decocms 4.451.0 → 4.452.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-DrwoGJpd.js → AlertCircle-CQkRRGSg.js} +1 -1
- package/dist/client/assets/{AreaChart-BAAHWXOl.js → AreaChart-B-RuYs_G.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DKYwT7KB.js → ArrowLeft-DR8lCUOF.js} +1 -1
- package/dist/client/assets/{ArrowUp-NsPNRi9p.js → ArrowUp-7FgpFlyY.js} +1 -1
- package/dist/client/assets/{Building02-DlH3FV2M.js → Building02-7V26SUA6.js} +1 -1
- package/dist/client/assets/{CartesianChart-8XeONUcg.js → CartesianChart-D2qv7oNB.js} +1 -1
- package/dist/client/assets/{Check-BcGsLSsp.js → Check-CZYLh537.js} +1 -1
- package/dist/client/assets/{CheckCircle-iXm3h-fF.js → CheckCircle-BcqKkSj5.js} +1 -1
- package/dist/client/assets/{ChevronUp-BAvbedXO.js → ChevronUp-riNbaljB.js} +1 -1
- package/dist/client/assets/{Copy01-C_KnfAlj.js → Copy01-DFthUWqM.js} +1 -1
- package/dist/client/assets/{CreditCard01-B7CL5INn.js → CreditCard01-CyYVeRD3.js} +1 -1
- package/dist/client/assets/{DotsVertical-wjfpXF6W.js → DotsVertical-rzfqPSdm.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-JpptrruU.js → ErrorBarContext-DQp6cg0w.js} +1 -1
- package/dist/client/assets/{Image01-BVwA4uCp.js → Image01-CmS6lPNM.js} +1 -1
- package/dist/client/assets/{Key01-C3aJH3VU.js → Key01-CkznrEPX.js} +1 -1
- package/dist/client/assets/{Line-CE2RR3X9.js → Line-TP8KMdrq.js} +1 -1
- package/dist/client/assets/{Link01-BezCCi1I.js → Link01-BK2WDfDE.js} +1 -1
- package/dist/client/assets/{LinkBroken01-CYAPpruG.js → LinkBroken01-DE5GGQ-P.js} +1 -1
- package/dist/client/assets/{LinkExternal01-D_cGFYPK.js → LinkExternal01-YQUR5lT6.js} +1 -1
- package/dist/client/assets/{Monitor01-R0RI8JD-.js → Monitor01-mscEQ6pB.js} +1 -1
- package/dist/client/assets/{Palette-Bh_thK5-.js → Palette-U32cX76w.js} +1 -1
- package/dist/client/assets/{Plus-GNsqHUli.js → Plus-B1zA6p-4.js} +1 -1
- package/dist/client/assets/{SearchMd-DeSQISfo.js → SearchMd-nUFR-fun.js} +1 -1
- package/dist/client/assets/{Sector-CPFqrWxD.js → Sector-IJN93tJL.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-P4dMHDVk.js → ShoppingBag01-xjymcct3.js} +1 -1
- package/dist/client/assets/{Sun-7PdNidQ5.js → Sun-CCW_4qiv.js} +1 -1
- package/dist/client/assets/{Tool01-CWjV8YTI.js → Tool01-B62In8iq.js} +1 -1
- package/dist/client/assets/{Trash01-BJ_e57Kj.js → Trash01-C2tQl3wO.js} +1 -1
- package/dist/client/assets/{Upload01-3jf5OQDv.js → Upload01-BWT4v0Wi.js} +1 -1
- package/dist/client/assets/{User01-CN7JcgS_.js → User01-CjZ2I7BX.js} +1 -1
- package/dist/client/assets/{UserSquare-CEkD4_s5.js → UserSquare-CWUXupRN.js} +1 -1
- package/dist/client/assets/{Users01-B-RFC-RT.js → Users01-BCGnPOxS.js} +1 -1
- package/dist/client/assets/{X-DvEbwZ22.js → X-CHFG7-mU.js} +1 -1
- package/dist/client/assets/{XAxis-DdJd7RhS.js → XAxis-DIIA1eR_.js} +1 -1
- package/dist/client/assets/{XClose-eArhRgkd.js → XClose-DTOuD_e7.js} +1 -1
- package/dist/client/assets/{ZoomOut-B5FfXkUf.js → ZoomOut-CTvv0VFv.js} +1 -1
- package/dist/client/assets/{access-gate-Cno0bRAg.js → access-gate-YoCC2cak.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BRrDiP3N.js → add-connection-dialog-BJoFO4TU.js} +1 -1
- package/dist/client/assets/{agent-analytics-ZqkZ1GcW.js → agent-analytics-pKyZniYD.js} +1 -1
- package/dist/client/assets/agent-app-DwiMM2IP.js +1 -0
- package/dist/client/assets/{agent-assets-2FdntYeU.js → agent-assets-BBuETSa3.js} +1 -1
- package/dist/client/assets/{agent-automation-DeOilbKj.js → agent-automation-Gf_403yV.js} +1 -1
- package/dist/client/assets/{agent-automations-CU5BfClm.js → agent-automations-DHEWASaU.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-BlWCNkZ9.js → agent-connect-sources-BJfN-vfW.js} +1 -1
- package/dist/client/assets/agent-deck-E2P9m0dI.js +1 -0
- package/dist/client/assets/{agent-e2e-Dp5CImx5.js → agent-e2e-BUPuBpdn.js} +1 -1
- package/dist/client/assets/{agent-experiments-CT9FOKqn.js → agent-experiments-DvP2aKwk.js} +1 -1
- package/dist/client/assets/{agent-file-BWzZimsi.js → agent-file-CDAQ3_2M.js} +1 -1
- package/dist/client/assets/{agent-git-C1iinKRI.js → agent-git-B3crMGWs.js} +1 -1
- package/dist/client/assets/{agent-hosting-BsslI9uH.js → agent-hosting-MCkMzhov.js} +1 -1
- package/dist/client/assets/{agent-icon-CfuzWIKW.js → agent-icon-BJAncODg.js} +1 -1
- package/dist/client/assets/agent-library-Be8pU2hW.js +1 -0
- package/dist/client/assets/agent-library-file-CY8i2CE4.js +1 -0
- package/dist/client/assets/{agent-monitor-C2aIDenY.js → agent-monitor-CAKsywMv.js} +1 -1
- package/dist/client/assets/{agent-overview-DDbsx1gU.js → agent-overview-BeUwu-KG.js} +1 -1
- package/dist/client/assets/agent-settings-CuDtw36W.js +1 -0
- package/dist/client/assets/{agent-site-editor-xt5GtnuW.js → agent-site-editor-CiGatYz3.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-DRE7bc_V.js +2 -0
- package/dist/client/assets/agent-site-editor-content-CStkXfya.js +9 -0
- package/dist/client/assets/{agent-site-editor-preview-C9chmhlV.js → agent-site-editor-preview-D9pvz5fY.js} +3 -3
- package/dist/client/assets/agent-view-CI9PvOjo.js +1 -0
- package/dist/client/assets/{agent-view-guard-Vq5CpblU.js → agent-view-guard-H46J6I2J.js} +1 -1
- package/dist/client/assets/{agents-list-L_NaMW9r.js → agents-list-CfV4zbeg.js} +1 -1
- package/dist/client/assets/{ai-providers-C1Gld-NP.js → ai-providers-BN2hQMhH.js} +1 -1
- package/dist/client/assets/{alert-DSDuF6qI.js → alert-DAHFLojl.js} +1 -1
- package/dist/client/assets/{alert-dialog-BbSmZoVi.js → alert-dialog-DfTPgIPX.js} +1 -1
- package/dist/client/assets/{analytics-sections-B7erlEU9.js → analytics-sections-yoOoelxF.js} +1 -1
- package/dist/client/assets/api-keys-CKqJk5_6.js +1 -0
- package/dist/client/assets/{api-keys-DJHmuI-k.js → api-keys-NZUBfE--.js} +1 -1
- package/dist/client/assets/app-editor-DS_J4EUn.js +1 -0
- package/dist/client/assets/{asset-utils-CiYXoNyJ.js → asset-utils-Dg_L4rgJ.js} +1 -1
- package/dist/client/assets/{auth-catchall-DxlXq7tK.js → auth-catchall-CQNM5IYs.js} +1 -1
- package/dist/client/assets/{auth-entry-Exunf2v5.js → auth-entry-Bg2aCMAm.js} +1 -1
- package/dist/client/assets/{auth-5kOh9gsa.js → auth-g-eeEO2I.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BAIpdvCx.js → auth-split-layout-BHWXJwAv.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-IbhNDJn9.js → authenticate-and-persist-oauth-D01FuEWu.js} +1 -1
- package/dist/client/assets/{automation-list-row-BGPK9DDr.js → automation-list-row-CyxwTlrF.js} +1 -1
- package/dist/client/assets/{automation-runs-79Bdx95q.js → automation-runs-xCwcCJC2.js} +1 -1
- package/dist/client/assets/{automations-DEsgrDFl.js → automations-Ab2pgU9k.js} +1 -1
- package/dist/client/assets/{autosend-CsHrH9Xo.js → autosend-5ui8IdtF.js} +1 -1
- package/dist/client/assets/{avatar-CrasAAzq.js → avatar-CmjVNkwN.js} +1 -1
- package/dist/client/assets/{badge-BrDXjbHd.js → badge-DRRTtn5O.js} +1 -1
- package/dist/client/assets/block-document-Cu1B3Znw.js +3 -0
- package/dist/client/assets/{blocks-preview-workspace-context-DAcrAS0Y.js → blocks-preview-workspace-context-DKUHWFsF.js} +1 -1
- package/dist/client/assets/{blog-schema-CpOSYi5o.js → blog-schema-DsqMhqVM.js} +1 -1
- package/dist/client/assets/{buckets-CJHv6B92.js → buckets-yskqiFUf.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-Dp9hBbaC.js → build-improve-prompt-doc-Czr7rpOn.js} +1 -1
- package/dist/client/assets/{calendar-DJbd_Mk0.js → calendar-hQQyUCsj.js} +1 -1
- package/dist/client/assets/{capability-load-error-B8JQAANB.js → capability-load-error-CbMIev40.js} +1 -1
- package/dist/client/assets/category-editor-CERa-ic1.js +1 -0
- package/dist/client/assets/{chart-CrYOX1s7.js → chart-V4xaiNPC.js} +1 -1
- package/dist/client/assets/{chat-context-CbVc7tEo.js → chat-context-oxL7wGnz.js} +1 -1
- package/dist/client/assets/{chat-draft-DCJfKWx2.js → chat-draft-Djy3dkUg.js} +1 -1
- package/dist/client/assets/{checkbox-C68xjrg5.js → checkbox-D7WjpuVv.js} +1 -1
- package/dist/client/assets/{choose-editor-9DBH_8WX.js → choose-editor-BEgt8mUY.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-C42LUZgr.js → claim-phase-copy-D-j3nn-u.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CQ-Ph_Z8.js → cli-auth-success-CDTAwVf_.js} +1 -1
- package/dist/client/assets/{client-icons-B2afUpOp.js → client-icons-BRCUVaWX.js} +1 -1
- package/dist/client/assets/{collapsible-BouI-hE9.js → collapsible-DIaN6Srf.js} +1 -1
- package/dist/client/assets/{collection-detail-BIyd346E.js → collection-detail-DJ79vvsb.js} +1 -1
- package/dist/client/assets/{collection-display-button-CJGrnpdv.js → collection-display-button-D_MeUzdg.js} +1 -1
- package/dist/client/assets/{collection-search-FRa3rbYr.js → collection-search-CKIe33RH.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CWM8G_TB.js → collection-table-wrapper-BU7gTJT1.js} +1 -1
- package/dist/client/assets/{collection-tabs-JVe-o8Om.js → collection-tabs-Br7caoEY.js} +1 -1
- package/dist/client/assets/{column-rules-D2GeNGaF.js → column-rules-C4SSRzGe.js} +1 -1
- package/dist/client/assets/{combobox-BYzyVsfP.js → combobox-ZWRPqCmz.js} +1 -1
- package/dist/client/assets/{command-DA3SiBwF.js → command-CBb61KwU.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-nJ90DS7n.js → companion-mcps-section-B4YWrazT.js} +1 -1
- package/dist/client/assets/{config-CiQU6gsO.js → config-e26AxbQy.js} +1 -1
- package/dist/client/assets/{connect-BfDqgAhE.js → connect-Cis4Tapn.js} +1 -1
- package/dist/client/assets/{connect-layout-D9lxOI4T.js → connect-layout-Dcio3Lf-.js} +1 -1
- package/dist/client/assets/{connection-B1RIZdkW.js → connection-BHqwT0eD.js} +1 -1
- package/dist/client/assets/{connection-card-CBKnCj0k.js → connection-card-C2EkxrBF.js} +1 -1
- package/dist/client/assets/{connection-detail-DCoDGHIg.js → connection-detail-jcDwf2ZX.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CTzk01jW.js → connection-form-helpers-9n8ribSs.js} +1 -1
- package/dist/client/assets/{connections-g7AYRhCW.js → connections-D7jA8LjW.js} +1 -1
- package/dist/client/assets/{context-CtvGGIuc.js → context-izLsg2u9.js} +1 -1
- package/dist/client/assets/{context-menu-BHpyeRN3.js → context-menu-DerEN04P.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-DM0EVF-D.js → create-organization-dialog-CYAsWdo6.js} +1 -1
- package/dist/client/assets/{daily-pulse-BOdn-UxC.js → daily-pulse-CnVCBpq0.js} +1 -1
- package/dist/client/assets/{decopilot-BEZXwH2l.js → decopilot-BLnyHUyj.js} +1 -1
- package/dist/client/assets/{device-hint-Bcob3UqV.js → device-hint-BELnE8gL.js} +1 -1
- package/dist/client/assets/{dialog-BJny2srB.js → dialog-BrqxKGpn.js} +1 -1
- package/dist/client/assets/{discover-Be00RGyY.js → discover-CkexzJr8.js} +1 -1
- package/dist/client/assets/{domain-settings-ChkNgBLE.js → domain-settings-BZKJb9dL.js} +1 -1
- package/dist/client/assets/{download-app-dialog-CYxTt_wl.js → download-app-dialog-D4fZwg6L.js} +1 -1
- package/dist/client/assets/{drawer-ugS5r2iQ.js → drawer-DnzsJxQZ.js} +1 -1
- package/dist/client/assets/{editor-BFX6ra4l.js → editor-CTFiwz0O.js} +1 -1
- package/dist/client/assets/{empty-state-BgjT33mH.js → empty-state-CIlXqsAy.js} +1 -1
- package/dist/client/assets/{empty-state-CrLuHHe8.js → empty-state-L-fapaGY.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DzRM76JF.js → extract-connection-data-BojttbHn.js} +1 -1
- package/dist/client/assets/{feature-gate-D5RLRNV5.js → feature-gate-n8g4g4zp.js} +1 -1
- package/dist/client/assets/{feature-paywall-BOUIyLME.js → feature-paywall-KXd0tDN_.js} +1 -1
- package/dist/client/assets/{file-explorer-WHZll4h4.js → file-explorer-BKwSFv0S.js} +1 -1
- package/dist/client/assets/{file-preview-C0y1VI3d.js → file-preview-DTF7cqq1.js} +1 -1
- package/dist/client/assets/{file-share-button-BIJj7BbT.js → file-share-button-YKzQ30pm.js} +1 -1
- package/dist/client/assets/{file-type-icon-CvWWoRAO.js → file-type-icon-DH3SCrZf.js} +1 -1
- package/dist/client/assets/flat-project-zMUH6pEW.js +1 -0
- package/dist/client/assets/{folder-icon-CMZRw_lE.js → folder-icon-mDaDXy1F.js} +1 -1
- package/dist/client/assets/{form-BsbEXxEk.js → form-CwmR-nDp.js} +1 -1
- package/dist/client/assets/{gateway-client-DPQb-ray.js → gateway-client-BUVeQ8TP.js} +1 -1
- package/dist/client/assets/{general-DcmU5ljh.js → general-pHKX0mlj.js} +1 -1
- package/dist/client/assets/{home-Cluz7ZcZ.js → home-DpJ0l_4_.js} +1 -1
- package/dist/client/assets/{icon-button-Cpld4nrH.js → icon-button-CLFo5Lxf.js} +1 -1
- package/dist/client/assets/{index-LUzyiStE.js → index-5Z-O-IC_.js} +1 -1
- package/dist/client/assets/{index-CMWyW-nP.js → index-BOU4FVnf.js} +1 -1
- package/dist/client/assets/{index-BnLwnO1e.js → index-BQrJviGi.js} +1 -1
- package/dist/client/assets/{index-C5LlvZFc.js → index-BTRkPuaE.js} +7 -7
- package/dist/client/assets/{index-BsSf6-Tp.js → index-B_3n7z-z.js} +1 -1
- package/dist/client/assets/{index-CFVUUkFw.js → index-BwZnKcdF.js} +1 -1
- package/dist/client/assets/{index-CMxk_Q0b.js → index-CYfmFyzv.js} +3 -3
- package/dist/client/assets/{index-svk4_uTN.js → index-Cmukyu5i.js} +1 -1
- package/dist/client/assets/{index-CeE78dnN.js → index-CskCkMle.js} +1 -1
- package/dist/client/assets/{index-B7-3R-Wc.js → index-D7BAQWSU.js} +1 -1
- package/dist/client/assets/{index-DR8phzsm.js → index-D7EpZIyR.js} +1 -1
- package/dist/client/assets/{index-Dm8tF0P6.js → index-DktJOqdm.js} +1 -1
- package/dist/client/assets/{index-BmjSoeeS.js → index-DxdM0E0B.js} +1 -1
- package/dist/client/assets/{index-Bnq5a3RF.js → index-NRQboip2.js} +1 -1
- package/dist/client/assets/{index-DnCv4gDA.js → index-q1e9PWXS.js} +1 -1
- package/dist/client/assets/{index-redirect-2EYYlLWV.js → index-redirect-ClcE1C-w.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DS3r5RyQ.js → infiniteQueryObserver-DDM1TL4D.js} +1 -1
- package/dist/client/assets/{infra-billing-BP0k6gQd.js → infra-billing-CNDnR1FE.js} +1 -1
- package/dist/client/assets/{input-DtRnGymn.js → input-BkhtMOai.js} +3 -3
- package/dist/client/assets/{input-BYbHl7fH.js → input-C7ggWsLT.js} +1 -1
- package/dist/client/assets/{input-NPHEwu7D.js → input-_e15nvFZ.js} +1 -1
- package/dist/client/assets/{integration-icon-Db99lv2a.js → integration-icon-C5Hxx8nt.js} +1 -1
- package/dist/client/assets/{label-DFV1EjGx.js → label-7CUu5Nng.js} +1 -1
- package/dist/client/assets/{layout-DT9fBwIn.js → layout-l5Dybhax.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CB9Z2QQP.js → legacy-agents-deep-CdAR76HP.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-DL_OU_ve.js → legacy-main-redirect-FsmMt53b.js} +1 -1
- package/dist/client/assets/library-8wHr6YwM.js +1 -0
- package/dist/client/assets/{library-tab-zwg8I-zT.js → library-tab-D8YaxhRw.js} +1 -1
- package/dist/client/assets/{login-B_u9hKdd.js → login-C-bgG6Sh.js} +1 -1
- package/dist/client/assets/{markdown-BNkxJvOO.js → markdown-B6rsJl8D.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BEPdGRWf.js → mcp-app-renderer-C1z0J9GI.js} +1 -1
- package/dist/client/assets/{mcp-oauth-B9fQInjX.js → mcp-oauth-DiCqLrTx.js} +1 -1
- package/dist/client/assets/{members-BDa5FNmm.js → members-CP1FamHG.js} +1 -1
- package/dist/client/assets/{memory-DLlNfrtQ.js → memory-CFfQuPfj.js} +1 -1
- package/dist/client/assets/{message-templates-BfVwoNvk.js → message-templates-BLkI2XAu.js} +1 -1
- package/dist/client/assets/{mini-report-page-Ci8p_7Qc.js → mini-report-page-DoPdD9qO.js} +1 -1
- package/dist/client/assets/{mock-board-CWXm4av0.js → mock-board-BTXd0sAw.js} +1 -1
- package/dist/client/assets/{monaco-editor-D29Kd2Kr.js → monaco-editor-DynJau-q.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-slQbN1nA.js → monitoring-stats-row-DEGIuizb.js} +1 -1
- package/dist/client/assets/{multi-select-W9MlzeC1.js → multi-select-BSBfkzHR.js} +1 -1
- package/dist/client/assets/{mustache-BgbWTbKV.js → mustache-C6B9oTBs.js} +1 -1
- package/dist/client/assets/{new-project-dialog-CJlermXp.js → new-project-dialog-Ch4HsoZn.js} +1 -1
- package/dist/client/assets/{oauth-callback-BuGfhU-z.js → oauth-callback-KXWSibnc.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BAJwl5IS.js → oauth-callback-ai-provider-C9UxxVbB.js} +1 -1
- package/dist/client/assets/{onboarding-kTCKp428.js → onboarding-NRECAyIG.js} +1 -1
- package/dist/client/assets/{openai-conversation-C-yPKbTo.js → openai-conversation-CeIvqTTz.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-CIecA9o-.js → optimistic-project-sidebar-views-BSGhW_VM.js} +1 -1
- package/dist/client/assets/{org-file-open-context-C7-ltXbm.js → org-file-open-context-BXXF2r_W.js} +1 -1
- package/dist/client/assets/{organization-choice-D3SzAbEY.js → organization-choice-B4UdP9Qv.js} +1 -1
- package/dist/client/assets/{orgs-BGO2o2om.js → orgs-B1zsOJOt.js} +1 -1
- package/dist/client/assets/{page-seo-form-syG_NsyC.js → page-seo-form-_-ijKB5k.js} +1 -1
- package/dist/client/assets/{pair-BXahrBJ-.js → pair-BCFdDbiP.js} +1 -1
- package/dist/client/assets/{plan-ladder-jHsL2xiU.js → plan-ladder-CsmVoXQQ.js} +1 -1
- package/dist/client/assets/{popover-98ItoIiE.js → popover-CrZxQ_WL.js} +1 -1
- package/dist/client/assets/{post-calendar-DA7gf-iD.js → post-calendar-D7geM2YK.js} +1 -1
- package/dist/client/assets/post-editor-ChtR1Ltr.js +2 -0
- package/dist/client/assets/{preview-content-B3SrY9U6.js → preview-content-BvBDv3Fi.js} +1 -1
- package/dist/client/assets/{preview-dialog-DtE8hySm.js → preview-dialog-COx6Lotq.js} +1 -1
- package/dist/client/assets/{profile-BqkkPgHb.js → profile-Bc9S2aAt.js} +1 -1
- package/dist/client/assets/{project-app-view-DJNcLbfl.js → project-app-view-ObUx-R3J.js} +1 -1
- package/dist/client/assets/{project-feed-5oGhucIT.js → project-feed-27M9wFaD.js} +1 -1
- package/dist/client/assets/{project-icon-ss5TCI0R.js → project-icon-DfxqT1AH.js} +1 -1
- package/dist/client/assets/project-reports-CYg2nuJI.js +1 -0
- package/dist/client/assets/project-tasks-C8uyyfmf.js +1 -0
- package/dist/client/assets/{projects-C0NE_8ue.js → projects-70vA9Ztg.js} +1 -1
- package/dist/client/assets/{projects-empty-state-AWojsVAU.js → projects-empty-state-DXeCmI_E.js} +1 -1
- package/dist/client/assets/{prompts-CkLT7Pp3.js → prompts-DEQvjN3W.js} +1 -1
- package/dist/client/assets/record-editor-_3tMo9Zr.js +1 -0
- package/dist/client/assets/{redirect-editor-Co-NnhcC.js → redirect-editor-nH8dYkmn.js} +1 -1
- package/dist/client/assets/{reports-BZp0upxy.js → reports-BXOZrkbg.js} +1 -1
- package/dist/client/assets/reports-Bf-BvYhy.js +1 -0
- package/dist/client/assets/{reports-onboarding-BBsNQaBV.js → reports-onboarding-DL82A2cU.js} +1 -1
- package/dist/client/assets/{reports-tab-yZ-nVssc.js → reports-tab-DO_Lp8eH.js} +2 -2
- package/dist/client/assets/{repositories-DuKOCOxg.js → repositories-CMKipbLK.js} +1 -1
- package/dist/client/assets/{repository-binding-BzfYTDYg.js → repository-binding-Bbkm6nc1.js} +1 -1
- package/dist/client/assets/{repository-import-picker-BZ4SbZxQ.js → repository-import-picker-Cag3a6oY.js} +1 -1
- package/dist/client/assets/{repository-picker-Bzznh2XU.js → repository-picker-CfTYgBDn.js} +1 -1
- package/dist/client/assets/{require-capability-ZVnNGQoT.js → require-capability-DwsTiirz.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DanliwF9.js → required-auth-layout-yl3jbIxV.js} +1 -1
- package/dist/client/assets/{reset-password-DW3qLKpy.js → reset-password-C5EXdCC7.js} +1 -1
- package/dist/client/assets/{resizable-DywAIc1-.js → resizable-CtYj4VXu.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-C5M35tEP.js → resolve-tab-icon-COPKEIag.js} +1 -1
- package/dist/client/assets/{review-settings-Cu2P77Gp.js → review-settings-Dpq07FB5.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-DGgBIkoQ.js → rich-text-link-control-CDJeP4n9.js} +1 -1
- package/dist/client/assets/{roles-55Tdfjs_.js → roles-BCA_WGIg.js} +1 -1
- package/dist/client/assets/{route-BSEkxVC-.js → route-BIN7HFum.js} +1 -1
- package/dist/client/assets/{route-BvV_LTTA.js → route-DR7xqOI0.js} +1 -1
- package/dist/client/assets/route-DTM6T9N4.js +1 -0
- package/dist/client/assets/{runnable-block-editor-246vsgYp.js → runnable-block-editor-BaDSgAAv.js} +2 -2
- package/dist/client/assets/{sandbox-lifecycle-context-BvXjf7rx.js → sandbox-lifecycle-context-AU726rjo.js} +1 -1
- package/dist/client/assets/{schema-DvFu1ToO.js → schema-CUw1risJ.js} +1 -1
- package/dist/client/assets/{scroll-area-DaBuMKS9.js → scroll-area-C2S3fcxE.js} +1 -1
- package/dist/client/assets/{search-input--Cs2kN0G.js → search-input-Dd4B3qzf.js} +1 -1
- package/dist/client/assets/{search-toggle-C3WefJ2y.js → search-toggle-CsGviyR_.js} +1 -1
- package/dist/client/assets/{secret-picker-CEdXEQdI.js → secret-picker-oakuwK6W.js} +1 -1
- package/dist/client/assets/{secrets-CqHQ9R62.js → secrets-CXgB5-m9.js} +1 -1
- package/dist/client/assets/{sections-editor-BBgqWNXJ.js → sections-editor-D8pxq_yu.js} +1 -1
- package/dist/client/assets/{select-BlojSjop.js → select-C350dwBx.js} +1 -1
- package/dist/client/assets/{select-model-qkZsSZ-s.js → select-model-CRWgLGNx.js} +1 -1
- package/dist/client/assets/{seo-editor-vSFjIyB8.js → seo-editor-1V2gYAl_.js} +1 -1
- package/dist/client/assets/{separator-DVd2LxRQ.js → separator-CDghQ8gc.js} +1 -1
- package/dist/client/assets/{settings-tab-BB1cUOmY.js → settings-tab-CAkBws58.js} +1 -1
- package/dist/client/assets/{sheet-DhV5S-lN.js → sheet-B2gAUp07.js} +1 -1
- package/dist/client/assets/{shell-layout-BCgx5xUt.js → shell-layout-DT24w4k_.js} +1 -1
- package/dist/client/assets/{skills-CGor4YeE.js → skills-CyVOwqjn.js} +1 -1
- package/dist/client/assets/{sso-DT447B-z.js → sso-CfVGd8zI.js} +1 -1
- package/dist/client/assets/{suggestion-20OWsU93.js → suggestion-yycalltA.js} +1 -1
- package/dist/client/assets/{switch-CMfc7QV5.js → switch-C4OygJ1j.js} +1 -1
- package/dist/client/assets/{synced-repos-mHQN0OHN.js → synced-repos-CRCUc2yM.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-Cv2jvczH.js → tab-icon-glyph-CnzBc78s.js} +1 -1
- package/dist/client/assets/{table-Dh5pobpb.js → table-BVqziFMU.js} +1 -1
- package/dist/client/assets/{tabs-BQf21wqw.js → tabs-M4EGpP-K.js} +1 -1
- package/dist/client/assets/{task-board-DGnwsIns.js → task-board-Dy1oP9tV.js} +1 -1
- package/dist/client/assets/{task-route-T3lqK1Fh.js → task-route-Dya6D_p7.js} +1 -1
- package/dist/client/assets/{task-status-BXB-vdW8.js → task-status-uh1TpLCM.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-DorE9nZU.js → taskboard-analytics-dQI3iomY.js} +1 -1
- package/dist/client/assets/{tasks-DJSTWu0I.js → tasks-D70uWBSC.js} +1 -1
- package/dist/client/assets/tasks-W04QS25_.js +1 -0
- package/dist/client/assets/{textarea-CVYfh0wC.js → textarea-NMcEOyOg.js} +1 -1
- package/dist/client/assets/{thread-analytics-DnKw3wA2.js → thread-analytics-B54AXYt6.js} +1 -1
- package/dist/client/assets/{thread-button-DLBvXKcS.js → thread-button-CgP5Z586.js} +1 -1
- package/dist/client/assets/{thread-intent-Cc5BAaIc.js → thread-intent-Jf2tKMef.js} +1 -1
- package/dist/client/assets/{thread-route-BfHTBheT.js → thread-route-DxzVtF_c.js} +1 -1
- package/dist/client/assets/{thread-route-CmSAw42O.js → thread-route-IxUDda00.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-tvi3Cu-i.js → thread-sheet-body-B8X3wACw.js} +1 -1
- package/dist/client/assets/{toggle-group-D_XfPgvt.js → toggle-group-DpTIfIjE.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-CUSdjojs.js → toolbar-icon-button-C_PK_Noh.js} +1 -1
- package/dist/client/assets/{tooltip-66nc6La-.js → tooltip-BJNrweFg.js} +1 -1
- package/dist/client/assets/{track-C-MP37D4.js → track-BtwjnpVQ.js} +1 -1
- package/dist/client/assets/{types-Ch9SdRcv.js → types-Zvb_HNLy.js} +1 -1
- package/dist/client/assets/{usage-stats-yiZ6SKAb.js → usage-stats-N89KL5SR.js} +1 -1
- package/dist/client/assets/{use-ai-providers-M9Gfv9f8.js → use-ai-providers-Bb-AtX2R.js} +1 -1
- package/dist/client/assets/{use-automations-CY_zEchX.js → use-automations-CySFN-Fc.js} +1 -1
- package/dist/client/assets/{use-autosave-Cn0WfmQ8.js → use-autosave-DG37V9_z.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-EbMrj1Yk.js → use-chat-layout-state-CmdNghlG.js} +1 -1
- package/dist/client/assets/{use-clock-tick-Db61eAzB.js → use-clock-tick-BPnWxYd_.js} +1 -1
- package/dist/client/assets/{use-connect-companion-DxqzImGI.js → use-connect-companion-ECuWJz0C.js} +1 -1
- package/dist/client/assets/{use-connection-aogXB8HT.js → use-connection-C0aQTMeC.js} +1 -1
- package/dist/client/assets/{use-copy-B1c_EBRx.js → use-copy-BVWEkCC-.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CV_Qkq--.js → use-create-virtual-mcp-DEMYuYyB.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-B2cpFjnp.js → use-date-fns-locale-Bd8PyfIy.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CNHp8gYO.js → use-debounced-autosave-DXb_Ac1O.js} +1 -1
- package/dist/client/assets/{use-debounced-value-C3ROkLpe.js → use-debounced-value-DBJBbNih.js} +1 -1
- package/dist/client/assets/{use-deco-credits-u3-i822p.js → use-deco-credits-_QhU-dhT.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DSjzPVBT.js → use-decopilot-events-D3bXKKWM.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DUF2NW3l.js → use-delete-connection-DSFkVlnh.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Cc2a3wOb.js → use-deployment-admin-BruYSdMh.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-ClRKZFue.js → use-fast-preview-draft-url-ZFU-P35J.js} +1 -1
- package/dist/client/assets/{use-file-configs-CF1-8iPu.js → use-file-configs-RTbLyPOX.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DwjxrCBI.js → use-infinite-scroll-opYdDO9U.js} +1 -1
- package/dist/client/assets/{use-join-requests-CX1Z0mNX.js → use-join-requests-c0wYTiAF.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-D9RE-lnQ.js → use-main-panel-tabs-DLoT5JrG.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-BoAIHl4N.js → use-mcp-auth-status-Bc_ELMHW.js} +1 -1
- package/dist/client/assets/{use-mcp-client-B2Vh9Cd7.js → use-mcp-client-DAfDiXAH.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-BBIzvKJ-.js → use-mcp-prompts-CDl0wJU0.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BTm2d3TE.js → use-mcp-tools-C7pm9vnU.js} +1 -1
- package/dist/client/assets/{use-members-C6qHLZqu.js → use-members-CyU3kEXW.js} +1 -1
- package/dist/client/assets/{use-mobile-Du3isCXQ.js → use-mobile-DgFuzdmq.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DeIS5d_A.js → use-navigate-to-agent-DrZpt_-x.js} +1 -1
- package/dist/client/assets/use-new-blocks-editor-CD7nCSQB.js +1 -0
- package/dist/client/assets/{use-open-billing-url-C43__85H.js → use-open-billing-url-C-if4cJf.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BBNuWvcV.js → use-org-auth-client-C7_w-QfK.js} +1 -1
- package/dist/client/assets/{use-org-fs-Can_Zv1k.js → use-org-fs-CKHreXlO.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DSCXfgI7.js → use-org-repo-syncs-CdOm1Gkh.js} +1 -1
- package/dist/client/assets/{use-org-sso-CW6lGteH.js → use-org-sso-CbL4kkEg.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BawJTbcK.js → use-organization-roles-DQ43ZVi5.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Bq69ux21.js → use-organization-settings-_CCzAfB0.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-BVY-Wy0A.js → use-panel-navigate-DJawwVTN.js} +1 -1
- package/dist/client/assets/{use-project-scope-Cg6fEvSs.js → use-project-scope-BTHyRdHp.js} +1 -1
- package/dist/client/assets/{use-releases-BKi-DdL8.js → use-releases-BWJN6YTw.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-6cATxGHb.js → use-reports-diagnostic-CiKeDiTH.js} +1 -1
- package/dist/client/assets/{use-secrets-BD6_VEse.js → use-secrets-CSjuIq4b.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-BGOkvMCT.js → use-section-preview-base-CeoNtR7i.js} +1 -1
- package/dist/client/assets/{use-session-runtime-XVdydjwY.js → use-session-runtime-Wyvnx53o.js} +1 -1
- package/dist/client/assets/{use-tags-BzBCpaxP.js → use-tags-C3diByDZ.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-OYMnbU1S.js → use-task-board-analytics-Csh4rD2k.js} +1 -1
- package/dist/client/assets/{use-task-board-events-j6Gt2_bO.js → use-task-board-events-BwC1dILR.js} +1 -1
- package/dist/client/assets/{use-task-metadata-BJMv-ITR.js → use-task-metadata-DzFvwyIV.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-2OqfjnUQ.js → use-thread-analytics-DXqO4MwU.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-DqGdi_Az.js → use-thread-outputs-C05qBJbv.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DZS3Aawa.js +1 -0
- package/dist/client/assets/{useQueries-hEYaMROO.js → useQueries-BcxNFZiu.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DGDEkzHG.js +1 -0
- package/dist/client/assets/{users-CVUsc3a5.js → users-Cc-KY6pD.js} +1 -1
- package/dist/client/assets/{utils-DWTn-3pm.js → utils-DPdaJHGR.js} +1 -1
- package/dist/client/assets/{variant-calendar-BwZCUSvP.js → variant-calendar-BJjVTz4W.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-Dv_-MENJ.js → variant-matcher-override-CwgRSkJP.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-D-i9WhgV.js → view-mode-toggle-CQqizETf.js} +1 -1
- package/dist/client/assets/{virtual-mcp-CYrVMkY_.js → virtual-mcp-BdXZSyI0.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-DrzBZfr1.js +0 -1
- package/dist/client/assets/agent-deck-CMkJu0nT.js +0 -1
- package/dist/client/assets/agent-library-BnziJi08.js +0 -1
- package/dist/client/assets/agent-library-file-Cf4X2sXR.js +0 -1
- package/dist/client/assets/agent-settings-CXCG6lM5.js +0 -1
- package/dist/client/assets/agent-site-editor-code-BA8Iz10L.js +0 -2
- package/dist/client/assets/agent-site-editor-content-Cboi32wv.js +0 -9
- package/dist/client/assets/agent-view-CWGAdnJH.js +0 -1
- package/dist/client/assets/api-keys-bQee7GZd.js +0 -1
- package/dist/client/assets/app-editor-BUUQAodh.js +0 -1
- package/dist/client/assets/block-document-CWFqlSnH.js +0 -3
- package/dist/client/assets/category-editor-DdyY6pMr.js +0 -1
- package/dist/client/assets/flat-project-DklPJ7ot.js +0 -1
- package/dist/client/assets/library-DVDKWOCj.js +0 -1
- package/dist/client/assets/post-editor-DJSWFkVZ.js +0 -2
- package/dist/client/assets/project-reports-BLn_609q.js +0 -1
- package/dist/client/assets/project-tasks-B2djFoeX.js +0 -1
- package/dist/client/assets/record-editor-DyjHgKTD.js +0 -1
- package/dist/client/assets/reports-z77dCvga.js +0 -1
- package/dist/client/assets/route-efW7oDD1.js +0 -1
- package/dist/client/assets/tasks-BCug_duM.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-Bq5-foqH.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DpDVtLXw.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Exur-lii.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aX as $,aY as v,aZ as W,a_ as H,a$ as D,b0 as y,b1 as V,b2 as x,b3 as L,b4 as q,b5 as j,b6 as N,b7 as B,b8 as Z,b9 as F}from"./index-C5LlvZFc.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function X(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function K(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":Q(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function Q(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=B.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=Z[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof $||n instanceof v)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof W)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await P(c,{fetchFn:i}),!o)try{o=await T(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new H(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const O=!e.redirectUrl;if(n!==void 0||O){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof D)||l instanceof y))throw l}const C=e.state?await e.state():void 0,{authorizationUrl:z,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:C,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(z),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function T(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return q.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function P(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?V.parse(await o.json()):x.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await T(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await P(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await N(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function b(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=X(r,h);K(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return F.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=b(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=b(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return j.parse(await s.json())}export{pe as U,P as a,_e as b,Ue as c,T as d,me as e};
|
|
1
|
+
import{aX as $,aY as v,aZ as W,a_ as H,a$ as D,b0 as y,b1 as V,b2 as x,b3 as L,b4 as q,b5 as j,b6 as N,b7 as B,b8 as Z,b9 as F}from"./index-BTRkPuaE.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function X(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function K(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":Q(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function Q(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=B.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=Z[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof $||n instanceof v)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof W)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await P(c,{fetchFn:i}),!o)try{o=await T(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new H(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const O=!e.redirectUrl;if(n!==void 0||O){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof D)||l instanceof y))throw l}const C=e.state?await e.state():void 0,{authorizationUrl:z,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:C,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(z),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function T(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return q.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function P(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?V.parse(await o.json()):x.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await T(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await P(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await N(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function b(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=X(r,h);K(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return F.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=b(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=b(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return j.parse(await s.json())}export{pe as U,P as a,_e as b,Ue as c,T as d,me as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,l as p,j as f}from"./index-
|
|
1
|
+
import{c as g,l as p,j as f}from"./index-BTRkPuaE.js";function w(b){const e=g.c(20),{children:m,visual:r,align:j}=b,d=(j===void 0?"center":j)==="fill",x=d?"min-h-[100dvh] md:min-h-screen":"min-h-screen";let l;e[0]!==x?(l=p("flex w-full",x),e[0]=x,e[1]=l):l=e[1];const h=d?"h-[100dvh] justify-start pt-4 pb-8 md:h-auto":"justify-center py-6";let t;e[2]!==h?(t=p("flex flex-1 flex-col items-center bg-sidebar px-6 md:justify-center md:px-10 md:py-10",h),e[2]=h,e[3]=t):t=e[3];const u=d&&"flex min-h-0 flex-1 flex-col md:block md:flex-none";let s;e[4]!==u?(s=p("w-full max-w-[440px]",u),e[4]=u,e[5]=s):s=e[5];let i;e[6]!==m||e[7]!==s?(i=f.jsx("div",{className:s,children:m}),e[6]=m,e[7]=s,e[8]=i):i=e[8];let n;e[9]!==t||e[10]!==i?(n=f.jsx("section",{className:t,children:i}),e[9]=t,e[10]=i,e[11]=n):n=e[11];let c;e[12]!==r?(c=r??f.jsx("img",{src:"/onboarding-placeholder.png",alt:"",className:"absolute inset-0 h-full w-full object-cover"}),e[12]=r,e[13]=c):c=e[13];let a;e[14]!==c?(a=f.jsx("aside",{className:"relative hidden flex-1 overflow-hidden bg-muted md:flex",children:c}),e[14]=c,e[15]=a):a=e[15];let o;return e[16]!==a||e[17]!==l||e[18]!==n?(o=f.jsxs("main",{className:l,children:[n,a]}),e[16]=a,e[17]=l,e[18]=n,e[19]=o):o=e[19],o}export{w as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-BTRkPuaE.js";import{i as u,a as p}from"./mcp-oauth-DiCqLrTx.js";async function k({connectionId:n,orgId:s,orgSlug:o,persistFallback:r}){const c=new URL(`/api/${o}/mcp/${n}`,window.location.origin),i=await u({url:c.href,token:null,orgId:s});if(!i.supportsOAuth||i.isAuthenticated)return{ran:!1,ok:!0,error:null};const{token:t,tokenInfo:e,error:a}=await p({connectionId:n,orgSlug:o,scope:"offline_access"});if(a||!t)return{ran:!0,ok:!1,error:a??"no token received"};if(e)try{(await fetch(`/api/${o}/connections/${n}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:e.accessToken,refreshToken:e.refreshToken,expiresIn:e.expiresIn,scope:e.scope,clientId:e.clientId,clientSecret:e.clientSecret,tokenEndpoint:e.tokenEndpoint})})).ok||await r(t)}catch{await r(t)}else await r(t);return{ran:!0,ok:!0,error:null}}export{k as a};
|
package/dist/client/assets/{automation-list-row-BGPK9DDr.js → automation-list-row-CyxwTlrF.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as q,b as J,r as U,l as W,j as t,F as X,B as Y,I as Z,H as ee,G as te}from"./index-
|
|
1
|
+
import{c as q,b as J,r as U,l as W,j as t,F as X,B as Y,I as Z,H as ee,G as te}from"./index-BTRkPuaE.js";import{A as se,a as ie,b as ne,c as oe,g as ae,d as re,e as le,f as ce}from"./alert-dialog-DfTPgIPX.js";import{A as me,K as ue}from"./agent-icon-BJAncODg.js";import{i as de}from"./DotsVertical-rzfqPSdm.js";import{s as fe}from"./Trash01-C2tQl3wO.js";import{i as ge}from"./ZoomOut-CTvv0VFv.js";import{a as xe}from"./repository-binding-Bbkm6nc1.js";import{a as pe}from"./use-automations-CySFN-Fc.js";function Ce(c){const e=q.c(80),{automation:s,showAgent:a,onClick:n}=c,i=J(),{remove:o}=pe(),[l,I]=U.useState(!1),r=xe(a?s.virtual_mcp_id:void 0);let M;e[0]!==s.id||e[1]!==o?(M=()=>{o.mutate(s.id),I(!1)},e[0]=s.id,e[1]=o,e[2]=M):M=e[2];const O=M;let S;e[3]!==n?(S=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=S):S=e[4];const H=S,G=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==G?(u=W("inline-block size-2 rounded-full shrink-0",G),e[5]=G,e[6]=u):u=e[6];const V=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==V?(d=i(V),e[7]=i,e[8]=V,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=t.jsx("span",{className:u,"aria-label":d}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let g;e[13]!==r?.icon||e[14]!==r?.title||e[15]!==s.name||e[16]!==a?(g=a&&t.jsx(me,{icon:r?.icon??null,name:r?.title??s.name,size:"xs",className:"shrink-0"}),e[13]=r?.icon,e[14]=r?.title,e[15]=s.name,e[16]=a,e[17]=g):g=e[17];let x;e[18]!==s.name?(x=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[18]=s.name,e[19]=x):x=e[19];let p;e[20]!==r||e[21]!==a?(p=a&&r&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",r.title]}),e[20]=r,e[21]=a,e[22]=p):p=e[22];let h;e[23]!==p||e[24]!==x?(h=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x,p]}),e[23]=p,e[24]=x,e[25]=h):h=e[25];let j;e[26]!==s.nearest_next_run_at||e[27]!==s.trigger_count?(j=t.jsx(we,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[26]=s.nearest_next_run_at,e[27]=s.trigger_count,e[28]=j):j=e[28];let w;e[29]!==h||e[30]!==j?(w=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[h,j]}),e[29]=h,e[30]=j,e[31]=w):w=e[31];let E;e[32]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(X,{asChild:!0,children:t.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(de,{size:16})})}),e[32]=E):E=e[32];let K,$;e[33]===Symbol.for("react.memo_cache_sentinel")?(K=m=>{m.stopPropagation(),I(!0)},$=t.jsx(fe,{size:16}),e[33]=K,e[34]=$):(K=e[33],$=e[34]);let v;e[35]!==i?(v=i("automations.automationListRow.delete"),e[35]=i,e[36]=v):v=e[36];let _;e[37]!==v?(_=t.jsx("div",{onClick:je,onKeyDown:he,role:"presentation",className:"shrink-0",children:t.jsxs(Z,{children:[E,t.jsx(ee,{align:"end",children:t.jsxs(te,{variant:"destructive",onClick:K,children:[$,v]})})]})}),e[37]=v,e[38]=_):_=e[38];let A;e[39]!==H||e[40]!==n||e[41]!==w||e[42]!==_||e[43]!==f||e[44]!==g?(A=t.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:H,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[f,g,w,_]}),e[39]=H,e[40]=n,e[41]=w,e[42]=_,e[43]=f,e[44]=g,e[45]=A):A=e[45];let b;e[46]!==i?(b=i("automations.automationListRow.deleteTitle"),e[46]=i,e[47]=b):b=e[47];let D;e[48]!==b?(D=t.jsx(se,{children:b}),e[48]=b,e[49]=D):D=e[49];let N;e[50]!==s.name||e[51]!==i?(N=i("automations.automationListRow.deleteDescription",{name:s.name}),e[50]=s.name,e[51]=i,e[52]=N):N=e[52];let R;e[53]!==N?(R=t.jsx(ie,{children:N}),e[53]=N,e[54]=R):R=e[54];let y;e[55]!==D||e[56]!==R?(y=t.jsxs(ne,{children:[D,R]}),e[55]=D,e[56]=R,e[57]=y):y=e[57];let C;e[58]!==i?(C=i("automations.automationListRow.cancel"),e[58]=i,e[59]=C):C=e[59];let L;e[60]!==C?(L=t.jsx(oe,{children:C}),e[60]=C,e[61]=L):L=e[61];const Q=o.isPending;let k;e[62]!==i?(k=i("automations.automationListRow.deleteButton"),e[62]=i,e[63]=k):k=e[63];let P;e[64]!==O||e[65]!==o.isPending||e[66]!==k?(P=t.jsx(ae,{onClick:O,disabled:Q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:k}),e[64]=O,e[65]=o.isPending,e[66]=k,e[67]=P):P=e[67];let T;e[68]!==L||e[69]!==P?(T=t.jsxs(re,{children:[L,P]}),e[68]=L,e[69]=P,e[70]=T):T=e[70];let z;e[71]!==y||e[72]!==T?(z=t.jsxs(le,{children:[y,T]}),e[71]=y,e[72]=T,e[73]=z):z=e[73];let F;e[74]!==l||e[75]!==z?(F=t.jsx(ce,{open:l,onOpenChange:I,children:z}),e[74]=l,e[75]=z,e[76]=F):F=e[76];let B;return e[77]!==A||e[78]!==F?(B=t.jsxs(t.Fragment,{children:[A,F]}),e[77]=A,e[78]=F,e[79]=B):B=e[79],B}function he(c){return c.stopPropagation()}function je(c){return c.stopPropagation()}function we(c){const e=q.c(8),{triggerCount:s,nextRunAt:a}=c,n=J();if(s===0){let o;e[0]!==n?(o=n("automations.automationListRow.noTriggers"),e[0]=n,e[1]=o):o=e[1];let l;return e[2]!==o?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=l):l=e[3],l}let i;return e[4]!==a||e[5]!==n||e[6]!==s?(i=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:a?t.jsxs(t.Fragment,{children:[t.jsx(ue,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.nextRun",{date:new Date(a).toLocaleString()})})]}):t.jsxs(t.Fragment,{children:[t.jsx(ge,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.triggers",{count:s})})]})}),e[4]=a,e[5]=n,e[6]=s,e[7]=i):i=e[7],i}export{Ce as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as z,r as lt,b as W,X as it,z as rt,a2 as ct,K as tt,j as s,l as ut,m as dt,e_ as mt}from"./index-C5LlvZFc.js";import{u as ft}from"./useInfiniteQuery-DpDVtLXw.js";import{u as xt}from"./use-connection-aogXB8HT.js";import{u as pt}from"./use-mcp-client-B2Vh9Cd7.js";import{b as gt}from"./repository-binding-BzfYTDYg.js";import{b as ht,a as Rt}from"./sheet-DhV5S-lN.js";import{e as jt,a as Nt,b as st,T as G,d as bt,c as V}from"./table-Dh5pobpb.js";import{E as et}from"./empty-state-BgjT33mH.js";import{u as Tt}from"./use-infinite-scroll-DwjxrCBI.js";import{a as St}from"./use-members-C6qHLZqu.js";import{g as vt}from"./task-status-BXB-vdW8.js";import{e as wt}from"./use-automations-CY_zEchX.js";import{T as Ct,f as at,a as nt}from"./thread-sheet-body-tvi3Cu-i.js";function It(c){const t=z.c(15),[i,r]=lt.useState(null);let e;t[0]!==c||t[1]!==i?(e=i!==null?c.findIndex(u=>u.id===i):-1,t[0]=c,t[1]=i,t[2]=e):e=t[2];const a=e,o=a!==-1?c[a]:null,n=o!==null;let l,w;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=u=>r(u),w=()=>r(null),t[3]=l,t[4]=w):(l=t[3],w=t[4]);let f,x;t[5]!==a||t[6]!==c?(f=()=>{const u=c[a-1];a>0&&u&&r(u.id)},x=()=>{const u=c[a+1];a!==-1&&u&&r(u.id)},t[5]=a,t[6]=c,t[7]=f,t[8]=x):(f=t[7],x=t[8]);let m;return t[9]!==a||t[10]!==o||t[11]!==n||t[12]!==f||t[13]!==x?(m={selected:o,index:a,isOpen:n,select:l,close:w,prev:f,next:x},t[9]=a,t[10]=o,t[11]=n,t[12]=f,t[13]=x,t[14]=m):m=t[14],m}const Z=50;function X(c){const t=z.c(10),{title:i,value:r,subtitle:e}=c;let a;t[0]!==i?(a=s.jsx("span",{className:"text-sm text-foreground/70",children:i}),t[0]=i,t[1]=a):a=t[1];let o;t[2]!==r?(o=s.jsx("span",{className:"text-3xl font-normal tabular-nums",children:r}),t[2]=r,t[3]=o):o=t[3];let n;t[4]!==e?(n=e&&s.jsx("span",{className:"text-xs text-muted-foreground",children:e}),t[4]=e,t[5]=n):n=t[5];let l;return t[6]!==a||t[7]!==o||t[8]!==n?(l=s.jsxs(mt,{className:"pt-4 px-4 pb-5 gap-1",children:[a,o,n]}),t[6]=a,t[7]=o,t[8]=n,t[9]=l):l=t[9],l}function kt(c){const t=z.c(45),{automationId:i,range:r}=c,e=W(),{data:a,isLoading:o}=wt(i,r),n=a?.runs,l=a?.usage;let w;t[0]!==n?(w=n&&n.total>0?`${Math.round(n.completed/n.total*100)}%`:"—",t[0]=n,t[1]=w):w=t[1];const f=w;let x;t[2]!==e||t[3]!==l?(x=l&&l.truncated?e("automations.automationRuns.lastRunsSubtitle",{count:l.sampledRuns}):void 0,t[2]=e,t[3]=l,t[4]=x):x=t[4];const m=x;let u;t[5]!==e?(u=e("automations.automationRuns.runsTitle"),t[5]=e,t[6]=u):u=t[6];let g;t[7]!==o||t[8]!==n?.total?(g=o?"…":n?.total.toLocaleString()??"0",t[7]=o,t[8]=n?.total,t[9]=g):g=t[9];let h;t[10]!==n||t[11]!==e?(h=n?`${n.completed} ${e("automations.automationRuns.ok")} · ${n.failed} ${e("automations.automationRuns.failed")}${n.inProgress>0?` · ${n.inProgress} ${e("automations.automationRuns.running")}`:""}`:void 0,t[10]=n,t[11]=e,t[12]=h):h=t[12];let R;t[13]!==u||t[14]!==g||t[15]!==h?(R=s.jsx(X,{title:u,value:g,subtitle:h}),t[13]=u,t[14]=g,t[15]=h,t[16]=R):R=t[16];let T;t[17]!==e?(T=e("automations.automationRuns.successRateTitle"),t[17]=e,t[18]=T):T=t[18];const k=o?"…":f;let C;t[19]!==T||t[20]!==k?(C=s.jsx(X,{title:T,value:k}),t[19]=T,t[20]=k,t[21]=C):C=t[21];let S;t[22]!==e?(S=e("automations.automationRuns.tokensTitle"),t[22]=e,t[23]=S):S=t[23];let p;t[24]!==o||t[25]!==l?.totalTokens?(p=o?"…":at(l?.totalTokens??0),t[24]=o,t[25]=l?.totalTokens,t[26]=p):p=t[26];let I;t[27]!==S||t[28]!==p||t[29]!==m?(I=s.jsx(X,{title:S,value:p,subtitle:m}),t[27]=S,t[28]=p,t[29]=m,t[30]=I):I=t[30];let d;t[31]!==e?(d=e("automations.automationRuns.costTitle"),t[31]=e,t[32]=d):d=t[32];let j;t[33]!==o||t[34]!==l?(j=o?"…":l&&l.costUsd>0?nt(l.costUsd):"—",t[33]=o,t[34]=l,t[35]=j):j=t[35];let v;t[36]!==d||t[37]!==j||t[38]!==m?(v=s.jsx(X,{title:d,value:j,subtitle:m}),t[36]=d,t[37]=j,t[38]=m,t[39]=v):v=t[39];let N;return t[40]!==I||t[41]!==v||t[42]!==R||t[43]!==C?(N=s.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[R,C,I,v]}),t[40]=I,t[41]=v,t[42]=R,t[43]=C,t[44]=N):N=t[44],N}function yt(c){const t=z.c(57),{run:i,usage:r,onClick:e,lastRowRef:a}=c,o=W();let n,l;if(t[0]!==i.created_at){const P=new Date(i.created_at);n=P.toLocaleDateString("en-US",{month:"short",day:"numeric"}),l=P.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),t[0]=i.created_at,t[1]=n,t[2]=l}else n=t[1],l=t[2];const w=l;let f,x,m,u,g,h,R,T,k,C,S;if(t[3]!==a||t[4]!==e||t[5]!==i.status||t[6]!==i.title||t[7]!==o){const P=vt(i.status),U=P.icon;x=st,k=a,C="h-14 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",S=e,t[19]!==i.title?(m=s.jsx(V,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:s.jsx("div",{className:"font-medium text-foreground truncate",children:i.title})}),t[19]=i.title,t[20]=m):m=t[20],f=V,T="w-28 px-3",h="flex items-center gap-1.5",R=s.jsx(U,{size:14,className:P.iconClassName}),u=ut("text-sm",P.labelColor),g=o(P.labelKey),t[3]=a,t[4]=e,t[5]=i.status,t[6]=i.title,t[7]=o,t[8]=f,t[9]=x,t[10]=m,t[11]=u,t[12]=g,t[13]=h,t[14]=R,t[15]=T,t[16]=k,t[17]=C,t[18]=S}else f=t[8],x=t[9],m=t[10],u=t[11],g=t[12],h=t[13],R=t[14],T=t[15],k=t[16],C=t[17],S=t[18];let p;t[21]!==u||t[22]!==g?(p=s.jsx("span",{className:u,children:g}),t[21]=u,t[22]=g,t[23]=p):p=t[23];let I;t[24]!==p||t[25]!==h||t[26]!==R?(I=s.jsxs("div",{className:h,children:[R,p]}),t[24]=p,t[25]=h,t[26]=R,t[27]=I):I=t[27];let d;t[28]!==f||t[29]!==I||t[30]!==T?(d=s.jsx(f,{className:T,children:I}),t[28]=f,t[29]=I,t[30]=T,t[31]=d):d=t[31];let j;t[32]!==r?(j=r?at(r.totalTokens):"—",t[32]=r,t[33]=j):j=t[33];let v;t[34]!==j?(v=s.jsx(V,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:j}),t[34]=j,t[35]=v):v=t[35];let N;t[36]!==r?(N=r&&r.costUsd>0?nt(r.costUsd):"—",t[36]=r,t[37]=N):N=t[37];let y;t[38]!==N?(y=s.jsx(V,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:N}),t[38]=N,t[39]=y):y=t[39];let D;t[40]!==n?(D=s.jsx("div",{children:n}),t[40]=n,t[41]=D):D=t[41];let _;t[42]!==w?(_=s.jsx("div",{className:"text-xs text-muted-foreground/60",children:w}),t[42]=w,t[43]=_):_=t[43];let E;t[44]!==D||t[45]!==_?(E=s.jsxs(V,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[D,_]}),t[44]=D,t[45]=_,t[46]=E):E=t[46];let $;return t[47]!==x||t[48]!==m||t[49]!==d||t[50]!==v||t[51]!==y||t[52]!==E||t[53]!==k||t[54]!==C||t[55]!==S?($=s.jsxs(x,{ref:k,className:C,onClick:S,children:[m,d,v,y,E]}),t[47]=x,t[48]=m,t[49]=d,t[50]=v,t[51]=y,t[52]=E,t[53]=k,t[54]=C,t[55]=S,t[56]=$):$=t[56],$}function Bt(c){const t=z.c(73),{automationId:i,triggerIds:r,range:e}=c,a=W(),{org:o,locator:n}=it();let l;t[0]!==o.id||t[1]!==o.slug?(l={connectionId:rt,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=l):l=t[2];const w=pt(l),f=ct(),x=xt(),m=gt(),{data:u}=St(),g=r.length>0;let h;t[3]!==i||t[4]!==o.id||t[5]!==r?(h=tt.automationRuns(o.id,i,r),t[3]=i,t[4]=o.id,t[5]=r,t[6]=h):h=t[6];let R;t[7]!==f||t[8]!==r?(R=async M=>{const{pageParam:J}=M,ot=J===void 0?0:J;return await f.call("COLLECTION_THREADS_LIST",{limit:Z,offset:ot,where:{trigger_ids:r}})},t[7]=f,t[8]=r,t[9]=R):R=t[9];let T;t[10]!==g||t[11]!==h||t[12]!==R?(T={queryKey:h,queryFn:R,initialPageParam:0,getNextPageParam:Et,enabled:g,staleTime:3e4},t[10]=g,t[11]=h,t[12]=R,t[13]=T):T=t[13];const{data:k,fetchNextPage:C,hasNextPage:S,isFetchingNextPage:p,isLoading:I}=ft(T);let d,j,v,N;t[14]!==k?.pages||t[15]!==n||t[16]!==e?(d=(k?.pages??[]).flatMap(Dt),N=d.map(Pt),v=dt,j=tt.monitoringThreadUsage(n,JSON.stringify({ids:N,...e})),t[14]=k?.pages,t[15]=n,t[16]=e,t[17]=d,t[18]=j,t[19]=v,t[20]=N):(d=t[17],j=t[18],v=t[19],N=t[20]);let y;t[21]!==e||t[22]!==f||t[23]!==N?(y=async()=>await f.call("MONITORING_THREAD_USAGE",{threadIds:N,...e.startDate?{startDate:e.startDate}:{},...e.endDate?{endDate:e.endDate}:{}}),t[21]=e,t[22]=f,t[23]=N,t[24]=y):y=t[24];const D=N.length>0;let _;t[25]!==j||t[26]!==y||t[27]!==D?(_={queryKey:j,queryFn:y,enabled:D,staleTime:3e4},t[25]=j,t[26]=y,t[27]=D,t[28]=_):_=t[28];const{data:E}=v(_);let $;t[29]!==E?.items?($=new Map((E?.items??[]).map(_t)),t[29]=E?.items,t[30]=$):$=t[30];const P=$;let U;t[31]!==C||t[32]!==S||t[33]!==p?(U=()=>{S&&!p&&C()},t[31]=C,t[32]=S,t[33]=p,t[34]=U):U=t[34];const Y=Tt(U,S??!1,p),b=It(d),B=b.selected;let L;t[35]!==i||t[36]!==e?(L=s.jsx(kt,{automationId:i,range:e}),t[35]=i,t[36]=e,t[37]=L):L=t[37];let O;t[38]!==g||t[39]!==I||t[40]!==Y||t[41]!==d||t[42]!==b||t[43]!==a||t[44]!==P?(O=g?I?s.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:a("automations.automationRuns.loadingRuns")}):d.length===0?s.jsx("div",{className:"py-16",children:s.jsx(et,{title:a("automations.automationRuns.noRunsTitle"),description:a("automations.automationRuns.noRunsDescription")})}):s.jsxs(jt,{className:"w-full border-collapse",children:[s.jsx(Nt,{className:"border-b-0",children:s.jsxs(st,{className:"h-9 hover:bg-transparent border-b border-border",children:[s.jsx(G,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.runHeader")}),s.jsx(G,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.statusHeader")}),s.jsx(G,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:a("automations.automationRuns.tokensHeader")}),s.jsx(G,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:a("automations.automationRuns.costHeader")}),s.jsx(G,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.startedHeader")})]})}),s.jsx(bt,{children:d.map((M,J)=>s.jsx(yt,{run:M,usage:P.get(M.id),onClick:()=>b.select(M.id),lastRowRef:J===d.length-1?Y:void 0},M.id))})]}):s.jsx("div",{className:"py-16",children:s.jsx(et,{title:a("automations.automationRuns.noStartersTitle"),description:a("automations.automationRuns.noStartersDescription")})}),t[38]=g,t[39]=I,t[40]=Y,t[41]=d,t[42]=b,t[43]=a,t[44]=P,t[45]=O):O=t[45];let A;t[46]!==p||t[47]!==a?(A=p&&s.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:a("automations.automationRuns.loadingMore")}),t[46]=p,t[47]=a,t[48]=A):A=t[48];let H;t[49]!==b?(H=M=>{M||b.close()},t[49]=b,t[50]=H):H=t[50];let K;t[51]!==x||t[52]!==m||t[53]!==w||t[54]!==n||t[55]!==u||t[56]!==d||t[57]!==B||t[58]!==b.index||t[59]!==b.next||t[60]!==b.prev?(K=B&&s.jsx(Ct,{thread:B,client:w,locator:n,connections:x,virtualMcps:m,members:u,nav:{index:b.index,total:d.length,onPrev:b.prev,onNext:b.next}}),t[51]=x,t[52]=m,t[53]=w,t[54]=n,t[55]=u,t[56]=d,t[57]=B,t[58]=b.index,t[59]=b.next,t[60]=b.prev,t[61]=K):K=t[61];let q;t[62]!==K?(q=s.jsx(Rt,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:K}),t[62]=K,t[63]=q):q=t[63];let F;t[64]!==b.isOpen||t[65]!==H||t[66]!==q?(F=s.jsx(ht,{open:b.isOpen,onOpenChange:H,children:q}),t[64]=b.isOpen,t[65]=H,t[66]=q,t[67]=F):F=t[67];let Q;return t[68]!==L||t[69]!==O||t[70]!==A||t[71]!==F?(Q=s.jsxs("div",{className:"flex flex-col gap-5",children:[L,O,A,F]}),t[68]=L,t[69]=O,t[70]=A,t[71]=F,t[72]=Q):Q=t[72],Q}function _t(c){return[c.threadId,{calls:c.calls,inputTokens:c.inputTokens,outputTokens:c.outputTokens,totalTokens:c.totalTokens,costUsd:c.costUsd}]}function Pt(c){return c.id}function Dt(c){return c.items??[]}function Et(c,t){const i=c,r=t;if(!((i?.items?.length??0)<Z))return r.length*Z}export{Bt as A,It as u};
|
|
1
|
+
import{c as z,r as lt,b as W,X as it,z as rt,a2 as ct,K as tt,j as s,l as ut,m as dt,e_ as mt}from"./index-BTRkPuaE.js";import{u as ft}from"./useInfiniteQuery-DZS3Aawa.js";import{u as xt}from"./use-connection-C0aQTMeC.js";import{u as pt}from"./use-mcp-client-DAfDiXAH.js";import{b as gt}from"./repository-binding-Bbkm6nc1.js";import{b as ht,a as Rt}from"./sheet-B2gAUp07.js";import{e as jt,a as Nt,b as st,T as G,d as bt,c as V}from"./table-BVqziFMU.js";import{E as et}from"./empty-state-CIlXqsAy.js";import{u as Tt}from"./use-infinite-scroll-opYdDO9U.js";import{a as St}from"./use-members-CyU3kEXW.js";import{g as vt}from"./task-status-uh1TpLCM.js";import{e as wt}from"./use-automations-CySFN-Fc.js";import{T as Ct,f as at,a as nt}from"./thread-sheet-body-B8X3wACw.js";function It(c){const t=z.c(15),[i,r]=lt.useState(null);let e;t[0]!==c||t[1]!==i?(e=i!==null?c.findIndex(u=>u.id===i):-1,t[0]=c,t[1]=i,t[2]=e):e=t[2];const a=e,o=a!==-1?c[a]:null,n=o!==null;let l,w;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=u=>r(u),w=()=>r(null),t[3]=l,t[4]=w):(l=t[3],w=t[4]);let f,x;t[5]!==a||t[6]!==c?(f=()=>{const u=c[a-1];a>0&&u&&r(u.id)},x=()=>{const u=c[a+1];a!==-1&&u&&r(u.id)},t[5]=a,t[6]=c,t[7]=f,t[8]=x):(f=t[7],x=t[8]);let m;return t[9]!==a||t[10]!==o||t[11]!==n||t[12]!==f||t[13]!==x?(m={selected:o,index:a,isOpen:n,select:l,close:w,prev:f,next:x},t[9]=a,t[10]=o,t[11]=n,t[12]=f,t[13]=x,t[14]=m):m=t[14],m}const Z=50;function X(c){const t=z.c(10),{title:i,value:r,subtitle:e}=c;let a;t[0]!==i?(a=s.jsx("span",{className:"text-sm text-foreground/70",children:i}),t[0]=i,t[1]=a):a=t[1];let o;t[2]!==r?(o=s.jsx("span",{className:"text-3xl font-normal tabular-nums",children:r}),t[2]=r,t[3]=o):o=t[3];let n;t[4]!==e?(n=e&&s.jsx("span",{className:"text-xs text-muted-foreground",children:e}),t[4]=e,t[5]=n):n=t[5];let l;return t[6]!==a||t[7]!==o||t[8]!==n?(l=s.jsxs(mt,{className:"pt-4 px-4 pb-5 gap-1",children:[a,o,n]}),t[6]=a,t[7]=o,t[8]=n,t[9]=l):l=t[9],l}function kt(c){const t=z.c(45),{automationId:i,range:r}=c,e=W(),{data:a,isLoading:o}=wt(i,r),n=a?.runs,l=a?.usage;let w;t[0]!==n?(w=n&&n.total>0?`${Math.round(n.completed/n.total*100)}%`:"—",t[0]=n,t[1]=w):w=t[1];const f=w;let x;t[2]!==e||t[3]!==l?(x=l&&l.truncated?e("automations.automationRuns.lastRunsSubtitle",{count:l.sampledRuns}):void 0,t[2]=e,t[3]=l,t[4]=x):x=t[4];const m=x;let u;t[5]!==e?(u=e("automations.automationRuns.runsTitle"),t[5]=e,t[6]=u):u=t[6];let g;t[7]!==o||t[8]!==n?.total?(g=o?"…":n?.total.toLocaleString()??"0",t[7]=o,t[8]=n?.total,t[9]=g):g=t[9];let h;t[10]!==n||t[11]!==e?(h=n?`${n.completed} ${e("automations.automationRuns.ok")} · ${n.failed} ${e("automations.automationRuns.failed")}${n.inProgress>0?` · ${n.inProgress} ${e("automations.automationRuns.running")}`:""}`:void 0,t[10]=n,t[11]=e,t[12]=h):h=t[12];let R;t[13]!==u||t[14]!==g||t[15]!==h?(R=s.jsx(X,{title:u,value:g,subtitle:h}),t[13]=u,t[14]=g,t[15]=h,t[16]=R):R=t[16];let T;t[17]!==e?(T=e("automations.automationRuns.successRateTitle"),t[17]=e,t[18]=T):T=t[18];const k=o?"…":f;let C;t[19]!==T||t[20]!==k?(C=s.jsx(X,{title:T,value:k}),t[19]=T,t[20]=k,t[21]=C):C=t[21];let S;t[22]!==e?(S=e("automations.automationRuns.tokensTitle"),t[22]=e,t[23]=S):S=t[23];let p;t[24]!==o||t[25]!==l?.totalTokens?(p=o?"…":at(l?.totalTokens??0),t[24]=o,t[25]=l?.totalTokens,t[26]=p):p=t[26];let I;t[27]!==S||t[28]!==p||t[29]!==m?(I=s.jsx(X,{title:S,value:p,subtitle:m}),t[27]=S,t[28]=p,t[29]=m,t[30]=I):I=t[30];let d;t[31]!==e?(d=e("automations.automationRuns.costTitle"),t[31]=e,t[32]=d):d=t[32];let j;t[33]!==o||t[34]!==l?(j=o?"…":l&&l.costUsd>0?nt(l.costUsd):"—",t[33]=o,t[34]=l,t[35]=j):j=t[35];let v;t[36]!==d||t[37]!==j||t[38]!==m?(v=s.jsx(X,{title:d,value:j,subtitle:m}),t[36]=d,t[37]=j,t[38]=m,t[39]=v):v=t[39];let N;return t[40]!==I||t[41]!==v||t[42]!==R||t[43]!==C?(N=s.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[R,C,I,v]}),t[40]=I,t[41]=v,t[42]=R,t[43]=C,t[44]=N):N=t[44],N}function yt(c){const t=z.c(57),{run:i,usage:r,onClick:e,lastRowRef:a}=c,o=W();let n,l;if(t[0]!==i.created_at){const P=new Date(i.created_at);n=P.toLocaleDateString("en-US",{month:"short",day:"numeric"}),l=P.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),t[0]=i.created_at,t[1]=n,t[2]=l}else n=t[1],l=t[2];const w=l;let f,x,m,u,g,h,R,T,k,C,S;if(t[3]!==a||t[4]!==e||t[5]!==i.status||t[6]!==i.title||t[7]!==o){const P=vt(i.status),U=P.icon;x=st,k=a,C="h-14 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",S=e,t[19]!==i.title?(m=s.jsx(V,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:s.jsx("div",{className:"font-medium text-foreground truncate",children:i.title})}),t[19]=i.title,t[20]=m):m=t[20],f=V,T="w-28 px-3",h="flex items-center gap-1.5",R=s.jsx(U,{size:14,className:P.iconClassName}),u=ut("text-sm",P.labelColor),g=o(P.labelKey),t[3]=a,t[4]=e,t[5]=i.status,t[6]=i.title,t[7]=o,t[8]=f,t[9]=x,t[10]=m,t[11]=u,t[12]=g,t[13]=h,t[14]=R,t[15]=T,t[16]=k,t[17]=C,t[18]=S}else f=t[8],x=t[9],m=t[10],u=t[11],g=t[12],h=t[13],R=t[14],T=t[15],k=t[16],C=t[17],S=t[18];let p;t[21]!==u||t[22]!==g?(p=s.jsx("span",{className:u,children:g}),t[21]=u,t[22]=g,t[23]=p):p=t[23];let I;t[24]!==p||t[25]!==h||t[26]!==R?(I=s.jsxs("div",{className:h,children:[R,p]}),t[24]=p,t[25]=h,t[26]=R,t[27]=I):I=t[27];let d;t[28]!==f||t[29]!==I||t[30]!==T?(d=s.jsx(f,{className:T,children:I}),t[28]=f,t[29]=I,t[30]=T,t[31]=d):d=t[31];let j;t[32]!==r?(j=r?at(r.totalTokens):"—",t[32]=r,t[33]=j):j=t[33];let v;t[34]!==j?(v=s.jsx(V,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:j}),t[34]=j,t[35]=v):v=t[35];let N;t[36]!==r?(N=r&&r.costUsd>0?nt(r.costUsd):"—",t[36]=r,t[37]=N):N=t[37];let y;t[38]!==N?(y=s.jsx(V,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:N}),t[38]=N,t[39]=y):y=t[39];let D;t[40]!==n?(D=s.jsx("div",{children:n}),t[40]=n,t[41]=D):D=t[41];let _;t[42]!==w?(_=s.jsx("div",{className:"text-xs text-muted-foreground/60",children:w}),t[42]=w,t[43]=_):_=t[43];let E;t[44]!==D||t[45]!==_?(E=s.jsxs(V,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[D,_]}),t[44]=D,t[45]=_,t[46]=E):E=t[46];let $;return t[47]!==x||t[48]!==m||t[49]!==d||t[50]!==v||t[51]!==y||t[52]!==E||t[53]!==k||t[54]!==C||t[55]!==S?($=s.jsxs(x,{ref:k,className:C,onClick:S,children:[m,d,v,y,E]}),t[47]=x,t[48]=m,t[49]=d,t[50]=v,t[51]=y,t[52]=E,t[53]=k,t[54]=C,t[55]=S,t[56]=$):$=t[56],$}function Bt(c){const t=z.c(73),{automationId:i,triggerIds:r,range:e}=c,a=W(),{org:o,locator:n}=it();let l;t[0]!==o.id||t[1]!==o.slug?(l={connectionId:rt,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=l):l=t[2];const w=pt(l),f=ct(),x=xt(),m=gt(),{data:u}=St(),g=r.length>0;let h;t[3]!==i||t[4]!==o.id||t[5]!==r?(h=tt.automationRuns(o.id,i,r),t[3]=i,t[4]=o.id,t[5]=r,t[6]=h):h=t[6];let R;t[7]!==f||t[8]!==r?(R=async M=>{const{pageParam:J}=M,ot=J===void 0?0:J;return await f.call("COLLECTION_THREADS_LIST",{limit:Z,offset:ot,where:{trigger_ids:r}})},t[7]=f,t[8]=r,t[9]=R):R=t[9];let T;t[10]!==g||t[11]!==h||t[12]!==R?(T={queryKey:h,queryFn:R,initialPageParam:0,getNextPageParam:Et,enabled:g,staleTime:3e4},t[10]=g,t[11]=h,t[12]=R,t[13]=T):T=t[13];const{data:k,fetchNextPage:C,hasNextPage:S,isFetchingNextPage:p,isLoading:I}=ft(T);let d,j,v,N;t[14]!==k?.pages||t[15]!==n||t[16]!==e?(d=(k?.pages??[]).flatMap(Dt),N=d.map(Pt),v=dt,j=tt.monitoringThreadUsage(n,JSON.stringify({ids:N,...e})),t[14]=k?.pages,t[15]=n,t[16]=e,t[17]=d,t[18]=j,t[19]=v,t[20]=N):(d=t[17],j=t[18],v=t[19],N=t[20]);let y;t[21]!==e||t[22]!==f||t[23]!==N?(y=async()=>await f.call("MONITORING_THREAD_USAGE",{threadIds:N,...e.startDate?{startDate:e.startDate}:{},...e.endDate?{endDate:e.endDate}:{}}),t[21]=e,t[22]=f,t[23]=N,t[24]=y):y=t[24];const D=N.length>0;let _;t[25]!==j||t[26]!==y||t[27]!==D?(_={queryKey:j,queryFn:y,enabled:D,staleTime:3e4},t[25]=j,t[26]=y,t[27]=D,t[28]=_):_=t[28];const{data:E}=v(_);let $;t[29]!==E?.items?($=new Map((E?.items??[]).map(_t)),t[29]=E?.items,t[30]=$):$=t[30];const P=$;let U;t[31]!==C||t[32]!==S||t[33]!==p?(U=()=>{S&&!p&&C()},t[31]=C,t[32]=S,t[33]=p,t[34]=U):U=t[34];const Y=Tt(U,S??!1,p),b=It(d),B=b.selected;let L;t[35]!==i||t[36]!==e?(L=s.jsx(kt,{automationId:i,range:e}),t[35]=i,t[36]=e,t[37]=L):L=t[37];let O;t[38]!==g||t[39]!==I||t[40]!==Y||t[41]!==d||t[42]!==b||t[43]!==a||t[44]!==P?(O=g?I?s.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:a("automations.automationRuns.loadingRuns")}):d.length===0?s.jsx("div",{className:"py-16",children:s.jsx(et,{title:a("automations.automationRuns.noRunsTitle"),description:a("automations.automationRuns.noRunsDescription")})}):s.jsxs(jt,{className:"w-full border-collapse",children:[s.jsx(Nt,{className:"border-b-0",children:s.jsxs(st,{className:"h-9 hover:bg-transparent border-b border-border",children:[s.jsx(G,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.runHeader")}),s.jsx(G,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.statusHeader")}),s.jsx(G,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:a("automations.automationRuns.tokensHeader")}),s.jsx(G,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:a("automations.automationRuns.costHeader")}),s.jsx(G,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.startedHeader")})]})}),s.jsx(bt,{children:d.map((M,J)=>s.jsx(yt,{run:M,usage:P.get(M.id),onClick:()=>b.select(M.id),lastRowRef:J===d.length-1?Y:void 0},M.id))})]}):s.jsx("div",{className:"py-16",children:s.jsx(et,{title:a("automations.automationRuns.noStartersTitle"),description:a("automations.automationRuns.noStartersDescription")})}),t[38]=g,t[39]=I,t[40]=Y,t[41]=d,t[42]=b,t[43]=a,t[44]=P,t[45]=O):O=t[45];let A;t[46]!==p||t[47]!==a?(A=p&&s.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:a("automations.automationRuns.loadingMore")}),t[46]=p,t[47]=a,t[48]=A):A=t[48];let H;t[49]!==b?(H=M=>{M||b.close()},t[49]=b,t[50]=H):H=t[50];let K;t[51]!==x||t[52]!==m||t[53]!==w||t[54]!==n||t[55]!==u||t[56]!==d||t[57]!==B||t[58]!==b.index||t[59]!==b.next||t[60]!==b.prev?(K=B&&s.jsx(Ct,{thread:B,client:w,locator:n,connections:x,virtualMcps:m,members:u,nav:{index:b.index,total:d.length,onPrev:b.prev,onNext:b.next}}),t[51]=x,t[52]=m,t[53]=w,t[54]=n,t[55]=u,t[56]=d,t[57]=B,t[58]=b.index,t[59]=b.next,t[60]=b.prev,t[61]=K):K=t[61];let q;t[62]!==K?(q=s.jsx(Rt,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:K}),t[62]=K,t[63]=q):q=t[63];let F;t[64]!==b.isOpen||t[65]!==H||t[66]!==q?(F=s.jsx(ht,{open:b.isOpen,onOpenChange:H,children:q}),t[64]=b.isOpen,t[65]=H,t[66]=q,t[67]=F):F=t[67];let Q;return t[68]!==L||t[69]!==O||t[70]!==A||t[71]!==F?(Q=s.jsxs("div",{className:"flex flex-col gap-5",children:[L,O,A,F]}),t[68]=L,t[69]=O,t[70]=A,t[71]=F,t[72]=Q):Q=t[72],Q}function _t(c){return[c.threadId,{calls:c.calls,inputTokens:c.inputTokens,outputTokens:c.outputTokens,totalTokens:c.totalTokens,costUsd:c.costUsd}]}function Pt(c){return c.id}function Dt(c){return c.items??[]}function Et(c,t){const i=c,r=t;if(!((i?.items?.length??0)<Z))return r.length*Z}export{Bt as A,It as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,j as e,b as $,X as D,d as M,r as q,n as d,B as O,fO as V,q as R}from"./index-
|
|
1
|
+
import{c as k,j as e,b as $,X as D,d as M,r as q,n as d,B as O,fO as V,q as R}from"./index-BTRkPuaE.js";import{s as X}from"./Plus-B1zA6p-4.js";import{i as S}from"./ZoomOut-CTvv0VFv.js";import{S as F}from"./search-input-Dd4B3qzf.js";import{E as T}from"./empty-state-CIlXqsAy.js";import{u as G}from"./use-automations-CySFN-Fc.js";import{u as H}from"./use-navigate-to-agent-DrZpt_-x.js";import{A as J}from"./automation-list-row-CyxwTlrF.js";import{b as K}from"./repository-binding-Bbkm6nc1.js";import{R as Q}from"./require-capability-DwsTiirz.js";import"./SearchMd-nUFR-fun.js";import"./use-mcp-client-DAfDiXAH.js";import"./auth-g-eeEO2I.js";import"./thread-intent-Jf2tKMef.js";import"./backoff-8mStPHYB.js";import"./task-board-Dy1oP9tV.js";import"./schema-CUw1risJ.js";import"./slugify-CEUa2lfQ.js";import"./alert-dialog-DfTPgIPX.js";import"./agent-icon-BJAncODg.js";import"./AlertCircle-CQkRRGSg.js";import"./Tool01-B62In8iq.js";import"./ArrowUp-7FgpFlyY.js";import"./ArrowLeft-DR8lCUOF.js";import"./LinkBroken01-DE5GGQ-P.js";import"./ShoppingBag01-xjymcct3.js";import"./Building02-7V26SUA6.js";import"./CheckCircle-BcqKkSj5.js";import"./Check-CZYLh537.js";import"./ChevronUp-riNbaljB.js";import"./UserSquare-CWUXupRN.js";import"./Copy01-DFthUWqM.js";import"./CreditCard01-CyYVeRD3.js";import"./DotsVertical-rzfqPSdm.js";import"./Image01-CmS6lPNM.js";import"./Palette-U32cX76w.js";import"./XClose-DTOuD_e7.js";import"./Key01-CkznrEPX.js";import"./Link01-BK2WDfDE.js";import"./LinkExternal01-YQUR5lT6.js";import"./Monitor01-mscEQ6pB.js";import"./Sun-CCW_4qiv.js";import"./Trash01-C2tQl3wO.js";import"./Upload01-BWT4v0Wi.js";import"./User01-CjZ2I7BX.js";import"./Users01-BCGnPOxS.js";import"./X-CHFG7-mU.js";import"./access-gate-YoCC2cak.js";import"./capability-load-error-CbMIev40.js";function U(){const t=k.c(20),o=$(),{org:c}=D(),{data:y}=G(void 0),g=y===void 0?[]:y,E=K(),P=H(),f=M(),[x,z]=q.useState(""),h=x.toLowerCase(),b=new Map(E.map(W)),A=g.filter(i=>{if(!h||i.name.toLowerCase().includes(h))return!0;if(i.virtual_mcp_id){const l=b.get(i.virtual_mcp_id);if(l&&l.title.toLowerCase().includes(h))return!0}return!1}),B=(i,l)=>{const N=l&&b.has(l)?l:V(c.id);R("automations_list_row_clicked",{automation_id:i,agent_id:N,source:"settings_automations"}),P(N,{panel:`automation:${i}`})};let p;t[0]!==f||t[1]!==c.slug?(p=()=>{R("automations_empty_state_browse_agents_clicked"),f({to:"/$org/settings/projects",params:{org:c.slug}})},t[0]=f,t[1]=c.slug,t[2]=p):p=t[2];const L=p,j=d,C=d,v=d;let s;t[3]!==o?(s=o("settings.automations.pageTitle"),t[3]=o,t[4]=s):s=t[4];let r;t[5]!==s?(r=e.jsx(d.Title,{children:s}),t[5]=s,t[6]=r):r=t[6];const w=g.length>0&&e.jsx(F,{value:x,onChange:z,placeholder:o("settings.automations.searchPlaceholder"),className:"w-full md:w-[375px]"});let n;t[7]!==r||t[8]!==w?(n=e.jsxs("div",{className:"flex flex-col gap-6",children:[r,w]}),t[7]=r,t[8]=w,t[9]=n):n=t[9];const _=g.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(T,{image:e.jsx(S,{size:48,className:"text-muted-foreground"}),title:o("settings.automations.emptyTitle"),description:o("settings.automations.emptyDescription"),actions:e.jsxs(O,{size:"sm",onClick:L,children:[e.jsx(X,{size:14}),o("settings.automations.browseAgentsButton")]})})}):A.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(T,{image:e.jsx(S,{size:48,className:"text-muted-foreground"}),title:o("settings.automations.noResultsTitle"),description:o("settings.automations.noResultsDescription",{search:x})})}):e.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:A.map(i=>e.jsx(J,{automation:i,showAgent:!0,onClick:()=>B(i.id,i.virtual_mcp_id)},i.id))});let a;t[10]!==v.Container||t[11]!==n||t[12]!==_?(a=e.jsxs(v.Container,{children:[n,_]}),t[10]=v.Container,t[11]=n,t[12]=_,t[13]=a):a=t[13];let m;t[14]!==C.Content||t[15]!==a?(m=e.jsx(C.Content,{children:a}),t[14]=C.Content,t[15]=a,t[16]=m):m=t[16];let u;return t[17]!==j||t[18]!==m?(u=e.jsx(j,{children:m}),t[17]=j,t[18]=m,t[19]=u):u=t[19],u}function W(t){return[t.id,t]}function Jt(){const t=k.c(1);let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(Q,{capability:"automations:manage",area:"automations",children:e.jsx(U,{})}),t[0]=o):o=t[0],o}export{Jt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{V as d}from"./index-
|
|
1
|
+
import{V as d}from"./index-BTRkPuaE.js";const m=1e4,y="true",i=2;function a(t,n){return d.chatAutosend(t,n)}function l(t){return t==="pending"||t==="sending"}function f(t){if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!n||typeof n!="object")return null;const e=n;let o=0;e.status==="sending"?o=e.retryAt===void 0?1:i:e.retryAt!==void 0&&(o=1);const r=e.attempt===void 0?o:e.attempt;return typeof e.createdAt!="number"||typeof e.message!="object"||!l(e.status)||e.retryAt!==void 0&&typeof e.retryAt!="number"||typeof r!="number"||!Number.isInteger(r)||r<0||r>i?null:{...n,attempt:r}}function S(t,n,e,o,r=Date.now()){const s={message:o,createdAt:r,status:"pending",attempt:0};return t.setItem(a(n,e),JSON.stringify(s)),s}function p(t,n,e){const o=a(n,e),r=f(t.getItem(o));return r||(t.removeItem(o),null)}function g(t,n,e,o=Date.now()){const r=a(n,e),s=p(t,n,e);if(!s||s.status!=="pending")return null;if(s.attempt>=i)return t.removeItem(r),null;const c=s.retryAt??s.createdAt;if(o-c>=m)return t.removeItem(r),null;const u={...s,status:"sending",attempt:s.attempt+1};return t.setItem(r,JSON.stringify(u)),{message:u.message,createdAt:u.createdAt,attempt:u.attempt}}function T(t,n,e){t.removeItem(a(n,e))}export{y as A,T as a,g as c,S as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,j as i,l as f,aH as R,ba as V,bb as I,bc as $}from"./index-
|
|
1
|
+
import{c as k,j as i,l as f,aH as R,ba as V,bb as I,bc as $}from"./index-BTRkPuaE.js";import{s as O}from"./User01-CjZ2I7BX.js";function U(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx($,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function E(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(V,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(I,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const C=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],L="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function T(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%C.length;return C[s]}const S=R("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),_=R("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),D=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function H(r){const e=k.c(34);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const m=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g;let x;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],x=c;break e}x=t}const b=x;let y;e:{if(j){y=L;break e}if(typeof t=="string"){let c;e[11]!==t?(c=T(t),e[11]=t,e[12]=c):c=e[12],y=c;break e}y=C[0]}const z=y;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const F=q;let w;e[18]!==s||e[19]!==m||e[20]!==h?(w=f(S({shape:m,size:h}),s),e[18]=s,e[19]=m,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==z||e[23]!==b||e[24]!==F||e[25]!==p||e[26]!==u||e[27]!==h||e[28]!==l?(v=p&&F?i.jsx("div",{className:f("flex items-center justify-center w-full h-full",z),children:i.jsx(O,{size:D(h)})}):i.jsxs(i.Fragment,{children:[l&&i.jsx(E,{src:l,loading:"lazy",alt:"Avatar",className:f(_({objectFit:u}))}),i.jsx(M,{className:f(z,"rounded-none"),delayMs:l?600:0,children:b})]}),e[22]=z,e[23]=b,e[24]=F,e[25]=p,e[26]=u,e[27]=h,e[28]=l,e[29]=v):v=e[29];let A;return e[30]!==o||e[31]!==v||e[32]!==w?(A=i.jsx(U,{className:w,...o,children:v}),e[30]=o,e[31]=v,e[32]=w,e[33]=A):A=e[33],A}function W(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const m=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,x=h??"base";let b;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==m||e[15]!==x||e[16]!==l?(b=i.jsx(H,{shape:m,url:l,fallback:t,size:x,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=m,e[15]=x,e[16]=l,e[17]=b):b=e[17],b}W.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:f(S({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{W as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,l as g,j as l,bd as v,aH as b}from"./index-
|
|
1
|
+
import{c as u,l as g,j as l,bd as v,aH as b}from"./index-BTRkPuaE.js";const f=b("inline-flex items-center justify-center rounded-full border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",warning:"border-transparent bg-warning text-warning-foreground [a&]:hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",muted:"border-transparent bg-muted text-muted-foreground [a&]:hover:bg-muted/80"},size:{default:"px-2 py-0.5",icon:"size-5",segmented:"h-7 gap-0 rounded-lg border-transparent bg-card p-0 card-shadow"}},defaultVariants:{variant:"default",size:"default"}});function x(d){const e=u.c(14);let r,s,t,n,a;e[0]!==d?({className:r,variant:a,size:t,asChild:n,...s}=d,e[0]=d,e[1]=r,e[2]=s,e[3]=t,e[4]=n,e[5]=a):(r=e[1],s=e[2],t=e[3],n=e[4],a=e[5]);const c=(n===void 0?!1:n)?v:"span";let i;e[6]!==r||e[7]!==t||e[8]!==a?(i=g(f({variant:a,size:t}),r),e[6]=r,e[7]=t,e[8]=a,e[9]=i):i=e[9];let o;return e[10]!==c||e[11]!==s||e[12]!==i?(o=l.jsx(c,{"data-slot":"badge",className:i,...s}),e[10]=c,e[11]=s,e[12]=i,e[13]=o):o=e[13],o}export{x as B};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{c as I,l as se,j as s,b as H,r as G,K as Ee,m as Ae,h as yt,B as rl}from"./index-BTRkPuaE.js";import{E as Je,T as He,R as vt,a as jt,b as $e,K as kt,P as Nt,s as Ct,e as St,S as Bt,r as nl,D as Pt,c as wt,u as _t,C as Tt,v as il}from"./rich-text-link-control-CDJeP4n9.js";import{s as We}from"./Plus-B1zA6p-4.js";import{q as al,t as cl,l as dl,F as Qe,I as ae,c as M,v as be,R as fe,A as me,w as ul,b as fl,x as ml,y as ue,z as pl,B as xl}from"./agent-site-editor-content-CStkXfya.js";import{e as rt,b as gl,C as hl,a as bl,c as yl,f as vl}from"./command-CBb61KwU.js";import{a as jl,b as kl,P as Nl}from"./popover-CrZxQ_WL.js";import{N as Cl,Q as Sl,ak as Bl,Y as Pl,a3 as wl,G as Re,ac as $t,ad as Lt,ae as It,af as _l,z as Tl,aj as Et}from"./agent-icon-BJAncODg.js";import{a as $l}from"./Copy01-DFthUWqM.js";import{s as Ve}from"./Trash01-C2tQl3wO.js";import{u as Xe,s as Ze,a as et,b as tt}from"./index-DktJOqdm.js";import{s as lt}from"./suggestion-yycalltA.js";import{b as Ll,i as Il,a as El}from"./ZoomOut-CTvv0VFv.js";import{w as At}from"./section-preview-url-7zfngvgW.js";import{e as Al,r as Rl}from"./claim-phase-copy-D-j3nn-u.js";import{au as nt,av as Dl,aw as Ol,ax as zl,ay as Fl,az as Ul,aA as Ml,aB as Hl,aC as ql}from"./runnable-block-editor-BaDSgAAv.js";import{B as Gl}from"./index-BwZnKcdF.js";import{T as Kl,a as Vl,b as Yl}from"./tooltip-BJNrweFg.js";import{a as Rt}from"./Image01-CmS6lPNM.js";import{i as Jl}from"./Link01-BK2WDfDE.js";import{i as Wl}from"./Monitor01-mscEQ6pB.js";import{L as ve}from"./label-7CUu5Nng.js";import{I as Le}from"./input-_e15nvFZ.js";import{i as Dt}from"./Check-CZYLh537.js";import{s as Ql}from"./XClose-DTOuD_e7.js";import{c as Xl,d as Zl,b as es,D as ts}from"./dialog-BrqxKGpn.js";import{S as ls}from"./blog-schema-DsqMhqVM.js";function re(u){const e=I.c(8),{active:t,label:n,onClick:l,children:o}=u,r=t?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let i;e[0]!==r?(i=se("flex h-7 min-w-7 items-center justify-center px-1.5 text-sm transition-colors cursor-pointer rounded-[var(--studio-control-radius,var(--radius))]",r),e[0]=r,e[1]=i):i=e[1];let f;return e[2]!==t||e[3]!==o||e[4]!==n||e[5]!==l||e[6]!==i?(f=s.jsx("button",{type:"button","aria-label":n,"aria-pressed":t,onMouseDown:ss,onClick:l,className:i,children:o}),e[2]=t,e[3]=o,e[4]=n,e[5]=l,e[6]=i,e[7]=f):f=e[7],f}function ss(u){return u.preventDefault()}function it(){const u=I.c(1);let e;return u[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("span",{"aria-hidden":!0,className:"mx-0.5 h-5 w-px bg-border"}),u[0]=e):e=u[0],e}function os(u){const e=I.c(17),{draft:t,notice:n,label:l,placeholder:o,onDraftChange:r,onCommit:i,onCancel:f}=u;let c;e[0]!==r?(c=a=>r(a.target.value),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==f||e[3]!==i?(d=a=>{a.key==="Escape"&&f(),a.key==="Enter"&&i()},e[2]=f,e[3]=i,e[4]=d):d=e[4];let g;e[5]!==t||e[6]!==l||e[7]!==i||e[8]!==o||e[9]!==c||e[10]!==d?(g=s.jsx(Le,{autoFocus:!0,type:"url",value:t,onChange:c,onBlur:i,onKeyDown:d,placeholder:o,spellCheck:!1,"aria-label":l,className:"h-8 w-full text-xs"}),e[5]=t,e[6]=l,e[7]=i,e[8]=o,e[9]=c,e[10]=d,e[11]=g):g=e[11];let h;e[12]!==n?(h=n&&s.jsx("p",{role:"alert",className:"px-1 pb-0.5 pt-1.5 text-xs text-destructive",children:n}),e[12]=n,e[13]=h):h=e[13];let b;return e[14]!==g||e[15]!==h?(b=s.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 w-96 rounded-[var(--studio-surface-radius,var(--radius-md))] border bg-popover p-1 shadow-md",children:[g,h]}),e[14]=g,e[15]=h,e[16]=b):b=e[16],b}function rs(u){const e=I.c(74),{value:t,mobileValue:n,onChange:l,onMobileChange:o,label:r,alt:i,toolbarExtras:f,sandbox:c}=u,d=H(),[g,h]=G.useState(!1),[b,a]=G.useState(!1),[m,p]=G.useState(null),[x,y]=G.useState(null),v=m!==null,[k,j]=G.useState(null),C=ns,S=C(n),B=g?S:C(t),N=nt(B),w=!!B&&(k===B||!N),_=Dl(N);let T;e[0]!==g||e[1]!==d?(T=d(g?"sectionsEditor.imageField.mobileUrlLabel":"sectionsEditor.imageField.urlLabel"),e[0]=g,e[1]=d,e[2]=T):T=e[2];const P=T;let L;e[3]!==l||e[4]!==g||e[5]!==o?(L=oe=>(g?o:l)(oe||void 0),e[3]=l,e[4]=g,e[5]=o,e[6]=L):L=e[6];const $=L,D=`${g?"mobile":"desktop"}:${B}`,[O,z]=G.useState(D);O!==D&&(z(D),m!==null&&(p(B),y(null)));let q;e[7]===Symbol.for("react.memo_cache_sentinel")?(q=()=>{p(null),y(null)},e[7]=q):q=e[7];const E=q,J=()=>{const oe=m??"",Me=nt(oe);return!Me&&oe.trim()?(y(d("sectionsEditor.imageField.unsafeUrl")),!1):(Me!==B&&$(Me||void 0),!0)};let V;e[8]!==E||e[9]!==J?(V=()=>{J()&&E()},e[8]=E,e[9]=J,e[10]=V):V=e[10];const W=V,te=()=>{v?W():p(B)};let ee;e[11]!==J||e[12]!==v?(ee=oe=>{v&&!J()||h(oe)},e[11]=J,e[12]=v,e[13]=ee):ee=e[13];const Q=ee,le=c?.siteSlug;let Z;e[14]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>a(!0),e[14]=Z):Z=e[14];let X;e[15]!==$||e[16]!==le?(X={siteSlug:le,onUploaded:$,onNeedsPicker:Z},e[15]=$,e[16]=le,e[17]=X):X=e[17];const{isDragging:F,isPending:R,lockedConfigId:K,dropProps:U}=Ol(X);let A;e[18]!==r?(A=r&&s.jsx(ve,{className:"text-muted-foreground",children:r}),e[18]=r,e[19]=A):A=e[19];let Y;e[20]!==f?(Y=f&&s.jsx(it,{}),e[20]=f,e[21]=Y):Y=e[21];const ie=!g;let ce;e[22]!==d?(ce=d("sectionsEditor.imageField.desktopSlot"),e[22]=d,e[23]=ce):ce=e[23];let ne;e[24]!==Q?(ne=()=>Q(!1),e[24]=Q,e[25]=ne):ne=e[25];let je;e[26]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(Wl,{size:14}),e[26]=je):je=e[26];let ke;e[27]!==ie||e[28]!==ce||e[29]!==ne?(ke=s.jsx(re,{active:ie,label:ce,onClick:ne,children:je}),e[27]=ie,e[28]=ce,e[29]=ne,e[30]=ke):ke=e[30];let Ne;e[31]!==d?(Ne=d("sectionsEditor.imageField.mobileSlot"),e[31]=d,e[32]=Ne):Ne=e[32];let Ce;e[33]!==Q?(Ce=()=>Q(!0),e[33]=Q,e[34]=Ce):Ce=e[34];let Se;e[35]===Symbol.for("react.memo_cache_sentinel")?(Se=s.jsx(Jl,{size:14}),e[35]=Se):Se=e[35];let Be;e[36]!==te||e[37]!==P||e[38]!==v?(Be=s.jsx(re,{active:v,label:P,onClick:te,children:Se}),e[36]=te,e[37]=P,e[38]=v,e[39]=Be):Be=e[39];let Pe;e[40]!==E||e[41]!==W||e[42]!==d||e[43]!==m||e[44]!==P||e[45]!==x?(Pe=m!==null&&s.jsx(os,{draft:m,notice:x,label:P,placeholder:d("sectionsEditor.imageField.urlPlaceholder"),onDraftChange:oe=>{y(null),p(oe)},onCommit:W,onCancel:E}),e[40]=E,e[41]=W,e[42]=d,e[43]=m,e[44]=P,e[45]=x,e[46]=Pe):Pe=e[46];let we;e[47]===Symbol.for("react.memo_cache_sentinel")?(we=()=>a(!0),e[47]=we):we=e[47];let pe;e[48]!==d?(pe=d("sectionsEditor.imageField.replaceImage"),e[48]=d,e[49]=pe):pe=e[49];const ze=!B&&"border border-dashed border-border/60 bg-muted/30 hover:bg-muted/50",Fe=F&&"ring-2 ring-primary/40",Ue=R&&"pointer-events-none opacity-60";let xe;e[50]!==ze||e[51]!==Fe||e[52]!==Ue?(xe=se("relative block w-full cursor-pointer overflow-hidden rounded-[var(--studio-surface-radius,var(--radius-xl))] transition",ze,Fe,Ue),e[50]=ze,e[51]=Fe,e[52]=Ue,e[53]=xe):xe=e[53];let ge;e[54]!==B||e[55]!==i||e[56]!==w||e[57]!==R||e[58]!==g||e[59]!==N||e[60]!==d?(ge=N&&!w?s.jsx("img",{src:N,alt:i??"",onError:()=>j(B),className:"block h-auto w-full"}):s.jsxs("span",{className:"flex h-32 w-full flex-col items-center justify-center gap-1.5 text-sm text-muted-foreground",children:[s.jsx(Rt,{size:20}),d(R?"sectionsEditor.imageField.uploading":w?"sectionsEditor.imageField.previewUnavailable":g?"sectionsEditor.imageField.dropMobileImage":"sectionsEditor.imageField.dropImageOrClickToBrowse")]}),e[54]=B,e[55]=i,e[56]=w,e[57]=R,e[58]=g,e[59]=N,e[60]=d,e[61]=ge):ge=e[61];let he;e[62]!==F||e[63]!==d?(he=F&&s.jsx("span",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-primary/10 backdrop-blur-[1px]",children:s.jsx("span",{className:"rounded-md bg-background px-3 py-1.5 text-xs font-medium shadow",children:d("sectionsEditor.imageField.dropToUpload")})}),e[62]=F,e[63]=d,e[64]=he):he=e[64];let _e;e[65]!==pe||e[66]!==xe||e[67]!==ge||e[68]!==he?(_e=s.jsxs("button",{type:"button",onClick:we,"aria-label":pe,className:xe,children:[ge,he]}),e[65]=pe,e[66]=xe,e[67]=ge,e[68]=he,e[69]=_e):_e=e[69];let Te;return e[70]!==K||e[71]!==b||e[72]!==$?(Te=s.jsx(Ul,{open:b,onOpenChange:a,mode:"image",onSelect:$,lockedConfigId:K}),e[70]=K,e[71]=b,e[72]=$,e[73]=Te):Te=e[73],s.jsxs("div",{...U,className:"group/image relative space-y-2",children:[A,s.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-2 z-10 flex justify-center",children:s.jsxs("div",{className:"pointer-events-none relative flex items-center gap-0.5 rounded-md border bg-popover p-0.5 opacity-0 shadow-md transition-opacity group-hover/image:pointer-events-auto group-hover/image:opacity-100 group-focus-within/image:pointer-events-auto group-focus-within/image:opacity-100",children:[f,Y,ke,s.jsx(re,{active:g,label:Ne,onClick:Ce,children:s.jsx(Cl,{size:14,className:se(S&&"text-primary")})}),Be,N&&!N.toLowerCase().startsWith("data:")&&s.jsxs(s.Fragment,{children:[s.jsx(it,{}),zl.map(oe=>s.jsx(re,{active:_===oe,label:oe,onClick:()=>$(Fl(N,_===oe?void 0:oe)),children:s.jsx("span",{className:"px-0.5 text-xs capitalize",children:oe})},oe))]}),Pe]})}),_e,Te]})}function ns(u){return typeof u=="string"?u:""}const De=u=>typeof u=="string"?u:"",is=/\/blog\.tsx?$/;function Ot(u,e){for(const[t,n]of Object.entries(u)){if(t.includes("/")||!n||typeof n!="object"||Array.isArray(n))continue;const l=n;if(typeof l.__resolveType!="string"||!is.test(l.__resolveType))continue;const o=De(l[e]);if(o)return o}return null}const as=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]);function cs(u){if(!u||typeof u!="object"||Array.isArray(u))return null;const e=u;return typeof e.__resolveType!="string"||!as.has(e.__resolveType)?null:typeof e.path=="string"?e.path:null}function ds(u){return Al(u).filter(e=>e!=="*").length}function zt(u,e){let t=null,n=Number.POSITIVE_INFINITY;for(const l of Object.values(u)){const o=cs(l);if(!o||!e.test(JSON.stringify(l)))continue;const r=ds(o);r<n&&(t=o,n=r)}return t}const us=/blogpostpage/i,fs=/blogcategorypage/i;function Ft(u){return Ot(u,"pageSlug")??zt(u,us)}function ms(u){return Ot(u,"categorySlug")??zt(u,fs)}function ps(u){const e=u.categories;if(!Array.isArray(e)||e.length===0)return"";const t=e[0];return De(t?.slug)}function Ut(u,e){let t=u;if(/:category[*?]?/.test(t)){if(!e.category)return null;t=t.replace(/:category[*?]?/g,Ye(e.category))}if(/:slug[*?]?/.test(t)){if(!e.slug)return null;t=t.replace(/:slug[*?]?/g,encodeURIComponent(e.slug))}return t}const at=/:(?:categorySlug|categoria|category|slug)[*?]?/,xs=/:(?:categorySlug|categoria|category|slug)[*?]?/g;function Mt(u,e=!1){return/:(?:categorySlug|categoria|category)\*|\/\*$/.test(u)?!0:e&&/:slug\*/.test(u)&&!/:(?:categorySlug|categoria|category)[*?]?/.test(u)}function Ye(u){return u.split("/").filter(e=>e!=="."&&e!=="..").map(encodeURIComponent).join("/")}function Ht(u,e){if(!e)return"";const t=al(u).categories;return cl(e,t).join("/")}function gs(u,e){return/\/\*$/.test(u)&&!at.test(u)?e?u.replace(/\/\*$/,`/${Ye(e)}`):null:at.test(u)?e?u.replace(xs,Ye(e)):null:u}function cr({decofile:u,category:e,previewBaseUrl:t,draftPointer:n}){if(!t)return null;const l=ms(u);if(!l)return null;const o=De(e.slug),r=gs(l,Mt(l,!0)?Ht(u,o):o);if(!r)return null;try{return At(new URL(r,t).href,n)}catch{return null}}function dr({decofile:u,post:e,previewBaseUrl:t,draftPointer:n}){if(!t)return null;const l=Ft(u);if(!l)return null;const o=ps(e),r=Ut(l,{category:Mt(l)?Ht(u,o):o,slug:De(e.slug)});if(!r)return null;try{return At(new URL(r,t).href,n)}catch{return null}}function qt(u){const e=I.c(12),{iconName:t,iconUrl:n,alt:l,className:o,size:r}=u,i=r===void 0?16:r;let f;e[0]!==t?(f=Bl(t)??Sl,e[0]=t,e[1]=f):f=e[1];const c=f;let d;e[2]!==o?(d=se("flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-md border bg-muted",o),e[2]=o,e[3]=d):d=e[3];let g;e[4]!==c||e[5]!==l||e[6]!==n||e[7]!==i?(g=n?s.jsx("img",{src:n,alt:l,className:"size-5 object-contain"}):s.jsx(c,{size:i,className:"text-muted-foreground"}),e[4]=c,e[5]=l,e[6]=n,e[7]=i,e[8]=g):g=e[8];let h;return e[9]!==d||e[10]!==g?(h=s.jsx("div",{className:d,children:g}),e[9]=d,e[10]=g,e[11]=h):h=e[11],h}const ct={app:"sandbox.blockPicker.blocksLabel",site:"sandbox.blockPicker.customBlocksLabel"};function dt(u){const e=I.c(19),{type:t,onInsert:n}=u,l=`${t.title} ${t.resolveType} ${t.description??""}`;let o;e[0]!==n||e[1]!==t.resolveType?(o=()=>n(t.resolveType),e[0]=n,e[1]=t.resolveType,e[2]=o):o=e[2];let r;e[3]!==t.iconName||e[4]!==t.iconUrl||e[5]!==t.title?(r=s.jsx(qt,{iconName:t.iconName,iconUrl:t.iconUrl,alt:t.title}),e[3]=t.iconName,e[4]=t.iconUrl,e[5]=t.title,e[6]=r):r=e[6];let i;e[7]!==t.title?(i=s.jsx("span",{className:"text-sm font-medium",children:t.title}),e[7]=t.title,e[8]=i):i=e[8];let f;e[9]!==t.description?(f=t.description&&s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[9]=t.description,e[10]=f):f=e[10];let c;e[11]!==i||e[12]!==f?(c=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[i,f]}),e[11]=i,e[12]=f,e[13]=c):c=e[13];let d;return e[14]!==l||e[15]!==o||e[16]!==r||e[17]!==c?(d=s.jsxs(gl,{value:l,onSelect:o,className:"flex items-center gap-2.5",children:[r,c]}),e[14]=l,e[15]=o,e[16]=r,e[17]=c,e[18]=d):d=e[18],d}function Gt(u){const e=I.c(41),{blockTypes:t,onInsert:n,children:l,align:o}=u,r=o===void 0?"start":o,i=H(),[f,c]=G.useState(!1),[d,g]=G.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=$=>{$&&typeof document<"u"&&g(document.querySelector('[data-slot="dialog-content"][data-state="open"]')),c($)},e[0]=h):h=e[0];const b=h;let a,m;if(e[1]!==t){a=[],m=[];for(const $ of t)($.source==="site"?m:a).push($);e[1]=t,e[2]=a,e[3]=m}else a=e[2],m=e[3];let p;e[4]!==n?(p=$=>{n($),c(!1)},e[4]=n,e[5]=p):p=e[5];const x=p,y=a.length>0&&m.length>0;let v;e[6]!==l?(v=s.jsx(jl,{asChild:!0,children:l}),e[6]=l,e[7]=v):v=e[7];const k=d??void 0;let j;e[8]!==i?(j=i("sandbox.blockPicker.searchPlaceholder"),e[8]=i,e[9]=j):j=e[9];let C;e[10]!==j?(C=s.jsx(hl,{placeholder:j}),e[10]=j,e[11]=C):C=e[11];let S;e[12]!==i?(S=i("sandbox.blockPicker.noBlocksFound"),e[12]=i,e[13]=S):S=e[13];let B;e[14]!==S?(B=s.jsx(bl,{children:S}),e[14]=S,e[15]=B):B=e[15];let N;e[16]!==x||e[17]!==y||e[18]!==m||e[19]!==i?(N=m.length>0&&s.jsx(rt,{heading:y?i(ct.site):void 0,children:m.map($=>s.jsx(dt,{type:$,onInsert:x},$.resolveType))}),e[16]=x,e[17]=y,e[18]=m,e[19]=i,e[20]=N):N=e[20];let w;e[21]!==a||e[22]!==x||e[23]!==y||e[24]!==i?(w=a.length>0&&s.jsx(rt,{heading:y?i(ct.app):void 0,children:a.map($=>s.jsx(dt,{type:$,onInsert:x},$.resolveType))}),e[21]=a,e[22]=x,e[23]=y,e[24]=i,e[25]=w):w=e[25];let _;e[26]!==N||e[27]!==w||e[28]!==B?(_=s.jsxs(yl,{className:"min-h-0 flex-1",children:[B,N,w]}),e[26]=N,e[27]=w,e[28]=B,e[29]=_):_=e[29];let T;e[30]!==_||e[31]!==C?(T=s.jsxs(vl,{className:"min-h-0 flex-1",children:[C,_]}),e[30]=_,e[31]=C,e[32]=T):T=e[32];let P;e[33]!==r||e[34]!==T||e[35]!==k?(P=s.jsx(kl,{container:k,className:"flex max-h-(--radix-popover-content-available-height) w-80 flex-col p-0",align:r,children:T}),e[33]=r,e[34]=T,e[35]=k,e[36]=P):P=e[36];let L;return e[37]!==f||e[38]!==P||e[39]!==v?(L=s.jsxs(Nl,{open:f,onOpenChange:b,children:[v,P]}),e[37]=f,e[38]=P,e[39]=v,e[40]=L):L=e[40],L}const Kt="vtex/loaders/intelligentSearch/productList.ts",hs="vtex/loaders/categories/tree.ts",bs=24;function ye(u){return u&&typeof u=="object"&&!Array.isArray(u)?u:null}function ys(u){return u.split("/").filter(Boolean).map((t,n)=>`category-${n+1}/${t}`).join("/")}function Vt(u,e){const t=e.trim(),n=Kt,l=bs;if(u==="cluster")return t?[{resolveType:n,props:{collection:t,count:l}}]:[];if(u==="category"){if(!t)return[];const f=ys(t);return f?[{resolveType:n,props:{facets:f,count:l}}]:[]}if(!t)return[{resolveType:n,props:{count:l}}];const o=[];/^\d+$/.test(t)&&o.push({resolveType:n,props:{ids:[t]}});const i=t.includes("-")&&!/\s/.test(t)?t.replace(/-+/g," "):t;return o.push({resolveType:n,props:{query:i,count:l}}),o}function vs(){return{resolveType:hs,props:{}}}function js(u){return{resolveType:Kt,props:{ids:u}}}function ut(u){return typeof u=="string"||typeof u=="number"?String(u):""}function st(u){const e=ye(u),t=Array.isArray(u)?u:Array.isArray(e?.products)?e.products:[],n=[],l=new Set;for(const o of t){const r=ye(o);if(!r)continue;const i=ut(r.productID)||ut(r.sku);if(!i||l.has(i))continue;l.add(i);const f=ye(r.isVariantOf),c=typeof f?.name=="string"&&f.name||typeof r.name=="string"&&r.name||i,d=Array.isArray(r.image)?ye(r.image[0]):null,g=typeof d?.url=="string"?d.url:void 0,h=typeof r.url=="string"&&r.url||typeof f?.url=="string"&&f.url||void 0;n.push({id:i,label:c,image:g,url:h})}return n}function ks(u){if(typeof u!="string"||!u)return null;let e;try{e=new URL(u,"https://placeholder.invalid").pathname}catch{return null}return e.replace(/^\/+|\/+$/g,"")||null}function Ns(u){const e=[],t=new Set,n=(l,o)=>{const r=ye(l);if(!r)return;const i=typeof r.name=="string"&&r.name?r.name:"",f=i?[...o,i]:o,c=ks(r.url);if(c&&!t.has(c)&&(t.add(c),e.push({path:c,label:f.join(" › ")||c})),Array.isArray(r.children))for(const d of r.children)n(d,f)};if(Array.isArray(u))for(const l of u)n(l,[]);return e}function Cs(u,e,t=50){const n=e.trim().toLowerCase();return(n?u.filter(o=>o.label.toLowerCase().includes(n)||o.path.toLowerCase().includes(n)):u).slice(0,t)}const Ss=1e4;async function Oe(u,{resolveType:e,props:t}){const n=await fetch(Ml(u),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...t}),signal:AbortSignal.timeout(Ss)});if(!n.ok)throw new Error(`Failed to fetch (${n.status})`);return n.json()}function Yt(u,e){const t=I.c(20);let n;t[0]!==e?(n=new Set(e.filter(Boolean)),t[0]=e,t[1]=n):n=t[1];let l;t[2]!==n?(l=[...n],t[2]=n,t[3]=l):l=t[3];const o=l;let r;t[4]!==o||t[5]!==u?(r=Ee.sandboxInvoke(u?`${u.orgSlug}/${u.virtualMcpId}/${u.branch}`:"none",`blog-products-by-ids:${o.join(",")}`),t[4]=o,t[5]=u,t[6]=r):r=t[6];let i;t[7]!==o||t[8]!==u?(i=()=>Oe(u,js(o)).then(st),t[7]=o,t[8]=u,t[9]=i):i=t[9];const f=!!u&&o.length>0;let c;t[10]!==r||t[11]!==i||t[12]!==f?(c={queryKey:r,queryFn:i,enabled:f,staleTime:6e4,retry:1},t[10]=r,t[11]=i,t[12]=f,t[13]=c):c=t[13];const d=Ae(c);let g;if(t[14]!==d.data){g=new Map;for(const b of d.data??[])g.set(b.id,b);t[14]=d.data,t[15]=g}else g=t[15];let h;return t[16]!==g||t[17]!==d.isError||t[18]!==d.isLoading?(h={byId:g,isLoading:d.isLoading,isError:d.isError},t[16]=g,t[17]=d.isError,t[18]=d.isLoading,t[19]=h):h=t[19],h}function Jt(u){const e=I.c(12),{value:t,onChange:n,placeholder:l,children:o}=u;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Re,{size:13,className:"shrink-0 text-muted-foreground"}),e[0]=r):r=e[0];let i;e[1]!==n?(i=g=>n(g.target.value),e[1]=n,e[2]=i):i=e[2];let f;e[3]!==l||e[4]!==i||e[5]!==t?(f=s.jsxs("div",{className:"flex items-center gap-1.5 rounded border px-2",children:[r,s.jsx("input",{autoFocus:!0,type:"text",value:t,placeholder:l,onChange:i,className:"h-7 flex-1 bg-transparent text-sm text-foreground placeholder:text-muted-foreground focus:outline-none"})]}),e[3]=l,e[4]=i,e[5]=t,e[6]=f):f=e[6];let c;e[7]!==o?(c=s.jsx("div",{className:"max-h-56 overflow-y-auto",children:o}),e[7]=o,e[8]=c):c=e[8];let d;return e[9]!==f||e[10]!==c?(d=s.jsxs("div",{className:"flex flex-col gap-1",children:[f,c]}),e[9]=f,e[10]=c,e[11]=d):d=e[11],d}function Wt(u){const e=I.c(13),{label:t,sublabel:n,image:l,onPick:o}=u;let r;e[0]!==l?(r=l!==void 0&&s.jsx("img",{src:l,alt:"",className:"h-7 w-7 shrink-0 rounded object-cover"}),e[0]=l,e[1]=r):r=e[1];let i;e[2]!==t?(i=s.jsx("span",{className:"block truncate text-sm",children:t}),e[2]=t,e[3]=i):i=e[3];let f;e[4]!==n?(f=n&&s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:n}),e[4]=n,e[5]=f):f=e[5];let c;e[6]!==i||e[7]!==f?(c=s.jsxs("span",{className:"min-w-0 flex-1",children:[i,f]}),e[6]=i,e[7]=f,e[8]=c):c=e[8];let d;return e[9]!==o||e[10]!==r||e[11]!==c?(d=s.jsxs("button",{type:"button",onMouseDown:Bs,onClick:o,className:"flex w-full items-center gap-2 rounded px-1.5 py-1.5 text-left transition-colors hover:bg-muted",children:[r,c]}),e[9]=o,e[10]=r,e[11]=c,e[12]=d):d=e[12],d}function Bs(u){return u.preventDefault()}function Ps(u){const e=I.c(7),{decofile:t,onPick:n}=u,l=H(),[o,r]=G.useState("");let i;if(e[0]!==t||e[1]!==n||e[2]!==l||e[3]!==o){const f=Ft(t),c=o.trim().toLowerCase(),d=dl(t).filter(b=>!c||b.title.toLowerCase().includes(c)||b.slug.toLowerCase().includes(c)).slice(0,30),g=b=>f?Ut(f,{category:b.categorySlugs[0]??"",slug:b.slug}):null;let h;e[5]!==l?(h=l("sandbox.linkPicker.searchPosts"),e[5]=l,e[6]=h):h=e[6],i=s.jsx(Jt,{value:o,onChange:r,placeholder:h,children:d.length===0?s.jsx("p",{className:"px-1.5 py-3 text-center text-xs text-muted-foreground",children:l("sandbox.linkPicker.noPosts")}):d.map(b=>{const a=g(b);return a?s.jsx(Wt,{label:b.title||b.slug,sublabel:a,onPick:()=>n(a)},b.key):null})}),e[0]=t,e[1]=n,e[2]=l,e[3]=o,e[4]=i}else i=e[4];return i}function ws(u){const e=I.c(25),{sandboxRef:t,onPick:n}=u,l=H(),[o,r]=G.useState(""),[i,f]=G.useState(""),c=G.useRef(null);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=j=>{r(j),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>f(j.trim()),300)},e[0]=d):d=e[0];const g=d;let h;e[1]!==i||e[2]!==t.branch||e[3]!==t.orgSlug||e[4]!==t.virtualMcpId?(h=Ee.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`product-link:${i}`),e[1]=i,e[2]=t.branch,e[3]=t.orgSlug,e[4]=t.virtualMcpId,e[5]=h):h=e[5];let b;e[6]!==i||e[7]!==t?(b=async()=>{const[j]=Vt("search",i);if(!j)return[];const C=await Oe(t,j);return st(C).filter(_s)},e[6]=i,e[7]=t,e[8]=b):b=e[8];let a;e[9]!==h||e[10]!==b?(a={queryKey:h,queryFn:b},e[9]=h,e[10]=b,e[11]=a):a=e[11];const m=Ae(a);let p;e[12]!==m.data?(p=m.data??[],e[12]=m.data,e[13]=p):p=e[13];const x=p;let y;e[14]!==l?(y=l("sandbox.linkPicker.searchProducts"),e[14]=l,e[15]=y):y=e[15];let v;e[16]!==n||e[17]!==x||e[18]!==m.isFetching||e[19]!==l?(v=m.isFetching?s.jsxs("p",{className:"flex items-center justify-center gap-1.5 px-1.5 py-3 text-xs text-muted-foreground",children:[s.jsx(wl,{size:12,className:"animate-spin"}),l("sandbox.linkPicker.searching")]}):x.length===0?s.jsx("p",{className:"px-1.5 py-3 text-center text-xs text-muted-foreground",children:l("sandbox.linkPicker.noProducts")}):x.map(j=>s.jsx(Wt,{label:j.label,image:j.image??"",onPick:()=>j.url&&n(j.url)},j.id)),e[16]=n,e[17]=x,e[18]=m.isFetching,e[19]=l,e[20]=v):v=e[20];let k;return e[21]!==y||e[22]!==v||e[23]!==o?(k=s.jsx(Jt,{value:o,onChange:g,placeholder:y,children:v}),e[21]=y,e[22]=v,e[23]=o,e[24]=k):k=e[24],k}function _s(u){return u.url}function ot(u){const e=I.c(20),{decofile:t,sandboxRef:n}=u,l=H();let o;if(e[0]!==t||e[1]!==n||e[2]!==l){if(o=[],t){let r;e[4]!==l?(r=l("sandbox.linkPicker.tabPost"),e[4]=l,e[5]=r):r=e[5];let i;e[6]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ll,{size:12}),e[6]=i):i=e[6];let f;e[7]!==t?(f=d=>s.jsx(Ps,{decofile:t,onPick:d}),e[7]=t,e[8]=f):f=e[8];let c;e[9]!==r||e[10]!==f?(c={id:"post",label:r,icon:i,render:f},e[9]=r,e[10]=f,e[11]=c):c=e[11],o.push(c)}if(n){let r;e[12]!==l?(r=l("sandbox.linkPicker.tabProduct"),e[12]=l,e[13]=r):r=e[13];let i;e[14]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Pl,{size:12}),e[14]=i):i=e[14];let f;e[15]!==n?(f=d=>s.jsx(ws,{sandboxRef:n,onPick:d}),e[15]=n,e[16]=f):f=e[16];let c;e[17]!==r||e[18]!==f?(c={id:"product",label:r,icon:i,render:f},e[17]=r,e[18]=f,e[19]=c):c=e[19],o.push(c)}e[0]=t,e[1]=n,e[2]=l,e[3]=o}else o=e[3];return o}function Ts({html:u,placeholder:e,onChange:t,decofile:n,sandboxRef:l}){const o=G.useRef(t);o.current=t;const[r,i]=G.useState(!1),f=Xe({extensions:[Ze.configure({link:{HTMLAttributes:{}},heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,bulletList:!1,orderedList:!1,listItem:!1,dropcursor:!1,gapcursor:!1}),lt.configure({placeholder:e??"Write something…"})],content:u||"",editorProps:{attributes:{class:se("prose prose-sm dark:prose-invert max-w-none focus:outline-none","leading-relaxed [&_p]:my-0",Je)}},onUpdate:({editor:g})=>{const h=g.getHTML();o.current(h==="<p></p>"?"":h)}}),c=et({editor:f,selector:({editor:g})=>({isFocused:g?.isFocused??!1,bold:g?.isActive("bold")??!1,italic:g?.isActive("italic")??!1,underline:g?.isActive("underline")??!1,link:g?.isActive("link")??!1})}),d=ot({decofile:n,sandboxRef:l});return f?s.jsxs("div",{className:"relative",children:[(c.isFocused||r)&&s.jsxs("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.jsx(He,{active:c.bold,label:"Bold",onClick:()=>f.chain().focus().toggleBold().run(),children:s.jsx($t,{size:14})}),s.jsx(He,{active:c.italic,label:"Italic",onClick:()=>f.chain().focus().toggleItalic().run(),children:s.jsx(Lt,{size:14})}),s.jsx(He,{active:c.underline,label:"Underline",onClick:()=>f.chain().focus().toggleUnderline().run(),children:s.jsx(It,{size:14})}),s.jsx(vt,{editor:f,active:c.link,open:r,onOpenChange:i,sources:d})]}),s.jsx(tt,{editor:f,className:"text-[15px] text-foreground"})]}):null}function $s(u,e){const t=u.length?u.split(`
|
|
2
|
+
`):[""],n=e?"ol":"ul",l=t.map(o=>`<li><p>${o}</p></li>`).join("");return`<${n}>${l}</${n}>`}function Ls(u){const e=new DOMParser().parseFromString(u,"text/html").body,t=Array.from(e.querySelectorAll(":scope > ul > li, :scope > ol > li")),n=t.length?t:Array.from(e.children);return n.length===0?[""]:n.map(l=>{const o=l.children.length===1?l.children[0]:null;return(o?.tagName==="P"?o.innerHTML:l.innerHTML).trim()})}const Is=({editor:u,state:e})=>u.isEditable&&(u.isFocused||!e.selection.empty),Es={placement:"bottom-start",offset:8};function Qt(u){const e=I.c(11),{editor:t,appendTo:n,sources:l}=u,o=H(),[r,i]=G.useState(!1),[f,c]=G.useState(null),d=n??f;let g;e[0]!==t?(g={editor:t,selector:As},e[0]=t,e[1]=g):g=e[1];const h=et(g);let b;e[2]!==t||e[3]!==r||e[4]!==h||e[5]!==l||e[6]!==o||e[7]!==d?(b=d&&s.jsxs(Gl,{editor:t,appendTo:d,shouldShow:Is,options:Es,className:"z-50 flex items-center gap-0.5 rounded-md border bg-popover p-0.5 shadow-md",children:[s.jsx(re,{active:h.bold,label:o("sectionsEditor.richTextField.bold"),onClick:()=>t.chain().focus().toggleBold().run(),children:s.jsx($t,{size:14})}),s.jsx(re,{active:h.italic,label:o("sectionsEditor.richTextField.italic"),onClick:()=>t.chain().focus().toggleItalic().run(),children:s.jsx(Lt,{size:14})}),s.jsx(re,{active:h.underline,label:o("sectionsEditor.richTextField.underline"),onClick:()=>t.chain().focus().toggleUnderline().run(),children:s.jsx(It,{size:14})}),s.jsx(re,{active:h.strike,label:o("sectionsEditor.richTextField.strikethrough"),onClick:()=>t.chain().focus().toggleStrike().run(),children:s.jsx(_l,{size:14})}),s.jsx(vt,{editor:t,active:h.link,open:r,onOpenChange:i,sources:l})]}),e[2]=t,e[3]=r,e[4]=h,e[5]=l,e[6]=o,e[7]=d,e[8]=b):b=e[8];let a;return e[9]!==b?(a=s.jsx("div",{ref:c,className:"relative z-20",children:b}),e[9]=b,e[10]=a):a=e[10],a}function As(u){const{editor:e}=u;return{bold:e.isActive("bold"),italic:e.isActive("italic"),underline:e.isActive("underline"),strike:e.isActive("strike"),link:e.isActive("link")}}const Rs=["1","2","3","4"],Ds={1:"sandbox.plainBlocks.headingLevel1",2:"sandbox.plainBlocks.headingLevel2",3:"sandbox.plainBlocks.headingLevel3",4:"sandbox.plainBlocks.headingLevel4"},ft={1:"text-3xl font-bold",2:"text-2xl font-bold",3:"text-xl font-semibold",4:"text-lg font-semibold",5:"text-base font-semibold",6:"text-sm font-semibold"};function Os(u){const e=I.c(23),{text:t,level:n,onChange:l}=u,[o,r]=G.useState(!1),i=H(),f=n||"2";let c;e[0]!==o||e[1]!==f||e[2]!==l||e[3]!==i||e[4]!==t?(c=o&&s.jsx(Qe,{children:Rs.map(y=>s.jsxs(re,{active:f===y,label:i(Ds[y]),onClick:()=>l({text:t,level:y}),children:["H",y]},y))}),e[0]=o,e[1]=f,e[2]=l,e[3]=i,e[4]=t,e[5]=c):c=e[5];let d;e[6]!==f||e[7]!==l?(d=y=>l({text:y,level:f}),e[6]=f,e[7]=l,e[8]=d):d=e[8];let g,h;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=()=>r(!0),h=()=>r(!1),e[9]=g,e[10]=h):(g=e[9],h=e[10]);let b;e[11]!==i?(b=i("sandbox.plainBlocks.headingPlaceholder"),e[11]=i,e[12]=b):b=e[12];const a=ft[f]??ft[2];let m;e[13]!==a?(m=se("text-foreground",a),e[13]=a,e[14]=m):m=e[14];let p;e[15]!==d||e[16]!==b||e[17]!==m||e[18]!==t?(p=s.jsx(ae,{value:t,onChange:d,onFocus:g,onBlur:h,placeholder:b,className:m}),e[15]=d,e[16]=b,e[17]=m,e[18]=t,e[19]=p):p=e[19];let x;return e[20]!==c||e[21]!==p?(x=s.jsxs("div",{className:"relative",children:[c,p]}),e[20]=c,e[21]=p,e[22]=x):x=e[22],x}function zs(u){const e=I.c(6),{quote:t,onChange:n}=u,l=H();let o;e[0]!==l?(o=l("sandbox.plainBlocks.quotePlaceholder"),e[0]=l,e[1]=o):o=e[1];let r;return e[2]!==n||e[3]!==t||e[4]!==o?(r=s.jsx("div",{className:"border-l-2 border-foreground/30 pl-4",children:s.jsx(ae,{value:t,onChange:n,placeholder:o,className:"text-lg italic text-foreground/90"})}),e[2]=n,e[3]=t,e[4]=o,e[5]=r):r=e[5],r}function Fs(u){const e=I.c(21),{code:t,language:n,onChange:l}=u,o=H();let r;e[0]!==t||e[1]!==l?(r=b=>l({code:t,language:b.target.value}),e[0]=t,e[1]=l,e[2]=r):r=e[2];let i;e[3]!==o?(i=o("sandbox.plainBlocks.languagePlaceholder"),e[3]=o,e[4]=i):i=e[4];let f;e[5]!==n||e[6]!==r||e[7]!==i?(f=s.jsx("input",{value:n,onChange:r,placeholder:i,className:"w-full border-b bg-transparent px-3 py-1.5 font-mono text-xs text-muted-foreground outline-none placeholder:text-muted-foreground/50"}),e[5]=n,e[6]=r,e[7]=i,e[8]=f):f=e[8];let c;e[9]!==n||e[10]!==l?(c=b=>l({code:b,language:n}),e[9]=n,e[10]=l,e[11]=c):c=e[11];let d;e[12]!==o?(d=o("sandbox.plainBlocks.codePlaceholder"),e[12]=o,e[13]=d):d=e[13];let g;e[14]!==t||e[15]!==c||e[16]!==d?(g=s.jsx(ae,{value:t,onChange:c,placeholder:d,spellCheck:!1,className:"px-3 py-2.5 font-mono text-sm text-foreground"}),e[14]=t,e[15]=c,e[16]=d,e[17]=g):g=e[17];let h;return e[18]!==f||e[19]!==g?(h=s.jsxs("div",{className:"overflow-hidden rounded-md border bg-muted/50",children:[f,g]}),e[18]=f,e[19]=g,e[20]=h):h=e[20],h}function Us({items:u,style:e,onChange:t,decofile:n,sandboxRef:l}){const o=H(),r=ot({decofile:n,sandboxRef:l}),i=G.useRef(t);i.current=t;const f=G.useRef(e);f.current=e;const c=Xe({extensions:[Ze.configure({link:{HTMLAttributes:{}},heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,dropcursor:!1,gapcursor:!1}),lt.configure({placeholder:o("sandbox.plainBlocks.listItemPlaceholder")})],content:$s(u,e==="ordered"),editorProps:{attributes:{class:se("focus:outline-none text-[15px] leading-relaxed","[&_ul]:list-disc [&_ol]:list-decimal [&_ul]:pl-7 [&_ol]:pl-7","[&_ul]:my-0 [&_ol]:my-0 [&_li]:pl-1.5 [&_li]:my-1 [&_p]:my-0","marker:text-muted-foreground marker:tabular-nums",Je)},handleKeyDown:(g,h)=>h.key==="Tab"},onUpdate:({editor:g})=>{i.current({items:Ls(g.getHTML()).join(`
|
|
3
|
+
`),style:g.isActive("orderedList")?"ordered":g.isActive("bulletList")?"unordered":f.current})}}),d=et({editor:c,selector:({editor:g})=>({isFocused:g?.isFocused??!1,bullet:g?.isActive("bulletList")??!1,ordered:g?.isActive("orderedList")??!1})});return c?s.jsxs("div",{className:"relative",children:[d.isFocused&&s.jsxs(Qe,{children:[s.jsx(re,{active:d.bullet,label:o("sandbox.plainBlocks.bulletedLabel"),onClick:()=>!d.bullet&&c.chain().focus().toggleBulletList().run(),children:"•"}),s.jsx(re,{active:d.ordered,label:o("sandbox.plainBlocks.numberedLabel"),onClick:()=>!d.ordered&&c.chain().focus().toggleOrderedList().run(),children:"1."})]}),s.jsx(Qt,{editor:c,sources:r}),s.jsx(tt,{editor:c,className:"text-foreground"})]}):null}function Ms(u){const e=u.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]{11})/);if(e)return`https://www.youtube.com/embed/${e[1]}`;const t=u.match(/vimeo\.com\/(\d+)/);return t?`https://player.vimeo.com/video/${t[1]}`:null}function Hs(u){const e=I.c(28),{url:t,caption:n,onChange:l}=u,o=H();let r;e[0]!==t?(r=Ms(t),e[0]=t,e[1]=r):r=e[1];const i=r;let f;e[2]!==n||e[3]!==i||e[4]!==o?(f=i?s.jsx("div",{className:"relative aspect-video overflow-hidden rounded-md border bg-muted",children:s.jsx("iframe",{src:i,title:n||o("sandbox.mediaBlocks.video"),sandbox:"allow-scripts allow-same-origin allow-presentation",className:"absolute inset-0 h-full w-full border-0",allowFullScreen:!0})}):s.jsx("div",{className:"flex aspect-video items-center justify-center rounded-md border border-dashed bg-muted/40 text-xs text-muted-foreground",children:o("sandbox.mediaBlocks.pasteVideoUrl")}),e[2]=n,e[3]=i,e[4]=o,e[5]=f):f=e[5];let c;e[6]!==n||e[7]!==l?(c=p=>l({url:p.target.value,caption:n}),e[6]=n,e[7]=l,e[8]=c):c=e[8];let d;e[9]!==o?(d=o("sandbox.mediaBlocks.videoUrlPlaceholder"),e[9]=o,e[10]=d):d=e[10];let g;e[11]!==c||e[12]!==d||e[13]!==t?(g=s.jsx("input",{value:t,onChange:c,placeholder:d,className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[11]=c,e[12]=d,e[13]=t,e[14]=g):g=e[14];let h;e[15]!==l||e[16]!==t?(h=p=>l({url:t,caption:p}),e[15]=l,e[16]=t,e[17]=h):h=e[17];let b;e[18]!==o?(b=o("sandbox.mediaBlocks.addCaption"),e[18]=o,e[19]=b):b=e[19];let a;e[20]!==n||e[21]!==h||e[22]!==b?(a=s.jsx(ae,{value:n,onChange:h,placeholder:b,className:"text-center text-sm italic text-muted-foreground"}),e[20]=n,e[21]=h,e[22]=b,e[23]=a):a=e[23];let m;return e[24]!==f||e[25]!==g||e[26]!==a?(m=s.jsxs("div",{className:"space-y-2",children:[f,g,a]}),e[24]=f,e[25]=g,e[26]=a,e[27]=m):m=e[27],m}function qs(){const u=I.c(5),e=H();let t;u[0]!==e?(t=e("sandbox.mediaBlocks.divider"),u[0]=e,u[1]=t):t=u[1];let n;u[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("span",{className:"h-px flex-1 bg-border"}),u[2]=n):n=u[2];let l;return u[3]!==t?(l=s.jsx("div",{className:"flex items-center py-3","aria-label":t,children:n}),u[3]=t,u[4]=l):l=u[4],l}function Gs(u){const e=I.c(22),{text:t,href:n,onChange:l}=u,o=H();let r;e[0]!==n||e[1]!==l?(r=a=>l({text:a.target.value,href:n}),e[0]=n,e[1]=l,e[2]=r):r=e[2];let i;e[3]!==o?(i=o("sandbox.mediaBlocks.buttonLabel"),e[3]=o,e[4]=i):i=e[4];const f=Math.max(t.length||11,8);let c;e[5]!==r||e[6]!==i||e[7]!==f||e[8]!==t?(c=s.jsx("div",{className:"inline-flex items-center rounded-full bg-primary px-6 py-2 text-sm font-semibold text-primary-foreground",children:s.jsx("input",{value:t,onChange:r,placeholder:i,size:f,className:"border-0 bg-transparent p-0 text-center text-sm font-semibold text-primary-foreground outline-none placeholder:text-primary-foreground/60 focus:ring-0"})}),e[5]=r,e[6]=i,e[7]=f,e[8]=t,e[9]=c):c=e[9];let d;e[10]!==l||e[11]!==t?(d=a=>l({text:t,href:a.target.value}),e[10]=l,e[11]=t,e[12]=d):d=e[12];let g;e[13]!==o?(g=o("sandbox.mediaBlocks.destinationUrlPlaceholder"),e[13]=o,e[14]=g):g=e[14];let h;e[15]!==n||e[16]!==d||e[17]!==g?(h=s.jsx("input",{value:n,onChange:d,placeholder:g,className:"w-full max-w-sm border-0 bg-transparent p-0 text-center text-xs text-muted-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[15]=n,e[16]=d,e[17]=g,e[18]=h):h=e[18];let b;return e[19]!==c||e[20]!==h?(b=s.jsxs("div",{className:"flex flex-col items-center gap-2 py-2",children:[c,h]}),e[19]=c,e[20]=h,e[21]=b):b=e[21],b}const qe=[{value:"info",icon:"ℹ",color:"oklch(0.62 0.19 250)"},{value:"tip",icon:"✓",color:"oklch(0.65 0.17 150)"},{value:"warning",icon:"⚠",color:"oklch(0.75 0.15 75)"},{value:"product",icon:"★",color:"oklch(0.62 0.21 300)"}];function Ks(u){const e=I.c(51),{title:t,body:n,variant:l,onChange:o}=u,r=H(),[i,f]=G.useState(!1);let c;e[0]!==l?(c=qe.find(P=>P.value===l)??qe[0],e[0]=l,e[1]=c):c=e[1];const d=c;let g,h;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=()=>f(!0),h=P=>{P.currentTarget.contains(P.relatedTarget)||f(!1)},e[2]=g,e[3]=h):(g=e[2],h=e[3]);let b;e[4]!==n||e[5]!==i||e[6]!==o||e[7]!==t||e[8]!==d.value?(b=i&&s.jsx(Qe,{children:qe.map(P=>s.jsx(re,{active:d.value===P.value,label:P.value,onClick:()=>o({title:t,body:n,variant:P.value}),children:s.jsx("span",{style:{color:P.color},children:P.icon})},P.value))}),e[4]=n,e[5]=i,e[6]=o,e[7]=t,e[8]=d.value,e[9]=b):b=e[9];const a=`3px solid ${d.color}`,m=`color-mix(in oklch, ${d.color} 8%, transparent)`;let p;e[10]!==a||e[11]!==m?(p={borderLeft:a,backgroundColor:m},e[10]=a,e[11]=m,e[12]=p):p=e[12];let x;e[13]!==d.color?(x={color:d.color},e[13]=d.color,e[14]=x):x=e[14];let y;e[15]!==d.icon?(y=s.jsx("span",{"aria-hidden":!0,className:"text-sm font-bold leading-none",children:d.icon}),e[15]=d.icon,e[16]=y):y=e[16];let v;e[17]!==n||e[18]!==o||e[19]!==l?(v=P=>o({title:P.target.value,body:n,variant:l}),e[17]=n,e[18]=o,e[19]=l,e[20]=v):v=e[20];let k;e[21]!==r?(k=r("sandbox.mediaBlocks.calloutTitle"),e[21]=r,e[22]=k):k=e[22];let j;e[23]!==d.color?(j={color:d.color},e[23]=d.color,e[24]=j):j=e[24];let C;e[25]!==v||e[26]!==k||e[27]!==j||e[28]!==t?(C=s.jsx("input",{value:t,onChange:v,placeholder:k,className:"flex-1 border-0 bg-transparent p-0 text-xs font-semibold uppercase tracking-wide outline-none focus:ring-0",style:j}),e[25]=v,e[26]=k,e[27]=j,e[28]=t,e[29]=C):C=e[29];let S;e[30]!==C||e[31]!==x||e[32]!==y?(S=s.jsxs("div",{className:"mb-1.5 flex items-center gap-2",style:x,children:[y,C]}),e[30]=C,e[31]=x,e[32]=y,e[33]=S):S=e[33];let B;e[34]!==o||e[35]!==t||e[36]!==l?(B=P=>o({title:t,body:P,variant:l}),e[34]=o,e[35]=t,e[36]=l,e[37]=B):B=e[37];let N;e[38]!==r?(N=r("sandbox.mediaBlocks.calloutText"),e[38]=r,e[39]=N):N=e[39];let w;e[40]!==n||e[41]!==B||e[42]!==N?(w=s.jsx(ae,{value:n,onChange:B,placeholder:N,className:"text-[15px] leading-relaxed text-foreground"}),e[40]=n,e[41]=B,e[42]=N,e[43]=w):w=e[43];let _;e[44]!==S||e[45]!==w||e[46]!==p?(_=s.jsxs("div",{className:"rounded-md py-4 pl-5 pr-4",style:p,children:[S,w]}),e[44]=S,e[45]=w,e[46]=p,e[47]=_):_=e[47];let T;return e[48]!==_||e[49]!==b?(T=s.jsxs("div",{className:"relative",onFocus:g,onBlur:h,children:[b,_]}),e[48]=_,e[49]=b,e[50]=T):T=e[50],T}function Vs(u){const e=I.c(34),{value:t,label:n,description:l,onChange:o}=u,r=H();let i;e[0]!==l||e[1]!==n||e[2]!==o?(i=x=>o({value:x.target.value,label:n,description:l}),e[0]=l,e[1]=n,e[2]=o,e[3]=i):i=e[3];let f;e[4]!==r?(f=r("sandbox.mediaBlocks.statValuePlaceholder"),e[4]=r,e[5]=f):f=e[5];let c;e[6]!==i||e[7]!==f||e[8]!==t?(c=s.jsx("input",{value:t,onChange:i,placeholder:f,className:"w-full border-0 bg-transparent p-0 text-center text-4xl font-bold tabular-nums text-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),e[6]=i,e[7]=f,e[8]=t,e[9]=c):c=e[9];let d;e[10]!==l||e[11]!==o||e[12]!==t?(d=x=>o({value:t,label:x.target.value,description:l}),e[10]=l,e[11]=o,e[12]=t,e[13]=d):d=e[13];let g;e[14]!==r?(g=r("sandbox.mediaBlocks.label"),e[14]=r,e[15]=g):g=e[15];let h;e[16]!==n||e[17]!==d||e[18]!==g?(h=s.jsx("input",{value:n,onChange:d,placeholder:g,className:"w-full border-0 bg-transparent p-0 text-center text-xs font-semibold uppercase tracking-wide text-muted-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),e[16]=n,e[17]=d,e[18]=g,e[19]=h):h=e[19];let b;e[20]!==n||e[21]!==o||e[22]!==t?(b=x=>o({value:t,label:n,description:x}),e[20]=n,e[21]=o,e[22]=t,e[23]=b):b=e[23];let a;e[24]!==r?(a=r("sandbox.mediaBlocks.optionalDescription"),e[24]=r,e[25]=a):a=e[25];let m;e[26]!==l||e[27]!==b||e[28]!==a?(m=s.jsx(ae,{value:l,onChange:b,placeholder:a,className:"max-w-md text-center text-sm text-muted-foreground"}),e[26]=l,e[27]=b,e[28]=a,e[29]=m):m=e[29];let p;return e[30]!==c||e[31]!==h||e[32]!==m?(p=s.jsxs("div",{className:"flex flex-col items-center gap-1.5 border-y border-border/60 py-8 text-center",children:[c,h,m]}),e[30]=c,e[31]=h,e[32]=m,e[33]=p):p=e[33],p}function Ys(u){const e=I.c(74),{block:t,onChange:n}=u,l=H();let o;e[0]!==t.size?(o=M(t.size)||"normal",e[0]=t.size,e[1]=o):o=e[1];const r=o,i=t.url,f=t.mobileUrl;let c,d;e[2]!==t||e[3]!==n?(c=E=>n({...t,url:E}),d=E=>n({...t,mobileUrl:E}),e[2]=t,e[3]=n,e[4]=c,e[5]=d):(c=e[4],d=e[5]);let g;e[6]!==t.alt?(g=M(t.alt),e[6]=t.alt,e[7]=g):g=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=["normal","full"],e[8]=h):h=e[8];let b;e[9]!==t||e[10]!==n||e[11]!==r||e[12]!==l?(b=h.map(E=>s.jsx(re,{active:r===E,label:E,onClick:()=>n({...t,size:E}),children:s.jsx("span",{className:"px-0.5 text-xs",children:l(E==="full"?"sandbox.mediaBlocks.fullWidth":"sandbox.mediaBlocks.normal")})},E)),e[9]=t,e[10]=n,e[11]=r,e[12]=l,e[13]=b):b=e[13];const a=t.highPriority===!0;let m;e[14]!==l?(m=l("sandbox.mediaBlocks.highPriority"),e[14]=l,e[15]=m):m=e[15];let p;e[16]!==t||e[17]!==n?(p=()=>n({...t,highPriority:t.highPriority?void 0:!0}),e[16]=t,e[17]=n,e[18]=p):p=e[18];let x;e[19]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Il,{size:14}),e[19]=x):x=e[19];let y;e[20]!==m||e[21]!==p||e[22]!==a?(y=s.jsx(Kl,{asChild:!0,children:s.jsx("span",{children:s.jsx(re,{active:a,label:m,onClick:p,children:x})})}),e[20]=m,e[21]=p,e[22]=a,e[23]=y):y=e[23];let v;e[24]!==l?(v=l("sandbox.mediaBlocks.highPriorityHint"),e[24]=l,e[25]=v):v=e[25];let k;e[26]!==v?(k=s.jsx(Vl,{className:"max-w-64",children:v}),e[26]=v,e[27]=k):k=e[27];let j;e[28]!==y||e[29]!==k?(j=s.jsxs(Yl,{children:[y,k]}),e[28]=y,e[29]=k,e[30]=j):j=e[30];let C;e[31]!==j||e[32]!==b?(C=s.jsxs(s.Fragment,{children:[b,j]}),e[31]=j,e[32]=b,e[33]=C):C=e[33];let S;e[34]!==t.mobileUrl||e[35]!==t.url||e[36]!==C||e[37]!==c||e[38]!==d||e[39]!==g?(S=s.jsx(rs,{value:i,mobileValue:f,onChange:c,onMobileChange:d,alt:g,toolbarExtras:C}),e[34]=t.mobileUrl,e[35]=t.url,e[36]=C,e[37]=c,e[38]=d,e[39]=g,e[40]=S):S=e[40];let B;e[41]!==t.caption?(B=M(t.caption),e[41]=t.caption,e[42]=B):B=e[42];let N;e[43]!==t||e[44]!==n?(N=E=>n({...t,caption:E}),e[43]=t,e[44]=n,e[45]=N):N=e[45];let w;e[46]!==l?(w=l("sandbox.mediaBlocks.addCaption"),e[46]=l,e[47]=w):w=e[47];let _;e[48]!==B||e[49]!==N||e[50]!==w?(_=s.jsx(ae,{value:B,onChange:N,placeholder:w,className:"text-center text-sm italic text-muted-foreground"}),e[48]=B,e[49]=N,e[50]=w,e[51]=_):_=e[51];let T;e[52]!==l?(T=l("sandbox.mediaBlocks.altLabel"),e[52]=l,e[53]=T):T=e[53];let P;e[54]!==T?(P=s.jsx("span",{className:"shrink-0 font-medium",children:T}),e[54]=T,e[55]=P):P=e[55];let L;e[56]!==t.alt?(L=M(t.alt),e[56]=t.alt,e[57]=L):L=e[57];let $;e[58]!==t||e[59]!==n?($=E=>n({...t,alt:E}),e[58]=t,e[59]=n,e[60]=$):$=e[60];let D;e[61]!==l?(D=l("sandbox.mediaBlocks.altText"),e[61]=l,e[62]=D):D=e[62];let O;e[63]!==L||e[64]!==$||e[65]!==D?(O=s.jsx(ae,{value:L,onChange:$,placeholder:D,className:"text-xs"}),e[63]=L,e[64]=$,e[65]=D,e[66]=O):O=e[66];let z;e[67]!==P||e[68]!==O?(z=s.jsxs("div",{className:"flex items-baseline gap-1.5 text-xs text-muted-foreground",children:[P,O]}),e[67]=P,e[68]=O,e[69]=z):z=e[69];let q;return e[70]!==S||e[71]!==_||e[72]!==z?(q=s.jsxs("div",{className:"space-y-2",children:[S,_,z]}),e[70]=S,e[71]=_,e[72]=z,e[73]=q):q=e[73],q}function Js(u){const e=I.c(21),{cards:t,onChange:n}=u,l=H();let o,r,i,f,c;if(e[0]!==t||e[1]!==n||e[2]!==l){r=be(t);let b;e[8]!==n?(b=m=>n(JSON.stringify(m)),e[8]=n,e[9]=b):b=e[9],o=b;const a=(m,p)=>o(r.map((x,y)=>y===m?{...x,...p}:x));c="space-y-2",i="grid grid-cols-1 gap-3 sm:grid-cols-3",f=r.slice(0,3).map((m,p)=>s.jsxs("div",{className:"group/item relative flex flex-col gap-2 rounded-lg border bg-card p-4",children:[s.jsx("div",{className:"absolute right-1 top-1",children:s.jsx(fe,{label:l("sandbox.listBlocks.removeCard"),onClick:()=>o(r.filter((x,y)=>y!==p))})}),s.jsx("input",{value:M(m.icon),onChange:x=>a(p,{icon:x.target.value}),placeholder:"🎴",className:"flex h-9 w-9 items-center justify-center rounded-md border bg-background text-center text-lg outline-none focus:ring-0"}),s.jsx("input",{value:M(m.title),onChange:x=>a(p,{title:x.target.value}),placeholder:l("sandbox.listBlocks.cardTitle"),className:"border-0 bg-transparent p-0 text-[15px] font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),s.jsx(ae,{value:M(m.body),onChange:x=>a(p,{body:x}),placeholder:l("sandbox.listBlocks.cardBody"),className:"text-sm text-muted-foreground"})]},p)),e[0]=t,e[1]=n,e[2]=l,e[3]=o,e[4]=r,e[5]=i,e[6]=f,e[7]=c}else o=e[3],r=e[4],i=e[5],f=e[6],c=e[7];let d;e[10]!==i||e[11]!==f?(d=s.jsx("div",{className:i,children:f}),e[10]=i,e[11]=f,e[12]=d):d=e[12];let g;e[13]!==o||e[14]!==r||e[15]!==l?(g=r.length<3&&s.jsx(me,{label:l("sandbox.listBlocks.addCard"),onClick:()=>o([...r,{title:"",body:""}])}),e[13]=o,e[14]=r,e[15]=l,e[16]=g):g=e[16];let h;return e[17]!==c||e[18]!==d||e[19]!==g?(h=s.jsxs("div",{className:c,children:[d,g]}),e[17]=c,e[18]=d,e[19]=g,e[20]=h):h=e[20],h}function Ws(u){const e=I.c(36),{title:t,items:n,onChange:l}=u,o=H();let r,i,f,c,d;if(e[0]!==n||e[1]!==l||e[2]!==o||e[3]!==t){i=be(n);let p;e[9]!==l||e[10]!==t?(p=v=>l({title:t,items:JSON.stringify(v)}),e[9]=l,e[10]=t,e[11]=p):p=e[11],r=p,c="space-y-2";let x;e[12]!==n||e[13]!==l?(x=v=>l({title:v.target.value,items:n}),e[12]=n,e[13]=l,e[14]=x):x=e[14];let y;e[15]!==o?(y=o("sandbox.listBlocks.checklistTitle"),e[15]=o,e[16]=y):y=e[16],e[17]!==x||e[18]!==y||e[19]!==t?(d=s.jsx("input",{value:t,onChange:x,placeholder:y,className:"w-full border-0 bg-transparent p-0 text-lg font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[17]=x,e[18]=y,e[19]=t,e[20]=d):d=e[20],f=i.map((v,k)=>s.jsxs("li",{className:"group/item flex items-start gap-3 border-b border-border/50 py-2.5",children:[s.jsx("span",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center text-primary",children:s.jsx(Dt,{size:15})}),s.jsx(ae,{value:v,onChange:j=>r(i.map((C,S)=>S===k?j:C)),placeholder:o("sandbox.listBlocks.checklistItem"),className:"text-[15px] text-foreground"}),s.jsx(fe,{label:o("sandbox.listBlocks.removeItem"),onClick:()=>r(i.filter((j,C)=>C!==k))})]},k)),e[0]=n,e[1]=l,e[2]=o,e[3]=t,e[4]=r,e[5]=i,e[6]=f,e[7]=c,e[8]=d}else r=e[4],i=e[5],f=e[6],c=e[7],d=e[8];let g;e[21]!==f?(g=s.jsx("ul",{children:f}),e[21]=f,e[22]=g):g=e[22];let h;e[23]!==o?(h=o("sandbox.listBlocks.addItem"),e[23]=o,e[24]=h):h=e[24];let b;e[25]!==r||e[26]!==i?(b=()=>r([...i,""]),e[25]=r,e[26]=i,e[27]=b):b=e[27];let a;e[28]!==h||e[29]!==b?(a=s.jsx(me,{label:h,onClick:b}),e[28]=h,e[29]=b,e[30]=a):a=e[30];let m;return e[31]!==c||e[32]!==d||e[33]!==g||e[34]!==a?(m=s.jsxs("div",{className:c,children:[d,g,a]}),e[31]=c,e[32]=d,e[33]=g,e[34]=a,e[35]=m):m=e[35],m}function Qs(u){const e=I.c(21),{stats:t,onChange:n}=u,l=H();let o,r,i,f,c;if(e[0]!==n||e[1]!==t||e[2]!==l){r=be(t);let b;e[8]!==n?(b=m=>n(JSON.stringify(m)),e[8]=n,e[9]=b):b=e[9],o=b;const a=(m,p)=>o(r.map((x,y)=>y===m?{...x,...p}:x));c="space-y-2",i="grid grid-cols-1 gap-3 sm:grid-cols-3",f=r.slice(0,3).map((m,p)=>s.jsxs("div",{className:"group/item relative rounded-lg border p-5 text-center",children:[s.jsx("div",{className:"absolute right-1 top-1",children:s.jsx(fe,{label:l("sandbox.listBlocks.removeStat"),onClick:()=>o(r.filter((x,y)=>y!==p))})}),s.jsx("input",{value:M(m.value),onChange:x=>a(p,{value:x.target.value}),placeholder:l("sandbox.listBlocks.statValuePlaceholder"),className:"w-full border-0 bg-transparent p-0 text-center text-3xl font-bold tabular-nums text-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),s.jsx("input",{value:M(m.label),onChange:x=>a(p,{label:x.target.value}),placeholder:l("sandbox.listBlocks.label"),className:"mt-1 w-full border-0 bg-transparent p-0 text-center text-sm text-muted-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"})]},p)),e[0]=n,e[1]=t,e[2]=l,e[3]=o,e[4]=r,e[5]=i,e[6]=f,e[7]=c}else o=e[3],r=e[4],i=e[5],f=e[6],c=e[7];let d;e[10]!==i||e[11]!==f?(d=s.jsx("div",{className:i,children:f}),e[10]=i,e[11]=f,e[12]=d):d=e[12];let g;e[13]!==o||e[14]!==r||e[15]!==l?(g=r.length<3&&s.jsx(me,{label:l("sandbox.listBlocks.addStat"),onClick:()=>o([...r,{value:"",label:""}])}),e[13]=o,e[14]=r,e[15]=l,e[16]=g):g=e[16];let h;return e[17]!==c||e[18]!==d||e[19]!==g?(h=s.jsxs("div",{className:c,children:[d,g]}),e[17]=c,e[18]=d,e[19]=g,e[20]=h):h=e[20],h}function Xs(u){const e=I.c(38),{title:t,steps:n,onChange:l}=u,o=H();let r,i,f,c,d,g;if(e[0]!==l||e[1]!==n||e[2]!==o||e[3]!==t){i=be(n);let x;e[10]!==l||e[11]!==t?(x=j=>l({title:t,steps:JSON.stringify(j)}),e[10]=l,e[11]=t,e[12]=x):x=e[12],r=x;const y=(j,C)=>r(i.map((S,B)=>B===j?{...S,...C}:S));d="space-y-2";let v;e[13]!==l||e[14]!==n?(v=j=>l({title:j.target.value,steps:n}),e[13]=l,e[14]=n,e[15]=v):v=e[15];let k;e[16]!==o?(k=o("sandbox.listBlocks.stepsTitle"),e[16]=o,e[17]=k):k=e[17],e[18]!==v||e[19]!==k||e[20]!==t?(g=s.jsx("input",{value:t,onChange:v,placeholder:k,className:"w-full border-0 bg-transparent p-0 text-lg font-semibold uppercase tracking-wide outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[18]=v,e[19]=k,e[20]=t,e[21]=g):g=e[21],f="space-y-3",c=i.map((j,C)=>s.jsxs("li",{className:"group/item flex gap-4",children:[s.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full border text-sm font-semibold text-muted-foreground",children:C+1}),s.jsxs("div",{className:"min-w-0 flex-1 space-y-1 pt-0.5",children:[s.jsx("input",{value:M(j.title),onChange:S=>y(C,{title:S.target.value}),placeholder:o("sandbox.listBlocks.stepTitle"),className:"w-full border-0 bg-transparent p-0 text-[15px] font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),s.jsx(ae,{value:M(j.description),onChange:S=>y(C,{description:S}),placeholder:o("sandbox.listBlocks.stepDescription"),className:"text-sm text-muted-foreground"})]}),s.jsx(fe,{label:o("sandbox.listBlocks.removeStep"),onClick:()=>r(i.filter((S,B)=>B!==C))})]},C)),e[0]=l,e[1]=n,e[2]=o,e[3]=t,e[4]=r,e[5]=i,e[6]=f,e[7]=c,e[8]=d,e[9]=g}else r=e[4],i=e[5],f=e[6],c=e[7],d=e[8],g=e[9];let h;e[22]!==f||e[23]!==c?(h=s.jsx("ol",{className:f,children:c}),e[22]=f,e[23]=c,e[24]=h):h=e[24];let b;e[25]!==o?(b=o("sandbox.listBlocks.addStep"),e[25]=o,e[26]=b):b=e[26];let a;e[27]!==r||e[28]!==i?(a=()=>r([...i,{title:"",description:""}]),e[27]=r,e[28]=i,e[29]=a):a=e[29];let m;e[30]!==b||e[31]!==a?(m=s.jsx(me,{label:b,onClick:a}),e[30]=b,e[31]=a,e[32]=m):m=e[32];let p;return e[33]!==d||e[34]!==g||e[35]!==h||e[36]!==m?(p=s.jsxs("div",{className:d,children:[g,h,m]}),e[33]=d,e[34]=g,e[35]=h,e[36]=m,e[37]=p):p=e[37],p}function mt(u,e){try{const t=JSON.parse(u||"{}");return{title:typeof t?.title=="string"?t.title:e,items:Array.isArray(t?.items)?t.items:[]}}catch{return{title:e,items:[]}}}function Zs(u){const e=I.c(13),{left:t,right:n,onChange:l}=u,o=H();let r;if(e[0]!==t||e[1]!==l||e[2]!==n||e[3]!==o){const i={left:mt(t,o("sandbox.listBlocks.optionA")),right:mt(n,o("sandbox.listBlocks.optionB"))};let f;e[5]!==t||e[6]!==l||e[7]!==n?(f=(b,a)=>l({left:b==="left"?JSON.stringify(a):t,right:b==="right"?JSON.stringify(a):n}),e[5]=t,e[6]=l,e[7]=n,e[8]=f):f=e[8];const c=f;let d;e[9]!==c||e[10]!==o?(d=(b,a,m)=>{const p=a.items??[];return s.jsxs("div",{className:"space-y-2 rounded-lg border p-4",children:[s.jsx("input",{value:M(a.title),onChange:x=>c(b,{...a,title:x.target.value}),placeholder:o("sandbox.listBlocks.columnTitle"),className:"w-full border-0 bg-transparent p-0 text-xs font-semibold uppercase tracking-wide outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),s.jsx("ul",{className:"space-y-1.5",children:p.map((x,y)=>s.jsxs("li",{className:"group/item flex items-start gap-2",children:[s.jsx("span",{"aria-hidden":!0,className:"mt-0.5 shrink-0 text-sm font-bold",style:{color:m},children:"✓"}),s.jsx(ae,{value:x,onChange:v=>c(b,{...a,items:p.map((k,j)=>j===y?v:k)}),placeholder:o("sandbox.listBlocks.item"),className:"text-sm text-foreground"}),s.jsx(fe,{label:o("sandbox.listBlocks.removeItem"),onClick:()=>c(b,{...a,items:p.filter((v,k)=>k!==y)})})]},y))}),s.jsx(me,{label:o("sandbox.listBlocks.addItem"),onClick:()=>c(b,{...a,items:[...p,""]})})]})},e[9]=c,e[10]=o,e[11]=d):d=e[11];const g=d;let h;e[12]===Symbol.for("react.memo_cache_sentinel")?(h=se("grid grid-cols-1 gap-3 sm:grid-cols-2"),e[12]=h):h=e[12],r=s.jsxs("div",{className:h,children:[g("left",i.left,"oklch(0.65 0.17 150)"),g("right",i.right,"oklch(0.75 0.15 75)")]}),e[0]=t,e[1]=l,e[2]=n,e[3]=o,e[4]=r}else r=e[4];return r}const eo="vtex/loaders/intelligentSearch/productList.ts";function de(u){return u&&typeof u=="object"&&!Array.isArray(u)?u:null}function Ge(u){return typeof u=="string"||typeof u=="number"?String(u):""}function Ke(u){const e=de(u);return!!e&&typeof e.__resolveType=="string"&&"productId"in e}function Xt(u){if(Array.isArray(u))return u.map(n=>Ge(de(n)?.productId));const e=de(u),t=de(e?.props);return t&&Array.isArray(t.ids)?t.ids.map(Ge):e&&"productId"in e?[Ge(e.productId)]:[]}function to(u){const e=de(u)??{};return typeof e.__resolveType=="string"?e.__resolveType:eo}function Zt(u,e){if(Array.isArray(u)){const o=u.find(Ke);if(o)return e.map((r,i)=>{const f=de(u[i]);return{...Ke(f)?f:{__resolveType:o.__resolveType},productId:r}})}const t=de(u);if(Ke(t)&&!de(t.props)?.ids)return{...t,productId:e[0]??""};const n=de(t?.props)??{},l=to(u);return{...t??{},__resolveType:l,props:{...n,ids:e,simulationBehavior:n.simulationBehavior??"default"}}}const lo=[{id:"search",labelKey:"sandbox.productPickerDialog.modeSearch"},{id:"category",labelKey:"sandbox.productPickerDialog.modeCategory"},{id:"cluster",labelKey:"sandbox.productPickerDialog.modeClusterId"}];async function so(u,e){if(e.length===0)return[];const t=await Promise.allSettled(e.map(r=>Oe(u,r))),n=t.filter(r=>r.status==="fulfilled").map(r=>r.value);if(n.length===0){const r=t.find(i=>i.status==="rejected");throw r?r.reason:new Error("Failed to fetch products")}const l=[],o=new Set;for(const r of n)for(const i of st(r))o.has(i.id)||(o.add(i.id),l.push(i));return l}function pt(u){const e=I.c(6),[t,n]=G.useState(""),[l,o]=G.useState(""),r=G.useRef(null);let i;e[0]!==u?(i=d=>{n(d),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>o(d),u)},e[0]=u,e[1]=i):i=e[1];const f=i;let c;return e[2]!==l||e[3]!==f||e[4]!==t?(c={value:t,debounced:l,onChange:f},e[2]=l,e[3]=f,e[4]=t,e[5]=c):c=e[5],c}function oo(u){const e=I.c(23),{option:t,selected:n,onToggle:l}=u,o=n?"border-primary/40 bg-primary/5":"border-transparent hover:bg-muted/60";let r;e[0]!==o?(r=se("flex w-full items-center gap-3 rounded-lg border px-2 py-2 text-left transition-colors",o),e[0]=o,e[1]=r):r=e[1];let i;e[2]!==t.image?(i=s.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:t.image?s.jsx("img",{src:t.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):s.jsx(Re,{size:14,className:"text-muted-foreground"})}),e[2]=t.image,e[3]=i):i=e[3];let f;e[4]!==t.label?(f=s.jsx("span",{className:"line-clamp-2 text-sm",children:t.label}),e[4]=t.label,e[5]=f):f=e[5];let c;e[6]!==t.id?(c=s.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:["ID ",t.id]}),e[6]=t.id,e[7]=c):c=e[7];let d;e[8]!==f||e[9]!==c?(d=s.jsxs("span",{className:"min-w-0 flex-1",children:[f,c]}),e[8]=f,e[9]=c,e[10]=d):d=e[10];const g=n?"border-primary bg-primary text-primary-foreground":"border-border text-transparent";let h;e[11]!==g?(h=se("flex h-5 w-5 shrink-0 items-center justify-center rounded-full border",g),e[11]=g,e[12]=h):h=e[12];let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Dt,{size:12}),e[13]=b):b=e[13];let a;e[14]!==h?(a=s.jsx("span",{className:h,children:b}),e[14]=h,e[15]=a):a=e[15];let m;return e[16]!==l||e[17]!==n||e[18]!==a||e[19]!==r||e[20]!==i||e[21]!==d?(m=s.jsxs("button",{type:"button",onClick:l,"aria-pressed":n,className:r,children:[i,d,a]}),e[16]=l,e[17]=n,e[18]=a,e[19]=r,e[20]=i,e[21]=d,e[22]=m):m=e[22],m}function el(u){const e=I.c(9),{query:t,emptyLabel:n,loadingLabel:l}=u,o=H();if(t.isLoading){let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(yt,{size:"xs"}),e[0]=i):i=e[0];let f;return e[1]!==l?(f=s.jsxs("div",{className:"flex items-center gap-2 px-2 py-6 text-sm text-muted-foreground",children:[i,l]}),e[1]=l,e[2]=f):f=e[2],f}if(t.isError){let i;e[3]!==o?(i=o("sandbox.productPickerDialog.couldNotLoad"),e[3]=o,e[4]=i):i=e[4];let f;return e[5]!==i?(f=s.jsx("p",{className:"px-2 py-6 text-sm text-muted-foreground",children:i}),e[5]=i,e[6]=f):f=e[6],f}let r;return e[7]!==n?(r=s.jsx("p",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:n}),e[7]=n,e[8]=r):r=e[8],r}function tl(u){return`${u.orgSlug}/${u.virtualMcpId}/${u.branch}`}function ro(u){const e=I.c(45),{sandboxRef:t,open:n,selected:l,onSelect:o}=u,r=H(),[i,f]=G.useState("");let c;e[0]!==t?(c=Ee.sandboxInvoke(tl(t),"blog-category-tree"),e[0]=t,e[1]=c):c=e[1];let d;e[2]!==t?(d=()=>Oe(t,vs()).then(Ns),e[2]=t,e[3]=d):d=e[3];const g=n&&!l;let h;e[4]!==c||e[5]!==d||e[6]!==g?(h={queryKey:c,queryFn:d,enabled:g,staleTime:6e4,retry:1},e[4]=c,e[5]=d,e[6]=g,e[7]=h):h=e[7];const b=Ae(h);if(l){let k;e[8]!==o?(k=()=>o(null),e[8]=o,e[9]=k):k=e[9];let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Tl,{size:14}),e[10]=j):j=e[10];let C;e[11]!==r?(C=r("sandbox.productPickerDialog.categoryLabel"),e[11]=r,e[12]=C):C=e[12];let S;e[13]!==l.label?(S=s.jsx("span",{className:"text-foreground",children:l.label}),e[13]=l.label,e[14]=S):S=e[14];let B;e[15]!==r?(B=r("sandbox.productPickerDialog.change"),e[15]=r,e[16]=B):B=e[16];let N;e[17]!==C||e[18]!==S||e[19]!==B?(N=s.jsxs("span",{className:"truncate",children:[C,S," —",B]}),e[17]=C,e[18]=S,e[19]=B,e[20]=N):N=e[20];let w;return e[21]!==N||e[22]!==k?(w=s.jsxs("button",{type:"button",onClick:k,className:"flex items-center gap-1.5 rounded-lg px-2 py-1.5 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[j,N]}),e[21]=N,e[22]=k,e[23]=w):w=e[23],w}let a,m,p,x;if(e[24]!==i||e[25]!==o||e[26]!==b||e[27]!==r){const k=Cs(b.data??[],i);p="space-y-2";let j;e[32]===Symbol.for("react.memo_cache_sentinel")?(j=S=>f(S.target.value),e[32]=j):j=e[32];let C;e[33]!==r?(C=r("sandbox.productPickerDialog.filterCategoriesPlaceholder"),e[33]=r,e[34]=C):C=e[34],e[35]!==i||e[36]!==C?(x=s.jsx(Le,{value:i,onChange:j,placeholder:C,className:"h-9"}),e[35]=i,e[36]=C,e[37]=x):x=e[37],a="h-48 overflow-y-auto rounded-md border",m=k.length===0?s.jsx(el,{query:b,loadingLabel:r("sandbox.productPickerDialog.loadingCategories"),emptyLabel:r("sandbox.productPickerDialog.noCategories")}):s.jsx("div",{className:"p-1",children:k.map(S=>s.jsx("button",{type:"button",onClick:()=>o(S),className:"block w-full truncate px-2 py-1.5 text-left text-sm hover:bg-muted/60 rounded-lg",children:S.label},S.path))}),e[24]=i,e[25]=o,e[26]=b,e[27]=r,e[28]=a,e[29]=m,e[30]=p,e[31]=x}else a=e[28],m=e[29],p=e[30],x=e[31];let y;e[38]!==a||e[39]!==m?(y=s.jsx("div",{className:a,children:m}),e[38]=a,e[39]=m,e[40]=y):y=e[40];let v;return e[41]!==p||e[42]!==x||e[43]!==y?(v=s.jsxs("div",{className:p,children:[x,y]}),e[41]=p,e[42]=x,e[43]=y,e[44]=v):v=e[44],v}function ll(u){const e=I.c(89),{open:t,onOpenChange:n,sandboxRef:l,selectedIds:o,onChange:r,multiple:i}=u,f=i===void 0?!0:i,c=H(),[d,g]=G.useState("search"),h=pt(300),b=pt(300),[a,m]=G.useState(null),p=d==="search"?h.debounced:d==="cluster"?b.debounced:a?.path??"";let x;e[0]!==d||e[1]!==p?(x=Vt(d,p),e[0]=d,e[1]=p,e[2]=x):x=e[2];const y=x;let v;e[3]!==d||e[4]!==l||e[5]!==p?(v=Ee.sandboxInvoke(tl(l),`blog-product:${d}:${p}`),e[3]=d,e[4]=l,e[5]=p,e[6]=v):v=e[6];let k;e[7]!==y||e[8]!==l?(k=()=>so(l,y),e[7]=y,e[8]=l,e[9]=k):k=e[9];const j=t&&y.length>0;let C;e[10]!==v||e[11]!==k||e[12]!==j?(C={queryKey:v,queryFn:k,enabled:j,staleTime:6e4,retry:1},e[10]=v,e[11]=k,e[12]=j,e[13]=C):C=e[13];const S=Ae(C);let B;e[14]!==o?(B=new Set(o.filter(Boolean)),e[14]=o,e[15]=B):B=e[15];const N=B;let w;e[16]!==f||e[17]!==r||e[18]!==N||e[19]!==o?(w=A=>{if(!f){r(N.has(A)?[]:[A]);return}N.has(A)?r(o.filter(Y=>Y!==A)):r([...o.filter(Boolean),A])},e[16]=f,e[17]=r,e[18]=N,e[19]=o,e[20]=w):w=e[20];const _=w;let T;e[21]!==S.data?(T=S.data??[],e[21]=S.data,e[22]=T):T=e[22];const P=T,L=y.length===0;let $;e[23]!==f||e[24]!==c?($=c(f?"sandbox.productPickerDialog.addProducts":"sandbox.productPickerDialog.chooseProduct"),e[23]=f,e[24]=c,e[25]=$):$=e[25];let D;e[26]!==$?(D=s.jsx(Xl,{className:"border-b border-border px-4 py-3",children:s.jsx(Zl,{className:"text-sm font-medium",children:$})}),e[26]=$,e[27]=D):D=e[27];let O;e[28]!==d||e[29]!==c?(O=lo.map(A=>s.jsx("button",{type:"button",onClick:()=>g(A.id),className:se("rounded-lg px-2.5 py-1 text-sm transition-colors",d===A.id?"bg-muted font-medium text-foreground":"text-muted-foreground hover:text-foreground"),children:c(A.labelKey)},A.id)),e[28]=d,e[29]=c,e[30]=O):O=e[30];let z;e[31]!==O?(z=s.jsx("div",{className:"flex shrink-0 items-center gap-1 border-b border-border px-4 py-2",children:O}),e[31]=O,e[32]=z):z=e[32];let q;e[33]!==d||e[34]!==h||e[35]!==c?(q=d==="search"&&s.jsx(Le,{autoFocus:!0,value:h.value,onChange:A=>h.onChange(A.target.value),placeholder:c("sandbox.productPickerDialog.searchProductsPlaceholder"),className:"h-9"}),e[33]=d,e[34]=h,e[35]=c,e[36]=q):q=e[36];let E;e[37]!==b||e[38]!==d||e[39]!==c?(E=d==="cluster"&&s.jsx(Le,{autoFocus:!0,value:b.value,onChange:A=>b.onChange(A.target.value),placeholder:c("sandbox.productPickerDialog.clusterIdPlaceholder"),className:"h-9"}),e[37]=b,e[38]=d,e[39]=c,e[40]=E):E=e[40];let J;e[41]!==a||e[42]!==d||e[43]!==t||e[44]!==l?(J=d==="category"&&s.jsx(ro,{sandboxRef:l,open:t,selected:a,onSelect:m}),e[41]=a,e[42]=d,e[43]=t,e[44]=l,e[45]=J):J=e[45];let V;e[46]!==q||e[47]!==E||e[48]!==J?(V=s.jsxs("div",{className:"shrink-0 space-y-2 px-4 py-3",children:[q,E,J]}),e[46]=q,e[47]=E,e[48]=J,e[49]=V):V=e[49];let W;e[50]!==P||e[51]!==S||e[52]!==N||e[53]!==L||e[54]!==c||e[55]!==_?(W=P.length>0?P.map(A=>s.jsx(oo,{option:A,selected:N.has(A.id),onToggle:()=>_(A.id)},A.id)):!L&&s.jsx(el,{query:S,loadingLabel:c("sandbox.productPickerDialog.loadingProducts"),emptyLabel:c("sandbox.productPickerDialog.noProductsFound")}),e[50]=P,e[51]=S,e[52]=N,e[53]=L,e[54]=c,e[55]=_,e[56]=W):W=e[56];let te;e[57]!==d||e[58]!==L||e[59]!==c?(te=L&&s.jsx("p",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:c(d==="category"?"sandbox.productPickerDialog.pickCategoryPrompt":"sandbox.productPickerDialog.enterClusterPrompt")}),e[57]=d,e[58]=L,e[59]=c,e[60]=te):te=e[60];let ee;e[61]!==W||e[62]!==te?(ee=s.jsxs("div",{className:"min-h-0 flex-1 space-y-1 overflow-y-auto border-t border-border px-3 py-2",children:[W,te]}),e[61]=W,e[62]=te,e[63]=ee):ee=e[63];let Q;e[64]!==N.size||e[65]!==c?(Q=N.size===0?c("sandbox.productPickerDialog.noneSelected"):c("sandbox.productPickerDialog.selectedCount",{count:String(N.size)}),e[64]=N.size,e[65]=c,e[66]=Q):Q=e[66];let le;e[67]!==Q?(le=s.jsx("span",{className:"text-xs text-muted-foreground",children:Q}),e[67]=Q,e[68]=le):le=e[68];let Z;e[69]!==n?(Z=()=>n(!1),e[69]=n,e[70]=Z):Z=e[70];let X;e[71]!==c?(X=c("sandbox.productPickerDialog.done"),e[71]=c,e[72]=X):X=e[72];let F;e[73]!==Z||e[74]!==X?(F=s.jsx(rl,{size:"sm",onClick:Z,children:X}),e[73]=Z,e[74]=X,e[75]=F):F=e[75];let R;e[76]!==le||e[77]!==F?(R=s.jsxs("div",{className:"flex shrink-0 items-center justify-between border-t border-border px-4 py-3",children:[le,F]}),e[76]=le,e[77]=F,e[78]=R):R=e[78];let K;e[79]!==D||e[80]!==z||e[81]!==V||e[82]!==ee||e[83]!==R?(K=s.jsxs(es,{className:"flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[560px] sm:max-w-[560px]",children:[D,z,V,ee,R]}),e[79]=D,e[80]=z,e[81]=V,e[82]=ee,e[83]=R,e[84]=K):K=e[84];let U;return e[85]!==n||e[86]!==t||e[87]!==K?(U=s.jsx(ts,{open:t,onOpenChange:n,children:K}),e[85]=n,e[86]=t,e[87]=K,e[88]=U):U=e[88],U}const no=["normal","h1","h2","h3"],io=/^<(h[1-3])>([\s\S]*)<\/\1>$/i;function ao(u){const e=u.match(io);return e?{level:e[1].toLowerCase(),text:e[2]}:{level:"normal",text:u}}function xt(u,e){return e?u==="normal"?e:`<${u}>${e}</${u}>`:""}const gt={normal:"sandbox.productBlocks.headingNormal",h1:"sandbox.productBlocks.headingH1",h2:"sandbox.productBlocks.headingH2",h3:"sandbox.productBlocks.headingH3"},co={normal:"text-lg font-semibold",h1:"text-3xl font-bold",h2:"text-2xl font-bold",h3:"text-xl font-semibold"};function uo(u){const e=I.c(27),{value:t,onChange:n}=u,l=H();let o,r,i,f,c;e[0]!==n||e[1]!==l||e[2]!==t?({level:o,text:c}=ao(t),f="space-y-1.5",r="flex items-center gap-0.5",i=no.map(x=>s.jsx(re,{active:o===x,label:l(gt[x]),onClick:()=>n(xt(x,c)),children:l(gt[x])},x)),e[0]=n,e[1]=l,e[2]=t,e[3]=o,e[4]=r,e[5]=i,e[6]=f,e[7]=c):(o=e[3],r=e[4],i=e[5],f=e[6],c=e[7]);let d;e[8]!==r||e[9]!==i?(d=s.jsx("div",{className:r,children:i}),e[8]=r,e[9]=i,e[10]=d):d=e[10];let g;e[11]!==o||e[12]!==n?(g=x=>n(xt(o,x.target.value)),e[11]=o,e[12]=n,e[13]=g):g=e[13];let h;e[14]!==l?(h=l("sandbox.productBlocks.shelfTitlePlaceholder"),e[14]=l,e[15]=h):h=e[15];const b=co[o];let a;e[16]!==b?(a=se("w-full border-0 bg-transparent p-0 outline-none placeholder:text-muted-foreground/50 focus:ring-0",b),e[16]=b,e[17]=a):a=e[17];let m;e[18]!==g||e[19]!==h||e[20]!==a||e[21]!==c?(m=s.jsx("input",{value:c,onChange:g,placeholder:h,className:a}),e[18]=g,e[19]=h,e[20]=a,e[21]=c,e[22]=m):m=e[22];let p;return e[23]!==f||e[24]!==d||e[25]!==m?(p=s.jsxs("div",{className:f,children:[d,m]}),e[23]=f,e[24]=d,e[25]=m,e[26]=p):p=e[26],p}function sl(u){const e=I.c(4),{label:t,onClick:n}=u;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Re,{size:13}),e[0]=l):l=e[0];let o;return e[1]!==t||e[2]!==n?(o=s.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground cursor-pointer",children:[l,t]}),e[1]=t,e[2]=n,e[3]=o):o=e[3],o}function ol(u){const e=I.c(9),{option:t,loading:n,className:l,iconSize:o}=u,r=o===void 0?18:o;let i;e[0]!==l?(i=se("flex items-center justify-center overflow-hidden bg-muted text-muted-foreground",l),e[0]=l,e[1]=i):i=e[1];let f;e[2]!==r||e[3]!==n||e[4]!==t?(f=t?.image?s.jsx("img",{src:t.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-contain p-1.5"}):n?s.jsx(yt,{size:"xs"}):s.jsx(Rt,{size:r}),e[2]=r,e[3]=n,e[4]=t,e[5]=f):f=e[5];let c;return e[6]!==i||e[7]!==f?(c=s.jsx("span",{className:i,children:f}),e[6]=i,e[7]=f,e[8]=c):c=e[8],c}function fo(u){const e=I.c(50),{id:t,option:n,loading:l,onRemove:o}=u,r=H();let i;e[0]!==t?(i={id:t},e[0]=t,e[1]=i):i=e[1];const{attributes:f,listeners:c,setNodeRef:d,transform:g,transition:h,isDragging:b}=_t(i);let a;e[2]!==g?(a=Tt.Transform.toString(g),e[2]=g,e[3]=a):a=e[3];let m;e[4]!==a||e[5]!==h?(m={transform:a,transition:h},e[4]=a,e[5]=h,e[6]=m):m=e[6];const p=b&&"z-10 opacity-60";let x;e[7]!==p?(x=se("group/card relative flex flex-col overflow-hidden rounded-md border bg-background",p),e[7]=p,e[8]=x):x=e[8];let y;e[9]!==l||e[10]!==n?(y=s.jsx(ol,{option:n,loading:l,className:"h-full w-full"}),e[9]=l,e[10]=n,e[11]=y):y=e[11];let v;e[12]!==r?(v=r("sandbox.productBlocks.dragToReorderLabel"),e[12]=r,e[13]=v):v=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Et,{size:13}),e[14]=k):k=e[14];let j;e[15]!==f||e[16]!==c||e[17]!==v?(j=s.jsx("button",{type:"button","aria-label":v,...f,...c,className:"absolute left-1 top-1 flex h-6 w-6 cursor-grab items-center justify-center bg-background/80 text-muted-foreground opacity-0 backdrop-blur-sm transition-opacity hover:text-foreground active:cursor-grabbing group-hover/card:opacity-100 rounded-lg",children:k}),e[15]=f,e[16]=c,e[17]=v,e[18]=j):j=e[18];let C;e[19]!==r?(C=r("sandbox.productBlocks.removeProductLabel"),e[19]=r,e[20]=C):C=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Ql,{size:13}),e[21]=S):S=e[21];let B;e[22]!==o||e[23]!==C?(B=s.jsx("button",{type:"button","aria-label":C,onClick:o,className:"absolute right-1 top-1 flex h-6 w-6 items-center justify-center bg-background/80 text-muted-foreground opacity-0 backdrop-blur-sm transition-opacity hover:text-destructive group-hover/card:opacity-100 cursor-pointer rounded-lg",children:S}),e[22]=o,e[23]=C,e[24]=B):B=e[24];let N;e[25]!==B||e[26]!==y||e[27]!==j?(N=s.jsxs("div",{className:"relative aspect-square",children:[y,j,B]}),e[25]=B,e[26]=y,e[27]=j,e[28]=N):N=e[28];let w;e[29]!==t||e[30]!==l||e[31]!==n?.label||e[32]!==r?(w=n?.label??(l?r("sandbox.productBlocks.loadingEllipsis"):r("sandbox.productBlocks.productWithId",{id:t})),e[29]=t,e[30]=l,e[31]=n?.label,e[32]=r,e[33]=w):w=e[33];let _;e[34]!==w?(_=s.jsx("p",{className:"line-clamp-2 text-xs leading-tight text-foreground",children:w}),e[34]=w,e[35]=_):_=e[35];let T;e[36]!==t||e[37]!==r?(T=r("sandbox.productBlocks.idLabel",{id:t}),e[36]=t,e[37]=r,e[38]=T):T=e[38];let P;e[39]!==T?(P=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:T}),e[39]=T,e[40]=P):P=e[40];let L;e[41]!==_||e[42]!==P?(L=s.jsxs("div",{className:"flex flex-col gap-0.5 p-2",children:[_,P]}),e[41]=_,e[42]=P,e[43]=L):L=e[43];let $;return e[44]!==d||e[45]!==N||e[46]!==L||e[47]!==m||e[48]!==x?($=s.jsxs("div",{ref:d,style:m,className:x,children:[N,L]}),e[44]=d,e[45]=N,e[46]=L,e[47]=m,e[48]=x,e[49]=$):$=e[49],$}function mo(u){const e=I.c(21),{ids:t,lookup:n,onReorder:l,onRemove:o}=u;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={activationConstraint:{distance:6}},e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={coordinateGetter:Ct},e[1]=i):i=e[1];const f=jt($e(Nt,r),$e(kt,i));let c;e[2]!==t||e[3]!==l?(c=m=>{const{active:p,over:x}=m;if(!x||p.id===x.id)return;const y=t.indexOf(String(p.id)),v=t.indexOf(String(x.id));y===-1||v===-1||l(St(t,y,v))},e[2]=t,e[3]=l,e[4]=c):c=e[4];const d=c;let g;if(e[5]!==t||e[6]!==n||e[7]!==o){let m;e[9]!==n||e[10]!==o?(m=p=>s.jsx(fo,{id:p,option:n.byId.get(p),loading:n.isLoading&&!n.byId.get(p),onRemove:()=>o(p)},p),e[9]=n,e[10]=o,e[11]=m):m=e[11],g=t.map(m),e[5]=t,e[6]=n,e[7]=o,e[8]=g}else g=e[8];let h;e[12]!==g?(h=s.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:g}),e[12]=g,e[13]=h):h=e[13];let b;e[14]!==t||e[15]!==h?(b=s.jsx(Bt,{items:t,strategy:nl,children:h}),e[14]=t,e[15]=h,e[16]=b):b=e[16];let a;return e[17]!==d||e[18]!==f||e[19]!==b?(a=s.jsx(Pt,{sensors:f,collisionDetection:wt,onDragEnd:d,children:b}),e[17]=d,e[18]=f,e[19]=b,e[20]=a):a=e[20],a}function po(u){const e=I.c(13),{onBrowse:t}=u,n=H();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("span",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-muted text-muted-foreground",children:s.jsx(El,{size:16})}),e[0]=l):l=e[0];let o;e[1]!==n?(o=n("sandbox.productBlocks.addProductsButton"),e[1]=n,e[2]=o):o=e[2];let r;e[3]!==o?(r=s.jsx("span",{className:"text-sm font-medium text-foreground",children:o}),e[3]=o,e[4]=r):r=e[4];let i;e[5]!==n?(i=n("sandbox.productBlocks.addProductsDescription"),e[5]=n,e[6]=i):i=e[6];let f;e[7]!==i?(f=s.jsx("span",{className:"text-xs text-muted-foreground",children:i}),e[7]=i,e[8]=f):f=e[8];let c;return e[9]!==t||e[10]!==r||e[11]!==f?(c=s.jsxs("button",{type:"button",onClick:t,className:"flex w-full flex-col items-center justify-center gap-1.5 rounded-lg border border-dashed py-8 text-center transition-colors hover:border-foreground/30 hover:bg-muted/40 cursor-pointer",children:[l,r,f]}),e[9]=t,e[10]=r,e[11]=f,e[12]=c):c=e[12],c}function xo(u){const e=I.c(30),{ids:t,onChange:n}=u,l=H();let o;e[0]!==t||e[1]!==n?(o=(p,x)=>n(t.map((y,v)=>v===p?x:y)),e[0]=t,e[1]=n,e[2]=o):o=e[2];const r=o;let i;e[3]!==l?(i=l("sandbox.productBlocks.vtexProductIds"),e[3]=l,e[4]=i):i=e[4];let f;e[5]!==i?(f=s.jsx(ve,{className:"text-xs text-muted-foreground",children:i}),e[5]=i,e[6]=f):f=e[6];let c;e[7]!==t.length||e[8]!==l?(c=t.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:l("sandbox.productBlocks.startDevServerDescription")}),e[7]=t.length,e[8]=l,e[9]=c):c=e[9];let d;e[10]!==t||e[11]!==n||e[12]!==r||e[13]!==l?(d=t.map((p,x)=>s.jsxs("li",{className:"group/item flex items-center gap-3",children:[s.jsx("input",{value:p,onChange:y=>r(x,y.target.value),placeholder:l("sandbox.productBlocks.skuIdPlaceholder"),className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),s.jsx(fe,{label:l("sandbox.productBlocks.removeProductIdButton"),onClick:()=>n(t.filter((y,v)=>v!==x))})]},x)),e[10]=t,e[11]=n,e[12]=r,e[13]=l,e[14]=d):d=e[14];let g;e[15]!==d?(g=s.jsx("ul",{className:"space-y-2",children:d}),e[15]=d,e[16]=g):g=e[16];let h;e[17]!==l?(h=l("sandbox.productBlocks.addProductIdButton"),e[17]=l,e[18]=h):h=e[18];let b;e[19]!==t||e[20]!==n?(b=()=>n([...t,""]),e[19]=t,e[20]=n,e[21]=b):b=e[21];let a;e[22]!==h||e[23]!==b?(a=s.jsx(me,{label:h,onClick:b}),e[22]=h,e[23]=b,e[24]=a):a=e[24];let m;return e[25]!==f||e[26]!==c||e[27]!==g||e[28]!==a?(m=s.jsxs("div",{className:"space-y-2",children:[f,c,g,a]}),e[25]=f,e[26]=c,e[27]=g,e[28]=a,e[29]=m):m=e[29],m}function go(u){const e=I.c(32),{block:t,onChange:n,sandboxRef:l}=u,o=H();let r,i;e[0]!==t.products?(r=Xt(t.products),i=new Set(r.filter(Boolean)),e[0]=t.products,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let f;e[3]!==i?(f=[...i],e[3]=i,e[4]=f):f=e[4];const c=f,[d,g]=G.useState(!1),h=Yt(l,c);let b;e[5]!==t||e[6]!==n?(b=j=>n({...t,products:Zt(t.products,j)}),e[5]=t,e[6]=n,e[7]=b):b=e[7];const a=b;let m;e[8]!==t.title?(m=M(t.title),e[8]=t.title,e[9]=m):m=e[9];let p;e[10]!==t||e[11]!==n?(p=j=>n({...t,title:j}),e[10]=t,e[11]=n,e[12]=p):p=e[12];let x;e[13]!==m||e[14]!==p?(x=s.jsx(uo,{value:m,onChange:p}),e[13]=m,e[14]=p,e[15]=x):x=e[15];let y;e[16]!==c||e[17]!==h||e[18]!==r||e[19]!==l||e[20]!==a||e[21]!==o?(y=l?s.jsxs("div",{className:"space-y-3",children:[c.length>0&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"text-xs font-medium text-muted-foreground",children:[c.length," ",o(c.length===1?"sandbox.productBlocks.productSingular":"sandbox.productBlocks.productPlural")]}),s.jsx(sl,{label:o("sandbox.productBlocks.browseProductsButton"),onClick:()=>g(!0)})]}),c.length===0?s.jsx(po,{onBrowse:()=>g(!0)}):s.jsx(mo,{ids:c,lookup:h,onReorder:a,onRemove:j=>a(c.filter(C=>C!==j))})]}):s.jsx(xo,{ids:r,onChange:a}),e[16]=c,e[17]=h,e[18]=r,e[19]=l,e[20]=a,e[21]=o,e[22]=y):y=e[22];let v;e[23]!==c||e[24]!==d||e[25]!==l||e[26]!==a?(v=l&&s.jsx(ll,{open:d,onOpenChange:g,sandboxRef:l,selectedIds:c,onChange:a}),e[23]=c,e[24]=d,e[25]=l,e[26]=a,e[27]=v):v=e[27];let k;return e[28]!==x||e[29]!==y||e[30]!==v?(k=s.jsxs("div",{className:"space-y-4 rounded-lg border bg-card p-4",children:[x,y,v]}),e[28]=x,e[29]=y,e[30]=v,e[31]=k):k=e[31],k}function ho(u){const e=I.c(27),{id:t,option:n,loading:l,onRemove:o}=u,r=H();let i;e[0]!==l||e[1]!==n?(i=s.jsx(ol,{option:n,loading:l,className:"h-11 w-11 shrink-0 rounded",iconSize:16}),e[0]=l,e[1]=n,e[2]=i):i=e[2];let f;e[3]!==t||e[4]!==l||e[5]!==n?.label||e[6]!==r?(f=n?.label??(l?r("sandbox.productBlocks.loadingEllipsis"):r("sandbox.productBlocks.productWithId",{id:t})),e[3]=t,e[4]=l,e[5]=n?.label,e[6]=r,e[7]=f):f=e[7];let c;e[8]!==f?(c=s.jsx("p",{className:"truncate text-sm text-foreground",children:f}),e[8]=f,e[9]=c):c=e[9];let d;e[10]!==t||e[11]!==r?(d=r("sandbox.productBlocks.idLabel",{id:t}),e[10]=t,e[11]=r,e[12]=d):d=e[12];let g;e[13]!==d?(g=s.jsx("p",{className:"text-xs text-muted-foreground",children:d}),e[13]=d,e[14]=g):g=e[14];let h;e[15]!==c||e[16]!==g?(h=s.jsxs("div",{className:"min-w-0 flex-1",children:[c,g]}),e[15]=c,e[16]=g,e[17]=h):h=e[17];let b;e[18]!==r?(b=r("sandbox.productBlocks.removeProductButton"),e[18]=r,e[19]=b):b=e[19];let a;e[20]!==o||e[21]!==b?(a=s.jsx(fe,{label:b,onClick:o}),e[20]=o,e[21]=b,e[22]=a):a=e[22];let m;return e[23]!==i||e[24]!==h||e[25]!==a?(m=s.jsxs("div",{className:"group/item flex items-center gap-3 rounded-md border bg-background p-2",children:[i,h,a]}),e[23]=i,e[24]=h,e[25]=a,e[26]=m):m=e[26],m}function bo(u){const e=I.c(78),{block:t,onChange:n,sandboxRef:l}=u,o=H();let r;e[0]!==t.product?(r=Xt(t.product).filter(Boolean)[0]??"",e[0]=t.product,e[1]=r):r=e[1];const i=r,[f,c]=G.useState(!1);let d;e[2]!==i?(d=i?[i]:[],e[2]=i,e[3]=d):d=e[3];const g=Yt(l,d);let h;e[4]!==t||e[5]!==n?(h=V=>n({...t,product:Zt(t.product,V)}),e[4]=t,e[5]=n,e[6]=h):h=e[6];const b=h;let a;e[7]!==o?(a=o("sandbox.productBlocks.productCardLabel"),e[7]=o,e[8]=a):a=e[8];let m;e[9]!==a?(m=s.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:a}),e[9]=a,e[10]=m):m=e[10];let p;e[11]!==o?(p=o("sandbox.productBlocks.ctaLabelField"),e[11]=o,e[12]=p):p=e[12];let x;e[13]!==p?(x=s.jsx(ve,{htmlFor:"product-card-cta",className:"text-xs text-muted-foreground",children:p}),e[13]=p,e[14]=x):x=e[14];let y;e[15]!==t.textCta?(y=M(t.textCta),e[15]=t.textCta,e[16]=y):y=e[16];let v;e[17]!==t||e[18]!==n?(v=V=>n({...t,textCta:V.target.value}),e[17]=t,e[18]=n,e[19]=v):v=e[19];let k;e[20]!==o?(k=o("sandbox.productBlocks.ctaLabelPlaceholder"),e[20]=o,e[21]=k):k=e[21];let j;e[22]!==k||e[23]!==y||e[24]!==v?(j=s.jsx("input",{id:"product-card-cta",value:y,onChange:v,placeholder:k,className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[22]=k,e[23]=y,e[24]=v,e[25]=j):j=e[25];let C;e[26]!==j||e[27]!==x?(C=s.jsxs("div",{className:"space-y-2",children:[x,j]}),e[26]=j,e[27]=x,e[28]=C):C=e[28];let S;e[29]!==o?(S=o("sandbox.productBlocks.productSlugField"),e[29]=o,e[30]=S):S=e[30];let B;e[31]!==S?(B=s.jsx(ve,{htmlFor:"product-card-slug",className:"text-xs text-muted-foreground",children:S}),e[31]=S,e[32]=B):B=e[32];let N;e[33]!==t.productSlug?(N=M(t.productSlug),e[33]=t.productSlug,e[34]=N):N=e[34];let w;e[35]!==t||e[36]!==n?(w=V=>n({...t,productSlug:V.target.value}),e[35]=t,e[36]=n,e[37]=w):w=e[37];let _;e[38]!==o?(_=o("sandbox.productBlocks.productSlugPlaceholder"),e[38]=o,e[39]=_):_=e[39];let T;e[40]!==N||e[41]!==w||e[42]!==_?(T=s.jsx("input",{id:"product-card-slug",value:N,onChange:w,placeholder:_,className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[40]=N,e[41]=w,e[42]=_,e[43]=T):T=e[43];let P;e[44]!==B||e[45]!==T?(P=s.jsxs("div",{className:"space-y-2",children:[B,T]}),e[44]=B,e[45]=T,e[46]=P):P=e[46];let L;e[47]!==o?(L=o("sandbox.productBlocks.productField"),e[47]=o,e[48]=L):L=e[48];let $;e[49]!==L?($=s.jsx(ve,{className:"text-xs text-muted-foreground",children:L}),e[49]=L,e[50]=$):$=e[50];let D;e[51]!==i||e[52]!==l||e[53]!==o?(D=l&&i&&s.jsx(sl,{label:o("sandbox.productBlocks.changeButton"),onClick:()=>c(!0)}),e[51]=i,e[52]=l,e[53]=o,e[54]=D):D=e[54];let O;e[55]!==$||e[56]!==D?(O=s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[$,D]}),e[55]=$,e[56]=D,e[57]=O):O=e[57];let z;e[58]!==g||e[59]!==i||e[60]!==l||e[61]!==b||e[62]!==o?(z=l?i?s.jsx(ho,{id:i,option:g.byId.get(i),loading:g.isLoading,onRemove:()=>b([])}):s.jsxs("button",{type:"button",onClick:()=>c(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed py-3 text-sm text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground cursor-pointer",children:[s.jsx(Re,{size:14}),o("sandbox.productBlocks.chooseProductButton")]}):s.jsx("input",{value:i,onChange:V=>b(V.target.value?[V.target.value]:[]),placeholder:o("sandbox.productBlocks.vtexProductIdPlaceholder"),className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[58]=g,e[59]=i,e[60]=l,e[61]=b,e[62]=o,e[63]=z):z=e[63];let q;e[64]!==O||e[65]!==z?(q=s.jsxs("div",{className:"space-y-2",children:[O,z]}),e[64]=O,e[65]=z,e[66]=q):q=e[66];let E;e[67]!==f||e[68]!==i||e[69]!==l||e[70]!==b?(E=l&&s.jsx(ll,{open:f,onOpenChange:c,sandboxRef:l,selectedIds:i?[i]:[],onChange:b,multiple:!1}),e[67]=f,e[68]=i,e[69]=l,e[70]=b,e[71]=E):E=e[71];let J;return e[72]!==C||e[73]!==P||e[74]!==q||e[75]!==E||e[76]!==m?(J=s.jsxs("div",{className:"space-y-4 rounded-lg border bg-card p-4",children:[m,C,P,q,E]}),e[72]=C,e[73]=P,e[74]=q,e[75]=E,e[76]=m,e[77]=J):J=e[77],J}const yo=["[&_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_p.is-editor-empty:first-child::before]:text-muted-foreground/40","[&_p.is-editor-empty:first-child::before]:float-left","[&_p.is-editor-empty:first-child::before]:h-0","[&_p.is-editor-empty:first-child::before]:pointer-events-none"].join(" ");function ht({value:u,onChange:e,placeholder:t,className:n,menuHost:l,sources:o}){const r=G.useRef(e);r.current=e;const i=Xe({extensions:[Ze.configure({link:{HTMLAttributes:{}},heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,bulletList:!1,orderedList:!1,listItem:!1,dropcursor:!1,gapcursor:!1}),...t?[lt.configure({placeholder:t})]:[]],content:u||"",editorProps:{attributes:{class:se("focus:outline-none",Je,yo,n)},handleKeyDown:(f,c)=>c.key==="Enter"},onUpdate:({editor:f})=>r.current(Hl(f.getHTML()))});return i?s.jsxs("div",{className:"relative",children:[s.jsx(Qt,{editor:i,appendTo:l??void 0,sources:o}),s.jsx(tt,{editor:i})]}):null}const vo=2,jo=2;function ko(u){return be(u).map(M)}function No(u){return be(u).map(e=>Array.isArray(e)?e.map(M):[])}function bt(u){return Array.from({length:u},()=>"")}function Co(u,e){return e.reduce((t,n)=>Math.max(t,n.length),u.length)||1}function So(u){const e=I.c(56),{headers:t,rows:n,onChange:l,decofile:o,sandboxRef:r}=u,i=H();let f;e[0]!==o||e[1]!==r?(f={decofile:o,sandboxRef:r},e[0]=o,e[1]=r,e[2]=f):f=e[2];const c=ot(f),[d,g]=G.useState(null);let h,b,a,m,p,x,y,v,k;if(e[3]!==t||e[4]!==c||e[5]!==d||e[6]!==l||e[7]!==n||e[8]!==i){const O=ko(t),z=No(n),q=O.length===0&&z.length===0;a=q?vo:Co(O,z);const E=Array.from({length:a},(F,R)=>O[R]??"");m=q?Array.from({length:jo},()=>bt(a)):z.map(F=>Array.from({length:a},(R,K)=>F[K]??""));const J=`${m.length}x${a}`;let V;e[18]!==l?(V=(F,R)=>l({headers:JSON.stringify(F.some(Po)?F:[]),rows:JSON.stringify(R)}),e[18]=l,e[19]=V):V=e[19];const W=V,te=(F,R)=>W(E.map((K,U)=>U===F?R:K),m),ee=(F,R,K)=>W(E,m.map((U,A)=>A===F?U.map((Y,ie)=>ie===R?K:Y):U));b=()=>W(E,[...m,bt(a)]);const Q=F=>W(E,m.filter((R,K)=>K!==F));h=()=>W([...E,""],m.map(Bo));const le=F=>W(E.filter((R,K)=>K!==F),m.map(R=>R.filter((K,U)=>U!==F)));k="relative space-y-2",v="overflow-x-auto rounded-lg border",x="w-full border-collapse";let Z;e[20]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx("th",{className:"w-8 border-b"}),e[20]=Z):Z=e[20];const X=s.jsxs("tr",{className:"bg-muted/40",children:[E.map((F,R)=>s.jsxs("th",{className:"group/col relative border-b border-r p-0 last:border-r-0 text-left align-top",children:[s.jsx(ht,{value:F,onChange:K=>te(R,K),placeholder:i("sandbox.tableBlock.headerPlaceholder",{n:R+1}),className:"py-2 pl-7 pr-3 text-xs font-semibold uppercase tracking-wide [&_p]:my-0 focus:bg-background",menuHost:d,sources:c}),a>1&&s.jsx("button",{type:"button","aria-label":i("sandbox.tableBlock.removeColumn",{n:R+1}),onClick:()=>le(R),className:"absolute left-0.5 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center text-muted-foreground/50 opacity-0 transition-opacity hover:text-destructive group-hover/col:opacity-100 cursor-pointer rounded-lg",children:s.jsx(Ve,{size:12})})]},`${J}-h-${R}`)),Z]});e[21]!==X?(y=s.jsx("thead",{children:X}),e[21]=X,e[22]=y):y=e[22],p=m.map((F,R)=>s.jsxs("tr",{className:"group/item border-b last:border-b-0",children:[F.map((K,U)=>s.jsx("td",{className:"border-r p-0 last:border-r-0 align-top",children:s.jsx(ht,{value:K,onChange:A=>ee(R,U,A),placeholder:"—",className:"px-3 py-2 text-sm [&_p]:my-0 focus:bg-muted/30",menuHost:d,sources:c})},`${J}-${R}-${U}`)),s.jsx("td",{className:"w-8 text-center align-middle",children:m.length>1&&s.jsx("button",{type:"button","aria-label":i("sandbox.tableBlock.removeRow",{n:R+1}),onClick:()=>Q(R),className:"flex h-6 w-6 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:s.jsx(Ve,{size:13})})})]},`${J}-${R}`)),e[3]=t,e[4]=c,e[5]=d,e[6]=l,e[7]=n,e[8]=i,e[9]=h,e[10]=b,e[11]=a,e[12]=m,e[13]=p,e[14]=x,e[15]=y,e[16]=v,e[17]=k}else h=e[9],b=e[10],a=e[11],m=e[12],p=e[13],x=e[14],y=e[15],v=e[16],k=e[17];let j;e[23]!==a||e[24]!==m.length||e[25]!==i?(j=m.length===0&&s.jsx("tr",{children:s.jsx("td",{colSpan:a+1,className:"px-3 py-4 text-center text-xs text-muted-foreground",children:i("sandbox.tableBlock.noRowsYet")})}),e[23]=a,e[24]=m.length,e[25]=i,e[26]=j):j=e[26];let C;e[27]!==p||e[28]!==j?(C=s.jsxs("tbody",{children:[p,j]}),e[27]=p,e[28]=j,e[29]=C):C=e[29];let S;e[30]!==x||e[31]!==y||e[32]!==C?(S=s.jsxs("table",{className:x,children:[y,C]}),e[30]=x,e[31]=y,e[32]=C,e[33]=S):S=e[33];let B;e[34]!==v||e[35]!==S?(B=s.jsx("div",{className:v,children:S}),e[34]=v,e[35]=S,e[36]=B):B=e[36];let N;e[37]!==i?(N=i("sandbox.tableBlock.addRow"),e[37]=i,e[38]=N):N=e[38];let w;e[39]!==b||e[40]!==N?(w=s.jsx(me,{label:N,onClick:b}),e[39]=b,e[40]=N,e[41]=w):w=e[41];let _;e[42]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(We,{size:13}),e[42]=_):_=e[42];let T;e[43]!==i?(T=i("sandbox.tableBlock.addColumn"),e[43]=i,e[44]=T):T=e[44];let P;e[45]!==h||e[46]!==T?(P=s.jsxs("button",{type:"button",onClick:h,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 cursor-pointer",children:[_,T]}),e[45]=h,e[46]=T,e[47]=P):P=e[47];let L;e[48]!==w||e[49]!==P?(L=s.jsxs("div",{className:"flex gap-2",children:[w,P]}),e[48]=w,e[49]=P,e[50]=L):L=e[50];let $;e[51]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx("div",{ref:g,className:"absolute z-20"}),e[51]=$):$=e[51];let D;return e[52]!==B||e[53]!==L||e[54]!==k?(D=s.jsxs("div",{className:k,children:[B,L,$]}),e[52]=B,e[53]=L,e[54]=k,e[55]=D):D=e[55],D}function Bo(u){return[...u,""]}function Po(u){return u.trim()!==""}function wo(u){const e=I.c(50),{block:t,meta:n,onChange:l,decofile:o,sandbox:r,previewBaseUrl:i,onSaveReferencedBlock:f}=u,c=H();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=[],e[0]=d):d=e[0];const[g,h]=G.useState(d),b=t.__resolveType??"";let a;e[1]!==n||e[2]!==b?(a=b?Rl(b,n):null,e[1]=n,e[2]=b,e[3]=a):a=e[3];const m=a;if(!m){let P;e[4]!==b||e[5]!==c?(P=c("sandbox.blockRegistry.unknownBlockType",{type:b}),e[4]=b,e[5]=c,e[6]=P):P=e[6];let L;return e[7]!==P?(L=s.jsx("p",{className:"text-xs text-muted-foreground",children:P}),e[7]=P,e[8]=L):L=e[8],L}let p;e[9]!==n||e[10]!==b?(p=ul(b,n),e[9]=n,e[10]=b,e[11]=p):p=e[11];const x=p;let y;e[12]!==x.iconName||e[13]!==x.iconUrl||e[14]!==x.title?(y=s.jsx(qt,{iconName:x.iconName,iconUrl:x.iconUrl,alt:x.title,className:"size-7",size:14}),e[12]=x.iconName,e[13]=x.iconUrl,e[14]=x.title,e[15]=y):y=e[15];let v;e[16]!==x.title?(v=s.jsx("span",{className:"truncate text-sm font-medium",children:x.title}),e[16]=x.title,e[17]=v):v=e[17];let k;e[18]!==x.description?(k=x.description&&s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:x.description}),e[18]=x.description,e[19]=k):k=e[19];let j;e[20]!==v||e[21]!==k?(j=s.jsxs("div",{className:"flex min-w-0 flex-col",children:[v,k]}),e[20]=v,e[21]=k,e[22]=j):j=e[22];let C;e[23]!==y||e[24]!==j?(C=s.jsxs("div",{className:"flex items-center gap-2.5",children:[y,j]}),e[23]=y,e[24]=j,e[25]=C):C=e[25];let S;e[26]!==c?(S=c("sandbox.blockRegistry.breadcrumbLabel"),e[26]=c,e[27]=S):S=e[27];let B;e[28]!==c?(B=c("sandbox.blockRegistry.backToFields"),e[28]=c,e[29]=B):B=e[29];let N;e[30]!==g||e[31]!==B||e[32]!==S?(N=s.jsx(ql,{path:g,onNavigate:h,label:S,backTitle:B}),e[30]=g,e[31]=B,e[32]=S,e[33]=N):N=e[33];let w;e[34]!==l?(w=P=>l(P),e[34]=l,e[35]=w):w=e[35];let _;e[36]!==t||e[37]!==g||e[38]!==o||e[39]!==n||e[40]!==f||e[41]!==i||e[42]!==r||e[43]!==m||e[44]!==w?(_=s.jsx(ls,{schema:m,value:t,onChange:w,basePath:"",breadcrumbPath:g,onBreadcrumbChange:h,meta:n,decofile:o,sandbox:r,previewBaseUrl:i,onSaveReferencedBlock:f}),e[36]=t,e[37]=g,e[38]=o,e[39]=n,e[40]=f,e[41]=i,e[42]=r,e[43]=m,e[44]=w,e[45]=_):_=e[45];let T;return e[46]!==N||e[47]!==_||e[48]!==C?(T=s.jsxs("div",{className:"space-y-3 rounded-lg border bg-background p-3",children:[C,N,_]}),e[46]=N,e[47]=_,e[48]=C,e[49]=T):T=e[49],T}function _o(u){const e=I.c(188),{block:t,meta:n,onChange:l,decofile:o,sandboxRef:r,previewBaseUrl:i,onSaveReferencedBlock:f}=u,c=H(),d=t.__resolveType??"",g=fl(d);if(ml(d))switch(g){case"Paragraph":{let a;e[0]!==t.html?(a=M(t.html),e[0]=t.html,e[1]=a):a=e[1];let m;e[2]!==c?(m=c("sandbox.blockRegistry.writeSomethingPlaceholder"),e[2]=c,e[3]=m):m=e[3];let p;e[4]!==t||e[5]!==l?(p=y=>l({...t,html:y}),e[4]=t,e[5]=l,e[6]=p):p=e[6];let x;return e[7]!==o||e[8]!==r||e[9]!==a||e[10]!==m||e[11]!==p?(x=s.jsx(Ts,{html:a,placeholder:m,onChange:p,decofile:o,sandboxRef:r}),e[7]=o,e[8]=r,e[9]=a,e[10]=m,e[11]=p,e[12]=x):x=e[12],x}case"Heading":{let a;e[13]!==t.text?(a=M(t.text),e[13]=t.text,e[14]=a):a=e[14];let m;e[15]!==t.level?(m=M(t.level),e[15]=t.level,e[16]=m):m=e[16];let p;e[17]!==t||e[18]!==l?(p=y=>l({...t,...y}),e[17]=t,e[18]=l,e[19]=p):p=e[19];let x;return e[20]!==a||e[21]!==m||e[22]!==p?(x=s.jsx(Os,{text:a,level:m,onChange:p}),e[20]=a,e[21]=m,e[22]=p,e[23]=x):x=e[23],x}case"Quote":{let a;e[24]!==t.quote?(a=M(t.quote),e[24]=t.quote,e[25]=a):a=e[25];let m;e[26]!==t||e[27]!==l?(m=x=>l({...t,quote:x}),e[26]=t,e[27]=l,e[28]=m):m=e[28];let p;return e[29]!==a||e[30]!==m?(p=s.jsx(zs,{quote:a,onChange:m}),e[29]=a,e[30]=m,e[31]=p):p=e[31],p}case"Code":{let a;e[32]!==t.code?(a=M(t.code),e[32]=t.code,e[33]=a):a=e[33];let m;e[34]!==t.language?(m=M(t.language),e[34]=t.language,e[35]=m):m=e[35];let p;e[36]!==t||e[37]!==l?(p=y=>l({...t,...y}),e[36]=t,e[37]=l,e[38]=p):p=e[38];let x;return e[39]!==a||e[40]!==m||e[41]!==p?(x=s.jsx(Fs,{code:a,language:m,onChange:p}),e[39]=a,e[40]=m,e[41]=p,e[42]=x):x=e[42],x}case"List":{let a;e[43]!==t.items?(a=M(t.items),e[43]=t.items,e[44]=a):a=e[44];let m;e[45]!==t.style?(m=M(t.style),e[45]=t.style,e[46]=m):m=e[46];let p;e[47]!==t||e[48]!==l?(p=y=>l({...t,...y}),e[47]=t,e[48]=l,e[49]=p):p=e[49];let x;return e[50]!==o||e[51]!==r||e[52]!==a||e[53]!==m||e[54]!==p?(x=s.jsx(Us,{items:a,style:m,onChange:p,decofile:o,sandboxRef:r}),e[50]=o,e[51]=r,e[52]=a,e[53]=m,e[54]=p,e[55]=x):x=e[55],x}case"BlockImage":{let a;return e[56]!==t||e[57]!==l?(a=s.jsx(Ys,{block:t,onChange:l}),e[56]=t,e[57]=l,e[58]=a):a=e[58],a}case"Video":{let a;e[59]!==t.url?(a=M(t.url),e[59]=t.url,e[60]=a):a=e[60];let m;e[61]!==t.caption?(m=M(t.caption),e[61]=t.caption,e[62]=m):m=e[62];let p;e[63]!==t||e[64]!==l?(p=y=>l({...t,...y}),e[63]=t,e[64]=l,e[65]=p):p=e[65];let x;return e[66]!==a||e[67]!==m||e[68]!==p?(x=s.jsx(Hs,{url:a,caption:m,onChange:p}),e[66]=a,e[67]=m,e[68]=p,e[69]=x):x=e[69],x}case"Divider":{let a;return e[70]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(qs,{}),e[70]=a):a=e[70],a}case"Cta":{let a;e[71]!==t.text?(a=M(t.text),e[71]=t.text,e[72]=a):a=e[72];let m;e[73]!==t.href?(m=M(t.href),e[73]=t.href,e[74]=m):m=e[74];let p;e[75]!==t||e[76]!==l?(p=y=>l({...t,...y}),e[75]=t,e[76]=l,e[77]=p):p=e[77];let x;return e[78]!==a||e[79]!==m||e[80]!==p?(x=s.jsx(Gs,{text:a,href:m,onChange:p}),e[78]=a,e[79]=m,e[80]=p,e[81]=x):x=e[81],x}case"Callout":{let a;e[82]!==t.title?(a=M(t.title),e[82]=t.title,e[83]=a):a=e[83];let m;e[84]!==t.body?(m=M(t.body),e[84]=t.body,e[85]=m):m=e[85];let p;e[86]!==t.variant?(p=M(t.variant),e[86]=t.variant,e[87]=p):p=e[87];let x;e[88]!==t||e[89]!==l?(x=v=>l({...t,...v}),e[88]=t,e[89]=l,e[90]=x):x=e[90];let y;return e[91]!==a||e[92]!==m||e[93]!==p||e[94]!==x?(y=s.jsx(Ks,{title:a,body:m,variant:p,onChange:x}),e[91]=a,e[92]=m,e[93]=p,e[94]=x,e[95]=y):y=e[95],y}case"Stat":{let a;e[96]!==t.value?(a=M(t.value),e[96]=t.value,e[97]=a):a=e[97];let m;e[98]!==t.label?(m=M(t.label),e[98]=t.label,e[99]=m):m=e[99];let p;e[100]!==t.description?(p=M(t.description),e[100]=t.description,e[101]=p):p=e[101];let x;e[102]!==t||e[103]!==l?(x=v=>l({...t,...v}),e[102]=t,e[103]=l,e[104]=x):x=e[104];let y;return e[105]!==a||e[106]!==m||e[107]!==p||e[108]!==x?(y=s.jsx(Vs,{value:a,label:m,description:p,onChange:x}),e[105]=a,e[106]=m,e[107]=p,e[108]=x,e[109]=y):y=e[109],y}case"StatGroup":{let a;e[110]!==t.stats?(a=ue(t.stats),e[110]=t.stats,e[111]=a):a=e[111];let m;e[112]!==t||e[113]!==l?(m=x=>l({...t,stats:x}),e[112]=t,e[113]=l,e[114]=m):m=e[114];let p;return e[115]!==a||e[116]!==m?(p=s.jsx(Qs,{stats:a,onChange:m}),e[115]=a,e[116]=m,e[117]=p):p=e[117],p}case"CardGroup":{let a;e[118]!==t.cards?(a=ue(t.cards),e[118]=t.cards,e[119]=a):a=e[119];let m;e[120]!==t||e[121]!==l?(m=x=>l({...t,cards:x}),e[120]=t,e[121]=l,e[122]=m):m=e[122];let p;return e[123]!==a||e[124]!==m?(p=s.jsx(Js,{cards:a,onChange:m}),e[123]=a,e[124]=m,e[125]=p):p=e[125],p}case"Checklist":{let a;e[126]!==t.title?(a=M(t.title),e[126]=t.title,e[127]=a):a=e[127];let m;e[128]!==t.items?(m=ue(t.items),e[128]=t.items,e[129]=m):m=e[129];let p;e[130]!==t||e[131]!==l?(p=y=>l({...t,...y}),e[130]=t,e[131]=l,e[132]=p):p=e[132];let x;return e[133]!==a||e[134]!==m||e[135]!==p?(x=s.jsx(Ws,{title:a,items:m,onChange:p}),e[133]=a,e[134]=m,e[135]=p,e[136]=x):x=e[136],x}case"Steps":{let a;e[137]!==t.title?(a=M(t.title),e[137]=t.title,e[138]=a):a=e[138];let m;e[139]!==t.steps?(m=ue(t.steps),e[139]=t.steps,e[140]=m):m=e[140];let p;e[141]!==t||e[142]!==l?(p=y=>l({...t,...y}),e[141]=t,e[142]=l,e[143]=p):p=e[143];let x;return e[144]!==a||e[145]!==m||e[146]!==p?(x=s.jsx(Xs,{title:a,steps:m,onChange:p}),e[144]=a,e[145]=m,e[146]=p,e[147]=x):x=e[147],x}case"Comparison":{let a;e[148]!==t.left?(a=ue(t.left,{}),e[148]=t.left,e[149]=a):a=e[149];let m;e[150]!==t.right?(m=ue(t.right,{}),e[150]=t.right,e[151]=m):m=e[151];let p;e[152]!==t||e[153]!==l?(p=y=>l({...t,...y}),e[152]=t,e[153]=l,e[154]=p):p=e[154];let x;return e[155]!==a||e[156]!==m||e[157]!==p?(x=s.jsx(Zs,{left:a,right:m,onChange:p}),e[155]=a,e[156]=m,e[157]=p,e[158]=x):x=e[158],x}case"Table":{let a;e[159]!==t.headers?(a=ue(t.headers),e[159]=t.headers,e[160]=a):a=e[160];let m;e[161]!==t.rows?(m=ue(t.rows),e[161]=t.rows,e[162]=m):m=e[162];let p;e[163]!==t||e[164]!==l?(p=y=>l({...t,...y}),e[163]=t,e[164]=l,e[165]=p):p=e[165];let x;return e[166]!==o||e[167]!==r||e[168]!==a||e[169]!==m||e[170]!==p?(x=s.jsx(So,{headers:a,rows:m,onChange:p,decofile:o,sandboxRef:r}),e[166]=o,e[167]=r,e[168]=a,e[169]=m,e[170]=p,e[171]=x):x=e[171],x}case"ProductCard":{let a;return e[172]!==t||e[173]!==l||e[174]!==r?(a=s.jsx(bo,{block:t,onChange:l,sandboxRef:r}),e[172]=t,e[173]=l,e[174]=r,e[175]=a):a=e[175],a}case"ProductShelf":{let a;return e[176]!==t||e[177]!==l||e[178]!==r?(a=s.jsx(go,{block:t,onChange:l,sandboxRef:r}),e[176]=t,e[177]=l,e[178]=r,e[179]=a):a=e[179],a}}let b;return e[180]!==t||e[181]!==o||e[182]!==n||e[183]!==l||e[184]!==f||e[185]!==i||e[186]!==r?(b=s.jsx(wo,{block:t,meta:n,onChange:l,decofile:o,sandbox:r,previewBaseUrl:i,onSaveReferencedBlock:f}),e[180]=t,e[181]=o,e[182]=n,e[183]=l,e[184]=f,e[185]=i,e[186]=r,e[187]=b):b=e[187],b}function To(u){const e=I.c(46),{id:t,block:n,meta:l,onChange:o,onDelete:r,onDuplicate:i,decofile:f,sandboxRef:c,previewBaseUrl:d,onSaveReferencedBlock:g}=u,h=H();let b;e[0]!==t?(b={id:t},e[0]=t,e[1]=b):b=e[1];const{attributes:a,listeners:m,setNodeRef:p,transform:x,transition:y,isDragging:v}=_t(b);let k;e[2]!==x?(k=Tt.Transform.toString(x),e[2]=x,e[3]=k):k=e[3];let j;e[4]!==k||e[5]!==y?(j={transform:k,transition:y},e[4]=k,e[5]=y,e[6]=j):j=e[6];const C=v&&"opacity-50";let S;e[7]!==C?(S=se("group/row relative rounded-md py-1.5 pl-12 pr-2 transition-colors hover:bg-muted/40",C),e[7]=C,e[8]=S):S=e[8];let B;e[9]!==h?(B=h("sandbox.blockRow.dragToReorder"),e[9]=h,e[10]=B):B=e[10];let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Et,{size:14}),e[11]=N):N=e[11];let w;e[12]!==a||e[13]!==m||e[14]!==B?(w=s.jsx("button",{type:"button","aria-label":B,className:"absolute left-1 top-1.5 flex h-6 w-6 cursor-grab items-center justify-center text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-foreground active:cursor-grabbing group-hover/row:opacity-100 rounded-lg",...a,...m,children:N}),e[12]=a,e[13]=m,e[14]=B,e[15]=w):w=e[15];let _;e[16]!==h?(_=h("sandbox.blockRow.duplicateBlock"),e[16]=h,e[17]=_):_=e[17];let T;e[18]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx($l,{size:14}),e[18]=T):T=e[18];let P;e[19]!==i||e[20]!==_?(P=s.jsx("button",{type:"button","aria-label":_,onClick:i,className:"flex h-6 w-6 items-center justify-center text-muted-foreground hover:bg-muted hover:text-foreground cursor-pointer rounded-lg",children:T}),e[19]=i,e[20]=_,e[21]=P):P=e[21];let L;e[22]!==h?(L=h("sandbox.blockRow.deleteBlock"),e[22]=h,e[23]=L):L=e[23];let $;e[24]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(Ve,{size:14}),e[24]=$):$=e[24];let D;e[25]!==r||e[26]!==L?(D=s.jsx("button",{type:"button","aria-label":L,onClick:r,className:"flex h-6 w-6 items-center justify-center text-muted-foreground hover:bg-muted hover:text-destructive cursor-pointer rounded-lg",children:$}),e[25]=r,e[26]=L,e[27]=D):D=e[27];let O;e[28]!==P||e[29]!==D?(O=s.jsxs("div",{className:"absolute right-1 top-1 z-10 flex flex-row gap-0.5 rounded-md bg-background/80 opacity-0 backdrop-blur-sm transition-opacity group-hover/row:opacity-100",children:[P,D]}),e[28]=P,e[29]=D,e[30]=O):O=e[30];let z;e[31]!==n||e[32]!==f||e[33]!==l||e[34]!==o||e[35]!==g||e[36]!==d||e[37]!==c?(z=s.jsx(_o,{block:n,meta:l,onChange:o,decofile:f,sandboxRef:c,previewBaseUrl:d,onSaveReferencedBlock:g}),e[31]=n,e[32]=f,e[33]=l,e[34]=o,e[35]=g,e[36]=d,e[37]=c,e[38]=z):z=e[38];let q;return e[39]!==p||e[40]!==O||e[41]!==z||e[42]!==j||e[43]!==S||e[44]!==w?(q=s.jsxs("div",{ref:p,style:j,className:S,children:[w,O,z]}),e[39]=p,e[40]=O,e[41]=z,e[42]=j,e[43]=S,e[44]=w,e[45]=q):q=e[45],q}function Ie(){return crypto.randomUUID()}function $o(u){return u.map(e=>({id:Ie(),block:e}))}function Lo(u,e){return e.map((t,n)=>{const l=u[n];return{id:l?l.id:Ie(),block:t}})}function ur(u){return Array.isArray(u)?u:[]}function Io(u){const e=I.c(10),{blockTypes:t,onInsert:n}=u,l=H();let o;e[0]!==l?(o=l("sandbox.blockPicker.insertBlockButton"),e[0]=l,e[1]=o):o=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("span",{className:"absolute inset-x-10 top-1/2 h-px -translate-y-1/2 bg-primary/30"}),e[2]=r):r=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"relative z-10 flex h-5 w-5 items-center justify-center rounded-lg border bg-background text-muted-foreground",children:s.jsx(We,{size:12})}),e[3]=i):i=e[3];let f;e[4]!==o?(f=s.jsxs("button",{type:"button","aria-label":o,className:"group/ins relative flex h-2.5 w-full items-center justify-center opacity-0 transition-opacity hover:opacity-100 cursor-pointer",children:[r,i]}),e[4]=o,e[5]=f):f=e[5];let c;return e[6]!==t||e[7]!==n||e[8]!==f?(c=s.jsx(Gt,{blockTypes:t,onInsert:n,align:"center",children:f}),e[6]=t,e[7]=n,e[8]=f,e[9]=c):c=e[9],c}function fr(u){const e=I.c(77),{value:t,onChange:n,meta:l,decofile:o,sandboxRef:r,previewBaseUrl:i,onSaveReferencedBlock:f,emptyMessage:c}=u,d=c===void 0?"No content yet. Add your first block below.":c,g=H(),h=pl();let b;e[0]!==h||e[1]!==l?(b=xl(l,{hideDefaults:h}),e[0]=h,e[1]=l,e[2]=b):b=e[2];const a=b;let m;e[3]!==t?(m=()=>$o(t),e[3]=t,e[4]=m):m=e[4];const[p,x]=G.useState(m),[y,v]=G.useState(t);t!==y&&(v(t),x(Lo(p,t)));let k;e[5]!==p?(k=p.map(Ro),e[5]=p,e[6]=k):k=e[6];const j=k;let C;e[7]!==p?(C=p.map(Ao),e[7]=p,e[8]=C):C=e[8];const S=C;let B;e[9]!==n?(B=U=>{x(U);const A=U.map(Eo);v(A),n(A)},e[9]=n,e[10]=B):B=e[10];const N=B;let w;e[11]!==p||e[12]!==N?(w=(U,A)=>{const Y=[...p];Y.splice(U,0,{id:Ie(),block:{__resolveType:A}}),N(Y)},e[11]=p,e[12]=N,e[13]=w):w=e[13];const _=w;let T;e[14]!==p||e[15]!==N?(T=(U,A)=>{N(p.map((Y,ie)=>ie===U?{...Y,block:A}:Y))},e[14]=p,e[15]=N,e[16]=T):T=e[16];const P=T;let L;e[17]!==p||e[18]!==N?(L=U=>{N(p.filter((A,Y)=>Y!==U))},e[17]=p,e[18]=N,e[19]=L):L=e[19];const $=L;let D;e[20]!==p||e[21]!==N?(D=U=>{const A=p[U];if(!A)return;const Y=[...p];Y.splice(U+1,0,{id:Ie(),block:structuredClone(A.block)}),N(Y)},e[20]=p,e[21]=N,e[22]=D):D=e[22];const O=D;let z;e[23]===Symbol.for("react.memo_cache_sentinel")?(z={activationConstraint:{distance:6}},e[23]=z):z=e[23];let q;e[24]===Symbol.for("react.memo_cache_sentinel")?(q={coordinateGetter:Ct},e[24]=q):q=e[24];const E=jt($e(Nt,z),$e(kt,q));let J;e[25]!==p||e[26]!==N?(J=U=>{const{active:A,over:Y}=U;if(!Y||A.id===Y.id)return;const ie=p.findIndex(ne=>ne.id===String(A.id)),ce=p.findIndex(ne=>ne.id===String(Y.id));ie===-1||ce===-1||N(St(p,ie,ce))},e[25]=p,e[26]=N,e[27]=J):J=e[27];const V=J;let W;if(e[28]!==p||e[29]!==a||e[30]!==o||e[31]!==O||e[32]!==_||e[33]!==l||e[34]!==f||e[35]!==i||e[36]!==$||e[37]!==r||e[38]!==P){let U;e[40]!==a||e[41]!==o||e[42]!==O||e[43]!==_||e[44]!==l||e[45]!==f||e[46]!==i||e[47]!==$||e[48]!==r||e[49]!==P?(U=(A,Y)=>{const{id:ie,block:ce}=A;return s.jsxs("div",{children:[s.jsx(Io,{blockTypes:a,onInsert:ne=>_(Y,ne)}),s.jsx(To,{id:ie,block:ce,meta:l,onChange:ne=>P(Y,ne),onDelete:()=>$(Y),onDuplicate:()=>O(Y),decofile:o,sandboxRef:r,previewBaseUrl:i,onSaveReferencedBlock:f})]},ie)},e[40]=a,e[41]=o,e[42]=O,e[43]=_,e[44]=l,e[45]=f,e[46]=i,e[47]=$,e[48]=r,e[49]=P,e[50]=U):U=e[50],W=p.map(U),e[28]=p,e[29]=a,e[30]=o,e[31]=O,e[32]=_,e[33]=l,e[34]=f,e[35]=i,e[36]=$,e[37]=r,e[38]=P,e[39]=W}else W=e[39];let te;e[51]!==j||e[52]!==W?(te=s.jsx(Bt,{items:j,strategy:il,children:W}),e[51]=j,e[52]=W,e[53]=te):te=e[53];let ee;e[54]!==V||e[55]!==E||e[56]!==te?(ee=s.jsx(Pt,{sensors:E,collisionDetection:wt,onDragEnd:V,children:te}),e[54]=V,e[55]=E,e[56]=te,e[57]=ee):ee=e[57];let Q;e[58]!==S.length||e[59]!==d?(Q=S.length===0&&s.jsx("p",{className:"px-3 pb-1 pt-2 text-sm text-muted-foreground",children:d}),e[58]=S.length,e[59]=d,e[60]=Q):Q=e[60];let le;e[61]!==p.length||e[62]!==_?(le=U=>_(p.length,U),e[61]=p.length,e[62]=_,e[63]=le):le=e[63];let Z;e[64]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx(We,{size:16}),e[64]=Z):Z=e[64];let X;e[65]!==g?(X=g("sandbox.blockDocument.addBlock"),e[65]=g,e[66]=X):X=e[66];let F;e[67]!==X?(F=s.jsxs("button",{type:"button",className:"mt-1 flex w-full items-center gap-2 rounded-md py-2 pl-14 pr-2 text-sm text-muted-foreground transition-colors hover:bg-muted/40 hover:text-foreground cursor-pointer",children:[Z,X]}),e[67]=X,e[68]=F):F=e[68];let R;e[69]!==a||e[70]!==le||e[71]!==F?(R=s.jsx(Gt,{blockTypes:a,onInsert:le,children:F}),e[69]=a,e[70]=le,e[71]=F,e[72]=R):R=e[72];let K;return e[73]!==ee||e[74]!==Q||e[75]!==R?(K=s.jsxs("div",{className:"mt-2",children:[ee,Q,R]}),e[73]=ee,e[74]=Q,e[75]=R,e[76]=K):K=e[76],K}function Eo(u){return u.block}function Ao(u){return u.block}function Ro(u){return u.id}export{fr as B,rs as R,Ut as a,dr as b,ur as c,cr as d,Ft as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as y,r as k,j as f}from"./index-
|
|
1
|
+
import{c as y,r as k,j as f}from"./index-BTRkPuaE.js";const P={target:null,editSeoPageKey:null,variantOverride:null,focusedBlockKey:null};function m(t,e){switch(e.type){case"select":return{...t,target:e.target,variantOverride:null,editSeoPageKey:null,focusedBlockKey:null};case"edit-seo":return{...t,target:e.target,editSeoPageKey:e.target.key,variantOverride:null,focusedBlockKey:null};case"consume-edit-seo":return{...t,editSeoPageKey:null};case"variant-override":return{...t,variantOverride:e.params};case"focus-block":return{...t,focusedBlockKey:e.key}}}const p=k.createContext(null);function B(t){const e=y.c(10),{children:d}=t,[v,o]=k.useReducer(m,P);let c,l,i,n,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=r=>o({type:"select",target:r}),l=r=>o({type:"edit-seo",target:r}),i=()=>o({type:"consume-edit-seo"}),n=r=>o({type:"variant-override",params:r}),u=r=>o({type:"focus-block",key:r}),e[0]=c,e[1]=l,e[2]=i,e[3]=n,e[4]=u):(c=e[0],l=e[1],i=e[2],n=e[3],u=e[4]);let s;e[5]!==v?(s={state:v,selectTarget:c,editSeo:l,consumeEditSeo:i,setVariantOverride:n,setFocusedBlock:u},e[5]=v,e[6]=s):s=e[6];let a;return e[7]!==d||e[8]!==s?(a=f.jsx(p,{value:s,children:d}),e[7]=d,e[8]=s,e[9]=a):a=e[9],a}function K(){const t=k.use(p);if(!t)throw new Error("useBlocksPreviewWorkspace must be used inside BlocksPreviewWorkspaceProvider");return t}export{B,K as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as O,j as i,r as _,l as R,b as T}from"./index-
|
|
1
|
+
import{c as O,j as i,r as _,l as R,b as T}from"./index-BTRkPuaE.js";import{_ as v}from"./agent-icon-BJAncODg.js";import{aD as P,x as K,aC as D,aE as W}from"./runnable-block-editor-BaDSgAAv.js";import{t as y}from"./ChevronUp-riNbaljB.js";import{C as I,a as Y,b as w}from"./collapsible-DIaN6Srf.js";import{C as B,W as L}from"./agent-site-editor-content-CStkXfya.js";function $(l){const e=O.c(2);let t;return e[0]!==l?(t=i.jsx(P,{children:i.jsx(K,{...l})}),e[0]=l,e[1]=t):t=e[1],t}function A(l){const e=O.c(18),{icon:t,title:o,defaultOpen:c,children:d}=l,E=c===void 0?!1:c,[f,j]=_.useState(E);let m;e[0]!==t?(m=i.jsx(t,{size:15}),e[0]=t,e[1]=m):m=e[1];let s;e[2]!==o?(s=i.jsx("span",{className:"flex-1 text-left",children:o}),e[2]=o,e[3]=s):s=e[3];const b=f&&"rotate-180";let n;e[4]!==b?(n=R("transition-transform",b),e[4]=b,e[5]=n):n=e[5];let p;e[6]!==n?(p=i.jsx(y,{size:15,className:n}),e[6]=n,e[7]=p):p=e[7];let r;e[8]!==m||e[9]!==s||e[10]!==p?(r=i.jsx(I,{asChild:!0,children:i.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[m,s,p]})}),e[8]=m,e[9]=s,e[10]=p,e[11]=r):r=e[11];let a;e[12]!==d?(a=i.jsx(Y,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=a):a=e[13];let u;return e[14]!==f||e[15]!==r||e[16]!==a?(u=i.jsxs(w,{open:f,onOpenChange:j,className:"mt-4",children:[r,a]}),e[14]=f,e[15]=r,e[16]=a,e[17]=u):u=e[17],u}function Z(l){const e=O.c(32),{schema:t,value:o,onChange:c,basePath:d,meta:E,decofile:f,sandbox:j,onSaveReferencedBlock:m}=l,s=T();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=[],e[0]=b):b=e[0];const[n,p]=_.useState(b);if(!t)return null;let r;e[1]!==s?(r=s("sandbox.blogCustomFields.title"),e[1]=s,e[2]=r):r=e[2];let a;e[3]!==s?(a=s("sandbox.blogCustomFields.description"),e[3]=s,e[4]=a):a=e[4];let u;e[5]!==a?(u=i.jsx("p",{className:"mb-4 text-xs text-muted-foreground",children:a}),e[5]=a,e[6]=u):u=e[6];let x;e[7]!==s?(x=s("sandbox.blogCustomFields.breadcrumbLabel"),e[7]=s,e[8]=x):x=e[8];let h;e[9]!==s?(h=s("sandbox.blogCustomFields.backToFields"),e[9]=s,e[10]=h):h=e[10];let g;e[11]!==n||e[12]!==x||e[13]!==h?(g=i.jsx(D,{path:n,onNavigate:p,label:x,backTitle:h}),e[11]=n,e[12]=x,e[13]=h,e[14]=g):g=e[14];let S;e[15]!==c?(S=F=>c(F),e[15]=c,e[16]=S):S=e[16];let C;e[17]!==d||e[18]!==n||e[19]!==f||e[20]!==E||e[21]!==m||e[22]!==j||e[23]!==t||e[24]!==S||e[25]!==o?(C=i.jsx($,{schema:t,value:o,onChange:S,basePath:d,breadcrumbPath:n,onBreadcrumbChange:p,meta:E,decofile:f,sandbox:j,onSaveReferencedBlock:m}),e[17]=d,e[18]=n,e[19]=f,e[20]=E,e[21]=m,e[22]=j,e[23]=t,e[24]=S,e[25]=o,e[26]=C):C=e[26];let N;return e[27]!==r||e[28]!==u||e[29]!==g||e[30]!==C?(N=i.jsxs(A,{icon:v,title:r,children:[u,g,C]}),e[27]=r,e[28]=u,e[29]=g,e[30]=C,e[31]=N):N=e[31],N}function k(l,e){if(!e)return null;const o=W(B[l],e)?.properties?.[L[l]];if(!o)return null;const c=o.properties?o:o.plainSchema;return c?.properties?c:null}const z=new Set(["__resolveType","@type"]);function G(l,e){const t=l?.properties;if(!t)return null;const o=Object.fromEntries(Object.entries(t).filter(([c,d])=>!e.has(c)&&!z.has(c)&&d.hidden!==!0));return Object.keys(o).length===0?null:{type:"object",properties:o}}function ee(l,e,t){return G(k(l,e),t)}const V=["title","slug","excerpt","date","readTime","image","mobileImage","alt","authors","categories","sections","seo","extraProps","scheduledDatetime","status","dateModified","planning","content"],te=new Set(V),M=["name","slug","parentSlug","description","sections"],se=new Set(M);export{Z as C,te as K,$ as S,A as a,ee as b,se as c};
|