decocms 4.98.2 → 4.99.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-s4M099V-.js → AlertCircle-XqqGV3Z6.js} +1 -1
- package/dist/client/assets/{AreaChart-DZY3jVGV.js → AreaChart-Cb5vezEb.js} +1 -1
- package/dist/client/assets/{ArrowRight-CEvUZ07f.js → ArrowRight-eKd4fN-U.js} +1 -1
- package/dist/client/assets/{ArrowUp-BZIsoAKC.js → ArrowUp-CwqP3NfG.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DmpBvFc_.js → ArrowUpRight-DpLV-PnO.js} +1 -1
- package/dist/client/assets/{Check-VM8y-9BQ.js → Check-CuStPfkH.js} +1 -1
- package/dist/client/assets/{CheckCircle-BAIP4B4s.js → CheckCircle-CELt-Ff1.js} +1 -1
- package/dist/client/assets/{ChevronDown-C7k6Nvz7.js → ChevronDown-BhzSzO-F.js} +1 -1
- package/dist/client/assets/{ChevronRight-GsbvSb1f.js → ChevronRight-D-6a6xHj.js} +1 -1
- package/dist/client/assets/{ChevronUp-BBz5QAvl.js → ChevronUp-B2lEsVKS.js} +1 -1
- package/dist/client/assets/{Copy01-BkSfK2eJ.js → Copy01-Ckds0BNV.js} +1 -1
- package/dist/client/assets/{DotsVertical-COIpLrxe.js → DotsVertical-BBjpcaJY.js} +1 -1
- package/dist/client/assets/{Eye-BCWEcnlS.js → Eye-CVbV_raa.js} +1 -1
- package/dist/client/assets/{FilterLines-CdIXRngT.js → FilterLines-Bm-n53eP.js} +1 -1
- package/dist/client/assets/{Globe01-xGPYTjkz.js → Globe01-B29qVwMW.js} +1 -1
- package/dist/client/assets/{Globe04-DSKs_NVJ.js → Globe04-C5fQerBK.js} +1 -1
- package/dist/client/assets/{HardDrive-DAb8AG3Y.js → HardDrive-BeV2wHr7.js} +1 -1
- package/dist/client/assets/{Image01-Dj2aQnzA.js → Image01-CpzRhjw-.js} +1 -1
- package/dist/client/assets/{Key01-DfWmgmlc.js → Key01-Br-NL4v6.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CmxpuOeh.js → LayoutLeft-D3pEEPrL.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DwePTfJe.js → LinkExternal01-VPpYp_Nz.js} +1 -1
- package/dist/client/assets/{Monitor01-B1903mhc.js → Monitor01-BbWyfKM-.js} +1 -1
- package/dist/client/assets/{Package-CjrrIbcY.js → Package-giUmCQTv.js} +1 -1
- package/dist/client/assets/{Palette-J3W4AQcQ.js → Palette-cb_H6dYq.js} +1 -1
- package/dist/client/assets/{Play-DMnKFapx.js → Play-BSxzVROp.js} +1 -1
- package/dist/client/assets/{Plus-DcI7xaXC.js → Plus-D3J2ZkJj.js} +1 -1
- package/dist/client/assets/{SearchLg-m2tN2z_q.js → SearchLg-Bji00daO.js} +1 -1
- package/dist/client/assets/{SearchMd-CK1b1J65.js → SearchMd-DRA_fm-t.js} +1 -1
- package/dist/client/assets/{Settings02-Bu50gx78.js → Settings02-DUAOVJ9V.js} +1 -1
- package/dist/client/assets/{Shield01-t2Ws4UCi.js → Shield01-H9zDGPeG.js} +1 -1
- package/dist/client/assets/{Star01-Bz40h6pO.js → Star01-Bi9Snhbv.js} +1 -1
- package/dist/client/assets/{Stars01-DXrHhfBN.js → Stars01-D7TqAQfA.js} +1 -1
- package/dist/client/assets/{Stars02-CPOpSHUw.js → Stars02-Ds-FqbiT.js} +1 -1
- package/dist/client/assets/{Sun-DXBHb5hE.js → Sun-1owZLJ_o.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DbqDzXZF.js → SwitchHorizontal01-DWJ1XbLE.js} +1 -1
- package/dist/client/assets/{Tool01-Cc0YA_de.js → Tool01-DfPAe4eV.js} +1 -1
- package/dist/client/assets/{Tool02-BgBpVowf.js → Tool02-B_haJwud.js} +1 -1
- package/dist/client/assets/{Trash01-B06SRS55.js → Trash01-DE0_omFY.js} +1 -1
- package/dist/client/assets/{TrendUp01-cv7CTzZH.js → TrendUp01-B5MySlCF.js} +1 -1
- package/dist/client/assets/{Upload01-Bdm_yBtp.js → Upload01-Cy9naNzM.js} +1 -1
- package/dist/client/assets/{User01-BwN_f-eA.js → User01-5RIq4_Iv.js} +1 -1
- package/dist/client/assets/{Users01-DgMkwC5F.js → Users01-Vq-rydwi.js} +1 -1
- package/dist/client/assets/{Users03-Brx9Tfi0.js → Users03-CkwkDwFQ.js} +1 -1
- package/dist/client/assets/{X-BlFMoNvi.js → X-CbgRopSM.js} +1 -1
- package/dist/client/assets/{XCircle-I2DGdz2H.js → XCircle-CiX77iUK.js} +1 -1
- package/dist/client/assets/{XClose-C1HOoFIF.js → XClose-DyOwi7PW.js} +1 -1
- package/dist/client/assets/{Zap-C9C0XcWZ.js → Zap-D-ISyZlf.js} +1 -1
- package/dist/client/assets/{ZapSquare-Dqaz_Wu7.js → ZapSquare-D0caCqhB.js} +1 -1
- package/dist/client/assets/{ZoomOut-CLMb9fqF.js → ZoomOut-BccWsYWo.js} +1 -1
- package/dist/client/assets/{access-gate-neKtespr.js → access-gate-vNRBQIRg.js} +1 -1
- package/dist/client/assets/{add-section-modal-BiDfxoZu.js → add-section-modal-CWKrN_Du.js} +1 -1
- package/dist/client/assets/{agent-icon-pxwcqiKA.js → agent-icon-C9M8Qgs2.js} +1 -1
- package/dist/client/assets/{agents-list-BjdOBjhy.js → agents-list-CPC1QRJp.js} +1 -1
- package/dist/client/assets/{ai-providers-CEx0bd-z.js → ai-providers-DVp-_mzP.js} +1 -1
- package/dist/client/assets/{alert-dialog-hIk4u9Gb.js → alert-dialog-DabruZmQ.js} +1 -1
- package/dist/client/assets/{alert-DO0YdPKF.js → alert-xjBDiZuV.js} +1 -1
- package/dist/client/assets/app-editor-CKQ7q9xg.js +1 -0
- package/dist/client/assets/{auth-KHE-8AXi.js → auth-B8BgG_-A.js} +1 -1
- package/dist/client/assets/{auth-catchall-Dw2gjNU4.js → auth-catchall-wZ-9EzxJ.js} +1 -1
- package/dist/client/assets/{auth-entry-awyvnsoy.js → auth-entry-dAaFyjRj.js} +1 -1
- package/dist/client/assets/{auth-split-layout-ykflmu8z.js → auth-split-layout-CivV-kxO.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Dw5vK4Np.js → authenticate-and-persist-oauth-DTf1gJW3.js} +1 -1
- package/dist/client/assets/{automation-list-row-CcfTxVvE.js → automation-list-row-Bxe1UuJn.js} +1 -1
- package/dist/client/assets/{automation-runs-CqsAiiMs.js → automation-runs-CmZ9KW0J.js} +1 -1
- package/dist/client/assets/automations-CHRgOy3z.js +1 -0
- package/dist/client/assets/{autosend-C5G3ujHX.js → autosend-DpJObari.js} +1 -1
- package/dist/client/assets/{avatar-W4HH3mYk.js → avatar-CR9iVdur.js} +1 -1
- package/dist/client/assets/{badge-BsMFZNOH.js → badge-XvDeZ6fv.js} +1 -1
- package/dist/client/assets/{block-document-BHE6ywJ4.js → block-document-STUEK7ED.js} +1 -1
- package/dist/client/assets/{brand-context-Bqr4cAus.js → brand-context-BAFCVOhd.js} +1 -1
- package/dist/client/assets/{buckets-C5KMMKb1.js → buckets-CEBGtnhb.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-CZqAzMMI.js → bulk-category-panel-ZfEla-pE.js} +1 -1
- package/dist/client/assets/{calendar-oce0FxN3.js → calendar-DRUl8y7E.js} +1 -1
- package/dist/client/assets/{capability-load-error-CbA1NqWt.js → capability-load-error-C-aOXmL5.js} +1 -1
- package/dist/client/assets/{card-9DbXNPrJ.js → card-BFt8D388.js} +1 -1
- package/dist/client/assets/{category-editor-8bUEH-Wt.js → category-editor-B0gjpnu6.js} +1 -1
- package/dist/client/assets/{chat-context-gzZ7g8Xm.js → chat-context-b7wY40dG.js} +1 -1
- package/dist/client/assets/{checkbox-BVsue6mv.js → checkbox-B7bcFvg_.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CEPfTmBb.js → cli-auth-success-Bv9ENzK8.js} +1 -1
- package/dist/client/assets/{collection-detail-CE8A5bk0.js → collection-detail-CCMftDyC.js} +1 -1
- package/dist/client/assets/{collection-display-button-Dfl8-jad.js → collection-display-button-It-ZN9Ac.js} +1 -1
- package/dist/client/assets/{collection-search-DwF42kDs.js → collection-search-B8DE7pS0.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DNoMV9U5.js → collection-table-wrapper-K3-9Ykil.js} +1 -1
- package/dist/client/assets/{collection-tabs-C2y4_AeK.js → collection-tabs-CRi5sPF6.js} +1 -1
- package/dist/client/assets/{command-BRhwT5rW.js → command-iaeulMQd.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-BNq8o8CH.js → commerce-onboarding-CzaxUno1.js} +1 -1
- package/dist/client/assets/{companions-core-BL6EyMpO.js → companions-core-C0CN4_0i.js} +1 -1
- package/dist/client/assets/{connect-C4I9C9GT.js → connect-C8ZBm-KO.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-GCGHv8Sq.js → connect-desktop-dialog-DPKgLupF.js} +1 -1
- package/dist/client/assets/{connection-card-Bn7CJCNN.js → connection-card-e2bclNdE.js} +1 -1
- package/dist/client/assets/{connection-detail-C3ypag6C.js → connection-detail-DriwvK0v.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-B-QHv1cx.js → connection-form-helpers-BgZpP06w.js} +1 -1
- package/dist/client/assets/{connections-aF15B61B.js → connections-Ca9MKk6b.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-C1filKUs.js → decopilot-sse-pool-BQUdJLw8.js} +1 -1
- package/dist/client/assets/{dialog-D8-F1Dpf.js → dialog-u_k4pxo5.js} +1 -1
- package/dist/client/assets/{domain-settings-But8W_Q0.js → domain-settings-DXrYDUa3.js} +1 -1
- package/dist/client/assets/{drawer-By87BFYK.js → drawer-C86weXnc.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BTKmAvGt.js → dropdown-menu-ClB-SnGU.js} +1 -1
- package/dist/client/assets/{empty-state-vqXVK1uB.js → empty-state-BQe89JAr.js} +1 -1
- package/dist/client/assets/{extract-connection-data-ChmN_E8R.js → extract-connection-data-DwqarX0g.js} +1 -1
- package/dist/client/assets/{file-explorer-CE5VMGoi.js → file-explorer-BnmyGDBl.js} +1 -1
- package/dist/client/assets/{file-type-icon-DaKccIVJ.js → file-type-icon-CUUaDbpn.js} +1 -1
- package/dist/client/assets/{files-DJoSNnRh.js → files-ClD_mI04.js} +1 -1
- package/dist/client/assets/{form-CjQec4iJ.js → form-DvGgcBNp.js} +1 -1
- package/dist/client/assets/{general-_jNMXiEE.js → general-Bscno4fJ.js} +1 -1
- package/dist/client/assets/{github-repo-picker-DlrrhmDQ.js → github-repo-picker-CJwuyICc.js} +1 -1
- package/dist/client/assets/{hooks-DscYSje4.js → hooks-Dat9iskm.js} +1 -1
- package/dist/client/assets/{index-CbzaZ7I7.js → index-8q4ROgAp.js} +1 -1
- package/dist/client/assets/{index-DUn-Pr9h.js → index-Akgr_Xwr.js} +1 -1
- package/dist/client/assets/{index-Bz0qWBv4.js → index-B8aeAWA2.js} +1 -1
- package/dist/client/assets/{index-DeXpWuKZ.js → index-C08sv2c-.js} +1 -1
- package/dist/client/assets/{index-D_3Jk9KL.js → index-CTjjDL0k.js} +3 -3
- package/dist/client/assets/{index-nLTsAUH1.js → index-Ch1cAHXh.js} +1 -1
- package/dist/client/assets/{index-CLo4P1Xt.js → index-CoFQWjWu.js} +1 -1
- package/dist/client/assets/{index-drugjJAP.js → index-CteIQMB0.js} +1 -1
- package/dist/client/assets/{index-B3mw6d9V.js → index-D5oNRj-6.js} +5 -5
- package/dist/client/assets/{index-C8WcR_-D.js → index-DHwzISKL.js} +1 -1
- package/dist/client/assets/{index-B6d99Zuw.js → index-DR8PhBak.js} +1 -1
- package/dist/client/assets/{index-DGQApBQJ.js → index-DfYr6tBQ.js} +1 -1
- package/dist/client/assets/{index-DCvlf1Ug.js → index-DvwWkvbF.js} +1 -1
- package/dist/client/assets/{index-redirect-BOpH_F8d.js → index-redirect-D9npRwTP.js} +1 -1
- package/dist/client/assets/{index-CCt42fhd.js → index-yySTLmxN.js} +7 -7
- package/dist/client/assets/{input-1TVgmysx.js → input-C_SNan5h.js} +1 -1
- package/dist/client/assets/{integration-icon-D1L6NAI-.js → integration-icon-B1EIcmc7.js} +1 -1
- package/dist/client/assets/invite-member-dialog-CprMrq6s.js +1 -0
- package/dist/client/assets/{label-3v7rgQ87.js → label-CWIiksOC.js} +1 -1
- package/dist/client/assets/layout-rGJqztT6.js +1 -0
- package/dist/client/assets/{login-DJz1mHLe.js → login-CyLQ2590.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DOoppcBw.js → mcp-oauth-CdDVM1Kh.js} +1 -1
- package/dist/client/assets/{members-htdU20Ak.js → members-Dgm_D9GP.js} +1 -1
- package/dist/client/assets/{monaco-editor-qoG_ANVE.js → monaco-editor-BqkNRmLm.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-dkx-6D_y.js → monitoring-stats-row-C0eUS1sK.js} +1 -1
- package/dist/client/assets/{multi-select-Cq9LWX9g.js → multi-select-CNkG8utF.js} +1 -1
- package/dist/client/assets/{oauth-callback-C5CwGMPX.js → oauth-callback-7PHJt0k1.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-LRqpMdk_.js → oauth-callback-ai-provider-DWmpRKc4.js} +1 -1
- package/dist/client/assets/{onboarding-Bx8ZTODK.js → onboarding-BJf0JUOS.js} +1 -1
- package/dist/client/assets/{org-install-C4nr0Vah.js → org-install-C5x_1xL7.js} +1 -1
- package/dist/client/assets/{org-layout-wN4G3m_j.js → org-layout-CnVB6jxb.js} +1 -1
- package/dist/client/assets/{organization-choice-Cg1WUyzX.js → organization-choice-DrsNwuL0.js} +1 -1
- package/dist/client/assets/{orgs-2YjmXoKn.js → orgs-BkkK5Lgq.js} +1 -1
- package/dist/client/assets/{page-seo-form-CqzAMBmy.js → page-seo-form-4ntsafg7.js} +1 -1
- package/dist/client/assets/page-seo-sheet-zFYVW9Rn.js +1 -0
- package/dist/client/assets/{popover-C5NpLL36.js → popover-ByY44B0c.js} +1 -1
- package/dist/client/assets/{post-editor-DO9iR3fF.js → post-editor-DnWlQ00I.js} +1 -1
- package/dist/client/assets/{primitives-DPxAocdS.js → primitives-alsZ8klS.js} +1 -1
- package/dist/client/assets/{profile-ChprDpgA.js → profile-BUunAU3P.js} +1 -1
- package/dist/client/assets/project-app-view-CPVCpqtg.js +1 -0
- package/dist/client/assets/record-editor-DlYuibE1.js +1 -0
- package/dist/client/assets/redirect-editor-4U80yExP.js +1 -0
- package/dist/client/assets/registry-DpVhBBcq.js +2 -0
- package/dist/client/assets/{registry-layout-DgJdNYSo.js → registry-layout-DO7biD8T.js} +1 -1
- package/dist/client/assets/{reports-2P5ajcib.js → reports-B2iXa55y.js} +1 -1
- package/dist/client/assets/{require-capability-bHFckPj9.js → require-capability-BM6Hy4og.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CW5F7Jgk.js → required-auth-layout-Bz1oFz-W.js} +1 -1
- package/dist/client/assets/reset-password-D_USgXUk.js +1 -0
- package/dist/client/assets/{roles-DYW42HYl.js → roles-DL1onjEm.js} +1 -1
- package/dist/client/assets/{search-input-BQbdJ2he.js → search-input-DnkWW-Gd.js} +1 -1
- package/dist/client/assets/{secrets-B-SU-tPR.js → secrets-ByYupfvM.js} +1 -1
- package/dist/client/assets/{sections-editor-Th4k2JT_.js → sections-editor-la9j1l6Z.js} +1 -1
- package/dist/client/assets/{select-DUmSM5EM.js → select-OlHxoBJz.js} +1 -1
- package/dist/client/assets/{select-model-ETM53_8W.js → select-model-HBS9R2j8.js} +1 -1
- package/dist/client/assets/{self-tool-result-IfNeydep.js → self-tool-result-CKjdMiqf.js} +1 -1
- package/dist/client/assets/{seo-editor-vJ4E4ytA.js → seo-editor-DT3BuQ4t.js} +1 -1
- package/dist/client/assets/{settings-layout-Bd59ZRXS.js → settings-layout-Cyvna48K.js} +1 -1
- package/dist/client/assets/{settings-section-BR9YvGIk.js → settings-section-D4ATPOeT.js} +1 -1
- package/dist/client/assets/shell-controls-xSJ_CBz8.js +1 -0
- package/dist/client/assets/{shell-layout-BsXxdfbp.js → shell-layout-573UShEI.js} +1 -1
- package/dist/client/assets/{sidebar-D6-aY7uR.js → sidebar-xm1vgluP.js} +1 -1
- package/dist/client/assets/{skeleton-Ch3CZUn8.js → skeleton-B3CL8fZK.js} +1 -1
- package/dist/client/assets/{sso-B0aGhfWu.js → sso-Dl7qGlaM.js} +1 -1
- package/dist/client/assets/{store-DlFKnntZ.js → store-DuHY87h0.js} +1 -1
- package/dist/client/assets/store-registry-qsAKCr1t.js +2 -0
- package/dist/client/assets/{studio-tools-DoMHB93K.js → studio-tools-DkN8b8B7.js} +1 -1
- package/dist/client/assets/{switch-CUqj3jOe.js → switch-Ct1C5yNI.js} +1 -1
- package/dist/client/assets/{table-pytWJ1ut.js → table-D_twSt1A.js} +1 -1
- package/dist/client/assets/{tabs-CkPmBMi3.js → tabs-BL4qz_0v.js} +1 -1
- package/dist/client/assets/{textarea-CxTodsGS.js → textarea-CD_WoWL0.js} +1 -1
- package/dist/client/assets/{toggle-group-KVNHQOlJ.js → toggle-group-DXDWKX1n.js} +1 -1
- package/dist/client/assets/{toolbar-DoZFc6_-.js → toolbar-DKPP0B2n.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-C8I3X4AL.js → toolbar-icon-button-Do2JIH_X.js} +1 -1
- package/dist/client/assets/{tooltip-gzP1o_vw.js → tooltip-DVgeIxlJ.js} +1 -1
- package/dist/client/assets/{use-ai-providers-B9qcHKGB.js → use-ai-providers-CVaUEgsU.js} +1 -1
- package/dist/client/assets/{use-api-keys-Cri6sUcw.js → use-api-keys-WnPQfDGG.js} +1 -1
- package/dist/client/assets/{use-automations-DrXIjC9t.js → use-automations-DUwCWM9N.js} +1 -1
- package/dist/client/assets/{use-autosave-CNVWllu0.js → use-autosave-BUrBAntN.js} +1 -1
- package/dist/client/assets/{use-capability-agtn1o9e.js → use-capability-DstzlECw.js} +1 -1
- package/dist/client/assets/{use-clock-tick-B0wuHOGm.js → use-clock-tick-CkqVwQ_W.js} +1 -1
- package/dist/client/assets/{use-connection-ZSSYjv0K.js → use-connection-CRV9qKeY.js} +1 -1
- package/dist/client/assets/{use-copy-BqcwGytp.js → use-copy-jN-dJpfw.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CfVxqhVH.js → use-create-virtual-mcp-BLkCl8r2.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-gzWIEzIj.js → use-debounced-autosave-D0tzNtga.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BWnhnNaP.js → use-debounced-value-BX6NTr7f.js} +1 -1
- package/dist/client/assets/{use-deco-credits-BmAFGsJd.js → use-deco-credits-DwHVvh8Z.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-D2An9y3w.js → use-decopilot-events-jVx0nTmd.js} +1 -1
- package/dist/client/assets/{use-delete-connection-1L-Gk2Ac.js → use-delete-connection-5wMwKJdr.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DhXQj96y.js → use-deployment-admin-B5DXZ0Si.js} +1 -1
- package/dist/client/assets/use-file-configs-D1SQkyYf.js +1 -0
- package/dist/client/assets/{use-infinite-scroll-lD_7yXP8.js → use-infinite-scroll-BfSBcFKy.js} +1 -1
- package/dist/client/assets/{use-join-requests-CrMSYiEs.js → use-join-requests-Ds7gm29T.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CAFPzOhG.js → use-mcp-auth-status-vmtcr5QJ.js} +1 -1
- package/dist/client/assets/{use-mcp-client-dIBU-iH0.js → use-mcp-client-BiD2fCU0.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-b8SvRxmy.js → use-mcp-tools-C43bRzXb.js} +1 -1
- package/dist/client/assets/{use-members-D_W3qaJm.js → use-members-1sm2C2bs.js} +1 -1
- package/dist/client/assets/{use-mobile-C0WhA6Ul.js → use-mobile-CWHotxPh.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BrNg4w6S.js → use-navigate-to-agent-CTFgvUlq.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BCp3C1EM.js → use-org-auth-client-DCuPZekg.js} +1 -1
- package/dist/client/assets/{use-org-sso-DR9Zr63B.js → use-org-sso-DQPVwN8s.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CKzI9TKZ.js → use-organization-roles-EiyKpsj2.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CaoxbJ0f.js → use-organization-settings-BkAAShAG.js} +1 -1
- package/dist/client/assets/{use-registry-app-CJge9fBS.js → use-registry-app-CRmTGCyB.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CHUzDznJ.js → use-registry-connections-DkXu4rfL.js} +1 -1
- package/dist/client/assets/{use-secrets-B5nZ1TW8.js → use-secrets-C-zmL48q.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CqT9RAaw.js → use-status-sounds-Cgzuw-1r.js} +1 -1
- package/dist/client/assets/{use-view-mode-Bf9x9eT5.js → use-view-mode-CwZaCSk5.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-oeoH8Gg2.js → use-virtual-mcp-rTU-PkMs.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-D2RarQG6.js +1 -0
- package/dist/client/assets/{useRouterState-BhEGfl3u.js → useRouterState-C8UzLSub.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DFzk5M-u.js +1 -0
- package/dist/client/assets/{users-BlPWlCLe.js → users-DqPNFRiE.js} +1 -1
- package/dist/client/assets/{variant-calendar-DPQhPCIJ.js → variant-calendar-Bj6Yxd7M.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-D_1UKzjv.js → view-mode-toggle-DbBhjVUT.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/app-editor-B80R4dvu.js +0 -1
- package/dist/client/assets/automations-B0_ws4kn.js +0 -1
- package/dist/client/assets/invite-member-dialog-DzaA-En6.js +0 -1
- package/dist/client/assets/layout-B2eLY54H.js +0 -1
- package/dist/client/assets/page-seo-sheet-D4-wp1A-.js +0 -1
- package/dist/client/assets/project-app-view-DWnPqmaW.js +0 -1
- package/dist/client/assets/record-editor-G_5MDDzm.js +0 -1
- package/dist/client/assets/redirect-editor-Beomv-cm.js +0 -1
- package/dist/client/assets/registry-D6LWxxJX.js +0 -2
- package/dist/client/assets/reset-password-O59NZF5c.js +0 -1
- package/dist/client/assets/shell-controls-CIsEVB_w.js +0 -1
- package/dist/client/assets/store-registry-aphKJLSj.js +0 -2
- package/dist/client/assets/use-file-configs-G2AW3Z28.js +0 -1
- package/dist/client/assets/useInfiniteQuery-Cmtb1pe3.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DOBDAIgL.js +0 -1
package/dist/client/assets/{automation-list-row-CcfTxVvE.js → automation-list-row-Bxe1UuJn.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as G,
|
|
1
|
+
import{c as G,b as J,r as U,m as W,j as t,B as X}from"./index-D5oNRj-6.js";import{A as Y,a as Z,b as ee,c as te,g as se,d as ie,e as ne,f as oe}from"./alert-dialog-DabruZmQ.js";import{D as ae,c as re,b as le,a as ce}from"./dropdown-menu-ClB-SnGU.js";import{s as me}from"./Stars02-Ds-FqbiT.js";import{i as ue}from"./DotsVertical-BBjpcaJY.js";import{s as de}from"./Trash01-DE0_omFY.js";import{i as fe}from"./Zap-D-ISyZlf.js";import{a as ge}from"./use-virtual-mcp-rTU-PkMs.js";import{A as xe}from"./agent-icon-C9M8Qgs2.js";import{u as pe}from"./use-automations-DUwCWM9N.js";function ke(c){const e=G.c(80),{automation:s,showAgent:a,onClick:n}=c,i=J(),{remove:o}=pe(),[l,O]=U.useState(!1),r=ge(a?s.virtual_mcp_id:void 0);let S;e[0]!==s.id||e[1]!==o?(S=()=>{o.mutate(s.id),O(!1)},e[0]=s.id,e[1]=o,e[2]=S):S=e[2];const I=S;let E;e[3]!==n?(E=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=E):E=e[4];const H=E,V=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==V?(u=W("inline-block size-2 rounded-full shrink-0",V),e[5]=V,e[6]=u):u=e[6];const q=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==q?(d=i(q),e[7]=i,e[8]=q,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(xe,{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 F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(ae,{asChild:!0,children:t.jsx(X,{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(ue,{size:16})})}),e[32]=F):F=e[32];let $,B;e[33]===Symbol.for("react.memo_cache_sentinel")?($=m=>{m.stopPropagation(),O(!0)},B=t.jsx(de,{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(re,{children:[F,t.jsx(le,{align:"end",children:t.jsxs(ce,{variant:"destructive",onClick:$,children:[B,v]})})]})}),e[37]=v,e[38]=_):_=e[38];let b;e[39]!==H||e[40]!==n||e[41]!==w||e[42]!==_||e[43]!==f||e[44]!==g?(b=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]=b):b=e[45];let A;e[46]!==i?(A=i("automations.automationListRow.deleteTitle"),e[46]=i,e[47]=A):A=e[47];let D;e[48]!==A?(D=t.jsx(Y,{children:A}),e[48]=A,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(Z,{children:N}),e[53]=N,e[54]=R):R=e[54];let y;e[55]!==D||e[56]!==R?(y=t.jsxs(ee,{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(te,{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]!==I||e[65]!==o.isPending||e[66]!==k?(P=t.jsx(se,{onClick:I,disabled:Q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:k}),e[64]=I,e[65]=o.isPending,e[66]=k,e[67]=P):P=e[67];let T;e[68]!==L||e[69]!==P?(T=t.jsxs(ie,{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(ne,{children:[y,T]}),e[71]=y,e[72]=T,e[73]=z):z=e[73];let M;e[74]!==l||e[75]!==z?(M=t.jsx(oe,{open:l,onOpenChange:O,children:z}),e[74]=l,e[75]=z,e[76]=M):M=e[76];let K;return e[77]!==b||e[78]!==M?(K=t.jsxs(t.Fragment,{children:[b,M]}),e[77]=b,e[78]=M,e[79]=K):K=e[79],K}function he(c){return c.stopPropagation()}function je(c){return c.stopPropagation()}function we(c){const e=G.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(me,{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(fe,{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{ke as A};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as A,c as P,P as Aa,j as a,B as st,M as fr,J as La,R as Ea,i as Y,m as ee,q as Ma,aS as Ra,aP as Xe,aW as Pa,aV as Ge,bH as Mt,aT as lt,bI as Wr,aR as Kr,F as Fe,o as $a,d as Oa,K as Te,t as Jn,n as Rt,b as ht,E as Vr,aM as Gr,bJ as js,aU as Da,bK as Ze}from"./index-B3mw6d9V.js";import{e as Ha}from"./select-DUmSM5EM.js";import{u as qr}from"./useInfiniteQuery-Cmtb1pe3.js";import{a as Xr,u as za}from"./use-connection-ZSSYjv0K.js";import{j as Ba,u as ws,b as Fa,i as Ua,a as Wa,S as Ka}from"./use-mcp-client-dIBU-iH0.js";import{u as Va}from"./use-virtual-mcp-oeoH8Gg2.js";import{C as Ga}from"./card-9DbXNPrJ.js";import{o as Yr,m as Qr,p as Ts,q as Ns}from"./sidebar-D6-aY7uR.js";import{c as Jr,e as Zr,a as Cn,d as je,b as eo,T as we}from"./table-pytWJ1ut.js";import{E as Zn}from"./empty-state-vqXVK1uB.js";import{u as Cs}from"./use-infinite-scroll-lD_7yXP8.js";import{a as qa}from"./use-members-D_W3qaJm.js";import{u as to,S as dt}from"./use-clock-tick-B0wuHOGm.js";import{e as Xa}from"./use-automations-DrXIjC9t.js";import{u as no}from"./studio-tools-DoMHB93K.js";import{u as Ya}from"./useSuspenseInfiniteQuery-DOBDAIgL.js";import{A as so}from"./avatar-W4HH3mYk.js";import{t as Vt}from"./ChevronDown-C7k6Nvz7.js";import{n as es}from"./ChevronUp-BBz5QAvl.js";import{t as Qa,a as ro,n as _s}from"./Tool02-BgBpVowf.js";import{g as Ja,aD as Za,aE as ei,a6 as ti,B as ni,aF as si,a9 as ri,ap as oi,m as ai,aG as ii,aB as oo,aH as li,A as ao,aI as $e,aJ as ci,q as ui}from"./agent-icon-pxwcqiKA.js";import{t as _n}from"./Stars01-DXrHhfBN.js";import{i as io}from"./ArrowRight-CEvUZ07f.js";import{i as Is}from"./Check-VM8y-9BQ.js";import{i as mr}from"./ChevronRight-GsbvSb1f.js";import{a as lo}from"./Copy01-BkSfK2eJ.js";import{b as qe,t as As,c as pr}from"./format-time-BnbuEtat.js";import{u as co}from"./use-copy-BqcwGytp.js";import{T as rt,a as ot,b as at}from"./tooltip-gzP1o_vw.js";import{M as Ls,I as uo,F as di}from"./file-type-icon-DaKccIVJ.js";import{R as fi,c as mi,r as pi,g as hi}from"./hooks-DscYSje4.js";import{S as gi,h as gt,m as xi,c as Es,d as bi,b as yi}from"./chat-context-gzZ7g8Xm.js";import{c as vi}from"./monaco-editor-qoG_ANVE.js";import{g as fo,M as ki}from"./index-B6d99Zuw.js";import{f as Si,n as ji,o as wi}from"./tab-id-BijBBRwE.js";import{N as ve,R as Ti,k as Ni,a as Ne,l as Ci,F as hr,S as mo,T as tt,m as _i,n as Ms,D as _t,h as In,o as It,P as Ie,p as Ii,e as Ae,q as Ai,r as Li,s as Ei,v as po,w as ft,x as fe,y as xt,z as it,A as mt,B as ts,G as Mi,H as Ri,I as Pi,J as $i,K as Oi,L as Di,O as Hi,Q as ho,U as ns,V as zi,W as Bi,X as go,Y as Fi,Z as Ui,_ as gr,t as Wi,$ as Le,a0 as bt,c as Ki,u as Vi,M as Gi,d as qi}from"./calendar-oce0FxN3.js";import{i as xo}from"./AlertCircle-s4M099V-.js";import{s as Xi}from"./Eye-BCWEcnlS.js";import{s as Gt,t as bo}from"./Star01-Bz40h6pO.js";import{s as Yi}from"./XClose-C1HOoFIF.js";import{n as ss}from"./ZapSquare-Dqaz_Wu7.js";import{n as yo,i as Qi}from"./Globe01-xGPYTjkz.js";import{c as Ji,b as Zi}from"./Tool01-Cc0YA_de.js";import{i as xr,a as el}from"./ZoomOut-CLMb9fqF.js";import{i as kt}from"./Monitor01-B1903mhc.js";import{i as tl}from"./SearchMd-CK1b1J65.js";import{i as nl}from"./Upload01-Bdm_yBtp.js";import{u as sl,a as rl}from"./shell-layout-BsXxdfbp.js";import{a as $t}from"./Image01-Dj2aQnzA.js";import{n as vo}from"./LinkExternal01-DwePTfJe.js";import{I as Ye}from"./integration-icon-D1L6NAI-.js";import{i as ol}from"./ArrowUpRight-DmpBvFc_.js";import{a as Rs}from"./Users03-Brx9Tfi0.js";import{a as Oe}from"./Palette-J3W4AQcQ.js";import{c as ko}from"./use-navigate-to-agent-BrNg4w6S.js";import{a as Ot}from"./XCircle-I2DGdz2H.js";import{a as al}from"./Stars02-CPOpSHUw.js";import{g as il}from"./AreaChart-DZY3jVGV.js";import{b as ll,a as cl,c as ul,d as dl,e as fl}from"./dialog-D8-F1Dpf.js";import{a as ml,F as pl,b as hl,c as gl,d as xl,f as bl}from"./form-CjQec4iJ.js";import{I as yl}from"./input-1TVgmysx.js";const vl={openrouter:t=>{const e=t?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function So(t){if(!t?.providerMetadata)return 0;for(const e of Object.values(vl)){const n=e(t.providerMetadata);if(n!==null)return n}return 0}function jo(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function wo(t,e){if(!e)return t;const n=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,s=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:t.inputTokens+(e.inputTokens??0),outputTokens:t.outputTokens+(e.outputTokens??0),reasoningTokens:t.reasoningTokens+(e.reasoningTokens??0),totalTokens:t.totalTokens+(e.totalTokens??0),cost:t.cost+So(e),cacheReadTokens:t.cacheReadTokens+n,cacheWriteTokens:t.cacheWriteTokens+s}}function Dp(t){return t.reduce((e,n)=>wo(e,n.metadata?.usage),jo())}const kl={damping:.7,stiffness:.05,mass:1.25},Sl=70,jl=1e3/60,wl=350;let An=!1;globalThis.document?.addEventListener("mousedown",()=>{An=!0});globalThis.document?.addEventListener("mouseup",()=>{An=!1});globalThis.document?.addEventListener("click",()=>{An=!1});const Tl=(t={})=>{const[e,n]=A.useState(!1),[s,r]=A.useState(t.initial!==!1),[o,i]=A.useState(!1),l=A.useRef(null);l.current=t;const c=A.useCallback(()=>{if(!An)return!1;const b=window.getSelection();if(!b||!b.rangeCount)return!1;const S=b.getRangeAt(0);return S.commonAncestorContainer.contains(g.current)||g.current?.contains(S.commonAncestorContainer)},[]),u=A.useCallback(b=>{d.isAtBottom=b,r(b)},[]),m=A.useCallback(b=>{d.escapedFromLock=b,n(b)},[]),d=A.useMemo(()=>{let b;return{escapedFromLock:e,isAtBottom:s,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(S){if(g.current){const{scrollBehavior:v}=getComputedStyle(g.current);v!=="auto"&&(g.current.style.scrollBehavior="auto"),g.current.scrollTop=S,d.ignoreScrollToTop=g.current.scrollTop,v!=="auto"&&(g.current.style.scrollBehavior=v)}},get targetScrollTop(){return!g.current||!y.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!y.current)return 0;const{targetScrollTop:S}=this;if(!t.targetScrollTop)return S;if(b?.targetScrollTop===S)return b.calculatedScrollTop;const v=Math.max(Math.min(t.targetScrollTop(S,{scrollElement:g.current,contentElement:y.current}),S),0);return b={targetScrollTop:S,calculatedScrollTop:v},requestAnimationFrame(()=>{b=void 0}),v},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Sl}}},[]),f=A.useCallback((b={})=>{typeof b=="string"&&(b={animation:b}),b.preserveScrollPosition||u(!0);const S=Date.now()+(Number(b.wait)||0),v=Hn(l.current,b.animation),{ignoreEscapes:T=!1}=b;let k,j=d.calculatedTargetScrollTop;b.duration instanceof Promise?b.duration.finally(()=>{k=Date.now()}):k=S+(b.duration??0);const w=async()=>{const N=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;const{scrollTop:C}=d,_=performance.now(),I=(_-(d.lastTick??_))/jl;if(d.animation||(d.animation={behavior:v,promise:N,ignoreEscapes:T}),d.animation.behavior===v&&(d.lastTick=_),c()||S>Date.now())return w();if(C<Math.min(j,d.calculatedTargetScrollTop)){if(d.animation?.behavior===v){if(v==="instant")return d.scrollTop=d.calculatedTargetScrollTop,w();d.velocity=(v.damping*d.velocity+v.stiffness*d.scrollDifference)/v.mass,d.accumulated+=d.velocity*I,d.scrollTop+=d.accumulated,d.scrollTop!==C&&(d.accumulated=0)}return w()}return k>Date.now()?(j=d.calculatedTargetScrollTop,w()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:Hn(l.current,l.current.resize),ignoreEscapes:T,duration:Math.max(0,k-Date.now())||void 0}):d.isAtBottom)});return N.then(C=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),C))};return b.wait!==!0&&(d.animation=void 0),d.animation?.behavior===v?d.animation.promise:w()},[u,c,d]),p=A.useCallback(()=>{m(!0),u(!1)},[m,u]),h=A.useCallback(({target:b})=>{if(b!==g.current)return;const{scrollTop:S,ignoreScrollToTop:v}=d;let{lastScrollTop:T=S}=d;d.lastScrollTop=S,d.ignoreScrollToTop=void 0,v&&v>S&&(T=v),i(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||S===v)return;if(c()){m(!0),u(!1);return}const k=S>T,j=S<T;if(d.animation?.ignoreEscapes){d.scrollTop=T;return}j&&(m(!0),u(!1)),k&&m(!1),!d.escapedFromLock&&d.isNearBottom&&u(!0)},1)},[m,u,c,d]),x=A.useCallback(({target:b,deltaY:S})=>{let v=b;for(;!["scroll","auto"].includes(getComputedStyle(v).overflow);){if(!v.parentElement)return;v=v.parentElement}v===g.current&&S<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(m(!0),u(!1))},[m,u,d]),g=br(b=>{g.current?.removeEventListener("scroll",h),g.current?.removeEventListener("wheel",x),b?.addEventListener("scroll",h,{passive:!0}),b?.addEventListener("wheel",x,{passive:!0})},[]),y=br(b=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!b)return;let S;d.resizeObserver=new ResizeObserver(([v])=>{const{height:T}=v.contentRect,k=T-(S??T);if(d.resizeDifference=k,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),i(d.isNearBottom),k>=0){const j=Hn(l.current,S?l.current.resize:l.current.initial);f({animation:j,wait:!0,preserveScrollPosition:!0,duration:j==="instant"?void 0:wl})}else d.isNearBottom&&(m(!1),u(!0));S=T,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===k&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(b)},[]);return{contentRef:y,scrollRef:g,scrollToBottom:f,stopScroll:p,isAtBottom:s||o,isNearBottom:o,escapedFromLock:e,state:d}};function br(t,e){const n=A.useCallback(s=>(n.current=s,t(s)),e);return n}const Dn=new Map;function Hn(...t){const e={...kl};let n=!1;for(const r of t){if(r==="instant"){n=!0;continue}typeof r=="object"&&(n=!1,e.damping=r.damping??e.damping,e.stiffness=r.stiffness??e.stiffness,e.mass=r.mass??e.mass)}const s=JSON.stringify(e);return Dn.has(s)||Dn.set(s,Object.freeze(e)),n?"instant":Dn.get(s)}function Nl(t){let e=2166136261;for(let n=0;n<t.length;n++)e=Math.imul(e^t.charCodeAt(n),16777619);return`a${(e>>>0).toString(36).padStart(6,"0").slice(-6)}`}function Ps(t){if(t&&typeof t=="object"&&"gatewayClientId"in t&&typeof t.gatewayClientId=="string")return t.gatewayClientId}function $s(t,e){if(!e)return t;const n=`${Nl(e)}_`;return t.startsWith(n)?t.slice(n.length):t}function Cl(t,e){return $s(t,e).replace(/[_-]/g," ").toLowerCase()}function _l(t){const e={};for(const n of t?.arguments??[])e[n.name]=n.required?fr().min(1,"Required"):fr();return La(e)}function Il(t,e){const n={};for(const s of t.arguments??[])n[s.name]=e?.[s.name]??"";return n}function Al(t){const e=P.c(67),{prompt:n,setPrompt:s,onSubmit:r,defaultValues:o}=t,i=A.useId();let l,c;if(e[0]!==n){const O=_l(n);c=Ea,l=Aa(O),e[0]=n,e[1]=l,e[2]=c}else l=e[1],c=e[2];let u;e[3]!==o||e[4]!==n?(u=n?Il(n,o):{},e[3]=o,e[4]=n,e[5]=u):u=e[5];let m;e[6]!==l||e[7]!==u?(m={resolver:l,defaultValues:u,mode:"onChange"},e[6]=l,e[7]=u,e[8]=m):m=e[8];const d=c(m);let f;e[9]!==n?.arguments?(f=n?.arguments??[],e[9]=n?.arguments,e[10]=f):f=e[10];const p=f;let h;e[11]!==d||e[12]!==r||e[13]!==s?(h=async O=>{await r(O),s(null),d.reset()},e[11]=d,e[12]=r,e[13]=s,e[14]=h):h=e[14];const x=h;let g;e[15]!==d||e[16]!==s?(g=O=>{O||(d.reset(),s(null))},e[15]=d,e[16]=s,e[17]=g):g=e[17];const y=g;if(!n)return null;let b;e[18]!==n._meta||e[19]!==n.name||e[20]!==n.title?(b=n.title||Cl(n.name,Ps(n._meta)),e[18]=n._meta,e[19]=n.name,e[20]=n.title,e[21]=b):b=e[21];let S;e[22]!==b?(S=a.jsx(ll,{children:a.jsx("span",{className:"capitalize",children:b})}),e[22]=b,e[23]=S):S=e[23];let v;e[24]!==n.description?(v=n.description&&a.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[24]=n.description,e[25]=v):v=e[25];let T;e[26]!==v||e[27]!==S?(T=a.jsxs(cl,{children:[S,v]}),e[26]=v,e[27]=S,e[28]=T):T=e[28];let k;e[29]!==d||e[30]!==x?(k=O=>{O.stopPropagation(),d.handleSubmit(x)(O)},e[29]=d,e[30]=x,e[31]=k):k=e[31];let j;if(e[32]!==p||e[33]!==d.control||e[34]!==d.formState.isSubmitting){let O;e[36]!==d.control||e[37]!==d.formState.isSubmitting?(O=H=>a.jsx(pl,{control:d.control,name:H.name,render:z=>{const{field:D}=z;return a.jsxs(hl,{children:[a.jsxs(gl,{className:"text-xs",children:[H.name,H.required?null:a.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),a.jsx(xl,{children:a.jsx(yl,{...D,value:D.value??"",required:H.required,placeholder:H.description??"",className:"h-9",disabled:d.formState.isSubmitting})}),a.jsx(bl,{})]})}},H.name),e[36]=d.control,e[37]=d.formState.isSubmitting,e[38]=O):O=e[38],j=p.map(O),e[32]=p,e[33]=d.control,e[34]=d.formState.isSubmitting,e[35]=j}else j=e[35];let w;e[39]!==y?(w=()=>y(!1),e[39]=y,e[40]=w):w=e[40];let N;e[41]!==d.formState.isSubmitting||e[42]!==w?(N=a.jsx(st,{type:"button",variant:"ghost",onClick:w,disabled:d.formState.isSubmitting,children:"Cancel"}),e[41]=d.formState.isSubmitting,e[42]=w,e[43]=N):N=e[43];let C;e[44]!==d.formState.isSubmitting?(C=d.formState.isSubmitting?a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(gi,{size:"xs"}),"Loading..."]}):"Use prompt",e[44]=d.formState.isSubmitting,e[45]=C):C=e[45];let _;e[46]!==d.formState.isSubmitting||e[47]!==i||e[48]!==C?(_=a.jsx(st,{type:"submit",form:i,disabled:d.formState.isSubmitting,children:C}),e[46]=d.formState.isSubmitting,e[47]=i,e[48]=C,e[49]=_):_=e[49];let I;e[50]!==N||e[51]!==_?(I=a.jsxs(ul,{children:[N,_]}),e[50]=N,e[51]=_,e[52]=I):I=e[52];let E;e[53]!==i||e[54]!==k||e[55]!==j||e[56]!==I?(E=a.jsxs("form",{id:i,className:"space-y-4 py-4",autoComplete:"off",onSubmit:k,children:[j,I]}),e[53]=i,e[54]=k,e[55]=j,e[56]=I,e[57]=E):E=e[57];let M;e[58]!==d||e[59]!==E?(M=a.jsx(ml,{...d,children:E}),e[58]=d,e[59]=E,e[60]=M):M=e[60];let L;e[61]!==T||e[62]!==M?(L=a.jsxs(dl,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[T,M]}),e[61]=T,e[62]=M,e[63]=L):L=e[63];let R;return e[64]!==y||e[65]!==L?(R=a.jsx(fl,{open:!0,onOpenChange:y,children:L}),e[64]=y,e[65]=L,e[66]=R):R=e[66],R}const Ll=/^mcp__[a-zA-Z0-9_-]+__/;function To(t){return t.replace(Ll,"")}function Ln(t){const e=P.c(19),{id:n,part:s,copyable:r,extraActions:o,alwaysShowActions:i,animate:l}=t,c=r===void 0?!1:r,u=i===void 0?!1:i,m=l===void 0?!1:l,{handleCopy:d}=co(),f=Y(),[p,h]=A.useState(!1);let x;e[0]!==d||e[1]!==n||e[2]!==s.text?(x=async()=>{Ma("chat_message_copied",{message_id:n,chars:s.text.length}),await d(s.text),h(!0),setTimeout(()=>h(!1),2e3)},e[0]=d,e[1]=n,e[2]=s.text,e[3]=x):x=e[3];const g=x,y=c&&o,b=y||o;let S;e[4]!==m||e[5]!==n||e[6]!==s.text?(S=a.jsx(Ls,{id:n,text:s.text,animate:m}),e[4]=m,e[5]=n,e[6]=s.text,e[7]=S):S=e[7];let v;e[8]!==u||e[9]!==o||e[10]!==g||e[11]!==p||e[12]!==b||e[13]!==y||e[14]!==f?(v=b&&a.jsxs("div",{className:ee("flex w-full items-center gap-2 text-sm text-muted-foreground transition-all duration-200 mt-1 py-1",u?"opacity-100":"opacity-0 pointer-events-none group-hover/part:opacity-100 group-hover/part:pointer-events-auto"),children:[o,y&&o&&a.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),y&&a.jsx("button",{type:"button",onClick:g,className:"text-muted-foreground [@media(hover:hover)]:hover:text-foreground transition-colors active:scale-[0.97]","aria-label":f("chat.textPart.copyMessage"),children:p?a.jsx(Is,{className:"size-4"}):a.jsx(lo,{className:"size-4"})})]}),e[8]=u,e[9]=o,e[10]=g,e[11]=p,e[12]=b,e[13]=y,e[14]=f,e[15]=v):v=e[15];let T;return e[16]!==S||e[17]!==v?(T=a.jsxs("div",{className:"group/part relative",children:[S,v]}),e[16]=S,e[17]=v,e[18]=T):T=e[18],T}function Hp(t,e,n){t.chain().focus().insertContentAt(e,[El(n),{type:"text",text:" "}]).run()}function El(t){return{type:"file",attrs:t}}function Ml(t){const e=P.c(17),{node:n,selected:s,view:r}=t,{name:o,mimeType:i,data:l}=n.attrs,c=s&&r.editable;let u;e[0]!==i?(u=i.startsWith("image/"),e[0]=i,e[1]=u):u=e[1];const m=u,d=c&&"outline-2 outline-blue-300 outline-offset-0";let f;e[2]!==d?(f=ee("px-1 py-1 rounded","inline-flex items-center gap-1","cursor-default select-none","text-xs font-light","bg-muted text-muted-foreground",d),e[2]=d,e[3]=f):f=e[3];let p;e[4]!==o?(p=a.jsx(rt,{asChild:!0,children:a.jsx("span",{children:o})}),e[4]=o,e[5]=p):p=e[5];let h;e[6]!==l||e[7]!==m||e[8]!==i||e[9]!==o?(h=a.jsx(ot,{side:"top",className:"max-w-sm p-1.5",children:m?a.jsx("img",{src:`data:${i};base64,${l}`,alt:o,className:"max-w-full max-h-64 object-contain rounded"}):a.jsxs("div",{className:"text-xs",children:[a.jsx("div",{className:"font-medium",children:o}),a.jsx("div",{className:"text-muted-foreground mt-1",children:i})]})}),e[6]=l,e[7]=m,e[8]=i,e[9]=o,e[10]=h):h=e[10];let x;e[11]!==p||e[12]!==h?(x=a.jsxs(at,{children:[p,h]}),e[11]=p,e[12]=h,e[13]=x):x=e[13];let g;return e[14]!==f||e[15]!==x?(g=a.jsx(Ni,{className:f,children:x}),e[14]=f,e[15]=x,e[16]=g):g=e[16],g}const Rl=ve.create({name:"file",group:"inline",inline:!0,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id")||null,renderHTML:t=>t.id?{"data-id":t.id}:{}},name:{default:null,parseHTML:t=>t.getAttribute("data-name")||null,renderHTML:t=>t.name?{"data-name":t.name}:{}},mimeType:{default:null,parseHTML:t=>t.getAttribute("data-mime-type")||null,renderHTML:t=>t.mimeType?{"data-mime-type":t.mimeType}:{}},size:{default:0,parseHTML:t=>{const e=t.getAttribute("data-size");return e?Number.parseInt(e,10):0},renderHTML:t=>t.size?{"data-size":String(t.size)}:{}},data:{default:null,parseHTML:t=>t.getAttribute("data-data")||null,renderHTML:t=>t.data?{"data-data":t.data}:{}}}},parseHTML(){return[{tag:'span[data-type="file"]'}]},renderHTML({node:t,HTMLAttributes:e}){const n={"data-type":"file"};return t.attrs.id&&(n["data-id"]=t.attrs.id),t.attrs.name&&(n["data-name"]=t.attrs.name),t.attrs.mimeType&&(n["data-mime-type"]=t.attrs.mimeType),t.attrs.size&&(n["data-size"]=String(t.attrs.size)),t.attrs.data&&(n["data-data"]=t.attrs.data),["span",{...e,...n}]},renderText({node:t}){return`[${t.attrs.name??""}]`},addNodeView(){return Ti(Ml)}});function Pl(t={}){return new Ne({view(e){return new $l(e,t)}})}class $l{constructor(e,n){var s;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(s=n.width)!==null&&s!==void 0?s:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let o=i=>{this[r](i)};return e.dom.addEventListener(r,o),{name:r,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,s,r=this.editorView.dom,o=r.getBoundingClientRect(),i=o.width/r.offsetWidth,l=o.height/r.offsetHeight;if(n){let d=e.nodeBefore,f=e.nodeAfter;if(d||f){let p=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(p){let h=p.getBoundingClientRect(),x=d?h.bottom:h.top;d&&f&&(x=(x+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*l;s={left:h.left,right:h.right,top:x-g,bottom:x+g}}}}if(!s){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*i;s={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let c=this.editorView.dom.offsetParent;this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let u,m;if(!c||c==document.body&&getComputedStyle(c).position=="static")u=-pageXOffset,m=-pageYOffset;else{let d=c.getBoundingClientRect(),f=d.width/c.offsetWidth,p=d.height/c.offsetHeight;u=d.left-c.scrollLeft*f,m=d.top-c.scrollTop*p}this.element.style.left=(s.left-u)/i+"px",this.element.style.top=(s.top-m)/l+"px",this.element.style.width=(s.right-s.left)/i+"px",this.element.style.height=(s.bottom-s.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),s=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),r=s&&s.type.spec.disableDropCursor,o=typeof r=="function"?r(this.editorView,n,e):r;if(n&&!o){let i=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Ci(this.editorView.state.doc,i,this.editorView.dragging.slice);l!=null&&(i=l)}this.setCursor(i),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class le extends It{constructor(e){super(e,e)}map(e,n){let s=e.resolve(n.map(this.head));return le.valid(s)?new le(s):It.near(s)}content(){return mo.empty}eq(e){return e instanceof le&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new le(e.resolve(n.pos))}getBookmark(){return new Os(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!Ol(e)||!Dl(e))return!1;let s=n.type.spec.allowGapCursor;if(s!=null)return s;let r=n.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,n,s=!1){e:for(;;){if(!s&&le.valid(e))return e;let r=e.pos,o=null;for(let i=e.depth;;i--){let l=e.node(i);if(n>0?e.indexAfter(i)<l.childCount:e.index(i)>0){o=l.child(n>0?e.indexAfter(i):e.index(i)-1);break}else if(i==0)return null;r+=n;let c=e.doc.resolve(r);if(le.valid(c))return c}for(;;){let i=n>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!Ms.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*n),s=!1;continue e}break}o=i,r+=n;let l=e.doc.resolve(r);if(le.valid(l))return l}return null}}}le.prototype.visible=!1;le.findFrom=le.findGapCursorFrom;It.jsonID("gapcursor",le);class Os{constructor(e){this.pos=e}map(e){return new Os(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return le.valid(n)?new le(n):It.near(n)}}function No(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function Ol(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),s=t.node(e);if(n==0){if(s.type.spec.isolating)return!0;continue}for(let r=s.child(n-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||No(r.type))return!0;if(r.inlineContent)return!1}}return!0}function Dl(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),s=t.node(e);if(n==s.childCount){if(s.type.spec.isolating)return!0;continue}for(let r=s.child(n);;r=r.firstChild){if(r.childCount==0&&!r.inlineContent||No(r.type))return!0;if(r.inlineContent)return!1}}return!0}function Hl(){return new Ne({props:{decorations:Ul,createSelectionBetween(t,e,n){return e.pos==n.pos&&le.valid(n)?new le(n):null},handleClick:Bl,handleKeyDown:zl,handleDOMEvents:{beforeinput:Fl}}})}const zl=_i({ArrowLeft:Dt("horiz",-1),ArrowRight:Dt("horiz",1),ArrowUp:Dt("vert",-1),ArrowDown:Dt("vert",1)});function Dt(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(s,r,o){let i=s.selection,l=e>0?i.$to:i.$from,c=i.empty;if(i instanceof tt){if(!o.endOfTextblock(n)||l.depth==0)return!1;c=!1,l=s.doc.resolve(e>0?l.after():l.before())}let u=le.findGapCursorFrom(l,e,c);return u?(r&&r(s.tr.setSelection(new le(u))),!0):!1}}function Bl(t,e,n){if(!t||!t.editable)return!1;let s=t.state.doc.resolve(e);if(!le.valid(s))return!1;let r=t.posAtCoords({left:n.clientX,top:n.clientY});return r&&r.inside>-1&&Ms.isSelectable(t.state.doc.nodeAt(r.inside))?!1:(t.dispatch(t.state.tr.setSelection(new le(s))),!0)}function Fl(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof le))return!1;let{$from:n}=t.state.selection,s=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!s)return!1;let r=hr.empty;for(let i=s.length-1;i>=0;i--)r=hr.from(s[i].createAndFill(null,r));let o=t.state.tr.replace(n.pos,n.pos,new mo(r,0,0));return o.setSelection(tt.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function Ul(t){if(!(t.selection instanceof le))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",_t.create(t.doc,[In.widget(t.selection.head,e,{key:"gapcursor"})])}var qt=200,pe=function(){};pe.prototype.append=function(e){return e.length?(e=pe.from(e),!this.length&&e||e.length<qt&&this.leafAppend(e)||this.length<qt&&e.leafPrepend(this)||this.appendInner(e)):this};pe.prototype.prepend=function(e){return e.length?pe.from(e).append(this):this};pe.prototype.appendInner=function(e){return new Wl(this,e)};pe.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?pe.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};pe.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};pe.prototype.forEach=function(e,n,s){n===void 0&&(n=0),s===void 0&&(s=this.length),n<=s?this.forEachInner(e,n,s,0):this.forEachInvertedInner(e,n,s,0)};pe.prototype.map=function(e,n,s){n===void 0&&(n=0),s===void 0&&(s=this.length);var r=[];return this.forEach(function(o,i){return r.push(e(o,i))},n,s),r};pe.from=function(e){return e instanceof pe?e:e&&e.length?new Co(e):pe.empty};var Co=(function(t){function e(s){t.call(this),this.values=s}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,o){return r==0&&o==this.length?this:new e(this.values.slice(r,o))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,o,i,l){for(var c=o;c<i;c++)if(r(this.values[c],l+c)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,i,l){for(var c=o-1;c>=i;c--)if(r(this.values[c],l+c)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=qt)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=qt)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(pe);pe.empty=new Co([]);var Wl=(function(t){function e(n,s){t.call(this),this.left=n,this.right=s,this.length=n.length+s.length,this.depth=Math.max(n.depth,s.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(s){return s<this.left.length?this.left.get(s):this.right.get(s-this.left.length)},e.prototype.forEachInner=function(s,r,o,i){var l=this.left.length;if(r<l&&this.left.forEachInner(s,r,Math.min(o,l),i)===!1||o>l&&this.right.forEachInner(s,Math.max(r-l,0),Math.min(this.length,o)-l,i+l)===!1)return!1},e.prototype.forEachInvertedInner=function(s,r,o,i){var l=this.left.length;if(r>l&&this.right.forEachInvertedInner(s,r-l,Math.max(o,l)-l,i+l)===!1||o<l&&this.left.forEachInvertedInner(s,Math.min(r,l),o,i)===!1)return!1},e.prototype.sliceInner=function(s,r){if(s==0&&r==this.length)return this;var o=this.left.length;return r<=o?this.left.slice(s,r):s>=o?this.right.slice(s-o,r-o):this.left.slice(s,o).append(this.right.slice(0,r-o))},e.prototype.leafAppend=function(s){var r=this.right.leafAppend(s);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(s){var r=this.left.leafPrepend(s);if(r)return new e(r,this.right)},e.prototype.appendInner=function(s){return this.left.depth>=Math.max(this.right.depth,s.depth)+1?new e(this.left,new e(this.right,s)):new e(this,s)},e})(pe);const Kl=500;class _e{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}let r,o;n&&(r=this.remapping(s,this.items.length),o=r.maps.length);let i=e.tr,l,c,u=[],m=[];return this.items.forEach((d,f)=>{if(!d.step){r||(r=this.remapping(s,f+1),o=r.maps.length),o--,m.push(d);return}if(r){m.push(new Me(d.map));let p=d.step.map(r.slice(o)),h;p&&i.maybeStep(p).doc&&(h=i.mapping.maps[i.mapping.maps.length-1],u.push(new Me(h,void 0,void 0,u.length+m.length))),o--,h&&r.appendMap(h,o)}else i.maybeStep(d.step);if(d.selection)return l=r?d.selection.map(r.slice(o)):d.selection,c=new _e(this.items.slice(0,s).append(m.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:i,selection:l}}addTransform(e,n,s,r){let o=[],i=this.eventCount,l=this.items,c=!r&&l.length?l.get(l.length-1):null;for(let m=0;m<e.steps.length;m++){let d=e.steps[m].invert(e.docs[m]),f=new Me(e.mapping.maps[m],d,n),p;(p=c&&c.merge(f))&&(f=p,m?o.pop():l=l.slice(0,l.length-1)),o.push(f),n&&(i++,n=void 0),r||(c=f)}let u=i-s.depth;return u>Gl&&(l=Vl(l,u),i-=u),new _e(l.append(o),i)}remapping(e,n){let s=new Ii;return this.items.forEach((r,o)=>{let i=r.mirrorOffset!=null&&o-r.mirrorOffset>=e?s.maps.length-r.mirrorOffset:void 0;s.appendMap(r.map,i)},e,n),s}addMaps(e){return this.eventCount==0?this:new _e(this.items.append(e.map(n=>new Me(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let s=[],r=Math.max(0,this.items.length-n),o=e.mapping,i=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},r);let c=n;this.items.forEach(f=>{let p=o.getMirror(--c);if(p==null)return;i=Math.min(i,p);let h=o.maps[p];if(f.step){let x=e.steps[p].invert(e.docs[p]),g=f.selection&&f.selection.map(o.slice(c+1,p));g&&l++,s.push(new Me(h,x,g))}else s.push(new Me(h))},r);let u=[];for(let f=n;f<i;f++)u.push(new Me(o.maps[f]));let m=this.items.slice(0,r).append(u).append(s),d=new _e(m,l);return d.emptyItemCount()>Kl&&(d=d.compress(this.items.length-s.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),s=n.maps.length,r=[],o=0;return this.items.forEach((i,l)=>{if(l>=e)r.push(i),i.selection&&o++;else if(i.step){let c=i.step.map(n.slice(s)),u=c&&c.getMap();if(s--,u&&n.appendMap(u,s),c){let m=i.selection&&i.selection.map(n.slice(s));m&&o++;let d=new Me(u.invert(),c,m),f,p=r.length-1;(f=r.length&&r[p].merge(d))?r[p]=f:r.push(d)}}else i.map&&s--},this.items.length,0),new _e(pe.from(r.reverse()),o)}}_e.empty=new _e(pe.empty,0);function Vl(t,e){let n;return t.forEach((s,r)=>{if(s.selection&&e--==0)return n=r,!1}),t.slice(n)}class Me{constructor(e,n,s,r){this.map=e,this.step=n,this.selection=s,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Me(n.getMap().invert(),n,this.selection)}}}class We{constructor(e,n,s,r,o){this.done=e,this.undone=n,this.prevRanges=s,this.prevTime=r,this.prevComposition=o}}const Gl=20;function ql(t,e,n,s){let r=n.getMeta(nt),o;if(r)return r.historyState;n.getMeta(Ql)&&(t=new We(t.done,t.undone,null,0,-1));let i=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(i&&i.getMeta(nt))return i.getMeta(nt).redo?new We(t.done.addTransform(n,void 0,s,Wt(e)),t.undone,yr(n.mapping.maps),t.prevTime,t.prevComposition):new We(t.done,t.undone.addTransform(n,void 0,s,Wt(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(i&&i.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),c=t.prevTime==0||!i&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-s.newGroupDelay||!Xl(n,t.prevRanges)),u=i?zn(t.prevRanges,n.mapping):yr(n.mapping.maps);return new We(t.done.addTransform(n,c?e.selection.getBookmark():void 0,s,Wt(e)),_e.empty,u,n.time,l??t.prevComposition)}else return(o=n.getMeta("rebased"))?new We(t.done.rebased(n,o),t.undone.rebased(n,o),zn(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new We(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),zn(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function Xl(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((s,r)=>{for(let o=0;o<e.length;o+=2)s<=e[o+1]&&r>=e[o]&&(n=!0)}),n}function yr(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((s,r,o,i)=>e.push(o,i));return e}function zn(t,e){if(!t)return null;let n=[];for(let s=0;s<t.length;s+=2){let r=e.map(t[s],1),o=e.map(t[s+1],-1);r<=o&&n.push(r,o)}return n}function Yl(t,e,n){let s=Wt(e),r=nt.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,s);if(!o)return null;let i=o.selection.resolve(o.transform.doc),l=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),r,s),c=new We(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(i).setMeta(nt,{redo:n,historyState:c})}let Bn=!1,vr=null;function Wt(t){let e=t.plugins;if(vr!=e){Bn=!1,vr=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Bn=!0;break}}return Bn}const nt=new Ie("history"),Ql=new Ie("closeHistory");function Jl(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ne({key:nt,state:{init(){return new We(_e.empty,_e.empty,null,0,-1)},apply(e,n,s){return ql(n,s,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let s=n.inputType,r=s=="historyUndo"?Io:s=="historyRedo"?Ao:null;return!r||!e.editable?!1:(n.preventDefault(),r(e.state,e.dispatch))}}}})}function _o(t,e){return(n,s)=>{let r=nt.getState(n);if(!r||(t?r.undone:r.done).eventCount==0)return!1;if(s){let o=Yl(r,n,t);o&&s(e?o.scrollIntoView():o)}return!0}}const Io=_o(!1,!0),Ao=_o(!0,!0);Ae.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=t?.node||this.editor.state.doc;if((t?.mode||this.options.mode)==="textSize"){const s=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(s)}return e.nodeSize},this.storage.words=t=>{const e=t?.node||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new Ne({key:new Ie("characterCount"),appendTransaction:(e,n,s)=>{if(t)return;const r=this.options.limit;if(r==null||r===0){t=!0;return}const o=this.storage.characters({node:s.doc});if(o>r){const i=o-r,l=0,c=i;console.warn(`[CharacterCount] Initial content exceeded limit of ${r} characters. Content was automatically trimmed.`);const u=s.tr.deleteRange(l,c);return t=!0,u}t=!0},filterTransaction:(e,n)=>{const s=this.options.limit;if(!e.docChanged||s===0||s===null||s===void 0)return!0;const r=this.storage.characters({node:n.doc}),o=this.storage.characters({node:e.doc});if(o<=s||r>s&&o>s&&o<=r)return!0;if(r>s&&o>s&&o>r||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,c=o-s,u=l-c,m=l;return e.deleteRange(u,m),!(this.storage.characters({node:e.doc})>s)}})]}});var Zl=Ae.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Pl(this.options)]}});Ae.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Ne({key:new Ie("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:s}=this.editor,{anchor:r}=e,o=[];if(!n||!s)return _t.create(t,[]);let i=0;this.options.mode==="deepest"&&t.descendants((c,u)=>{if(c.isText)return;if(!(r>=u&&r<=u+c.nodeSize-1))return!1;i+=1});let l=0;return t.descendants((c,u)=>{if(c.isText||!(r>=u&&r<=u+c.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&i-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";o.push(In.node(u,u+c.nodeSize,{class:this.options.className}))}),_t.create(t,o)}}})]}});var ec=Ae.create({name:"gapCursor",addProseMirrorPlugins(){return[Hl()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Li(Ei(t,"allowGapCursor",n)))!=null?e:null}}}),kr="placeholder";function tc(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var zp=Ae.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:kr,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const t=this.options.dataAttribute?`data-${tc(this.options.dataAttribute)}`:`data-${kr}`;return[new Ne({key:new Ie("placeholder"),props:{decorations:({doc:e,selection:n})=>{const s=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=n,o=[];if(!s)return null;const i=this.editor.isEmpty;return e.descendants((l,c)=>{const u=r>=c&&r<=c+l.nodeSize,m=!l.isLeaf&&Ai(l);if((u||!this.options.showOnlyCurrent)&&m){const d=[this.options.emptyNodeClass];i&&d.push(this.options.emptyEditorClass);const f=In.node(c,c+l.nodeSize,{class:d.join(" "),[t]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:l,pos:c,hasAnchor:u}):this.options.placeholder});o.push(f)}return this.options.includeChildren}),_t.create(e,o)}}})]}});Ae.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new Ne({key:new Ie("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||po(n.selection)||t.view.dragging?null:_t.create(n.doc,[In.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function Sr({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||e?.type===t}var nc=Ae.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Ie(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",s=Object.entries(this.editor.schema.nodes).map(([,r])=>r).filter(r=>(this.options.notAfter||[]).concat(n).includes(r.name));return[new Ne({key:e,appendTransaction:(r,o,i)=>{const{doc:l,tr:c,schema:u}=i,m=e.getState(i),d=l.content.size,f=u.nodes[n];if(m)return c.insert(d,f.create())},state:{init:(r,o)=>{const i=o.tr.doc.lastChild;return!Sr({node:i,types:s})},apply:(r,o)=>{if(!r.docChanged||r.getMeta("__uniqueIDTransaction"))return o;const i=r.doc.lastChild;return!Sr({node:i,types:s})}}})]}}),sc=Ae.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Io(t,e),redo:()=>({state:t,dispatch:e})=>Ao(t,e)}},addProseMirrorPlugins(){return[Jl(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Xt=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...s}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,s,n]},rc=/^\s*>\s$/,oc=ve.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return Xt("blockquote",{...fe(this.options.HTMLAttributes,t),children:Xt("slot",{})})},parseMarkdown:(t,e)=>{var n;const s=(n=e.parseBlockChildren)!=null?n:e.parseChildren;return e.createNode("blockquote",void 0,s(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const n=">",s=[];return t.content.forEach((r,o)=>{var i,l;const m=((l=(i=e.renderChild)==null?void 0:i.call(e,r,o))!=null?l:e.renderChildren([r])).split(`
|
|
1
|
+
import{r as A,c as P,P as Aa,j as a,B as st,M as fr,J as La,R as Ea,b as Y,m as ee,q as Ma,aS as Ra,aP as Xe,aW as Pa,aV as Ge,bH as Mt,aT as lt,bI as Wr,aR as Kr,F as Fe,o as $a,e as Oa,K as Te,t as Jn,n as Rt,d as ht,E as Vr,aM as Gr,bJ as js,aU as Da,bK as Ze}from"./index-D5oNRj-6.js";import{e as Ha}from"./select-OlHxoBJz.js";import{u as qr}from"./useInfiniteQuery-D2RarQG6.js";import{a as Xr,u as za}from"./use-connection-CRV9qKeY.js";import{j as Ba,u as ws,b as Fa,i as Ua,a as Wa,S as Ka}from"./use-mcp-client-BiD2fCU0.js";import{u as Va}from"./use-virtual-mcp-rTU-PkMs.js";import{C as Ga}from"./card-BFt8D388.js";import{o as Yr,m as Qr,p as Ts,q as Ns}from"./sidebar-xm1vgluP.js";import{c as Jr,e as Zr,a as Cn,d as je,b as eo,T as we}from"./table-D_twSt1A.js";import{E as Zn}from"./empty-state-BQe89JAr.js";import{u as Cs}from"./use-infinite-scroll-BfSBcFKy.js";import{a as qa}from"./use-members-1sm2C2bs.js";import{u as to,S as dt}from"./use-clock-tick-CkqVwQ_W.js";import{e as Xa}from"./use-automations-DUwCWM9N.js";import{u as no}from"./studio-tools-DkN8b8B7.js";import{u as Ya}from"./useSuspenseInfiniteQuery-DFzk5M-u.js";import{A as so}from"./avatar-CR9iVdur.js";import{t as Vt}from"./ChevronDown-BhzSzO-F.js";import{n as es}from"./ChevronUp-B2lEsVKS.js";import{t as Qa,a as ro,n as _s}from"./Tool02-B_haJwud.js";import{g as Ja,aD as Za,aE as ei,a7 as ti,B as ni,aF as si,a9 as ri,ap as oi,m as ai,aG as ii,aB as oo,aH as li,A as ao,aI as $e,aJ as ci,q as ui}from"./agent-icon-C9M8Qgs2.js";import{t as _n}from"./Stars01-D7TqAQfA.js";import{i as io}from"./ArrowRight-eKd4fN-U.js";import{i as Is}from"./Check-CuStPfkH.js";import{i as mr}from"./ChevronRight-D-6a6xHj.js";import{a as lo}from"./Copy01-Ckds0BNV.js";import{b as qe,t as As,c as pr}from"./format-time-BnbuEtat.js";import{u as co}from"./use-copy-jN-dJpfw.js";import{T as rt,a as ot,b as at}from"./tooltip-DVgeIxlJ.js";import{M as Ls,I as uo,F as di}from"./file-type-icon-CUUaDbpn.js";import{R as fi,c as mi,r as pi,g as hi}from"./hooks-Dat9iskm.js";import{S as gi,h as gt,m as xi,c as Es,d as bi,b as yi}from"./chat-context-b7wY40dG.js";import{c as vi}from"./monaco-editor-BqkNRmLm.js";import{g as fo,M as ki}from"./index-DR8PhBak.js";import{f as Si,n as ji,o as wi}from"./tab-id-BijBBRwE.js";import{N as ve,R as Ti,k as Ni,a as Ne,l as Ci,F as hr,S as mo,T as tt,m as _i,n as Ms,D as _t,h as In,o as It,P as Ie,p as Ii,e as Ae,q as Ai,r as Li,s as Ei,v as po,w as ft,x as fe,y as xt,z as it,A as mt,B as ts,G as Mi,H as Ri,I as Pi,J as $i,K as Oi,L as Di,O as Hi,Q as ho,U as ns,V as zi,W as Bi,X as go,Y as Fi,Z as Ui,_ as gr,t as Wi,$ as Le,a0 as bt,c as Ki,u as Vi,M as Gi,d as qi}from"./calendar-DRUl8y7E.js";import{i as xo}from"./AlertCircle-XqqGV3Z6.js";import{s as Xi}from"./Eye-CVbV_raa.js";import{s as Gt,t as bo}from"./Star01-Bi9Snhbv.js";import{s as Yi}from"./XClose-DyOwi7PW.js";import{n as ss}from"./ZapSquare-D0caCqhB.js";import{n as yo,i as Qi}from"./Globe01-B29qVwMW.js";import{c as Ji,b as Zi}from"./Tool01-DfPAe4eV.js";import{i as xr,a as el}from"./ZoomOut-BccWsYWo.js";import{i as kt}from"./Monitor01-BbWyfKM-.js";import{i as tl}from"./SearchMd-DRA_fm-t.js";import{i as nl}from"./Upload01-Cy9naNzM.js";import{u as sl,a as rl}from"./shell-layout-573UShEI.js";import{a as $t}from"./Image01-CpzRhjw-.js";import{n as vo}from"./LinkExternal01-VPpYp_Nz.js";import{I as Ye}from"./integration-icon-B1EIcmc7.js";import{i as ol}from"./ArrowUpRight-DpLV-PnO.js";import{a as Rs}from"./Users03-CkwkDwFQ.js";import{a as Oe}from"./Palette-cb_H6dYq.js";import{c as ko}from"./use-navigate-to-agent-CTFgvUlq.js";import{a as Ot}from"./XCircle-CiX77iUK.js";import{a as al}from"./Stars02-Ds-FqbiT.js";import{g as il}from"./AreaChart-Cb5vezEb.js";import{b as ll,a as cl,c as ul,d as dl,e as fl}from"./dialog-u_k4pxo5.js";import{a as ml,F as pl,b as hl,c as gl,d as xl,f as bl}from"./form-DvGgcBNp.js";import{I as yl}from"./input-C_SNan5h.js";const vl={openrouter:t=>{const e=t?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function So(t){if(!t?.providerMetadata)return 0;for(const e of Object.values(vl)){const n=e(t.providerMetadata);if(n!==null)return n}return 0}function jo(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function wo(t,e){if(!e)return t;const n=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,s=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:t.inputTokens+(e.inputTokens??0),outputTokens:t.outputTokens+(e.outputTokens??0),reasoningTokens:t.reasoningTokens+(e.reasoningTokens??0),totalTokens:t.totalTokens+(e.totalTokens??0),cost:t.cost+So(e),cacheReadTokens:t.cacheReadTokens+n,cacheWriteTokens:t.cacheWriteTokens+s}}function Dp(t){return t.reduce((e,n)=>wo(e,n.metadata?.usage),jo())}const kl={damping:.7,stiffness:.05,mass:1.25},Sl=70,jl=1e3/60,wl=350;let An=!1;globalThis.document?.addEventListener("mousedown",()=>{An=!0});globalThis.document?.addEventListener("mouseup",()=>{An=!1});globalThis.document?.addEventListener("click",()=>{An=!1});const Tl=(t={})=>{const[e,n]=A.useState(!1),[s,r]=A.useState(t.initial!==!1),[o,i]=A.useState(!1),l=A.useRef(null);l.current=t;const c=A.useCallback(()=>{if(!An)return!1;const b=window.getSelection();if(!b||!b.rangeCount)return!1;const S=b.getRangeAt(0);return S.commonAncestorContainer.contains(g.current)||g.current?.contains(S.commonAncestorContainer)},[]),u=A.useCallback(b=>{d.isAtBottom=b,r(b)},[]),m=A.useCallback(b=>{d.escapedFromLock=b,n(b)},[]),d=A.useMemo(()=>{let b;return{escapedFromLock:e,isAtBottom:s,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(S){if(g.current){const{scrollBehavior:v}=getComputedStyle(g.current);v!=="auto"&&(g.current.style.scrollBehavior="auto"),g.current.scrollTop=S,d.ignoreScrollToTop=g.current.scrollTop,v!=="auto"&&(g.current.style.scrollBehavior=v)}},get targetScrollTop(){return!g.current||!y.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!y.current)return 0;const{targetScrollTop:S}=this;if(!t.targetScrollTop)return S;if(b?.targetScrollTop===S)return b.calculatedScrollTop;const v=Math.max(Math.min(t.targetScrollTop(S,{scrollElement:g.current,contentElement:y.current}),S),0);return b={targetScrollTop:S,calculatedScrollTop:v},requestAnimationFrame(()=>{b=void 0}),v},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Sl}}},[]),f=A.useCallback((b={})=>{typeof b=="string"&&(b={animation:b}),b.preserveScrollPosition||u(!0);const S=Date.now()+(Number(b.wait)||0),v=Hn(l.current,b.animation),{ignoreEscapes:T=!1}=b;let k,j=d.calculatedTargetScrollTop;b.duration instanceof Promise?b.duration.finally(()=>{k=Date.now()}):k=S+(b.duration??0);const w=async()=>{const N=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;const{scrollTop:C}=d,_=performance.now(),I=(_-(d.lastTick??_))/jl;if(d.animation||(d.animation={behavior:v,promise:N,ignoreEscapes:T}),d.animation.behavior===v&&(d.lastTick=_),c()||S>Date.now())return w();if(C<Math.min(j,d.calculatedTargetScrollTop)){if(d.animation?.behavior===v){if(v==="instant")return d.scrollTop=d.calculatedTargetScrollTop,w();d.velocity=(v.damping*d.velocity+v.stiffness*d.scrollDifference)/v.mass,d.accumulated+=d.velocity*I,d.scrollTop+=d.accumulated,d.scrollTop!==C&&(d.accumulated=0)}return w()}return k>Date.now()?(j=d.calculatedTargetScrollTop,w()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:Hn(l.current,l.current.resize),ignoreEscapes:T,duration:Math.max(0,k-Date.now())||void 0}):d.isAtBottom)});return N.then(C=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),C))};return b.wait!==!0&&(d.animation=void 0),d.animation?.behavior===v?d.animation.promise:w()},[u,c,d]),p=A.useCallback(()=>{m(!0),u(!1)},[m,u]),h=A.useCallback(({target:b})=>{if(b!==g.current)return;const{scrollTop:S,ignoreScrollToTop:v}=d;let{lastScrollTop:T=S}=d;d.lastScrollTop=S,d.ignoreScrollToTop=void 0,v&&v>S&&(T=v),i(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||S===v)return;if(c()){m(!0),u(!1);return}const k=S>T,j=S<T;if(d.animation?.ignoreEscapes){d.scrollTop=T;return}j&&(m(!0),u(!1)),k&&m(!1),!d.escapedFromLock&&d.isNearBottom&&u(!0)},1)},[m,u,c,d]),x=A.useCallback(({target:b,deltaY:S})=>{let v=b;for(;!["scroll","auto"].includes(getComputedStyle(v).overflow);){if(!v.parentElement)return;v=v.parentElement}v===g.current&&S<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(m(!0),u(!1))},[m,u,d]),g=br(b=>{g.current?.removeEventListener("scroll",h),g.current?.removeEventListener("wheel",x),b?.addEventListener("scroll",h,{passive:!0}),b?.addEventListener("wheel",x,{passive:!0})},[]),y=br(b=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!b)return;let S;d.resizeObserver=new ResizeObserver(([v])=>{const{height:T}=v.contentRect,k=T-(S??T);if(d.resizeDifference=k,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),i(d.isNearBottom),k>=0){const j=Hn(l.current,S?l.current.resize:l.current.initial);f({animation:j,wait:!0,preserveScrollPosition:!0,duration:j==="instant"?void 0:wl})}else d.isNearBottom&&(m(!1),u(!0));S=T,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===k&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(b)},[]);return{contentRef:y,scrollRef:g,scrollToBottom:f,stopScroll:p,isAtBottom:s||o,isNearBottom:o,escapedFromLock:e,state:d}};function br(t,e){const n=A.useCallback(s=>(n.current=s,t(s)),e);return n}const Dn=new Map;function Hn(...t){const e={...kl};let n=!1;for(const r of t){if(r==="instant"){n=!0;continue}typeof r=="object"&&(n=!1,e.damping=r.damping??e.damping,e.stiffness=r.stiffness??e.stiffness,e.mass=r.mass??e.mass)}const s=JSON.stringify(e);return Dn.has(s)||Dn.set(s,Object.freeze(e)),n?"instant":Dn.get(s)}function Nl(t){let e=2166136261;for(let n=0;n<t.length;n++)e=Math.imul(e^t.charCodeAt(n),16777619);return`a${(e>>>0).toString(36).padStart(6,"0").slice(-6)}`}function Ps(t){if(t&&typeof t=="object"&&"gatewayClientId"in t&&typeof t.gatewayClientId=="string")return t.gatewayClientId}function $s(t,e){if(!e)return t;const n=`${Nl(e)}_`;return t.startsWith(n)?t.slice(n.length):t}function Cl(t,e){return $s(t,e).replace(/[_-]/g," ").toLowerCase()}function _l(t){const e={};for(const n of t?.arguments??[])e[n.name]=n.required?fr().min(1,"Required"):fr();return La(e)}function Il(t,e){const n={};for(const s of t.arguments??[])n[s.name]=e?.[s.name]??"";return n}function Al(t){const e=P.c(67),{prompt:n,setPrompt:s,onSubmit:r,defaultValues:o}=t,i=A.useId();let l,c;if(e[0]!==n){const O=_l(n);c=Ea,l=Aa(O),e[0]=n,e[1]=l,e[2]=c}else l=e[1],c=e[2];let u;e[3]!==o||e[4]!==n?(u=n?Il(n,o):{},e[3]=o,e[4]=n,e[5]=u):u=e[5];let m;e[6]!==l||e[7]!==u?(m={resolver:l,defaultValues:u,mode:"onChange"},e[6]=l,e[7]=u,e[8]=m):m=e[8];const d=c(m);let f;e[9]!==n?.arguments?(f=n?.arguments??[],e[9]=n?.arguments,e[10]=f):f=e[10];const p=f;let h;e[11]!==d||e[12]!==r||e[13]!==s?(h=async O=>{await r(O),s(null),d.reset()},e[11]=d,e[12]=r,e[13]=s,e[14]=h):h=e[14];const x=h;let g;e[15]!==d||e[16]!==s?(g=O=>{O||(d.reset(),s(null))},e[15]=d,e[16]=s,e[17]=g):g=e[17];const y=g;if(!n)return null;let b;e[18]!==n._meta||e[19]!==n.name||e[20]!==n.title?(b=n.title||Cl(n.name,Ps(n._meta)),e[18]=n._meta,e[19]=n.name,e[20]=n.title,e[21]=b):b=e[21];let S;e[22]!==b?(S=a.jsx(ll,{children:a.jsx("span",{className:"capitalize",children:b})}),e[22]=b,e[23]=S):S=e[23];let v;e[24]!==n.description?(v=n.description&&a.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[24]=n.description,e[25]=v):v=e[25];let T;e[26]!==v||e[27]!==S?(T=a.jsxs(cl,{children:[S,v]}),e[26]=v,e[27]=S,e[28]=T):T=e[28];let k;e[29]!==d||e[30]!==x?(k=O=>{O.stopPropagation(),d.handleSubmit(x)(O)},e[29]=d,e[30]=x,e[31]=k):k=e[31];let j;if(e[32]!==p||e[33]!==d.control||e[34]!==d.formState.isSubmitting){let O;e[36]!==d.control||e[37]!==d.formState.isSubmitting?(O=H=>a.jsx(pl,{control:d.control,name:H.name,render:z=>{const{field:D}=z;return a.jsxs(hl,{children:[a.jsxs(gl,{className:"text-xs",children:[H.name,H.required?null:a.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),a.jsx(xl,{children:a.jsx(yl,{...D,value:D.value??"",required:H.required,placeholder:H.description??"",className:"h-9",disabled:d.formState.isSubmitting})}),a.jsx(bl,{})]})}},H.name),e[36]=d.control,e[37]=d.formState.isSubmitting,e[38]=O):O=e[38],j=p.map(O),e[32]=p,e[33]=d.control,e[34]=d.formState.isSubmitting,e[35]=j}else j=e[35];let w;e[39]!==y?(w=()=>y(!1),e[39]=y,e[40]=w):w=e[40];let N;e[41]!==d.formState.isSubmitting||e[42]!==w?(N=a.jsx(st,{type:"button",variant:"ghost",onClick:w,disabled:d.formState.isSubmitting,children:"Cancel"}),e[41]=d.formState.isSubmitting,e[42]=w,e[43]=N):N=e[43];let C;e[44]!==d.formState.isSubmitting?(C=d.formState.isSubmitting?a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(gi,{size:"xs"}),"Loading..."]}):"Use prompt",e[44]=d.formState.isSubmitting,e[45]=C):C=e[45];let _;e[46]!==d.formState.isSubmitting||e[47]!==i||e[48]!==C?(_=a.jsx(st,{type:"submit",form:i,disabled:d.formState.isSubmitting,children:C}),e[46]=d.formState.isSubmitting,e[47]=i,e[48]=C,e[49]=_):_=e[49];let I;e[50]!==N||e[51]!==_?(I=a.jsxs(ul,{children:[N,_]}),e[50]=N,e[51]=_,e[52]=I):I=e[52];let E;e[53]!==i||e[54]!==k||e[55]!==j||e[56]!==I?(E=a.jsxs("form",{id:i,className:"space-y-4 py-4",autoComplete:"off",onSubmit:k,children:[j,I]}),e[53]=i,e[54]=k,e[55]=j,e[56]=I,e[57]=E):E=e[57];let M;e[58]!==d||e[59]!==E?(M=a.jsx(ml,{...d,children:E}),e[58]=d,e[59]=E,e[60]=M):M=e[60];let L;e[61]!==T||e[62]!==M?(L=a.jsxs(dl,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[T,M]}),e[61]=T,e[62]=M,e[63]=L):L=e[63];let R;return e[64]!==y||e[65]!==L?(R=a.jsx(fl,{open:!0,onOpenChange:y,children:L}),e[64]=y,e[65]=L,e[66]=R):R=e[66],R}const Ll=/^mcp__[a-zA-Z0-9_-]+__/;function To(t){return t.replace(Ll,"")}function Ln(t){const e=P.c(19),{id:n,part:s,copyable:r,extraActions:o,alwaysShowActions:i,animate:l}=t,c=r===void 0?!1:r,u=i===void 0?!1:i,m=l===void 0?!1:l,{handleCopy:d}=co(),f=Y(),[p,h]=A.useState(!1);let x;e[0]!==d||e[1]!==n||e[2]!==s.text?(x=async()=>{Ma("chat_message_copied",{message_id:n,chars:s.text.length}),await d(s.text),h(!0),setTimeout(()=>h(!1),2e3)},e[0]=d,e[1]=n,e[2]=s.text,e[3]=x):x=e[3];const g=x,y=c&&o,b=y||o;let S;e[4]!==m||e[5]!==n||e[6]!==s.text?(S=a.jsx(Ls,{id:n,text:s.text,animate:m}),e[4]=m,e[5]=n,e[6]=s.text,e[7]=S):S=e[7];let v;e[8]!==u||e[9]!==o||e[10]!==g||e[11]!==p||e[12]!==b||e[13]!==y||e[14]!==f?(v=b&&a.jsxs("div",{className:ee("flex w-full items-center gap-2 text-sm text-muted-foreground transition-all duration-200 mt-1 py-1",u?"opacity-100":"opacity-0 pointer-events-none group-hover/part:opacity-100 group-hover/part:pointer-events-auto"),children:[o,y&&o&&a.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),y&&a.jsx("button",{type:"button",onClick:g,className:"text-muted-foreground [@media(hover:hover)]:hover:text-foreground transition-colors active:scale-[0.97]","aria-label":f("chat.textPart.copyMessage"),children:p?a.jsx(Is,{className:"size-4"}):a.jsx(lo,{className:"size-4"})})]}),e[8]=u,e[9]=o,e[10]=g,e[11]=p,e[12]=b,e[13]=y,e[14]=f,e[15]=v):v=e[15];let T;return e[16]!==S||e[17]!==v?(T=a.jsxs("div",{className:"group/part relative",children:[S,v]}),e[16]=S,e[17]=v,e[18]=T):T=e[18],T}function Hp(t,e,n){t.chain().focus().insertContentAt(e,[El(n),{type:"text",text:" "}]).run()}function El(t){return{type:"file",attrs:t}}function Ml(t){const e=P.c(17),{node:n,selected:s,view:r}=t,{name:o,mimeType:i,data:l}=n.attrs,c=s&&r.editable;let u;e[0]!==i?(u=i.startsWith("image/"),e[0]=i,e[1]=u):u=e[1];const m=u,d=c&&"outline-2 outline-blue-300 outline-offset-0";let f;e[2]!==d?(f=ee("px-1 py-1 rounded","inline-flex items-center gap-1","cursor-default select-none","text-xs font-light","bg-muted text-muted-foreground",d),e[2]=d,e[3]=f):f=e[3];let p;e[4]!==o?(p=a.jsx(rt,{asChild:!0,children:a.jsx("span",{children:o})}),e[4]=o,e[5]=p):p=e[5];let h;e[6]!==l||e[7]!==m||e[8]!==i||e[9]!==o?(h=a.jsx(ot,{side:"top",className:"max-w-sm p-1.5",children:m?a.jsx("img",{src:`data:${i};base64,${l}`,alt:o,className:"max-w-full max-h-64 object-contain rounded"}):a.jsxs("div",{className:"text-xs",children:[a.jsx("div",{className:"font-medium",children:o}),a.jsx("div",{className:"text-muted-foreground mt-1",children:i})]})}),e[6]=l,e[7]=m,e[8]=i,e[9]=o,e[10]=h):h=e[10];let x;e[11]!==p||e[12]!==h?(x=a.jsxs(at,{children:[p,h]}),e[11]=p,e[12]=h,e[13]=x):x=e[13];let g;return e[14]!==f||e[15]!==x?(g=a.jsx(Ni,{className:f,children:x}),e[14]=f,e[15]=x,e[16]=g):g=e[16],g}const Rl=ve.create({name:"file",group:"inline",inline:!0,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id")||null,renderHTML:t=>t.id?{"data-id":t.id}:{}},name:{default:null,parseHTML:t=>t.getAttribute("data-name")||null,renderHTML:t=>t.name?{"data-name":t.name}:{}},mimeType:{default:null,parseHTML:t=>t.getAttribute("data-mime-type")||null,renderHTML:t=>t.mimeType?{"data-mime-type":t.mimeType}:{}},size:{default:0,parseHTML:t=>{const e=t.getAttribute("data-size");return e?Number.parseInt(e,10):0},renderHTML:t=>t.size?{"data-size":String(t.size)}:{}},data:{default:null,parseHTML:t=>t.getAttribute("data-data")||null,renderHTML:t=>t.data?{"data-data":t.data}:{}}}},parseHTML(){return[{tag:'span[data-type="file"]'}]},renderHTML({node:t,HTMLAttributes:e}){const n={"data-type":"file"};return t.attrs.id&&(n["data-id"]=t.attrs.id),t.attrs.name&&(n["data-name"]=t.attrs.name),t.attrs.mimeType&&(n["data-mime-type"]=t.attrs.mimeType),t.attrs.size&&(n["data-size"]=String(t.attrs.size)),t.attrs.data&&(n["data-data"]=t.attrs.data),["span",{...e,...n}]},renderText({node:t}){return`[${t.attrs.name??""}]`},addNodeView(){return Ti(Ml)}});function Pl(t={}){return new Ne({view(e){return new $l(e,t)}})}class $l{constructor(e,n){var s;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(s=n.width)!==null&&s!==void 0?s:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let o=i=>{this[r](i)};return e.dom.addEventListener(r,o),{name:r,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,s,r=this.editorView.dom,o=r.getBoundingClientRect(),i=o.width/r.offsetWidth,l=o.height/r.offsetHeight;if(n){let d=e.nodeBefore,f=e.nodeAfter;if(d||f){let p=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(p){let h=p.getBoundingClientRect(),x=d?h.bottom:h.top;d&&f&&(x=(x+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*l;s={left:h.left,right:h.right,top:x-g,bottom:x+g}}}}if(!s){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*i;s={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let c=this.editorView.dom.offsetParent;this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let u,m;if(!c||c==document.body&&getComputedStyle(c).position=="static")u=-pageXOffset,m=-pageYOffset;else{let d=c.getBoundingClientRect(),f=d.width/c.offsetWidth,p=d.height/c.offsetHeight;u=d.left-c.scrollLeft*f,m=d.top-c.scrollTop*p}this.element.style.left=(s.left-u)/i+"px",this.element.style.top=(s.top-m)/l+"px",this.element.style.width=(s.right-s.left)/i+"px",this.element.style.height=(s.bottom-s.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),s=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),r=s&&s.type.spec.disableDropCursor,o=typeof r=="function"?r(this.editorView,n,e):r;if(n&&!o){let i=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Ci(this.editorView.state.doc,i,this.editorView.dragging.slice);l!=null&&(i=l)}this.setCursor(i),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class le extends It{constructor(e){super(e,e)}map(e,n){let s=e.resolve(n.map(this.head));return le.valid(s)?new le(s):It.near(s)}content(){return mo.empty}eq(e){return e instanceof le&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new le(e.resolve(n.pos))}getBookmark(){return new Os(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!Ol(e)||!Dl(e))return!1;let s=n.type.spec.allowGapCursor;if(s!=null)return s;let r=n.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,n,s=!1){e:for(;;){if(!s&&le.valid(e))return e;let r=e.pos,o=null;for(let i=e.depth;;i--){let l=e.node(i);if(n>0?e.indexAfter(i)<l.childCount:e.index(i)>0){o=l.child(n>0?e.indexAfter(i):e.index(i)-1);break}else if(i==0)return null;r+=n;let c=e.doc.resolve(r);if(le.valid(c))return c}for(;;){let i=n>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!Ms.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*n),s=!1;continue e}break}o=i,r+=n;let l=e.doc.resolve(r);if(le.valid(l))return l}return null}}}le.prototype.visible=!1;le.findFrom=le.findGapCursorFrom;It.jsonID("gapcursor",le);class Os{constructor(e){this.pos=e}map(e){return new Os(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return le.valid(n)?new le(n):It.near(n)}}function No(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function Ol(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),s=t.node(e);if(n==0){if(s.type.spec.isolating)return!0;continue}for(let r=s.child(n-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||No(r.type))return!0;if(r.inlineContent)return!1}}return!0}function Dl(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),s=t.node(e);if(n==s.childCount){if(s.type.spec.isolating)return!0;continue}for(let r=s.child(n);;r=r.firstChild){if(r.childCount==0&&!r.inlineContent||No(r.type))return!0;if(r.inlineContent)return!1}}return!0}function Hl(){return new Ne({props:{decorations:Ul,createSelectionBetween(t,e,n){return e.pos==n.pos&&le.valid(n)?new le(n):null},handleClick:Bl,handleKeyDown:zl,handleDOMEvents:{beforeinput:Fl}}})}const zl=_i({ArrowLeft:Dt("horiz",-1),ArrowRight:Dt("horiz",1),ArrowUp:Dt("vert",-1),ArrowDown:Dt("vert",1)});function Dt(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(s,r,o){let i=s.selection,l=e>0?i.$to:i.$from,c=i.empty;if(i instanceof tt){if(!o.endOfTextblock(n)||l.depth==0)return!1;c=!1,l=s.doc.resolve(e>0?l.after():l.before())}let u=le.findGapCursorFrom(l,e,c);return u?(r&&r(s.tr.setSelection(new le(u))),!0):!1}}function Bl(t,e,n){if(!t||!t.editable)return!1;let s=t.state.doc.resolve(e);if(!le.valid(s))return!1;let r=t.posAtCoords({left:n.clientX,top:n.clientY});return r&&r.inside>-1&&Ms.isSelectable(t.state.doc.nodeAt(r.inside))?!1:(t.dispatch(t.state.tr.setSelection(new le(s))),!0)}function Fl(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof le))return!1;let{$from:n}=t.state.selection,s=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!s)return!1;let r=hr.empty;for(let i=s.length-1;i>=0;i--)r=hr.from(s[i].createAndFill(null,r));let o=t.state.tr.replace(n.pos,n.pos,new mo(r,0,0));return o.setSelection(tt.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function Ul(t){if(!(t.selection instanceof le))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",_t.create(t.doc,[In.widget(t.selection.head,e,{key:"gapcursor"})])}var qt=200,pe=function(){};pe.prototype.append=function(e){return e.length?(e=pe.from(e),!this.length&&e||e.length<qt&&this.leafAppend(e)||this.length<qt&&e.leafPrepend(this)||this.appendInner(e)):this};pe.prototype.prepend=function(e){return e.length?pe.from(e).append(this):this};pe.prototype.appendInner=function(e){return new Wl(this,e)};pe.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?pe.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};pe.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};pe.prototype.forEach=function(e,n,s){n===void 0&&(n=0),s===void 0&&(s=this.length),n<=s?this.forEachInner(e,n,s,0):this.forEachInvertedInner(e,n,s,0)};pe.prototype.map=function(e,n,s){n===void 0&&(n=0),s===void 0&&(s=this.length);var r=[];return this.forEach(function(o,i){return r.push(e(o,i))},n,s),r};pe.from=function(e){return e instanceof pe?e:e&&e.length?new Co(e):pe.empty};var Co=(function(t){function e(s){t.call(this),this.values=s}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,o){return r==0&&o==this.length?this:new e(this.values.slice(r,o))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,o,i,l){for(var c=o;c<i;c++)if(r(this.values[c],l+c)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,i,l){for(var c=o-1;c>=i;c--)if(r(this.values[c],l+c)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=qt)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=qt)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(pe);pe.empty=new Co([]);var Wl=(function(t){function e(n,s){t.call(this),this.left=n,this.right=s,this.length=n.length+s.length,this.depth=Math.max(n.depth,s.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(s){return s<this.left.length?this.left.get(s):this.right.get(s-this.left.length)},e.prototype.forEachInner=function(s,r,o,i){var l=this.left.length;if(r<l&&this.left.forEachInner(s,r,Math.min(o,l),i)===!1||o>l&&this.right.forEachInner(s,Math.max(r-l,0),Math.min(this.length,o)-l,i+l)===!1)return!1},e.prototype.forEachInvertedInner=function(s,r,o,i){var l=this.left.length;if(r>l&&this.right.forEachInvertedInner(s,r-l,Math.max(o,l)-l,i+l)===!1||o<l&&this.left.forEachInvertedInner(s,Math.min(r,l),o,i)===!1)return!1},e.prototype.sliceInner=function(s,r){if(s==0&&r==this.length)return this;var o=this.left.length;return r<=o?this.left.slice(s,r):s>=o?this.right.slice(s-o,r-o):this.left.slice(s,o).append(this.right.slice(0,r-o))},e.prototype.leafAppend=function(s){var r=this.right.leafAppend(s);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(s){var r=this.left.leafPrepend(s);if(r)return new e(r,this.right)},e.prototype.appendInner=function(s){return this.left.depth>=Math.max(this.right.depth,s.depth)+1?new e(this.left,new e(this.right,s)):new e(this,s)},e})(pe);const Kl=500;class _e{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}let r,o;n&&(r=this.remapping(s,this.items.length),o=r.maps.length);let i=e.tr,l,c,u=[],m=[];return this.items.forEach((d,f)=>{if(!d.step){r||(r=this.remapping(s,f+1),o=r.maps.length),o--,m.push(d);return}if(r){m.push(new Me(d.map));let p=d.step.map(r.slice(o)),h;p&&i.maybeStep(p).doc&&(h=i.mapping.maps[i.mapping.maps.length-1],u.push(new Me(h,void 0,void 0,u.length+m.length))),o--,h&&r.appendMap(h,o)}else i.maybeStep(d.step);if(d.selection)return l=r?d.selection.map(r.slice(o)):d.selection,c=new _e(this.items.slice(0,s).append(m.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:i,selection:l}}addTransform(e,n,s,r){let o=[],i=this.eventCount,l=this.items,c=!r&&l.length?l.get(l.length-1):null;for(let m=0;m<e.steps.length;m++){let d=e.steps[m].invert(e.docs[m]),f=new Me(e.mapping.maps[m],d,n),p;(p=c&&c.merge(f))&&(f=p,m?o.pop():l=l.slice(0,l.length-1)),o.push(f),n&&(i++,n=void 0),r||(c=f)}let u=i-s.depth;return u>Gl&&(l=Vl(l,u),i-=u),new _e(l.append(o),i)}remapping(e,n){let s=new Ii;return this.items.forEach((r,o)=>{let i=r.mirrorOffset!=null&&o-r.mirrorOffset>=e?s.maps.length-r.mirrorOffset:void 0;s.appendMap(r.map,i)},e,n),s}addMaps(e){return this.eventCount==0?this:new _e(this.items.append(e.map(n=>new Me(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let s=[],r=Math.max(0,this.items.length-n),o=e.mapping,i=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},r);let c=n;this.items.forEach(f=>{let p=o.getMirror(--c);if(p==null)return;i=Math.min(i,p);let h=o.maps[p];if(f.step){let x=e.steps[p].invert(e.docs[p]),g=f.selection&&f.selection.map(o.slice(c+1,p));g&&l++,s.push(new Me(h,x,g))}else s.push(new Me(h))},r);let u=[];for(let f=n;f<i;f++)u.push(new Me(o.maps[f]));let m=this.items.slice(0,r).append(u).append(s),d=new _e(m,l);return d.emptyItemCount()>Kl&&(d=d.compress(this.items.length-s.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),s=n.maps.length,r=[],o=0;return this.items.forEach((i,l)=>{if(l>=e)r.push(i),i.selection&&o++;else if(i.step){let c=i.step.map(n.slice(s)),u=c&&c.getMap();if(s--,u&&n.appendMap(u,s),c){let m=i.selection&&i.selection.map(n.slice(s));m&&o++;let d=new Me(u.invert(),c,m),f,p=r.length-1;(f=r.length&&r[p].merge(d))?r[p]=f:r.push(d)}}else i.map&&s--},this.items.length,0),new _e(pe.from(r.reverse()),o)}}_e.empty=new _e(pe.empty,0);function Vl(t,e){let n;return t.forEach((s,r)=>{if(s.selection&&e--==0)return n=r,!1}),t.slice(n)}class Me{constructor(e,n,s,r){this.map=e,this.step=n,this.selection=s,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Me(n.getMap().invert(),n,this.selection)}}}class We{constructor(e,n,s,r,o){this.done=e,this.undone=n,this.prevRanges=s,this.prevTime=r,this.prevComposition=o}}const Gl=20;function ql(t,e,n,s){let r=n.getMeta(nt),o;if(r)return r.historyState;n.getMeta(Ql)&&(t=new We(t.done,t.undone,null,0,-1));let i=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(i&&i.getMeta(nt))return i.getMeta(nt).redo?new We(t.done.addTransform(n,void 0,s,Wt(e)),t.undone,yr(n.mapping.maps),t.prevTime,t.prevComposition):new We(t.done,t.undone.addTransform(n,void 0,s,Wt(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(i&&i.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),c=t.prevTime==0||!i&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-s.newGroupDelay||!Xl(n,t.prevRanges)),u=i?zn(t.prevRanges,n.mapping):yr(n.mapping.maps);return new We(t.done.addTransform(n,c?e.selection.getBookmark():void 0,s,Wt(e)),_e.empty,u,n.time,l??t.prevComposition)}else return(o=n.getMeta("rebased"))?new We(t.done.rebased(n,o),t.undone.rebased(n,o),zn(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new We(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),zn(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function Xl(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((s,r)=>{for(let o=0;o<e.length;o+=2)s<=e[o+1]&&r>=e[o]&&(n=!0)}),n}function yr(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((s,r,o,i)=>e.push(o,i));return e}function zn(t,e){if(!t)return null;let n=[];for(let s=0;s<t.length;s+=2){let r=e.map(t[s],1),o=e.map(t[s+1],-1);r<=o&&n.push(r,o)}return n}function Yl(t,e,n){let s=Wt(e),r=nt.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,s);if(!o)return null;let i=o.selection.resolve(o.transform.doc),l=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),r,s),c=new We(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(i).setMeta(nt,{redo:n,historyState:c})}let Bn=!1,vr=null;function Wt(t){let e=t.plugins;if(vr!=e){Bn=!1,vr=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Bn=!0;break}}return Bn}const nt=new Ie("history"),Ql=new Ie("closeHistory");function Jl(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ne({key:nt,state:{init(){return new We(_e.empty,_e.empty,null,0,-1)},apply(e,n,s){return ql(n,s,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let s=n.inputType,r=s=="historyUndo"?Io:s=="historyRedo"?Ao:null;return!r||!e.editable?!1:(n.preventDefault(),r(e.state,e.dispatch))}}}})}function _o(t,e){return(n,s)=>{let r=nt.getState(n);if(!r||(t?r.undone:r.done).eventCount==0)return!1;if(s){let o=Yl(r,n,t);o&&s(e?o.scrollIntoView():o)}return!0}}const Io=_o(!1,!0),Ao=_o(!0,!0);Ae.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=t?.node||this.editor.state.doc;if((t?.mode||this.options.mode)==="textSize"){const s=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(s)}return e.nodeSize},this.storage.words=t=>{const e=t?.node||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new Ne({key:new Ie("characterCount"),appendTransaction:(e,n,s)=>{if(t)return;const r=this.options.limit;if(r==null||r===0){t=!0;return}const o=this.storage.characters({node:s.doc});if(o>r){const i=o-r,l=0,c=i;console.warn(`[CharacterCount] Initial content exceeded limit of ${r} characters. Content was automatically trimmed.`);const u=s.tr.deleteRange(l,c);return t=!0,u}t=!0},filterTransaction:(e,n)=>{const s=this.options.limit;if(!e.docChanged||s===0||s===null||s===void 0)return!0;const r=this.storage.characters({node:n.doc}),o=this.storage.characters({node:e.doc});if(o<=s||r>s&&o>s&&o<=r)return!0;if(r>s&&o>s&&o>r||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,c=o-s,u=l-c,m=l;return e.deleteRange(u,m),!(this.storage.characters({node:e.doc})>s)}})]}});var Zl=Ae.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Pl(this.options)]}});Ae.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Ne({key:new Ie("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:s}=this.editor,{anchor:r}=e,o=[];if(!n||!s)return _t.create(t,[]);let i=0;this.options.mode==="deepest"&&t.descendants((c,u)=>{if(c.isText)return;if(!(r>=u&&r<=u+c.nodeSize-1))return!1;i+=1});let l=0;return t.descendants((c,u)=>{if(c.isText||!(r>=u&&r<=u+c.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&i-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";o.push(In.node(u,u+c.nodeSize,{class:this.options.className}))}),_t.create(t,o)}}})]}});var ec=Ae.create({name:"gapCursor",addProseMirrorPlugins(){return[Hl()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Li(Ei(t,"allowGapCursor",n)))!=null?e:null}}}),kr="placeholder";function tc(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var zp=Ae.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:kr,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const t=this.options.dataAttribute?`data-${tc(this.options.dataAttribute)}`:`data-${kr}`;return[new Ne({key:new Ie("placeholder"),props:{decorations:({doc:e,selection:n})=>{const s=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=n,o=[];if(!s)return null;const i=this.editor.isEmpty;return e.descendants((l,c)=>{const u=r>=c&&r<=c+l.nodeSize,m=!l.isLeaf&&Ai(l);if((u||!this.options.showOnlyCurrent)&&m){const d=[this.options.emptyNodeClass];i&&d.push(this.options.emptyEditorClass);const f=In.node(c,c+l.nodeSize,{class:d.join(" "),[t]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:l,pos:c,hasAnchor:u}):this.options.placeholder});o.push(f)}return this.options.includeChildren}),_t.create(e,o)}}})]}});Ae.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new Ne({key:new Ie("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||po(n.selection)||t.view.dragging?null:_t.create(n.doc,[In.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function Sr({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||e?.type===t}var nc=Ae.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Ie(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",s=Object.entries(this.editor.schema.nodes).map(([,r])=>r).filter(r=>(this.options.notAfter||[]).concat(n).includes(r.name));return[new Ne({key:e,appendTransaction:(r,o,i)=>{const{doc:l,tr:c,schema:u}=i,m=e.getState(i),d=l.content.size,f=u.nodes[n];if(m)return c.insert(d,f.create())},state:{init:(r,o)=>{const i=o.tr.doc.lastChild;return!Sr({node:i,types:s})},apply:(r,o)=>{if(!r.docChanged||r.getMeta("__uniqueIDTransaction"))return o;const i=r.doc.lastChild;return!Sr({node:i,types:s})}}})]}}),sc=Ae.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Io(t,e),redo:()=>({state:t,dispatch:e})=>Ao(t,e)}},addProseMirrorPlugins(){return[Jl(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Xt=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...s}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,s,n]},rc=/^\s*>\s$/,oc=ve.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return Xt("blockquote",{...fe(this.options.HTMLAttributes,t),children:Xt("slot",{})})},parseMarkdown:(t,e)=>{var n;const s=(n=e.parseBlockChildren)!=null?n:e.parseChildren;return e.createNode("blockquote",void 0,s(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const n=">",s=[];return t.content.forEach((r,o)=>{var i,l;const m=((l=(i=e.renderChild)==null?void 0:i.call(e,r,o))!=null?l:e.renderChildren([r])).split(`
|
|
2
2
|
`).map(d=>d.trim()===""?n:`${n} ${d}`);s.push(m.join(`
|
|
3
3
|
`))}),s.join(`
|
|
4
4
|
${n}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as B,j as o,b as q,F as D,d as M,r as $,B as F,q as R}from"./index-D5oNRj-6.js";import{s as V}from"./Plus-D3J2ZkJj.js";import{i as S}from"./Zap-D-ISyZlf.js";import{S as G}from"./search-input-DnkWW-Gd.js";import{P as d}from"./index-CteIQMB0.js";import{E as T}from"./empty-state-BQe89JAr.js";import{c as H}from"./use-automations-DUwCWM9N.js";import{c as J}from"./use-navigate-to-agent-CTFgvUlq.js";import{A as K}from"./automation-list-row-Bxe1UuJn.js";import{q as O}from"./use-mcp-client-BiD2fCU0.js";import{u as Q}from"./use-virtual-mcp-rTU-PkMs.js";import{R as U}from"./require-capability-BM6Hy4og.js";import"./SearchMd-DRA_fm-t.js";import"./sidebar-xm1vgluP.js";import"./LayoutLeft-D3pEEPrL.js";import"./use-mobile-CWHotxPh.js";import"./X-CbgRopSM.js";import"./tooltip-DVgeIxlJ.js";import"./studio-tools-DkN8b8B7.js";import"./hooks-Dat9iskm.js";import"./decopilot-sse-pool-BQUdJLw8.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-DabruZmQ.js";import"./dropdown-menu-ClB-SnGU.js";import"./Check-CuStPfkH.js";import"./ChevronRight-D-6a6xHj.js";import"./DotsVertical-BBjpcaJY.js";import"./Stars02-Ds-FqbiT.js";import"./Trash01-DE0_omFY.js";import"./agent-icon-C9M8Qgs2.js";import"./AlertCircle-XqqGV3Z6.js";import"./Tool01-DfPAe4eV.js";import"./ArrowUp-CwqP3NfG.js";import"./Settings02-DUAOVJ9V.js";import"./Tool02-B_haJwud.js";import"./ArrowRight-eKd4fN-U.js";import"./ArrowUpRight-DpLV-PnO.js";import"./TrendUp01-B5MySlCF.js";import"./ZapSquare-D0caCqhB.js";import"./ZoomOut-BccWsYWo.js";import"./Users03-CkwkDwFQ.js";import"./CheckCircle-CELt-Ff1.js";import"./ChevronDown-BhzSzO-F.js";import"./ChevronUp-B2lEsVKS.js";import"./Copy01-Ckds0BNV.js";import"./Globe01-B29qVwMW.js";import"./Eye-CVbV_raa.js";import"./FilterLines-Bm-n53eP.js";import"./Star01-Bi9Snhbv.js";import"./Globe04-C5fQerBK.js";import"./SwitchHorizontal01-DWJ1XbLE.js";import"./HardDrive-BeV2wHr7.js";import"./Image01-CpzRhjw-.js";import"./Key01-Br-NL4v6.js";import"./XCircle-CiX77iUK.js";import"./LinkExternal01-VPpYp_Nz.js";import"./Monitor01-BbWyfKM-.js";import"./Sun-1owZLJ_o.js";import"./Package-giUmCQTv.js";import"./Palette-cb_H6dYq.js";import"./Play-BSxzVROp.js";import"./SearchLg-Bji00daO.js";import"./Shield01-H9zDGPeG.js";import"./Stars01-D7TqAQfA.js";import"./Upload01-Cy9naNzM.js";import"./User01-5RIq4_Iv.js";import"./Users01-Vq-rydwi.js";import"./XClose-DyOwi7PW.js";import"./auth-B8BgG_-A.js";import"./use-capability-DstzlECw.js";import"./access-gate-vNRBQIRg.js";import"./capability-load-error-C-aOXmL5.js";function W(){const t=B.c(20),e=q(),{org:c}=D(),{data:C}=H(void 0),g=C===void 0?[]:C,k=Q(),P=J(),f=M(),[x,E]=$.useState(""),h=x.toLowerCase(),A=new Map(k.map(X)),b=g.filter(i=>{if(!h||i.name.toLowerCase().includes(h))return!0;if(i.virtual_mcp_id){const p=A.get(i.virtual_mcp_id);if(p&&p.title.toLowerCase().includes(h))return!0}return!1}),z=(i,p)=>{const N=p&&A.has(p)?p:O(c.id);R("automations_list_row_clicked",{automation_id:i,agent_id:N,source:"settings_automations"}),P(N,{search:{main:"automation:"+i}})};let l;t[0]!==f||t[1]!==c.slug?(l=()=>{R("automations_empty_state_browse_agents_clicked"),f({to:"/$org/settings/agents",params:{org:c.slug}})},t[0]=f,t[1]=c.slug,t[2]=l):l=t[2];const L=l,j=d,v=d,w=d;let s;t[3]!==e?(s=e("settings.automations.pageTitle"),t[3]=e,t[4]=s):s=t[4];let r;t[5]!==s?(r=o.jsx(d.Title,{children:s}),t[5]=s,t[6]=r):r=t[6];const _=g.length>0&&o.jsx(G,{value:x,onChange:E,placeholder:e("settings.automations.searchPlaceholder"),className:"w-full md:w-[375px]"});let m;t[7]!==r||t[8]!==_?(m=o.jsxs("div",{className:"flex flex-col gap-6",children:[r,_]}),t[7]=r,t[8]=_,t[9]=m):m=t[9];const y=g.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.emptyTitle"),description:e("settings.automations.emptyDescription"),actions:o.jsxs(F,{size:"sm",onClick:L,children:[o.jsx(V,{size:14}),e("settings.automations.browseAgentsButton")]})})}):b.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.noResultsTitle"),description:e("settings.automations.noResultsDescription",{search:x})})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:b.map(i=>o.jsx(K,{automation:i,showAgent:!0,onClick:()=>z(i.id,i.virtual_mcp_id)},i.id))});let n;t[10]!==w.Body||t[11]!==m||t[12]!==y?(n=o.jsxs(w.Body,{children:[m,y]}),t[10]=w.Body,t[11]=m,t[12]=y,t[13]=n):n=t[13];let a;t[14]!==v.Content||t[15]!==n?(a=o.jsx(v.Content,{children:n}),t[14]=v.Content,t[15]=n,t[16]=a):a=t[16];let u;return t[17]!==j||t[18]!==a?(u=o.jsx(j,{children:a}),t[17]=j,t[18]=a,t[19]=u):u=t[19],u}function X(t){return[t.id,t]}function jo(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(U,{capability:"automations:manage",area:"automations",children:o.jsx(W,{})}),t[0]=e):e=t[0],e}export{jo as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as a}from"./index-
|
|
1
|
+
import{G as a}from"./index-D5oNRj-6.js";const i=1e4,m="true";function s(e,t){return a.chatAutosend(e,t)}function d(e){return e==="pending"||e==="sending"}function c(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}return!t||typeof t!="object"||typeof t.createdAt!="number"||typeof t.message!="object"||!d(t.status)?null:t}function A(e,t,r,o,u=Date.now()){const n={message:o,createdAt:u,status:"pending"};return e.setItem(s(t,r),JSON.stringify(n)),n}function f(e,t,r){const o=s(t,r),u=c(e.getItem(o));return u||(e.removeItem(o),null)}function S(e,t,r,o=Date.now()){const u=s(t,r),n=f(e,t,r);return!n||n.status!=="pending"?null:o-n.createdAt>=i?(e.removeItem(u),null):(e.setItem(u,JSON.stringify({...n,status:"sending"})),{message:n.message,createdAt:n.createdAt})}function p(e,t,r){e.removeItem(s(t,r))}export{m as A,p as a,S as c,A as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,j as i,m as f,bA as R,cL as V,cM as I,cN as $}from"./index-
|
|
1
|
+
import{c as k,j as i,m as f,bA as R,cL as V,cM as I,cN as $}from"./index-D5oNRj-6.js";import{s as M}from"./User01-5RIq4_Iv.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 E(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("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 b=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 m=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]!==b||e[20]!==h?(w=f(S({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==z||e[23]!==m||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(M,{size:D(h)})}):i.jsxs(i.Fragment,{children:[l&&i.jsx(U,{src:l,loading:"lazy",alt:"Avatar",className:f(_({objectFit:u}))}),i.jsx(E,{className:f(z,"rounded-none"),delayMs:l?600:0,children:m})]}),e[22]=z,e[23]=m,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 b=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 m;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==x||e[16]!==l?(m=i.jsx(W,{shape:b,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]=b,e[15]=x,e[16]=l,e[17]=m):m=e[17],m}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 u,m as l,j as g,bc as v,bA as b}from"./index-
|
|
1
|
+
import{c as u,m as l,j as g,bc as v,bA as b}from"./index-D5oNRj-6.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"}},defaultVariants:{variant:"default",size:"default"}});function h(c){const e=u.c(14);let r,s,i,n,t;e[0]!==c?({className:r,variant:t,size:i,asChild:n,...s}=c,e[0]=c,e[1]=r,e[2]=s,e[3]=i,e[4]=n,e[5]=t):(r=e[1],s=e[2],i=e[3],n=e[4],t=e[5]);const d=(n===void 0?!1:n)?v:"span";let a;e[6]!==r||e[7]!==i||e[8]!==t?(a=l(f({variant:t,size:i}),r),e[6]=r,e[7]=i,e[8]=t,e[9]=a):a=e[9];let o;return e[10]!==d||e[11]!==s||e[12]!==a?(o=g.jsx(d,{"data-slot":"badge",className:a,...s}),e[10]=d,e[11]=s,e[12]=a,e[13]=o):o=e[13],o}export{h as B};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{c as E,i as D,r as K,m as Q,j as l,K as ve,n as je,B as it}from"./index-B3mw6d9V.js";import{E as ct,T as me,R as dt,I as ut,F as ft,H as De,J as ue,K as Re,P as Oe,L as ze,M as Fe,N as Ue,O as mt,Q as qe,U as He,V as Ve,W as Me,X as pt,Y as xt,r as gt,S as ht,Z as bt,_ as yt}from"./index-CCt42fhd.js";import{_ as vt,F as jt,ab as kt,ac as Nt,ad as Ct,h as ke,z as Bt}from"./agent-icon-pxwcqiKA.js";import{s as Ge}from"./Plus-DcI7xaXC.js";import{e as Be,a as St,b as wt,C as Pt,c as Tt,d as It}from"./command-BRhwT5rW.js";import{P as Lt,a as $t,b as At}from"./popover-C5NpLL36.js";import{a as _t}from"./Copy01-BkSfK2eJ.js";import{b as Ke}from"./ZoomOut-CLMb9fqF.js";import{s as he}from"./Trash01-B06SRS55.js";import{u as Et,f as Dt,d as Rt}from"./calendar-oce0FxN3.js";import{c as Ot}from"./automation-runs-CqsAiiMs.js";import{F as Ne,T as ie,I as X,s as L,p as ne,R as te,A as se}from"./primitives-DPxAocdS.js";import{i as Je}from"./Check-VM8y-9BQ.js";import{a as zt}from"./Image01-Dj2aQnzA.js";import{a as Ft}from"./Package-CjrrIbcY.js";import{s as Ut}from"./XClose-C1HOoFIF.js";import{L as de}from"./label-3v7rgQ87.js";import{S as Ye}from"./chat-context-gzZ7g8Xm.js";import{a as qt,b as Ht,d as Vt,e as Mt}from"./dialog-D8-F1Dpf.js";import{I as be}from"./input-1TVgmysx.js";const fe=m=>typeof m=="string"?m:"",Gt=/\/blog\.tsx?$/;function We(m,e){for(const[t,n]of Object.entries(m)){if(t.includes("/")||!n||typeof n!="object"||Array.isArray(n))continue;const s=n;if(typeof s.__resolveType!="string"||!Gt.test(s.__resolveType))continue;const r=fe(s[e]);if(r)return r}return null}function Kt(m){return We(m,"pageSlug")}function Jt(m){return We(m,"categorySlug")}function Yt(m){const e=m.categories;if(!Array.isArray(e)||e.length===0)return"";const t=e[0];return fe(t?.slug)}function Wt(m,e){let t=m;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 Qt=/:(?:categorySlug|category|slug)\??/,Xt=/:(?:categorySlug|category|slug)\??/g;function Zt(m,e){return Qt.test(m)?e?m.replace(Xt,encodeURIComponent(e)):null:m}function wl({decofile:m,category:e,previewBaseUrl:t}){if(!t)return null;const n=Jt(m);if(!n)return null;const s=Zt(n,fe(e.slug));if(!s)return null;try{return new URL(s,t).href}catch{return null}}function Pl({decofile:m,post:e,previewBaseUrl:t}){if(!t)return null;const n=Kt(m);if(!n)return null;const s=Wt(n,{category:Yt(e),slug:fe(e.slug)});if(!s)return null;try{return new URL(s,t).href}catch{return null}}const Se={app:"sandbox.blockPicker.blocksLabel",site:"sandbox.blockPicker.customBlocksLabel"};function es(m){const e=E.c(6),{iconName:t,iconUrl:n,alt:s}=m;let r;e[0]!==t?(r=jt(t)??vt,e[0]=t,e[1]=r):r=e[1];const o=r;let a;return e[2]!==o||e[3]!==s||e[4]!==n?(a=l.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-md border bg-muted",children:n?l.jsx("img",{src:n,alt:s,className:"size-5 object-contain"}):l.jsx(o,{size:16,className:"text-muted-foreground"})}),e[2]=o,e[3]=s,e[4]=n,e[5]=a):a=e[5],a}function we(m){const e=E.c(19),{type:t,onInsert:n}=m,s=`${t.title} ${t.resolveType} ${t.description??""}`;let r;e[0]!==n||e[1]!==t.resolveType?(r=()=>n(t.resolveType),e[0]=n,e[1]=t.resolveType,e[2]=r):r=e[2];let o;e[3]!==t.iconName||e[4]!==t.iconUrl||e[5]!==t.title?(o=l.jsx(es,{iconName:t.iconName,iconUrl:t.iconUrl,alt:t.title}),e[3]=t.iconName,e[4]=t.iconUrl,e[5]=t.title,e[6]=o):o=e[6];let a;e[7]!==t.title?(a=l.jsx("span",{className:"text-sm font-medium",children:t.title}),e[7]=t.title,e[8]=a):a=e[8];let f;e[9]!==t.description?(f=t.description&&l.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[9]=t.description,e[10]=f):f=e[10];let d;e[11]!==a||e[12]!==f?(d=l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[a,f]}),e[11]=a,e[12]=f,e[13]=d):d=e[13];let p;return e[14]!==s||e[15]!==r||e[16]!==o||e[17]!==d?(p=l.jsxs(St,{value:s,onSelect:r,className:"flex items-center gap-2.5",children:[o,d]}),e[14]=s,e[15]=r,e[16]=o,e[17]=d,e[18]=p):p=e[18],p}function Pe(m){const e=E.c(45),{blockTypes:t,onInsert:n,alwaysShow:s}=m,r=s===void 0?!1:s,o=D(),[a,f]=K.useState(!1);let d,p;if(e[0]!==t){d=[],p=[];for(const _ of t)(_.source==="site"?p:d).push(_);e[0]=t,e[1]=d,e[2]=p}else d=e[1],p=e[2];let g;e[3]!==n?(g=_=>{n(_),f(!1)},e[3]=n,e[4]=g):g=e[4];const h=g,b=d.length>0&&p.length>0,i=r?"h-10":"";let c;e[5]!==i?(c=Q("group/insert relative flex h-6 items-center justify-center",i),e[5]=i,e[6]=c):c=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx("div",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-border"}),e[7]=u):u=e[7];let x;e[8]!==o?(x=o("sandbox.blockPicker.insertBlockButton"),e[8]=o,e[9]=x):x=e[9];let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(Ge,{size:14}),e[10]=y):y=e[10];let N;e[11]!==x?(N=l.jsx(Lt,{asChild:!0,children:l.jsx("button",{type:"button","aria-label":x,className:"relative z-10 flex h-6 w-6 items-center justify-center rounded-full border bg-background text-muted-foreground transition-all hover:border-primary hover:text-primary cursor-pointer",children:y})}),e[11]=x,e[12]=N):N=e[12];let j;e[13]!==o?(j=o("sandbox.blockPicker.searchPlaceholder"),e[13]=o,e[14]=j):j=e[14];let C;e[15]!==j?(C=l.jsx(wt,{placeholder:j}),e[15]=j,e[16]=C):C=e[16];let k;e[17]!==o?(k=o("sandbox.blockPicker.noBlocksFound"),e[17]=o,e[18]=k):k=e[18];let v;e[19]!==k?(v=l.jsx(Pt,{children:k}),e[19]=k,e[20]=v):v=e[20];let B;e[21]!==h||e[22]!==b||e[23]!==p||e[24]!==o?(B=p.length>0&&l.jsx(Be,{heading:b?o(Se.site):void 0,children:p.map(_=>l.jsx(we,{type:_,onInsert:h},_.resolveType))}),e[21]=h,e[22]=b,e[23]=p,e[24]=o,e[25]=B):B=e[25];let S;e[26]!==d||e[27]!==h||e[28]!==b||e[29]!==o?(S=d.length>0&&l.jsx(Be,{heading:b?o(Se.app):void 0,children:d.map(_=>l.jsx(we,{type:_,onInsert:h},_.resolveType))}),e[26]=d,e[27]=h,e[28]=b,e[29]=o,e[30]=S):S=e[30];let w;e[31]!==v||e[32]!==B||e[33]!==S?(w=l.jsxs(Tt,{className:"max-h-80",children:[v,B,S]}),e[31]=v,e[32]=B,e[33]=S,e[34]=w):w=e[34];let I;e[35]!==C||e[36]!==w?(I=l.jsx($t,{className:"w-80 p-0",align:"center",children:l.jsxs(It,{children:[C,w]})}),e[35]=C,e[36]=w,e[37]=I):I=e[37];let $;e[38]!==a||e[39]!==I||e[40]!==N?($=l.jsxs(At,{open:a,onOpenChange:f,children:[N,I]}),e[38]=a,e[39]=I,e[40]=N,e[41]=$):$=e[41];let P;return e[42]!==$||e[43]!==c?(P=l.jsxs("div",{className:c,children:[u,$]}),e[42]=$,e[43]=c,e[44]=P):P=e[44],P}function ts({html:m,placeholder:e,onChange:t}){const n=K.useRef(t);n.current=t;const[s,r]=K.useState(!1),o=Et({extensions:[Ot.configure({link:{HTMLAttributes:{}},heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,bulletList:!1,orderedList:!1,listItem:!1,dropcursor:!1,gapcursor:!1}),ct.configure({placeholder:e??"Write something…"})],content:m||"",editorProps:{attributes:{class:Q("prose prose-sm dark:prose-invert max-w-none focus:outline-none","leading-relaxed [&_p]:my-0")}},onUpdate:({editor:f})=>{const d=f.getHTML();n.current(d==="<p></p>"?"":d)}}),a=Dt({editor:o,selector:({editor:f})=>({isFocused:f?.isFocused??!1,bold:f?.isActive("bold")??!1,italic:f?.isActive("italic")??!1,underline:f?.isActive("underline")??!1,link:f?.isActive("link")??!1})});return o?l.jsxs("div",{className:"relative",children:[(a.isFocused||s)&&l.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:[l.jsx(me,{active:a.bold,label:"Bold",onClick:()=>o.chain().focus().toggleBold().run(),children:l.jsx(kt,{size:14})}),l.jsx(me,{active:a.italic,label:"Italic",onClick:()=>o.chain().focus().toggleItalic().run(),children:l.jsx(Nt,{size:14})}),l.jsx(me,{active:a.underline,label:"Underline",onClick:()=>o.chain().focus().toggleUnderline().run(),children:l.jsx(Ct,{size:14})}),l.jsx(dt,{editor:o,active:a.link,open:s,onOpenChange:r})]}),l.jsx(Rt,{editor:o,className:"text-[15px] text-foreground"})]}):null}const ss=["1","2","3"],Te={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 ls(m){const e=E.c(23),{text:t,level:n,onChange:s}=m,[r,o]=K.useState(!1),a=D(),f=n||"2";let d;e[0]!==r||e[1]!==f||e[2]!==s||e[3]!==a||e[4]!==t?(d=r&&l.jsx(Ne,{children:ss.map(y=>l.jsxs(ie,{active:f===y,label:a(`sandbox.plainBlocks.headingLevel${y}`),onClick:()=>s({text:t,level:y}),children:["H",y]},y))}),e[0]=r,e[1]=f,e[2]=s,e[3]=a,e[4]=t,e[5]=d):d=e[5];let p;e[6]!==f||e[7]!==s?(p=y=>s({text:y,level:f}),e[6]=f,e[7]=s,e[8]=p):p=e[8];let g,h;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=()=>o(!0),h=()=>o(!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=Te[f]??Te[2];let c;e[13]!==i?(c=Q("text-foreground",i),e[13]=i,e[14]=c):c=e[14];let u;e[15]!==p||e[16]!==b||e[17]!==c||e[18]!==t?(u=l.jsx(X,{value:t,onChange:p,onFocus:g,onBlur:h,placeholder:b,className:c}),e[15]=p,e[16]=b,e[17]=c,e[18]=t,e[19]=u):u=e[19];let x;return e[20]!==d||e[21]!==u?(x=l.jsxs("div",{className:"relative",children:[d,u]}),e[20]=d,e[21]=u,e[22]=x):x=e[22],x}function os(m){const e=E.c(6),{quote:t,onChange:n}=m,s=D();let r;e[0]!==s?(r=s("sandbox.plainBlocks.quotePlaceholder"),e[0]=s,e[1]=r):r=e[1];let o;return e[2]!==n||e[3]!==t||e[4]!==r?(o=l.jsx("div",{className:"border-l-2 border-foreground/30 pl-4",children:l.jsx(X,{value:t,onChange:n,placeholder:r,className:"text-lg italic text-foreground/90"})}),e[2]=n,e[3]=t,e[4]=r,e[5]=o):o=e[5],o}function rs(m){const e=E.c(21),{code:t,language:n,onChange:s}=m,r=D();let o;e[0]!==t||e[1]!==s?(o=b=>s({code:t,language:b.target.value}),e[0]=t,e[1]=s,e[2]=o):o=e[2];let a;e[3]!==r?(a=r("sandbox.plainBlocks.languagePlaceholder"),e[3]=r,e[4]=a):a=e[4];let f;e[5]!==n||e[6]!==o||e[7]!==a?(f=l.jsx("input",{value:n,onChange:o,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]=o,e[7]=a,e[8]=f):f=e[8];let d;e[9]!==n||e[10]!==s?(d=b=>s({code:b,language:n}),e[9]=n,e[10]=s,e[11]=d):d=e[11];let p;e[12]!==r?(p=r("sandbox.plainBlocks.codePlaceholder"),e[12]=r,e[13]=p):p=e[13];let g;e[14]!==t||e[15]!==d||e[16]!==p?(g=l.jsx(X,{value:t,onChange:d,placeholder:p,spellCheck:!1,className:"px-3 py-2.5 font-mono text-sm text-foreground"}),e[14]=t,e[15]=d,e[16]=p,e[17]=g):g=e[17];let h;return e[18]!==f||e[19]!==g?(h=l.jsxs("div",{className:"overflow-hidden rounded-md border bg-muted/50",children:[f,g]}),e[18]=f,e[19]=g,e[20]=h):h=e[20],h}function ns(m){const e=E.c(18),{items:t,style:n,onChange:s}=m,r=n==="ordered",o=t.length?t.split(`
|
|
1
|
+
import{c as E,b as D,r as K,m as Q,j as l,K as ve,n as je,B as it}from"./index-D5oNRj-6.js";import{E as ct,T as me,R as dt,I as ut,F as ft,H as De,J as ue,K as Re,P as Oe,L as ze,M as Fe,N as Ue,O as mt,Q as qe,U as He,V as Ve,W as Me,X as pt,Y as xt,r as gt,S as ht,Z as bt,_ as yt}from"./index-yySTLmxN.js";import{$ as vt,F as jt,ab as kt,ac as Nt,ad as Ct,h as ke,z as Bt}from"./agent-icon-C9M8Qgs2.js";import{s as Ge}from"./Plus-D3J2ZkJj.js";import{e as Be,a as St,b as wt,C as Pt,c as Tt,d as It}from"./command-iaeulMQd.js";import{P as Lt,a as $t,b as At}from"./popover-ByY44B0c.js";import{a as _t}from"./Copy01-Ckds0BNV.js";import{b as Ke}from"./ZoomOut-BccWsYWo.js";import{s as he}from"./Trash01-DE0_omFY.js";import{u as Et,f as Dt,d as Rt}from"./calendar-DRUl8y7E.js";import{c as Ot}from"./automation-runs-CmZ9KW0J.js";import{F as Ne,T as ie,I as X,s as L,p as ne,R as te,A as se}from"./primitives-alsZ8klS.js";import{i as Je}from"./Check-CuStPfkH.js";import{a as zt}from"./Image01-CpzRhjw-.js";import{a as Ft}from"./Package-giUmCQTv.js";import{s as Ut}from"./XClose-DyOwi7PW.js";import{L as de}from"./label-CWIiksOC.js";import{S as Ye}from"./chat-context-b7wY40dG.js";import{a as qt,b as Ht,d as Vt,e as Mt}from"./dialog-u_k4pxo5.js";import{I as be}from"./input-C_SNan5h.js";const fe=m=>typeof m=="string"?m:"",Gt=/\/blog\.tsx?$/;function We(m,e){for(const[t,n]of Object.entries(m)){if(t.includes("/")||!n||typeof n!="object"||Array.isArray(n))continue;const s=n;if(typeof s.__resolveType!="string"||!Gt.test(s.__resolveType))continue;const r=fe(s[e]);if(r)return r}return null}function Kt(m){return We(m,"pageSlug")}function Jt(m){return We(m,"categorySlug")}function Yt(m){const e=m.categories;if(!Array.isArray(e)||e.length===0)return"";const t=e[0];return fe(t?.slug)}function Wt(m,e){let t=m;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 Qt=/:(?:categorySlug|category|slug)\??/,Xt=/:(?:categorySlug|category|slug)\??/g;function Zt(m,e){return Qt.test(m)?e?m.replace(Xt,encodeURIComponent(e)):null:m}function wl({decofile:m,category:e,previewBaseUrl:t}){if(!t)return null;const n=Jt(m);if(!n)return null;const s=Zt(n,fe(e.slug));if(!s)return null;try{return new URL(s,t).href}catch{return null}}function Pl({decofile:m,post:e,previewBaseUrl:t}){if(!t)return null;const n=Kt(m);if(!n)return null;const s=Wt(n,{category:Yt(e),slug:fe(e.slug)});if(!s)return null;try{return new URL(s,t).href}catch{return null}}const Se={app:"sandbox.blockPicker.blocksLabel",site:"sandbox.blockPicker.customBlocksLabel"};function es(m){const e=E.c(6),{iconName:t,iconUrl:n,alt:s}=m;let r;e[0]!==t?(r=jt(t)??vt,e[0]=t,e[1]=r):r=e[1];const o=r;let a;return e[2]!==o||e[3]!==s||e[4]!==n?(a=l.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-md border bg-muted",children:n?l.jsx("img",{src:n,alt:s,className:"size-5 object-contain"}):l.jsx(o,{size:16,className:"text-muted-foreground"})}),e[2]=o,e[3]=s,e[4]=n,e[5]=a):a=e[5],a}function we(m){const e=E.c(19),{type:t,onInsert:n}=m,s=`${t.title} ${t.resolveType} ${t.description??""}`;let r;e[0]!==n||e[1]!==t.resolveType?(r=()=>n(t.resolveType),e[0]=n,e[1]=t.resolveType,e[2]=r):r=e[2];let o;e[3]!==t.iconName||e[4]!==t.iconUrl||e[5]!==t.title?(o=l.jsx(es,{iconName:t.iconName,iconUrl:t.iconUrl,alt:t.title}),e[3]=t.iconName,e[4]=t.iconUrl,e[5]=t.title,e[6]=o):o=e[6];let a;e[7]!==t.title?(a=l.jsx("span",{className:"text-sm font-medium",children:t.title}),e[7]=t.title,e[8]=a):a=e[8];let f;e[9]!==t.description?(f=t.description&&l.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[9]=t.description,e[10]=f):f=e[10];let d;e[11]!==a||e[12]!==f?(d=l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[a,f]}),e[11]=a,e[12]=f,e[13]=d):d=e[13];let p;return e[14]!==s||e[15]!==r||e[16]!==o||e[17]!==d?(p=l.jsxs(St,{value:s,onSelect:r,className:"flex items-center gap-2.5",children:[o,d]}),e[14]=s,e[15]=r,e[16]=o,e[17]=d,e[18]=p):p=e[18],p}function Pe(m){const e=E.c(45),{blockTypes:t,onInsert:n,alwaysShow:s}=m,r=s===void 0?!1:s,o=D(),[a,f]=K.useState(!1);let d,p;if(e[0]!==t){d=[],p=[];for(const _ of t)(_.source==="site"?p:d).push(_);e[0]=t,e[1]=d,e[2]=p}else d=e[1],p=e[2];let g;e[3]!==n?(g=_=>{n(_),f(!1)},e[3]=n,e[4]=g):g=e[4];const h=g,b=d.length>0&&p.length>0,i=r?"h-10":"";let c;e[5]!==i?(c=Q("group/insert relative flex h-6 items-center justify-center",i),e[5]=i,e[6]=c):c=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx("div",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-border"}),e[7]=u):u=e[7];let x;e[8]!==o?(x=o("sandbox.blockPicker.insertBlockButton"),e[8]=o,e[9]=x):x=e[9];let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(Ge,{size:14}),e[10]=y):y=e[10];let N;e[11]!==x?(N=l.jsx(Lt,{asChild:!0,children:l.jsx("button",{type:"button","aria-label":x,className:"relative z-10 flex h-6 w-6 items-center justify-center rounded-full border bg-background text-muted-foreground transition-all hover:border-primary hover:text-primary cursor-pointer",children:y})}),e[11]=x,e[12]=N):N=e[12];let j;e[13]!==o?(j=o("sandbox.blockPicker.searchPlaceholder"),e[13]=o,e[14]=j):j=e[14];let C;e[15]!==j?(C=l.jsx(wt,{placeholder:j}),e[15]=j,e[16]=C):C=e[16];let k;e[17]!==o?(k=o("sandbox.blockPicker.noBlocksFound"),e[17]=o,e[18]=k):k=e[18];let v;e[19]!==k?(v=l.jsx(Pt,{children:k}),e[19]=k,e[20]=v):v=e[20];let B;e[21]!==h||e[22]!==b||e[23]!==p||e[24]!==o?(B=p.length>0&&l.jsx(Be,{heading:b?o(Se.site):void 0,children:p.map(_=>l.jsx(we,{type:_,onInsert:h},_.resolveType))}),e[21]=h,e[22]=b,e[23]=p,e[24]=o,e[25]=B):B=e[25];let S;e[26]!==d||e[27]!==h||e[28]!==b||e[29]!==o?(S=d.length>0&&l.jsx(Be,{heading:b?o(Se.app):void 0,children:d.map(_=>l.jsx(we,{type:_,onInsert:h},_.resolveType))}),e[26]=d,e[27]=h,e[28]=b,e[29]=o,e[30]=S):S=e[30];let w;e[31]!==v||e[32]!==B||e[33]!==S?(w=l.jsxs(Tt,{className:"max-h-80",children:[v,B,S]}),e[31]=v,e[32]=B,e[33]=S,e[34]=w):w=e[34];let I;e[35]!==C||e[36]!==w?(I=l.jsx($t,{className:"w-80 p-0",align:"center",children:l.jsxs(It,{children:[C,w]})}),e[35]=C,e[36]=w,e[37]=I):I=e[37];let $;e[38]!==a||e[39]!==I||e[40]!==N?($=l.jsxs(At,{open:a,onOpenChange:f,children:[N,I]}),e[38]=a,e[39]=I,e[40]=N,e[41]=$):$=e[41];let P;return e[42]!==$||e[43]!==c?(P=l.jsxs("div",{className:c,children:[u,$]}),e[42]=$,e[43]=c,e[44]=P):P=e[44],P}function ts({html:m,placeholder:e,onChange:t}){const n=K.useRef(t);n.current=t;const[s,r]=K.useState(!1),o=Et({extensions:[Ot.configure({link:{HTMLAttributes:{}},heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,bulletList:!1,orderedList:!1,listItem:!1,dropcursor:!1,gapcursor:!1}),ct.configure({placeholder:e??"Write something…"})],content:m||"",editorProps:{attributes:{class:Q("prose prose-sm dark:prose-invert max-w-none focus:outline-none","leading-relaxed [&_p]:my-0")}},onUpdate:({editor:f})=>{const d=f.getHTML();n.current(d==="<p></p>"?"":d)}}),a=Dt({editor:o,selector:({editor:f})=>({isFocused:f?.isFocused??!1,bold:f?.isActive("bold")??!1,italic:f?.isActive("italic")??!1,underline:f?.isActive("underline")??!1,link:f?.isActive("link")??!1})});return o?l.jsxs("div",{className:"relative",children:[(a.isFocused||s)&&l.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:[l.jsx(me,{active:a.bold,label:"Bold",onClick:()=>o.chain().focus().toggleBold().run(),children:l.jsx(kt,{size:14})}),l.jsx(me,{active:a.italic,label:"Italic",onClick:()=>o.chain().focus().toggleItalic().run(),children:l.jsx(Nt,{size:14})}),l.jsx(me,{active:a.underline,label:"Underline",onClick:()=>o.chain().focus().toggleUnderline().run(),children:l.jsx(Ct,{size:14})}),l.jsx(dt,{editor:o,active:a.link,open:s,onOpenChange:r})]}),l.jsx(Rt,{editor:o,className:"text-[15px] text-foreground"})]}):null}const ss=["1","2","3"],Te={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 ls(m){const e=E.c(23),{text:t,level:n,onChange:s}=m,[r,o]=K.useState(!1),a=D(),f=n||"2";let d;e[0]!==r||e[1]!==f||e[2]!==s||e[3]!==a||e[4]!==t?(d=r&&l.jsx(Ne,{children:ss.map(y=>l.jsxs(ie,{active:f===y,label:a(`sandbox.plainBlocks.headingLevel${y}`),onClick:()=>s({text:t,level:y}),children:["H",y]},y))}),e[0]=r,e[1]=f,e[2]=s,e[3]=a,e[4]=t,e[5]=d):d=e[5];let p;e[6]!==f||e[7]!==s?(p=y=>s({text:y,level:f}),e[6]=f,e[7]=s,e[8]=p):p=e[8];let g,h;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=()=>o(!0),h=()=>o(!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=Te[f]??Te[2];let c;e[13]!==i?(c=Q("text-foreground",i),e[13]=i,e[14]=c):c=e[14];let u;e[15]!==p||e[16]!==b||e[17]!==c||e[18]!==t?(u=l.jsx(X,{value:t,onChange:p,onFocus:g,onBlur:h,placeholder:b,className:c}),e[15]=p,e[16]=b,e[17]=c,e[18]=t,e[19]=u):u=e[19];let x;return e[20]!==d||e[21]!==u?(x=l.jsxs("div",{className:"relative",children:[d,u]}),e[20]=d,e[21]=u,e[22]=x):x=e[22],x}function os(m){const e=E.c(6),{quote:t,onChange:n}=m,s=D();let r;e[0]!==s?(r=s("sandbox.plainBlocks.quotePlaceholder"),e[0]=s,e[1]=r):r=e[1];let o;return e[2]!==n||e[3]!==t||e[4]!==r?(o=l.jsx("div",{className:"border-l-2 border-foreground/30 pl-4",children:l.jsx(X,{value:t,onChange:n,placeholder:r,className:"text-lg italic text-foreground/90"})}),e[2]=n,e[3]=t,e[4]=r,e[5]=o):o=e[5],o}function rs(m){const e=E.c(21),{code:t,language:n,onChange:s}=m,r=D();let o;e[0]!==t||e[1]!==s?(o=b=>s({code:t,language:b.target.value}),e[0]=t,e[1]=s,e[2]=o):o=e[2];let a;e[3]!==r?(a=r("sandbox.plainBlocks.languagePlaceholder"),e[3]=r,e[4]=a):a=e[4];let f;e[5]!==n||e[6]!==o||e[7]!==a?(f=l.jsx("input",{value:n,onChange:o,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]=o,e[7]=a,e[8]=f):f=e[8];let d;e[9]!==n||e[10]!==s?(d=b=>s({code:b,language:n}),e[9]=n,e[10]=s,e[11]=d):d=e[11];let p;e[12]!==r?(p=r("sandbox.plainBlocks.codePlaceholder"),e[12]=r,e[13]=p):p=e[13];let g;e[14]!==t||e[15]!==d||e[16]!==p?(g=l.jsx(X,{value:t,onChange:d,placeholder:p,spellCheck:!1,className:"px-3 py-2.5 font-mono text-sm text-foreground"}),e[14]=t,e[15]=d,e[16]=p,e[17]=g):g=e[17];let h;return e[18]!==f||e[19]!==g?(h=l.jsxs("div",{className:"overflow-hidden rounded-md border bg-muted/50",children:[f,g]}),e[18]=f,e[19]=g,e[20]=h):h=e[20],h}function ns(m){const e=E.c(18),{items:t,style:n,onChange:s}=m,r=n==="ordered",o=t.length?t.split(`
|
|
2
2
|
`):[""],[a,f]=K.useState(!1),d=D(),p=K.useRef([]);let g;e[0]!==s||e[1]!==n?(g=k=>s({items:k.join(`
|
|
3
3
|
`),style:n}),e[0]=s,e[1]=n,e[2]=g):g=e[2];const h=g,b=(k,v)=>requestAnimationFrame(()=>{const B=p.current[k];if(!B)return;B.focus();const S=v==="end"?B.value.length:0;B.setSelectionRange(S,S)}),i="relative";let c,u;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=()=>f(!0),u=k=>{k.currentTarget.contains(k.relatedTarget)||f(!1)},e[3]=c,e[4]=u):(c=e[3],u=e[4]);let x;e[5]!==a||e[6]!==t||e[7]!==s||e[8]!==r||e[9]!==d?(x=a&&l.jsxs(Ne,{children:[l.jsx(ie,{active:!r,label:d("sandbox.plainBlocks.bulletedLabel"),onClick:()=>s({items:t,style:"unordered"}),children:"•"}),l.jsx(ie,{active:r,label:d("sandbox.plainBlocks.numberedLabel"),onClick:()=>s({items:t,style:"ordered"}),children:"1."})]}),e[5]=a,e[6]=t,e[7]=s,e[8]=r,e[9]=d,e[10]=x):x=e[10];const y="space-y-1",N=o.map((k,v)=>l.jsxs("li",{className:"flex items-start gap-2.5",children:[l.jsx("span",{className:"min-w-5 shrink-0 select-none pt-px text-right text-[15px] leading-relaxed text-muted-foreground tabular-nums",children:r?`${v+1}.`:"•"}),l.jsx(X,{inputRef:B=>{p.current[v]=B},value:k,onChange:B=>{const S=[...o];S[v]=B,h(S)},onKeyDown:B=>{const S=B.currentTarget;if(B.key==="Enter"){B.preventDefault();const w=[...o];w.splice(v+1,0,""),h(w),b(v+1,"start")}else B.key==="Backspace"&&k===""&&o.length>1?(B.preventDefault(),h(o.filter((w,I)=>I!==v)),b(Math.max(0,v-1),"end")):B.key==="ArrowUp"&&S.selectionStart===0&&v>0?(B.preventDefault(),b(v-1,"end")):B.key==="ArrowDown"&&S.selectionEnd===k.length&&v<o.length-1&&(B.preventDefault(),b(v+1,"end"))},placeholder:d("sandbox.plainBlocks.listItemPlaceholder"),className:"text-[15px] leading-relaxed text-foreground"})]},v));let j;e[11]!==N?(j=l.jsx("ul",{className:y,children:N}),e[11]=N,e[12]=j):j=e[12];let C;return e[13]!==c||e[14]!==u||e[15]!==x||e[16]!==j?(C=l.jsxs("div",{className:i,onFocus:c,onBlur:u,children:[x,j]}),e[13]=c,e[14]=u,e[15]=x,e[16]=j,e[17]=C):C=e[17],C}function as(m){const e=E.c(51),{block:t,onChange:n}=m,s=D();let r;e[0]!==t.size?(r=L(t.size)||"normal",e[0]=t.size,e[1]=r):r=e[1];const o=r;let a;e[2]!==s?(a=s("sandbox.mediaBlocks.image"),e[2]=s,e[3]=a):a=e[3];let f;e[4]!==a?(f={type:"string",format:"image-uri",title:a},e[4]=a,e[5]=f):f=e[5];const d=t.url;let p;e[6]!==t||e[7]!==n?(p=S=>n({...t,url:S}),e[6]=t,e[7]=n,e[8]=p):p=e[8];let g;e[9]!==s?(g=s("sandbox.mediaBlocks.image"),e[9]=s,e[10]=g):g=e[10];let h;e[11]!==t.url||e[12]!==f||e[13]!==p||e[14]!==g?(h=l.jsx(ut,{schema:f,value:d,onChange:p,path:"block-image-url",label:g}),e[11]=t.url,e[12]=f,e[13]=p,e[14]=g,e[15]=h):h=e[15];let b;e[16]!==t.caption?(b=L(t.caption),e[16]=t.caption,e[17]=b):b=e[17];let i;e[18]!==t||e[19]!==n?(i=S=>n({...t,caption:S}),e[18]=t,e[19]=n,e[20]=i):i=e[20];let c;e[21]!==s?(c=s("sandbox.mediaBlocks.addCaption"),e[21]=s,e[22]=c):c=e[22];let u;e[23]!==c||e[24]!==b||e[25]!==i?(u=l.jsx(X,{value:b,onChange:i,placeholder:c,className:"text-center text-sm italic text-muted-foreground"}),e[23]=c,e[24]=b,e[25]=i,e[26]=u):u=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]!==o||e[31]!==s?(y=l.jsx("div",{className:"flex items-center gap-1",children:x.map(S=>l.jsx("button",{type:"button",onClick:()=>n({...t,size:S}),className:Q("rounded px-2 py-0.5 transition-colors cursor-pointer",o===S?"bg-accent text-accent-foreground":"hover:bg-muted"),children:s(S==="full"?"sandbox.mediaBlocks.fullWidth":"sandbox.mediaBlocks.normal")},S))}),e[28]=t,e[29]=n,e[30]=o,e[31]=s,e[32]=y):y=e[32];let N;e[33]!==t.alt?(N=L(t.alt),e[33]=t.alt,e[34]=N):N=e[34];let j;e[35]!==t||e[36]!==n?(j=S=>n({...t,alt:S.target.value}),e[35]=t,e[36]=n,e[37]=j):j=e[37];let C;e[38]!==s?(C=s("sandbox.mediaBlocks.altText"),e[38]=s,e[39]=C):C=e[39];let k;e[40]!==N||e[41]!==j||e[42]!==C?(k=l.jsx("input",{value:N,onChange:j,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]=N,e[41]=j,e[42]=C,e[43]=k):k=e[43];let v;e[44]!==y||e[45]!==k?(v=l.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[y,k]}),e[44]=y,e[45]=k,e[46]=v):v=e[46];let B;return e[47]!==u||e[48]!==v||e[49]!==h?(B=l.jsxs("div",{className:"space-y-2",children:[h,u,v]}),e[47]=u,e[48]=v,e[49]=h,e[50]=B):B=e[50],B}function is(m){const e=m.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]{11})/);if(e)return`https://www.youtube.com/embed/${e[1]}`;const t=m.match(/vimeo\.com\/(\d+)/);return t?`https://player.vimeo.com/video/${t[1]}`:null}function cs(m){const e=E.c(28),{url:t,caption:n,onChange:s}=m,r=D();let o;e[0]!==t?(o=is(t),e[0]=t,e[1]=o):o=e[1];const a=o;let f;e[2]!==n||e[3]!==a||e[4]!==r?(f=a?l.jsx("div",{className:"relative aspect-video overflow-hidden rounded-md border bg-muted",children:l.jsx("iframe",{src:a,title:n||r("sandbox.mediaBlocks.video"),className:"absolute inset-0 h-full w-full border-0",allowFullScreen:!0})}):l.jsx("div",{className:"flex aspect-video items-center justify-center rounded-md border border-dashed bg-muted/40 text-xs text-muted-foreground",children:r("sandbox.mediaBlocks.pasteVideoUrl")}),e[2]=n,e[3]=a,e[4]=r,e[5]=f):f=e[5];let d;e[6]!==n||e[7]!==s?(d=u=>s({url:u.target.value,caption:n}),e[6]=n,e[7]=s,e[8]=d):d=e[8];let p;e[9]!==r?(p=r("sandbox.mediaBlocks.videoUrlPlaceholder"),e[9]=r,e[10]=p):p=e[10];let g;e[11]!==d||e[12]!==p||e[13]!==t?(g=l.jsx("input",{value:t,onChange:d,placeholder:p,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]=d,e[12]=p,e[13]=t,e[14]=g):g=e[14];let h;e[15]!==s||e[16]!==t?(h=u=>s({url:t,caption:u}),e[15]=s,e[16]=t,e[17]=h):h=e[17];let b;e[18]!==r?(b=r("sandbox.mediaBlocks.addCaption"),e[18]=r,e[19]=b):b=e[19];let i;e[20]!==n||e[21]!==h||e[22]!==b?(i=l.jsx(X,{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 c;return e[24]!==f||e[25]!==g||e[26]!==i?(c=l.jsxs("div",{className:"space-y-2",children:[f,g,i]}),e[24]=f,e[25]=g,e[26]=i,e[27]=c):c=e[27],c}function ds(){const m=E.c(5),e=D();let t;m[0]!==e?(t=e("sandbox.mediaBlocks.divider"),m[0]=e,m[1]=t):t=m[1];let n;m[2]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx("span",{className:"h-px flex-1 bg-border"}),m[2]=n):n=m[2];let s;return m[3]!==t?(s=l.jsx("div",{className:"flex items-center py-3","aria-label":t,children:n}),m[3]=t,m[4]=s):s=m[4],s}function us(m){const e=E.c(22),{text:t,href:n,onChange:s}=m,r=D();let o;e[0]!==n||e[1]!==s?(o=i=>s({text:i.target.value,href:n}),e[0]=n,e[1]=s,e[2]=o):o=e[2];let a;e[3]!==r?(a=r("sandbox.mediaBlocks.buttonLabel"),e[3]=r,e[4]=a):a=e[4];const f=Math.max(t.length||11,8);let d;e[5]!==o||e[6]!==a||e[7]!==f||e[8]!==t?(d=l.jsx("div",{className:"inline-flex items-center rounded-full bg-primary px-6 py-2 text-sm font-semibold text-primary-foreground",children:l.jsx("input",{value:t,onChange:o,placeholder:a,size:f,className:"border-0 bg-transparent p-0 text-center text-sm font-semibold text-primary-foreground outline-none placeholder:text-primary-foreground/60 focus:ring-0"})}),e[5]=o,e[6]=a,e[7]=f,e[8]=t,e[9]=d):d=e[9];let p;e[10]!==s||e[11]!==t?(p=i=>s({text:t,href:i.target.value}),e[10]=s,e[11]=t,e[12]=p):p=e[12];let g;e[13]!==r?(g=r("sandbox.mediaBlocks.destinationUrlPlaceholder"),e[13]=r,e[14]=g):g=e[14];let h;e[15]!==n||e[16]!==p||e[17]!==g?(h=l.jsx("input",{value:n,onChange:p,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]=p,e[17]=g,e[18]=h):h=e[18];let b;return e[19]!==d||e[20]!==h?(b=l.jsxs("div",{className:"flex flex-col items-center gap-2 py-2",children:[d,h]}),e[19]=d,e[20]=h,e[21]=b):b=e[21],b}const pe=[{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 fs(m){const e=E.c(51),{title:t,body:n,variant:s,onChange:r}=m,o=D(),[a,f]=K.useState(!1);let d;e[0]!==s?(d=pe.find(P=>P.value===s)??pe[0],e[0]=s,e[1]=d):d=e[1];const p=d;let g,h;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=()=>f(!0),h=P=>{P.currentTarget.contains(P.relatedTarget)||f(!1)},e[2]=g,e[3]=h):(g=e[2],h=e[3]);let b;e[4]!==n||e[5]!==a||e[6]!==r||e[7]!==t||e[8]!==p.value?(b=a&&l.jsx(Ne,{children:pe.map(P=>l.jsx(ie,{active:p.value===P.value,label:P.value,onClick:()=>r({title:t,body:n,variant:P.value}),children:l.jsx("span",{style:{color:P.color},children:P.icon})},P.value))}),e[4]=n,e[5]=a,e[6]=r,e[7]=t,e[8]=p.value,e[9]=b):b=e[9];const i=`3px solid ${p.color}`,c=`color-mix(in oklch, ${p.color} 8%, transparent)`;let u;e[10]!==i||e[11]!==c?(u={borderLeft:i,backgroundColor:c},e[10]=i,e[11]=c,e[12]=u):u=e[12];let x;e[13]!==p.color?(x={color:p.color},e[13]=p.color,e[14]=x):x=e[14];let y;e[15]!==p.icon?(y=l.jsx("span",{"aria-hidden":!0,className:"text-sm font-bold leading-none",children:p.icon}),e[15]=p.icon,e[16]=y):y=e[16];let N;e[17]!==n||e[18]!==r||e[19]!==s?(N=P=>r({title:P.target.value,body:n,variant:s}),e[17]=n,e[18]=r,e[19]=s,e[20]=N):N=e[20];let j;e[21]!==o?(j=o("sandbox.mediaBlocks.calloutTitle"),e[21]=o,e[22]=j):j=e[22];let C;e[23]!==p.color?(C={color:p.color},e[23]=p.color,e[24]=C):C=e[24];let k;e[25]!==N||e[26]!==j||e[27]!==C||e[28]!==t?(k=l.jsx("input",{value:t,onChange:N,placeholder:j,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]=N,e[26]=j,e[27]=C,e[28]=t,e[29]=k):k=e[29];let v;e[30]!==k||e[31]!==x||e[32]!==y?(v=l.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]=v):v=e[33];let B;e[34]!==r||e[35]!==t||e[36]!==s?(B=P=>r({title:t,body:P,variant:s}),e[34]=r,e[35]=t,e[36]=s,e[37]=B):B=e[37];let S;e[38]!==o?(S=o("sandbox.mediaBlocks.calloutText"),e[38]=o,e[39]=S):S=e[39];let w;e[40]!==n||e[41]!==B||e[42]!==S?(w=l.jsx(X,{value:n,onChange:B,placeholder:S,className:"text-[15px] leading-relaxed text-foreground"}),e[40]=n,e[41]=B,e[42]=S,e[43]=w):w=e[43];let I;e[44]!==v||e[45]!==w||e[46]!==u?(I=l.jsxs("div",{className:"rounded-md py-4 pl-5 pr-4",style:u,children:[v,w]}),e[44]=v,e[45]=w,e[46]=u,e[47]=I):I=e[47];let $;return e[48]!==I||e[49]!==b?($=l.jsxs("div",{className:"relative",onFocus:g,onBlur:h,children:[b,I]}),e[48]=I,e[49]=b,e[50]=$):$=e[50],$}function ms(m){const e=E.c(34),{value:t,label:n,description:s,onChange:r}=m,o=D();let a;e[0]!==s||e[1]!==n||e[2]!==r?(a=x=>r({value:x.target.value,label:n,description:s}),e[0]=s,e[1]=n,e[2]=r,e[3]=a):a=e[3];let f;e[4]!==o?(f=o("sandbox.mediaBlocks.statValuePlaceholder"),e[4]=o,e[5]=f):f=e[5];let d;e[6]!==a||e[7]!==f||e[8]!==t?(d=l.jsx("input",{value:t,onChange:a,placeholder:f,className:"w-full border-0 bg-transparent p-0 text-center text-4xl font-bold tabular-nums text-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),e[6]=a,e[7]=f,e[8]=t,e[9]=d):d=e[9];let p;e[10]!==s||e[11]!==r||e[12]!==t?(p=x=>r({value:t,label:x.target.value,description:s}),e[10]=s,e[11]=r,e[12]=t,e[13]=p):p=e[13];let g;e[14]!==o?(g=o("sandbox.mediaBlocks.label"),e[14]=o,e[15]=g):g=e[15];let h;e[16]!==n||e[17]!==p||e[18]!==g?(h=l.jsx("input",{value:n,onChange:p,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]=p,e[18]=g,e[19]=h):h=e[19];let b;e[20]!==n||e[21]!==r||e[22]!==t?(b=x=>r({value:t,label:n,description:x}),e[20]=n,e[21]=r,e[22]=t,e[23]=b):b=e[23];let i;e[24]!==o?(i=o("sandbox.mediaBlocks.optionalDescription"),e[24]=o,e[25]=i):i=e[25];let c;e[26]!==s||e[27]!==b||e[28]!==i?(c=l.jsx(X,{value:s,onChange:b,placeholder:i,className:"max-w-md text-center text-sm text-muted-foreground"}),e[26]=s,e[27]=b,e[28]=i,e[29]=c):c=e[29];let u;return e[30]!==d||e[31]!==h||e[32]!==c?(u=l.jsxs("div",{className:"flex flex-col items-center gap-1.5 border-y border-border/60 py-8 text-center",children:[d,h,c]}),e[30]=d,e[31]=h,e[32]=c,e[33]=u):u=e[33],u}function ps(m){const e=E.c(21),{cards:t,onChange:n}=m,s=D();let r,o,a,f,d;if(e[0]!==t||e[1]!==n||e[2]!==s){o=ne(t);let b;e[8]!==n?(b=c=>n(JSON.stringify(c)),e[8]=n,e[9]=b):b=e[9],r=b;const i=(c,u)=>r(o.map((x,y)=>y===c?{...x,...u}:x));d="space-y-2",a="grid grid-cols-1 gap-3 sm:grid-cols-3",f=o.slice(0,3).map((c,u)=>l.jsxs("div",{className:"group/item relative flex flex-col gap-2 rounded-lg border bg-card p-4",children:[l.jsx("div",{className:"absolute right-1 top-1",children:l.jsx(te,{label:s("sandbox.listBlocks.removeCard"),onClick:()=>r(o.filter((x,y)=>y!==u))})}),l.jsx("input",{value:L(c.icon),onChange:x=>i(u,{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"}),l.jsx("input",{value:L(c.title),onChange:x=>i(u,{title:x.target.value}),placeholder:s("sandbox.listBlocks.cardTitle"),className:"border-0 bg-transparent p-0 text-[15px] font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),l.jsx(X,{value:L(c.body),onChange:x=>i(u,{body:x}),placeholder:s("sandbox.listBlocks.cardBody"),className:"text-sm text-muted-foreground"})]},u)),e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=o,e[5]=a,e[6]=f,e[7]=d}else r=e[3],o=e[4],a=e[5],f=e[6],d=e[7];let p;e[10]!==a||e[11]!==f?(p=l.jsx("div",{className:a,children:f}),e[10]=a,e[11]=f,e[12]=p):p=e[12];let g;e[13]!==r||e[14]!==o||e[15]!==s?(g=o.length<3&&l.jsx(se,{label:s("sandbox.listBlocks.addCard"),onClick:()=>r([...o,{title:"",body:""}])}),e[13]=r,e[14]=o,e[15]=s,e[16]=g):g=e[16];let h;return e[17]!==d||e[18]!==p||e[19]!==g?(h=l.jsxs("div",{className:d,children:[p,g]}),e[17]=d,e[18]=p,e[19]=g,e[20]=h):h=e[20],h}function xs(m){const e=E.c(36),{title:t,items:n,onChange:s}=m,r=D();let o,a,f,d,p;if(e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==t){a=ne(n);let u;e[9]!==s||e[10]!==t?(u=N=>s({title:t,items:JSON.stringify(N)}),e[9]=s,e[10]=t,e[11]=u):u=e[11],o=u,d="space-y-2";let x;e[12]!==n||e[13]!==s?(x=N=>s({title:N.target.value,items:n}),e[12]=n,e[13]=s,e[14]=x):x=e[14];let y;e[15]!==r?(y=r("sandbox.listBlocks.checklistTitle"),e[15]=r,e[16]=y):y=e[16],e[17]!==x||e[18]!==y||e[19]!==t?(p=l.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]=p):p=e[20],f=a.map((N,j)=>l.jsxs("li",{className:"group/item flex items-start gap-3 border-b border-border/50 py-2.5",children:[l.jsx("span",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center text-primary",children:l.jsx(Je,{size:15})}),l.jsx(X,{value:N,onChange:C=>o(a.map((k,v)=>v===j?C:k)),placeholder:r("sandbox.listBlocks.checklistItem"),className:"text-[15px] text-foreground"}),l.jsx(te,{label:r("sandbox.listBlocks.removeItem"),onClick:()=>o(a.filter((C,k)=>k!==j))})]},j)),e[0]=n,e[1]=s,e[2]=r,e[3]=t,e[4]=o,e[5]=a,e[6]=f,e[7]=d,e[8]=p}else o=e[4],a=e[5],f=e[6],d=e[7],p=e[8];let g;e[21]!==f?(g=l.jsx("ul",{children:f}),e[21]=f,e[22]=g):g=e[22];let h;e[23]!==r?(h=r("sandbox.listBlocks.addItem"),e[23]=r,e[24]=h):h=e[24];let b;e[25]!==o||e[26]!==a?(b=()=>o([...a,""]),e[25]=o,e[26]=a,e[27]=b):b=e[27];let i;e[28]!==h||e[29]!==b?(i=l.jsx(se,{label:h,onClick:b}),e[28]=h,e[29]=b,e[30]=i):i=e[30];let c;return e[31]!==d||e[32]!==p||e[33]!==g||e[34]!==i?(c=l.jsxs("div",{className:d,children:[p,g,i]}),e[31]=d,e[32]=p,e[33]=g,e[34]=i,e[35]=c):c=e[35],c}function gs(m){const e=E.c(21),{stats:t,onChange:n}=m,s=D();let r,o,a,f,d;if(e[0]!==n||e[1]!==t||e[2]!==s){o=ne(t);let b;e[8]!==n?(b=c=>n(JSON.stringify(c)),e[8]=n,e[9]=b):b=e[9],r=b;const i=(c,u)=>r(o.map((x,y)=>y===c?{...x,...u}:x));d="space-y-2",a="grid grid-cols-1 gap-3 sm:grid-cols-3",f=o.slice(0,3).map((c,u)=>l.jsxs("div",{className:"group/item relative rounded-lg border p-5 text-center",children:[l.jsx("div",{className:"absolute right-1 top-1",children:l.jsx(te,{label:s("sandbox.listBlocks.removeStat"),onClick:()=>r(o.filter((x,y)=>y!==u))})}),l.jsx("input",{value:L(c.value),onChange:x=>i(u,{value:x.target.value}),placeholder:s("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"}),l.jsx("input",{value:L(c.label),onChange:x=>i(u,{label:x.target.value}),placeholder:s("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"})]},u)),e[0]=n,e[1]=t,e[2]=s,e[3]=r,e[4]=o,e[5]=a,e[6]=f,e[7]=d}else r=e[3],o=e[4],a=e[5],f=e[6],d=e[7];let p;e[10]!==a||e[11]!==f?(p=l.jsx("div",{className:a,children:f}),e[10]=a,e[11]=f,e[12]=p):p=e[12];let g;e[13]!==r||e[14]!==o||e[15]!==s?(g=o.length<3&&l.jsx(se,{label:s("sandbox.listBlocks.addStat"),onClick:()=>r([...o,{value:"",label:""}])}),e[13]=r,e[14]=o,e[15]=s,e[16]=g):g=e[16];let h;return e[17]!==d||e[18]!==p||e[19]!==g?(h=l.jsxs("div",{className:d,children:[p,g]}),e[17]=d,e[18]=p,e[19]=g,e[20]=h):h=e[20],h}function hs(m){const e=E.c(38),{title:t,steps:n,onChange:s}=m,r=D();let o,a,f,d,p,g;if(e[0]!==s||e[1]!==n||e[2]!==r||e[3]!==t){a=ne(n);let x;e[10]!==s||e[11]!==t?(x=C=>s({title:t,steps:JSON.stringify(C)}),e[10]=s,e[11]=t,e[12]=x):x=e[12],o=x;const y=(C,k)=>o(a.map((v,B)=>B===C?{...v,...k}:v));p="space-y-2";let N;e[13]!==s||e[14]!==n?(N=C=>s({title:C.target.value,steps:n}),e[13]=s,e[14]=n,e[15]=N):N=e[15];let j;e[16]!==r?(j=r("sandbox.listBlocks.stepsTitle"),e[16]=r,e[17]=j):j=e[17],e[18]!==N||e[19]!==j||e[20]!==t?(g=l.jsx("input",{value:t,onChange:N,placeholder:j,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]=N,e[19]=j,e[20]=t,e[21]=g):g=e[21],f="space-y-3",d=a.map((C,k)=>l.jsxs("li",{className:"group/item flex gap-4",children:[l.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}),l.jsxs("div",{className:"min-w-0 flex-1 space-y-1 pt-0.5",children:[l.jsx("input",{value:L(C.title),onChange:v=>y(k,{title:v.target.value}),placeholder:r("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"}),l.jsx(X,{value:L(C.description),onChange:v=>y(k,{description:v}),placeholder:r("sandbox.listBlocks.stepDescription"),className:"text-sm text-muted-foreground"})]}),l.jsx(te,{label:r("sandbox.listBlocks.removeStep"),onClick:()=>o(a.filter((v,B)=>B!==k))})]},k)),e[0]=s,e[1]=n,e[2]=r,e[3]=t,e[4]=o,e[5]=a,e[6]=f,e[7]=d,e[8]=p,e[9]=g}else o=e[4],a=e[5],f=e[6],d=e[7],p=e[8],g=e[9];let h;e[22]!==f||e[23]!==d?(h=l.jsx("ol",{className:f,children:d}),e[22]=f,e[23]=d,e[24]=h):h=e[24];let b;e[25]!==r?(b=r("sandbox.listBlocks.addStep"),e[25]=r,e[26]=b):b=e[26];let i;e[27]!==o||e[28]!==a?(i=()=>o([...a,{title:"",description:""}]),e[27]=o,e[28]=a,e[29]=i):i=e[29];let c;e[30]!==b||e[31]!==i?(c=l.jsx(se,{label:b,onClick:i}),e[30]=b,e[31]=i,e[32]=c):c=e[32];let u;return e[33]!==p||e[34]!==g||e[35]!==h||e[36]!==c?(u=l.jsxs("div",{className:p,children:[g,h,c]}),e[33]=p,e[34]=g,e[35]=h,e[36]=c,e[37]=u):u=e[37],u}function Ie(m,e){try{const t=JSON.parse(m||"{}");return{title:typeof t?.title=="string"?t.title:e,items:Array.isArray(t?.items)?t.items:[]}}catch{return{title:e,items:[]}}}function bs({left:m,right:e,onChange:t}){const n=D(),s={left:Ie(m,n("sandbox.listBlocks.optionA")),right:Ie(e,n("sandbox.listBlocks.optionB"))},r=(a,f)=>t({left:a==="left"?JSON.stringify(f):m,right:a==="right"?JSON.stringify(f):e}),o=(a,f,d)=>{const p=D(),g=f.items??[];return l.jsxs("div",{className:"space-y-2 rounded-lg border p-4",children:[l.jsx("input",{value:L(f.title),onChange:h=>r(a,{...f,title:h.target.value}),placeholder:p("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"}),l.jsx("ul",{className:"space-y-1.5",children:g.map((h,b)=>l.jsxs("li",{className:"group/item flex items-start gap-2",children:[l.jsx("span",{"aria-hidden":!0,className:"mt-0.5 shrink-0 text-sm font-bold",style:{color:d},children:"✓"}),l.jsx(X,{value:h,onChange:i=>r(a,{...f,items:g.map((c,u)=>u===b?i:c)}),placeholder:p("sandbox.listBlocks.item"),className:"text-sm text-foreground"}),l.jsx(te,{label:p("sandbox.listBlocks.removeItem"),onClick:()=>r(a,{...f,items:g.filter((i,c)=>c!==b)})})]},b))}),l.jsx(se,{label:p("sandbox.listBlocks.addItem"),onClick:()=>r(a,{...f,items:[...g,""]})})]})};return l.jsxs("div",{className:Q("grid grid-cols-1 gap-3 sm:grid-cols-2"),children:[o("left",s.left,"oklch(0.65 0.17 150)"),o("right",s.right,"oklch(0.75 0.15 75)")]})}const ys="vtex/loaders/intelligentSearch/productList.ts";function ee(m){return m&&typeof m=="object"&&!Array.isArray(m)?m:null}function xe(m){return typeof m=="string"||typeof m=="number"?String(m):""}function ge(m){const e=ee(m);return!!e&&typeof e.__resolveType=="string"&&"productId"in e}function Qe(m){if(Array.isArray(m))return m.map(n=>xe(ee(n)?.productId));const e=ee(m),t=ee(e?.props);return t&&Array.isArray(t.ids)?t.ids.map(xe):e&&"productId"in e?[xe(e.productId)]:[]}function vs(m){const e=ee(m)??{};return typeof e.__resolveType=="string"?e.__resolveType:ys}function Xe(m,e){if(Array.isArray(m)){const r=m.find(ge);if(r)return e.map((o,a)=>{const f=ee(m[a]);return{...ge(f)?f:{__resolveType:r.__resolveType},productId:o}})}const t=ee(m);if(ge(t)&&!ee(t.props)?.ids)return{...t,productId:e[0]??""};const n=ee(t?.props)??{},s=vs(m);return{...t??{},__resolveType:s,props:{...n,ids:e,simulationBehavior:n.simulationBehavior??"default"}}}const Ze="vtex/loaders/intelligentSearch/productList.ts",js="vtex/loaders/categories/tree.ts",ks=24;function ae(m){return m&&typeof m=="object"&&!Array.isArray(m)?m:null}function Ns(m){return m.split("/").filter(Boolean).map((t,n)=>`category-${n+1}/${t}`).join("/")}function Cs(m,e){const t=e.trim();if(!t)return[];const n=Ze,s=ks;if(m==="cluster")return[{resolveType:n,props:{collection:t,count:s}}];if(m==="category"){const f=Ns(t);return f?[{resolveType:n,props:{facets:f,count:s}}]:[]}const r=[];/^\d+$/.test(t)&&r.push({resolveType:n,props:{ids:[t]}});const a=t.includes("-")&&!/\s/.test(t)?t.replace(/-+/g," "):t;return r.push({resolveType:n,props:{query:a,count:s}}),r}function Bs(){return{resolveType:js,props:{}}}function Ss(m){return{resolveType:Ze,props:{ids:m}}}function Le(m){return typeof m=="string"||typeof m=="number"?String(m):""}function et(m){const e=ae(m),t=Array.isArray(m)?m:Array.isArray(e?.products)?e.products:[],n=[],s=new Set;for(const r of t){const o=ae(r);if(!o)continue;const a=Le(o.productID)||Le(o.sku);if(!a||s.has(a))continue;s.add(a);const f=ae(o.isVariantOf),d=typeof f?.name=="string"&&f.name||typeof o.name=="string"&&o.name||a,p=Array.isArray(o.image)?ae(o.image[0]):null,g=typeof p?.url=="string"?p.url:void 0;n.push({id:a,label:d,image:g})}return n}function ws(m){if(typeof m!="string"||!m)return null;let e;try{e=new URL(m,"https://placeholder.invalid").pathname}catch{return null}return e.replace(/^\/+|\/+$/g,"")||null}function Ps(m){const e=[],t=new Set,n=(s,r)=>{const o=ae(s);if(!o)return;const a=typeof o.name=="string"&&o.name?o.name:"",f=a?[...r,a]:r,d=ws(o.url);if(d&&!t.has(d)&&(t.add(d),e.push({path:d,label:f.join(" › ")||d})),Array.isArray(o.children))for(const p of o.children)n(p,f)};if(Array.isArray(m))for(const s of m)n(s,[]);return e}function Ts(m,e,t=50){const n=e.trim().toLowerCase();return(n?m.filter(r=>r.label.toLowerCase().includes(n)||r.path.toLowerCase().includes(n)):m).slice(0,t)}const Is=1e4;async function Ce(m,{resolveType:e,props:t}){const n=await fetch(ft(m),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...t}),signal:AbortSignal.timeout(Is)});if(!n.ok)throw new Error(`Failed to fetch (${n.status})`);return n.json()}function tt(m,e){const t=E.c(20);let n;t[0]!==e?(n=new Set(e.filter(Boolean)),t[0]=e,t[1]=n):n=t[1];let s;t[2]!==n?(s=[...n],t[2]=n,t[3]=s):s=t[3];const r=s;let o;t[4]!==r||t[5]!==m?(o=ve.sandboxInvoke(m?`${m.orgSlug}/${m.virtualMcpId}/${m.branch}`:"none",`blog-products-by-ids:${r.join(",")}`),t[4]=r,t[5]=m,t[6]=o):o=t[6];let a;t[7]!==r||t[8]!==m?(a=()=>Ce(m,Ss(r)).then(et),t[7]=r,t[8]=m,t[9]=a):a=t[9];const f=!!m&&r.length>0;let d;t[10]!==o||t[11]!==a||t[12]!==f?(d={queryKey:o,queryFn:a,enabled:f,staleTime:6e4,retry:1},t[10]=o,t[11]=a,t[12]=f,t[13]=d):d=t[13];const p=je(d);let g;if(t[14]!==p.data){g=new Map;for(const b of p.data??[])g.set(b.id,b);t[14]=p.data,t[15]=g}else g=t[15];let h;return t[16]!==g||t[17]!==p.isError||t[18]!==p.isLoading?(h={byId:g,isLoading:p.isLoading,isError:p.isError},t[16]=g,t[17]=p.isError,t[18]=p.isLoading,t[19]=h):h=t[19],h}const Ls=[{id:"search",labelKey:"sandbox.productPickerDialog.modeSearch"},{id:"category",labelKey:"sandbox.productPickerDialog.modeCategory"},{id:"cluster",labelKey:"sandbox.productPickerDialog.modeClusterId"}];async function $s(m,e){if(e.length===0)return[];const t=await Promise.allSettled(e.map(o=>Ce(m,o))),n=t.filter(o=>o.status==="fulfilled").map(o=>o.value);if(n.length===0){const o=t.find(a=>a.status==="rejected");throw o?o.reason:new Error("Failed to fetch products")}const s=[],r=new Set;for(const o of n)for(const a of et(o))r.has(a.id)||(r.add(a.id),s.push(a));return s}function $e(m){const e=E.c(6),[t,n]=K.useState(""),[s,r]=K.useState(""),o=K.useRef(null);let a;e[0]!==m?(a=p=>{n(p),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>r(p),m)},e[0]=m,e[1]=a):a=e[1];const f=a;let d;return e[2]!==s||e[3]!==f||e[4]!==t?(d={value:t,debounced:s,onChange:f},e[2]=s,e[3]=f,e[4]=t,e[5]=d):d=e[5],d}function As(m){const e=E.c(23),{option:t,selected:n,onToggle:s}=m,r=n?"border-primary/40 bg-primary/5":"border-transparent hover:bg-muted/60";let o;e[0]!==r?(o=Q("flex w-full items-center gap-3 rounded-md border px-2 py-2 text-left transition-colors",r),e[0]=r,e[1]=o):o=e[1];let a;e[2]!==t.image?(a=l.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?l.jsx("img",{src:t.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):l.jsx(ke,{size:14,className:"text-muted-foreground"})}),e[2]=t.image,e[3]=a):a=e[3];let f;e[4]!==t.label?(f=l.jsx("span",{className:"line-clamp-2 text-sm",children:t.label}),e[4]=t.label,e[5]=f):f=e[5];let d;e[6]!==t.id?(d=l.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:["ID ",t.id]}),e[6]=t.id,e[7]=d):d=e[7];let p;e[8]!==f||e[9]!==d?(p=l.jsxs("span",{className:"min-w-0 flex-1",children:[f,d]}),e[8]=f,e[9]=d,e[10]=p):p=e[10];const g=n?"border-primary bg-primary text-primary-foreground":"border-border text-transparent";let h;e[11]!==g?(h=Q("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=l.jsx(Je,{size:12}),e[13]=b):b=e[13];let i;e[14]!==h?(i=l.jsx("span",{className:h,children:b}),e[14]=h,e[15]=i):i=e[15];let c;return e[16]!==s||e[17]!==n||e[18]!==i||e[19]!==o||e[20]!==a||e[21]!==p?(c=l.jsxs("button",{type:"button",onClick:s,"aria-pressed":n,className:o,children:[a,p,i]}),e[16]=s,e[17]=n,e[18]=i,e[19]=o,e[20]=a,e[21]=p,e[22]=c):c=e[22],c}function st(m){const e=E.c(9),{query:t,emptyLabel:n,loadingLabel:s}=m,r=D();if(t.isLoading){let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsx(Ye,{size:"xs"}),e[0]=a):a=e[0];let f;return e[1]!==s?(f=l.jsxs("div",{className:"flex items-center gap-2 px-2 py-6 text-sm text-muted-foreground",children:[a,s]}),e[1]=s,e[2]=f):f=e[2],f}if(t.isError){let a;e[3]!==r?(a=r("sandbox.productPickerDialog.couldNotLoad"),e[3]=r,e[4]=a):a=e[4];let f;return e[5]!==a?(f=l.jsx("p",{className:"px-2 py-6 text-sm text-muted-foreground",children:a}),e[5]=a,e[6]=f):f=e[6],f}let o;return e[7]!==n?(o=l.jsx("p",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:n}),e[7]=n,e[8]=o):o=e[8],o}function lt(m){return`${m.orgSlug}/${m.virtualMcpId}/${m.branch}`}function _s(m){const e=E.c(45),{sandboxRef:t,open:n,selected:s,onSelect:r}=m,o=D(),[a,f]=K.useState("");let d;e[0]!==t?(d=ve.sandboxInvoke(lt(t),"blog-category-tree"),e[0]=t,e[1]=d):d=e[1];let p;e[2]!==t?(p=()=>Ce(t,Bs()).then(Ps),e[2]=t,e[3]=p):p=e[3];const g=n&&!s;let h;e[4]!==d||e[5]!==p||e[6]!==g?(h={queryKey:d,queryFn:p,enabled:g,staleTime:6e4,retry:1},e[4]=d,e[5]=p,e[6]=g,e[7]=h):h=e[7];const b=je(h);if(s){let j;e[8]!==r?(j=()=>r(null),e[8]=r,e[9]=j):j=e[9];let C;e[10]===Symbol.for("react.memo_cache_sentinel")?(C=l.jsx(Bt,{size:14}),e[10]=C):C=e[10];let k;e[11]!==o?(k=o("sandbox.productPickerDialog.categoryLabel"),e[11]=o,e[12]=k):k=e[12];let v;e[13]!==s.label?(v=l.jsx("span",{className:"text-foreground",children:s.label}),e[13]=s.label,e[14]=v):v=e[14];let B;e[15]!==o?(B=o("sandbox.productPickerDialog.change"),e[15]=o,e[16]=B):B=e[16];let S;e[17]!==k||e[18]!==v||e[19]!==B?(S=l.jsxs("span",{className:"truncate",children:[k,v," —",B]}),e[17]=k,e[18]=v,e[19]=B,e[20]=S):S=e[20];let w;return e[21]!==S||e[22]!==j?(w=l.jsxs("button",{type:"button",onClick:j,className:"flex items-center gap-1.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[C,S]}),e[21]=S,e[22]=j,e[23]=w):w=e[23],w}let i,c,u,x;if(e[24]!==a||e[25]!==r||e[26]!==b||e[27]!==o){const j=Ts(b.data??[],a);u="space-y-2";let C;e[32]===Symbol.for("react.memo_cache_sentinel")?(C=v=>f(v.target.value),e[32]=C):C=e[32];let k;e[33]!==o?(k=o("sandbox.productPickerDialog.filterCategoriesPlaceholder"),e[33]=o,e[34]=k):k=e[34],e[35]!==a||e[36]!==k?(x=l.jsx(be,{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",c=j.length===0?l.jsx(st,{query:b,loadingLabel:o("sandbox.productPickerDialog.loadingCategories"),emptyLabel:o("sandbox.productPickerDialog.noCategories")}):l.jsx("div",{className:"p-1",children:j.map(v=>l.jsx("button",{type:"button",onClick:()=>r(v),className:"block w-full truncate rounded px-2 py-1.5 text-left text-sm hover:bg-muted/60",children:v.label},v.path))}),e[24]=a,e[25]=r,e[26]=b,e[27]=o,e[28]=i,e[29]=c,e[30]=u,e[31]=x}else i=e[28],c=e[29],u=e[30],x=e[31];let y;e[38]!==i||e[39]!==c?(y=l.jsx("div",{className:i,children:c}),e[38]=i,e[39]=c,e[40]=y):y=e[40];let N;return e[41]!==u||e[42]!==x||e[43]!==y?(N=l.jsxs("div",{className:u,children:[x,y]}),e[41]=u,e[42]=x,e[43]=y,e[44]=N):N=e[44],N}function ot(m){const e=E.c(89),{open:t,onOpenChange:n,sandboxRef:s,selectedIds:r,onChange:o,multiple:a}=m,f=a===void 0?!0:a,d=D(),[p,g]=K.useState("search"),h=$e(300),b=$e(300),[i,c]=K.useState(null),u=p==="search"?h.debounced:p==="cluster"?b.debounced:i?.path??"";let x;e[0]!==p||e[1]!==u?(x=Cs(p,u),e[0]=p,e[1]=u,e[2]=x):x=e[2];const y=x;let N;e[3]!==p||e[4]!==s||e[5]!==u?(N=ve.sandboxInvoke(lt(s),`blog-product:${p}:${u}`),e[3]=p,e[4]=s,e[5]=u,e[6]=N):N=e[6];let j;e[7]!==y||e[8]!==s?(j=()=>$s(s,y),e[7]=y,e[8]=s,e[9]=j):j=e[9];const C=t&&y.length>0;let k;e[10]!==N||e[11]!==j||e[12]!==C?(k={queryKey:N,queryFn:j,enabled:C,staleTime:6e4,retry:1},e[10]=N,e[11]=j,e[12]=C,e[13]=k):k=e[13];const v=je(k);let B;e[14]!==r?(B=new Set(r.filter(Boolean)),e[14]=r,e[15]=B):B=e[15];const S=B;let w;e[16]!==f||e[17]!==o||e[18]!==S||e[19]!==r?(w=G=>{if(!f){o(S.has(G)?[]:[G]);return}S.has(G)?o(r.filter(at=>at!==G)):o([...r.filter(Boolean),G])},e[16]=f,e[17]=o,e[18]=S,e[19]=r,e[20]=w):w=e[20];const I=w;let $;e[21]!==v.data?($=v.data??[],e[21]=v.data,e[22]=$):$=e[22];const P=$,_=y.length===0;let U;e[23]!==f||e[24]!==d?(U=d(f?"sandbox.productPickerDialog.addProducts":"sandbox.productPickerDialog.chooseProduct"),e[23]=f,e[24]=d,e[25]=U):U=e[25];let F;e[26]!==U?(F=l.jsx(qt,{className:"border-b border-border px-4 py-3",children:l.jsx(Ht,{className:"text-sm font-medium",children:U})}),e[26]=U,e[27]=F):F=e[27];let H;e[28]!==p||e[29]!==d?(H=Ls.map(G=>l.jsx("button",{type:"button",onClick:()=>g(G.id),className:Q("rounded-md px-2.5 py-1 text-sm transition-colors",p===G.id?"bg-muted font-medium text-foreground":"text-muted-foreground hover:text-foreground"),children:d(G.labelKey)},G.id)),e[28]=p,e[29]=d,e[30]=H):H=e[30];let V;e[31]!==H?(V=l.jsx("div",{className:"flex shrink-0 items-center gap-1 border-b border-border px-4 py-2",children:H}),e[31]=H,e[32]=V):V=e[32];let A;e[33]!==p||e[34]!==h||e[35]!==d?(A=p==="search"&&l.jsx(be,{autoFocus:!0,value:h.value,onChange:G=>h.onChange(G.target.value),placeholder:d("sandbox.productPickerDialog.searchProductsPlaceholder"),className:"h-9"}),e[33]=p,e[34]=h,e[35]=d,e[36]=A):A=e[36];let T;e[37]!==b||e[38]!==p||e[39]!==d?(T=p==="cluster"&&l.jsx(be,{autoFocus:!0,value:b.value,onChange:G=>b.onChange(G.target.value),placeholder:d("sandbox.productPickerDialog.clusterIdPlaceholder"),className:"h-9"}),e[37]=b,e[38]=p,e[39]=d,e[40]=T):T=e[40];let R;e[41]!==i||e[42]!==p||e[43]!==t||e[44]!==s?(R=p==="category"&&l.jsx(_s,{sandboxRef:s,open:t,selected:i,onSelect:c}),e[41]=i,e[42]=p,e[43]=t,e[44]=s,e[45]=R):R=e[45];let O;e[46]!==A||e[47]!==T||e[48]!==R?(O=l.jsxs("div",{className:"shrink-0 space-y-2 px-4 py-3",children:[A,T,R]}),e[46]=A,e[47]=T,e[48]=R,e[49]=O):O=e[49];let J;e[50]!==P||e[51]!==v||e[52]!==S||e[53]!==_||e[54]!==d||e[55]!==I?(J=P.length>0?P.map(G=>l.jsx(As,{option:G,selected:S.has(G.id),onToggle:()=>I(G.id)},G.id)):!_&&l.jsx(st,{query:v,loadingLabel:d("sandbox.productPickerDialog.loadingProducts"),emptyLabel:d("sandbox.productPickerDialog.noProductsFound")}),e[50]=P,e[51]=v,e[52]=S,e[53]=_,e[54]=d,e[55]=I,e[56]=J):J=e[56];let z;e[57]!==p||e[58]!==_||e[59]!==d?(z=_&&l.jsx("p",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:d(p==="category"?"sandbox.productPickerDialog.pickCategoryPrompt":p==="cluster"?"sandbox.productPickerDialog.enterClusterPrompt":"sandbox.productPickerDialog.typeToSearchPrompt")}),e[57]=p,e[58]=_,e[59]=d,e[60]=z):z=e[60];let M;e[61]!==J||e[62]!==z?(M=l.jsxs("div",{className:"min-h-0 flex-1 space-y-1 overflow-y-auto border-t border-border px-3 py-2",children:[J,z]}),e[61]=J,e[62]=z,e[63]=M):M=e[63];let q;e[64]!==S.size||e[65]!==d?(q=S.size===0?d("sandbox.productPickerDialog.noneSelected"):d("sandbox.productPickerDialog.selectedCount",{count:String(S.size)}),e[64]=S.size,e[65]=d,e[66]=q):q=e[66];let Y;e[67]!==q?(Y=l.jsx("span",{className:"text-xs text-muted-foreground",children:q}),e[67]=q,e[68]=Y):Y=e[68];let Z;e[69]!==n?(Z=()=>n(!1),e[69]=n,e[70]=Z):Z=e[70];let W;e[71]!==d?(W=d("sandbox.productPickerDialog.done"),e[71]=d,e[72]=W):W=e[72];let le;e[73]!==Z||e[74]!==W?(le=l.jsx(it,{size:"sm",onClick:Z,children:W}),e[73]=Z,e[74]=W,e[75]=le):le=e[75];let oe;e[76]!==Y||e[77]!==le?(oe=l.jsxs("div",{className:"flex shrink-0 items-center justify-between border-t border-border px-4 py-3",children:[Y,le]}),e[76]=Y,e[77]=le,e[78]=oe):oe=e[78];let re;e[79]!==F||e[80]!==V||e[81]!==O||e[82]!==M||e[83]!==oe?(re=l.jsxs(Vt,{className:"flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[560px] sm:max-w-[560px]",children:[F,V,O,M,oe]}),e[79]=F,e[80]=V,e[81]=O,e[82]=M,e[83]=oe,e[84]=re):re=e[84];let ce;return e[85]!==n||e[86]!==t||e[87]!==re?(ce=l.jsx(Mt,{open:t,onOpenChange:n,children:re}),e[85]=n,e[86]=t,e[87]=re,e[88]=ce):ce=e[88],ce}const Es=["normal","h1","h2","h3"],Ds=/^<(h[1-3])>([\s\S]*)<\/\1>$/i;function Rs(m){const e=m.match(Ds);return e?{level:e[1].toLowerCase(),text:e[2]}:{level:"normal",text:m}}function Ae(m,e){return e?m==="normal"?e:`<${m}>${e}</${m}>`:""}const _e={normal:"sandbox.productBlocks.headingNormal",h1:"sandbox.productBlocks.headingH1",h2:"sandbox.productBlocks.headingH2",h3:"sandbox.productBlocks.headingH3"},Os={normal:"text-lg font-semibold",h1:"text-3xl font-bold",h2:"text-2xl font-bold",h3:"text-xl font-semibold"};function zs(m){const e=E.c(27),{value:t,onChange:n}=m,s=D();let r,o,a,f,d;e[0]!==n||e[1]!==s||e[2]!==t?({level:r,text:d}=Rs(t),f="space-y-1.5",o="flex items-center gap-0.5",a=Es.map(x=>l.jsx(ie,{active:r===x,label:s(_e[x]),onClick:()=>n(Ae(x,d)),children:s(_e[x])},x)),e[0]=n,e[1]=s,e[2]=t,e[3]=r,e[4]=o,e[5]=a,e[6]=f,e[7]=d):(r=e[3],o=e[4],a=e[5],f=e[6],d=e[7]);let p;e[8]!==o||e[9]!==a?(p=l.jsx("div",{className:o,children:a}),e[8]=o,e[9]=a,e[10]=p):p=e[10];let g;e[11]!==r||e[12]!==n?(g=x=>n(Ae(r,x.target.value)),e[11]=r,e[12]=n,e[13]=g):g=e[13];let h;e[14]!==s?(h=s("sandbox.productBlocks.shelfTitlePlaceholder"),e[14]=s,e[15]=h):h=e[15];const b=Os[r];let i;e[16]!==b?(i=Q("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 c;e[18]!==g||e[19]!==h||e[20]!==i||e[21]!==d?(c=l.jsx("input",{value:d,onChange:g,placeholder:h,className:i}),e[18]=g,e[19]=h,e[20]=i,e[21]=d,e[22]=c):c=e[22];let u;return e[23]!==f||e[24]!==p||e[25]!==c?(u=l.jsxs("div",{className:f,children:[p,c]}),e[23]=f,e[24]=p,e[25]=c,e[26]=u):u=e[26],u}function rt(m){const e=E.c(4),{label:t,onClick:n}=m;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx(ke,{size:13}),e[0]=s):s=e[0];let r;return e[1]!==t||e[2]!==n?(r=l.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground cursor-pointer",children:[s,t]}),e[1]=t,e[2]=n,e[3]=r):r=e[3],r}function nt(m){const e=E.c(9),{option:t,loading:n,className:s,iconSize:r}=m,o=r===void 0?18:r;let a;e[0]!==s?(a=Q("flex items-center justify-center overflow-hidden bg-muted text-muted-foreground",s),e[0]=s,e[1]=a):a=e[1];let f;e[2]!==o||e[3]!==n||e[4]!==t?(f=t?.image?l.jsx("img",{src:t.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-contain p-1.5"}):n?l.jsx(Ye,{size:"xs"}):l.jsx(zt,{size:o}),e[2]=o,e[3]=n,e[4]=t,e[5]=f):f=e[5];let d;return e[6]!==a||e[7]!==f?(d=l.jsx("span",{className:a,children:f}),e[6]=a,e[7]=f,e[8]=d):d=e[8],d}function Fs({id:m,option:e,loading:t,onRemove:n}){const{attributes:s,listeners:r,setNodeRef:o,transform:a,transition:f,isDragging:d}=Ve({id:m});return l.jsxs("div",{ref:o,style:{transform:Me.Transform.toString(a),transition:f},className:Q("group/card relative flex flex-col overflow-hidden rounded-md border bg-background",d&&"z-10 opacity-60"),children:[l.jsxs("div",{className:"relative aspect-square",children:[l.jsx(nt,{option:e,loading:t,className:"h-full w-full"}),l.jsx("button",{type:"button","aria-label":D()("sandbox.productBlocks.dragToReorderLabel"),...s,...r,className:"absolute left-1 top-1 flex h-6 w-6 cursor-grab items-center justify-center 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",children:l.jsx(Ke,{size:13})}),l.jsx("button",{type:"button","aria-label":D()("sandbox.productBlocks.removeProductLabel"),onClick:n,className:"absolute right-1 top-1 flex h-6 w-6 items-center justify-center rounded bg-background/80 text-muted-foreground opacity-0 backdrop-blur-sm transition-opacity hover:text-destructive group-hover/card:opacity-100 cursor-pointer",children:l.jsx(Ut,{size:13})})]}),l.jsxs("div",{className:"flex flex-col gap-0.5 p-2",children:[l.jsx("p",{className:"line-clamp-2 text-xs leading-tight text-foreground",children:e?.label??(t?D()("sandbox.productBlocks.loadingEllipsis"):D()("sandbox.productBlocks.productWithId",{id:m}))}),l.jsx("p",{className:"text-[11px] text-muted-foreground",children:D()("sandbox.productBlocks.idLabel",{id:m})})]})]})}function Us(m){const e=E.c(21),{ids:t,lookup:n,onReorder:s,onRemove:r}=m;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={activationConstraint:{distance:6}},e[0]=o):o=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={coordinateGetter:ze},e[1]=a):a=e[1];const f=De(ue(Oe,o),ue(Re,a));let d;e[2]!==t||e[3]!==s?(d=c=>{const{active:u,over:x}=c;if(!x||u.id===x.id)return;const y=t.indexOf(String(u.id)),N=t.indexOf(String(x.id));y===-1||N===-1||s(Fe(t,y,N))},e[2]=t,e[3]=s,e[4]=d):d=e[4];const p=d;let g;if(e[5]!==t||e[6]!==n||e[7]!==r){let c;e[9]!==n||e[10]!==r?(c=u=>l.jsx(Fs,{id:u,option:n.byId.get(u),loading:n.isLoading&&!n.byId.get(u),onRemove:()=>r(u)},u),e[9]=n,e[10]=r,e[11]=c):c=e[11],g=t.map(c),e[5]=t,e[6]=n,e[7]=r,e[8]=g}else g=e[8];let h;e[12]!==g?(h=l.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=l.jsx(Ue,{items:t,strategy:mt,children:h}),e[14]=t,e[15]=h,e[16]=b):b=e[16];let i;return e[17]!==p||e[18]!==f||e[19]!==b?(i=l.jsx(qe,{sensors:f,collisionDetection:He,onDragEnd:p,children:b}),e[17]=p,e[18]=f,e[19]=b,e[20]=i):i=e[20],i}function qs(m){const e=E.c(13),{onBrowse:t}=m,n=D();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx("span",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-muted text-muted-foreground",children:l.jsx(Ft,{size:16})}),e[0]=s):s=e[0];let r;e[1]!==n?(r=n("sandbox.productBlocks.addProductsButton"),e[1]=n,e[2]=r):r=e[2];let o;e[3]!==r?(o=l.jsx("span",{className:"text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=o):o=e[4];let a;e[5]!==n?(a=n("sandbox.productBlocks.addProductsDescription"),e[5]=n,e[6]=a):a=e[6];let f;e[7]!==a?(f=l.jsx("span",{className:"text-xs text-muted-foreground",children:a}),e[7]=a,e[8]=f):f=e[8];let d;return e[9]!==t||e[10]!==o||e[11]!==f?(d=l.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:[s,o,f]}),e[9]=t,e[10]=o,e[11]=f,e[12]=d):d=e[12],d}function Hs(m){const e=E.c(30),{ids:t,onChange:n}=m,s=D();let r;e[0]!==t||e[1]!==n?(r=(u,x)=>n(t.map((y,N)=>N===u?x:y)),e[0]=t,e[1]=n,e[2]=r):r=e[2];const o=r;let a;e[3]!==s?(a=s("sandbox.productBlocks.vtexProductIds"),e[3]=s,e[4]=a):a=e[4];let f;e[5]!==a?(f=l.jsx(de,{className:"text-xs text-muted-foreground",children:a}),e[5]=a,e[6]=f):f=e[6];let d;e[7]!==t.length||e[8]!==s?(d=t.length===0&&l.jsx("p",{className:"text-xs text-muted-foreground",children:s("sandbox.productBlocks.startDevServerDescription")}),e[7]=t.length,e[8]=s,e[9]=d):d=e[9];let p;e[10]!==t||e[11]!==n||e[12]!==o||e[13]!==s?(p=t.map((u,x)=>l.jsxs("li",{className:"group/item flex items-center gap-3",children:[l.jsx("input",{value:u,onChange:y=>o(x,y.target.value),placeholder:s("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"}),l.jsx(te,{label:s("sandbox.productBlocks.removeProductIdButton"),onClick:()=>n(t.filter((y,N)=>N!==x))})]},x)),e[10]=t,e[11]=n,e[12]=o,e[13]=s,e[14]=p):p=e[14];let g;e[15]!==p?(g=l.jsx("ul",{className:"space-y-2",children:p}),e[15]=p,e[16]=g):g=e[16];let h;e[17]!==s?(h=s("sandbox.productBlocks.addProductIdButton"),e[17]=s,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=l.jsx(se,{label:h,onClick:b}),e[22]=h,e[23]=b,e[24]=i):i=e[24];let c;return e[25]!==f||e[26]!==d||e[27]!==g||e[28]!==i?(c=l.jsxs("div",{className:"space-y-2",children:[f,d,g,i]}),e[25]=f,e[26]=d,e[27]=g,e[28]=i,e[29]=c):c=e[29],c}function Vs({block:m,onChange:e,sandboxRef:t}){const n=Qe(m.products),s=[...new Set(n.filter(Boolean))],[r,o]=K.useState(!1),a=tt(t,s),f=d=>e({...m,products:Xe(m.products,d)});return l.jsxs("div",{className:"space-y-4 rounded-lg border bg-card p-4",children:[l.jsx(zs,{value:L(m.title),onChange:d=>e({...m,title:d})}),t?l.jsxs("div",{className:"space-y-3",children:[s.length>0&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-xs font-medium text-muted-foreground",children:[s.length," ",D()(s.length===1?"sandbox.productBlocks.productSingular":"sandbox.productBlocks.productPlural")]}),l.jsx(rt,{label:D()("sandbox.productBlocks.browseProductsButton"),onClick:()=>o(!0)})]}),s.length===0?l.jsx(qs,{onBrowse:()=>o(!0)}):l.jsx(Us,{ids:s,lookup:a,onReorder:f,onRemove:d=>f(s.filter(p=>p!==d))})]}):l.jsx(Hs,{ids:n,onChange:f}),t&&l.jsx(ot,{open:r,onOpenChange:o,sandboxRef:t,selectedIds:s,onChange:f})]})}function Ms(m){const e=E.c(27),{id:t,option:n,loading:s,onRemove:r}=m,o=D();let a;e[0]!==s||e[1]!==n?(a=l.jsx(nt,{option:n,loading:s,className:"h-11 w-11 shrink-0 rounded",iconSize:16}),e[0]=s,e[1]=n,e[2]=a):a=e[2];let f;e[3]!==t||e[4]!==s||e[5]!==n?.label||e[6]!==o?(f=n?.label??(s?o("sandbox.productBlocks.loadingEllipsis"):o("sandbox.productBlocks.productWithId",{id:t})),e[3]=t,e[4]=s,e[5]=n?.label,e[6]=o,e[7]=f):f=e[7];let d;e[8]!==f?(d=l.jsx("p",{className:"truncate text-sm text-foreground",children:f}),e[8]=f,e[9]=d):d=e[9];let p;e[10]!==t||e[11]!==o?(p=o("sandbox.productBlocks.idLabel",{id:t}),e[10]=t,e[11]=o,e[12]=p):p=e[12];let g;e[13]!==p?(g=l.jsx("p",{className:"text-xs text-muted-foreground",children:p}),e[13]=p,e[14]=g):g=e[14];let h;e[15]!==d||e[16]!==g?(h=l.jsxs("div",{className:"min-w-0 flex-1",children:[d,g]}),e[15]=d,e[16]=g,e[17]=h):h=e[17];let b;e[18]!==o?(b=o("sandbox.productBlocks.removeProductButton"),e[18]=o,e[19]=b):b=e[19];let i;e[20]!==r||e[21]!==b?(i=l.jsx(te,{label:b,onClick:r}),e[20]=r,e[21]=b,e[22]=i):i=e[22];let c;return e[23]!==a||e[24]!==h||e[25]!==i?(c=l.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]=c):c=e[26],c}function Gs(m){const e=E.c(78),{block:t,onChange:n,sandboxRef:s}=m,r=D();let o;e[0]!==t.product?(o=Qe(t.product).filter(Boolean)[0]??"",e[0]=t.product,e[1]=o):o=e[1];const a=o,[f,d]=K.useState(!1);let p;e[2]!==a?(p=a?[a]:[],e[2]=a,e[3]=p):p=e[3];const g=tt(s,p);let h;e[4]!==t||e[5]!==n?(h=O=>n({...t,product:Xe(t.product,O)}),e[4]=t,e[5]=n,e[6]=h):h=e[6];const b=h;let i;e[7]!==r?(i=r("sandbox.productBlocks.productCardLabel"),e[7]=r,e[8]=i):i=e[8];let c;e[9]!==i?(c=l.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:i}),e[9]=i,e[10]=c):c=e[10];let u;e[11]!==r?(u=r("sandbox.productBlocks.ctaLabelField"),e[11]=r,e[12]=u):u=e[12];let x;e[13]!==u?(x=l.jsx(de,{htmlFor:"product-card-cta",className:"text-xs text-muted-foreground",children:u}),e[13]=u,e[14]=x):x=e[14];let y;e[15]!==t.textCta?(y=L(t.textCta),e[15]=t.textCta,e[16]=y):y=e[16];let N;e[17]!==t||e[18]!==n?(N=O=>n({...t,textCta:O.target.value}),e[17]=t,e[18]=n,e[19]=N):N=e[19];let j;e[20]!==r?(j=r("sandbox.productBlocks.ctaLabelPlaceholder"),e[20]=r,e[21]=j):j=e[21];let C;e[22]!==j||e[23]!==y||e[24]!==N?(C=l.jsx("input",{id:"product-card-cta",value:y,onChange:N,placeholder:j,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]=j,e[23]=y,e[24]=N,e[25]=C):C=e[25];let k;e[26]!==C||e[27]!==x?(k=l.jsxs("div",{className:"space-y-2",children:[x,C]}),e[26]=C,e[27]=x,e[28]=k):k=e[28];let v;e[29]!==r?(v=r("sandbox.productBlocks.productSlugField"),e[29]=r,e[30]=v):v=e[30];let B;e[31]!==v?(B=l.jsx(de,{htmlFor:"product-card-slug",className:"text-xs text-muted-foreground",children:v}),e[31]=v,e[32]=B):B=e[32];let S;e[33]!==t.productSlug?(S=L(t.productSlug),e[33]=t.productSlug,e[34]=S):S=e[34];let w;e[35]!==t||e[36]!==n?(w=O=>n({...t,productSlug:O.target.value}),e[35]=t,e[36]=n,e[37]=w):w=e[37];let I;e[38]!==r?(I=r("sandbox.productBlocks.productSlugPlaceholder"),e[38]=r,e[39]=I):I=e[39];let $;e[40]!==S||e[41]!==w||e[42]!==I?($=l.jsx("input",{id:"product-card-slug",value:S,onChange:w,placeholder:I,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]=S,e[41]=w,e[42]=I,e[43]=$):$=e[43];let P;e[44]!==B||e[45]!==$?(P=l.jsxs("div",{className:"space-y-2",children:[B,$]}),e[44]=B,e[45]=$,e[46]=P):P=e[46];let _;e[47]!==r?(_=r("sandbox.productBlocks.productField"),e[47]=r,e[48]=_):_=e[48];let U;e[49]!==_?(U=l.jsx(de,{className:"text-xs text-muted-foreground",children:_}),e[49]=_,e[50]=U):U=e[50];let F;e[51]!==a||e[52]!==s||e[53]!==r?(F=s&&a&&l.jsx(rt,{label:r("sandbox.productBlocks.changeButton"),onClick:()=>d(!0)}),e[51]=a,e[52]=s,e[53]=r,e[54]=F):F=e[54];let H;e[55]!==U||e[56]!==F?(H=l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[U,F]}),e[55]=U,e[56]=F,e[57]=H):H=e[57];let V;e[58]!==g||e[59]!==a||e[60]!==s||e[61]!==b||e[62]!==r?(V=s?a?l.jsx(Ms,{id:a,option:g.byId.get(a),loading:g.isLoading,onRemove:()=>b([])}):l.jsxs("button",{type:"button",onClick:()=>d(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-md border border-dashed py-3 text-sm text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground cursor-pointer",children:[l.jsx(ke,{size:14}),r("sandbox.productBlocks.chooseProductButton")]}):l.jsx("input",{value:a,onChange:O=>b(O.target.value?[O.target.value]:[]),placeholder:r("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]=s,e[61]=b,e[62]=r,e[63]=V):V=e[63];let A;e[64]!==H||e[65]!==V?(A=l.jsxs("div",{className:"space-y-2",children:[H,V]}),e[64]=H,e[65]=V,e[66]=A):A=e[66];let T;e[67]!==f||e[68]!==a||e[69]!==s||e[70]!==b?(T=s&&l.jsx(ot,{open:f,onOpenChange:d,sandboxRef:s,selectedIds:a?[a]:[],onChange:b,multiple:!1}),e[67]=f,e[68]=a,e[69]=s,e[70]=b,e[71]=T):T=e[71];let R;return e[72]!==k||e[73]!==P||e[74]!==A||e[75]!==T||e[76]!==c?(R=l.jsxs("div",{className:"space-y-4 rounded-lg border bg-card p-4",children:[c,k,P,A,T]}),e[72]=k,e[73]=P,e[74]=A,e[75]=T,e[76]=c,e[77]=R):R=e[77],R}const Ks=2,Js=2;function Ys(m){return ne(m).map(L)}function Ws(m){return ne(m).map(e=>Array.isArray(e)?e.map(L):[])}function Ee(m){return Array.from({length:m},()=>"")}function Qs(m){const e=E.c(42),{headers:t,rows:n,onChange:s}=m;let r,o,a,f,d,p,g,h,b;if(e[0]!==t||e[1]!==s||e[2]!==n){const v=Ys(t),B=Ws(n),S=v.length===0&&B.length===0;a=S?Ks:Math.max(v.length,...B.map(el),1);const w=Array.from({length:a},(A,T)=>v[T]??"");f=S?Array.from({length:Js},()=>Ee(a)):B.map(A=>Array.from({length:a},(T,R)=>A[R]??""));let I;e[12]!==s?(I=(A,T)=>s({headers:JSON.stringify(A.some(Zs)?A:[]),rows:JSON.stringify(T)}),e[12]=s,e[13]=I):I=e[13];const $=I,P=(A,T)=>$(w.map((R,O)=>O===A?T:R),f),_=(A,T,R)=>$(w,f.map((O,J)=>J===A?O.map((z,M)=>M===T?R:z):O));o=()=>$(w,[...f,Ee(a)]);const U=A=>$(w,f.filter((T,R)=>R!==A));r=()=>$([...w,""],f.map(Xs));const F=A=>$(w.filter((T,R)=>R!==A),f.map(T=>T.filter((R,O)=>O!==A)));b="space-y-2",h="overflow-x-auto rounded-lg border",p="w-full border-collapse";let H;e[14]===Symbol.for("react.memo_cache_sentinel")?(H=l.jsx("th",{className:"w-8 border-b"}),e[14]=H):H=e[14];const V=l.jsxs("tr",{className:"bg-muted/40",children:[w.map((A,T)=>l.jsxs("th",{className:"group/col relative border-b border-r p-0 last:border-r-0",children:[l.jsx("input",{value:A,onChange:R=>P(T,R.target.value),placeholder:`Header ${T+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"}),a>1&&l.jsx("button",{type:"button","aria-label":`Remove column ${T+1}`,onClick:()=>F(T),className:"absolute left-0.5 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded text-muted-foreground/50 opacity-0 transition-opacity hover:text-destructive group-hover/col:opacity-100 cursor-pointer",children:l.jsx(he,{size:12})})]},T)),H]});e[15]!==V?(g=l.jsx("thead",{children:V}),e[15]=V,e[16]=g):g=e[16],d=f.map((A,T)=>l.jsxs("tr",{className:"group/item border-b last:border-b-0",children:[A.map((R,O)=>l.jsx("td",{className:"border-r p-0 last:border-r-0",children:l.jsx("input",{value:R,onChange:J=>_(T,O,J.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"})},O)),l.jsx("td",{className:"w-8 text-center align-middle",children:f.length>1&&l.jsx("button",{type:"button","aria-label":`Remove row ${T+1}`,onClick:()=>U(T),className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground/60 opacity-0 transition-opacity hover:text-destructive group-hover/item:opacity-100 cursor-pointer",children:l.jsx(he,{size:13})})})]},T)),e[0]=t,e[1]=s,e[2]=n,e[3]=r,e[4]=o,e[5]=a,e[6]=f,e[7]=d,e[8]=p,e[9]=g,e[10]=h,e[11]=b}else r=e[3],o=e[4],a=e[5],f=e[6],d=e[7],p=e[8],g=e[9],h=e[10],b=e[11];let i;e[17]!==a||e[18]!==f.length?(i=f.length===0&&l.jsx("tr",{children:l.jsx("td",{colSpan:a+1,className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No rows yet — add one below."})}),e[17]=a,e[18]=f.length,e[19]=i):i=e[19];let c;e[20]!==d||e[21]!==i?(c=l.jsxs("tbody",{children:[d,i]}),e[20]=d,e[21]=i,e[22]=c):c=e[22];let u;e[23]!==p||e[24]!==g||e[25]!==c?(u=l.jsxs("table",{className:p,children:[g,c]}),e[23]=p,e[24]=g,e[25]=c,e[26]=u):u=e[26];let x;e[27]!==h||e[28]!==u?(x=l.jsx("div",{className:h,children:u}),e[27]=h,e[28]=u,e[29]=x):x=e[29];let y;e[30]!==o?(y=l.jsx(se,{label:"Add row",onClick:o}),e[30]=o,e[31]=y):y=e[31];let N;e[32]===Symbol.for("react.memo_cache_sentinel")?(N=l.jsx(Ge,{size:13}),e[32]=N):N=e[32];let j;e[33]!==r?(j=l.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-md 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:[N,"Add column"]}),e[33]=r,e[34]=j):j=e[34];let C;e[35]!==y||e[36]!==j?(C=l.jsxs("div",{className:"flex gap-2",children:[y,j]}),e[35]=y,e[36]=j,e[37]=C):C=e[37];let k;return e[38]!==C||e[39]!==b||e[40]!==x?(k=l.jsxs("div",{className:b,children:[x,C]}),e[38]=C,e[39]=b,e[40]=x,e[41]=k):k=e[41],k}function Xs(m){return[...m,""]}function Zs(m){return m.trim()!==""}function el(m){return m.length}function tl(m){const e=E.c(188),{block:t,meta:n,onChange:s,sandboxRef:r}=m,o=D(),a=t.__resolveType??"",f=pt(a);if(xt(a))switch(f){case"Paragraph":{let i;e[0]!==t.html?(i=L(t.html),e[0]=t.html,e[1]=i):i=e[1];let c;e[2]!==o?(c=o("sandbox.blockRegistry.writeSomethingPlaceholder"),e[2]=o,e[3]=c):c=e[3];let u;e[4]!==t||e[5]!==s?(u=y=>s({...t,html:y}),e[4]=t,e[5]=s,e[6]=u):u=e[6];let x;return e[7]!==i||e[8]!==c||e[9]!==u?(x=l.jsx(ts,{html:i,placeholder:c,onChange:u}),e[7]=i,e[8]=c,e[9]=u,e[10]=x):x=e[10],x}case"Heading":{let i;e[11]!==t.text?(i=L(t.text),e[11]=t.text,e[12]=i):i=e[12];let c;e[13]!==t.level?(c=L(t.level),e[13]=t.level,e[14]=c):c=e[14];let u;e[15]!==t||e[16]!==s?(u=y=>s({...t,...y}),e[15]=t,e[16]=s,e[17]=u):u=e[17];let x;return e[18]!==i||e[19]!==c||e[20]!==u?(x=l.jsx(ls,{text:i,level:c,onChange:u}),e[18]=i,e[19]=c,e[20]=u,e[21]=x):x=e[21],x}case"Quote":{let i;e[22]!==t.quote?(i=L(t.quote),e[22]=t.quote,e[23]=i):i=e[23];let c;e[24]!==t||e[25]!==s?(c=x=>s({...t,quote:x}),e[24]=t,e[25]=s,e[26]=c):c=e[26];let u;return e[27]!==i||e[28]!==c?(u=l.jsx(os,{quote:i,onChange:c}),e[27]=i,e[28]=c,e[29]=u):u=e[29],u}case"Code":{let i;e[30]!==t.code?(i=L(t.code),e[30]=t.code,e[31]=i):i=e[31];let c;e[32]!==t.language?(c=L(t.language),e[32]=t.language,e[33]=c):c=e[33];let u;e[34]!==t||e[35]!==s?(u=y=>s({...t,...y}),e[34]=t,e[35]=s,e[36]=u):u=e[36];let x;return e[37]!==i||e[38]!==c||e[39]!==u?(x=l.jsx(rs,{code:i,language:c,onChange:u}),e[37]=i,e[38]=c,e[39]=u,e[40]=x):x=e[40],x}case"List":{let i;e[41]!==t.items?(i=L(t.items),e[41]=t.items,e[42]=i):i=e[42];let c;e[43]!==t.style?(c=L(t.style),e[43]=t.style,e[44]=c):c=e[44];let u;e[45]!==t||e[46]!==s?(u=y=>s({...t,...y}),e[45]=t,e[46]=s,e[47]=u):u=e[47];let x;return e[48]!==i||e[49]!==c||e[50]!==u?(x=l.jsx(ns,{items:i,style:c,onChange:u}),e[48]=i,e[49]=c,e[50]=u,e[51]=x):x=e[51],x}case"BlockImage":{let i;return e[52]!==t||e[53]!==s?(i=l.jsx(as,{block:t,onChange:s}),e[52]=t,e[53]=s,e[54]=i):i=e[54],i}case"Video":{let i;e[55]!==t.url?(i=L(t.url),e[55]=t.url,e[56]=i):i=e[56];let c;e[57]!==t.caption?(c=L(t.caption),e[57]=t.caption,e[58]=c):c=e[58];let u;e[59]!==t||e[60]!==s?(u=y=>s({...t,...y}),e[59]=t,e[60]=s,e[61]=u):u=e[61];let x;return e[62]!==i||e[63]!==c||e[64]!==u?(x=l.jsx(cs,{url:i,caption:c,onChange:u}),e[62]=i,e[63]=c,e[64]=u,e[65]=x):x=e[65],x}case"Divider":{let i;return e[66]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx(ds,{}),e[66]=i):i=e[66],i}case"Cta":{let i;e[67]!==t.text?(i=L(t.text),e[67]=t.text,e[68]=i):i=e[68];let c;e[69]!==t.href?(c=L(t.href),e[69]=t.href,e[70]=c):c=e[70];let u;e[71]!==t||e[72]!==s?(u=y=>s({...t,...y}),e[71]=t,e[72]=s,e[73]=u):u=e[73];let x;return e[74]!==i||e[75]!==c||e[76]!==u?(x=l.jsx(us,{text:i,href:c,onChange:u}),e[74]=i,e[75]=c,e[76]=u,e[77]=x):x=e[77],x}case"Callout":{let i;e[78]!==t.title?(i=L(t.title),e[78]=t.title,e[79]=i):i=e[79];let c;e[80]!==t.body?(c=L(t.body),e[80]=t.body,e[81]=c):c=e[81];let u;e[82]!==t.variant?(u=L(t.variant),e[82]=t.variant,e[83]=u):u=e[83];let x;e[84]!==t||e[85]!==s?(x=N=>s({...t,...N}),e[84]=t,e[85]=s,e[86]=x):x=e[86];let y;return e[87]!==i||e[88]!==c||e[89]!==u||e[90]!==x?(y=l.jsx(fs,{title:i,body:c,variant:u,onChange:x}),e[87]=i,e[88]=c,e[89]=u,e[90]=x,e[91]=y):y=e[91],y}case"Stat":{let i;e[92]!==t.value?(i=L(t.value),e[92]=t.value,e[93]=i):i=e[93];let c;e[94]!==t.label?(c=L(t.label),e[94]=t.label,e[95]=c):c=e[95];let u;e[96]!==t.description?(u=L(t.description),e[96]=t.description,e[97]=u):u=e[97];let x;e[98]!==t||e[99]!==s?(x=N=>s({...t,...N}),e[98]=t,e[99]=s,e[100]=x):x=e[100];let y;return e[101]!==i||e[102]!==c||e[103]!==u||e[104]!==x?(y=l.jsx(ms,{value:i,label:c,description:u,onChange:x}),e[101]=i,e[102]=c,e[103]=u,e[104]=x,e[105]=y):y=e[105],y}case"StatGroup":{let i;e[106]!==t.stats?(i=L(t.stats),e[106]=t.stats,e[107]=i):i=e[107];let c;e[108]!==t||e[109]!==s?(c=x=>s({...t,stats:x}),e[108]=t,e[109]=s,e[110]=c):c=e[110];let u;return e[111]!==i||e[112]!==c?(u=l.jsx(gs,{stats:i,onChange:c}),e[111]=i,e[112]=c,e[113]=u):u=e[113],u}case"CardGroup":{let i;e[114]!==t.cards?(i=typeof t.cards=="string"?t.cards:JSON.stringify(t.cards??[]),e[114]=t.cards,e[115]=i):i=e[115];let c;e[116]!==t||e[117]!==s?(c=x=>s({...t,cards:x}),e[116]=t,e[117]=s,e[118]=c):c=e[118];let u;return e[119]!==i||e[120]!==c?(u=l.jsx(ps,{cards:i,onChange:c}),e[119]=i,e[120]=c,e[121]=u):u=e[121],u}case"Checklist":{let i;e[122]!==t.title?(i=L(t.title),e[122]=t.title,e[123]=i):i=e[123];let c;e[124]!==t.items?(c=L(t.items),e[124]=t.items,e[125]=c):c=e[125];let u;e[126]!==t||e[127]!==s?(u=y=>s({...t,...y}),e[126]=t,e[127]=s,e[128]=u):u=e[128];let x;return e[129]!==i||e[130]!==c||e[131]!==u?(x=l.jsx(xs,{title:i,items:c,onChange:u}),e[129]=i,e[130]=c,e[131]=u,e[132]=x):x=e[132],x}case"Steps":{let i;e[133]!==t.title?(i=L(t.title),e[133]=t.title,e[134]=i):i=e[134];let c;e[135]!==t.steps?(c=L(t.steps),e[135]=t.steps,e[136]=c):c=e[136];let u;e[137]!==t||e[138]!==s?(u=y=>s({...t,...y}),e[137]=t,e[138]=s,e[139]=u):u=e[139];let x;return e[140]!==i||e[141]!==c||e[142]!==u?(x=l.jsx(hs,{title:i,steps:c,onChange:u}),e[140]=i,e[141]=c,e[142]=u,e[143]=x):x=e[143],x}case"Comparison":{let i;e[144]!==t.left?(i=L(t.left),e[144]=t.left,e[145]=i):i=e[145];let c;e[146]!==t.right?(c=L(t.right),e[146]=t.right,e[147]=c):c=e[147];let u;e[148]!==t||e[149]!==s?(u=y=>s({...t,...y}),e[148]=t,e[149]=s,e[150]=u):u=e[150];let x;return e[151]!==i||e[152]!==c||e[153]!==u?(x=l.jsx(bs,{left:i,right:c,onChange:u}),e[151]=i,e[152]=c,e[153]=u,e[154]=x):x=e[154],x}case"Table":{let i;e[155]!==t.headers?(i=typeof t.headers=="string"?t.headers:JSON.stringify(t.headers??[]),e[155]=t.headers,e[156]=i):i=e[156];let c;e[157]!==t.rows?(c=typeof t.rows=="string"?t.rows:JSON.stringify(t.rows??[]),e[157]=t.rows,e[158]=c):c=e[158];let u;e[159]!==t||e[160]!==s?(u=y=>s({...t,...y}),e[159]=t,e[160]=s,e[161]=u):u=e[161];let x;return e[162]!==i||e[163]!==c||e[164]!==u?(x=l.jsx(Qs,{headers:i,rows:c,onChange:u}),e[162]=i,e[163]=c,e[164]=u,e[165]=x):x=e[165],x}case"ProductCard":{let i;return e[166]!==t||e[167]!==s||e[168]!==r?(i=l.jsx(Gs,{block:t,onChange:s,sandboxRef:r}),e[166]=t,e[167]=s,e[168]=r,e[169]=i):i=e[169],i}case"ProductShelf":{let i;return e[170]!==t||e[171]!==s||e[172]!==r?(i=l.jsx(Vs,{block:t,onChange:s,sandboxRef:r}),e[170]=t,e[171]=s,e[172]=r,e[173]=i):i=e[173],i}}let p;e[174]!==n||e[175]!==a?(p=a?gt(a,n):null,e[174]=n,e[175]=a,e[176]=p):p=e[176];const g=p;if(!g){const i=a??"";let c;e[177]!==o||e[178]!==i?(c=o("sandbox.blockRegistry.unknownBlockType",{type:i}),e[177]=o,e[178]=i,e[179]=c):c=e[179];let u;return e[180]!==c?(u=l.jsx("p",{className:"text-xs text-muted-foreground",children:c}),e[180]=c,e[181]=u):u=e[181],u}let h;e[182]!==s?(h=i=>s(i),e[182]=s,e[183]=h):h=e[183];let b;return e[184]!==t||e[185]!==g||e[186]!==h?(b=l.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 sl(m){const e=E.c(43),{id:t,block:n,meta:s,onChange:r,onDelete:o,onDuplicate:a,sandboxRef:f}=m,d=D();let p;e[0]!==t?(p={id:t},e[0]=t,e[1]=p):p=e[1];const{attributes:g,listeners:h,setNodeRef:b,transform:i,transition:c,isDragging:u}=Ve(p);let x;e[2]!==i?(x=Me.Transform.toString(i),e[2]=i,e[3]=x):x=e[3];let y;e[4]!==x||e[5]!==c?(y={transform:x,transition:c},e[4]=x,e[5]=c,e[6]=y):y=e[6];const N=u&&"opacity-50";let j;e[7]!==N?(j=Q("group/row relative rounded-md py-1.5 pl-12 pr-2 transition-colors hover:bg-muted/40",N),e[7]=N,e[8]=j):j=e[8];let C;e[9]!==d?(C=d("sandbox.blockRow.dragToReorder"),e[9]=d,e[10]=C):C=e[10];let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=l.jsx(Ke,{size:14}),e[11]=k):k=e[11];let v;e[12]!==g||e[13]!==h||e[14]!==C?(v=l.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 rounded text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-foreground active:cursor-grabbing group-hover/row:opacity-100",...g,...h,children:k}),e[12]=g,e[13]=h,e[14]=C,e[15]=v):v=e[15];let B;e[16]!==d?(B=d("sandbox.blockRow.duplicateBlock"),e[16]=d,e[17]=B):B=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=l.jsx(_t,{size:14}),e[18]=S):S=e[18];let w;e[19]!==a||e[20]!==B?(w=l.jsx("button",{type:"button","aria-label":B,onClick:a,className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground cursor-pointer",children:S}),e[19]=a,e[20]=B,e[21]=w):w=e[21];let I;e[22]!==d?(I=d("sandbox.blockRow.deleteBlock"),e[22]=d,e[23]=I):I=e[23];let $;e[24]===Symbol.for("react.memo_cache_sentinel")?($=l.jsx(he,{size:14}),e[24]=$):$=e[24];let P;e[25]!==o||e[26]!==I?(P=l.jsx("button",{type:"button","aria-label":I,onClick:o,className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-destructive cursor-pointer",children:$}),e[25]=o,e[26]=I,e[27]=P):P=e[27];let _;e[28]!==w||e[29]!==P?(_=l.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:[w,P]}),e[28]=w,e[29]=P,e[30]=_):_=e[30];let U;e[31]!==n||e[32]!==s||e[33]!==r||e[34]!==f?(U=l.jsx(tl,{block:n,meta:s,onChange:r,sandboxRef:f}),e[31]=n,e[32]=s,e[33]=r,e[34]=f,e[35]=U):U=e[35];let F;return e[36]!==b||e[37]!==_||e[38]!==U||e[39]!==y||e[40]!==j||e[41]!==v?(F=l.jsxs("div",{ref:b,style:y,className:j,children:[v,_,U]}),e[36]=b,e[37]=_,e[38]=U,e[39]=y,e[40]=j,e[41]=v,e[42]=F):F=e[42],F}function Tl(m){return Array.isArray(m)?m:[]}function Il(m){const e=E.c(64),{value:t,onChange:n,meta:s,sandboxRef:r,emptyMessage:o}=m,a=o===void 0?"No content yet. Use ⊕ to add your first block.":o;let f;e[0]!==s?(f=bt(s),e[0]=s,e[1]=f):f=e[1];const d=f;let p;e[2]!==t?(p=()=>t.map(nl),e[2]=t,e[3]=p):p=e[3];const[g,h]=K.useState(p);let b;e[4]!==g?(b=g.map(rl),e[4]=g,e[5]=b):b=e[5];const i=b;let c;e[6]!==g?(c=g.map(ol),e[6]=g,e[7]=c):c=e[7];const u=c;let x;e[8]!==n?(x=z=>{h(z),n(z.map(ll))},e[8]=n,e[9]=x):x=e[9];const y=x;let N;e[10]!==g||e[11]!==y?(N=(z,M)=>{const q=[...g];q.splice(z,0,{id:ye(),block:{__resolveType:M}}),y(q)},e[10]=g,e[11]=y,e[12]=N):N=e[12];const j=N;let C;e[13]!==g||e[14]!==y?(C=(z,M)=>{y(g.map((q,Y)=>Y===z?{...q,block:M}:q))},e[13]=g,e[14]=y,e[15]=C):C=e[15];const k=C;let v;e[16]!==g||e[17]!==y?(v=z=>{y(g.filter((M,q)=>q!==z))},e[16]=g,e[17]=y,e[18]=v):v=e[18];const B=v;let S;e[19]!==g||e[20]!==y?(S=z=>{const M=g[z];if(!M)return;const q=[...g];q.splice(z+1,0,{id:ye(),block:structuredClone(M.block)}),y(q)},e[19]=g,e[20]=y,e[21]=S):S=e[21];const w=S;let I;e[22]===Symbol.for("react.memo_cache_sentinel")?(I={activationConstraint:{distance:6}},e[22]=I):I=e[22];let $;e[23]===Symbol.for("react.memo_cache_sentinel")?($={coordinateGetter:ze},e[23]=$):$=e[23];const P=De(ue(Oe,I),ue(Re,$));let _;e[24]!==g||e[25]!==y?(_=z=>{const{active:M,over:q}=z;if(!q||M.id===q.id)return;const Y=g.findIndex(W=>W.id===String(M.id)),Z=g.findIndex(W=>W.id===String(q.id));Y===-1||Z===-1||y(Fe(g,Y,Z))},e[24]=g,e[25]=y,e[26]=_):_=e[26];const U=_;let F;e[27]!==u.length||e[28]!==a?(F=u.length===0&&l.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground",children:a}),e[27]=u.length,e[28]=a,e[29]=F):F=e[29];let H;e[30]!==j?(H=z=>j(0,z),e[30]=j,e[31]=H):H=e[31];const V=u.length===0;let A;e[32]!==d||e[33]!==H||e[34]!==V?(A=l.jsx(Pe,{blockTypes:d,onInsert:H,alwaysShow:V}),e[32]=d,e[33]=H,e[34]=V,e[35]=A):A=e[35];let T;if(e[36]!==g||e[37]!==d||e[38]!==w||e[39]!==j||e[40]!==s||e[41]!==B||e[42]!==r||e[43]!==k){let z;e[45]!==d||e[46]!==w||e[47]!==j||e[48]!==s||e[49]!==B||e[50]!==r||e[51]!==k?(z=(M,q)=>{const{id:Y,block:Z}=M;return l.jsxs("div",{children:[l.jsx(sl,{id:Y,block:Z,meta:s,onChange:W=>k(q,W),onDelete:()=>B(q),onDuplicate:()=>w(q),sandboxRef:r}),l.jsx(Pe,{blockTypes:d,onInsert:W=>j(q+1,W)})]},Y)},e[45]=d,e[46]=w,e[47]=j,e[48]=s,e[49]=B,e[50]=r,e[51]=k,e[52]=z):z=e[52],T=g.map(z),e[36]=g,e[37]=d,e[38]=w,e[39]=j,e[40]=s,e[41]=B,e[42]=r,e[43]=k,e[44]=T}else T=e[44];let R;e[53]!==i||e[54]!==A||e[55]!==T?(R=l.jsxs(Ue,{items:i,strategy:yt,children:[A,T]}),e[53]=i,e[54]=A,e[55]=T,e[56]=R):R=e[56];let O;e[57]!==U||e[58]!==P||e[59]!==R?(O=l.jsx(qe,{sensors:P,collisionDetection:He,onDragEnd:U,children:R}),e[57]=U,e[58]=P,e[59]=R,e[60]=O):O=e[60];let J;return e[61]!==F||e[62]!==O?(J=l.jsxs("div",{className:"mt-2",children:[F,O]}),e[61]=F,e[62]=O,e[63]=J):J=e[63],J}function ll(m){return m.block}function ol(m){return m.block}function rl(m){return m.id}function nl(m){return{id:ye(),block:m}}function ye(){return crypto.randomUUID()}export{Il as B,Tl as a,Pl as b,wl as c};
|