decocms 4.155.6 → 4.157.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-B5EzHQ3T.js → AlertCircle-BVRdcAr7.js} +1 -1
- package/dist/client/assets/{AreaChart-Cim5jZe2.js → AreaChart-BZd2BMDX.js} +1 -1
- package/dist/client/assets/{ArrowUp-DP4--CRE.js → ArrowUp-CEnxQhJa.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-ClvhqYJg.js → ArrowUpRight-c4UbenX2.js} +1 -1
- package/dist/client/assets/{Check-B9fmDnkt.js → Check-PvwAFW5_.js} +1 -1
- package/dist/client/assets/{CheckCircle-DEOdfySb.js → CheckCircle-tNfHHzqR.js} +1 -1
- package/dist/client/assets/{ChevronDown-zcfJwool.js → ChevronDown-DhOhINAM.js} +1 -1
- package/dist/client/assets/{ChevronRight-Da7RLvlz.js → ChevronRight-Dia-WW4B.js} +1 -1
- package/dist/client/assets/{ChevronUp-D2nRl71d.js → ChevronUp-DYAPwS7D.js} +1 -1
- package/dist/client/assets/{Copy01-Br7jIcvA.js → Copy01-DxBV3dt3.js} +1 -1
- package/dist/client/assets/{CpuChip01-2vWRhh6j.js → CpuChip01-DnKRaqtj.js} +1 -1
- package/dist/client/assets/{DotsVertical-Da2a3Dvx.js → DotsVertical-CKorlk4R.js} +1 -1
- package/dist/client/assets/{Eye-fXYyMTJq.js → Eye-Bc6OKV-y.js} +1 -1
- package/dist/client/assets/{FilterLines-BzZQGPEM.js → FilterLines-DxJRwle6.js} +1 -1
- package/dist/client/assets/{HardDrive-DzJwZFDi.js → HardDrive-BiWDyH7C.js} +1 -1
- package/dist/client/assets/{Key01-ST4vByf3.js → Key01-Bmye11fH.js} +1 -1
- package/dist/client/assets/{LayoutLeft--DTq1lf3.js → LayoutLeft-Dn612JDh.js} +1 -1
- package/dist/client/assets/{LinkExternal01-ByF377Xd.js → LinkExternal01-BRfN9dRJ.js} +1 -1
- package/dist/client/assets/{LogOut01-DwUMYNzY.js → LogOut01-CHgz8ujG.js} +1 -1
- package/dist/client/assets/{Monitor01-DIl3Bjd2.js → Monitor01-8Zn_oQLH.js} +1 -1
- package/dist/client/assets/{Palette-BKSScrz_.js → Palette-CLRvU0eK.js} +1 -1
- package/dist/client/assets/{Play-DFvGhSpX.js → Play-GbRXM_X_.js} +1 -1
- package/dist/client/assets/{Plus-6GgajCWE.js → Plus-L2K4KGAP.js} +1 -1
- package/dist/client/assets/{SearchLg-BZRFwlcE.js → SearchLg-DD_M63q4.js} +1 -1
- package/dist/client/assets/{SearchMd-C-YQQRbK.js → SearchMd-DSheghKh.js} +1 -1
- package/dist/client/assets/{Settings02-T7YLgdWM.js → Settings02-CVwE6_LX.js} +1 -1
- package/dist/client/assets/{Shield01-CdlD5CJP.js → Shield01-BtLPYIWD.js} +1 -1
- package/dist/client/assets/{Star01-D8H53NVR.js → Star01-Bb-AArDe.js} +1 -1
- package/dist/client/assets/{Stars01-Re5gaAtU.js → Stars01-BabGpMQS.js} +1 -1
- package/dist/client/assets/{Stars02-CeRYgJCg.js → Stars02-CKPBAOIU.js} +1 -1
- package/dist/client/assets/{Sun-CwY5usNr.js → Sun-CvM5J-FW.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-xbOALVe_.js → SwitchHorizontal01-n8F4B6uE.js} +1 -1
- package/dist/client/assets/{Tool01-Dsz9WT2F.js → Tool01-DN0PeFAX.js} +1 -1
- package/dist/client/assets/{Tool02-DKdShLft.js → Tool02-RPFrSRbs.js} +1 -1
- package/dist/client/assets/{Trash01-DdGCAmvH.js → Trash01-DwKFwhTe.js} +1 -1
- package/dist/client/assets/{TrendUp01-Rwx5WUW7.js → TrendUp01-5fmO9zBH.js} +1 -1
- package/dist/client/assets/{Upload01-DdCDL_BX.js → Upload01-CEZ0vqHA.js} +1 -1
- package/dist/client/assets/{User01-DuIeQfhs.js → User01-CMegumei.js} +1 -1
- package/dist/client/assets/{Users01-BDDInj3j.js → Users01-C2x7fgEw.js} +1 -1
- package/dist/client/assets/{Users03-DXxBN50i.js → Users03-B_aCu_uX.js} +1 -1
- package/dist/client/assets/{X-7b-sSD2v.js → X-C9xR6k_q.js} +1 -1
- package/dist/client/assets/{XCircle-Cqp6M2Ri.js → XCircle-qIYKCuWZ.js} +1 -1
- package/dist/client/assets/{XClose-dqg_FLeN.js → XClose-D6PNomGP.js} +1 -1
- package/dist/client/assets/{Zap-Ds0z8JF5.js → Zap-BCvJyZqp.js} +1 -1
- package/dist/client/assets/{ZapSquare-jro4IGFj.js → ZapSquare-B_xZPtA0.js} +1 -1
- package/dist/client/assets/{access-gate-5LVYTmNO.js → access-gate-CgBkF5HO.js} +1 -1
- package/dist/client/assets/{add-section-modal-T8XdNxIf.js → add-section-modal-Bgum13n2.js} +1 -1
- package/dist/client/assets/{agent-icon-CVwazKeT.js → agent-icon-CtiUyn5V.js} +1 -1
- package/dist/client/assets/{agents-list-Dx--dpMc.js → agents-list-DHwxl85B.js} +1 -1
- package/dist/client/assets/{ai-providers-CCJtOJBY.js → ai-providers-BAOWMEQx.js} +1 -1
- package/dist/client/assets/{alert-u5n4es2L.js → alert-CgJLRqED.js} +1 -1
- package/dist/client/assets/{alert-dialog-CIsCwJLF.js → alert-dialog-Cy_KM5bI.js} +2 -2
- package/dist/client/assets/{app-editor-DJlRe5Qj.js → app-editor-BWRR4WKU.js} +1 -1
- package/dist/client/assets/{auth-CMEh2aKE.js → auth-B6wLv_ge.js} +1 -1
- package/dist/client/assets/{auth-catchall-DcLSwYza.js → auth-catchall-CK8jbGrb.js} +1 -1
- package/dist/client/assets/{auth-entry-B-hGbfhf.js → auth-entry-umz9GY8P.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DIn01YeS.js → auth-split-layout-CFi1gMlG.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Dc7nzZYd.js → authenticate-and-persist-oauth-UMzs9VZn.js} +1 -1
- package/dist/client/assets/{automation-list-row-CzBHL7O6.js → automation-list-row-CqpWerJJ.js} +1 -1
- package/dist/client/assets/{automation-runs-OIuxPUCu.js → automation-runs-D22hl0By.js} +72 -112
- package/dist/client/assets/{automations-C49OaMy2.js → automations-DEf3LLpY.js} +1 -1
- package/dist/client/assets/{avatar-BHLGt_46.js → avatar-DTq8LB7h.js} +1 -1
- package/dist/client/assets/{badge-Cd0M39Bu.js → badge-DCJPq-TC.js} +1 -1
- package/dist/client/assets/{block-document-Dd8M_1-u.js → block-document-DgfQnX34.js} +3 -3
- package/dist/client/assets/{brand-context-CYufvmAl.js → brand-context-JpMxWj1R.js} +1 -1
- package/dist/client/assets/{buckets-CbgCYstj.js → buckets-DaCkmXEf.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-CPd8oKFt.js → bulk-category-panel-Brm62LQU.js} +1 -1
- package/dist/client/assets/calendar-DiPJMbZr.js +142 -0
- package/dist/client/assets/{capability-load-error-pyghqnbM.js → capability-load-error-wbvMQZ3s.js} +1 -1
- package/dist/client/assets/{card-u5PNQDUW.js → card-CrBmylnL.js} +1 -1
- package/dist/client/assets/category-editor-DHxskdpJ.js +1 -0
- package/dist/client/assets/{chat-context-DCzWZrLz.js → chat-context-DQXfzeZ1.js} +1 -1
- package/dist/client/assets/{checkbox-CY1yI_Qw.js → checkbox-CCkUa9zL.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BVkwx5rw.js → cli-auth-success-C59WlVJX.js} +1 -1
- package/dist/client/assets/{collection-detail-C8WC100q.js → collection-detail-pmRAIQhn.js} +1 -1
- package/dist/client/assets/{collection-display-button-Dn_15bUR.js → collection-display-button-C3GUuD7t.js} +1 -1
- package/dist/client/assets/{collection-search-Cfa2VsMM.js → collection-search-CQ4hmVx6.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BR0F1Z2a.js → collection-table-wrapper-DWQTzM0N.js} +1 -1
- package/dist/client/assets/{collection-tabs-A-FQ9ciC.js → collection-tabs-BGGP3Q4Q.js} +1 -1
- package/dist/client/assets/{command-BWFUwrRD.js → command-Bw3jNeoH.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-m1N9zdZc.js → commerce-onboarding-DEK9436h.js} +1 -1
- package/dist/client/assets/{companions-core-Cx62iuxG.js → companions-core-Be1fT7Qa.js} +1 -1
- package/dist/client/assets/{connect-ChVHA_Cq.js → connect-CWFRWKGd.js} +1 -1
- package/dist/client/assets/{connection-HdW9nUoI.js → connection-DYDdJHYT.js} +1 -1
- package/dist/client/assets/{connection-card-5DsDh1pc.js → connection-card-rF4iZROi.js} +1 -1
- package/dist/client/assets/{connection-detail-DpzalBOD.js → connection-detail-B17jcN2-.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-D-E-0wAM.js → connection-form-helpers-BZGXkBOU.js} +1 -1
- package/dist/client/assets/{connections-CddmRYnO.js → connections-BwDvvI81.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DQ-QHafM.js → decopilot-sse-pool-dCMollnS.js} +1 -1
- package/dist/client/assets/{dialog-C9Y0JFmm.js → dialog-BEE2ieIv.js} +1 -1
- package/dist/client/assets/{domain-settings-CSaQNWcT.js → domain-settings-DfyYMoAI.js} +1 -1
- package/dist/client/assets/{drawer-B87EWS0a.js → drawer-D_zlJSIa.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DM50AQFT.js → dropdown-menu-CScom-4o.js} +1 -1
- package/dist/client/assets/{empty-state-CT8CVS2g.js → empty-state-BW9CnFTA.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CXwOVGvM.js → extract-connection-data-CQ3H7X46.js} +1 -1
- package/dist/client/assets/{file-explorer-boGufn0U.js → file-explorer-DPUaYjU-.js} +2 -2
- package/dist/client/assets/{form-Dq7OxJjL.js → form-BBxBIdP7.js} +1 -1
- package/dist/client/assets/{general-97imiaC2.js → general-CtJ3KRAc.js} +1 -1
- package/dist/client/assets/{github-repo-picker-D8h3_SIG.js → github-repo-picker-_fOGWT5B.js} +1 -1
- package/dist/client/assets/{hooks-CdHw7kBQ.js → hooks-D2DXSkUb.js} +1 -1
- package/dist/client/assets/{index-DT0SFO0-.js → index-BYebWbkH.js} +1 -1
- package/dist/client/assets/index-CYhSS9zf.css +1 -0
- package/dist/client/assets/{index-Bkp-7etC.js → index-CZrBPeSF.js} +41 -41
- package/dist/client/assets/index-Ck4HNDeL.js +77 -0
- package/dist/client/assets/index-CwBzuD_m.js +663 -0
- package/dist/client/assets/{index-Davc1Spm.js → index-DTrEhN5C.js} +1 -1
- package/dist/client/assets/{index-_w4PVSAs.js → index-DrIBFZ81.js} +2 -2
- package/dist/client/assets/{index-ke5Y-j-X.js → index-FLb6-l5J.js} +1 -1
- package/dist/client/assets/{index-BelI0bV9.js → index-L22QcARJ.js} +1 -1
- package/dist/client/assets/{index-BrGCgrXI.js → index-NKgRHLP_.js} +1 -1
- package/dist/client/assets/{index-GoB4Xm4I.js → index-dQDZUsRB.js} +1 -1
- package/dist/client/assets/{index-redirect-G3ZHS5dR.js → index-redirect-B8BYdzj2.js} +1 -1
- package/dist/client/assets/{index-CCOn6TVf.js → index-u4kSn-Ka.js} +1 -1
- package/dist/client/assets/{input-BUlb65w4.js → input-DfW0n64T.js} +1 -1
- package/dist/client/assets/{integration-icon-BqeZ81Ki.js → integration-icon-BriL0gdd.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-DRgdq1e6.js → invite-member-dialog-C1b9xa_q.js} +1 -1
- package/dist/client/assets/{label-Brue7KkY.js → label-u1FnGPif.js} +1 -1
- package/dist/client/assets/{layout-DomeuX52.js → layout-91MOct-x.js} +1 -1
- package/dist/client/assets/{login-C_NR0MWw.js → login-ComSuoop.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BS8oJHLa.js → mcp-oauth-BNg8UA_R.js} +1 -1
- package/dist/client/assets/{members-BbLp1GTX.js → members-BVot0E3a.js} +1 -1
- package/dist/client/assets/{monaco-editor-DKGZY7KB.js → monaco-editor-Cq8a3e0Q.js} +4 -4
- package/dist/client/assets/{monitoring-stats-row-DAsEBsoX.js → monitoring-stats-row-7EEfSN_H.js} +1 -1
- package/dist/client/assets/{multi-select-BOJyCVSz.js → multi-select-B_LPMXUc.js} +1 -1
- package/dist/client/assets/{oauth-callback-CYwQ0NJe.js → oauth-callback-BJNIPi5Z.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BdT7AP9B.js → oauth-callback-ai-provider-sBE6HXoD.js} +1 -1
- package/dist/client/assets/{onboarding-DdV1PqwL.js → onboarding-rMKgR3te.js} +1 -1
- package/dist/client/assets/{org-layout-DeM4TcX_.js → org-layout-FWtpNVPK.js} +1 -1
- package/dist/client/assets/{organization-choice-D_l6xRyU.js → organization-choice-Ds2qQKu8.js} +1 -1
- package/dist/client/assets/{orgs-DYeysyR3.js → orgs-CNBDLBm5.js} +1 -1
- package/dist/client/assets/{page-seo-form-CG3lFTHB.js → page-seo-form-BnD0FsnZ.js} +1 -1
- package/dist/client/assets/{popover-zo9vhm7M.js → popover-AjzmM7C7.js} +1 -1
- package/dist/client/assets/{post-editor-Bsog7W5j.js → post-editor-DVGbQJGA.js} +1 -1
- package/dist/client/assets/{primitives-B_eXmfpN.js → primitives-BORxjSOf.js} +1 -1
- package/dist/client/assets/{profile-BhfUXlIO.js → profile-B3tCocQY.js} +1 -1
- package/dist/client/assets/project-app-view-CboRisYT.js +1 -0
- package/dist/client/assets/record-editor-DKjGmqDW.js +1 -0
- package/dist/client/assets/{redirect-editor-Bqrb2WOt.js → redirect-editor-DQqTPtyS.js} +1 -1
- package/dist/client/assets/registry-BlxkoTJz.js +2 -0
- package/dist/client/assets/{registry-layout-CbxeqJM8.js → registry-layout-CQpVcGyd.js} +1 -1
- package/dist/client/assets/{reports-BUTkqxe8.js → reports-B7bHou75.js} +1 -1
- package/dist/client/assets/{require-capability-Bsvyei9e.js → require-capability-BWp_ugtq.js} +1 -1
- package/dist/client/assets/{required-auth-layout-H-bvovJA.js → required-auth-layout-CX-j8fcs.js} +1 -1
- package/dist/client/assets/{reset-password-ClLsmOeS.js → reset-password-B_mSf-fh.js} +1 -1
- package/dist/client/assets/{roles-By7p5If3.js → roles-CbO21DnZ.js} +1 -1
- package/dist/client/assets/{search-input-ChwfOLYJ.js → search-input-B6b2ZnBA.js} +1 -1
- package/dist/client/assets/{secrets-DjsgHCD1.js → secrets-DHRDRmvb.js} +1 -1
- package/dist/client/assets/{sections-editor-BblWdGv0.js → sections-editor-2UGRHd2L.js} +2 -2
- package/dist/client/assets/{select-model-CB-EK_HF.js → select-model-DLYysGmM.js} +1 -1
- package/dist/client/assets/{select-DxMLbuxt.js → select-n4tYtSWP.js} +1 -1
- package/dist/client/assets/{self-tool-result-CQ3n1tli.js → self-tool-result-9g5XXNrJ.js} +1 -1
- package/dist/client/assets/{seo-editor-Cq75T14m.js → seo-editor-Dp4dSKcE.js} +1 -1
- package/dist/client/assets/{settings-layout-DOno7DP_.js → settings-layout-DB_Q64RJ.js} +1 -1
- package/dist/client/assets/{settings-section-6sUHyPiZ.js → settings-section-B4sxMatG.js} +1 -1
- package/dist/client/assets/{shell-controls-DZYpPQkf.js → shell-controls-zZvgboKB.js} +1 -1
- package/dist/client/assets/{shell-layout-B5roAZO2.js → shell-layout-BLNXlEs8.js} +1 -1
- package/dist/client/assets/{sidebar-imulaJzp.js → sidebar-BTOMGewK.js} +1 -1
- package/dist/client/assets/{skeleton-QmnG1Nm5.js → skeleton-BSh29Pqn.js} +1 -1
- package/dist/client/assets/{spinner-nEloco4D.js → spinner-BruVqM08.js} +1 -1
- package/dist/client/assets/{sso-DUQtbRl2.js → sso-CkQZtYP5.js} +1 -1
- package/dist/client/assets/{store-9yvhohCQ.js → store-Dura68P-.js} +1 -1
- package/dist/client/assets/store-registry-Cpq2Y3v7.js +2 -0
- package/dist/client/assets/{studio-tools-DWNBPKxz.js → studio-tools-DZ4A4LK4.js} +1 -1
- package/dist/client/assets/{switch-HRiVgJhy.js → switch-Capnufwf.js} +1 -1
- package/dist/client/assets/{tab-id-oTaKG_NF.js → tab-id-TIvCa4AH.js} +1 -1
- package/dist/client/assets/{table-7XciIyJ8.js → table-BhXfGt_D.js} +1 -1
- package/dist/client/assets/{tabs-Dc7iBqjc.js → tabs-CmlSCOKE.js} +1 -1
- package/dist/client/assets/{textarea-BbqkJA0A.js → textarea-CzJQ4jof.js} +1 -1
- package/dist/client/assets/{toggle-group-CqDuHyMB.js → toggle-group-DJogx7Sw.js} +1 -1
- package/dist/client/assets/{toolbar-16OORO9B.js → toolbar-4Xs9gQqE.js} +1 -1
- package/dist/client/assets/{tooltip-CALKScQe.js → tooltip-DlGzqhnP.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BRjohUtF.js → use-ai-providers-CIIrncdr.js} +1 -1
- package/dist/client/assets/{use-automations-CWBUKr70.js → use-automations-oR1lkik8.js} +1 -1
- package/dist/client/assets/{use-autosave-IYEJiv_p.js → use-autosave-B62TGEph.js} +1 -1
- package/dist/client/assets/{use-capability-Bn00p9kX.js → use-capability-D8lE65Qq.js} +1 -1
- package/dist/client/assets/{use-clock-tick-D-wa1z0F.js → use-clock-tick-CV-pJYBs.js} +1 -1
- package/dist/client/assets/{use-connection-C9DNXZf8.js → use-connection-BzoGO_rZ.js} +1 -1
- package/dist/client/assets/{use-copy-Dc0x9EjL.js → use-copy-CUMl3QMe.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DLdO94ug.js → use-create-virtual-mcp-CtHfYunD.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BZs3xF3G.js → use-debounced-autosave-6rt-rF4t.js} +1 -1
- package/dist/client/assets/{use-debounced-value-D8WagtLE.js → use-debounced-value-CXreFFvV.js} +1 -1
- package/dist/client/assets/{use-deco-credits-B5bl8N1q.js → use-deco-credits-CRRWJZpL.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DIUqvtu8.js → use-decopilot-events-BQ6ItOFo.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CL0lmITt.js → use-delete-connection-D7g881JG.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CAbydMvM.js → use-deployment-admin-Cei02Kx3.js} +1 -1
- package/dist/client/assets/{use-file-configs-DzVPSKzj.js → use-file-configs-CfPB3s7t.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Buw_04KT.js → use-infinite-scroll-BIsiRuqk.js} +1 -1
- package/dist/client/assets/{use-join-requests-DsC9NI-V.js → use-join-requests-Dv3eHJh5.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-B6YMPvU5.js → use-mcp-auth-status-2CuEn9Ao.js} +1 -1
- package/dist/client/assets/{use-mcp-client-0Sy8SV6j.js → use-mcp-client-C-LnBBuJ.js} +2 -2
- package/dist/client/assets/{use-mcp-tools-DWFksO0x.js → use-mcp-tools-BxFrq8sY.js} +1 -1
- package/dist/client/assets/{use-members-er-r_ZhJ.js → use-members-6mtN34eU.js} +1 -1
- package/dist/client/assets/{use-mobile-eFYyqfBg.js → use-mobile-hjfr3xoA.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DJEYuQnn.js → use-navigate-to-agent-DLULuM6_.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-UnJp9S-D.js → use-org-auth-client-Dd2A-3_W.js} +1 -1
- package/dist/client/assets/{use-org-sso-BXzPwxrA.js → use-org-sso-mDWe3mwz.js} +1 -1
- package/dist/client/assets/{use-organization-roles-gpEH8wFF.js → use-organization-roles-UFDl0kli.js} +1 -1
- package/dist/client/assets/{use-organization-settings-B9xB5uId.js → use-organization-settings-VTvhO8RM.js} +1 -1
- package/dist/client/assets/{use-registry-connections-eY-OZABr.js → use-registry-connections-6V_OOVJn.js} +1 -1
- package/dist/client/assets/{use-secrets-pesED1b4.js → use-secrets-C3APoSVc.js} +1 -1
- package/dist/client/assets/{use-status-sounds-B5j_4eaS.js → use-status-sounds-0NlGQGcq.js} +1 -1
- package/dist/client/assets/{use-tags-GyT5QweE.js → use-tags-CNwvMQjY.js} +1 -1
- package/dist/client/assets/{use-view-mode-59fH0Uy0.js → use-view-mode-DasG8IDi.js} +1 -1
- package/dist/client/assets/use-virtual-mcp-333MNW6F.js +1 -0
- package/dist/client/assets/useInfiniteQuery-jDP8kOiZ.js +1 -0
- package/dist/client/assets/{useQueries-C23P6xV0.js → useQueries-CJIQxjbc.js} +1 -1
- package/dist/client/assets/{useRouterState-BZABTJgG.js → useRouterState-k_6bFC93.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BKk4QAmj.js +1 -0
- package/dist/client/assets/{users-DJ1RT6jP.js → users-Dx28SD_Z.js} +1 -1
- package/dist/client/assets/{variant-calendar-Cszv_F1h.js → variant-calendar-4-b9myOJ.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-NMPZ55VF.js → view-mode-toggle-CwXiquMd.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/calendar-D4pekYHk.js +0 -102
- package/dist/client/assets/category-editor-C_4PGhcn.js +0 -1
- package/dist/client/assets/index-B5jBvolo.css +0 -1
- package/dist/client/assets/index-DSLPSI9k.js +0 -663
- package/dist/client/assets/index-jX9vv4ej.js +0 -12
- package/dist/client/assets/project-app-view-Bdt0NsjQ.js +0 -1
- package/dist/client/assets/record-editor-BGx0Y6nL.js +0 -1
- package/dist/client/assets/registry-2nh66Nd_.js +0 -2
- package/dist/client/assets/store-registry-D6uAhMYw.js +0 -2
- package/dist/client/assets/use-virtual-mcp-DrdIacUa.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BJleB0BU.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-6fCBD_Yx.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as Ue,b as ct,r as w,m as Oe,j as n,af as Yn,B as Qe,k as Jn,o as Na,t as X,K as Da}from"./index-Bkp-7etC.js";import{a9 as Ta,aa as Pa,ab as Aa,ac as Qn,ad as Xn,ae as Ca,af as Ma,ag as Ka,N as La,ah as Fa,ai as Ct,aj as Ba,S as Zn,ak as lt,al as Oa,am as Ia,an as $a,ao as za,D as Ha,F as Ga,ap as Ua,aq as Wa,ar as qa,as as Ya,a3 as Gt,at as Ut,au as Ja,av as bt,aw as Tt,ax as Qa,ay as Xa,az as tt,aA as Mn,aB as Za,aC as Pt,aD as Wt,aE as eo,aF as dn,aG as to,aH as wt,aI as no,aJ as so,aK as ao,aL as oo,aM as ro,aN as xt,aO as io,aP as lo,aQ as co,H as uo,aR as Kn,aS as At,aT as Ln,aU as Fn,aV as mo,aW as fo,aX as po,aY as go,aZ as mn,a_ as Bn,a$ as On,b0 as Vt,b1 as qt,b2 as In,b3 as ho,b4 as fn,b5 as vo,b6 as So,b7 as bo,b8 as xo,b9 as yo}from"./index-DSLPSI9k.js";import{t as _o}from"./ChevronDown-zcfJwool.js";import{a4 as gn,y as jo,Y as es,J as Eo,x as ts,a6 as ko,a7 as Ro}from"./agent-icon-CVwazKeT.js";import{i as ns}from"./ChevronRight-Da7RLvlz.js";import{n as wo}from"./ChevronUp-D2nRl71d.js";import{i as Vo}from"./Tool02-DKdShLft.js";import{n as Yt}from"./automation-runs-OIuxPUCu.js";import{c as yt,T as _t,a as jt}from"./tooltip-CALKScQe.js";import{b as No,h as Do,a as To,c as Po,d as Ao,e as Co}from"./dialog-C9Y0JFmm.js";import{I as Mo}from"./input-BUlb65w4.js";import{a as ss}from"./Copy01-Br7jIcvA.js";import{i as Ko}from"./Settings02-T7YLgdWM.js";import{s as Lo}from"./Eye-fXYyMTJq.js";import{s as as}from"./TrendUp01-Rwx5WUW7.js";import{s as hn}from"./Plus-6GgajCWE.js";import{s as os}from"./Trash01-DdGCAmvH.js";import{i as Fo}from"./Zap-Ds0z8JF5.js";import{a as ht,D as rs,b as is,c as ls,i as Bo}from"./dropdown-menu-DM50AQFT.js";import{g as cs,h as Jt,K as us,P as ds,j as ms,o as fs,C as ps,s as gs,p as Mt,D as hs,m as vs,n as Ss,v as bs}from"./index-jX9vv4ej.js";import{S as Oo,r as $n,u as Io,d as $o,a as zo,i as Ho,f as Go,P as Uo,b as Wo}from"./page-seo-form-CG3lFTHB.js";import{c as qo}from"./Tool01-Dsz9WT2F.js";import{A as Yo}from"./add-section-modal-T8XdNxIf.js";import"./ArrowUp-DP4--CRE.js";import"./chat-context-DCzWZrLz.js";import"./tab-id-oTaKG_NF.js";import"./Check-B9fmDnkt.js";import"./hooks-CdHw7kBQ.js";import"./use-mcp-client-0Sy8SV6j.js";import"./auth-CMEh2aKE.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-DQ-QHafM.js";import"./studio-tools-DWNBPKxz.js";import"./use-virtual-mcp-DrdIacUa.js";import"./use-ai-providers-BRjohUtF.js";import"./use-decopilot-events-DIUqvtu8.js";import"./use-organization-settings-B9xB5uId.js";import"./spinner-nEloco4D.js";import"./drawer-B87EWS0a.js";import"./collection-search-Cfa2VsMM.js";import"./SearchMd-C-YQQRbK.js";import"./use-mobile-eFYyqfBg.js";import"./AreaChart-Cim5jZe2.js";import"./index-BelI0bV9.js";import"./calendar-D4pekYHk.js";import"./X-7b-sSD2v.js";import"./shell-layout-B5roAZO2.js";import"./avatar-BHLGt_46.js";import"./User01-DuIeQfhs.js";import"./Users03-DXxBN50i.js";import"./SearchLg-BZRFwlcE.js";import"./Stars02-CeRYgJCg.js";import"./XClose-dqg_FLeN.js";import"./CheckCircle-DEOdfySb.js";import"./CpuChip01-2vWRhh6j.js";import"./FilterLines-BzZQGPEM.js";import"./Monitor01-DIl3Bjd2.js";import"./use-is-desktop-app-BNujXJc_.js";import"./required-auth-layout-H-bvovJA.js";import"./use-org-sso-BXzPwxrA.js";import"./ZapSquare-jro4IGFj.js";import"./Star01-D8H53NVR.js";import"./Upload01-DdCDL_BX.js";import"./AlertCircle-B5EzHQ3T.js";import"./form-Dq7OxJjL.js";import"./label-Brue7KkY.js";import"./select-DxMLbuxt.js";import"./XCircle-Cqp6M2Ri.js";import"./tabs-Dc7iBqjc.js";import"./toggle-group-CqDuHyMB.js";import"./use-deco-credits-B5bl8N1q.js";import"./sidebar-imulaJzp.js";import"./LayoutLeft--DTq1lf3.js";import"./popover-zo9vhm7M.js";import"./alert-dialog-CIsCwJLF.js";import"./toolbar-16OORO9B.js";import"./skeleton-QmnG1Nm5.js";import"./github-repo-picker-D8h3_SIG.js";import"./use-debounced-value-D8WagtLE.js";import"./use-connection-C9DNXZf8.js";import"./authenticate-and-persist-oauth-Dc7nzZYd.js";import"./mcp-oauth-BS8oJHLa.js";import"./LinkExternal01-ByF377Xd.js";import"./use-mcp-tools-DWFksO0x.js";import"./extract-connection-data-CXwOVGvM.js";import"./metadata-dUsYcpuu.js";import"./use-navigate-to-agent-DJEYuQnn.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-C2RHf8fG.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-5DsDh1pc.js";import"./use-registry-connections-eY-OZABr.js";import"./useInfiniteQuery-BJleB0BU.js";import"./use-infinite-scroll-Buw_04KT.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-u5PNQDUW.js";import"./integration-icon-BqeZ81Ki.js";import"./textarea-BbqkJA0A.js";import"./connection-form-helpers-D-E-0wAM.js";import"./collection-tabs-A-FQ9ciC.js";import"./badge-Cd0M39Bu.js";import"./useSuspenseInfiniteQuery-6fCBD_Yx.js";import"./select-model-CB-EK_HF.js";import"./checkbox-CY1yI_Qw.js";import"./Key01-ST4vByf3.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-6sUHyPiZ.js";import"./ArrowUpRight-ClvhqYJg.js";import"./Stars01-Re5gaAtU.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-B5j_4eaS.js";import"./empty-state-CT8CVS2g.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-Bn00p9kX.js";import"./monaco-editor-DKGZY7KB.js";import"./pt-BR-CLy76QW2.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-mcp-auth-status-B6YMPvU5.js";import"./DotsVertical-Da2a3Dvx.js";import"./Play-DFvGhSpX.js";import"./use-debounced-autosave-BZs3xF3G.js";import"./index-BrGCgrXI.js";import"./search-input-ChwfOLYJ.js";import"./switch-HRiVgJhy.js";import"./Users01-BDDInj3j.js";import"./use-secrets-pesED1b4.js";import"./format-time-BnbuEtat.js";import"./use-members-er-r_ZhJ.js";import"./use-org-auth-client-UnJp9S-D.js";import"./command-BWFUwrRD.js";import"./index-Davc1Spm.js";import"./useQueries-C23P6xV0.js";import"./SwitchHorizontal01-xbOALVe_.js";import"./use-file-configs-DzVPSKzj.js";import"./use-automations-CWBUKr70.js";import"./automation-list-row-CzBHL7O6.js";import"./Palette-BKSScrz_.js";import"./get-initials-D-f_fDFw.js";import"./HardDrive-DzJwZFDi.js";import"./LogOut01-DwUMYNzY.js";import"./Sun-CwY5usNr.js";import"./Shield01-CdlD5CJP.js";import"./table-7XciIyJ8.js";import"./use-clock-tick-D-wa1z0F.js";import"./use-copy-Dc0x9EjL.js";import"./use-tags-GyT5QweE.js";import"./companions-core-Cx62iuxG.js";function Jo(h){return h.schema?.definitions??h.schema?.$defs??{}}function Qo(h,e){const o=Jo(e),d=o[btoa(h)];if(!d)return;let m=typeof d.image=="string"?d.image:void 0;if(!m&&Array.isArray(d.allOf)){const b=d.allOf.find(x=>typeof x.$ref=="string")?.$ref;if(typeof b=="string"){const x=b.replace("#/definitions/",""),f=o[x];m=typeof f?.image=="string"?f.image:void 0}}if(m?.includes("{{{"))return m}function Xo(h,e){if(!e)return;const o=Ta(h);if(!o)return;const d=Qo(o.resolveType,e);if(!d)return;const m=Pa(d,o.data);if(m)return Aa(m)}const Zo="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",er="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function zn(h){return Array.from({length:h},(e,o)=>({id:crypto.randomUUID(),index:o}))}function xs(h){return h.map((e,o)=>({...e,index:o}))}function tr(h,e){if(e===h.length)return h;if(e<h.length)return xs(h.slice(0,e));const o=Array.from({length:e-h.length},(d,m)=>({id:crypto.randomUUID(),index:h.length+m}));return[...h,...o]}function ys(h){const e=Ue.c(20),{section:o,raw:d,meta:m}=h,b=o.isSavedBlock===!0,x=o.isMultivariate===!0;let f;e[0]!==m||e[1]!==d?(f=d&&m?Xo(d,m):void 0,e[0]=m,e[1]=d,e[2]=f):f=e[2];const v=f;let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(jo,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=u):u=e[3];let y;e[4]!==v?(y=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=y):y=e[5];let k;e[6]!==x||e[7]!==b?(k=b?{color:La}:x?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=x,e[7]=b,e[8]=k):k=e[8];let D;e[9]!==k?(D=n.jsx(gn,{className:"h-4 w-4 shrink-0",style:k}),e[9]=k,e[10]=D):D=e[10];const E=o.isHidden&&"line-through opacity-50";let i;e[11]!==E?(i=Oe("min-w-0 flex-1 truncate text-sm font-medium",E),e[11]=E,e[12]=i):i=e[12];let g;e[13]!==o.label||e[14]!==i?(g=n.jsx("span",{className:i,children:o.label}),e[13]=o.label,e[14]=i,e[15]=g):g=e[15];let r;return e[16]!==y||e[17]!==D||e[18]!==g?(r=n.jsxs(n.Fragment,{children:[u,y,D,g]}),e[16]=y,e[17]=D,e[18]=g,e[19]=r):r=e[19],r}function _s(h,e){const o=h.isSavedBlock===!0,d=h.isMultivariate===!0;return Oe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?Zo:d?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function nr(h){const e=Ue.c(81),{section:o,raw:d,meta:m,sortableId:b,selected:x,onSelect:f,onDelete:v,onDuplicate:u,onMakeReusable:y,onToggleHidden:k,onToggleLazy:D,onAddVariant:E,onDetach:i}=h,g=ct(),r=d?Xn(d.__resolveType??""):!1;let A;e[0]!==o?(A=Ca(o),e[0]=o,e[1]=A):A=e[1];const l=A;let R;e[2]!==b?(R={id:b,animateLayoutChanges:ir},e[2]=b,e[3]=R):R=e[3];const{attributes:K,listeners:z,setNodeRef:p,transform:N,isDragging:ie}=fs(R);let L;e[4]!==N?(L=ps.Transform.toString(N?{...N,x:0}:null),e[4]=N,e[5]=L):L=e[5];const ce=ie?0:void 0;let M;e[6]!==L||e[7]!==ce?(M={transform:L,opacity:ce},e[6]=L,e[7]=ce,e[8]=M):M=e[8];const ge=M;let O;e[9]!==o?(O=Ma(o),e[9]=o,e[10]=O):O=e[10];const ne=O,he="button",me=0;let I;e[11]!==f?(I=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),f())},e[11]=f,e[12]=I):I=e[12];const J=ie?"cursor-grabbing":"cursor-pointer";let Z;e[13]!==o||e[14]!==x||e[15]!==J?(Z=Oe("touch-none transition-colors",J,_s(o,x)),e[13]=o,e[14]=x,e[15]=J,e[16]=Z):Z=e[16];let ee;e[17]!==m||e[18]!==d||e[19]!==o?(ee=n.jsx(ys,{section:o,raw:d,meta:m}),e[17]=m,e[18]=d,e[19]=o,e[20]=ee):ee=e[20];const $=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":g(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Oe("h-7 w-7 shrink-0",r?"":"opacity-0 group-hover:opacity-100"),onClick:T=>{T.stopPropagation(),D()},onPointerDown:rr,children:n.jsx(Fo,{className:Oe("h-3.5 w-3.5",r&&"text-yellow-500")})})}),n.jsx(jt,{side:"bottom",children:g(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]});let Ae;e[21]!==k||e[22]!==o.isHidden||e[23]!==o.isMultivariate||e[24]!==g?(Ae=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":o.isHidden?g("sectionsEditor.sectionList.showSection"):g("sectionsEditor.sectionList.hideSection"),className:Oe("h-7 w-7 shrink-0",o.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:T=>{T.stopPropagation(),k()},onPointerDown:or,children:o.isHidden?n.jsx(Ko,{className:"h-3.5 w-3.5"}):n.jsx(Lo,{className:"h-3.5 w-3.5"})})}),n.jsx(jt,{side:"bottom",children:o.isHidden?g("sectionsEditor.sectionList.showSection"):g("sectionsEditor.sectionList.hideSection")})]}),e[21]=k,e[22]=o.isHidden,e[23]=o.isMultivariate,e[24]=g,e[25]=Ae):Ae=e[25];let Me;e[26]!==g?(Me=g("sectionsEditor.sectionList.sectionActionsMenu"),e[26]=g,e[27]=Me):Me=e[27];let et;e[28]===Symbol.for("react.memo_cache_sentinel")?(et=n.jsx(es,{className:"h-3.5 w-3.5"}),e[28]=et):et=e[28];let Se;e[29]!==Me?(Se=n.jsx(rs,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":Me,className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:ar,onPointerDown:sr,children:et})}),e[29]=Me,e[30]=Se):Se=e[30];let H;e[31]!==u?(H=T=>{T.stopPropagation(),u()},e[31]=u,e[32]=H):H=e[32];let se;e[33]===Symbol.for("react.memo_cache_sentinel")?(se=n.jsx(ss,{className:"h-4 w-4"}),e[33]=se):se=e[33];let ae;e[34]!==g?(ae=g("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=g,e[35]=ae):ae=e[35];let ue;e[36]!==H||e[37]!==ae?(ue=n.jsxs(ht,{onClick:H,children:[se,ae]}),e[36]=H,e[37]=ae,e[38]=ue):ue=e[38];let oe;e[39]!==l||e[40]!==E||e[41]!==g?(oe=l&&n.jsxs(ht,{className:Ka,onClick:T=>{T.stopPropagation(),E()},children:[n.jsx(as,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=l,e[40]=E,e[41]=g,e[42]=oe):oe=e[42];let de;e[43]!==ne||e[44]!==y||e[45]!==g?(de=ne&&n.jsxs(ht,{className:er,onClick:T=>{T.stopPropagation(),y()},children:[n.jsx(gn,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=ne,e[44]=y,e[45]=g,e[46]=de):de=e[46];let le;e[47]!==i||e[48]!==o.isMultivariate||e[49]!==o.isSavedBlock||e[50]!==g?(le=o.isSavedBlock===!0&&!o.isMultivariate&&n.jsxs(ht,{onClick:T=>{T.stopPropagation(),i()},children:[n.jsx(gn,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=i,e[48]=o.isMultivariate,e[49]=o.isSavedBlock,e[50]=g,e[51]=le):le=e[51];let fe;e[52]!==v?(fe=T=>{T.stopPropagation(),v()},e[52]=v,e[53]=fe):fe=e[53];let De;e[54]===Symbol.for("react.memo_cache_sentinel")?(De=n.jsx(os,{className:"h-4 w-4"}),e[54]=De):De=e[54];let je;e[55]!==g?(je=g("sectionsEditor.sectionList.deleteMenuItem"),e[55]=g,e[56]=je):je=e[56];let re;e[57]!==fe||e[58]!==je?(re=n.jsxs(ht,{className:"text-destructive focus:text-destructive",onClick:fe,children:[De,je]}),e[57]=fe,e[58]=je,e[59]=re):re=e[59];let pe;e[60]!==ue||e[61]!==oe||e[62]!==de||e[63]!==le||e[64]!==re?(pe=n.jsxs(is,{align:"end",className:"w-44",children:[ue,oe,de,le,re]}),e[60]=ue,e[61]=oe,e[62]=de,e[63]=le,e[64]=re,e[65]=pe):pe=e[65];let be;e[66]!==Se||e[67]!==pe?(be=n.jsxs(ls,{children:[Se,pe]}),e[66]=Se,e[67]=pe,e[68]=be):be=e[68];let xe;return e[69]!==K||e[70]!==z||e[71]!==f||e[72]!==p||e[73]!==ge||e[74]!==Z||e[75]!==ee||e[76]!==$||e[77]!==Ae||e[78]!==be||e[79]!==I?(xe=n.jsxs("div",{ref:p,style:ge,...K,...z,role:he,tabIndex:me,onClick:f,onKeyDown:I,className:Z,children:[ee,$,Ae,be]}),e[69]=K,e[70]=z,e[71]=f,e[72]=p,e[73]=ge,e[74]=Z,e[75]=ee,e[76]=$,e[77]=Ae,e[78]=be,e[79]=I,e[80]=xe):xe=e[80],xe}function sr(h){return h.stopPropagation()}function ar(h){return h.stopPropagation()}function or(h){return h.stopPropagation()}function rr(h){return h.stopPropagation()}function ir(){return!1}function lr(h){const e=Ue.c(104),{listKey:o,rawSections:d,sections:m,meta:b,selectedIndex:x,onSelect:f,onReorder:v,onDelete:u,onDuplicate:y,onMakeReusable:k,onToggleHidden:D,onToggleLazy:E,onAddVariant:i,onDetach:g,onAddSection:r,canAddSection:A}=h,l=A===void 0?!0:A,R=ct();let K;e[0]!==m.length?(K=()=>zn(m.length),e[0]=m.length,e[1]=K):K=e[1];const[z,p]=w.useState(K),[N,ie]=w.useState(null),[L,ce]=w.useState(o),[M,ge]=w.useState(m.length),O=w.useRef(!1);L!==o?(ce(o),ge(m.length),p(zn(m.length))):M!==m.length&&(ge(m.length),p(ze=>tr(ze,m.length)));let ne;e[2]===Symbol.for("react.memo_cache_sentinel")?(ne={activationConstraint:{distance:8}},e[2]=ne):ne=e[2];let he;e[3]===Symbol.for("react.memo_cache_sentinel")?(he={coordinateGetter:gs},e[3]=he):he=e[3];const me=cs(Jt(ds,ne),Jt(us,he));let I;e[4]!==z?(I=z.map(cr),e[4]=z,e[5]=I):I=e[5];const J=I;let Z;e[6]===Symbol.for("react.memo_cache_sentinel")?(Z=ze=>{ie(String(ze.active.id))},e[6]=Z):Z=e[6];const ee=Z;let $;e[7]!==J||e[8]!==v?($=ze=>{ie(null);const{active:F,over:B}=ze;if(!B||F.id===B.id)return;const G=J.indexOf(String(F.id)),nt=J.indexOf(String(B.id));G===-1||nt===-1||(p(Re=>xs(Mt([...Re],G,nt))),O.current=!0,requestAnimationFrame(()=>{O.current=!1}),v?.(G,nt))},e[7]=J,e[8]=v,e[9]=$):$=e[9];const Ae=$;let Me;e[10]===Symbol.for("react.memo_cache_sentinel")?(Me=()=>{ie(null)},e[10]=Me):Me=e[10];const et=Me;let Se,H,se,ae,ue,oe,de,le,fe,De,je,re,pe,be,xe;if(e[11]!==N||e[12]!==l||e[13]!==z||e[14]!==J||e[15]!==Ae||e[16]!==b||e[17]!==r||e[18]!==i||e[19]!==u||e[20]!==g||e[21]!==y||e[22]!==k||e[23]!==f||e[24]!==D||e[25]!==E||e[26]!==d||e[27]!==m||e[28]!==x||e[29]!==me||e[30]!==R){be=Symbol.for("react.early_return_sentinel");e:{const ze=F=>{O.current||f(F)};if(e[46]!==N||e[47]!==l||e[48]!==z||e[49]!==r||e[50]!==d||e[51]!==m||e[52]!==R){const F=N?z.find(B=>B.id===N):null;if(ae=F!=null?m[F.index]:null,se=F!=null?d[F.index]:void 0,z.length===0){let B;e[56]!==R?(B=R("sectionsEditor.sectionList.noSections"),e[56]=R,e[57]=B):B=e[57];let G;e[58]!==B?(G=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:B}),e[58]=B,e[59]=G):G=e[59];const nt=!l;let Re;e[60]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(hn,{size:14}),e[60]=Re):Re=e[60];let We;e[61]!==R?(We=R("sectionsEditor.sectionList.addSectionButton"),e[61]=R,e[62]=We):We=e[62];let Ne;e[63]!==r||e[64]!==nt||e[65]!==We?(Ne=n.jsxs(Qe,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:nt,onClick:r,children:[Re,We]}),e[63]=r,e[64]=nt,e[65]=We,e[66]=Ne):Ne=e[66];let vt;e[67]!==G||e[68]!==Ne?(vt=n.jsxs("div",{className:"space-y-2",children:[G,Ne]}),e[67]=G,e[68]=Ne,e[69]=vt):vt=e[69],be=vt;break e}pe=Oe(F&&"cursor-grabbing"),e[46]=N,e[47]=l,e[48]=z,e[49]=r,e[50]=d,e[51]=m,e[52]=R,e[53]=se,e[54]=ae,e[55]=pe}else se=e[53],ae=e[54],pe=e[55];H=hs,le=me,fe=vs,De=ee,je=Ae,re=et,Se=Ss,oe=J,de=bs,xe="space-y-1",ue=z.map(F=>{const B=m[F.index];return B?n.jsx(nr,{sortableId:F.id,section:B,raw:d[F.index],meta:b,selected:x===F.index,onSelect:()=>ze(F.index),onDelete:()=>u(F.index),onDuplicate:()=>y(F.index),onMakeReusable:()=>k(F.index),onToggleHidden:()=>D(F.index),onToggleLazy:()=>E(F.index),onAddVariant:()=>i(F.index),onDetach:()=>g(F.index)},F.id):null})}e[11]=N,e[12]=l,e[13]=z,e[14]=J,e[15]=Ae,e[16]=b,e[17]=r,e[18]=i,e[19]=u,e[20]=g,e[21]=y,e[22]=k,e[23]=f,e[24]=D,e[25]=E,e[26]=d,e[27]=m,e[28]=x,e[29]=me,e[30]=R,e[31]=Se,e[32]=H,e[33]=se,e[34]=ae,e[35]=ue,e[36]=oe,e[37]=de,e[38]=le,e[39]=fe,e[40]=De,e[41]=je,e[42]=re,e[43]=pe,e[44]=be,e[45]=xe}else Se=e[31],H=e[32],se=e[33],ae=e[34],ue=e[35],oe=e[36],de=e[37],le=e[38],fe=e[39],De=e[40],je=e[41],re=e[42],pe=e[43],be=e[44],xe=e[45];if(be!==Symbol.for("react.early_return_sentinel"))return be;let T;e[70]!==ue||e[71]!==xe?(T=n.jsx("div",{className:xe,children:ue}),e[70]=ue,e[71]=xe,e[72]=T):T=e[72];let Ke;e[73]!==Se||e[74]!==oe||e[75]!==de||e[76]!==T?(Ke=n.jsx(Se,{items:oe,strategy:de,children:T}),e[73]=Se,e[74]=oe,e[75]=de,e[76]=T,e[77]=Ke):Ke=e[77];let Ie;e[78]!==se||e[79]!==ae||e[80]!==b?(Ie=ae?n.jsx("div",{className:Oe("cursor-grabbing shadow-lg ring-1 ring-border/60",_s(ae,!1)),children:n.jsx(ys,{section:ae,raw:se,meta:b})}):null,e[78]=se,e[79]=ae,e[80]=b,e[81]=Ie):Ie=e[81];let Ge;e[82]!==Ie?(Ge=Yn.createPortal(n.jsx(ms,{dropAnimation:Qn,children:Ie}),document.body),e[82]=Ie,e[83]=Ge):Ge=e[83];let $e;e[84]!==H||e[85]!==le||e[86]!==fe||e[87]!==De||e[88]!==je||e[89]!==re||e[90]!==Ke||e[91]!==Ge?($e=n.jsxs(H,{sensors:le,collisionDetection:fe,onDragStart:De,onDragEnd:je,onDragCancel:re,children:[Ke,Ge]}),e[84]=H,e[85]=le,e[86]=fe,e[87]=De,e[88]=je,e[89]=re,e[90]=Ke,e[91]=Ge,e[92]=$e):$e=e[92];const Ee=!l;let ye;e[93]===Symbol.for("react.memo_cache_sentinel")?(ye=n.jsx(hn,{size:14}),e[93]=ye):ye=e[93];let ke;e[94]!==R?(ke=R("sectionsEditor.sectionList.addSectionButton"),e[94]=R,e[95]=ke):ke=e[95];let Le;e[96]!==r||e[97]!==Ee||e[98]!==ke?(Le=n.jsxs(Qe,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Ee,onClick:r,children:[ye,ke]}),e[96]=r,e[97]=Ee,e[98]=ke,e[99]=Le):Le=e[99];let Te;return e[100]!==pe||e[101]!==$e||e[102]!==Le?(Te=n.jsxs("div",{className:pe,children:[$e,Le]}),e[100]=pe,e[101]=$e,e[102]=Le,e[103]=Te):Te=e[103],Te}function cr(h){return h.id}function Hn(h){const e=Ue.c(57),{open:o,initialName:d,autoLabel:m,isPending:b,onSubmit:x,onOpenChange:f}=h,v=b===void 0?!1:b,u=ct(),[y,k]=w.useState(d),[D,E]=w.useState(o);o!==D&&(E(o),o&&k(d));let i;e[0]!==v||e[1]!==f?(i=ee=>{!ee&&!v&&f(!1)},e[0]=v,e[1]=f,e[2]=i):i=e[2];const g=i;let r;e[3]!==v||e[4]!==y||e[5]!==x?(r=async ee=>{ee.preventDefault(),!v&&await x(y.trim())},e[3]=v,e[4]=y,e[5]=x,e[6]=r):r=e[6];const A=r;let l;e[7]!==u?(l=u("sectionsEditor.variantRenameDialog.title"),e[7]=u,e[8]=l):l=e[8];let R;e[9]!==l?(R=n.jsx(No,{children:l}),e[9]=l,e[10]=R):R=e[10];let K;e[11]!==m||e[12]!==u?(K=u("sectionsEditor.variantRenameDialog.description",{fallback:m||u("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=m,e[12]=u,e[13]=K):K=e[13];let z;e[14]!==K?(z=n.jsx(Do,{children:K}),e[14]=K,e[15]=z):z=e[15];let p;e[16]!==R||e[17]!==z?(p=n.jsxs(To,{children:[R,z]}),e[16]=R,e[17]=z,e[18]=p):p=e[18];let N;e[19]!==u?(N=u("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=u,e[20]=N):N=e[20];let ie;e[21]!==N?(ie=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:N}),e[21]=N,e[22]=ie):ie=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=ee=>k(ee.target.value),e[23]=L):L=e[23];let ce;e[24]!==m||e[25]!==v||e[26]!==y?(ce=n.jsx(Mo,{id:"variant-rename-name",value:y,onChange:L,placeholder:m,autoFocus:!0,disabled:v}),e[24]=m,e[25]=v,e[26]=y,e[27]=ce):ce=e[27];let M;e[28]!==ie||e[29]!==ce?(M=n.jsxs("div",{className:"space-y-1.5 py-4",children:[ie,ce]}),e[28]=ie,e[29]=ce,e[30]=M):M=e[30];let ge;e[31]!==f?(ge=()=>f(!1),e[31]=f,e[32]=ge):ge=e[32];let O;e[33]!==u?(O=u("sectionsEditor.variantRenameDialog.cancel"),e[33]=u,e[34]=O):O=e[34];let ne;e[35]!==v||e[36]!==ge||e[37]!==O?(ne=n.jsx(Qe,{type:"button",variant:"outline",onClick:ge,disabled:v,children:O}),e[35]=v,e[36]=ge,e[37]=O,e[38]=ne):ne=e[38];let he;e[39]!==v||e[40]!==u?(he=v?n.jsxs(n.Fragment,{children:[n.jsx(Jn,{size:14,className:"animate-spin"}),u("sectionsEditor.variantRenameDialog.saving")]}):u("sectionsEditor.variantRenameDialog.save"),e[39]=v,e[40]=u,e[41]=he):he=e[41];let me;e[42]!==v||e[43]!==he?(me=n.jsx(Qe,{type:"submit",disabled:v,children:he}),e[42]=v,e[43]=he,e[44]=me):me=e[44];let I;e[45]!==ne||e[46]!==me?(I=n.jsxs(Po,{children:[ne,me]}),e[45]=ne,e[46]=me,e[47]=I):I=e[47];let J;e[48]!==A||e[49]!==M||e[50]!==I||e[51]!==p?(J=n.jsx(Ao,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:A,children:[p,M,I]})}),e[48]=A,e[49]=M,e[50]=I,e[51]=p,e[52]=J):J=e[52];let Z;return e[53]!==g||e[54]!==o||e[55]!==J?(Z=n.jsx(Co,{open:o,onOpenChange:g,children:J}),e[53]=g,e[54]=o,e[55]=J,e[56]=Z):Z=e[56],Z}const ur="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",js="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function Es(h){const e=Ue.c(5),{rule:o,matchers:d}=h,m=o?.__resolveType??"";let b;if(e[0]!==d||e[1]!==m){const u=d.find(y=>y.resolveType===m)?.iconName??Fa(m);b=Eo(u),e[0]=d,e[1]=m,e[2]=b}else b=e[2];const x=b;if(!x)return null;let f;return e[3]!==x?(f=n.jsx(x,{size:14,className:"shrink-0"}),e[3]=x,e[4]=f):f=e[4],f}function Gn(h){return h.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
-
`)}function pn(h){return h.map((e,o)=>({id:crypto.randomUUID(),index:o,variant:e}))}function dr(h){return h.map((e,o)=>({...e,index:o}))}function ks(h){const e=Ue.c(17),{label:o,effectiveRule:d,matchers:m,canDelete:b,dragging:x,onRename:f,onDuplicate:v,onDelete:u}=h,y=ct();let k;e[0]!==d||e[1]!==m?(k=n.jsx(Es,{rule:d,matchers:m}),e[0]=d,e[1]=m,e[2]=k):k=e[2];let D;e[3]!==o?(D=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:o}),e[3]=o,e[4]=D):D=e[4];let E;e[5]!==b||e[6]!==x||e[7]!==o||e[8]!==u||e[9]!==v||e[10]!==f||e[11]!==y?(E=!x&&n.jsxs(ls,{children:[n.jsx(rs,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":y("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:o}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:fr,onPointerDown:mr,children:n.jsx(es,{size:14})})}),n.jsxs(is,{align:"end",className:"w-36",children:[n.jsxs(ht,{onClick:g=>{g.stopPropagation(),f?.()},children:[n.jsx(qo,{size:14}),y("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(ht,{onClick:g=>{g.stopPropagation(),v?.()},children:[n.jsx(ss,{size:14}),y("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(Bo,{}),n.jsxs(ht,{variant:"destructive",disabled:!b,onClick:g=>{g.stopPropagation(),u?.()},children:[n.jsx(os,{size:14}),y("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=b,e[6]=x,e[7]=o,e[8]=u,e[9]=v,e[10]=f,e[11]=y,e[12]=E):E=e[12];let i;return e[13]!==k||e[14]!==D||e[15]!==E?(i=n.jsxs(n.Fragment,{children:[k,D,E]}),e[13]=k,e[14]=D,e[15]=E,e[16]=i):i=e[16],i}function mr(h){return h.stopPropagation()}function fr(h){return h.stopPropagation()}function pr(h){const e=Ue.c(33),{entry:o,sortableId:d,isActive:m,canDelete:b,decofile:x,meta:f,matchers:v,onSelect:u,onRename:y,onDuplicate:k,onDelete:D}=h;let E;e[0]!==d?(E={id:d,animateLayoutChanges:gr},e[0]=d,e[1]=E):E=e[1];const{attributes:i,listeners:g,setNodeRef:r,transform:A,isDragging:l}=fs(E);let R;e[2]!==A?(R=ps.Transform.toString(A?{...A,x:0}:null),e[2]=A,e[3]=R):R=e[3];const K=l?0:void 0;let z;e[4]!==R||e[5]!==K?(z={transform:R,opacity:K},e[4]=R,e[5]=K,e[6]=z):z=e[6];const p=z,N=f??void 0;let ie;e[7]!==x||e[8]!==o.variant.rule||e[9]!==N?(ie=Ct(o.variant.rule,x,N),e[7]=x,e[8]=o.variant.rule,e[9]=N,e[10]=ie):ie=e[10];const L=ie;let ce;e[11]!==u?(ce=me=>{me.target===me.currentTarget&&(me.key==="Enter"||me.key===" ")&&(me.preventDefault(),u())},e[11]=u,e[12]=ce):ce=e[12];const M=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",ge=m?js:ur;let O;e[13]!==M||e[14]!==ge?(O=Oe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",M,ge),e[13]=M,e[14]=ge,e[15]=O):O=e[15];let ne;e[16]!==b||e[17]!==L||e[18]!==o.variant.label||e[19]!==v||e[20]!==D||e[21]!==k||e[22]!==y?(ne=n.jsx(ks,{label:o.variant.label,effectiveRule:L,matchers:v,canDelete:b,onRename:y,onDuplicate:k,onDelete:D}),e[16]=b,e[17]=L,e[18]=o.variant.label,e[19]=v,e[20]=D,e[21]=k,e[22]=y,e[23]=ne):ne=e[23];let he;return e[24]!==i||e[25]!==g||e[26]!==u||e[27]!==r||e[28]!==p||e[29]!==O||e[30]!==ne||e[31]!==ce?(he=n.jsx("div",{ref:r,style:p,...i,...g,onClick:u,onKeyDown:ce,className:O,children:ne}),e[24]=i,e[25]=g,e[26]=u,e[27]=r,e[28]=p,e[29]=O,e[30]=ne,e[31]=ce,e[32]=he):he=e[32],he}function gr(){return!1}function hr(h){const e=Ue.c(9),{variant:o,decofile:d,meta:m,matchers:b}=h,x=m??void 0;let f;e[0]!==d||e[1]!==x||e[2]!==o.rule?(f=Ct(o.rule,d,x),e[0]=d,e[1]=x,e[2]=o.rule,e[3]=f):f=e[3];const v=f;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=Oe("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",js),e[4]=u):u=e[4];let y;return e[5]!==v||e[6]!==b||e[7]!==o.label?(y=n.jsx("div",{className:u,children:n.jsx(ks,{label:o.label,effectiveRule:v,matchers:b,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=b,e[7]=o.label,e[8]=y):y=e[8],y}function vr(h){const e=Ue.c(91),{listKey:o,variants:d,activeIndex:m,decofile:b,meta:x,matchers:f,onSelect:v,onReorder:u,onRename:y,onDuplicate:k,onDelete:D,onAdd:E}=h,i=ct();let g;e[0]!==d?(g=()=>pn(d),e[0]=d,e[1]=g):g=e[1];const[r,A]=w.useState(g),[l,R]=w.useState(null),[K,z]=w.useState(o),[p,N]=w.useState(d.length);let ie;e[2]!==d?(ie=()=>Gn(d),e[2]=d,e[3]=ie):ie=e[3];const[L,ce]=w.useState(ie),M=w.useRef(!1),ge=Gn(d);K!==o?(z(o),N(d.length),ce(ge),A(pn(d))):p!==d.length?(N(d.length),ce(ge),A(pn(d))):L!==ge&&(ce(ge),A($e=>d.map((Ee,ye)=>({id:$e[ye]?.id??crypto.randomUUID(),index:ye,variant:Ee}))));let O;e[4]===Symbol.for("react.memo_cache_sentinel")?(O={activationConstraint:{distance:8}},e[4]=O):O=e[4];let ne;e[5]===Symbol.for("react.memo_cache_sentinel")?(ne={coordinateGetter:gs},e[5]=ne):ne=e[5];const he=cs(Jt(ds,O),Jt(us,ne));let me;e[6]!==r?(me=r.map(Sr),e[6]=r,e[7]=me):me=e[7];const I=me,J=d.length>1;let Z;e[8]!==r?(Z=$e=>{const Ee=String($e.active.id);R(r.find(ye=>ye.id===Ee)??null)},e[8]=r,e[9]=Z):Z=e[9];const ee=Z;let $;e[10]!==I||e[11]!==u?($=$e=>{R(null);const{active:Ee,over:ye}=$e;if(!ye||Ee.id===ye.id)return;const ke=I.indexOf(String(Ee.id)),Le=I.indexOf(String(ye.id));ke===-1||Le===-1||(A(Te=>dr(Mt([...Te],ke,Le))),M.current=!0,requestAnimationFrame(()=>{M.current=!1}),u(ke,Le))},e[10]=I,e[11]=u,e[12]=$):$=e[12];const Ae=$;let Me;e[13]===Symbol.for("react.memo_cache_sentinel")?(Me=()=>{R(null)},e[13]=Me):Me=e[13];const et=Me;let Se,H,se,ae,ue,oe,de,le,fe,De,je,re,pe;if(e[14]!==m||e[15]!==J||e[16]!==b||e[17]!==r||e[18]!==I||e[19]!==Ae||e[20]!==ee||e[21]!==f||e[22]!==x||e[23]!==E||e[24]!==D||e[25]!==k||e[26]!==y||e[27]!==v||e[28]!==he||e[29]!==i){const $e=G=>{M.current||v(G)};je="space-y-1 border-b p-2";let Ee;e[43]!==i?(Ee=i("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=i,e[44]=Ee):Ee=e[44];let ye;e[45]!==Ee?(ye=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:Ee}),e[45]=Ee,e[46]=ye):ye=e[46];let ke;e[47]!==i?(ke=i("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=i,e[48]=ke):ke=e[48];let Le;e[49]===Symbol.for("react.memo_cache_sentinel")?(Le=n.jsx(hn,{size:14}),e[49]=Le):Le=e[49];let Te;e[50]!==E||e[51]!==ke?(Te=n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":ke,className:"size-6",onClick:E,children:Le})}),e[50]=E,e[51]=ke,e[52]=Te):Te=e[52];let ze;e[53]!==i?(ze=i("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=i,e[54]=ze):ze=e[54];let F;e[55]!==ze?(F=n.jsx(jt,{children:ze}),e[55]=ze,e[56]=F):F=e[56];let B;e[57]!==Te||e[58]!==F?(B=n.jsxs(yt,{children:[Te,F]}),e[57]=Te,e[58]=F,e[59]=B):B=e[59],e[60]!==ye||e[61]!==B?(re=n.jsxs("div",{className:"flex items-center justify-between",children:[ye,B]}),e[60]=ye,e[61]=B,e[62]=re):re=e[62],H=hs,oe=he,de=vs,le=ee,fe=Ae,De=et,Se=Ss,ae=I,ue=bs,pe="space-y-0.5",se=r.map(G=>n.jsx(pr,{sortableId:G.id,entry:G,isActive:G.index===m,canDelete:J,decofile:b,meta:x,matchers:f,onSelect:()=>$e(G.index),onRename:()=>y(G.index),onDuplicate:()=>k(G.index),onDelete:()=>D(G.index)},G.id)),e[14]=m,e[15]=J,e[16]=b,e[17]=r,e[18]=I,e[19]=Ae,e[20]=ee,e[21]=f,e[22]=x,e[23]=E,e[24]=D,e[25]=k,e[26]=y,e[27]=v,e[28]=he,e[29]=i,e[30]=Se,e[31]=H,e[32]=se,e[33]=ae,e[34]=ue,e[35]=oe,e[36]=de,e[37]=le,e[38]=fe,e[39]=De,e[40]=je,e[41]=re,e[42]=pe}else Se=e[30],H=e[31],se=e[32],ae=e[33],ue=e[34],oe=e[35],de=e[36],le=e[37],fe=e[38],De=e[39],je=e[40],re=e[41],pe=e[42];let be;e[63]!==se||e[64]!==pe?(be=n.jsx("div",{className:pe,children:se}),e[63]=se,e[64]=pe,e[65]=be):be=e[65];let xe;e[66]!==Se||e[67]!==ae||e[68]!==ue||e[69]!==be?(xe=n.jsx(Se,{items:ae,strategy:ue,children:be}),e[66]=Se,e[67]=ae,e[68]=ue,e[69]=be,e[70]=xe):xe=e[70];let T;e[71]!==l||e[72]!==b||e[73]!==f||e[74]!==x?(T=l?n.jsx(hr,{variant:l.variant,decofile:b,meta:x,matchers:f}):null,e[71]=l,e[72]=b,e[73]=f,e[74]=x,e[75]=T):T=e[75];let Ke;e[76]!==T?(Ke=Yn.createPortal(n.jsx(ms,{dropAnimation:Qn,children:T}),document.body),e[76]=T,e[77]=Ke):Ke=e[77];let Ie;e[78]!==H||e[79]!==oe||e[80]!==de||e[81]!==le||e[82]!==fe||e[83]!==De||e[84]!==xe||e[85]!==Ke?(Ie=n.jsxs(H,{sensors:oe,collisionDetection:de,onDragStart:le,onDragEnd:fe,onDragCancel:De,children:[xe,Ke]}),e[78]=H,e[79]=oe,e[80]=de,e[81]=le,e[82]=fe,e[83]=De,e[84]=xe,e[85]=Ke,e[86]=Ie):Ie=e[86];let Ge;return e[87]!==je||e[88]!==re||e[89]!==Ie?(Ge=n.jsxs("div",{className:je,children:[re,Ie]}),e[87]=je,e[88]=re,e[89]=Ie,e[90]=Ge):Ge=e[90],Ge}function Sr(h){return h.id}function br(h){const e=Ue.c(16),{schema:o,value:d,onChange:m,meta:b,decofile:x,onSaveReferencedBlock:f,sandbox:v}=h,u=ct();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0];const[k,D]=w.useState(y);let E;e[1]!==k||e[2]!==u?(E=k.length>0&&n.jsxs("nav",{"aria-label":u("sectionsEditor.sectionsEditorPanels.variantRuleBreadcrumb"),className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>D([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:u("sectionsEditor.sectionsEditorPanels.backToRule"),children:n.jsx(ts,{className:"size-3.5"})}),k.map((r,A)=>{const l=A===k.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[A>0&&n.jsx(ns,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>D(k.slice(0,A+1)),title:r,className:Oe("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",l?"font-medium text-foreground":"text-muted-foreground"),children:r})]},`${r}-${A}`)})]}),e[1]=k,e[2]=u,e[3]=E):E=e[3];let i;e[4]!==k||e[5]!==x||e[6]!==b||e[7]!==m||e[8]!==f||e[9]!==v||e[10]!==o||e[11]!==d?(i=n.jsx(Zn,{schema:o,value:d,onChange:m,basePath:"",breadcrumbPath:k,onBreadcrumbChange:D,meta:b,decofile:x,onSaveReferencedBlock:f,sandbox:v}),e[4]=k,e[5]=x,e[6]=b,e[7]=m,e[8]=f,e[9]=v,e[10]=o,e[11]=d,e[12]=i):i=e[12];let g;return e[13]!==E||e[14]!==i?(g=n.jsxs("div",{className:"space-y-2",children:[E,i]}),e[13]=E,e[14]=i,e[15]=g):g=e[15],g}function Un(h){const e=Ue.c(23),{activeSchema:o,formValue:d,formResetKey:m,onFormChange:b,onBreadcrumbChange:x,breadcrumbPath:f,emptyMessage:v,beforeForm:u,seoResolveType:y,siteDefaultSeo:k,meta:D,decofile:E,onSaveReferencedBlock:i,sandbox:g,previewBaseUrl:r,onRequestAddSection:A}=h;let l;e[0]!==f?(l=f===void 0?[]:f,e[0]=f,e[1]=l):l=e[1];const R=l;let K;e[2]!==o||e[3]!==R||e[4]!==E||e[5]!==m||e[6]!==d||e[7]!==D||e[8]!==x||e[9]!==b||e[10]!==A||e[11]!==i||e[12]!==r||e[13]!==g||e[14]!==y||e[15]!==k?(K=o&&d?y?n.jsx(Oo,{schema:o,resolveType:y,value:d,formResetKey:m,onChange:b,onBreadcrumbChange:x,siteDefaultSeo:k}):n.jsx(Zn,{schema:o,value:d,onChange:b,basePath:"",breadcrumbPath:R,onBreadcrumbChange:x,meta:D,decofile:E,onSaveReferencedBlock:i,sandbox:g,previewBaseUrl:r,onRequestAddSection:A},m):null,e[2]=o,e[3]=R,e[4]=E,e[5]=m,e[6]=d,e[7]=D,e[8]=x,e[9]=b,e[10]=A,e[11]=i,e[12]=r,e[13]=g,e[14]=y,e[15]=k,e[16]=K):K=e[16];const z=K;let p;e[17]!==v||e[18]!==z?(p=z??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[17]=v,e[18]=z,e[19]=p):p=e[19];let N;return e[20]!==u||e[21]!==p?(N=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[u,p]})}),e[20]=u,e[21]=p,e[22]=N):N=e[22],N}const xr="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function yr(h,e){return Ba(h,e,lt)}function _r(h){const e=Ue.c(19),{pageKey:o,initialName:d,initialPath:m,onFieldChange:b}=h,x=ct(),[f,v]=w.useState(d),[u,y]=w.useState(m),[k,D]=w.useState(o);k!==o&&(D(o),v(d),y(m));let E;e[0]!==b?(E=K=>{v(K.target.value),b("name",K.target.value)},e[0]=b,e[1]=E):E=e[1];let i;e[2]!==x?(i=x("sectionsEditor.sectionsEditorPanels.pageNamePlaceholder"),e[2]=x,e[3]=i):i=e[3];let g;e[4]!==f||e[5]!==E||e[6]!==i?(g=n.jsx("input",{type:"text",value:f,onChange:E,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:i}),e[4]=f,e[5]=E,e[6]=i,e[7]=g):g=e[7];let r;e[8]!==b?(r=K=>{y(K.target.value),b("path",K.target.value)},e[8]=b,e[9]=r):r=e[9];let A;e[10]!==x?(A=x("sectionsEditor.sectionsEditorPanels.pathPlaceholder"),e[10]=x,e[11]=A):A=e[11];let l;e[12]!==u||e[13]!==r||e[14]!==A?(l=n.jsx("input",{type:"text",value:u,onChange:r,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:A}),e[12]=u,e[13]=r,e[14]=A,e[15]=l):l=e[15];let R;return e[16]!==g||e[17]!==l?(R=n.jsxs("div",{className:"space-y-1",children:[g,l]}),e[16]=g,e[17]=l,e[18]=R):R=e[18],R}function Wn(h){const e=Ue.c(13),{onClick:o}=h,d=ct();let m;e[0]!==d?(m=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[0]=d,e[1]=m):m=e[1];let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(as,{size:14}),e[2]=b):b=e[2];let x;e[3]!==o||e[4]!==m?(x=n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":m,className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:o,children:b})}),e[3]=o,e[4]=m,e[5]=x):x=e[5];let f;e[6]!==d?(f=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[6]=d,e[7]=f):f=e[7];let v;e[8]!==f?(v=n.jsx(jt,{side:"bottom",children:f}),e[8]=f,e[9]=v):v=e[9];let u;return e[10]!==x||e[11]!==v?(u=n.jsxs(yt,{children:[x,v]}),e[10]=x,e[11]=v,e[12]=u):u=e[12],u}function qn(h){const e=Ue.c(21),{currentRt:o,currentLabel:d,currentGlobalKey:m,matchers:b,globals:x,onSelect:f,onSelectGlobal:v,schema:u,formValue:y,onChange:k,formKey:D,formWrapperClassName:E,meta:i,decofile:g,onSaveReferencedBlock:r,sandbox:A}=h;let l;e[0]!==m||e[1]!==d||e[2]!==o||e[3]!==x||e[4]!==b||e[5]!==f||e[6]!==v?(l=n.jsx(Oa,{currentRt:o,currentLabel:d,currentGlobalKey:m,matchers:b,globals:x,onSelect:f,onSelectGlobal:v}),e[0]=m,e[1]=d,e[2]=o,e[3]=x,e[4]=b,e[5]=f,e[6]=v,e[7]=l):l=e[7];let R;e[8]!==g||e[9]!==D||e[10]!==y||e[11]!==E||e[12]!==i||e[13]!==k||e[14]!==r||e[15]!==A||e[16]!==u?(R=u&&y&&n.jsx("div",{className:E,children:n.jsx(br,{schema:u,value:y,onChange:k,meta:i,decofile:g,onSaveReferencedBlock:r,sandbox:A},D)}),e[8]=g,e[9]=D,e[10]=y,e[11]=E,e[12]=i,e[13]=k,e[14]=r,e[15]=A,e[16]=u,e[17]=R):R=e[17];let K;return e[18]!==l||e[19]!==R?(K=n.jsxs(n.Fragment,{children:[l,R]}),e[18]=l,e[19]=R,e[20]=K):K=e[20],K}function uc({orgSlug:h,virtualMcpId:e,branch:o,previewReady:d=!0,previewUrl:m,currentPath:b,activePageBlockKey:x=null,activeGlobalBlockKey:f=null,externalSelectedIndex:v,onSaved:u,initialEditSeo:y=!1,onExitSeo:k,onViewJsonFile:D,onVariantPreviewOverride:E}){const i=ct(),g=d?{orgSlug:h,virtualMcpId:e,branch:o,previewUrl:m}:null,{data:r,isLoading:A}=Ia(g),{data:l,isLoading:R}=$a(g),K=za(),z=K?.entity?.id===e?K.entity.metadata?.siteSlug??null:null,[p,N]=w.useState(null),[ie,L]=w.useState(null),[ce,M]=w.useState(null),[ge,O]=w.useState(0),[ne,he]=w.useState(void 0),[me,I]=w.useState(null),[J,Z]=w.useState(null),[ee,$]=w.useState([]),Ae=w.useRef(null),[Me,et]=w.useState(ee.length);Me!==ee.length&&(et(ee.length),requestAnimationFrame(()=>{Ae.current&&(Ae.current.scrollTop=0)}));const[Se,H]=w.useState(0),[se,ae]=w.useState(null),[ue,oe]=w.useState(null),[de,le]=w.useState(null),[fe,De]=w.useState(!0),[je,re]=w.useState(!1),[pe,be]=w.useState(!1),xe=w.useRef(null),[T,Ke]=w.useState(y),[Ie,Ge]=w.useState(y);y&&!Ie&&(Ge(!0),Ke(!0),N(null),L(null),M(null),$([])),!y&&Ie&&Ge(!1);const[$e,Ee]=w.useState(null),[ye,ke]=w.useState(void 0),[Le,Te]=w.useState([]),[ze,F]=w.useState(0),[B,G]=w.useState(0),[nt,Re]=w.useState(null),[We,Ne]=w.useState(null),[vt,vn]=w.useState(null),Rs=Na(),ws=`${h}/${e}/${o}`,Qt=Ha({orgSlug:h,virtualMcpId:e,branch:o}),[Vs,Ns]=w.useState(b),[Ds,Ts]=w.useState(x),[Ps,As]=w.useState(f);(Vs!==b||Ds!==x||Ps!==f)&&(queueMicrotask(()=>Qt.flush()),Ns(b),Ts(x),As(f),N(null),L(null),M(null),O(0),I(null),Z(null),G(0),Re(null),Ne(null),$([]),H(t=>t+1),Ke(!1),Ee(null),ke(void 0),Te([]),F(t=>t+1));const we=Ga({orgSlug:h,virtualMcpId:e,branch:o}),Kt=uo((t,s)=>{we.mutate({blockKey:t,data:s},{onSuccess:()=>u?.(),onError:a=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Xt=Ua({orgSlug:h,virtualMcpId:e,branch:o}),[Nt,Lt]=w.useState(!1),Fe=w.useRef(null),st=w.useRef(null),at=w.useRef(null),Zt=w.useRef({}),Xe=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!d||A||R)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Jn,{size:20,className:"animate-spin text-muted-foreground"})});if(!r||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Cs=Wa(r),Ve=!!f,qe=Ve?null:qa(Cs,b,x),V=Ve?f:qe?.key??null,en=Ve&&f?r[f]:void 0,Sn=Ve&&f&&en?Ya(f,en):Ve&&f?f:"",Ft=!Ve&&V&&r[V]?r[V]:null,tn=T&&r&&l&&V&&qe?$n(r,{kind:"page",pageKey:V,pageName:String(qe.name??""),path:String(qe.path??"")},l):null,Ms=T?Ft?.seo:void 0,nn=ye!==void 0?ye:Ms,Ks=T?Io(nn):void 0,Ls=tn?.seoTypeOptions??[],Fs=T&&l?$o(l):"",bn=$e??Ks??{},sn=T&&tn?zo(bn,tn):null,Bs=T&&sn&&Ho(nn)?Gt(sn,l):null,Os=T?Go(r,l)?.seoData:void 0,He=Ve?[{label:"Default",sections:[{__resolveType:f}]}]:yr(Ft?.sections,r??{}),Bt=He.length>1,Ce=Math.min(ge,He.length-1),ut=He[Ce],q=ut?.sections??[],Be=Ut(q,r),xn=!Ve&&Ja(Ft?.sections);if(Ve&&f&&vt!==f){vn(f);const t=q[0],s=Be[0];if(t&&s){N(0),G(0),$([]);const a=bt(t,s,r);a&&(L(a.data),M(a.resolveType),Ne(null),Re(null))}}!Ve&&vt!==null&&vn(null),Xe.current={rawSections:q,parsedSections:Be,decofile:r??{},activePageKey:V,pageVariants:He,variantIndex:Ce,sectionVariantIndex:B,selectedSectionIndex:p};const Is=()=>({multivariate:xn,index:Ce,variants:He.map(t=>({rule:t.rule}))}),yn=(t,s)=>{if(!E)return;if(!V||!xn||t.length<=1){E(null);return}const a=In(V,{multivariate:!0,index:s,variants:t},r,l);E(a.length>0?a:null)},Et=(t,s,a)=>{if(!E)return;if(!V){E(null);return}const c=Is(),S=In(V,c,r,l);if(!t||s<0){E(S.length>0?S:null);return}const j=ho({pageKey:V,page:c,sectionIndex:s,sectionLazy:Be[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:r,meta:l}),_=[...S,...j];E(_.length>0?_:null)},dt=(t,s,a,c=p??-1,S=!1)=>{const j=tt(t,s);if(!j){L(null),M(null),Ne(null),Re(null),S&&Et(null,c,a);return}const P=Mn(j,lt)[a];if(!P){L(null),M(null),Ne(null),Re(null),S&&Et(null,c,a);return}const te=no(P.value,r);L(te?.data??null),M(te?.resolveType??null);const{resolveType:C,formValue:U}=Tt(P.rule,r,l??void 0);Ne(C),Re(U),S&&Et(j,c,a)};if(v!==void 0&&v!==ne&&(he(v??null),typeof v=="number")){const t=q[v],s=Be[v];if(t&&s)if(N(v),G(0),$([]),H(a=>a+1),s.isMultivariate)dt(t,s,0,v);else{const a=bt(t,s,r);a?(L(a.data),M(a.resolveType)):(L(null),M(null)),Ne(null),Re(null)}}const Ot={orgSlug:h,virtualMcpId:e,branch:o,previewUrl:m??void 0,siteSlug:z},an=ce&&l?Gt(ce,l):null,Ye=(t,s)=>{if(!V)return;Fe.current&&(clearTimeout(Fe.current),Fe.current=null),at.current&&(clearTimeout(at.current),at.current=null),st.current&&(clearTimeout(st.current),st.current=null);const a=At(r,V,t,Ce,He);we.mutate({blockKey:V,data:a},{onSuccess:()=>s?.onSuccess?.()??u?.(),onError:c=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},kt=()=>{N(null),L(null),M(null),G(0),Re(null),Ne(null),$([]),H(t=>t+1)},$s=(t,s)=>{Fe.current&&clearTimeout(Fe.current);const a=Xe.current.sectionVariantIndex;Fe.current=setTimeout(()=>{const{rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current,C=c[s];if(!C)return;const U=S[s];if(!U)return;if(U.isSavedBlock){const Y=U.isLazy?C.section?.__resolveType??C.__resolveType:C.__resolveType;we.mutate({blockKey:Y,data:t},{onSuccess:()=>u?.(),onError:Q=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Q.message}))});return}if(!_)return;const W={...j[_]},_e=[...c];if(U.isMultivariate){const Y=tt(C,U);if(!Y||!_)return;const Q=So(Y,a,t);_e[s]=xt(C,U,Q)}else if(U.isHidden){const Y=Xn(C.__resolveType),Q=Y?{...C.section}:{...C},Pe=Array.isArray(Q.variants)?[...Q.variants]:[];Pe[0]&&(Pe[0]={...Pe[0],value:t}),Q.variants=Pe,Y?_e[s]={...C,section:Q}:_e[s]=Q}else U.isLazy?_e[s]={...C,section:t}:_e[s]=t;if(P.length>1){const Y=W.sections,Q=[...Y?.variants??[]];Q[te]&&(Q[te]={...Q[te],value:_e}),W.sections={...Y,variants:Q}}else W.sections=_e;we.mutate({blockKey:_,data:W},{onSuccess:()=>u?.(),onError:Y=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))})},fn)},zs=t=>{N(t),G(0),$([]),H(S=>S+1);const s=q[t],a=Be[t];if(!s||!a)return;if(a.isMultivariate){dt(s,a,0,t);return}const c=bt(s,a,r);if(!c){L(null),M(null),Ne(null),Re(null),Et(null,t,0);return}L(c.data),M(c.resolveType),Ne(null),Re(null),Et(null,t,0)},_n=t=>{const s=t;L(s),p!==null&&$s(s,p)},on=t=>{if(!V||!r||!l||!qe)return;const s={kind:"page",pageKey:V,pageName:String(qe.name??""),path:String(qe.path??"")},a=$n(r,s,l);a&&Qt.save(V,()=>{const c=Rs.getQueryData(Da.decofile(ws))?.[V];if(!c||typeof c!="object"||c===null||Array.isArray(c))return null;const S={...c,...Zt.current};return Zt.current={},t?.raw!==void 0?{...S,seo:t.raw}:t?.inner!==void 0?Wo(s,a,S,t.inner):S})},Hs=(t,s)=>{V&&(Zt.current[t]=s,on())},Gs=(t,s)=>{if(!V)return;const a=Mt([...q],t,s);p!==null&&(p===t?N(s):t<p&&s>=p?N(p-1):t>p&&s<=p&&N(p+1)),Ye(a)},Us=t=>{if(!V)return;const s=q.filter((a,c)=>c!==t);p===t?kt():p!==null&&p>t&&N(p-1),Ye(s)},Ws=t=>{if(!V)return;const s=q[t];if(!s)return;const a=[...q];a.splice(t+1,0,go(s)),p!==null&&p>t&&N(p+1),Ye(a)},qs=t=>{if(!V)return;const s=q[t],a=Be[t];if(!s||!a||a.isMultivariate)return;const c=a.isHidden?fo(s):po(s);if(!c)return;const S=[...q];S[t]=c,p===t&&kt(),Ye(S)},Ys=t=>{if(!V)return;const s=q[t],a=Be[t];if(!s||!a||a.isMultivariate)return;const c=mo(s);if(!c)return;const S=[...q];S[t]=c,p===t&&kt(),Ye(S)},Js=t=>{if(!V)return;const s=q[t],a=Be[t];if(!s||!a?.isSavedBlock)return;const c=bt(s,a,r);if(!c?.data)return;const{name:S,...j}=c.data,_=[...q];a.isLazy?_[t]={...s,section:j}:_[t]=j,p===t&&kt(),Ye(_)},Qs=t=>{if(!V)return;const s=[...q,{__resolveType:t.resolveType}],a=s.length-1;Ye(s,{onSuccess:()=>{re(!1),N(a),G(0),$([]),H(_=>_+1);const c=s[a],S=Ut(s,r)[a];if(!c||!S)return;if(S.isMultivariate){dt(c,S,0);return}const j=bt(c,S,r);if(!j){L(null),M(null),Ne(null),Re(null);return}L(j.data),M(j.resolveType),Ne(null),Re(null)}})},jn=t=>{xe.current=t.append,re(!0)},Xs=t=>{const s=xe.current;if(!s){Qs(t);return}s({__resolveType:t.resolveType}),re(!1),xe.current=null},Zs=t=>{if(p===null)return;const s=q[p],a=Be[p];!s||!a?.isMultivariate||(G(t),$([]),H(c=>c+1),dt(s,a,t,p,!0))},ea=t=>{if(p===null||!V)return;const s=q[p],a=Be[p];if(!s||!a?.isMultivariate)return;const c=tt(s,a);if(!c)return;const S=lo(c,t);if(!S){X.error(i("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const j=[...q];j[p]=xt(s,a,S);const _=S.variants;let P=B;t===B?P=Math.min(t,_.length-1):t<B&&(P=B-1),G(P),$([]),H(te=>te+1),dt(j[p],a,P),Ye(j)},ta=t=>{if(p===null||!V)return;const s=q[p],a=Be[p];if(!s||!a?.isMultivariate)return;const c=tt(s,a);if(!c)return;const S=co(c,t),j=[...q];j[p]=xt(s,a,S);const _=t+1;G(_),$([]),H(P=>P+1),dt(j[p],a,_),Ye(j)},na=(t,s)=>{if(p===null||!V||t===s)return;const a=q[p],c=Be[p];if(!a||!c?.isMultivariate)return;const S=tt(a,c);if(!S)return;const j=ro(S,t,s),_=[...q];_[p]=xt(a,c,j);let P=B;B===t?P=s:t<B&&s>=B?P=B-1:t>B&&s<=B&&(P=B+1),G(P),dt(_[p],c,P),Ye(_)},rn=t=>{const s=t??p;if(s===null||!V)return;const a=q[s],c=Be[s];if(!a||!c)return;const S=so(a,c);if(!S){X.error(i("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const j=[...q];j[s]=S.section;const _=Ut(j,r)[s];if(!_?.isMultivariate){X.error(i("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}N(s),G(S.newVariantIndex),$([]),H(P=>P+1),dt(S.section,_,S.newVariantIndex,s),Ye(j)},sa=()=>{if(p===null||!V)return;const t=q[p],s=Be[p];if(!t||!s?.isMultivariate)return;const a=tt(t,s);if(!a)return;const c=io(t,s,a);if(!c){X.error(i("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const S=[...q];S[p]=c;const j=Ut(S,r)[p];if(!j)return;G(0),Ne(null),Re(null),$([]),H(P=>P+1);const _=bt(c,j,r);_?(L(_.data),M(_.resolveType)):(L(null),M(null)),Et(null,p,0),Ye(S)},aa=async t=>{if(se===null||!V)return;const s=mn(t,r);if(s){X.error(s);return}const a=q[se],c=Be[se];if(!a||!c)return;const S=bt(a,c,r);if(!S){X.error(i("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const j={...S.data,name:t};try{await we.mutateAsync({blockKey:t,data:j});const _=[...q];_[se]={__resolveType:t},await we.mutateAsync({blockKey:V,data:At(r,V,_,Ce,He)}),p===se&&kt(),ae(null),X.success(i("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),u?.()}catch(_){X.error(_ instanceof Error?_.message:i("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},En=ut?.rule;if(Bt&&p===null&&J===null&&En){const{resolveType:t,formValue:s}=Tt(En,r??{},l??void 0);Z(t),I(s)}const It=l?Qa(l):[],kn=l&&r?Xa(l,r):[],oa=!Ve&&!!(m&&l&&r),ra=J&&l?Gt(J,l):null,Rt=()=>{st.current&&(clearTimeout(st.current),st.current=null),at.current&&(clearTimeout(at.current),at.current=null)},Dt=async(t,s)=>{if(!(vo(s,t,l)>0))try{await Xt.mutateAsync({blockKey:t})}catch(a){X.error(a instanceof Error?a.message:i("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Rn=t=>{st.current&&clearTimeout(st.current),st.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:c}=Xe.current;if(!s)return;const S={...a[s]},j={...S.sections},_=[...j.variants??[]],P=_[c],te=P?.rule;if(wt(te,a,l)){const C=te?.__resolveType??"",U=a[C],W=typeof U?.name=="string"?U.name:C,{__resolveType:_e,...Y}=t;we.mutate({blockKey:C,data:Vt(_e??"",Y,W)},{onSuccess:()=>u?.(),onError:Q=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Q.message}))});return}P&&(_[c]={...P,rule:t}),S.sections={...j,variants:_},we.mutate({blockKey:s,data:S},{onSuccess:()=>u?.(),onError:C=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},fn)},ia=t=>{Z(t);const s=t?Ln(t,l):{__resolveType:Fn};I(t?s:{}),Rn(s)},la=t=>{const s=t;I(s);const a=J?{__resolveType:J,...s}:{...s};Rn(a)},ca=async t=>{Rt();const{activePageKey:s,decofile:a,variantIndex:c}=Xe.current;if(!s)return;const S=a[s],j=S?.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const P=[..._.variants],te=P[c];if(!te)return;const C=Pt(te.rule,a,l),U=qt(t);P[c]={...te,rule:U};const W={...a,[s]:{...S,sections:{..._,variants:P}}},{resolveType:_e,formValue:Y}=Tt(U,W,l??void 0);Z(_e),I(Y);try{await we.mutateAsync({blockKey:s,data:W[s]}),C&&C!==t&&await Dt(C,W),u?.()}catch(Q){X.error(Q instanceof Error?Q.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},wn=t=>{at.current&&clearTimeout(at.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=Xe.current;s!==null&&(at.current=setTimeout(()=>{const{rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current;if(!_)return;const C=c[s],U=S[s];if(!C||!U?.isMultivariate)return;const W=tt(C,U);if(!W)return;const Y=(W.variants??[])[a]?.rule;if(wt(Y,j,l)){const ve=Y?.__resolveType??"",Je=j[ve],rt=typeof Je?.name=="string"?Je.name:ve,{__resolveType:pt,...it}=t;we.mutate({blockKey:ve,data:Vt(pt??"",it,rt)},{onSuccess:()=>u?.(),onError:gt=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:gt.message}))});return}const Q=Kn(W,a,t),Pe=[...c];Pe[s]=xt(C,U,Q);const Ze=At(j,_,Pe,te,P);we.mutate({blockKey:_,data:Ze},{onSuccess:()=>u?.(),onError:ve=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:ve.message}))})},fn))},ua=t=>{Ne(t);const s=t?Ln(t,l):{__resolveType:Fn};Re(t?s:{}),wn(s)},da=t=>{const s=t;Re(s);const a=We?{__resolveType:We,...s}:{...s};wn(a)},ma=async t=>{Rt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current;if(s===null||!_)return;const C=c[s],U=S[s];if(!C||!U?.isMultivariate)return;const W=tt(C,U);if(!W)return;const _e=W.variants??[],Y=Pt(_e[a]?.rule,j,l),Q=qt(t),Pe=Kn(W,a,Q),Ze=[...c];Ze[s]=xt(C,U,Pe);const ve=At(j,_,Ze,te,P),Je={...j,[_]:ve},{resolveType:rt,formValue:pt}=Tt(Q,Je,l??void 0);Ne(rt),Re(pt);try{await we.mutateAsync({blockKey:_,data:ve}),Y&&Y!==t&&await Dt(Y,Je),u?.()}catch(it){X.error(it instanceof Error?it.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ve&&!qe)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.noPageFound",{currentPath:b})});if(Ve&&!en)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.globalBlockNotFound")});const mt=p!==null?Be[p]??null:null,Vn=p!==null?q[p]:null,Nn=Vn&&mt?.isMultivariate?tt(Vn,mt):null,St=Nn?Mn(Nn,lt):[],ln=Math.min(B,Math.max(St.length-1,0)),$t=St[ln]??null,ft=mt?.isMultivariate===!0,Dn=p!==null&&mt!==null,zt=Dn&&(ft||!!(an&&ie)),fa=zt&&!Ve&&mt?.isSavedBlock===!0,ot=Ve||fa,pa=Ve?Sn:mt?.label??"",ga=We&&l?Gt(We,l):null,cn=zt&&(!Ve||ee.length>0)?Ve?[Sn,...ee]:[qe.name,mt.label,...ft&&$t?[$t.label]:[],...ee]:[],ha=T&&qe?[qe.name,"SEO",...Le]:[],Ht=T?ha:ot?cn.length>0?cn:[pa]:cn,va=!T&&!Ve&&ft&&ee.length===0,Tn=()=>{if(!V)return;Rt(),Fe.current&&(clearTimeout(Fe.current),Fe.current=null);const t=r[V],s=ao(t.sections,q);if(!s)return;const a=oo(s);we.mutate({blockKey:V,data:{...t,sections:s}},{onSuccess:()=>{O(a),N(null),L(null),M(null),$([]),I(null),Z(null)},onError:c=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},un=(t,s,a)=>{if(!V)return;Rt(),Fe.current&&(clearTimeout(Fe.current),Fe.current=null);const c=r[V],S=c.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const j=S;if(!Array.isArray(j.variants))return;const _=t([...j.variants]);if(!_)return;const P=bo(j,_),te={...r,[V]:{...c,sections:P}};we.mutate({blockKey:V,data:te[V]},{onSuccess:()=>{s?.(),a&&Dt(a,te)},onError:C=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},Sa=t=>{oe(null),O(t),N(null),L(null),M(null),$([]);const s=He[t]?.rule,{resolveType:a,formValue:c}=Tt(s,r??{},l??void 0);Z(a),I(c),yn(He.map(S=>({rule:S.rule})),t)},ba=(t,s)=>{if(t===s)return;let a=Ce;Ce===t?a=s:t<Ce&&s>=Ce?a=Ce-1:t>Ce&&s<=Ce&&(a=Ce+1),O(a);const c=Mt(He.map(S=>({rule:S.rule})),t,s);yn(c,a),un(S=>Mt(S,t,s))},xa=t=>{const s=He[t]?.rule,a=Pt(s,r??{},l??void 0);un(c=>c.length<=1?null:(c.splice(t,1),c),()=>{He.length-1===1?O(0):t<Ce?O(Ce-1):t===Ce&&O(Math.max(0,t-1)),N(null),L(null),M(null),$([]),I(null),Z(null)},a)},ya=t=>{un(s=>xo(s,t),()=>{O(t+1),N(null),L(null),M(null),$([]),I(null),Z(null)})},_a=async(t,s)=>{Rt(),Fe.current&&(clearTimeout(Fe.current),Fe.current=null);const a=Xe.current.activePageKey,c=Xe.current.decofile;if(!a)return;const S=c[a],j=S.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const P=[..._.variants],te=P[t];if(!te?.rule||typeof te.rule!="object"){X.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const C=te.rule,U=s.trim();Lt(!0);try{if(!U){if(!wt(C,c,l)){oe(null);return}const Ze=C.__resolveType??"";P[t]={...te,rule:Bn(C,c,l)};const ve={...c,[a]:{...S,sections:{..._,variants:P}}};await we.mutateAsync({blockKey:a,data:ve[a]}),await Dt(Ze,ve),oe(null),u?.();return}const W=On(C,c,l);if(!W){X.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(W.blockKey){await we.mutateAsync({blockKey:W.blockKey,data:Vt(W.resolveType,W.data,U)}),oe(null),u?.();return}const _e=dn(U),Y=mn(_e,c);if(Y){X.error(Y);return}const Q=Vt(W.resolveType,W.data,U);let Pe=null;try{await we.mutateAsync({blockKey:_e,data:Q}),Pe=_e,P[t]={...te,rule:qt(_e)},await we.mutateAsync({blockKey:a,data:{...S,sections:{..._,variants:P}}}),Pe=null}catch(Ze){throw Pe&&await Xt.mutateAsync({blockKey:Pe}).catch(()=>{}),Ze}oe(null),X.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:U})),u?.()}catch(W){X.error(W instanceof Error?W.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Lt(!1)}},ja=async(t,s)=>{Rt(),Fe.current&&(clearTimeout(Fe.current),Fe.current=null);const{selectedSectionIndex:a,rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current;if(a===null||!_)return;const C=c[a],U=S[a];if(!C||!U?.isMultivariate)return;const W=tt(C,U);if(!W)return;const _e=W.variants??[],Y=_e[t];if(!Y?.rule||typeof Y.rule!="object"){X.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Q=Y.rule,Pe=s.trim();Lt(!0);const Ze=async ve=>{const Je={...W,variants:ve},rt=[...c];rt[a]=xt(C,U,Je);const pt=At(j,_,rt,te,P);return await we.mutateAsync({blockKey:_,data:pt}),{...j,[_]:pt}};try{if(!Pe){if(!wt(Q,j,l)){le(null);return}const gt=Q.__resolveType??"",Cn=[..._e];Cn[t]={...Y,rule:Bn(Q,j,l)};const Va=await Ze(Cn);await Dt(gt,Va),le(null),u?.();return}const ve=On(Q,j,l);if(!ve){X.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(ve.blockKey){await we.mutateAsync({blockKey:ve.blockKey,data:Vt(ve.resolveType,ve.data,Pe)}),le(null),u?.();return}const Je=dn(Pe),rt=mn(Je,j);if(rt){X.error(rt);return}const pt=Vt(ve.resolveType,ve.data,Pe);let it=null;try{await we.mutateAsync({blockKey:Je,data:pt}),it=Je;const gt=[..._e];gt[t]={...Y,rule:qt(Je)},await Ze(gt),it=null}catch(gt){throw it&&await Xt.mutateAsync({blockKey:it}).catch(()=>{}),gt}le(null),X.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Pe})),u?.()}catch(ve){X.error(ve instanceof Error?ve.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Lt(!1)}},Pn=()=>{kt()},Ea=t=>{Ee(t),on({inner:t})},ka=t=>{ke(t),on({raw:t})},Ra=()=>{Ee(null),Te([])},wa=()=>F(t=>t+1),An=t=>{if(T){if(t===0){Qt.flush(),Ke(!1),Ee(null),ke(void 0),Te([]),F(a=>a+1),k?.();return}if(t===1){Te([]),F(a=>a+1);return}Te(Le.slice(0,t-1)),F(a=>a+1);return}if(Ve){$(ee.slice(0,t)),H(a=>a+1);return}if(t===0){Pn();return}if(t===1){$([]),H(a=>a+1);return}if(ft&&t===2){$([]),H(a=>a+1);return}const s=ft?2:1;$(ee.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:ot||zt||T?n.jsxs("div",{className:Oe("border-b px-3 py-2.5",ot&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[Ht.length>1&&n.jsx("button",{type:"button",onClick:()=>An(yo(Ht.length,{isMultivariateSectionTop:va})),title:i("sectionsEditor.sectionsEditor.back"),"aria-label":i("sectionsEditor.sectionsEditor.back"),className:Oe("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",ot?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(ts,{className:"size-4"})}),!Ve&&Bt&&ut&&n.jsxs("button",{type:"button",onClick:Pn,title:i("sectionsEditor.sectionsEditor.editingInVariant",{variant:ut.label}),className:Oe("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",xr),children:[n.jsx(Es,{rule:Ct(ut.rule,r??{},l??void 0),matchers:It}),n.jsx("span",{className:"max-w-[160px] truncate",children:ut.label})]}),n.jsx("nav",{"aria-label":i("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Ht.map((t,s)=>{const a=s===Ht.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(ns,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>An(s),title:t,className:Oe("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?ot?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":ot?"text-foreground/80":"text-muted-foreground",ot?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${s}`)})}),ot&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Vo,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(jt,{side:"bottom",className:"max-w-[260px]",children:i("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Dn&&!ft&&!mt?.isHidden&&V&&n.jsx(Wn,{onClick:()=>rn()})]}),ot&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:i("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(_r,{pageKey:V,initialName:qe.name,initialPath:qe.path,onFieldChange:Hs})}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Ke(!0),children:n.jsx(ko,{size:14})})}),n.jsx(jt,{side:"bottom",children:i("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>D&&V?D(V):be(!0),children:n.jsx(Ro,{size:14})})}),n.jsx(jt,{side:"bottom",children:i("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(Wn,{onClick:Tn})]})}),T?n.jsx(Yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ft&&V?n.jsx(Uo,{rawSeo:nn,innerSeo:bn,defaultResolveType:Fs,seoSchema:Bs,activeResolveType:sn,seoTypeOptions:Ls,formResetKey:ze,siteDefaultSeo:Os,onBreadcrumbChange:Te,onPersistRaw:ka,onInnerChange:Ea,onClearForm:Ra,onBumpFormKey:wa}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})}):zt?n.jsxs(Yt,{viewportRef:Ae,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ft&&St.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Za,{listKey:`${V??""}:${p??""}`,variants:St.map((t,s)=>({index:s,label:t.label})),selectedIndex:ln,onSelect:Zs,onRename:le,onDuplicate:ta,onDelete:ea,onRemoveAll:sa,onReorder:na,onAdd:()=>rn()}),ft&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(qn,{currentRt:We??"",currentLabel:Wt($t?.rule,r??{},lt,l??void 0),currentGlobalKey:Pt($t?.rule,r??{},l??void 0)??void 0,matchers:It,globals:kn,onSelect:ua,onSelectGlobal:ma,schema:ga,formValue:nt,onChange:da,formKey:`${p??"none"}:${ln}:${We??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot})]})]}),n.jsx(Un,{activeSchema:an,formValue:ie,formResetKey:Se,onFormChange:_n,onBreadcrumbChange:$,breadcrumbPath:ee,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot,previewBaseUrl:m,onRequestAddSection:jn})]}):Ve?n.jsx(Yt,{viewportRef:Ae,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Un,{activeSchema:an,formValue:ie,formResetKey:Se,onFormChange:_n,onBreadcrumbChange:$,breadcrumbPath:ee,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot,previewBaseUrl:m,onRequestAddSection:jn})}):n.jsxs(Yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Bt&&V&&n.jsx(vr,{listKey:V,variants:He,activeIndex:Ce,decofile:r??{},meta:l,matchers:It,onSelect:Sa,onReorder:ba,onRename:oe,onDuplicate:ya,onDelete:xa,onAdd:Tn}),Bt&&J!==null&&n.jsxs("div",{className:Oe("px-3 border-b",fe?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>De(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":fe,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i("sectionsEditor.sectionsEditor.variantRule")}),fe?n.jsx(wo,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(_o,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),fe&&n.jsx("div",{className:Oe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(qn,{currentRt:J,currentLabel:Wt(ut?.rule,r??{},lt,l??void 0),currentGlobalKey:Pt(ut?.rule,r??{},l??void 0)??void 0,matchers:It,globals:kn,onSelect:ia,onSelectGlobal:ca,schema:ra,formValue:me,onChange:la,formKey:`${Ce}:${J??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(lr,{listKey:`${V??""}-${Ce}`,rawSections:q,sections:Be,meta:l,selectedIndex:p,onSelect:zs,onReorder:Gs,onDelete:Us,onDuplicate:Ws,onMakeReusable:ae,onToggleHidden:qs,onToggleLazy:Ys,onAddVariant:rn,onDetach:Js,onAddSection:()=>re(!0),canAddSection:oa})})]}),n.jsx(eo,{open:se!==null,onOpenChange:t=>{t||ae(null)},defaultBlockId:se!==null?dn(Be[se]?.label??""):"",isPending:we.isPending,onSubmit:aa}),m&&n.jsx(Yo,{open:je,onOpenChange:t=>{re(t),t||(xe.current=null)},meta:l,decofile:r,previewBaseUrl:m,onSelect:Xs}),pe&&V&&r&&n.jsx(to,{open:pe,onOpenChange:be,pageKey:V,decofile:r}),ue!==null&&n.jsx(Hn,{open:!0,initialName:wt(He[ue]?.rule,r??{},l??void 0)?Wt(He[ue]?.rule,r??{},lt,l??void 0):"",autoLabel:lt(Ct(He[ue]?.rule,r??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await _a(ue,t)},onOpenChange:t=>{!t&&!Nt&&oe(null)}}),de!==null&&n.jsx(Hn,{open:!0,initialName:wt(St[de]?.rule,r??{},l??void 0)?Wt(St[de]?.rule,r??{},lt,l??void 0):"",autoLabel:lt(Ct(St[de]?.rule,r??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await ja(de,t)},onOpenChange:t=>{!t&&!Nt&&le(null)}})]})}export{uc as SectionsEditor};
|
|
1
|
+
import{c as Ue,b as ct,r as w,m as Oe,j as n,af as Yn,B as Qe,k as Jn,o as Na,t as X,K as Da}from"./index-CZrBPeSF.js";import{a6 as Ta,a7 as Pa,a8 as Aa,a9 as Qn,aa as Xn,ab as Ca,ac as Ma,ad as Ka,N as La,ae as Ba,af as Ct,ag as Fa,S as Zn,ah as lt,ai as Oa,aj as Ia,ak as $a,al as za,D as Ha,F as Ga,am as Ua,an as Wa,ao as qa,ap as Ya,a0 as Gt,aq as Ut,ar as Ja,as as xt,at as Tt,au as Qa,av as Xa,aw as tt,ax as Mn,ay as Za,az as Pt,aA as Wt,aB as eo,aC as dn,aD as to,aE as wt,aF as no,aG as so,aH as ao,aI as oo,aJ as ro,aK as bt,aL as io,aM as lo,aN as co,H as uo,aO as Kn,aP as At,aQ as Ln,aR as Bn,aS as mo,aT as fo,aU as po,aV as go,aW as mn,aX as Fn,aY as On,aZ as Vt,a_ as qt,a$ as In,b0 as ho,b1 as fn,b2 as vo,b3 as So,b4 as xo,b5 as bo,b6 as yo}from"./index-CwBzuD_m.js";import{t as _o}from"./ChevronDown-DhOhINAM.js";import{a4 as gn,y as jo,Y as es,J as Eo,x as ts,a6 as ko,a7 as Ro}from"./agent-icon-CtiUyn5V.js";import{i as ns}from"./ChevronRight-Dia-WW4B.js";import{n as wo}from"./ChevronUp-DYAPwS7D.js";import{i as Vo}from"./Tool02-RPFrSRbs.js";import{l as Yt}from"./automation-runs-D22hl0By.js";import{c as yt,T as _t,a as jt}from"./tooltip-DlGzqhnP.js";import{b as No,h as Do,a as To,c as Po,d as Ao,e as Co}from"./dialog-BEE2ieIv.js";import{I as Mo}from"./input-DfW0n64T.js";import{a as ss}from"./Copy01-DxBV3dt3.js";import{i as Ko}from"./Settings02-CVwE6_LX.js";import{s as Lo}from"./Eye-Bc6OKV-y.js";import{s as as}from"./TrendUp01-5fmO9zBH.js";import{s as hn}from"./Plus-L2K4KGAP.js";import{s as os}from"./Trash01-DwKFwhTe.js";import{i as Bo}from"./Zap-BCvJyZqp.js";import{a as ht,D as rs,b as is,c as ls,i as Fo}from"./dropdown-menu-CScom-4o.js";import{o as cs,p as Jt,K as us,P as ds,q as ms,z as fs,C as ps,A as gs,B as Mt,D as hs,v as vs,x as Ss,y as xs}from"./index-Ck4HNDeL.js";import{S as Oo,r as $n,u as Io,d as $o,a as zo,i as Ho,f as Go,P as Uo,b as Wo}from"./page-seo-form-BnD0FsnZ.js";import{c as qo}from"./Tool01-DN0PeFAX.js";import{A as Yo}from"./add-section-modal-Bgum13n2.js";import"./ArrowUp-CEnxQhJa.js";import"./chat-context-DQXfzeZ1.js";import"./tab-id-TIvCa4AH.js";import"./Check-PvwAFW5_.js";import"./hooks-D2DXSkUb.js";import"./use-mcp-client-C-LnBBuJ.js";import"./auth-B6wLv_ge.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-dCMollnS.js";import"./studio-tools-DZ4A4LK4.js";import"./use-virtual-mcp-333MNW6F.js";import"./use-ai-providers-CIIrncdr.js";import"./use-decopilot-events-BQ6ItOFo.js";import"./use-organization-settings-VTvhO8RM.js";import"./spinner-BruVqM08.js";import"./drawer-D_zlJSIa.js";import"./collection-search-CQ4hmVx6.js";import"./SearchMd-DSheghKh.js";import"./use-mobile-hjfr3xoA.js";import"./AreaChart-BZd2BMDX.js";import"./index-L22QcARJ.js";import"./calendar-DiPJMbZr.js";import"./X-C9xR6k_q.js";import"./shell-layout-BLNXlEs8.js";import"./avatar-DTq8LB7h.js";import"./User01-CMegumei.js";import"./Users03-B_aCu_uX.js";import"./SearchLg-DD_M63q4.js";import"./Stars02-CKPBAOIU.js";import"./XClose-D6PNomGP.js";import"./CheckCircle-tNfHHzqR.js";import"./CpuChip01-DnKRaqtj.js";import"./FilterLines-DxJRwle6.js";import"./Monitor01-8Zn_oQLH.js";import"./use-is-desktop-app-BNujXJc_.js";import"./required-auth-layout-CX-j8fcs.js";import"./use-org-sso-mDWe3mwz.js";import"./ZapSquare-B_xZPtA0.js";import"./Star01-Bb-AArDe.js";import"./Upload01-CEZ0vqHA.js";import"./AlertCircle-BVRdcAr7.js";import"./form-BBxBIdP7.js";import"./label-u1FnGPif.js";import"./select-n4tYtSWP.js";import"./XCircle-qIYKCuWZ.js";import"./tabs-CmlSCOKE.js";import"./toggle-group-DJogx7Sw.js";import"./use-deco-credits-CRRWJZpL.js";import"./sidebar-BTOMGewK.js";import"./LayoutLeft-Dn612JDh.js";import"./popover-AjzmM7C7.js";import"./alert-dialog-Cy_KM5bI.js";import"./toolbar-4Xs9gQqE.js";import"./skeleton-BSh29Pqn.js";import"./github-repo-picker-_fOGWT5B.js";import"./use-debounced-value-CXreFFvV.js";import"./use-connection-BzoGO_rZ.js";import"./authenticate-and-persist-oauth-UMzs9VZn.js";import"./mcp-oauth-BNg8UA_R.js";import"./LinkExternal01-BRfN9dRJ.js";import"./use-mcp-tools-BxFrq8sY.js";import"./extract-connection-data-CQ3H7X46.js";import"./metadata-dUsYcpuu.js";import"./use-navigate-to-agent-DLULuM6_.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-C2RHf8fG.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-rF4iZROi.js";import"./use-registry-connections-6V_OOVJn.js";import"./useInfiniteQuery-jDP8kOiZ.js";import"./use-infinite-scroll-BIsiRuqk.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-CrBmylnL.js";import"./integration-icon-BriL0gdd.js";import"./textarea-CzJQ4jof.js";import"./connection-form-helpers-BZGXkBOU.js";import"./collection-tabs-BGGP3Q4Q.js";import"./badge-DCJPq-TC.js";import"./useSuspenseInfiniteQuery-BKk4QAmj.js";import"./select-model-DLYysGmM.js";import"./checkbox-CCkUa9zL.js";import"./Key01-Bmye11fH.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B4sxMatG.js";import"./ArrowUpRight-c4UbenX2.js";import"./Stars01-BabGpMQS.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-0NlGQGcq.js";import"./empty-state-BW9CnFTA.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-D8lE65Qq.js";import"./monaco-editor-Cq8a3e0Q.js";import"./pt-BR-CLy76QW2.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-mcp-auth-status-2CuEn9Ao.js";import"./DotsVertical-CKorlk4R.js";import"./Play-GbRXM_X_.js";import"./use-debounced-autosave-6rt-rF4t.js";import"./index-NKgRHLP_.js";import"./search-input-B6b2ZnBA.js";import"./switch-Capnufwf.js";import"./Users01-C2x7fgEw.js";import"./use-secrets-C3APoSVc.js";import"./format-time-BnbuEtat.js";import"./use-members-6mtN34eU.js";import"./use-org-auth-client-Dd2A-3_W.js";import"./command-Bw3jNeoH.js";import"./index-DTrEhN5C.js";import"./useQueries-CJIQxjbc.js";import"./SwitchHorizontal01-n8F4B6uE.js";import"./Palette-CLRvU0eK.js";import"./use-file-configs-CfPB3s7t.js";import"./use-automations-oR1lkik8.js";import"./automation-list-row-CqpWerJJ.js";import"./get-initials-D-f_fDFw.js";import"./HardDrive-BiWDyH7C.js";import"./LogOut01-CHgz8ujG.js";import"./Sun-CvM5J-FW.js";import"./Shield01-BtLPYIWD.js";import"./table-BhXfGt_D.js";import"./use-clock-tick-CV-pJYBs.js";import"./use-copy-CUMl3QMe.js";import"./use-tags-CNwvMQjY.js";import"./companions-core-Be1fT7Qa.js";function Jo(h){return h.schema?.definitions??h.schema?.$defs??{}}function Qo(h,e){const o=Jo(e),d=o[btoa(h)];if(!d)return;let m=typeof d.image=="string"?d.image:void 0;if(!m&&Array.isArray(d.allOf)){const x=d.allOf.find(b=>typeof b.$ref=="string")?.$ref;if(typeof x=="string"){const b=x.replace("#/definitions/",""),f=o[b];m=typeof f?.image=="string"?f.image:void 0}}if(m?.includes("{{{"))return m}function Xo(h,e){if(!e)return;const o=Ta(h);if(!o)return;const d=Qo(o.resolveType,e);if(!d)return;const m=Pa(d,o.data);if(m)return Aa(m)}const Zo="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",er="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function zn(h){return Array.from({length:h},(e,o)=>({id:crypto.randomUUID(),index:o}))}function bs(h){return h.map((e,o)=>({...e,index:o}))}function tr(h,e){if(e===h.length)return h;if(e<h.length)return bs(h.slice(0,e));const o=Array.from({length:e-h.length},(d,m)=>({id:crypto.randomUUID(),index:h.length+m}));return[...h,...o]}function ys(h){const e=Ue.c(20),{section:o,raw:d,meta:m}=h,x=o.isSavedBlock===!0,b=o.isMultivariate===!0;let f;e[0]!==m||e[1]!==d?(f=d&&m?Xo(d,m):void 0,e[0]=m,e[1]=d,e[2]=f):f=e[2];const v=f;let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(jo,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=u):u=e[3];let y;e[4]!==v?(y=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=y):y=e[5];let k;e[6]!==b||e[7]!==x?(k=x?{color:La}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=b,e[7]=x,e[8]=k):k=e[8];let D;e[9]!==k?(D=n.jsx(gn,{className:"h-4 w-4 shrink-0",style:k}),e[9]=k,e[10]=D):D=e[10];const E=o.isHidden&&"line-through opacity-50";let i;e[11]!==E?(i=Oe("min-w-0 flex-1 truncate text-sm font-medium",E),e[11]=E,e[12]=i):i=e[12];let g;e[13]!==o.label||e[14]!==i?(g=n.jsx("span",{className:i,children:o.label}),e[13]=o.label,e[14]=i,e[15]=g):g=e[15];let r;return e[16]!==y||e[17]!==D||e[18]!==g?(r=n.jsxs(n.Fragment,{children:[u,y,D,g]}),e[16]=y,e[17]=D,e[18]=g,e[19]=r):r=e[19],r}function _s(h,e){const o=h.isSavedBlock===!0,d=h.isMultivariate===!0;return Oe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?Zo:d?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function nr(h){const e=Ue.c(81),{section:o,raw:d,meta:m,sortableId:x,selected:b,onSelect:f,onDelete:v,onDuplicate:u,onMakeReusable:y,onToggleHidden:k,onToggleLazy:D,onAddVariant:E,onDetach:i}=h,g=ct(),r=d?Xn(d.__resolveType??""):!1;let A;e[0]!==o?(A=Ca(o),e[0]=o,e[1]=A):A=e[1];const l=A;let R;e[2]!==x?(R={id:x,animateLayoutChanges:ir},e[2]=x,e[3]=R):R=e[3];const{attributes:K,listeners:z,setNodeRef:p,transform:N,isDragging:ie}=fs(R);let L;e[4]!==N?(L=ps.Transform.toString(N?{...N,x:0}:null),e[4]=N,e[5]=L):L=e[5];const ce=ie?0:void 0;let M;e[6]!==L||e[7]!==ce?(M={transform:L,opacity:ce},e[6]=L,e[7]=ce,e[8]=M):M=e[8];const ge=M;let O;e[9]!==o?(O=Ma(o),e[9]=o,e[10]=O):O=e[10];const ne=O,he="button",me=0;let I;e[11]!==f?(I=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),f())},e[11]=f,e[12]=I):I=e[12];const J=ie?"cursor-grabbing":"cursor-pointer";let Z;e[13]!==o||e[14]!==b||e[15]!==J?(Z=Oe("touch-none transition-colors",J,_s(o,b)),e[13]=o,e[14]=b,e[15]=J,e[16]=Z):Z=e[16];let ee;e[17]!==m||e[18]!==d||e[19]!==o?(ee=n.jsx(ys,{section:o,raw:d,meta:m}),e[17]=m,e[18]=d,e[19]=o,e[20]=ee):ee=e[20];const $=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":g(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Oe("h-7 w-7 shrink-0",r?"":"opacity-0 group-hover:opacity-100"),onClick:T=>{T.stopPropagation(),D()},onPointerDown:rr,children:n.jsx(Bo,{className:Oe("h-3.5 w-3.5",r&&"text-yellow-500")})})}),n.jsx(jt,{side:"bottom",children:g(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]});let Ae;e[21]!==k||e[22]!==o.isHidden||e[23]!==o.isMultivariate||e[24]!==g?(Ae=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":o.isHidden?g("sectionsEditor.sectionList.showSection"):g("sectionsEditor.sectionList.hideSection"),className:Oe("h-7 w-7 shrink-0",o.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:T=>{T.stopPropagation(),k()},onPointerDown:or,children:o.isHidden?n.jsx(Ko,{className:"h-3.5 w-3.5"}):n.jsx(Lo,{className:"h-3.5 w-3.5"})})}),n.jsx(jt,{side:"bottom",children:o.isHidden?g("sectionsEditor.sectionList.showSection"):g("sectionsEditor.sectionList.hideSection")})]}),e[21]=k,e[22]=o.isHidden,e[23]=o.isMultivariate,e[24]=g,e[25]=Ae):Ae=e[25];let Me;e[26]!==g?(Me=g("sectionsEditor.sectionList.sectionActionsMenu"),e[26]=g,e[27]=Me):Me=e[27];let et;e[28]===Symbol.for("react.memo_cache_sentinel")?(et=n.jsx(es,{className:"h-3.5 w-3.5"}),e[28]=et):et=e[28];let Se;e[29]!==Me?(Se=n.jsx(rs,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":Me,className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:ar,onPointerDown:sr,children:et})}),e[29]=Me,e[30]=Se):Se=e[30];let H;e[31]!==u?(H=T=>{T.stopPropagation(),u()},e[31]=u,e[32]=H):H=e[32];let se;e[33]===Symbol.for("react.memo_cache_sentinel")?(se=n.jsx(ss,{className:"h-4 w-4"}),e[33]=se):se=e[33];let ae;e[34]!==g?(ae=g("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=g,e[35]=ae):ae=e[35];let ue;e[36]!==H||e[37]!==ae?(ue=n.jsxs(ht,{onClick:H,children:[se,ae]}),e[36]=H,e[37]=ae,e[38]=ue):ue=e[38];let oe;e[39]!==l||e[40]!==E||e[41]!==g?(oe=l&&n.jsxs(ht,{className:Ka,onClick:T=>{T.stopPropagation(),E()},children:[n.jsx(as,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=l,e[40]=E,e[41]=g,e[42]=oe):oe=e[42];let de;e[43]!==ne||e[44]!==y||e[45]!==g?(de=ne&&n.jsxs(ht,{className:er,onClick:T=>{T.stopPropagation(),y()},children:[n.jsx(gn,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=ne,e[44]=y,e[45]=g,e[46]=de):de=e[46];let le;e[47]!==i||e[48]!==o.isMultivariate||e[49]!==o.isSavedBlock||e[50]!==g?(le=o.isSavedBlock===!0&&!o.isMultivariate&&n.jsxs(ht,{onClick:T=>{T.stopPropagation(),i()},children:[n.jsx(gn,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=i,e[48]=o.isMultivariate,e[49]=o.isSavedBlock,e[50]=g,e[51]=le):le=e[51];let fe;e[52]!==v?(fe=T=>{T.stopPropagation(),v()},e[52]=v,e[53]=fe):fe=e[53];let De;e[54]===Symbol.for("react.memo_cache_sentinel")?(De=n.jsx(os,{className:"h-4 w-4"}),e[54]=De):De=e[54];let je;e[55]!==g?(je=g("sectionsEditor.sectionList.deleteMenuItem"),e[55]=g,e[56]=je):je=e[56];let re;e[57]!==fe||e[58]!==je?(re=n.jsxs(ht,{className:"text-destructive focus:text-destructive",onClick:fe,children:[De,je]}),e[57]=fe,e[58]=je,e[59]=re):re=e[59];let pe;e[60]!==ue||e[61]!==oe||e[62]!==de||e[63]!==le||e[64]!==re?(pe=n.jsxs(is,{align:"end",className:"w-44",children:[ue,oe,de,le,re]}),e[60]=ue,e[61]=oe,e[62]=de,e[63]=le,e[64]=re,e[65]=pe):pe=e[65];let xe;e[66]!==Se||e[67]!==pe?(xe=n.jsxs(ls,{children:[Se,pe]}),e[66]=Se,e[67]=pe,e[68]=xe):xe=e[68];let be;return e[69]!==K||e[70]!==z||e[71]!==f||e[72]!==p||e[73]!==ge||e[74]!==Z||e[75]!==ee||e[76]!==$||e[77]!==Ae||e[78]!==xe||e[79]!==I?(be=n.jsxs("div",{ref:p,style:ge,...K,...z,role:he,tabIndex:me,onClick:f,onKeyDown:I,className:Z,children:[ee,$,Ae,xe]}),e[69]=K,e[70]=z,e[71]=f,e[72]=p,e[73]=ge,e[74]=Z,e[75]=ee,e[76]=$,e[77]=Ae,e[78]=xe,e[79]=I,e[80]=be):be=e[80],be}function sr(h){return h.stopPropagation()}function ar(h){return h.stopPropagation()}function or(h){return h.stopPropagation()}function rr(h){return h.stopPropagation()}function ir(){return!1}function lr(h){const e=Ue.c(104),{listKey:o,rawSections:d,sections:m,meta:x,selectedIndex:b,onSelect:f,onReorder:v,onDelete:u,onDuplicate:y,onMakeReusable:k,onToggleHidden:D,onToggleLazy:E,onAddVariant:i,onDetach:g,onAddSection:r,canAddSection:A}=h,l=A===void 0?!0:A,R=ct();let K;e[0]!==m.length?(K=()=>zn(m.length),e[0]=m.length,e[1]=K):K=e[1];const[z,p]=w.useState(K),[N,ie]=w.useState(null),[L,ce]=w.useState(o),[M,ge]=w.useState(m.length),O=w.useRef(!1);L!==o?(ce(o),ge(m.length),p(zn(m.length))):M!==m.length&&(ge(m.length),p(ze=>tr(ze,m.length)));let ne;e[2]===Symbol.for("react.memo_cache_sentinel")?(ne={activationConstraint:{distance:8}},e[2]=ne):ne=e[2];let he;e[3]===Symbol.for("react.memo_cache_sentinel")?(he={coordinateGetter:gs},e[3]=he):he=e[3];const me=cs(Jt(ds,ne),Jt(us,he));let I;e[4]!==z?(I=z.map(cr),e[4]=z,e[5]=I):I=e[5];const J=I;let Z;e[6]===Symbol.for("react.memo_cache_sentinel")?(Z=ze=>{ie(String(ze.active.id))},e[6]=Z):Z=e[6];const ee=Z;let $;e[7]!==J||e[8]!==v?($=ze=>{ie(null);const{active:B,over:F}=ze;if(!F||B.id===F.id)return;const G=J.indexOf(String(B.id)),nt=J.indexOf(String(F.id));G===-1||nt===-1||(p(Re=>bs(Mt([...Re],G,nt))),O.current=!0,requestAnimationFrame(()=>{O.current=!1}),v?.(G,nt))},e[7]=J,e[8]=v,e[9]=$):$=e[9];const Ae=$;let Me;e[10]===Symbol.for("react.memo_cache_sentinel")?(Me=()=>{ie(null)},e[10]=Me):Me=e[10];const et=Me;let Se,H,se,ae,ue,oe,de,le,fe,De,je,re,pe,xe,be;if(e[11]!==N||e[12]!==l||e[13]!==z||e[14]!==J||e[15]!==Ae||e[16]!==x||e[17]!==r||e[18]!==i||e[19]!==u||e[20]!==g||e[21]!==y||e[22]!==k||e[23]!==f||e[24]!==D||e[25]!==E||e[26]!==d||e[27]!==m||e[28]!==b||e[29]!==me||e[30]!==R){xe=Symbol.for("react.early_return_sentinel");e:{const ze=B=>{O.current||f(B)};if(e[46]!==N||e[47]!==l||e[48]!==z||e[49]!==r||e[50]!==d||e[51]!==m||e[52]!==R){const B=N?z.find(F=>F.id===N):null;if(ae=B!=null?m[B.index]:null,se=B!=null?d[B.index]:void 0,z.length===0){let F;e[56]!==R?(F=R("sectionsEditor.sectionList.noSections"),e[56]=R,e[57]=F):F=e[57];let G;e[58]!==F?(G=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:F}),e[58]=F,e[59]=G):G=e[59];const nt=!l;let Re;e[60]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(hn,{size:14}),e[60]=Re):Re=e[60];let We;e[61]!==R?(We=R("sectionsEditor.sectionList.addSectionButton"),e[61]=R,e[62]=We):We=e[62];let Ne;e[63]!==r||e[64]!==nt||e[65]!==We?(Ne=n.jsxs(Qe,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:nt,onClick:r,children:[Re,We]}),e[63]=r,e[64]=nt,e[65]=We,e[66]=Ne):Ne=e[66];let vt;e[67]!==G||e[68]!==Ne?(vt=n.jsxs("div",{className:"space-y-2",children:[G,Ne]}),e[67]=G,e[68]=Ne,e[69]=vt):vt=e[69],xe=vt;break e}pe=Oe(B&&"cursor-grabbing"),e[46]=N,e[47]=l,e[48]=z,e[49]=r,e[50]=d,e[51]=m,e[52]=R,e[53]=se,e[54]=ae,e[55]=pe}else se=e[53],ae=e[54],pe=e[55];H=hs,le=me,fe=vs,De=ee,je=Ae,re=et,Se=Ss,oe=J,de=xs,be="space-y-1",ue=z.map(B=>{const F=m[B.index];return F?n.jsx(nr,{sortableId:B.id,section:F,raw:d[B.index],meta:x,selected:b===B.index,onSelect:()=>ze(B.index),onDelete:()=>u(B.index),onDuplicate:()=>y(B.index),onMakeReusable:()=>k(B.index),onToggleHidden:()=>D(B.index),onToggleLazy:()=>E(B.index),onAddVariant:()=>i(B.index),onDetach:()=>g(B.index)},B.id):null})}e[11]=N,e[12]=l,e[13]=z,e[14]=J,e[15]=Ae,e[16]=x,e[17]=r,e[18]=i,e[19]=u,e[20]=g,e[21]=y,e[22]=k,e[23]=f,e[24]=D,e[25]=E,e[26]=d,e[27]=m,e[28]=b,e[29]=me,e[30]=R,e[31]=Se,e[32]=H,e[33]=se,e[34]=ae,e[35]=ue,e[36]=oe,e[37]=de,e[38]=le,e[39]=fe,e[40]=De,e[41]=je,e[42]=re,e[43]=pe,e[44]=xe,e[45]=be}else Se=e[31],H=e[32],se=e[33],ae=e[34],ue=e[35],oe=e[36],de=e[37],le=e[38],fe=e[39],De=e[40],je=e[41],re=e[42],pe=e[43],xe=e[44],be=e[45];if(xe!==Symbol.for("react.early_return_sentinel"))return xe;let T;e[70]!==ue||e[71]!==be?(T=n.jsx("div",{className:be,children:ue}),e[70]=ue,e[71]=be,e[72]=T):T=e[72];let Ke;e[73]!==Se||e[74]!==oe||e[75]!==de||e[76]!==T?(Ke=n.jsx(Se,{items:oe,strategy:de,children:T}),e[73]=Se,e[74]=oe,e[75]=de,e[76]=T,e[77]=Ke):Ke=e[77];let Ie;e[78]!==se||e[79]!==ae||e[80]!==x?(Ie=ae?n.jsx("div",{className:Oe("cursor-grabbing shadow-lg ring-1 ring-border/60",_s(ae,!1)),children:n.jsx(ys,{section:ae,raw:se,meta:x})}):null,e[78]=se,e[79]=ae,e[80]=x,e[81]=Ie):Ie=e[81];let Ge;e[82]!==Ie?(Ge=Yn.createPortal(n.jsx(ms,{dropAnimation:Qn,children:Ie}),document.body),e[82]=Ie,e[83]=Ge):Ge=e[83];let $e;e[84]!==H||e[85]!==le||e[86]!==fe||e[87]!==De||e[88]!==je||e[89]!==re||e[90]!==Ke||e[91]!==Ge?($e=n.jsxs(H,{sensors:le,collisionDetection:fe,onDragStart:De,onDragEnd:je,onDragCancel:re,children:[Ke,Ge]}),e[84]=H,e[85]=le,e[86]=fe,e[87]=De,e[88]=je,e[89]=re,e[90]=Ke,e[91]=Ge,e[92]=$e):$e=e[92];const Ee=!l;let ye;e[93]===Symbol.for("react.memo_cache_sentinel")?(ye=n.jsx(hn,{size:14}),e[93]=ye):ye=e[93];let ke;e[94]!==R?(ke=R("sectionsEditor.sectionList.addSectionButton"),e[94]=R,e[95]=ke):ke=e[95];let Le;e[96]!==r||e[97]!==Ee||e[98]!==ke?(Le=n.jsxs(Qe,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Ee,onClick:r,children:[ye,ke]}),e[96]=r,e[97]=Ee,e[98]=ke,e[99]=Le):Le=e[99];let Te;return e[100]!==pe||e[101]!==$e||e[102]!==Le?(Te=n.jsxs("div",{className:pe,children:[$e,Le]}),e[100]=pe,e[101]=$e,e[102]=Le,e[103]=Te):Te=e[103],Te}function cr(h){return h.id}function Hn(h){const e=Ue.c(57),{open:o,initialName:d,autoLabel:m,isPending:x,onSubmit:b,onOpenChange:f}=h,v=x===void 0?!1:x,u=ct(),[y,k]=w.useState(d),[D,E]=w.useState(o);o!==D&&(E(o),o&&k(d));let i;e[0]!==v||e[1]!==f?(i=ee=>{!ee&&!v&&f(!1)},e[0]=v,e[1]=f,e[2]=i):i=e[2];const g=i;let r;e[3]!==v||e[4]!==y||e[5]!==b?(r=async ee=>{ee.preventDefault(),!v&&await b(y.trim())},e[3]=v,e[4]=y,e[5]=b,e[6]=r):r=e[6];const A=r;let l;e[7]!==u?(l=u("sectionsEditor.variantRenameDialog.title"),e[7]=u,e[8]=l):l=e[8];let R;e[9]!==l?(R=n.jsx(No,{children:l}),e[9]=l,e[10]=R):R=e[10];let K;e[11]!==m||e[12]!==u?(K=u("sectionsEditor.variantRenameDialog.description",{fallback:m||u("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=m,e[12]=u,e[13]=K):K=e[13];let z;e[14]!==K?(z=n.jsx(Do,{children:K}),e[14]=K,e[15]=z):z=e[15];let p;e[16]!==R||e[17]!==z?(p=n.jsxs(To,{children:[R,z]}),e[16]=R,e[17]=z,e[18]=p):p=e[18];let N;e[19]!==u?(N=u("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=u,e[20]=N):N=e[20];let ie;e[21]!==N?(ie=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:N}),e[21]=N,e[22]=ie):ie=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=ee=>k(ee.target.value),e[23]=L):L=e[23];let ce;e[24]!==m||e[25]!==v||e[26]!==y?(ce=n.jsx(Mo,{id:"variant-rename-name",value:y,onChange:L,placeholder:m,autoFocus:!0,disabled:v}),e[24]=m,e[25]=v,e[26]=y,e[27]=ce):ce=e[27];let M;e[28]!==ie||e[29]!==ce?(M=n.jsxs("div",{className:"space-y-1.5 py-4",children:[ie,ce]}),e[28]=ie,e[29]=ce,e[30]=M):M=e[30];let ge;e[31]!==f?(ge=()=>f(!1),e[31]=f,e[32]=ge):ge=e[32];let O;e[33]!==u?(O=u("sectionsEditor.variantRenameDialog.cancel"),e[33]=u,e[34]=O):O=e[34];let ne;e[35]!==v||e[36]!==ge||e[37]!==O?(ne=n.jsx(Qe,{type:"button",variant:"outline",onClick:ge,disabled:v,children:O}),e[35]=v,e[36]=ge,e[37]=O,e[38]=ne):ne=e[38];let he;e[39]!==v||e[40]!==u?(he=v?n.jsxs(n.Fragment,{children:[n.jsx(Jn,{size:14,className:"animate-spin"}),u("sectionsEditor.variantRenameDialog.saving")]}):u("sectionsEditor.variantRenameDialog.save"),e[39]=v,e[40]=u,e[41]=he):he=e[41];let me;e[42]!==v||e[43]!==he?(me=n.jsx(Qe,{type:"submit",disabled:v,children:he}),e[42]=v,e[43]=he,e[44]=me):me=e[44];let I;e[45]!==ne||e[46]!==me?(I=n.jsxs(Po,{children:[ne,me]}),e[45]=ne,e[46]=me,e[47]=I):I=e[47];let J;e[48]!==A||e[49]!==M||e[50]!==I||e[51]!==p?(J=n.jsx(Ao,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:A,children:[p,M,I]})}),e[48]=A,e[49]=M,e[50]=I,e[51]=p,e[52]=J):J=e[52];let Z;return e[53]!==g||e[54]!==o||e[55]!==J?(Z=n.jsx(Co,{open:o,onOpenChange:g,children:J}),e[53]=g,e[54]=o,e[55]=J,e[56]=Z):Z=e[56],Z}const ur="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",js="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function Es(h){const e=Ue.c(5),{rule:o,matchers:d}=h,m=o?.__resolveType??"";let x;if(e[0]!==d||e[1]!==m){const u=d.find(y=>y.resolveType===m)?.iconName??Ba(m);x=Eo(u),e[0]=d,e[1]=m,e[2]=x}else x=e[2];const b=x;if(!b)return null;let f;return e[3]!==b?(f=n.jsx(b,{size:14,className:"shrink-0"}),e[3]=b,e[4]=f):f=e[4],f}function Gn(h){return h.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
+
`)}function pn(h){return h.map((e,o)=>({id:crypto.randomUUID(),index:o,variant:e}))}function dr(h){return h.map((e,o)=>({...e,index:o}))}function ks(h){const e=Ue.c(17),{label:o,effectiveRule:d,matchers:m,canDelete:x,dragging:b,onRename:f,onDuplicate:v,onDelete:u}=h,y=ct();let k;e[0]!==d||e[1]!==m?(k=n.jsx(Es,{rule:d,matchers:m}),e[0]=d,e[1]=m,e[2]=k):k=e[2];let D;e[3]!==o?(D=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:o}),e[3]=o,e[4]=D):D=e[4];let E;e[5]!==x||e[6]!==b||e[7]!==o||e[8]!==u||e[9]!==v||e[10]!==f||e[11]!==y?(E=!b&&n.jsxs(ls,{children:[n.jsx(rs,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":y("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:o}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:fr,onPointerDown:mr,children:n.jsx(es,{size:14})})}),n.jsxs(is,{align:"end",className:"w-36",children:[n.jsxs(ht,{onClick:g=>{g.stopPropagation(),f?.()},children:[n.jsx(qo,{size:14}),y("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(ht,{onClick:g=>{g.stopPropagation(),v?.()},children:[n.jsx(ss,{size:14}),y("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(Fo,{}),n.jsxs(ht,{variant:"destructive",disabled:!x,onClick:g=>{g.stopPropagation(),u?.()},children:[n.jsx(os,{size:14}),y("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=x,e[6]=b,e[7]=o,e[8]=u,e[9]=v,e[10]=f,e[11]=y,e[12]=E):E=e[12];let i;return e[13]!==k||e[14]!==D||e[15]!==E?(i=n.jsxs(n.Fragment,{children:[k,D,E]}),e[13]=k,e[14]=D,e[15]=E,e[16]=i):i=e[16],i}function mr(h){return h.stopPropagation()}function fr(h){return h.stopPropagation()}function pr(h){const e=Ue.c(33),{entry:o,sortableId:d,isActive:m,canDelete:x,decofile:b,meta:f,matchers:v,onSelect:u,onRename:y,onDuplicate:k,onDelete:D}=h;let E;e[0]!==d?(E={id:d,animateLayoutChanges:gr},e[0]=d,e[1]=E):E=e[1];const{attributes:i,listeners:g,setNodeRef:r,transform:A,isDragging:l}=fs(E);let R;e[2]!==A?(R=ps.Transform.toString(A?{...A,x:0}:null),e[2]=A,e[3]=R):R=e[3];const K=l?0:void 0;let z;e[4]!==R||e[5]!==K?(z={transform:R,opacity:K},e[4]=R,e[5]=K,e[6]=z):z=e[6];const p=z,N=f??void 0;let ie;e[7]!==b||e[8]!==o.variant.rule||e[9]!==N?(ie=Ct(o.variant.rule,b,N),e[7]=b,e[8]=o.variant.rule,e[9]=N,e[10]=ie):ie=e[10];const L=ie;let ce;e[11]!==u?(ce=me=>{me.target===me.currentTarget&&(me.key==="Enter"||me.key===" ")&&(me.preventDefault(),u())},e[11]=u,e[12]=ce):ce=e[12];const M=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",ge=m?js:ur;let O;e[13]!==M||e[14]!==ge?(O=Oe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",M,ge),e[13]=M,e[14]=ge,e[15]=O):O=e[15];let ne;e[16]!==x||e[17]!==L||e[18]!==o.variant.label||e[19]!==v||e[20]!==D||e[21]!==k||e[22]!==y?(ne=n.jsx(ks,{label:o.variant.label,effectiveRule:L,matchers:v,canDelete:x,onRename:y,onDuplicate:k,onDelete:D}),e[16]=x,e[17]=L,e[18]=o.variant.label,e[19]=v,e[20]=D,e[21]=k,e[22]=y,e[23]=ne):ne=e[23];let he;return e[24]!==i||e[25]!==g||e[26]!==u||e[27]!==r||e[28]!==p||e[29]!==O||e[30]!==ne||e[31]!==ce?(he=n.jsx("div",{ref:r,style:p,...i,...g,onClick:u,onKeyDown:ce,className:O,children:ne}),e[24]=i,e[25]=g,e[26]=u,e[27]=r,e[28]=p,e[29]=O,e[30]=ne,e[31]=ce,e[32]=he):he=e[32],he}function gr(){return!1}function hr(h){const e=Ue.c(9),{variant:o,decofile:d,meta:m,matchers:x}=h,b=m??void 0;let f;e[0]!==d||e[1]!==b||e[2]!==o.rule?(f=Ct(o.rule,d,b),e[0]=d,e[1]=b,e[2]=o.rule,e[3]=f):f=e[3];const v=f;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=Oe("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",js),e[4]=u):u=e[4];let y;return e[5]!==v||e[6]!==x||e[7]!==o.label?(y=n.jsx("div",{className:u,children:n.jsx(ks,{label:o.label,effectiveRule:v,matchers:x,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=x,e[7]=o.label,e[8]=y):y=e[8],y}function vr(h){const e=Ue.c(91),{listKey:o,variants:d,activeIndex:m,decofile:x,meta:b,matchers:f,onSelect:v,onReorder:u,onRename:y,onDuplicate:k,onDelete:D,onAdd:E}=h,i=ct();let g;e[0]!==d?(g=()=>pn(d),e[0]=d,e[1]=g):g=e[1];const[r,A]=w.useState(g),[l,R]=w.useState(null),[K,z]=w.useState(o),[p,N]=w.useState(d.length);let ie;e[2]!==d?(ie=()=>Gn(d),e[2]=d,e[3]=ie):ie=e[3];const[L,ce]=w.useState(ie),M=w.useRef(!1),ge=Gn(d);K!==o?(z(o),N(d.length),ce(ge),A(pn(d))):p!==d.length?(N(d.length),ce(ge),A(pn(d))):L!==ge&&(ce(ge),A($e=>d.map((Ee,ye)=>({id:$e[ye]?.id??crypto.randomUUID(),index:ye,variant:Ee}))));let O;e[4]===Symbol.for("react.memo_cache_sentinel")?(O={activationConstraint:{distance:8}},e[4]=O):O=e[4];let ne;e[5]===Symbol.for("react.memo_cache_sentinel")?(ne={coordinateGetter:gs},e[5]=ne):ne=e[5];const he=cs(Jt(ds,O),Jt(us,ne));let me;e[6]!==r?(me=r.map(Sr),e[6]=r,e[7]=me):me=e[7];const I=me,J=d.length>1;let Z;e[8]!==r?(Z=$e=>{const Ee=String($e.active.id);R(r.find(ye=>ye.id===Ee)??null)},e[8]=r,e[9]=Z):Z=e[9];const ee=Z;let $;e[10]!==I||e[11]!==u?($=$e=>{R(null);const{active:Ee,over:ye}=$e;if(!ye||Ee.id===ye.id)return;const ke=I.indexOf(String(Ee.id)),Le=I.indexOf(String(ye.id));ke===-1||Le===-1||(A(Te=>dr(Mt([...Te],ke,Le))),M.current=!0,requestAnimationFrame(()=>{M.current=!1}),u(ke,Le))},e[10]=I,e[11]=u,e[12]=$):$=e[12];const Ae=$;let Me;e[13]===Symbol.for("react.memo_cache_sentinel")?(Me=()=>{R(null)},e[13]=Me):Me=e[13];const et=Me;let Se,H,se,ae,ue,oe,de,le,fe,De,je,re,pe;if(e[14]!==m||e[15]!==J||e[16]!==x||e[17]!==r||e[18]!==I||e[19]!==Ae||e[20]!==ee||e[21]!==f||e[22]!==b||e[23]!==E||e[24]!==D||e[25]!==k||e[26]!==y||e[27]!==v||e[28]!==he||e[29]!==i){const $e=G=>{M.current||v(G)};je="space-y-1 border-b p-2";let Ee;e[43]!==i?(Ee=i("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=i,e[44]=Ee):Ee=e[44];let ye;e[45]!==Ee?(ye=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:Ee}),e[45]=Ee,e[46]=ye):ye=e[46];let ke;e[47]!==i?(ke=i("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=i,e[48]=ke):ke=e[48];let Le;e[49]===Symbol.for("react.memo_cache_sentinel")?(Le=n.jsx(hn,{size:14}),e[49]=Le):Le=e[49];let Te;e[50]!==E||e[51]!==ke?(Te=n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":ke,className:"size-6",onClick:E,children:Le})}),e[50]=E,e[51]=ke,e[52]=Te):Te=e[52];let ze;e[53]!==i?(ze=i("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=i,e[54]=ze):ze=e[54];let B;e[55]!==ze?(B=n.jsx(jt,{children:ze}),e[55]=ze,e[56]=B):B=e[56];let F;e[57]!==Te||e[58]!==B?(F=n.jsxs(yt,{children:[Te,B]}),e[57]=Te,e[58]=B,e[59]=F):F=e[59],e[60]!==ye||e[61]!==F?(re=n.jsxs("div",{className:"flex items-center justify-between",children:[ye,F]}),e[60]=ye,e[61]=F,e[62]=re):re=e[62],H=hs,oe=he,de=vs,le=ee,fe=Ae,De=et,Se=Ss,ae=I,ue=xs,pe="space-y-0.5",se=r.map(G=>n.jsx(pr,{sortableId:G.id,entry:G,isActive:G.index===m,canDelete:J,decofile:x,meta:b,matchers:f,onSelect:()=>$e(G.index),onRename:()=>y(G.index),onDuplicate:()=>k(G.index),onDelete:()=>D(G.index)},G.id)),e[14]=m,e[15]=J,e[16]=x,e[17]=r,e[18]=I,e[19]=Ae,e[20]=ee,e[21]=f,e[22]=b,e[23]=E,e[24]=D,e[25]=k,e[26]=y,e[27]=v,e[28]=he,e[29]=i,e[30]=Se,e[31]=H,e[32]=se,e[33]=ae,e[34]=ue,e[35]=oe,e[36]=de,e[37]=le,e[38]=fe,e[39]=De,e[40]=je,e[41]=re,e[42]=pe}else Se=e[30],H=e[31],se=e[32],ae=e[33],ue=e[34],oe=e[35],de=e[36],le=e[37],fe=e[38],De=e[39],je=e[40],re=e[41],pe=e[42];let xe;e[63]!==se||e[64]!==pe?(xe=n.jsx("div",{className:pe,children:se}),e[63]=se,e[64]=pe,e[65]=xe):xe=e[65];let be;e[66]!==Se||e[67]!==ae||e[68]!==ue||e[69]!==xe?(be=n.jsx(Se,{items:ae,strategy:ue,children:xe}),e[66]=Se,e[67]=ae,e[68]=ue,e[69]=xe,e[70]=be):be=e[70];let T;e[71]!==l||e[72]!==x||e[73]!==f||e[74]!==b?(T=l?n.jsx(hr,{variant:l.variant,decofile:x,meta:b,matchers:f}):null,e[71]=l,e[72]=x,e[73]=f,e[74]=b,e[75]=T):T=e[75];let Ke;e[76]!==T?(Ke=Yn.createPortal(n.jsx(ms,{dropAnimation:Qn,children:T}),document.body),e[76]=T,e[77]=Ke):Ke=e[77];let Ie;e[78]!==H||e[79]!==oe||e[80]!==de||e[81]!==le||e[82]!==fe||e[83]!==De||e[84]!==be||e[85]!==Ke?(Ie=n.jsxs(H,{sensors:oe,collisionDetection:de,onDragStart:le,onDragEnd:fe,onDragCancel:De,children:[be,Ke]}),e[78]=H,e[79]=oe,e[80]=de,e[81]=le,e[82]=fe,e[83]=De,e[84]=be,e[85]=Ke,e[86]=Ie):Ie=e[86];let Ge;return e[87]!==je||e[88]!==re||e[89]!==Ie?(Ge=n.jsxs("div",{className:je,children:[re,Ie]}),e[87]=je,e[88]=re,e[89]=Ie,e[90]=Ge):Ge=e[90],Ge}function Sr(h){return h.id}function xr(h){const e=Ue.c(16),{schema:o,value:d,onChange:m,meta:x,decofile:b,onSaveReferencedBlock:f,sandbox:v}=h,u=ct();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0];const[k,D]=w.useState(y);let E;e[1]!==k||e[2]!==u?(E=k.length>0&&n.jsxs("nav",{"aria-label":u("sectionsEditor.sectionsEditorPanels.variantRuleBreadcrumb"),className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>D([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:u("sectionsEditor.sectionsEditorPanels.backToRule"),children:n.jsx(ts,{className:"size-3.5"})}),k.map((r,A)=>{const l=A===k.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[A>0&&n.jsx(ns,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>D(k.slice(0,A+1)),title:r,className:Oe("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",l?"font-medium text-foreground":"text-muted-foreground"),children:r})]},`${r}-${A}`)})]}),e[1]=k,e[2]=u,e[3]=E):E=e[3];let i;e[4]!==k||e[5]!==b||e[6]!==x||e[7]!==m||e[8]!==f||e[9]!==v||e[10]!==o||e[11]!==d?(i=n.jsx(Zn,{schema:o,value:d,onChange:m,basePath:"",breadcrumbPath:k,onBreadcrumbChange:D,meta:x,decofile:b,onSaveReferencedBlock:f,sandbox:v}),e[4]=k,e[5]=b,e[6]=x,e[7]=m,e[8]=f,e[9]=v,e[10]=o,e[11]=d,e[12]=i):i=e[12];let g;return e[13]!==E||e[14]!==i?(g=n.jsxs("div",{className:"space-y-2",children:[E,i]}),e[13]=E,e[14]=i,e[15]=g):g=e[15],g}function Un(h){const e=Ue.c(23),{activeSchema:o,formValue:d,formResetKey:m,onFormChange:x,onBreadcrumbChange:b,breadcrumbPath:f,emptyMessage:v,beforeForm:u,seoResolveType:y,siteDefaultSeo:k,meta:D,decofile:E,onSaveReferencedBlock:i,sandbox:g,previewBaseUrl:r,onRequestAddSection:A}=h;let l;e[0]!==f?(l=f===void 0?[]:f,e[0]=f,e[1]=l):l=e[1];const R=l;let K;e[2]!==o||e[3]!==R||e[4]!==E||e[5]!==m||e[6]!==d||e[7]!==D||e[8]!==b||e[9]!==x||e[10]!==A||e[11]!==i||e[12]!==r||e[13]!==g||e[14]!==y||e[15]!==k?(K=o&&d?y?n.jsx(Oo,{schema:o,resolveType:y,value:d,formResetKey:m,onChange:x,onBreadcrumbChange:b,siteDefaultSeo:k}):n.jsx(Zn,{schema:o,value:d,onChange:x,basePath:"",breadcrumbPath:R,onBreadcrumbChange:b,meta:D,decofile:E,onSaveReferencedBlock:i,sandbox:g,previewBaseUrl:r,onRequestAddSection:A},m):null,e[2]=o,e[3]=R,e[4]=E,e[5]=m,e[6]=d,e[7]=D,e[8]=b,e[9]=x,e[10]=A,e[11]=i,e[12]=r,e[13]=g,e[14]=y,e[15]=k,e[16]=K):K=e[16];const z=K;let p;e[17]!==v||e[18]!==z?(p=z??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[17]=v,e[18]=z,e[19]=p):p=e[19];let N;return e[20]!==u||e[21]!==p?(N=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[u,p]})}),e[20]=u,e[21]=p,e[22]=N):N=e[22],N}const br="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function yr(h,e){return Fa(h,e,lt)}function _r(h){const e=Ue.c(19),{pageKey:o,initialName:d,initialPath:m,onFieldChange:x}=h,b=ct(),[f,v]=w.useState(d),[u,y]=w.useState(m),[k,D]=w.useState(o);k!==o&&(D(o),v(d),y(m));let E;e[0]!==x?(E=K=>{v(K.target.value),x("name",K.target.value)},e[0]=x,e[1]=E):E=e[1];let i;e[2]!==b?(i=b("sectionsEditor.sectionsEditorPanels.pageNamePlaceholder"),e[2]=b,e[3]=i):i=e[3];let g;e[4]!==f||e[5]!==E||e[6]!==i?(g=n.jsx("input",{type:"text",value:f,onChange:E,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:i}),e[4]=f,e[5]=E,e[6]=i,e[7]=g):g=e[7];let r;e[8]!==x?(r=K=>{y(K.target.value),x("path",K.target.value)},e[8]=x,e[9]=r):r=e[9];let A;e[10]!==b?(A=b("sectionsEditor.sectionsEditorPanels.pathPlaceholder"),e[10]=b,e[11]=A):A=e[11];let l;e[12]!==u||e[13]!==r||e[14]!==A?(l=n.jsx("input",{type:"text",value:u,onChange:r,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:A}),e[12]=u,e[13]=r,e[14]=A,e[15]=l):l=e[15];let R;return e[16]!==g||e[17]!==l?(R=n.jsxs("div",{className:"space-y-1",children:[g,l]}),e[16]=g,e[17]=l,e[18]=R):R=e[18],R}function Wn(h){const e=Ue.c(13),{onClick:o}=h,d=ct();let m;e[0]!==d?(m=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[0]=d,e[1]=m):m=e[1];let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(as,{size:14}),e[2]=x):x=e[2];let b;e[3]!==o||e[4]!==m?(b=n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":m,className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:o,children:x})}),e[3]=o,e[4]=m,e[5]=b):b=e[5];let f;e[6]!==d?(f=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[6]=d,e[7]=f):f=e[7];let v;e[8]!==f?(v=n.jsx(jt,{side:"bottom",children:f}),e[8]=f,e[9]=v):v=e[9];let u;return e[10]!==b||e[11]!==v?(u=n.jsxs(yt,{children:[b,v]}),e[10]=b,e[11]=v,e[12]=u):u=e[12],u}function qn(h){const e=Ue.c(21),{currentRt:o,currentLabel:d,currentGlobalKey:m,matchers:x,globals:b,onSelect:f,onSelectGlobal:v,schema:u,formValue:y,onChange:k,formKey:D,formWrapperClassName:E,meta:i,decofile:g,onSaveReferencedBlock:r,sandbox:A}=h;let l;e[0]!==m||e[1]!==d||e[2]!==o||e[3]!==b||e[4]!==x||e[5]!==f||e[6]!==v?(l=n.jsx(Oa,{currentRt:o,currentLabel:d,currentGlobalKey:m,matchers:x,globals:b,onSelect:f,onSelectGlobal:v}),e[0]=m,e[1]=d,e[2]=o,e[3]=b,e[4]=x,e[5]=f,e[6]=v,e[7]=l):l=e[7];let R;e[8]!==g||e[9]!==D||e[10]!==y||e[11]!==E||e[12]!==i||e[13]!==k||e[14]!==r||e[15]!==A||e[16]!==u?(R=u&&y&&n.jsx("div",{className:E,children:n.jsx(xr,{schema:u,value:y,onChange:k,meta:i,decofile:g,onSaveReferencedBlock:r,sandbox:A},D)}),e[8]=g,e[9]=D,e[10]=y,e[11]=E,e[12]=i,e[13]=k,e[14]=r,e[15]=A,e[16]=u,e[17]=R):R=e[17];let K;return e[18]!==l||e[19]!==R?(K=n.jsxs(n.Fragment,{children:[l,R]}),e[18]=l,e[19]=R,e[20]=K):K=e[20],K}function uc({orgSlug:h,virtualMcpId:e,branch:o,previewReady:d=!0,previewUrl:m,currentPath:x,activePageBlockKey:b=null,activeGlobalBlockKey:f=null,externalSelectedIndex:v,onSaved:u,initialEditSeo:y=!1,onExitSeo:k,onViewJsonFile:D,onVariantPreviewOverride:E}){const i=ct(),g=d?{orgSlug:h,virtualMcpId:e,branch:o,previewUrl:m}:null,{data:r,isLoading:A}=Ia(g),{data:l,isLoading:R}=$a(g),K=za(),z=K?.entity?.id===e?K.entity.metadata?.siteSlug??null:null,[p,N]=w.useState(null),[ie,L]=w.useState(null),[ce,M]=w.useState(null),[ge,O]=w.useState(0),[ne,he]=w.useState(void 0),[me,I]=w.useState(null),[J,Z]=w.useState(null),[ee,$]=w.useState([]),Ae=w.useRef(null),[Me,et]=w.useState(ee.length);Me!==ee.length&&(et(ee.length),requestAnimationFrame(()=>{Ae.current&&(Ae.current.scrollTop=0)}));const[Se,H]=w.useState(0),[se,ae]=w.useState(null),[ue,oe]=w.useState(null),[de,le]=w.useState(null),[fe,De]=w.useState(!0),[je,re]=w.useState(!1),[pe,xe]=w.useState(!1),be=w.useRef(null),[T,Ke]=w.useState(y),[Ie,Ge]=w.useState(y);y&&!Ie&&(Ge(!0),Ke(!0),N(null),L(null),M(null),$([])),!y&&Ie&&Ge(!1);const[$e,Ee]=w.useState(null),[ye,ke]=w.useState(void 0),[Le,Te]=w.useState([]),[ze,B]=w.useState(0),[F,G]=w.useState(0),[nt,Re]=w.useState(null),[We,Ne]=w.useState(null),[vt,vn]=w.useState(null),Rs=Na(),ws=`${h}/${e}/${o}`,Qt=Ha({orgSlug:h,virtualMcpId:e,branch:o}),[Vs,Ns]=w.useState(x),[Ds,Ts]=w.useState(b),[Ps,As]=w.useState(f);(Vs!==x||Ds!==b||Ps!==f)&&(queueMicrotask(()=>Qt.flush()),Ns(x),Ts(b),As(f),N(null),L(null),M(null),O(0),I(null),Z(null),G(0),Re(null),Ne(null),$([]),H(t=>t+1),Ke(!1),Ee(null),ke(void 0),Te([]),B(t=>t+1));const we=Ga({orgSlug:h,virtualMcpId:e,branch:o}),Kt=uo((t,s)=>{we.mutate({blockKey:t,data:s},{onSuccess:()=>u?.(),onError:a=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Xt=Ua({orgSlug:h,virtualMcpId:e,branch:o}),[Nt,Lt]=w.useState(!1),Be=w.useRef(null),st=w.useRef(null),at=w.useRef(null),Zt=w.useRef({}),Xe=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!d||A||R)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Jn,{size:20,className:"animate-spin text-muted-foreground"})});if(!r||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Cs=Wa(r),Ve=!!f,qe=Ve?null:qa(Cs,x,b),V=Ve?f:qe?.key??null,en=Ve&&f?r[f]:void 0,Sn=Ve&&f&&en?Ya(f,en):Ve&&f?f:"",Bt=!Ve&&V&&r[V]?r[V]:null,tn=T&&r&&l&&V&&qe?$n(r,{kind:"page",pageKey:V,pageName:String(qe.name??""),path:String(qe.path??"")},l):null,Ms=T?Bt?.seo:void 0,nn=ye!==void 0?ye:Ms,Ks=T?Io(nn):void 0,Ls=tn?.seoTypeOptions??[],Bs=T&&l?$o(l):"",xn=$e??Ks??{},sn=T&&tn?zo(xn,tn):null,Fs=T&&sn&&Ho(nn)?Gt(sn,l):null,Os=T?Go(r,l)?.seoData:void 0,He=Ve?[{label:"Default",sections:[{__resolveType:f}]}]:yr(Bt?.sections,r??{}),Ft=He.length>1,Ce=Math.min(ge,He.length-1),ut=He[Ce],q=ut?.sections??[],Fe=Ut(q,r),bn=!Ve&&Ja(Bt?.sections);if(Ve&&f&&vt!==f){vn(f);const t=q[0],s=Fe[0];if(t&&s){N(0),G(0),$([]);const a=xt(t,s,r);a&&(L(a.data),M(a.resolveType),Ne(null),Re(null))}}!Ve&&vt!==null&&vn(null),Xe.current={rawSections:q,parsedSections:Fe,decofile:r??{},activePageKey:V,pageVariants:He,variantIndex:Ce,sectionVariantIndex:F,selectedSectionIndex:p};const Is=()=>({multivariate:bn,index:Ce,variants:He.map(t=>({rule:t.rule}))}),yn=(t,s)=>{if(!E)return;if(!V||!bn||t.length<=1){E(null);return}const a=In(V,{multivariate:!0,index:s,variants:t},r,l);E(a.length>0?a:null)},Et=(t,s,a)=>{if(!E)return;if(!V){E(null);return}const c=Is(),S=In(V,c,r,l);if(!t||s<0){E(S.length>0?S:null);return}const j=ho({pageKey:V,page:c,sectionIndex:s,sectionLazy:Fe[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:r,meta:l}),_=[...S,...j];E(_.length>0?_:null)},dt=(t,s,a,c=p??-1,S=!1)=>{const j=tt(t,s);if(!j){L(null),M(null),Ne(null),Re(null),S&&Et(null,c,a);return}const P=Mn(j,lt)[a];if(!P){L(null),M(null),Ne(null),Re(null),S&&Et(null,c,a);return}const te=no(P.value,r);L(te?.data??null),M(te?.resolveType??null);const{resolveType:C,formValue:U}=Tt(P.rule,r,l??void 0);Ne(C),Re(U),S&&Et(j,c,a)};if(v!==void 0&&v!==ne&&(he(v??null),typeof v=="number")){const t=q[v],s=Fe[v];if(t&&s)if(N(v),G(0),$([]),H(a=>a+1),s.isMultivariate)dt(t,s,0,v);else{const a=xt(t,s,r);a?(L(a.data),M(a.resolveType)):(L(null),M(null)),Ne(null),Re(null)}}const Ot={orgSlug:h,virtualMcpId:e,branch:o,previewUrl:m??void 0,siteSlug:z},an=ce&&l?Gt(ce,l):null,Ye=(t,s)=>{if(!V)return;Be.current&&(clearTimeout(Be.current),Be.current=null),at.current&&(clearTimeout(at.current),at.current=null),st.current&&(clearTimeout(st.current),st.current=null);const a=At(r,V,t,Ce,He);we.mutate({blockKey:V,data:a},{onSuccess:()=>s?.onSuccess?.()??u?.(),onError:c=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},kt=()=>{N(null),L(null),M(null),G(0),Re(null),Ne(null),$([]),H(t=>t+1)},$s=(t,s)=>{Be.current&&clearTimeout(Be.current);const a=Xe.current.sectionVariantIndex;Be.current=setTimeout(()=>{const{rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current,C=c[s];if(!C)return;const U=S[s];if(!U)return;if(U.isSavedBlock){const Y=U.isLazy?C.section?.__resolveType??C.__resolveType:C.__resolveType;we.mutate({blockKey:Y,data:t},{onSuccess:()=>u?.(),onError:Q=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Q.message}))});return}if(!_)return;const W={...j[_]},_e=[...c];if(U.isMultivariate){const Y=tt(C,U);if(!Y||!_)return;const Q=So(Y,a,t);_e[s]=bt(C,U,Q)}else if(U.isHidden){const Y=Xn(C.__resolveType),Q=Y?{...C.section}:{...C},Pe=Array.isArray(Q.variants)?[...Q.variants]:[];Pe[0]&&(Pe[0]={...Pe[0],value:t}),Q.variants=Pe,Y?_e[s]={...C,section:Q}:_e[s]=Q}else U.isLazy?_e[s]={...C,section:t}:_e[s]=t;if(P.length>1){const Y=W.sections,Q=[...Y?.variants??[]];Q[te]&&(Q[te]={...Q[te],value:_e}),W.sections={...Y,variants:Q}}else W.sections=_e;we.mutate({blockKey:_,data:W},{onSuccess:()=>u?.(),onError:Y=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))})},fn)},zs=t=>{N(t),G(0),$([]),H(S=>S+1);const s=q[t],a=Fe[t];if(!s||!a)return;if(a.isMultivariate){dt(s,a,0,t);return}const c=xt(s,a,r);if(!c){L(null),M(null),Ne(null),Re(null),Et(null,t,0);return}L(c.data),M(c.resolveType),Ne(null),Re(null),Et(null,t,0)},_n=t=>{const s=t;L(s),p!==null&&$s(s,p)},on=t=>{if(!V||!r||!l||!qe)return;const s={kind:"page",pageKey:V,pageName:String(qe.name??""),path:String(qe.path??"")},a=$n(r,s,l);a&&Qt.save(V,()=>{const c=Rs.getQueryData(Da.decofile(ws))?.[V];if(!c||typeof c!="object"||c===null||Array.isArray(c))return null;const S={...c,...Zt.current};return Zt.current={},t?.raw!==void 0?{...S,seo:t.raw}:t?.inner!==void 0?Wo(s,a,S,t.inner):S})},Hs=(t,s)=>{V&&(Zt.current[t]=s,on())},Gs=(t,s)=>{if(!V)return;const a=Mt([...q],t,s);p!==null&&(p===t?N(s):t<p&&s>=p?N(p-1):t>p&&s<=p&&N(p+1)),Ye(a)},Us=t=>{if(!V)return;const s=q.filter((a,c)=>c!==t);p===t?kt():p!==null&&p>t&&N(p-1),Ye(s)},Ws=t=>{if(!V)return;const s=q[t];if(!s)return;const a=[...q];a.splice(t+1,0,go(s)),p!==null&&p>t&&N(p+1),Ye(a)},qs=t=>{if(!V)return;const s=q[t],a=Fe[t];if(!s||!a||a.isMultivariate)return;const c=a.isHidden?fo(s):po(s);if(!c)return;const S=[...q];S[t]=c,p===t&&kt(),Ye(S)},Ys=t=>{if(!V)return;const s=q[t],a=Fe[t];if(!s||!a||a.isMultivariate)return;const c=mo(s);if(!c)return;const S=[...q];S[t]=c,p===t&&kt(),Ye(S)},Js=t=>{if(!V)return;const s=q[t],a=Fe[t];if(!s||!a?.isSavedBlock)return;const c=xt(s,a,r);if(!c?.data)return;const{name:S,...j}=c.data,_=[...q];a.isLazy?_[t]={...s,section:j}:_[t]=j,p===t&&kt(),Ye(_)},Qs=t=>{if(!V)return;const s=[...q,{__resolveType:t.resolveType}],a=s.length-1;Ye(s,{onSuccess:()=>{re(!1),N(a),G(0),$([]),H(_=>_+1);const c=s[a],S=Ut(s,r)[a];if(!c||!S)return;if(S.isMultivariate){dt(c,S,0);return}const j=xt(c,S,r);if(!j){L(null),M(null),Ne(null),Re(null);return}L(j.data),M(j.resolveType),Ne(null),Re(null)}})},jn=t=>{be.current=t.append,re(!0)},Xs=t=>{const s=be.current;if(!s){Qs(t);return}s({__resolveType:t.resolveType}),re(!1),be.current=null},Zs=t=>{if(p===null)return;const s=q[p],a=Fe[p];!s||!a?.isMultivariate||(G(t),$([]),H(c=>c+1),dt(s,a,t,p,!0))},ea=t=>{if(p===null||!V)return;const s=q[p],a=Fe[p];if(!s||!a?.isMultivariate)return;const c=tt(s,a);if(!c)return;const S=lo(c,t);if(!S){X.error(i("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const j=[...q];j[p]=bt(s,a,S);const _=S.variants;let P=F;t===F?P=Math.min(t,_.length-1):t<F&&(P=F-1),G(P),$([]),H(te=>te+1),dt(j[p],a,P),Ye(j)},ta=t=>{if(p===null||!V)return;const s=q[p],a=Fe[p];if(!s||!a?.isMultivariate)return;const c=tt(s,a);if(!c)return;const S=co(c,t),j=[...q];j[p]=bt(s,a,S);const _=t+1;G(_),$([]),H(P=>P+1),dt(j[p],a,_),Ye(j)},na=(t,s)=>{if(p===null||!V||t===s)return;const a=q[p],c=Fe[p];if(!a||!c?.isMultivariate)return;const S=tt(a,c);if(!S)return;const j=ro(S,t,s),_=[...q];_[p]=bt(a,c,j);let P=F;F===t?P=s:t<F&&s>=F?P=F-1:t>F&&s<=F&&(P=F+1),G(P),dt(_[p],c,P),Ye(_)},rn=t=>{const s=t??p;if(s===null||!V)return;const a=q[s],c=Fe[s];if(!a||!c)return;const S=so(a,c);if(!S){X.error(i("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const j=[...q];j[s]=S.section;const _=Ut(j,r)[s];if(!_?.isMultivariate){X.error(i("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}N(s),G(S.newVariantIndex),$([]),H(P=>P+1),dt(S.section,_,S.newVariantIndex,s),Ye(j)},sa=()=>{if(p===null||!V)return;const t=q[p],s=Fe[p];if(!t||!s?.isMultivariate)return;const a=tt(t,s);if(!a)return;const c=io(t,s,a);if(!c){X.error(i("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const S=[...q];S[p]=c;const j=Ut(S,r)[p];if(!j)return;G(0),Ne(null),Re(null),$([]),H(P=>P+1);const _=xt(c,j,r);_?(L(_.data),M(_.resolveType)):(L(null),M(null)),Et(null,p,0),Ye(S)},aa=async t=>{if(se===null||!V)return;const s=mn(t,r);if(s){X.error(s);return}const a=q[se],c=Fe[se];if(!a||!c)return;const S=xt(a,c,r);if(!S){X.error(i("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const j={...S.data,name:t};try{await we.mutateAsync({blockKey:t,data:j});const _=[...q];_[se]={__resolveType:t},await we.mutateAsync({blockKey:V,data:At(r,V,_,Ce,He)}),p===se&&kt(),ae(null),X.success(i("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),u?.()}catch(_){X.error(_ instanceof Error?_.message:i("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},En=ut?.rule;if(Ft&&p===null&&J===null&&En){const{resolveType:t,formValue:s}=Tt(En,r??{},l??void 0);Z(t),I(s)}const It=l?Qa(l):[],kn=l&&r?Xa(l,r):[],oa=!Ve&&!!(m&&l&&r),ra=J&&l?Gt(J,l):null,Rt=()=>{st.current&&(clearTimeout(st.current),st.current=null),at.current&&(clearTimeout(at.current),at.current=null)},Dt=async(t,s)=>{if(!(vo(s,t,l)>0))try{await Xt.mutateAsync({blockKey:t})}catch(a){X.error(a instanceof Error?a.message:i("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Rn=t=>{st.current&&clearTimeout(st.current),st.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:c}=Xe.current;if(!s)return;const S={...a[s]},j={...S.sections},_=[...j.variants??[]],P=_[c],te=P?.rule;if(wt(te,a,l)){const C=te?.__resolveType??"",U=a[C],W=typeof U?.name=="string"?U.name:C,{__resolveType:_e,...Y}=t;we.mutate({blockKey:C,data:Vt(_e??"",Y,W)},{onSuccess:()=>u?.(),onError:Q=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Q.message}))});return}P&&(_[c]={...P,rule:t}),S.sections={...j,variants:_},we.mutate({blockKey:s,data:S},{onSuccess:()=>u?.(),onError:C=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},fn)},ia=t=>{Z(t);const s=t?Ln(t,l):{__resolveType:Bn};I(t?s:{}),Rn(s)},la=t=>{const s=t;I(s);const a=J?{__resolveType:J,...s}:{...s};Rn(a)},ca=async t=>{Rt();const{activePageKey:s,decofile:a,variantIndex:c}=Xe.current;if(!s)return;const S=a[s],j=S?.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const P=[..._.variants],te=P[c];if(!te)return;const C=Pt(te.rule,a,l),U=qt(t);P[c]={...te,rule:U};const W={...a,[s]:{...S,sections:{..._,variants:P}}},{resolveType:_e,formValue:Y}=Tt(U,W,l??void 0);Z(_e),I(Y);try{await we.mutateAsync({blockKey:s,data:W[s]}),C&&C!==t&&await Dt(C,W),u?.()}catch(Q){X.error(Q instanceof Error?Q.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},wn=t=>{at.current&&clearTimeout(at.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=Xe.current;s!==null&&(at.current=setTimeout(()=>{const{rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current;if(!_)return;const C=c[s],U=S[s];if(!C||!U?.isMultivariate)return;const W=tt(C,U);if(!W)return;const Y=(W.variants??[])[a]?.rule;if(wt(Y,j,l)){const ve=Y?.__resolveType??"",Je=j[ve],rt=typeof Je?.name=="string"?Je.name:ve,{__resolveType:pt,...it}=t;we.mutate({blockKey:ve,data:Vt(pt??"",it,rt)},{onSuccess:()=>u?.(),onError:gt=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:gt.message}))});return}const Q=Kn(W,a,t),Pe=[...c];Pe[s]=bt(C,U,Q);const Ze=At(j,_,Pe,te,P);we.mutate({blockKey:_,data:Ze},{onSuccess:()=>u?.(),onError:ve=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:ve.message}))})},fn))},ua=t=>{Ne(t);const s=t?Ln(t,l):{__resolveType:Bn};Re(t?s:{}),wn(s)},da=t=>{const s=t;Re(s);const a=We?{__resolveType:We,...s}:{...s};wn(a)},ma=async t=>{Rt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current;if(s===null||!_)return;const C=c[s],U=S[s];if(!C||!U?.isMultivariate)return;const W=tt(C,U);if(!W)return;const _e=W.variants??[],Y=Pt(_e[a]?.rule,j,l),Q=qt(t),Pe=Kn(W,a,Q),Ze=[...c];Ze[s]=bt(C,U,Pe);const ve=At(j,_,Ze,te,P),Je={...j,[_]:ve},{resolveType:rt,formValue:pt}=Tt(Q,Je,l??void 0);Ne(rt),Re(pt);try{await we.mutateAsync({blockKey:_,data:ve}),Y&&Y!==t&&await Dt(Y,Je),u?.()}catch(it){X.error(it instanceof Error?it.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ve&&!qe)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.noPageFound",{currentPath:x})});if(Ve&&!en)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.globalBlockNotFound")});const mt=p!==null?Fe[p]??null:null,Vn=p!==null?q[p]:null,Nn=Vn&&mt?.isMultivariate?tt(Vn,mt):null,St=Nn?Mn(Nn,lt):[],ln=Math.min(F,Math.max(St.length-1,0)),$t=St[ln]??null,ft=mt?.isMultivariate===!0,Dn=p!==null&&mt!==null,zt=Dn&&(ft||!!(an&&ie)),fa=zt&&!Ve&&mt?.isSavedBlock===!0,ot=Ve||fa,pa=Ve?Sn:mt?.label??"",ga=We&&l?Gt(We,l):null,cn=zt&&(!Ve||ee.length>0)?Ve?[Sn,...ee]:[qe.name,mt.label,...ft&&$t?[$t.label]:[],...ee]:[],ha=T&&qe?[qe.name,"SEO",...Le]:[],Ht=T?ha:ot?cn.length>0?cn:[pa]:cn,va=!T&&!Ve&&ft&&ee.length===0,Tn=()=>{if(!V)return;Rt(),Be.current&&(clearTimeout(Be.current),Be.current=null);const t=r[V],s=ao(t.sections,q);if(!s)return;const a=oo(s);we.mutate({blockKey:V,data:{...t,sections:s}},{onSuccess:()=>{O(a),N(null),L(null),M(null),$([]),I(null),Z(null)},onError:c=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},un=(t,s,a)=>{if(!V)return;Rt(),Be.current&&(clearTimeout(Be.current),Be.current=null);const c=r[V],S=c.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const j=S;if(!Array.isArray(j.variants))return;const _=t([...j.variants]);if(!_)return;const P=xo(j,_),te={...r,[V]:{...c,sections:P}};we.mutate({blockKey:V,data:te[V]},{onSuccess:()=>{s?.(),a&&Dt(a,te)},onError:C=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},Sa=t=>{oe(null),O(t),N(null),L(null),M(null),$([]);const s=He[t]?.rule,{resolveType:a,formValue:c}=Tt(s,r??{},l??void 0);Z(a),I(c),yn(He.map(S=>({rule:S.rule})),t)},xa=(t,s)=>{if(t===s)return;let a=Ce;Ce===t?a=s:t<Ce&&s>=Ce?a=Ce-1:t>Ce&&s<=Ce&&(a=Ce+1),O(a);const c=Mt(He.map(S=>({rule:S.rule})),t,s);yn(c,a),un(S=>Mt(S,t,s))},ba=t=>{const s=He[t]?.rule,a=Pt(s,r??{},l??void 0);un(c=>c.length<=1?null:(c.splice(t,1),c),()=>{He.length-1===1?O(0):t<Ce?O(Ce-1):t===Ce&&O(Math.max(0,t-1)),N(null),L(null),M(null),$([]),I(null),Z(null)},a)},ya=t=>{un(s=>bo(s,t),()=>{O(t+1),N(null),L(null),M(null),$([]),I(null),Z(null)})},_a=async(t,s)=>{Rt(),Be.current&&(clearTimeout(Be.current),Be.current=null);const a=Xe.current.activePageKey,c=Xe.current.decofile;if(!a)return;const S=c[a],j=S.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const P=[..._.variants],te=P[t];if(!te?.rule||typeof te.rule!="object"){X.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const C=te.rule,U=s.trim();Lt(!0);try{if(!U){if(!wt(C,c,l)){oe(null);return}const Ze=C.__resolveType??"";P[t]={...te,rule:Fn(C,c,l)};const ve={...c,[a]:{...S,sections:{..._,variants:P}}};await we.mutateAsync({blockKey:a,data:ve[a]}),await Dt(Ze,ve),oe(null),u?.();return}const W=On(C,c,l);if(!W){X.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(W.blockKey){await we.mutateAsync({blockKey:W.blockKey,data:Vt(W.resolveType,W.data,U)}),oe(null),u?.();return}const _e=dn(U),Y=mn(_e,c);if(Y){X.error(Y);return}const Q=Vt(W.resolveType,W.data,U);let Pe=null;try{await we.mutateAsync({blockKey:_e,data:Q}),Pe=_e,P[t]={...te,rule:qt(_e)},await we.mutateAsync({blockKey:a,data:{...S,sections:{..._,variants:P}}}),Pe=null}catch(Ze){throw Pe&&await Xt.mutateAsync({blockKey:Pe}).catch(()=>{}),Ze}oe(null),X.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:U})),u?.()}catch(W){X.error(W instanceof Error?W.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Lt(!1)}},ja=async(t,s)=>{Rt(),Be.current&&(clearTimeout(Be.current),Be.current=null);const{selectedSectionIndex:a,rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current;if(a===null||!_)return;const C=c[a],U=S[a];if(!C||!U?.isMultivariate)return;const W=tt(C,U);if(!W)return;const _e=W.variants??[],Y=_e[t];if(!Y?.rule||typeof Y.rule!="object"){X.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Q=Y.rule,Pe=s.trim();Lt(!0);const Ze=async ve=>{const Je={...W,variants:ve},rt=[...c];rt[a]=bt(C,U,Je);const pt=At(j,_,rt,te,P);return await we.mutateAsync({blockKey:_,data:pt}),{...j,[_]:pt}};try{if(!Pe){if(!wt(Q,j,l)){le(null);return}const gt=Q.__resolveType??"",Cn=[..._e];Cn[t]={...Y,rule:Fn(Q,j,l)};const Va=await Ze(Cn);await Dt(gt,Va),le(null),u?.();return}const ve=On(Q,j,l);if(!ve){X.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(ve.blockKey){await we.mutateAsync({blockKey:ve.blockKey,data:Vt(ve.resolveType,ve.data,Pe)}),le(null),u?.();return}const Je=dn(Pe),rt=mn(Je,j);if(rt){X.error(rt);return}const pt=Vt(ve.resolveType,ve.data,Pe);let it=null;try{await we.mutateAsync({blockKey:Je,data:pt}),it=Je;const gt=[..._e];gt[t]={...Y,rule:qt(Je)},await Ze(gt),it=null}catch(gt){throw it&&await Xt.mutateAsync({blockKey:it}).catch(()=>{}),gt}le(null),X.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Pe})),u?.()}catch(ve){X.error(ve instanceof Error?ve.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Lt(!1)}},Pn=()=>{kt()},Ea=t=>{Ee(t),on({inner:t})},ka=t=>{ke(t),on({raw:t})},Ra=()=>{Ee(null),Te([])},wa=()=>B(t=>t+1),An=t=>{if(T){if(t===0){Qt.flush(),Ke(!1),Ee(null),ke(void 0),Te([]),B(a=>a+1),k?.();return}if(t===1){Te([]),B(a=>a+1);return}Te(Le.slice(0,t-1)),B(a=>a+1);return}if(Ve){$(ee.slice(0,t)),H(a=>a+1);return}if(t===0){Pn();return}if(t===1){$([]),H(a=>a+1);return}if(ft&&t===2){$([]),H(a=>a+1);return}const s=ft?2:1;$(ee.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:ot||zt||T?n.jsxs("div",{className:Oe("border-b px-3 py-2.5",ot&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[Ht.length>1&&n.jsx("button",{type:"button",onClick:()=>An(yo(Ht.length,{isMultivariateSectionTop:va})),title:i("sectionsEditor.sectionsEditor.back"),"aria-label":i("sectionsEditor.sectionsEditor.back"),className:Oe("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",ot?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(ts,{className:"size-4"})}),!Ve&&Ft&&ut&&n.jsxs("button",{type:"button",onClick:Pn,title:i("sectionsEditor.sectionsEditor.editingInVariant",{variant:ut.label}),className:Oe("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",br),children:[n.jsx(Es,{rule:Ct(ut.rule,r??{},l??void 0),matchers:It}),n.jsx("span",{className:"max-w-[160px] truncate",children:ut.label})]}),n.jsx("nav",{"aria-label":i("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Ht.map((t,s)=>{const a=s===Ht.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(ns,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>An(s),title:t,className:Oe("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?ot?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":ot?"text-foreground/80":"text-muted-foreground",ot?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${s}`)})}),ot&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Vo,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(jt,{side:"bottom",className:"max-w-[260px]",children:i("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Dn&&!ft&&!mt?.isHidden&&V&&n.jsx(Wn,{onClick:()=>rn()})]}),ot&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:i("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(_r,{pageKey:V,initialName:qe.name,initialPath:qe.path,onFieldChange:Hs})}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Ke(!0),children:n.jsx(ko,{size:14})})}),n.jsx(jt,{side:"bottom",children:i("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>D&&V?D(V):xe(!0),children:n.jsx(Ro,{size:14})})}),n.jsx(jt,{side:"bottom",children:i("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(Wn,{onClick:Tn})]})}),T?n.jsx(Yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Bt&&V?n.jsx(Uo,{rawSeo:nn,innerSeo:xn,defaultResolveType:Bs,seoSchema:Fs,activeResolveType:sn,seoTypeOptions:Ls,formResetKey:ze,siteDefaultSeo:Os,onBreadcrumbChange:Te,onPersistRaw:ka,onInnerChange:Ea,onClearForm:Ra,onBumpFormKey:wa}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})}):zt?n.jsxs(Yt,{viewportRef:Ae,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ft&&St.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Za,{listKey:`${V??""}:${p??""}`,variants:St.map((t,s)=>({index:s,label:t.label})),selectedIndex:ln,onSelect:Zs,onRename:le,onDuplicate:ta,onDelete:ea,onRemoveAll:sa,onReorder:na,onAdd:()=>rn()}),ft&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(qn,{currentRt:We??"",currentLabel:Wt($t?.rule,r??{},lt,l??void 0),currentGlobalKey:Pt($t?.rule,r??{},l??void 0)??void 0,matchers:It,globals:kn,onSelect:ua,onSelectGlobal:ma,schema:ga,formValue:nt,onChange:da,formKey:`${p??"none"}:${ln}:${We??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot})]})]}),n.jsx(Un,{activeSchema:an,formValue:ie,formResetKey:Se,onFormChange:_n,onBreadcrumbChange:$,breadcrumbPath:ee,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot,previewBaseUrl:m,onRequestAddSection:jn})]}):Ve?n.jsx(Yt,{viewportRef:Ae,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Un,{activeSchema:an,formValue:ie,formResetKey:Se,onFormChange:_n,onBreadcrumbChange:$,breadcrumbPath:ee,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot,previewBaseUrl:m,onRequestAddSection:jn})}):n.jsxs(Yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ft&&V&&n.jsx(vr,{listKey:V,variants:He,activeIndex:Ce,decofile:r??{},meta:l,matchers:It,onSelect:Sa,onReorder:xa,onRename:oe,onDuplicate:ya,onDelete:ba,onAdd:Tn}),Ft&&J!==null&&n.jsxs("div",{className:Oe("px-3 border-b",fe?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>De(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":fe,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i("sectionsEditor.sectionsEditor.variantRule")}),fe?n.jsx(wo,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(_o,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),fe&&n.jsx("div",{className:Oe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(qn,{currentRt:J,currentLabel:Wt(ut?.rule,r??{},lt,l??void 0),currentGlobalKey:Pt(ut?.rule,r??{},l??void 0)??void 0,matchers:It,globals:kn,onSelect:ia,onSelectGlobal:ca,schema:ra,formValue:me,onChange:la,formKey:`${Ce}:${J??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(lr,{listKey:`${V??""}-${Ce}`,rawSections:q,sections:Fe,meta:l,selectedIndex:p,onSelect:zs,onReorder:Gs,onDelete:Us,onDuplicate:Ws,onMakeReusable:ae,onToggleHidden:qs,onToggleLazy:Ys,onAddVariant:rn,onDetach:Js,onAddSection:()=>re(!0),canAddSection:oa})})]}),n.jsx(eo,{open:se!==null,onOpenChange:t=>{t||ae(null)},defaultBlockId:se!==null?dn(Fe[se]?.label??""):"",isPending:we.isPending,onSubmit:aa}),m&&n.jsx(Yo,{open:je,onOpenChange:t=>{re(t),t||(be.current=null)},meta:l,decofile:r,previewBaseUrl:m,onSelect:Xs}),pe&&V&&r&&n.jsx(to,{open:pe,onOpenChange:xe,pageKey:V,decofile:r}),ue!==null&&n.jsx(Hn,{open:!0,initialName:wt(He[ue]?.rule,r??{},l??void 0)?Wt(He[ue]?.rule,r??{},lt,l??void 0):"",autoLabel:lt(Ct(He[ue]?.rule,r??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await _a(ue,t)},onOpenChange:t=>{!t&&!Nt&&oe(null)}}),de!==null&&n.jsx(Hn,{open:!0,initialName:wt(St[de]?.rule,r??{},l??void 0)?Wt(St[de]?.rule,r??{},lt,l??void 0):"",autoLabel:lt(Ct(St[de]?.rule,r??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await ja(de,t)},onOpenChange:t=>{!t&&!Nt&&le(null)}})]})}export{uc as SectionsEditor};
|