decocms 4.388.3 → 4.388.4
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-DjWk5lbs.js → AlertCircle-Cat-Fy2i.js} +1 -1
- package/dist/client/assets/{AreaChart-DpbK-wPl.js → AreaChart-CSNer7sZ.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BT08o34-.js → ArrowLeft-DuxVUo5_.js} +1 -1
- package/dist/client/assets/{ArrowRight-BfJbR6tM.js → ArrowRight-CsoDgnUj.js} +1 -1
- package/dist/client/assets/{ArrowUp-B3lDfWjg.js → ArrowUp-CbPBDOpZ.js} +1 -1
- package/dist/client/assets/{CartesianChart-BQMugGo5.js → CartesianChart-DgQehil3.js} +1 -1
- package/dist/client/assets/{Check-DKfnzvYg.js → Check-BZXRTDaX.js} +1 -1
- package/dist/client/assets/{CheckCircle-3RJgfxT7.js → CheckCircle-Cj4PQGuv.js} +1 -1
- package/dist/client/assets/{ChevronUp-BZvvG7x0.js → ChevronUp-DGt31MPD.js} +1 -1
- package/dist/client/assets/{Copy01-C_MmEjzi.js → Copy01-B6hr4CBg.js} +1 -1
- package/dist/client/assets/{CreditCard01-DAGYoN-c.js → CreditCard01-CiYLi_pR.js} +1 -1
- package/dist/client/assets/{DotsVertical-BgwcBSVD.js → DotsVertical-BITRq5d-.js} +1 -1
- package/dist/client/assets/{Download01-CBORkxWP.js → Download01-CsYfHghd.js} +1 -1
- package/dist/client/assets/{ErrorBarContext--g6qb8qB.js → ErrorBarContext-zVAOL4kJ.js} +1 -1
- package/dist/client/assets/{Eye-DOU8s9t-.js → Eye-rQUtSbk6.js} +1 -1
- package/dist/client/assets/{Globe04-DtAkyZND.js → Globe04-C_9DD9oO.js} +1 -1
- package/dist/client/assets/{Image01-D8OZG2z7.js → Image01-BLIf6uY9.js} +1 -1
- package/dist/client/assets/{Key01-CbayyTsA.js → Key01-SGIR_QrT.js} +1 -1
- package/dist/client/assets/{LayoutLeft-Caz0Lt_Y.js → LayoutLeft-GBQ0rQxQ.js} +1 -1
- package/dist/client/assets/{Line-BvslwIMS.js → Line-y7nkMb-C.js} +1 -1
- package/dist/client/assets/{Link01-BInc9e0T.js → Link01-BnVQGp2l.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BEY89FPH.js → LinkExternal01-Dh0AABP8.js} +1 -1
- package/dist/client/assets/{Monitor01-CQXT1fTU.js → Monitor01-CxisI5ut.js} +1 -1
- package/dist/client/assets/{Package-DfxUvxv4.js → Package-DsU1cU6S.js} +1 -1
- package/dist/client/assets/{Palette-B943lckv.js → Palette-CzoNEzRs.js} +1 -1
- package/dist/client/assets/{Plus-CEeYNHhw.js → Plus-qASEo4cN.js} +1 -1
- package/dist/client/assets/{SearchLg-1oLqmGgV.js → SearchLg-qmi8uaeX.js} +1 -1
- package/dist/client/assets/{SearchMd-C0AUVD_8.js → SearchMd-B6NDUgzQ.js} +1 -1
- package/dist/client/assets/{Sector-BJlGRa2A.js → Sector-DK9KwpRN.js} +1 -1
- package/dist/client/assets/{Share07-1ycVIkNv.js → Share07-CMPYQYHk.js} +1 -1
- package/dist/client/assets/{Stars01-BR2xAOfq.js → Stars01-cdnol_cb.js} +1 -1
- package/dist/client/assets/{Sun-BeiND7FE.js → Sun-BSFyLDhg.js} +1 -1
- package/dist/client/assets/{Tool01-F59vZFeb.js → Tool01-H9OcfGdq.js} +1 -1
- package/dist/client/assets/{Trash01-C5U24gHX.js → Trash01-mB4s-hrv.js} +1 -1
- package/dist/client/assets/{Upload01-oHOVZjKN.js → Upload01-Uv_jtHIk.js} +1 -1
- package/dist/client/assets/{User01-DXO6uMW8.js → User01-DHGCVvV3.js} +1 -1
- package/dist/client/assets/{UserSquare-CQ18lqIQ.js → UserSquare-BfT6tB5U.js} +1 -1
- package/dist/client/assets/{Users01-BcBkqFnI.js → Users01-C_qUmfZB.js} +1 -1
- package/dist/client/assets/{X-BElaUA97.js → X-vKTIsgL1.js} +1 -1
- package/dist/client/assets/{XCircle-CfrU4xOL.js → XCircle-Cu2Sy8Aw.js} +1 -1
- package/dist/client/assets/{XClose-DyyZff74.js → XClose-DFUqDOc8.js} +1 -1
- package/dist/client/assets/{Zap-D4-tVqB8.js → Zap-CSRFlEXK.js} +1 -1
- package/dist/client/assets/{ZoomOut-BZEJ1m0_.js → ZoomOut-Burao8Eg.js} +1 -1
- package/dist/client/assets/{access-gate-DSTPxGFF.js → access-gate-Bbnx_Qh-.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-Ck-3imzw.js → add-connection-dialog-DzNaYAxM.js} +1 -1
- package/dist/client/assets/{agent-analytics-BZ1AFwq3.js → agent-analytics-C0sV-7Xb.js} +1 -1
- package/dist/client/assets/agent-app-D8aCkILQ.js +1 -0
- package/dist/client/assets/{agent-assets-Du2G3M9w.js → agent-assets-OnbttXnX.js} +1 -1
- package/dist/client/assets/{agent-automation-DI7AKCew.js → agent-automation-BSmqRx9Q.js} +1 -1
- package/dist/client/assets/{agent-automations-B_ahcZN7.js → agent-automations-D7yiwZb3.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-DT3BDdke.js → agent-connect-sources-CTElBaoM.js} +1 -1
- package/dist/client/assets/agent-deck-JfSkYOo0.js +1 -0
- package/dist/client/assets/{agent-e2e-CPSog-ML.js → agent-e2e-36-yunOr.js} +1 -1
- package/dist/client/assets/{agent-experiments-CHWvVcTG.js → agent-experiments-B5DGYFrd.js} +1 -1
- package/dist/client/assets/agent-file-BQkNRXR6.js +1 -0
- package/dist/client/assets/{agent-git-CwO7pSmZ.js → agent-git-BYVAaPsW.js} +1 -1
- package/dist/client/assets/{agent-hosting-BeGSndfb.js → agent-hosting-BbmS530x.js} +1 -1
- package/dist/client/assets/{agent-icon-DhLfIe3O.js → agent-icon-CzsnrYjD.js} +1 -1
- package/dist/client/assets/agent-library-file-B_9ZfsqS.js +1 -0
- package/dist/client/assets/{agent-monitor-mregZ7WZ.js → agent-monitor-C27DYrEB.js} +1 -1
- package/dist/client/assets/{agent-overview-cju0FQVn.js → agent-overview-DsQze4i5.js} +1 -1
- package/dist/client/assets/agent-settings-Dlb-w-aW.js +1 -0
- package/dist/client/assets/{agent-site-editor-qthNNfCU.js → agent-site-editor-BNuBiz19.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-Cg74frt9.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-CbksEhjq.js → agent-site-editor-content-BMF_TO-O.js} +2 -2
- package/dist/client/assets/{agent-site-editor-preview-1Jm3ZRzY.js → agent-site-editor-preview-DfUEy_mW.js} +3 -3
- package/dist/client/assets/agent-view-9ku1NYkG.js +1 -0
- package/dist/client/assets/{agent-view-guard-C1oAPIJ2.js → agent-view-guard-C4pdkmKc.js} +1 -1
- package/dist/client/assets/{agents-list-D4pkgu23.js → agents-list-B3F1REj8.js} +1 -1
- package/dist/client/assets/{ai-providers-DFUH7wUK.js → ai-providers-BYHAVCy5.js} +1 -1
- package/dist/client/assets/{alert-BGb3bVfC.js → alert-DsW1KUvt.js} +1 -1
- package/dist/client/assets/{alert-dialog-BaFKqeCg.js → alert-dialog-Dg6YJ6PP.js} +1 -1
- package/dist/client/assets/api-keys-CB0BbOJK.js +1 -0
- package/dist/client/assets/{api-keys-CwDqNl3-.js → api-keys-DDd9VBHu.js} +1 -1
- package/dist/client/assets/app-editor-6ntO4YLY.js +1 -0
- package/dist/client/assets/{asset-utils-DKWH6cxB.js → asset-utils-DOWh4JzZ.js} +1 -1
- package/dist/client/assets/{auth-CgJrRvsM.js → auth-D3Q2r2cz.js} +1 -1
- package/dist/client/assets/{auth-catchall-CBrT5FQc.js → auth-catchall-M53zUwPP.js} +1 -1
- package/dist/client/assets/{auth-entry-Cjz2jd3K.js → auth-entry-CQhZUGUz.js} +1 -1
- package/dist/client/assets/{auth-split-layout-PeqmFq8y.js → auth-split-layout-Cp7zhn_p.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-B0m3dG4a.js → authenticate-and-persist-oauth-DG9xWGRs.js} +1 -1
- package/dist/client/assets/{automation-list-row-4KsYbqo_.js → automation-list-row-DuetYP8A.js} +1 -1
- package/dist/client/assets/{automation-runs-C3tBkM33.js → automation-runs-DrVjV_Uv.js} +1 -1
- package/dist/client/assets/{automations-1pX2YzVI.js → automations-CflFKE1S.js} +1 -1
- package/dist/client/assets/{autosend-BJwVkEjG.js → autosend-C5knIVwo.js} +1 -1
- package/dist/client/assets/{avatar-BcMS36hr.js → avatar-CLf3yQhN.js} +1 -1
- package/dist/client/assets/{badge-DXhj8jyN.js → badge-DuB4cqrw.js} +1 -1
- package/dist/client/assets/{block-document-BYv7Uhpb.js → block-document-DZ3zGn-U.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-Do53Y7oN.js → blocks-preview-workspace-context-CGrONP0s.js} +1 -1
- package/dist/client/assets/{breadcrumb-FPO9c1iO.js → breadcrumb-SXbKtw7u.js} +1 -1
- package/dist/client/assets/{buckets-BM78VnWb.js → buckets-D7jxbA8X.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-DoeGzwSR.js → build-improve-prompt-doc-DKo7W0US.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-C7tJold5.js → bulk-category-panel-CS9EslBN.js} +1 -1
- package/dist/client/assets/{calendar-ffSf2cX4.js → calendar-D41RMBsP.js} +1 -1
- package/dist/client/assets/{capability-load-error-CpHJKGK_.js → capability-load-error-CYpF4fm6.js} +1 -1
- package/dist/client/assets/{category-editor-Cqsnc6Sy.js → category-editor-CMewSARd.js} +1 -1
- package/dist/client/assets/{chart-BQ6QpW4U.js → chart-CdmZzz30.js} +1 -1
- package/dist/client/assets/{chat-context-BTXCucl3.js → chat-context-D1GbDSrr.js} +1 -1
- package/dist/client/assets/{chat-draft-BkVD6W6R.js → chat-draft-VYqGGS3B.js} +1 -1
- package/dist/client/assets/{checkbox-CU6aP4l0.js → checkbox-BKGUJJNh.js} +1 -1
- package/dist/client/assets/{choose-editor-CkWOYF-H.js → choose-editor-Dkb9gjmg.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BPcQztK3.js → cli-auth-success-BFRzX7yY.js} +1 -1
- package/dist/client/assets/{client-icons-DgqSrzk2.js → client-icons-CIit2qYG.js} +1 -1
- package/dist/client/assets/{collapsible-srAejL6b.js → collapsible-eiDLfZY7.js} +1 -1
- package/dist/client/assets/{collection-detail-D322Op1Q.js → collection-detail-D6aw3A-V.js} +1 -1
- package/dist/client/assets/{collection-display-button-DQJ-tLOp.js → collection-display-button-D9O76Rnp.js} +1 -1
- package/dist/client/assets/{collection-search-Gh-hR-4s.js → collection-search-BQXOJg8a.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BDU2B_Je.js → collection-table-wrapper-zKpdBBAO.js} +1 -1
- package/dist/client/assets/{collection-tabs-BWrFlRZ9.js → collection-tabs-BWQrYrdS.js} +1 -1
- package/dist/client/assets/{combobox-CC112gZR.js → combobox-B1IXE26_.js} +1 -1
- package/dist/client/assets/{command-nGWuX8Gm.js → command-CDaLB2Ox.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-DBP_G53Z.js → companion-mcps-section-8c0rXQex.js} +1 -1
- package/dist/client/assets/{connect-CwLwDxgk.js → connect-B9ZzFP7o.js} +1 -1
- package/dist/client/assets/{connect-layout-ukgz_R9I.js → connect-layout-CSTvrhGM.js} +1 -1
- package/dist/client/assets/{connection-BA4KC5KX.js → connection-DzM2SOZ6.js} +1 -1
- package/dist/client/assets/{connection-card-XlsSZ-R-.js → connection-card-DF11WhqU.js} +1 -1
- package/dist/client/assets/{connection-detail-BPcZf8VO.js → connection-detail-Dimacfl3.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BAMFNNCq.js → connection-form-helpers-CyBATU5Y.js} +1 -1
- package/dist/client/assets/{connections-DdgU2Tuo.js → connections-C_1m4t4b.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-DKDVlIFF.js → create-organization-dialog-Cy1fVEro.js} +1 -1
- package/dist/client/assets/{decofile-api-BxmdSUgP.js → decofile-api-DkM3ZQFM.js} +1 -1
- package/dist/client/assets/{decopilot-DO_8sAdu.js → decopilot-YckYKTsg.js} +1 -1
- package/dist/client/assets/{dialog-D6pQPaBv.js → dialog-C36x61_J.js} +1 -1
- package/dist/client/assets/{discover-CHgBeXee.js → discover-CqgNMlsp.js} +1 -1
- package/dist/client/assets/{domain-settings-CaEGGzVl.js → domain-settings-D6TBWbch.js} +1 -1
- package/dist/client/assets/{download-app-dialog-Bzuj2ntc.js → download-app-dialog-7J000m-o.js} +1 -1
- package/dist/client/assets/{drawer-DluZzO2x.js → drawer-CsJzOKcM.js} +1 -1
- package/dist/client/assets/{editor-DIclqa9-.js → editor-BQuCFEpz.js} +1 -1
- package/dist/client/assets/{empty-state-BiVhgtC1.js → empty-state-ClBiZqLf.js} +1 -1
- package/dist/client/assets/{empty-state-CZLFWSqu.js → empty-state-gVTYQvW1.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CxC-zqEs.js → extract-connection-data-BIqslos8.js} +1 -1
- package/dist/client/assets/{feature-gate-D76S3kAa.js → feature-gate-DLeaUXYN.js} +1 -1
- package/dist/client/assets/{feature-paywall-eayRVomb.js → feature-paywall-lhh7GOr7.js} +1 -1
- package/dist/client/assets/{file-explorer-DlZkjZmt.js → file-explorer-BRRFAgbe.js} +1 -1
- package/dist/client/assets/{file-preview-CQAkzxV4.js → file-preview-DobzjEc2.js} +1 -1
- package/dist/client/assets/{file-share-button-DYSkPigi.js → file-share-button-6XYGV6w8.js} +1 -1
- package/dist/client/assets/{file-type-icon-Dt2UXzNa.js → file-type-icon-CFRsMAQ4.js} +1 -1
- package/dist/client/assets/{folder-icon-pIyzDMu_.js → folder-icon-CxyYiSJb.js} +1 -1
- package/dist/client/assets/{form-D-kjTFYr.js → form-CXSt7_li.js} +1 -1
- package/dist/client/assets/{gateway-client-BTm_6rQY.js → gateway-client-BF14HPqj.js} +1 -1
- package/dist/client/assets/{general-t1k7zYf_.js → general-0kms2_Mb.js} +1 -1
- package/dist/client/assets/{github-icon-CnETDRsY.js → github-icon-CIx0jkrL.js} +1 -1
- package/dist/client/assets/{home-cowO1F9H.js → home-CyQJcQvg.js} +1 -1
- package/dist/client/assets/{hooks-Box_GtQh.js → hooks-C8t7cMQJ.js} +1 -1
- package/dist/client/assets/{hooks-C39WD24p.js → hooks-enzgIMXj.js} +1 -1
- package/dist/client/assets/{icon-button-DqcpKghL.js → icon-button-Df-IeDHT.js} +1 -1
- package/dist/client/assets/{index-DA32LSL4.js → index-B7z_63F4.js} +1 -1
- package/dist/client/assets/{index-C0zUNKSL.js → index-BODjkOG4.js} +1 -1
- package/dist/client/assets/{index-DrL2LocL.js → index-BoSUEB27.js} +1 -1
- package/dist/client/assets/{index-nvKHmXqU.js → index-Byz-UaqT.js} +1 -1
- package/dist/client/assets/{index-DGxbsdDw.js → index-C4LzZ3-O.js} +1 -1
- package/dist/client/assets/{index-DvAVZBWu.js → index-CDAG9yf3.js} +1 -1
- package/dist/client/assets/{index-fzTgPViF.js → index-Ci3v6d1n.js} +1 -1
- package/dist/client/assets/{index-BKBDQhyx.js → index-ClQyNrgO.js} +1 -1
- package/dist/client/assets/{index-vA2LOloM.js → index-D9padtMD.js} +1 -1
- package/dist/client/assets/{index-BtxDLgO0.js → index-DC9_5qIh.js} +1 -1
- package/dist/client/assets/{index-Co7m86PQ.js → index-DV9UJZA2.js} +1 -1
- package/dist/client/assets/{index-D-N685jC.js → index-Doi07Y6T.js} +1 -1
- package/dist/client/assets/{index-DfPMKGyf.js → index-DowxFM-Z.js} +1 -1
- package/dist/client/assets/{index-JMsKOuRI.js → index-doEaURqC.js} +2 -2
- package/dist/client/assets/{index-redirect-Ymu_kpVO.js → index-redirect-XY4L95T5.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BvjTfQm9.js → infiniteQueryObserver-CxJm0T6_.js} +1 -1
- package/dist/client/assets/{infra-billing-C5Uc1Jo3.js → infra-billing-zdKJ_MUK.js} +1 -1
- package/dist/client/assets/{input-BLaOCTeL.js → input-BK5Sp8hZ.js} +1 -1
- package/dist/client/assets/{input-B-KO0VwW.js → input-BT236l5B.js} +1 -1
- package/dist/client/assets/{input-D1KFXH1M.js → input-CLIoB1hh.js} +1 -1
- package/dist/client/assets/{integration-icon-CLEGVk7b.js → integration-icon-Crk6WRxP.js} +1 -1
- package/dist/client/assets/{label-4qJl41zD.js → label-tAsQMZ2G.js} +1 -1
- package/dist/client/assets/{last-preview-page-BG7FS_dH.js → last-preview-page-002026Ee.js} +1 -1
- package/dist/client/assets/{layout-qQmCky-Z.js → layout-CCpqo3zm.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-DUGXKWr2.js → legacy-agents-deep-Cj78AYzA.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-C4PcsWOU.js → legacy-main-redirect-Dn96iLn4.js} +1 -1
- package/dist/client/assets/{library-DFlMdwU7.js → library-BuoDGyY9.js} +1 -1
- package/dist/client/assets/{login-CWrrzoze.js → login-DqL9YZRz.js} +1 -1
- package/dist/client/assets/{markdown-ClyMvzxh.js → markdown-D0jNOMCX.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-B0WVunXh.js → mcp-app-renderer-BvLPqeD1.js} +1 -1
- package/dist/client/assets/{mcp-oauth-AnqnN4tD.js → mcp-oauth-61IHYJoj.js} +1 -1
- package/dist/client/assets/{members-CphPtY7z.js → members-BcXF5gIl.js} +1 -1
- package/dist/client/assets/{message-templates-CYdPhJUj.js → message-templates-CUQwBtaa.js} +1 -1
- package/dist/client/assets/{mini-report-page-i0uz2wdg.js → mini-report-page-DbALNxiX.js} +1 -1
- package/dist/client/assets/{mock-board-wkrGgcEr.js → mock-board-D9-PmaL9.js} +3 -3
- package/dist/client/assets/{monaco-editor-BCNICwQQ.js → monaco-editor-xB6SdWXy.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-C_ucWxvm.js → monitoring-stats-row-CTbrFT2U.js} +1 -1
- package/dist/client/assets/{multi-select-BjikSxtg.js → multi-select-BPlBOZll.js} +1 -1
- package/dist/client/assets/{mustache-ke4At2H-.js → mustache-Btjjkmrx.js} +1 -1
- package/dist/client/assets/{oauth-callback-WgX8PqTT.js → oauth-callback-D8-Vh_4C.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-ChbKtcY4.js → oauth-callback-ai-provider-Dpai0ql-.js} +1 -1
- package/dist/client/assets/{onboarding-aAWVAcO_.js → onboarding-uOVvp-Mg.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-B3Crhw1z.js → optimistic-project-sidebar-views-BQt56FI4.js} +1 -1
- package/dist/client/assets/{org-file-open-context-lFucpOqZ.js → org-file-open-context-DodrnIMR.js} +1 -1
- package/dist/client/assets/{organization-choice-BRfFHmIi.js → organization-choice-9DpczJ4c.js} +1 -1
- package/dist/client/assets/{orgs-RjiRiV-j.js → orgs-B6tWlX0C.js} +1 -1
- package/dist/client/assets/{page-seo-form-CeWscTxl.js → page-seo-form-Dbz3eu1p.js} +1 -1
- package/dist/client/assets/{pair-DHrlwMz5.js → pair-BIUMok9W.js} +1 -1
- package/dist/client/assets/{plan-ladder-iPlek9cO.js → plan-ladder-DjuDG4EH.js} +1 -1
- package/dist/client/assets/{popover-CLkWb0ma.js → popover-GUR8piky.js} +1 -1
- package/dist/client/assets/{post-calendar--4Elo_Fx.js → post-calendar-FfQIYQQi.js} +1 -1
- package/dist/client/assets/{post-editor-DBITXFzX.js → post-editor-YU4-WfQ7.js} +1 -1
- package/dist/client/assets/{preview-content-BtBwxf8_.js → preview-content-CkHbAlf-.js} +1 -1
- package/dist/client/assets/{preview-dialog-DvDFnEBT.js → preview-dialog-DUI33rZ8.js} +1 -1
- package/dist/client/assets/{primitives-P21lGmVx.js → primitives-CHkTFFF-.js} +1 -1
- package/dist/client/assets/{profile-Dg6i1xyh.js → profile-BIFbXoSW.js} +1 -1
- package/dist/client/assets/{project-app-view-BPxgp2Js.js → project-app-view-ZkgOByQo.js} +1 -1
- package/dist/client/assets/{project-feed-C87uAfWT.js → project-feed-DGoAUO34.js} +1 -1
- package/dist/client/assets/{project-icon-BReCgAJA.js → project-icon-mjklzNJs.js} +1 -1
- package/dist/client/assets/project-reports-DVMPWWFi.js +1 -0
- package/dist/client/assets/project-tasks-Jy5UvQy6.js +1 -0
- package/dist/client/assets/{prompts-3cUd2EYt.js → prompts-BwsVrHFI.js} +1 -1
- package/dist/client/assets/record-editor-CXOCBCZ1.js +1 -0
- package/dist/client/assets/{redirect-editor-CglFoksh.js → redirect-editor-MDe3fibH.js} +1 -1
- package/dist/client/assets/{reports-d8DVVX1F.js → reports-ChF6GDQz.js} +1 -1
- package/dist/client/assets/reports-DwYY1RWm.js +1 -0
- package/dist/client/assets/{reports-onboarding-hyM4vCl8.js → reports-onboarding-ukyewr1e.js} +1 -1
- package/dist/client/assets/{reports-tab-Cug67MBx.js → reports-tab-Cxq1-mux.js} +2 -2
- package/dist/client/assets/{repositories-C0bQ0l1P.js → repositories-D7d8VzOE.js} +1 -1
- package/dist/client/assets/{repository-import-picker-Bptjw4Pi.js → repository-import-picker-B6ijLkOL.js} +1 -1
- package/dist/client/assets/{repository-picker-B8XMDU58.js → repository-picker-Ca5oB9j5.js} +1 -1
- package/dist/client/assets/{require-capability-CIzRt2aq.js → require-capability-vhXMBpff.js} +1 -1
- package/dist/client/assets/{required-auth-layout-K5ljvyV3.js → required-auth-layout-DbGCmQgx.js} +1 -1
- package/dist/client/assets/{reset-password-BasKVERH.js → reset-password-DrRaSkr-.js} +1 -1
- package/dist/client/assets/{resizable-B2KoNYCF.js → resizable-WgWAPECX.js} +1 -1
- package/dist/client/assets/{review-settings-fCGXJvf-.js → review-settings-BzcjRJO0.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-BJwXSPYM.js → rich-text-link-control-i_tw_Jd2.js} +1 -1
- package/dist/client/assets/{roles-CmiGyPEA.js → roles-DTbcvvsD.js} +1 -1
- package/dist/client/assets/{route-C1pqSXZw.js → route-B8hLxHmX.js} +1 -1
- package/dist/client/assets/{route-DOl18dQS.js → route-BRh6VH3Q.js} +1 -1
- package/dist/client/assets/{route-DkHmMKef.js → route-DsWfLZyf.js} +1 -1
- package/dist/client/assets/{route-page-header-B3kEjR8p.js → route-page-header-tbVW9ntg.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-CFmYToE9.js → runnable-block-editor-CdEmnBad.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-FlMg1fQY.js → sandbox-lifecycle-context-CvyFr09R.js} +1 -1
- package/dist/client/assets/{schema-B2q5Yt4K.js → schema-BVqtjcyJ.js} +1 -1
- package/dist/client/assets/{scroll-area-CH-rb0_G.js → scroll-area-Cve7MqyA.js} +1 -1
- package/dist/client/assets/{search-input-CAENkblf.js → search-input-CCUlZDzf.js} +1 -1
- package/dist/client/assets/{search-toggle-Css1x_ZP.js → search-toggle-BtmGTpxl.js} +1 -1
- package/dist/client/assets/{secret-picker-CkKXzT8w.js → secret-picker-DVWtSCXk.js} +1 -1
- package/dist/client/assets/{secrets-CFFkXPPW.js → secrets-dQAYGJYM.js} +1 -1
- package/dist/client/assets/{sections-editor-BIXw2DHh.js → sections-editor-C6cdGUNk.js} +1 -1
- package/dist/client/assets/{select-model-AKQ4BYqT.js → select-model-Bnz73VTx.js} +1 -1
- package/dist/client/assets/{select-lCLfdrAv.js → select-oEHCSTZi.js} +1 -1
- package/dist/client/assets/{seo-editor-C2eNHP61.js → seo-editor-BD39YQzP.js} +1 -1
- package/dist/client/assets/{separator-D9MBgrlO.js → separator-JATiwE_2.js} +1 -1
- package/dist/client/assets/{settings-tab-DQX9Hhij.js → settings-tab-CE0tP2vq.js} +1 -1
- package/dist/client/assets/{sheet-D9ryq7NB.js → sheet-ZoEgH6s-.js} +1 -1
- package/dist/client/assets/{shell-layout-C5Kw3gFs.js → shell-layout-BNVBlKMe.js} +1 -1
- package/dist/client/assets/{sidebar-BHNGBRPf.js → sidebar-Cz1S2PSM.js} +1 -1
- package/dist/client/assets/{skill-preview-Lh8MAOOX.js → skill-preview-BP5xxsO4.js} +1 -1
- package/dist/client/assets/{skills-BKFCZRwD.js → skills-D52kTkau.js} +1 -1
- package/dist/client/assets/{sso-DzUb8tRJ.js → sso-DAgB-pSG.js} +1 -1
- package/dist/client/assets/{switch-Ctfktb3Q.js → switch-BNLiV_oA.js} +1 -1
- package/dist/client/assets/{synced-repos-Cfdy3b49.js → synced-repos-BzaJ7fNm.js} +1 -1
- package/dist/client/assets/{table-Bn8Ki7JL.js → table-D7l9brRh.js} +1 -1
- package/dist/client/assets/{tabs-DaVafG3V.js → tabs-Gq0qvZI4.js} +1 -1
- package/dist/client/assets/{task-board-BaCCzAkS.js → task-board-BXLBBo-B.js} +1 -1
- package/dist/client/assets/{task-route-UwWZbeWT.js → task-route-BpYPpL3v.js} +1 -1
- package/dist/client/assets/{task-status-CgnZNHAt.js → task-status-C7fhyr8_.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-Cl1HSG8q.js → taskboard-analytics-Bhbjv4p8.js} +1 -1
- package/dist/client/assets/{tasks-JZ18Uh2f.js → tasks-C2avg53f.js} +1 -1
- package/dist/client/assets/tasks-aGbeVyrS.js +1 -0
- package/dist/client/assets/{textarea-B1GALty3.js → textarea-B9cyNs7j.js} +1 -1
- package/dist/client/assets/{thread-button-Ea1IEPhL.js → thread-button-CzoAkKWi.js} +1 -1
- package/dist/client/assets/{thread-intent-BRrskxk5.js → thread-intent-DuCE7MYG.js} +1 -1
- package/dist/client/assets/{thread-route-Dk9ahPxf.js → thread-route-BBKn0p1b.js} +1 -1
- package/dist/client/assets/{thread-route-DEMNROXo.js → thread-route-C5QqTXOt.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-xoK93iNg.js → thread-sheet-body-C52UGBXx.js} +1 -1
- package/dist/client/assets/{toggle-group-D1XsuFs0.js → toggle-group-DHrftnUg.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Bg5-1pXA.js → toolbar-icon-button-iy_uLVVB.js} +1 -1
- package/dist/client/assets/{tooltip-Dl_6fBP-.js → tooltip-C91IS2ON.js} +1 -1
- package/dist/client/assets/{track-B7wy8tQa.js → track-CpCOxAsM.js} +1 -1
- package/dist/client/assets/{types-2KFsrYQc.js → types-BCbJ4Eml.js} +1 -1
- package/dist/client/assets/{usage-stats-Bz_wAGKI.js → usage-stats-P7Ebxq4V.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BkXWbAU8.js → use-ai-providers-CJ2ga4nx.js} +1 -1
- package/dist/client/assets/{use-automations-CSgRicI5.js → use-automations-V0dkF89H.js} +1 -1
- package/dist/client/assets/{use-autosave-Bc9C-TXt.js → use-autosave-ClFMVO3A.js} +1 -1
- package/dist/client/assets/{use-connect-companion-N7l_a-TB.js → use-connect-companion-CXK99yF4.js} +1 -1
- package/dist/client/assets/{use-connection-5dW0kEfg.js → use-connection-PgTQPnAp.js} +1 -1
- package/dist/client/assets/{use-copy-Bd7__6JV.js → use-copy-CGJ-16i-.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DIvFq9PY.js → use-create-virtual-mcp-D4lB4pbk.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-R90PdH_-.js → use-date-fns-locale-VjB0j61V.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CPqao0Jg.js → use-debounced-autosave-Du2G3qf3.js} +1 -1
- package/dist/client/assets/{use-debounced-value-D6neZbIW.js → use-debounced-value-CG2jgHBI.js} +1 -1
- package/dist/client/assets/{use-deco-credits-UyjtVf28.js → use-deco-credits-DU8sJrax.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-AGcLIEqV.js → use-decopilot-events-x0K7Zb7m.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BOf_sS7R.js → use-delete-connection-Pe3fW9Dc.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-ovZ9r24K.js → use-deployment-admin-CWwZo7oV.js} +1 -1
- package/dist/client/assets/{use-entitlements-9Kc8crdb.js → use-entitlements-pN-YIa6T.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-Da8mrZly.js → use-fast-preview-draft-url-CCQm80wV.js} +1 -1
- package/dist/client/assets/{use-file-configs-C3ggNWTu.js → use-file-configs-CzJCjBKX.js} +1 -1
- package/dist/client/assets/{use-in-settings-BS7AoaPJ.js → use-in-settings-DplznXN9.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-B-wkakMK.js → use-infinite-scroll-Bm905rys.js} +1 -1
- package/dist/client/assets/{use-join-requests-0l0i103h.js → use-join-requests-D4wrlTl5.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-_tT3JUnc.js → use-main-panel-tabs-BcprnHpG.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-Dt_dcuV6.js → use-mcp-auth-status-BnAPI8Zf.js} +1 -1
- package/dist/client/assets/{use-mcp-client-e1wyTE1C.js → use-mcp-client-D2DgMGL-.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DQx9bmKK.js → use-mcp-prompts-UNzUvECH.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-ClkQeKNW.js → use-mcp-tools-CtMvHJK9.js} +1 -1
- package/dist/client/assets/{use-members-HVNlL38Y.js → use-members-C_tB-qI-.js} +1 -1
- package/dist/client/assets/{use-mobile-B5flYDXi.js → use-mobile-DYpKQ1eP.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-yO-Nj7az.js → use-navigate-to-agent-TwlhlbmB.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-CfYJ6IYG.js → use-open-billing-url-BrlDdS6U.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DNJLCpUj.js → use-org-auth-client-BkVvw_9f.js} +1 -1
- package/dist/client/assets/{use-org-fs-Dwl12W1B.js → use-org-fs-Bbl2QQqg.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-D6cUp9Xj.js → use-org-repo-syncs-Ds4sFbSY.js} +1 -1
- package/dist/client/assets/{use-org-sso-ByWK6FUG.js → use-org-sso-BnqcEd47.js} +1 -1
- package/dist/client/assets/{use-organization-roles-ZRysohL8.js → use-organization-roles-3K_wbMHo.js} +1 -1
- package/dist/client/assets/{use-organization-settings-ChfSyrRD.js → use-organization-settings-Wh36EN0I.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-C12W08bg.js → use-panel-navigate-xYH0iX8e.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-C_IPdceh.js → use-project-native-view-presence-U59DT0hQ.js} +1 -1
- package/dist/client/assets/{use-project-scope-BMpsuDud.js → use-project-scope-CENQvfVc.js} +1 -1
- package/dist/client/assets/{use-releases-CYjYNFTK.js → use-releases-_xbQ8yPk.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-D1WI0_3t.js → use-reports-diagnostic-Cz_g9Pum.js} +1 -1
- package/dist/client/assets/{use-route-default-main-DAkihQ4e.js → use-route-default-main-evb2BAGs.js} +1 -1
- package/dist/client/assets/{use-secrets-B9E3rRH5.js → use-secrets-44zj-3N9.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-Dxevo_OY.js → use-section-preview-base-BbxztEDH.js} +1 -1
- package/dist/client/assets/{use-session-runtime-CR-UnxXL.js → use-session-runtime-COugfsOm.js} +1 -1
- package/dist/client/assets/{use-tags-BLewCq5f.js → use-tags-BqebMAjW.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BkkPkKsc.js → use-task-board-analytics-CElip-Jh.js} +1 -1
- package/dist/client/assets/{use-task-metadata-BcoAGFmu.js → use-task-metadata-Dhub_XGT.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-CkKCKHRQ.js → use-thread-outputs-DldRsY9l.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-zNwvJ0Qw.js → use-virtual-mcp-B-mdsJbn.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DCZL7BN4.js +1 -0
- package/dist/client/assets/{useQueries-C4eAa4a3.js → useQueries-CrUxqve0.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-C0KSbZH8.js +1 -0
- package/dist/client/assets/{users-BLYahvM-.js → users-XpLTDG6s.js} +1 -1
- package/dist/client/assets/{utils-CsYaNcgA.js → utils-BcFrUaDf.js} +1 -1
- package/dist/client/assets/{variant-calendar-DrAQCdkG.js → variant-calendar-BPWkuyHy.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-D6FNSy0H.js → variant-matcher-override-DWffsqol.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-B3l32s4o.js → view-mode-toggle-Bsk0Q0dk.js} +1 -1
- package/dist/client/assets/{virtual-mcp-DV4tZ2Pb.js → virtual-mcp-Bj7Y16hO.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +502 -502
- package/dist/server/server.js +347 -347
- package/package.json +1 -1
- package/dist/client/assets/agent-app-D4j92Ry2.js +0 -1
- package/dist/client/assets/agent-deck-BXYE9A0p.js +0 -1
- package/dist/client/assets/agent-file-Dm25wG5E.js +0 -1
- package/dist/client/assets/agent-library-file-W56WasEq.js +0 -1
- package/dist/client/assets/agent-settings-eeAuvV7O.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CwqCnEUW.js +0 -2
- package/dist/client/assets/agent-view-BkUptLHy.js +0 -1
- package/dist/client/assets/api-keys-DSCRIr8M.js +0 -1
- package/dist/client/assets/app-editor-mIQWdons.js +0 -1
- package/dist/client/assets/project-reports-DQ2ZLU92.js +0 -1
- package/dist/client/assets/project-tasks-CVlnv3sT.js +0 -1
- package/dist/client/assets/record-editor-BOeRQbRZ.js +0 -1
- package/dist/client/assets/reports-Cff3xrO5.js +0 -1
- package/dist/client/assets/tasks-ZUfslj3F.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CuJHgIBx.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DLlRpun8.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as V,Y as Fe,r as w,e as me,q as z,j as t,l as P,B as xe,o as Ve,m as ze,K as ue,c as oe,b as be,h as _e}from"./index-JMsKOuRI.js";import{I as ee}from"./input-BLaOCTeL.js";import{i as Qe}from"./use-is-desktop-app-BNujXJc_.js";import{d as He,e as Ke}from"./backoff-8mStPHYB.js";class Le extends Error{constructor(e,a){super(`Retrying exceeded the maxAttempts (${a}).`),this.name="RetryError",this.cause=e}}async function Ye(n,e){const{multiplier:a=2,maxTimeout:u=6e4,maxAttempts:f=5,minTimeout:o=1e3,jitter:i=1,isRetriable:m=()=>!0,signal:g}=e??{};if(!Number.isInteger(f)||f<1)throw new RangeError(`Cannot retry as 'maxAttempts' must be a positive integer: current value is ${f}`);if(!Number.isFinite(a)||a<1)throw new RangeError(`Cannot retry as 'multiplier' must be a finite number >= 1: current value is ${a}`);if(Number.isNaN(u)||u<=0)throw new RangeError(`Cannot retry as 'maxTimeout' must be a positive number: current value is ${u}`);if(Number.isNaN(o)||o<0)throw new RangeError(`Cannot retry as 'minTimeout' must be >= 0: current value is ${o}`);if(o>u)throw new RangeError(`Cannot retry as 'minTimeout' must be <= 'maxTimeout': current values 'minTimeout=${o}', 'maxTimeout=${u}'`);if(Number.isNaN(i)||i<0||i>1)throw new RangeError(`Cannot retry as 'jitter' must be between 0 and 1: current value is ${i}`);let j=0;for(;;){g?.throwIfAborted();try{return await n()}catch(v){if(!m(v))throw v;if(j+1>=f)throw new Le(v,f);const C=Ke(u,o,j,a,i);await He(C,g?{signal:g}:void 0)}j++}}const Oe={submitEmailPassword:({mode:n,email:e,password:a,name:u})=>n==="sign_up"?V.signUp.email({email:e,password:a,name:u||""}):V.signIn.email({email:e,password:a}),requestPasswordReset:({email:n,redirectTo:e})=>V.requestPasswordReset({email:n,redirectTo:e}),sendOtp:({email:n})=>V.emailOtp.sendVerificationOtp({email:n,type:"sign-in"}),submitOtp:({email:n,otp:e})=>V.signIn.emailOtp({email:n,otp:e}),socialSignIn:({provider:n,callbackURL:e})=>V.signIn.social({provider:n,callbackURL:e}),ssoSignIn:({providerId:n,callbackURL:e})=>V.signIn.sso({providerId:n,callbackURL:e}),onAuthenticated:n=>{window.location.href=n}},ge="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ge={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:n=>`Code sent to ${n}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:n=>`Continue with ${n}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Je({redirectUrl:n,callbackUrl:e="/",title:a,subtitle:u,brand:f,copy:o,variant:i="default",allowedSocialProviders:m,allowPassword:g=!0,onAuthEvent:j,actions:v}){const{emailAndPassword:C,resetPassword:E,emailOtp:y,socialProviders:N}=Fe(),d={...Oe,...v},h=s=>{try{j?.(s)}catch{}},I=i==="compact",te=m?N.providers.filter(s=>m.includes(s.name)):N.providers,se=N.enabled&&te.length>0,le=C.enabled&&(g||!y.enabled&&!se),de=N.enabled&&N.providers.length>0&&!se&&!y.enabled&&!le?N.providers:te,p=N.enabled&&de.length>0,F=C.enabled&&(g||!y.enabled&&!p),[b,_]=w.useState(""),[L,Q]=w.useState(""),[U,O]=w.useState(""),[D,l]=w.useState(""),[x,$]=w.useState(!1),[M,W]=w.useState(()=>y.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[A,H]=w.useState(""),[ye,we]=w.useState(!1),[Re,fe]=w.useState(null),r={...Ge,...o},ne=w.useId(),K=`${ne}-email`,Y=`${ne}-email-error`,ve=`${ne}-name`,Ee=`${ne}-password`,Se=`${ne}-otp`,k=M==="signUp",q=M==="forgotPassword",T=M==="emailOtp",re=me({mutationFn:async({email:s,password:c,name:R})=>{try{const Z=await d.submitEmailPassword({mode:k?"sign_up":"sign_in",email:s,password:c,name:R});if(Z.error)throw new Error(Z.error.message||(k?r.signUpFailed:r.signInFailed));return Z}catch(Z){throw Z instanceof Error?Z:new Error(r.authenticationFailed)}},onMutate:()=>{h({type:"started",method:"email_password",mode:k?"sign_up":"sign_in"})},onSuccess:()=>{h({type:"succeeded",method:"email_password",mode:k?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),d.onAuthenticated(n??e)},onError:s=>{h({type:"failed",method:"email_password",mode:k?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),z(k?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),ie=me({mutationFn:async({email:s})=>{const c=await d.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(c.error)throw new Error(c.error.message||r.resetEmailFailed);return c},onSuccess:()=>{z("password_reset_requested"),we(!0)},onError:s=>{z("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),G=me({mutationFn:async({email:s})=>{const c=await d.sendOtp({email:s});if(c.error)throw new Error(c.error.message||r.otpSendFailed);return c},onMutate:()=>{h({type:"started",method:"email_otp"})},onSuccess:()=>{h({type:"otp_sent",method:"email_otp"}),z("email_otp_sent"),$(!0)},onError:s=>{h({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),z("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),J=me({mutationFn:async({email:s,otp:c})=>{const R=await d.submitOtp({email:s,otp:c});if(R.error)throw new Error(R.error.message||r.invalidCode);return R},onMutate:()=>{h({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{h({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),d.onAuthenticated(n??e)},onError:s=>{h({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),z("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),ce=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),pe=()=>{b.trim()&&!ce(b)&&H(r.invalidEmail)},De=s=>{if(s.preventDefault(),!ce(b)){H(r.invalidEmail),h({type:"failed",method:"email_password",mode:k?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}re.mutate({email:b,password:L,name:U})},$e=s=>{if(s.preventDefault(),!ce(b)){H(r.invalidEmail);return}ie.mutate({email:b})},Me=s=>{if(s.preventDefault(),!ce(b)){H(r.invalidEmail),h({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}G.mutate({email:b})},We=s=>{s.preventDefault(),J.mutate({email:b,otp:D})},X=s=>c=>{s(c.target.value),je&&re.reset(),Ne&&ie.reset(),Ae&&(G.reset(),J.reset()),s===_&&A&&H("")},ae=s=>{W(s),O(""),l(""),$(!1),H(""),we(!1),fe(null),re.reset(),ie.reset(),G.reset(),J.reset()},S=re.isPending||ie.isPending||G.isPending||J.isPending,je=re.error,Ne=ie.error,Ae=G.error||J.error,B=k?b.trim()&&L.trim()&&U.trim():q?b.trim():T?x?D.trim():b.trim():b.trim()&&L.trim(),qe=s=>{if(!s)return null;const c=s.message.toLowerCase();return c.includes("unauthorized")||c.includes("401")?r.invalidEmailOrPassword:c.includes("already exists")||c.includes("409")?r.accountExists:c.includes("network")||c.includes("fetch")?r.networkError:c.includes("rate limit")||c.includes("429")?r.tooManyAttempts:c.includes("invalid")&&c.includes("otp")?r.invalidOrExpiredCode:s.message||r.genericError},Ce=je||Ne||Ae||Re,Ue=async s=>{h({type:"started",method:"social",provider:s}),fe(null);try{const c=await d.socialSignIn({provider:s,callbackURL:n??e});if(c.error)throw new Error(c.error.message||r.authenticationFailed)}catch(c){const R=c instanceof Error?c.message:String(c);h({type:"failed",method:"social",provider:s,stage:"redirect",error:R}),z("social_signin_failed",{provider:s,error:R}),fe(c instanceof Error?c:new Error(R))}},Be=q?r.resetPasswordTitle:T&&x?r.verificationCodeTitle:a??r.welcomeTitle,Pe=q?r.resetPasswordSubtitle:T&&x?r.codeSentTo(b):u===void 0?r.defaultSubtitle:u;return t.jsxs("div",{className:P("grid w-full",I?"gap-5":"gap-10"),children:[f??t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:P("font-medium",I?"text-xl leading-7":"text-2xl leading-8"),children:Be}),Pe&&t.jsx("p",{className:P("text-muted-foreground",I?"text-sm leading-5":"text-base leading-6"),children:Pe})]}),Ce&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:qe(Ce)}),ye&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:r.resetEmailSent}),!q&&!(T&&x)&&p&&t.jsx("div",{className:"grid gap-2",children:de.map(s=>t.jsxs("button",{type:"button",disabled:S,onClick:()=>{Ue(s.name)},className:P("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50 compact:rounded-lg",I?"h-11":"h-12"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:P("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),r.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!q&&!(T&&x)&&p&&(F||y.enabled)&&t.jsxs("div",{className:P("flex items-center gap-2.5",I?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:P("text-muted-foreground",I?"text-sm":"text-base"),children:r.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),T&&y.enabled&&t.jsx(t.Fragment,{children:x?t.jsxs("form",{onSubmit:We,className:P("grid gap-2",I&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:Se,className:P("text-sm font-medium text-foreground",I&&"sr-only"),children:r.verificationCodeLabel}),t.jsx(ee,{id:Se,type:"text",placeholder:r.enterCodePlaceholder,value:D,onChange:X(l),required:!0,disabled:S,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx("button",{type:"submit",disabled:S||!B,className:P("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",I?"h-11 sm:w-auto":"h-12 w-full"),children:S?r.verifying:r.verify}),t.jsx("button",{type:"button",onClick:()=>{$(!1),l(""),G.reset(),J.reset()},disabled:S,className:P("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",I&&"sm:col-span-2"),children:r.useDifferentEmail})]}):t.jsxs("form",{onSubmit:Me,className:P("grid gap-2",I&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:K,className:P("text-sm font-medium text-foreground",I&&"sr-only"),children:r.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:r.emailPlaceholder,value:b,onChange:X(_),onBlur:pe,required:!0,disabled:S,autoComplete:"email","aria-invalid":!!A,"aria-describedby":A?Y:void 0,className:"h-11 rounded-lg"}),A&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive",children:A})]}),t.jsx("button",{type:"submit",disabled:S||!B,className:P("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",I?"h-11 sm:w-auto":"h-12 w-full"),children:S?r.sending:r.sendCode})]})}),q&&F&&!ye&&t.jsxs("form",{onSubmit:$e,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:r.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:S,autoComplete:"email","aria-invalid":!!A,"aria-describedby":A?Y:void 0,className:"h-11 rounded-lg"}),A&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:A})]}),t.jsx(xe,{type:"submit",disabled:S||!B,className:"w-full font-semibold",size:"xl",children:S?r.sending:r.sendResetLink})]}),!q&&!T&&F&&t.jsxs("form",{onSubmit:De,className:"grid gap-5",children:[k&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:ve,className:"block text-sm font-medium text-foreground mb-2",children:r.nameLabel}),t.jsx(ee,{id:ve,type:"text",placeholder:r.namePlaceholder,value:U,onChange:X(O),required:!0,disabled:S,autoComplete:"name",className:"h-11 rounded-lg"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:r.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:S,autoComplete:"email","aria-invalid":!!A,"aria-describedby":A?Y:void 0,className:"h-11 rounded-lg"}),A&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:A})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:Ee,className:"block text-sm font-medium text-foreground",children:r.passwordLabel}),!k&&E.enabled&&t.jsx("button",{type:"button",onClick:()=>ae("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r.forgotPassword})]}),t.jsx(ee,{id:Ee,type:"password",placeholder:"••••••••",value:L,onChange:X(Q),required:!0,disabled:S,autoComplete:k?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:P("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",B?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:P("p-1",!B&&"pointer-events-none"),children:t.jsx(xe,{type:"submit",disabled:S||!B,className:P("w-full font-semibold"),size:"xl","aria-hidden":!B,children:S?k?r.creatingAccount:r.signingIn:r.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:q?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:S,className:ge,children:r.backToSignIn}):T&&F?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:S,className:ge,children:r.signInWithPassword}):!T&&F?t.jsxs(t.Fragment,{children:[k?r.alreadyHaveAccount:r.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>ae(k?"signIn":"signUp"),disabled:S,className:ge,children:k?r.signIn:r.signUp}),y.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>ae("emailOtp"),disabled:S,className:ge,children:r.signInWithEmailCode})]})]}):null})]})}async function he(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Xe(){const n=Ve(),e=Qe(),a=ze({queryKey:ue.desktopAuthStatus(),queryFn:async()=>(await he()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[u,f]=w.useState(!1),[o,i]=w.useState(null),[m,g]=w.useState(!1),[j,v]=w.useState(null);w.useEffect(()=>{},[e,n]);async function C(){f(!0),i(null);try{const d=await he();await d.performAuthLogin();const h=await d.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),h)}catch(d){i(d instanceof Error?d.message:"Sign-in failed")}finally{f(!1)}}async function E(){f(!0);try{const d=await he();await d.performAuthLogout();const h=await d.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),h)}finally{f(!1)}}async function y(){g(!0),v(null);let d;try{d=await he()}catch(h){v(h instanceof Error?h.message:"Sign-in failed"),g(!1);return}try{await d.performAuthCompleteSession()}catch(h){v(h instanceof Error?h.message:"Sign-in failed")}finally{try{const h=await d.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),h)}finally{g(!1)}}}async function N(){await a.refetch()}return{status:a.data,isChecking:a.isLoading,isRetryingStatus:a.isFetching,isPending:u,loginError:o,login:C,logout:E,isCompletingSession:m,completeSessionError:j,completeSession:y,retryStatus:N}}function Ze(n){return!(n.emailAndPassword.enabled||n.emailOtp.enabled||n.socialProviders.enabled)&&!n.sso.enabled&&n.magicLink.enabled}function et(){return oe.c(10),Xe(),null}function tt(n){const e=oe.c(25),{onContinue:a,isPending:u,error:f}=n,o=be();let i;e[0]!==o?(i=o("common.authEntry.browserOnlyTitle"),e[0]=o,e[1]=i):i=e[1];let m;e[2]!==i?(m=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:i}),e[2]=i,e[3]=m):m=e[3];let g;e[4]!==o?(g=o("common.authEntry.browserOnlyDescription"),e[4]=o,e[5]=g):g=e[5];let j;e[6]!==g?(j=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:g}),e[6]=g,e[7]=j):j=e[7];let v;e[8]!==m||e[9]!==j?(v=t.jsxs("div",{className:"flex flex-col gap-1",children:[m,j]}),e[8]=m,e[9]=j,e[10]=v):v=e[10];let C;e[11]!==a?(C=()=>{a()},e[11]=a,e[12]=C):C=e[12];let E;e[13]!==o?(E=o("common.authEntry.browserOnlyCta"),e[13]=o,e[14]=E):E=e[14];let y;e[15]!==u||e[16]!==C||e[17]!==E?(y=t.jsx(xe,{onClick:C,disabled:u,children:E}),e[15]=u,e[16]=C,e[17]=E,e[18]=y):y=e[18];let N;e[19]!==f?(N=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[19]=f,e[20]=N):N=e[20];let d;return e[21]!==v||e[22]!==y||e[23]!==N?(d=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[v,y,N]}),e[21]=v,e[22]=y,e[23]=N,e[24]=d):d=e[24],d}function Ie(n){const e=oe.c(8),{label:a,error:u}=n;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(_e,{size:"lg"}),e[0]=f):f=e[0];let o;e[1]!==a?(o=a&&t.jsx("p",{className:"text-sm text-muted-foreground",children:a}),e[1]=a,e[2]=o):o=e[2];let i;e[3]!==u?(i=u&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:u}),e[3]=u,e[4]=i):i=e[4];let m;return e[5]!==o||e[6]!==i?(m=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[f,o,i]}),e[5]=o,e[6]=i,e[7]=m):m=e[7],m}class ke{constructor(e){this.response=e}response}function st(n){return n.startsWith("/")&&!n.startsWith("//")?n:"/"}function nt({redirectTo:n,onAuthEvent:e}){const a=be(),[u,f]=w.useState(null),o=w.useEffectEvent(i=>{try{e?.(i)}catch{}});return w.useEffect(()=>{let i=!1;return(async()=>{o({type:"started",method:"local"});try{let m;try{m=await Ye(async()=>{const g=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(g.status>=500)throw new ke(g);return g},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(g){if(g instanceof Le&&g.cause instanceof ke)m=g.cause.response;else throw g}if(!m.ok){const g=await m.json().catch(()=>({}));throw new Error(g?.error||a("common.authEntry.autoLoginFailed"))}i||(o({type:"succeeded",method:"local"}),window.location.href=st(n))}catch(m){i||(o({type:"failed",method:"local",stage:"authenticate",error:m instanceof Error?m.message:String(m)}),f(m instanceof Error?m.message:a("common.authEntry.autoLoginFailed")))}})(),()=>{i=!0}},[n]),u?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:a("common.authEntry.autoLoginFailedWithError",{error:u})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:a("common.authEntry.tryRestartingServer")})]})}):t.jsx(Te,{})}function Te(){const n=oe.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsx(_e,{size:"lg",label:"Signing in"})}),n[0]=e):e=n[0],e}function rt({callbackURL:n,providerId:e,ssoSignIn:a,onAuthEvent:u}){const f=w.useEffectEvent(i=>{try{u?.(i)}catch{}}),o=w.useEffectEvent(a);return w.useEffect(()=>{(async()=>{f({type:"started",method:"sso",provider:e});try{const i=await o({providerId:e,callbackURL:n});if(i.error)throw new Error(i.error.message||"SSO redirect failed")}catch(i){f({type:"failed",method:"sso",provider:e,stage:"redirect",error:i instanceof Error?i.message:String(i)})}})()},[e,n]),t.jsx(Te,{})}function dt(n){const e=oe.c(51),{callbackUrl:a,redirectUrl:u,allowAutoLogin:f,title:o,subtitle:i,brand:m,copy:g,variant:j,allowedSocialProviders:v,allowPassword:C,onAuthEvent:E,onAuthenticated:y}=n,N=f===void 0?!0:f,d=be(),{sso:h,emailAndPassword:I,magicLink:te,emailOtp:se,socialProviders:le,localMode:de}=Fe(),p=et(),F=u||a;let b;e[0]!==y?(b=y?{onAuthenticated:y}:void 0,e[0]=y,e[1]=b):b=e[1];const _=b,L=p?.actions;let Q;e[2]!==_||e[3]!==L?(Q={...Oe,..._,...L},e[2]=_,e[3]=L,e[4]=Q):Q=e[4];const U=Q;if(p?.isPending){let l;e[5]!==d?(l=d("common.authEntry.finishSignInInBrowser"),e[5]=d,e[6]=l):l=e[6];let x;return e[7]!==p.loginError||e[8]!==l?(x=t.jsx(Ie,{label:l,error:p.loginError}),e[7]=p.loginError,e[8]=l,e[9]=x):x=e[9],x}if(p?.isCompletingSession){let l;e[10]!==d?(l=d("common.authEntry.finishingSignIn"),e[10]=d,e[11]=l):l=e[11];let x;return e[12]!==p.completeSessionError||e[13]!==l?(x=t.jsx(Ie,{label:l,error:p.completeSessionError}),e[12]=p.completeSessionError,e[13]=l,e[14]=x):x=e[14],x}if(de&&N){let l;return e[15]!==E||e[16]!==F?(l=t.jsx(nt,{redirectTo:F,onAuthEvent:E}),e[15]=E,e[16]=F,e[17]=l):l=e[17],l}if(h.enabled){let l;return e[18]!==E||e[19]!==F||e[20]!==U.ssoSignIn||e[21]!==h.providerId?(l=t.jsx(rt,{callbackURL:F,providerId:h.providerId,ssoSignIn:U.ssoSignIn,onAuthEvent:E}),e[18]=E,e[19]=F,e[20]=U.ssoSignIn,e[21]=h.providerId,e[22]=l):l=e[22],l}if(p&&Ze({emailAndPassword:I,emailOtp:se,socialProviders:le,magicLink:te,sso:h})){let l;return e[23]!==p.isPending||e[24]!==p.login||e[25]!==p.loginError?(l=t.jsx(tt,{onContinue:p.login,isPending:p.isPending,error:p.loginError}),e[23]=p.isPending,e[24]=p.login,e[25]=p.loginError,e[26]=l):l=e[26],l}if(I.enabled||te.enabled||se.enabled||le.enabled){const l=p?.loginError??p?.completeSessionError??null;let x;e[27]!==_||e[28]!==L?(x={..._,...L},e[27]=_,e[28]=L,e[29]=x):x=e[29];let $;e[30]!==C||e[31]!==v||e[32]!==m||e[33]!==a||e[34]!==g||e[35]!==E||e[36]!==u||e[37]!==i||e[38]!==x||e[39]!==o||e[40]!==j?($=t.jsx(Je,{redirectUrl:u,callbackUrl:a,title:o,subtitle:i,brand:m,copy:g,variant:j,allowedSocialProviders:v,allowPassword:C,onAuthEvent:E,actions:x}),e[30]=C,e[31]=v,e[32]=m,e[33]=a,e[34]=g,e[35]=E,e[36]=u,e[37]=i,e[38]=x,e[39]=o,e[40]=j,e[41]=$):$=e[41];const M=$;if(!l)return M;let W;e[42]!==l?(W=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:l}),e[42]=l,e[43]=W):W=e[43];let A;return e[44]!==M||e[45]!==W?(A=t.jsxs("div",{className:"grid gap-4",children:[W,M]}),e[44]=M,e[45]=W,e[46]=A):A=e[46],A}let O;e[47]!==d?(O=d("common.authEntry.noLoginOptions"),e[47]=d,e[48]=O):O=e[48];let D;return e[49]!==O?(D=t.jsx("div",{children:O}),e[49]=O,e[50]=D):D=e[50],D}export{Te as A,dt as a,Xe as u};
|
|
1
|
+
import{a as V,Y as Fe,r as w,e as me,q as z,j as t,l as P,B as xe,o as Ve,m as ze,K as ue,c as oe,b as be,h as _e}from"./index-doEaURqC.js";import{I as ee}from"./input-BK5Sp8hZ.js";import{i as Qe}from"./use-is-desktop-app-BNujXJc_.js";import{d as He,e as Ke}from"./backoff-8mStPHYB.js";class Le extends Error{constructor(e,a){super(`Retrying exceeded the maxAttempts (${a}).`),this.name="RetryError",this.cause=e}}async function Ye(n,e){const{multiplier:a=2,maxTimeout:u=6e4,maxAttempts:f=5,minTimeout:o=1e3,jitter:i=1,isRetriable:m=()=>!0,signal:g}=e??{};if(!Number.isInteger(f)||f<1)throw new RangeError(`Cannot retry as 'maxAttempts' must be a positive integer: current value is ${f}`);if(!Number.isFinite(a)||a<1)throw new RangeError(`Cannot retry as 'multiplier' must be a finite number >= 1: current value is ${a}`);if(Number.isNaN(u)||u<=0)throw new RangeError(`Cannot retry as 'maxTimeout' must be a positive number: current value is ${u}`);if(Number.isNaN(o)||o<0)throw new RangeError(`Cannot retry as 'minTimeout' must be >= 0: current value is ${o}`);if(o>u)throw new RangeError(`Cannot retry as 'minTimeout' must be <= 'maxTimeout': current values 'minTimeout=${o}', 'maxTimeout=${u}'`);if(Number.isNaN(i)||i<0||i>1)throw new RangeError(`Cannot retry as 'jitter' must be between 0 and 1: current value is ${i}`);let j=0;for(;;){g?.throwIfAborted();try{return await n()}catch(v){if(!m(v))throw v;if(j+1>=f)throw new Le(v,f);const C=Ke(u,o,j,a,i);await He(C,g?{signal:g}:void 0)}j++}}const Oe={submitEmailPassword:({mode:n,email:e,password:a,name:u})=>n==="sign_up"?V.signUp.email({email:e,password:a,name:u||""}):V.signIn.email({email:e,password:a}),requestPasswordReset:({email:n,redirectTo:e})=>V.requestPasswordReset({email:n,redirectTo:e}),sendOtp:({email:n})=>V.emailOtp.sendVerificationOtp({email:n,type:"sign-in"}),submitOtp:({email:n,otp:e})=>V.signIn.emailOtp({email:n,otp:e}),socialSignIn:({provider:n,callbackURL:e})=>V.signIn.social({provider:n,callbackURL:e}),ssoSignIn:({providerId:n,callbackURL:e})=>V.signIn.sso({providerId:n,callbackURL:e}),onAuthenticated:n=>{window.location.href=n}},ge="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ge={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:n=>`Code sent to ${n}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:n=>`Continue with ${n}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Je({redirectUrl:n,callbackUrl:e="/",title:a,subtitle:u,brand:f,copy:o,variant:i="default",allowedSocialProviders:m,allowPassword:g=!0,onAuthEvent:j,actions:v}){const{emailAndPassword:C,resetPassword:E,emailOtp:y,socialProviders:N}=Fe(),d={...Oe,...v},h=s=>{try{j?.(s)}catch{}},I=i==="compact",te=m?N.providers.filter(s=>m.includes(s.name)):N.providers,se=N.enabled&&te.length>0,le=C.enabled&&(g||!y.enabled&&!se),de=N.enabled&&N.providers.length>0&&!se&&!y.enabled&&!le?N.providers:te,p=N.enabled&&de.length>0,F=C.enabled&&(g||!y.enabled&&!p),[b,_]=w.useState(""),[L,Q]=w.useState(""),[U,O]=w.useState(""),[D,l]=w.useState(""),[x,$]=w.useState(!1),[M,W]=w.useState(()=>y.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[A,H]=w.useState(""),[ye,we]=w.useState(!1),[Re,fe]=w.useState(null),r={...Ge,...o},ne=w.useId(),K=`${ne}-email`,Y=`${ne}-email-error`,ve=`${ne}-name`,Ee=`${ne}-password`,Se=`${ne}-otp`,k=M==="signUp",q=M==="forgotPassword",T=M==="emailOtp",re=me({mutationFn:async({email:s,password:c,name:R})=>{try{const Z=await d.submitEmailPassword({mode:k?"sign_up":"sign_in",email:s,password:c,name:R});if(Z.error)throw new Error(Z.error.message||(k?r.signUpFailed:r.signInFailed));return Z}catch(Z){throw Z instanceof Error?Z:new Error(r.authenticationFailed)}},onMutate:()=>{h({type:"started",method:"email_password",mode:k?"sign_up":"sign_in"})},onSuccess:()=>{h({type:"succeeded",method:"email_password",mode:k?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),d.onAuthenticated(n??e)},onError:s=>{h({type:"failed",method:"email_password",mode:k?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),z(k?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),ie=me({mutationFn:async({email:s})=>{const c=await d.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(c.error)throw new Error(c.error.message||r.resetEmailFailed);return c},onSuccess:()=>{z("password_reset_requested"),we(!0)},onError:s=>{z("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),G=me({mutationFn:async({email:s})=>{const c=await d.sendOtp({email:s});if(c.error)throw new Error(c.error.message||r.otpSendFailed);return c},onMutate:()=>{h({type:"started",method:"email_otp"})},onSuccess:()=>{h({type:"otp_sent",method:"email_otp"}),z("email_otp_sent"),$(!0)},onError:s=>{h({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),z("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),J=me({mutationFn:async({email:s,otp:c})=>{const R=await d.submitOtp({email:s,otp:c});if(R.error)throw new Error(R.error.message||r.invalidCode);return R},onMutate:()=>{h({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{h({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),d.onAuthenticated(n??e)},onError:s=>{h({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),z("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),ce=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),pe=()=>{b.trim()&&!ce(b)&&H(r.invalidEmail)},De=s=>{if(s.preventDefault(),!ce(b)){H(r.invalidEmail),h({type:"failed",method:"email_password",mode:k?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}re.mutate({email:b,password:L,name:U})},$e=s=>{if(s.preventDefault(),!ce(b)){H(r.invalidEmail);return}ie.mutate({email:b})},Me=s=>{if(s.preventDefault(),!ce(b)){H(r.invalidEmail),h({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}G.mutate({email:b})},We=s=>{s.preventDefault(),J.mutate({email:b,otp:D})},X=s=>c=>{s(c.target.value),je&&re.reset(),Ne&&ie.reset(),Ae&&(G.reset(),J.reset()),s===_&&A&&H("")},ae=s=>{W(s),O(""),l(""),$(!1),H(""),we(!1),fe(null),re.reset(),ie.reset(),G.reset(),J.reset()},S=re.isPending||ie.isPending||G.isPending||J.isPending,je=re.error,Ne=ie.error,Ae=G.error||J.error,B=k?b.trim()&&L.trim()&&U.trim():q?b.trim():T?x?D.trim():b.trim():b.trim()&&L.trim(),qe=s=>{if(!s)return null;const c=s.message.toLowerCase();return c.includes("unauthorized")||c.includes("401")?r.invalidEmailOrPassword:c.includes("already exists")||c.includes("409")?r.accountExists:c.includes("network")||c.includes("fetch")?r.networkError:c.includes("rate limit")||c.includes("429")?r.tooManyAttempts:c.includes("invalid")&&c.includes("otp")?r.invalidOrExpiredCode:s.message||r.genericError},Ce=je||Ne||Ae||Re,Ue=async s=>{h({type:"started",method:"social",provider:s}),fe(null);try{const c=await d.socialSignIn({provider:s,callbackURL:n??e});if(c.error)throw new Error(c.error.message||r.authenticationFailed)}catch(c){const R=c instanceof Error?c.message:String(c);h({type:"failed",method:"social",provider:s,stage:"redirect",error:R}),z("social_signin_failed",{provider:s,error:R}),fe(c instanceof Error?c:new Error(R))}},Be=q?r.resetPasswordTitle:T&&x?r.verificationCodeTitle:a??r.welcomeTitle,Pe=q?r.resetPasswordSubtitle:T&&x?r.codeSentTo(b):u===void 0?r.defaultSubtitle:u;return t.jsxs("div",{className:P("grid w-full",I?"gap-5":"gap-10"),children:[f??t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:P("font-medium",I?"text-xl leading-7":"text-2xl leading-8"),children:Be}),Pe&&t.jsx("p",{className:P("text-muted-foreground",I?"text-sm leading-5":"text-base leading-6"),children:Pe})]}),Ce&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:qe(Ce)}),ye&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:r.resetEmailSent}),!q&&!(T&&x)&&p&&t.jsx("div",{className:"grid gap-2",children:de.map(s=>t.jsxs("button",{type:"button",disabled:S,onClick:()=>{Ue(s.name)},className:P("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50 compact:rounded-lg",I?"h-11":"h-12"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:P("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),r.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!q&&!(T&&x)&&p&&(F||y.enabled)&&t.jsxs("div",{className:P("flex items-center gap-2.5",I?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:P("text-muted-foreground",I?"text-sm":"text-base"),children:r.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),T&&y.enabled&&t.jsx(t.Fragment,{children:x?t.jsxs("form",{onSubmit:We,className:P("grid gap-2",I&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:Se,className:P("text-sm font-medium text-foreground",I&&"sr-only"),children:r.verificationCodeLabel}),t.jsx(ee,{id:Se,type:"text",placeholder:r.enterCodePlaceholder,value:D,onChange:X(l),required:!0,disabled:S,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx("button",{type:"submit",disabled:S||!B,className:P("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",I?"h-11 sm:w-auto":"h-12 w-full"),children:S?r.verifying:r.verify}),t.jsx("button",{type:"button",onClick:()=>{$(!1),l(""),G.reset(),J.reset()},disabled:S,className:P("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",I&&"sm:col-span-2"),children:r.useDifferentEmail})]}):t.jsxs("form",{onSubmit:Me,className:P("grid gap-2",I&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:K,className:P("text-sm font-medium text-foreground",I&&"sr-only"),children:r.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:r.emailPlaceholder,value:b,onChange:X(_),onBlur:pe,required:!0,disabled:S,autoComplete:"email","aria-invalid":!!A,"aria-describedby":A?Y:void 0,className:"h-11 rounded-lg"}),A&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive",children:A})]}),t.jsx("button",{type:"submit",disabled:S||!B,className:P("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",I?"h-11 sm:w-auto":"h-12 w-full"),children:S?r.sending:r.sendCode})]})}),q&&F&&!ye&&t.jsxs("form",{onSubmit:$e,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:r.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:S,autoComplete:"email","aria-invalid":!!A,"aria-describedby":A?Y:void 0,className:"h-11 rounded-lg"}),A&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:A})]}),t.jsx(xe,{type:"submit",disabled:S||!B,className:"w-full font-semibold",size:"xl",children:S?r.sending:r.sendResetLink})]}),!q&&!T&&F&&t.jsxs("form",{onSubmit:De,className:"grid gap-5",children:[k&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:ve,className:"block text-sm font-medium text-foreground mb-2",children:r.nameLabel}),t.jsx(ee,{id:ve,type:"text",placeholder:r.namePlaceholder,value:U,onChange:X(O),required:!0,disabled:S,autoComplete:"name",className:"h-11 rounded-lg"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:r.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:S,autoComplete:"email","aria-invalid":!!A,"aria-describedby":A?Y:void 0,className:"h-11 rounded-lg"}),A&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:A})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:Ee,className:"block text-sm font-medium text-foreground",children:r.passwordLabel}),!k&&E.enabled&&t.jsx("button",{type:"button",onClick:()=>ae("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r.forgotPassword})]}),t.jsx(ee,{id:Ee,type:"password",placeholder:"••••••••",value:L,onChange:X(Q),required:!0,disabled:S,autoComplete:k?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:P("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",B?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:P("p-1",!B&&"pointer-events-none"),children:t.jsx(xe,{type:"submit",disabled:S||!B,className:P("w-full font-semibold"),size:"xl","aria-hidden":!B,children:S?k?r.creatingAccount:r.signingIn:r.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:q?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:S,className:ge,children:r.backToSignIn}):T&&F?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:S,className:ge,children:r.signInWithPassword}):!T&&F?t.jsxs(t.Fragment,{children:[k?r.alreadyHaveAccount:r.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>ae(k?"signIn":"signUp"),disabled:S,className:ge,children:k?r.signIn:r.signUp}),y.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>ae("emailOtp"),disabled:S,className:ge,children:r.signInWithEmailCode})]})]}):null})]})}async function he(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Xe(){const n=Ve(),e=Qe(),a=ze({queryKey:ue.desktopAuthStatus(),queryFn:async()=>(await he()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[u,f]=w.useState(!1),[o,i]=w.useState(null),[m,g]=w.useState(!1),[j,v]=w.useState(null);w.useEffect(()=>{},[e,n]);async function C(){f(!0),i(null);try{const d=await he();await d.performAuthLogin();const h=await d.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),h)}catch(d){i(d instanceof Error?d.message:"Sign-in failed")}finally{f(!1)}}async function E(){f(!0);try{const d=await he();await d.performAuthLogout();const h=await d.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),h)}finally{f(!1)}}async function y(){g(!0),v(null);let d;try{d=await he()}catch(h){v(h instanceof Error?h.message:"Sign-in failed"),g(!1);return}try{await d.performAuthCompleteSession()}catch(h){v(h instanceof Error?h.message:"Sign-in failed")}finally{try{const h=await d.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),h)}finally{g(!1)}}}async function N(){await a.refetch()}return{status:a.data,isChecking:a.isLoading,isRetryingStatus:a.isFetching,isPending:u,loginError:o,login:C,logout:E,isCompletingSession:m,completeSessionError:j,completeSession:y,retryStatus:N}}function Ze(n){return!(n.emailAndPassword.enabled||n.emailOtp.enabled||n.socialProviders.enabled)&&!n.sso.enabled&&n.magicLink.enabled}function et(){return oe.c(10),Xe(),null}function tt(n){const e=oe.c(25),{onContinue:a,isPending:u,error:f}=n,o=be();let i;e[0]!==o?(i=o("common.authEntry.browserOnlyTitle"),e[0]=o,e[1]=i):i=e[1];let m;e[2]!==i?(m=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:i}),e[2]=i,e[3]=m):m=e[3];let g;e[4]!==o?(g=o("common.authEntry.browserOnlyDescription"),e[4]=o,e[5]=g):g=e[5];let j;e[6]!==g?(j=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:g}),e[6]=g,e[7]=j):j=e[7];let v;e[8]!==m||e[9]!==j?(v=t.jsxs("div",{className:"flex flex-col gap-1",children:[m,j]}),e[8]=m,e[9]=j,e[10]=v):v=e[10];let C;e[11]!==a?(C=()=>{a()},e[11]=a,e[12]=C):C=e[12];let E;e[13]!==o?(E=o("common.authEntry.browserOnlyCta"),e[13]=o,e[14]=E):E=e[14];let y;e[15]!==u||e[16]!==C||e[17]!==E?(y=t.jsx(xe,{onClick:C,disabled:u,children:E}),e[15]=u,e[16]=C,e[17]=E,e[18]=y):y=e[18];let N;e[19]!==f?(N=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[19]=f,e[20]=N):N=e[20];let d;return e[21]!==v||e[22]!==y||e[23]!==N?(d=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[v,y,N]}),e[21]=v,e[22]=y,e[23]=N,e[24]=d):d=e[24],d}function Ie(n){const e=oe.c(8),{label:a,error:u}=n;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(_e,{size:"lg"}),e[0]=f):f=e[0];let o;e[1]!==a?(o=a&&t.jsx("p",{className:"text-sm text-muted-foreground",children:a}),e[1]=a,e[2]=o):o=e[2];let i;e[3]!==u?(i=u&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:u}),e[3]=u,e[4]=i):i=e[4];let m;return e[5]!==o||e[6]!==i?(m=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[f,o,i]}),e[5]=o,e[6]=i,e[7]=m):m=e[7],m}class ke{constructor(e){this.response=e}response}function st(n){return n.startsWith("/")&&!n.startsWith("//")?n:"/"}function nt({redirectTo:n,onAuthEvent:e}){const a=be(),[u,f]=w.useState(null),o=w.useEffectEvent(i=>{try{e?.(i)}catch{}});return w.useEffect(()=>{let i=!1;return(async()=>{o({type:"started",method:"local"});try{let m;try{m=await Ye(async()=>{const g=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(g.status>=500)throw new ke(g);return g},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(g){if(g instanceof Le&&g.cause instanceof ke)m=g.cause.response;else throw g}if(!m.ok){const g=await m.json().catch(()=>({}));throw new Error(g?.error||a("common.authEntry.autoLoginFailed"))}i||(o({type:"succeeded",method:"local"}),window.location.href=st(n))}catch(m){i||(o({type:"failed",method:"local",stage:"authenticate",error:m instanceof Error?m.message:String(m)}),f(m instanceof Error?m.message:a("common.authEntry.autoLoginFailed")))}})(),()=>{i=!0}},[n]),u?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:a("common.authEntry.autoLoginFailedWithError",{error:u})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:a("common.authEntry.tryRestartingServer")})]})}):t.jsx(Te,{})}function Te(){const n=oe.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsx(_e,{size:"lg",label:"Signing in"})}),n[0]=e):e=n[0],e}function rt({callbackURL:n,providerId:e,ssoSignIn:a,onAuthEvent:u}){const f=w.useEffectEvent(i=>{try{u?.(i)}catch{}}),o=w.useEffectEvent(a);return w.useEffect(()=>{(async()=>{f({type:"started",method:"sso",provider:e});try{const i=await o({providerId:e,callbackURL:n});if(i.error)throw new Error(i.error.message||"SSO redirect failed")}catch(i){f({type:"failed",method:"sso",provider:e,stage:"redirect",error:i instanceof Error?i.message:String(i)})}})()},[e,n]),t.jsx(Te,{})}function dt(n){const e=oe.c(51),{callbackUrl:a,redirectUrl:u,allowAutoLogin:f,title:o,subtitle:i,brand:m,copy:g,variant:j,allowedSocialProviders:v,allowPassword:C,onAuthEvent:E,onAuthenticated:y}=n,N=f===void 0?!0:f,d=be(),{sso:h,emailAndPassword:I,magicLink:te,emailOtp:se,socialProviders:le,localMode:de}=Fe(),p=et(),F=u||a;let b;e[0]!==y?(b=y?{onAuthenticated:y}:void 0,e[0]=y,e[1]=b):b=e[1];const _=b,L=p?.actions;let Q;e[2]!==_||e[3]!==L?(Q={...Oe,..._,...L},e[2]=_,e[3]=L,e[4]=Q):Q=e[4];const U=Q;if(p?.isPending){let l;e[5]!==d?(l=d("common.authEntry.finishSignInInBrowser"),e[5]=d,e[6]=l):l=e[6];let x;return e[7]!==p.loginError||e[8]!==l?(x=t.jsx(Ie,{label:l,error:p.loginError}),e[7]=p.loginError,e[8]=l,e[9]=x):x=e[9],x}if(p?.isCompletingSession){let l;e[10]!==d?(l=d("common.authEntry.finishingSignIn"),e[10]=d,e[11]=l):l=e[11];let x;return e[12]!==p.completeSessionError||e[13]!==l?(x=t.jsx(Ie,{label:l,error:p.completeSessionError}),e[12]=p.completeSessionError,e[13]=l,e[14]=x):x=e[14],x}if(de&&N){let l;return e[15]!==E||e[16]!==F?(l=t.jsx(nt,{redirectTo:F,onAuthEvent:E}),e[15]=E,e[16]=F,e[17]=l):l=e[17],l}if(h.enabled){let l;return e[18]!==E||e[19]!==F||e[20]!==U.ssoSignIn||e[21]!==h.providerId?(l=t.jsx(rt,{callbackURL:F,providerId:h.providerId,ssoSignIn:U.ssoSignIn,onAuthEvent:E}),e[18]=E,e[19]=F,e[20]=U.ssoSignIn,e[21]=h.providerId,e[22]=l):l=e[22],l}if(p&&Ze({emailAndPassword:I,emailOtp:se,socialProviders:le,magicLink:te,sso:h})){let l;return e[23]!==p.isPending||e[24]!==p.login||e[25]!==p.loginError?(l=t.jsx(tt,{onContinue:p.login,isPending:p.isPending,error:p.loginError}),e[23]=p.isPending,e[24]=p.login,e[25]=p.loginError,e[26]=l):l=e[26],l}if(I.enabled||te.enabled||se.enabled||le.enabled){const l=p?.loginError??p?.completeSessionError??null;let x;e[27]!==_||e[28]!==L?(x={..._,...L},e[27]=_,e[28]=L,e[29]=x):x=e[29];let $;e[30]!==C||e[31]!==v||e[32]!==m||e[33]!==a||e[34]!==g||e[35]!==E||e[36]!==u||e[37]!==i||e[38]!==x||e[39]!==o||e[40]!==j?($=t.jsx(Je,{redirectUrl:u,callbackUrl:a,title:o,subtitle:i,brand:m,copy:g,variant:j,allowedSocialProviders:v,allowPassword:C,onAuthEvent:E,actions:x}),e[30]=C,e[31]=v,e[32]=m,e[33]=a,e[34]=g,e[35]=E,e[36]=u,e[37]=i,e[38]=x,e[39]=o,e[40]=j,e[41]=$):$=e[41];const M=$;if(!l)return M;let W;e[42]!==l?(W=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:l}),e[42]=l,e[43]=W):W=e[43];let A;return e[44]!==M||e[45]!==W?(A=t.jsxs("div",{className:"grid gap-4",children:[W,M]}),e[44]=M,e[45]=W,e[46]=A):A=e[46],A}let O;e[47]!==d?(O=d("common.authEntry.noLoginOptions"),e[47]=d,e[48]=O):O=e[48];let D;return e[49]!==O?(D=t.jsx("div",{children:O}),e[49]=O,e[50]=D):D=e[50],D}export{Te as A,dt as a,Xe as u};
|
|
@@ -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-doEaURqC.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-doEaURqC.js";import{i as u,a as p}from"./mcp-oauth-61IHYJoj.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-4KsYbqo_.js → automation-list-row-DuetYP8A.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-doEaURqC.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-Dg6YJ6PP.js";import{A as me,ac as ue}from"./agent-icon-CzsnrYjD.js";import{i as de}from"./DotsVertical-BITRq5d-.js";import{s as fe}from"./Trash01-mB4s-hrv.js";import{i as ge}from"./Zap-CSRFlEXK.js";import{a as xe}from"./use-virtual-mcp-B-mdsJbn.js";import{a as pe}from"./use-automations-V0dkF89H.js";function Ce(c){const e=q.c(80),{automation:s,showAgent:a,onClick:n}=c,i=J(),{remove:o}=pe(),[l,K]=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),K(!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 $,B;e[33]===Symbol.for("react.memo_cache_sentinel")?($=m=>{m.stopPropagation(),K(!0)},B=t.jsx(fe,{size:16}),e[33]=$,e[34]=B):($=e[33],B=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:$,children:[B,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:K,children:z}),e[74]=l,e[75]=z,e[76]=F):F=e[76];let I;return e[77]!==A||e[78]!==F?(I=t.jsxs(t.Fragment,{children:[A,F]}),e[77]=A,e[78]=F,e[79]=I):I=e[79],I}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 X,a0 as it,z as rt,a6 as ct,K as tt,j as s,l as ut,m as dt,eL as mt}from"./index-JMsKOuRI.js";import{u as ft}from"./useInfiniteQuery-CuJHgIBx.js";import{u as xt}from"./use-connection-5dW0kEfg.js";import{u as pt}from"./use-mcp-client-e1wyTE1C.js";import{b as gt}from"./use-virtual-mcp-zNwvJ0Qw.js";import{b as ht,a as Rt}from"./sheet-D9ryq7NB.js";import{e as jt,a as Nt,b as st,T as G,d as bt,c as V}from"./table-Bn8Ki7JL.js";import{E as et}from"./empty-state-BiVhgtC1.js";import{u as Tt}from"./use-infinite-scroll-B-wkakMK.js";import{a as St}from"./use-members-HVNlL38Y.js";import{g as vt}from"./task-status-CgnZNHAt.js";import{e as wt}from"./use-automations-CSgRicI5.js";import{T as Ct,f as at,a as nt}from"./thread-sheet-body-xoK93iNg.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 W=50;function Y(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=X(),{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(Y,{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(Y,{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(Y,{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(Y,{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=X();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=X(),{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:W,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 Z=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]!==Z||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?Z: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]=Z,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)<W))return r.length*W}export{Bt as A,It as u};
|
|
1
|
+
import{c as z,r as lt,b as X,a0 as it,z as rt,a6 as ct,K as tt,j as s,l as ut,m as dt,eL as mt}from"./index-doEaURqC.js";import{u as ft}from"./useInfiniteQuery-DCZL7BN4.js";import{u as xt}from"./use-connection-PgTQPnAp.js";import{u as pt}from"./use-mcp-client-D2DgMGL-.js";import{b as gt}from"./use-virtual-mcp-B-mdsJbn.js";import{b as ht,a as Rt}from"./sheet-ZoEgH6s-.js";import{e as jt,a as Nt,b as st,T as G,d as bt,c as V}from"./table-D7l9brRh.js";import{E as et}from"./empty-state-ClBiZqLf.js";import{u as Tt}from"./use-infinite-scroll-Bm905rys.js";import{a as St}from"./use-members-C_tB-qI-.js";import{g as vt}from"./task-status-C7fhyr8_.js";import{e as wt}from"./use-automations-V0dkF89H.js";import{T as Ct,f as at,a as nt}from"./thread-sheet-body-C52UGBXx.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 W=50;function Y(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=X(),{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(Y,{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(Y,{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(Y,{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(Y,{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=X();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=X(),{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:W,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 Z=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]!==Z||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?Z: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]=Z,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)<W))return r.length*W}export{Bt as A,It as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,j as e,b as $,a0 as D,d as M,r as q,n as d,B as V,fy as F,q as R}from"./index-
|
|
1
|
+
import{c as k,j as e,b as $,a0 as D,d as M,r as q,n as d,B as V,fy as F,q as R}from"./index-doEaURqC.js";import{s as G}from"./Plus-qASEo4cN.js";import{i as S}from"./Zap-CSRFlEXK.js";import{S as H}from"./search-input-CCUlZDzf.js";import{E as T}from"./empty-state-ClBiZqLf.js";import{u as J}from"./use-automations-V0dkF89H.js";import{u as K}from"./use-navigate-to-agent-TwlhlbmB.js";import{A as O}from"./automation-list-row-DuetYP8A.js";import{b as Q}from"./use-virtual-mcp-B-mdsJbn.js";import{R as U}from"./require-capability-vhXMBpff.js";import"./SearchMd-B6NDUgzQ.js";import"./use-mcp-client-D2DgMGL-.js";import"./auth-D3Q2r2cz.js";import"./hooks-C8t7cMQJ.js";import"./backoff-8mStPHYB.js";import"./task-board-BXLBBo-B.js";import"./schema-BVqtjcyJ.js";import"./thread-intent-DuCE7MYG.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-BknN0SVI.js";import"./alert-dialog-Dg6YJ6PP.js";import"./agent-icon-CzsnrYjD.js";import"./AlertCircle-Cat-Fy2i.js";import"./Tool01-H9OcfGdq.js";import"./ArrowUp-CbPBDOpZ.js";import"./ArrowLeft-DuxVUo5_.js";import"./ArrowRight-CsoDgnUj.js";import"./XCircle-Cu2Sy8Aw.js";import"./ZoomOut-Burao8Eg.js";import"./Globe04-C_9DD9oO.js";import"./CheckCircle-Cj4PQGuv.js";import"./Check-BZXRTDaX.js";import"./ChevronUp-DGt31MPD.js";import"./UserSquare-BfT6tB5U.js";import"./Copy01-B6hr4CBg.js";import"./CreditCard01-CiYLi_pR.js";import"./DotsVertical-BITRq5d-.js";import"./Download01-CsYfHghd.js";import"./Eye-rQUtSbk6.js";import"./Share07-CMPYQYHk.js";import"./XClose-DFUqDOc8.js";import"./Image01-BLIf6uY9.js";import"./Key01-SGIR_QrT.js";import"./LayoutLeft-GBQ0rQxQ.js";import"./Link01-BnVQGp2l.js";import"./LinkExternal01-Dh0AABP8.js";import"./Monitor01-CxisI5ut.js";import"./Sun-BSFyLDhg.js";import"./Package-DsU1cU6S.js";import"./Palette-CzoNEzRs.js";import"./SearchLg-qmi8uaeX.js";import"./Stars01-cdnol_cb.js";import"./Trash01-mB4s-hrv.js";import"./Upload01-Uv_jtHIk.js";import"./User01-DHGCVvV3.js";import"./Users01-C_qUmfZB.js";import"./X-vKTIsgL1.js";import"./access-gate-Bbnx_Qh-.js";import"./capability-load-error-CYpF4fm6.js";function W(){const t=k.c(20),o=$(),{org:l}=D(),{data:y}=J(void 0),g=y===void 0?[]:y,E=Q(),P=K(),f=M(),[x,z]=q.useState(""),h=x.toLowerCase(),b=new Map(E.map(X)),A=g.filter(i=>{if(!h||i.name.toLowerCase().includes(h))return!0;if(i.virtual_mcp_id){const p=b.get(i.virtual_mcp_id);if(p&&p.title.toLowerCase().includes(h))return!0}return!1}),B=(i,p)=>{const N=p&&b.has(p)?p:F(l.id);R("automations_list_row_clicked",{automation_id:i,agent_id:N,source:"settings_automations"}),P(N,{panel:`automation:${i}`})};let c;t[0]!==f||t[1]!==l.slug?(c=()=>{R("automations_empty_state_browse_agents_clicked"),f({to:"/$org/settings/agents",params:{org:l.slug}})},t[0]=f,t[1]=l.slug,t[2]=c):c=t[2];const L=c,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(H,{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(V,{size:"sm",onClick:L,children:[e.jsx(G,{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(O,{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 X(t){return[t.id,t]}function oe(){const t=k.c(1);let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(U,{capability:"automations:manage",area:"automations",children:e.jsx(W,{})}),t[0]=o):o=t[0],o}export{oe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as d}from"./index-
|
|
1
|
+
import{$ as d}from"./index-doEaURqC.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,aE as R,bb as V,bc as I,bd as $}from"./index-
|
|
1
|
+
import{c as k,j as i,l as f,aE as R,bb as V,bc as I,bd as $}from"./index-doEaURqC.js";import{s as E}from"./User01-DHGCVvV3.js";function O(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 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("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 W(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(E,{size:D(h)})}):i.jsxs(i.Fragment,{children:[l&&i.jsx(U,{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(O,{className:w,...o,children:v}),e[30]=o,e[31]=v,e[32]=w,e[33]=A):A=e[33],A}function B(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(W,{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}B.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{B as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,l,j as u,be as v,aE as b}from"./index-
|
|
1
|
+
import{c as g,l,j as u,be as v,aE as b}from"./index-doEaURqC.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"},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 h(d){const e=g.c(14);let r,s,a,n,t;e[0]!==d?({className:r,variant:t,size:a,asChild:n,...s}=d,e[0]=d,e[1]=r,e[2]=s,e[3]=a,e[4]=n,e[5]=t):(r=e[1],s=e[2],a=e[3],n=e[4],t=e[5]);const c=(n===void 0?!1:n)?v:"span";let i;e[6]!==r||e[7]!==a||e[8]!==t?(i=l(f({variant:t,size:a}),r),e[6]=r,e[7]=a,e[8]=t,e[9]=i):i=e[9];let o;return e[10]!==c||e[11]!==s||e[12]!==i?(o=u.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{h as B};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{w as Oe}from"./section-preview-url-Csj0_ZDg.js";import{X as vt,r as jt}from"./claim-phase-copy-0btUuJoC.js";import{c as I,b as O,r as W,l as Z,j as o,K as je,m as ke,h as ze,B as kt}from"./index-
|
|
1
|
+
import{w as Oe}from"./section-preview-url-Csj0_ZDg.js";import{X as vt,r as jt}from"./claim-phase-copy-0btUuJoC.js";import{c as I,b as O,r as W,l as Z,j as o,K as je,m as ke,h as ze,B as kt}from"./index-doEaURqC.js";import{T as xe,R as Fe,a as Ue,b as fe,K as Me,P as He,s as qe,e as Ge,S as Ve,r as Ct,D as Ke,c as Ye,u as Je,C as We,v as Nt}from"./rich-text-link-control-i_tw_Jd2.js";import{h as Bt,i as St,j as wt}from"./agent-site-editor-content-BMF_TO-O.js";import{E as Pt,a5 as _t,X as Xe,Y as Qe,Z as Ze,_ as Tt,v as Ce,m as Lt,a2 as et}from"./agent-icon-CzsnrYjD.js";import{s as tt}from"./Plus-qASEo4cN.js";import{a as we,b as At,e as It,C as Et,c as $t,d as Rt}from"./command-CDaLB2Ox.js";import{a as Dt,b as Ot,P as zt}from"./popover-GUR8piky.js";import{a as Ft}from"./Copy01-B6hr4CBg.js";import{s as ye}from"./Trash01-mB4s-hrv.js";import{aR as Ut,b as Mt,x as Ht}from"./runnable-block-editor-CdEmnBad.js";import{u as lt,s as st,a as Ne,b as ot}from"./index-CDAG9yf3.js";import{s as rt}from"./hooks-enzgIMXj.js";import{B as qt}from"./index-Ci3v6d1n.js";import{F as Be,T as le,I as te,s as R,p as ae,R as re,A as ne,j as oe}from"./primitives-CHkTFFF-.js";import{i as nt}from"./Check-BZXRTDaX.js";import{a as Gt}from"./Image01-BLIf6uY9.js";import{a as Vt}from"./Package-DsU1cU6S.js";import{s as Kt}from"./XClose-DFUqDOc8.js";import{L as ue}from"./label-tAsQMZ2G.js";import{c as Yt,d as Jt,b as Wt,D as Xt}from"./dialog-C36x61_J.js";import{I as ve}from"./input-BK5Sp8hZ.js";const pe=u=>typeof u=="string"?u:"",Qt=/\/blog\.tsx?$/;function it(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"||!Qt.test(l.__resolveType))continue;const s=pe(l[e]);if(s)return s}return null}const Zt=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]);function el(u){if(!u||typeof u!="object"||Array.isArray(u))return null;const e=u;return typeof e.__resolveType!="string"||!Zt.has(e.__resolveType)?null:typeof e.path=="string"?e.path:null}function tl(u){return vt(u).filter(e=>e!=="*").length}function at(u,e){let t=null,n=Number.POSITIVE_INFINITY;for(const l of Object.values(u)){const s=el(l);if(!s||!e.test(JSON.stringify(l)))continue;const r=tl(s);r<n&&(t=s,n=r)}return t}const ll=/blogpostpage/i,sl=/blogcategorypage/i;function ol(u){return it(u,"pageSlug")??at(u,ll)}function rl(u){return it(u,"categorySlug")??at(u,sl)}function nl(u){const e=u.categories;if(!Array.isArray(e)||e.length===0)return"";const t=e[0];return pe(t?.slug)}function il(u,e){let t=u;if(/:category\??/.test(t)){if(!e.category)return null;t=t.replace(/:category\??/g,encodeURIComponent(e.category))}if(/:slug\??/.test(t)){if(!e.slug)return null;t=t.replace(/:slug\??/g,encodeURIComponent(e.slug))}return t}const al=/:(?:categorySlug|categoria|category|slug)\??/,cl=/:(?:categorySlug|categoria|category|slug)\??/g;function dl(u,e){return al.test(u)?e?u.replace(cl,encodeURIComponent(e)):null:u}function Js({decofile:u,category:e,previewBaseUrl:t,draftPointer:n}){if(!t)return null;const l=rl(u);if(!l)return null;const s=dl(l,pe(e.slug));if(!s)return null;try{return Oe(new URL(s,t).href,n)}catch{return null}}function Ws({decofile:u,post:e,previewBaseUrl:t,draftPointer:n}){if(!t)return null;const l=ol(u);if(!l)return null;const s=il(l,{category:nl(e),slug:pe(e.slug)});if(!s)return null;try{return Oe(new URL(s,t).href,n)}catch{return null}}const Pe={app:"sandbox.blockPicker.blocksLabel",site:"sandbox.blockPicker.customBlocksLabel"};function ul(u){const e=I.c(6),{iconName:t,iconUrl:n,alt:l}=u;let s;e[0]!==t?(s=_t(t)??Pt,e[0]=t,e[1]=s):s=e[1];const r=s;let a;return e[2]!==r||e[3]!==l||e[4]!==n?(a=o.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-md border bg-muted",children:n?o.jsx("img",{src:n,alt:l,className:"size-5 object-contain"}):o.jsx(r,{size:16,className:"text-muted-foreground"})}),e[2]=r,e[3]=l,e[4]=n,e[5]=a):a=e[5],a}function _e(u){const e=I.c(19),{type:t,onInsert:n}=u,l=`${t.title} ${t.resolveType} ${t.description??""}`;let s;e[0]!==n||e[1]!==t.resolveType?(s=()=>n(t.resolveType),e[0]=n,e[1]=t.resolveType,e[2]=s):s=e[2];let r;e[3]!==t.iconName||e[4]!==t.iconUrl||e[5]!==t.title?(r=o.jsx(ul,{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 a;e[7]!==t.title?(a=o.jsx("span",{className:"text-sm font-medium",children:t.title}),e[7]=t.title,e[8]=a):a=e[8];let p;e[9]!==t.description?(p=t.description&&o.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[9]=t.description,e[10]=p):p=e[10];let c;e[11]!==a||e[12]!==p?(c=o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[a,p]}),e[11]=a,e[12]=p,e[13]=c):c=e[13];let m;return e[14]!==l||e[15]!==s||e[16]!==r||e[17]!==c?(m=o.jsxs(At,{value:l,onSelect:s,className:"flex items-center gap-2.5",children:[r,c]}),e[14]=l,e[15]=s,e[16]=r,e[17]=c,e[18]=m):m=e[18],m}function Te(u){const e=I.c(45),{blockTypes:t,onInsert:n,alwaysShow:l}=u,s=l===void 0?!1:l,r=O(),[a,p]=W.useState(!1);let c,m;if(e[0]!==t){c=[],m=[];for(const _ of t)(_.source==="site"?m:c).push(_);e[0]=t,e[1]=c,e[2]=m}else c=e[1],m=e[2];let g;e[3]!==n?(g=_=>{n(_),p(!1)},e[3]=n,e[4]=g):g=e[4];const h=g,b=c.length>0&&m.length>0,i=s?"h-10":"";let d;e[5]!==i?(d=Z("group/insert relative flex h-6 items-center justify-center",i),e[5]=i,e[6]=d):d=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("div",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-border"}),e[7]=f):f=e[7];let x;e[8]!==r?(x=r("sandbox.blockPicker.insertBlockButton"),e[8]=r,e[9]=x):x=e[9];let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx(tt,{size:14}),e[10]=y):y=e[10];let j;e[11]!==x?(j=o.jsx(Dt,{asChild:!0,children:o.jsx("button",{type:"button","aria-label":x,className:"relative z-10 flex h-6 w-6 items-center justify-center classic:rounded-full compact:rounded-lg border bg-background text-muted-foreground transition-all hover:border-primary hover:text-primary cursor-pointer",children:y})}),e[11]=x,e[12]=j):j=e[12];let v;e[13]!==r?(v=r("sandbox.blockPicker.searchPlaceholder"),e[13]=r,e[14]=v):v=e[14];let C;e[15]!==v?(C=o.jsx(It,{placeholder:v}),e[15]=v,e[16]=C):C=e[16];let k;e[17]!==r?(k=r("sandbox.blockPicker.noBlocksFound"),e[17]=r,e[18]=k):k=e[18];let N;e[19]!==k?(N=o.jsx(Et,{children:k}),e[19]=k,e[20]=N):N=e[20];let S;e[21]!==h||e[22]!==b||e[23]!==m||e[24]!==r?(S=m.length>0&&o.jsx(we,{heading:b?r(Pe.site):void 0,children:m.map(_=>o.jsx(_e,{type:_,onInsert:h},_.resolveType))}),e[21]=h,e[22]=b,e[23]=m,e[24]=r,e[25]=S):S=e[25];let B;e[26]!==c||e[27]!==h||e[28]!==b||e[29]!==r?(B=c.length>0&&o.jsx(we,{heading:b?r(Pe.app):void 0,children:c.map(_=>o.jsx(_e,{type:_,onInsert:h},_.resolveType))}),e[26]=c,e[27]=h,e[28]=b,e[29]=r,e[30]=B):B=e[30];let P;e[31]!==N||e[32]!==S||e[33]!==B?(P=o.jsxs($t,{className:"max-h-80",children:[N,S,B]}),e[31]=N,e[32]=S,e[33]=B,e[34]=P):P=e[34];let T;e[35]!==C||e[36]!==P?(T=o.jsx(Ot,{className:"w-80 p-0",align:"center",children:o.jsxs(Rt,{children:[C,P]})}),e[35]=C,e[36]=P,e[37]=T):T=e[37];let L;e[38]!==a||e[39]!==T||e[40]!==j?(L=o.jsxs(zt,{open:a,onOpenChange:p,children:[j,T]}),e[38]=a,e[39]=T,e[40]=j,e[41]=L):L=e[41];let w;return e[42]!==L||e[43]!==d?(w=o.jsxs("div",{className:d,children:[f,L]}),e[42]=L,e[43]=d,e[44]=w):w=e[44],w}function fl({html:u,placeholder:e,onChange:t}){const n=W.useRef(t);n.current=t;const[l,s]=W.useState(!1),r=lt({extensions:[st.configure({link:{HTMLAttributes:{}},heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,bulletList:!1,orderedList:!1,listItem:!1,dropcursor:!1,gapcursor:!1}),rt.configure({placeholder:e??"Write something…"})],content:u||"",editorProps:{attributes:{class:Z("prose prose-sm dark:prose-invert max-w-none focus:outline-none","leading-relaxed [&_p]:my-0")}},onUpdate:({editor:p})=>{const c=p.getHTML();n.current(c==="<p></p>"?"":c)}}),a=Ne({editor:r,selector:({editor:p})=>({isFocused:p?.isFocused??!1,bold:p?.isActive("bold")??!1,italic:p?.isActive("italic")??!1,underline:p?.isActive("underline")??!1,link:p?.isActive("link")??!1})});return r?o.jsxs("div",{className:"relative",children:[(a.isFocused||l)&&o.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:[o.jsx(xe,{active:a.bold,label:"Bold",onClick:()=>r.chain().focus().toggleBold().run(),children:o.jsx(Xe,{size:14})}),o.jsx(xe,{active:a.italic,label:"Italic",onClick:()=>r.chain().focus().toggleItalic().run(),children:o.jsx(Qe,{size:14})}),o.jsx(xe,{active:a.underline,label:"Underline",onClick:()=>r.chain().focus().toggleUnderline().run(),children:o.jsx(Ze,{size:14})}),o.jsx(Fe,{editor:r,active:a.link,open:l,onOpenChange:s})]}),o.jsx(ot,{editor:r,className:"text-[15px] text-foreground"})]}):null}function ml(u,e){const t=u.length?u.split(`
|
|
2
2
|
`):[""],n=e?"ol":"ul",l=t.map(s=>`<li><p>${s}</p></li>`).join("");return`<${n}>${l}</${n}>`}function pl(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 s=l.children.length===1?l.children[0]:null;return(s?.tagName==="P"?s.innerHTML:l.innerHTML).trim()})}const xl=["1","2","3"],gl={1:"sandbox.plainBlocks.headingLevel1",2:"sandbox.plainBlocks.headingLevel2",3:"sandbox.plainBlocks.headingLevel3"},Le={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 hl(u){const e=I.c(23),{text:t,level:n,onChange:l}=u,[s,r]=W.useState(!1),a=O(),p=n||"2";let c;e[0]!==s||e[1]!==p||e[2]!==l||e[3]!==a||e[4]!==t?(c=s&&o.jsx(Be,{children:xl.map(y=>o.jsxs(le,{active:p===y,label:a(gl[y]),onClick:()=>l({text:t,level:y}),children:["H",y]},y))}),e[0]=s,e[1]=p,e[2]=l,e[3]=a,e[4]=t,e[5]=c):c=e[5];let m;e[6]!==p||e[7]!==l?(m=y=>l({text:y,level:p}),e[6]=p,e[7]=l,e[8]=m):m=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]!==a?(b=a("sandbox.plainBlocks.headingPlaceholder"),e[11]=a,e[12]=b):b=e[12];const i=Le[p]??Le[2];let d;e[13]!==i?(d=Z("text-foreground",i),e[13]=i,e[14]=d):d=e[14];let f;e[15]!==m||e[16]!==b||e[17]!==d||e[18]!==t?(f=o.jsx(te,{value:t,onChange:m,onFocus:g,onBlur:h,placeholder:b,className:d}),e[15]=m,e[16]=b,e[17]=d,e[18]=t,e[19]=f):f=e[19];let x;return e[20]!==c||e[21]!==f?(x=o.jsxs("div",{className:"relative",children:[c,f]}),e[20]=c,e[21]=f,e[22]=x):x=e[22],x}function bl(u){const e=I.c(6),{quote:t,onChange:n}=u,l=O();let s;e[0]!==l?(s=l("sandbox.plainBlocks.quotePlaceholder"),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==t||e[4]!==s?(r=o.jsx("div",{className:"border-l-2 border-foreground/30 pl-4",children:o.jsx(te,{value:t,onChange:n,placeholder:s,className:"text-lg italic text-foreground/90"})}),e[2]=n,e[3]=t,e[4]=s,e[5]=r):r=e[5],r}function yl(u){const e=I.c(21),{code:t,language:n,onChange:l}=u,s=O();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 a;e[3]!==s?(a=s("sandbox.plainBlocks.languagePlaceholder"),e[3]=s,e[4]=a):a=e[4];let p;e[5]!==n||e[6]!==r||e[7]!==a?(p=o.jsx("input",{value:n,onChange:r,placeholder:a,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]=a,e[8]=p):p=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 m;e[12]!==s?(m=s("sandbox.plainBlocks.codePlaceholder"),e[12]=s,e[13]=m):m=e[13];let g;e[14]!==t||e[15]!==c||e[16]!==m?(g=o.jsx(te,{value:t,onChange:c,placeholder:m,spellCheck:!1,className:"px-3 py-2.5 font-mono text-sm text-foreground"}),e[14]=t,e[15]=c,e[16]=m,e[17]=g):g=e[17];let h;return e[18]!==p||e[19]!==g?(h=o.jsxs("div",{className:"overflow-hidden rounded-md border bg-muted/50",children:[p,g]}),e[18]=p,e[19]=g,e[20]=h):h=e[20],h}const vl=({editor:u,state:e})=>u.isEditable&&(u.isFocused||!e.selection.empty),jl={placement:"bottom-start",offset:8};function kl(u){const e=I.c(10),{editor:t}=u,n=O(),[l,s]=W.useState(!1),[r,a]=W.useState(null);let p;e[0]!==t?(p={editor:t,selector:Cl},e[0]=t,e[1]=p):p=e[1];const c=Ne(p);let m;e[2]!==t||e[3]!==r||e[4]!==l||e[5]!==c||e[6]!==n?(m=r&&o.jsxs(qt,{editor:t,appendTo:r,shouldShow:vl,options:jl,className:"flex items-center gap-0.5 rounded-md border bg-popover p-0.5 shadow-md",children:[o.jsx(le,{active:c.bold,label:n("sectionsEditor.richTextField.bold"),onClick:()=>t.chain().focus().toggleBold().run(),children:o.jsx(Xe,{size:14})}),o.jsx(le,{active:c.italic,label:n("sectionsEditor.richTextField.italic"),onClick:()=>t.chain().focus().toggleItalic().run(),children:o.jsx(Qe,{size:14})}),o.jsx(le,{active:c.underline,label:n("sectionsEditor.richTextField.underline"),onClick:()=>t.chain().focus().toggleUnderline().run(),children:o.jsx(Ze,{size:14})}),o.jsx(le,{active:c.strike,label:n("sectionsEditor.richTextField.strikethrough"),onClick:()=>t.chain().focus().toggleStrike().run(),children:o.jsx(Tt,{size:14})}),o.jsx(Fe,{editor:t,active:c.link,open:l,onOpenChange:s})]}),e[2]=t,e[3]=r,e[4]=l,e[5]=c,e[6]=n,e[7]=m):m=e[7];let g;return e[8]!==m?(g=o.jsx("div",{ref:a,className:"relative z-20",children:m}),e[8]=m,e[9]=g):g=e[9],g}function Cl(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")}}function Nl({items:u,style:e,onChange:t}){const n=O(),l=W.useRef(t);l.current=t;const s=W.useRef(e);s.current=e;const r=lt({extensions:[st.configure({link:{HTMLAttributes:{}},heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,dropcursor:!1,gapcursor:!1}),rt.configure({placeholder:n("sandbox.plainBlocks.listItemPlaceholder")})],content:ml(u,e==="ordered"),editorProps:{attributes:{class:Z("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")},handleKeyDown:(p,c)=>c.key==="Tab"},onUpdate:({editor:p})=>{l.current({items:pl(p.getHTML()).join(`
|
|
3
3
|
`),style:p.isActive("orderedList")?"ordered":p.isActive("bulletList")?"unordered":s.current})}}),a=Ne({editor:r,selector:({editor:p})=>({isFocused:p?.isFocused??!1,bullet:p?.isActive("bulletList")??!1,ordered:p?.isActive("orderedList")??!1})});return r?o.jsxs("div",{className:"relative",children:[a.isFocused&&o.jsxs(Be,{children:[o.jsx(le,{active:a.bullet,label:n("sandbox.plainBlocks.bulletedLabel"),onClick:()=>!a.bullet&&r.chain().focus().toggleBulletList().run(),children:"•"}),o.jsx(le,{active:a.ordered,label:n("sandbox.plainBlocks.numberedLabel"),onClick:()=>!a.ordered&&r.chain().focus().toggleOrderedList().run(),children:"1."})]}),o.jsx(kl,{editor:r}),o.jsx(ot,{editor:r,className:"text-foreground"})]}):null}function Bl(u){const e=I.c(51),{block:t,onChange:n}=u,l=O();let s;e[0]!==t.size?(s=R(t.size)||"normal",e[0]=t.size,e[1]=s):s=e[1];const r=s;let a;e[2]!==l?(a=l("sandbox.mediaBlocks.image"),e[2]=l,e[3]=a):a=e[3];let p;e[4]!==a?(p={type:"string",format:"image-uri",title:a},e[4]=a,e[5]=p):p=e[5];const c=t.url;let m;e[6]!==t||e[7]!==n?(m=B=>n({...t,url:B}),e[6]=t,e[7]=n,e[8]=m):m=e[8];let g;e[9]!==l?(g=l("sandbox.mediaBlocks.image"),e[9]=l,e[10]=g):g=e[10];let h;e[11]!==t.url||e[12]!==p||e[13]!==m||e[14]!==g?(h=o.jsx(Ut,{schema:p,value:c,onChange:m,path:"block-image-url",label:g}),e[11]=t.url,e[12]=p,e[13]=m,e[14]=g,e[15]=h):h=e[15];let b;e[16]!==t.caption?(b=R(t.caption),e[16]=t.caption,e[17]=b):b=e[17];let i;e[18]!==t||e[19]!==n?(i=B=>n({...t,caption:B}),e[18]=t,e[19]=n,e[20]=i):i=e[20];let d;e[21]!==l?(d=l("sandbox.mediaBlocks.addCaption"),e[21]=l,e[22]=d):d=e[22];let f;e[23]!==d||e[24]!==b||e[25]!==i?(f=o.jsx(te,{value:b,onChange:i,placeholder:d,className:"text-center text-sm italic text-muted-foreground"}),e[23]=d,e[24]=b,e[25]=i,e[26]=f):f=e[26];let x;e[27]===Symbol.for("react.memo_cache_sentinel")?(x=["normal","full"],e[27]=x):x=e[27];let y;e[28]!==t||e[29]!==n||e[30]!==r||e[31]!==l?(y=o.jsx("div",{className:"flex items-center gap-1",children:x.map(B=>o.jsx("button",{type:"button",onClick:()=>n({...t,size:B}),className:Z("classic:rounded px-2 py-0.5 transition-colors cursor-pointer compact:rounded-lg",r===B?"bg-accent text-accent-foreground":"hover:bg-muted"),children:l(B==="full"?"sandbox.mediaBlocks.fullWidth":"sandbox.mediaBlocks.normal")},B))}),e[28]=t,e[29]=n,e[30]=r,e[31]=l,e[32]=y):y=e[32];let j;e[33]!==t.alt?(j=R(t.alt),e[33]=t.alt,e[34]=j):j=e[34];let v;e[35]!==t||e[36]!==n?(v=B=>n({...t,alt:B.target.value}),e[35]=t,e[36]=n,e[37]=v):v=e[37];let C;e[38]!==l?(C=l("sandbox.mediaBlocks.altText"),e[38]=l,e[39]=C):C=e[39];let k;e[40]!==j||e[41]!==v||e[42]!==C?(k=o.jsx("input",{value:j,onChange:v,placeholder:C,className:"flex-1 border-0 bg-transparent p-0 text-xs outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[40]=j,e[41]=v,e[42]=C,e[43]=k):k=e[43];let N;e[44]!==y||e[45]!==k?(N=o.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[y,k]}),e[44]=y,e[45]=k,e[46]=N):N=e[46];let S;return e[47]!==f||e[48]!==N||e[49]!==h?(S=o.jsxs("div",{className:"space-y-2",children:[h,f,N]}),e[47]=f,e[48]=N,e[49]=h,e[50]=S):S=e[50],S}function Sl(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 wl(u){const e=I.c(28),{url:t,caption:n,onChange:l}=u,s=O();let r;e[0]!==t?(r=Sl(t),e[0]=t,e[1]=r):r=e[1];const a=r;let p;e[2]!==n||e[3]!==a||e[4]!==s?(p=a?o.jsx("div",{className:"relative aspect-video overflow-hidden rounded-md border bg-muted",children:o.jsx("iframe",{src:a,title:n||s("sandbox.mediaBlocks.video"),sandbox:"allow-scripts allow-same-origin allow-presentation",className:"absolute inset-0 h-full w-full border-0",allowFullScreen:!0})}):o.jsx("div",{className:"flex aspect-video items-center justify-center rounded-md border border-dashed bg-muted/40 text-xs text-muted-foreground",children:s("sandbox.mediaBlocks.pasteVideoUrl")}),e[2]=n,e[3]=a,e[4]=s,e[5]=p):p=e[5];let c;e[6]!==n||e[7]!==l?(c=f=>l({url:f.target.value,caption:n}),e[6]=n,e[7]=l,e[8]=c):c=e[8];let m;e[9]!==s?(m=s("sandbox.mediaBlocks.videoUrlPlaceholder"),e[9]=s,e[10]=m):m=e[10];let g;e[11]!==c||e[12]!==m||e[13]!==t?(g=o.jsx("input",{value:t,onChange:c,placeholder:m,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]=m,e[13]=t,e[14]=g):g=e[14];let h;e[15]!==l||e[16]!==t?(h=f=>l({url:t,caption:f}),e[15]=l,e[16]=t,e[17]=h):h=e[17];let b;e[18]!==s?(b=s("sandbox.mediaBlocks.addCaption"),e[18]=s,e[19]=b):b=e[19];let i;e[20]!==n||e[21]!==h||e[22]!==b?(i=o.jsx(te,{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]=i):i=e[23];let d;return e[24]!==p||e[25]!==g||e[26]!==i?(d=o.jsxs("div",{className:"space-y-2",children:[p,g,i]}),e[24]=p,e[25]=g,e[26]=i,e[27]=d):d=e[27],d}function Pl(){const u=I.c(5),e=O();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=o.jsx("span",{className:"h-px flex-1 bg-border"}),u[2]=n):n=u[2];let l;return u[3]!==t?(l=o.jsx("div",{className:"flex items-center py-3","aria-label":t,children:n}),u[3]=t,u[4]=l):l=u[4],l}function _l(u){const e=I.c(22),{text:t,href:n,onChange:l}=u,s=O();let r;e[0]!==n||e[1]!==l?(r=i=>l({text:i.target.value,href:n}),e[0]=n,e[1]=l,e[2]=r):r=e[2];let a;e[3]!==s?(a=s("sandbox.mediaBlocks.buttonLabel"),e[3]=s,e[4]=a):a=e[4];const p=Math.max(t.length||11,8);let c;e[5]!==r||e[6]!==a||e[7]!==p||e[8]!==t?(c=o.jsx("div",{className:"inline-flex items-center rounded-full bg-primary px-6 py-2 text-sm font-semibold text-primary-foreground",children:o.jsx("input",{value:t,onChange:r,placeholder:a,size:p,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]=a,e[7]=p,e[8]=t,e[9]=c):c=e[9];let m;e[10]!==l||e[11]!==t?(m=i=>l({text:t,href:i.target.value}),e[10]=l,e[11]=t,e[12]=m):m=e[12];let g;e[13]!==s?(g=s("sandbox.mediaBlocks.destinationUrlPlaceholder"),e[13]=s,e[14]=g):g=e[14];let h;e[15]!==n||e[16]!==m||e[17]!==g?(h=o.jsx("input",{value:n,onChange:m,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]=m,e[17]=g,e[18]=h):h=e[18];let b;return e[19]!==c||e[20]!==h?(b=o.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 ge=[{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 Tl(u){const e=I.c(51),{title:t,body:n,variant:l,onChange:s}=u,r=O(),[a,p]=W.useState(!1);let c;e[0]!==l?(c=ge.find(w=>w.value===l)??ge[0],e[0]=l,e[1]=c):c=e[1];const m=c;let g,h;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=()=>p(!0),h=w=>{w.currentTarget.contains(w.relatedTarget)||p(!1)},e[2]=g,e[3]=h):(g=e[2],h=e[3]);let b;e[4]!==n||e[5]!==a||e[6]!==s||e[7]!==t||e[8]!==m.value?(b=a&&o.jsx(Be,{children:ge.map(w=>o.jsx(le,{active:m.value===w.value,label:w.value,onClick:()=>s({title:t,body:n,variant:w.value}),children:o.jsx("span",{style:{color:w.color},children:w.icon})},w.value))}),e[4]=n,e[5]=a,e[6]=s,e[7]=t,e[8]=m.value,e[9]=b):b=e[9];const i=`3px solid ${m.color}`,d=`color-mix(in oklch, ${m.color} 8%, transparent)`;let f;e[10]!==i||e[11]!==d?(f={borderLeft:i,backgroundColor:d},e[10]=i,e[11]=d,e[12]=f):f=e[12];let x;e[13]!==m.color?(x={color:m.color},e[13]=m.color,e[14]=x):x=e[14];let y;e[15]!==m.icon?(y=o.jsx("span",{"aria-hidden":!0,className:"text-sm font-bold leading-none",children:m.icon}),e[15]=m.icon,e[16]=y):y=e[16];let j;e[17]!==n||e[18]!==s||e[19]!==l?(j=w=>s({title:w.target.value,body:n,variant:l}),e[17]=n,e[18]=s,e[19]=l,e[20]=j):j=e[20];let v;e[21]!==r?(v=r("sandbox.mediaBlocks.calloutTitle"),e[21]=r,e[22]=v):v=e[22];let C;e[23]!==m.color?(C={color:m.color},e[23]=m.color,e[24]=C):C=e[24];let k;e[25]!==j||e[26]!==v||e[27]!==C||e[28]!==t?(k=o.jsx("input",{value:t,onChange:j,placeholder:v,className:"flex-1 border-0 bg-transparent p-0 text-xs font-semibold uppercase tracking-wide outline-none focus:ring-0",style:C}),e[25]=j,e[26]=v,e[27]=C,e[28]=t,e[29]=k):k=e[29];let N;e[30]!==k||e[31]!==x||e[32]!==y?(N=o.jsxs("div",{className:"mb-1.5 flex items-center gap-2",style:x,children:[y,k]}),e[30]=k,e[31]=x,e[32]=y,e[33]=N):N=e[33];let S;e[34]!==s||e[35]!==t||e[36]!==l?(S=w=>s({title:t,body:w,variant:l}),e[34]=s,e[35]=t,e[36]=l,e[37]=S):S=e[37];let B;e[38]!==r?(B=r("sandbox.mediaBlocks.calloutText"),e[38]=r,e[39]=B):B=e[39];let P;e[40]!==n||e[41]!==S||e[42]!==B?(P=o.jsx(te,{value:n,onChange:S,placeholder:B,className:"text-[15px] leading-relaxed text-foreground"}),e[40]=n,e[41]=S,e[42]=B,e[43]=P):P=e[43];let T;e[44]!==N||e[45]!==P||e[46]!==f?(T=o.jsxs("div",{className:"rounded-md py-4 pl-5 pr-4",style:f,children:[N,P]}),e[44]=N,e[45]=P,e[46]=f,e[47]=T):T=e[47];let L;return e[48]!==T||e[49]!==b?(L=o.jsxs("div",{className:"relative",onFocus:g,onBlur:h,children:[b,T]}),e[48]=T,e[49]=b,e[50]=L):L=e[50],L}function Ll(u){const e=I.c(34),{value:t,label:n,description:l,onChange:s}=u,r=O();let a;e[0]!==l||e[1]!==n||e[2]!==s?(a=x=>s({value:x.target.value,label:n,description:l}),e[0]=l,e[1]=n,e[2]=s,e[3]=a):a=e[3];let p;e[4]!==r?(p=r("sandbox.mediaBlocks.statValuePlaceholder"),e[4]=r,e[5]=p):p=e[5];let c;e[6]!==a||e[7]!==p||e[8]!==t?(c=o.jsx("input",{value:t,onChange:a,placeholder:p,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]=a,e[7]=p,e[8]=t,e[9]=c):c=e[9];let m;e[10]!==l||e[11]!==s||e[12]!==t?(m=x=>s({value:t,label:x.target.value,description:l}),e[10]=l,e[11]=s,e[12]=t,e[13]=m):m=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]!==m||e[18]!==g?(h=o.jsx("input",{value:n,onChange:m,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]=m,e[18]=g,e[19]=h):h=e[19];let b;e[20]!==n||e[21]!==s||e[22]!==t?(b=x=>s({value:t,label:n,description:x}),e[20]=n,e[21]=s,e[22]=t,e[23]=b):b=e[23];let i;e[24]!==r?(i=r("sandbox.mediaBlocks.optionalDescription"),e[24]=r,e[25]=i):i=e[25];let d;e[26]!==l||e[27]!==b||e[28]!==i?(d=o.jsx(te,{value:l,onChange:b,placeholder:i,className:"max-w-md text-center text-sm text-muted-foreground"}),e[26]=l,e[27]=b,e[28]=i,e[29]=d):d=e[29];let f;return e[30]!==c||e[31]!==h||e[32]!==d?(f=o.jsxs("div",{className:"flex flex-col items-center gap-1.5 border-y border-border/60 py-8 text-center",children:[c,h,d]}),e[30]=c,e[31]=h,e[32]=d,e[33]=f):f=e[33],f}function Al(u){const e=I.c(21),{cards:t,onChange:n}=u,l=O();let s,r,a,p,c;if(e[0]!==t||e[1]!==n||e[2]!==l){r=ae(t);let b;e[8]!==n?(b=d=>n(JSON.stringify(d)),e[8]=n,e[9]=b):b=e[9],s=b;const i=(d,f)=>s(r.map((x,y)=>y===d?{...x,...f}:x));c="space-y-2",a="grid grid-cols-1 gap-3 sm:grid-cols-3",p=r.slice(0,3).map((d,f)=>o.jsxs("div",{className:"group/item relative flex flex-col gap-2 rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"absolute right-1 top-1",children:o.jsx(re,{label:l("sandbox.listBlocks.removeCard"),onClick:()=>s(r.filter((x,y)=>y!==f))})}),o.jsx("input",{value:R(d.icon),onChange:x=>i(f,{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"}),o.jsx("input",{value:R(d.title),onChange:x=>i(f,{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"}),o.jsx(te,{value:R(d.body),onChange:x=>i(f,{body:x}),placeholder:l("sandbox.listBlocks.cardBody"),className:"text-sm text-muted-foreground"})]},f)),e[0]=t,e[1]=n,e[2]=l,e[3]=s,e[4]=r,e[5]=a,e[6]=p,e[7]=c}else s=e[3],r=e[4],a=e[5],p=e[6],c=e[7];let m;e[10]!==a||e[11]!==p?(m=o.jsx("div",{className:a,children:p}),e[10]=a,e[11]=p,e[12]=m):m=e[12];let g;e[13]!==s||e[14]!==r||e[15]!==l?(g=r.length<3&&o.jsx(ne,{label:l("sandbox.listBlocks.addCard"),onClick:()=>s([...r,{title:"",body:""}])}),e[13]=s,e[14]=r,e[15]=l,e[16]=g):g=e[16];let h;return e[17]!==c||e[18]!==m||e[19]!==g?(h=o.jsxs("div",{className:c,children:[m,g]}),e[17]=c,e[18]=m,e[19]=g,e[20]=h):h=e[20],h}function Il(u){const e=I.c(36),{title:t,items:n,onChange:l}=u,s=O();let r,a,p,c,m;if(e[0]!==n||e[1]!==l||e[2]!==s||e[3]!==t){a=ae(n);let f;e[9]!==l||e[10]!==t?(f=j=>l({title:t,items:JSON.stringify(j)}),e[9]=l,e[10]=t,e[11]=f):f=e[11],r=f,c="space-y-2";let x;e[12]!==n||e[13]!==l?(x=j=>l({title:j.target.value,items:n}),e[12]=n,e[13]=l,e[14]=x):x=e[14];let y;e[15]!==s?(y=s("sandbox.listBlocks.checklistTitle"),e[15]=s,e[16]=y):y=e[16],e[17]!==x||e[18]!==y||e[19]!==t?(m=o.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]=m):m=e[20],p=a.map((j,v)=>o.jsxs("li",{className:"group/item flex items-start gap-3 border-b border-border/50 py-2.5",children:[o.jsx("span",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center text-primary",children:o.jsx(nt,{size:15})}),o.jsx(te,{value:j,onChange:C=>r(a.map((k,N)=>N===v?C:k)),placeholder:s("sandbox.listBlocks.checklistItem"),className:"text-[15px] text-foreground"}),o.jsx(re,{label:s("sandbox.listBlocks.removeItem"),onClick:()=>r(a.filter((C,k)=>k!==v))})]},v)),e[0]=n,e[1]=l,e[2]=s,e[3]=t,e[4]=r,e[5]=a,e[6]=p,e[7]=c,e[8]=m}else r=e[4],a=e[5],p=e[6],c=e[7],m=e[8];let g;e[21]!==p?(g=o.jsx("ul",{children:p}),e[21]=p,e[22]=g):g=e[22];let h;e[23]!==s?(h=s("sandbox.listBlocks.addItem"),e[23]=s,e[24]=h):h=e[24];let b;e[25]!==r||e[26]!==a?(b=()=>r([...a,""]),e[25]=r,e[26]=a,e[27]=b):b=e[27];let i;e[28]!==h||e[29]!==b?(i=o.jsx(ne,{label:h,onClick:b}),e[28]=h,e[29]=b,e[30]=i):i=e[30];let d;return e[31]!==c||e[32]!==m||e[33]!==g||e[34]!==i?(d=o.jsxs("div",{className:c,children:[m,g,i]}),e[31]=c,e[32]=m,e[33]=g,e[34]=i,e[35]=d):d=e[35],d}function El(u){const e=I.c(21),{stats:t,onChange:n}=u,l=O();let s,r,a,p,c;if(e[0]!==n||e[1]!==t||e[2]!==l){r=ae(t);let b;e[8]!==n?(b=d=>n(JSON.stringify(d)),e[8]=n,e[9]=b):b=e[9],s=b;const i=(d,f)=>s(r.map((x,y)=>y===d?{...x,...f}:x));c="space-y-2",a="grid grid-cols-1 gap-3 sm:grid-cols-3",p=r.slice(0,3).map((d,f)=>o.jsxs("div",{className:"group/item relative rounded-lg border p-5 text-center",children:[o.jsx("div",{className:"absolute right-1 top-1",children:o.jsx(re,{label:l("sandbox.listBlocks.removeStat"),onClick:()=>s(r.filter((x,y)=>y!==f))})}),o.jsx("input",{value:R(d.value),onChange:x=>i(f,{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"}),o.jsx("input",{value:R(d.label),onChange:x=>i(f,{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"})]},f)),e[0]=n,e[1]=t,e[2]=l,e[3]=s,e[4]=r,e[5]=a,e[6]=p,e[7]=c}else s=e[3],r=e[4],a=e[5],p=e[6],c=e[7];let m;e[10]!==a||e[11]!==p?(m=o.jsx("div",{className:a,children:p}),e[10]=a,e[11]=p,e[12]=m):m=e[12];let g;e[13]!==s||e[14]!==r||e[15]!==l?(g=r.length<3&&o.jsx(ne,{label:l("sandbox.listBlocks.addStat"),onClick:()=>s([...r,{value:"",label:""}])}),e[13]=s,e[14]=r,e[15]=l,e[16]=g):g=e[16];let h;return e[17]!==c||e[18]!==m||e[19]!==g?(h=o.jsxs("div",{className:c,children:[m,g]}),e[17]=c,e[18]=m,e[19]=g,e[20]=h):h=e[20],h}function $l(u){const e=I.c(38),{title:t,steps:n,onChange:l}=u,s=O();let r,a,p,c,m,g;if(e[0]!==l||e[1]!==n||e[2]!==s||e[3]!==t){a=ae(n);let x;e[10]!==l||e[11]!==t?(x=C=>l({title:t,steps:JSON.stringify(C)}),e[10]=l,e[11]=t,e[12]=x):x=e[12],r=x;const y=(C,k)=>r(a.map((N,S)=>S===C?{...N,...k}:N));m="space-y-2";let j;e[13]!==l||e[14]!==n?(j=C=>l({title:C.target.value,steps:n}),e[13]=l,e[14]=n,e[15]=j):j=e[15];let v;e[16]!==s?(v=s("sandbox.listBlocks.stepsTitle"),e[16]=s,e[17]=v):v=e[17],e[18]!==j||e[19]!==v||e[20]!==t?(g=o.jsx("input",{value:t,onChange:j,placeholder:v,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]=j,e[19]=v,e[20]=t,e[21]=g):g=e[21],p="space-y-3",c=a.map((C,k)=>o.jsxs("li",{className:"group/item flex gap-4",children:[o.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:k+1}),o.jsxs("div",{className:"min-w-0 flex-1 space-y-1 pt-0.5",children:[o.jsx("input",{value:R(C.title),onChange:N=>y(k,{title:N.target.value}),placeholder:s("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"}),o.jsx(te,{value:R(C.description),onChange:N=>y(k,{description:N}),placeholder:s("sandbox.listBlocks.stepDescription"),className:"text-sm text-muted-foreground"})]}),o.jsx(re,{label:s("sandbox.listBlocks.removeStep"),onClick:()=>r(a.filter((N,S)=>S!==k))})]},k)),e[0]=l,e[1]=n,e[2]=s,e[3]=t,e[4]=r,e[5]=a,e[6]=p,e[7]=c,e[8]=m,e[9]=g}else r=e[4],a=e[5],p=e[6],c=e[7],m=e[8],g=e[9];let h;e[22]!==p||e[23]!==c?(h=o.jsx("ol",{className:p,children:c}),e[22]=p,e[23]=c,e[24]=h):h=e[24];let b;e[25]!==s?(b=s("sandbox.listBlocks.addStep"),e[25]=s,e[26]=b):b=e[26];let i;e[27]!==r||e[28]!==a?(i=()=>r([...a,{title:"",description:""}]),e[27]=r,e[28]=a,e[29]=i):i=e[29];let d;e[30]!==b||e[31]!==i?(d=o.jsx(ne,{label:b,onClick:i}),e[30]=b,e[31]=i,e[32]=d):d=e[32];let f;return e[33]!==m||e[34]!==g||e[35]!==h||e[36]!==d?(f=o.jsxs("div",{className:m,children:[g,h,d]}),e[33]=m,e[34]=g,e[35]=h,e[36]=d,e[37]=f):f=e[37],f}function Ae(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 Rl(u){const e=I.c(13),{left:t,right:n,onChange:l}=u,s=O();let r;if(e[0]!==t||e[1]!==l||e[2]!==n||e[3]!==s){const a={left:Ae(t,s("sandbox.listBlocks.optionA")),right:Ae(n,s("sandbox.listBlocks.optionB"))};let p;e[5]!==t||e[6]!==l||e[7]!==n?(p=(b,i)=>l({left:b==="left"?JSON.stringify(i):t,right:b==="right"?JSON.stringify(i):n}),e[5]=t,e[6]=l,e[7]=n,e[8]=p):p=e[8];const c=p;let m;e[9]!==c||e[10]!==s?(m=(b,i,d)=>{const f=i.items??[];return o.jsxs("div",{className:"space-y-2 rounded-lg border p-4",children:[o.jsx("input",{value:R(i.title),onChange:x=>c(b,{...i,title:x.target.value}),placeholder:s("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"}),o.jsx("ul",{className:"space-y-1.5",children:f.map((x,y)=>o.jsxs("li",{className:"group/item flex items-start gap-2",children:[o.jsx("span",{"aria-hidden":!0,className:"mt-0.5 shrink-0 text-sm font-bold",style:{color:d},children:"✓"}),o.jsx(te,{value:x,onChange:j=>c(b,{...i,items:f.map((v,C)=>C===y?j:v)}),placeholder:s("sandbox.listBlocks.item"),className:"text-sm text-foreground"}),o.jsx(re,{label:s("sandbox.listBlocks.removeItem"),onClick:()=>c(b,{...i,items:f.filter((j,v)=>v!==y)})})]},y))}),o.jsx(ne,{label:s("sandbox.listBlocks.addItem"),onClick:()=>c(b,{...i,items:[...f,""]})})]})},e[9]=c,e[10]=s,e[11]=m):m=e[11];const g=m;let h;e[12]===Symbol.for("react.memo_cache_sentinel")?(h=Z("grid grid-cols-1 gap-3 sm:grid-cols-2"),e[12]=h):h=e[12],r=o.jsxs("div",{className:h,children:[g("left",a.left,"oklch(0.65 0.17 150)"),g("right",a.right,"oklch(0.75 0.15 75)")]}),e[0]=t,e[1]=l,e[2]=n,e[3]=s,e[4]=r}else r=e[4];return r}const Dl="vtex/loaders/intelligentSearch/productList.ts";function se(u){return u&&typeof u=="object"&&!Array.isArray(u)?u:null}function he(u){return typeof u=="string"||typeof u=="number"?String(u):""}function be(u){const e=se(u);return!!e&&typeof e.__resolveType=="string"&&"productId"in e}function ct(u){if(Array.isArray(u))return u.map(n=>he(se(n)?.productId));const e=se(u),t=se(e?.props);return t&&Array.isArray(t.ids)?t.ids.map(he):e&&"productId"in e?[he(e.productId)]:[]}function Ol(u){const e=se(u)??{};return typeof e.__resolveType=="string"?e.__resolveType:Dl}function dt(u,e){if(Array.isArray(u)){const s=u.find(be);if(s)return e.map((r,a)=>{const p=se(u[a]);return{...be(p)?p:{__resolveType:s.__resolveType},productId:r}})}const t=se(u);if(be(t)&&!se(t.props)?.ids)return{...t,productId:e[0]??""};const n=se(t?.props)??{},l=Ol(u);return{...t??{},__resolveType:l,props:{...n,ids:e,simulationBehavior:n.simulationBehavior??"default"}}}const ut="vtex/loaders/intelligentSearch/productList.ts",zl="vtex/loaders/categories/tree.ts",Fl=24;function ce(u){return u&&typeof u=="object"&&!Array.isArray(u)?u:null}function Ul(u){return u.split("/").filter(Boolean).map((t,n)=>`category-${n+1}/${t}`).join("/")}function Ml(u,e){const t=e.trim();if(!t)return[];const n=ut,l=Fl;if(u==="cluster")return[{resolveType:n,props:{collection:t,count:l}}];if(u==="category"){const p=Ul(t);return p?[{resolveType:n,props:{facets:p,count:l}}]:[]}const s=[];/^\d+$/.test(t)&&s.push({resolveType:n,props:{ids:[t]}});const a=t.includes("-")&&!/\s/.test(t)?t.replace(/-+/g," "):t;return s.push({resolveType:n,props:{query:a,count:l}}),s}function Hl(){return{resolveType:zl,props:{}}}function ql(u){return{resolveType:ut,props:{ids:u}}}function Ie(u){return typeof u=="string"||typeof u=="number"?String(u):""}function ft(u){const e=ce(u),t=Array.isArray(u)?u:Array.isArray(e?.products)?e.products:[],n=[],l=new Set;for(const s of t){const r=ce(s);if(!r)continue;const a=Ie(r.productID)||Ie(r.sku);if(!a||l.has(a))continue;l.add(a);const p=ce(r.isVariantOf),c=typeof p?.name=="string"&&p.name||typeof r.name=="string"&&r.name||a,m=Array.isArray(r.image)?ce(r.image[0]):null,g=typeof m?.url=="string"?m.url:void 0;n.push({id:a,label:c,image:g})}return n}function Gl(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 Vl(u){const e=[],t=new Set,n=(l,s)=>{const r=ce(l);if(!r)return;const a=typeof r.name=="string"&&r.name?r.name:"",p=a?[...s,a]:s,c=Gl(r.url);if(c&&!t.has(c)&&(t.add(c),e.push({path:c,label:p.join(" › ")||c})),Array.isArray(r.children))for(const m of r.children)n(m,p)};if(Array.isArray(u))for(const l of u)n(l,[]);return e}function Kl(u,e,t=50){const n=e.trim().toLowerCase();return(n?u.filter(s=>s.label.toLowerCase().includes(n)||s.path.toLowerCase().includes(n)):u).slice(0,t)}const Yl=1e4;async function Se(u,{resolveType:e,props:t}){const n=await fetch(Mt(u),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...t}),signal:AbortSignal.timeout(Yl)});if(!n.ok)throw new Error(`Failed to fetch (${n.status})`);return n.json()}function mt(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 s=l;let r;t[4]!==s||t[5]!==u?(r=je.sandboxInvoke(u?`${u.orgSlug}/${u.virtualMcpId}/${u.branch}`:"none",`blog-products-by-ids:${s.join(",")}`),t[4]=s,t[5]=u,t[6]=r):r=t[6];let a;t[7]!==s||t[8]!==u?(a=()=>Se(u,ql(s)).then(ft),t[7]=s,t[8]=u,t[9]=a):a=t[9];const p=!!u&&s.length>0;let c;t[10]!==r||t[11]!==a||t[12]!==p?(c={queryKey:r,queryFn:a,enabled:p,staleTime:6e4,retry:1},t[10]=r,t[11]=a,t[12]=p,t[13]=c):c=t[13];const m=ke(c);let g;if(t[14]!==m.data){g=new Map;for(const b of m.data??[])g.set(b.id,b);t[14]=m.data,t[15]=g}else g=t[15];let h;return t[16]!==g||t[17]!==m.isError||t[18]!==m.isLoading?(h={byId:g,isLoading:m.isLoading,isError:m.isError},t[16]=g,t[17]=m.isError,t[18]=m.isLoading,t[19]=h):h=t[19],h}const Jl=[{id:"search",labelKey:"sandbox.productPickerDialog.modeSearch"},{id:"category",labelKey:"sandbox.productPickerDialog.modeCategory"},{id:"cluster",labelKey:"sandbox.productPickerDialog.modeClusterId"}];async function Wl(u,e){if(e.length===0)return[];const t=await Promise.allSettled(e.map(r=>Se(u,r))),n=t.filter(r=>r.status==="fulfilled").map(r=>r.value);if(n.length===0){const r=t.find(a=>a.status==="rejected");throw r?r.reason:new Error("Failed to fetch products")}const l=[],s=new Set;for(const r of n)for(const a of ft(r))s.has(a.id)||(s.add(a.id),l.push(a));return l}function Ee(u){const e=I.c(6),[t,n]=W.useState(""),[l,s]=W.useState(""),r=W.useRef(null);let a;e[0]!==u?(a=m=>{n(m),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>s(m),u)},e[0]=u,e[1]=a):a=e[1];const p=a;let c;return e[2]!==l||e[3]!==p||e[4]!==t?(c={value:t,debounced:l,onChange:p},e[2]=l,e[3]=p,e[4]=t,e[5]=c):c=e[5],c}function Xl(u){const e=I.c(23),{option:t,selected:n,onToggle:l}=u,s=n?"border-primary/40 bg-primary/5":"border-transparent hover:bg-muted/60";let r;e[0]!==s?(r=Z("flex w-full items-center gap-3 classic:rounded-md compact:rounded-lg border px-2 py-2 text-left transition-colors",s),e[0]=s,e[1]=r):r=e[1];let a;e[2]!==t.image?(a=o.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?o.jsx("img",{src:t.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):o.jsx(Ce,{size:14,className:"text-muted-foreground"})}),e[2]=t.image,e[3]=a):a=e[3];let p;e[4]!==t.label?(p=o.jsx("span",{className:"line-clamp-2 text-sm",children:t.label}),e[4]=t.label,e[5]=p):p=e[5];let c;e[6]!==t.id?(c=o.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 m;e[8]!==p||e[9]!==c?(m=o.jsxs("span",{className:"min-w-0 flex-1",children:[p,c]}),e[8]=p,e[9]=c,e[10]=m):m=e[10];const g=n?"border-primary bg-primary text-primary-foreground":"border-border text-transparent";let h;e[11]!==g?(h=Z("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=o.jsx(nt,{size:12}),e[13]=b):b=e[13];let i;e[14]!==h?(i=o.jsx("span",{className:h,children:b}),e[14]=h,e[15]=i):i=e[15];let d;return e[16]!==l||e[17]!==n||e[18]!==i||e[19]!==r||e[20]!==a||e[21]!==m?(d=o.jsxs("button",{type:"button",onClick:l,"aria-pressed":n,className:r,children:[a,m,i]}),e[16]=l,e[17]=n,e[18]=i,e[19]=r,e[20]=a,e[21]=m,e[22]=d):d=e[22],d}function pt(u){const e=I.c(9),{query:t,emptyLabel:n,loadingLabel:l}=u,s=O();if(t.isLoading){let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(ze,{size:"xs"}),e[0]=a):a=e[0];let p;return e[1]!==l?(p=o.jsxs("div",{className:"flex items-center gap-2 px-2 py-6 text-sm text-muted-foreground",children:[a,l]}),e[1]=l,e[2]=p):p=e[2],p}if(t.isError){let a;e[3]!==s?(a=s("sandbox.productPickerDialog.couldNotLoad"),e[3]=s,e[4]=a):a=e[4];let p;return e[5]!==a?(p=o.jsx("p",{className:"px-2 py-6 text-sm text-muted-foreground",children:a}),e[5]=a,e[6]=p):p=e[6],p}let r;return e[7]!==n?(r=o.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 xt(u){return`${u.orgSlug}/${u.virtualMcpId}/${u.branch}`}function Ql(u){const e=I.c(45),{sandboxRef:t,open:n,selected:l,onSelect:s}=u,r=O(),[a,p]=W.useState("");let c;e[0]!==t?(c=je.sandboxInvoke(xt(t),"blog-category-tree"),e[0]=t,e[1]=c):c=e[1];let m;e[2]!==t?(m=()=>Se(t,Hl()).then(Vl),e[2]=t,e[3]=m):m=e[3];const g=n&&!l;let h;e[4]!==c||e[5]!==m||e[6]!==g?(h={queryKey:c,queryFn:m,enabled:g,staleTime:6e4,retry:1},e[4]=c,e[5]=m,e[6]=g,e[7]=h):h=e[7];const b=ke(h);if(l){let v;e[8]!==s?(v=()=>s(null),e[8]=s,e[9]=v):v=e[9];let C;e[10]===Symbol.for("react.memo_cache_sentinel")?(C=o.jsx(Lt,{size:14}),e[10]=C):C=e[10];let k;e[11]!==r?(k=r("sandbox.productPickerDialog.categoryLabel"),e[11]=r,e[12]=k):k=e[12];let N;e[13]!==l.label?(N=o.jsx("span",{className:"text-foreground",children:l.label}),e[13]=l.label,e[14]=N):N=e[14];let S;e[15]!==r?(S=r("sandbox.productPickerDialog.change"),e[15]=r,e[16]=S):S=e[16];let B;e[17]!==k||e[18]!==N||e[19]!==S?(B=o.jsxs("span",{className:"truncate",children:[k,N," —",S]}),e[17]=k,e[18]=N,e[19]=S,e[20]=B):B=e[20];let P;return e[21]!==B||e[22]!==v?(P=o.jsxs("button",{type:"button",onClick:v,className:"flex items-center gap-1.5 classic:rounded-md compact:rounded-lg px-2 py-1.5 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[C,B]}),e[21]=B,e[22]=v,e[23]=P):P=e[23],P}let i,d,f,x;if(e[24]!==a||e[25]!==s||e[26]!==b||e[27]!==r){const v=Kl(b.data??[],a);f="space-y-2";let C;e[32]===Symbol.for("react.memo_cache_sentinel")?(C=N=>p(N.target.value),e[32]=C):C=e[32];let k;e[33]!==r?(k=r("sandbox.productPickerDialog.filterCategoriesPlaceholder"),e[33]=r,e[34]=k):k=e[34],e[35]!==a||e[36]!==k?(x=o.jsx(ve,{value:a,onChange:C,placeholder:k,className:"h-9"}),e[35]=a,e[36]=k,e[37]=x):x=e[37],i="h-48 overflow-y-auto rounded-md border",d=v.length===0?o.jsx(pt,{query:b,loadingLabel:r("sandbox.productPickerDialog.loadingCategories"),emptyLabel:r("sandbox.productPickerDialog.noCategories")}):o.jsx("div",{className:"p-1",children:v.map(N=>o.jsx("button",{type:"button",onClick:()=>s(N),className:"block w-full truncate classic:rounded px-2 py-1.5 text-left text-sm hover:bg-muted/60 compact:rounded-lg",children:N.label},N.path))}),e[24]=a,e[25]=s,e[26]=b,e[27]=r,e[28]=i,e[29]=d,e[30]=f,e[31]=x}else i=e[28],d=e[29],f=e[30],x=e[31];let y;e[38]!==i||e[39]!==d?(y=o.jsx("div",{className:i,children:d}),e[38]=i,e[39]=d,e[40]=y):y=e[40];let j;return e[41]!==f||e[42]!==x||e[43]!==y?(j=o.jsxs("div",{className:f,children:[x,y]}),e[41]=f,e[42]=x,e[43]=y,e[44]=j):j=e[44],j}function gt(u){const e=I.c(89),{open:t,onOpenChange:n,sandboxRef:l,selectedIds:s,onChange:r,multiple:a}=u,p=a===void 0?!0:a,c=O(),[m,g]=W.useState("search"),h=Ee(300),b=Ee(300),[i,d]=W.useState(null),f=m==="search"?h.debounced:m==="cluster"?b.debounced:i?.path??"";let x;e[0]!==m||e[1]!==f?(x=Ml(m,f),e[0]=m,e[1]=f,e[2]=x):x=e[2];const y=x;let j;e[3]!==m||e[4]!==l||e[5]!==f?(j=je.sandboxInvoke(xt(l),`blog-product:${m}:${f}`),e[3]=m,e[4]=l,e[5]=f,e[6]=j):j=e[6];let v;e[7]!==y||e[8]!==l?(v=()=>Wl(l,y),e[7]=y,e[8]=l,e[9]=v):v=e[9];const C=t&&y.length>0;let k;e[10]!==j||e[11]!==v||e[12]!==C?(k={queryKey:j,queryFn:v,enabled:C,staleTime:6e4,retry:1},e[10]=j,e[11]=v,e[12]=C,e[13]=k):k=e[13];const N=ke(k);let S;e[14]!==s?(S=new Set(s.filter(Boolean)),e[14]=s,e[15]=S):S=e[15];const B=S;let P;e[16]!==p||e[17]!==r||e[18]!==B||e[19]!==s?(P=J=>{if(!p){r(B.has(J)?[]:[J]);return}B.has(J)?r(s.filter(yt=>yt!==J)):r([...s.filter(Boolean),J])},e[16]=p,e[17]=r,e[18]=B,e[19]=s,e[20]=P):P=e[20];const T=P;let L;e[21]!==N.data?(L=N.data??[],e[21]=N.data,e[22]=L):L=e[22];const w=L,_=y.length===0;let $;e[23]!==p||e[24]!==c?($=c(p?"sandbox.productPickerDialog.addProducts":"sandbox.productPickerDialog.chooseProduct"),e[23]=p,e[24]=c,e[25]=$):$=e[25];let U;e[26]!==$?(U=o.jsx(Yt,{className:"border-b border-border px-4 py-3",children:o.jsx(Jt,{className:"text-sm font-medium",children:$})}),e[26]=$,e[27]=U):U=e[27];let Y;e[28]!==m||e[29]!==c?(Y=Jl.map(J=>o.jsx("button",{type:"button",onClick:()=>g(J.id),className:Z("classic:rounded-md compact:rounded-lg px-2.5 py-1 text-sm transition-colors",m===J.id?"bg-muted font-medium text-foreground":"text-muted-foreground hover:text-foreground"),children:c(J.labelKey)},J.id)),e[28]=m,e[29]=c,e[30]=Y):Y=e[30];let H;e[31]!==Y?(H=o.jsx("div",{className:"flex shrink-0 items-center gap-1 border-b border-border px-4 py-2",children:Y}),e[31]=Y,e[32]=H):H=e[32];let q;e[33]!==m||e[34]!==h||e[35]!==c?(q=m==="search"&&o.jsx(ve,{autoFocus:!0,value:h.value,onChange:J=>h.onChange(J.target.value),placeholder:c("sandbox.productPickerDialog.searchProductsPlaceholder"),className:"h-9"}),e[33]=m,e[34]=h,e[35]=c,e[36]=q):q=e[36];let G;e[37]!==b||e[38]!==m||e[39]!==c?(G=m==="cluster"&&o.jsx(ve,{autoFocus:!0,value:b.value,onChange:J=>b.onChange(J.target.value),placeholder:c("sandbox.productPickerDialog.clusterIdPlaceholder"),className:"h-9"}),e[37]=b,e[38]=m,e[39]=c,e[40]=G):G=e[40];let V;e[41]!==i||e[42]!==m||e[43]!==t||e[44]!==l?(V=m==="category"&&o.jsx(Ql,{sandboxRef:l,open:t,selected:i,onSelect:d}),e[41]=i,e[42]=m,e[43]=t,e[44]=l,e[45]=V):V=e[45];let A;e[46]!==q||e[47]!==G||e[48]!==V?(A=o.jsxs("div",{className:"shrink-0 space-y-2 px-4 py-3",children:[q,G,V]}),e[46]=q,e[47]=G,e[48]=V,e[49]=A):A=e[49];let E;e[50]!==w||e[51]!==N||e[52]!==B||e[53]!==_||e[54]!==c||e[55]!==T?(E=w.length>0?w.map(J=>o.jsx(Xl,{option:J,selected:B.has(J.id),onToggle:()=>T(J.id)},J.id)):!_&&o.jsx(pt,{query:N,loadingLabel:c("sandbox.productPickerDialog.loadingProducts"),emptyLabel:c("sandbox.productPickerDialog.noProductsFound")}),e[50]=w,e[51]=N,e[52]=B,e[53]=_,e[54]=c,e[55]=T,e[56]=E):E=e[56];let z;e[57]!==m||e[58]!==_||e[59]!==c?(z=_&&o.jsx("p",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:c(m==="category"?"sandbox.productPickerDialog.pickCategoryPrompt":m==="cluster"?"sandbox.productPickerDialog.enterClusterPrompt":"sandbox.productPickerDialog.typeToSearchPrompt")}),e[57]=m,e[58]=_,e[59]=c,e[60]=z):z=e[60];let K;e[61]!==E||e[62]!==z?(K=o.jsxs("div",{className:"min-h-0 flex-1 space-y-1 overflow-y-auto border-t border-border px-3 py-2",children:[E,z]}),e[61]=E,e[62]=z,e[63]=K):K=e[63];let D;e[64]!==B.size||e[65]!==c?(D=B.size===0?c("sandbox.productPickerDialog.noneSelected"):c("sandbox.productPickerDialog.selectedCount",{count:String(B.size)}),e[64]=B.size,e[65]=c,e[66]=D):D=e[66];let M;e[67]!==D?(M=o.jsx("span",{className:"text-xs text-muted-foreground",children:D}),e[67]=D,e[68]=M):M=e[68];let F;e[69]!==n?(F=()=>n(!1),e[69]=n,e[70]=F):F=e[70];let X;e[71]!==c?(X=c("sandbox.productPickerDialog.done"),e[71]=c,e[72]=X):X=e[72];let ee;e[73]!==F||e[74]!==X?(ee=o.jsx(kt,{size:"sm",onClick:F,children:X}),e[73]=F,e[74]=X,e[75]=ee):ee=e[75];let Q;e[76]!==M||e[77]!==ee?(Q=o.jsxs("div",{className:"flex shrink-0 items-center justify-between border-t border-border px-4 py-3",children:[M,ee]}),e[76]=M,e[77]=ee,e[78]=Q):Q=e[78];let ie;e[79]!==U||e[80]!==H||e[81]!==A||e[82]!==K||e[83]!==Q?(ie=o.jsxs(Wt,{className:"flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[560px] sm:max-w-[560px]",children:[U,H,A,K,Q]}),e[79]=U,e[80]=H,e[81]=A,e[82]=K,e[83]=Q,e[84]=ie):ie=e[84];let de;return e[85]!==n||e[86]!==t||e[87]!==ie?(de=o.jsx(Xt,{open:t,onOpenChange:n,children:ie}),e[85]=n,e[86]=t,e[87]=ie,e[88]=de):de=e[88],de}const Zl=["normal","h1","h2","h3"],es=/^<(h[1-3])>([\s\S]*)<\/\1>$/i;function ts(u){const e=u.match(es);return e?{level:e[1].toLowerCase(),text:e[2]}:{level:"normal",text:u}}function $e(u,e){return e?u==="normal"?e:`<${u}>${e}</${u}>`:""}const Re={normal:"sandbox.productBlocks.headingNormal",h1:"sandbox.productBlocks.headingH1",h2:"sandbox.productBlocks.headingH2",h3:"sandbox.productBlocks.headingH3"},ls={normal:"text-lg font-semibold",h1:"text-3xl font-bold",h2:"text-2xl font-bold",h3:"text-xl font-semibold"};function ss(u){const e=I.c(27),{value:t,onChange:n}=u,l=O();let s,r,a,p,c;e[0]!==n||e[1]!==l||e[2]!==t?({level:s,text:c}=ts(t),p="space-y-1.5",r="flex items-center gap-0.5",a=Zl.map(x=>o.jsx(le,{active:s===x,label:l(Re[x]),onClick:()=>n($e(x,c)),children:l(Re[x])},x)),e[0]=n,e[1]=l,e[2]=t,e[3]=s,e[4]=r,e[5]=a,e[6]=p,e[7]=c):(s=e[3],r=e[4],a=e[5],p=e[6],c=e[7]);let m;e[8]!==r||e[9]!==a?(m=o.jsx("div",{className:r,children:a}),e[8]=r,e[9]=a,e[10]=m):m=e[10];let g;e[11]!==s||e[12]!==n?(g=x=>n($e(s,x.target.value)),e[11]=s,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=ls[s];let i;e[16]!==b?(i=Z("w-full border-0 bg-transparent p-0 outline-none placeholder:text-muted-foreground/50 focus:ring-0",b),e[16]=b,e[17]=i):i=e[17];let d;e[18]!==g||e[19]!==h||e[20]!==i||e[21]!==c?(d=o.jsx("input",{value:c,onChange:g,placeholder:h,className:i}),e[18]=g,e[19]=h,e[20]=i,e[21]=c,e[22]=d):d=e[22];let f;return e[23]!==p||e[24]!==m||e[25]!==d?(f=o.jsxs("div",{className:p,children:[m,d]}),e[23]=p,e[24]=m,e[25]=d,e[26]=f):f=e[26],f}function ht(u){const e=I.c(4),{label:t,onClick:n}=u;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(Ce,{size:13}),e[0]=l):l=e[0];let s;return e[1]!==t||e[2]!==n?(s=o.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 classic:rounded-md compact: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]=s):s=e[3],s}function bt(u){const e=I.c(9),{option:t,loading:n,className:l,iconSize:s}=u,r=s===void 0?18:s;let a;e[0]!==l?(a=Z("flex items-center justify-center overflow-hidden bg-muted text-muted-foreground",l),e[0]=l,e[1]=a):a=e[1];let p;e[2]!==r||e[3]!==n||e[4]!==t?(p=t?.image?o.jsx("img",{src:t.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-contain p-1.5"}):n?o.jsx(ze,{size:"xs"}):o.jsx(Gt,{size:r}),e[2]=r,e[3]=n,e[4]=t,e[5]=p):p=e[5];let c;return e[6]!==a||e[7]!==p?(c=o.jsx("span",{className:a,children:p}),e[6]=a,e[7]=p,e[8]=c):c=e[8],c}function os(u){const e=I.c(50),{id:t,option:n,loading:l,onRemove:s}=u,r=O();let a;e[0]!==t?(a={id:t},e[0]=t,e[1]=a):a=e[1];const{attributes:p,listeners:c,setNodeRef:m,transform:g,transition:h,isDragging:b}=Je(a);let i;e[2]!==g?(i=We.Transform.toString(g),e[2]=g,e[3]=i):i=e[3];let d;e[4]!==i||e[5]!==h?(d={transform:i,transition:h},e[4]=i,e[5]=h,e[6]=d):d=e[6];const f=b&&"z-10 opacity-60";let x;e[7]!==f?(x=Z("group/card relative flex flex-col overflow-hidden rounded-md border bg-background",f),e[7]=f,e[8]=x):x=e[8];let y;e[9]!==l||e[10]!==n?(y=o.jsx(bt,{option:n,loading:l,className:"h-full w-full"}),e[9]=l,e[10]=n,e[11]=y):y=e[11];let j;e[12]!==r?(j=r("sandbox.productBlocks.dragToReorderLabel"),e[12]=r,e[13]=j):j=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(et,{size:13}),e[14]=v):v=e[14];let C;e[15]!==p||e[16]!==c||e[17]!==j?(C=o.jsx("button",{type:"button","aria-label":j,...p,...c,className:"absolute left-1 top-1 flex h-6 w-6 cursor-grab items-center justify-center classic:rounded bg-background/80 text-muted-foreground opacity-0 backdrop-blur-sm transition-opacity hover:text-foreground active:cursor-grabbing group-hover/card:opacity-100 compact:rounded-lg",children:v}),e[15]=p,e[16]=c,e[17]=j,e[18]=C):C=e[18];let k;e[19]!==r?(k=r("sandbox.productBlocks.removeProductLabel"),e[19]=r,e[20]=k):k=e[20];let N;e[21]===Symbol.for("react.memo_cache_sentinel")?(N=o.jsx(Kt,{size:13}),e[21]=N):N=e[21];let S;e[22]!==s||e[23]!==k?(S=o.jsx("button",{type:"button","aria-label":k,onClick:s,className:"absolute right-1 top-1 flex h-6 w-6 items-center justify-center classic:rounded bg-background/80 text-muted-foreground opacity-0 backdrop-blur-sm transition-opacity hover:text-destructive group-hover/card:opacity-100 cursor-pointer compact:rounded-lg",children:N}),e[22]=s,e[23]=k,e[24]=S):S=e[24];let B;e[25]!==S||e[26]!==y||e[27]!==C?(B=o.jsxs("div",{className:"relative aspect-square",children:[y,C,S]}),e[25]=S,e[26]=y,e[27]=C,e[28]=B):B=e[28];let P;e[29]!==t||e[30]!==l||e[31]!==n?.label||e[32]!==r?(P=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]=P):P=e[33];let T;e[34]!==P?(T=o.jsx("p",{className:"line-clamp-2 text-xs leading-tight text-foreground",children:P}),e[34]=P,e[35]=T):T=e[35];let L;e[36]!==t||e[37]!==r?(L=r("sandbox.productBlocks.idLabel",{id:t}),e[36]=t,e[37]=r,e[38]=L):L=e[38];let w;e[39]!==L?(w=o.jsx("p",{className:"text-[11px] text-muted-foreground",children:L}),e[39]=L,e[40]=w):w=e[40];let _;e[41]!==T||e[42]!==w?(_=o.jsxs("div",{className:"flex flex-col gap-0.5 p-2",children:[T,w]}),e[41]=T,e[42]=w,e[43]=_):_=e[43];let $;return e[44]!==m||e[45]!==B||e[46]!==_||e[47]!==d||e[48]!==x?($=o.jsxs("div",{ref:m,style:d,className:x,children:[B,_]}),e[44]=m,e[45]=B,e[46]=_,e[47]=d,e[48]=x,e[49]=$):$=e[49],$}function rs(u){const e=I.c(21),{ids:t,lookup:n,onReorder:l,onRemove:s}=u;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={activationConstraint:{distance:6}},e[0]=r):r=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={coordinateGetter:qe},e[1]=a):a=e[1];const p=Ue(fe(He,r),fe(Me,a));let c;e[2]!==t||e[3]!==l?(c=d=>{const{active:f,over:x}=d;if(!x||f.id===x.id)return;const y=t.indexOf(String(f.id)),j=t.indexOf(String(x.id));y===-1||j===-1||l(Ge(t,y,j))},e[2]=t,e[3]=l,e[4]=c):c=e[4];const m=c;let g;if(e[5]!==t||e[6]!==n||e[7]!==s){let d;e[9]!==n||e[10]!==s?(d=f=>o.jsx(os,{id:f,option:n.byId.get(f),loading:n.isLoading&&!n.byId.get(f),onRemove:()=>s(f)},f),e[9]=n,e[10]=s,e[11]=d):d=e[11],g=t.map(d),e[5]=t,e[6]=n,e[7]=s,e[8]=g}else g=e[8];let h;e[12]!==g?(h=o.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=o.jsx(Ve,{items:t,strategy:Ct,children:h}),e[14]=t,e[15]=h,e[16]=b):b=e[16];let i;return e[17]!==m||e[18]!==p||e[19]!==b?(i=o.jsx(Ke,{sensors:p,collisionDetection:Ye,onDragEnd:m,children:b}),e[17]=m,e[18]=p,e[19]=b,e[20]=i):i=e[20],i}function ns(u){const e=I.c(13),{onBrowse:t}=u,n=O();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("span",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-muted text-muted-foreground",children:o.jsx(Vt,{size:16})}),e[0]=l):l=e[0];let s;e[1]!==n?(s=n("sandbox.productBlocks.addProductsButton"),e[1]=n,e[2]=s):s=e[2];let r;e[3]!==s?(r=o.jsx("span",{className:"text-sm font-medium text-foreground",children:s}),e[3]=s,e[4]=r):r=e[4];let a;e[5]!==n?(a=n("sandbox.productBlocks.addProductsDescription"),e[5]=n,e[6]=a):a=e[6];let p;e[7]!==a?(p=o.jsx("span",{className:"text-xs text-muted-foreground",children:a}),e[7]=a,e[8]=p):p=e[8];let c;return e[9]!==t||e[10]!==r||e[11]!==p?(c=o.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,p]}),e[9]=t,e[10]=r,e[11]=p,e[12]=c):c=e[12],c}function is(u){const e=I.c(30),{ids:t,onChange:n}=u,l=O();let s;e[0]!==t||e[1]!==n?(s=(f,x)=>n(t.map((y,j)=>j===f?x:y)),e[0]=t,e[1]=n,e[2]=s):s=e[2];const r=s;let a;e[3]!==l?(a=l("sandbox.productBlocks.vtexProductIds"),e[3]=l,e[4]=a):a=e[4];let p;e[5]!==a?(p=o.jsx(ue,{className:"text-xs text-muted-foreground",children:a}),e[5]=a,e[6]=p):p=e[6];let c;e[7]!==t.length||e[8]!==l?(c=t.length===0&&o.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 m;e[10]!==t||e[11]!==n||e[12]!==r||e[13]!==l?(m=t.map((f,x)=>o.jsxs("li",{className:"group/item flex items-center gap-3",children:[o.jsx("input",{value:f,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"}),o.jsx(re,{label:l("sandbox.productBlocks.removeProductIdButton"),onClick:()=>n(t.filter((y,j)=>j!==x))})]},x)),e[10]=t,e[11]=n,e[12]=r,e[13]=l,e[14]=m):m=e[14];let g;e[15]!==m?(g=o.jsx("ul",{className:"space-y-2",children:m}),e[15]=m,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 i;e[22]!==h||e[23]!==b?(i=o.jsx(ne,{label:h,onClick:b}),e[22]=h,e[23]=b,e[24]=i):i=e[24];let d;return e[25]!==p||e[26]!==c||e[27]!==g||e[28]!==i?(d=o.jsxs("div",{className:"space-y-2",children:[p,c,g,i]}),e[25]=p,e[26]=c,e[27]=g,e[28]=i,e[29]=d):d=e[29],d}function as(u){const e=I.c(32),{block:t,onChange:n,sandboxRef:l}=u,s=O();let r,a;e[0]!==t.products?(r=ct(t.products),a=new Set(r.filter(Boolean)),e[0]=t.products,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let p;e[3]!==a?(p=[...a],e[3]=a,e[4]=p):p=e[4];const c=p,[m,g]=W.useState(!1),h=mt(l,c);let b;e[5]!==t||e[6]!==n?(b=C=>n({...t,products:dt(t.products,C)}),e[5]=t,e[6]=n,e[7]=b):b=e[7];const i=b;let d;e[8]!==t.title?(d=R(t.title),e[8]=t.title,e[9]=d):d=e[9];let f;e[10]!==t||e[11]!==n?(f=C=>n({...t,title:C}),e[10]=t,e[11]=n,e[12]=f):f=e[12];let x;e[13]!==d||e[14]!==f?(x=o.jsx(ss,{value:d,onChange:f}),e[13]=d,e[14]=f,e[15]=x):x=e[15];let y;e[16]!==c||e[17]!==h||e[18]!==r||e[19]!==l||e[20]!==i||e[21]!==s?(y=l?o.jsxs("div",{className:"space-y-3",children:[c.length>0&&o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-xs font-medium text-muted-foreground",children:[c.length," ",s(c.length===1?"sandbox.productBlocks.productSingular":"sandbox.productBlocks.productPlural")]}),o.jsx(ht,{label:s("sandbox.productBlocks.browseProductsButton"),onClick:()=>g(!0)})]}),c.length===0?o.jsx(ns,{onBrowse:()=>g(!0)}):o.jsx(rs,{ids:c,lookup:h,onReorder:i,onRemove:C=>i(c.filter(k=>k!==C))})]}):o.jsx(is,{ids:r,onChange:i}),e[16]=c,e[17]=h,e[18]=r,e[19]=l,e[20]=i,e[21]=s,e[22]=y):y=e[22];let j;e[23]!==c||e[24]!==m||e[25]!==l||e[26]!==i?(j=l&&o.jsx(gt,{open:m,onOpenChange:g,sandboxRef:l,selectedIds:c,onChange:i}),e[23]=c,e[24]=m,e[25]=l,e[26]=i,e[27]=j):j=e[27];let v;return e[28]!==x||e[29]!==y||e[30]!==j?(v=o.jsxs("div",{className:"space-y-4 rounded-lg border bg-card p-4",children:[x,y,j]}),e[28]=x,e[29]=y,e[30]=j,e[31]=v):v=e[31],v}function cs(u){const e=I.c(27),{id:t,option:n,loading:l,onRemove:s}=u,r=O();let a;e[0]!==l||e[1]!==n?(a=o.jsx(bt,{option:n,loading:l,className:"h-11 w-11 shrink-0 rounded",iconSize:16}),e[0]=l,e[1]=n,e[2]=a):a=e[2];let p;e[3]!==t||e[4]!==l||e[5]!==n?.label||e[6]!==r?(p=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]=p):p=e[7];let c;e[8]!==p?(c=o.jsx("p",{className:"truncate text-sm text-foreground",children:p}),e[8]=p,e[9]=c):c=e[9];let m;e[10]!==t||e[11]!==r?(m=r("sandbox.productBlocks.idLabel",{id:t}),e[10]=t,e[11]=r,e[12]=m):m=e[12];let g;e[13]!==m?(g=o.jsx("p",{className:"text-xs text-muted-foreground",children:m}),e[13]=m,e[14]=g):g=e[14];let h;e[15]!==c||e[16]!==g?(h=o.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 i;e[20]!==s||e[21]!==b?(i=o.jsx(re,{label:b,onClick:s}),e[20]=s,e[21]=b,e[22]=i):i=e[22];let d;return e[23]!==a||e[24]!==h||e[25]!==i?(d=o.jsxs("div",{className:"group/item flex items-center gap-3 rounded-md border bg-background p-2",children:[a,h,i]}),e[23]=a,e[24]=h,e[25]=i,e[26]=d):d=e[26],d}function ds(u){const e=I.c(78),{block:t,onChange:n,sandboxRef:l}=u,s=O();let r;e[0]!==t.product?(r=ct(t.product).filter(Boolean)[0]??"",e[0]=t.product,e[1]=r):r=e[1];const a=r,[p,c]=W.useState(!1);let m;e[2]!==a?(m=a?[a]:[],e[2]=a,e[3]=m):m=e[3];const g=mt(l,m);let h;e[4]!==t||e[5]!==n?(h=A=>n({...t,product:dt(t.product,A)}),e[4]=t,e[5]=n,e[6]=h):h=e[6];const b=h;let i;e[7]!==s?(i=s("sandbox.productBlocks.productCardLabel"),e[7]=s,e[8]=i):i=e[8];let d;e[9]!==i?(d=o.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:i}),e[9]=i,e[10]=d):d=e[10];let f;e[11]!==s?(f=s("sandbox.productBlocks.ctaLabelField"),e[11]=s,e[12]=f):f=e[12];let x;e[13]!==f?(x=o.jsx(ue,{htmlFor:"product-card-cta",className:"text-xs text-muted-foreground",children:f}),e[13]=f,e[14]=x):x=e[14];let y;e[15]!==t.textCta?(y=R(t.textCta),e[15]=t.textCta,e[16]=y):y=e[16];let j;e[17]!==t||e[18]!==n?(j=A=>n({...t,textCta:A.target.value}),e[17]=t,e[18]=n,e[19]=j):j=e[19];let v;e[20]!==s?(v=s("sandbox.productBlocks.ctaLabelPlaceholder"),e[20]=s,e[21]=v):v=e[21];let C;e[22]!==v||e[23]!==y||e[24]!==j?(C=o.jsx("input",{id:"product-card-cta",value:y,onChange:j,placeholder:v,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]=v,e[23]=y,e[24]=j,e[25]=C):C=e[25];let k;e[26]!==C||e[27]!==x?(k=o.jsxs("div",{className:"space-y-2",children:[x,C]}),e[26]=C,e[27]=x,e[28]=k):k=e[28];let N;e[29]!==s?(N=s("sandbox.productBlocks.productSlugField"),e[29]=s,e[30]=N):N=e[30];let S;e[31]!==N?(S=o.jsx(ue,{htmlFor:"product-card-slug",className:"text-xs text-muted-foreground",children:N}),e[31]=N,e[32]=S):S=e[32];let B;e[33]!==t.productSlug?(B=R(t.productSlug),e[33]=t.productSlug,e[34]=B):B=e[34];let P;e[35]!==t||e[36]!==n?(P=A=>n({...t,productSlug:A.target.value}),e[35]=t,e[36]=n,e[37]=P):P=e[37];let T;e[38]!==s?(T=s("sandbox.productBlocks.productSlugPlaceholder"),e[38]=s,e[39]=T):T=e[39];let L;e[40]!==B||e[41]!==P||e[42]!==T?(L=o.jsx("input",{id:"product-card-slug",value:B,onChange:P,placeholder:T,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]=B,e[41]=P,e[42]=T,e[43]=L):L=e[43];let w;e[44]!==S||e[45]!==L?(w=o.jsxs("div",{className:"space-y-2",children:[S,L]}),e[44]=S,e[45]=L,e[46]=w):w=e[46];let _;e[47]!==s?(_=s("sandbox.productBlocks.productField"),e[47]=s,e[48]=_):_=e[48];let $;e[49]!==_?($=o.jsx(ue,{className:"text-xs text-muted-foreground",children:_}),e[49]=_,e[50]=$):$=e[50];let U;e[51]!==a||e[52]!==l||e[53]!==s?(U=l&&a&&o.jsx(ht,{label:s("sandbox.productBlocks.changeButton"),onClick:()=>c(!0)}),e[51]=a,e[52]=l,e[53]=s,e[54]=U):U=e[54];let Y;e[55]!==$||e[56]!==U?(Y=o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[$,U]}),e[55]=$,e[56]=U,e[57]=Y):Y=e[57];let H;e[58]!==g||e[59]!==a||e[60]!==l||e[61]!==b||e[62]!==s?(H=l?a?o.jsx(cs,{id:a,option:g.byId.get(a),loading:g.isLoading,onRemove:()=>b([])}):o.jsxs("button",{type:"button",onClick:()=>c(!0),className:"flex w-full items-center justify-center gap-1.5 classic:rounded-md compact:rounded-lg border border-dashed py-3 text-sm text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground cursor-pointer",children:[o.jsx(Ce,{size:14}),s("sandbox.productBlocks.chooseProductButton")]}):o.jsx("input",{value:a,onChange:A=>b(A.target.value?[A.target.value]:[]),placeholder:s("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]=a,e[60]=l,e[61]=b,e[62]=s,e[63]=H):H=e[63];let q;e[64]!==Y||e[65]!==H?(q=o.jsxs("div",{className:"space-y-2",children:[Y,H]}),e[64]=Y,e[65]=H,e[66]=q):q=e[66];let G;e[67]!==p||e[68]!==a||e[69]!==l||e[70]!==b?(G=l&&o.jsx(gt,{open:p,onOpenChange:c,sandboxRef:l,selectedIds:a?[a]:[],onChange:b,multiple:!1}),e[67]=p,e[68]=a,e[69]=l,e[70]=b,e[71]=G):G=e[71];let V;return e[72]!==k||e[73]!==w||e[74]!==q||e[75]!==G||e[76]!==d?(V=o.jsxs("div",{className:"space-y-4 rounded-lg border bg-card p-4",children:[d,k,w,q,G]}),e[72]=k,e[73]=w,e[74]=q,e[75]=G,e[76]=d,e[77]=V):V=e[77],V}const us=2,fs=2;function ms(u){return ae(u).map(R)}function ps(u){return ae(u).map(e=>Array.isArray(e)?e.map(R):[])}function De(u){return Array.from({length:u},()=>"")}function xs(u){const e=I.c(50),{headers:t,rows:n,onChange:l}=u,s=O();let r,a,p,c,m,g,h,b,i;if(e[0]!==t||e[1]!==l||e[2]!==n||e[3]!==s){const P=ms(t),T=ps(n),L=P.length===0&&T.length===0;p=L?us:Math.max(P.length,...T.map(bs),1);const w=Array.from({length:p},(A,E)=>P[E]??"");c=L?Array.from({length:fs},()=>De(p)):T.map(A=>Array.from({length:p},(E,z)=>A[z]??""));let _;e[13]!==l?(_=(A,E)=>l({headers:JSON.stringify(A.some(hs)?A:[]),rows:JSON.stringify(E)}),e[13]=l,e[14]=_):_=e[14];const $=_,U=(A,E)=>$(w.map((z,K)=>K===A?E:z),c),Y=(A,E,z)=>$(w,c.map((K,D)=>D===A?K.map((M,F)=>F===E?z:M):K));a=()=>$(w,[...c,De(p)]);const H=A=>$(w,c.filter((E,z)=>z!==A));r=()=>$([...w,""],c.map(gs));const q=A=>$(w.filter((E,z)=>z!==A),c.map(E=>E.filter((z,K)=>K!==A)));i="space-y-2",b="overflow-x-auto rounded-lg border",g="w-full border-collapse";let G;e[15]===Symbol.for("react.memo_cache_sentinel")?(G=o.jsx("th",{className:"w-8 border-b"}),e[15]=G):G=e[15];const V=o.jsxs("tr",{className:"bg-muted/40",children:[w.map((A,E)=>o.jsxs("th",{className:"group/col relative border-b border-r p-0 last:border-r-0",children:[o.jsx("input",{value:A,onChange:z=>U(E,z.target.value),placeholder:s("sandbox.tableBlock.headerPlaceholder",{n:E+1}),className:"w-full border-0 bg-transparent py-2 pl-7 pr-3 text-xs font-semibold uppercase tracking-wide outline-none placeholder:text-muted-foreground/40 focus:bg-background focus:ring-0"}),p>1&&o.jsx("button",{type:"button","aria-label":s("sandbox.tableBlock.removeColumn",{n:E+1}),onClick:()=>q(E),className:"absolute left-0.5 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center classic:rounded text-muted-foreground/50 opacity-0 transition-opacity hover:text-destructive group-hover/col:opacity-100 cursor-pointer compact:rounded-lg",children:o.jsx(ye,{size:12})})]},E)),G]});e[16]!==V?(h=o.jsx("thead",{children:V}),e[16]=V,e[17]=h):h=e[17],m=c.map((A,E)=>o.jsxs("tr",{className:"group/item border-b last:border-b-0",children:[A.map((z,K)=>o.jsx("td",{className:"border-r p-0 last:border-r-0",children:o.jsx("input",{value:z,onChange:D=>Y(E,K,D.target.value),placeholder:"—",className:"w-full border-0 bg-transparent px-3 py-2 text-sm outline-none placeholder:text-muted-foreground/30 focus:bg-muted/30 focus:ring-0"})},K)),o.jsx("td",{className:"w-8 text-center align-middle",children:c.length>1&&o.jsx("button",{type:"button","aria-label":s("sandbox.tableBlock.removeRow",{n:E+1}),onClick:()=>H(E),className:"flex h-6 w-6 items-center justify-center classic:rounded text-muted-foreground/60 opacity-0 transition-opacity hover:text-destructive group-hover/item:opacity-100 cursor-pointer compact:rounded-lg",children:o.jsx(ye,{size:13})})})]},E)),e[0]=t,e[1]=l,e[2]=n,e[3]=s,e[4]=r,e[5]=a,e[6]=p,e[7]=c,e[8]=m,e[9]=g,e[10]=h,e[11]=b,e[12]=i}else r=e[4],a=e[5],p=e[6],c=e[7],m=e[8],g=e[9],h=e[10],b=e[11],i=e[12];let d;e[18]!==p||e[19]!==c.length||e[20]!==s?(d=c.length===0&&o.jsx("tr",{children:o.jsx("td",{colSpan:p+1,className:"px-3 py-4 text-center text-xs text-muted-foreground",children:s("sandbox.tableBlock.noRowsYet")})}),e[18]=p,e[19]=c.length,e[20]=s,e[21]=d):d=e[21];let f;e[22]!==m||e[23]!==d?(f=o.jsxs("tbody",{children:[m,d]}),e[22]=m,e[23]=d,e[24]=f):f=e[24];let x;e[25]!==g||e[26]!==h||e[27]!==f?(x=o.jsxs("table",{className:g,children:[h,f]}),e[25]=g,e[26]=h,e[27]=f,e[28]=x):x=e[28];let y;e[29]!==b||e[30]!==x?(y=o.jsx("div",{className:b,children:x}),e[29]=b,e[30]=x,e[31]=y):y=e[31];let j;e[32]!==s?(j=s("sandbox.tableBlock.addRow"),e[32]=s,e[33]=j):j=e[33];let v;e[34]!==a||e[35]!==j?(v=o.jsx(ne,{label:j,onClick:a}),e[34]=a,e[35]=j,e[36]=v):v=e[36];let C;e[37]===Symbol.for("react.memo_cache_sentinel")?(C=o.jsx(tt,{size:13}),e[37]=C):C=e[37];let k;e[38]!==s?(k=s("sandbox.tableBlock.addColumn"),e[38]=s,e[39]=k):k=e[39];let N;e[40]!==r||e[41]!==k?(N=o.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 classic:rounded-md compact: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:[C,k]}),e[40]=r,e[41]=k,e[42]=N):N=e[42];let S;e[43]!==v||e[44]!==N?(S=o.jsxs("div",{className:"flex gap-2",children:[v,N]}),e[43]=v,e[44]=N,e[45]=S):S=e[45];let B;return e[46]!==S||e[47]!==i||e[48]!==y?(B=o.jsxs("div",{className:i,children:[y,S]}),e[46]=S,e[47]=i,e[48]=y,e[49]=B):B=e[49],B}function gs(u){return[...u,""]}function hs(u){return u.trim()!==""}function bs(u){return u.length}function ys(u){const e=I.c(188),{block:t,meta:n,onChange:l,sandboxRef:s}=u,r=O(),a=t.__resolveType??"",p=Bt(a);if(St(a))switch(p){case"Paragraph":{let i;e[0]!==t.html?(i=R(t.html),e[0]=t.html,e[1]=i):i=e[1];let d;e[2]!==r?(d=r("sandbox.blockRegistry.writeSomethingPlaceholder"),e[2]=r,e[3]=d):d=e[3];let f;e[4]!==t||e[5]!==l?(f=y=>l({...t,html:y}),e[4]=t,e[5]=l,e[6]=f):f=e[6];let x;return e[7]!==i||e[8]!==d||e[9]!==f?(x=o.jsx(fl,{html:i,placeholder:d,onChange:f}),e[7]=i,e[8]=d,e[9]=f,e[10]=x):x=e[10],x}case"Heading":{let i;e[11]!==t.text?(i=R(t.text),e[11]=t.text,e[12]=i):i=e[12];let d;e[13]!==t.level?(d=R(t.level),e[13]=t.level,e[14]=d):d=e[14];let f;e[15]!==t||e[16]!==l?(f=y=>l({...t,...y}),e[15]=t,e[16]=l,e[17]=f):f=e[17];let x;return e[18]!==i||e[19]!==d||e[20]!==f?(x=o.jsx(hl,{text:i,level:d,onChange:f}),e[18]=i,e[19]=d,e[20]=f,e[21]=x):x=e[21],x}case"Quote":{let i;e[22]!==t.quote?(i=R(t.quote),e[22]=t.quote,e[23]=i):i=e[23];let d;e[24]!==t||e[25]!==l?(d=x=>l({...t,quote:x}),e[24]=t,e[25]=l,e[26]=d):d=e[26];let f;return e[27]!==i||e[28]!==d?(f=o.jsx(bl,{quote:i,onChange:d}),e[27]=i,e[28]=d,e[29]=f):f=e[29],f}case"Code":{let i;e[30]!==t.code?(i=R(t.code),e[30]=t.code,e[31]=i):i=e[31];let d;e[32]!==t.language?(d=R(t.language),e[32]=t.language,e[33]=d):d=e[33];let f;e[34]!==t||e[35]!==l?(f=y=>l({...t,...y}),e[34]=t,e[35]=l,e[36]=f):f=e[36];let x;return e[37]!==i||e[38]!==d||e[39]!==f?(x=o.jsx(yl,{code:i,language:d,onChange:f}),e[37]=i,e[38]=d,e[39]=f,e[40]=x):x=e[40],x}case"List":{let i;e[41]!==t.items?(i=R(t.items),e[41]=t.items,e[42]=i):i=e[42];let d;e[43]!==t.style?(d=R(t.style),e[43]=t.style,e[44]=d):d=e[44];let f;e[45]!==t||e[46]!==l?(f=y=>l({...t,...y}),e[45]=t,e[46]=l,e[47]=f):f=e[47];let x;return e[48]!==i||e[49]!==d||e[50]!==f?(x=o.jsx(Nl,{items:i,style:d,onChange:f}),e[48]=i,e[49]=d,e[50]=f,e[51]=x):x=e[51],x}case"BlockImage":{let i;return e[52]!==t||e[53]!==l?(i=o.jsx(Bl,{block:t,onChange:l}),e[52]=t,e[53]=l,e[54]=i):i=e[54],i}case"Video":{let i;e[55]!==t.url?(i=R(t.url),e[55]=t.url,e[56]=i):i=e[56];let d;e[57]!==t.caption?(d=R(t.caption),e[57]=t.caption,e[58]=d):d=e[58];let f;e[59]!==t||e[60]!==l?(f=y=>l({...t,...y}),e[59]=t,e[60]=l,e[61]=f):f=e[61];let x;return e[62]!==i||e[63]!==d||e[64]!==f?(x=o.jsx(wl,{url:i,caption:d,onChange:f}),e[62]=i,e[63]=d,e[64]=f,e[65]=x):x=e[65],x}case"Divider":{let i;return e[66]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(Pl,{}),e[66]=i):i=e[66],i}case"Cta":{let i;e[67]!==t.text?(i=R(t.text),e[67]=t.text,e[68]=i):i=e[68];let d;e[69]!==t.href?(d=R(t.href),e[69]=t.href,e[70]=d):d=e[70];let f;e[71]!==t||e[72]!==l?(f=y=>l({...t,...y}),e[71]=t,e[72]=l,e[73]=f):f=e[73];let x;return e[74]!==i||e[75]!==d||e[76]!==f?(x=o.jsx(_l,{text:i,href:d,onChange:f}),e[74]=i,e[75]=d,e[76]=f,e[77]=x):x=e[77],x}case"Callout":{let i;e[78]!==t.title?(i=R(t.title),e[78]=t.title,e[79]=i):i=e[79];let d;e[80]!==t.body?(d=R(t.body),e[80]=t.body,e[81]=d):d=e[81];let f;e[82]!==t.variant?(f=R(t.variant),e[82]=t.variant,e[83]=f):f=e[83];let x;e[84]!==t||e[85]!==l?(x=j=>l({...t,...j}),e[84]=t,e[85]=l,e[86]=x):x=e[86];let y;return e[87]!==i||e[88]!==d||e[89]!==f||e[90]!==x?(y=o.jsx(Tl,{title:i,body:d,variant:f,onChange:x}),e[87]=i,e[88]=d,e[89]=f,e[90]=x,e[91]=y):y=e[91],y}case"Stat":{let i;e[92]!==t.value?(i=R(t.value),e[92]=t.value,e[93]=i):i=e[93];let d;e[94]!==t.label?(d=R(t.label),e[94]=t.label,e[95]=d):d=e[95];let f;e[96]!==t.description?(f=R(t.description),e[96]=t.description,e[97]=f):f=e[97];let x;e[98]!==t||e[99]!==l?(x=j=>l({...t,...j}),e[98]=t,e[99]=l,e[100]=x):x=e[100];let y;return e[101]!==i||e[102]!==d||e[103]!==f||e[104]!==x?(y=o.jsx(Ll,{value:i,label:d,description:f,onChange:x}),e[101]=i,e[102]=d,e[103]=f,e[104]=x,e[105]=y):y=e[105],y}case"StatGroup":{let i;e[106]!==t.stats?(i=oe(t.stats),e[106]=t.stats,e[107]=i):i=e[107];let d;e[108]!==t||e[109]!==l?(d=x=>l({...t,stats:x}),e[108]=t,e[109]=l,e[110]=d):d=e[110];let f;return e[111]!==i||e[112]!==d?(f=o.jsx(El,{stats:i,onChange:d}),e[111]=i,e[112]=d,e[113]=f):f=e[113],f}case"CardGroup":{let i;e[114]!==t.cards?(i=oe(t.cards),e[114]=t.cards,e[115]=i):i=e[115];let d;e[116]!==t||e[117]!==l?(d=x=>l({...t,cards:x}),e[116]=t,e[117]=l,e[118]=d):d=e[118];let f;return e[119]!==i||e[120]!==d?(f=o.jsx(Al,{cards:i,onChange:d}),e[119]=i,e[120]=d,e[121]=f):f=e[121],f}case"Checklist":{let i;e[122]!==t.title?(i=R(t.title),e[122]=t.title,e[123]=i):i=e[123];let d;e[124]!==t.items?(d=oe(t.items),e[124]=t.items,e[125]=d):d=e[125];let f;e[126]!==t||e[127]!==l?(f=y=>l({...t,...y}),e[126]=t,e[127]=l,e[128]=f):f=e[128];let x;return e[129]!==i||e[130]!==d||e[131]!==f?(x=o.jsx(Il,{title:i,items:d,onChange:f}),e[129]=i,e[130]=d,e[131]=f,e[132]=x):x=e[132],x}case"Steps":{let i;e[133]!==t.title?(i=R(t.title),e[133]=t.title,e[134]=i):i=e[134];let d;e[135]!==t.steps?(d=oe(t.steps),e[135]=t.steps,e[136]=d):d=e[136];let f;e[137]!==t||e[138]!==l?(f=y=>l({...t,...y}),e[137]=t,e[138]=l,e[139]=f):f=e[139];let x;return e[140]!==i||e[141]!==d||e[142]!==f?(x=o.jsx($l,{title:i,steps:d,onChange:f}),e[140]=i,e[141]=d,e[142]=f,e[143]=x):x=e[143],x}case"Comparison":{let i;e[144]!==t.left?(i=oe(t.left,{}),e[144]=t.left,e[145]=i):i=e[145];let d;e[146]!==t.right?(d=oe(t.right,{}),e[146]=t.right,e[147]=d):d=e[147];let f;e[148]!==t||e[149]!==l?(f=y=>l({...t,...y}),e[148]=t,e[149]=l,e[150]=f):f=e[150];let x;return e[151]!==i||e[152]!==d||e[153]!==f?(x=o.jsx(Rl,{left:i,right:d,onChange:f}),e[151]=i,e[152]=d,e[153]=f,e[154]=x):x=e[154],x}case"Table":{let i;e[155]!==t.headers?(i=oe(t.headers),e[155]=t.headers,e[156]=i):i=e[156];let d;e[157]!==t.rows?(d=oe(t.rows),e[157]=t.rows,e[158]=d):d=e[158];let f;e[159]!==t||e[160]!==l?(f=y=>l({...t,...y}),e[159]=t,e[160]=l,e[161]=f):f=e[161];let x;return e[162]!==i||e[163]!==d||e[164]!==f?(x=o.jsx(xs,{headers:i,rows:d,onChange:f}),e[162]=i,e[163]=d,e[164]=f,e[165]=x):x=e[165],x}case"ProductCard":{let i;return e[166]!==t||e[167]!==l||e[168]!==s?(i=o.jsx(ds,{block:t,onChange:l,sandboxRef:s}),e[166]=t,e[167]=l,e[168]=s,e[169]=i):i=e[169],i}case"ProductShelf":{let i;return e[170]!==t||e[171]!==l||e[172]!==s?(i=o.jsx(as,{block:t,onChange:l,sandboxRef:s}),e[170]=t,e[171]=l,e[172]=s,e[173]=i):i=e[173],i}}let m;e[174]!==n||e[175]!==a?(m=a?jt(a,n):null,e[174]=n,e[175]=a,e[176]=m):m=e[176];const g=m;if(!g){const i=a??"";let d;e[177]!==r||e[178]!==i?(d=r("sandbox.blockRegistry.unknownBlockType",{type:i}),e[177]=r,e[178]=i,e[179]=d):d=e[179];let f;return e[180]!==d?(f=o.jsx("p",{className:"text-xs text-muted-foreground",children:d}),e[180]=d,e[181]=f):f=e[181],f}let h;e[182]!==l?(h=i=>l(i),e[182]=l,e[183]=h):h=e[183];let b;return e[184]!==t||e[185]!==g||e[186]!==h?(b=o.jsx(Ht,{schema:g,value:t,onChange:h,basePath:""}),e[184]=t,e[185]=g,e[186]=h,e[187]=b):b=e[187],b}function vs(u){const e=I.c(43),{id:t,block:n,meta:l,onChange:s,onDelete:r,onDuplicate:a,sandboxRef:p}=u,c=O();let m;e[0]!==t?(m={id:t},e[0]=t,e[1]=m):m=e[1];const{attributes:g,listeners:h,setNodeRef:b,transform:i,transition:d,isDragging:f}=Je(m);let x;e[2]!==i?(x=We.Transform.toString(i),e[2]=i,e[3]=x):x=e[3];let y;e[4]!==x||e[5]!==d?(y={transform:x,transition:d},e[4]=x,e[5]=d,e[6]=y):y=e[6];const j=f&&"opacity-50";let v;e[7]!==j?(v=Z("group/row relative rounded-md py-1.5 pl-12 pr-2 transition-colors hover:bg-muted/40",j),e[7]=j,e[8]=v):v=e[8];let C;e[9]!==c?(C=c("sandbox.blockRow.dragToReorder"),e[9]=c,e[10]=C):C=e[10];let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx(et,{size:14}),e[11]=k):k=e[11];let N;e[12]!==g||e[13]!==h||e[14]!==C?(N=o.jsx("button",{type:"button","aria-label":C,className:"absolute left-1 top-1.5 flex h-6 w-6 cursor-grab items-center justify-center classic:rounded text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-foreground active:cursor-grabbing group-hover/row:opacity-100 compact:rounded-lg",...g,...h,children:k}),e[12]=g,e[13]=h,e[14]=C,e[15]=N):N=e[15];let S;e[16]!==c?(S=c("sandbox.blockRow.duplicateBlock"),e[16]=c,e[17]=S):S=e[17];let B;e[18]===Symbol.for("react.memo_cache_sentinel")?(B=o.jsx(Ft,{size:14}),e[18]=B):B=e[18];let P;e[19]!==a||e[20]!==S?(P=o.jsx("button",{type:"button","aria-label":S,onClick:a,className:"flex h-6 w-6 items-center justify-center classic:rounded text-muted-foreground hover:bg-muted hover:text-foreground cursor-pointer compact:rounded-lg",children:B}),e[19]=a,e[20]=S,e[21]=P):P=e[21];let T;e[22]!==c?(T=c("sandbox.blockRow.deleteBlock"),e[22]=c,e[23]=T):T=e[23];let L;e[24]===Symbol.for("react.memo_cache_sentinel")?(L=o.jsx(ye,{size:14}),e[24]=L):L=e[24];let w;e[25]!==r||e[26]!==T?(w=o.jsx("button",{type:"button","aria-label":T,onClick:r,className:"flex h-6 w-6 items-center justify-center classic:rounded text-muted-foreground hover:bg-muted hover:text-destructive cursor-pointer compact:rounded-lg",children:L}),e[25]=r,e[26]=T,e[27]=w):w=e[27];let _;e[28]!==P||e[29]!==w?(_=o.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,w]}),e[28]=P,e[29]=w,e[30]=_):_=e[30];let $;e[31]!==n||e[32]!==l||e[33]!==s||e[34]!==p?($=o.jsx(ys,{block:n,meta:l,onChange:s,sandboxRef:p}),e[31]=n,e[32]=l,e[33]=s,e[34]=p,e[35]=$):$=e[35];let U;return e[36]!==b||e[37]!==_||e[38]!==$||e[39]!==y||e[40]!==v||e[41]!==N?(U=o.jsxs("div",{ref:b,style:y,className:v,children:[N,_,$]}),e[36]=b,e[37]=_,e[38]=$,e[39]=y,e[40]=v,e[41]=N,e[42]=U):U=e[42],U}function me(){return crypto.randomUUID()}function js(u){return u.map(e=>({id:me(),block:e}))}function ks(u,e){return e.map((t,n)=>{const l=u[n];return{id:l?l.id:me(),block:t}})}function Xs(u){return Array.isArray(u)?u:[]}function Qs(u){const e=I.c(64),{value:t,onChange:n,meta:l,sandboxRef:s,emptyMessage:r}=u,a=r===void 0?"No content yet. Use ⊕ to add your first block.":r;let p;e[0]!==l?(p=wt(l),e[0]=l,e[1]=p):p=e[1];const c=p;let m;e[2]!==t?(m=()=>js(t),e[2]=t,e[3]=m):m=e[3];const[g,h]=W.useState(m),[b,i]=W.useState(t);t!==b&&(i(t),h(ks(g,t)));let d;e[4]!==g?(d=g.map(Bs),e[4]=g,e[5]=d):d=e[5];const f=d;let x;e[6]!==g?(x=g.map(Ns),e[6]=g,e[7]=x):x=e[7];const y=x;let j;e[8]!==n?(j=D=>{h(D);const M=D.map(Cs);i(M),n(M)},e[8]=n,e[9]=j):j=e[9];const v=j;let C;e[10]!==g||e[11]!==v?(C=(D,M)=>{const F=[...g];F.splice(D,0,{id:me(),block:{__resolveType:M}}),v(F)},e[10]=g,e[11]=v,e[12]=C):C=e[12];const k=C;let N;e[13]!==g||e[14]!==v?(N=(D,M)=>{v(g.map((F,X)=>X===D?{...F,block:M}:F))},e[13]=g,e[14]=v,e[15]=N):N=e[15];const S=N;let B;e[16]!==g||e[17]!==v?(B=D=>{v(g.filter((M,F)=>F!==D))},e[16]=g,e[17]=v,e[18]=B):B=e[18];const P=B;let T;e[19]!==g||e[20]!==v?(T=D=>{const M=g[D];if(!M)return;const F=[...g];F.splice(D+1,0,{id:me(),block:structuredClone(M.block)}),v(F)},e[19]=g,e[20]=v,e[21]=T):T=e[21];const L=T;let w;e[22]===Symbol.for("react.memo_cache_sentinel")?(w={activationConstraint:{distance:6}},e[22]=w):w=e[22];let _;e[23]===Symbol.for("react.memo_cache_sentinel")?(_={coordinateGetter:qe},e[23]=_):_=e[23];const $=Ue(fe(He,w),fe(Me,_));let U;e[24]!==g||e[25]!==v?(U=D=>{const{active:M,over:F}=D;if(!F||M.id===F.id)return;const X=g.findIndex(Q=>Q.id===String(M.id)),ee=g.findIndex(Q=>Q.id===String(F.id));X===-1||ee===-1||v(Ge(g,X,ee))},e[24]=g,e[25]=v,e[26]=U):U=e[26];const Y=U;let H;e[27]!==y.length||e[28]!==a?(H=y.length===0&&o.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground",children:a}),e[27]=y.length,e[28]=a,e[29]=H):H=e[29];let q;e[30]!==k?(q=D=>k(0,D),e[30]=k,e[31]=q):q=e[31];const G=y.length===0;let V;e[32]!==c||e[33]!==q||e[34]!==G?(V=o.jsx(Te,{blockTypes:c,onInsert:q,alwaysShow:G}),e[32]=c,e[33]=q,e[34]=G,e[35]=V):V=e[35];let A;if(e[36]!==g||e[37]!==c||e[38]!==L||e[39]!==k||e[40]!==l||e[41]!==P||e[42]!==s||e[43]!==S){let D;e[45]!==c||e[46]!==L||e[47]!==k||e[48]!==l||e[49]!==P||e[50]!==s||e[51]!==S?(D=(M,F)=>{const{id:X,block:ee}=M;return o.jsxs("div",{children:[o.jsx(vs,{id:X,block:ee,meta:l,onChange:Q=>S(F,Q),onDelete:()=>P(F),onDuplicate:()=>L(F),sandboxRef:s}),o.jsx(Te,{blockTypes:c,onInsert:Q=>k(F+1,Q)})]},X)},e[45]=c,e[46]=L,e[47]=k,e[48]=l,e[49]=P,e[50]=s,e[51]=S,e[52]=D):D=e[52],A=g.map(D),e[36]=g,e[37]=c,e[38]=L,e[39]=k,e[40]=l,e[41]=P,e[42]=s,e[43]=S,e[44]=A}else A=e[44];let E;e[53]!==f||e[54]!==V||e[55]!==A?(E=o.jsxs(Ve,{items:f,strategy:Nt,children:[V,A]}),e[53]=f,e[54]=V,e[55]=A,e[56]=E):E=e[56];let z;e[57]!==Y||e[58]!==$||e[59]!==E?(z=o.jsx(Ke,{sensors:$,collisionDetection:Ye,onDragEnd:Y,children:E}),e[57]=Y,e[58]=$,e[59]=E,e[60]=z):z=e[60];let K;return e[61]!==H||e[62]!==z?(K=o.jsxs("div",{className:"mt-2",children:[H,z]}),e[61]=H,e[62]=z,e[63]=K):K=e[63],K}function Cs(u){return u.block}function Ns(u){return u.block}function Bs(u){return u.id}export{Qs as B,Xs as a,Ws as b,Js as c};
|