decocms 4.429.5 → 4.429.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CXwWyjWL.js → AlertCircle-B1Wz6L5U.js} +1 -1
- package/dist/client/assets/{AreaChart-CWnwFPGD.js → AreaChart-D8eDFA25.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DYnQbYxF.js → ArrowLeft-CecRcRxr.js} +1 -1
- package/dist/client/assets/{ArrowRight-C4e8QGnK.js → ArrowRight-BSlT04qT.js} +1 -1
- package/dist/client/assets/{ArrowUp-BiYv-XbK.js → ArrowUp-uu6L0oZa.js} +1 -1
- package/dist/client/assets/{CartesianChart-BGE8uJq6.js → CartesianChart-Cye2mySB.js} +1 -1
- package/dist/client/assets/{Check-C8M8v3vI.js → Check-BiHadeJU.js} +1 -1
- package/dist/client/assets/{CheckCircle-jESFBkr7.js → CheckCircle-BbTEzozp.js} +1 -1
- package/dist/client/assets/{ChevronUp-Q2TBgNib.js → ChevronUp-DMzxjk9Q.js} +1 -1
- package/dist/client/assets/{Copy01-CaF9W1F_.js → Copy01-Z8h17W5V.js} +1 -1
- package/dist/client/assets/{CreditCard01-Czi8bh9o.js → CreditCard01-BOXpMyZX.js} +1 -1
- package/dist/client/assets/{DotsVertical-DyDeVQCx.js → DotsVertical-BcY1zCnO.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-D4BkOvp5.js → ErrorBarContext-oZYgKRc9.js} +1 -1
- package/dist/client/assets/{Image01-CsDdVFAJ.js → Image01-BtlBqgq2.js} +1 -1
- package/dist/client/assets/{Key01-D2FR3CbZ.js → Key01-Crwm5tIn.js} +1 -1
- package/dist/client/assets/{Line-BfgHJMc3.js → Line-B6p_BSMr.js} +1 -1
- package/dist/client/assets/{Link01-NjQr5iwv.js → Link01-BCM1zE5K.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CR1925bA.js → LinkExternal01-BSjbzGPT.js} +1 -1
- package/dist/client/assets/{Monitor01-50nhII2F.js → Monitor01-Bu9itRvW.js} +1 -1
- package/dist/client/assets/{Palette-AyH3xXYO.js → Palette-Dfwz_KK_.js} +1 -1
- package/dist/client/assets/{Plus-DP7AHtKt.js → Plus-DWABMn2e.js} +1 -1
- package/dist/client/assets/{SearchMd-D_KPqWqZ.js → SearchMd-df6Y7iRV.js} +1 -1
- package/dist/client/assets/{Sector-BR7_Ijx1.js → Sector-DyaoP-4v.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-Dq4UD5Hm.js → ShoppingBag01-BzDsEvOc.js} +1 -1
- package/dist/client/assets/{Sun-oSoDHq1v.js → Sun-CuJDC_V5.js} +1 -1
- package/dist/client/assets/{Tool01-D2y7RTX1.js → Tool01-CXZVYCJV.js} +1 -1
- package/dist/client/assets/{Trash01-64yehlfB.js → Trash01-CZPHTYfi.js} +1 -1
- package/dist/client/assets/{Upload01-BvgQ3r-o.js → Upload01-BhUTj6_2.js} +1 -1
- package/dist/client/assets/{User01-CU3qbr5s.js → User01-BKQ4XDsb.js} +1 -1
- package/dist/client/assets/{UserSquare-nGw6lX43.js → UserSquare-C-IZAmnp.js} +1 -1
- package/dist/client/assets/{Users01-Lf2fvOej.js → Users01-NFbjkK3Z.js} +1 -1
- package/dist/client/assets/{X-NPE_cXRR.js → X-Df5KdWXB.js} +1 -1
- package/dist/client/assets/{XAxis-Drv4sXya.js → XAxis-BWQmNFV9.js} +1 -1
- package/dist/client/assets/{XClose-CMTvfCel.js → XClose-CigTCF4N.js} +1 -1
- package/dist/client/assets/{ZoomOut-xQj4oorm.js → ZoomOut-CrIY1x34.js} +1 -1
- package/dist/client/assets/{access-gate-DRBSlBtJ.js → access-gate-g9Q7ZgEZ.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-DHl4H43e.js → add-connection-dialog-7hGrBECA.js} +1 -1
- package/dist/client/assets/{agent-analytics-RDv7d0ta.js → agent-analytics-CObXpehp.js} +1 -1
- package/dist/client/assets/agent-app-k1_oJSpu.js +1 -0
- package/dist/client/assets/{agent-assets-QMTortLS.js → agent-assets-DO3tmGuX.js} +1 -1
- package/dist/client/assets/{agent-automation-kP7qIZSD.js → agent-automation-Ca1RFwdU.js} +1 -1
- package/dist/client/assets/{agent-automations-D5AIE6G6.js → agent-automations-CI9pfVCT.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-1UnRN6mW.js → agent-connect-sources-BuV_ZR1a.js} +1 -1
- package/dist/client/assets/agent-deck-CehM6vXp.js +1 -0
- package/dist/client/assets/{agent-e2e-DEc1NtfK.js → agent-e2e-CgIUjw8G.js} +1 -1
- package/dist/client/assets/{agent-experiments-D33dFCpI.js → agent-experiments-mi6BfJqy.js} +1 -1
- package/dist/client/assets/{agent-file-DxlwynYZ.js → agent-file-CGvjjvWl.js} +1 -1
- package/dist/client/assets/{agent-git-DVn4DsKt.js → agent-git-C25O_twU.js} +1 -1
- package/dist/client/assets/{agent-hosting-CgiR8Ql4.js → agent-hosting-C72vq_5m.js} +1 -1
- package/dist/client/assets/{agent-icon-TQUkqPJj.js → agent-icon-B241PBKK.js} +1 -1
- package/dist/client/assets/agent-library-BumAmLT2.js +1 -0
- package/dist/client/assets/agent-library-file-BnaSVA1s.js +1 -0
- package/dist/client/assets/{agent-monitor-DgcF05B9.js → agent-monitor-D6-3fGpu.js} +1 -1
- package/dist/client/assets/{agent-overview-dLl0w1eM.js → agent-overview-D3iRbnu8.js} +1 -1
- package/dist/client/assets/agent-settings-BGVwjdf6.js +1 -0
- package/dist/client/assets/{agent-site-editor-ITnkleU1.js → agent-site-editor-Bv4G1Ou2.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-B8dBeNBF.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-CNFJoRJD.js → agent-site-editor-content-SBwYc5Sx.js} +3 -3
- package/dist/client/assets/{agent-site-editor-preview-CNLkTYYB.js → agent-site-editor-preview-GCIpof6D.js} +3 -3
- package/dist/client/assets/agent-view-BxYubinM.js +1 -0
- package/dist/client/assets/{agent-view-guard-BbHyaShN.js → agent-view-guard-yCCS9tda.js} +1 -1
- package/dist/client/assets/{agents-list-D9hihWFU.js → agents-list-D9Qqbumt.js} +1 -1
- package/dist/client/assets/{ai-providers-oyOl9W3y.js → ai-providers-BRF8Kdv0.js} +1 -1
- package/dist/client/assets/{alert-CokNymqA.js → alert-Vbti1gEG.js} +1 -1
- package/dist/client/assets/{alert-dialog-DeJgSFRZ.js → alert-dialog-AqvICzdc.js} +1 -1
- package/dist/client/assets/{analytics-sections-DDWh8YnS.js → analytics-sections-BRRkR5Qo.js} +1 -1
- package/dist/client/assets/api-keys-BHkPvB4Y.js +1 -0
- package/dist/client/assets/{api-keys-Ch7q_sOP.js → api-keys-BNqPisrV.js} +1 -1
- package/dist/client/assets/{app-editor-BhWLpri1.js → app-editor-D6e4YO7u.js} +1 -1
- package/dist/client/assets/{asset-utils-BRk3fUR7.js → asset-utils-BAeS61or.js} +1 -1
- package/dist/client/assets/{auth-BNR-bSJO.js → auth-C0Awroma.js} +1 -1
- package/dist/client/assets/{auth-catchall-CJ0eRklU.js → auth-catchall-M1lbFyHW.js} +1 -1
- package/dist/client/assets/{auth-entry-XcfUUozZ.js → auth-entry-DNTBr4dX.js} +1 -1
- package/dist/client/assets/{auth-split-layout-mYNIGFvp.js → auth-split-layout-VyPiSI-b.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CZrI0wkU.js → authenticate-and-persist-oauth-CkO9YCus.js} +1 -1
- package/dist/client/assets/{automation-list-row-DfLOPauj.js → automation-list-row-NNUpUcl1.js} +1 -1
- package/dist/client/assets/{automation-runs-RuvSYlk2.js → automation-runs-CmqXHMa2.js} +1 -1
- package/dist/client/assets/{automations-CQh_fULy.js → automations-tpSvjSCZ.js} +1 -1
- package/dist/client/assets/{autosend-h1h21hnM.js → autosend-BBuziBf6.js} +1 -1
- package/dist/client/assets/{avatar-UFbMnkmr.js → avatar-Cm5Wz0Ek.js} +1 -1
- package/dist/client/assets/{badge-DzTxW-Ts.js → badge-D-X7jCCj.js} +1 -1
- package/dist/client/assets/{block-document-hxIwEIoN.js → block-document-CBORFGb8.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-DRl7lMaq.js → blocks-preview-workspace-context-smhHThS8.js} +1 -1
- package/dist/client/assets/{buckets-B-CYwdgC.js → buckets-B5krVge0.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-DNmtsTJk.js → build-improve-prompt-doc-BXIVXD_M.js} +1 -1
- package/dist/client/assets/{calendar-Bx26MiuJ.js → calendar-lqFPIlGZ.js} +1 -1
- package/dist/client/assets/{capability-load-error-BWTOxRLG.js → capability-load-error-8yr0cKsu.js} +1 -1
- package/dist/client/assets/{category-editor-DjdC64aL.js → category-editor-Cp8uxqcx.js} +1 -1
- package/dist/client/assets/{chart-BxpZzVsr.js → chart-BjcjMBp2.js} +1 -1
- package/dist/client/assets/{chat-context-DppIIhzA.js → chat-context-Bw1Qo4Kf.js} +1 -1
- package/dist/client/assets/{chat-draft-DiJpqitX.js → chat-draft-CQ5qjDsv.js} +1 -1
- package/dist/client/assets/{checkbox-BGfnFNv1.js → checkbox-BHKLlAci.js} +1 -1
- package/dist/client/assets/{choose-editor-DHwWSJiW.js → choose-editor-VLE21WTh.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-BRgB3yX1.js → claim-phase-copy-Bc0le9Uu.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BX3DQOO5.js → cli-auth-success-EpJb9LMW.js} +1 -1
- package/dist/client/assets/{client-icons-CYZ83j__.js → client-icons-DF05jGYG.js} +1 -1
- package/dist/client/assets/{collapsible-C2j127TD.js → collapsible-FI3WWzNe.js} +1 -1
- package/dist/client/assets/{collection-detail-ehNX3PLY.js → collection-detail-DA5Whp5b.js} +1 -1
- package/dist/client/assets/{collection-display-button-CwIm419d.js → collection-display-button-D2q-ABWg.js} +1 -1
- package/dist/client/assets/{collection-search-D_azi8Gq.js → collection-search-DdV66iL8.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DMU9yWMT.js → collection-table-wrapper-CGlcKHbe.js} +1 -1
- package/dist/client/assets/{collection-tabs-C6N84gCC.js → collection-tabs-DtGcsdTg.js} +1 -1
- package/dist/client/assets/{combobox--XWfS5lw.js → combobox-Br6WHzj1.js} +1 -1
- package/dist/client/assets/{command-D1RoIxg2.js → command-DkuU4Z8a.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-Cs-LBxQr.js → companion-mcps-section-CNei3iRu.js} +1 -1
- package/dist/client/assets/{config-CMMAnMUF.js → config-DynGIo1W.js} +1 -1
- package/dist/client/assets/{connect-DVE1Hnuy.js → connect-DG6OAh89.js} +1 -1
- package/dist/client/assets/{connect-layout--NwWaqYw.js → connect-layout-Cnc4NK49.js} +1 -1
- package/dist/client/assets/{connection-Ds6vwkGM.js → connection-CbXyxk_0.js} +1 -1
- package/dist/client/assets/{connection-card-BPKFHpho.js → connection-card-DvwNTHUt.js} +1 -1
- package/dist/client/assets/{connection-detail-BroJMnyc.js → connection-detail-DRP-MNPt.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-C4OB4j_3.js → connection-form-helpers-BoZMz-Fx.js} +1 -1
- package/dist/client/assets/{connections-DG2GlCvy.js → connections-C9THVD3s.js} +1 -1
- package/dist/client/assets/{context-BL1LKuLQ.js → context-D6Zd3Hi2.js} +1 -1
- package/dist/client/assets/{context-menu-CBJP1RfU.js → context-menu-VjgUfeOJ.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BQ0I0t_j.js → create-organization-dialog-C3ngVf0Y.js} +1 -1
- package/dist/client/assets/{daily-pulse-Dpp9pCbq.js → daily-pulse-DEC1kU0r.js} +1 -1
- package/dist/client/assets/{decopilot-BRlhj2Gw.js → decopilot-DTXbrEBB.js} +1 -1
- package/dist/client/assets/{dialog-Mg_Z3ES1.js → dialog-BR2W-zw-.js} +1 -1
- package/dist/client/assets/{discover-DCHf1gBE.js → discover-C0WrsbFb.js} +1 -1
- package/dist/client/assets/{domain-settings-CmoTC2Mj.js → domain-settings-VjNI_QNS.js} +1 -1
- package/dist/client/assets/{download-app-dialog-B7zcmkcH.js → download-app-dialog-UGyaf1gI.js} +1 -1
- package/dist/client/assets/{drawer-BIoKJwCW.js → drawer-BuCU4dtF.js} +1 -1
- package/dist/client/assets/{editor-JpZ1gWwV.js → editor-K_ZCeYmt.js} +1 -1
- package/dist/client/assets/{empty-state-BmztM-Bo.js → empty-state-Cc-zeI-b.js} +1 -1
- package/dist/client/assets/{empty-state-BayRP7H4.js → empty-state-CyVuIHKP.js} +1 -1
- package/dist/client/assets/{extract-connection-data-D5wjQBt3.js → extract-connection-data-CJFs5pw9.js} +1 -1
- package/dist/client/assets/{feature-gate-DvQXfI5S.js → feature-gate-DLNLPr3F.js} +1 -1
- package/dist/client/assets/{feature-paywall-sc2LtOXc.js → feature-paywall-dsk7xdNr.js} +1 -1
- package/dist/client/assets/{file-explorer-CqjD-skS.js → file-explorer-Bq_pA8Z8.js} +1 -1
- package/dist/client/assets/{file-preview-VfWoS2gk.js → file-preview-mQPZHAmY.js} +1 -1
- package/dist/client/assets/{file-share-button-BGOzbmtb.js → file-share-button-DtFsmxK8.js} +1 -1
- package/dist/client/assets/{file-type-icon-BhiPdwxi.js → file-type-icon-Dl1YFVBW.js} +1 -1
- package/dist/client/assets/flat-project-BIYjLVHC.js +1 -0
- package/dist/client/assets/{folder-icon-DBIJdeY7.js → folder-icon-CECAOUab.js} +1 -1
- package/dist/client/assets/{form-BgAERq-t.js → form-vqBaFO9r.js} +1 -1
- package/dist/client/assets/{gateway-client-CIbTMjGx.js → gateway-client-C-QySNgV.js} +1 -1
- package/dist/client/assets/{general-BBuB4XlH.js → general-Do2cA-65.js} +1 -1
- package/dist/client/assets/{home-C96-FMPc.js → home-DYEN5n0q.js} +1 -1
- package/dist/client/assets/{icon-button-CWL5E4Ua.js → icon-button-D6LkIJqw.js} +1 -1
- package/dist/client/assets/{index-B0WfPFpv.js → index-B65bqTRS.js} +1 -1
- package/dist/client/assets/{index-BZOsa8jC.js → index-BINYmdVo.js} +1 -1
- package/dist/client/assets/{index-CORXJXSN.js → index-BMtTkIcx.js} +1 -1
- package/dist/client/assets/{index-DWe-6mCD.js → index-BOvE7Vou.js} +1 -1
- package/dist/client/assets/{index-B9dD9jj0.js → index-B_3mBk4y.js} +47 -47
- package/dist/client/assets/{index-2-Z1VD2F.js → index-BgbBMhHU.js} +1 -1
- package/dist/client/assets/{index-DR9ob9os.js → index-BgjS0Ggx.js} +1 -1
- package/dist/client/assets/{index-DL-sDqTO.js → index-C0Nx6fZO.js} +1 -1
- package/dist/client/assets/{index-vYawqXRD.js → index-C5qguP-p.js} +1 -1
- package/dist/client/assets/{index-r8TBLtcZ.js → index-CSpDxMoa.js} +1 -1
- package/dist/client/assets/{index-RYaP6qX3.js → index-Cdm-vjxa.js} +3 -3
- package/dist/client/assets/{index-v5QvptSB.js → index-DYGqHQ2c.js} +1 -1
- package/dist/client/assets/{index-CpszPQp_.js → index-Dg8x2nny.js} +1 -1
- package/dist/client/assets/{index-ROw_u5-U.js → index-Dka8jQlP.js} +1 -1
- package/dist/client/assets/{index-Bv71AEH5.js → index-MTPwGC5m.js} +1 -1
- package/dist/client/assets/{index-redirect-DN5m0MeF.js → index-redirect-DoeqrB6K.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-Ex2lNjjr.js → infiniteQueryObserver-CBfG4TV-.js} +1 -1
- package/dist/client/assets/{infra-billing-BvYXN3Z1.js → infra-billing-BLgAtuiz.js} +1 -1
- package/dist/client/assets/{input-Cndqm_5O.js → input-B1N39T_Y.js} +1 -1
- package/dist/client/assets/{input-BmzPGvUi.js → input-BwSTkgpp.js} +1 -1
- package/dist/client/assets/{input-BZloVZ72.js → input-i0t9B7Yt.js} +3 -3
- package/dist/client/assets/{integration-icon-C5NBXdpz.js → integration-icon-DF1SWs0L.js} +1 -1
- package/dist/client/assets/{label-DpahMcEo.js → label-CAMUAUyp.js} +1 -1
- package/dist/client/assets/{last-preview-page-Dfux_ulA.js → last-preview-page-B2E_iOQP.js} +1 -1
- package/dist/client/assets/{layout-C6k3EFd1.js → layout-SznEbmEi.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-B_DiKZ0c.js → legacy-agents-deep-DzXfGrO1.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BgIGaynA.js → legacy-main-redirect-2uht7lTs.js} +1 -1
- package/dist/client/assets/library-BGY_wvai.js +1 -0
- package/dist/client/assets/{library-tab-Bso2C2NG.js → library-tab-8HAhdPuS.js} +1 -1
- package/dist/client/assets/{login-CXuSqosI.js → login-Dofn0_em.js} +1 -1
- package/dist/client/assets/{markdown-D8U5yexH.js → markdown-B9aD1F1t.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-CWOIFfi6.js → mcp-app-renderer-CCjWAcAL.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DCDrWVc0.js → mcp-oauth-D4Ea-Fft.js} +1 -1
- package/dist/client/assets/{members-BfRC0ceX.js → members-BvY310ge.js} +1 -1
- package/dist/client/assets/{message-templates-DgOMle6a.js → message-templates-CUdgVJRM.js} +1 -1
- package/dist/client/assets/{mini-report-page-BIktJNbh.js → mini-report-page-BNEmX88t.js} +1 -1
- package/dist/client/assets/{mock-board-DjQ6xrU_.js → mock-board-DoArRGPA.js} +1 -1
- package/dist/client/assets/{monaco-editor-BRUSLTLk.js → monaco-editor-B_VHQ5gY.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-C4bB2YFf.js → monitoring-stats-row-BDqEJkb_.js} +1 -1
- package/dist/client/assets/{multi-select-6bm7qEEn.js → multi-select-CgpS87eq.js} +1 -1
- package/dist/client/assets/{mustache-CAmcva4T.js → mustache-DmCtN5od.js} +1 -1
- package/dist/client/assets/{new-project-dialog-BejzbVG2.js → new-project-dialog-k4u3nID3.js} +1 -1
- package/dist/client/assets/{oauth-callback-0bxicPCo.js → oauth-callback-DFoxcVbz.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-D4kx59om.js → oauth-callback-ai-provider-Clc7UcPT.js} +1 -1
- package/dist/client/assets/{onboarding-C7mIZXvc.js → onboarding-QzWSNB68.js} +1 -1
- package/dist/client/assets/{openai-conversation-DYPzWsQc.js → openai-conversation-BYnJG3sG.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-DHo7EiTm.js → optimistic-project-sidebar-views-Bmn0i2L0.js} +1 -1
- package/dist/client/assets/{org-file-open-context-CSDcMwBD.js → org-file-open-context-C81CF5lY.js} +1 -1
- package/dist/client/assets/{organization-choice-BZ-4C5a6.js → organization-choice-1Ch3usqI.js} +1 -1
- package/dist/client/assets/{orgs-DnEd_o3Y.js → orgs-S_td7jXe.js} +1 -1
- package/dist/client/assets/{page-seo-form-BjAunJ7T.js → page-seo-form-CejuwtL1.js} +1 -1
- package/dist/client/assets/{pair-o8Pcow3m.js → pair-CffqlQYs.js} +1 -1
- package/dist/client/assets/{plan-ladder-COYrpP9N.js → plan-ladder-elmtHhgS.js} +1 -1
- package/dist/client/assets/{popover-D5s3M61L.js → popover-HtaOhw3r.js} +1 -1
- package/dist/client/assets/{post-calendar-Cl-vAwk3.js → post-calendar-BLuKhT2v.js} +1 -1
- package/dist/client/assets/{post-editor-D2HU9kfD.js → post-editor-B9m6130P.js} +1 -1
- package/dist/client/assets/{preview-content-B9bgsNRh.js → preview-content-7Xoo-BsV.js} +1 -1
- package/dist/client/assets/{preview-dialog-CwQ43Y6v.js → preview-dialog-EGWZsCf5.js} +1 -1
- package/dist/client/assets/{profile-BB1G47uY.js → profile-CdaDKILV.js} +1 -1
- package/dist/client/assets/{project-app-view-DS-jWTJh.js → project-app-view-DkTFe9BB.js} +1 -1
- package/dist/client/assets/{project-feed-Ceha3l-R.js → project-feed-JKI4eiPj.js} +1 -1
- package/dist/client/assets/{project-icon-CmV-Y1UZ.js → project-icon-CZCXf1ZD.js} +1 -1
- package/dist/client/assets/project-reports-CV3jPJF3.js +1 -0
- package/dist/client/assets/project-tasks-ByZ39JiK.js +1 -0
- package/dist/client/assets/{projects-Cv5osXsD.js → projects-DvXWKplD.js} +1 -1
- package/dist/client/assets/{projects-empty-state-CaTjevnb.js → projects-empty-state-9gNmeZsq.js} +1 -1
- package/dist/client/assets/{prompts-BgUtk3zC.js → prompts-DDBWSiYr.js} +1 -1
- package/dist/client/assets/record-editor-BwyoUD4K.js +1 -0
- package/dist/client/assets/{redirect-editor-BpclUTIj.js → redirect-editor-dBYIGyFb.js} +1 -1
- package/dist/client/assets/{reports-CLznlgS5.js → reports-BVjd03mK.js} +1 -1
- package/dist/client/assets/reports-PlaJXl-j.js +1 -0
- package/dist/client/assets/{reports-onboarding-BHCXUocU.js → reports-onboarding-s5-OPdwG.js} +1 -1
- package/dist/client/assets/{reports-tab-CoZHZlVb.js → reports-tab-zEmYxglx.js} +2 -2
- package/dist/client/assets/{repositories-DoauYKeu.js → repositories-q5YM_f7_.js} +1 -1
- package/dist/client/assets/{repository-binding-DzrKIMc8.js → repository-binding-DoGbZGqV.js} +1 -1
- package/dist/client/assets/{repository-import-picker-CVP1mN_O.js → repository-import-picker-Do_6Wg0W.js} +1 -1
- package/dist/client/assets/{repository-picker-BIkrH86Z.js → repository-picker-EdvJ_XCR.js} +1 -1
- package/dist/client/assets/{require-capability-CEGMzsiO.js → require-capability-C1D1dXCn.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BPzqc-yZ.js → required-auth-layout-DL1Uhs7R.js} +1 -1
- package/dist/client/assets/{reset-password-CC9lxhEO.js → reset-password-CQfjAeYc.js} +1 -1
- package/dist/client/assets/{resizable-Ck9CN4S9.js → resizable-eratR9AK.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-CgOUF0YA.js → resolve-tab-icon-Du8jGUtn.js} +1 -1
- package/dist/client/assets/{review-settings-cCLUF68J.js → review-settings-BDXdSq0U.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-RS2mJIfp.js → rich-text-link-control-BUaa9cuE.js} +1 -1
- package/dist/client/assets/{roles-DWD7cz1d.js → roles-BxLQKznn.js} +1 -1
- package/dist/client/assets/{route-DI4K2hiz.js → route-DN3pk65w.js} +1 -1
- package/dist/client/assets/route-Dk3w9UGz.js +1 -0
- package/dist/client/assets/{route-CjKIfVgB.js → route-GFaA83CZ.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-h-xGxUBS.js → runnable-block-editor-Bb72YaFN.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-OPdARg4I.js → sandbox-lifecycle-context-CZnq-87O.js} +1 -1
- package/dist/client/assets/{schema-BejaMrNT.js → schema-pZTMqosP.js} +1 -1
- package/dist/client/assets/{scroll-area-DjfgE2jb.js → scroll-area-kaq4mbUn.js} +1 -1
- package/dist/client/assets/{search-input-DviARBm2.js → search-input-BjeWS4bC.js} +1 -1
- package/dist/client/assets/{search-toggle-DvOTtKmA.js → search-toggle-BWjdA70E.js} +1 -1
- package/dist/client/assets/{secret-picker-CuEw2DSI.js → secret-picker-DFruMsO2.js} +1 -1
- package/dist/client/assets/{secrets-CoVAIKwE.js → secrets-C0ksgflf.js} +1 -1
- package/dist/client/assets/{sections-editor-CsNiIfgn.js → sections-editor-25cXOA_1.js} +1 -1
- package/dist/client/assets/{select-Cd1ykg-h.js → select-MC8L6Y4s.js} +1 -1
- package/dist/client/assets/{select-model-a344Xqu_.js → select-model-CgfK5T0X.js} +1 -1
- package/dist/client/assets/{seo-editor-D4_b59uB.js → seo-editor-qQizVqfD.js} +1 -1
- package/dist/client/assets/{separator-Ch977YA1.js → separator-CMC_q_rJ.js} +1 -1
- package/dist/client/assets/{settings-tab-sWmscvB1.js → settings-tab-DetxVou8.js} +1 -1
- package/dist/client/assets/{sheet-lggFYx6M.js → sheet-HF0WcB82.js} +1 -1
- package/dist/client/assets/{shell-layout-Bl8of89A.js → shell-layout-CTm_WHyN.js} +1 -1
- package/dist/client/assets/{skills-CzJ783Zp.js → skills-DfctZoHI.js} +1 -1
- package/dist/client/assets/{sso-DKlO8_Lq.js → sso-ChHWqNYy.js} +1 -1
- package/dist/client/assets/{suggestion-K--t6EP5.js → suggestion-CJYj-5kL.js} +1 -1
- package/dist/client/assets/{switch-BLWgY1pz.js → switch-BXBfxHLv.js} +1 -1
- package/dist/client/assets/{synced-repos-BnWEHPVF.js → synced-repos-8_ZxjVlT.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-C_bZ6WrZ.js → tab-icon-glyph-DdzedQEj.js} +1 -1
- package/dist/client/assets/{table-CufJwyXQ.js → table-DfMMeaNU.js} +1 -1
- package/dist/client/assets/{tabs-C1zPDoUI.js → tabs-CyQ-WrSH.js} +1 -1
- package/dist/client/assets/{task-board-DlEJAtdm.js → task-board-B1vzDAVG.js} +1 -1
- package/dist/client/assets/{task-route-z_uMrYh2.js → task-route-CxVqvuSa.js} +1 -1
- package/dist/client/assets/{task-status-DrVr4O9O.js → task-status-D_Ny_vO8.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-BEIixlIh.js → taskboard-analytics-9f61Lf0z.js} +1 -1
- package/dist/client/assets/{tasks-CpEABx-G.js → tasks--AojwOyu.js} +1 -1
- package/dist/client/assets/tasks-74JEZOvb.js +1 -0
- package/dist/client/assets/{textarea-r66bOcCD.js → textarea-VVwww85B.js} +1 -1
- package/dist/client/assets/{thread-analytics-BmowQF8I.js → thread-analytics-CGfF4U1z.js} +1 -1
- package/dist/client/assets/{thread-intent-UQGFcX_y.js → thread-intent-BwAsu2SG.js} +2 -2
- package/dist/client/assets/{thread-route-CVz2UKe8.js → thread-route-Bg90UHhP.js} +1 -1
- package/dist/client/assets/{thread-route-CowkfwAl.js → thread-route-CqPKjeFM.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-CxW1uZ8Z.js → thread-sheet-body-CAMNdnPV.js} +1 -1
- package/dist/client/assets/{toggle-group-BQtHqwCK.js → toggle-group-D4zRc1HZ.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-B4QTn-IO.js → toolbar-icon-button-voXPSLQD.js} +1 -1
- package/dist/client/assets/{tooltip-CM3YyNDC.js → tooltip-A9lPSKit.js} +1 -1
- package/dist/client/assets/{track-BqJ0I7ao.js → track-DobpObFT.js} +1 -1
- package/dist/client/assets/{types-DyM6In73.js → types-BjX52uU5.js} +1 -1
- package/dist/client/assets/{usage-stats-5Vc6zWOp.js → usage-stats-BY7R-UV8.js} +1 -1
- package/dist/client/assets/{use-ai-providers-C98JaJAU.js → use-ai-providers-CajwguYo.js} +1 -1
- package/dist/client/assets/{use-automations-CqbCGltu.js → use-automations-VXPCxEzn.js} +1 -1
- package/dist/client/assets/{use-autosave-tzZy_E8d.js → use-autosave-BgA4fgaR.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-BfZJHnkW.js → use-chat-layout-state-DD1tmwdx.js} +1 -1
- package/dist/client/assets/{use-connect-companion-DfiphJ3V.js → use-connect-companion-CHoHPYq5.js} +1 -1
- package/dist/client/assets/{use-connection-BdSGHKJK.js → use-connection-CWXA50IZ.js} +1 -1
- package/dist/client/assets/{use-copy-CiP5Vy7i.js → use-copy-B5g9zFhy.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CoU2LYN8.js → use-create-virtual-mcp-Dz5gwPDd.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-BQIR67dY.js → use-date-fns-locale-CZN80RON.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-6IETzqNZ.js → use-debounced-autosave-DKVhWfae.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DCYhoWzs.js → use-debounced-value-yeyF9VWy.js} +1 -1
- package/dist/client/assets/{use-deco-credits-x58AfrXU.js → use-deco-credits-BjM50lqx.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BZQXzmAo.js → use-decopilot-events-DgoNCAj-.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CzvLG4mr.js → use-delete-connection-nsQYmlH3.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BmH0eskZ.js → use-deployment-admin-5llNNzV_.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-DFL8djh0.js → use-fast-preview-draft-url-Cm_dQrR9.js} +1 -1
- package/dist/client/assets/{use-file-configs-DRP3Y7X_.js → use-file-configs-MloqKXG4.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BjVQV3DR.js → use-infinite-scroll-CgnPiJA2.js} +1 -1
- package/dist/client/assets/{use-join-requests-B6dqmlCQ.js → use-join-requests-Cr0cV6H_.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-sy9nYCqA.js → use-main-panel-tabs-CMknOIXL.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-Cjd2QrWU.js → use-mcp-auth-status-BBrvcdmC.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CqsHeShn.js → use-mcp-client-B_ORPqL8.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-D2YpCb1K.js → use-mcp-prompts-DL8S5JPE.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CHvaFbLg.js → use-mcp-tools-BUyi99fx.js} +1 -1
- package/dist/client/assets/{use-members-BIhBY7mT.js → use-members-C5YyvV0b.js} +1 -1
- package/dist/client/assets/{use-mobile-3MM_rw4D.js → use-mobile-Cit5JQWz.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-PjEm7mol.js → use-navigate-to-agent-BwWHCV0Z.js} +1 -1
- package/dist/client/assets/use-new-blocks-editor-BgW4UDeW.js +1 -0
- package/dist/client/assets/{use-open-billing-url-CVEaCqtR.js → use-open-billing-url-ufz1Edxj.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DM3Q5_fm.js → use-org-auth-client-uJpLhcXu.js} +1 -1
- package/dist/client/assets/{use-org-fs-DazA0BMP.js → use-org-fs-DSneEZr8.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DGjVBBAK.js → use-org-repo-syncs-rComLsRR.js} +1 -1
- package/dist/client/assets/{use-org-sso-DGy0uwEN.js → use-org-sso-DlHcchE2.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Bjw-G0xx.js → use-organization-roles-DMe1nsd1.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DbPbYeMx.js → use-organization-settings-NLGfOzk9.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-DH6_TAsx.js → use-panel-navigate-xfYLfPeP.js} +1 -1
- package/dist/client/assets/{use-project-scope-Bgnjdhs7.js → use-project-scope-mDKXkaKI.js} +1 -1
- package/dist/client/assets/{use-releases-DQGDjOy5.js → use-releases-B5H9FpQL.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-BASyyQU9.js → use-reports-diagnostic-Ds5W47nv.js} +1 -1
- package/dist/client/assets/{use-secrets-B41nk4LH.js → use-secrets-ycW9IMTs.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DKahorN-.js → use-section-preview-base-C7g5i8aB.js} +1 -1
- package/dist/client/assets/{use-session-runtime-CsLaMszW.js → use-session-runtime-41aA3FaG.js} +1 -1
- package/dist/client/assets/{use-tags-BQ9peM4A.js → use-tags-DCucaR9s.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-Co6FjpoI.js → use-task-board-analytics-Bn9GQ2td.js} +1 -1
- package/dist/client/assets/{use-task-board-events-BsviWCWn.js → use-task-board-events-0X4biGfq.js} +1 -1
- package/dist/client/assets/{use-task-metadata-DvgRil5z.js → use-task-metadata-Cj1cmQvo.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-Bf4bUeLT.js → use-thread-analytics-AHDY4dNK.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-CvWfZHjR.js → use-thread-outputs-Blfor-oA.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CN5NPBR0.js +1 -0
- package/dist/client/assets/{useQueries-CIVnwtOu.js → useQueries-JzYmKszp.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CI9mo6bF.js +1 -0
- package/dist/client/assets/{users-2Adoo8D9.js → users-CfSFNWT_.js} +1 -1
- package/dist/client/assets/{utils-BeoNvR__.js → utils-C1m0wvDK.js} +1 -1
- package/dist/client/assets/{variant-calendar-C6HvphcB.js → variant-calendar-C4_2wBML.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-De1zsqbc.js → variant-matcher-override-BAnoj0VK.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DtqPFP6s.js → view-mode-toggle-chgrfj1u.js} +1 -1
- package/dist/client/assets/{virtual-mcp-Cr9A-Wo0.js → virtual-mcp-B2jselSK.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-BMOs_YKU.js +0 -1
- package/dist/client/assets/agent-deck-9_2F3EG2.js +0 -1
- package/dist/client/assets/agent-library-BoJuDeBh.js +0 -1
- package/dist/client/assets/agent-library-file-Dyz9u3bt.js +0 -1
- package/dist/client/assets/agent-settings-MQLrMTV8.js +0 -1
- package/dist/client/assets/agent-site-editor-code-D4dXTr1f.js +0 -2
- package/dist/client/assets/agent-view-CfCVRWZl.js +0 -1
- package/dist/client/assets/api-keys-DLiRLY55.js +0 -1
- package/dist/client/assets/flat-project-wkNYEFlO.js +0 -1
- package/dist/client/assets/library-D6flTj5t.js +0 -1
- package/dist/client/assets/project-reports-M4OcQRnq.js +0 -1
- package/dist/client/assets/project-tasks-D2UK5JuX.js +0 -1
- package/dist/client/assets/record-editor-C0G9mTGj.js +0 -1
- package/dist/client/assets/reports-cbjIbfxK.js +0 -1
- package/dist/client/assets/route-n8gaWLVb.js +0 -1
- package/dist/client/assets/tasks-l5i1Y6YC.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-BAZ5qlTk.js +0 -1
- package/dist/client/assets/useInfiniteQuery-TQWsreUe.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DMyZCSsI.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-editor-
|
|
2
|
-
import{c as ae,b as Se,j as n,m as gs,K as Pt,l as be,r as $,h as lt,B as _e,o as _o,e as Do,t as me,a2 as js,aF as St,aN as bt,F as It,aG as Ks,H as Rt,I as Ft,aA as Ao,U as $o,V as Lo,G as Je,ak as Tt,al as ds,ag as Oo,X as Io,u as Nn,aL as He}from"./index-B9dD9jj0.js";import{A as Ro}from"./agent-view-guard-BbHyaShN.js";import{F as Fo}from"./feature-gate-DvQXfI5S.js";import{u as Bt,b as Cn}from"./chat-context-DppIIhzA.js";import{i as Wt}from"./AlertCircle-CXwWyjWL.js";import{I as Ko,T as Pn,U as et,V as Tn,W as ks,X as zo,Y as Bn,Z as Mo,b as Kt,O as En,_ as Vo,$ as Go,a0 as wt,a1 as Uo,a2 as Ho,n as qo,a3 as Jo,a4 as _n,a5 as Wo,a6 as Yo,a7 as Qo,l as zs,a8 as Xo,G as Dn}from"./agent-icon-TQUkqPJj.js";import{a as An,i as Ss,d as Ms}from"./UserSquare-nGw6lX43.js";import{b as $n,i as Ln}from"./ZoomOut-xQj4oorm.js";import{c as On,i as Zo}from"./XClose-CMTvfCel.js";import{s as ws}from"./Plus-DP7AHtKt.js";import{t as In}from"./Users01-Lf2fvOej.js";import{f as ea,e as ta,b as sa,A as na,a as oa,d as aa,c as la,g as ia}from"./alert-dialog-DeJgSFRZ.js";import{S as Yt}from"./scroll-area-DjfgE2jb.js";import{T as We,a as Ye,b as Qe}from"./tooltip-CM3YyNDC.js";import{B as nt}from"./badge-DzTxW-Ts.js";import{S as us,n as ra,c as ca,g as Rn,B as ms,P as da,h as Fn,o as ua,i as xs,s as ma,u as Qt,l as fa,q as pa,R as ha,t as Kn,r as ga,v as xa,d as zn,w as ba,x as ya,y as Mn,z as va,M as ja,j as ka,A as Sa,p as wa,C as Na,D as Ca,e as Pa,f as Ta,E as Vs,F as Vn,k as Ba,G as Ea}from"./runnable-block-editor-h-xGxUBS.js";import{r as Ns,S as _a,m as Cs,i as Da,o as Aa,q as $a,n as Lt,v as La,R as Gn,t as Oa,l as Ia,w as Ra,x as Fa,y as Gs,G as Ps,g as Ka,z as za,e as Us,A as Ma,d as Va,B as Ga,D as Hs,h as Ua,E as Ha,F as qa}from"./claim-phase-copy-BRgB3yX1.js";import{u as Un,P as Ja}from"./mustache-CAmcva4T.js";import{n as Hn}from"./ShoppingBag01-Dq4UD5Hm.js";import{t as ft}from"./ChevronUp-Q2TBgNib.js";import{C as Wa,a as Ya,b as Qa}from"./collapsible-C2j127TD.js";import{c as Xa,d as Za}from"./sandbox-lifecycle-context-OPdARg4I.js";import{u as qn}from"./use-session-runtime-CsLaMszW.js";import{c as pt,d as it,e as ht,b as rt,D as ct,h as zt,a as el}from"./dialog-Mg_Z3ES1.js";import{I as Xe}from"./input-Cndqm_5O.js";import{C as Xt}from"./checkbox-BGfnFNv1.js";import{L as ze}from"./label-DpahMcEo.js";import{c as tl,b as sl,a as nl,d as ol,S as al}from"./select-Cd1ykg-h.js";import{o as ll}from"./sandbox-git-api-B1R0585s.js";import{b as qs}from"./sandbox-url-D3mC8qhT.js";import{a as Js}from"./utils-BeoNvR__.js";import{i as il}from"./CheckCircle-jESFBkr7.js";import{s as Ts}from"./Trash01-64yehlfB.js";import{i as fs}from"./Upload01-BvgQ3r-o.js";import{E as rl}from"./empty-state-BayRP7H4.js";import{T as Ot}from"./textarea-r66bOcCD.js";import{u as cl}from"./use-ai-providers-C98JaJAU.js";import{M as Jn}from"./monaco-editor-BRUSLTLk.js";import{i as Bs}from"./X-NPE_cXRR.js";import{f as Wn,a as dl}from"./repository-binding-DzrKIMc8.js";import"./rich-text-link-control-RS2mJIfp.js";import{a as ul}from"./Copy01-CaF9W1F_.js";import{c as ml}from"./Tool01-D2y7RTX1.js";import{b as Ws}from"./use-project-scope-Bgnjdhs7.js";import{E as fl}from"./empty-state-BmztM-Bo.js";import{G as Ys}from"./repository-picker-BIkrH86Z.js";import{R as pl}from"./repository-import-picker-CVP1mN_O.js";import{b as hl}from"./thread-route-CowkfwAl.js";function gl(t){const e=ae.c(18),{title:s,description:o,children:a}=t,l=Se();let i;e[0]!==a?(i=n.jsx("div",{"aria-hidden":"true",inert:!0,className:"pointer-events-none h-full select-none overflow-hidden",children:a}),e[0]=a,e[1]=i):i=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Ko,{}),e[2]=c):c=e[2];let r;e[3]!==l?(r=l("common.soon"),e[3]=l,e[4]=r):r=e[4];let d;e[5]!==r?(d=n.jsxs(nt,{variant:"secondary",children:[c,r]}),e[5]=r,e[6]=d):d=e[6];let p;e[7]!==s?(p=n.jsx("p",{className:"text-base font-semibold text-foreground",children:s}),e[7]=s,e[8]=p):p=e[8];let m;e[9]!==o?(m=o&&n.jsx("p",{className:"text-sm text-muted-foreground",children:o}),e[9]=o,e[10]=m):m=e[10];let h;e[11]!==d||e[12]!==p||e[13]!==m?(h=n.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-background/60 p-6 backdrop-blur-sm",children:n.jsxs("div",{className:"flex max-w-sm flex-col items-center gap-3 rounded-2xl border bg-card px-8 py-6 text-center shadow-lg",children:[d,p,m]})}),e[11]=d,e[12]=p,e[13]=m,e[14]=h):h=e[14];let u;return e[15]!==i||e[16]!==h?(u=n.jsxs("div",{className:"relative h-full min-h-0",children:[i,h]}),e[15]=i,e[16]=h,e[17]=u):u=e[17],u}function xl(t,e){if(!t||!e?.length)return t;const s=Object.fromEntries(Object.entries(t.properties??{}).filter(([o])=>!e.includes(o)));return Object.keys(s).length>0?{...t,properties:s}:t}function bl(t,e,s){return typeof t!="string"?null:xl(Ns(t,e),s)}function Yn(t,e,s){if(!e||typeof t!="string")return!1;const o=bl(t,e,s);return!!o&&Object.keys(o.properties??{}).length>0}function yt(t){const e=ae.c(6),{hasItems:s,emptyLabel:o,emptyHint:a}=t;let l;e[0]!==a||e[1]!==o||e[2]!==s?(l=s?"No results match your search.":n.jsxs(n.Fragment,{children:[n.jsx("div",{children:o}),n.jsx("div",{className:"mt-1 text-muted-foreground/80",children:a})]}),e[0]=a,e[1]=o,e[2]=s,e[3]=l):l=e[3];let i;return e[4]!==l?(i=n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:l}),e[4]=l,e[5]=i):i=e[5],i}function Zt(t,e){return`${t}-${e}`}function Qn(t,e){return`site/apps/${t}/${e}.ts`}function Xn(t){const e=t.match(/^site\/apps\/([^/]+)\/([^/.]+)\.tsx?$/);if(e)return{vendor:e[1],app:e[2]};const s=t.match(/^([^/]+)\/apps\/([^/.]+)\.tsx?$/);return s?{vendor:s[1],app:s[2]}:null}function yl(t){const e=t.match(/^([^-]+)-(.+)$/);return e?{vendor:e[1],app:e[2]}:null}function vl(t){return t==="local"?"Custom":"Installed"}function Zn(t,e,s){const o=new Set([Zt(t,e),e].map(l=>l.toLowerCase())),a=Qn(t,e);for(const[l,i]of Object.entries(s)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const c=i;if(o.has(l.toLowerCase())||c.__resolveType===a)return l}return null}function jl(t,e){const s=t.vendor.alias,o=t.name,a=Zn(s,o,e);return{id:Zt(s,o),app:o,vendor:s,title:t.title||t.name,description:t.description,category:t.category??"Other",logo:t.logo||void 0,resolveType:Qn(s,o),blockKey:a,installed:a!==null}}function kl(t,e,s){if(t===_a)return null;const o=Xn(t);if(!o)return null;const{vendor:a,app:l}=o,i=Zn(a,l,s),c=Cs(t,e);return{id:Zt(a,l),app:l,vendor:a,title:c.title??l,description:c.description??"",category:"Others",logo:c.logo??c.icon,resolveType:t,blockKey:i,installed:i!==null}}function Sl(t,e,s){const o=e.__resolveType;if(typeof o!="string"||Da(t,e)||!Aa(o))return null;const a=Xn(o)??yl(t);if(!a)return null;const l=Cs(o,s),{vendor:i,app:c}=a;return{id:Zt(i,c),app:c,vendor:i,title:l.title??$a(t,e,s),description:l.description??"",category:vl(i),logo:l.logo??l.icon,resolveType:o,blockKey:t,installed:!0}}function wl(t,e,s){const o=new Map;for(const l of t){const i=jl(l,s);o.set(i.id,i)}const a=e.manifest?.blocks?.apps??{};for(const l of Object.keys(a)){const i=kl(l,e,s);!i||o.has(i.id)||o.set(i.id,i)}for(const[l,i]of Object.entries(s)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const c=Sl(l,i,e);!c||o.has(c.id)||o.set(c.id,c)}return[...o.values()].sort(Nl)}function Nl(t,e){return t.installed!==e.installed?t.installed?-1:1:t.title.localeCompare(e.title)}async function Cl(){const t=await fetch("/api/deco-apps");if(!t.ok)throw new Error(`Failed to fetch deco apps: ${t.status}`);return(await t.json()).apps??[]}function Pl(t,e,s){const o=ae.c(12),a=s?.enabled??!0;let l;o[0]===Symbol.for("react.memo_cache_sentinel")?(l=Pt.decoApps(),o[0]=l):l=o[0];let i;o[1]!==a?(i={queryKey:l,queryFn:Cl,staleTime:3e5,retry:1,enabled:a},o[1]=a,o[2]=i):i=o[2];const c=gs(i);let r;o[3]!==e||o[4]!==t||o[5]!==c.data?(r=t&&e?wl(c.data??[],t,e):[],o[3]=e,o[4]=t,o[5]=c.data,o[6]=r):r=o[6];const d=r,p=c.isLoading&&!c.isError;let m;return o[7]!==d||o[8]!==c.isError||o[9]!==c.refetch||o[10]!==p?(m={catalog:d,isLoading:p,isError:c.isError,refetch:c.refetch},o[7]=d,o[8]=c.isError,o[9]=c.refetch,o[10]=p,o[11]=m):m=o[11],m}const Tl=["sections","apps","loaders","actions"];function Bl(t){const e=ae.c(59),{active:s,counts:o,showBlog:a,onSelect:l}=t,i=Se();let c;e[0]!==i?(c=i("sandbox.collectionsSidebar.content"),e[0]=i,e[1]=c):c=e[1];let r;e[2]!==c?(r=n.jsx("div",{className:"px-3 h-12 flex items-center border-b shrink-0",children:n.jsx("span",{className:"text-sm font-medium",children:c})}),e[2]=c,e[3]=r):r=e[3];let d;e[4]!==i?(d=i("sandbox.collectionsSidebar.pages"),e[4]=i,e[5]=d):d=e[5];const p=s==="pages";let m;e[6]!==o.pages||e[7]!==l||e[8]!==d||e[9]!==p?(m=n.jsx(Re,{id:"pages",icon:An,label:d,count:o.pages,active:p,onSelect:l}),e[6]=o.pages,e[7]=l,e[8]=d,e[9]=p,e[10]=m):m=e[10];let h;e[11]!==i?(h=i("sandbox.collectionsSidebar.redirects"),e[11]=i,e[12]=h):h=e[12];const u=s==="redirects";let f;e[13]!==o.redirects||e[14]!==l||e[15]!==h||e[16]!==u?(f=n.jsx(Re,{id:"redirects",icon:Pn,label:h,count:o.redirects,active:u,onSelect:l}),e[13]=o.redirects,e[14]=l,e[15]=h,e[16]=u,e[17]=f):f=e[17];let x;e[18]!==i?(x=i("sandbox.collectionsSidebar.site"),e[18]=i,e[19]=x):x=e[19];const g=s==="site";let v;e[20]!==l||e[21]!==g||e[22]!==x?(v=n.jsx(Re,{id:"site",icon:zo,label:x,active:g,onSelect:l}),e[20]=l,e[21]=g,e[22]=x,e[23]=v):v=e[23];let y;e[24]!==i?(y=i("sandbox.collectionsSidebar.seo"),e[24]=i,e[25]=y):y=e[25];const j=s==="seo";let w;e[26]!==l||e[27]!==y||e[28]!==j?(w=n.jsx(Re,{id:"seo",icon:Bn,label:y,active:j,onSelect:l}),e[26]=l,e[27]=y,e[28]=j,e[29]=w):w=e[29];let N;e[30]!==i?(N=i("sandbox.collectionsSidebar.calendar"),e[30]=i,e[31]=N):N=e[31];const E=s==="calendar";let B;e[32]!==l||e[33]!==N||e[34]!==E?(B=n.jsx(Re,{id:"calendar",icon:Mo,label:N,active:E,onSelect:l}),e[32]=l,e[33]=N,e[34]=E,e[35]=B):B=e[35];let k;e[36]!==s||e[37]!==o||e[38]!==l?(k=n.jsx(El,{active:s,counts:o,onSelect:l}),e[36]=s,e[37]=o,e[38]=l,e[39]=k):k=e[39];let D;e[40]!==s||e[41]!==o.authors||e[42]!==o.categories||e[43]!==o.posts||e[44]!==l||e[45]!==a||e[46]!==i?(D=a&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mt-3 flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",children:[n.jsx(Hn,{size:13,className:"shrink-0"}),i("sandbox.collectionsSidebar.blog")]}),n.jsx(Re,{id:"context",icon:et,label:i("sandbox.collectionsSidebar.context"),active:s==="context",onSelect:l}),n.jsx(Re,{id:"posts",icon:$n,label:i("sandbox.collectionsSidebar.posts"),count:o.posts,active:s==="posts",onSelect:l}),n.jsx(Re,{id:"authors",icon:In,label:i("sandbox.collectionsSidebar.authors"),count:o.authors,active:s==="authors",onSelect:l}),n.jsx(Re,{id:"categories",icon:Tn,label:i("sandbox.collectionsSidebar.categories"),count:o.categories,active:s==="categories",onSelect:l}),n.jsx(Re,{id:"post-schedule",icon:ks,label:i("sandbox.collectionsSidebar.postSchedule"),active:s==="post-schedule",onSelect:l})]}),e[40]=s,e[41]=o.authors,e[42]=o.categories,e[43]=o.posts,e[44]=l,e[45]=a,e[46]=i,e[47]=D):D=e[47];let O;e[48]!==v||e[49]!==w||e[50]!==B||e[51]!==k||e[52]!==D||e[53]!==m||e[54]!==f?(O=n.jsxs("nav",{className:"flex flex-col p-1.5 gap-0.5",children:[m,f,v,w,B,k,D]}),e[48]=v,e[49]=w,e[50]=B,e[51]=k,e[52]=D,e[53]=m,e[54]=f,e[55]=O):O=e[55];let L;return e[56]!==r||e[57]!==O?(L=n.jsxs("div",{className:"w-[208px] shrink-0 border-r flex flex-col",children:[r,O]}),e[56]=r,e[57]=O,e[58]=L):L=e[58],L}function El(t){const e=ae.c(52),{active:s,counts:o,onSelect:a}=t,l=Se();let i;e[0]!==s?(i=Tl.includes(s),e[0]=s,e[1]=i):i=e[1];const c=i,[r,d]=$.useState(!1),p=r||c;let m,h;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=be("flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer","text-muted-foreground hover:bg-muted hover:text-foreground"),h=n.jsx(Vo,{size:16,className:"shrink-0"}),e[2]=m,e[3]=h):(m=e[2],h=e[3]);let u;e[4]!==l?(u=l("sandbox.collectionsSidebar.advanced"),e[4]=l,e[5]=u):u=e[5];let f;e[6]!==u?(f=n.jsx("span",{className:"flex-1 truncate",children:u}),e[6]=u,e[7]=f):f=e[7];const x=p&&"rotate-180";let g;e[8]!==x?(g=be("shrink-0 text-muted-foreground/70 transition-transform",x),e[8]=x,e[9]=g):g=e[9];let v;e[10]!==g?(v=n.jsx(ft,{size:16,className:g}),e[10]=g,e[11]=v):v=e[11];let y;e[12]!==f||e[13]!==v?(y=n.jsxs(Wa,{className:m,children:[h,f,v]}),e[12]=f,e[13]=v,e[14]=y):y=e[14];let j;e[15]!==l?(j=l("sandbox.collectionsSidebar.sections"),e[15]=l,e[16]=j):j=e[16];const w=s==="sections";let N;e[17]!==o.sections||e[18]!==a||e[19]!==j||e[20]!==w?(N=n.jsx(Re,{id:"sections",icon:Kt,label:j,count:o.sections,active:w,onSelect:a,indent:!0}),e[17]=o.sections,e[18]=a,e[19]=j,e[20]=w,e[21]=N):N=e[21];let E;e[22]!==l?(E=l("sandbox.collectionsSidebar.apps"),e[22]=l,e[23]=E):E=e[23];const B=s==="apps";let k;e[24]!==o.apps||e[25]!==a||e[26]!==E||e[27]!==B?(k=n.jsx(Re,{id:"apps",icon:On,label:E,count:o.apps,active:B,onSelect:a,indent:!0}),e[24]=o.apps,e[25]=a,e[26]=E,e[27]=B,e[28]=k):k=e[28];let D;e[29]!==l?(D=l("sandbox.collectionsSidebar.loaders"),e[29]=l,e[30]=D):D=e[30];const O=s==="loaders";let L;e[31]!==o.loaders||e[32]!==a||e[33]!==D||e[34]!==O?(L=n.jsx(Re,{id:"loaders",icon:En,label:D,count:o.loaders,active:O,onSelect:a,indent:!0}),e[31]=o.loaders,e[32]=a,e[33]=D,e[34]=O,e[35]=L):L=e[35];let K;e[36]!==l?(K=l("sandbox.collectionsSidebar.actions"),e[36]=l,e[37]=K):K=e[37];const F=s==="actions";let _;e[38]!==o.actions||e[39]!==a||e[40]!==K||e[41]!==F?(_=n.jsx(Re,{id:"actions",icon:Ln,label:K,count:o.actions,active:F,onSelect:a,indent:!0}),e[38]=o.actions,e[39]=a,e[40]=K,e[41]=F,e[42]=_):_=e[42];let A;e[43]!==N||e[44]!==k||e[45]!==L||e[46]!==_?(A=n.jsxs(Ya,{className:"flex flex-col gap-0.5 pt-0.5",children:[N,k,L,_]}),e[43]=N,e[44]=k,e[45]=L,e[46]=_,e[47]=A):A=e[47];let I;return e[48]!==p||e[49]!==A||e[50]!==y?(I=n.jsxs(Qa,{open:p,onOpenChange:d,children:[y,A]}),e[48]=p,e[49]=A,e[50]=y,e[51]=I):I=e[51],I}function Re(t){const e=ae.c(19),{id:s,icon:o,label:a,count:l,active:i,onSelect:c,indent:r}=t;let d;e[0]!==s||e[1]!==c?(d=()=>c(s),e[0]=s,e[1]=c,e[2]=d):d=e[2];const p=r&&"pl-6",m=i?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let h;e[3]!==p||e[4]!==m?(h=be("flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",p,m),e[3]=p,e[4]=m,e[5]=h):h=e[5];let u;e[6]!==o?(u=n.jsx(o,{size:16,className:"shrink-0"}),e[6]=o,e[7]=u):u=e[7];let f;e[8]!==a?(f=n.jsx("span",{className:"flex-1 truncate",children:a}),e[8]=a,e[9]=f):f=e[9];let x;e[10]!==i||e[11]!==l?(x=l!==void 0&&n.jsx("span",{className:be("shrink-0 text-xs tabular-nums",i?"text-accent-foreground/70":"text-muted-foreground/70"),children:l}),e[10]=i,e[11]=l,e[12]=x):x=e[12];let g;return e[13]!==d||e[14]!==h||e[15]!==u||e[16]!==f||e[17]!==x?(g=n.jsxs("button",{type:"button",onClick:d,className:h,children:[u,f,x]}),e[13]=d,e[14]=h,e[15]=u,e[16]=f,e[17]=x,e[18]=g):g=e[18],g}function _l(t){const e=ae.c(12),{state:s,claimPhase:o,lifecycle:a,onStart:l,connectionsHref:i}=t;switch(s.kind){case"starting":{let c;e[0]!==o||e[1]!==a?(c=ra({claimPhase:o,lifecycle:a}),e[0]=o,e[1]=a,e[2]=c):c=e[2];let r;return e[3]!==o||e[4]!==c?(r=n.jsx(us,{kind:"starting",progress:c,claimPhase:o}),e[3]=o,e[4]=c,e[5]=r):r=e[5],r}case"suspended":{let c;return e[6]!==l?(c=n.jsx(us,{kind:"suspended",onResume:l}),e[6]=l,e[7]=c):c=e[7],c}case"errored":{let c;return e[8]!==i||e[9]!==l||e[10]!==s.error?(c=n.jsx(us,{kind:"errored",error:s.error,onRetry:l,connectionsHref:i}),e[8]=i,e[9]=l,e[10]=s.error,e[11]=c):c=e[11],c}}}const Dl=new Set(["clone-failed","install-failed","start-failed","crashed"]);function Al(t){if(t.fastPreviewActive)return{kind:"ready",devServerReady:!1,sandboxWarming:!1};if(t.previewState.kind!=="iframe")return{kind:"sandbox-card",state:t.previewState};const e=t.lifecyclePhase==="running",s=!e&&!Dl.has(t.lifecyclePhase);return{kind:"ready",devServerReady:e,sandboxWarming:s}}function Qs(t,e){const s=e.replace(/\s*\(copy(?:\s+\d+)?\)\s*$/,"").trim(),o=`${s} (copy)`;if(!t.has(o))return o;for(let a=2;a<1e3;a++){const l=`${s} (copy ${a})`;if(!t.has(l))return l}return`${s} (copy ${Date.now()})`}function $l(t,e){const s=Lt,o=e.replace(/-copy(?:-\d+)?$/,""),a=`${o}-copy`;if(!t.has(s(a)))return a;for(let l=2;l<1e3;l++){const i=`${o}-copy-${l}`;if(!t.has(s(i)))return i}return`${o}-copy-${Date.now()}`}function Ll(t,e){const s=e.replace(/_copy(?:_\d+)?$/,""),o=`${s}_copy`;if(!Object.hasOwn(t,o))return o;for(let a=2;a<1e3;a++){const l=`${s}_copy_${a}`;if(!Object.hasOwn(t,l))return l}return`${s}_copy_${Date.now()}`}function Ol(t){const e=Rn(t.newName),s={...t.source,name:t.newName,path:t.newPath};return{key:e,data:s}}function Il(t,e){return ca(t,e)}const Rl=1e3;function Fl(t,e){for(let s=0;s<Rl;s++){const o=Rn(e);if(!Object.hasOwn(t,o))return o}throw new Error("Could not generate a unique page block key")}const Kl={create:"sandbox.pageFormDialog.titleCreate",duplicate:"sandbox.pageFormDialog.titleDuplicate",rename:"sandbox.pageFormDialog.titleRename"},zl={create:"sandbox.pageFormDialog.submitCreate",duplicate:"sandbox.pageFormDialog.submitDuplicate",rename:"sandbox.pageFormDialog.submitSave"},Ml={create:"sandbox.pageFormDialog.pendingCreate",duplicate:"sandbox.pageFormDialog.pendingDuplicate",rename:"sandbox.pageFormDialog.pendingSave"};function Vl(t){const e=ae.c(88),{open:s,mode:o,initialName:a,initialPath:l,isPending:i,error:c,templates:r,validate:d,onSubmit:p,onOpenChange:m}=t,h=i===void 0?!1:i,u=Se(),[f,x]=$.useState(a),[g,v]=$.useState(l),[y,j]=$.useState(ms),[w,N]=$.useState(null),[E,B]=$.useState(s);s!==E&&(B(s),s&&(x(a),v(l),j(ms),N(null)));const k=o==="create"&&!!r?.length;let D;e[0]!==h||e[1]!==m?(D=pe=>{!pe&&!h&&(N(null),m(!1))},e[0]=h,e[1]=m,e[2]=D):D=e[2];const O=D;let L;e[3]!==h||e[4]!==f||e[5]!==p||e[6]!==g||e[7]!==k||e[8]!==y||e[9]!==d?(L=async pe=>{pe.preventDefault();const je=f.trim(),he=g.trim();if(!je||!he||h)return;const we=La(he);if(we){N(we);return}const Pe=d?.({name:je,path:he});if(Pe){N(Pe);return}N(null),await p({name:je,path:he,templateKey:k&&y!==ms?y:null})},e[3]=h,e[4]=f,e[5]=p,e[6]=g,e[7]=k,e[8]=y,e[9]=d,e[10]=L):L=e[10];const K=L,F=w??c,_=Kl[o];let A;e[11]!==u||e[12]!==_?(A=u(_),e[11]=u,e[12]=_,e[13]=A):A=e[13];let I;e[14]!==A?(I=n.jsx(pt,{children:n.jsx(it,{children:A})}),e[14]=A,e[15]=I):I=e[15];let R;e[16]!==h||e[17]!==k||e[18]!==u||e[19]!==y||e[20]!==r?(R=k&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("label",{htmlFor:"page-form-template",className:"text-xs font-medium text-muted-foreground",children:u("sandbox.pageFormDialog.labelTemplate")}),n.jsx(da,{id:"page-form-template",value:y,onChange:j,templates:r??[],disabled:h})]}),e[16]=h,e[17]=k,e[18]=u,e[19]=y,e[20]=r,e[21]=R):R=e[21];let G;e[22]!==u?(G=u("sandbox.pageFormDialog.labelName"),e[22]=u,e[23]=G):G=e[23];let z;e[24]!==G?(z=n.jsx("label",{htmlFor:"page-form-name",className:"text-xs font-medium text-muted-foreground",children:G}),e[24]=G,e[25]=z):z=e[25];let W;e[26]===Symbol.for("react.memo_cache_sentinel")?(W=pe=>x(pe.target.value),e[26]=W):W=e[26];let P;e[27]!==u?(P=u("sandbox.pageFormDialog.placeholderName"),e[27]=u,e[28]=P):P=e[28];let U;e[29]!==h||e[30]!==f||e[31]!==P?(U=n.jsx(Xe,{id:"page-form-name",value:f,onChange:W,placeholder:P,autoFocus:!0,disabled:h}),e[29]=h,e[30]=f,e[31]=P,e[32]=U):U=e[32];let Y;e[33]!==U||e[34]!==z?(Y=n.jsxs("div",{className:"space-y-1.5",children:[z,U]}),e[33]=U,e[34]=z,e[35]=Y):Y=e[35];let q;e[36]!==u?(q=u("sandbox.pageFormDialog.labelPath"),e[36]=u,e[37]=q):q=e[37];let Z;e[38]!==q?(Z=n.jsx("label",{htmlFor:"page-form-path",className:"text-xs font-medium text-muted-foreground",children:q}),e[38]=q,e[39]=Z):Z=e[39];let de;e[40]===Symbol.for("react.memo_cache_sentinel")?(de=pe=>v(pe.target.value),e[40]=de):de=e[40];let ne;e[41]!==u?(ne=u("sandbox.pageFormDialog.placeholderPath"),e[41]=u,e[42]=ne):ne=e[42];let ue;e[43]!==h||e[44]!==g||e[45]!==ne?(ue=n.jsx(Xe,{id:"page-form-path",value:g,onChange:de,placeholder:ne,disabled:h}),e[43]=h,e[44]=g,e[45]=ne,e[46]=ue):ue=e[46];let te;e[47]!==Z||e[48]!==ue?(te=n.jsxs("div",{className:"space-y-1.5",children:[Z,ue]}),e[47]=Z,e[48]=ue,e[49]=te):te=e[49];let re;e[50]!==F?(re=F&&n.jsx("p",{className:"text-xs text-destructive",children:F}),e[50]=F,e[51]=re):re=e[51];let le;e[52]!==Y||e[53]!==te||e[54]!==re||e[55]!==R?(le=n.jsxs("div",{className:"space-y-4 py-4",children:[R,Y,te,re]}),e[52]=Y,e[53]=te,e[54]=re,e[55]=R,e[56]=le):le=e[56];let T;e[57]!==m?(T=()=>m(!1),e[57]=m,e[58]=T):T=e[58];let J;e[59]!==u?(J=u("sandbox.pageFormDialog.buttonCancel"),e[59]=u,e[60]=J):J=e[60];let ee;e[61]!==h||e[62]!==T||e[63]!==J?(ee=n.jsx(_e,{type:"button",variant:"outline",onClick:T,disabled:h,children:J}),e[61]=h,e[62]=T,e[63]=J,e[64]=ee):ee=e[64];let oe;e[65]!==h||e[66]!==f||e[67]!==g?(oe=!f.trim()||!g.trim()||h,e[65]=h,e[66]=f,e[67]=g,e[68]=oe):oe=e[68];let S;e[69]!==h||e[70]!==o||e[71]!==u?(S=h?n.jsxs(n.Fragment,{children:[n.jsx(lt,{className:"size-3.5"}),u(Ml[o])]}):u(zl[o]),e[69]=h,e[70]=o,e[71]=u,e[72]=S):S=e[72];let se;e[73]!==oe||e[74]!==S?(se=n.jsx(_e,{type:"submit",disabled:oe,children:S}),e[73]=oe,e[74]=S,e[75]=se):se=e[75];let H;e[76]!==ee||e[77]!==se?(H=n.jsxs(ht,{children:[ee,se]}),e[76]=ee,e[77]=se,e[78]=H):H=e[78];let ie;e[79]!==K||e[80]!==le||e[81]!==H||e[82]!==I?(ie=n.jsx(rt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:K,children:[I,le,H]})}),e[79]=K,e[80]=le,e[81]=H,e[82]=I,e[83]=ie):ie=e[83];let ye;return e[84]!==O||e[85]!==s||e[86]!==ie?(ye=n.jsx(ct,{open:s,onOpenChange:O,children:ie}),e[84]=O,e[85]=s,e[86]=ie,e[87]=ye):ye=e[87],ye}const Gl=[{value:"temporary",labelKey:"sandbox.redirectEditor.typeTemporary"},{value:"permanent",labelKey:"sandbox.redirectEditor.typePermanent"}],Xs={from:"",to:"",type:"temporary",discardQueryParameters:!1};function Ul(t){const e=ae.c(111),{open:s,isPending:o,error:a,onSubmit:l,onOpenChange:i}=t,c=o===void 0?!1:o,r=Se(),[d,p]=$.useState(Xs),[m,h]=$.useState(null),[u,f]=$.useState(s);s!==u&&(f(s),s&&(p(Xs),h(null)));let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=ge=>p($e=>({...$e,...ge})),e[0]=x):x=e[0];const g=x;let v;e[1]!==c||e[2]!==i?(v=ge=>{!ge&&!c&&(h(null),i(!1))},e[1]=c,e[2]=i,e[3]=v):v=e[3];const y=v;let j;e[4]!==c||e[5]!==l||e[6]!==d||e[7]!==r?(j=async ge=>{ge.preventDefault();const $e=d.from.trim(),Fe=d.to.trim();if(!$e||!Fe||c){h(r("sandbox.redirectFormDialog.errorRequired"));return}h(null),await l({...d,from:$e,to:Fe})},e[4]=c,e[5]=l,e[6]=d,e[7]=r,e[8]=j):j=e[8];const w=j,N=m??a;let E;e[9]!==c||e[10]!==d.from||e[11]!==d.to?(E=!!d.from.trim()&&!!d.to.trim()&&!c,e[9]=c,e[10]=d.from,e[11]=d.to,e[12]=E):E=e[12];const B=E;let k;e[13]!==r?(k=r("sandbox.redirectFormDialog.title"),e[13]=r,e[14]=k):k=e[14];let D;e[15]!==k?(D=n.jsx(pt,{children:n.jsx(it,{children:k})}),e[15]=k,e[16]=D):D=e[16];let O;e[17]!==r?(O=r("sandbox.redirectEditor.fromLabel"),e[17]=r,e[18]=O):O=e[18];let L;e[19]!==O?(L=n.jsx(ze,{htmlFor:"redirect-form-from",children:O}),e[19]=O,e[20]=L):L=e[20];const K=d.from;let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=ge=>g({from:ge.target.value}),e[21]=F):F=e[21];let _;e[22]!==r?(_=r("sandbox.redirectEditor.fromPlaceholder"),e[22]=r,e[23]=_):_=e[23];let A;e[24]!==c||e[25]!==d.from||e[26]!==_?(A=n.jsx(Xe,{id:"redirect-form-from",value:K,onChange:F,placeholder:_,autoFocus:!0,disabled:c}),e[24]=c,e[25]=d.from,e[26]=_,e[27]=A):A=e[27];let I;e[28]!==A||e[29]!==L?(I=n.jsxs("div",{className:"space-y-1.5",children:[L,A]}),e[28]=A,e[29]=L,e[30]=I):I=e[30];let R;e[31]!==r?(R=r("sandbox.redirectEditor.toLabel"),e[31]=r,e[32]=R):R=e[32];let G;e[33]!==R?(G=n.jsx(ze,{htmlFor:"redirect-form-to",children:R}),e[33]=R,e[34]=G):G=e[34];const z=d.to;let W;e[35]===Symbol.for("react.memo_cache_sentinel")?(W=ge=>g({to:ge.target.value}),e[35]=W):W=e[35];let P;e[36]!==r?(P=r("sandbox.redirectEditor.toPlaceholder"),e[36]=r,e[37]=P):P=e[37];let U;e[38]!==c||e[39]!==d.to||e[40]!==P?(U=n.jsx(Xe,{id:"redirect-form-to",value:z,onChange:W,placeholder:P,disabled:c}),e[38]=c,e[39]=d.to,e[40]=P,e[41]=U):U=e[41];let Y;e[42]!==G||e[43]!==U?(Y=n.jsxs("div",{className:"space-y-1.5",children:[G,U]}),e[42]=G,e[43]=U,e[44]=Y):Y=e[44];let q;e[45]!==r?(q=r("sandbox.redirectEditor.typeLabel"),e[45]=r,e[46]=q):q=e[46];let Z;e[47]!==q?(Z=n.jsx(ze,{htmlFor:"redirect-form-type",children:q}),e[47]=q,e[48]=Z):Z=e[48];const de=d.type;let ne;e[49]===Symbol.for("react.memo_cache_sentinel")?(ne=ge=>g({type:ge}),e[49]=ne):ne=e[49];let ue;e[50]!==r?(ue=r("sandbox.redirectEditor.typePlaceholder"),e[50]=r,e[51]=ue):ue=e[51];let te;e[52]!==ue?(te=n.jsx(sl,{id:"redirect-form-type",className:"w-full",children:n.jsx(nl,{placeholder:ue})}),e[52]=ue,e[53]=te):te=e[53];let re;e[54]!==r?(re=Gl.map(ge=>n.jsx(tl,{value:ge.value,children:r(ge.labelKey,{status:Gn[ge.value]})},ge.value)),e[54]=r,e[55]=re):re=e[55];let le;e[56]!==re?(le=n.jsx(ol,{children:re}),e[56]=re,e[57]=le):le=e[57];let T;e[58]!==c||e[59]!==d.type||e[60]!==te||e[61]!==le?(T=n.jsxs(al,{value:de,onValueChange:ne,disabled:c,children:[te,le]}),e[58]=c,e[59]=d.type,e[60]=te,e[61]=le,e[62]=T):T=e[62];let J;e[63]!==Z||e[64]!==T?(J=n.jsxs("div",{className:"space-y-1.5",children:[Z,T]}),e[63]=Z,e[64]=T,e[65]=J):J=e[65];let ee;e[66]===Symbol.for("react.memo_cache_sentinel")?(ee=ge=>g({discardQueryParameters:ge===!0}),e[66]=ee):ee=e[66];let oe;e[67]!==c||e[68]!==d.discardQueryParameters?(oe=n.jsx(Xt,{checked:d.discardQueryParameters,disabled:c,onCheckedChange:ee}),e[67]=c,e[68]=d.discardQueryParameters,e[69]=oe):oe=e[69];let S;e[70]!==r?(S=r("sandbox.redirectEditor.discardQueryParameters"),e[70]=r,e[71]=S):S=e[71];let se;e[72]!==S?(se=n.jsx("span",{className:"text-sm",children:S}),e[72]=S,e[73]=se):se=e[73];let H;e[74]!==oe||e[75]!==se?(H=n.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[oe,se]}),e[74]=oe,e[75]=se,e[76]=H):H=e[76];let ie;e[77]!==N?(ie=N&&n.jsx("p",{className:"text-xs text-destructive",children:N}),e[77]=N,e[78]=ie):ie=e[78];let ye;e[79]!==I||e[80]!==Y||e[81]!==J||e[82]!==H||e[83]!==ie?(ye=n.jsxs("div",{className:"space-y-4 py-4",children:[I,Y,J,H,ie]}),e[79]=I,e[80]=Y,e[81]=J,e[82]=H,e[83]=ie,e[84]=ye):ye=e[84];let pe;e[85]!==i?(pe=()=>i(!1),e[85]=i,e[86]=pe):pe=e[86];let je;e[87]!==r?(je=r("sandbox.redirectFormDialog.cancel"),e[87]=r,e[88]=je):je=e[88];let he;e[89]!==c||e[90]!==pe||e[91]!==je?(he=n.jsx(_e,{type:"button",variant:"outline",onClick:pe,disabled:c,children:je}),e[89]=c,e[90]=pe,e[91]=je,e[92]=he):he=e[92];const we=!B;let Pe;e[93]!==c||e[94]!==r?(Pe=c?n.jsxs(n.Fragment,{children:[n.jsx(lt,{className:"size-3.5"}),r("sandbox.redirectFormDialog.pending")]}):r("sandbox.redirectFormDialog.submit"),e[93]=c,e[94]=r,e[95]=Pe):Pe=e[95];let Te;e[96]!==we||e[97]!==Pe?(Te=n.jsx(_e,{type:"submit",disabled:we,children:Pe}),e[96]=we,e[97]=Pe,e[98]=Te):Te=e[98];let Ne;e[99]!==he||e[100]!==Te?(Ne=n.jsxs(ht,{children:[he,Te]}),e[99]=he,e[100]=Te,e[101]=Ne):Ne=e[101];let Be;e[102]!==w||e[103]!==ye||e[104]!==Ne||e[105]!==D?(Be=n.jsx(rt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:w,children:[D,ye,Ne]})}),e[102]=w,e[103]=ye,e[104]=Ne,e[105]=D,e[106]=Be):Be=e[106];let De;return e[107]!==y||e[108]!==s||e[109]!==Be?(De=n.jsx(ct,{open:s,onOpenChange:y,children:Be}),e[107]=y,e[108]=s,e[109]=Be,e[110]=De):De=e[110],De}function Hl(t){const e=ae.c(70),{open:s,blockKey:o,initialName:a,isPending:l,onSubmit:i,onOpenChange:c}=t,r=l===void 0?!1:l,d=Se(),[p,m]=$.useState(a),[h,u]=$.useState(s);s!==h&&(u(s),s&&m(a));let f;e[0]!==r||e[1]!==c?(f=de=>{!de&&!r&&c(!1)},e[0]=r,e[1]=c,e[2]=f):f=e[2];const x=f;let g;e[3]!==r||e[4]!==p||e[5]!==i?(g=async de=>{de.preventDefault();const ne=p.trim();!ne||r||await i(ne)},e[3]=r,e[4]=p,e[5]=i,e[6]=g):g=e[6];const v=g;let y;e[7]!==d?(y=d("sandbox.sectionRenameDialog.title"),e[7]=d,e[8]=y):y=e[8];let j;e[9]!==y?(j=n.jsx(it,{children:y}),e[9]=y,e[10]=j):j=e[10];let w;e[11]!==d?(w=d("sandbox.sectionRenameDialog.description"),e[11]=d,e[12]=w):w=e[12];let N;e[13]!==w?(N=n.jsx(zt,{children:w}),e[13]=w,e[14]=N):N=e[14];let E;e[15]!==j||e[16]!==N?(E=n.jsxs(pt,{children:[j,N]}),e[15]=j,e[16]=N,e[17]=E):E=e[17];let B;e[18]!==d?(B=d("sandbox.sectionRenameDialog.nameLabel"),e[18]=d,e[19]=B):B=e[19];let k;e[20]!==B?(k=n.jsx("label",{htmlFor:"section-rename-name",className:"text-xs font-medium text-muted-foreground",children:B}),e[20]=B,e[21]=k):k=e[21];let D;e[22]===Symbol.for("react.memo_cache_sentinel")?(D=de=>m(de.target.value),e[22]=D):D=e[22];let O;e[23]!==r||e[24]!==p?(O=n.jsx(Xe,{id:"section-rename-name",value:p,onChange:D,autoFocus:!0,disabled:r}),e[23]=r,e[24]=p,e[25]=O):O=e[25];let L;e[26]!==k||e[27]!==O?(L=n.jsxs("div",{className:"space-y-1.5",children:[k,O]}),e[26]=k,e[27]=O,e[28]=L):L=e[28];let K;e[29]!==d?(K=d("sandbox.sectionRenameDialog.keyLabel"),e[29]=d,e[30]=K):K=e[30];let F;e[31]!==K?(F=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:K}),e[31]=K,e[32]=F):F=e[32];let _;e[33]!==o?(_=n.jsx(Xe,{value:o,readOnly:!0,disabled:!0,className:"font-mono"}),e[33]=o,e[34]=_):_=e[34];let A;e[35]!==F||e[36]!==_?(A=n.jsxs("div",{className:"space-y-1.5",children:[F,_]}),e[35]=F,e[36]=_,e[37]=A):A=e[37];let I;e[38]!==L||e[39]!==A?(I=n.jsxs("div",{className:"space-y-4 py-4",children:[L,A]}),e[38]=L,e[39]=A,e[40]=I):I=e[40];let R;e[41]!==c?(R=()=>c(!1),e[41]=c,e[42]=R):R=e[42];let G;e[43]!==d?(G=d("sandbox.sectionRenameDialog.cancel"),e[43]=d,e[44]=G):G=e[44];let z;e[45]!==r||e[46]!==R||e[47]!==G?(z=n.jsx(_e,{type:"button",variant:"outline",onClick:R,disabled:r,children:G}),e[45]=r,e[46]=R,e[47]=G,e[48]=z):z=e[48];let W;e[49]!==r||e[50]!==p?(W=!p.trim()||r,e[49]=r,e[50]=p,e[51]=W):W=e[51];let P;e[52]!==r||e[53]!==d?(P=r?n.jsxs(n.Fragment,{children:[n.jsx(lt,{className:"size-3.5"}),d("sandbox.sectionRenameDialog.saving")]}):d("sandbox.sectionRenameDialog.save"),e[52]=r,e[53]=d,e[54]=P):P=e[54];let U;e[55]!==W||e[56]!==P?(U=n.jsx(_e,{type:"submit",disabled:W,children:P}),e[55]=W,e[56]=P,e[57]=U):U=e[57];let Y;e[58]!==z||e[59]!==U?(Y=n.jsxs(ht,{children:[z,U]}),e[58]=z,e[59]=U,e[60]=Y):Y=e[60];let q;e[61]!==v||e[62]!==I||e[63]!==Y||e[64]!==E?(q=n.jsx(rt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:v,children:[E,I,Y]})}),e[61]=v,e[62]=I,e[63]=Y,e[64]=E,e[65]=q):q=e[65];let Z;return e[66]!==x||e[67]!==s||e[68]!==q?(Z=n.jsx(ct,{open:s,onOpenChange:x,children:q}),e[66]=x,e[67]=s,e[68]=q,e[69]=Z):Z=e[69],Z}function ql(t){const e=ae.c(7),{type:s}=t,o=Gn[s];let a;e[0]!==o?(a=n.jsx(We,{asChild:!0,children:n.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium tabular-nums text-muted-foreground",children:o})}),e[0]=o,e[1]=a):a=e[1];const l=s==="permanent"?"Permanent":"Temporary";let i;e[2]!==l?(i=n.jsx(Ye,{side:"left",children:l}),e[2]=l,e[3]=i):i=e[3];let c;return e[4]!==a||e[5]!==i?(c=n.jsxs(Qe,{children:[a,i]}),e[4]=a,e[5]=i,e[6]=c):c=e[6],c}const Jl=60,ps={post:"blog/loaders/Blogpost.ts",author:"blog/loaders/Author.ts",category:"blog/loaders/Category.ts"},Es=["posts","authors","categories"],Nt={posts:"post",authors:"author",categories:"category"};function ot(t){return Es.includes(t)}const es={posts:"post",authors:"author",categories:"category"},eo={posts:ps.post,authors:ps.author,categories:ps.category},Wl=Object.fromEntries(Object.entries(eo).map(([t,e])=>[e,t]));function Yl(t){return typeof t=="string"?Wl[t]??null:null}function Ie(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function X(t){return typeof t=="string"?t:""}function Ql(t,e){switch(t){case"posts":return{label:X(e.title)||"Untitled post",subtitle:X(e.slug)};case"authors":return{label:X(e.name)||"Unnamed author",subtitle:X(e.email)};case"categories":return{label:X(e.name)||"Unnamed category",subtitle:X(e.slug)};default:{const s=t;throw new Error(`Unhandled blog kind: ${String(s)}`)}}}function to(t){const e={posts:[],authors:[],categories:[]};for(const[s,o]of Object.entries(t)){const a=Ie(o);if(!a)continue;const l=Yl(a.__resolveType);if(!l)continue;const i=Ie(a[es[l]])??{},{label:c,subtitle:r}=Ql(l,i);e[l].push({key:s,kind:l,label:c,subtitle:r})}for(const s of Es)e[s].sort((o,a)=>o.label.localeCompare(a.label));return e}function Xl(t,e){return to(t)[e]}function Ue(t,e){return Xl(t,e).map(s=>({key:s.key,payload:dt(Ie(t[s.key])??void 0,e)}))}const Zs=Object.freeze({});function dt(t,e){return t?Ie(t[es[e]])??Zs:Zs}function at(t,e,s){return{name:t,__resolveType:eo[e],[es[e]]:s}}function pd({records:t,selected:e,valueField:s,toRef:o}){const a=Array.isArray(e)?e:[],l=h=>typeof h=="string"?h:X(Ie(h)?.[s]),i=h=>typeof h=="string"?h:X(Ie(h)?.name),c=h=>{const u=l(h),f=u?t.find(({payload:g})=>X(g[s])===u):void 0;if(f)return f;const x=i(h);return x?t.find(({payload:g})=>X(g.name)===x):void 0},r=t.map(({key:h,payload:u})=>({value:h,label:X(u.name)||X(u[s])||h})),d=new Map,p=[];return a.forEach((h,u)=>{const f=c(h);if(f){p.includes(f.key)||p.push(f.key);return}const x=`unresolved:${u}`;d.set(x,h),p.push(x),r.push({value:x,label:i(h)||l(h)||"Unknown"})}),{options:r,selectedValues:p,refsForValues:h=>h.map(u=>{const f=t.find(x=>x.key===u);return f?o(f.payload):d.get(u)}).filter(u=>u!==void 0)}}function so(t){return Ue(t,"authors").map(({payload:e})=>({...e,name:X(e.name),email:X(e.email)})).filter(e=>e.email)}function Ze(t){return Array.isArray(t)?t:[]}function st(t){if(typeof t=="string")return t;const e=Ie(t);return e?X(e.slug):""}function no(t){if(typeof t=="string")return t;const e=Ie(t);return e?X(e.email):""}function _s(t){const e=[];return X(t.title).trim()||e.push("Title"),X(t.slug).trim()||e.push("Slug"),Ze(t.categories).map(st).filter(Boolean).length===0&&e.push("Category"),X(t.excerpt).trim()||e.push("Excerpt"),X(t.image).trim()||e.push("Cover image"),e}const Ds=["draft","generating","awaiting_review","scheduled","published","archived"],oo=8;function Et(t){switch(X(t.status)){case"draft":case"idea":return"draft";case"generating":return"generating";case"awaiting_review":case"in_review":return"awaiting_review";case"scheduled":return"scheduled";case"published":return"published";case"archived":return"archived";case"":return"published";default:return"awaiting_review"}}function Zl(t,e){return e!=="published"&&e!=="scheduled"||Et(t)===e?!1:_s(t).length>0}function ei(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1,oo).toISOString()}function Mt(t,e,s){if(e!=="scheduled")return{...t,status:e,scheduledDatetime:""};const o=X(t.scheduledDatetime);return{...t,status:"scheduled",scheduledDatetime:Number.isNaN(new Date(o).getTime())?ei(s):o}}function ao(t){return Ue(t,"posts").map(({key:e,payload:s})=>({key:e,title:X(s.title)||"Untitled post",slug:X(s.slug),date:X(s.date),scheduledDatetime:X(s.scheduledDatetime),categorySlugs:Ze(s.categories).map(st).filter(Boolean),authorEmails:Ze(s.authors).map(no).filter(Boolean),missing:_s(s),status:Et(s),form:"live"}))}const lo="blog-manager/posts/";function io(t){return t.startsWith(lo)}function Ct(t){return t.split("/").pop()??t}function Vt(t){return`${lo}${t}`}function ti(t){return`collections/blog/posts/${t}`}function bs(){return gt(12)}function si(t){const e=Ie(t.planning)??{},s=Ie(e.format);return{ideaKey:X(e.ideaKey)||void 0,pillarKey:X(e.pillarKey)||void 0,pillarTitle:X(e.pillarTitle)||void 0,format:s?{name:X(s.name),value:X(s.value)}:void 0,brief:X(e.brief)||void 0}}function ro(t){return{title:t.title,slug:"",excerpt:"",date:t.now.toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[],status:"draft",planning:t.planning??{}}}function ut(t,e){return{name:t,[es.posts]:e}}function hd(t,e){return io(t)?ut(t,e):at(t,"posts",e)}function ni(t){const e=[];for(const[s,o]of Object.entries(t)){if(!io(s))continue;const a=Ie(o);a&&e.push({key:s,payload:dt(a,"posts")})}return e}function oi(t){return[...ni(t).map(({key:s,payload:o})=>({key:s,title:X(o.title)||"Untitled post",slug:X(o.slug),date:X(o.date),scheduledDatetime:X(o.scheduledDatetime),categorySlugs:Ze(o.categories).map(st).filter(Boolean),authorEmails:Ze(o.authors).map(no).filter(Boolean),missing:_s(o),status:Et(o),form:"planning"})),...ao(t)]}function ai(t,e,s){const o=Mt(t.payload,e,s),a=Ct(t.key),l=e==="scheduled"||e==="published"?"live":"planning",i=l==="live"?ti(a):Vt(a),c=l==="live"?at(i,"posts",o):ut(i,o);return{writes:{[i]:c},deletes:i===t.key?[]:[t.key]}}function gd(t,e,s){const o=Ze(t.categories);if(!o.some(c=>st(c)===e))return t;const a=o.map(c=>{const r=st(c);return r===e||r===s.slug?{name:s.name,slug:s.slug}:c}),l=new Set,i=a.filter(c=>{const r=st(c);return r?l.has(r)?!1:(l.add(r),!0):!0});return{...t,categories:i}}function li(t,e){const s=Ze(t.categories);return s.some(o=>st(o)===e)?{...t,categories:s.filter(o=>st(o)!==e)}:t}function ii(t){const e=X(t.status),s=e==="idea"||e==="in_review"?{status:Et(t)}:{};return{...t,...s,dateModified:new Date().toISOString()}}function gt(t){const e=new Uint8Array(Math.ceil(t/2));return crypto.getRandomValues(e),Array.from(e,s=>s.toString(16).padStart(2,"0")).join("").slice(0,t)}function hs(t,e){const s=`collections/blog/${e}/${gt(12)}`;if(!Object.hasOwn(t,s))return s;throw new Error("Could not generate a unique blog block key")}function co(t){switch(t){case"posts":return{title:"Untitled post",excerpt:"",slug:`untitled-${gt(8)}`,date:new Date().toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[]};case"authors":return{name:"New author",type:"Person",email:"",jobTitle:"",company:"",url:"",avatar:""};case"categories":return{name:"New category",slug:`category-${gt(8)}`,description:"",sections:[]};default:{const e=t;throw new Error(`Unhandled blog kind: ${String(e)}`)}}}const ri={Paragraph:{title:"Paragraph",description:"Rich text content",iconName:"Pilcrow01"},Heading:{title:"Heading",description:"Section title (H1–H6)",iconName:"HeadingSquare"},Quote:{title:"Quote",description:"Pull quote",iconName:"MessageTextSquare02"},Code:{title:"Code",description:"Code block with syntax highlighting",iconName:"Code02"},List:{title:"List",description:"Bulleted or numbered list",iconName:"List"},BlockImage:{title:"Image",description:"Image with optional caption",iconName:"Image01"},Video:{title:"Video",description:"Embedded video",iconName:"PlayCircle"},Divider:{title:"Divider",description:"Horizontal divider",iconName:"Divider"},Cta:{title:"Call to action",description:"Button linking to a URL",iconName:"CursorClick01"},Callout:{title:"Callout",description:"Highlighted note, tip or warning",iconName:"Lightbulb02"},Stat:{title:"Stat",description:"Single key metric",iconName:"BarChartSquareUp"},StatGroup:{title:"Stat group",description:"Row of metrics",iconName:"BarChartSquare02"},CardGroup:{title:"Card group",description:"Grid of cards",iconName:"LayoutGrid01"},Checklist:{title:"Checklist",description:"List of check items",iconName:"CheckSquare"},Steps:{title:"Steps",description:"Step-by-step guide",iconName:"LayersThree01"},Comparison:{title:"Comparison",description:"Side-by-side comparison",iconName:"Columns03"},Table:{title:"Table",description:"Rows and columns of structured data",iconName:"Table"},ProductCard:{title:"Product card",description:"Single product",iconName:"Tag01"},ProductShelf:{title:"Product shelf",description:"Row of products",iconName:"ShoppingBag01"}},en="Box";function ci(t){return t.startsWith("site/")?"site":"app"}function di(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||t.startsWith("/")}function vt(...t){for(const e of t)if(e!==void 0)return e}function tn(t){if(t&&!(t.includes("/")||/\.(tsx?|jsx?)$/.test(t)))return t}function ui(t){const e=t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").trim();return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():t}function uo(t){const e=new Set,s=[],o=t.manifest?.blocks??{};for(const a of Object.values(o))for(const l of Object.keys(a)){if(!fi(l)||e.has(l))continue;e.add(l);const i=Cs(l,t),c=ts(l),r=ri[c],d=ci(l),p=tn(i.title),m=tn(i.description),h=(d==="site"?vt(p,r?.title):vt(r?.title,p))??ui(c),u=d==="site"?vt(m,r?.description):vt(r?.description,m),f=d==="site"?i.icon:void 0,x=f&&di(f)?f:void 0,g=x!==void 0?r?.iconName??en:vt(f,r?.iconName)??en;s.push({resolveType:l,title:h,description:u,iconName:g,iconUrl:x,source:d})}return s.sort((a,l)=>a.title.localeCompare(l.title))}function ts(t){return(t.split("/").pop()??t).replace(/\.(tsx?|jsx?)$/,"")}const mi=["blog/sections/blocks/","site/sections/Blog/Post/"];function fi(t){return mi.some(e=>t.startsWith(e))}const As="blog-manager-brand";function Ke(t){if(!Array.isArray(t))return[];const e=[];for(const s of t){if(typeof s=="string"){s.trim()&&e.push({name:s,value:""});continue}const o=Ie(s);o&&e.push({name:X(o.name),value:X(o.value)})}return e}function Me(t){return t.filter(e=>e.name.trim()||e.value.trim())}const pi=6e4,hi=4e3;function gi(t){const e=[],s=new Set,o=(a,l)=>{if(typeof a=="string"){if(!a.includes(" ")||a.length<4||/^(https?:)?\/\//.test(a)||/^data:/.test(a))return;const i=`${l}: ${a.trim()}`;if(s.has(i))return;s.add(i),e.push(i);return}if(Array.isArray(a)){for(const i of a)o(i,l);return}if(a&&typeof a=="object")for(const[i,c]of Object.entries(a))i!=="__resolveType"&&o(c,i)};return o(t,"block"),e.join(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-editor-D6e4YO7u.js","assets/index-B_3mBk4y.js","assets/index-3gIKLZj9.css","assets/chat-context-Bw1Qo4Kf.js","assets/use-panel-navigate-xfYLfPeP.js","assets/thread-route-CqPKjeFM.js","assets/use-project-scope-mDKXkaKI.js","assets/repository-binding-DoGbZGqV.js","assets/use-mcp-client-B_ORPqL8.js","assets/auth-C0Awroma.js","assets/autosend-BBuziBf6.js","assets/thread-intent-BwAsu2SG.js","assets/backoff-8mStPHYB.js","assets/task-board-B1vzDAVG.js","assets/schema-pZTMqosP.js","assets/slugify-CEUa2lfQ.js","assets/use-is-desktop-app-BNujXJc_.js","assets/use-decopilot-events-DgoNCAj-.js","assets/use-ai-providers-CajwguYo.js","assets/location-DBePU4bz.js","assets/use-organization-settings-NLGfOzk9.js","assets/scroll-area-kaq4mbUn.js","assets/select-MC8L6Y4s.js","assets/index-BOvE7Vou.js","assets/Check-BiHadeJU.js","assets/ChevronUp-DMzxjk9Q.js","assets/use-section-preview-base-C7g5i8aB.js","assets/UserSquare-C-IZAmnp.js","assets/agent-icon-B241PBKK.js","assets/AlertCircle-B1Wz6L5U.js","assets/Tool01-CXZVYCJV.js","assets/ArrowUp-uu6L0oZa.js","assets/ArrowLeft-CecRcRxr.js","assets/ArrowRight-BSlT04qT.js","assets/ShoppingBag01-BzDsEvOc.js","assets/ZoomOut-CrIY1x34.js","assets/Palette-Dfwz_KK_.js","assets/CheckCircle-BbTEzozp.js","assets/Copy01-Z8h17W5V.js","assets/CreditCard01-BOXpMyZX.js","assets/DotsVertical-BcY1zCnO.js","assets/Image01-BtlBqgq2.js","assets/XClose-CigTCF4N.js","assets/Key01-Crwm5tIn.js","assets/Link01-BCM1zE5K.js","assets/LinkExternal01-BSjbzGPT.js","assets/Monitor01-Bu9itRvW.js","assets/Sun-CuJDC_V5.js","assets/Plus-DWABMn2e.js","assets/SearchMd-df6Y7iRV.js","assets/Trash01-CZPHTYfi.js","assets/Upload01-BhUTj6_2.js","assets/User01-BKQ4XDsb.js","assets/Users01-NFbjkK3Z.js","assets/X-Df5KdWXB.js","assets/dialog-BR2W-zw-.js","assets/input-B1N39T_Y.js","assets/use-new-blocks-editor-BgW4UDeW.js","assets/claim-phase-copy-Bc0le9Uu.js","assets/section-preview-url-Csj0_ZDg.js","assets/use-session-runtime-41aA3FaG.js","assets/runnable-block-editor-Bb72YaFN.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-CffqlQYs.js","assets/format-time-CjIPQhCN.js","assets/differenceInSeconds-C3x8sHUj.js","assets/collapsible-FI3WWzNe.js","assets/use-copy-B5g9zFhy.js","assets/usage-stats-BY7R-UV8.js","assets/markdown-B9aD1F1t.js","assets/org-file-open-context-C81CF5lY.js","assets/use-mobile-Cit5JQWz.js","assets/tooltip-A9lPSKit.js","assets/shell-layout-CTm_WHyN.js","assets/avatar-Cm5Wz0Ek.js","assets/download-app-dialog-UGyaf1gI.js","assets/command-DkuU4Z8a.js","assets/index-BINYmdVo.js","assets/integration-icon-DF1SWs0L.js","assets/project-icon-CZCXf1ZD.js","assets/new-project-dialog-k4u3nID3.js","assets/label-CAMUAUyp.js","assets/repository-import-picker-Do_6Wg0W.js","assets/use-navigate-to-agent-BwWHCV0Z.js","assets/repository-picker-EdvJ_XCR.js","assets/useInfiniteQuery-CN5NPBR0.js","assets/infiniteQueryObserver-CBfG4TV-.js","assets/collection-search-DdV66iL8.js","assets/use-debounced-value-yeyF9VWy.js","assets/required-auth-layout-DL1Uhs7R.js","assets/use-org-sso-DlHcchE2.js","assets/shell-layout-CE2Eihra.css","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-CCjWAcAL.js","assets/types-BjX52uU5.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/gateway-client-C-QySNgV.js","assets/tool-namespace-DmnQIdtF.js","assets/utils-CVEq3hMx.js","assets/sheet-HF0WcB82.js","assets/use-connection-CWXA50IZ.js","assets/use-mcp-prompts-DL8S5JPE.js","assets/index-DYGqHQ2c.js","assets/form-vqBaFO9r.js","assets/use-thread-outputs-Blfor-oA.js","assets/file-type-icon-Dl1YFVBW.js","assets/popover-HtaOhw3r.js","assets/utils-C1m0wvDK.js","assets/monaco-editor-B_VHQ5gY.js","assets/editor-K_ZCeYmt.js","assets/calendar-lqFPIlGZ.js","assets/textarea-VVwww85B.js","assets/rich-text-link-control-BUaa9cuE.js","assets/switch-BXBfxHLv.js","assets/combobox-Br6WHzj1.js","assets/alert-dialog-AqvICzdc.js","assets/sandbox-url-D3mC8qhT.js","assets/search-input-BjeWS4bC.js","assets/tabs-CyQ-WrSH.js","assets/use-file-configs-MloqKXG4.js","assets/asset-utils-BAeS61or.js","assets/use-chat-layout-state-DD1tmwdx.js","assets/site-slug-DebpOoQq.js","assets/toggle-group-D4zRc1HZ.js","assets/sandbox-git-api-B1R0585s.js","assets/agent-view-guard-yCCS9tda.js","assets/use-main-panel-tabs-CMknOIXL.js","assets/use-mcp-tools-BUyi99fx.js","assets/index-BgbBMhHU.js","assets/drawer-BuCU4dtF.js","assets/input-i0t9B7Yt.js","assets/chat-draft-CQ5qjDsv.js","assets/use-deco-credits-BjM50lqx.js","assets/use-open-billing-url-ufz1Edxj.js","assets/decopilot-DTXbrEBB.js","assets/checkbox-BHKLlAci.js","assets/ai-providers-logos-DD3qZ33J.js","assets/index-CSpDxMoa.js","assets/input-BwSTkgpp.js","assets/suggestion-CJYj-5kL.js","assets/use-org-fs-DSneEZr8.js","assets/question-004-sINsf4GQ.js","assets/use-members-C5YyvV0b.js","assets/use-org-auth-client-uJpLhcXu.js","assets/feature-paywall-dsk7xdNr.js","assets/plan-ladder-elmtHhgS.js","assets/add-connection-dialog-7hGrBECA.js","assets/extract-connection-data-CJFs5pw9.js","assets/metadata-D72DunRR.js","assets/connection-CbXyxk_0.js","assets/connection-card-DvwNTHUt.js","assets/connection-slug-CITJ0kGN.js","assets/connection-form-helpers-BoZMz-Fx.js","assets/authenticate-and-persist-oauth-CkO9YCus.js","assets/mcp-oauth-D4Ea-Fft.js","assets/collection-tabs-DtGcsdTg.js","assets/badge-D-X7jCCj.js","assets/use-infinite-scroll-CgnPiJA2.js","assets/useSuspenseInfiniteQuery-CI9mo6bF.js","assets/use-task-board-events-0X4biGfq.js","assets/input-Bwd_JSM8.css","assets/sandbox-lifecycle-context-CZnq-87O.js","assets/resolve-tab-icon-Du8jGUtn.js","assets/use-task-metadata-Cj1cmQvo.js","assets/virtual-mcp-B2jselSK.js","assets/feature-gate-DLNLPr3F.js","assets/mustache-DmCtN5od.js","assets/empty-state-CyVuIHKP.js","assets/empty-state-Cc-zeI-b.js","assets/post-editor-B9m6130P.js","assets/multi-select-CgpS87eq.js","assets/block-document-CBORFGb8.js","assets/index-BMtTkIcx.js","assets/use-fast-preview-draft-url-Cm_dQrR9.js","assets/use-autosave-BgA4fgaR.js","assets/record-editor-BwyoUD4K.js","assets/context-D6Zd3Hi2.js","assets/index-BgjS0Ggx.js","assets/get-initials-D-f_fDFw.js","assets/category-editor-Cp8uxqcx.js","assets/sections-editor-25cXOA_1.js","assets/page-seo-form-CejuwtL1.js","assets/variant-matcher-override-BAnoj0VK.js","assets/seo-editor-qQizVqfD.js","assets/variant-calendar-C4_2wBML.js","assets/view-mode-toggle-chgrfj1u.js","assets/post-calendar-BLuKhT2v.js","assets/alert-Vbti1gEG.js","assets/redirect-editor-dBYIGyFb.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as ae,b as Se,j as n,m as gs,K as Pt,l as be,r as $,h as lt,B as _e,o as _o,e as Do,t as me,a2 as js,aF as St,aN as bt,F as It,aG as Ks,H as Rt,I as Ft,aA as Ao,U as $o,V as Lo,G as Je,ak as Tt,al as ds,ag as Oo,X as Io,u as Nn,aL as He}from"./index-B_3mBk4y.js";import{A as Ro}from"./agent-view-guard-yCCS9tda.js";import{F as Fo}from"./feature-gate-DLNLPr3F.js";import{u as Bt,b as Cn}from"./chat-context-Bw1Qo4Kf.js";import{i as Wt}from"./AlertCircle-B1Wz6L5U.js";import{I as Ko,T as Pn,U as et,V as Tn,W as ks,X as zo,Y as Bn,Z as Mo,b as Kt,O as En,_ as Vo,$ as Go,a0 as wt,a1 as Uo,a2 as Ho,n as qo,a3 as Jo,a4 as _n,a5 as Wo,a6 as Yo,a7 as Qo,l as zs,a8 as Xo,G as Dn}from"./agent-icon-B241PBKK.js";import{a as An,i as Ss,d as Ms}from"./UserSquare-C-IZAmnp.js";import{b as $n,i as Ln}from"./ZoomOut-CrIY1x34.js";import{c as On,i as Zo}from"./XClose-CigTCF4N.js";import{s as ws}from"./Plus-DWABMn2e.js";import{t as In}from"./Users01-NFbjkK3Z.js";import{f as ea,e as ta,b as sa,A as na,a as oa,d as aa,c as la,g as ia}from"./alert-dialog-AqvICzdc.js";import{S as Yt}from"./scroll-area-kaq4mbUn.js";import{T as We,a as Ye,b as Qe}from"./tooltip-A9lPSKit.js";import{B as nt}from"./badge-D-X7jCCj.js";import{S as us,n as ra,c as ca,g as Rn,B as ms,P as da,h as Fn,o as ua,i as xs,s as ma,u as Qt,l as fa,q as pa,R as ha,t as Kn,r as ga,v as xa,d as zn,w as ba,x as ya,y as Mn,z as va,M as ja,j as ka,A as Sa,p as wa,C as Na,D as Ca,e as Pa,f as Ta,E as Vs,F as Vn,k as Ba,G as Ea}from"./runnable-block-editor-Bb72YaFN.js";import{r as Ns,S as _a,m as Cs,i as Da,o as Aa,q as $a,n as Lt,v as La,R as Gn,t as Oa,l as Ia,w as Ra,x as Fa,y as Gs,G as Ps,g as Ka,z as za,e as Us,A as Ma,d as Va,B as Ga,D as Hs,h as Ua,E as Ha,F as qa}from"./claim-phase-copy-Bc0le9Uu.js";import{u as Un,P as Ja}from"./mustache-DmCtN5od.js";import{n as Hn}from"./ShoppingBag01-BzDsEvOc.js";import{t as ft}from"./ChevronUp-DMzxjk9Q.js";import{C as Wa,a as Ya,b as Qa}from"./collapsible-FI3WWzNe.js";import{c as Xa,d as Za}from"./sandbox-lifecycle-context-CZnq-87O.js";import{u as qn}from"./use-session-runtime-41aA3FaG.js";import{c as pt,d as it,e as ht,b as rt,D as ct,h as zt,a as el}from"./dialog-BR2W-zw-.js";import{I as Xe}from"./input-B1N39T_Y.js";import{C as Xt}from"./checkbox-BHKLlAci.js";import{L as ze}from"./label-CAMUAUyp.js";import{c as tl,b as sl,a as nl,d as ol,S as al}from"./select-MC8L6Y4s.js";import{o as ll}from"./sandbox-git-api-B1R0585s.js";import{b as qs}from"./sandbox-url-D3mC8qhT.js";import{a as Js}from"./utils-C1m0wvDK.js";import{i as il}from"./CheckCircle-BbTEzozp.js";import{s as Ts}from"./Trash01-CZPHTYfi.js";import{i as fs}from"./Upload01-BhUTj6_2.js";import{E as rl}from"./empty-state-CyVuIHKP.js";import{T as Ot}from"./textarea-VVwww85B.js";import{u as cl}from"./use-ai-providers-CajwguYo.js";import{M as Jn}from"./monaco-editor-B_VHQ5gY.js";import{i as Bs}from"./X-Df5KdWXB.js";import{f as Wn,a as dl}from"./repository-binding-DoGbZGqV.js";import"./rich-text-link-control-BUaa9cuE.js";import{a as ul}from"./Copy01-Z8h17W5V.js";import{c as ml}from"./Tool01-CXZVYCJV.js";import{b as Ws}from"./use-project-scope-mDKXkaKI.js";import{E as fl}from"./empty-state-Cc-zeI-b.js";import{G as Ys}from"./repository-picker-EdvJ_XCR.js";import{R as pl}from"./repository-import-picker-Do_6Wg0W.js";import{b as hl}from"./thread-route-CqPKjeFM.js";function gl(t){const e=ae.c(18),{title:s,description:o,children:a}=t,l=Se();let i;e[0]!==a?(i=n.jsx("div",{"aria-hidden":"true",inert:!0,className:"pointer-events-none h-full select-none overflow-hidden",children:a}),e[0]=a,e[1]=i):i=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Ko,{}),e[2]=c):c=e[2];let r;e[3]!==l?(r=l("common.soon"),e[3]=l,e[4]=r):r=e[4];let d;e[5]!==r?(d=n.jsxs(nt,{variant:"secondary",children:[c,r]}),e[5]=r,e[6]=d):d=e[6];let p;e[7]!==s?(p=n.jsx("p",{className:"text-base font-semibold text-foreground",children:s}),e[7]=s,e[8]=p):p=e[8];let m;e[9]!==o?(m=o&&n.jsx("p",{className:"text-sm text-muted-foreground",children:o}),e[9]=o,e[10]=m):m=e[10];let h;e[11]!==d||e[12]!==p||e[13]!==m?(h=n.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-background/60 p-6 backdrop-blur-sm",children:n.jsxs("div",{className:"flex max-w-sm flex-col items-center gap-3 rounded-2xl border bg-card px-8 py-6 text-center shadow-lg",children:[d,p,m]})}),e[11]=d,e[12]=p,e[13]=m,e[14]=h):h=e[14];let u;return e[15]!==i||e[16]!==h?(u=n.jsxs("div",{className:"relative h-full min-h-0",children:[i,h]}),e[15]=i,e[16]=h,e[17]=u):u=e[17],u}function xl(t,e){if(!t||!e?.length)return t;const s=Object.fromEntries(Object.entries(t.properties??{}).filter(([o])=>!e.includes(o)));return Object.keys(s).length>0?{...t,properties:s}:t}function bl(t,e,s){return typeof t!="string"?null:xl(Ns(t,e),s)}function Yn(t,e,s){if(!e||typeof t!="string")return!1;const o=bl(t,e,s);return!!o&&Object.keys(o.properties??{}).length>0}function yt(t){const e=ae.c(6),{hasItems:s,emptyLabel:o,emptyHint:a}=t;let l;e[0]!==a||e[1]!==o||e[2]!==s?(l=s?"No results match your search.":n.jsxs(n.Fragment,{children:[n.jsx("div",{children:o}),n.jsx("div",{className:"mt-1 text-muted-foreground/80",children:a})]}),e[0]=a,e[1]=o,e[2]=s,e[3]=l):l=e[3];let i;return e[4]!==l?(i=n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:l}),e[4]=l,e[5]=i):i=e[5],i}function Zt(t,e){return`${t}-${e}`}function Qn(t,e){return`site/apps/${t}/${e}.ts`}function Xn(t){const e=t.match(/^site\/apps\/([^/]+)\/([^/.]+)\.tsx?$/);if(e)return{vendor:e[1],app:e[2]};const s=t.match(/^([^/]+)\/apps\/([^/.]+)\.tsx?$/);return s?{vendor:s[1],app:s[2]}:null}function yl(t){const e=t.match(/^([^-]+)-(.+)$/);return e?{vendor:e[1],app:e[2]}:null}function vl(t){return t==="local"?"Custom":"Installed"}function Zn(t,e,s){const o=new Set([Zt(t,e),e].map(l=>l.toLowerCase())),a=Qn(t,e);for(const[l,i]of Object.entries(s)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const c=i;if(o.has(l.toLowerCase())||c.__resolveType===a)return l}return null}function jl(t,e){const s=t.vendor.alias,o=t.name,a=Zn(s,o,e);return{id:Zt(s,o),app:o,vendor:s,title:t.title||t.name,description:t.description,category:t.category??"Other",logo:t.logo||void 0,resolveType:Qn(s,o),blockKey:a,installed:a!==null}}function kl(t,e,s){if(t===_a)return null;const o=Xn(t);if(!o)return null;const{vendor:a,app:l}=o,i=Zn(a,l,s),c=Cs(t,e);return{id:Zt(a,l),app:l,vendor:a,title:c.title??l,description:c.description??"",category:"Others",logo:c.logo??c.icon,resolveType:t,blockKey:i,installed:i!==null}}function Sl(t,e,s){const o=e.__resolveType;if(typeof o!="string"||Da(t,e)||!Aa(o))return null;const a=Xn(o)??yl(t);if(!a)return null;const l=Cs(o,s),{vendor:i,app:c}=a;return{id:Zt(i,c),app:c,vendor:i,title:l.title??$a(t,e,s),description:l.description??"",category:vl(i),logo:l.logo??l.icon,resolveType:o,blockKey:t,installed:!0}}function wl(t,e,s){const o=new Map;for(const l of t){const i=jl(l,s);o.set(i.id,i)}const a=e.manifest?.blocks?.apps??{};for(const l of Object.keys(a)){const i=kl(l,e,s);!i||o.has(i.id)||o.set(i.id,i)}for(const[l,i]of Object.entries(s)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const c=Sl(l,i,e);!c||o.has(c.id)||o.set(c.id,c)}return[...o.values()].sort(Nl)}function Nl(t,e){return t.installed!==e.installed?t.installed?-1:1:t.title.localeCompare(e.title)}async function Cl(){const t=await fetch("/api/deco-apps");if(!t.ok)throw new Error(`Failed to fetch deco apps: ${t.status}`);return(await t.json()).apps??[]}function Pl(t,e,s){const o=ae.c(12),a=s?.enabled??!0;let l;o[0]===Symbol.for("react.memo_cache_sentinel")?(l=Pt.decoApps(),o[0]=l):l=o[0];let i;o[1]!==a?(i={queryKey:l,queryFn:Cl,staleTime:3e5,retry:1,enabled:a},o[1]=a,o[2]=i):i=o[2];const c=gs(i);let r;o[3]!==e||o[4]!==t||o[5]!==c.data?(r=t&&e?wl(c.data??[],t,e):[],o[3]=e,o[4]=t,o[5]=c.data,o[6]=r):r=o[6];const d=r,p=c.isLoading&&!c.isError;let m;return o[7]!==d||o[8]!==c.isError||o[9]!==c.refetch||o[10]!==p?(m={catalog:d,isLoading:p,isError:c.isError,refetch:c.refetch},o[7]=d,o[8]=c.isError,o[9]=c.refetch,o[10]=p,o[11]=m):m=o[11],m}const Tl=["sections","apps","loaders","actions"];function Bl(t){const e=ae.c(59),{active:s,counts:o,showBlog:a,onSelect:l}=t,i=Se();let c;e[0]!==i?(c=i("sandbox.collectionsSidebar.content"),e[0]=i,e[1]=c):c=e[1];let r;e[2]!==c?(r=n.jsx("div",{className:"px-3 h-12 flex items-center border-b shrink-0",children:n.jsx("span",{className:"text-sm font-medium",children:c})}),e[2]=c,e[3]=r):r=e[3];let d;e[4]!==i?(d=i("sandbox.collectionsSidebar.pages"),e[4]=i,e[5]=d):d=e[5];const p=s==="pages";let m;e[6]!==o.pages||e[7]!==l||e[8]!==d||e[9]!==p?(m=n.jsx(Re,{id:"pages",icon:An,label:d,count:o.pages,active:p,onSelect:l}),e[6]=o.pages,e[7]=l,e[8]=d,e[9]=p,e[10]=m):m=e[10];let h;e[11]!==i?(h=i("sandbox.collectionsSidebar.redirects"),e[11]=i,e[12]=h):h=e[12];const u=s==="redirects";let f;e[13]!==o.redirects||e[14]!==l||e[15]!==h||e[16]!==u?(f=n.jsx(Re,{id:"redirects",icon:Pn,label:h,count:o.redirects,active:u,onSelect:l}),e[13]=o.redirects,e[14]=l,e[15]=h,e[16]=u,e[17]=f):f=e[17];let x;e[18]!==i?(x=i("sandbox.collectionsSidebar.site"),e[18]=i,e[19]=x):x=e[19];const g=s==="site";let v;e[20]!==l||e[21]!==g||e[22]!==x?(v=n.jsx(Re,{id:"site",icon:zo,label:x,active:g,onSelect:l}),e[20]=l,e[21]=g,e[22]=x,e[23]=v):v=e[23];let y;e[24]!==i?(y=i("sandbox.collectionsSidebar.seo"),e[24]=i,e[25]=y):y=e[25];const j=s==="seo";let w;e[26]!==l||e[27]!==y||e[28]!==j?(w=n.jsx(Re,{id:"seo",icon:Bn,label:y,active:j,onSelect:l}),e[26]=l,e[27]=y,e[28]=j,e[29]=w):w=e[29];let N;e[30]!==i?(N=i("sandbox.collectionsSidebar.calendar"),e[30]=i,e[31]=N):N=e[31];const E=s==="calendar";let B;e[32]!==l||e[33]!==N||e[34]!==E?(B=n.jsx(Re,{id:"calendar",icon:Mo,label:N,active:E,onSelect:l}),e[32]=l,e[33]=N,e[34]=E,e[35]=B):B=e[35];let k;e[36]!==s||e[37]!==o||e[38]!==l?(k=n.jsx(El,{active:s,counts:o,onSelect:l}),e[36]=s,e[37]=o,e[38]=l,e[39]=k):k=e[39];let D;e[40]!==s||e[41]!==o.authors||e[42]!==o.categories||e[43]!==o.posts||e[44]!==l||e[45]!==a||e[46]!==i?(D=a&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mt-3 flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",children:[n.jsx(Hn,{size:13,className:"shrink-0"}),i("sandbox.collectionsSidebar.blog")]}),n.jsx(Re,{id:"context",icon:et,label:i("sandbox.collectionsSidebar.context"),active:s==="context",onSelect:l}),n.jsx(Re,{id:"posts",icon:$n,label:i("sandbox.collectionsSidebar.posts"),count:o.posts,active:s==="posts",onSelect:l}),n.jsx(Re,{id:"authors",icon:In,label:i("sandbox.collectionsSidebar.authors"),count:o.authors,active:s==="authors",onSelect:l}),n.jsx(Re,{id:"categories",icon:Tn,label:i("sandbox.collectionsSidebar.categories"),count:o.categories,active:s==="categories",onSelect:l}),n.jsx(Re,{id:"post-schedule",icon:ks,label:i("sandbox.collectionsSidebar.postSchedule"),active:s==="post-schedule",onSelect:l})]}),e[40]=s,e[41]=o.authors,e[42]=o.categories,e[43]=o.posts,e[44]=l,e[45]=a,e[46]=i,e[47]=D):D=e[47];let O;e[48]!==v||e[49]!==w||e[50]!==B||e[51]!==k||e[52]!==D||e[53]!==m||e[54]!==f?(O=n.jsxs("nav",{className:"flex flex-col p-1.5 gap-0.5",children:[m,f,v,w,B,k,D]}),e[48]=v,e[49]=w,e[50]=B,e[51]=k,e[52]=D,e[53]=m,e[54]=f,e[55]=O):O=e[55];let L;return e[56]!==r||e[57]!==O?(L=n.jsxs("div",{className:"w-[208px] shrink-0 border-r flex flex-col",children:[r,O]}),e[56]=r,e[57]=O,e[58]=L):L=e[58],L}function El(t){const e=ae.c(52),{active:s,counts:o,onSelect:a}=t,l=Se();let i;e[0]!==s?(i=Tl.includes(s),e[0]=s,e[1]=i):i=e[1];const c=i,[r,d]=$.useState(!1),p=r||c;let m,h;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=be("flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer","text-muted-foreground hover:bg-muted hover:text-foreground"),h=n.jsx(Vo,{size:16,className:"shrink-0"}),e[2]=m,e[3]=h):(m=e[2],h=e[3]);let u;e[4]!==l?(u=l("sandbox.collectionsSidebar.advanced"),e[4]=l,e[5]=u):u=e[5];let f;e[6]!==u?(f=n.jsx("span",{className:"flex-1 truncate",children:u}),e[6]=u,e[7]=f):f=e[7];const x=p&&"rotate-180";let g;e[8]!==x?(g=be("shrink-0 text-muted-foreground/70 transition-transform",x),e[8]=x,e[9]=g):g=e[9];let v;e[10]!==g?(v=n.jsx(ft,{size:16,className:g}),e[10]=g,e[11]=v):v=e[11];let y;e[12]!==f||e[13]!==v?(y=n.jsxs(Wa,{className:m,children:[h,f,v]}),e[12]=f,e[13]=v,e[14]=y):y=e[14];let j;e[15]!==l?(j=l("sandbox.collectionsSidebar.sections"),e[15]=l,e[16]=j):j=e[16];const w=s==="sections";let N;e[17]!==o.sections||e[18]!==a||e[19]!==j||e[20]!==w?(N=n.jsx(Re,{id:"sections",icon:Kt,label:j,count:o.sections,active:w,onSelect:a,indent:!0}),e[17]=o.sections,e[18]=a,e[19]=j,e[20]=w,e[21]=N):N=e[21];let E;e[22]!==l?(E=l("sandbox.collectionsSidebar.apps"),e[22]=l,e[23]=E):E=e[23];const B=s==="apps";let k;e[24]!==o.apps||e[25]!==a||e[26]!==E||e[27]!==B?(k=n.jsx(Re,{id:"apps",icon:On,label:E,count:o.apps,active:B,onSelect:a,indent:!0}),e[24]=o.apps,e[25]=a,e[26]=E,e[27]=B,e[28]=k):k=e[28];let D;e[29]!==l?(D=l("sandbox.collectionsSidebar.loaders"),e[29]=l,e[30]=D):D=e[30];const O=s==="loaders";let L;e[31]!==o.loaders||e[32]!==a||e[33]!==D||e[34]!==O?(L=n.jsx(Re,{id:"loaders",icon:En,label:D,count:o.loaders,active:O,onSelect:a,indent:!0}),e[31]=o.loaders,e[32]=a,e[33]=D,e[34]=O,e[35]=L):L=e[35];let K;e[36]!==l?(K=l("sandbox.collectionsSidebar.actions"),e[36]=l,e[37]=K):K=e[37];const F=s==="actions";let _;e[38]!==o.actions||e[39]!==a||e[40]!==K||e[41]!==F?(_=n.jsx(Re,{id:"actions",icon:Ln,label:K,count:o.actions,active:F,onSelect:a,indent:!0}),e[38]=o.actions,e[39]=a,e[40]=K,e[41]=F,e[42]=_):_=e[42];let A;e[43]!==N||e[44]!==k||e[45]!==L||e[46]!==_?(A=n.jsxs(Ya,{className:"flex flex-col gap-0.5 pt-0.5",children:[N,k,L,_]}),e[43]=N,e[44]=k,e[45]=L,e[46]=_,e[47]=A):A=e[47];let I;return e[48]!==p||e[49]!==A||e[50]!==y?(I=n.jsxs(Qa,{open:p,onOpenChange:d,children:[y,A]}),e[48]=p,e[49]=A,e[50]=y,e[51]=I):I=e[51],I}function Re(t){const e=ae.c(19),{id:s,icon:o,label:a,count:l,active:i,onSelect:c,indent:r}=t;let d;e[0]!==s||e[1]!==c?(d=()=>c(s),e[0]=s,e[1]=c,e[2]=d):d=e[2];const p=r&&"pl-6",m=i?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let h;e[3]!==p||e[4]!==m?(h=be("flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",p,m),e[3]=p,e[4]=m,e[5]=h):h=e[5];let u;e[6]!==o?(u=n.jsx(o,{size:16,className:"shrink-0"}),e[6]=o,e[7]=u):u=e[7];let f;e[8]!==a?(f=n.jsx("span",{className:"flex-1 truncate",children:a}),e[8]=a,e[9]=f):f=e[9];let x;e[10]!==i||e[11]!==l?(x=l!==void 0&&n.jsx("span",{className:be("shrink-0 text-xs tabular-nums",i?"text-accent-foreground/70":"text-muted-foreground/70"),children:l}),e[10]=i,e[11]=l,e[12]=x):x=e[12];let g;return e[13]!==d||e[14]!==h||e[15]!==u||e[16]!==f||e[17]!==x?(g=n.jsxs("button",{type:"button",onClick:d,className:h,children:[u,f,x]}),e[13]=d,e[14]=h,e[15]=u,e[16]=f,e[17]=x,e[18]=g):g=e[18],g}function _l(t){const e=ae.c(12),{state:s,claimPhase:o,lifecycle:a,onStart:l,connectionsHref:i}=t;switch(s.kind){case"starting":{let c;e[0]!==o||e[1]!==a?(c=ra({claimPhase:o,lifecycle:a}),e[0]=o,e[1]=a,e[2]=c):c=e[2];let r;return e[3]!==o||e[4]!==c?(r=n.jsx(us,{kind:"starting",progress:c,claimPhase:o}),e[3]=o,e[4]=c,e[5]=r):r=e[5],r}case"suspended":{let c;return e[6]!==l?(c=n.jsx(us,{kind:"suspended",onResume:l}),e[6]=l,e[7]=c):c=e[7],c}case"errored":{let c;return e[8]!==i||e[9]!==l||e[10]!==s.error?(c=n.jsx(us,{kind:"errored",error:s.error,onRetry:l,connectionsHref:i}),e[8]=i,e[9]=l,e[10]=s.error,e[11]=c):c=e[11],c}}}const Dl=new Set(["clone-failed","install-failed","start-failed","crashed"]);function Al(t){if(t.fastPreviewActive)return{kind:"ready",devServerReady:!1,sandboxWarming:!1};if(t.previewState.kind!=="iframe")return{kind:"sandbox-card",state:t.previewState};const e=t.lifecyclePhase==="running",s=!e&&!Dl.has(t.lifecyclePhase);return{kind:"ready",devServerReady:e,sandboxWarming:s}}function Qs(t,e){const s=e.replace(/\s*\(copy(?:\s+\d+)?\)\s*$/,"").trim(),o=`${s} (copy)`;if(!t.has(o))return o;for(let a=2;a<1e3;a++){const l=`${s} (copy ${a})`;if(!t.has(l))return l}return`${s} (copy ${Date.now()})`}function $l(t,e){const s=Lt,o=e.replace(/-copy(?:-\d+)?$/,""),a=`${o}-copy`;if(!t.has(s(a)))return a;for(let l=2;l<1e3;l++){const i=`${o}-copy-${l}`;if(!t.has(s(i)))return i}return`${o}-copy-${Date.now()}`}function Ll(t,e){const s=e.replace(/_copy(?:_\d+)?$/,""),o=`${s}_copy`;if(!Object.hasOwn(t,o))return o;for(let a=2;a<1e3;a++){const l=`${s}_copy_${a}`;if(!Object.hasOwn(t,l))return l}return`${s}_copy_${Date.now()}`}function Ol(t){const e=Rn(t.newName),s={...t.source,name:t.newName,path:t.newPath};return{key:e,data:s}}function Il(t,e){return ca(t,e)}const Rl=1e3;function Fl(t,e){for(let s=0;s<Rl;s++){const o=Rn(e);if(!Object.hasOwn(t,o))return o}throw new Error("Could not generate a unique page block key")}const Kl={create:"sandbox.pageFormDialog.titleCreate",duplicate:"sandbox.pageFormDialog.titleDuplicate",rename:"sandbox.pageFormDialog.titleRename"},zl={create:"sandbox.pageFormDialog.submitCreate",duplicate:"sandbox.pageFormDialog.submitDuplicate",rename:"sandbox.pageFormDialog.submitSave"},Ml={create:"sandbox.pageFormDialog.pendingCreate",duplicate:"sandbox.pageFormDialog.pendingDuplicate",rename:"sandbox.pageFormDialog.pendingSave"};function Vl(t){const e=ae.c(88),{open:s,mode:o,initialName:a,initialPath:l,isPending:i,error:c,templates:r,validate:d,onSubmit:p,onOpenChange:m}=t,h=i===void 0?!1:i,u=Se(),[f,x]=$.useState(a),[g,v]=$.useState(l),[y,j]=$.useState(ms),[w,N]=$.useState(null),[E,B]=$.useState(s);s!==E&&(B(s),s&&(x(a),v(l),j(ms),N(null)));const k=o==="create"&&!!r?.length;let D;e[0]!==h||e[1]!==m?(D=pe=>{!pe&&!h&&(N(null),m(!1))},e[0]=h,e[1]=m,e[2]=D):D=e[2];const O=D;let L;e[3]!==h||e[4]!==f||e[5]!==p||e[6]!==g||e[7]!==k||e[8]!==y||e[9]!==d?(L=async pe=>{pe.preventDefault();const je=f.trim(),he=g.trim();if(!je||!he||h)return;const we=La(he);if(we){N(we);return}const Pe=d?.({name:je,path:he});if(Pe){N(Pe);return}N(null),await p({name:je,path:he,templateKey:k&&y!==ms?y:null})},e[3]=h,e[4]=f,e[5]=p,e[6]=g,e[7]=k,e[8]=y,e[9]=d,e[10]=L):L=e[10];const K=L,F=w??c,_=Kl[o];let A;e[11]!==u||e[12]!==_?(A=u(_),e[11]=u,e[12]=_,e[13]=A):A=e[13];let I;e[14]!==A?(I=n.jsx(pt,{children:n.jsx(it,{children:A})}),e[14]=A,e[15]=I):I=e[15];let R;e[16]!==h||e[17]!==k||e[18]!==u||e[19]!==y||e[20]!==r?(R=k&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("label",{htmlFor:"page-form-template",className:"text-xs font-medium text-muted-foreground",children:u("sandbox.pageFormDialog.labelTemplate")}),n.jsx(da,{id:"page-form-template",value:y,onChange:j,templates:r??[],disabled:h})]}),e[16]=h,e[17]=k,e[18]=u,e[19]=y,e[20]=r,e[21]=R):R=e[21];let G;e[22]!==u?(G=u("sandbox.pageFormDialog.labelName"),e[22]=u,e[23]=G):G=e[23];let z;e[24]!==G?(z=n.jsx("label",{htmlFor:"page-form-name",className:"text-xs font-medium text-muted-foreground",children:G}),e[24]=G,e[25]=z):z=e[25];let W;e[26]===Symbol.for("react.memo_cache_sentinel")?(W=pe=>x(pe.target.value),e[26]=W):W=e[26];let P;e[27]!==u?(P=u("sandbox.pageFormDialog.placeholderName"),e[27]=u,e[28]=P):P=e[28];let U;e[29]!==h||e[30]!==f||e[31]!==P?(U=n.jsx(Xe,{id:"page-form-name",value:f,onChange:W,placeholder:P,autoFocus:!0,disabled:h}),e[29]=h,e[30]=f,e[31]=P,e[32]=U):U=e[32];let Y;e[33]!==U||e[34]!==z?(Y=n.jsxs("div",{className:"space-y-1.5",children:[z,U]}),e[33]=U,e[34]=z,e[35]=Y):Y=e[35];let q;e[36]!==u?(q=u("sandbox.pageFormDialog.labelPath"),e[36]=u,e[37]=q):q=e[37];let Z;e[38]!==q?(Z=n.jsx("label",{htmlFor:"page-form-path",className:"text-xs font-medium text-muted-foreground",children:q}),e[38]=q,e[39]=Z):Z=e[39];let de;e[40]===Symbol.for("react.memo_cache_sentinel")?(de=pe=>v(pe.target.value),e[40]=de):de=e[40];let ne;e[41]!==u?(ne=u("sandbox.pageFormDialog.placeholderPath"),e[41]=u,e[42]=ne):ne=e[42];let ue;e[43]!==h||e[44]!==g||e[45]!==ne?(ue=n.jsx(Xe,{id:"page-form-path",value:g,onChange:de,placeholder:ne,disabled:h}),e[43]=h,e[44]=g,e[45]=ne,e[46]=ue):ue=e[46];let te;e[47]!==Z||e[48]!==ue?(te=n.jsxs("div",{className:"space-y-1.5",children:[Z,ue]}),e[47]=Z,e[48]=ue,e[49]=te):te=e[49];let re;e[50]!==F?(re=F&&n.jsx("p",{className:"text-xs text-destructive",children:F}),e[50]=F,e[51]=re):re=e[51];let le;e[52]!==Y||e[53]!==te||e[54]!==re||e[55]!==R?(le=n.jsxs("div",{className:"space-y-4 py-4",children:[R,Y,te,re]}),e[52]=Y,e[53]=te,e[54]=re,e[55]=R,e[56]=le):le=e[56];let T;e[57]!==m?(T=()=>m(!1),e[57]=m,e[58]=T):T=e[58];let J;e[59]!==u?(J=u("sandbox.pageFormDialog.buttonCancel"),e[59]=u,e[60]=J):J=e[60];let ee;e[61]!==h||e[62]!==T||e[63]!==J?(ee=n.jsx(_e,{type:"button",variant:"outline",onClick:T,disabled:h,children:J}),e[61]=h,e[62]=T,e[63]=J,e[64]=ee):ee=e[64];let oe;e[65]!==h||e[66]!==f||e[67]!==g?(oe=!f.trim()||!g.trim()||h,e[65]=h,e[66]=f,e[67]=g,e[68]=oe):oe=e[68];let S;e[69]!==h||e[70]!==o||e[71]!==u?(S=h?n.jsxs(n.Fragment,{children:[n.jsx(lt,{className:"size-3.5"}),u(Ml[o])]}):u(zl[o]),e[69]=h,e[70]=o,e[71]=u,e[72]=S):S=e[72];let se;e[73]!==oe||e[74]!==S?(se=n.jsx(_e,{type:"submit",disabled:oe,children:S}),e[73]=oe,e[74]=S,e[75]=se):se=e[75];let H;e[76]!==ee||e[77]!==se?(H=n.jsxs(ht,{children:[ee,se]}),e[76]=ee,e[77]=se,e[78]=H):H=e[78];let ie;e[79]!==K||e[80]!==le||e[81]!==H||e[82]!==I?(ie=n.jsx(rt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:K,children:[I,le,H]})}),e[79]=K,e[80]=le,e[81]=H,e[82]=I,e[83]=ie):ie=e[83];let ye;return e[84]!==O||e[85]!==s||e[86]!==ie?(ye=n.jsx(ct,{open:s,onOpenChange:O,children:ie}),e[84]=O,e[85]=s,e[86]=ie,e[87]=ye):ye=e[87],ye}const Gl=[{value:"temporary",labelKey:"sandbox.redirectEditor.typeTemporary"},{value:"permanent",labelKey:"sandbox.redirectEditor.typePermanent"}],Xs={from:"",to:"",type:"temporary",discardQueryParameters:!1};function Ul(t){const e=ae.c(111),{open:s,isPending:o,error:a,onSubmit:l,onOpenChange:i}=t,c=o===void 0?!1:o,r=Se(),[d,p]=$.useState(Xs),[m,h]=$.useState(null),[u,f]=$.useState(s);s!==u&&(f(s),s&&(p(Xs),h(null)));let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=ge=>p($e=>({...$e,...ge})),e[0]=x):x=e[0];const g=x;let v;e[1]!==c||e[2]!==i?(v=ge=>{!ge&&!c&&(h(null),i(!1))},e[1]=c,e[2]=i,e[3]=v):v=e[3];const y=v;let j;e[4]!==c||e[5]!==l||e[6]!==d||e[7]!==r?(j=async ge=>{ge.preventDefault();const $e=d.from.trim(),Fe=d.to.trim();if(!$e||!Fe||c){h(r("sandbox.redirectFormDialog.errorRequired"));return}h(null),await l({...d,from:$e,to:Fe})},e[4]=c,e[5]=l,e[6]=d,e[7]=r,e[8]=j):j=e[8];const w=j,N=m??a;let E;e[9]!==c||e[10]!==d.from||e[11]!==d.to?(E=!!d.from.trim()&&!!d.to.trim()&&!c,e[9]=c,e[10]=d.from,e[11]=d.to,e[12]=E):E=e[12];const B=E;let k;e[13]!==r?(k=r("sandbox.redirectFormDialog.title"),e[13]=r,e[14]=k):k=e[14];let D;e[15]!==k?(D=n.jsx(pt,{children:n.jsx(it,{children:k})}),e[15]=k,e[16]=D):D=e[16];let O;e[17]!==r?(O=r("sandbox.redirectEditor.fromLabel"),e[17]=r,e[18]=O):O=e[18];let L;e[19]!==O?(L=n.jsx(ze,{htmlFor:"redirect-form-from",children:O}),e[19]=O,e[20]=L):L=e[20];const K=d.from;let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=ge=>g({from:ge.target.value}),e[21]=F):F=e[21];let _;e[22]!==r?(_=r("sandbox.redirectEditor.fromPlaceholder"),e[22]=r,e[23]=_):_=e[23];let A;e[24]!==c||e[25]!==d.from||e[26]!==_?(A=n.jsx(Xe,{id:"redirect-form-from",value:K,onChange:F,placeholder:_,autoFocus:!0,disabled:c}),e[24]=c,e[25]=d.from,e[26]=_,e[27]=A):A=e[27];let I;e[28]!==A||e[29]!==L?(I=n.jsxs("div",{className:"space-y-1.5",children:[L,A]}),e[28]=A,e[29]=L,e[30]=I):I=e[30];let R;e[31]!==r?(R=r("sandbox.redirectEditor.toLabel"),e[31]=r,e[32]=R):R=e[32];let G;e[33]!==R?(G=n.jsx(ze,{htmlFor:"redirect-form-to",children:R}),e[33]=R,e[34]=G):G=e[34];const z=d.to;let W;e[35]===Symbol.for("react.memo_cache_sentinel")?(W=ge=>g({to:ge.target.value}),e[35]=W):W=e[35];let P;e[36]!==r?(P=r("sandbox.redirectEditor.toPlaceholder"),e[36]=r,e[37]=P):P=e[37];let U;e[38]!==c||e[39]!==d.to||e[40]!==P?(U=n.jsx(Xe,{id:"redirect-form-to",value:z,onChange:W,placeholder:P,disabled:c}),e[38]=c,e[39]=d.to,e[40]=P,e[41]=U):U=e[41];let Y;e[42]!==G||e[43]!==U?(Y=n.jsxs("div",{className:"space-y-1.5",children:[G,U]}),e[42]=G,e[43]=U,e[44]=Y):Y=e[44];let q;e[45]!==r?(q=r("sandbox.redirectEditor.typeLabel"),e[45]=r,e[46]=q):q=e[46];let Z;e[47]!==q?(Z=n.jsx(ze,{htmlFor:"redirect-form-type",children:q}),e[47]=q,e[48]=Z):Z=e[48];const de=d.type;let ne;e[49]===Symbol.for("react.memo_cache_sentinel")?(ne=ge=>g({type:ge}),e[49]=ne):ne=e[49];let ue;e[50]!==r?(ue=r("sandbox.redirectEditor.typePlaceholder"),e[50]=r,e[51]=ue):ue=e[51];let te;e[52]!==ue?(te=n.jsx(sl,{id:"redirect-form-type",className:"w-full",children:n.jsx(nl,{placeholder:ue})}),e[52]=ue,e[53]=te):te=e[53];let re;e[54]!==r?(re=Gl.map(ge=>n.jsx(tl,{value:ge.value,children:r(ge.labelKey,{status:Gn[ge.value]})},ge.value)),e[54]=r,e[55]=re):re=e[55];let le;e[56]!==re?(le=n.jsx(ol,{children:re}),e[56]=re,e[57]=le):le=e[57];let T;e[58]!==c||e[59]!==d.type||e[60]!==te||e[61]!==le?(T=n.jsxs(al,{value:de,onValueChange:ne,disabled:c,children:[te,le]}),e[58]=c,e[59]=d.type,e[60]=te,e[61]=le,e[62]=T):T=e[62];let J;e[63]!==Z||e[64]!==T?(J=n.jsxs("div",{className:"space-y-1.5",children:[Z,T]}),e[63]=Z,e[64]=T,e[65]=J):J=e[65];let ee;e[66]===Symbol.for("react.memo_cache_sentinel")?(ee=ge=>g({discardQueryParameters:ge===!0}),e[66]=ee):ee=e[66];let oe;e[67]!==c||e[68]!==d.discardQueryParameters?(oe=n.jsx(Xt,{checked:d.discardQueryParameters,disabled:c,onCheckedChange:ee}),e[67]=c,e[68]=d.discardQueryParameters,e[69]=oe):oe=e[69];let S;e[70]!==r?(S=r("sandbox.redirectEditor.discardQueryParameters"),e[70]=r,e[71]=S):S=e[71];let se;e[72]!==S?(se=n.jsx("span",{className:"text-sm",children:S}),e[72]=S,e[73]=se):se=e[73];let H;e[74]!==oe||e[75]!==se?(H=n.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[oe,se]}),e[74]=oe,e[75]=se,e[76]=H):H=e[76];let ie;e[77]!==N?(ie=N&&n.jsx("p",{className:"text-xs text-destructive",children:N}),e[77]=N,e[78]=ie):ie=e[78];let ye;e[79]!==I||e[80]!==Y||e[81]!==J||e[82]!==H||e[83]!==ie?(ye=n.jsxs("div",{className:"space-y-4 py-4",children:[I,Y,J,H,ie]}),e[79]=I,e[80]=Y,e[81]=J,e[82]=H,e[83]=ie,e[84]=ye):ye=e[84];let pe;e[85]!==i?(pe=()=>i(!1),e[85]=i,e[86]=pe):pe=e[86];let je;e[87]!==r?(je=r("sandbox.redirectFormDialog.cancel"),e[87]=r,e[88]=je):je=e[88];let he;e[89]!==c||e[90]!==pe||e[91]!==je?(he=n.jsx(_e,{type:"button",variant:"outline",onClick:pe,disabled:c,children:je}),e[89]=c,e[90]=pe,e[91]=je,e[92]=he):he=e[92];const we=!B;let Pe;e[93]!==c||e[94]!==r?(Pe=c?n.jsxs(n.Fragment,{children:[n.jsx(lt,{className:"size-3.5"}),r("sandbox.redirectFormDialog.pending")]}):r("sandbox.redirectFormDialog.submit"),e[93]=c,e[94]=r,e[95]=Pe):Pe=e[95];let Te;e[96]!==we||e[97]!==Pe?(Te=n.jsx(_e,{type:"submit",disabled:we,children:Pe}),e[96]=we,e[97]=Pe,e[98]=Te):Te=e[98];let Ne;e[99]!==he||e[100]!==Te?(Ne=n.jsxs(ht,{children:[he,Te]}),e[99]=he,e[100]=Te,e[101]=Ne):Ne=e[101];let Be;e[102]!==w||e[103]!==ye||e[104]!==Ne||e[105]!==D?(Be=n.jsx(rt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:w,children:[D,ye,Ne]})}),e[102]=w,e[103]=ye,e[104]=Ne,e[105]=D,e[106]=Be):Be=e[106];let De;return e[107]!==y||e[108]!==s||e[109]!==Be?(De=n.jsx(ct,{open:s,onOpenChange:y,children:Be}),e[107]=y,e[108]=s,e[109]=Be,e[110]=De):De=e[110],De}function Hl(t){const e=ae.c(70),{open:s,blockKey:o,initialName:a,isPending:l,onSubmit:i,onOpenChange:c}=t,r=l===void 0?!1:l,d=Se(),[p,m]=$.useState(a),[h,u]=$.useState(s);s!==h&&(u(s),s&&m(a));let f;e[0]!==r||e[1]!==c?(f=de=>{!de&&!r&&c(!1)},e[0]=r,e[1]=c,e[2]=f):f=e[2];const x=f;let g;e[3]!==r||e[4]!==p||e[5]!==i?(g=async de=>{de.preventDefault();const ne=p.trim();!ne||r||await i(ne)},e[3]=r,e[4]=p,e[5]=i,e[6]=g):g=e[6];const v=g;let y;e[7]!==d?(y=d("sandbox.sectionRenameDialog.title"),e[7]=d,e[8]=y):y=e[8];let j;e[9]!==y?(j=n.jsx(it,{children:y}),e[9]=y,e[10]=j):j=e[10];let w;e[11]!==d?(w=d("sandbox.sectionRenameDialog.description"),e[11]=d,e[12]=w):w=e[12];let N;e[13]!==w?(N=n.jsx(zt,{children:w}),e[13]=w,e[14]=N):N=e[14];let E;e[15]!==j||e[16]!==N?(E=n.jsxs(pt,{children:[j,N]}),e[15]=j,e[16]=N,e[17]=E):E=e[17];let B;e[18]!==d?(B=d("sandbox.sectionRenameDialog.nameLabel"),e[18]=d,e[19]=B):B=e[19];let k;e[20]!==B?(k=n.jsx("label",{htmlFor:"section-rename-name",className:"text-xs font-medium text-muted-foreground",children:B}),e[20]=B,e[21]=k):k=e[21];let D;e[22]===Symbol.for("react.memo_cache_sentinel")?(D=de=>m(de.target.value),e[22]=D):D=e[22];let O;e[23]!==r||e[24]!==p?(O=n.jsx(Xe,{id:"section-rename-name",value:p,onChange:D,autoFocus:!0,disabled:r}),e[23]=r,e[24]=p,e[25]=O):O=e[25];let L;e[26]!==k||e[27]!==O?(L=n.jsxs("div",{className:"space-y-1.5",children:[k,O]}),e[26]=k,e[27]=O,e[28]=L):L=e[28];let K;e[29]!==d?(K=d("sandbox.sectionRenameDialog.keyLabel"),e[29]=d,e[30]=K):K=e[30];let F;e[31]!==K?(F=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:K}),e[31]=K,e[32]=F):F=e[32];let _;e[33]!==o?(_=n.jsx(Xe,{value:o,readOnly:!0,disabled:!0,className:"font-mono"}),e[33]=o,e[34]=_):_=e[34];let A;e[35]!==F||e[36]!==_?(A=n.jsxs("div",{className:"space-y-1.5",children:[F,_]}),e[35]=F,e[36]=_,e[37]=A):A=e[37];let I;e[38]!==L||e[39]!==A?(I=n.jsxs("div",{className:"space-y-4 py-4",children:[L,A]}),e[38]=L,e[39]=A,e[40]=I):I=e[40];let R;e[41]!==c?(R=()=>c(!1),e[41]=c,e[42]=R):R=e[42];let G;e[43]!==d?(G=d("sandbox.sectionRenameDialog.cancel"),e[43]=d,e[44]=G):G=e[44];let z;e[45]!==r||e[46]!==R||e[47]!==G?(z=n.jsx(_e,{type:"button",variant:"outline",onClick:R,disabled:r,children:G}),e[45]=r,e[46]=R,e[47]=G,e[48]=z):z=e[48];let W;e[49]!==r||e[50]!==p?(W=!p.trim()||r,e[49]=r,e[50]=p,e[51]=W):W=e[51];let P;e[52]!==r||e[53]!==d?(P=r?n.jsxs(n.Fragment,{children:[n.jsx(lt,{className:"size-3.5"}),d("sandbox.sectionRenameDialog.saving")]}):d("sandbox.sectionRenameDialog.save"),e[52]=r,e[53]=d,e[54]=P):P=e[54];let U;e[55]!==W||e[56]!==P?(U=n.jsx(_e,{type:"submit",disabled:W,children:P}),e[55]=W,e[56]=P,e[57]=U):U=e[57];let Y;e[58]!==z||e[59]!==U?(Y=n.jsxs(ht,{children:[z,U]}),e[58]=z,e[59]=U,e[60]=Y):Y=e[60];let q;e[61]!==v||e[62]!==I||e[63]!==Y||e[64]!==E?(q=n.jsx(rt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:v,children:[E,I,Y]})}),e[61]=v,e[62]=I,e[63]=Y,e[64]=E,e[65]=q):q=e[65];let Z;return e[66]!==x||e[67]!==s||e[68]!==q?(Z=n.jsx(ct,{open:s,onOpenChange:x,children:q}),e[66]=x,e[67]=s,e[68]=q,e[69]=Z):Z=e[69],Z}function ql(t){const e=ae.c(7),{type:s}=t,o=Gn[s];let a;e[0]!==o?(a=n.jsx(We,{asChild:!0,children:n.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium tabular-nums text-muted-foreground",children:o})}),e[0]=o,e[1]=a):a=e[1];const l=s==="permanent"?"Permanent":"Temporary";let i;e[2]!==l?(i=n.jsx(Ye,{side:"left",children:l}),e[2]=l,e[3]=i):i=e[3];let c;return e[4]!==a||e[5]!==i?(c=n.jsxs(Qe,{children:[a,i]}),e[4]=a,e[5]=i,e[6]=c):c=e[6],c}const Jl=60,ps={post:"blog/loaders/Blogpost.ts",author:"blog/loaders/Author.ts",category:"blog/loaders/Category.ts"},Es=["posts","authors","categories"],Nt={posts:"post",authors:"author",categories:"category"};function ot(t){return Es.includes(t)}const es={posts:"post",authors:"author",categories:"category"},eo={posts:ps.post,authors:ps.author,categories:ps.category},Wl=Object.fromEntries(Object.entries(eo).map(([t,e])=>[e,t]));function Yl(t){return typeof t=="string"?Wl[t]??null:null}function Ie(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function X(t){return typeof t=="string"?t:""}function Ql(t,e){switch(t){case"posts":return{label:X(e.title)||"Untitled post",subtitle:X(e.slug)};case"authors":return{label:X(e.name)||"Unnamed author",subtitle:X(e.email)};case"categories":return{label:X(e.name)||"Unnamed category",subtitle:X(e.slug)};default:{const s=t;throw new Error(`Unhandled blog kind: ${String(s)}`)}}}function to(t){const e={posts:[],authors:[],categories:[]};for(const[s,o]of Object.entries(t)){const a=Ie(o);if(!a)continue;const l=Yl(a.__resolveType);if(!l)continue;const i=Ie(a[es[l]])??{},{label:c,subtitle:r}=Ql(l,i);e[l].push({key:s,kind:l,label:c,subtitle:r})}for(const s of Es)e[s].sort((o,a)=>o.label.localeCompare(a.label));return e}function Xl(t,e){return to(t)[e]}function Ue(t,e){return Xl(t,e).map(s=>({key:s.key,payload:dt(Ie(t[s.key])??void 0,e)}))}const Zs=Object.freeze({});function dt(t,e){return t?Ie(t[es[e]])??Zs:Zs}function at(t,e,s){return{name:t,__resolveType:eo[e],[es[e]]:s}}function pd({records:t,selected:e,valueField:s,toRef:o}){const a=Array.isArray(e)?e:[],l=h=>typeof h=="string"?h:X(Ie(h)?.[s]),i=h=>typeof h=="string"?h:X(Ie(h)?.name),c=h=>{const u=l(h),f=u?t.find(({payload:g})=>X(g[s])===u):void 0;if(f)return f;const x=i(h);return x?t.find(({payload:g})=>X(g.name)===x):void 0},r=t.map(({key:h,payload:u})=>({value:h,label:X(u.name)||X(u[s])||h})),d=new Map,p=[];return a.forEach((h,u)=>{const f=c(h);if(f){p.includes(f.key)||p.push(f.key);return}const x=`unresolved:${u}`;d.set(x,h),p.push(x),r.push({value:x,label:i(h)||l(h)||"Unknown"})}),{options:r,selectedValues:p,refsForValues:h=>h.map(u=>{const f=t.find(x=>x.key===u);return f?o(f.payload):d.get(u)}).filter(u=>u!==void 0)}}function so(t){return Ue(t,"authors").map(({payload:e})=>({...e,name:X(e.name),email:X(e.email)})).filter(e=>e.email)}function Ze(t){return Array.isArray(t)?t:[]}function st(t){if(typeof t=="string")return t;const e=Ie(t);return e?X(e.slug):""}function no(t){if(typeof t=="string")return t;const e=Ie(t);return e?X(e.email):""}function _s(t){const e=[];return X(t.title).trim()||e.push("Title"),X(t.slug).trim()||e.push("Slug"),Ze(t.categories).map(st).filter(Boolean).length===0&&e.push("Category"),X(t.excerpt).trim()||e.push("Excerpt"),X(t.image).trim()||e.push("Cover image"),e}const Ds=["draft","generating","awaiting_review","scheduled","published","archived"],oo=8;function Et(t){switch(X(t.status)){case"draft":case"idea":return"draft";case"generating":return"generating";case"awaiting_review":case"in_review":return"awaiting_review";case"scheduled":return"scheduled";case"published":return"published";case"archived":return"archived";case"":return"published";default:return"awaiting_review"}}function Zl(t,e){return e!=="published"&&e!=="scheduled"||Et(t)===e?!1:_s(t).length>0}function ei(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1,oo).toISOString()}function Mt(t,e,s){if(e!=="scheduled")return{...t,status:e,scheduledDatetime:""};const o=X(t.scheduledDatetime);return{...t,status:"scheduled",scheduledDatetime:Number.isNaN(new Date(o).getTime())?ei(s):o}}function ao(t){return Ue(t,"posts").map(({key:e,payload:s})=>({key:e,title:X(s.title)||"Untitled post",slug:X(s.slug),date:X(s.date),scheduledDatetime:X(s.scheduledDatetime),categorySlugs:Ze(s.categories).map(st).filter(Boolean),authorEmails:Ze(s.authors).map(no).filter(Boolean),missing:_s(s),status:Et(s),form:"live"}))}const lo="blog-manager/posts/";function io(t){return t.startsWith(lo)}function Ct(t){return t.split("/").pop()??t}function Vt(t){return`${lo}${t}`}function ti(t){return`collections/blog/posts/${t}`}function bs(){return gt(12)}function si(t){const e=Ie(t.planning)??{},s=Ie(e.format);return{ideaKey:X(e.ideaKey)||void 0,pillarKey:X(e.pillarKey)||void 0,pillarTitle:X(e.pillarTitle)||void 0,format:s?{name:X(s.name),value:X(s.value)}:void 0,brief:X(e.brief)||void 0}}function ro(t){return{title:t.title,slug:"",excerpt:"",date:t.now.toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[],status:"draft",planning:t.planning??{}}}function ut(t,e){return{name:t,[es.posts]:e}}function hd(t,e){return io(t)?ut(t,e):at(t,"posts",e)}function ni(t){const e=[];for(const[s,o]of Object.entries(t)){if(!io(s))continue;const a=Ie(o);a&&e.push({key:s,payload:dt(a,"posts")})}return e}function oi(t){return[...ni(t).map(({key:s,payload:o})=>({key:s,title:X(o.title)||"Untitled post",slug:X(o.slug),date:X(o.date),scheduledDatetime:X(o.scheduledDatetime),categorySlugs:Ze(o.categories).map(st).filter(Boolean),authorEmails:Ze(o.authors).map(no).filter(Boolean),missing:_s(o),status:Et(o),form:"planning"})),...ao(t)]}function ai(t,e,s){const o=Mt(t.payload,e,s),a=Ct(t.key),l=e==="scheduled"||e==="published"?"live":"planning",i=l==="live"?ti(a):Vt(a),c=l==="live"?at(i,"posts",o):ut(i,o);return{writes:{[i]:c},deletes:i===t.key?[]:[t.key]}}function gd(t,e,s){const o=Ze(t.categories);if(!o.some(c=>st(c)===e))return t;const a=o.map(c=>{const r=st(c);return r===e||r===s.slug?{name:s.name,slug:s.slug}:c}),l=new Set,i=a.filter(c=>{const r=st(c);return r?l.has(r)?!1:(l.add(r),!0):!0});return{...t,categories:i}}function li(t,e){const s=Ze(t.categories);return s.some(o=>st(o)===e)?{...t,categories:s.filter(o=>st(o)!==e)}:t}function ii(t){const e=X(t.status),s=e==="idea"||e==="in_review"?{status:Et(t)}:{};return{...t,...s,dateModified:new Date().toISOString()}}function gt(t){const e=new Uint8Array(Math.ceil(t/2));return crypto.getRandomValues(e),Array.from(e,s=>s.toString(16).padStart(2,"0")).join("").slice(0,t)}function hs(t,e){const s=`collections/blog/${e}/${gt(12)}`;if(!Object.hasOwn(t,s))return s;throw new Error("Could not generate a unique blog block key")}function co(t){switch(t){case"posts":return{title:"Untitled post",excerpt:"",slug:`untitled-${gt(8)}`,date:new Date().toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[]};case"authors":return{name:"New author",type:"Person",email:"",jobTitle:"",company:"",url:"",avatar:""};case"categories":return{name:"New category",slug:`category-${gt(8)}`,description:"",sections:[]};default:{const e=t;throw new Error(`Unhandled blog kind: ${String(e)}`)}}}const ri={Paragraph:{title:"Paragraph",description:"Rich text content",iconName:"Pilcrow01"},Heading:{title:"Heading",description:"Section title (H1–H6)",iconName:"HeadingSquare"},Quote:{title:"Quote",description:"Pull quote",iconName:"MessageTextSquare02"},Code:{title:"Code",description:"Code block with syntax highlighting",iconName:"Code02"},List:{title:"List",description:"Bulleted or numbered list",iconName:"List"},BlockImage:{title:"Image",description:"Image with optional caption",iconName:"Image01"},Video:{title:"Video",description:"Embedded video",iconName:"PlayCircle"},Divider:{title:"Divider",description:"Horizontal divider",iconName:"Divider"},Cta:{title:"Call to action",description:"Button linking to a URL",iconName:"CursorClick01"},Callout:{title:"Callout",description:"Highlighted note, tip or warning",iconName:"Lightbulb02"},Stat:{title:"Stat",description:"Single key metric",iconName:"BarChartSquareUp"},StatGroup:{title:"Stat group",description:"Row of metrics",iconName:"BarChartSquare02"},CardGroup:{title:"Card group",description:"Grid of cards",iconName:"LayoutGrid01"},Checklist:{title:"Checklist",description:"List of check items",iconName:"CheckSquare"},Steps:{title:"Steps",description:"Step-by-step guide",iconName:"LayersThree01"},Comparison:{title:"Comparison",description:"Side-by-side comparison",iconName:"Columns03"},Table:{title:"Table",description:"Rows and columns of structured data",iconName:"Table"},ProductCard:{title:"Product card",description:"Single product",iconName:"Tag01"},ProductShelf:{title:"Product shelf",description:"Row of products",iconName:"ShoppingBag01"}},en="Box";function ci(t){return t.startsWith("site/")?"site":"app"}function di(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||t.startsWith("/")}function vt(...t){for(const e of t)if(e!==void 0)return e}function tn(t){if(t&&!(t.includes("/")||/\.(tsx?|jsx?)$/.test(t)))return t}function ui(t){const e=t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").trim();return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():t}function uo(t){const e=new Set,s=[],o=t.manifest?.blocks??{};for(const a of Object.values(o))for(const l of Object.keys(a)){if(!fi(l)||e.has(l))continue;e.add(l);const i=Cs(l,t),c=ts(l),r=ri[c],d=ci(l),p=tn(i.title),m=tn(i.description),h=(d==="site"?vt(p,r?.title):vt(r?.title,p))??ui(c),u=d==="site"?vt(m,r?.description):vt(r?.description,m),f=d==="site"?i.icon:void 0,x=f&&di(f)?f:void 0,g=x!==void 0?r?.iconName??en:vt(f,r?.iconName)??en;s.push({resolveType:l,title:h,description:u,iconName:g,iconUrl:x,source:d})}return s.sort((a,l)=>a.title.localeCompare(l.title))}function ts(t){return(t.split("/").pop()??t).replace(/\.(tsx?|jsx?)$/,"")}const mi=["blog/sections/blocks/","site/sections/Blog/Post/"];function fi(t){return mi.some(e=>t.startsWith(e))}const As="blog-manager-brand";function Ke(t){if(!Array.isArray(t))return[];const e=[];for(const s of t){if(typeof s=="string"){s.trim()&&e.push({name:s,value:""});continue}const o=Ie(s);o&&e.push({name:X(o.name),value:X(o.value)})}return e}function Me(t){return t.filter(e=>e.name.trim()||e.value.trim())}const pi=6e4,hi=4e3;function gi(t){const e=[],s=new Set,o=(a,l)=>{if(typeof a=="string"){if(!a.includes(" ")||a.length<4||/^(https?:)?\/\//.test(a)||/^data:/.test(a))return;const i=`${l}: ${a.trim()}`;if(s.has(i))return;s.add(i),e.push(i);return}if(Array.isArray(a)){for(const i of a)o(i,l);return}if(a&&typeof a=="object")for(const[i,c]of Object.entries(a))i!=="__resolveType"&&o(c,i)};return o(t,"block"),e.join(`
|
|
3
3
|
`)}function xd(t,e){const s=new Map,o=d=>{const p=s.get(d);if(p!==void 0)return p;const m=gi(t[d]).slice(0,hi);return s.set(d,m),m},a=(d,p)=>o(p).length-o(d).length,l=[...Ue(t,"posts").map(d=>d.key).sort(a),...Ue(t,"categories").map(d=>d.key),...[...e].sort(a)],i=[],c=new Set;let r=pi;for(const d of l){if(i.length>=Jl)break;if(c.has(d)||!t[d])continue;c.add(d);const p=o(d);if(p.length>r)break;i.push({key:d,content:p}),r-=p.length}return i}const mo="blog-manager/themes/";function xi(){return`${mo}${crypto.randomUUID()}`}function bi(t,e){return{name:t,title:e.title,body:e.body,pillarKey:e.pillarKey??"",createdAt:e.createdAt}}function fo(t){const e=[];for(const[s,o]of Object.entries(t)){if(!s.startsWith(mo))continue;const a=Ie(o);a&&e.push({key:s,title:X(a.title),body:X(a.body),pillarKey:X(a.pillarKey)||void 0,createdAt:X(a.createdAt)})}return e.sort((s,o)=>o.createdAt.localeCompare(s.createdAt)||s.title.localeCompare(o.title))}const po="blog-manager/pillars/";function bd(){return`${po}${crypto.randomUUID()}`}function ho(t){const e=[];for(const[s,o]of Object.entries(t)){if(!s.startsWith(po))continue;const a=Ie(o);a&&e.push({key:s,title:X(a.title),body:X(a.body),createdAt:X(a.createdAt),formats:Ze(a.formats).map(l=>X(l)).filter(Boolean)})}return e.sort((s,o)=>o.createdAt.localeCompare(s.createdAt)||s.title.localeCompare(o.title))}const go="blog-manager-formats",yi=40;function yd(t){return Ue(t,"posts").slice(0,yi).map(({key:e,payload:s})=>({key:e,title:X(s.title),sections:Ze(s.sections).map(o=>X(Ie(o)?.__resolveType)).filter(Boolean).map(ts)}))}function vi(t){const e=new Map;for(const s of uo(t)){const o=ts(s.resolveType);e.has(o)||e.set(o,{name:o,title:s.title,description:s.description})}return[...e.values()]}function ji(t){const e=new Set;for(const s of t.matchAll(/(?:^|[\s([{>])@([A-Za-z][\w-]*)/g))s[1]&&e.add(s[1]);return[...e]}function vd(t,e){const s=new Set(e);return ji(t).filter(o=>!s.has(o))}const ki=["Heading","Paragraph","BlockImage","List","Cta"];function jd(t){const e=new Set(t);return ki.filter(s=>e.has(s))}function sn(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/\s+/g," ").trim()}function Si(t,e){const s=new Set(t.map(sn)),o=[];for(const a of e){const l=sn(a.title);!l||s.has(l)||(s.add(l),o.push(a))}return o}const wi=["companyName","language","description","tone","targetAudience"];function Ni(t){const e=Ie(t)??{},s=[];for(const o of wi)X(e[o]).trim()||s.push(o);return Me(Ke(e.dos)).length===0&&s.push("dos"),Me(Ke(e.avoid)).length===0&&s.push("avoid"),s}function xo(t){const e={};for(const s of uo(t)){const o=ts(s.resolveType);o in e||(e[o]=s.resolveType)}return e}function Ci(t,e){const s=[];for(const o of t){const a=e[o.type];if(a)switch(o.type){case"Heading":s.push({__resolveType:a,text:X(o.text),level:o.level??"2"});break;case"Paragraph":s.push({__resolveType:a,html:X(o.html)});break;case"List":s.push({__resolveType:a,items:(o.items??[]).join(`
|
|
4
4
|
`),style:o.style??"unordered"});break;case"Quote":s.push({__resolveType:a,quote:X(o.quote)});break;case"Callout":s.push({__resolveType:a,title:X(o.title),body:X(o.body),variant:o.variant??"info"});break;case"Cta":s.push({__resolveType:a,text:X(o.text),href:X(o.href)});break;case"Divider":s.push({__resolveType:a});break}}return s}const $s=80;function bo(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,$s)}function kd(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+/,"").slice(0,$s)}function nn(t,e){const s=$s-e.length-1;return`${t.slice(0,s).replace(/-+$/,"")}-${e}`}function yo(t,e){const s=bo(t)||`post-${gt(6)}`,o=new Set(e);if(!o.has(s))return s;for(let a=2;a<100;a++){const l=nn(s,String(a));if(!o.has(l))return l}return nn(s,gt(4))}function Pi({draft:t,resolveTypes:e,categories:s,authors:o,planning:a,takenSlugs:l,now:i}){const c=new Set(t.categorySlugs),r=new Set(t.authorEmails),d={title:t.title,slug:yo(t.title,l),date:i.toISOString().slice(0,10),excerpt:t.excerpt,image:"",alt:"",authors:o.filter(p=>r.has(p.email)),categories:s.filter(p=>c.has(p.slug)),seo:{title:t.seo.title,description:t.seo.description,image:""},sections:Ci(t.sections,e),planning:a??{}};return Mt(d,"awaiting_review",i)}const Sd=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wd=["January","February","March","April","May","June","July","August","September","October","November","December"],vo=1440*60*1e3;function mt(t){const e=new Date(t);return e.setHours(0,0,0,0),e}function Nd(t){return new Date(t.getFullYear(),t.getMonth(),1)}function Cd(t,e){return new Date(t.getFullYear(),t.getMonth()+e,1)}function Gt(t,e){const s=new Date(t);return s.setDate(s.getDate()+e),s}function ys(t,e){return Math.round((mt(t).getTime()-mt(e).getTime())/vo)}function Ti(t){const e=(t.getTime()-mt(t).getTime())/vo;return Math.min(Math.max(e,0),1)}function on(t,e){return ys(t,e)+Ti(t)}function Pd(t){const e=Gt(t,-t.getDay()),s=[];for(let o=0;o<6;o++){const a=[];for(let l=0;l<7;l++)a.push(Gt(e,o*7+l));s.push(a)}for(;s.length>0&&s[s.length-1].every(o=>o.getMonth()!==t.getMonth());)s.pop();return s}function Td(t,e){const s=mt(t[0]),o=Gt(s,7),a=s.getTime(),l=o.getTime(),i=[];for(const d of e){const p=mt(d.start),m=mt(d.end);if(m.getTime()<s.getTime()||p.getTime()>=o.getTime())continue;const h=p.getTime()<s.getTime()?s:p,u=m.getTime()>=o.getTime()?Gt(o,-1):m,f=ys(h,s),x=ys(u,h)+1;if(x<=0)continue;const g=Math.max(d.start.getTime(),a),v=Math.min(d.end.getTime(),l),y=on(new Date(g),s),j=Math.max(on(new Date(v),s)-y,0);j<=0||i.push({variant:d,startCol:f,span:x,leftUnits:y,widthUnits:j})}i.sort((d,p)=>d.startCol-p.startCol||p.span-d.span||d.variant.blockKey.localeCompare(p.variant.blockKey));const c=[],r=[];for(const d of i){let p=c.findIndex(m=>m<=d.startCol);p===-1&&(p=c.length,c.push(0)),c[p]=d.startCol+d.span,r.push({...d,lane:p})}return r}function Ut(t){const e=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0");return`${t.getFullYear()}-${e}-${s}`}const jo=/^(\d{4})-(\d{2})-(\d{2})$/;function Ht(t){const e=t.trim();if(!e)return null;const s=jo.exec(e);if(s){const a=Number(s[1]),l=Number(s[2])-1,i=Number(s[3]),c=new Date(a,l,i);return c.getMonth()===l&&c.getDate()===i?c:null}const o=new Date(e);return Number.isNaN(o.getTime())?null:mt(o)}function Bi(t){const e=new Date(t.getFullYear(),t.getMonth(),t.getDate(),oo);return{...co("posts"),status:"scheduled",scheduledDatetime:e.toISOString(),date:Ut(t)}}function Ei(t){if(typeof t!="string")return null;const e=t.trim();if(!e)return null;if(jo.test(e))return Ht(e);const s=new Date(e);return Number.isNaN(s.getTime())?null:s}function _i(t,e){const s=Ei(t.scheduledDatetime);if(!s)return null;const o=new Date(e.getFullYear(),e.getMonth(),e.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()),a={...t,scheduledDatetime:o.toISOString()};return(typeof t.date=="string"?t.date:"")===Ut(s)&&(a.date=Ut(o)),a}function Di(t){return Ht(t.scheduledDatetime)??Ht(t.date)}function Bd(t){const e=new Map,s=[];for(const a of t){const l={post:a,scheduled:Ht(a.scheduledDatetime)!==null},i=Di(a);if(!i){s.push(l);continue}const c=Ut(i),r=e.get(c);r?r.push(l):e.set(c,[l])}const o=(a,l)=>Number(l.scheduled)-Number(a.scheduled)||a.post.title.localeCompare(l.post.title);for(const a of e.values())a.sort(o);return s.sort(o),{byDay:e,undated:s}}const Ai="0.161.0",$i="0.162.0",an="7.53.0",Li="@decocms/apps-blog";function ln(t){const e=/^v?(\d+)\.(\d+)\.(\d+)$/.exec(t.trim());return e?[Number(e[1]),Number(e[2]),Number(e[3])]:null}function rn(t,e){const s=ln(t),o=ln(e);if(!s||!o)return 0;for(let a=0;a<3;a++){const l=s[a]-o[a];if(l!==0)return l}return 0}const ko=/deco-cx\/apps@v?(\d+\.\d+\.\d+)/;function Oi(t){const e=t?.imports;if(!e||typeof e!="object")return null;for(const s of Object.values(e)){if(typeof s!="string")continue;const o=ko.exec(s)?.[1];if(o)return o}return null}function Ii(t){const e=t?.schema?.definitions;if(!e||typeof e!="object")return null;for(const s of Object.values(e)){const o=s?.title;if(typeof o!="string")continue;const a=ko.exec(o)?.[1];if(a)return a}return null}function Ri(t){return vs(t?.schema?.definitions,"scheduledDatetime")}function vs(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t))return t.some(o=>vs(o,e));const s=t.properties;return s&&typeof s=="object"&&e in s?!0:Object.values(t).some(o=>vs(o,e))}function Fi(t){const e=t;for(const s of[e?.dependencies,e?.devDependencies]){if(!s||typeof s!="object")continue;const o=s[Li];if(typeof o=="string")return o}return null}function Ki(t){const e=/^[\^~]?v?(\d+\.\d+\.\d+)$/.exec(t.trim());return e?e[1]:null}function zi(t){const e=t?.packageManager,s=typeof e=="string"?e.split("@")[0]?.trim():null;return s==="pnpm"||s==="yarn"||s==="bun"?s:"npm"}function So(t){return t==="deno"?[Ai,$i]:[an,an]}function cn(t,e){const[s,o]=So(t);return!e||rn(e,s)<0?{kind:"outdated",packageManager:t,version:e}:rn(e,o)<0?{kind:"publish-only",packageManager:t,version:e}:{kind:"full",version:e}}function Mi(t){const e=Ii(t.meta);if(t.denoJson.kind==="data"||e){const o=t.denoJson.kind==="data"?Oi(t.denoJson.data):null;return cn("deno",o??e)}if(t.packageJson.kind==="data"){const o=Fi(t.packageJson.data);return o===null?{kind:"unsupported-runtime"}:cn(zi(t.packageJson.data),Ki(o))}return Ri(t.meta)?{kind:"full",version:null}:t.denoJson.kind==="unavailable"||t.packageJson.kind==="unavailable"?{kind:"unknown"}:{kind:"unsupported-runtime"}}function Vi(t){return t==="deno"?"deno task update":`npx npm-check-updates -u "@decocms/*" && ${t} install`}function Gi(t){return t.kind==="publish-only"||t.kind==="full"}function Ed(t){return t.kind==="full"}function wo(t,e){if(t.kind==="full"||e!=="scheduled"&&e!=="published"||e==="published"&&Gi(t))return null;if(t.kind==="unknown")return{reason:"unknown"};if(t.kind==="unsupported-runtime")return{reason:"no-app"};const[s,o]=So(t.packageManager);return{reason:"outdated",required:e==="scheduled"?o:s,version:t.version,command:Vi(t.packageManager)}}const dn={kind:"unavailable"};function Ui(t){const e=ae.c(26),s=Fn(t.virtualMcpId),o=Bt()?.taskId??null;let a;e[0]!==s||e[1]!==t||e[2]!==o?(a=v=>({queryFn:()=>ua({...t,threadId:o},xs(s,v)),staleTime:3e5}),e[0]=s,e[1]=t,e[2]=o,e[3]=a):a=e[3];const l=a;let i;e[4]!==t.branch||e[5]!==t.orgSlug||e[6]!==t.virtualMcpId?(i=Pt.denoJson(t.orgSlug,t.virtualMcpId,t.branch),e[4]=t.branch,e[5]=t.orgSlug,e[6]=t.virtualMcpId,e[7]=i):i=e[7];let c;e[8]!==l?(c=l("deno.json"),e[8]=l,e[9]=c):c=e[9];let r;e[10]!==i||e[11]!==c?(r={queryKey:i,...c},e[10]=i,e[11]=c,e[12]=r):r=e[12];const{data:d}=gs(r);let p;e[13]!==t.branch||e[14]!==t.orgSlug||e[15]!==t.virtualMcpId?(p=Pt.packageJson(t.orgSlug,t.virtualMcpId,t.branch),e[13]=t.branch,e[14]=t.orgSlug,e[15]=t.virtualMcpId,e[16]=p):p=e[16];let m;e[17]!==l?(m=l("package.json"),e[17]=l,e[18]=m):m=e[18];let h;e[19]!==p||e[20]!==m?(h={queryKey:p,...m},e[19]=p,e[20]=m,e[21]=h):h=e[21];const{data:u}=gs(h),f=d??dn,x=u??dn;let g;return e[22]!==t.meta||e[23]!==f||e[24]!==x?(g=Mi({denoJson:f,packageJson:x,meta:t.meta}),e[22]=t.meta,e[23]=f,e[24]=x,e[25]=g):g=e[25],g}function Hi(t){const e=ae.c(37),{orgSlug:s,virtualMcpId:o,branch:a}=t,l=_o(),i=Bt()?.taskId??null,c=Fn(o),r=qn(o).runtime==="cms";let d;e[0]!==a||e[1]!==s||e[2]!==o?(d=Pt.decofile(`${s}/${o}/${a}`),e[0]=a,e[1]=s,e[2]=o,e[3]=d):d=e[3];const p=d;let m;e[4]!==a||e[5]!==s||e[6]!==o?(m=Ia(s,o,a),e[4]=a,e[5]=s,e[6]=o,e[7]=m):m=e[7];let h;e[8]!==a||e[9]!==s||e[10]!==o?(h=Oa(s,o,a),e[8]=a,e[9]=s,e[10]=o,e[11]=h):h=e[11];let u;e[12]!==a||e[13]!==r||e[14]!==s||e[15]!==c||e[16]!==l||e[17]!==i||e[18]!==o?(u=async w=>{const{writes:N,deletes:E}=w,B=ma(N);if(r){const D=await Ra({orgSlug:s,virtualMcpId:o,branch:a},{set:B,delete:E});return Fa(l,{orgSlug:s,virtualMcpId:o,branch:a},D),await l.invalidateQueries({queryKey:ll({orgSlug:s,virtualMcpId:o,branch:a,threadId:i})}),D}const k={orgSlug:s,virtualMcpId:o,branch:a,threadId:i};for(const[D,O]of Object.entries(B)){const L=await fetch(qs(k,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:xs(c,Js(D)),content:JSON.stringify(O,null,2)})});if(!L.ok)return Gs(L,"Write")}for(const D of E){const O=await fetch(qs(k,"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:xs(c,Js(D))})});if(!O.ok)return Gs(O,"Delete")}return{ok:!0}},e[12]=a,e[13]=r,e[14]=s,e[15]=c,e[16]=l,e[17]=i,e[18]=o,e[19]=u):u=e[19];let f;e[20]!==a||e[21]!==s||e[22]!==l||e[23]!==o?(f=()=>{l.invalidateQueries({queryKey:Pt.liveMeta(s,o,a)})},e[20]=a,e[21]=s,e[22]=l,e[23]=o,e[24]=f):f=e[24];let x;e[25]!==m||e[26]!==h||e[27]!==u||e[28]!==f?(x={mutationKey:m,scope:h,mutationFn:u,onSuccess:f},e[25]=m,e[26]=h,e[27]=u,e[28]=f,e[29]=x):x=e[29];const g=Do(x);let v;e[30]!==g||e[31]!==l||e[32]!==p?(v=async w=>{const N=[...Object.keys(w.writes),...w.deletes],E=l.getQueryData(p),B=new Map;for(const k of N)E&&k in E&&B.set(k,E[k]);l.setQueryData(p,k=>qi(k,w)),l.cancelQueries({queryKey:p});try{return await g.mutateAsync(w)}catch(k){const D=k;throw l.setQueryData(p,O=>{if(!O)return O;const L={...O};for(const K of N)B.has(K)?L[K]=B.get(K):delete L[K];return L}),D}},e[30]=g,e[31]=l,e[32]=p,e[33]=v):v=e[33];const y=v;let j;return e[34]!==y||e[35]!==g.isPending?(j={move:y,isPending:g.isPending},e[34]=y,e[35]=g.isPending,e[36]=j):j=e[36],j}function qi(t,{writes:e,deletes:s}){const o={...t??{},...e};for(const a of s)a in e||delete o[a];return o}const qt={draft:"sandbox.postBoard.laneDraft",generating:"sandbox.postBoard.laneGenerating",awaiting_review:"sandbox.postBoard.laneAwaitingReview",scheduled:"sandbox.postBoard.laneScheduled",published:"sandbox.postBoard.lanePublished",archived:"sandbox.postBoard.laneArchived"};function No(t,e){switch(e.reason){case"unknown":return t("sandbox.postBoard.moveUnknownApp");case"no-app":return t("sandbox.postBoard.moveNoBlogApp");case"outdated":return t("sandbox.postBoard.moveUnsupported",{required:e.required,command:e.command})}}function Ji({orgSlug:t,virtualMcpId:e,branch:s,decofile:o,support:a,onMoved:l}){const i=Se(),c=Hi({orgSlug:t,virtualMcpId:e,branch:s}),[r,d]=$.useState(new Set),p=f=>dt(o[f],"posts"),m=(f,x,g=p(f))=>{if(x==="generating")return{kind:"not-a-target"};if(r.has(Ct(f)))return{kind:"in-flight"};const v=wo(a,x);return v?{kind:"unsupported",...v}:Zl(g,x)?{kind:"incomplete"}:null},h=f=>{switch(f.kind){case"unsupported":return No(i,f);case"incomplete":return i("sandbox.postBoard.moveBlocked");case"in-flight":return i("sandbox.postBoard.moveInFlight");case"not-a-target":return i("sandbox.postBoard.moveNotATarget");default:return String(f)}};return{apply:async(f,x,g)=>{const v=g??p(f);if(Et(v)===x)return null;const y=m(f,x,v);if(y)return y.kind!=="in-flight"&&me.error(h(y)),null;const j=Ct(f);d(E=>new Set(E).add(j));const w=ai({key:f,payload:v},x,new Date),N=Object.keys(w.writes)[0]??f;N!==f&&l?.(f,N);try{return await c.move(w),N}catch(E){return N!==f&&l?.(N,f),me.error(E instanceof Error?E.message:i("sandbox.postBoard.moveFailed")),null}finally{d(E=>{const B=new Set(E);return B.delete(j),B})}},refuse:m,reasonText:h,isMoving:f=>r.has(Ct(f))}}function Wi(t){const e=ae.c(14),{value:s,onChange:o,placeholder:a,className:l,onFocus:i,onBlur:c,onKeyDown:r,spellCheck:d,inputRef:p}=t,m=d===void 0?!0:d;let h;e[0]!==o?(h=x=>o(x.target.value),e[0]=o,e[1]=h):h=e[1];let u;e[2]!==l?(u=be("w-full resize-none border-0 bg-transparent p-0 outline-none [field-sizing:content] placeholder:text-muted-foreground/50 focus:ring-0",l),e[2]=l,e[3]=u):u=e[3];let f;return e[4]!==p||e[5]!==c||e[6]!==i||e[7]!==r||e[8]!==a||e[9]!==m||e[10]!==h||e[11]!==u||e[12]!==s?(f=n.jsx("textarea",{ref:p,value:s,onChange:h,onInput:Yi,onFocus:i,onBlur:c,onKeyDown:r,placeholder:a,spellCheck:m,rows:1,className:u}),e[4]=p,e[5]=c,e[6]=i,e[7]=r,e[8]=a,e[9]=m,e[10]=h,e[11]=u,e[12]=s,e[13]=f):f=e[13],f}function Yi(t){const e=t.currentTarget;e.style.height="auto",e.style.height=`${e.scrollHeight}px`}function ke(t){return typeof t=="string"?t:""}function _d(t){const e=ae.c(11);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=be(s,"pr-9"),e[3]=s,e[4]=a):a=e[4];let l;e[5]!==o||e[6]!==a?(l=n.jsx(Wi,{...o,className:a}),e[5]=o,e[6]=a,e[7]=l):l=e[7];let i;e[8]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Go,{size:18,"aria-hidden":!0,className:"pointer-events-none absolute right-2 top-3 text-muted-foreground/40 transition-opacity group-hover/editable:text-muted-foreground group-focus-within/editable:text-muted-foreground"}),e[8]=i):i=e[8];let c;return e[9]!==l?(c=n.jsxs("div",{className:"group/editable relative -mx-2 rounded-md px-2 transition-colors hover:bg-muted/50 focus-within:bg-muted/50",children:[l,i]}),e[9]=l,e[10]=c):c=e[10],c}function Dd(t){const e=ae.c(5),{label:s,onClick:o,disabled:a}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(ws,{size:13}),e[0]=l):l=e[0];let i;return e[1]!==a||e[2]!==s||e[3]!==o?(i=n.jsxs("button",{type:"button",onClick:o,disabled:a,className:"flex items-center gap-1.5 rounded-lg border border-dashed px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground disabled:opacity-40 disabled:hover:border-dashed disabled:hover:text-muted-foreground cursor-pointer",children:[l,s]}),e[1]=a,e[2]=s,e[3]=o,e[4]=i):i=e[4],i}function Ad(t){const e=ae.c(4),{label:s,onClick:o}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ts,{size:13}),e[0]=a):a=e[0];let l;return e[1]!==s||e[2]!==o?(l=n.jsx("button",{type:"button","aria-label":s,onClick:o,className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground/60 opacity-0 transition-opacity hover:text-destructive group-hover/item:opacity-100 cursor-pointer rounded-lg",children:a}),e[1]=s,e[2]=o,e[3]=l):l=e[3],l}function $d(t){const e=ae.c(2),{children:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"absolute -top-9 left-0 z-10 flex items-center gap-0.5 rounded-md border bg-popover p-0.5 shadow-md",children:s}),e[0]=s,e[1]=o):o=e[1],o}function Ld(t){const e=ae.c(8),{active:s,label:o,onClick:a,children:l}=t,i=s?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let c;e[0]!==i?(c=be("flex h-7 min-w-7 items-center justify-center px-1.5 text-sm transition-colors cursor-pointer rounded-lg",i),e[0]=i,e[1]=c):c=e[1];let r;return e[2]!==s||e[3]!==l||e[4]!==o||e[5]!==a||e[6]!==c?(r=n.jsx("button",{type:"button","aria-label":o,"aria-pressed":s,onMouseDown:Qi,onClick:a,className:c,children:l}),e[2]=s,e[3]=l,e[4]=o,e[5]=a,e[6]=c,e[7]=r):r=e[7],r}function Qi(t){return t.preventDefault()}function Od(t){if(Array.isArray(t))return t;if(typeof t!="string"||t.trim()==="")return[];try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}function kt(t){const e=ae.c(14),{options:s,value:o,emptyLabel:a,onChange:l}=t;let i;e[0]!==a||e[1]!==l||e[2]!==o?(i=a&&n.jsx(un,{active:!o,onClick:()=>l(""),children:a}),e[0]=a,e[1]=l,e[2]=o,e[3]=i):i=e[3];let c;if(e[4]!==l||e[5]!==s||e[6]!==o){let d;e[8]!==l||e[9]!==o?(d=p=>n.jsx(un,{active:p===o,onClick:()=>l(p),children:p},p),e[8]=l,e[9]=o,e[10]=d):d=e[10],c=s.filter(Boolean).map(d),e[4]=l,e[5]=s,e[6]=o,e[7]=c}else c=e[7];let r;return e[11]!==i||e[12]!==c?(r=n.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i,c]}),e[11]=i,e[12]=c,e[13]=r):r=e[13],r}function un(t){const e=ae.c(7),{active:s,onClick:o,children:a}=t,l=s?"border-primary bg-primary text-primary-foreground":"bg-card hover:bg-muted";let i;e[0]!==l?(i=be("cursor-pointer rounded-md border px-2.5 py-1 text-xs font-medium transition-colors",l),e[0]=l,e[1]=i):i=e[1];let c;return e[2]!==s||e[3]!==a||e[4]!==o||e[5]!==i?(c=n.jsx("button",{type:"button","aria-pressed":s,onClick:o,className:i,children:a}),e[2]=s,e[3]=a,e[4]=o,e[5]=i,e[6]=c):c=e[6],c}function Id(t,e=[]){return typeof t=="string"?t:JSON.stringify(t??e)}const mn=[{id:"idea",label:"sandbox.generatePost.stepIdea"},{id:"format",label:"sandbox.generatePost.stepFormat"},{id:"extra",label:"sandbox.generatePost.stepExtra"}],Xi={companyName:"sandbox.blogBrand.companyNameLabel",language:"sandbox.blogBrand.languageLabel",description:"sandbox.blogBrand.descriptionLabel",tone:"sandbox.blogBrand.toneLabel",targetAudience:"sandbox.blogBrand.audienceLabel",dos:"sandbox.blogBrand.tabDos",avoid:"sandbox.blogBrand.tabGuardrails"};function Zi({open:t,onOpenChange:e,decofile:s,hasAi:o,seed:a,onGenerate:l}){const i=Se(),c=js(),[r,d]=$.useState(a?"format":"idea"),[p,m]=$.useState(a?.key??""),[h,u]=$.useState(a?.title??""),[f,x]=$.useState(a?.body??""),[g,v]=$.useState([]),[y,j]=$.useState(""),[w,N]=$.useState(""),[E,B]=$.useState(""),[k,D]=$.useState(""),[O,L]=$.useState(""),[K,F]=$.useState(!1),_=s[As],A=Ni(_),I={companyName:ke(_?.companyName),description:ke(_?.description),language:ke(_?.language),tone:ke(_?.tone),targetAudience:ke(_?.targetAudience),values:Me(Ke(_?.values)),dos:Me(Ke(_?.dos)),avoid:Me(Ke(_?.avoid))},R=fo(s),G=R.find(T=>T.key===p),z=ho(s).find(T=>T.key===G?.pillarKey),W=s[go],P=Me(Ke(W?.formats)),U=Ue(s,"categories").map(({payload:T})=>({name:ke(T.name),slug:ke(T.slug)})).filter(T=>T.slug),Y=so(s),q=()=>{d(a?"format":"idea"),m(a?.key??""),u(a?.title??""),x(a?.body??""),v([]),j(""),N(""),B(""),D(""),L("")},Z=T=>{e(T),T||q()},de=async()=>{F(!0);try{const T=await c.call("BLOG_THEME_SUGGEST",{brand:I,existingTitles:[],formats:P.map(J=>J.name).filter(Boolean),guidance:z?`Every idea must be one angle inside the pillar "${z.title}": ${z.body}`:void 0,count:4});v(T.themes)}catch(T){me.error(T instanceof Error?T.message:i("sandbox.generatePost.suggestFailed"))}finally{F(!1)}},ne=a?mn.filter(T=>T.id!=="idea"):mn,ue=ne.findIndex(T=>T.id===r),te=r==="idea"?h.trim().length>0:r==="format"?y.trim().length>0&&w.trim().length>0:!0,re=r==="extra",le=()=>{l({idea:{key:p||void 0,title:h.trim(),body:f.trim()},pillar:z?{key:z.key,title:z.title,body:z.body}:void 0,format:{name:y.trim(),value:w.trim()},category:U.find(T=>T.slug===E),author:Y.find(T=>T.email===k),extraInstructions:O.trim()||void 0}),Z(!1)};return n.jsx(ct,{open:t,onOpenChange:Z,children:n.jsxs(rt,{className:"flex max-h-[85vh] flex-col sm:max-w-2xl",children:[n.jsxs(pt,{children:[n.jsx(it,{children:i("sandbox.generatePost.title")}),n.jsx(zt,{children:i("sandbox.generatePost.subtitle")})]}),A.length>0?n.jsx("p",{className:"text-sm text-muted-foreground",children:i("sandbox.generatePost.blockedBrand",{fields:A.map(T=>i(Xi[T])).join(", ")})}):n.jsxs(n.Fragment,{children:[n.jsx("ol",{className:"flex shrink-0 items-center gap-1.5 text-xs",children:ne.map((T,J)=>n.jsx("li",{className:be("rounded-md px-2 py-1",J===ue?"bg-primary text-primary-foreground":J<ue?"text-foreground":"text-muted-foreground"),children:i(T.label)},T.id))}),n.jsxs("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto py-1",children:[r==="idea"&&n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"text-xs text-muted-foreground",children:z?i("sandbox.generatePost.ideaHintInPillar",{pillar:z.title}):i("sandbox.generatePost.ideaHint")}),R.length>0&&n.jsx(kt,{options:R.map(T=>T.title).filter(Boolean),value:G?.title??"",emptyLabel:i("sandbox.generatePost.writeAnIdea"),onChange:T=>{const J=R.find(ee=>ee.title===T);m(J?.key??""),u(J?.title??""),x(J?.body??"")}}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ze,{htmlFor:"generate-idea-title",children:i("sandbox.generatePost.ideaTitleLabel")}),n.jsx(Xe,{id:"generate-idea-title",value:h,onChange:T=>{m(""),u(T.target.value)},placeholder:i("sandbox.generatePost.ideaTitlePlaceholder")})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ze,{htmlFor:"generate-idea-body",children:i("sandbox.generatePost.ideaBodyLabel")}),n.jsx(Ot,{id:"generate-idea-body",value:f,onChange:T=>x(T.target.value),placeholder:i("sandbox.generatePost.ideaBodyPlaceholder"),rows:3})]}),n.jsx(er,{label:i("sandbox.generatePost.suggestIdeas"),hint:i("sandbox.generatePost.suggestIdeasHint"),disabled:!o||K,busy:K,onSuggest:de}),n.jsx(tr,{suggestions:g,onPick:T=>{u(T.title),x(T.body)}})]}),r==="format"&&n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.formatHint")}),n.jsx(kt,{options:P.map(T=>T.name),value:y,onChange:T=>{j(T),N(P.find(J=>J.name===T)?.value??"")}}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ze,{htmlFor:"generate-format-name",children:i("sandbox.generatePost.formatNameLabel")}),n.jsx(Xe,{id:"generate-format-name",value:y,onChange:T=>j(T.target.value),placeholder:i("sandbox.generatePost.formatNamePlaceholder")})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ze,{htmlFor:"generate-format-value",children:i("sandbox.generatePost.formatValueLabel")}),n.jsx(Ot,{id:"generate-format-value",value:w,onChange:T=>N(T.target.value),placeholder:i("sandbox.generatePost.formatValuePlaceholder"),rows:4})]})]}),r==="extra"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ze,{htmlFor:"generate-category",children:i("sandbox.generatePost.categoryLabel")}),n.jsx(kt,{options:U.map(T=>T.name),value:U.find(T=>T.slug===E)?.name??"",emptyLabel:i("sandbox.generatePost.inferIt"),onChange:T=>B(U.find(J=>J.name===T)?.slug??"")})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ze,{htmlFor:"generate-author",children:i("sandbox.generatePost.authorLabel")}),n.jsx(kt,{options:Y.map(T=>T.name),value:Y.find(T=>T.email===k)?.name??"",emptyLabel:i("sandbox.generatePost.inferIt"),onChange:T=>D(Y.find(J=>J.name===T)?.email??"")})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ze,{htmlFor:"generate-extra",children:i("sandbox.generatePost.extraLabel")}),n.jsx(Ot,{id:"generate-extra",value:O,onChange:T=>L(T.target.value),placeholder:i("sandbox.generatePost.extraPlaceholder"),rows:3})]}),n.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.inferHint")})]})]}),n.jsxs(ht,{className:"shrink-0 sm:justify-between",children:[n.jsx(_e,{type:"button",variant:"outline",disabled:ue===0,onClick:()=>d(ne[ue-1].id),children:i("sandbox.generatePost.back")}),re?n.jsxs(_e,{type:"button",disabled:!o,onClick:le,children:[n.jsx(et,{size:14}),i("sandbox.generatePost.generate")]}):n.jsx(_e,{type:"button",disabled:!te,onClick:()=>d(ne[ue+1].id),children:i("sandbox.generatePost.next")})]})]})]})})}function er(t){const e=ae.c(12),{label:s,hint:o,disabled:a,busy:l,onSuggest:i}=t;let c;e[0]!==o?(c=n.jsx("p",{className:"text-xs text-muted-foreground",children:o}),e[0]=o,e[1]=c):c=e[1];let r;e[2]!==l?(r=l?n.jsx(wt,{size:14,className:"animate-spin"}):n.jsx(et,{size:14}),e[2]=l,e[3]=r):r=e[3];let d;e[4]!==a||e[5]!==s||e[6]!==i||e[7]!==r?(d=n.jsxs(_e,{type:"button",variant:"outline",size:"sm",disabled:a,onClick:i,children:[r,s]}),e[4]=a,e[5]=s,e[6]=i,e[7]=r,e[8]=d):d=e[8];let p;return e[9]!==c||e[10]!==d?(p=n.jsxs("div",{className:"flex items-center justify-between gap-3 border-t pt-3",children:[c,d]}),e[9]=c,e[10]=d,e[11]=p):p=e[11],p}function tr(t){const e=ae.c(7),{suggestions:s,onPick:o}=t;if(s.length===0)return null;let a;if(e[0]!==o||e[1]!==s){let i;e[3]!==o?(i=c=>n.jsx("li",{children:n.jsxs("button",{type:"button",onClick:()=>o(c),className:"w-full cursor-pointer rounded-lg border bg-card p-2.5 text-left transition-colors hover:border-primary/40",children:[n.jsx("p",{className:"text-sm font-medium",children:c.title}),n.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:c.body})]})},c.title),e[3]=o,e[4]=i):i=e[4],a=s.map(i),e[0]=o,e[1]=s,e[2]=a}else a=e[2];let l;return e[5]!==a?(l=n.jsx("ul",{className:"space-y-1.5",children:a}),e[5]=a,e[6]=l):l=e[6],l}const sr=["Heading","Paragraph","List","Quote","Callout","Cta","Divider"];function nr(t){return sr.includes(t)}function or({orgSlug:t,virtualMcpId:e,branch:s,decofile:o,meta:a,onStarted:l}){const i=Se(),c=js(),r=Qt({orgSlug:t,virtualMcpId:e,branch:s});return async d=>{const p=Vt(bs()),m={ideaKey:d.idea.key,pillarKey:d.pillar?.key,pillarTitle:d.pillar?.title,format:d.format,brief:d.idea.body},h=Mt(ro({title:d.idea.title,planning:m,now:new Date}),"generating",new Date);await r.mutateAsync({blockKey:p,data:ut(p,h)}),l?.(p);const u=o[As],f=d.category?[d.category]:Ue(o,"categories").map(({payload:g})=>({name:ke(g.name),slug:ke(g.slug)})).filter(g=>g.slug),x=d.author?[d.author]:so(o);try{const g=await c.call("BLOG_POST_DRAFT",{brand:{companyName:ke(u?.companyName),description:ke(u?.description),language:ke(u?.language),tone:ke(u?.tone),targetAudience:ke(u?.targetAudience),values:Me(Ke(u?.values)),dos:Me(Ke(u?.dos)),avoid:Me(Ke(u?.avoid))},pillar:d.pillar?{title:d.pillar.title,body:d.pillar.body}:void 0,theme:{title:d.idea.title,body:d.idea.body},format:d.format,sections:vi(a).filter(y=>nr(y.name)).map(y=>({type:y.name,purpose:y.description})),categories:f,authors:x.map(({name:y,email:j})=>({name:y,email:j})),extraInstructions:d.extraInstructions?.trim()||void 0}),v=Pi({draft:g,resolveTypes:xo(a),categories:f,authors:x,planning:m,takenSlugs:ao(o).map(y=>y.slug),now:new Date});await r.mutateAsync({blockKey:p,data:ut(p,v)}),me.success(i("sandbox.generatePost.done",{title:g.title}))}catch(g){await r.mutateAsync({blockKey:p,data:ut(p,Mt(h,"draft",new Date))}),me.error(g instanceof Error?g.message:i("sandbox.generatePost.failed"))}}}const ar=/<(h[1-6]|p|ul|ol|div|img|br|blockquote|section|article|figure)\b|<\/[a-z]/i;function Co(t){return ar.test(t)}function lr(t){const e=t.trim();return e?Co(e)?pr(e):gr(e):{title:"",sections:[]}}function Ls(t){return t.replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/�?39;|'/gi,"'").replace(/&/gi,"&")}function jt(t){let e=t,s;do s=e,e=e.replace(/<[^>]+>/g,"");while(e!==s);return Ls(e).replace(/\s+/g," ").trim()}function ir(t){let e=t,s;do s=e,e=e.replace(/<!--[\s\S]*?-->/g,"");while(e!==s);return e}function rr(t){let e=t,s;do s=e,e=e.replace(/<(script|style)\b[\s\S]*?<\/\1\s*>/gi,"");while(e!==s);return e}function Po(t){let e=t,s;do s=e,e=rr(ir(e));while(e!==s);return e}const cr=/^(a|b|strong|i|em|u|s|code|br|span|sub|sup)$/;function Jt(t){let e="";for(const s of t)s.charCodeAt(0)>31&&(e+=s);return e=e.trim(),!/^[a-z][a-z0-9+.-]*:/i.test(e)||/^(https?|mailto|tel):/i.test(e)}function dr(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}const ur=/^<\/?([a-z][a-z0-9]*)\b([^>]*)>/i;function mr(t,e,s){const o=e.toLowerCase();if(!cr.test(o))return"";if(t.startsWith("</"))return`</${o}>`;if(o!=="a")return`<${o}>`;const a=Ls(s.match(/href\s*=\s*"([^"]*)"/i)?.[1]??"");return Jt(a)&&a?`<a href="${dr(a)}">`:"<a>"}function To(t){const e=Po(t);let s="",o=0;for(;o<e.length;){const a=e.indexOf("<",o);if(a===-1){s+=e.slice(o);break}s+=e.slice(o,a);const l=ur.exec(e.slice(a));if(!l){s+="<",o=a+1;continue}s+=mr(l[0],l[1]??"",l[2]??""),o=a+l[0].length}return s}function Dt(t,e){const s=t.match(new RegExp(`${e}\\s*=\\s*"([^"]*)"`,"i"));return s?.[1]?Ls(s[1]):""}const fr=/<(h[1-6]|p|ul|ol|blockquote|figure)\b[^>]*>([\s\S]*?)<\/\1\s*>|<hr\b[^>]*\/?>|<img\b[^>]*>/gi;function pr(t){const e=Po(t);let s="";const o=[];for(const a of e.matchAll(fr)){const l=a[1]?.toLowerCase(),i=a[2]??"",c=a[0];if(!l){if(/^<img/i.test(c)){const r=Dt(c,"src");r&&Jt(r)&&o.push({kind:"image",url:r,alt:Dt(c,"alt"),caption:""})}else o.push({kind:"divider"});continue}if(/^h[1-6]$/.test(l)){const r=jt(i);if(!r)continue;if(l==="h1"&&!s){s=r;continue}o.push({kind:"heading",text:r,level:l.slice(1)})}else if(l==="p"){const r=To(i.trim());jt(r)&&o.push({kind:"paragraph",html:r})}else if(l==="ul"||l==="ol"){const r=[...i.matchAll(/<li\b[^>]*>([\s\S]*?)<\/li\s*>/gi)].map(d=>jt(d[1]??"")).filter(Boolean);r.length&&o.push({kind:"list",items:r,ordered:l==="ol"})}else if(l==="blockquote"){const r=jt(i);r&&o.push({kind:"quote",text:r})}else if(l==="figure"){const r=i.match(/<img\b[^>]*>/i)?.[0],d=r?Dt(r,"src"):"",p=jt(i.match(/<figcaption\b[^>]*>([\s\S]*?)<\/figcaption\s*>/i)?.[1]??"");d&&Jt(d)&&o.push({kind:"image",url:d,alt:r?Dt(r,"alt"):"",caption:p})}}return{title:s,sections:o}}function hr(t){return t.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,'<a href="$2">$1</a>').replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/(^|[^*])\*([^*]+)\*/g,"$1<em>$2</em>").replace(/`([^`]+)`/g,"<code>$1</code>")}function gr(t){const e=t.replace(/\r\n?/g,`
|
|
5
5
|
`).split(`
|
|
6
6
|
`);let s="";const o=[];let a=[],l=null,i=[];const c=()=>{a.length&&(o.push({kind:"paragraph",html:To(hr(a.join(" ")))}),a=[])},r=()=>{l&&(o.push({kind:"list",items:l.items,ordered:l.ordered}),l=null)},d=()=>{i.length&&(o.push({kind:"quote",text:i.join(" ")}),i=[])},p=()=>{c(),r(),d()};for(const m of e){const h=m.trimEnd(),u=h.match(/^(#{1,6})\s+(.*)$/),f=h.match(/^!\[([^\]]*)\]\(([^)\s]+)\)\s*$/),x=h.match(/^\s*(?:[-*+]|\d+\.)\s+(.*)$/),g=/^\s*\d+\./.test(h),v=h.match(/^>\s?(.*)$/);if(!h.trim())p();else if(u){p();const y=u[2]?.trim()??"",j=String(u[1]?.length??1);j==="1"&&!s?s=y:y&&o.push({kind:"heading",text:y,level:j})}else if(/^(-{3,}|\*{3,}|_{3,})$/.test(h.trim()))p(),o.push({kind:"divider"});else if(f){p();const y=f[2]??"";Jt(y)&&o.push({kind:"image",url:y,alt:f[1]??"",caption:""})}else x?(c(),d(),l||(l={items:[],ordered:g}),l.items.push(x[1]?.trim()??"")):v?(c(),r(),i.push(v[1]?.trim()??"")):(r(),d(),a.push(h.trim()))}return p(),{title:s,sections:o}}const xr={heading:"Heading",paragraph:"Paragraph",list:"List",quote:"Quote",divider:"Divider",image:"BlockImage"};function br(t,e){const s=[];for(const o of t){const a=e[xr[o.kind]];if(a)switch(o.kind){case"heading":s.push({__resolveType:a,text:o.text,level:o.level});break;case"paragraph":s.push({__resolveType:a,html:o.html});break;case"list":s.push({__resolveType:a,items:o.items.join(`
|
|
7
7
|
`),style:o.ordered?"ordered":"unordered"});break;case"quote":s.push({__resolveType:a,quote:o.text});break;case"divider":s.push({__resolveType:a});break;case"image":s.push({__resolveType:a,url:o.url,alt:o.alt,caption:o.caption,size:"normal"});break}}return s}function yr({title:t,blocks:e,takenSlugs:s,now:o}){const a=t.trim();return{title:a,slug:a?yo(a,s):bo(""),date:o.toISOString().slice(0,10),excerpt:"",image:"",alt:"",authors:[],categories:[],sections:e,status:"in_review"}}const fn="__all__",pn={"date-desc":"sandbox.postToolbar.sortNewestFirst","date-asc":"sandbox.postToolbar.sortOldestFirst",az:"sandbox.postToolbar.sortTitleAZ",za:"sandbox.postToolbar.sortTitleZA"},vr={"date-desc":"sandbox.postToolbar.sortNewest","date-asc":"sandbox.postToolbar.sortOldest",az:"sandbox.postToolbar.sortAZ",za:"sandbox.postToolbar.sortZA"},hn="status:";function gn(t){if(!t.startsWith(hn))return null;const e=t.slice(hn.length);return Ds.includes(e)?e:null}const xn=$.forwardRef(function(e,s){const o=ae.c(20);let a,l,i,c,r;o[0]!==e?({icon:a,active:l,value:r,className:i,...c}=e,o[0]=e,o[1]=a,o[2]=l,o[3]=i,o[4]=c,o[5]=r):(a=o[1],l=o[2],i=o[3],c=o[4],r=o[5]);const d=l?"text-foreground":"text-muted-foreground";let p;o[6]!==i||o[7]!==d?(p=be("h-7 gap-1 px-1.5 text-xs",d,i),o[6]=i,o[7]=d,o[8]=p):p=o[8];let m;o[9]!==a?(m=n.jsx(a,{size:14,className:"shrink-0"}),o[9]=a,o[10]=m):m=o[10];let h;o[11]!==r?(h=r&&n.jsx("span",{className:"min-w-0 flex-1 truncate",children:r}),o[11]=r,o[12]=h):h=o[12];let u;o[13]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(ft,{size:12,className:"shrink-0 opacity-60"}),o[13]=u):u=o[13];let f;return o[14]!==c||o[15]!==s||o[16]!==p||o[17]!==m||o[18]!==h?(f=n.jsxs(_e,{ref:s,type:"button",variant:"ghost",size:"sm",className:p,...c,children:[m,h,u]}),o[14]=c,o[15]=s,o[16]=p,o[17]=m,o[18]=h,o[19]=f):f=o[19],f});function Os(t){const e=ae.c(2),{count:s}=t;let o;return e[0]!==s?(o=n.jsx("span",{className:"ml-auto pl-3 text-xs text-muted-foreground tabular-nums",children:s}),e[0]=s,e[1]=o):o=e[1],o}function jr(t){const e=ae.c(19),{value:s,onChange:o}=t,a=Se();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Ss,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[0]=l):l=e[0];let i;e[1]!==o?(i=h=>o(h.target.value),e[1]=o,e[2]=i):i=e[2];let c;e[3]!==a?(c=a("sandbox.postToolbar.searchPlaceholder"),e[3]=a,e[4]=c):c=e[4];let r;e[5]!==a?(r=a("sandbox.postToolbar.searchAriaLabel"),e[5]=a,e[6]=r):r=e[6];let d;e[7]!==i||e[8]!==c||e[9]!==r||e[10]!==s?(d=n.jsx("input",{type:"text",value:s,onChange:i,placeholder:c,"aria-label":r,className:"min-w-0 flex-1 bg-transparent py-0.5 text-sm outline-none placeholder:text-muted-foreground"}),e[7]=i,e[8]=c,e[9]=r,e[10]=s,e[11]=d):d=e[11];let p;e[12]!==o||e[13]!==a||e[14]!==s?(p=s&&n.jsx(Bo,{label:a("sandbox.postToolbar.clearSearch"),onClick:()=>o("")}),e[12]=o,e[13]=a,e[14]=s,e[15]=p):p=e[15];let m;return e[16]!==d||e[17]!==p?(m=n.jsxs("div",{className:"flex items-center gap-2 border-b px-2.5 py-1.5",children:[l,d,p]}),e[16]=d,e[17]=p,e[18]=m):m=e[18],m}function kr(t){const e=ae.c(100),{categories:s,authors:o,statusCounts:a,categoryFilter:l,authorFilter:i,statusFilter:c,sort:r,onCategoryFilterChange:d,onAuthorFilterChange:p,onStatusFilterChange:m,onSortChange:h}=t,u=Se();let f;if(e[0]!==s||e[1]!==l){let H;e[3]!==l?(H=ie=>ie.slug===l,e[3]=l,e[4]=H):H=e[4],f=s.find(H),e[0]=s,e[1]=l,e[2]=f}else f=e[2];const x=f;let g;if(e[5]!==i||e[6]!==o){let H;e[8]!==i?(H=ie=>ie.email===i,e[8]=i,e[9]=H):H=e[9],g=o.find(H),e[5]=i,e[6]=o,e[7]=g}else g=e[7];const v=g,y=!!(l||i||c);let j;e[10]!==v?.name||e[11]!==x?.name||e[12]!==c||e[13]!==u?(j=x?.name??v?.name??u(c?qt[c]:"sandbox.postToolbar.filterLabel"),e[10]=v?.name,e[11]=x?.name,e[12]=c,e[13]=u,e[14]=j):j=e[14];const w=j,N=l?`cat:${l}`:i?`author:${i}`:c?`status:${c}`:fn;let E;e[15]!==p||e[16]!==d||e[17]!==m?(E=()=>{d(null),p(null),m(null)},e[15]=p,e[16]=d,e[17]=m,e[18]=E):E=e[18];const B=E;let k;e[19]!==B||e[20]!==p||e[21]!==d||e[22]!==m?(k=H=>{H.startsWith("cat:")?(p(null),m(null),d(H.slice(4))):H.startsWith("author:")?(d(null),m(null),p(H.slice(7))):gn(H)?(d(null),p(null),m(gn(H))):B()},e[19]=B,e[20]=p,e[21]=d,e[22]=m,e[23]=k):k=e[23];const D=k;let O;e[24]!==w||e[25]!==y?(O=n.jsx(It,{asChild:!0,children:n.jsx(xn,{icon:Uo,active:y,value:w,className:"min-w-0 shrink"})}),e[24]=w,e[25]=y,e[26]=O):O=e[26];let L;e[27]!==u?(L=u("sandbox.postToolbar.filterBy"),e[27]=u,e[28]=L):L=e[28];let K;e[29]!==L?(K=n.jsx(bt,{children:L}),e[29]=L,e[30]=K):K=e[30];let F;e[31]!==u?(F=u("sandbox.postToolbar.allPosts"),e[31]=u,e[32]=F):F=e[32];let _;e[33]!==F?(_=n.jsx(St,{value:fn,children:F}),e[33]=F,e[34]=_):_=e[34];let A;e[35]!==u?(A=u("sandbox.postToolbar.statusLabel"),e[35]=u,e[36]=A):A=e[36];let I;e[37]!==A?(I=n.jsx(bt,{className:"text-muted-foreground/70",children:A}),e[37]=A,e[38]=I):I=e[38];let R;e[39]!==a||e[40]!==u?(R=Ds.map(H=>n.jsxs(St,{value:`status:${H}`,children:[n.jsx("span",{className:"min-w-0 flex-1 truncate",children:u(qt[H])}),n.jsx(Os,{count:a[H]??0})]},`status:${H}`)),e[39]=a,e[40]=u,e[41]=R):R=e[41];let G;e[42]!==s.length||e[43]!==u?(G=s.length>0&&n.jsx(bt,{className:"text-muted-foreground/70",children:u("sandbox.postToolbar.categoryLabel")}),e[42]=s.length,e[43]=u,e[44]=G):G=e[44];let z;e[45]!==s?(z=s.map(wr),e[45]=s,e[46]=z):z=e[46];let W;e[47]!==o.length||e[48]!==u?(W=o.length>0&&n.jsx(bt,{className:"text-muted-foreground/70",children:u("sandbox.postToolbar.authorLabel")}),e[47]=o.length,e[48]=u,e[49]=W):W=e[49];let P;e[50]!==o?(P=o.map(Sr),e[50]=o,e[51]=P):P=e[51];let U;e[52]!==N||e[53]!==D||e[54]!==_||e[55]!==I||e[56]!==R||e[57]!==G||e[58]!==z||e[59]!==W||e[60]!==P?(U=n.jsxs(Ks,{value:N,onValueChange:D,children:[_,I,R,G,z,W,P]}),e[52]=N,e[53]=D,e[54]=_,e[55]=I,e[56]=R,e[57]=G,e[58]=z,e[59]=W,e[60]=P,e[61]=U):U=e[61];let Y;e[62]!==U||e[63]!==K?(Y=n.jsxs(Rt,{align:"start",className:"max-h-96 w-60 overflow-y-auto",children:[K,U]}),e[62]=U,e[63]=K,e[64]=Y):Y=e[64];let q;e[65]!==Y||e[66]!==O?(q=n.jsxs(Ft,{children:[O,Y]}),e[65]=Y,e[66]=O,e[67]=q):q=e[67];let Z;e[68]!==B||e[69]!==y||e[70]!==u?(Z=y&&n.jsx(Bo,{label:u("sandbox.postToolbar.clearFilter"),onClick:B}),e[68]=B,e[69]=y,e[70]=u,e[71]=Z):Z=e[71];const de=vr[r];let ne;e[72]!==u||e[73]!==de?(ne=u(de),e[72]=u,e[73]=de,e[74]=ne):ne=e[74];let ue;e[75]!==ne?(ue=n.jsx(It,{asChild:!0,children:n.jsx(xn,{icon:Ho,active:!0,value:ne})}),e[75]=ne,e[76]=ue):ue=e[76];let te;e[77]!==u?(te=u("sandbox.postToolbar.sortBy"),e[77]=u,e[78]=te):te=e[78];let re;e[79]!==te?(re=n.jsx(bt,{children:te}),e[79]=te,e[80]=re):re=e[80];let le;e[81]!==h?(le=H=>h(H),e[81]=h,e[82]=le):le=e[82];let T;e[83]===Symbol.for("react.memo_cache_sentinel")?(T=Object.keys(pn),e[83]=T):T=e[83];let J;e[84]!==u?(J=T.map(H=>n.jsx(St,{value:H,children:u(pn[H])},H)),e[84]=u,e[85]=J):J=e[85];let ee;e[86]!==r||e[87]!==le||e[88]!==J?(ee=n.jsx(Ks,{value:r,onValueChange:le,children:J}),e[86]=r,e[87]=le,e[88]=J,e[89]=ee):ee=e[89];let oe;e[90]!==re||e[91]!==ee?(oe=n.jsxs(Rt,{align:"end",className:"w-44",children:[re,ee]}),e[90]=re,e[91]=ee,e[92]=oe):oe=e[92];let S;e[93]!==ue||e[94]!==oe?(S=n.jsx("div",{className:"ml-auto shrink-0",children:n.jsxs(Ft,{children:[ue,oe]})}),e[93]=ue,e[94]=oe,e[95]=S):S=e[95];let se;return e[96]!==q||e[97]!==Z||e[98]!==S?(se=n.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden border-b px-2 py-1.5",children:[q,Z,S]}),e[96]=q,e[97]=Z,e[98]=S,e[99]=se):se=e[99],se}function Sr(t){return n.jsxs(St,{value:`author:${t.email}`,children:[n.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),n.jsx(Os,{count:t.count})]},`author:${t.email}`)}function wr(t){return n.jsxs(St,{value:`cat:${t.slug}`,children:[n.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),n.jsx(Os,{count:t.count})]},`cat:${t.slug}`)}function Bo(t){const e=ae.c(4),{label:s,onClick:o}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Bs,{size:12}),e[0]=a):a=e[0];let l;return e[1]!==s||e[2]!==o?(l=n.jsx("button",{type:"button","aria-label":s,onClick:o,className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer rounded-lg",children:a}),e[1]=s,e[2]=o,e[3]=l):l=e[3],l}function Nr(t){const e=ae.c(18),{checked:s,disabled:o,onToggle:a}=t,l=Se();let i;e[0]!==a?(i=()=>a(),e[0]=a,e[1]=i):i=e[1];let c;e[2]!==s||e[3]!==l?(c=l(s?"sandbox.postToolbar.deselectAllPosts":"sandbox.postToolbar.selectAllPosts"),e[2]=s,e[3]=l,e[4]=c):c=e[4];let r;e[5]!==s||e[6]!==o||e[7]!==i||e[8]!==c?(r=n.jsx(We,{asChild:!0,children:n.jsx("span",{className:"flex shrink-0 items-center px-1.5",onClick:Cr,children:n.jsx(Xt,{checked:s,disabled:o,onCheckedChange:i,"aria-label":c})})}),e[5]=s,e[6]=o,e[7]=i,e[8]=c,e[9]=r):r=e[9];let d;e[10]!==s||e[11]!==l?(d=l(s?"sandbox.postToolbar.deselectAll":"sandbox.postToolbar.selectAll"),e[10]=s,e[11]=l,e[12]=d):d=e[12];let p;e[13]!==d?(p=n.jsx(Ye,{side:"bottom",children:d}),e[13]=d,e[14]=p):p=e[14];let m;return e[15]!==r||e[16]!==p?(m=n.jsxs(Qe,{children:[r,p]}),e[15]=r,e[16]=p,e[17]=m):m=e[17],m}function Cr(t){return t.stopPropagation()}function Pr(t){const e=ae.c(42),{count:s,allSelected:o,onToggleSelectAll:a,onArchive:l,onExit:i}=t,c=Se();let r;e[0]!==o||e[1]!==a?(r=n.jsx(Nr,{checked:o,onToggle:a}),e[0]=o,e[1]=a,e[2]=r):r=e[2];let d;e[3]!==s||e[4]!==c?(d=c("sandbox.postToolbar.itemsSelected",{count:s}),e[3]=s,e[4]=c,e[5]=d):d=e[5];let p;e[6]!==d?(p=n.jsx("span",{className:"text-xs font-medium tabular-nums",children:d}),e[6]=d,e[7]=p):p=e[7];const m=s===0;let h;e[8]!==c?(h=c("sandbox.postToolbar.archiveSelectedPosts"),e[8]=c,e[9]=h):h=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Ao,{size:14}),e[10]=u):u=e[10];let f;e[11]!==l||e[12]!==m||e[13]!==h?(f=n.jsx(We,{asChild:!0,children:n.jsx(_e,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",disabled:m,onClick:l,"aria-label":h,children:u})}),e[11]=l,e[12]=m,e[13]=h,e[14]=f):f=e[14];let x;e[15]!==c?(x=c("sandbox.postToolbar.archiveSelected"),e[15]=c,e[16]=x):x=e[16];let g;e[17]!==x?(g=n.jsx(Ye,{side:"bottom",children:x}),e[17]=x,e[18]=g):g=e[18];let v;e[19]!==f||e[20]!==g?(v=n.jsxs(Qe,{children:[f,g]}),e[19]=f,e[20]=g,e[21]=v):v=e[21];let y;e[22]!==c?(y=c("sandbox.postToolbar.exitSelection"),e[22]=c,e[23]=y):y=e[23];let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Bs,{size:14}),e[24]=j):j=e[24];let w;e[25]!==i||e[26]!==y?(w=n.jsx(We,{asChild:!0,children:n.jsx(_e,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:i,"aria-label":y,children:j})}),e[25]=i,e[26]=y,e[27]=w):w=e[27];let N;e[28]!==c?(N=c("sandbox.postToolbar.exitSelection"),e[28]=c,e[29]=N):N=e[29];let E;e[30]!==N?(E=n.jsx(Ye,{side:"bottom",children:N}),e[30]=N,e[31]=E):E=e[31];let B;e[32]!==w||e[33]!==E?(B=n.jsxs(Qe,{children:[w,E]}),e[32]=w,e[33]=E,e[34]=B):B=e[34];let k;e[35]!==v||e[36]!==B?(k=n.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[v,B]}),e[35]=v,e[36]=B,e[37]=k):k=e[37];let D;return e[38]!==r||e[39]!==k||e[40]!==p?(D=n.jsxs("div",{className:"flex items-center gap-0.5 border-b bg-accent/40 px-2 py-1.5",children:[r,p,k]}),e[38]=r,e[39]=k,e[40]=p,e[41]=D):D=e[41],D}const Tr={draft:"outline",generating:"secondary",awaiting_review:"warning",scheduled:"secondary",published:"success",archived:"outline"},bn="ideas",yn=t=>t.scheduledDatetime||t.date||"",Br=(t,e)=>yn(e).localeCompare(yn(t)),Er=t=>t==="scheduled"||t==="published",Eo="application/x-post-key";function _r({orgSlug:t,virtualMcpId:e,branch:s,decofile:o,view:a,selectedKey:l,onViewChange:i,onOpen:c,onClose:r,move:d,support:p,meta:m,renderDetail:h}){const u=Se(),f=js(),x=Qt({orgSlug:t,virtualMcpId:e,branch:s}),g=Un({orgSlug:t,virtualMcpId:e,branch:s}),v=cl().length>0,[y,j]=$.useState(null),[w,N]=$.useState(!1),[E,B]=$.useState(!1),[k,D]=$.useState(""),[O,L]=$.useState(3),[K,F]=$.useState(""),[_,A]=$.useState(!1),[I,R]=$.useState(!1),[G,z]=$.useState(),[W,P]=$.useState(!1),[U,Y]=$.useState(""),q=$.useRef(null),[Z,de]=$o(Lo.blogBoardCollapsedLanes(),[]),ne=C=>de(Q=>Q.includes(C)?Q.filter(Ee=>Ee!==C):[...Q,C]),ue=or({orgSlug:t,virtualMcpId:e,branch:s,decofile:o,meta:m,onStarted:c}),te=oi(o),re=fo(o),le=ho(o),T=C=>le.find(Q=>Q.key===C)?.title,J=C=>dt(o[C],"posts"),ee=l&&te.some(C=>C.key===l)?l:te[0]?.key??null,oe=async C=>{await d.apply(C.key,"archived")&&me.success(u("sandbox.postBoard.archived"))},[S,se]=$.useState(null),[H,ie]=$.useState(null),[ye,pe]=$.useState(null),[je,he]=$.useState("date-desc"),[we,Pe]=$.useState(""),[Te,Ne]=$.useState(new Set),Be=te.reduce((C,Q)=>(C[Q.status]=(C[Q.status]??0)+1,C),{}),De=C=>{const Q=new Map;for(const Ee of te)for(const Ve of C(Ee))Q.set(Ve,(Q.get(Ve)??0)+1);return Q},ge=De(C=>C.categorySlugs),$e=De(C=>C.authorEmails),Fe=Ue(o,"categories").map(({payload:C})=>({slug:ke(C.slug),name:ke(C.name)||ke(C.slug),count:ge.get(ke(C.slug))??0})),M=Ue(o,"authors").map(({payload:C})=>({email:ke(C.email),name:ke(C.name)||ke(C.email),count:$e.get(ke(C.email))??0})),xe=we.trim().toLowerCase(),ve=te.filter(C=>!S||C.categorySlugs.includes(S)).filter(C=>!H||C.authorEmails.includes(H)).filter(C=>!ye||C.status===ye).filter(C=>!xe||C.title.toLowerCase().includes(xe)||C.slug.toLowerCase().includes(xe)).sort((C,Q)=>{if(je==="az")return C.title.localeCompare(Q.title);if(je==="za")return Q.title.localeCompare(C.title);const Ee=(C.scheduledDatetime||C.date).localeCompare(Q.scheduledDatetime||Q.date);return je==="date-asc"?Ee:-Ee}),Le=Te.size>0,ss=C=>Ne(Q=>{const Ee=new Set(Q);return Ee.delete(C)||Ee.add(C),Ee}),ns=()=>Ne(C=>ve.every(Q=>C.has(Q.key))?new Set:new Set(ve.map(Q=>Q.key))),os=async()=>{let C=0;for(const Q of Te)await d.apply(Q,"archived")&&(C+=1);Ne(new Set),C>0&&me.success(u("sandbox.postBoard.archived"))},as=C=>{z({key:C.key,title:C.title,body:C.body}),R(!0)},ls=C=>{g.mutate({blockKey:C.key})},is=(C,Q)=>{j(null),d.apply(Q,C)},_t=()=>{const C=Vt(bs()),Q=ro({title:"",now:new Date});x.mutate({blockKey:C,data:ut(C,Q)}),c(C)},rs=()=>{const C=lr(U),Q=br(C.sections,xo(m));if(Q.length===0&&!C.title.trim()){me.error(u("sandbox.postBoard.importEmpty"));return}const Ee=Vt(bs()),Ve=yr({title:C.title,blocks:Q,takenSlugs:te.map(qe=>qe.slug).filter(Boolean),now:new Date});x.mutate({blockKey:Ee,data:ut(Ee,Ve)}),P(!1),Y(""),me.success(u("sandbox.postBoard.imported")),c(Ee)},cs=async()=>{N(!0);const C=le.find(Q=>Q.key===K);try{const Q=o[As]??{},Ee=o[go],Ve=Ke(Ee?.formats).map(b=>b.name).filter(Boolean),qe=await f.call("BLOG_THEME_SUGGEST",{brand:{companyName:ke(Q.companyName),description:ke(Q.description),language:ke(Q.language),tone:ke(Q.tone),targetAudience:ke(Q.targetAudience),values:Me(Ke(Q.values)),dos:Me(Ke(Q.dos)),avoid:Me(Ke(Q.avoid))},existingTitles:re.map(b=>b.title).filter(Boolean),formats:Ve,guidance:[C&&`Every idea must be one angle inside the pillar "${C.title}": ${C.body}`,k.trim()].filter(Boolean).join(`
|
|
8
8
|
|
|
9
|
-
`)||void 0,count:O}),Ce=Si(re.map(b=>b.title),qe.themes);if(Ce.length===0){me.info(u("sandbox.postBoard.ideasFailed"));return}let xt=0;for(const b of Ce){const V=xi();try{await x.mutateAsync({blockKey:V,data:bi(V,{title:b.title,body:b.body,pillarKey:C?.key,createdAt:new Date().toISOString()})}),xt++}catch(ce){console.warn("[posts] could not save a generated idea",ce)}}if(xt===0){me.error(u("sandbox.postBoard.ideasFailed"));return}me.success(u("sandbox.postBoard.ideasAdded",{count:String(xt)}))}catch(Q){me.error(Q instanceof Error?Q.message:u("sandbox.postBoard.ideasFailed"))}finally{N(!1)}};return n.jsxs("div",{className:"relative flex h-full min-w-0 flex-col",children:[n.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b px-6 py-3",children:[n.jsx("div",{className:"flex items-center gap-3",children:n.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border p-0.5",children:[n.jsx(vn,{active:a==="board",onClick:()=>i("board"),icon:n.jsx(qo,{size:14}),label:u("sandbox.postBoard.viewBoard")}),n.jsx(vn,{active:a==="list",onClick:()=>i("list"),icon:n.jsx(Zo,{size:14}),label:u("sandbox.postBoard.viewList")})]})}),n.jsxs("div",{className:"flex items-center gap-2",children:[w&&n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","aria-live":"polite",role:"status",children:[n.jsx(wt,{size:12,className:"animate-spin"}),u("sandbox.postBoard.generatingLabel")]}),n.jsxs(ct,{open:E,onOpenChange:B,children:[n.jsx(el,{asChild:!0,children:n.jsxs(_e,{type:"button",variant:"outline",size:"sm",disabled:!0,children:[n.jsx(et,{size:14}),u("sandbox.postBoard.generateIdeas"),n.jsx(nt,{variant:"secondary",children:u("common.soon")})]})}),n.jsxs(rt,{className:"sm:max-w-lg",children:[n.jsxs(pt,{children:[n.jsx(it,{children:u("sandbox.postBoard.generateIdeas")}),n.jsx(zt,{children:u("sandbox.postBoard.ideaGuidanceLabel")})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx(Ot,{id:"idea-guidance",value:k,rows:6,autoFocus:!0,onChange:C=>D(C.target.value),placeholder:u("sandbox.postBoard.ideaGuidancePlaceholder"),className:"resize-none text-sm"}),le.length>0&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx(ze,{className:"text-xs",children:u("sandbox.postBoard.ideaPillarLabel")}),n.jsx(kt,{options:le.map(C=>C.title),value:le.find(C=>C.key===K)?.title??"",emptyLabel:u("sandbox.postBoard.ideaNoPillar"),onChange:C=>F(le.find(Q=>Q.title===C)?.key??"")})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ze,{htmlFor:"idea-count",className:"text-xs",children:u("sandbox.postBoard.ideaCount")}),n.jsx(Xe,{id:"idea-count",type:"number",min:1,max:8,value:O,onChange:C=>L(Math.max(1,Math.min(8,Number(C.target.value)||1))),className:"h-9 w-16"}),n.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:u("sandbox.postBoard.usesCredits")})]})]}),n.jsx(ht,{children:n.jsxs(_e,{type:"button",onClick:()=>{B(!1),cs()},children:[n.jsx(et,{size:14}),u("sandbox.postBoard.generateIdeas")]})})]})]}),n.jsxs(Ft,{children:[n.jsx(It,{asChild:!0,children:n.jsxs(_e,{type:"button",size:"sm",children:[n.jsx(ws,{size:14}),u("sandbox.postBoard.newPost"),n.jsx(ft,{size:14})]})}),n.jsxs(Rt,{align:"end",className:"w-56",children:[n.jsxs(Je,{disabled:!0,onClick:()=>{z(void 0),R(!0)},children:[n.jsx(et,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[u("sandbox.postBoard.newPostGenerate"),n.jsx(nt,{variant:"secondary",children:u("common.soon")})]}),n.jsx("span",{className:"text-xs text-muted-foreground",children:u("sandbox.postBoard.newPostGenerateHint")})]})]}),n.jsxs(Je,{onClick:_t,children:[n.jsx(Jo,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{children:u("sandbox.postBoard.newPostWrite")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:u("sandbox.postBoard.newPostWriteHint")})]})]}),n.jsxs(Je,{onClick:()=>P(!0),children:[n.jsx(fs,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{children:u("sandbox.postBoard.importContent")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:u("sandbox.postBoard.importContentHint")})]})]})]})]}),n.jsx(Zi,{open:I,onOpenChange:R,decofile:o,hasAi:v,seed:G,onGenerate:C=>{ue(C)}},G?.title??"scratch"),n.jsx(ct,{open:W,onOpenChange:P,children:n.jsxs(rt,{className:"max-h-[85vh] sm:max-w-2xl",children:[n.jsxs(pt,{children:[n.jsx(it,{children:u("sandbox.postBoard.importTitle")}),n.jsx(zt,{children:u("sandbox.postBoard.importDescription")})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"h-72 overflow-hidden rounded-[var(--studio-control-radius,var(--radius-xl))] border bg-[var(--studio-input-background)]",children:n.jsx(Jn,{code:U,language:Co(U)?"html":"markdown",height:"100%",autoFocus:!0,onChange:C=>Y(C??"")})}),n.jsx("input",{ref:q,type:"file",accept:".html,.htm,.md,.markdown,.txt",className:"hidden",onChange:async C=>{const Q=C.target.files?.[0];Q&&Y(await Q.text()),C.target.value=""}}),n.jsxs(_e,{type:"button",variant:"outline",size:"sm",onClick:()=>q.current?.click(),children:[n.jsx(fs,{size:14}),u("sandbox.postBoard.importUpload")]})]}),n.jsx(ht,{children:n.jsxs(_e,{type:"button",disabled:!U.trim(),onClick:rs,children:[n.jsx(fs,{size:14}),u("sandbox.postBoard.importRun")]})})]})})]})]}),te.length===0&&re.length===0?n.jsx(rl,{className:"flex-1",icon:n.jsx(et,{size:22}),title:u("sandbox.postBoard.emptyTitle"),description:u("sandbox.postBoard.emptyDescription"),buttonProps:{children:u("sandbox.postBoard.newPost"),onClick:_t}}):a==="board"?n.jsxs("div",{className:"flex min-h-0 flex-1 gap-3 overflow-x-auto p-4",children:[n.jsx(Lr,{ideas:re,collapsed:Z.includes(bn),pillarTitleOf:T,onToggleCollapsed:()=>ne(bn),onGenerate:as,onDelete:ls}),n.jsx("div",{"aria-hidden":!0,className:"my-1 w-px shrink-0 self-stretch bg-border"}),Ds.map(C=>{const Q=te.filter(Ce=>Ce.status===C);Er(C)&&Q.sort(Br);const Ee=u(qt[C]),Ve=Z.includes(C),qe=wo(p,C);return n.jsx("div",{onDragOver:Ce=>{Ce.preventDefault(),j(C)},onDragLeave:()=>j(Ce=>Ce===C?null:Ce),onDrop:Ce=>{Ce.preventDefault(),is(C,Ce.dataTransfer.getData(Eo))},title:qe?No(u,qe):void 0,className:be("flex shrink-0 flex-col rounded-xl border bg-muted/30 transition-colors",Ve?"w-11":"w-72",qe&&"opacity-50",y===C&&"border-primary bg-primary/5"),children:Ve?n.jsxs("button",{type:"button",onClick:()=>ne(C),"aria-label":u("sandbox.postBoard.expandLane",{lane:Ee}),"aria-expanded":!1,className:"flex min-h-0 flex-1 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[n.jsx(Tt,{size:14,className:"shrink-0"}),n.jsx("span",{className:"text-xs tabular-nums",children:Q.length}),n.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:Ee})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",children:[n.jsxs("button",{type:"button",onClick:()=>ne(C),"aria-label":u("sandbox.postBoard.collapseLane",{lane:Ee}),"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[n.jsx(ft,{size:14,className:"shrink-0"}),n.jsx("span",{className:"truncate",children:Ee})]}),n.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:Q.length})]}),n.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto px-2 pb-2",children:Q.length===0?n.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:u("sandbox.postBoard.laneEmpty")}):Q.map(Ce=>n.jsx($r,{post:Ce,payload:J(Ce.key),moving:d.isMoving(Ce.key),onOpen:()=>c(Ce.key),onArchive:Ce.status==="archived"?void 0:()=>{oe(Ce)}},Ce.key))})]})},C)})]}):n.jsxs("div",{className:"flex min-h-0 flex-1",children:[n.jsxs("div",{className:"flex w-80 shrink-0 flex-col border-r",children:[n.jsx(jr,{value:we,onChange:Pe}),Le?n.jsx(Pr,{count:Te.size,allSelected:ve.length>0&&ve.every(C=>Te.has(C.key)),onToggleSelectAll:ns,onArchive:()=>{os()},onExit:()=>Ne(new Set)}):n.jsx(kr,{categories:Fe,authors:M,statusCounts:Be,categoryFilter:S,authorFilter:H,statusFilter:ye,sort:je,onCategoryFilterChange:se,onAuthorFilterChange:ie,onStatusFilterChange:pe,onSortChange:he}),n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:n.jsx(Dr,{posts:ve,selectedKey:ee,selectionActive:Le,selectedKeys:Te,onToggleSelect:ss,onOpen:c,isMoving:d.isMoving,onArchive:C=>{oe(C)}})})]}),n.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:ee&&h?n.jsx($.Suspense,{fallback:n.jsx("div",{className:"flex h-full items-center justify-center",children:n.jsx(wt,{size:20,className:"animate-spin text-muted-foreground"})}),children:h(ee)}):n.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:u("sandbox.postBoard.selectPrompt")})})]}),a==="board"&&l&&_&&h&&n.jsx("div",{className:"absolute inset-0 z-30 flex flex-col bg-background",children:h(l,{expanded:!0,onToggleExpand:()=>A(!1),onClose:()=>{A(!1),r?.()}})}),n.jsx(ct,{open:a==="board"&&!!l&&!_,onOpenChange:C=>{C||(A(!1),r?.())},children:n.jsxs(rt,{closeButtonClassName:"hidden",className:"left-auto right-4 top-4 bottom-4 flex h-auto translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden p-0 sm:max-w-3xl",children:[n.jsx(it,{className:"sr-only",children:u("sandbox.collectionsSidebar.posts")}),l&&h?n.jsx($.Suspense,{fallback:n.jsx("div",{className:"flex h-full items-center justify-center",children:n.jsx(wt,{size:20,className:"animate-spin text-muted-foreground"})}),children:h(l,{expanded:!1,onToggleExpand:()=>A(!0),onClose:()=>r?.()})}):null]})})]})}function vn(t){const e=ae.c(7),{active:s,onClick:o,icon:a,label:l}=t,i=s?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground";let c;e[0]!==i?(c=be("inline-flex cursor-pointer items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",i),e[0]=i,e[1]=c):c=e[1];let r;return e[2]!==a||e[3]!==l||e[4]!==o||e[5]!==c?(r=n.jsxs("button",{type:"button",onClick:o,className:c,children:[a,l]}),e[2]=a,e[3]=l,e[4]=o,e[5]=c,e[6]=r):r=e[6],r}function Dr(t){const e=ae.c(23),{posts:s,selectedKey:o,selectionActive:a,selectedKeys:l,onToggleSelect:i,onOpen:c,isMoving:r,onArchive:d}=t,p=Se();if(s.length===0){let u;e[0]!==p?(u=p("sandbox.postList.noMatches"),e[0]=p,e[1]=u):u=e[1];let f;return e[2]!==u?(f=n.jsx("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=f):f=e[3],f}let m;if(e[4]!==r||e[5]!==d||e[6]!==c||e[7]!==i||e[8]!==s||e[9]!==o||e[10]!==l||e[11]!==a){let u;e[13]!==r||e[14]!==d||e[15]!==c||e[16]!==i||e[17]!==o||e[18]!==l||e[19]!==a?(u=f=>n.jsx(Ar,{post:f,selected:f.key===o,selectionActive:a,checked:l.has(f.key),onToggleSelect:()=>i(f.key),moving:r(f.key),onOpen:()=>c(f.key),onArchive:f.status==="archived"?void 0:()=>d(f)},f.key),e[13]=r,e[14]=d,e[15]=c,e[16]=i,e[17]=o,e[18]=l,e[19]=a,e[20]=u):u=e[20],m=s.map(u),e[4]=r,e[5]=d,e[6]=c,e[7]=i,e[8]=s,e[9]=o,e[10]=l,e[11]=a,e[12]=m}else m=e[12];let h;return e[21]!==m?(h=n.jsx("ul",{className:"divide-y",children:m}),e[21]=m,e[22]=h):h=e[22],h}function Ar(t){const e=ae.c(56),{post:s,selected:o,selectionActive:a,checked:l,onToggleSelect:i,moving:c,onOpen:r,onArchive:d}=t,p=Se(),m=s.status==="awaiting_review"&&s.missing.length>0,h=s.status==="scheduled"||s.status==="published",u=a||l?"opacity-100":"opacity-0 focus-within:opacity-100 group-hover/row:opacity-100";let f;e[0]!==u?(f=be("absolute left-3 top-3 z-10 transition-opacity",u),e[0]=u,e[1]=f):f=e[1];let x;e[2]!==i?(x=()=>i(),e[2]=i,e[3]=x):x=e[3];let g;e[4]!==s.title||e[5]!==p?(g=s.title||p("sandbox.postBoard.untitled"),e[4]=s.title,e[5]=p,e[6]=g):g=e[6];let v;e[7]!==l||e[8]!==x||e[9]!==g?(v=n.jsx(Xt,{checked:l,onCheckedChange:x,"aria-label":g}),e[7]=l,e[8]=x,e[9]=g,e[10]=v):v=e[10];let y;e[11]!==f||e[12]!==v?(y=n.jsx("span",{className:f,children:v}),e[11]=f,e[12]=v,e[13]=y):y=e[13];let j;e[14]!==c||e[15]!==d||e[16]!==a?(j=d&&!a&&n.jsx(Is,{onArchive:d,disabled:c,className:"top-2.5"}),e[14]=c,e[15]=d,e[16]=a,e[17]=j):j=e[17];let w;e[18]!==r||e[19]!==i||e[20]!==a?(w=()=>a?i():r(),e[18]=r,e[19]=i,e[20]=a,e[21]=w):w=e[21];const N=o?"bg-accent text-accent-foreground":"bg-card hover:bg-muted/50";let E;e[22]!==N?(E=be("flex w-full cursor-pointer flex-col gap-1.5 py-2.5 pl-10 pr-3 text-left text-sm transition-colors",N),e[22]=N,e[23]=E):E=e[23];let B;e[24]!==s.title||e[25]!==p?(B=s.title||p("sandbox.postBoard.untitled"),e[24]=s.title,e[25]=p,e[26]=B):B=e[26];let k;e[27]!==B?(k=n.jsx("span",{className:"min-w-0 truncate pr-6 font-medium",children:B}),e[27]=B,e[28]=k):k=e[28];const D=Tr[s.status],O=qt[s.status];let L;e[29]!==p||e[30]!==O?(L=p(O),e[29]=p,e[30]=O,e[31]=L):L=e[31];let K;e[32]!==D||e[33]!==L?(K=n.jsx(nt,{variant:D,className:"shrink-0",children:L}),e[32]=D,e[33]=L,e[34]=K):K=e[34];let F;e[35]!==m||e[36]!==s.missing?(F=m&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[n.jsx(Wt,{size:12}),s.missing.length]}),e[35]=m,e[36]=s.missing,e[37]=F):F=e[37];let _;e[38]!==h||e[39]!==s.date||e[40]!==s.scheduledDatetime?(_=h&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs tabular-nums text-muted-foreground",children:[n.jsx(ks,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[38]=h,e[39]=s.date,e[40]=s.scheduledDatetime,e[41]=_):_=e[41];let A;e[42]!==K||e[43]!==F||e[44]!==_?(A=n.jsxs("div",{className:"flex items-center gap-2",children:[K,F,_]}),e[42]=K,e[43]=F,e[44]=_,e[45]=A):A=e[45];let I;e[46]!==o||e[47]!==E||e[48]!==k||e[49]!==A||e[50]!==w?(I=n.jsxs("button",{type:"button",onClick:w,"aria-current":o,className:E,children:[k,A]}),e[46]=o,e[47]=E,e[48]=k,e[49]=A,e[50]=w,e[51]=I):I=e[51];let R;return e[52]!==I||e[53]!==y||e[54]!==j?(R=n.jsxs("li",{className:"group/row relative",children:[y,j,I]}),e[52]=I,e[53]=y,e[54]=j,e[55]=R):R=e[55],R}function $r(t){const e=ae.c(46),{post:s,payload:o,moving:a,onOpen:l,onArchive:i}=t,c=Se(),r=s.status!=="generating"&&!a;let d;e[0]!==o?(d=si(o),e[0]=o,e[1]=d):d=e[1];const p=d,m=!r&&"opacity-80";let h;e[2]!==m?(h=be("group/card relative rounded-lg border bg-card shadow-sm transition-colors hover:border-primary/40",m),e[2]=m,e[3]=h):h=e[3];let u;e[4]!==a||e[5]!==i?(u=i&&n.jsx(Is,{onArchive:i,disabled:a,className:"top-2"}),e[4]=a,e[5]=i,e[6]=u):u=e[6];let f;e[7]!==s.key?(f=O=>O.dataTransfer.setData(Eo,s.key),e[7]=s.key,e[8]=f):f=e[8];const x=r?"cursor-grab active:cursor-grabbing":"cursor-pointer";let g;e[9]!==x?(g=be("block w-full p-3 text-left",x),e[9]=x,e[10]=g):g=e[10];let v;e[11]!==s.title||e[12]!==c?(v=s.title||c("sandbox.postBoard.untitled"),e[11]=s.title,e[12]=c,e[13]=v):v=e[13];let y;e[14]!==v?(y=n.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:v}),e[14]=v,e[15]=y):y=e[15];let j;e[16]!==p||e[17]!==s.status?(j=s.status==="draft"&&n.jsxs(n.Fragment,{children:[p.pillarTitle&&n.jsx(nt,{variant:"secondary",className:"max-w-full truncate",children:p.pillarTitle}),p.format?.name&&n.jsx(nt,{variant:"outline",className:"max-w-full truncate",children:p.format.name})]}),e[16]=p,e[17]=s.status,e[18]=j):j=e[18];let w;e[19]!==s.status||e[20]!==c?(w=s.status==="generating"&&n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[n.jsx(wt,{size:12,className:"animate-spin"}),c("sandbox.postBoard.generatingLabel")]}),e[19]=s.status,e[20]=c,e[21]=w):w=e[21];let N;e[22]!==s.missing||e[23]!==s.status||e[24]!==c?(N=s.status==="awaiting_review"&&(s.missing.length>0?n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[n.jsx(Wt,{size:12}),c("sandbox.postBoard.nIssues",{count:String(s.missing.length)})]}):n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-success",children:[n.jsx(il,{size:12}),c("sandbox.postBoard.readyToSchedule")]})),e[22]=s.missing,e[23]=s.status,e[24]=c,e[25]=N):N=e[25];let E;e[26]!==s.date||e[27]!==s.scheduledDatetime||e[28]!==s.status?(E=(s.status==="scheduled"||s.status==="published")&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[n.jsx(ks,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[26]=s.date,e[27]=s.scheduledDatetime,e[28]=s.status,e[29]=E):E=e[29];let B;e[30]!==j||e[31]!==w||e[32]!==N||e[33]!==E?(B=n.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[j,w,N,E]}),e[30]=j,e[31]=w,e[32]=N,e[33]=E,e[34]=B):B=e[34];let k;e[35]!==r||e[36]!==l||e[37]!==B||e[38]!==f||e[39]!==g||e[40]!==y?(k=n.jsxs("button",{type:"button",draggable:r,onDragStart:f,onClick:l,className:g,children:[y,B]}),e[35]=r,e[36]=l,e[37]=B,e[38]=f,e[39]=g,e[40]=y,e[41]=k):k=e[41];let D;return e[42]!==k||e[43]!==h||e[44]!==u?(D=n.jsxs("div",{className:h,children:[u,k]}),e[42]=k,e[43]=h,e[44]=u,e[45]=D):D=e[45],D}function Lr(t){const e=ae.c(40),{ideas:s,collapsed:o,pillarTitleOf:a,onToggleCollapsed:l,onGenerate:i,onDelete:c}=t,r=Se();let d,p,m,h,u,f,x;if(e[0]!==o||e[1]!==s.length||e[2]!==l||e[3]!==r){x=Symbol.for("react.early_return_sentinel");e:{if(d=r("sandbox.postBoard.ideasTray"),o){let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(Tt,{size:14,className:"shrink-0"}),e[11]=k):k=e[11];let D;e[12]!==s.length?(D=n.jsx("span",{className:"text-xs tabular-nums",children:s.length}),e[12]=s.length,e[13]=D):D=e[13],x=n.jsxs("button",{type:"button",onClick:l,"aria-label":r("sandbox.postBoard.expandLane",{lane:d}),"aria-expanded":!1,className:"flex w-11 shrink-0 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[k,D,n.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:d})]});break e}f="flex w-72 shrink-0 flex-col",u="flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",p="button",m=l,h=r("sandbox.postBoard.collapseLane",{lane:d})}e[0]=o,e[1]=s.length,e[2]=l,e[3]=r,e[4]=d,e[5]=p,e[6]=m,e[7]=h,e[8]=u,e[9]=f,e[10]=x}else d=e[4],p=e[5],m=e[6],h=e[7],u=e[8],f=e[9],x=e[10];if(x!==Symbol.for("react.early_return_sentinel"))return x;let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(ft,{size:14,className:"shrink-0"}),e[14]=g):g=e[14];let v;e[15]!==d?(v=n.jsx("span",{className:"truncate",children:d}),e[15]=d,e[16]=v):v=e[16];let y;e[17]!==p||e[18]!==m||e[19]!==h||e[20]!==v?(y=n.jsxs("button",{type:p,onClick:m,"aria-label":h,"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[g,v]}),e[17]=p,e[18]=m,e[19]=h,e[20]=v,e[21]=y):y=e[21];let j;e[22]!==s.length?(j=n.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:s.length}),e[22]=s.length,e[23]=j):j=e[23];let w;e[24]!==j||e[25]!==u||e[26]!==y?(w=n.jsxs("div",{className:u,children:[y,j]}),e[24]=j,e[25]=u,e[26]=y,e[27]=w):w=e[27];let N;e[28]!==s||e[29]!==c||e[30]!==i||e[31]!==a||e[32]!==r?(N=s.length===0?n.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:r("sandbox.postBoard.ideasEmpty")}):s.map(k=>{const D=a(k.pillarKey);return n.jsxs("div",{className:"group/card relative rounded-lg border border-dashed bg-card shadow-sm transition-colors hover:border-primary/40",children:[n.jsx(Is,{label:r("sandbox.postBoard.deleteIdea"),onArchive:()=>c(k),className:"top-2"}),n.jsxs("div",{className:"p-3",children:[n.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:k.title||r("sandbox.postBoard.untitledIdea")}),k.body&&n.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-muted-foreground",children:k.body}),D&&n.jsx(nt,{variant:"secondary",className:"mt-2 max-w-full truncate",children:D})]}),n.jsx("div",{className:"border-t px-3 py-2",children:n.jsxs(_e,{type:"button",variant:"ghost",size:"sm",disabled:!0,className:"h-7 w-full justify-start px-1.5 text-xs",onClick:()=>i(k),children:[n.jsx(et,{size:13}),r("sandbox.postBoard.writeFromIdea"),n.jsx(nt,{variant:"secondary",className:"ml-auto",children:r("common.soon")})]})})]},k.key)}),e[28]=s,e[29]=c,e[30]=i,e[31]=a,e[32]=r,e[33]=N):N=e[33];let E;e[34]!==N?(E=n.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto pb-2 pr-1",children:N}),e[34]=N,e[35]=E):E=e[35];let B;return e[36]!==w||e[37]!==E||e[38]!==f?(B=n.jsxs("div",{className:f,children:[w,E]}),e[36]=w,e[37]=E,e[38]=f,e[39]=B):B=e[39],B}function Is(t){const e=ae.c(13),{label:s,onArchive:o,disabled:a,className:l}=t,i=Se();let c;e[0]!==s||e[1]!==i?(c=s??i("sandbox.postBoard.delete"),e[0]=s,e[1]=i,e[2]=c):c=e[2];const r=c;let d;e[3]!==o?(d=u=>{u.stopPropagation(),o()},e[3]=o,e[4]=d):d=e[4];let p;e[5]!==l?(p=be("absolute right-2 z-10 flex size-6 cursor-pointer items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-destructive focus-visible:opacity-100 group-hover/card:opacity-100 group-hover/row:opacity-100",l),e[5]=l,e[6]=p):p=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Ts,{size:13}),e[7]=m):m=e[7];let h;return e[8]!==a||e[9]!==d||e[10]!==p||e[11]!==r?(h=n.jsx("button",{type:"button",disabled:a,"aria-label":r,title:r,onClick:d,className:p,children:m}),e[8]=a,e[9]=d,e[10]=p,e[11]=r,e[12]=h):h=e[12],h}function Ge(t){const e=ae.c(50),{icon:s,logoUrl:o,title:a,subtitle:l,active:i,accent:c,variantCount:r,trailing:d,selectable:p,selectionActive:m,selected:h,invalid:u,invalidReason:f,onToggleSelect:x,onClick:g,menu:v}=t,y=Se(),j=c==="global";let w;e[0]!==s||e[1]!==i||e[2]!==j||e[3]!==o?(w=o?n.jsx("img",{src:o,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):n.jsx("span",{className:be("flex size-8 shrink-0 items-center justify-center rounded-lg",j?"bg-global-section/15":"bg-muted"),children:n.jsx(s,{size:16,className:be("shrink-0",!j&&(i?"text-accent-foreground":"text-muted-foreground")),style:j?{color:Ps}:void 0})}),e[0]=s,e[1]=i,e[2]=j,e[3]=o,e[4]=w):w=e[4];const N=w,E=i?j?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":j?"hover:bg-global-section/10":"hover:bg-muted";let B;e[5]!==E?(B=be("group relative flex min-w-0 items-center rounded-md transition-colors",E),e[5]=E,e[6]=B):B=e[6];let k;e[7]!==x||e[8]!==p||e[9]!==h||e[10]!==m||e[11]!==y||e[12]!==a?(k=p&&n.jsx("span",{className:be("flex shrink-0 items-center pl-2.5 transition-opacity",h||m?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:Or,children:n.jsx(Xt,{checked:h,onCheckedChange:()=>x?.(),"aria-label":y("sandbox.itemRow.selectItem",{title:a})})}),e[7]=x,e[8]=p,e[9]=h,e[10]=m,e[11]=y,e[12]=a,e[13]=k):k=e[13];const D=u&&!i&&"text-destructive";let O;e[14]!==D?(O=be("block truncate text-sm font-medium",D),e[14]=D,e[15]=O):O=e[15];let L;e[16]!==O||e[17]!==a?(L=n.jsx("span",{className:O,children:a}),e[16]=O,e[17]=a,e[18]=L):L=e[18];const K=i?"text-accent-foreground/70":"text-muted-foreground";let F;e[19]!==K?(F=be("block truncate text-xs",K),e[19]=K,e[20]=F):F=e[20];let _;e[21]!==l||e[22]!==F?(_=n.jsx("span",{className:F,children:l}),e[21]=l,e[22]=F,e[23]=_):_=e[23];let A;e[24]!==_||e[25]!==L?(A=n.jsxs("span",{className:"min-w-0 flex-1",children:[L,_]}),e[24]=_,e[25]=L,e[26]=A):A=e[26];let I;e[27]!==i||e[28]!==y||e[29]!==r?(I=r!==void 0&&r>1&&n.jsxs(Qe,{children:[n.jsx(We,{asChild:!0,children:n.jsxs("span",{className:be("flex shrink-0 items-center gap-1 text-xs font-medium",i?"text-accent-foreground/70":"text-muted-foreground"),children:[n.jsx(_n,{size:14}),r]})}),n.jsx(Ye,{side:"bottom",children:y("sandbox.itemRow.variantCount",{count:r})})]}),e[27]=i,e[28]=y,e[29]=r,e[30]=I):I=e[30];let R;e[31]!==i||e[32]!==u||e[33]!==f?(R=u&&n.jsxs(Qe,{children:[n.jsx(We,{asChild:!0,children:n.jsx("span",{className:be("flex shrink-0 items-center",i?"text-accent-foreground":"text-destructive"),children:n.jsx(Wt,{size:14})})}),f&&n.jsx(Ye,{side:"bottom",children:f})]}),e[31]=i,e[32]=u,e[33]=f,e[34]=R):R=e[34];let G;e[35]!==g||e[36]!==N||e[37]!==A||e[38]!==I||e[39]!==R||e[40]!==d?(G=n.jsxs("button",{type:"button",onClick:g,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-lg px-2.5 py-2 text-left cursor-pointer",children:[N,A,I,R,d]}),e[35]=g,e[36]=N,e[37]=A,e[38]=I,e[39]=R,e[40]=d,e[41]=G):G=e[41];let z;e[42]!==i||e[43]!==v?(z=v&&n.jsx("div",{className:be("pr-1 opacity-0 transition-opacity group-hover:opacity-100",i&&"opacity-100"),children:v}),e[42]=i,e[43]=v,e[44]=z):z=e[44];let W;return e[45]!==G||e[46]!==z||e[47]!==B||e[48]!==k?(W=n.jsxs("div",{className:B,children:[k,G,z]}),e[45]=G,e[46]=z,e[47]=B,e[48]=k,e[49]=W):W=e[49],W}function Or(t){return t.stopPropagation()}function tt(t){const e=ae.c(10),{icon:s,title:o,description:a}=t;let l;e[0]!==s?(l=s&&n.jsx(s,{size:24,className:"text-muted-foreground/60"}),e[0]=s,e[1]=l):l=e[1];let i;e[2]!==o?(i=n.jsx("div",{children:o}),e[2]=o,e[3]=i):i=e[3];let c;e[4]!==a?(c=a&&n.jsx("div",{className:"text-xs text-muted-foreground/80 max-w-sm",children:a}),e[4]=a,e[5]=c):c=e[5];let r;return e[6]!==l||e[7]!==i||e[8]!==c?(r=n.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 p-6 text-center text-sm text-muted-foreground",children:[l,i,c]}),e[6]=l,e[7]=i,e[8]=c,e[9]=r):r=e[9],r}const Ir={loaders:En,actions:Ln},Rr={loaders:"Loaders",actions:"Actions"},Fr={analytics:Qo,blog:Hn,commerce:Yo,site:Wo,website:Kt};function Kr(t,e){return e===0?Fr[t.toLowerCase()]??zs:zs}function At(t,e){return e===0?xa(t):t}function zr(t){const e=ae.c(98),{orgSlug:s,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,kind:r}=t,d=Se();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=[],e[0]=p):p=e[0];const[m,h]=$.useState(p),[u,f]=$.useState(null),[x,g]=$.useState(""),[v,y]=$.useState(Wr),[j,w]=$.useState(r);j!==r&&(w(r),h([]),f(null),g(""),y(new Set));let N;e[1]===Symbol.for("react.memo_cache_sentinel")?(N=q=>{y(Z=>{const de=new Set(Z);return de.has(q)?de.delete(q):de.add(q),de})},e[1]=N):N=e[1];const E=N;let B;e[2]!==a||e[3]!==s||e[4]!==o?(B={orgSlug:s,virtualMcpId:o,branch:a},e[2]=a,e[3]=s,e[4]=o,e[5]=B):B=e[5];const k=Qt(B);let D;e[6]!==k?(D=zn((q,Z)=>k.mutate({blockKey:q,data:Z})),e[6]=k,e[7]=D):D=e[7];const O=D;let L;e[8]!==r?(L=ba(r),e[8]=r,e[9]=L):L=e[9];const K=L,F=Ir[r];let _,A,I,R,G,z,W;if(e[10]!==F||e[11]!==a||e[12]!==c||e[13]!==r||e[14]!==i||e[15]!==v||e[16]!==s||e[17]!==m||e[18]!==l||e[19]!==k||e[20]!==O||e[21]!==x||e[22]!==u||e[23]!==K||e[24]!==d||e[25]!==o){I=Symbol.for("react.early_return_sentinel");e:{const q=[...fa(i,c,r).map(Jr),...pa(i,r).map(qr)],Z=x.trim().toLowerCase(),de=Z.length>0,ne=de?q.filter(M=>M.title.toLowerCase().includes(Z)||M.resolveType.toLowerCase().includes(Z)):[],ue=new Map,te=[],re=new Map;if(!de){for(const M of q){const xe=M.folderPath;if(!(xe.length<m.length)&&m.every((ve,Le)=>xe[Le]===ve))if(xe.length===m.length)if(M.savedKey!==void 0){const ve=re.get(M.resolveType);ve?ve.push(M):re.set(M.resolveType,[M])}else te.push(M);else{const ve=xe[m.length],Le=ue.get(ve)??{count:0,savedCount:0};M.savedKey!==void 0?Le.savedCount=Le.savedCount+1:Le.count=Le.count+1,ue.set(ve,Le)}}te.sort(Hr);for(const M of re.values())M.sort(Ur)}const le=[...re.entries()].filter(M=>{const[xe]=M;return!te.some(ve=>ve.resolveType===xe)}).flatMap(Gr).sort(Vr);let T;e[33]!==m?(T=(M,xe)=>At(M.name,m.length).localeCompare(At(xe.name,m.length)),e[33]=m,e[34]=T):T=e[34];const J=[...ue.entries()].map(Mr).sort(T);let ee;e[35]===Symbol.for("react.memo_cache_sentinel")?(ee=M=>{f(M.savedKey!==void 0?{mode:"saved",key:M.savedKey}:{mode:"available",resolveType:M.resolveType,title:M.title})},e[35]=ee):ee=e[35];const oe=ee;let S;e[36]!==k||e[37]!==K||e[38]!==d?(S=async(M,xe)=>{await k.mutateAsync({blockKey:M,data:xe}),me.success(d("sandbox.runnableBlocksBrowser.savedBlockToast",{singular:K,blockId:M})),f({mode:"saved",key:M})},e[36]=k,e[37]=K,e[38]=d,e[39]=S):S=e[39];const se=S;let H;e[40]!==c||e[41]!==u?(H=Yr(u,c),e[40]=c,e[41]=u,e[42]=H):H=e[42];const ie=H;if(ie){const M=`${ie.mode}:${ie.mode==="saved"?ie.blockKey:ie.resolveType}`;let xe;e[43]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>f(null),e[43]=xe):xe=e[43];let ve;e[44]!==a||e[45]!==c||e[46]!==se||e[47]!==r||e[48]!==i||e[49]!==s||e[50]!==l||e[51]!==k.isPending||e[52]!==O||e[53]!==M||e[54]!==ie.editorTarget||e[55]!==ie.initialValue||e[56]!==o?(ve=n.jsx(ha,{orgSlug:s,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,kind:r,target:ie.editorTarget,initialValue:ie.initialValue,isCreating:k.isPending,onCreate:se,onSaveReferencedBlock:O,onBack:xe},M),e[44]=a,e[45]=c,e[46]=se,e[47]=r,e[48]=i,e[49]=s,e[50]=l,e[51]=k.isPending,e[52]=O,e[53]=M,e[54]=ie.editorTarget,e[55]=ie.initialValue,e[56]=o,e[57]=ve):ve=e[57],I=ve;break e}W="flex h-full w-full min-w-0 flex-col";let ye;e[58]!==d?(ye=d("sandbox.runnableBlocksBrowser.folderBreadcrumb"),e[58]=d,e[59]=ye):ye=e[59];let pe;e[60]===Symbol.for("react.memo_cache_sentinel")?(pe=()=>h([]),e[60]=pe):pe=e[60];const je=m.length===0?"font-medium text-foreground":"text-muted-foreground";let he;e[61]!==je?(he=be("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",je),e[61]=je,e[62]=he):he=e[62];const we=Rr[r];let Pe;e[63]!==he||e[64]!==we?(Pe=n.jsx("button",{type:"button",onClick:pe,className:he,children:we}),e[63]=he,e[64]=we,e[65]=Pe):Pe=e[65];let Te;e[66]!==m?(Te=m.map((M,xe)=>{const ve=xe===m.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[n.jsx(Tt,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>h(m.slice(0,xe+1)),className:be("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",ve?"font-medium text-foreground":"text-muted-foreground"),children:At(M,xe)})]},`${M}-${xe}`)}),e[66]=m,e[67]=Te):Te=e[67];let Ne;e[68]!==ye||e[69]!==Pe||e[70]!==Te?(Ne=n.jsxs("nav",{"aria-label":ye,className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:[Pe,Te]}),e[68]=ye,e[69]=Pe,e[70]=Te,e[71]=Ne):Ne=e[71];let Be;e[72]===Symbol.for("react.memo_cache_sentinel")?(Be=n.jsx(Ss,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[72]=Be):Be=e[72];let De;e[73]===Symbol.for("react.memo_cache_sentinel")?(De=M=>g(M.target.value),e[73]=De):De=e[73];let ge;e[74]!==r||e[75]!==d?(ge=d("sandbox.runnableBlocksBrowser.searchPlaceholder",{kind:r}),e[74]=r,e[75]=d,e[76]=ge):ge=e[76];let $e;e[77]!==r||e[78]!==d?($e=d("sandbox.runnableBlocksBrowser.searchAriaLabel",{kind:r}),e[77]=r,e[78]=d,e[79]=$e):$e=e[79];let Fe;e[80]!==x||e[81]!==ge||e[82]!==$e?(Fe=n.jsxs("div",{className:"flex w-56 shrink-0 items-center gap-2",children:[Be,n.jsx("input",{type:"text",value:x,onChange:De,placeholder:ge,"aria-label":$e,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[80]=x,e[81]=ge,e[82]=$e,e[83]=Fe):Fe=e[83],e[84]!==Ne||e[85]!==Fe?(A=n.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[Ne,Fe]}),e[84]=Ne,e[85]=Fe,e[86]=A):A=e[86],_=Yt,z="min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",R="mx-auto w-full max-w-4xl px-6 py-5",G=de?ne.length===0?n.jsx(tt,{title:d("sandbox.runnableBlocksBrowser.noSearchResults",{kind:r,query:x.trim()}),description:d("sandbox.runnableBlocksBrowser.noSearchResultsDescription")}):n.jsx("div",{className:"flex flex-col gap-1",children:ne.map(M=>n.jsx(Ge,{icon:F,accent:M.savedKey!==void 0?"global":void 0,title:M.title,subtitle:M.resolveType,active:!1,onClick:()=>oe(M)},M.savedKey??M.resolveType))}):J.length===0&&te.length===0&&le.length===0?n.jsx(tt,{title:d("sandbox.runnableBlocksBrowser.emptyFolderTitle",{kind:r}),description:m.length===0?d("sandbox.runnableBlocksBrowser.emptyFolderNoManifest"):d("sandbox.runnableBlocksBrowser.emptyFolder")}):n.jsxs(n.Fragment,{children:[J.length>0&&n.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2",children:J.map(M=>{const xe=Kr(M.name,m.length);return n.jsxs("button",{type:"button",onClick:()=>h([...m,M.name]),className:"flex items-center gap-2.5 rounded-lg border px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[n.jsx(xe,{size:18,className:"shrink-0 text-muted-foreground"}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm font-medium",children:At(M.name,m.length)}),n.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[M.count," ",M.count===1?K:r,M.savedCount>0&&n.jsxs(n.Fragment,{children:[" ","·"," ",d("sandbox.runnableBlocksBrowser.savedCountLabel",{count:M.savedCount})]})]})]})]},M.name)})}),(te.length>0||le.length>0)&&n.jsxs("div",{className:be("flex flex-col gap-1",J.length>0&&"mt-4"),children:[te.map(M=>{const xe=re.get(M.resolveType)??[],ve=v.has(M.resolveType);return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(Ge,{icon:F,title:M.title,subtitle:M.resolveType,active:!1,onClick:()=>oe(M)}),xe.length>0&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{type:"button",onClick:()=>E(M.resolveType),"aria-expanded":ve,className:"flex items-center gap-1 self-start rounded-lg px-2.5 py-1 text-xs font-medium transition-colors hover:bg-global-section/10 cursor-pointer ml-11",style:{color:Ps},children:[ve?n.jsx(ft,{size:12,className:"shrink-0"}):n.jsx(Tt,{size:12,className:"shrink-0"}),d(ve?"sandbox.runnableBlocksBrowser.hideSaved":"sandbox.runnableBlocksBrowser.seeSaved")," ","(",xe.length,")"]}),ve&&n.jsx("div",{className:"ml-11 flex flex-col gap-1 pb-1",children:xe.map(Le=>n.jsx(Ge,{icon:F,accent:"global",title:Le.title,subtitle:Le.resolveType,active:!1,onClick:()=>oe(Le)},Le.savedKey))})]})]},M.resolveType)}),le.map(M=>n.jsx(Ge,{icon:F,accent:"global",title:M.title,subtitle:M.resolveType,active:!1,onClick:()=>oe(M)},M.savedKey))]})]})}e[10]=F,e[11]=a,e[12]=c,e[13]=r,e[14]=i,e[15]=v,e[16]=s,e[17]=m,e[18]=l,e[19]=k,e[20]=O,e[21]=x,e[22]=u,e[23]=K,e[24]=d,e[25]=o,e[26]=_,e[27]=A,e[28]=I,e[29]=R,e[30]=G,e[31]=z,e[32]=W}else _=e[26],A=e[27],I=e[28],R=e[29],G=e[30],z=e[31],W=e[32];if(I!==Symbol.for("react.early_return_sentinel"))return I;let P;e[87]!==R||e[88]!==G?(P=n.jsx("div",{className:R,children:G}),e[87]=R,e[88]=G,e[89]=P):P=e[89];let U;e[90]!==_||e[91]!==P||e[92]!==z?(U=n.jsx(_,{className:z,children:P}),e[90]=_,e[91]=P,e[92]=z,e[93]=U):U=e[93];let Y;return e[94]!==A||e[95]!==U||e[96]!==W?(Y=n.jsxs("div",{className:W,children:[A,U]}),e[94]=A,e[95]=U,e[96]=W,e[97]=Y):Y=e[97],Y}function Mr(t){const[e,s]=t;return{name:e,...s}}function Vr(t,e){return t.title.localeCompare(e.title)}function Gr(t){const[,e]=t;return e}function Ur(t,e){return t.title.localeCompare(e.title)}function Hr(t,e){return t.title.localeCompare(e.title)}function qr(t){return{resolveType:t.resolveType,title:t.title,folderPath:Kn(t.resolveType)}}function Jr(t){return{resolveType:t.resolveType,title:t.title,folderPath:Kn(t.resolveType),savedKey:t.key}}function Wr(){return new Set}function Yr(t,e){if(!t)return null;if(t.mode==="available")return{mode:"available",resolveType:t.resolveType,editorTarget:{mode:"available",resolveType:t.resolveType,title:t.title},initialValue:{}};const{resolveType:s,props:o,title:a}=ga(e,t.key);return{mode:"saved",blockKey:t.key,resolveType:s,editorTarget:{mode:"saved",blockKey:t.key,resolveType:s,title:a},initialValue:o}}function Qr(t){const e=ae.c(106),{orgSlug:s,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,resolveType:r,title:d,defaultBlockId:p,isCreating:m,onCreate:h,onSaveReferencedBlock:u}=t,f=Se(),x=Bt(),g=x?.virtualMcpId,y=Wn(g===o?o:null)?.metadata?.siteSlug??null;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={},e[0]=j):j=e[0];const[w,N]=$.useState(j);let E;e[1]===Symbol.for("react.memo_cache_sentinel")?(E=[],e[1]=E):E=e[1];const[B,k]=$.useState(E),[D,O]=$.useState(0),[L,K]=$.useState(!1);let F;e[2]!==i||e[3]!==r?(F=Ns(r,i),e[2]=i,e[3]=r,e[4]=F):F=e[4];const _=F;let A,I,R,G,z,W,P,U;if(e[5]!==y||e[6]!==a||e[7]!==c||e[8]!==B||e[9]!==w||e[10]!==m||e[11]!==h||e[12]!==s||e[13]!==l||e[14]!==r||e[15]!==f||e[16]!==x?.taskId||e[17]!==d||e[18]!==o){const te=r.split("/").pop()?.replace(/\.tsx?$/,"")??r,re=x?.taskId??null,le=l??void 0;let T;e[27]!==y||e[28]!==a||e[29]!==s||e[30]!==le||e[31]!==re||e[32]!==o?(T={orgSlug:s,virtualMcpId:o,branch:a,threadId:re,previewUrl:le,siteSlug:y},e[27]=y,e[28]=a,e[29]=s,e[30]=le,e[31]=re,e[32]=o,e[33]=T):T=e[33],I=T;let J,ee,oe,S;if(e[34]!==c||e[35]!==B||e[36]!==w||e[37]!==h||e[38]!==f||e[39]!==d){const Pe=[d,...B],Te=Be=>{k(B.slice(0,Be)),O(Xr)};let Ne;e[48]!==c||e[49]!==w||e[50]!==h?(Ne=async Be=>{const De=va(Be,c);if(De){me.error(De);return}await h(Be,w),K(!1)},e[48]=c,e[49]=w,e[50]=h,e[51]=Ne):Ne=e[51],A=Ne,U="flex h-full w-full min-w-0",P="flex min-w-0 flex-1 flex-col",z="shrink-0 border-b px-3 py-2.5",S="flex min-w-0 items-center gap-2 overflow-hidden",e[52]!==f?(J=f("sandbox.availableSectionEditor.editingBreadcrumb"),e[52]=f,e[53]=J):J=e[53],ee="flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",oe=Pe.map((Be,De)=>{const ge=De===Pe.length-1,$e=ya(Be);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[De>0&&n.jsx(Tt,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Te(De),title:$e,className:be("min-w-0 truncate rounded-lg px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",ge?"font-medium text-foreground":"text-muted-foreground"),children:$e})]},`${$e}-${De}`)}),e[34]=c,e[35]=B,e[36]=w,e[37]=h,e[38]=f,e[39]=d,e[40]=A,e[41]=J,e[42]=ee,e[43]=oe,e[44]=S,e[45]=z,e[46]=P,e[47]=U}else A=e[40],J=e[41],ee=e[42],oe=e[43],S=e[44],z=e[45],P=e[46],U=e[47];let se;e[54]!==J||e[55]!==ee||e[56]!==oe?(se=n.jsx("nav",{"aria-label":J,className:ee,children:oe}),e[54]=J,e[55]=ee,e[56]=oe,e[57]=se):se=e[57];let H;e[58]===Symbol.for("react.memo_cache_sentinel")?(H=()=>K(!0),e[58]=H):H=e[58];let ie;e[59]!==f?(ie=f("sandbox.availableSectionEditor.saveAsGlobalSection"),e[59]=f,e[60]=ie):ie=e[60];let ye;e[61]===Symbol.for("react.memo_cache_sentinel")?(ye=n.jsx(Xo,{size:14}),e[61]=ye):ye=e[61];let pe;e[62]!==m||e[63]!==ie?(pe=n.jsx(We,{asChild:!0,children:n.jsx(_e,{size:"icon",className:"size-8 shrink-0",disabled:m,onClick:H,"aria-label":ie,children:ye})}),e[62]=m,e[63]=ie,e[64]=pe):pe=e[64];let je;e[65]!==f?(je=f("sandbox.availableSectionEditor.saveAsGlobalSection"),e[65]=f,e[66]=je):je=e[66];let he;e[67]!==je?(he=n.jsx(Ye,{side:"bottom",children:je}),e[67]=je,e[68]=he):he=e[68];let we;e[69]!==pe||e[70]!==he?(we=n.jsxs(Qe,{children:[pe,he]}),e[69]=pe,e[70]=he,e[71]=we):we=e[71],e[72]!==S||e[73]!==se||e[74]!==we?(W=n.jsxs("div",{className:S,children:[se,we]}),e[72]=S,e[73]=se,e[74]=we,e[75]=W):W=e[75],R="mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",G=f("sandbox.availableSectionEditor.localEditsHint",{typeLabel:te}),e[5]=y,e[6]=a,e[7]=c,e[8]=B,e[9]=w,e[10]=m,e[11]=h,e[12]=s,e[13]=l,e[14]=r,e[15]=f,e[16]=x?.taskId,e[17]=d,e[18]=o,e[19]=A,e[20]=I,e[21]=R,e[22]=G,e[23]=z,e[24]=W,e[25]=P,e[26]=U}else A=e[19],I=e[20],R=e[21],G=e[22],z=e[23],W=e[24],P=e[25],U=e[26];let Y;e[76]!==R||e[77]!==G?(Y=n.jsx("p",{className:R,children:G}),e[76]=R,e[77]=G,e[78]=Y):Y=e[78];let q;e[79]!==Y||e[80]!==z||e[81]!==W?(q=n.jsxs("div",{className:z,children:[W,Y]}),e[79]=Y,e[80]=z,e[81]=W,e[82]=q):q=e[82];let Z;e[83]!==c||e[84]!==B||e[85]!==D||e[86]!==w||e[87]!==i||e[88]!==u||e[89]!==I||e[90]!==_||e[91]!==f?(Z=n.jsx(Yt,{className:"min-h-0 flex-1 [&_[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:_?n.jsx(Mn,{schema:_,value:w,onChange:te=>N(te),basePath:"",breadcrumbPath:B,onBreadcrumbChange:k,meta:i,decofile:c,onSaveReferencedBlock:u,sandbox:I},D):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:f("sandbox.availableSectionEditor.noEditableFields")})})})}),e[83]=c,e[84]=B,e[85]=D,e[86]=w,e[87]=i,e[88]=u,e[89]=I,e[90]=_,e[91]=f,e[92]=Z):Z=e[92];let de;e[93]!==q||e[94]!==Z||e[95]!==P?(de=n.jsxs("div",{className:P,children:[q,Z]}),e[93]=q,e[94]=Z,e[95]=P,e[96]=de):de=e[96];let ne;e[97]!==p||e[98]!==A||e[99]!==m||e[100]!==L?(ne=n.jsx(ja,{open:L,onOpenChange:K,defaultBlockId:p,isPending:m,onSubmit:A}),e[97]=p,e[98]=A,e[99]=m,e[100]=L,e[101]=ne):ne=e[101];let ue;return e[102]!==de||e[103]!==ne||e[104]!==U?(ue=n.jsxs("div",{className:U,children:[de,ne]}),e[102]=de,e[103]=ne,e[104]=U,e[105]=ue):ue=e[105],ue}function Xr(t){return t+1}function Zr(t,e){const s={__resolveType:t},o=wa([s],e)[0];return o?Na(s,o,e):null}function ec({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,meta:a,decofile:l,blockKey:i,onSaveReferencedBlock:c}){const r=Se(),d=Bt(),p=d?.virtualMcpId,h=Wn(p===e?e:null)?.metadata?.siteSlug??null,[u]=$.useState(()=>Zr(i,l)),[f,x]=$.useState(u?.data??{}),[g,v]=$.useState([]),[y,j]=$.useState(0),[w,N]=$.useState(!1),[E,B]=$.useState(null),k=E!==null,{save:D,flush:O}=ka({orgSlug:t,virtualMcpId:e,branch:s}),L=u?.resolveType?Ns(u.resolveType,a):null,K=l[i],F=K?Ka(i,K):i,_=d?.taskId??null,A={orgSlug:t,virtualMcpId:e,branch:s,threadId:_,previewUrl:o??void 0,siteSlug:h},I=P=>{x(P),D(i,P)},R=()=>{k?(B(null),N(!1),j(P=>P+1)):B(JSON.stringify(f,null,2))},G=P=>{const U=P??"";try{const Y=JSON.parse(U);if(Y&&typeof Y=="object"&&!Array.isArray(Y)){N(!1),I(Y);return}N(!0)}catch{N(!0)}},z=[F,...g],W=P=>{v(g.slice(0,P)),j(U=>U+1)};return n.jsx("div",{className:"flex h-full w-full min-w-0",children:n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsx(Sa,{crumbs:z,onSelect:W}),n.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[n.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Ps},"aria-hidden":!0}),n.jsx("div",{className:"flex-1"}),n.jsxs(Qe,{children:[n.jsx(We,{asChild:!0,children:n.jsx(_e,{variant:k?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:R,"aria-label":r(k?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson"),"aria-pressed":k,children:k?n.jsx(Bs,{size:14}):n.jsx(Dn,{size:14})})}),n.jsx(Ye,{side:"bottom",children:r(k?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson")})]})]}),n.jsx("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:r("sandbox.savedSectionEditor.globalSectionDescription")})]}),n.jsxs("div",{className:"relative min-h-0 flex-1",children:[n.jsx(Yt,{className:"h-full [&_[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:L?n.jsx(Mn,{schema:L,value:f,onChange:P=>I(P),basePath:"",breadcrumbPath:g,onBreadcrumbChange:v,meta:a,decofile:l,onSaveReferencedBlock:c,sandbox:A},y):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sandbox.savedSectionEditor.noEditableFields")})})})}),E!==null&&n.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[w&&n.jsx("div",{className:"shrink-0 border-b bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:r("sandbox.savedSectionEditor.invalidJsonError")}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(Jn,{language:"json",height:"100%",code:E,onChange:G,onSave:P=>{G(P),O()}})})]})]})]})})}function tc(t){const e=ae.c(36),{selection:s,orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,isCreating:d,onCreateAvailable:p,onSaveReferencedBlock:m}=t,h=Se();if(!s){let x;e[0]!==h?(x=h("sandbox.sectionsRightPane.selectSectionTitle"),e[0]=h,e[1]=x):x=e[1];let g;e[2]!==h?(g=h("sandbox.sectionsRightPane.selectSectionDescription"),e[2]=h,e[3]=g):g=e[3];let v;return e[4]!==x||e[5]!==g?(v=n.jsx(tt,{title:x,description:g}),e[4]=x,e[5]=g,e[6]=v):v=e[6],v}if(s.collection==="available-section"){const x=`available:${s.resolveType}`,g=s.resolveType,v=s.title;let y;e[7]!==s.title?(y=Ca(s.title),e[7]=s.title,e[8]=y):y=e[8];let j;e[9]!==p||e[10]!==s.resolveType?(j=(N,E)=>p(s.resolveType,N,E),e[9]=p,e[10]=s.resolveType,e[11]=j):j=e[11];let w;return e[12]!==l||e[13]!==r||e[14]!==d||e[15]!==c||e[16]!==m||e[17]!==o||e[18]!==i||e[19]!==s.resolveType||e[20]!==s.title||e[21]!==x||e[22]!==y||e[23]!==j||e[24]!==a?(w=n.jsx(Qr,{orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,resolveType:g,title:v,defaultBlockId:y,isCreating:d,onCreate:j,onSaveReferencedBlock:m},x),e[12]=l,e[13]=r,e[14]=d,e[15]=c,e[16]=m,e[17]=o,e[18]=i,e[19]=s.resolveType,e[20]=s.title,e[21]=x,e[22]=y,e[23]=j,e[24]=a,e[25]=w):w=e[25],w}const u=`saved:${s.key}`;let f;return e[26]!==l||e[27]!==r||e[28]!==c||e[29]!==m||e[30]!==o||e[31]!==i||e[32]!==s.key||e[33]!==u||e[34]!==a?(f=n.jsx(ec,{orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,blockKey:s.key,onSaveReferencedBlock:m},u),e[26]=l,e[27]=r,e[28]=c,e[29]=m,e[30]=o,e[31]=i,e[32]=s.key,e[33]=u,e[34]=a,e[35]=f):f=e[35],f}function $t(t){const e=ae.c(34),{onDuplicate:s,onRename:o,onAddVariant:a,onEditSeo:l,onViewJson:i,onDelete:c}=t,r=Se();let d;e[0]!==r?(d=r("sandbox.itemActions.moreActions"),e[0]=r,e[1]=d):d=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Oo,{size:14}),e[2]=p):p=e[2];let m;e[3]!==d?(m=n.jsx(It,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":d,className:"flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:sc,children:p})}),e[3]=d,e[4]=m):m=e[4];let h;e[5]!==o||e[6]!==r?(h=o&&n.jsxs(Je,{onClick:o,children:[n.jsx(ml,{size:14}),r("sandbox.itemActions.rename")]}),e[5]=o,e[6]=r,e[7]=h):h=e[7];let u;e[8]!==s||e[9]!==r?(u=s&&n.jsxs(Je,{onClick:s,children:[n.jsx(ul,{size:14}),r("sandbox.itemActions.duplicate")]}),e[8]=s,e[9]=r,e[10]=u):u=e[10];let f;e[11]!==a||e[12]!==r?(f=a&&n.jsxs(n.Fragment,{children:[n.jsx(ds,{}),n.jsxs(Je,{onClick:a,className:"cursor-pointer text-success focus:text-success",children:[n.jsx(_n,{size:14}),r("sandbox.itemActions.addVariant")]})]}),e[11]=a,e[12]=r,e[13]=f):f=e[13];let x;e[14]!==l||e[15]!==i||e[16]!==r?(x=(l||i)&&n.jsxs(n.Fragment,{children:[n.jsx(ds,{}),l&&n.jsxs(Je,{onClick:l,children:[n.jsx(Bn,{size:14}),r("sandbox.itemActions.editSeo")]}),i&&n.jsxs(Je,{onClick:i,children:[n.jsx(Dn,{size:14}),r("sandbox.itemActions.viewJson")]})]}),e[14]=l,e[15]=i,e[16]=r,e[17]=x):x=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(ds,{}),e[18]=g):g=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ts,{size:14}),e[19]=v):v=e[19];let y;e[20]!==r?(y=r("sandbox.itemActions.delete"),e[20]=r,e[21]=y):y=e[21];let j;e[22]!==c||e[23]!==y?(j=n.jsxs(Je,{onClick:c,className:"text-destructive focus:text-destructive",children:[v,y]}),e[22]=c,e[23]=y,e[24]=j):j=e[24];let w;e[25]!==j||e[26]!==h||e[27]!==u||e[28]!==f||e[29]!==x?(w=n.jsxs(Rt,{align:"end",className:"w-44",children:[h,u,f,x,g,j]}),e[25]=j,e[26]=h,e[27]=u,e[28]=f,e[29]=x,e[30]=w):w=e[30];let N;return e[31]!==w||e[32]!==m?(N=n.jsxs(Ft,{children:[m,w]}),e[31]=w,e[32]=m,e[33]=N):N=e[33],N}function sc(t){return t.stopPropagation()}function nc(t){return t.split("/").pop()?.replace(/\.tsx?$/,"")||t||"Section"}function oc(t){const e=new Map;for(const s of t){const o=nc(s.resolveType),a=e.get(o);a?a.push(s):e.set(o,[s])}return[...e.entries()].map(([s,o])=>({label:s,sections:o})).sort((s,o)=>s.label.localeCompare(o.label))}function jn(t){const e=ae.c(8),{icon:s,label:o,className:a}=t;let l;e[0]!==a?(l=be("flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",a),e[0]=a,e[1]=l):l=e[1];let i;e[2]!==s?(i=n.jsx(s,{size:13,className:"shrink-0"}),e[2]=s,e[3]=i):i=e[3];let c;return e[4]!==o||e[5]!==l||e[6]!==i?(c=n.jsxs("div",{className:l,children:[i,o]}),e[4]=o,e[5]=l,e[6]=i,e[7]=c):c=e[7],c}const kn=$.lazy(()=>He(()=>import("./app-editor-BhWLpri1.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168])).then(t=>({default:t.AppEditor}))),ac=$.lazy(()=>He(()=>import("./post-editor-D2HU9kfD.js"),__vite__mapDeps([169,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,29,28,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,56,81,170,156,135,76,77,55,106,118,113,111,61,60,58,62,63,64,65,66,67,68,69,70,71,72,23,73,74,75,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,107,21,22,108,109,110,57,112,114,115,116,117,119,120,121,122,123,124,171,139,59,172,173,174,125,126,127,128,129,130,131,132,133,134,136,137,138,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,157,158,159,160,161,162,163,164,165,166,167,168])).then(t=>({default:t.PostEditor}))),lc=$.lazy(()=>He(()=>import("./record-editor-C0G9mTGj.js"),__vite__mapDeps([175,1,2,56,81,22,23,24,25,111,61,60,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,58,28,29,30,31,32,33,34,35,36,37,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,62,63,64,65,66,67,68,69,55,70,71,72,73,74,75,76,77,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,21,108,109,110,57,112,113,114,115,116,117,118,119,120,121,122,123,124,174,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168])).then(t=>({default:t.RecordEditor}))),ic=$.lazy(()=>He(()=>import("./context-BL1LKuLQ.js"),__vite__mapDeps([176,1,2,25,28,29,30,31,32,33,34,35,36,37,24,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,56,81,111,106,18,177,102,96,55,103,98,70,71,4,5,6,7,8,9,72,23,112,139,172,69,74,76,77,178,143,140,61,60,11,12,13,14,15,3,10,16,17,19,20,58,62,63,64,65,66,67,68,73,75,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,97,99,100,101,104,105,107,21,22,108,109,110,57,113,114,115,116,117,118,119,120,121,122,123,124,166,174,175,125,126,127,128,129,130,131,132,133,134,135,136,137,138,141,142,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,167,168,179,171,59,173])).then(t=>({default:t.BlogContext}))),rc=$.lazy(()=>He(()=>import("./category-editor-DjdC64aL.js"),__vite__mapDeps([179,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,33,35,45,28,29,30,31,32,34,36,37,24,25,27,38,39,40,41,42,43,44,46,47,48,49,50,51,52,53,54,115,56,81,171,112,76,77,55,106,61,60,58,62,63,64,65,66,67,68,69,70,71,72,23,73,74,75,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,107,21,22,108,109,110,111,57,113,114,116,117,118,119,120,121,122,123,124,139,59,172,173,174,125,126,127,128,129,130,131,132,133,134,135,136,137,138,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168])).then(t=>({default:t.CategoryEditor}))),cc=$.lazy(()=>He(()=>import("./sections-editor-CsNiIfgn.js"),__vite__mapDeps([180,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,57,61,60,58,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,62,63,64,65,66,67,68,69,55,70,71,72,23,73,74,75,76,77,78,79,80,56,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,21,22,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,166,181,26,59,182])).then(t=>({default:t.SectionsEditor}))),dc=$.lazy(()=>He(()=>import("./seo-editor-D4_b59uB.js"),__vite__mapDeps([183,1,2,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,21,22,23,61,60,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,58,62,63,64,65,66,67,68,69,55,70,71,72,73,74,75,76,77,78,79,80,56,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,57,112,113,114,115,116,117,118,119,120,121,122,123,124,181])).then(t=>({default:t.SeoEditor}))),uc=$.lazy(()=>He(()=>import("./variant-calendar-C6HvphcB.js"),__vite__mapDeps([184,1,2,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,81,21,22,23,113,72,185,125,126,121,119,20,14,13,122,5,4,6,7,8,9,11,12,15,100,127,94,98,128,3,10,16,17,18,19,96,55,129,87,71,101,102,103,56,70,130,73,74,75,76,77,78,79,80,82,83,84,85,86,88,89,90,91,131,60,68,67,69,64,65,118,132,123,97,133,134,135,136,106,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,111,152,153,154,155,156,157,158,159,160,63,66,92,93,95,99,104,105,161,116,62,162,163,164,165,115,61,58,107,108,109,110,57,112,114,117,120,124,166,167,168])).then(t=>({default:t.VariantCalendar}))),mc=$.lazy(()=>He(()=>import("./post-calendar-Cl-vAwk3.js"),__vite__mapDeps([186,1,2,29,28,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,187,21,22,23,125,126,121,119,20,14,13,122,5,4,6,7,8,9,11,12,15,100,127,94,98,128,3,10,16,17,18,19,96,72,55,129,87,71,101,102,103,81,56,70,130,73,74,75,76,77,78,79,80,82,83,84,85,86,88,89,90,91,131,60,68,67,69,64,65,118,132,123,97,133,134,135,136,106,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,111,152,153,154,155,156,157,158,159,160,63,66,92,93,95,99,104,105,161,116,62,162,163,164,165,115,61,58,107,108,109,110,57,112,113,114,117,120,124,166,167,168])).then(t=>({default:t.PostCalendar}))),fc=$.lazy(()=>He(()=>import("./redirect-editor-BpclUTIj.js"),__vite__mapDeps([188,1,2,135,24,56,81,22,23,25,61,60,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,58,28,29,30,31,32,33,34,35,36,37,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,62,63,64,65,66,67,68,69,55,70,71,72,73,74,75,76,77,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,21,108,109,110,111,57,112,113,114,115,116,117,118,119,120,121,122,123,124,174])).then(t=>({default:t.RedirectEditor})));function pc(t){const e=ae.c(20),{deepLinkPage:s}=t,{currentBranch:o,virtualMcpId:a}=Cn(),{org:l}=Io(),i=Xa(),c=Za(),{runtime:r,previewServerUrl:d}=qn(a),p=r==="cms";let m;e[0]!==p||e[1]!==c.previewState||e[2]!==i.lifecycle.phase?(m=Al({fastPreviewActive:p,previewState:c.previewState,lifecyclePhase:i.lifecycle.phase}),e[0]=p,e[1]=c.previewState,e[2]=i.lifecycle.phase,e[3]=m):m=e[3];const h=m;if(h.kind==="sandbox-card"){const x=`/${l.slug}/settings/connections`;let g;return e[4]!==h.state||e[5]!==c.start||e[6]!==x||e[7]!==i.lifecycle||e[8]!==i.phase?(g=n.jsx(_l,{state:h.state,claimPhase:i.phase,lifecycle:i.lifecycle,onStart:c.start,connectionsHref:x}),e[4]=h.state,e[5]=c.start,e[6]=x,e[7]=i.lifecycle,e[8]=i.phase,e[9]=g):g=e[9],g}if(!a||!o){let x;return e[10]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(tt,{title:"Waiting for sandbox context…"}),e[10]=x):x=e[10],x}const u=p?d:c.previewUrl;let f;return e[11]!==o||e[12]!==s||e[13]!==h.devServerReady||e[14]!==h.sandboxWarming||e[15]!==c.previewUrl||e[16]!==l.slug||e[17]!==u||e[18]!==a?(f=n.jsx(gc,{orgSlug:l.slug,virtualMcpId:a,branch:o,previewUrl:c.previewUrl,sitePreviewUrl:u,deepLinkPage:s,devServerReady:h.devServerReady,sandboxWarming:h.sandboxWarming}),e[11]=o,e[12]=s,e[13]=h.devServerReady,e[14]=h.sandboxWarming,e[15]=c.previewUrl,e[16]=l.slug,e[17]=u,e[18]=a,e[19]=f):f=e[19],f}const Sn=2e3,hc=15;function wn(t,e,s,o){return typeof e!="string"||s&&(Yn(e,s,o)||t.state.dataUpdateCount>=hc)?!1:Sn}function gc({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,sitePreviewUrl:a,deepLinkPage:l,devServerReady:i,sandboxWarming:c}){const r=Se(),d=Bt()?.taskId??null,p={orgSlug:t,virtualMcpId:e,branch:s,threadId:d,previewUrl:o},{data:m,isLoading:h}=Pa(p,{fetchEnabled:i}),u=Nn({strict:!1}),[f,x]=$.useState(()=>u.contentCollection&&ot(u.contentCollection)&&u.contentCollection||"pages"),[g,v]=$.useState(()=>u.contentItem&&ot(f)?{collection:f,key:u.contentItem}:null),[y,j]=$.useState(null),w=!!(l?.pageId||l?.path||l?.pathTemplate),[N,E]=$.useState(!1);if(w&&!N&&g===null&&m){E(!0);const b=za(Us(m),l??{});b&&(x("pages"),v({collection:"pages",key:b.key,path:b.path}))}const[B,k]=$.useState(""),[D,O]=$.useState("board"),L=b=>{v(b),j(null)},[K,F]=$.useState(f);K!==f&&(F(f),k(""));const{data:_,isLoading:A,isFetching:I}=Ta(p,{fetchEnabled:i,refetchInterval:b=>{const V=b.state.data;if(f==="apps"&&g&&g.collection==="apps"){const ce=m?.[g.key];return wn(b,typeof ce?.__resolveType=="string"?ce.__resolveType:void 0,V)}if(f==="site"&&m){const ce=V?Hs(m,V):null,fe=m.site,Ae=ce?.resolveType??(typeof fe?.__resolveType=="string"?fe.__resolveType:void 0);return wn(b,Ae,V,["seo"])}return!1}}),R=(b,V)=>!Yn(b,_,V)&&(A||I),{catalog:G,isLoading:z}=Pl(_??void 0,m??void 0,{enabled:f==="apps"}),W=Ui({orgSlug:t,virtualMcpId:e,branch:s,meta:_}),P=Qt(p),U=Un(p),Y=Ji({orgSlug:t,virtualMcpId:e,branch:s,decofile:m??{},support:W,onMoved:(b,V)=>v(ce=>ce?.collection==="posts"&&ce.key===b?{collection:"posts",key:V}:ce)}),[q,Z]=$.useState(null),[de,ne]=$.useState(),[ue,te]=$.useState(!1),[re,le]=$.useState(),[T,J]=$.useState(null),[ee,oe]=$.useState(null),[S,se]=$.useState(null),H=!m||!_;if(h||A||H&&c)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(lt,{className:"size-5 text-muted-foreground"})});if(H)return n.jsx(tt,{title:"Could not load site data."});const ie=Us(m).sort((b,V)=>b.name.localeCompare(V.name)),ye=Ma(m).sort((b,V)=>b.from.localeCompare(V.from)),pe=Va(m,_),je=f==="sections"?Ga(_):[],he=Hs(m,_),we=to(m),Pe=Es.some(b=>we[b].length>0),Te=ot(f)?we[f]:[],Ne=Vs(_,"loaders"),Be=Vs(_,"actions");if(!Ua(m,_)&&!Pe&&Ne===0&&Be===0)return n.jsx(tt,{icon:Wt,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, apps, loaders, or actions."});const De={pages:ie.length,sections:pe.length,apps:G.length,loaders:Ne,actions:Be,redirects:ye.length,posts:we.posts.length,authors:we.authors.length,categories:we.categories.length},ge=new Set(ie.map(b=>Lt(b.path))),$e=new Set(ie.map(b=>b.name)),Fe=new Set(pe.map(b=>b.name)),M=async b=>{const V=m[b.key];if(!V)return;const ce=Vn(m,b.key),fe=Ba(m,b.key,Math.max(0,ce-1)),Ae=Ea(V.sections,fe);if(Ae)try{await P.mutateAsync({blockKey:b.key,data:{...V,sections:Ae}}),me.success(`Variant added to "${b.name}"`),v({collection:"pages",key:b.key,path:b.path})}catch(Oe){me.error(Oe instanceof Error?Oe.message:"Could not add variant")}},xe=()=>{ne(void 0),Z({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},ve=b=>{ne(void 0),Z({mode:"duplicate",sourceKey:b.key,initialName:Qs($e,b.name),initialPath:$l(ge,b.path)})},Le=b=>{ne(void 0),Z({mode:"rename",sourceKey:b.key,initialName:b.name,initialPath:b.path})},ss=async b=>{if(!q)return;const{mode:V,sourceKey:ce}=q;try{if(V==="create"){let fe;if(b.templateKey){const Oe=m[b.templateKey];if(!Oe)throw new Error("Selected template no longer exists.");fe={...Oe,name:b.name,path:b.path}}else fe=Il(b.name,b.path);const Ae=Fl(m,b.name);await P.mutateAsync({blockKey:Ae,data:fe}),me.success(`Created "${b.name}"`),v({collection:"pages",key:Ae,path:b.path})}else if(V==="duplicate"&&ce){const fe=m[ce];if(!fe)throw new Error("Source page not found");const{key:Ae,data:Oe}=Ol({source:fe,pages:ie,newName:b.name,newPath:b.path});await P.mutateAsync({blockKey:Ae,data:Oe}),me.success(`Duplicated as "${b.name}"`),v({collection:"pages",key:Ae,path:b.path})}else if(V==="rename"&&ce){const fe=m[ce];if(!fe)throw new Error("Page not found");const Ae={...fe,name:b.name,path:b.path};await P.mutateAsync({blockKey:ce,data:Ae}),me.success("Page updated"),g?.collection==="pages"&&g.key===ce&&v({collection:"pages",key:ce,path:b.path})}Z(null)}catch(fe){ne(fe instanceof Error?fe.message:"Save failed")}},ns=({path:b})=>{if(!q)return null;const V=Lt(b);return(q.mode==="rename"?Lt(q.initialPath):null)!==V&&ge.has(V)?`A page with path "${b}" already exists.`:null},os=async(b,V,ce)=>{await P.mutateAsync({blockKey:V,data:{...ce,name:V,__resolveType:b}}),me.success(r("sandbox.contentBrowser.createdSection",{name:V})),v({collection:"sections",key:V})},as=zn((b,V)=>P.mutate({blockKey:b,data:V})),ls=async b=>{const V=m[b.key];if(!V){me.error(r("sandbox.contentBrowser.sectionNotFound"));return}const ce=Ll(m,b.key),fe=Qs(Fe,b.name),Ae={...V,name:fe};try{await P.mutateAsync({blockKey:ce,data:Ae}),me.success(r("sandbox.contentBrowser.duplicatedSection",{name:b.name})),v({collection:"sections",key:ce})}catch(Oe){me.error(Oe instanceof Error?Oe.message:r("sandbox.contentBrowser.duplicateFailed"))}},is=async b=>{if(!T)return;const V=m[T];if(!V){me.error(r("sandbox.contentBrowser.sectionNotFound"));return}try{await P.mutateAsync({blockKey:T,data:{...V,name:b}}),me.success(r("sandbox.contentBrowser.sectionRenamed")),J(null)}catch(ce){me.error(ce instanceof Error?ce.message:r("sandbox.contentBrowser.renameFailed"))}},_t=()=>{le(void 0),te(!0)},rs=async b=>{const V=Ha(m,b.from),ce=qa(b);try{await P.mutateAsync({blockKey:V,data:ce}),me.success("Created redirect"),te(!1),v({collection:"redirects",key:V})}catch(fe){le(fe instanceof Error?fe.message:"Could not create redirect")}},cs=async b=>{const V=hs(m,b),ce=at(V,b,co(b));try{await P.mutateAsync({blockKey:V,data:ce}),me.success(`Created ${Nt[b]}`),v({collection:b,key:V})}catch(fe){me.error(fe instanceof Error?fe.message:"Could not create")}},C=async b=>{const V=hs(m,"posts"),ce=at(V,"posts",Bi(b));try{await P.mutateAsync({blockKey:V,data:ce}),me.success(r("sandbox.postCalendar.createdScheduledPost")),x("posts"),F("posts"),v({collection:"posts",key:V}),j(null)}catch(fe){me.error(fe instanceof Error?fe.message:r("sandbox.postCalendar.couldNotCreate"))}},Q=async(b,V)=>{const ce=m[b],fe=ce?_i(dt(ce,"posts"),V):null;if(!fe){me.error(r("sandbox.postCalendar.onlyScheduledCanMove"));return}try{await P.mutateAsync({blockKey:b,data:at(b,"posts",fe)})}catch(Ae){me.error(Ae instanceof Error?Ae.message:r("sandbox.postCalendar.couldNotReschedule"))}},Ee=async b=>{const V=m[b.key];if(!V){me.error("Record not found.");return}const ce=hs(m,b.kind),fe=b.kind==="posts"?"title":"name",Ae={...structuredClone(dt(V,b.kind)),[fe]:`${b.label} (copy)`};try{await P.mutateAsync({blockKey:ce,data:at(ce,b.kind,Ae)}),me.success(`Duplicated "${b.label}"`),v({collection:b.kind,key:ce})}catch(Oe){me.error(Oe instanceof Error?Oe.message:"Duplicate failed")}},Ve=()=>{x("posts"),F("posts"),v(null),j(null),k("")},qe=async()=>{if(ee)try{const{kind:b,key:V,label:ce}=ee;if(b==="blog"){if(ee.blogKind==="categories"){const fe=dt(m[V],"categories").slug,Ae=typeof fe=="string"?fe:"";if(Ae)for(const{key:Oe,payload:Rs}of Ue(m,"posts")){const Fs=li(Rs,Ae);Fs!==Rs&&await P.mutateAsync({blockKey:Oe,data:at(Oe,"posts",ii(Fs))})}}await U.mutateAsync({blockKey:V})}else await U.mutateAsync({blockKey:V});me.success(`Deleted "${ce}"`),g&&g.collection!=="available-section"&&g.key===V&&v(null),oe(null)}catch(b){me.error(b instanceof Error?b.message:"Delete failed")}},Ce=U.isPending||P.isPending,xt=ee?.kind==="blog"?Nt[ee.blogKind]:ee?.kind??"item";return n.jsxs("div",{className:"flex h-full w-full",children:[n.jsx(Bl,{active:f,counts:De,showBlog:Pe,onSelect:b=>{x(b),v(null),j(null)}}),f!=="seo"&&f!=="site"&&f!=="context"&&f!=="calendar"&&f!=="post-schedule"&&f!=="posts"&&f!=="loaders"&&f!=="actions"&&n.jsx(xc,{activeCollection:f,pages:ie,redirects:ye,sections:pe,availableSections:je,appCatalog:G,appCatalogLoading:z,blogEntries:Te,decofile:m,searchQuery:B,onSearchChange:k,selection:g,onSelect:L,onCreate:()=>{f==="pages"?xe():f==="redirects"?_t():ot(f)&&cs(f)},onDuplicatePage:ve,onRenamePage:Le,onAddPageVariant:M,onDeletePage:b=>oe({kind:"page",key:b.key,label:b.name}),onEditPageSeo:b=>{const V={collection:"pages",key:b.key,path:b.path};v(V),j(b.key)},onViewPageJson:b=>se(b.key),onDuplicateSection:ls,onRenameSection:b=>J(b.key),onDeleteSection:b=>oe({kind:"section",key:b.key,label:b.name}),onDeleteRedirect:b=>oe({kind:"redirect",key:b.key,label:b.from||b.key}),onDuplicateBlog:Ee,onDeleteBlog:b=>oe({kind:"blog",blogKind:b.kind,key:b.key,label:b.label})}),n.jsx("div",{className:"flex-1 min-w-0",children:f==="loaders"||f==="actions"?n.jsx(zr,{orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,meta:_,decofile:m,kind:f}):n.jsx($.Suspense,{fallback:n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(lt,{className:"size-5 text-muted-foreground"})}),children:f==="calendar"?n.jsx(uc,{decofile:m}):f==="post-schedule"?n.jsx(mc,{decofile:m,support:W,isCreating:P.isPending,onCreate:b=>{C(b)},onReschedule:(b,V)=>{Q(b,V)},onSelect:b=>{x("posts"),F("posts"),v({collection:"posts",key:b}),j(null)}}):f==="site"?he?n.jsx(kn,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:he.key,block:m[he.key],decofile:m,meta:_,title:"Site",excludeFields:["seo"],schemaPending:R(he.resolveType,["seo"]),previewBaseUrl:o},`site:${he.key}`):n.jsx(tt,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):f==="context"?n.jsx(gl,{title:r("sandbox.blogContext.soonTitle"),description:r("sandbox.blogContext.soonDescription"),children:n.jsx(ic,{orgSlug:t,virtualMcpId:e,branch:s,decofile:m,meta:_,onOpenPost:b=>{x("posts"),F("posts"),v({collection:"posts",key:b}),j(null)},onManageCategoryPosts:()=>{x("posts"),F("posts"),v(null),j(null)}})}):f==="seo"?n.jsx(dc,{orgSlug:t,virtualMcpId:e,branch:s,decofile:m,meta:_,target:{kind:"site"},previewBaseUrl:a}):f==="sections"?n.jsx(tc,{selection:g?.collection==="sections"||g?.collection==="available-section"?g:null,orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,meta:_,decofile:m,isCreating:P.isPending,onCreateAvailable:os,onSaveReferencedBlock:as}):f==="posts"?n.jsx(_r,{orgSlug:t,virtualMcpId:e,branch:s,decofile:m,view:D,selectedKey:g?.collection==="posts"?g.key:null,onViewChange:b=>{O(b),v(null)},onClose:()=>v(null),onOpen:b=>{v({collection:"posts",key:b}),j(null)},move:Y,support:W,meta:_,renderDetail:(b,V)=>n.jsx(ac,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:b,block:m[b],decofile:m,meta:_,previewBaseUrl:a,move:Y,onClose:V?.onClose,expanded:V?.expanded,onToggleExpand:V?.onToggleExpand},`post:${Ct(b)}`)}):g&&g.collection!=="available-section"?g.collection==="apps"?n.jsx(kn,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:g.key,block:m[g.key],decofile:m,meta:_,previewBaseUrl:o,schemaPending:R(typeof m[g.key]?.__resolveType=="string"?String(m[g.key].__resolveType):void 0)},`app:${g.key}`):g.collection==="categories"?n.jsx(rc,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:g.key,block:m[g.key],decofile:m,meta:_,onManagePosts:()=>Ve(),onOpenPost:b=>{x("posts"),F("posts"),v({collection:"posts",key:b}),j(null)},previewBaseUrl:a},`category:${g.key}`):g.collection==="authors"?n.jsx(lc,{orgSlug:t,virtualMcpId:e,branch:s,kind:"authors",blockKey:g.key,block:m[g.key]},`authors:${g.key}`):g.collection==="redirects"?n.jsx(fc,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:g.key,block:m[g.key]},`redirect:${g.key}`):n.jsx(cc,{orgSlug:t,virtualMcpId:e,branch:s,previewReady:!0,previewUrl:o??void 0,currentPath:g.collection==="pages"?g.path:"/",activePageBlockKey:g.collection==="pages"?g.key:null,activeGlobalBlockKey:g.collection==="sections"?g.key:null,initialEditSeo:g.collection==="pages"&&y===g.key,onExitSeo:()=>j(null),onSelectRoot:()=>{v(null),j(null)}},g.collection==="pages"?`page:${g.key}`:`section:${g.key}`):n.jsx(tt,{title:`Select ${ot(f)?`a ${Nt[f]}`:f==="pages"?"a page":f==="apps"?"an app":f==="redirects"?"a redirect":"a section"} to edit`,description:f==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),q&&n.jsx(Vl,{open:!!q,mode:q.mode,initialName:q.initialName,initialPath:q.initialPath,isPending:P.isPending,error:de,templates:ie,validate:ns,onSubmit:ss,onOpenChange:b=>{b||(Z(null),ne(void 0))}}),n.jsx(Ul,{open:ue,isPending:P.isPending,error:re,onSubmit:rs,onOpenChange:b=>{b||(te(!1),le(void 0))}}),T&&n.jsx(Hl,{open:!!T,blockKey:T,initialName:pe.find(b=>b.key===T)?.name??T,isPending:P.isPending,onSubmit:is,onOpenChange:b=>{b||J(null)}}),S&&n.jsx(Ja,{open:!!S,onOpenChange:b=>{b||se(null)},pageKey:S,decofile:m,onSave:b=>P.mutateAsync({blockKey:S,data:b})}),n.jsx(ea,{open:!!ee,onOpenChange:b=>{!b&&!Ce&&oe(null)},children:n.jsxs(ta,{children:[n.jsxs(sa,{children:[n.jsx(na,{children:`Delete ${xt}?`}),n.jsx(oa,{children:ee?.kind==="section"?`"${ee.label}" will be removed. Pages that still reference it will lose this section.`:ee?`"${ee.label}" will be removed permanently. This can't be undone.`:null})]}),n.jsxs(aa,{children:[n.jsx(la,{disabled:Ce,children:"Cancel"}),n.jsx(ia,{onClick:b=>{b.preventDefault(),qe()},disabled:Ce,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ce?n.jsxs(n.Fragment,{children:[n.jsx(lt,{className:"size-3.5"}),"Deleting…"]}):"Delete"})]})]})})]})}function xc(t){const e=ae.c(57),{activeCollection:s,pages:o,redirects:a,sections:l,availableSections:i,appCatalog:c,appCatalogLoading:r,blogEntries:d,decofile:p,searchQuery:m,onSearchChange:h,selection:u,onSelect:f,onCreate:x,onDuplicatePage:g,onRenamePage:v,onAddPageVariant:y,onDeletePage:j,onEditPageSeo:w,onViewPageJson:N,onDuplicateSection:E,onRenameSection:B,onDeleteSection:k,onDeleteRedirect:D,onDuplicateBlog:O,onDeleteBlog:L}=t;let K,F,_,A,I,R;if(e[0]!==s||e[1]!==c||e[2]!==r||e[3]!==i||e[4]!==d||e[5]!==p||e[6]!==y||e[7]!==x||e[8]!==L||e[9]!==j||e[10]!==D||e[11]!==k||e[12]!==O||e[13]!==g||e[14]!==E||e[15]!==w||e[16]!==v||e[17]!==B||e[18]!==h||e[19]!==f||e[20]!==N||e[21]!==o||e[22]!==a||e[23]!==m||e[24]!==l||e[25]!==u){const P=m.toLowerCase(),U=o.filter(S=>!P||S.name.toLowerCase().includes(P)||S.path.toLowerCase().includes(P)),Y=a.filter(S=>!P||S.from.toLowerCase().includes(P)||S.to.toLowerCase().includes(P)),q=l.filter(S=>!P||S.name.toLowerCase().includes(P)||S.key.toLowerCase().includes(P)||S.resolveType.toLowerCase().includes(P)),Z=i.filter(S=>!P||S.title.toLowerCase().includes(P)||S.resolveType.toLowerCase().includes(P)||(S.description?.toLowerCase().includes(P)??!1)),de=oc(q),ne=c.filter(S=>!P||S.title.toLowerCase().includes(P)||S.app.toLowerCase().includes(P)||S.vendor.toLowerCase().includes(P)||S.category.toLowerCase().includes(P)),ue=d.filter(S=>!P||S.label.toLowerCase().includes(P)||S.subtitle.toLowerCase().includes(P)),te=`Search ${s}…`,re=ot(s)?`Create new ${Nt[s]}`:s==="redirects"?"Create new redirect":"Create new page",le=s!=="apps"&&s!=="sections";I="shrink-0 border-r flex flex-col min-h-0 w-[300px]";let T;e[32]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(Ss,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[32]=T):T=e[32];let J;e[33]!==h?(J=S=>h(S.target.value),e[33]=h,e[34]=J):J=e[34];let ee;e[35]!==te||e[36]!==m||e[37]!==J?(ee=n.jsxs("div",{className:"flex flex-1 items-center gap-2 pl-1",children:[T,n.jsx("input",{type:"text",value:m,onChange:J,placeholder:te,"aria-label":te,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[35]=te,e[36]=m,e[37]=J,e[38]=ee):ee=e[38];let oe;e[39]!==re||e[40]!==x||e[41]!==le?(oe=le&&n.jsxs(Qe,{children:[n.jsx(We,{asChild:!0,children:n.jsx(_e,{variant:"ghost",size:"icon",onClick:x,"aria-label":re,children:n.jsx(ws,{size:14})})}),n.jsx(Ye,{side:"bottom",children:re})]}),e[39]=re,e[40]=x,e[41]=le,e[42]=oe):oe=e[42],e[43]!==ee||e[44]!==oe?(R=n.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[ee,oe]}),e[43]=ee,e[44]=oe,e[45]=R):R=e[45],K=Yt,A="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",F="flex flex-col gap-1 p-1.5",_=s==="pages"?U.length===0?n.jsx(yt,{hasItems:o.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):U.map(S=>{const se=u?.collection==="pages"&&u.key===S.key,H=Vn(p,S.key);return n.jsx(Ge,{icon:An,title:S.name,subtitle:S.path,active:se,variantCount:H,onClick:()=>f({collection:"pages",key:S.key,path:S.path}),menu:n.jsx($t,{onDuplicate:()=>g(S),onRename:()=>v(S),onAddVariant:()=>y(S),onEditSeo:()=>w(S),onViewJson:()=>N(S),onDelete:()=>j(S)})},S.key)}):s==="sections"?q.length===0&&Z.length===0?n.jsx(yt,{hasItems:l.length>0||i.length>0,emptyLabel:"No sections yet.",emptyHint:"Save a section from a page, or start the preview dev server."}):n.jsxs(n.Fragment,{children:[de.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(jn,{icon:Kt,label:"Saved sections"}),de.map(S=>n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("div",{className:"px-2.5 pt-1 pb-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60",children:S.label}),S.sections.map(se=>{const H=u?.collection==="sections"&&u.key===se.key;return n.jsx(Ge,{icon:Kt,accent:"global",title:se.name,subtitle:S.label,active:H,onClick:()=>f({collection:"sections",key:se.key}),menu:n.jsx($t,{onDuplicate:()=>E(se),onRename:()=>B(se),onDelete:()=>k(se)})},se.key)})]},S.label))]}),Z.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(jn,{icon:Ms,label:"Available sections",className:be(de.length>0&&"mt-3")}),Z.map(S=>{const se=u?.collection==="available-section"&&u.resolveType===S.resolveType,H=S.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return n.jsx(Ge,{icon:Ms,title:S.title,subtitle:H??S.resolveType,active:se,onClick:()=>f({collection:"available-section",resolveType:S.resolveType,title:S.title})},S.resolveType)})]})]}):s==="apps"?r?n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx(lt,{className:"size-4.5 text-muted-foreground"})}):ne.length===0?n.jsx(yt,{hasItems:c.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):ne.map(S=>{const se=u?.collection==="apps"&&S.blockKey!==null&&u.key===S.blockKey;return n.jsx(Ge,{icon:On,logoUrl:S.logo,title:S.title,subtitle:S.category,active:se,trailing:S.installed?n.jsx("span",{className:"shrink-0 rounded-full bg-success/15 px-1.5 py-0.5 text-[10px] font-medium text-success",children:"Installed"}):void 0,onClick:()=>{if(!S.installed||!S.blockKey){me.message(`${S.title} is not installed on this site.`);return}f({collection:"apps",key:S.blockKey})}},S.id)}):s==="redirects"?Y.length===0?n.jsx(yt,{hasItems:a.length>0,emptyLabel:"No redirects yet.",emptyHint:'Click "+" to create your first redirect.'}):Y.map(S=>n.jsx(Ge,{icon:Pn,title:S.from||"(no source)",subtitle:`→ ${S.to||"(no target)"}`,active:u?.collection==="redirects"&&u.key===S.key,trailing:n.jsx(ql,{type:S.type}),onClick:()=>f({collection:"redirects",key:S.key}),menu:n.jsx($t,{onDelete:()=>D(S)})},S.key)):ue.length===0?n.jsx(yt,{hasItems:d.length>0,emptyLabel:`No ${s} yet.`,emptyHint:`Click "+" to create your first ${ot(s)?Nt[s]:"item"}.`}):ue.map(S=>{const se=u?.collection===S.kind&&u.key===S.key;return n.jsx(Ge,{icon:S.kind==="posts"?$n:S.kind==="authors"?In:Tn,title:S.label,subtitle:S.subtitle,active:se,onClick:()=>f({collection:S.kind,key:S.key}),menu:n.jsx($t,{onDuplicate:()=>O(S),onDelete:()=>L(S)})},S.key)}),e[0]=s,e[1]=c,e[2]=r,e[3]=i,e[4]=d,e[5]=p,e[6]=y,e[7]=x,e[8]=L,e[9]=j,e[10]=D,e[11]=k,e[12]=O,e[13]=g,e[14]=E,e[15]=w,e[16]=v,e[17]=B,e[18]=h,e[19]=f,e[20]=N,e[21]=o,e[22]=a,e[23]=m,e[24]=l,e[25]=u,e[26]=K,e[27]=F,e[28]=_,e[29]=A,e[30]=I,e[31]=R}else K=e[26],F=e[27],_=e[28],A=e[29],I=e[30],R=e[31];let G;e[46]!==F||e[47]!==_?(G=n.jsx("div",{className:F,children:_}),e[46]=F,e[47]=_,e[48]=G):G=e[48];let z;e[49]!==K||e[50]!==A||e[51]!==G?(z=n.jsx(K,{className:A,children:G}),e[49]=K,e[50]=A,e[51]=G,e[52]=z):z=e[52];let W;return e[53]!==I||e[54]!==R||e[55]!==z?(W=n.jsxs("div",{className:I,children:[R,z]}),e[53]=I,e[54]=R,e[55]=z,e[56]=W):W=e[56],W}function bc(t){const e=ae.c(25),{virtualMcpId:s}=t,o=Se(),[a,l]=$.useState(!1),i=dl(s),{activeTask:c}=Cn();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const d=Nn(r);if(!(Ws(i?.metadata)||Ws(c?.metadata))){let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:n.jsx(Ys,{className:"size-7 text-foreground"})}),e[1]=h):h=e[1];let u;e[2]!==o?(u=o("mainPanelTabs.contentTab.noContentToEdit"),e[2]=o,e[3]=u):u=e[3];let f;e[4]!==o?(f=o("mainPanelTabs.contentTab.connectGithubDescription"),e[4]=o,e[5]=f):f=e[5];let x,g;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=()=>l(!0),g=n.jsx(Ys,{className:"size-4"}),e[6]=x,e[7]=g):(x=e[6],g=e[7]);let v;e[8]!==o?(v=o("mainPanelTabs.previewTab.connectGithub"),e[8]=o,e[9]=v):v=e[9];let y;e[10]!==v?(y=n.jsxs(_e,{onClick:x,children:[g,v]}),e[10]=v,e[11]=y):y=e[11];let j;e[12]!==u||e[13]!==f||e[14]!==y?(j=n.jsx(fl,{className:"h-full",image:h,title:u,description:f,actions:y}),e[12]=u,e[13]=f,e[14]=y,e[15]=j):j=e[15];let w;e[16]!==a?(w=n.jsx(pl,{open:a,onOpenChange:l,mode:"agent"}),e[16]=a,e[17]=w):w=e[17];let N;return e[18]!==w||e[19]!==j?(N=n.jsxs(n.Fragment,{children:[j,w]}),e[18]=w,e[19]=j,e[20]=N):N=e[20],N}let m;return e[21]!==d.contentPageId||e[22]!==d.contentPath||e[23]!==d.contentPathTemplate?(m=n.jsx(pc,{deepLinkPage:{pageId:d.contentPageId,path:d.contentPath,pathTemplate:d.contentPathTemplate}}),e[21]=d.contentPageId,e[22]=d.contentPath,e[23]=d.contentPathTemplate,e[24]=m):m=e[24],m}function yc(){const t=ae.c(2),e=hl();let s;return t[0]!==e?(s=n.jsx(Ro,{tabId:"content",children:n.jsx(Fo,{feature:"cms",children:n.jsx(bc,{virtualMcpId:e})})}),t[0]=e,t[1]=s):s=t[1],s}const Rd=Object.freeze(Object.defineProperty({__proto__:null,default:yc},Symbol.toStringTag,{value:"Module"}));export{Sd as $,Dd as A,As as B,vi as C,xd as D,_d as E,$d as F,vd as G,Me as H,Wi as I,jd as J,yd as K,to as L,ho as M,Si as N,bd as O,Ds as P,hs as Q,Ad as R,co as S,Ld as T,gd as U,wd as V,Nd as W,Pd as X,mt as Y,Td as Z,Cd as _,sn as a,Bd as a0,Ut as a1,wo as a2,Rd as a3,ts as b,Ue as c,hd as d,ii as e,Ed as f,dt as g,pd as h,bo as i,yo as j,kd as k,ao as l,_s as m,Ll as n,qt as o,Et as p,Od as q,bl as r,ke as s,fi as t,Ui as u,Id as v,uo as w,at as x,go as y,Ke as z};
|
|
9
|
+
`)||void 0,count:O}),Ce=Si(re.map(b=>b.title),qe.themes);if(Ce.length===0){me.info(u("sandbox.postBoard.ideasFailed"));return}let xt=0;for(const b of Ce){const V=xi();try{await x.mutateAsync({blockKey:V,data:bi(V,{title:b.title,body:b.body,pillarKey:C?.key,createdAt:new Date().toISOString()})}),xt++}catch(ce){console.warn("[posts] could not save a generated idea",ce)}}if(xt===0){me.error(u("sandbox.postBoard.ideasFailed"));return}me.success(u("sandbox.postBoard.ideasAdded",{count:String(xt)}))}catch(Q){me.error(Q instanceof Error?Q.message:u("sandbox.postBoard.ideasFailed"))}finally{N(!1)}};return n.jsxs("div",{className:"relative flex h-full min-w-0 flex-col",children:[n.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b px-6 py-3",children:[n.jsx("div",{className:"flex items-center gap-3",children:n.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border p-0.5",children:[n.jsx(vn,{active:a==="board",onClick:()=>i("board"),icon:n.jsx(qo,{size:14}),label:u("sandbox.postBoard.viewBoard")}),n.jsx(vn,{active:a==="list",onClick:()=>i("list"),icon:n.jsx(Zo,{size:14}),label:u("sandbox.postBoard.viewList")})]})}),n.jsxs("div",{className:"flex items-center gap-2",children:[w&&n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","aria-live":"polite",role:"status",children:[n.jsx(wt,{size:12,className:"animate-spin"}),u("sandbox.postBoard.generatingLabel")]}),n.jsxs(ct,{open:E,onOpenChange:B,children:[n.jsx(el,{asChild:!0,children:n.jsxs(_e,{type:"button",variant:"outline",size:"sm",disabled:!0,children:[n.jsx(et,{size:14}),u("sandbox.postBoard.generateIdeas"),n.jsx(nt,{variant:"secondary",children:u("common.soon")})]})}),n.jsxs(rt,{className:"sm:max-w-lg",children:[n.jsxs(pt,{children:[n.jsx(it,{children:u("sandbox.postBoard.generateIdeas")}),n.jsx(zt,{children:u("sandbox.postBoard.ideaGuidanceLabel")})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx(Ot,{id:"idea-guidance",value:k,rows:6,autoFocus:!0,onChange:C=>D(C.target.value),placeholder:u("sandbox.postBoard.ideaGuidancePlaceholder"),className:"resize-none text-sm"}),le.length>0&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx(ze,{className:"text-xs",children:u("sandbox.postBoard.ideaPillarLabel")}),n.jsx(kt,{options:le.map(C=>C.title),value:le.find(C=>C.key===K)?.title??"",emptyLabel:u("sandbox.postBoard.ideaNoPillar"),onChange:C=>F(le.find(Q=>Q.title===C)?.key??"")})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ze,{htmlFor:"idea-count",className:"text-xs",children:u("sandbox.postBoard.ideaCount")}),n.jsx(Xe,{id:"idea-count",type:"number",min:1,max:8,value:O,onChange:C=>L(Math.max(1,Math.min(8,Number(C.target.value)||1))),className:"h-9 w-16"}),n.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:u("sandbox.postBoard.usesCredits")})]})]}),n.jsx(ht,{children:n.jsxs(_e,{type:"button",onClick:()=>{B(!1),cs()},children:[n.jsx(et,{size:14}),u("sandbox.postBoard.generateIdeas")]})})]})]}),n.jsxs(Ft,{children:[n.jsx(It,{asChild:!0,children:n.jsxs(_e,{type:"button",size:"sm",children:[n.jsx(ws,{size:14}),u("sandbox.postBoard.newPost"),n.jsx(ft,{size:14})]})}),n.jsxs(Rt,{align:"end",className:"w-56",children:[n.jsxs(Je,{disabled:!0,onClick:()=>{z(void 0),R(!0)},children:[n.jsx(et,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[u("sandbox.postBoard.newPostGenerate"),n.jsx(nt,{variant:"secondary",children:u("common.soon")})]}),n.jsx("span",{className:"text-xs text-muted-foreground",children:u("sandbox.postBoard.newPostGenerateHint")})]})]}),n.jsxs(Je,{onClick:_t,children:[n.jsx(Jo,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{children:u("sandbox.postBoard.newPostWrite")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:u("sandbox.postBoard.newPostWriteHint")})]})]}),n.jsxs(Je,{onClick:()=>P(!0),children:[n.jsx(fs,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{children:u("sandbox.postBoard.importContent")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:u("sandbox.postBoard.importContentHint")})]})]})]})]}),n.jsx(Zi,{open:I,onOpenChange:R,decofile:o,hasAi:v,seed:G,onGenerate:C=>{ue(C)}},G?.title??"scratch"),n.jsx(ct,{open:W,onOpenChange:P,children:n.jsxs(rt,{className:"max-h-[85vh] sm:max-w-2xl",children:[n.jsxs(pt,{children:[n.jsx(it,{children:u("sandbox.postBoard.importTitle")}),n.jsx(zt,{children:u("sandbox.postBoard.importDescription")})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"h-72 overflow-hidden rounded-[var(--studio-control-radius,var(--radius-xl))] border bg-[var(--studio-input-background)]",children:n.jsx(Jn,{code:U,language:Co(U)?"html":"markdown",height:"100%",autoFocus:!0,onChange:C=>Y(C??"")})}),n.jsx("input",{ref:q,type:"file",accept:".html,.htm,.md,.markdown,.txt",className:"hidden",onChange:async C=>{const Q=C.target.files?.[0];Q&&Y(await Q.text()),C.target.value=""}}),n.jsxs(_e,{type:"button",variant:"outline",size:"sm",onClick:()=>q.current?.click(),children:[n.jsx(fs,{size:14}),u("sandbox.postBoard.importUpload")]})]}),n.jsx(ht,{children:n.jsxs(_e,{type:"button",disabled:!U.trim(),onClick:rs,children:[n.jsx(fs,{size:14}),u("sandbox.postBoard.importRun")]})})]})})]})]}),te.length===0&&re.length===0?n.jsx(rl,{className:"flex-1",icon:n.jsx(et,{size:22}),title:u("sandbox.postBoard.emptyTitle"),description:u("sandbox.postBoard.emptyDescription"),buttonProps:{children:u("sandbox.postBoard.newPost"),onClick:_t}}):a==="board"?n.jsxs("div",{className:"flex min-h-0 flex-1 gap-3 overflow-x-auto p-4",children:[n.jsx(Lr,{ideas:re,collapsed:Z.includes(bn),pillarTitleOf:T,onToggleCollapsed:()=>ne(bn),onGenerate:as,onDelete:ls}),n.jsx("div",{"aria-hidden":!0,className:"my-1 w-px shrink-0 self-stretch bg-border"}),Ds.map(C=>{const Q=te.filter(Ce=>Ce.status===C);Er(C)&&Q.sort(Br);const Ee=u(qt[C]),Ve=Z.includes(C),qe=wo(p,C);return n.jsx("div",{onDragOver:Ce=>{Ce.preventDefault(),j(C)},onDragLeave:()=>j(Ce=>Ce===C?null:Ce),onDrop:Ce=>{Ce.preventDefault(),is(C,Ce.dataTransfer.getData(Eo))},title:qe?No(u,qe):void 0,className:be("flex shrink-0 flex-col rounded-xl border bg-muted/30 transition-colors",Ve?"w-11":"w-72",qe&&"opacity-50",y===C&&"border-primary bg-primary/5"),children:Ve?n.jsxs("button",{type:"button",onClick:()=>ne(C),"aria-label":u("sandbox.postBoard.expandLane",{lane:Ee}),"aria-expanded":!1,className:"flex min-h-0 flex-1 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[n.jsx(Tt,{size:14,className:"shrink-0"}),n.jsx("span",{className:"text-xs tabular-nums",children:Q.length}),n.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:Ee})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",children:[n.jsxs("button",{type:"button",onClick:()=>ne(C),"aria-label":u("sandbox.postBoard.collapseLane",{lane:Ee}),"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[n.jsx(ft,{size:14,className:"shrink-0"}),n.jsx("span",{className:"truncate",children:Ee})]}),n.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:Q.length})]}),n.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto px-2 pb-2",children:Q.length===0?n.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:u("sandbox.postBoard.laneEmpty")}):Q.map(Ce=>n.jsx($r,{post:Ce,payload:J(Ce.key),moving:d.isMoving(Ce.key),onOpen:()=>c(Ce.key),onArchive:Ce.status==="archived"?void 0:()=>{oe(Ce)}},Ce.key))})]})},C)})]}):n.jsxs("div",{className:"flex min-h-0 flex-1",children:[n.jsxs("div",{className:"flex w-80 shrink-0 flex-col border-r",children:[n.jsx(jr,{value:we,onChange:Pe}),Le?n.jsx(Pr,{count:Te.size,allSelected:ve.length>0&&ve.every(C=>Te.has(C.key)),onToggleSelectAll:ns,onArchive:()=>{os()},onExit:()=>Ne(new Set)}):n.jsx(kr,{categories:Fe,authors:M,statusCounts:Be,categoryFilter:S,authorFilter:H,statusFilter:ye,sort:je,onCategoryFilterChange:se,onAuthorFilterChange:ie,onStatusFilterChange:pe,onSortChange:he}),n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:n.jsx(Dr,{posts:ve,selectedKey:ee,selectionActive:Le,selectedKeys:Te,onToggleSelect:ss,onOpen:c,isMoving:d.isMoving,onArchive:C=>{oe(C)}})})]}),n.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:ee&&h?n.jsx($.Suspense,{fallback:n.jsx("div",{className:"flex h-full items-center justify-center",children:n.jsx(wt,{size:20,className:"animate-spin text-muted-foreground"})}),children:h(ee)}):n.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:u("sandbox.postBoard.selectPrompt")})})]}),a==="board"&&l&&_&&h&&n.jsx("div",{className:"absolute inset-0 z-30 flex flex-col bg-background",children:h(l,{expanded:!0,onToggleExpand:()=>A(!1),onClose:()=>{A(!1),r?.()}})}),n.jsx(ct,{open:a==="board"&&!!l&&!_,onOpenChange:C=>{C||(A(!1),r?.())},children:n.jsxs(rt,{closeButtonClassName:"hidden",className:"left-auto right-4 top-4 bottom-4 flex h-auto translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden p-0 sm:max-w-3xl",children:[n.jsx(it,{className:"sr-only",children:u("sandbox.collectionsSidebar.posts")}),l&&h?n.jsx($.Suspense,{fallback:n.jsx("div",{className:"flex h-full items-center justify-center",children:n.jsx(wt,{size:20,className:"animate-spin text-muted-foreground"})}),children:h(l,{expanded:!1,onToggleExpand:()=>A(!0),onClose:()=>r?.()})}):null]})})]})}function vn(t){const e=ae.c(7),{active:s,onClick:o,icon:a,label:l}=t,i=s?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground";let c;e[0]!==i?(c=be("inline-flex cursor-pointer items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",i),e[0]=i,e[1]=c):c=e[1];let r;return e[2]!==a||e[3]!==l||e[4]!==o||e[5]!==c?(r=n.jsxs("button",{type:"button",onClick:o,className:c,children:[a,l]}),e[2]=a,e[3]=l,e[4]=o,e[5]=c,e[6]=r):r=e[6],r}function Dr(t){const e=ae.c(23),{posts:s,selectedKey:o,selectionActive:a,selectedKeys:l,onToggleSelect:i,onOpen:c,isMoving:r,onArchive:d}=t,p=Se();if(s.length===0){let u;e[0]!==p?(u=p("sandbox.postList.noMatches"),e[0]=p,e[1]=u):u=e[1];let f;return e[2]!==u?(f=n.jsx("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=f):f=e[3],f}let m;if(e[4]!==r||e[5]!==d||e[6]!==c||e[7]!==i||e[8]!==s||e[9]!==o||e[10]!==l||e[11]!==a){let u;e[13]!==r||e[14]!==d||e[15]!==c||e[16]!==i||e[17]!==o||e[18]!==l||e[19]!==a?(u=f=>n.jsx(Ar,{post:f,selected:f.key===o,selectionActive:a,checked:l.has(f.key),onToggleSelect:()=>i(f.key),moving:r(f.key),onOpen:()=>c(f.key),onArchive:f.status==="archived"?void 0:()=>d(f)},f.key),e[13]=r,e[14]=d,e[15]=c,e[16]=i,e[17]=o,e[18]=l,e[19]=a,e[20]=u):u=e[20],m=s.map(u),e[4]=r,e[5]=d,e[6]=c,e[7]=i,e[8]=s,e[9]=o,e[10]=l,e[11]=a,e[12]=m}else m=e[12];let h;return e[21]!==m?(h=n.jsx("ul",{className:"divide-y",children:m}),e[21]=m,e[22]=h):h=e[22],h}function Ar(t){const e=ae.c(56),{post:s,selected:o,selectionActive:a,checked:l,onToggleSelect:i,moving:c,onOpen:r,onArchive:d}=t,p=Se(),m=s.status==="awaiting_review"&&s.missing.length>0,h=s.status==="scheduled"||s.status==="published",u=a||l?"opacity-100":"opacity-0 focus-within:opacity-100 group-hover/row:opacity-100";let f;e[0]!==u?(f=be("absolute left-3 top-3 z-10 transition-opacity",u),e[0]=u,e[1]=f):f=e[1];let x;e[2]!==i?(x=()=>i(),e[2]=i,e[3]=x):x=e[3];let g;e[4]!==s.title||e[5]!==p?(g=s.title||p("sandbox.postBoard.untitled"),e[4]=s.title,e[5]=p,e[6]=g):g=e[6];let v;e[7]!==l||e[8]!==x||e[9]!==g?(v=n.jsx(Xt,{checked:l,onCheckedChange:x,"aria-label":g}),e[7]=l,e[8]=x,e[9]=g,e[10]=v):v=e[10];let y;e[11]!==f||e[12]!==v?(y=n.jsx("span",{className:f,children:v}),e[11]=f,e[12]=v,e[13]=y):y=e[13];let j;e[14]!==c||e[15]!==d||e[16]!==a?(j=d&&!a&&n.jsx(Is,{onArchive:d,disabled:c,className:"top-2.5"}),e[14]=c,e[15]=d,e[16]=a,e[17]=j):j=e[17];let w;e[18]!==r||e[19]!==i||e[20]!==a?(w=()=>a?i():r(),e[18]=r,e[19]=i,e[20]=a,e[21]=w):w=e[21];const N=o?"bg-accent text-accent-foreground":"bg-card hover:bg-muted/50";let E;e[22]!==N?(E=be("flex w-full cursor-pointer flex-col gap-1.5 py-2.5 pl-10 pr-3 text-left text-sm transition-colors",N),e[22]=N,e[23]=E):E=e[23];let B;e[24]!==s.title||e[25]!==p?(B=s.title||p("sandbox.postBoard.untitled"),e[24]=s.title,e[25]=p,e[26]=B):B=e[26];let k;e[27]!==B?(k=n.jsx("span",{className:"min-w-0 truncate pr-6 font-medium",children:B}),e[27]=B,e[28]=k):k=e[28];const D=Tr[s.status],O=qt[s.status];let L;e[29]!==p||e[30]!==O?(L=p(O),e[29]=p,e[30]=O,e[31]=L):L=e[31];let K;e[32]!==D||e[33]!==L?(K=n.jsx(nt,{variant:D,className:"shrink-0",children:L}),e[32]=D,e[33]=L,e[34]=K):K=e[34];let F;e[35]!==m||e[36]!==s.missing?(F=m&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[n.jsx(Wt,{size:12}),s.missing.length]}),e[35]=m,e[36]=s.missing,e[37]=F):F=e[37];let _;e[38]!==h||e[39]!==s.date||e[40]!==s.scheduledDatetime?(_=h&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs tabular-nums text-muted-foreground",children:[n.jsx(ks,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[38]=h,e[39]=s.date,e[40]=s.scheduledDatetime,e[41]=_):_=e[41];let A;e[42]!==K||e[43]!==F||e[44]!==_?(A=n.jsxs("div",{className:"flex items-center gap-2",children:[K,F,_]}),e[42]=K,e[43]=F,e[44]=_,e[45]=A):A=e[45];let I;e[46]!==o||e[47]!==E||e[48]!==k||e[49]!==A||e[50]!==w?(I=n.jsxs("button",{type:"button",onClick:w,"aria-current":o,className:E,children:[k,A]}),e[46]=o,e[47]=E,e[48]=k,e[49]=A,e[50]=w,e[51]=I):I=e[51];let R;return e[52]!==I||e[53]!==y||e[54]!==j?(R=n.jsxs("li",{className:"group/row relative",children:[y,j,I]}),e[52]=I,e[53]=y,e[54]=j,e[55]=R):R=e[55],R}function $r(t){const e=ae.c(46),{post:s,payload:o,moving:a,onOpen:l,onArchive:i}=t,c=Se(),r=s.status!=="generating"&&!a;let d;e[0]!==o?(d=si(o),e[0]=o,e[1]=d):d=e[1];const p=d,m=!r&&"opacity-80";let h;e[2]!==m?(h=be("group/card relative rounded-lg border bg-card shadow-sm transition-colors hover:border-primary/40",m),e[2]=m,e[3]=h):h=e[3];let u;e[4]!==a||e[5]!==i?(u=i&&n.jsx(Is,{onArchive:i,disabled:a,className:"top-2"}),e[4]=a,e[5]=i,e[6]=u):u=e[6];let f;e[7]!==s.key?(f=O=>O.dataTransfer.setData(Eo,s.key),e[7]=s.key,e[8]=f):f=e[8];const x=r?"cursor-grab active:cursor-grabbing":"cursor-pointer";let g;e[9]!==x?(g=be("block w-full p-3 text-left",x),e[9]=x,e[10]=g):g=e[10];let v;e[11]!==s.title||e[12]!==c?(v=s.title||c("sandbox.postBoard.untitled"),e[11]=s.title,e[12]=c,e[13]=v):v=e[13];let y;e[14]!==v?(y=n.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:v}),e[14]=v,e[15]=y):y=e[15];let j;e[16]!==p||e[17]!==s.status?(j=s.status==="draft"&&n.jsxs(n.Fragment,{children:[p.pillarTitle&&n.jsx(nt,{variant:"secondary",className:"max-w-full truncate",children:p.pillarTitle}),p.format?.name&&n.jsx(nt,{variant:"outline",className:"max-w-full truncate",children:p.format.name})]}),e[16]=p,e[17]=s.status,e[18]=j):j=e[18];let w;e[19]!==s.status||e[20]!==c?(w=s.status==="generating"&&n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[n.jsx(wt,{size:12,className:"animate-spin"}),c("sandbox.postBoard.generatingLabel")]}),e[19]=s.status,e[20]=c,e[21]=w):w=e[21];let N;e[22]!==s.missing||e[23]!==s.status||e[24]!==c?(N=s.status==="awaiting_review"&&(s.missing.length>0?n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[n.jsx(Wt,{size:12}),c("sandbox.postBoard.nIssues",{count:String(s.missing.length)})]}):n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-success",children:[n.jsx(il,{size:12}),c("sandbox.postBoard.readyToSchedule")]})),e[22]=s.missing,e[23]=s.status,e[24]=c,e[25]=N):N=e[25];let E;e[26]!==s.date||e[27]!==s.scheduledDatetime||e[28]!==s.status?(E=(s.status==="scheduled"||s.status==="published")&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[n.jsx(ks,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[26]=s.date,e[27]=s.scheduledDatetime,e[28]=s.status,e[29]=E):E=e[29];let B;e[30]!==j||e[31]!==w||e[32]!==N||e[33]!==E?(B=n.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[j,w,N,E]}),e[30]=j,e[31]=w,e[32]=N,e[33]=E,e[34]=B):B=e[34];let k;e[35]!==r||e[36]!==l||e[37]!==B||e[38]!==f||e[39]!==g||e[40]!==y?(k=n.jsxs("button",{type:"button",draggable:r,onDragStart:f,onClick:l,className:g,children:[y,B]}),e[35]=r,e[36]=l,e[37]=B,e[38]=f,e[39]=g,e[40]=y,e[41]=k):k=e[41];let D;return e[42]!==k||e[43]!==h||e[44]!==u?(D=n.jsxs("div",{className:h,children:[u,k]}),e[42]=k,e[43]=h,e[44]=u,e[45]=D):D=e[45],D}function Lr(t){const e=ae.c(40),{ideas:s,collapsed:o,pillarTitleOf:a,onToggleCollapsed:l,onGenerate:i,onDelete:c}=t,r=Se();let d,p,m,h,u,f,x;if(e[0]!==o||e[1]!==s.length||e[2]!==l||e[3]!==r){x=Symbol.for("react.early_return_sentinel");e:{if(d=r("sandbox.postBoard.ideasTray"),o){let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(Tt,{size:14,className:"shrink-0"}),e[11]=k):k=e[11];let D;e[12]!==s.length?(D=n.jsx("span",{className:"text-xs tabular-nums",children:s.length}),e[12]=s.length,e[13]=D):D=e[13],x=n.jsxs("button",{type:"button",onClick:l,"aria-label":r("sandbox.postBoard.expandLane",{lane:d}),"aria-expanded":!1,className:"flex w-11 shrink-0 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[k,D,n.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:d})]});break e}f="flex w-72 shrink-0 flex-col",u="flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",p="button",m=l,h=r("sandbox.postBoard.collapseLane",{lane:d})}e[0]=o,e[1]=s.length,e[2]=l,e[3]=r,e[4]=d,e[5]=p,e[6]=m,e[7]=h,e[8]=u,e[9]=f,e[10]=x}else d=e[4],p=e[5],m=e[6],h=e[7],u=e[8],f=e[9],x=e[10];if(x!==Symbol.for("react.early_return_sentinel"))return x;let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(ft,{size:14,className:"shrink-0"}),e[14]=g):g=e[14];let v;e[15]!==d?(v=n.jsx("span",{className:"truncate",children:d}),e[15]=d,e[16]=v):v=e[16];let y;e[17]!==p||e[18]!==m||e[19]!==h||e[20]!==v?(y=n.jsxs("button",{type:p,onClick:m,"aria-label":h,"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[g,v]}),e[17]=p,e[18]=m,e[19]=h,e[20]=v,e[21]=y):y=e[21];let j;e[22]!==s.length?(j=n.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:s.length}),e[22]=s.length,e[23]=j):j=e[23];let w;e[24]!==j||e[25]!==u||e[26]!==y?(w=n.jsxs("div",{className:u,children:[y,j]}),e[24]=j,e[25]=u,e[26]=y,e[27]=w):w=e[27];let N;e[28]!==s||e[29]!==c||e[30]!==i||e[31]!==a||e[32]!==r?(N=s.length===0?n.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:r("sandbox.postBoard.ideasEmpty")}):s.map(k=>{const D=a(k.pillarKey);return n.jsxs("div",{className:"group/card relative rounded-lg border border-dashed bg-card shadow-sm transition-colors hover:border-primary/40",children:[n.jsx(Is,{label:r("sandbox.postBoard.deleteIdea"),onArchive:()=>c(k),className:"top-2"}),n.jsxs("div",{className:"p-3",children:[n.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:k.title||r("sandbox.postBoard.untitledIdea")}),k.body&&n.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-muted-foreground",children:k.body}),D&&n.jsx(nt,{variant:"secondary",className:"mt-2 max-w-full truncate",children:D})]}),n.jsx("div",{className:"border-t px-3 py-2",children:n.jsxs(_e,{type:"button",variant:"ghost",size:"sm",disabled:!0,className:"h-7 w-full justify-start px-1.5 text-xs",onClick:()=>i(k),children:[n.jsx(et,{size:13}),r("sandbox.postBoard.writeFromIdea"),n.jsx(nt,{variant:"secondary",className:"ml-auto",children:r("common.soon")})]})})]},k.key)}),e[28]=s,e[29]=c,e[30]=i,e[31]=a,e[32]=r,e[33]=N):N=e[33];let E;e[34]!==N?(E=n.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto pb-2 pr-1",children:N}),e[34]=N,e[35]=E):E=e[35];let B;return e[36]!==w||e[37]!==E||e[38]!==f?(B=n.jsxs("div",{className:f,children:[w,E]}),e[36]=w,e[37]=E,e[38]=f,e[39]=B):B=e[39],B}function Is(t){const e=ae.c(13),{label:s,onArchive:o,disabled:a,className:l}=t,i=Se();let c;e[0]!==s||e[1]!==i?(c=s??i("sandbox.postBoard.delete"),e[0]=s,e[1]=i,e[2]=c):c=e[2];const r=c;let d;e[3]!==o?(d=u=>{u.stopPropagation(),o()},e[3]=o,e[4]=d):d=e[4];let p;e[5]!==l?(p=be("absolute right-2 z-10 flex size-6 cursor-pointer items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-destructive focus-visible:opacity-100 group-hover/card:opacity-100 group-hover/row:opacity-100",l),e[5]=l,e[6]=p):p=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Ts,{size:13}),e[7]=m):m=e[7];let h;return e[8]!==a||e[9]!==d||e[10]!==p||e[11]!==r?(h=n.jsx("button",{type:"button",disabled:a,"aria-label":r,title:r,onClick:d,className:p,children:m}),e[8]=a,e[9]=d,e[10]=p,e[11]=r,e[12]=h):h=e[12],h}function Ge(t){const e=ae.c(50),{icon:s,logoUrl:o,title:a,subtitle:l,active:i,accent:c,variantCount:r,trailing:d,selectable:p,selectionActive:m,selected:h,invalid:u,invalidReason:f,onToggleSelect:x,onClick:g,menu:v}=t,y=Se(),j=c==="global";let w;e[0]!==s||e[1]!==i||e[2]!==j||e[3]!==o?(w=o?n.jsx("img",{src:o,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):n.jsx("span",{className:be("flex size-8 shrink-0 items-center justify-center rounded-lg",j?"bg-global-section/15":"bg-muted"),children:n.jsx(s,{size:16,className:be("shrink-0",!j&&(i?"text-accent-foreground":"text-muted-foreground")),style:j?{color:Ps}:void 0})}),e[0]=s,e[1]=i,e[2]=j,e[3]=o,e[4]=w):w=e[4];const N=w,E=i?j?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":j?"hover:bg-global-section/10":"hover:bg-muted";let B;e[5]!==E?(B=be("group relative flex min-w-0 items-center rounded-md transition-colors",E),e[5]=E,e[6]=B):B=e[6];let k;e[7]!==x||e[8]!==p||e[9]!==h||e[10]!==m||e[11]!==y||e[12]!==a?(k=p&&n.jsx("span",{className:be("flex shrink-0 items-center pl-2.5 transition-opacity",h||m?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:Or,children:n.jsx(Xt,{checked:h,onCheckedChange:()=>x?.(),"aria-label":y("sandbox.itemRow.selectItem",{title:a})})}),e[7]=x,e[8]=p,e[9]=h,e[10]=m,e[11]=y,e[12]=a,e[13]=k):k=e[13];const D=u&&!i&&"text-destructive";let O;e[14]!==D?(O=be("block truncate text-sm font-medium",D),e[14]=D,e[15]=O):O=e[15];let L;e[16]!==O||e[17]!==a?(L=n.jsx("span",{className:O,children:a}),e[16]=O,e[17]=a,e[18]=L):L=e[18];const K=i?"text-accent-foreground/70":"text-muted-foreground";let F;e[19]!==K?(F=be("block truncate text-xs",K),e[19]=K,e[20]=F):F=e[20];let _;e[21]!==l||e[22]!==F?(_=n.jsx("span",{className:F,children:l}),e[21]=l,e[22]=F,e[23]=_):_=e[23];let A;e[24]!==_||e[25]!==L?(A=n.jsxs("span",{className:"min-w-0 flex-1",children:[L,_]}),e[24]=_,e[25]=L,e[26]=A):A=e[26];let I;e[27]!==i||e[28]!==y||e[29]!==r?(I=r!==void 0&&r>1&&n.jsxs(Qe,{children:[n.jsx(We,{asChild:!0,children:n.jsxs("span",{className:be("flex shrink-0 items-center gap-1 text-xs font-medium",i?"text-accent-foreground/70":"text-muted-foreground"),children:[n.jsx(_n,{size:14}),r]})}),n.jsx(Ye,{side:"bottom",children:y("sandbox.itemRow.variantCount",{count:r})})]}),e[27]=i,e[28]=y,e[29]=r,e[30]=I):I=e[30];let R;e[31]!==i||e[32]!==u||e[33]!==f?(R=u&&n.jsxs(Qe,{children:[n.jsx(We,{asChild:!0,children:n.jsx("span",{className:be("flex shrink-0 items-center",i?"text-accent-foreground":"text-destructive"),children:n.jsx(Wt,{size:14})})}),f&&n.jsx(Ye,{side:"bottom",children:f})]}),e[31]=i,e[32]=u,e[33]=f,e[34]=R):R=e[34];let G;e[35]!==g||e[36]!==N||e[37]!==A||e[38]!==I||e[39]!==R||e[40]!==d?(G=n.jsxs("button",{type:"button",onClick:g,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-lg px-2.5 py-2 text-left cursor-pointer",children:[N,A,I,R,d]}),e[35]=g,e[36]=N,e[37]=A,e[38]=I,e[39]=R,e[40]=d,e[41]=G):G=e[41];let z;e[42]!==i||e[43]!==v?(z=v&&n.jsx("div",{className:be("pr-1 opacity-0 transition-opacity group-hover:opacity-100",i&&"opacity-100"),children:v}),e[42]=i,e[43]=v,e[44]=z):z=e[44];let W;return e[45]!==G||e[46]!==z||e[47]!==B||e[48]!==k?(W=n.jsxs("div",{className:B,children:[k,G,z]}),e[45]=G,e[46]=z,e[47]=B,e[48]=k,e[49]=W):W=e[49],W}function Or(t){return t.stopPropagation()}function tt(t){const e=ae.c(10),{icon:s,title:o,description:a}=t;let l;e[0]!==s?(l=s&&n.jsx(s,{size:24,className:"text-muted-foreground/60"}),e[0]=s,e[1]=l):l=e[1];let i;e[2]!==o?(i=n.jsx("div",{children:o}),e[2]=o,e[3]=i):i=e[3];let c;e[4]!==a?(c=a&&n.jsx("div",{className:"text-xs text-muted-foreground/80 max-w-sm",children:a}),e[4]=a,e[5]=c):c=e[5];let r;return e[6]!==l||e[7]!==i||e[8]!==c?(r=n.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 p-6 text-center text-sm text-muted-foreground",children:[l,i,c]}),e[6]=l,e[7]=i,e[8]=c,e[9]=r):r=e[9],r}const Ir={loaders:En,actions:Ln},Rr={loaders:"Loaders",actions:"Actions"},Fr={analytics:Qo,blog:Hn,commerce:Yo,site:Wo,website:Kt};function Kr(t,e){return e===0?Fr[t.toLowerCase()]??zs:zs}function At(t,e){return e===0?xa(t):t}function zr(t){const e=ae.c(98),{orgSlug:s,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,kind:r}=t,d=Se();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=[],e[0]=p):p=e[0];const[m,h]=$.useState(p),[u,f]=$.useState(null),[x,g]=$.useState(""),[v,y]=$.useState(Wr),[j,w]=$.useState(r);j!==r&&(w(r),h([]),f(null),g(""),y(new Set));let N;e[1]===Symbol.for("react.memo_cache_sentinel")?(N=q=>{y(Z=>{const de=new Set(Z);return de.has(q)?de.delete(q):de.add(q),de})},e[1]=N):N=e[1];const E=N;let B;e[2]!==a||e[3]!==s||e[4]!==o?(B={orgSlug:s,virtualMcpId:o,branch:a},e[2]=a,e[3]=s,e[4]=o,e[5]=B):B=e[5];const k=Qt(B);let D;e[6]!==k?(D=zn((q,Z)=>k.mutate({blockKey:q,data:Z})),e[6]=k,e[7]=D):D=e[7];const O=D;let L;e[8]!==r?(L=ba(r),e[8]=r,e[9]=L):L=e[9];const K=L,F=Ir[r];let _,A,I,R,G,z,W;if(e[10]!==F||e[11]!==a||e[12]!==c||e[13]!==r||e[14]!==i||e[15]!==v||e[16]!==s||e[17]!==m||e[18]!==l||e[19]!==k||e[20]!==O||e[21]!==x||e[22]!==u||e[23]!==K||e[24]!==d||e[25]!==o){I=Symbol.for("react.early_return_sentinel");e:{const q=[...fa(i,c,r).map(Jr),...pa(i,r).map(qr)],Z=x.trim().toLowerCase(),de=Z.length>0,ne=de?q.filter(M=>M.title.toLowerCase().includes(Z)||M.resolveType.toLowerCase().includes(Z)):[],ue=new Map,te=[],re=new Map;if(!de){for(const M of q){const xe=M.folderPath;if(!(xe.length<m.length)&&m.every((ve,Le)=>xe[Le]===ve))if(xe.length===m.length)if(M.savedKey!==void 0){const ve=re.get(M.resolveType);ve?ve.push(M):re.set(M.resolveType,[M])}else te.push(M);else{const ve=xe[m.length],Le=ue.get(ve)??{count:0,savedCount:0};M.savedKey!==void 0?Le.savedCount=Le.savedCount+1:Le.count=Le.count+1,ue.set(ve,Le)}}te.sort(Hr);for(const M of re.values())M.sort(Ur)}const le=[...re.entries()].filter(M=>{const[xe]=M;return!te.some(ve=>ve.resolveType===xe)}).flatMap(Gr).sort(Vr);let T;e[33]!==m?(T=(M,xe)=>At(M.name,m.length).localeCompare(At(xe.name,m.length)),e[33]=m,e[34]=T):T=e[34];const J=[...ue.entries()].map(Mr).sort(T);let ee;e[35]===Symbol.for("react.memo_cache_sentinel")?(ee=M=>{f(M.savedKey!==void 0?{mode:"saved",key:M.savedKey}:{mode:"available",resolveType:M.resolveType,title:M.title})},e[35]=ee):ee=e[35];const oe=ee;let S;e[36]!==k||e[37]!==K||e[38]!==d?(S=async(M,xe)=>{await k.mutateAsync({blockKey:M,data:xe}),me.success(d("sandbox.runnableBlocksBrowser.savedBlockToast",{singular:K,blockId:M})),f({mode:"saved",key:M})},e[36]=k,e[37]=K,e[38]=d,e[39]=S):S=e[39];const se=S;let H;e[40]!==c||e[41]!==u?(H=Yr(u,c),e[40]=c,e[41]=u,e[42]=H):H=e[42];const ie=H;if(ie){const M=`${ie.mode}:${ie.mode==="saved"?ie.blockKey:ie.resolveType}`;let xe;e[43]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>f(null),e[43]=xe):xe=e[43];let ve;e[44]!==a||e[45]!==c||e[46]!==se||e[47]!==r||e[48]!==i||e[49]!==s||e[50]!==l||e[51]!==k.isPending||e[52]!==O||e[53]!==M||e[54]!==ie.editorTarget||e[55]!==ie.initialValue||e[56]!==o?(ve=n.jsx(ha,{orgSlug:s,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,kind:r,target:ie.editorTarget,initialValue:ie.initialValue,isCreating:k.isPending,onCreate:se,onSaveReferencedBlock:O,onBack:xe},M),e[44]=a,e[45]=c,e[46]=se,e[47]=r,e[48]=i,e[49]=s,e[50]=l,e[51]=k.isPending,e[52]=O,e[53]=M,e[54]=ie.editorTarget,e[55]=ie.initialValue,e[56]=o,e[57]=ve):ve=e[57],I=ve;break e}W="flex h-full w-full min-w-0 flex-col";let ye;e[58]!==d?(ye=d("sandbox.runnableBlocksBrowser.folderBreadcrumb"),e[58]=d,e[59]=ye):ye=e[59];let pe;e[60]===Symbol.for("react.memo_cache_sentinel")?(pe=()=>h([]),e[60]=pe):pe=e[60];const je=m.length===0?"font-medium text-foreground":"text-muted-foreground";let he;e[61]!==je?(he=be("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",je),e[61]=je,e[62]=he):he=e[62];const we=Rr[r];let Pe;e[63]!==he||e[64]!==we?(Pe=n.jsx("button",{type:"button",onClick:pe,className:he,children:we}),e[63]=he,e[64]=we,e[65]=Pe):Pe=e[65];let Te;e[66]!==m?(Te=m.map((M,xe)=>{const ve=xe===m.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[n.jsx(Tt,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>h(m.slice(0,xe+1)),className:be("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",ve?"font-medium text-foreground":"text-muted-foreground"),children:At(M,xe)})]},`${M}-${xe}`)}),e[66]=m,e[67]=Te):Te=e[67];let Ne;e[68]!==ye||e[69]!==Pe||e[70]!==Te?(Ne=n.jsxs("nav",{"aria-label":ye,className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:[Pe,Te]}),e[68]=ye,e[69]=Pe,e[70]=Te,e[71]=Ne):Ne=e[71];let Be;e[72]===Symbol.for("react.memo_cache_sentinel")?(Be=n.jsx(Ss,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[72]=Be):Be=e[72];let De;e[73]===Symbol.for("react.memo_cache_sentinel")?(De=M=>g(M.target.value),e[73]=De):De=e[73];let ge;e[74]!==r||e[75]!==d?(ge=d("sandbox.runnableBlocksBrowser.searchPlaceholder",{kind:r}),e[74]=r,e[75]=d,e[76]=ge):ge=e[76];let $e;e[77]!==r||e[78]!==d?($e=d("sandbox.runnableBlocksBrowser.searchAriaLabel",{kind:r}),e[77]=r,e[78]=d,e[79]=$e):$e=e[79];let Fe;e[80]!==x||e[81]!==ge||e[82]!==$e?(Fe=n.jsxs("div",{className:"flex w-56 shrink-0 items-center gap-2",children:[Be,n.jsx("input",{type:"text",value:x,onChange:De,placeholder:ge,"aria-label":$e,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[80]=x,e[81]=ge,e[82]=$e,e[83]=Fe):Fe=e[83],e[84]!==Ne||e[85]!==Fe?(A=n.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[Ne,Fe]}),e[84]=Ne,e[85]=Fe,e[86]=A):A=e[86],_=Yt,z="min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",R="mx-auto w-full max-w-4xl px-6 py-5",G=de?ne.length===0?n.jsx(tt,{title:d("sandbox.runnableBlocksBrowser.noSearchResults",{kind:r,query:x.trim()}),description:d("sandbox.runnableBlocksBrowser.noSearchResultsDescription")}):n.jsx("div",{className:"flex flex-col gap-1",children:ne.map(M=>n.jsx(Ge,{icon:F,accent:M.savedKey!==void 0?"global":void 0,title:M.title,subtitle:M.resolveType,active:!1,onClick:()=>oe(M)},M.savedKey??M.resolveType))}):J.length===0&&te.length===0&&le.length===0?n.jsx(tt,{title:d("sandbox.runnableBlocksBrowser.emptyFolderTitle",{kind:r}),description:m.length===0?d("sandbox.runnableBlocksBrowser.emptyFolderNoManifest"):d("sandbox.runnableBlocksBrowser.emptyFolder")}):n.jsxs(n.Fragment,{children:[J.length>0&&n.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2",children:J.map(M=>{const xe=Kr(M.name,m.length);return n.jsxs("button",{type:"button",onClick:()=>h([...m,M.name]),className:"flex items-center gap-2.5 rounded-lg border px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[n.jsx(xe,{size:18,className:"shrink-0 text-muted-foreground"}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm font-medium",children:At(M.name,m.length)}),n.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[M.count," ",M.count===1?K:r,M.savedCount>0&&n.jsxs(n.Fragment,{children:[" ","·"," ",d("sandbox.runnableBlocksBrowser.savedCountLabel",{count:M.savedCount})]})]})]})]},M.name)})}),(te.length>0||le.length>0)&&n.jsxs("div",{className:be("flex flex-col gap-1",J.length>0&&"mt-4"),children:[te.map(M=>{const xe=re.get(M.resolveType)??[],ve=v.has(M.resolveType);return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(Ge,{icon:F,title:M.title,subtitle:M.resolveType,active:!1,onClick:()=>oe(M)}),xe.length>0&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{type:"button",onClick:()=>E(M.resolveType),"aria-expanded":ve,className:"flex items-center gap-1 self-start rounded-lg px-2.5 py-1 text-xs font-medium transition-colors hover:bg-global-section/10 cursor-pointer ml-11",style:{color:Ps},children:[ve?n.jsx(ft,{size:12,className:"shrink-0"}):n.jsx(Tt,{size:12,className:"shrink-0"}),d(ve?"sandbox.runnableBlocksBrowser.hideSaved":"sandbox.runnableBlocksBrowser.seeSaved")," ","(",xe.length,")"]}),ve&&n.jsx("div",{className:"ml-11 flex flex-col gap-1 pb-1",children:xe.map(Le=>n.jsx(Ge,{icon:F,accent:"global",title:Le.title,subtitle:Le.resolveType,active:!1,onClick:()=>oe(Le)},Le.savedKey))})]})]},M.resolveType)}),le.map(M=>n.jsx(Ge,{icon:F,accent:"global",title:M.title,subtitle:M.resolveType,active:!1,onClick:()=>oe(M)},M.savedKey))]})]})}e[10]=F,e[11]=a,e[12]=c,e[13]=r,e[14]=i,e[15]=v,e[16]=s,e[17]=m,e[18]=l,e[19]=k,e[20]=O,e[21]=x,e[22]=u,e[23]=K,e[24]=d,e[25]=o,e[26]=_,e[27]=A,e[28]=I,e[29]=R,e[30]=G,e[31]=z,e[32]=W}else _=e[26],A=e[27],I=e[28],R=e[29],G=e[30],z=e[31],W=e[32];if(I!==Symbol.for("react.early_return_sentinel"))return I;let P;e[87]!==R||e[88]!==G?(P=n.jsx("div",{className:R,children:G}),e[87]=R,e[88]=G,e[89]=P):P=e[89];let U;e[90]!==_||e[91]!==P||e[92]!==z?(U=n.jsx(_,{className:z,children:P}),e[90]=_,e[91]=P,e[92]=z,e[93]=U):U=e[93];let Y;return e[94]!==A||e[95]!==U||e[96]!==W?(Y=n.jsxs("div",{className:W,children:[A,U]}),e[94]=A,e[95]=U,e[96]=W,e[97]=Y):Y=e[97],Y}function Mr(t){const[e,s]=t;return{name:e,...s}}function Vr(t,e){return t.title.localeCompare(e.title)}function Gr(t){const[,e]=t;return e}function Ur(t,e){return t.title.localeCompare(e.title)}function Hr(t,e){return t.title.localeCompare(e.title)}function qr(t){return{resolveType:t.resolveType,title:t.title,folderPath:Kn(t.resolveType)}}function Jr(t){return{resolveType:t.resolveType,title:t.title,folderPath:Kn(t.resolveType),savedKey:t.key}}function Wr(){return new Set}function Yr(t,e){if(!t)return null;if(t.mode==="available")return{mode:"available",resolveType:t.resolveType,editorTarget:{mode:"available",resolveType:t.resolveType,title:t.title},initialValue:{}};const{resolveType:s,props:o,title:a}=ga(e,t.key);return{mode:"saved",blockKey:t.key,resolveType:s,editorTarget:{mode:"saved",blockKey:t.key,resolveType:s,title:a},initialValue:o}}function Qr(t){const e=ae.c(106),{orgSlug:s,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,resolveType:r,title:d,defaultBlockId:p,isCreating:m,onCreate:h,onSaveReferencedBlock:u}=t,f=Se(),x=Bt(),g=x?.virtualMcpId,y=Wn(g===o?o:null)?.metadata?.siteSlug??null;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={},e[0]=j):j=e[0];const[w,N]=$.useState(j);let E;e[1]===Symbol.for("react.memo_cache_sentinel")?(E=[],e[1]=E):E=e[1];const[B,k]=$.useState(E),[D,O]=$.useState(0),[L,K]=$.useState(!1);let F;e[2]!==i||e[3]!==r?(F=Ns(r,i),e[2]=i,e[3]=r,e[4]=F):F=e[4];const _=F;let A,I,R,G,z,W,P,U;if(e[5]!==y||e[6]!==a||e[7]!==c||e[8]!==B||e[9]!==w||e[10]!==m||e[11]!==h||e[12]!==s||e[13]!==l||e[14]!==r||e[15]!==f||e[16]!==x?.taskId||e[17]!==d||e[18]!==o){const te=r.split("/").pop()?.replace(/\.tsx?$/,"")??r,re=x?.taskId??null,le=l??void 0;let T;e[27]!==y||e[28]!==a||e[29]!==s||e[30]!==le||e[31]!==re||e[32]!==o?(T={orgSlug:s,virtualMcpId:o,branch:a,threadId:re,previewUrl:le,siteSlug:y},e[27]=y,e[28]=a,e[29]=s,e[30]=le,e[31]=re,e[32]=o,e[33]=T):T=e[33],I=T;let J,ee,oe,S;if(e[34]!==c||e[35]!==B||e[36]!==w||e[37]!==h||e[38]!==f||e[39]!==d){const Pe=[d,...B],Te=Be=>{k(B.slice(0,Be)),O(Xr)};let Ne;e[48]!==c||e[49]!==w||e[50]!==h?(Ne=async Be=>{const De=va(Be,c);if(De){me.error(De);return}await h(Be,w),K(!1)},e[48]=c,e[49]=w,e[50]=h,e[51]=Ne):Ne=e[51],A=Ne,U="flex h-full w-full min-w-0",P="flex min-w-0 flex-1 flex-col",z="shrink-0 border-b px-3 py-2.5",S="flex min-w-0 items-center gap-2 overflow-hidden",e[52]!==f?(J=f("sandbox.availableSectionEditor.editingBreadcrumb"),e[52]=f,e[53]=J):J=e[53],ee="flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",oe=Pe.map((Be,De)=>{const ge=De===Pe.length-1,$e=ya(Be);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[De>0&&n.jsx(Tt,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Te(De),title:$e,className:be("min-w-0 truncate rounded-lg px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",ge?"font-medium text-foreground":"text-muted-foreground"),children:$e})]},`${$e}-${De}`)}),e[34]=c,e[35]=B,e[36]=w,e[37]=h,e[38]=f,e[39]=d,e[40]=A,e[41]=J,e[42]=ee,e[43]=oe,e[44]=S,e[45]=z,e[46]=P,e[47]=U}else A=e[40],J=e[41],ee=e[42],oe=e[43],S=e[44],z=e[45],P=e[46],U=e[47];let se;e[54]!==J||e[55]!==ee||e[56]!==oe?(se=n.jsx("nav",{"aria-label":J,className:ee,children:oe}),e[54]=J,e[55]=ee,e[56]=oe,e[57]=se):se=e[57];let H;e[58]===Symbol.for("react.memo_cache_sentinel")?(H=()=>K(!0),e[58]=H):H=e[58];let ie;e[59]!==f?(ie=f("sandbox.availableSectionEditor.saveAsGlobalSection"),e[59]=f,e[60]=ie):ie=e[60];let ye;e[61]===Symbol.for("react.memo_cache_sentinel")?(ye=n.jsx(Xo,{size:14}),e[61]=ye):ye=e[61];let pe;e[62]!==m||e[63]!==ie?(pe=n.jsx(We,{asChild:!0,children:n.jsx(_e,{size:"icon",className:"size-8 shrink-0",disabled:m,onClick:H,"aria-label":ie,children:ye})}),e[62]=m,e[63]=ie,e[64]=pe):pe=e[64];let je;e[65]!==f?(je=f("sandbox.availableSectionEditor.saveAsGlobalSection"),e[65]=f,e[66]=je):je=e[66];let he;e[67]!==je?(he=n.jsx(Ye,{side:"bottom",children:je}),e[67]=je,e[68]=he):he=e[68];let we;e[69]!==pe||e[70]!==he?(we=n.jsxs(Qe,{children:[pe,he]}),e[69]=pe,e[70]=he,e[71]=we):we=e[71],e[72]!==S||e[73]!==se||e[74]!==we?(W=n.jsxs("div",{className:S,children:[se,we]}),e[72]=S,e[73]=se,e[74]=we,e[75]=W):W=e[75],R="mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",G=f("sandbox.availableSectionEditor.localEditsHint",{typeLabel:te}),e[5]=y,e[6]=a,e[7]=c,e[8]=B,e[9]=w,e[10]=m,e[11]=h,e[12]=s,e[13]=l,e[14]=r,e[15]=f,e[16]=x?.taskId,e[17]=d,e[18]=o,e[19]=A,e[20]=I,e[21]=R,e[22]=G,e[23]=z,e[24]=W,e[25]=P,e[26]=U}else A=e[19],I=e[20],R=e[21],G=e[22],z=e[23],W=e[24],P=e[25],U=e[26];let Y;e[76]!==R||e[77]!==G?(Y=n.jsx("p",{className:R,children:G}),e[76]=R,e[77]=G,e[78]=Y):Y=e[78];let q;e[79]!==Y||e[80]!==z||e[81]!==W?(q=n.jsxs("div",{className:z,children:[W,Y]}),e[79]=Y,e[80]=z,e[81]=W,e[82]=q):q=e[82];let Z;e[83]!==c||e[84]!==B||e[85]!==D||e[86]!==w||e[87]!==i||e[88]!==u||e[89]!==I||e[90]!==_||e[91]!==f?(Z=n.jsx(Yt,{className:"min-h-0 flex-1 [&_[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:_?n.jsx(Mn,{schema:_,value:w,onChange:te=>N(te),basePath:"",breadcrumbPath:B,onBreadcrumbChange:k,meta:i,decofile:c,onSaveReferencedBlock:u,sandbox:I},D):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:f("sandbox.availableSectionEditor.noEditableFields")})})})}),e[83]=c,e[84]=B,e[85]=D,e[86]=w,e[87]=i,e[88]=u,e[89]=I,e[90]=_,e[91]=f,e[92]=Z):Z=e[92];let de;e[93]!==q||e[94]!==Z||e[95]!==P?(de=n.jsxs("div",{className:P,children:[q,Z]}),e[93]=q,e[94]=Z,e[95]=P,e[96]=de):de=e[96];let ne;e[97]!==p||e[98]!==A||e[99]!==m||e[100]!==L?(ne=n.jsx(ja,{open:L,onOpenChange:K,defaultBlockId:p,isPending:m,onSubmit:A}),e[97]=p,e[98]=A,e[99]=m,e[100]=L,e[101]=ne):ne=e[101];let ue;return e[102]!==de||e[103]!==ne||e[104]!==U?(ue=n.jsxs("div",{className:U,children:[de,ne]}),e[102]=de,e[103]=ne,e[104]=U,e[105]=ue):ue=e[105],ue}function Xr(t){return t+1}function Zr(t,e){const s={__resolveType:t},o=wa([s],e)[0];return o?Na(s,o,e):null}function ec({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,meta:a,decofile:l,blockKey:i,onSaveReferencedBlock:c}){const r=Se(),d=Bt(),p=d?.virtualMcpId,h=Wn(p===e?e:null)?.metadata?.siteSlug??null,[u]=$.useState(()=>Zr(i,l)),[f,x]=$.useState(u?.data??{}),[g,v]=$.useState([]),[y,j]=$.useState(0),[w,N]=$.useState(!1),[E,B]=$.useState(null),k=E!==null,{save:D,flush:O}=ka({orgSlug:t,virtualMcpId:e,branch:s}),L=u?.resolveType?Ns(u.resolveType,a):null,K=l[i],F=K?Ka(i,K):i,_=d?.taskId??null,A={orgSlug:t,virtualMcpId:e,branch:s,threadId:_,previewUrl:o??void 0,siteSlug:h},I=P=>{x(P),D(i,P)},R=()=>{k?(B(null),N(!1),j(P=>P+1)):B(JSON.stringify(f,null,2))},G=P=>{const U=P??"";try{const Y=JSON.parse(U);if(Y&&typeof Y=="object"&&!Array.isArray(Y)){N(!1),I(Y);return}N(!0)}catch{N(!0)}},z=[F,...g],W=P=>{v(g.slice(0,P)),j(U=>U+1)};return n.jsx("div",{className:"flex h-full w-full min-w-0",children:n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsx(Sa,{crumbs:z,onSelect:W}),n.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[n.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Ps},"aria-hidden":!0}),n.jsx("div",{className:"flex-1"}),n.jsxs(Qe,{children:[n.jsx(We,{asChild:!0,children:n.jsx(_e,{variant:k?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:R,"aria-label":r(k?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson"),"aria-pressed":k,children:k?n.jsx(Bs,{size:14}):n.jsx(Dn,{size:14})})}),n.jsx(Ye,{side:"bottom",children:r(k?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson")})]})]}),n.jsx("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:r("sandbox.savedSectionEditor.globalSectionDescription")})]}),n.jsxs("div",{className:"relative min-h-0 flex-1",children:[n.jsx(Yt,{className:"h-full [&_[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:L?n.jsx(Mn,{schema:L,value:f,onChange:P=>I(P),basePath:"",breadcrumbPath:g,onBreadcrumbChange:v,meta:a,decofile:l,onSaveReferencedBlock:c,sandbox:A},y):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sandbox.savedSectionEditor.noEditableFields")})})})}),E!==null&&n.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[w&&n.jsx("div",{className:"shrink-0 border-b bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:r("sandbox.savedSectionEditor.invalidJsonError")}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(Jn,{language:"json",height:"100%",code:E,onChange:G,onSave:P=>{G(P),O()}})})]})]})]})})}function tc(t){const e=ae.c(36),{selection:s,orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,isCreating:d,onCreateAvailable:p,onSaveReferencedBlock:m}=t,h=Se();if(!s){let x;e[0]!==h?(x=h("sandbox.sectionsRightPane.selectSectionTitle"),e[0]=h,e[1]=x):x=e[1];let g;e[2]!==h?(g=h("sandbox.sectionsRightPane.selectSectionDescription"),e[2]=h,e[3]=g):g=e[3];let v;return e[4]!==x||e[5]!==g?(v=n.jsx(tt,{title:x,description:g}),e[4]=x,e[5]=g,e[6]=v):v=e[6],v}if(s.collection==="available-section"){const x=`available:${s.resolveType}`,g=s.resolveType,v=s.title;let y;e[7]!==s.title?(y=Ca(s.title),e[7]=s.title,e[8]=y):y=e[8];let j;e[9]!==p||e[10]!==s.resolveType?(j=(N,E)=>p(s.resolveType,N,E),e[9]=p,e[10]=s.resolveType,e[11]=j):j=e[11];let w;return e[12]!==l||e[13]!==r||e[14]!==d||e[15]!==c||e[16]!==m||e[17]!==o||e[18]!==i||e[19]!==s.resolveType||e[20]!==s.title||e[21]!==x||e[22]!==y||e[23]!==j||e[24]!==a?(w=n.jsx(Qr,{orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,resolveType:g,title:v,defaultBlockId:y,isCreating:d,onCreate:j,onSaveReferencedBlock:m},x),e[12]=l,e[13]=r,e[14]=d,e[15]=c,e[16]=m,e[17]=o,e[18]=i,e[19]=s.resolveType,e[20]=s.title,e[21]=x,e[22]=y,e[23]=j,e[24]=a,e[25]=w):w=e[25],w}const u=`saved:${s.key}`;let f;return e[26]!==l||e[27]!==r||e[28]!==c||e[29]!==m||e[30]!==o||e[31]!==i||e[32]!==s.key||e[33]!==u||e[34]!==a?(f=n.jsx(ec,{orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,blockKey:s.key,onSaveReferencedBlock:m},u),e[26]=l,e[27]=r,e[28]=c,e[29]=m,e[30]=o,e[31]=i,e[32]=s.key,e[33]=u,e[34]=a,e[35]=f):f=e[35],f}function $t(t){const e=ae.c(34),{onDuplicate:s,onRename:o,onAddVariant:a,onEditSeo:l,onViewJson:i,onDelete:c}=t,r=Se();let d;e[0]!==r?(d=r("sandbox.itemActions.moreActions"),e[0]=r,e[1]=d):d=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Oo,{size:14}),e[2]=p):p=e[2];let m;e[3]!==d?(m=n.jsx(It,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":d,className:"flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:sc,children:p})}),e[3]=d,e[4]=m):m=e[4];let h;e[5]!==o||e[6]!==r?(h=o&&n.jsxs(Je,{onClick:o,children:[n.jsx(ml,{size:14}),r("sandbox.itemActions.rename")]}),e[5]=o,e[6]=r,e[7]=h):h=e[7];let u;e[8]!==s||e[9]!==r?(u=s&&n.jsxs(Je,{onClick:s,children:[n.jsx(ul,{size:14}),r("sandbox.itemActions.duplicate")]}),e[8]=s,e[9]=r,e[10]=u):u=e[10];let f;e[11]!==a||e[12]!==r?(f=a&&n.jsxs(n.Fragment,{children:[n.jsx(ds,{}),n.jsxs(Je,{onClick:a,className:"cursor-pointer text-success focus:text-success",children:[n.jsx(_n,{size:14}),r("sandbox.itemActions.addVariant")]})]}),e[11]=a,e[12]=r,e[13]=f):f=e[13];let x;e[14]!==l||e[15]!==i||e[16]!==r?(x=(l||i)&&n.jsxs(n.Fragment,{children:[n.jsx(ds,{}),l&&n.jsxs(Je,{onClick:l,children:[n.jsx(Bn,{size:14}),r("sandbox.itemActions.editSeo")]}),i&&n.jsxs(Je,{onClick:i,children:[n.jsx(Dn,{size:14}),r("sandbox.itemActions.viewJson")]})]}),e[14]=l,e[15]=i,e[16]=r,e[17]=x):x=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(ds,{}),e[18]=g):g=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ts,{size:14}),e[19]=v):v=e[19];let y;e[20]!==r?(y=r("sandbox.itemActions.delete"),e[20]=r,e[21]=y):y=e[21];let j;e[22]!==c||e[23]!==y?(j=n.jsxs(Je,{onClick:c,className:"text-destructive focus:text-destructive",children:[v,y]}),e[22]=c,e[23]=y,e[24]=j):j=e[24];let w;e[25]!==j||e[26]!==h||e[27]!==u||e[28]!==f||e[29]!==x?(w=n.jsxs(Rt,{align:"end",className:"w-44",children:[h,u,f,x,g,j]}),e[25]=j,e[26]=h,e[27]=u,e[28]=f,e[29]=x,e[30]=w):w=e[30];let N;return e[31]!==w||e[32]!==m?(N=n.jsxs(Ft,{children:[m,w]}),e[31]=w,e[32]=m,e[33]=N):N=e[33],N}function sc(t){return t.stopPropagation()}function nc(t){return t.split("/").pop()?.replace(/\.tsx?$/,"")||t||"Section"}function oc(t){const e=new Map;for(const s of t){const o=nc(s.resolveType),a=e.get(o);a?a.push(s):e.set(o,[s])}return[...e.entries()].map(([s,o])=>({label:s,sections:o})).sort((s,o)=>s.label.localeCompare(o.label))}function jn(t){const e=ae.c(8),{icon:s,label:o,className:a}=t;let l;e[0]!==a?(l=be("flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",a),e[0]=a,e[1]=l):l=e[1];let i;e[2]!==s?(i=n.jsx(s,{size:13,className:"shrink-0"}),e[2]=s,e[3]=i):i=e[3];let c;return e[4]!==o||e[5]!==l||e[6]!==i?(c=n.jsxs("div",{className:l,children:[i,o]}),e[4]=o,e[5]=l,e[6]=i,e[7]=c):c=e[7],c}const kn=$.lazy(()=>He(()=>import("./app-editor-D6e4YO7u.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168])).then(t=>({default:t.AppEditor}))),ac=$.lazy(()=>He(()=>import("./post-editor-B9m6130P.js"),__vite__mapDeps([169,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,29,28,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,56,81,170,156,135,76,77,55,106,118,113,111,61,60,58,62,63,64,65,66,67,68,69,70,71,72,23,73,74,75,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,107,21,22,108,109,110,57,112,114,115,116,117,119,120,121,122,123,124,171,139,59,172,173,174,125,126,127,128,129,130,131,132,133,134,136,137,138,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,157,158,159,160,161,162,163,164,165,166,167,168])).then(t=>({default:t.PostEditor}))),lc=$.lazy(()=>He(()=>import("./record-editor-BwyoUD4K.js"),__vite__mapDeps([175,1,2,56,81,22,23,24,25,111,61,60,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,58,28,29,30,31,32,33,34,35,36,37,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,62,63,64,65,66,67,68,69,55,70,71,72,73,74,75,76,77,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,21,108,109,110,57,112,113,114,115,116,117,118,119,120,121,122,123,124,174,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168])).then(t=>({default:t.RecordEditor}))),ic=$.lazy(()=>He(()=>import("./context-D6Zd3Hi2.js"),__vite__mapDeps([176,1,2,25,28,29,30,31,32,33,34,35,36,37,24,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,56,81,111,106,18,177,102,96,55,103,98,70,71,4,5,6,7,8,9,72,23,112,139,172,69,74,76,77,178,143,140,61,60,11,12,13,14,15,3,10,16,17,19,20,58,62,63,64,65,66,67,68,73,75,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,97,99,100,101,104,105,107,21,22,108,109,110,57,113,114,115,116,117,118,119,120,121,122,123,124,166,174,175,125,126,127,128,129,130,131,132,133,134,135,136,137,138,141,142,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,167,168,179,171,59,173])).then(t=>({default:t.BlogContext}))),rc=$.lazy(()=>He(()=>import("./category-editor-Cp8uxqcx.js"),__vite__mapDeps([179,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,33,35,45,28,29,30,31,32,34,36,37,24,25,27,38,39,40,41,42,43,44,46,47,48,49,50,51,52,53,54,115,56,81,171,112,76,77,55,106,61,60,58,62,63,64,65,66,67,68,69,70,71,72,23,73,74,75,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,107,21,22,108,109,110,111,57,113,114,116,117,118,119,120,121,122,123,124,139,59,172,173,174,125,126,127,128,129,130,131,132,133,134,135,136,137,138,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168])).then(t=>({default:t.CategoryEditor}))),cc=$.lazy(()=>He(()=>import("./sections-editor-25cXOA_1.js"),__vite__mapDeps([180,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,57,61,60,58,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,62,63,64,65,66,67,68,69,55,70,71,72,23,73,74,75,76,77,78,79,80,56,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,21,22,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,166,181,26,59,182])).then(t=>({default:t.SectionsEditor}))),dc=$.lazy(()=>He(()=>import("./seo-editor-qQizVqfD.js"),__vite__mapDeps([183,1,2,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,21,22,23,61,60,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,58,62,63,64,65,66,67,68,69,55,70,71,72,73,74,75,76,77,78,79,80,56,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,57,112,113,114,115,116,117,118,119,120,121,122,123,124,181])).then(t=>({default:t.SeoEditor}))),uc=$.lazy(()=>He(()=>import("./variant-calendar-C4_2wBML.js"),__vite__mapDeps([184,1,2,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,81,21,22,23,113,72,185,125,126,121,119,20,14,13,122,5,4,6,7,8,9,11,12,15,100,127,94,98,128,3,10,16,17,18,19,96,55,129,87,71,101,102,103,56,70,130,73,74,75,76,77,78,79,80,82,83,84,85,86,88,89,90,91,131,60,68,67,69,64,65,118,132,123,97,133,134,135,136,106,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,111,152,153,154,155,156,157,158,159,160,63,66,92,93,95,99,104,105,161,116,62,162,163,164,165,115,61,58,107,108,109,110,57,112,114,117,120,124,166,167,168])).then(t=>({default:t.VariantCalendar}))),mc=$.lazy(()=>He(()=>import("./post-calendar-BLuKhT2v.js"),__vite__mapDeps([186,1,2,29,28,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,187,21,22,23,125,126,121,119,20,14,13,122,5,4,6,7,8,9,11,12,15,100,127,94,98,128,3,10,16,17,18,19,96,72,55,129,87,71,101,102,103,81,56,70,130,73,74,75,76,77,78,79,80,82,83,84,85,86,88,89,90,91,131,60,68,67,69,64,65,118,132,123,97,133,134,135,136,106,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,111,152,153,154,155,156,157,158,159,160,63,66,92,93,95,99,104,105,161,116,62,162,163,164,165,115,61,58,107,108,109,110,57,112,113,114,117,120,124,166,167,168])).then(t=>({default:t.PostCalendar}))),fc=$.lazy(()=>He(()=>import("./redirect-editor-dBYIGyFb.js"),__vite__mapDeps([188,1,2,135,24,56,81,22,23,25,61,60,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,58,28,29,30,31,32,33,34,35,36,37,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,62,63,64,65,66,67,68,69,55,70,71,72,73,74,75,76,77,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,21,108,109,110,111,57,112,113,114,115,116,117,118,119,120,121,122,123,124,174])).then(t=>({default:t.RedirectEditor})));function pc(t){const e=ae.c(20),{deepLinkPage:s}=t,{currentBranch:o,virtualMcpId:a}=Cn(),{org:l}=Io(),i=Xa(),c=Za(),{runtime:r,previewServerUrl:d}=qn(a),p=r==="cms";let m;e[0]!==p||e[1]!==c.previewState||e[2]!==i.lifecycle.phase?(m=Al({fastPreviewActive:p,previewState:c.previewState,lifecyclePhase:i.lifecycle.phase}),e[0]=p,e[1]=c.previewState,e[2]=i.lifecycle.phase,e[3]=m):m=e[3];const h=m;if(h.kind==="sandbox-card"){const x=`/${l.slug}/settings/connections`;let g;return e[4]!==h.state||e[5]!==c.start||e[6]!==x||e[7]!==i.lifecycle||e[8]!==i.phase?(g=n.jsx(_l,{state:h.state,claimPhase:i.phase,lifecycle:i.lifecycle,onStart:c.start,connectionsHref:x}),e[4]=h.state,e[5]=c.start,e[6]=x,e[7]=i.lifecycle,e[8]=i.phase,e[9]=g):g=e[9],g}if(!a||!o){let x;return e[10]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(tt,{title:"Waiting for sandbox context…"}),e[10]=x):x=e[10],x}const u=p?d:c.previewUrl;let f;return e[11]!==o||e[12]!==s||e[13]!==h.devServerReady||e[14]!==h.sandboxWarming||e[15]!==c.previewUrl||e[16]!==l.slug||e[17]!==u||e[18]!==a?(f=n.jsx(gc,{orgSlug:l.slug,virtualMcpId:a,branch:o,previewUrl:c.previewUrl,sitePreviewUrl:u,deepLinkPage:s,devServerReady:h.devServerReady,sandboxWarming:h.sandboxWarming}),e[11]=o,e[12]=s,e[13]=h.devServerReady,e[14]=h.sandboxWarming,e[15]=c.previewUrl,e[16]=l.slug,e[17]=u,e[18]=a,e[19]=f):f=e[19],f}const Sn=2e3,hc=15;function wn(t,e,s,o){return typeof e!="string"||s&&(Yn(e,s,o)||t.state.dataUpdateCount>=hc)?!1:Sn}function gc({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,sitePreviewUrl:a,deepLinkPage:l,devServerReady:i,sandboxWarming:c}){const r=Se(),d=Bt()?.taskId??null,p={orgSlug:t,virtualMcpId:e,branch:s,threadId:d,previewUrl:o},{data:m,isLoading:h}=Pa(p,{fetchEnabled:i}),u=Nn({strict:!1}),[f,x]=$.useState(()=>u.contentCollection&&ot(u.contentCollection)&&u.contentCollection||"pages"),[g,v]=$.useState(()=>u.contentItem&&ot(f)?{collection:f,key:u.contentItem}:null),[y,j]=$.useState(null),w=!!(l?.pageId||l?.path||l?.pathTemplate),[N,E]=$.useState(!1);if(w&&!N&&g===null&&m){E(!0);const b=za(Us(m),l??{});b&&(x("pages"),v({collection:"pages",key:b.key,path:b.path}))}const[B,k]=$.useState(""),[D,O]=$.useState("board"),L=b=>{v(b),j(null)},[K,F]=$.useState(f);K!==f&&(F(f),k(""));const{data:_,isLoading:A,isFetching:I}=Ta(p,{fetchEnabled:i,refetchInterval:b=>{const V=b.state.data;if(f==="apps"&&g&&g.collection==="apps"){const ce=m?.[g.key];return wn(b,typeof ce?.__resolveType=="string"?ce.__resolveType:void 0,V)}if(f==="site"&&m){const ce=V?Hs(m,V):null,fe=m.site,Ae=ce?.resolveType??(typeof fe?.__resolveType=="string"?fe.__resolveType:void 0);return wn(b,Ae,V,["seo"])}return!1}}),R=(b,V)=>!Yn(b,_,V)&&(A||I),{catalog:G,isLoading:z}=Pl(_??void 0,m??void 0,{enabled:f==="apps"}),W=Ui({orgSlug:t,virtualMcpId:e,branch:s,meta:_}),P=Qt(p),U=Un(p),Y=Ji({orgSlug:t,virtualMcpId:e,branch:s,decofile:m??{},support:W,onMoved:(b,V)=>v(ce=>ce?.collection==="posts"&&ce.key===b?{collection:"posts",key:V}:ce)}),[q,Z]=$.useState(null),[de,ne]=$.useState(),[ue,te]=$.useState(!1),[re,le]=$.useState(),[T,J]=$.useState(null),[ee,oe]=$.useState(null),[S,se]=$.useState(null),H=!m||!_;if(h||A||H&&c)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(lt,{className:"size-5 text-muted-foreground"})});if(H)return n.jsx(tt,{title:"Could not load site data."});const ie=Us(m).sort((b,V)=>b.name.localeCompare(V.name)),ye=Ma(m).sort((b,V)=>b.from.localeCompare(V.from)),pe=Va(m,_),je=f==="sections"?Ga(_):[],he=Hs(m,_),we=to(m),Pe=Es.some(b=>we[b].length>0),Te=ot(f)?we[f]:[],Ne=Vs(_,"loaders"),Be=Vs(_,"actions");if(!Ua(m,_)&&!Pe&&Ne===0&&Be===0)return n.jsx(tt,{icon:Wt,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, apps, loaders, or actions."});const De={pages:ie.length,sections:pe.length,apps:G.length,loaders:Ne,actions:Be,redirects:ye.length,posts:we.posts.length,authors:we.authors.length,categories:we.categories.length},ge=new Set(ie.map(b=>Lt(b.path))),$e=new Set(ie.map(b=>b.name)),Fe=new Set(pe.map(b=>b.name)),M=async b=>{const V=m[b.key];if(!V)return;const ce=Vn(m,b.key),fe=Ba(m,b.key,Math.max(0,ce-1)),Ae=Ea(V.sections,fe);if(Ae)try{await P.mutateAsync({blockKey:b.key,data:{...V,sections:Ae}}),me.success(`Variant added to "${b.name}"`),v({collection:"pages",key:b.key,path:b.path})}catch(Oe){me.error(Oe instanceof Error?Oe.message:"Could not add variant")}},xe=()=>{ne(void 0),Z({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},ve=b=>{ne(void 0),Z({mode:"duplicate",sourceKey:b.key,initialName:Qs($e,b.name),initialPath:$l(ge,b.path)})},Le=b=>{ne(void 0),Z({mode:"rename",sourceKey:b.key,initialName:b.name,initialPath:b.path})},ss=async b=>{if(!q)return;const{mode:V,sourceKey:ce}=q;try{if(V==="create"){let fe;if(b.templateKey){const Oe=m[b.templateKey];if(!Oe)throw new Error("Selected template no longer exists.");fe={...Oe,name:b.name,path:b.path}}else fe=Il(b.name,b.path);const Ae=Fl(m,b.name);await P.mutateAsync({blockKey:Ae,data:fe}),me.success(`Created "${b.name}"`),v({collection:"pages",key:Ae,path:b.path})}else if(V==="duplicate"&&ce){const fe=m[ce];if(!fe)throw new Error("Source page not found");const{key:Ae,data:Oe}=Ol({source:fe,pages:ie,newName:b.name,newPath:b.path});await P.mutateAsync({blockKey:Ae,data:Oe}),me.success(`Duplicated as "${b.name}"`),v({collection:"pages",key:Ae,path:b.path})}else if(V==="rename"&&ce){const fe=m[ce];if(!fe)throw new Error("Page not found");const Ae={...fe,name:b.name,path:b.path};await P.mutateAsync({blockKey:ce,data:Ae}),me.success("Page updated"),g?.collection==="pages"&&g.key===ce&&v({collection:"pages",key:ce,path:b.path})}Z(null)}catch(fe){ne(fe instanceof Error?fe.message:"Save failed")}},ns=({path:b})=>{if(!q)return null;const V=Lt(b);return(q.mode==="rename"?Lt(q.initialPath):null)!==V&&ge.has(V)?`A page with path "${b}" already exists.`:null},os=async(b,V,ce)=>{await P.mutateAsync({blockKey:V,data:{...ce,name:V,__resolveType:b}}),me.success(r("sandbox.contentBrowser.createdSection",{name:V})),v({collection:"sections",key:V})},as=zn((b,V)=>P.mutate({blockKey:b,data:V})),ls=async b=>{const V=m[b.key];if(!V){me.error(r("sandbox.contentBrowser.sectionNotFound"));return}const ce=Ll(m,b.key),fe=Qs(Fe,b.name),Ae={...V,name:fe};try{await P.mutateAsync({blockKey:ce,data:Ae}),me.success(r("sandbox.contentBrowser.duplicatedSection",{name:b.name})),v({collection:"sections",key:ce})}catch(Oe){me.error(Oe instanceof Error?Oe.message:r("sandbox.contentBrowser.duplicateFailed"))}},is=async b=>{if(!T)return;const V=m[T];if(!V){me.error(r("sandbox.contentBrowser.sectionNotFound"));return}try{await P.mutateAsync({blockKey:T,data:{...V,name:b}}),me.success(r("sandbox.contentBrowser.sectionRenamed")),J(null)}catch(ce){me.error(ce instanceof Error?ce.message:r("sandbox.contentBrowser.renameFailed"))}},_t=()=>{le(void 0),te(!0)},rs=async b=>{const V=Ha(m,b.from),ce=qa(b);try{await P.mutateAsync({blockKey:V,data:ce}),me.success("Created redirect"),te(!1),v({collection:"redirects",key:V})}catch(fe){le(fe instanceof Error?fe.message:"Could not create redirect")}},cs=async b=>{const V=hs(m,b),ce=at(V,b,co(b));try{await P.mutateAsync({blockKey:V,data:ce}),me.success(`Created ${Nt[b]}`),v({collection:b,key:V})}catch(fe){me.error(fe instanceof Error?fe.message:"Could not create")}},C=async b=>{const V=hs(m,"posts"),ce=at(V,"posts",Bi(b));try{await P.mutateAsync({blockKey:V,data:ce}),me.success(r("sandbox.postCalendar.createdScheduledPost")),x("posts"),F("posts"),v({collection:"posts",key:V}),j(null)}catch(fe){me.error(fe instanceof Error?fe.message:r("sandbox.postCalendar.couldNotCreate"))}},Q=async(b,V)=>{const ce=m[b],fe=ce?_i(dt(ce,"posts"),V):null;if(!fe){me.error(r("sandbox.postCalendar.onlyScheduledCanMove"));return}try{await P.mutateAsync({blockKey:b,data:at(b,"posts",fe)})}catch(Ae){me.error(Ae instanceof Error?Ae.message:r("sandbox.postCalendar.couldNotReschedule"))}},Ee=async b=>{const V=m[b.key];if(!V){me.error("Record not found.");return}const ce=hs(m,b.kind),fe=b.kind==="posts"?"title":"name",Ae={...structuredClone(dt(V,b.kind)),[fe]:`${b.label} (copy)`};try{await P.mutateAsync({blockKey:ce,data:at(ce,b.kind,Ae)}),me.success(`Duplicated "${b.label}"`),v({collection:b.kind,key:ce})}catch(Oe){me.error(Oe instanceof Error?Oe.message:"Duplicate failed")}},Ve=()=>{x("posts"),F("posts"),v(null),j(null),k("")},qe=async()=>{if(ee)try{const{kind:b,key:V,label:ce}=ee;if(b==="blog"){if(ee.blogKind==="categories"){const fe=dt(m[V],"categories").slug,Ae=typeof fe=="string"?fe:"";if(Ae)for(const{key:Oe,payload:Rs}of Ue(m,"posts")){const Fs=li(Rs,Ae);Fs!==Rs&&await P.mutateAsync({blockKey:Oe,data:at(Oe,"posts",ii(Fs))})}}await U.mutateAsync({blockKey:V})}else await U.mutateAsync({blockKey:V});me.success(`Deleted "${ce}"`),g&&g.collection!=="available-section"&&g.key===V&&v(null),oe(null)}catch(b){me.error(b instanceof Error?b.message:"Delete failed")}},Ce=U.isPending||P.isPending,xt=ee?.kind==="blog"?Nt[ee.blogKind]:ee?.kind??"item";return n.jsxs("div",{className:"flex h-full w-full",children:[n.jsx(Bl,{active:f,counts:De,showBlog:Pe,onSelect:b=>{x(b),v(null),j(null)}}),f!=="seo"&&f!=="site"&&f!=="context"&&f!=="calendar"&&f!=="post-schedule"&&f!=="posts"&&f!=="loaders"&&f!=="actions"&&n.jsx(xc,{activeCollection:f,pages:ie,redirects:ye,sections:pe,availableSections:je,appCatalog:G,appCatalogLoading:z,blogEntries:Te,decofile:m,searchQuery:B,onSearchChange:k,selection:g,onSelect:L,onCreate:()=>{f==="pages"?xe():f==="redirects"?_t():ot(f)&&cs(f)},onDuplicatePage:ve,onRenamePage:Le,onAddPageVariant:M,onDeletePage:b=>oe({kind:"page",key:b.key,label:b.name}),onEditPageSeo:b=>{const V={collection:"pages",key:b.key,path:b.path};v(V),j(b.key)},onViewPageJson:b=>se(b.key),onDuplicateSection:ls,onRenameSection:b=>J(b.key),onDeleteSection:b=>oe({kind:"section",key:b.key,label:b.name}),onDeleteRedirect:b=>oe({kind:"redirect",key:b.key,label:b.from||b.key}),onDuplicateBlog:Ee,onDeleteBlog:b=>oe({kind:"blog",blogKind:b.kind,key:b.key,label:b.label})}),n.jsx("div",{className:"flex-1 min-w-0",children:f==="loaders"||f==="actions"?n.jsx(zr,{orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,meta:_,decofile:m,kind:f}):n.jsx($.Suspense,{fallback:n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(lt,{className:"size-5 text-muted-foreground"})}),children:f==="calendar"?n.jsx(uc,{decofile:m}):f==="post-schedule"?n.jsx(mc,{decofile:m,support:W,isCreating:P.isPending,onCreate:b=>{C(b)},onReschedule:(b,V)=>{Q(b,V)},onSelect:b=>{x("posts"),F("posts"),v({collection:"posts",key:b}),j(null)}}):f==="site"?he?n.jsx(kn,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:he.key,block:m[he.key],decofile:m,meta:_,title:"Site",excludeFields:["seo"],schemaPending:R(he.resolveType,["seo"]),previewBaseUrl:o},`site:${he.key}`):n.jsx(tt,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):f==="context"?n.jsx(gl,{title:r("sandbox.blogContext.soonTitle"),description:r("sandbox.blogContext.soonDescription"),children:n.jsx(ic,{orgSlug:t,virtualMcpId:e,branch:s,decofile:m,meta:_,onOpenPost:b=>{x("posts"),F("posts"),v({collection:"posts",key:b}),j(null)},onManageCategoryPosts:()=>{x("posts"),F("posts"),v(null),j(null)}})}):f==="seo"?n.jsx(dc,{orgSlug:t,virtualMcpId:e,branch:s,decofile:m,meta:_,target:{kind:"site"},previewBaseUrl:a}):f==="sections"?n.jsx(tc,{selection:g?.collection==="sections"||g?.collection==="available-section"?g:null,orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,meta:_,decofile:m,isCreating:P.isPending,onCreateAvailable:os,onSaveReferencedBlock:as}):f==="posts"?n.jsx(_r,{orgSlug:t,virtualMcpId:e,branch:s,decofile:m,view:D,selectedKey:g?.collection==="posts"?g.key:null,onViewChange:b=>{O(b),v(null)},onClose:()=>v(null),onOpen:b=>{v({collection:"posts",key:b}),j(null)},move:Y,support:W,meta:_,renderDetail:(b,V)=>n.jsx(ac,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:b,block:m[b],decofile:m,meta:_,previewBaseUrl:a,move:Y,onClose:V?.onClose,expanded:V?.expanded,onToggleExpand:V?.onToggleExpand},`post:${Ct(b)}`)}):g&&g.collection!=="available-section"?g.collection==="apps"?n.jsx(kn,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:g.key,block:m[g.key],decofile:m,meta:_,previewBaseUrl:o,schemaPending:R(typeof m[g.key]?.__resolveType=="string"?String(m[g.key].__resolveType):void 0)},`app:${g.key}`):g.collection==="categories"?n.jsx(rc,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:g.key,block:m[g.key],decofile:m,meta:_,onManagePosts:()=>Ve(),onOpenPost:b=>{x("posts"),F("posts"),v({collection:"posts",key:b}),j(null)},previewBaseUrl:a},`category:${g.key}`):g.collection==="authors"?n.jsx(lc,{orgSlug:t,virtualMcpId:e,branch:s,kind:"authors",blockKey:g.key,block:m[g.key]},`authors:${g.key}`):g.collection==="redirects"?n.jsx(fc,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:g.key,block:m[g.key]},`redirect:${g.key}`):n.jsx(cc,{orgSlug:t,virtualMcpId:e,branch:s,previewReady:!0,previewUrl:o??void 0,currentPath:g.collection==="pages"?g.path:"/",activePageBlockKey:g.collection==="pages"?g.key:null,activeGlobalBlockKey:g.collection==="sections"?g.key:null,initialEditSeo:g.collection==="pages"&&y===g.key,onExitSeo:()=>j(null),onSelectRoot:()=>{v(null),j(null)}},g.collection==="pages"?`page:${g.key}`:`section:${g.key}`):n.jsx(tt,{title:`Select ${ot(f)?`a ${Nt[f]}`:f==="pages"?"a page":f==="apps"?"an app":f==="redirects"?"a redirect":"a section"} to edit`,description:f==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),q&&n.jsx(Vl,{open:!!q,mode:q.mode,initialName:q.initialName,initialPath:q.initialPath,isPending:P.isPending,error:de,templates:ie,validate:ns,onSubmit:ss,onOpenChange:b=>{b||(Z(null),ne(void 0))}}),n.jsx(Ul,{open:ue,isPending:P.isPending,error:re,onSubmit:rs,onOpenChange:b=>{b||(te(!1),le(void 0))}}),T&&n.jsx(Hl,{open:!!T,blockKey:T,initialName:pe.find(b=>b.key===T)?.name??T,isPending:P.isPending,onSubmit:is,onOpenChange:b=>{b||J(null)}}),S&&n.jsx(Ja,{open:!!S,onOpenChange:b=>{b||se(null)},pageKey:S,decofile:m,onSave:b=>P.mutateAsync({blockKey:S,data:b})}),n.jsx(ea,{open:!!ee,onOpenChange:b=>{!b&&!Ce&&oe(null)},children:n.jsxs(ta,{children:[n.jsxs(sa,{children:[n.jsx(na,{children:`Delete ${xt}?`}),n.jsx(oa,{children:ee?.kind==="section"?`"${ee.label}" will be removed. Pages that still reference it will lose this section.`:ee?`"${ee.label}" will be removed permanently. This can't be undone.`:null})]}),n.jsxs(aa,{children:[n.jsx(la,{disabled:Ce,children:"Cancel"}),n.jsx(ia,{onClick:b=>{b.preventDefault(),qe()},disabled:Ce,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ce?n.jsxs(n.Fragment,{children:[n.jsx(lt,{className:"size-3.5"}),"Deleting…"]}):"Delete"})]})]})})]})}function xc(t){const e=ae.c(57),{activeCollection:s,pages:o,redirects:a,sections:l,availableSections:i,appCatalog:c,appCatalogLoading:r,blogEntries:d,decofile:p,searchQuery:m,onSearchChange:h,selection:u,onSelect:f,onCreate:x,onDuplicatePage:g,onRenamePage:v,onAddPageVariant:y,onDeletePage:j,onEditPageSeo:w,onViewPageJson:N,onDuplicateSection:E,onRenameSection:B,onDeleteSection:k,onDeleteRedirect:D,onDuplicateBlog:O,onDeleteBlog:L}=t;let K,F,_,A,I,R;if(e[0]!==s||e[1]!==c||e[2]!==r||e[3]!==i||e[4]!==d||e[5]!==p||e[6]!==y||e[7]!==x||e[8]!==L||e[9]!==j||e[10]!==D||e[11]!==k||e[12]!==O||e[13]!==g||e[14]!==E||e[15]!==w||e[16]!==v||e[17]!==B||e[18]!==h||e[19]!==f||e[20]!==N||e[21]!==o||e[22]!==a||e[23]!==m||e[24]!==l||e[25]!==u){const P=m.toLowerCase(),U=o.filter(S=>!P||S.name.toLowerCase().includes(P)||S.path.toLowerCase().includes(P)),Y=a.filter(S=>!P||S.from.toLowerCase().includes(P)||S.to.toLowerCase().includes(P)),q=l.filter(S=>!P||S.name.toLowerCase().includes(P)||S.key.toLowerCase().includes(P)||S.resolveType.toLowerCase().includes(P)),Z=i.filter(S=>!P||S.title.toLowerCase().includes(P)||S.resolveType.toLowerCase().includes(P)||(S.description?.toLowerCase().includes(P)??!1)),de=oc(q),ne=c.filter(S=>!P||S.title.toLowerCase().includes(P)||S.app.toLowerCase().includes(P)||S.vendor.toLowerCase().includes(P)||S.category.toLowerCase().includes(P)),ue=d.filter(S=>!P||S.label.toLowerCase().includes(P)||S.subtitle.toLowerCase().includes(P)),te=`Search ${s}…`,re=ot(s)?`Create new ${Nt[s]}`:s==="redirects"?"Create new redirect":"Create new page",le=s!=="apps"&&s!=="sections";I="shrink-0 border-r flex flex-col min-h-0 w-[300px]";let T;e[32]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(Ss,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[32]=T):T=e[32];let J;e[33]!==h?(J=S=>h(S.target.value),e[33]=h,e[34]=J):J=e[34];let ee;e[35]!==te||e[36]!==m||e[37]!==J?(ee=n.jsxs("div",{className:"flex flex-1 items-center gap-2 pl-1",children:[T,n.jsx("input",{type:"text",value:m,onChange:J,placeholder:te,"aria-label":te,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[35]=te,e[36]=m,e[37]=J,e[38]=ee):ee=e[38];let oe;e[39]!==re||e[40]!==x||e[41]!==le?(oe=le&&n.jsxs(Qe,{children:[n.jsx(We,{asChild:!0,children:n.jsx(_e,{variant:"ghost",size:"icon",onClick:x,"aria-label":re,children:n.jsx(ws,{size:14})})}),n.jsx(Ye,{side:"bottom",children:re})]}),e[39]=re,e[40]=x,e[41]=le,e[42]=oe):oe=e[42],e[43]!==ee||e[44]!==oe?(R=n.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[ee,oe]}),e[43]=ee,e[44]=oe,e[45]=R):R=e[45],K=Yt,A="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",F="flex flex-col gap-1 p-1.5",_=s==="pages"?U.length===0?n.jsx(yt,{hasItems:o.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):U.map(S=>{const se=u?.collection==="pages"&&u.key===S.key,H=Vn(p,S.key);return n.jsx(Ge,{icon:An,title:S.name,subtitle:S.path,active:se,variantCount:H,onClick:()=>f({collection:"pages",key:S.key,path:S.path}),menu:n.jsx($t,{onDuplicate:()=>g(S),onRename:()=>v(S),onAddVariant:()=>y(S),onEditSeo:()=>w(S),onViewJson:()=>N(S),onDelete:()=>j(S)})},S.key)}):s==="sections"?q.length===0&&Z.length===0?n.jsx(yt,{hasItems:l.length>0||i.length>0,emptyLabel:"No sections yet.",emptyHint:"Save a section from a page, or start the preview dev server."}):n.jsxs(n.Fragment,{children:[de.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(jn,{icon:Kt,label:"Saved sections"}),de.map(S=>n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("div",{className:"px-2.5 pt-1 pb-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60",children:S.label}),S.sections.map(se=>{const H=u?.collection==="sections"&&u.key===se.key;return n.jsx(Ge,{icon:Kt,accent:"global",title:se.name,subtitle:S.label,active:H,onClick:()=>f({collection:"sections",key:se.key}),menu:n.jsx($t,{onDuplicate:()=>E(se),onRename:()=>B(se),onDelete:()=>k(se)})},se.key)})]},S.label))]}),Z.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(jn,{icon:Ms,label:"Available sections",className:be(de.length>0&&"mt-3")}),Z.map(S=>{const se=u?.collection==="available-section"&&u.resolveType===S.resolveType,H=S.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return n.jsx(Ge,{icon:Ms,title:S.title,subtitle:H??S.resolveType,active:se,onClick:()=>f({collection:"available-section",resolveType:S.resolveType,title:S.title})},S.resolveType)})]})]}):s==="apps"?r?n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx(lt,{className:"size-4.5 text-muted-foreground"})}):ne.length===0?n.jsx(yt,{hasItems:c.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):ne.map(S=>{const se=u?.collection==="apps"&&S.blockKey!==null&&u.key===S.blockKey;return n.jsx(Ge,{icon:On,logoUrl:S.logo,title:S.title,subtitle:S.category,active:se,trailing:S.installed?n.jsx("span",{className:"shrink-0 rounded-full bg-success/15 px-1.5 py-0.5 text-[10px] font-medium text-success",children:"Installed"}):void 0,onClick:()=>{if(!S.installed||!S.blockKey){me.message(`${S.title} is not installed on this site.`);return}f({collection:"apps",key:S.blockKey})}},S.id)}):s==="redirects"?Y.length===0?n.jsx(yt,{hasItems:a.length>0,emptyLabel:"No redirects yet.",emptyHint:'Click "+" to create your first redirect.'}):Y.map(S=>n.jsx(Ge,{icon:Pn,title:S.from||"(no source)",subtitle:`→ ${S.to||"(no target)"}`,active:u?.collection==="redirects"&&u.key===S.key,trailing:n.jsx(ql,{type:S.type}),onClick:()=>f({collection:"redirects",key:S.key}),menu:n.jsx($t,{onDelete:()=>D(S)})},S.key)):ue.length===0?n.jsx(yt,{hasItems:d.length>0,emptyLabel:`No ${s} yet.`,emptyHint:`Click "+" to create your first ${ot(s)?Nt[s]:"item"}.`}):ue.map(S=>{const se=u?.collection===S.kind&&u.key===S.key;return n.jsx(Ge,{icon:S.kind==="posts"?$n:S.kind==="authors"?In:Tn,title:S.label,subtitle:S.subtitle,active:se,onClick:()=>f({collection:S.kind,key:S.key}),menu:n.jsx($t,{onDuplicate:()=>O(S),onDelete:()=>L(S)})},S.key)}),e[0]=s,e[1]=c,e[2]=r,e[3]=i,e[4]=d,e[5]=p,e[6]=y,e[7]=x,e[8]=L,e[9]=j,e[10]=D,e[11]=k,e[12]=O,e[13]=g,e[14]=E,e[15]=w,e[16]=v,e[17]=B,e[18]=h,e[19]=f,e[20]=N,e[21]=o,e[22]=a,e[23]=m,e[24]=l,e[25]=u,e[26]=K,e[27]=F,e[28]=_,e[29]=A,e[30]=I,e[31]=R}else K=e[26],F=e[27],_=e[28],A=e[29],I=e[30],R=e[31];let G;e[46]!==F||e[47]!==_?(G=n.jsx("div",{className:F,children:_}),e[46]=F,e[47]=_,e[48]=G):G=e[48];let z;e[49]!==K||e[50]!==A||e[51]!==G?(z=n.jsx(K,{className:A,children:G}),e[49]=K,e[50]=A,e[51]=G,e[52]=z):z=e[52];let W;return e[53]!==I||e[54]!==R||e[55]!==z?(W=n.jsxs("div",{className:I,children:[R,z]}),e[53]=I,e[54]=R,e[55]=z,e[56]=W):W=e[56],W}function bc(t){const e=ae.c(25),{virtualMcpId:s}=t,o=Se(),[a,l]=$.useState(!1),i=dl(s),{activeTask:c}=Cn();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const d=Nn(r);if(!(Ws(i?.metadata)||Ws(c?.metadata))){let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:n.jsx(Ys,{className:"size-7 text-foreground"})}),e[1]=h):h=e[1];let u;e[2]!==o?(u=o("mainPanelTabs.contentTab.noContentToEdit"),e[2]=o,e[3]=u):u=e[3];let f;e[4]!==o?(f=o("mainPanelTabs.contentTab.connectGithubDescription"),e[4]=o,e[5]=f):f=e[5];let x,g;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=()=>l(!0),g=n.jsx(Ys,{className:"size-4"}),e[6]=x,e[7]=g):(x=e[6],g=e[7]);let v;e[8]!==o?(v=o("mainPanelTabs.previewTab.connectGithub"),e[8]=o,e[9]=v):v=e[9];let y;e[10]!==v?(y=n.jsxs(_e,{onClick:x,children:[g,v]}),e[10]=v,e[11]=y):y=e[11];let j;e[12]!==u||e[13]!==f||e[14]!==y?(j=n.jsx(fl,{className:"h-full",image:h,title:u,description:f,actions:y}),e[12]=u,e[13]=f,e[14]=y,e[15]=j):j=e[15];let w;e[16]!==a?(w=n.jsx(pl,{open:a,onOpenChange:l,mode:"agent"}),e[16]=a,e[17]=w):w=e[17];let N;return e[18]!==w||e[19]!==j?(N=n.jsxs(n.Fragment,{children:[j,w]}),e[18]=w,e[19]=j,e[20]=N):N=e[20],N}let m;return e[21]!==d.contentPageId||e[22]!==d.contentPath||e[23]!==d.contentPathTemplate?(m=n.jsx(pc,{deepLinkPage:{pageId:d.contentPageId,path:d.contentPath,pathTemplate:d.contentPathTemplate}}),e[21]=d.contentPageId,e[22]=d.contentPath,e[23]=d.contentPathTemplate,e[24]=m):m=e[24],m}function yc(){const t=ae.c(2),e=hl();let s;return t[0]!==e?(s=n.jsx(Ro,{tabId:"content",children:n.jsx(Fo,{feature:"cms",children:n.jsx(bc,{virtualMcpId:e})})}),t[0]=e,t[1]=s):s=t[1],s}const Rd=Object.freeze(Object.defineProperty({__proto__:null,default:yc},Symbol.toStringTag,{value:"Module"}));export{Sd as $,Dd as A,As as B,vi as C,xd as D,_d as E,$d as F,vd as G,Me as H,Wi as I,jd as J,yd as K,to as L,ho as M,Si as N,bd as O,Ds as P,hs as Q,Ad as R,co as S,Ld as T,gd as U,wd as V,Nd as W,Pd as X,mt as Y,Td as Z,Cd as _,sn as a,Bd as a0,Ut as a1,wo as a2,Rd as a3,ts as b,Ue as c,hd as d,ii as e,Ed as f,dt as g,pd as h,bo as i,yo as j,kd as k,ao as l,_s as m,Ll as n,qt as o,Et as p,Od as q,bl as r,ke as s,fi as t,Ui as u,Id as v,uo as w,at as x,go as y,Ke as z};
|