decocms 4.383.1 → 4.384.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-LJkM8Umc.js → AlertCircle-CN63l28E.js} +1 -1
- package/dist/client/assets/{AreaChart-CjJaUtwC.js → AreaChart-C6F8FeW1.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CGkn-m8f.js → ArrowLeft-gXpdVjjZ.js} +1 -1
- package/dist/client/assets/{ArrowRight-BX2App8Z.js → ArrowRight-DwJbToqY.js} +1 -1
- package/dist/client/assets/{ArrowUp-BAUR8mSe.js → ArrowUp-DYxdR5t4.js} +1 -1
- package/dist/client/assets/{CartesianChart-vw1yMsWr.js → CartesianChart-BSC303jI.js} +1 -1
- package/dist/client/assets/{CheckCircle-BpX5Mb8t.js → CheckCircle-DwE2PFQ4.js} +1 -1
- package/dist/client/assets/{ChevronUp-DsbltOpN.js → ChevronUp-CWbL6T1G.js} +1 -1
- package/dist/client/assets/{Copy01-0jm4SeRe.js → Copy01-txk4D2dp.js} +1 -1
- package/dist/client/assets/{CreditCard01-73-vkmvl.js → CreditCard01-CjsiyuM0.js} +1 -1
- package/dist/client/assets/{DotsVertical-CSfkrc8O.js → DotsVertical-Chx4AR6B.js} +1 -1
- package/dist/client/assets/{Download01-xiBeRwHN.js → Download01-C_uRJg-E.js} +1 -1
- package/dist/client/assets/{ErrorBarContext--VCU3oBZ.js → ErrorBarContext-DttuIWbP.js} +1 -1
- package/dist/client/assets/{Eye-Bigici17.js → Eye-PUFPRogI.js} +1 -1
- package/dist/client/assets/{Globe01-Cna45P6a.js → Globe01-cK-boe1F.js} +1 -1
- package/dist/client/assets/{Globe04-Dg8SD1vo.js → Globe04-DZ4La14w.js} +1 -1
- package/dist/client/assets/{Image01-C2MdYCtR.js → Image01-Cu23ajxK.js} +1 -1
- package/dist/client/assets/{Key01-DffQxPlE.js → Key01-C4vmDBWq.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BfYzK4mo.js → LayoutLeft-B6FExgE9.js} +1 -1
- package/dist/client/assets/{Line-ClkAgrJb.js → Line-BMTH13Bf.js} +1 -1
- package/dist/client/assets/{Link01-CynYhkLr.js → Link01-CCMhgKQC.js} +1 -1
- package/dist/client/assets/{LinkExternal01-nQSknRCR.js → LinkExternal01-BvYYsTzi.js} +1 -1
- package/dist/client/assets/{Monitor01-CDfch8oz.js → Monitor01-D4NGGSSY.js} +1 -1
- package/dist/client/assets/{Package-3ZLy52FE.js → Package-BHKlCKgA.js} +1 -1
- package/dist/client/assets/{Palette-CMZu59LK.js → Palette-D4pYAcww.js} +1 -1
- package/dist/client/assets/{Play-D_Dr-HEG.js → Play-DWkCdYVe.js} +1 -1
- package/dist/client/assets/{Plus-C1CKVAFo.js → Plus-B5qlUYQA.js} +1 -1
- package/dist/client/assets/{SearchLg-B6NToYZC.js → SearchLg-DgVGxGAk.js} +1 -1
- package/dist/client/assets/{SearchMd-zePyurMS.js → SearchMd-Ds8nq6dr.js} +1 -1
- package/dist/client/assets/{Sector-E8uUdeHk.js → Sector-5UqJism-.js} +1 -1
- package/dist/client/assets/{Settings02-DMaVDtfM.js → Settings02-DuHT9CDs.js} +1 -1
- package/dist/client/assets/{Share07-BSfD4Af0.js → Share07-Gti5eVBm.js} +1 -1
- package/dist/client/assets/{Stars01-CXObStKI.js → Stars01-NMjfS8aT.js} +1 -1
- package/dist/client/assets/{Sun-BQGS4Y0R.js → Sun-bZ7LINy-.js} +1 -1
- package/dist/client/assets/{Tool01-DZu8RUzZ.js → Tool01-D-kKamzo.js} +1 -1
- package/dist/client/assets/{Tool02-C7BRTm2R.js → Tool02-C3PJKwXL.js} +1 -1
- package/dist/client/assets/{Trash01-CacMXriS.js → Trash01-BOgDvBV9.js} +1 -1
- package/dist/client/assets/{TrendUp01-C3boeLIB.js → TrendUp01-Cz4fAV8R.js} +1 -1
- package/dist/client/assets/{Upload01-B5kYxzoc.js → Upload01-bRtRcrf0.js} +1 -1
- package/dist/client/assets/{User01-Ba34kYTP.js → User01-A5yQ_wrz.js} +1 -1
- package/dist/client/assets/{UserSquare-PE4kARaY.js → UserSquare-DGrBwjoh.js} +1 -1
- package/dist/client/assets/{Users01-CgytyhS2.js → Users01-BxbX_-HF.js} +1 -1
- package/dist/client/assets/{X-DfPrIb4m.js → X-DNbfDZJ4.js} +1 -1
- package/dist/client/assets/{XCircle-BRTsqRTs.js → XCircle-yvuIGIaV.js} +1 -1
- package/dist/client/assets/{XClose-DtruhyLM.js → XClose-BI_rRQ4C.js} +1 -1
- package/dist/client/assets/{Zap-FPirisgg.js → Zap-D3w7YXbH.js} +1 -1
- package/dist/client/assets/{ZoomOut-CW6c9gjM.js → ZoomOut-CkMxedob.js} +1 -1
- package/dist/client/assets/{access-gate-BzYSaxi9.js → access-gate-BN4Zc3yN.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-CNPkccVn.js → add-connection-dialog-DOiBCAyA.js} +1 -1
- package/dist/client/assets/{agent-analytics-CQAuAwQm.js → agent-analytics-Dxw3ggkt.js} +1 -1
- package/dist/client/assets/agent-app-0eg1eiqf.js +1 -0
- package/dist/client/assets/{agent-assets-CSDWDAzC.js → agent-assets-CHD2rYMH.js} +1 -1
- package/dist/client/assets/{agent-automation-DlwOjUyC.js → agent-automation-Bdv69h7i.js} +1 -1
- package/dist/client/assets/{agent-automations-Ck5Z78ep.js → agent-automations-CJGxlGqZ.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-B0nJ5Jnx.js → agent-connect-sources-DLHNDr12.js} +1 -1
- package/dist/client/assets/agent-deck-DrMV80HV.js +1 -0
- package/dist/client/assets/{agent-e2e-W_xfJoJ5.js → agent-e2e-D0O0eUvD.js} +1 -1
- package/dist/client/assets/{agent-experiments-C17LBhzf.js → agent-experiments-B4o3u-RO.js} +1 -1
- package/dist/client/assets/agent-file-CCj7uKuF.js +1 -0
- package/dist/client/assets/{agent-git-CucerCdW.js → agent-git-B-nOTC62.js} +1 -1
- package/dist/client/assets/{agent-hosting-BC5wIkhQ.js → agent-hosting-B4i2QTPU.js} +1 -1
- package/dist/client/assets/{agent-icon-Bo-J8xeh.js → agent-icon-syzsjQqD.js} +1 -1
- package/dist/client/assets/agent-library-file-Cxy49C5n.js +1 -0
- package/dist/client/assets/{agent-monitor-X5R8xXZE.js → agent-monitor-DafBtLIq.js} +1 -1
- package/dist/client/assets/{agent-overview-BkNGszRe.js → agent-overview-Cp3ca_fT.js} +1 -1
- package/dist/client/assets/agent-settings-BOzUFehK.js +1 -0
- package/dist/client/assets/{agent-site-editor-CEhI3_3Z.js → agent-site-editor-DaLvvkPd.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-B3uudymh.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-CDfpLYm0.js → agent-site-editor-content-COPyMtYx.js} +2 -2
- package/dist/client/assets/{agent-site-editor-preview-WNAkww5C.js → agent-site-editor-preview-DyyES80c.js} +3 -3
- package/dist/client/assets/{agent-view-guard-DvQUI0V1.js → agent-view-guard-CNoCeQGV.js} +1 -1
- package/dist/client/assets/agent-view-ioWkT_97.js +1 -0
- package/dist/client/assets/{agents-list-CObp6lJb.js → agents-list-A3SdSmbi.js} +1 -1
- package/dist/client/assets/{ai-providers-D3ERn1aD.js → ai-providers-Bc22cj0K.js} +1 -1
- package/dist/client/assets/{alert-Clqdl7aR.js → alert-DVLI8Gfp.js} +1 -1
- package/dist/client/assets/{alert-dialog-Cp2DKCaA.js → alert-dialog-C-7JcYKm.js} +1 -1
- package/dist/client/assets/api-keys-BbSb9ZS5.js +1 -0
- package/dist/client/assets/{api-keys-DaFJqFvy.js → api-keys-C1TQNBQk.js} +1 -1
- package/dist/client/assets/app-editor-CE2cAIcD.js +1 -0
- package/dist/client/assets/{asset-utils-PfPLdECv.js → asset-utils-CEYQNtbb.js} +1 -1
- package/dist/client/assets/{auth-BrLmBihg.js → auth-CqLAsH9H.js} +1 -1
- package/dist/client/assets/{auth-catchall-Cl7oTkwa.js → auth-catchall-xsnAyDMl.js} +1 -1
- package/dist/client/assets/{auth-entry-CNGgF6Ba.js → auth-entry-Bk-PmUnC.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DQwh8CIC.js → auth-split-layout-BNlJlV-x.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-B2zy35Vj.js → authenticate-and-persist-oauth-qEErHC5o.js} +1 -1
- package/dist/client/assets/{automation-list-row-CjcXeXwE.js → automation-list-row-CWqPcVwI.js} +1 -1
- package/dist/client/assets/{automation-runs-BD5ZIGkp.js → automation-runs-BIqjehHs.js} +1 -1
- package/dist/client/assets/{automations-CS1mUqQ5.js → automations-CQ7q-IQU.js} +1 -1
- package/dist/client/assets/{autosend-gR5Q16Ik.js → autosend-D2vNE1-H.js} +1 -1
- package/dist/client/assets/{avatar-DT4l4CGp.js → avatar-BktXtsSk.js} +1 -1
- package/dist/client/assets/{badge-DkEJ8U-u.js → badge-Dz02OelF.js} +1 -1
- package/dist/client/assets/{block-document-D8KCO97C.js → block-document-Br8yab_f.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-Cqex6ZSI.js → blocks-preview-workspace-context-EBiaJPDj.js} +1 -1
- package/dist/client/assets/{breadcrumb-BWA-hs-k.js → breadcrumb-B30eHojr.js} +1 -1
- package/dist/client/assets/{buckets-B_1NDeu-.js → buckets-nUGpOo92.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-Dgee_BLo.js → build-improve-prompt-doc-Jy7pCRLD.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-CNsJoPO6.js → bulk-category-panel-PV5rGUwP.js} +1 -1
- package/dist/client/assets/{calendar-DifXWLQ2.js → calendar-CKLBRofA.js} +1 -1
- package/dist/client/assets/{capability-load-error-wP3oA9Nb.js → capability-load-error-BW7ikFrl.js} +1 -1
- package/dist/client/assets/category-editor-DAcmMuqa.js +1 -0
- package/dist/client/assets/{chart-B4o0da4o.js → chart-0_Bs5-by.js} +1 -1
- package/dist/client/assets/{chat-context-ChL7WN2U.js → chat-context-Xotq8Uwe.js} +1 -1
- package/dist/client/assets/{chat-draft-C8cjqBXv.js → chat-draft-CgEPV7Kr.js} +1 -1
- package/dist/client/assets/{checkbox-DPYd0GE1.js → checkbox-_kcJEWes.js} +1 -1
- package/dist/client/assets/{choose-editor-jaVFOS3r.js → choose-editor-3QcFGZgT.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BuHD5-Ma.js → cli-auth-success-Dy4pnXjF.js} +1 -1
- package/dist/client/assets/{client-icons-DbAlWXgF.js → client-icons-D4aBzuCX.js} +1 -1
- package/dist/client/assets/{collapsible-Dy8o0xUs.js → collapsible-BnDH8Aa2.js} +1 -1
- package/dist/client/assets/{collection-detail-BeYuiuss.js → collection-detail-C2TsNF7h.js} +1 -1
- package/dist/client/assets/{collection-display-button-ByLd5rVn.js → collection-display-button-Dqa4y3X3.js} +1 -1
- package/dist/client/assets/{collection-search-CuWCjS6d.js → collection-search-BoAOwaNc.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BrX4iG6f.js → collection-table-wrapper-DSralND5.js} +1 -1
- package/dist/client/assets/{collection-tabs-sbmCBX8D.js → collection-tabs-B2xcnwza.js} +1 -1
- package/dist/client/assets/{combobox-B-tcdQh6.js → combobox-CxhEXJ11.js} +1 -1
- package/dist/client/assets/{command-DavQMzl4.js → command-CtXsvJo3.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-BoaiIO2s.js → companion-mcps-section-jQI_30D-.js} +1 -1
- package/dist/client/assets/{connect-fIpSHD9U.js → connect-OcFK-UU3.js} +1 -1
- package/dist/client/assets/{connect-layout-wd1v6Pwi.js → connect-layout-U0rq3TX1.js} +1 -1
- package/dist/client/assets/{connection-BbOsKsIS.js → connection-DIKevzcK.js} +1 -1
- package/dist/client/assets/{connection-card-rmPhqAiw.js → connection-card-D0KKFdD5.js} +1 -1
- package/dist/client/assets/{connection-detail-OuprsHor.js → connection-detail-DW2ymG-9.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-xq1JVrlH.js → connection-form-helpers-KqoUSQKE.js} +1 -1
- package/dist/client/assets/{connections-BNmysMRu.js → connections-B3q3OLOE.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CZ3KvKHK.js → create-organization-dialog-B4VxevwN.js} +1 -1
- package/dist/client/assets/{decofile-api-B-ltS0w-.js → decofile-api-BlHdyJaj.js} +1 -1
- package/dist/client/assets/{decopilot-Gurm5JcG.js → decopilot-ONeLQXU1.js} +1 -1
- package/dist/client/assets/{dialog-C--_G9bM.js → dialog-DAOqbLTM.js} +1 -1
- package/dist/client/assets/{discover-DaVcoHow.js → discover-CdRUWZaC.js} +1 -1
- package/dist/client/assets/{domain-settings-DMLNW66S.js → domain-settings-C-l-SMd_.js} +1 -1
- package/dist/client/assets/{download-app-dialog-BEPIC2WD.js → download-app-dialog-DD-_m3bO.js} +1 -1
- package/dist/client/assets/{drawer-CZUY_VVA.js → drawer-CzplXqA6.js} +1 -1
- package/dist/client/assets/{editor-1m8LO4yq.js → editor-CPbQohDU.js} +1 -1
- package/dist/client/assets/{empty-state-DULFVqUb.js → empty-state-SJDm-O9f.js} +1 -1
- package/dist/client/assets/{empty-state-CE_mQRYC.js → empty-state-XAuNoiCZ.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Dt8HdsMK.js → extract-connection-data-_3oz07QW.js} +1 -1
- package/dist/client/assets/{feature-gate-K-34Dfx0.js → feature-gate-CnfEirBt.js} +1 -1
- package/dist/client/assets/{feature-paywall-D81N--IK.js → feature-paywall-CWFruHaV.js} +1 -1
- package/dist/client/assets/{file-explorer-DkvAGvo_.js → file-explorer-BrCg5koI.js} +1 -1
- package/dist/client/assets/{file-preview-9riFcqVE.js → file-preview-D8QMa9_e.js} +1 -1
- package/dist/client/assets/{file-share-button-CxSyaqG1.js → file-share-button-Dk166-Ll.js} +1 -1
- package/dist/client/assets/{file-type-icon-BEvHZV8X.js → file-type-icon-PokUk1QC.js} +1 -1
- package/dist/client/assets/{folder-icon-BppDSJES.js → folder-icon-C-XUtXaj.js} +1 -1
- package/dist/client/assets/{form-BBJYOW9S.js → form-Pq1VF9SG.js} +1 -1
- package/dist/client/assets/{gateway-client-BwsPUN8V.js → gateway-client-p26Hg4rs.js} +1 -1
- package/dist/client/assets/{general-BZBOXoTC.js → general-IhDXIEo3.js} +1 -1
- package/dist/client/assets/{github-icon-CMPb9KoS.js → github-icon-BeOhZWX3.js} +1 -1
- package/dist/client/assets/{home-XMANan_t.js → home-DXPP6fCY.js} +1 -1
- package/dist/client/assets/{hooks-BT7beeUw.js → hooks-B7Nkkny2.js} +1 -1
- package/dist/client/assets/{hooks-B578kLR9.js → hooks-BRj1KGH0.js} +1 -1
- package/dist/client/assets/{icon-button-B5fNLlz3.js → icon-button-BCUJR5XB.js} +1 -1
- package/dist/client/assets/{index-DwbqeRvp.js → index-BEFYd_l9.js} +1 -1
- package/dist/client/assets/{index-DK-m4zyI.js → index-BMb1lZlu.js} +1 -1
- package/dist/client/assets/{index-DuN9g6_W.js → index-BlCAijlc.js} +1 -1
- package/dist/client/assets/{index-fmzc-5YR.js → index-Br65nWs8.js} +2 -2
- package/dist/client/assets/{index-BO5Kkf0J.js → index-BswfQfWK.js} +1 -1
- package/dist/client/assets/{index-DondjAWZ.js → index-C3hYf8V4.js} +1 -1
- package/dist/client/assets/{index-DXNGe5Ja.js → index-COmcBRgq.js} +1 -1
- package/dist/client/assets/{index-29FPmOVD.js → index-CbVh1pWL.js} +1 -1
- package/dist/client/assets/{index-sY3wVVMd.js → index-CkGUYH_5.js} +1 -1
- package/dist/client/assets/{index-BHJ4Cdqa.js → index-CvuZZryV.js} +1 -1
- package/dist/client/assets/{index-D0SVmTgB.js → index-D7t4sF_N.js} +1 -1
- package/dist/client/assets/{index-BmK9sOLy.js → index-De7ClK0R.js} +1 -1
- package/dist/client/assets/{index-redirect-BINM_u22.js → index-redirect-wevBIvJf.js} +1 -1
- package/dist/client/assets/{index-CEG_XSgp.js → index-tVpE3SFA.js} +1 -1
- package/dist/client/assets/{index-B96PBdkB.js → index-zwdcUZFQ.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-C8r1uJuJ.js → infiniteQueryObserver-C6uoSRRm.js} +1 -1
- package/dist/client/assets/{infra-billing-Cf7vNa5x.js → infra-billing-PAbb5Jwh.js} +1 -1
- package/dist/client/assets/{input-Cd4zhIdI.js → input-CpHc9Ccz.js} +1 -1
- package/dist/client/assets/{input-DnuTI592.js → input-DYvahrt0.js} +1 -1
- package/dist/client/assets/{input-0m53gxPF.js → input-WrUCYwPA.js} +1 -1
- package/dist/client/assets/{integration-icon-BK2IoSQO.js → integration-icon-CHq-tZ5S.js} +1 -1
- package/dist/client/assets/{label-DGWQJyZd.js → label-VZgjitSh.js} +1 -1
- package/dist/client/assets/{last-preview-page-CNeddLx4.js → last-preview-page-CAw6q3Ni.js} +1 -1
- package/dist/client/assets/{layout-BczTtTyQ.js → layout-VdZFOaDn.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-B_KvmQGx.js → legacy-agents-deep-Ddr-P5lf.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BTufX_Ez.js → legacy-main-redirect-Com2O168.js} +1 -1
- package/dist/client/assets/{library-BiwfkQAe.js → library-Cy4C1Xe7.js} +1 -1
- package/dist/client/assets/{login-C2OMCq-b.js → login-BZlQTdnW.js} +1 -1
- package/dist/client/assets/{markdown-CcgXCeWS.js → markdown-nDkdLMAq.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-qUU136mr.js → mcp-app-renderer-C-t-oEUy.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C5fzXDUg.js → mcp-oauth-D4qjjzCr.js} +1 -1
- package/dist/client/assets/{members-TO4zbHgb.js → members-D2oftmvt.js} +1 -1
- package/dist/client/assets/{message-templates-BS1amKSu.js → message-templates-DDyZkBWQ.js} +1 -1
- package/dist/client/assets/{mini-report-page-D-dwO5gS.js → mini-report-page-CLLCqBB-.js} +1 -1
- package/dist/client/assets/{mock-board-wUKFGvu9.js → mock-board-CIGfY1Fn.js} +3 -3
- package/dist/client/assets/{monaco-editor-ZdKL9FIJ.js → monaco-editor-6DU5W3RO.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Bs007IMN.js → monitoring-stats-row-DLZFqB6Y.js} +1 -1
- package/dist/client/assets/{multi-select-DaeS8uML.js → multi-select-0ZkYWy-8.js} +1 -1
- package/dist/client/assets/{mustache-BtYFB6VI.js → mustache-DqsxB6HM.js} +1 -1
- package/dist/client/assets/{oauth-callback-BHFlZWOH.js → oauth-callback-2hEPVX2K.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-qukMAzP9.js → oauth-callback-ai-provider-DD44XS1M.js} +1 -1
- package/dist/client/assets/{onboarding-r4Ej3daV.js → onboarding-BleSgTXv.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-IS3aIvG3.js → optimistic-project-sidebar-views-CGxbWunL.js} +1 -1
- package/dist/client/assets/{org-file-open-context-CsLVzm0L.js → org-file-open-context-fmLHly5t.js} +1 -1
- package/dist/client/assets/{organization-choice-B8Jprsi2.js → organization-choice-CpTHVweM.js} +1 -1
- package/dist/client/assets/{orgs-7TtpxkU6.js → orgs-D-8Omyac.js} +1 -1
- package/dist/client/assets/{page-seo-form-BA31O6yp.js → page-seo-form-CtYPF938.js} +1 -1
- package/dist/client/assets/{pair-Ax9qD1ST.js → pair-DFnpHOLp.js} +1 -1
- package/dist/client/assets/{plan-ladder-V8GNYGA4.js → plan-ladder-BFxdIlaH.js} +1 -1
- package/dist/client/assets/{popover-DjiStQSG.js → popover-jThH4hZX.js} +1 -1
- package/dist/client/assets/{post-calendar-CB4Ut6FT.js → post-calendar-CT_N8Two.js} +1 -1
- package/dist/client/assets/{post-editor-D2tKW_xB.js → post-editor-DUpUdKcd.js} +1 -1
- package/dist/client/assets/{preview-content-C6BpJMpN.js → preview-content-B-oFa1GP.js} +1 -1
- package/dist/client/assets/{preview-dialog-C5Pqo3dG.js → preview-dialog-Cj6rXYeM.js} +1 -1
- package/dist/client/assets/{primitives-BAd94TKT.js → primitives-sDubWs3n.js} +1 -1
- package/dist/client/assets/{profile-Bqnl1vMp.js → profile-CclDeU6M.js} +1 -1
- package/dist/client/assets/{project-app-view-CD9Zdt9k.js → project-app-view-DZzrNxcj.js} +1 -1
- package/dist/client/assets/{project-feed-DDSjygkw.js → project-feed-CYKHLYLc.js} +1 -1
- package/dist/client/assets/{project-icon-Bb8n1f1c.js → project-icon-Dz0CHIad.js} +1 -1
- package/dist/client/assets/project-reports-Bl6rgqCX.js +1 -0
- package/dist/client/assets/project-tasks-CRRYn93K.js +1 -0
- package/dist/client/assets/{prompts-KM7eCzO-.js → prompts-0IkmmZYs.js} +1 -1
- package/dist/client/assets/record-editor-iEZkEBOS.js +1 -0
- package/dist/client/assets/{redirect-editor-DRxzpjvy.js → redirect-editor-12sH-dI_.js} +1 -1
- package/dist/client/assets/registry-Cm3vYfs6.js +2 -0
- package/dist/client/assets/{registry-layout-BZ34q9_g.js → registry-layout-CtJukSU3.js} +1 -1
- package/dist/client/assets/reports-Bg_ERdf3.js +1 -0
- package/dist/client/assets/{reports-DVYraJFa.js → reports-C0cRDU9Z.js} +1 -1
- package/dist/client/assets/{reports-onboarding-qyjOlUrU.js → reports-onboarding-pFT3c7OK.js} +1 -1
- package/dist/client/assets/{reports-tab-CvviuXSm.js → reports-tab-BQJ56vGJ.js} +2 -2
- package/dist/client/assets/{repositories-Cr9zCxlF.js → repositories-DxlK1sZm.js} +1 -1
- package/dist/client/assets/{repository-import-picker-f-9x5_dE.js → repository-import-picker-B-0buJzG.js} +1 -1
- package/dist/client/assets/{repository-picker-BUcKVsp1.js → repository-picker-CvOapNuA.js} +1 -1
- package/dist/client/assets/{require-capability-DIAZVIUA.js → require-capability-D8-cLH0O.js} +1 -1
- package/dist/client/assets/{required-auth-layout-C6uKGAkK.js → required-auth-layout-nAeHro2C.js} +1 -1
- package/dist/client/assets/{reset-password-B9Kytu_p.js → reset-password-KPmVfZLN.js} +1 -1
- package/dist/client/assets/{resizable-BCEp9Elx.js → resizable-CaD_7NrF.js} +1 -1
- package/dist/client/assets/{review-settings-qXj6dD0l.js → review-settings-Dv9oD1xX.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-BrmBB2j2.js → rich-text-link-control-Cq9RUtOT.js} +1 -1
- package/dist/client/assets/{roles-D6erruW_.js → roles-CVdqwi42.js} +1 -1
- package/dist/client/assets/{route-tyO-k881.js → route-BUMOvuH4.js} +1 -1
- package/dist/client/assets/{route-CmZQ1AQ0.js → route-DN7wZbNA.js} +1 -1
- package/dist/client/assets/{route-page-header-BUr3e-ra.js → route-page-header-Tsd-6Cn8.js} +1 -1
- package/dist/client/assets/{route-M1-d0G6M.js → route-y3ZDxqyP.js} +1 -1
- package/dist/client/assets/runnable-block-editor-DGtY1Zv9.js +16 -0
- package/dist/client/assets/{sandbox-lifecycle-context-CZpPS0j1.js → sandbox-lifecycle-context-CfWOVVqS.js} +1 -1
- package/dist/client/assets/{schema-CHL8_jWB.js → schema-DUqJejhF.js} +1 -1
- package/dist/client/assets/{scroll-area-CXTYyDBj.js → scroll-area-CIgEcLya.js} +1 -1
- package/dist/client/assets/{search-input-OeEY_aWb.js → search-input-B3-es9gF.js} +1 -1
- package/dist/client/assets/{search-toggle-B4GHPbD5.js → search-toggle-CWeFY_dj.js} +1 -1
- package/dist/client/assets/{secrets-DpBLF-Q6.js → secrets-Brvsggyp.js} +1 -1
- package/dist/client/assets/sections-editor-B-05AQOj.js +2 -0
- package/dist/client/assets/{select-D0baifrN.js → select-DfsEKJbm.js} +1 -1
- package/dist/client/assets/{select-model-CmLziz3K.js → select-model-CleoV9x2.js} +1 -1
- package/dist/client/assets/seo-editor-AfoTf_sl.js +1 -0
- package/dist/client/assets/{separator-BjkdR6rZ.js → separator-BCH1SSgW.js} +1 -1
- package/dist/client/assets/{settings-tab-C0QSOJCY.js → settings-tab-DBXW5_vQ.js} +1 -1
- package/dist/client/assets/{sheet-5ssYXkXq.js → sheet-Qh31aIRZ.js} +1 -1
- package/dist/client/assets/{shell-layout-Dv1BAQBH.js → shell-layout-DYX27G-z.js} +1 -1
- package/dist/client/assets/{sidebar-DIKvlDwY.js → sidebar-BAkTFwFo.js} +1 -1
- package/dist/client/assets/{skill-preview-DaL0R4QE.js → skill-preview-Nll1AtTk.js} +1 -1
- package/dist/client/assets/{skills-oEqOsX33.js → skills-DTPrbPu0.js} +1 -1
- package/dist/client/assets/{sso-C2KqzLvQ.js → sso-Czivj0x0.js} +1 -1
- package/dist/client/assets/{store-DU14BrMb.js → store-UzV50FV7.js} +1 -1
- package/dist/client/assets/store-registry-B1kPOdQI.js +2 -0
- package/dist/client/assets/{switch-C6Il1ZWh.js → switch-DWqIDJ3O.js} +1 -1
- package/dist/client/assets/{synced-repos-_SV0wn-k.js → synced-repos-kO5pdppG.js} +1 -1
- package/dist/client/assets/{table-CTz-n2bW.js → table-DgqVpAo1.js} +1 -1
- package/dist/client/assets/{tabs-DSWYIolk.js → tabs-BEx3OU7l.js} +1 -1
- package/dist/client/assets/{task-board-DKe3wdiq.js → task-board-DLfMOW_8.js} +1 -1
- package/dist/client/assets/{task-route-DBh2fSaQ.js → task-route-CkGfsxNk.js} +1 -1
- package/dist/client/assets/{task-status-BNxu2J3_.js → task-status-21xCC61j.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-D-F7-GoP.js → taskboard-analytics-DOuMPLlN.js} +1 -1
- package/dist/client/assets/tasks-DxsffEKe.js +1 -0
- package/dist/client/assets/{tasks-D4I3SBXQ.js → tasks-LkJTvBu2.js} +1 -1
- package/dist/client/assets/{textarea-CaQxICAV.js → textarea-Cwtz-yOm.js} +1 -1
- package/dist/client/assets/{thread-button-CfjjFhjy.js → thread-button-D3zUMivq.js} +1 -1
- package/dist/client/assets/{thread-intent-Cb9GZZN5.js → thread-intent-wwkArE2X.js} +1 -1
- package/dist/client/assets/{thread-route-DsBIhxCv.js → thread-route-COWJ_7fp.js} +1 -1
- package/dist/client/assets/{thread-route-Du4cHT2w.js → thread-route-DznAT7wl.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-_30HS_im.js → thread-sheet-body-snZ9Iybc.js} +1 -1
- package/dist/client/assets/{toggle-group-tppf_gd5.js → toggle-group-Bo2cSsBt.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DA2hOIxm.js → toolbar-icon-button-BzblaI4I.js} +1 -1
- package/dist/client/assets/{tooltip-zizb--cq.js → tooltip-BEf6aTZO.js} +1 -1
- package/dist/client/assets/{track-CnM6YABU.js → track-DApuAK3u.js} +1 -1
- package/dist/client/assets/{types-D5VCiqQr.js → types-BzVAUbhh.js} +1 -1
- package/dist/client/assets/{usage-stats-1eJOdcXv.js → usage-stats-BSt2dDR8.js} +1 -1
- package/dist/client/assets/{use-ai-providers-COtUB3xq.js → use-ai-providers-DVYwWTyn.js} +1 -1
- package/dist/client/assets/{use-automations-BUrDWVbs.js → use-automations-BqtxbVm_.js} +1 -1
- package/dist/client/assets/{use-autosave-qlFdTnRf.js → use-autosave-CXYg5RsP.js} +1 -1
- package/dist/client/assets/{use-connect-companion-BGRDt-7V.js → use-connect-companion-Bs3Z_qGO.js} +1 -1
- package/dist/client/assets/{use-connection-B6mAxHy2.js → use-connection-CzmGzELP.js} +1 -1
- package/dist/client/assets/{use-copy-CkPsgpMc.js → use-copy-CQrsne9w.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CvGsbVkj.js → use-create-virtual-mcp-CGCnGQc7.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-BzqONKX7.js → use-date-fns-locale-CRKOtAZ4.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-0Vkdi2aW.js → use-debounced-autosave-yvR2QU7b.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DrvAsscn.js → use-debounced-value-C-a_puXS.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DMSGgIrA.js → use-deco-credits-BIQjMMrw.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-D-Dz9w48.js → use-decopilot-events-DRhD2Cc7.js} +1 -1
- package/dist/client/assets/{use-delete-connection-C5Gjl97D.js → use-delete-connection-2vJ2zjf1.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BjSD_HI7.js → use-deployment-admin-GWym07lx.js} +1 -1
- package/dist/client/assets/{use-entitlements-BJ2fU3xk.js → use-entitlements-dBRqAbFm.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-q4MoMELy.js → use-fast-preview-draft-url-B7Qgsa-v.js} +1 -1
- package/dist/client/assets/{use-file-configs-B9J96Cm2.js → use-file-configs-B6uZyC72.js} +1 -1
- package/dist/client/assets/{use-in-settings-CmHVpB2J.js → use-in-settings-DyAVjDbV.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CAlJFrTh.js → use-infinite-scroll-CcgsC5jf.js} +1 -1
- package/dist/client/assets/{use-join-requests-DRcItn4u.js → use-join-requests-DoYX1y9p.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-YYCWz3ix.js → use-main-panel-tabs-B9Pup-Q4.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-BOuLM5gU.js → use-mcp-auth-status-CSFSJQJ9.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CxqTiuzZ.js → use-mcp-client-BwDqIa-x.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-iHzcvLJ6.js → use-mcp-prompts-D2CngFU9.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-TV22SR83.js → use-mcp-tools-K86rDboN.js} +1 -1
- package/dist/client/assets/{use-members-BFcRJRUN.js → use-members-B2TxxXOD.js} +1 -1
- package/dist/client/assets/{use-mobile-BUhktowg.js → use-mobile-CLWwR5Aq.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BBKSnPWE.js → use-navigate-to-agent-BIcgvM34.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-pkL0KGK6.js → use-open-billing-url-c9fzPVJm.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-D8SU0dQC.js → use-org-auth-client-CmCV5i0j.js} +1 -1
- package/dist/client/assets/{use-org-fs-v5nOxtD0.js → use-org-fs-D0pDtmA_.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-Bo1SAH6u.js → use-org-repo-syncs-BW8kPlcG.js} +1 -1
- package/dist/client/assets/{use-org-sso-RpMHawvG.js → use-org-sso-NlJ03wR7.js} +1 -1
- package/dist/client/assets/{use-organization-roles-B_FlXSsl.js → use-organization-roles-B6-izWAc.js} +1 -1
- package/dist/client/assets/{use-organization-settings-f8Kb8g_i.js → use-organization-settings-BTHpppJM.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-BxPg1yeZ.js → use-panel-navigate-BenzejcY.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-D4PcfZz_.js → use-project-native-view-presence-CyTXliV7.js} +1 -1
- package/dist/client/assets/{use-project-scope-CjIHPrZt.js → use-project-scope-D7-wTJxZ.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BhzX8XJt.js → use-registry-connections-CUAAz7MM.js} +1 -1
- package/dist/client/assets/{use-releases-BbtuIcVh.js → use-releases-k9mlHhXd.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-BqU_lr8I.js → use-reports-diagnostic-Bo5UPpHF.js} +1 -1
- package/dist/client/assets/{use-route-default-main-Cv1ggVfc.js → use-route-default-main-fCKVwPih.js} +1 -1
- package/dist/client/assets/{use-secrets-brlU-7jS.js → use-secrets-Baw7IrPl.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-Efm1fB5a.js → use-section-preview-base-O63Lf73f.js} +1 -1
- package/dist/client/assets/{use-session-runtime-N5BeCPEE.js → use-session-runtime-Dnm0gd3b.js} +1 -1
- package/dist/client/assets/{use-tags-C9WZJKFW.js → use-tags-Cj8a5sQE.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BKjmCR55.js → use-task-board-analytics-DQqMnWvr.js} +1 -1
- package/dist/client/assets/{use-task-metadata-BX8DOL0g.js → use-task-metadata-Boljq1dV.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-Cyl9wrzu.js → use-thread-outputs-7L7th-tQ.js} +1 -1
- package/dist/client/assets/{use-view-mode-BxRB1gja.js → use-view-mode-C8ke4I9f.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DJlu-91-.js → use-virtual-mcp-uu9PNGR2.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-gUtcvvm4.js +1 -0
- package/dist/client/assets/{useQueries-jWWqJE84.js → useQueries-CRgHMvR6.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Dv7yjDB_.js +1 -0
- package/dist/client/assets/{users-FxfWAMqM.js → users-DT2Xesmp.js} +1 -1
- package/dist/client/assets/{utils-Ho1uEbeL.js → utils-CveRowcI.js} +1 -1
- package/dist/client/assets/{variant-calendar-BGruXdFw.js → variant-calendar-fW6dt4KX.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-Bq6VeSQ8.js → variant-matcher-override-BROprMl9.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BHtFEfW-.js → view-mode-toggle-DlG1QZ85.js} +1 -1
- package/dist/client/assets/{virtual-mcp-mb0zKoMr.js → virtual-mcp-_6SDLM9f.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-Din-9LnG.js +0 -1
- package/dist/client/assets/agent-deck-CXES1XUt.js +0 -1
- package/dist/client/assets/agent-file-BA3EHF-e.js +0 -1
- package/dist/client/assets/agent-library-file-N4jZXvcS.js +0 -1
- package/dist/client/assets/agent-settings-BATbyIjT.js +0 -1
- package/dist/client/assets/agent-site-editor-code-7-NVo0xn.js +0 -2
- package/dist/client/assets/agent-view-SZrC183A.js +0 -1
- package/dist/client/assets/api-keys-Bv6qak-q.js +0 -1
- package/dist/client/assets/app-editor-GK1LWSuy.js +0 -1
- package/dist/client/assets/category-editor-B4_X4ad1.js +0 -1
- package/dist/client/assets/project-reports-DJxSltW7.js +0 -1
- package/dist/client/assets/project-tasks-BOvk6C5p.js +0 -1
- package/dist/client/assets/record-editor-DDVq3M39.js +0 -1
- package/dist/client/assets/registry-BOkJLVB2.js +0 -2
- package/dist/client/assets/reports-D1_eGgks.js +0 -1
- package/dist/client/assets/runnable-block-editor-nGBfZiGl.js +0 -16
- package/dist/client/assets/sections-editor-DN84ShBs.js +0 -2
- package/dist/client/assets/seo-editor-CZ2WoqrW.js +0 -1
- package/dist/client/assets/store-registry-C-Xpsd9_.js +0 -2
- package/dist/client/assets/tasks-DFMbWCSN.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DrRYdT6d.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-pDODlTU-.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as j,r as o,dp as Ce,dm as De,c as Pe,e as Ae,dj as ee,a0 as Ee,j as ye,K as M,z as _e}from"./index-
|
|
1
|
+
import{o as j,r as o,dp as Ce,dm as De,c as Pe,e as Ae,dj as ee,a0 as Ee,j as ye,K as M,z as _e}from"./index-Br65nWs8.js";import{u as Le}from"./use-mcp-client-BwDqIa-x.js";import{u as Ue}from"./use-session-runtime-Dnm0gd3b.js";import{u as Re,b as Oe}from"./chat-context-Xotq8Uwe.js";import{u as Be}from"./hooks-BRj1KGH0.js";import{e as ge}from"./backoff-8mStPHYB.js";import{b as Ne}from"./sandbox-url-D3mC8qhT.js";import{a as Fe}from"./use-virtual-mcp-uu9PNGR2.js";import{d as $e}from"./sandbox-start-errors-BK_aDCyt.js";function Ke(e,t){const n=j(t);return Ve({filters:{...e,status:"pending"}},n).length}function fe(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function Ve(e={},t){const n=j(t).getMutationCache(),s=o.useRef(e),u=o.useRef(null);return u.current===null&&(u.current=fe(n,e)),o.useEffect(()=>{s.current=e}),o.useSyncExternalStore(o.useCallback(c=>n.subscribe(()=>{const a=Ce(u.current,fe(n,s.current));u.current!==a&&(u.current=a,De.schedule(c))}),[n]),()=>u.current,()=>u.current)}async function qe(e,t,n){const s=await e.callTool({name:t,arguments:n});if(s.isError){const u=s.content?.[0]?.text??`Tool ${t} failed without a message`;throw new Error(u)}return s}const be=["SANDBOX_START"],W=new Map,He=e=>`${e.virtualMcpId}::${e.branch??""}`,Qe=e=>e.message.includes("retry shortly"),ie=new Set,le={mark:(e,t)=>ie.add(`${e}::${t}`),clear:(e,t)=>ie.delete(`${e}::${t}`),isStopped:(e,t)=>ie.has(`${e}::${t}`)};function Ye(e,t){const n=j();return Ae({mutationKey:be,retry:(s,u)=>Qe(u)&&s<6,retryDelay:s=>ge(5e3,500,s,2,0),mutationFn:async s=>{s.branch&&le.clear(s.virtualMcpId,s.branch);const u=He(s),c=W.get(u);if(c)return c;const a=(async()=>(await qe(e,"SANDBOX_START",s)).structuredContent)();W.set(u,a);try{return await a}finally{W.get(u)===a&&W.delete(u)}},onSuccess:()=>{ee(n),t?.onStarted?.()}})}function Rt(e,t){const n=Pe.c(3);let s;return n[0]!==t||n[1]!==e?(s={mutationKey:be,predicate:c=>{if(!e)return!1;const a=c.state.variables;return!a||a.virtualMcpId!==e?!1:(a.branch??"")===(t??"")}},n[0]=t,n[1]=e,n[2]=s):s=n[2],Ke(s)>0}function Se(e){return e==="installing"||e==="install-failed"||e==="starting"||e==="start-failed"||e==="running"||e==="crashed"}const Me={phase:null,lifecycle:{phase:"idle"},status:{state:"running"},branch:{kind:"unknown"},notFound:!1,scripts:[],activeProcesses:[],getBuffer:()=>"",hasData:()=>!1,subscribeChunks:()=>()=>{},subscribeReload:()=>()=>{}},ve=o.createContext(Me),me=16384;class je{data="";append(t){this.data+=t,this.data.length>me&&(this.data=this.data.slice(this.data.length-me))}get(){return this.data}clear(){this.data=""}}const Ge=1e3,Xe=3e4,Ie=3e3,he=["lifecycle","status","tasks","scripts","branch","reload","file-changed"],pe="log";function Je(e){if(!e)return null;try{return new URL("/_sandbox/events",e).href}catch{return null}}function We(e){return e===404}async function ze(e){try{const t=await fetch(e,{headers:{Accept:"text/event-stream"},cache:"no-store",signal:AbortSignal.timeout(Ie)});return await t.body?.cancel().catch(()=>{}),We(t.status)}catch{return!1}}function gt({virtualMcpId:e,branch:t,previewUrl:n=null,enabled:s=!0,children:u}){const{org:c}=Ee(),a=j(),V=Re()?.taskId??null,[G,E]=o.useState(null),[te,b]=o.useState({phase:"idle"}),[ne,U]=o.useState({state:"running"}),[re,y]=o.useState({kind:"unknown"}),[X,h]=o.useState(!1),[k,q]=o.useState([]),[se,R]=o.useState([]),[,H]=o.useState(0),v=o.useRef(new Map),O=o.useRef(new Set),w=o.useRef(new Set),C=o.useRef(null),p=Je(n),Q=Fe(e)?.metadata?.runtime?.selected==="deno",_=d=>{let S=v.current.get(d);return S||(S=new je,v.current.set(d,S)),S};o.useEffect(()=>{if(E(null),b({phase:"idle"}),U({state:"running"}),y({kind:"unknown"}),C.current=null,h(!1),q([]),R([]),v.current.clear(),!e||!t||!s)return;const d=Ne({orgSlug:c.slug,virtualMcpId:e,branch:t,threadId:V??null},"events");let S=!1,D=0,L=null,T=null,P=null,g=null,m=null,A=null;const I=r=>{try{const i=JSON.parse(r.data);E(i),i.kind!=="failed"&&(h(!1),D=0),i.kind==="ready"&&ae()}catch(i){console.warn("[vm-events] bad phase payload",i)}},B=()=>{h(!0),E(null),b({phase:"idle"}),U({state:"running"}),y({kind:"unknown"}),q([]),R([]),v.current.clear()},Y=r=>{try{const i=JSON.parse(r.data);if(typeof i.data!="string")return;D=0;const f=i.data.replace(/\r?\n/g,`\r
|
|
2
2
|
`);_(i.source).append(f);for(const l of O.current)try{l(i.source,f)}catch{}H(l=>l+1)}catch{}},J=r=>{const i=r.type;try{const f=JSON.parse(r.data);switch(D=0,i){case"lifecycle":{const l=f;b(l.state);const F=`${c.slug}/${e}/${t}`;if(Se(l.state.phase)&&!(A&&Se(A))){ee(a,c.id);const K=M.decofile(F);a.getQueryData(K)===void 0&&a.invalidateQueries({queryKey:K})}l.state.phase==="running"&&A!=="running"&&(ee(a,c.id),a.invalidateQueries({queryKey:M.decofile(F)}),a.invalidateQueries({queryKey:M.liveMeta(c.slug,e,t)})),A=l.state.phase;const $=l.state.phase==="running"?l.state.port:null,ce=C.current;if(C.current=$,ce!==null&&$!==null&&ce!==$)for(const K of w.current)try{K()}catch{}return}case"status":U(f);return;case"tasks":{const F=f.active.map($=>$.logName??"").filter(Boolean);R(F);return}case"scripts":q(f.scripts);return;case"branch":{const l=f.meta;y(l);return}case"reload":for(const l of w.current)try{l()}catch{}return;case"file-changed":{const{path:l}=f,F=`${c.slug}/${e}/${t}`;if(l.startsWith(".deco/")||l.includes("/.deco/")){if(!(A==="running"))return;P&&clearTimeout(P),P=setTimeout(()=>{if(P=null,a.invalidateQueries({queryKey:M.decofile(F)}),Q)for(const K of w.current)try{K()}catch{}},500)}else T&&clearTimeout(T),T=setTimeout(()=>{T=null,a.invalidateQueries({queryKey:M.liveMeta(c.slug,e,t)})},1e3);return}}}catch{}};function N(){if(S)return;const r=new EventSource(d);g=r,r.onopen=()=>{},r.onerror=()=>{g===r&&r.readyState===EventSource.CLOSED&&x("studio")},r.addEventListener("phase",I),r.addEventListener("gone",B),r.addEventListener(pe,Y);for(const i of he)r.addEventListener(i,J)}function ae(){if(S||!p||m)return;const r=new EventSource(p);m=r;let i=!1;r.onopen=()=>{if(S||m!==r)return;i=!0,D=0;const f=g;g=null,f?.close()},r.onerror=()=>{m===r&&r.readyState===EventSource.CLOSED&&ue(r,i)},r.addEventListener(pe,Y);for(const f of he)r.addEventListener(f,J)}async function ue(r,i){const f=p?await ze(p):!1;if(!(S||m!==r)){if(r.close(),m=null,f){B(),g||N();return}i&&x("direct")}}function x(r){if(S||L)return;const i=ge(Xe,Ge,D,2,0);D++,L=setTimeout(()=>{if(L=null,!S){if(r==="direct"){m?.close(),m=null,ae();return}g?.close(),g=null,N()}},i)}return N(),()=>{S=!0,g?.close(),m?.close(),L&&clearTimeout(L),T&&clearTimeout(T),P&&clearTimeout(P)}},[e,t,c.slug,c.id,s,V,p,a,Q]);const oe={phase:G,lifecycle:te,status:ne,branch:re,notFound:X,scripts:k,activeProcesses:se,getBuffer:d=>v.current.get(d)?.get()??"",hasData:d=>(v.current.get(d)?.get().length??0)>0,subscribeChunks:d=>(O.current.add(d),()=>{O.current.delete(d)}),subscribeReload:d=>(w.current.add(d),()=>{w.current.delete(d)})};return ye.jsx(ve,{value:oe,children:u})}function de(){return o.use(ve)}function bt(e){const{subscribeChunks:t}=de(),n=o.useRef(e);n.current=e,o.useEffect(()=>t((c,a)=>{n.current?.(c,a)}),[t])}function vt(e){const{subscribeReload:t}=de(),n=o.useRef(e);n.current=e,o.useEffect(()=>t(()=>{n.current?.()}),[t])}function Ze(e){return e.appPaused||e.userStopped?{kind:"suspended"}:e.startError&&!e.previewUrl?{kind:"errored",error:e.startError}:e.previewUrl?{kind:"iframe",previewUrl:e.previewUrl}:{kind:"starting"}}function et(e){return e.executionEnabled&&e.sessionRuntime==="sandbox"&&e.hasActiveGithubRepo&&!!e.userId&&!!e.branch&&!e.vmEntry&&!e.userStopped&&!e.isPending&&!e.attempted}function wt(e){return e.threadLoaded&&e.isOwner&&e.hasActiveGithubRepo&&!e.branch&&!e.attempted}function tt(e){return e.executionEnabled&&e.notFound&&!!e.deadVmId&&!e.isPending&&!e.userStopped&&e.deadVmId!==e.lastDeadVmId}function Tt(e){const{agentSandboxMap:t,threadSandboxMap:n,userId:s,branch:u}=e,c=e.ownerId??s;if(!s||!c||!u)return t;const a=n?.[c]?.[u];return a?{...t??{},[s]:{...t?.[s]??{},[u]:a}}:t}function z(e,t,n){const s={virtualMcpId:e};return t&&(s.branch=t),n&&(s.threadId=n),s}const we=2,nt=new Set(["scheduling-timeout","reconciler-error","claim-never-created","unknown"]);function Te(e){return nt.has(e)}function rt(e){return e.executionEnabled&&e.failedReason!==null&&Te(e.failedReason)&&e.attempts<we&&!e.isPending&&!e.userStopped&&!e.alreadyHandled}const st={branch:null,count:0,handled:!1};function ot(e,t){return e.branch===t?e:{branch:t,count:0,handled:!1}}function at(e){return e.mutationError?e.mutationError:e.phase?.kind==="failed"&&!e.startPending&&e.claimRetryExhausted?{code:null,message:e.phase.message}:null}function ut(e){switch(e.kind){case"suspended":return"suspended";case"iframe":return"running";case"starting":return"starting";case"errored":return"errored"}}function xe(e,t){return`${e??""}::${t??""}`}function ct(e){const t=e.vmEntry?.previewUrl??null;return t||(e.seeded?.key===e.key?e.seeded.url:null)}function Z(e){const{data:t,virtualMcpId:n,branch:s}=e;t?.branch&&!s&&e.setCurrentTaskBranch(t.branch),t?.previewUrl&&e.setSeededPreviewUrl({key:xe(n,t.branch??s),url:t.previewUrl})}const it={branch:null,previewState:{kind:"starting"},status:"idle",vmEntry:null,previewUrl:null,userStopped:!1,start:()=>{},stop:async()=>{},restart:async()=>{},retry:()=>{},resume:()=>{}},ke=o.createContext(it);function xt(){return o.use(ke)}function kt({executionEnabled:e,virtualMcpId:t,branch:n,userId:s,hasActiveGithubRepo:u,vmEntry:c,threadId:a,children:V}){const{org:G}=Ee(),{setCurrentTaskBranch:E}=Oe(),te=Be(),b=de(),ne=j(),U=Ue(t),re=U.resolved?U.runtime:null,y=Re()?.taskId??null,X=Le({connectionId:_e,orgId:G.id,orgSlug:G.slug}),h=Ye(X,{onStarted:()=>{a&&te?.refreshThreadMetadata(a)}}),{mutate:k,reset:q}=h,[se,R]=o.useState(null),H=o.useRef(new Set),v=o.useRef(null),[O,w]=o.useState(st),C=ot(O,n);C!==O&&w(C);const p=b.phase?.kind==="failed"?b.phase:null,Q=ct({vmEntry:c,seeded:p?null:se,key:xe(t,n)}),_=!!t&&!!n&&le.isStopped(t,n),oe=b.status.state==="paused",d=!p||!Te(p.reason)||C.count>=we,S=at({mutationError:h.isError&&h.error?$e(h.error.message):null,phase:b.phase,startPending:h.isPending,claimRetryExhausted:d}),D=Ze({previewUrl:Q,appPaused:oe,userStopped:_,startError:S}),L=ut(D),T=n??"",P=H.current.has(T),g=et({executionEnabled:e,hasActiveGithubRepo:u,userId:s,branch:n,vmEntry:c,userStopped:_,isPending:h.isPending,attempted:P,sessionRuntime:re});o.useEffect(()=>{if(!g||!t)return;H.current.add(T);const x=z(t,n,y);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:E,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] auto-start failed:",r)}})},[g,T,n,t,y,k,E,R]);const m=b.notFound?c?.sandboxHandle??null:null,A=tt({executionEnabled:e,notFound:b.notFound,deadVmId:m,lastDeadVmId:v.current,isPending:h.isPending,userStopped:_});o.useEffect(()=>{if(!A||!m||!t)return;v.current=m;const x=z(t,n,y);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:E,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] self-heal failed:",r)}})},[A,m,t,n,y,k,E,R]);const I=rt({executionEnabled:e,failedReason:p?.reason??null,attempts:C.count,isPending:h.isPending,userStopped:_,alreadyHandled:C.handled});o.useEffect(()=>{if(!p){w(r=>r.handled?{...r,handled:!1}:r);return}if(!I||!t)return;w(r=>({...r,handled:!0,count:r.count+1}));const x=z(t,n,y);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:E,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] claim auto-retry failed:",r)}})},[p,I,t,n,y,k,E,R]);const B=()=>{if(!e||!t)return;const x=z(t,n,y);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:E,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] user start failed:",r)}})},Y=async()=>{if(!(!e||!t||!n)&&c){le.mark(t,n);try{await X.callTool({name:"SANDBOX_DELETE",arguments:{virtualMcpId:t,branch:n}})}catch{}ee(ne)}},J=async()=>{await Y(),B()},N=()=>{H.current=new Set,v.current=null,w({branch:n,count:0,handled:!1}),q(),B()},ue={branch:n,previewState:D,status:L,vmEntry:c,previewUrl:Q,userStopped:_,start:B,stop:Y,restart:J,retry:N,resume:N};return ye.jsx(ke,{value:ue,children:V})}export{gt as S,kt as a,Ye as b,de as c,xt as d,bt as e,vt as f,Ke as g,Tt as o,wt as s,Rt as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ao as a,bM as t,ap as e,bN as c,bO as d,bP as p,bQ as m}from"./index-
|
|
1
|
+
import{ao as a,bM as t,ap as e,bN as c,bO as d,bP as p,bQ as m}from"./index-Br65nWs8.js";const i=500;a({title:e().max(i),url:e().max(i),icon:e().max(i)});a({registries:d(e().max(i),a({enabled:t()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:c(e().max(i)).describe("List of MCP app_name or app_id values to hide from the store.")});const s=a({keyId:e().max(i),modelId:e().max(i),title:e().max(i).optional()}).nullable();p(["fast","smart","thinking","image","web_search","deep_research"]);p(["fast","smart","thinking"]);const _=a({tiers:a({fast:s,smart:s,thinking:s,image:s,web_search:s,deep_research:s})});a({tiers:a({fast:s.optional(),smart:s.optional(),thinking:s.optional()})});a({ids:c(e().max(i)).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});const y=a({home_task_intake_enabled:t().optional().describe("Show Task mode on the Home composer and allow reports to start tasks."),demo_mode:t().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:t().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),reviewer_enabled:t().optional().describe("Run the Reviewer on a task's pull request once it's In Review — it reviews the code with the repo's stack-appropriate skills, fixes what it finds on the PR's own branch, then exercises the change on the deploy preview and approves or hands the card to a human."),qa_agent_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),code_reviewer_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),auto_merge:t().optional().describe("When the Reviewer approves a task's pull request, merge it automatically instead of leaving the merge to a human."),auto_resolve_conflicts:t().optional().describe("When an approved pull request can't be merged because it conflicts with its base branch, hand it back to the Super Agent to resolve the conflict (check out the branch, merge the base, push). Unset, it follows `auto_merge`; set it explicitly to run one without the other."),cheap_reviewer_model:t().optional().describe("Run the Reviewer on a cheaper model than the Super Agent that wrote the code. On by default — turning it off trades cost for some review depth."),coding_agent_org_mcps:t().optional().describe("Give a coding-agent run (the claude-code harness in a sandbox) every MCP connection in the org as its own MCP server, on top of the narrow task-run surface it always gets. Off by default: each connection is one more server the agent connects to at session start, and all of their tools land in its context."),coding_agents_claude_code:t().optional().describe("Run chats on a Code Agent (an agent imported from a GitHub repo) with the claude-code harness inside its sandbox, instead of hosted Decopilot. Off by default: it changes the runtime of every such chat, and claude-code flushes whole turns rather than streaming tokens."),auto_assign_report_tasks_to_super_agent:t().optional().describe("When a report import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned."),hosting_enabled:t().optional().describe("Per-site Hosting tab (deployments, domains, deploy outcomes). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),deco_analytics_enabled:t().optional().describe("Per-site Deco Analytics tab (traffic, realtime, usage & limits). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),e2e_enabled:t().optional().describe("Per-site E2E tab (end-to-end test runs). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),experiments_enabled:t().optional().describe("Per-site Experiments tab (A/B tests + variant results). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org."),monitor_enabled:t().optional().describe("Per-site Monitor tab (CDN Performance + Audience from the stats-lake warehouse). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. Its own deployment-wide switch `MONITOR_GA` opens it to every org at once (independent of the control-plane trio)."),delivery_lanes_enabled:t().optional().describe("Board lanes for shipping: Approved, Merged and Post-deploy Validation sit between In Review and Done, and a merged pull request lands on Merged instead of Done. For teams whose release process continues after the merge. Off by default — with it off the board and the state machine behave exactly as if the lanes did not exist."),cms_auto_fresh_branch:t().optional().describe("When a user opens the CMS on a branch whose last commit is older than the staleness window (2 days), move the session to a freshly minted branch cut from the default branch. The stale branch is left intact on GitHub. Off by default.")}),b=new Set(["reviewer_enabled","cheap_reviewer_model"]);function v(n,r){const h=n?.[r];return b.has(r)?h!==!1:h===!0}function x(n){const r=n?.auto_resolve_conflicts;return typeof r=="boolean"?r:n?.auto_merge===!0}const l=256*1024,f=50,o=500,u=5e3;a({id:e().describe("Brand context ID"),name:e().max(o).describe("Company name"),domain:e().max(o).describe("Company domain (e.g. example.com)"),overview:e().max(u).describe("Company overview / description"),logo:e().max(o).nullable().optional().describe("Logo URL"),favicon:e().max(o).nullable().optional().describe("Favicon URL"),ogImage:e().max(o).nullable().optional().describe("OG image URL"),fonts:a({heading:e().max(o).optional().describe("Font family for headings"),body:e().max(o).optional().describe("Font family for body text"),code:e().max(o).optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:a({primary:e().max(o).optional().describe("Primary brand color (hex)"),secondary:e().max(o).optional().describe("Secondary brand color (hex)"),accent:e().max(o).optional().describe("Accent / highlight color (hex)"),background:e().max(o).optional().describe("Background color (hex)"),foreground:e().max(o).optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:c(d(e(),m())).max(f).nullable().optional().refine(n=>n==null||JSON.stringify(n).length<=l,{message:`images must serialize to at most ${l} bytes`}).describe("Brand images"),metadata:d(e(),m()).nullable().optional().refine(n=>n==null||JSON.stringify(n).length<=l,{message:`metadata must serialize to at most ${l} bytes`}).describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:e().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:t().optional().describe("Whether this is the default brand for the organization")});export{b as D,y as O,_ as S,x as a,v as o};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,bo as A,bv as ce,j as b,bq as _,bH as ae,dk as O,br as C,bA as P,bt as ie,c as F,l as $}from"./index-fmzc-5YR.js";import{e as de}from"./select-D0baifrN.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,m]=q(U),G=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[a,c]=d.useState(null),[u,i]=d.useState(null),[h,f]=d.useState(null),[S,w]=d.useState(null),[T,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,H]=d.useState(!1),v=A(e,R=>c(R)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:i,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:T,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:H,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});G.displayName=U;var J="ScrollAreaViewport",K=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=m(J,o),a=d.useRef(null),c=A(e,a,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});K.displayName=J;var g="ScrollAreaScrollbar",Q=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,a=r.orientation==="horizontal";return d.useEffect(()=>(a?n(!0):s(!0),()=>{a?n(!1):s(!1)}),[a,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(V,{...l,ref:e}):null});Q.displayName=g;var he=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),[n,s]=d.useState(!1);return d.useEffect(()=>{const a=t.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},i=()=>{c=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",i),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",i)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>c("SCROLL_END"),100),[a,c]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,t.scrollHideDelay,c]),d.useEffect(()=>{const u=t.viewport,i=n?"scrollLeft":"scrollTop";if(u){let h=u[i];const f=()=>{const S=u[i];h!==S&&(c("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,c,s]),b.jsx(O,{present:o||a!=="hidden",children:b.jsx(V,{"data-state":a==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z=d.forwardRef((r,e)=>{const o=m(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=d.useState(!1),a=r.orientation==="horizontal",c=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,i=o.viewport.offsetHeight<o.viewport.scrollHeight;s(a?u:i)}},10);return E(o.viewport,c),E(o.content,c),b.jsx(O,{present:l||n,children:b.jsx(V,{"data-state":n?"visible":"hidden",...t,ref:e})})}),V=d.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=m(g,r.__scopeScrollArea),n=d.useRef(null),s=d.useRef(0),[a,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(a.viewport,a.content),i={...l,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,a,S)}return o==="horizontal"?b.jsx(Se,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=B(f,a,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(ve,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=B(f,a);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=A(e,c,n.onScrollbarXChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.x),onDragScroll:i=>r.onDragScroll(i.x),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+i.deltaX;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),ve=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=A(e,c,n.onScrollbarYChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.y),onDragScroll:i=>r.onDragScroll(i.y),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollTop+i.deltaY;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[me,ee]=q(g),re=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:i,onResize:h,...f}=r,S=m(g,o),[w,T]=d.useState(null),Y=A(e,v=>T(v)),x=d.useRef(null),L=d.useRef(""),M=S.viewport,j=l.content-l.viewport,D=P(i),y=P(c),N=X(h,10);function H(v){if(x.current){const p=v.clientX-x.current.left,R=v.clientY-x.current.top;u({x:p,y:R})}}return d.useEffect(()=>{const v=p=>{const R=p.target;w?.contains(R)&&D(p,j)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,j,D]),d.useEffect(y,[l,y]),E(w,N),E(S.content,N),b.jsx(me,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(a),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),H(v))}),onPointerMove:C(r.onPointerMove,H),onPointerUp:C(r.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),W="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(W,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=m(W,o),s=ee(W,o),{onThumbPositionChange:a}=s,c=A(e,h=>s.onThumbChange(h)),u=d.useRef(void 0),i=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(i(),!u.current){const S=xe(h,a);u.current=S,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,i,a]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,T=h.clientY-S.top;s.onThumbPointerDown({x:w,y:T})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=W;var k="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=m(k,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=k;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=m(k,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return E(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),E(t.scrollbarY,()=>{const i=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(i),s(i)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:a,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,a=t-s,c=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-a,i=o.content-o.viewport,h=l==="ltr"?[0,i]:[i*-1,0];return le([c,u],h)(r)}function B(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,a=n-l,c=o==="ltr"?[0,s]:[s*-1,0],u=de(r,c);return le([0,s],[0,a])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,a=o.top!==n.top;(s||a)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(l.current),[]),d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function E(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=G,Ce=K,Re=te;function _e(r){const e=F.c(21);let o,l,t,n,s;e[0]!==r?({className:l,children:o,hideScrollbar:n,viewportRef:s,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n,e[5]=s):(o=e[1],l=e[2],t=e[3],n=e[4],s=e[5]);const a=n===void 0?!1:n;let c;e[6]!==l?(c=$("relative h-full w-full",l),e[6]=l,e[7]=c):c=e[7];let u;e[8]!==o?(u=b.jsx("div",{className:"flex min-w-0 flex-col",children:o}),e[8]=o,e[9]=u):u=e[9];let i;e[10]!==u||e[11]!==s?(i=b.jsx(Ce,{ref:s,"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Ee,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Re,{}),e[15]=f):f=e[15];let S;return e[16]!==t||e[17]!==c||e[18]!==i||e[19]!==h?(S=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[i,h,f]}),e[16]=t,e[17]=c,e[18]=i,e[19]=h,e[20]=S):S=e[20],S}function Ee(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,a=n===void 0?!1:n,c=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",i=a&&"hidden";let h;e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==i?(h=$("select-none touch-none p-px transition-colors",c,u,i,o),e[5]=o,e[6]=c,e[7]=u,e[8]=i,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S};
|
|
1
|
+
import{r as d,bo as A,bv as ce,j as b,bq as _,bH as ae,dk as O,br as C,bA as P,bt as ie,c as F,l as $}from"./index-Br65nWs8.js";import{e as de}from"./select-DfsEKJbm.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,m]=q(U),G=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[a,c]=d.useState(null),[u,i]=d.useState(null),[h,f]=d.useState(null),[S,w]=d.useState(null),[T,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,H]=d.useState(!1),v=A(e,R=>c(R)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:i,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:T,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:H,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});G.displayName=U;var J="ScrollAreaViewport",K=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=m(J,o),a=d.useRef(null),c=A(e,a,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});K.displayName=J;var g="ScrollAreaScrollbar",Q=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,a=r.orientation==="horizontal";return d.useEffect(()=>(a?n(!0):s(!0),()=>{a?n(!1):s(!1)}),[a,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(V,{...l,ref:e}):null});Q.displayName=g;var he=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),[n,s]=d.useState(!1);return d.useEffect(()=>{const a=t.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},i=()=>{c=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",i),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",i)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>c("SCROLL_END"),100),[a,c]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,t.scrollHideDelay,c]),d.useEffect(()=>{const u=t.viewport,i=n?"scrollLeft":"scrollTop";if(u){let h=u[i];const f=()=>{const S=u[i];h!==S&&(c("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,c,s]),b.jsx(O,{present:o||a!=="hidden",children:b.jsx(V,{"data-state":a==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z=d.forwardRef((r,e)=>{const o=m(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=d.useState(!1),a=r.orientation==="horizontal",c=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,i=o.viewport.offsetHeight<o.viewport.scrollHeight;s(a?u:i)}},10);return E(o.viewport,c),E(o.content,c),b.jsx(O,{present:l||n,children:b.jsx(V,{"data-state":n?"visible":"hidden",...t,ref:e})})}),V=d.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=m(g,r.__scopeScrollArea),n=d.useRef(null),s=d.useRef(0),[a,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(a.viewport,a.content),i={...l,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,a,S)}return o==="horizontal"?b.jsx(Se,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=B(f,a,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(ve,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=B(f,a);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=A(e,c,n.onScrollbarXChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.x),onDragScroll:i=>r.onDragScroll(i.x),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+i.deltaX;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),ve=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=A(e,c,n.onScrollbarYChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.y),onDragScroll:i=>r.onDragScroll(i.y),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollTop+i.deltaY;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[me,ee]=q(g),re=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:i,onResize:h,...f}=r,S=m(g,o),[w,T]=d.useState(null),Y=A(e,v=>T(v)),x=d.useRef(null),L=d.useRef(""),M=S.viewport,j=l.content-l.viewport,D=P(i),y=P(c),N=X(h,10);function H(v){if(x.current){const p=v.clientX-x.current.left,R=v.clientY-x.current.top;u({x:p,y:R})}}return d.useEffect(()=>{const v=p=>{const R=p.target;w?.contains(R)&&D(p,j)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,j,D]),d.useEffect(y,[l,y]),E(w,N),E(S.content,N),b.jsx(me,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(a),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),H(v))}),onPointerMove:C(r.onPointerMove,H),onPointerUp:C(r.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),W="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(W,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=m(W,o),s=ee(W,o),{onThumbPositionChange:a}=s,c=A(e,h=>s.onThumbChange(h)),u=d.useRef(void 0),i=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(i(),!u.current){const S=xe(h,a);u.current=S,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,i,a]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,T=h.clientY-S.top;s.onThumbPointerDown({x:w,y:T})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=W;var k="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=m(k,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=k;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=m(k,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return E(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),E(t.scrollbarY,()=>{const i=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(i),s(i)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:a,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,a=t-s,c=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-a,i=o.content-o.viewport,h=l==="ltr"?[0,i]:[i*-1,0];return le([c,u],h)(r)}function B(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,a=n-l,c=o==="ltr"?[0,s]:[s*-1,0],u=de(r,c);return le([0,s],[0,a])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,a=o.top!==n.top;(s||a)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(l.current),[]),d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function E(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=G,Ce=K,Re=te;function _e(r){const e=F.c(21);let o,l,t,n,s;e[0]!==r?({className:l,children:o,hideScrollbar:n,viewportRef:s,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n,e[5]=s):(o=e[1],l=e[2],t=e[3],n=e[4],s=e[5]);const a=n===void 0?!1:n;let c;e[6]!==l?(c=$("relative h-full w-full",l),e[6]=l,e[7]=c):c=e[7];let u;e[8]!==o?(u=b.jsx("div",{className:"flex min-w-0 flex-col",children:o}),e[8]=o,e[9]=u):u=e[9];let i;e[10]!==u||e[11]!==s?(i=b.jsx(Ce,{ref:s,"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Ee,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Re,{}),e[15]=f):f=e[15];let S;return e[16]!==t||e[17]!==c||e[18]!==i||e[19]!==h?(S=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[i,h,f]}),e[16]=t,e[17]=c,e[18]=i,e[19]=h,e[20]=S):S=e[20],S}function Ee(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,a=n===void 0?!1:n,c=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",i=a&&"hidden";let h;e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==i?(h=$("select-none touch-none p-px transition-colors",c,u,i,o),e[5]=o,e[6]=c,e[7]=u,e[8]=i,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as b,l as w,j as a,h as j}from"./index-
|
|
1
|
+
import{c as b,l as w,j as a,h as j}from"./index-Br65nWs8.js";import{i as v}from"./SearchMd-Ds8nq6dr.js";function k(f){const e=b.c(17),{value:l,onChange:c,placeholder:m,onKeyDown:u,className:d,isSearching:p,disabled:r}=f,x=m===void 0?"Search...":m,h=r&&"pointer-events-none opacity-50";let t;e[0]!==d||e[1]!==h?(t=w("flex items-center gap-4 rounded-lg bg-[var(--studio-input-background)] px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",h,d),e[0]=d,e[1]=h,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{className:"size-4 text-muted-foreground/75 shrink-0"}):a.jsx(v,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=g=>c(g.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==r||e[8]!==u||e[9]!==x||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:u,placeholder:x,disabled:r,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=r,e[8]=u,e[9]=x,e[10]=s,e[11]=l,e[12]=o):o=e[12];let i;return e[13]!==t||e[14]!==n||e[15]!==o?(i=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=i):i=e[16],i}export{k as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as K,r as C,l as B,j as a}from"./index-
|
|
1
|
+
import{c as K,r as C,l as B,j as a}from"./index-Br65nWs8.js";import{i as I}from"./SearchMd-Ds8nq6dr.js";import{i as M}from"./X-DNbfDZJ4.js";import{I as O}from"./icon-button-BCUJR5XB.js";function H(S){const e=K.c(34),{value:t,onChange:s,label:E,placeholder:D,clearLabel:F,expanded:o,className:j}=S,w=E===void 0?"Search":E,d=D===void 0?"Search…":D,y=F===void 0?"Clear search":F,[L,p]=C.useState(t!==""),[R,z]=C.useState(!1),[V,$]=C.useState(t);if(t!==V&&($(t),t===""&&!R&&p(!1)),!L&&!o){let l,g;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>p(!0),g=a.jsx(I,{}),e[0]=l,e[1]=g):(l=e[0],g=e[1]);let v;return e[2]!==w?(v=a.jsx(O,{label:w,tooltipSide:"bottom",variant:"secondary",onClick:l,children:g}),e[2]=w,e[3]=v):v=e[3],v}const _=o?"h-10 w-full px-3":"h-7 w-32 animate-search-expand px-2.5 sm:w-44";let n;e[4]!==j||e[5]!==_?(n=B("inline-flex shrink-0 items-center gap-1.5 overflow-hidden rounded-full bg-card text-card-foreground card-shadow",_,j),e[4]=j,e[5]=_,e[6]=n):n=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx(I,{className:"size-4 shrink-0 text-muted-foreground"}),e[7]=x):x=e[7];const k=!o;let r;e[8]!==s?(r=l=>s(l.target.value),e[8]=s,e[9]=r):r=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>z(!0),e[10]=h):h=e[10];let i;e[11]!==t?(i=()=>{z(!1),t===""&&p(!1)},e[11]=t,e[12]=i):i=e[12];let c;e[13]!==s?(c=l=>{l.key==="Escape"&&s("")},e[13]=s,e[14]=c):c=e[14];const N=o?"text-sm":"text-xs";let f;e[15]!==N?(f=B("w-full min-w-0 bg-transparent outline-none placeholder:text-muted-foreground",N),e[15]=N,e[16]=f):f=e[16];let u;e[17]!==d||e[18]!==i||e[19]!==c||e[20]!==f||e[21]!==k||e[22]!==r||e[23]!==t?(u=a.jsx("input",{autoFocus:k,value:t,onChange:r,onFocus:h,onBlur:i,onKeyDown:c,placeholder:d,"aria-label":d,className:f}),e[17]=d,e[18]=i,e[19]=c,e[20]=f,e[21]=k,e[22]=r,e[23]=t,e[24]=u):u=e[24];let m;e[25]!==y||e[26]!==o||e[27]!==s||e[28]!==t?(m=t!==""&&a.jsx("button",{type:"button","aria-label":y,onMouseDown:P,onClick:()=>{s(""),o||p(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:a.jsx(M,{className:"size-3.5"})}),e[25]=y,e[26]=o,e[27]=s,e[28]=t,e[29]=m):m=e[29];let b;return e[30]!==u||e[31]!==m||e[32]!==n?(b=a.jsxs("div",{className:n,children:[x,u,m]}),e[30]=u,e[31]=m,e[32]=n,e[33]=b):b=e[33],b}function P(S){return S.preventDefault()}export{H as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,b as C,j as s,n as w,e$ as F,E as L,r as y,aQ as O,Z as B,B as z,R as E,t as _}from"./index-
|
|
1
|
+
import{c as v,b as C,j as s,n as w,e$ as F,E as L,r as y,aQ as O,Z as B,B as z,R as E,t as _}from"./index-Br65nWs8.js";import{i as R}from"./AlertCircle-CN63l28E.js";import{s as A}from"./Plus-B5qlUYQA.js";import{s as I}from"./User01-A5yQ_wrz.js";import{t as q}from"./Users01-BxbX_-HF.js";import{D as V,b as H,c as Q,d as Z,h as G,e as J}from"./dialog-DAOqbLTM.js";import{I as P}from"./input-WrUCYwPA.js";import{L as D}from"./label-VZgjitSh.js";import{S as K,b as M,a as U,d as W,c as $}from"./select-DfsEKJbm.js";import{T as X}from"./textarea-Cwtz-yOm.js";import{u as Y,a as ee}from"./use-secrets-Baw7IrPl.js";import{R as te}from"./require-capability-D8-cLH0O.js";import"./X-DNbfDZJ4.js";import"./index-CvuZZryV.js";import"./ChevronUp-CWbL6T1G.js";import"./access-gate-BN4Zc3yN.js";import"./capability-load-error-BW7ikFrl.js";function se(t){const e=v.c(6),{error:r}=t,n=C();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(R,{size:16}),e[0]=c):c=e[0];let i;e[1]!==r.message||e[2]!==n?(i=n("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=n,e[3]=i):i=e[3];let l;return e[4]!==i?(l=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:i})]}),e[4]=i,e[5]=l):l=e[5],l}function re(t){const e=v.c(8),{scope:r}=t,n=C(),c=r==="user"?I:q;let i;e[0]!==r||e[1]!==n?(i=n(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=n,e[2]=i):i=e[2];const l=i;let a;e[3]!==c?(a=s.jsx(c,{size:12}),e[3]=c,e[4]=a):a=e[4];let o;return e[5]!==l||e[6]!==a?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[a,l]}),e[5]=l,e[6]=a,e[7]=o):o=e[7],o}function T(t){const e=v.c(20),{secret:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(E,{size:16,className:"text-muted-foreground"})}),e[0]=n):n=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let i;e[3]!==r.scope?(i=s.jsx(re,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let l;e[5]!==c||e[6]!==i?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[c,i]}),e[5]=c,e[6]=i,e[7]=l):l=e[7];let a;e[8]!==r.description?(a=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=a):a=e[9];let o;e[10]!==l||e[11]!==a?(o=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[n,s.jsxs("div",{className:"min-w-0",children:[l,a]})]}),e[10]=l,e[11]=a,e[12]=o):o=e[12];let m;e[13]!==r.createdAt?(m=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=m):m=e[14];let d;e[15]!==m?(d=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:m}),e[15]=m,e[16]=d):d=e[16];let u;return e[17]!==o||e[18]!==d?(u=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[o,d]}),e[17]=o,e[18]=d,e[19]=u):u=e[19],u}function ne(t){const e=v.c(15),{action:r}=t,n=C();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(E,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let i;e[1]!==n?(i=n("settings.secrets.emptyTitle"),e[1]=n,e[2]=i):i=e[2];let l;e[3]!==i?(l=s.jsx("p",{className:"font-medium text-sm",children:i}),e[3]=i,e[4]=l):l=e[4];let a;e[5]!==n?(a=n("settings.secrets.emptyDescription"),e[5]=n,e[6]=a):a=e[6];let o;e[7]!==a?(o=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:a}),e[7]=a,e[8]=o):o=e[8];let m;e[9]!==l||e[10]!==o?(m=s.jsxs("div",{children:[l,o]}),e[9]=l,e[10]=o,e[11]=m):m=e[11];let d;return e[12]!==r||e[13]!==m?(d=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,m,r]}),e[12]=r,e[13]=m,e[14]=d):d=e[14],d}function k({open:t,onOpenChange:e}){const r=C(),[n,c]=y.useState("organization"),[i,l]=y.useState(""),[a,o]=y.useState(""),[m,d]=y.useState(""),u=ee();function b(){c("organization"),l(""),o(""),d("")}function g(){b(),e(!1)}async function S(x){if(x.preventDefault(),!(!i.trim()||!a))try{await u.mutateAsync({scope:n,name:i.trim(),value:a,description:m.trim()||void 0}),_.success(r("settings.secrets.secretCreated",{name:i.trim()})),g()}catch(j){_.error(j instanceof Error?j.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(V,{open:t,onOpenChange:x=>{x?e(x):g()},children:s.jsxs(H,{className:"sm:max-w-lg",children:[s.jsxs(Q,{children:[s.jsx(Z,{children:r("settings.secrets.newSecretTitle")}),s.jsx(G,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:S,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(D,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(K,{value:n,onValueChange:x=>c(x),children:[s.jsx(M,{id:"secret-scope",children:s.jsx(U,{})}),s.jsxs(W,{children:[s.jsx($,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx($,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(D,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(P,{id:"secret-name",value:i,onChange:x=>l(x.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(D,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(P,{id:"secret-value",type:"password",value:a,onChange:x=>o(x.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(D,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(X,{id:"secret-description",value:m,onChange:x=>d(x.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(J,{children:[s.jsx(z,{type:"button",variant:"outline",onClick:g,disabled:u.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(z,{type:"submit",disabled:u.isPending||!i.trim()||!a,children:u.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function ie(){const t=v.c(36),e=B(),r=C(),n=Y(),[c,i]=y.useState(!1);let l,a;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>i(!0),a=s.jsx(A,{size:14}),t[0]=l,t[1]=a):(l=t[0],a=t[1]);let o;t[2]!==r?(o=r("settings.secrets.newSecret"),t[2]=r,t[3]=o):o=t[3];let m;t[4]!==o?(m=s.jsx(w.Actions,{children:s.jsxs(z,{size:"sm",onClick:l,children:[a,o]})}),t[4]=o,t[5]=m):m=t[5];const d=m;if(n.length===0){const j=e&&d,N=!e&&d;let h;t[6]!==N?(h=s.jsx(ne,{action:N}),t[6]=N,t[7]=h):h=t[7];let f;t[8]!==c?(f=s.jsx(k,{open:c,onOpenChange:i}),t[8]=c,t[9]=f):f=t[9];let p;return t[10]!==j||t[11]!==h||t[12]!==f?(p=s.jsxs(s.Fragment,{children:[j,h,f]}),t[10]=j,t[11]=h,t[12]=f,t[13]=p):p=t[13],p}let u,b,g;if(t[14]!==d||t[15]!==n||t[16]!==r){const j=n.filter(oe),N=n.filter(ae),h=n.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let f;t[20]!==n.length||t[21]!==r||t[22]!==h?(f=r(h,{count:n.length}),t[20]=n.length,t[21]=r,t[22]=h,t[23]=f):f=t[23];let p;t[24]!==f?(p=s.jsx("p",{className:"text-sm text-muted-foreground",children:f}),t[24]=f,t[25]=p):p=t[25],t[26]!==d||t[27]!==p?(u=s.jsxs("div",{className:"flex items-center justify-between",children:[p,d]}),t[26]=d,t[27]=p,t[28]=u):u=t[28],b=j.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:r("settings.secrets.sectionOrganization")}),s.jsx("div",{children:j.map(le)})]}):null,g=N.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:r("settings.secrets.sectionPrivate")}),s.jsx("div",{children:N.map(ce)})]}):null,t[14]=d,t[15]=n,t[16]=r,t[17]=u,t[18]=b,t[19]=g}else u=t[17],b=t[18],g=t[19];let S;t[29]!==c?(S=s.jsx(k,{open:c,onOpenChange:i}),t[29]=c,t[30]=S):S=t[30];let x;return t[31]!==u||t[32]!==b||t[33]!==g||t[34]!==S?(x=s.jsxs(s.Fragment,{children:[u,b,g,S]}),t[31]=u,t[32]=b,t[33]=g,t[34]=S,t[35]=x):x=t[35],x}function ce(t){return s.jsx(T,{secret:t},t.id)}function le(t){return s.jsx(T,{secret:t},t.id)}function ae(t){return t.scope==="user"}function oe(t){return t.scope==="organization"}function de(){const t=v.c(7),e=C();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let n;t[2]!==r?(n=s.jsx(w.Title,{children:r}),t[2]=r,t[3]=n):n=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(L,{fallback:me,children:s.jsx(y.Suspense,{fallback:s.jsx(O,{className:"h-32 w-full"}),children:s.jsx(ie,{})})}),t[4]=c):c=t[4];let i;return t[5]!==n?(i=s.jsx(w,{children:s.jsx(w.Content,{children:s.jsx(w.Container,{children:s.jsxs(F,{children:[n,c]})})})}),t[5]=n,t[6]=i):i=t[6],i}function me(t){const{error:e}=t;return s.jsx(se,{error:e??new Error("Failed to load secrets")})}function Pe(){const t=v.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(te,{capability:"secrets:manage",area:"secrets",children:s.jsx(de,{})}),t[0]=e):e=t[0],e}export{Pe as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as St,b as Ht,r as k,l as Ke,j as s,aO as cs,Z as cn,B as ut,F as us,G as yt,I as ds,aN as ms,H as fs,aM as Ua,o as qa,h as Wa,t as L,K as Ya}from"./index-Br65nWs8.js";import{u as Ja}from"./chat-context-Xotq8Uwe.js";import{I as ps,J as Qa,K as Za,L as gs,N as Xa,O as eo,V as to,Q as no,T as hs,U as so,W as ao,X as zt,Y as vs,G as Rt,Z as Rn,_ as wn,$ as vt,C as on,y as rn,a0 as Mt,e as oo,f as ro,h as io,u as lo,a1 as Jn,a2 as co,a3 as uo,a4 as mo,a5 as fo,a6 as po,p as tn,a7 as go,A as jt,a8 as Ot,a9 as ho,aa as vo,ab as at,ac as Qn,z as yo,ad as So,ae as Zn,af as bo,ag as xo,ah as Xn,H as Pt,ai as nn,aj as es,M as _o,ak as ts,al as ht,am as Eo,an as jo,ao as ko,F as Ro,ap as wo,aq as To,ar as kt,as as Vo,at as No,au as Ao,d as Do,av as ns,aw as Ft,ax as ss,ay as Po,az as Mo,aA as Co,aB as Ko,aC as jn,aD as Bo,aE as Io,aF as Lo,aG as Oo,aH as Fo}from"./runnable-block-editor-DGtY1Zv9.js";import{d as zo}from"./use-virtual-mcp-uu9PNGR2.js";import{n as $o,t as Ho}from"./ChevronUp-CWbL6T1G.js";import{z as Tn,bj as Go,a2 as Vn,a5 as Uo,o as qo,P as Wo,x as Yo}from"./agent-icon-syzsjQqD.js";import{i as ys}from"./Globe01-cK-boe1F.js";import{S as sn}from"./scroll-area-CIgEcLya.js";import{c as Ct,T as Kt,a as Bt}from"./tooltip-BEf6aTZO.js";import{m as Jo,u as Qo,P as Zo}from"./mustache-DqsxB6HM.js";import{b as Ss,G as Xo,e as er,j as tr,g as nr,r as an,M as as}from"./claim-phase-copy-0btUuJoC.js";import{a as bs}from"./Copy01-txk4D2dp.js";import{c as xs}from"./UserSquare-DGrBwjoh.js";import{i as sr}from"./Settings02-DuHT9CDs.js";import{s as ar}from"./Eye-PUFPRogI.js";import{s as or}from"./TrendUp01-Cz4fAV8R.js";import{s as Nn}from"./Plus-B5qlUYQA.js";import{s as _s}from"./Trash01-BOgDvBV9.js";import{i as rr}from"./Zap-D3w7YXbH.js";import{a as Es,b as ln,d as js,K as ks,P as Rs,u as ws,C as Ts,s as Vs,e as $t,D as Ns,c as As,S as Ds,v as Ps}from"./rich-text-link-control-Cq9RUtOT.js";import{s as ir}from"./safe-image-url-D5z803Ot.js";import{a as lr,P as cr,b as ur}from"./page-seo-form-CtYPF938.js";import{a as dr}from"./Tool01-D-kKamzo.js";import{u as mr,A as fr}from"./use-section-preview-base-O63Lf73f.js";import{b as os,a as pr}from"./variant-matcher-override-BROprMl9.js";import"./use-panel-navigate-BenzejcY.js";import"./thread-route-DznAT7wl.js";import"./use-project-scope-D7-wTJxZ.js";import"./github-repo-BknN0SVI.js";import"./autosend-D2vNE1-H.js";import"./thread-intent-wwkArE2X.js";import"./slugify-CEUa2lfQ.js";import"./hooks-BRj1KGH0.js";import"./use-mcp-client-BwDqIa-x.js";import"./auth-CqLAsH9H.js";import"./backoff-8mStPHYB.js";import"./task-board-DLfMOW_8.js";import"./schema-DUqJejhF.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-entitlements-dBRqAbFm.js";import"./use-ai-providers-DVYwWTyn.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-DRhD2Cc7.js";import"./use-organization-settings-BTHpppJM.js";import"./use-session-runtime-Dnm0gd3b.js";import"./decofile-api-BlHdyJaj.js";import"./utils-CveRowcI.js";import"./ZoomOut-CkMxedob.js";import"./Image01-Cu23ajxK.js";import"./sandbox-url-D3mC8qhT.js";import"./Play-DWkCdYVe.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-DFnpHOLp.js";import"./Stars01-NMjfS8aT.js";import"./Tool02-C3PJKwXL.js";import"./ArrowRight-DwJbToqY.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-BnDH8Aa2.js";import"./use-copy-CQrsne9w.js";import"./usage-stats-BSt2dDR8.js";import"./markdown-nDkdLMAq.js";import"./dialog-DAOqbLTM.js";import"./X-DNbfDZJ4.js";import"./Download01-C_uRJg-E.js";import"./org-file-open-context-fmLHly5t.js";import"./use-mobile-CLWwR5Aq.js";import"./shell-layout-DYX27G-z.js";import"./avatar-BktXtsSk.js";import"./User01-A5yQ_wrz.js";import"./Globe04-DZ4La14w.js";import"./SearchLg-DgVGxGAk.js";import"./XClose-BI_rRQ4C.js";import"./download-app-dialog-DD-_m3bO.js";import"./CheckCircle-DwE2PFQ4.js";import"./Monitor01-D4NGGSSY.js";import"./Share07-Gti5eVBm.js";import"./command-CtXsvJo3.js";import"./index-BMb1lZlu.js";import"./SearchMd-Ds8nq6dr.js";import"./integration-icon-CHq-tZ5S.js";import"./project-icon-Dz0CHIad.js";import"./required-auth-layout-nAeHro2C.js";import"./use-org-sso-NlJ03wR7.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-C-t-oEUy.js";import"./types-BzVAUbhh.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-p26Hg4rs.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./AlertCircle-CN63l28E.js";import"./LinkExternal01-BvYYsTzi.js";import"./sheet-Qh31aIRZ.js";import"./use-connection-CzmGzELP.js";import"./Palette-D4pYAcww.js";import"./use-navigate-to-agent-BIcgvM34.js";import"./Link01-CCMhgKQC.js";import"./use-mcp-prompts-D2CngFU9.js";import"./index-COmcBRgq.js";import"./form-Pq1VF9SG.js";import"./label-VZgjitSh.js";import"./input-WrUCYwPA.js";import"./use-thread-outputs-7L7th-tQ.js";import"./file-type-icon-PokUk1QC.js";import"./popover-jThH4hZX.js";import"./monaco-editor-6DU5W3RO.js";import"./editor-CPbQohDU.js";import"./calendar-CKLBRofA.js";import"./textarea-Cwtz-yOm.js";import"./select-DfsEKJbm.js";import"./index-CvuZZryV.js";import"./switch-DWqIDJ3O.js";import"./Upload01-bRtRcrf0.js";import"./DotsVertical-Chx4AR6B.js";import"./search-input-B3-es9gF.js";import"./tabs-BEx3OU7l.js";import"./use-debounced-value-C-a_puXS.js";import"./use-file-configs-B6uZyC72.js";import"./asset-utils-CEYQNtbb.js";import"./useInfiniteQuery-gUtcvvm4.js";import"./infiniteQueryObserver-C6uoSRRm.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./toggle-group-Bo2cSsBt.js";import"./alert-dialog-C-7JcYKm.js";import"./sandbox-git-api-CMdpE2TE.js";import"./ArrowUp-DYxdR5t4.js";import"./ArrowLeft-gXpdVjjZ.js";import"./CreditCard01-CjsiyuM0.js";import"./Key01-C4vmDBWq.js";import"./LayoutLeft-B6FExgE9.js";import"./Sun-bZ7LINy-.js";import"./Package-BHKlCKgA.js";import"./Users01-BxbX_-HF.js";import"./XCircle-yvuIGIaV.js";import"./section-preview-url-Csj0_ZDg.js";function gr(c){return c.schema?.definitions??c.schema?.$defs??{}}function Ms(c,e){const o=gr(e),l=o[btoa(c)];if(!l)return[];const p=[l];if(Array.isArray(l.allOf)){const x=l.allOf.find(b=>typeof b.$ref=="string")?.$ref;if(typeof x=="string"){const b=o[x.replace("#/definitions/","")];b&&p.push(b)}}return p}function hr(c,e){for(const o of Ms(c,e)){const l=typeof o.image=="string"?o.image:void 0;if(l?.includes("{{{"))return l}}function vr(c,e){if(!e)return;const o=ps(c);if(!o)return;const l=hr(o.resolveType,e);if(!l)return;const p=Qa(l,o.data);if(p)return ir(p)}const yr={escape:Za};function Sr(c,e){for(const o of Ms(c,e)){const l=typeof o.title=="string"?o.title:void 0;if(l?.includes("{{"))return l}}function br(c,e){if(!e)return;const o=ps(c);if(o)try{const l=Sr(o.resolveType,e);return l&&Jo.render(l,o.data,{},yr).trim()||void 0}catch{return}}const xr="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",_r="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function rs(c){return Array.from({length:c},(e,o)=>({id:crypto.randomUUID(),index:o}))}function Cs(c){return c.map((e,o)=>({...e,index:o}))}function Er(c,e){if(e===c.length)return c;if(e<c.length)return Cs(c.slice(0,e));const o=Array.from({length:e-c.length},(l,p)=>({id:crypto.randomUUID(),index:c.length+p}));return[...c,...o]}function Ks(c){const e=St.c(38),{section:o,raw:l,meta:p,decofile:x}=c,b=cn(),y=o.isSavedBlock===!0,N=o.isMultivariate===!0;let E;e[0]!==p||e[1]!==l?(E=l&&p?vr(l,p):void 0,e[0]=p,e[1]=l,e[2]=E):E=e[2];const P=E;let ne;e[3]!==p||e[4]!==N||e[5]!==l||e[6]!==y?(ne=l&&p&&!y&&!N?br(l,p):void 0,e[3]=p,e[4]=N,e[5]=l,e[6]=y,e[7]=ne):ne=e[7];const Z=ne;let U;e[8]!==x||e[9]!==p||e[10]!==l||e[11]!==o?(U=no(l,o,x,p),e[8]=x,e[9]=p,e[10]=l,e[11]=o,e[12]=U):U=e[12];const V=U,m=N?Go:xs;let v;e[13]!==N||e[14]!==y?(v=y?{color:Xo}:N?{color:"oklch(0.65 0.15 160)"}:void 0,e[13]=N,e[14]=y,e[15]=v):v=e[15];const O=v;let q;e[16]!==m||e[17]!==b||e[18]!==O?(q=b?s.jsxs("span",{className:"relative size-4 shrink-0",children:[s.jsx(m,{className:"absolute inset-0 size-4 transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0",style:O}),s.jsx(Vn,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):s.jsx(Vn,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[16]=m,e[17]=b,e[18]=O,e[19]=q):q=e[19];let i;e[20]!==P?(i=P&&s.jsx("img",{src:P,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[20]=P,e[21]=i):i=e[21];let F;e[22]!==b||e[23]!==O?(F=!b&&s.jsx(Tn,{className:"h-4 w-4 shrink-0",style:O}),e[22]=b,e[23]=O,e[24]=F):F=e[24];const d=o.isHidden&&"line-through opacity-50";let W;e[25]!==d?(W=Ke("min-w-0 flex-1 truncate text-sm font-medium",d),e[25]=d,e[26]=W):W=e[26];const X=Z??o.label;let se;e[27]!==X||e[28]!==W?(se=s.jsx("span",{className:W,children:X}),e[27]=X,e[28]=W,e[29]=se):se=e[29];let _e;e[30]!==V?(_e=V&&s.jsx(so,{className:"absolute -right-0.5 -top-0.5"}),e[30]=V,e[31]=_e):_e=e[31];let Ie;return e[32]!==se||e[33]!==_e||e[34]!==q||e[35]!==i||e[36]!==F?(Ie=s.jsxs(s.Fragment,{children:[q,i,F,se,_e]}),e[32]=se,e[33]=_e,e[34]=q,e[35]=i,e[36]=F,e[37]=Ie):Ie=e[37],Ie}const jr="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",kr="w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",Rr="w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100";function kn(c,e){return Ke("h-7 shrink-0 overflow-hidden",e?jr:c?Rr:kr)}function Bs(c,e){const o=c.isSavedBlock===!0,l=c.isMultivariate===!0;return Ke("group relative flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?xr:l?hs:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function wr(c){const e=St.c(85),{section:o,raw:l,meta:p,decofile:x,sortableId:b,selected:y,onSelect:N,onDelete:E,onDuplicate:P,onMakeReusable:ne,onToggleHidden:Z,onToggleLazy:U,onAddVariant:V,onDetach:m}=c,v=Ht(),O=cn(),q=l?Ss(l.__resolveType??""):!1,i=o.isHidden===!0,F=q||i;let d;e[0]!==o?(d=Xa(o),e[0]=o,e[1]=d):d=e[1];const W=d;let X;e[2]!==b?(X={id:b,animateLayoutChanges:Dr},e[2]=b,e[3]=X):X=e[3];const{attributes:se,listeners:_e,setNodeRef:Ie,transform:Te,isDragging:g}=ws(X);let M;e[4]!==Te?(M=Ts.Transform.toString(Te?{...Te,x:0}:null),e[4]=Te,e[5]=M):M=e[5];const ke=g?0:void 0;let D;e[6]!==M||e[7]!==ke?(D={transform:M,opacity:ke},e[6]=M,e[7]=ke,e[8]=D):D=e[8];const He=D;let K;e[9]!==o?(K=eo(o),e[9]=o,e[10]=K):K=e[10];const Ge=K;let ae;e[11]!==N?(ae=R=>{(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),N())},e[11]=N,e[12]=ae):ae=e[12];const Ue=g?"cursor-grabbing":"cursor-pointer";let Je;e[13]!==o||e[14]!==y||e[15]!==Ue?(Je=Ke("touch-none transition-colors",Ue,Bs(o,y)),e[13]=o,e[14]=y,e[15]=Ue,e[16]=Je):Je=e[16];let ze;e[17]!==x||e[18]!==p||e[19]!==l||e[20]!==o?(ze=s.jsx(Ks,{section:o,raw:l,meta:p,decofile:x}),e[17]=x,e[18]=p,e[19]=l,e[20]=o,e[21]=ze):ze=e[21];let ye;e[22]!==i||e[23]!==v?(ye=v(i?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[22]=i,e[23]=v,e[24]=ye):ye=e[24];let Ve;e[25]!==Z?(Ve=R=>{R.stopPropagation(),Z()},e[25]=Z,e[26]=Ve):Ve=e[26];let Ee;e[27]!==i?(Ee=i?s.jsx(sr,{className:"h-3.5 w-3.5"}):s.jsx(ar,{className:"h-3.5 w-3.5"}),e[27]=i,e[28]=Ee):Ee=e[28];let z;e[29]!==i||e[30]!==v?(z=v(i?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[29]=i,e[30]=v,e[31]=z):z=e[31];let A;e[32]!==z?(A=s.jsx(Bt,{side:"bottom",children:z}),e[32]=z,e[33]=A):A=e[33];const me=ds,Se=us,Le=!0,Ne=ut,J="button",fe="ghost",Ce="icon";let oe;e[34]!==v?(oe=v("sectionsEditor.sectionList.sectionActionsMenu"),e[34]=v,e[35]=oe):oe=e[35];const ee=Ke(kn(F,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let pe;e[36]===Symbol.for("react.memo_cache_sentinel")?(pe=s.jsx(ms,{className:"h-3.5 w-3.5"}),e[36]=pe):pe=e[36];let Q;e[37]!==Ne||e[38]!==oe||e[39]!==ee?(Q=s.jsx(Ne,{type:J,variant:fe,size:Ce,"aria-label":oe,className:ee,onClick:Vr,onPointerDown:Tr,children:pe}),e[37]=Ne,e[38]=oe,e[39]=ee,e[40]=Q):Q=e[40];let ce;e[41]!==Se||e[42]!==Q?(ce=s.jsx(Se,{asChild:Le,children:Q}),e[41]=Se,e[42]=Q,e[43]=ce):ce=e[43];let je;e[44]!==P?(je=R=>{R.stopPropagation(),P()},e[44]=P,e[45]=je):je=e[45];let Ae;e[46]===Symbol.for("react.memo_cache_sentinel")?(Ae=s.jsx(bs,{className:"h-4 w-4"}),e[46]=Ae):Ae=e[46];let re;e[47]!==v?(re=v("sectionsEditor.sectionList.duplicateMenuItem"),e[47]=v,e[48]=re):re=e[48];let Re;e[49]!==je||e[50]!==re?(Re=s.jsxs(yt,{onClick:je,children:[Ae,re]}),e[49]=je,e[50]=re,e[51]=Re):Re=e[51];let ge;e[52]!==W||e[53]!==V||e[54]!==v?(ge=W&&s.jsxs(yt,{className:to,onClick:R=>{R.stopPropagation(),V()},children:[s.jsx(or,{className:"h-4 w-4"}),v("sectionsEditor.sectionList.addVariantMenuItem")]}),e[52]=W,e[53]=V,e[54]=v,e[55]=ge):ge=e[55];let Y;e[56]!==O||e[57]!==Ge||e[58]!==ne||e[59]!==v?(Y=Ge&&s.jsxs(yt,{className:_r,onClick:R=>{R.stopPropagation(),ne()},children:[O?s.jsx(ys,{className:"h-4 w-4"}):s.jsx(Tn,{className:"h-4 w-4"}),v("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[56]=O,e[57]=Ge,e[58]=ne,e[59]=v,e[60]=Y):Y=e[60];let B;e[61]!==O||e[62]!==m||e[63]!==o.isMultivariate||e[64]!==o.isSavedBlock||e[65]!==v?(B=o.isSavedBlock===!0&&!o.isMultivariate&&s.jsxs(yt,{onClick:R=>{R.stopPropagation(),m()},children:[O?s.jsx(xs,{className:"h-4 w-4"}):s.jsx(Tn,{className:"h-4 w-4"}),v("sectionsEditor.sectionList.detachMenuItem")]}),e[61]=O,e[62]=m,e[63]=o.isMultivariate,e[64]=o.isSavedBlock,e[65]=v,e[66]=B):B=e[66];let te;e[67]!==E?(te=R=>{R.stopPropagation(),E()},e[67]=E,e[68]=te):te=e[68];let be;e[69]===Symbol.for("react.memo_cache_sentinel")?(be=s.jsx(_s,{className:"h-4 w-4"}),e[69]=be):be=e[69];let ue;e[70]!==v?(ue=v("sectionsEditor.sectionList.deleteMenuItem"),e[70]=v,e[71]=ue):ue=e[71];let De;e[72]!==te||e[73]!==ue?(De=s.jsxs(yt,{className:"text-destructive focus:text-destructive",onClick:te,children:[be,ue]}),e[72]=te,e[73]=ue,e[74]=De):De=e[74];let ie;e[75]!==Re||e[76]!==ge||e[77]!==Y||e[78]!==B||e[79]!==De?(ie=s.jsxs(fs,{align:"end",className:"w-44",children:[Re,ge,Y,B,De]}),e[75]=Re,e[76]=ge,e[77]=Y,e[78]=B,e[79]=De,e[80]=ie):ie=e[80];let C;return e[81]!==me||e[82]!==ce||e[83]!==ie?(C=s.jsxs(me,{children:[ce,ie]}),e[81]=me,e[82]=ce,e[83]=ie,e[84]=C):C=e[84],s.jsxs("div",{ref:Ie,style:He,...se,..._e,role:"button",tabIndex:0,onClick:N,onKeyDown:ae,className:Je,children:[ze,!o.isMultivariate&&s.jsxs(Ct,{children:[s.jsx(Kt,{asChild:!0,children:s.jsx(ut,{type:"button",variant:"ghost",size:"icon","aria-label":v(q?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Ke(kn(F,q)),onClick:R=>{R.stopPropagation(),U()},onPointerDown:Ar,children:s.jsx(rr,{className:Ke("h-3.5 w-3.5",q&&"text-yellow-500")})})}),s.jsx(Bt,{side:"bottom",children:v(q?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),s.jsxs(Ct,{children:[s.jsx(Kt,{asChild:!0,children:s.jsx(ut,{type:"button",variant:"ghost",size:"icon","aria-label":ye,className:Ke(kn(F,i)),onClick:Ve,onPointerDown:Nr,children:Ee})}),A]}),C]})}function Tr(c){return c.stopPropagation()}function Vr(c){return c.stopPropagation()}function Nr(c){return c.stopPropagation()}function Ar(c){return c.stopPropagation()}function Dr(){return!1}function Pr(c){const e=St.c(106),{listKey:o,rawSections:l,sections:p,meta:x,decofile:b,selectedIndex:y,onSelect:N,onReorder:E,onDelete:P,onDuplicate:ne,onMakeReusable:Z,onToggleHidden:U,onToggleLazy:V,onAddVariant:m,onDetach:v,onAddSection:O,canAddSection:q}=c,i=q===void 0?!0:q,F=Ht();let d;e[0]!==p.length?(d=()=>rs(p.length),e[0]=p.length,e[1]=d):d=e[1];const[W,X]=k.useState(d),[se,_e]=k.useState(null),[Ie,Te]=k.useState(o),[g,M]=k.useState(p.length),ke=k.useRef(!1);Ie!==o?(Te(o),M(p.length),X(rs(p.length))):g!==p.length&&(M(p.length),X(ie=>Er(ie,p.length)));let D;e[2]===Symbol.for("react.memo_cache_sentinel")?(D={activationConstraint:{distance:8}},e[2]=D):D=e[2];let He;e[3]===Symbol.for("react.memo_cache_sentinel")?(He={coordinateGetter:Vs},e[3]=He):He=e[3];const K=Es(ln(Rs,D),ln(ks,He));let Ge;e[4]!==W?(Ge=W.map(Mr),e[4]=W,e[5]=Ge):Ge=e[5];const ae=Ge;let Ue;e[6]===Symbol.for("react.memo_cache_sentinel")?(Ue=ie=>{_e(String(ie.active.id))},e[6]=Ue):Ue=e[6];const Je=Ue;let ze;e[7]!==ae||e[8]!==E?(ze=ie=>{_e(null);const{active:C,over:R}=ie;if(!R||C.id===R.id)return;const Qe=ae.indexOf(String(C.id)),qe=ae.indexOf(String(R.id));Qe===-1||qe===-1||(X(dt=>Cs($t([...dt],Qe,qe))),ke.current=!0,requestAnimationFrame(()=>{ke.current=!1}),E?.(Qe,qe))},e[7]=ae,e[8]=E,e[9]=ze):ze=e[9];const ye=ze;let Ve;e[10]===Symbol.for("react.memo_cache_sentinel")?(Ve=()=>{_e(null)},e[10]=Ve):Ve=e[10];const Ee=Ve;let z,A,me,Se,Le,Ne,J,fe,Ce,oe,ee,pe,Q,ce,je;if(e[11]!==se||e[12]!==i||e[13]!==b||e[14]!==W||e[15]!==ae||e[16]!==ye||e[17]!==x||e[18]!==O||e[19]!==m||e[20]!==P||e[21]!==v||e[22]!==ne||e[23]!==Z||e[24]!==N||e[25]!==U||e[26]!==V||e[27]!==l||e[28]!==p||e[29]!==y||e[30]!==K||e[31]!==F){ce=Symbol.for("react.early_return_sentinel");e:{const ie=C=>{ke.current||N(C)};if(e[47]!==se||e[48]!==i||e[49]!==W||e[50]!==O||e[51]!==l||e[52]!==p||e[53]!==F){const C=se?W.find(R=>R.id===se):null;if(Se=C!=null?p[C.index]:null,me=C!=null?l[C.index]:void 0,W.length===0){let R;e[57]!==F?(R=F("sectionsEditor.sectionList.noSections"),e[57]=F,e[58]=R):R=e[58];let Qe;e[59]!==R?(Qe=s.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:R}),e[59]=R,e[60]=Qe):Qe=e[60];const qe=!i;let dt;e[61]===Symbol.for("react.memo_cache_sentinel")?(dt=s.jsx(Nn,{size:14}),e[61]=dt):dt=e[61];let Xe;e[62]!==F?(Xe=F("sectionsEditor.sectionList.addSectionButton"),e[62]=F,e[63]=Xe):Xe=e[63];let we;e[64]!==O||e[65]!==qe||e[66]!==Xe?(we=s.jsxs(ut,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:qe,onClick:O,children:[dt,Xe]}),e[64]=O,e[65]=qe,e[66]=Xe,e[67]=we):we=e[67];let Oe;e[68]!==Qe||e[69]!==we?(Oe=s.jsxs("div",{className:"space-y-2",children:[Qe,we]}),e[68]=Qe,e[69]=we,e[70]=Oe):Oe=e[70],ce=Oe;break e}Q=Ke(C&&"cursor-grabbing"),e[47]=se,e[48]=i,e[49]=W,e[50]=O,e[51]=l,e[52]=p,e[53]=F,e[54]=me,e[55]=Se,e[56]=Q}else me=e[54],Se=e[55],Q=e[56];A=Ns,fe=K,Ce=As,oe=Je,ee=ye,pe=Ee,z=Ds,Ne=ae,J=Ps,je="space-y-1",Le=W.map(C=>{const R=p[C.index];return R?s.jsx(wr,{sortableId:C.id,section:R,raw:l[C.index],meta:x,decofile:b,selected:y===C.index,onSelect:()=>ie(C.index),onDelete:()=>P(C.index),onDuplicate:()=>ne(C.index),onMakeReusable:()=>Z(C.index),onToggleHidden:()=>U(C.index),onToggleLazy:()=>V(C.index),onAddVariant:()=>m(C.index),onDetach:()=>v(C.index)},C.id):null})}e[11]=se,e[12]=i,e[13]=b,e[14]=W,e[15]=ae,e[16]=ye,e[17]=x,e[18]=O,e[19]=m,e[20]=P,e[21]=v,e[22]=ne,e[23]=Z,e[24]=N,e[25]=U,e[26]=V,e[27]=l,e[28]=p,e[29]=y,e[30]=K,e[31]=F,e[32]=z,e[33]=A,e[34]=me,e[35]=Se,e[36]=Le,e[37]=Ne,e[38]=J,e[39]=fe,e[40]=Ce,e[41]=oe,e[42]=ee,e[43]=pe,e[44]=Q,e[45]=ce,e[46]=je}else z=e[32],A=e[33],me=e[34],Se=e[35],Le=e[36],Ne=e[37],J=e[38],fe=e[39],Ce=e[40],oe=e[41],ee=e[42],pe=e[43],Q=e[44],ce=e[45],je=e[46];if(ce!==Symbol.for("react.early_return_sentinel"))return ce;let Ae;e[71]!==Le||e[72]!==je?(Ae=s.jsx("div",{className:je,children:Le}),e[71]=Le,e[72]=je,e[73]=Ae):Ae=e[73];let re;e[74]!==z||e[75]!==Ne||e[76]!==J||e[77]!==Ae?(re=s.jsx(z,{items:Ne,strategy:J,children:Ae}),e[74]=z,e[75]=Ne,e[76]=J,e[77]=Ae,e[78]=re):re=e[78];let Re;e[79]!==me||e[80]!==Se||e[81]!==b||e[82]!==x?(Re=Se?s.jsx("div",{className:Ke("cursor-grabbing shadow-lg ring-1 ring-border/60",Bs(Se,!1)),children:s.jsx(Ks,{section:Se,raw:me,meta:x,decofile:b})}):null,e[79]=me,e[80]=Se,e[81]=b,e[82]=x,e[83]=Re):Re=e[83];let ge;e[84]!==Re?(ge=cs.createPortal(s.jsx(js,{dropAnimation:gs,children:Re}),document.body),e[84]=Re,e[85]=ge):ge=e[85];let Y;e[86]!==A||e[87]!==fe||e[88]!==Ce||e[89]!==oe||e[90]!==ee||e[91]!==pe||e[92]!==re||e[93]!==ge?(Y=s.jsxs(A,{sensors:fe,collisionDetection:Ce,onDragStart:oe,onDragEnd:ee,onDragCancel:pe,children:[re,ge]}),e[86]=A,e[87]=fe,e[88]=Ce,e[89]=oe,e[90]=ee,e[91]=pe,e[92]=re,e[93]=ge,e[94]=Y):Y=e[94];const B=!i;let te;e[95]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx(Nn,{size:14}),e[95]=te):te=e[95];let be;e[96]!==F?(be=F("sectionsEditor.sectionList.addSectionButton"),e[96]=F,e[97]=be):be=e[97];let ue;e[98]!==O||e[99]!==B||e[100]!==be?(ue=s.jsxs(ut,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:B,onClick:O,children:[te,be]}),e[98]=O,e[99]=B,e[100]=be,e[101]=ue):ue=e[101];let De;return e[102]!==Q||e[103]!==Y||e[104]!==ue?(De=s.jsxs("div",{className:Q,children:[Y,ue]}),e[102]=Q,e[103]=Y,e[104]=ue,e[105]=De):De=e[105],De}function Mr(c){return c.id}function An(c){const e=St.c(5),{rule:o,matchers:l}=c,p=o?.__resolveType??"";let x;if(e[0]!==l||e[1]!==p){const E=l.find(P=>P.resolveType===p)?.iconName??ao(p);x=Uo(E),e[0]=l,e[1]=p,e[2]=x}else x=e[2];const b=x;if(!b)return null;let y;return e[3]!==b?(y=s.jsx(b,{size:14,className:"shrink-0"}),e[3]=b,e[4]=y):y=e[4],y}function is(c){return c.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
+
`)}function ls(c){return c.map((e,o)=>({id:crypto.randomUUID(),index:o,variant:e}))}function Cr(c,e){const o=new Map;for(const l of c){const p=o.get(l.variant.label);p?p.push(l):o.set(l.variant.label,[l])}return e.map((l,p)=>({id:o.get(l.label)?.shift()?.id??crypto.randomUUID(),index:p,variant:l}))}function Kr(c){return c.map((e,o)=>({...e,index:o}))}function Is(c){const e=St.c(19),{label:o,effectiveRule:l,matchers:p,canDelete:x,dragging:b,onRename:y,onDuplicate:N,onDelete:E}=c,P=Ht(),ne=cn();let Z;e[0]!==ne||e[1]!==b||e[2]!==l||e[3]!==p?(Z=ne?s.jsxs("span",{className:"relative size-4 shrink-0",children:[s.jsx("span",{className:Ke("absolute inset-0 flex items-center justify-center transition-opacity",b?"opacity-0":"group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"),children:s.jsx(An,{rule:l,matchers:p})}),s.jsx(Vn,{"aria-hidden":!0,className:Ke("absolute inset-0 size-4 transition-opacity",b?"opacity-100":"opacity-0 group-hover:opacity-100 group-has-[:focus-visible]:opacity-100")})]}):s.jsx(An,{rule:l,matchers:p}),e[0]=ne,e[1]=b,e[2]=l,e[3]=p,e[4]=Z):Z=e[4];let U;e[5]!==o?(U=s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:o}),e[5]=o,e[6]=U):U=e[6];let V;e[7]!==x||e[8]!==b||e[9]!==o||e[10]!==E||e[11]!==N||e[12]!==y||e[13]!==P?(V=!b&&s.jsxs(ds,{children:[s.jsx(us,{asChild:!0,children:s.jsx(ut,{type:"button",variant:"ghost",size:"icon","aria-label":P("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:o}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Ir,onPointerDown:Br,children:s.jsx(ms,{size:14})})}),s.jsxs(fs,{align:"end",className:"w-36",children:[s.jsxs(yt,{onClick:v=>{v.stopPropagation(),y?.()},children:[s.jsx(dr,{size:14}),P("sectionsEditor.pageVariantTabs.renameAction")]}),s.jsxs(yt,{onClick:v=>{v.stopPropagation(),N?.()},children:[s.jsx(bs,{size:14}),P("sectionsEditor.pageVariantTabs.duplicateAction")]}),s.jsx(Ua,{}),s.jsxs(yt,{variant:"destructive",disabled:!x,onClick:v=>{v.stopPropagation(),E?.()},children:[s.jsx(_s,{size:14}),P("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[7]=x,e[8]=b,e[9]=o,e[10]=E,e[11]=N,e[12]=y,e[13]=P,e[14]=V):V=e[14];let m;return e[15]!==Z||e[16]!==U||e[17]!==V?(m=s.jsxs(s.Fragment,{children:[Z,U,V]}),e[15]=Z,e[16]=U,e[17]=V,e[18]=m):m=e[18],m}function Br(c){return c.stopPropagation()}function Ir(c){return c.stopPropagation()}function Lr(c){const e=St.c(33),{entry:o,isActive:l,canDelete:p,decofile:x,meta:b,matchers:y,onSelect:N,onRename:E,onDuplicate:P,onDelete:ne}=c;let Z;e[0]!==o.id?(Z={id:o.id,animateLayoutChanges:Or},e[0]=o.id,e[1]=Z):Z=e[1];const{attributes:U,listeners:V,setNodeRef:m,transform:v,isDragging:O}=ws(Z);let q;e[2]!==v?(q=Ts.Transform.toString(v?{...v,x:0}:null),e[2]=v,e[3]=q):q=e[3];const i=O?0:void 0;let F;e[4]!==q||e[5]!==i?(F={transform:q,opacity:i},e[4]=q,e[5]=i,e[6]=F):F=e[6];const d=F,W=b??void 0;let X;e[7]!==x||e[8]!==o.variant.rule||e[9]!==W?(X=zt(o.variant.rule,x,W),e[7]=x,e[8]=o.variant.rule,e[9]=W,e[10]=X):X=e[10];const se=X;let _e;e[11]!==N?(_e=D=>{D.target===D.currentTarget&&(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),N())},e[11]=N,e[12]=_e):_e=e[12];const Ie=O?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",Te=l?vs:hs;let g;e[13]!==Ie||e[14]!==Te?(g=Ke("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",Ie,Te),e[13]=Ie,e[14]=Te,e[15]=g):g=e[15];let M;e[16]!==p||e[17]!==se||e[18]!==o.variant.label||e[19]!==y||e[20]!==ne||e[21]!==P||e[22]!==E?(M=s.jsx(Is,{label:o.variant.label,effectiveRule:se,matchers:y,canDelete:p,onRename:E,onDuplicate:P,onDelete:ne}),e[16]=p,e[17]=se,e[18]=o.variant.label,e[19]=y,e[20]=ne,e[21]=P,e[22]=E,e[23]=M):M=e[23];let ke;return e[24]!==U||e[25]!==V||e[26]!==N||e[27]!==m||e[28]!==d||e[29]!==g||e[30]!==M||e[31]!==_e?(ke=s.jsx("div",{ref:m,style:d,...U,...V,onClick:N,onKeyDown:_e,className:g,children:M}),e[24]=U,e[25]=V,e[26]=N,e[27]=m,e[28]=d,e[29]=g,e[30]=M,e[31]=_e,e[32]=ke):ke=e[32],ke}function Or(){return!1}function Fr(c){const e=St.c(9),{variant:o,decofile:l,meta:p,matchers:x}=c,b=p??void 0;let y;e[0]!==l||e[1]!==b||e[2]!==o.rule?(y=zt(o.rule,l,b),e[0]=l,e[1]=b,e[2]=o.rule,e[3]=y):y=e[3];const N=y;let E;e[4]===Symbol.for("react.memo_cache_sentinel")?(E=Ke("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",vs),e[4]=E):E=e[4];let P;return e[5]!==N||e[6]!==x||e[7]!==o.label?(P=s.jsx("div",{className:E,children:s.jsx(Is,{label:o.label,effectiveRule:N,matchers:x,canDelete:!1,dragging:!0})}),e[5]=N,e[6]=x,e[7]=o.label,e[8]=P):P=e[8],P}function zr(c){const e=St.c(91),{listKey:o,variants:l,activeIndex:p,decofile:x,meta:b,matchers:y,onSelect:N,onReorder:E,onRename:P,onDuplicate:ne,onDelete:Z,onAdd:U}=c,V=Ht();let m;e[0]!==l?(m=()=>ls(l),e[0]=l,e[1]=m):m=e[1];const[v,O]=k.useState(m),[q,i]=k.useState(null),[F,d]=k.useState(o),[W,X]=k.useState(l.length);let se;e[2]!==l?(se=()=>is(l),e[2]=l,e[3]=se):se=e[3];const[_e,Ie]=k.useState(se),Te=k.useRef(!1),g=is(l);F!==o?(d(o),X(l.length),Ie(g),O(ls(l))):(W!==l.length||_e!==g)&&(X(l.length),Ie(g),O(ge=>Cr(ge,l)));let M;e[4]===Symbol.for("react.memo_cache_sentinel")?(M={activationConstraint:{distance:8}},e[4]=M):M=e[4];let ke;e[5]===Symbol.for("react.memo_cache_sentinel")?(ke={coordinateGetter:Vs},e[5]=ke):ke=e[5];const D=Es(ln(Rs,M),ln(ks,ke));let He;e[6]!==v?(He=v.map($r),e[6]=v,e[7]=He):He=e[7];const K=He,Ge=l.length>1;let ae;e[8]!==v?(ae=ge=>{const Y=String(ge.active.id);i(v.find(B=>B.id===Y)??null)},e[8]=v,e[9]=ae):ae=e[9];const Ue=ae;let Je;e[10]!==K||e[11]!==E?(Je=ge=>{i(null);const{active:Y,over:B}=ge;if(!B||Y.id===B.id)return;const te=K.indexOf(String(Y.id)),be=K.indexOf(String(B.id));te===-1||be===-1||(O(ue=>Kr($t([...ue],te,be))),Te.current=!0,requestAnimationFrame(()=>{Te.current=!1}),E(te,be))},e[10]=K,e[11]=E,e[12]=Je):Je=e[12];const ze=Je;let ye;e[13]===Symbol.for("react.memo_cache_sentinel")?(ye=()=>{i(null)},e[13]=ye):ye=e[13];const Ve=ye;let Ee,z,A,me,Se,Le,Ne,J,fe,Ce,oe,ee,pe;if(e[14]!==p||e[15]!==Ge||e[16]!==x||e[17]!==v||e[18]!==K||e[19]!==ze||e[20]!==Ue||e[21]!==y||e[22]!==b||e[23]!==U||e[24]!==Z||e[25]!==ne||e[26]!==P||e[27]!==N||e[28]!==D||e[29]!==V){const ge=R=>{Te.current||N(R)};oe="space-y-1 border-b p-2";let Y;e[43]!==V?(Y=V("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=V,e[44]=Y):Y=e[44];let B;e[45]!==Y?(B=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:Y}),e[45]=Y,e[46]=B):B=e[46];let te;e[47]!==V?(te=V("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=V,e[48]=te):te=e[48];let be;e[49]===Symbol.for("react.memo_cache_sentinel")?(be=s.jsx(Nn,{size:14}),e[49]=be):be=e[49];let ue;e[50]!==U||e[51]!==te?(ue=s.jsx(Kt,{asChild:!0,children:s.jsx(ut,{type:"button",variant:"ghost",size:"icon","aria-label":te,className:"size-6",onClick:U,children:be})}),e[50]=U,e[51]=te,e[52]=ue):ue=e[52];let De;e[53]!==V?(De=V("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=V,e[54]=De):De=e[54];let ie;e[55]!==De?(ie=s.jsx(Bt,{children:De}),e[55]=De,e[56]=ie):ie=e[56];let C;e[57]!==ue||e[58]!==ie?(C=s.jsxs(Ct,{children:[ue,ie]}),e[57]=ue,e[58]=ie,e[59]=C):C=e[59],e[60]!==B||e[61]!==C?(ee=s.jsxs("div",{className:"flex items-center justify-between",children:[B,C]}),e[60]=B,e[61]=C,e[62]=ee):ee=e[62],z=Ns,Le=D,Ne=As,J=Ue,fe=ze,Ce=Ve,Ee=Ds,me=K,Se=Ps,pe="space-y-0.5",A=v.map(R=>s.jsx(Lr,{entry:R,isActive:R.index===p,canDelete:Ge,decofile:x,meta:b,matchers:y,onSelect:()=>ge(R.index),onRename:()=>P(R.index),onDuplicate:()=>ne(R.index),onDelete:()=>Z(R.index)},R.id)),e[14]=p,e[15]=Ge,e[16]=x,e[17]=v,e[18]=K,e[19]=ze,e[20]=Ue,e[21]=y,e[22]=b,e[23]=U,e[24]=Z,e[25]=ne,e[26]=P,e[27]=N,e[28]=D,e[29]=V,e[30]=Ee,e[31]=z,e[32]=A,e[33]=me,e[34]=Se,e[35]=Le,e[36]=Ne,e[37]=J,e[38]=fe,e[39]=Ce,e[40]=oe,e[41]=ee,e[42]=pe}else Ee=e[30],z=e[31],A=e[32],me=e[33],Se=e[34],Le=e[35],Ne=e[36],J=e[37],fe=e[38],Ce=e[39],oe=e[40],ee=e[41],pe=e[42];let Q;e[63]!==A||e[64]!==pe?(Q=s.jsx("div",{className:pe,children:A}),e[63]=A,e[64]=pe,e[65]=Q):Q=e[65];let ce;e[66]!==Ee||e[67]!==me||e[68]!==Se||e[69]!==Q?(ce=s.jsx(Ee,{items:me,strategy:Se,children:Q}),e[66]=Ee,e[67]=me,e[68]=Se,e[69]=Q,e[70]=ce):ce=e[70];let je;e[71]!==q||e[72]!==x||e[73]!==y||e[74]!==b?(je=q?s.jsx(Fr,{variant:q.variant,decofile:x,meta:b,matchers:y}):null,e[71]=q,e[72]=x,e[73]=y,e[74]=b,e[75]=je):je=e[75];let Ae;e[76]!==je?(Ae=cs.createPortal(s.jsx(js,{dropAnimation:gs,children:je}),document.body),e[76]=je,e[77]=Ae):Ae=e[77];let re;e[78]!==z||e[79]!==Le||e[80]!==Ne||e[81]!==J||e[82]!==fe||e[83]!==Ce||e[84]!==ce||e[85]!==Ae?(re=s.jsxs(z,{sensors:Le,collisionDetection:Ne,onDragStart:J,onDragEnd:fe,onDragCancel:Ce,children:[ce,Ae]}),e[78]=z,e[79]=Le,e[80]=Ne,e[81]=J,e[82]=fe,e[83]=Ce,e[84]=ce,e[85]=Ae,e[86]=re):re=e[86];let Re;return e[87]!==oe||e[88]!==ee||e[89]!==re?(Re=s.jsxs("div",{className:oe,children:[ee,re]}),e[87]=oe,e[88]=ee,e[89]=re,e[90]=Re):Re=e[90],Re}function $r(c){return c.id}function Hr(c,e,o,l){if(!c||typeof c!="object")return{kind:"error",reason:"no-matcher-rule"};const p=e.trim();if(!p)return Rt(c,o,l)?{kind:"inline",blockKey:c.__resolveType??"",inlinedRule:Rn(c,o,l)}:{kind:"noop"};const x=wn(c,o,l);if(!x)return{kind:"error",reason:"unreadable-rule"};if(x.blockKey)return{kind:"updateBlock",blockKey:x.blockKey,blockData:vt(x.resolveType,x.data,p)};const b=on(p),y=rn(b,o);return y?{kind:"error",reason:"invalid-block-id",message:y}:{kind:"createBlock",blockId:b,blockData:vt(x.resolveType,x.data,p),reference:Mt(b)}}function xc({orgSlug:c,virtualMcpId:e,branch:o,previewReady:l=!0,previewUrl:p,currentPath:x,activePageBlockKey:b=null,activeGlobalBlockKey:y=null,externalSelection:N,onSaved:E,initialEditSeo:P=!1,onExitSeo:ne,onSelectRoot:Z,onViewJsonFile:U,onVariantPreviewOverride:V}){const m=Ht(),v=Ja(),O=v?.taskId??null,q=l?{orgSlug:c,virtualMcpId:e,branch:o,threadId:O,previewUrl:p}:null,{data:i,isLoading:F}=oo(q),{data:d,isLoading:W}=ro(q),X=cn(),se=v?.virtualMcpId,Ie=zo(se===e?e:null)?.metadata?.siteSlug??null,Te=mr({virtualMcpId:e,sandboxUrl:p}),[g,M]=k.useState(null),[ke,D]=k.useState(null),[He,K]=k.useState(null),[Ge,ae]=k.useState(0),[Ue,Je]=k.useState(void 0),[ze,ye]=k.useState(null),[Ve,Ee]=k.useState(null),[z,A]=k.useState([]),me=k.useRef(null),[Se,Le]=k.useState(z.length);Se!==z.length&&(Le(z.length),requestAnimationFrame(()=>{me.current&&(me.current.scrollTop=0)}));const[Ne,J]=k.useState(0),[fe,Ce]=k.useState(null),[oe,ee]=k.useState(null),[pe,Q]=k.useState(null),[ce,je]=k.useState(!0),[Ae,re]=k.useState(!1),[Re,ge]=k.useState(!1),Y=k.useRef(null),[B,te]=k.useState(P),[be,ue]=k.useState(P);P&&!be&&(ue(!0),te(!0),M(null),D(null),K(null),A([])),!P&&be&&ue(!1);const[De,ie]=k.useState(null),[C,R]=k.useState(void 0),[Qe,qe]=k.useState([]),[dt,Xe]=k.useState(0),[we,Oe]=k.useState(0),[Ls,$e]=k.useState(null),[wt,We]=k.useState(null),[Dn,Pn]=k.useState(null),Os=qa(),Fs=`${c}/${e}/${o}`,Gt=io({orgSlug:c,virtualMcpId:e,branch:o}),[zs,$s]=k.useState(x),[Hs,Gs]=k.useState(b),[Us,qs]=k.useState(y);(zs!==x||Hs!==b||Us!==y)&&(queueMicrotask(()=>Gt.flush()),$s(x),Gs(b),qs(y),M(null),D(null),K(null),ae(0),ye(null),Ee(null),Oe(0),$e(null),We(null),A([]),J(t=>t+1),te(!1),ie(null),R(void 0),qe([]),Xe(t=>t+1));const le=lo({orgSlug:c,virtualMcpId:e,branch:o}),Ut=Do((t,n)=>{le.mutate({blockKey:t,data:n},{onSuccess:()=>E?.(),onError:a=>L.error(m("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),qt=Qo({orgSlug:c,virtualMcpId:e,branch:o}),[It,Tt]=k.useState(!1),he=k.useRef(null),ot=k.useRef(null),rt=k.useRef(null),un=k.useRef({}),Ze=k.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Ws,Ys]=k.useState(null);if(!l||F||W)return s.jsx("div",{className:"h-full w-full flex items-center justify-center",children:s.jsx(Wa,{className:"size-5 text-muted-foreground"})});if(!i||!d)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:m("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Js=er(i),xe=!!y,Ye=xe?null:tr(Js,x,b),_=xe?y:Ye?.key??null,dn=xe&&y?i[y]:void 0,Mn=xe&&y&&dn?nr(y,dn):xe&&y?y:"",Wt=!xe&&_&&i[_]?i[_]:null,mn=B&&i&&d&&_&&Ye?Jn(i,{kind:"page",pageKey:_,pageName:String(Ye.name??""),path:String(Ye.path??"")},d):null,Qs=B?Wt?.seo:void 0,fn=C!==void 0?C:Qs,Zs=B?co(fn):void 0,Xs=mn?.seoTypeOptions??[],ea=B&&d?uo(d):"",Cn=De??Zs??{},pn=B&&mn?lr(Cn,mn):null,ta=B&&pn&&mo(fn)?an(pn,d):null,na=B?fo(i,d)?.seoData:void 0,Fe=xe?[{label:"Default",sections:[{__resolveType:y}]}]:po(Wt?.sections,i??{}),Vt=Fe.length>1,Pe=Math.min(Ge,Fe.length-1),it=Fe[Pe],H=it?.sections??[],Be=tn(H,i),gn=!xe&&go(Wt?.sections);if(xe&&y&&Dn!==y){Pn(y);const t=H[0],n=Be[0];if(t&&n){M(0),Oe(0),A([]);const a=jt(t,n,i);a&&(D(a.data),K(a.resolveType),We(null),$e(null))}}!xe&&Dn!==null&&Pn(null),Ze.current={rawSections:H,parsedSections:Be,decofile:i??{},activePageKey:_,pageVariants:Fe,variantIndex:Pe,sectionVariantIndex:we,selectedSectionIndex:g};const sa=()=>({multivariate:gn,index:Pe,variants:Fe.map(t=>({rule:t.rule}))}),hn=(t,n)=>{if(!V)return;if(!_||!gn||t.length<=1){V(null);return}const a=os(_,{multivariate:!0,index:n,variants:t},i,d);V(a.length>0?a:null)},vn=V&&_&&gn&&Vt&&!F&&!W?_:null;if(vn!==Ws&&(Ys(vn),vn)){const t=Fe.map(a=>({rule:a.rule})),n=Pe;queueMicrotask(()=>hn(t,n))}const Nt=(t,n,a)=>{if(!V)return;if(!_){V(null);return}const r=sa(),u=os(_,r,i,d);if(!t||n<0){V(u.length>0?u:null);return}const h=pr({pageKey:_,page:r,sectionIndex:n,sectionLazy:Be[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:i,meta:d}),f=[...u,...h];V(f.length>0?f:null)},mt=(t,n,a,r=g??-1,u=!1)=>{const h=at(t,n);if(!h){D(null),K(null),We(null),$e(null),u&&Nt(null,r,a);return}const j=Qn(h,ht)[a];if(!j){D(null),K(null),We(null),$e(null),u&&Nt(null,r,a);return}const I=Eo(j.value,i);D(I?.data??null),K(I?.resolveType??null);const{resolveType:S,formValue:w}=Ot(j.rule,i,d??void 0);We(S),$e(w),u&&Nt(h,r,a)},Lt=N?.index;if(N!==void 0&&(N?.seq??null)!==Ue&&(Je(N?.seq??null),typeof Lt=="number")){const t=H[Lt],n=Be[Lt];if(t&&n)if(M(Lt),Oe(0),A([]),J(a=>a+1),n.isMultivariate)mt(t,n,0,Lt);else{const a=jt(t,n,i);a?(D(a.data),K(a.resolveType)):(D(null),K(null)),We(null),$e(null)}}const Yt={orgSlug:c,virtualMcpId:e,branch:o,threadId:O,previewUrl:p??void 0,siteSlug:Ie},yn=He&&d?an(He,d):null,et=(t,n)=>{if(!_)return;he.current&&(clearTimeout(he.current),he.current=null),rt.current&&(clearTimeout(rt.current),rt.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null);const a=Ft(i,_,t,Pe,Fe);le.mutate({blockKey:_,data:a},{onSuccess:()=>n?.onSuccess?.()??E?.(),onError:r=>L.error(m("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},At=()=>{M(null),D(null),K(null),Oe(0),$e(null),We(null),A([]),J(t=>t+1)},aa=(t,n)=>{he.current&&clearTimeout(he.current);const a=Ze.current.sectionVariantIndex;he.current=setTimeout(()=>{const{rawSections:r,parsedSections:u,decofile:h,activePageKey:f,pageVariants:j,variantIndex:I}=Ze.current,S=r[n];if(!S)return;const w=u[n];if(!w)return;if(w.isSavedBlock){const $=Io(S,w);if(!$)return;le.mutate({blockKey:$,data:t},{onSuccess:()=>E?.(),onError:G=>L.error(m("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))});return}if(!f)return;const T={...h[f]},de=[...r];if(w.isMultivariate){const $=at(S,w);if(!$||!f)return;const G=Lo($,a,t);de[n]=kt(S,w,G)}else if(w.isHidden){const $=Ss(S.__resolveType),G=$?{...S.section}:{...S},Me=Array.isArray(G.variants)?[...G.variants]:[];Me[0]&&(Me[0]={...Me[0],value:t}),G.variants=Me,$?de[n]={...S,section:G}:de[n]=G}else w.isLazy?de[n]={...S,section:t}:de[n]=t;if(j.length>1){const $=T.sections,G=[...$?.variants??[]];G[I]&&(G[I]={...G[I],value:de}),T.sections={...$,variants:G}}else T.sections=de;le.mutate({blockKey:f,data:T},{onSuccess:()=>E?.(),onError:$=>L.error(m("sectionsEditor.sectionsEditor.saveFailed",{error:$.message}))})},jn)},oa=t=>{M(t),Oe(0),A([]),J(u=>u+1);const n=H[t],a=Be[t];if(!n||!a)return;if(a.isMultivariate){mt(n,a,0,t);return}const r=jt(n,a,i);if(!r){D(null),K(null),We(null),$e(null),Nt(null,t,0);return}D(r.data),K(r.resolveType),We(null),$e(null),Nt(null,t,0)},Kn=t=>{const n=t;D(n),g!==null&&aa(n,g)},Sn=t=>{if(!_||!i||!d||!Ye)return;const n={kind:"page",pageKey:_,pageName:String(Ye.name??""),path:String(Ye.path??"")},a=Jn(i,n,d);a&&Gt.save(_,()=>{const r=Os.getQueryData(Ya.decofile(Fs))?.[_];if(!r||typeof r!="object"||r===null||Array.isArray(r))return null;const u={...r,...un.current};return un.current={},t?.raw!==void 0?{...u,seo:t.raw}:t?.inner!==void 0?ur(n,a,u,t.inner):u})},ra=(t,n)=>{_&&(un.current[t]=n,Sn())},ia=(t,n)=>{if(!_)return;const a=$t([...H],t,n);g!==null&&(g===t?M(n):t<g&&n>=g?M(g-1):t>g&&n<=g&&M(g+1)),et(a)},la=t=>{if(!_)return;const n=H.filter((a,r)=>r!==t);g===t?At():g!==null&&g>t&&M(g-1),et(n)},ca=t=>{if(!_)return;const n=H[t];if(!n)return;const a=[...H];a.splice(t+1,0,Ko(n)),g!==null&&g>t&&M(g+1),et(a)},ua=t=>{if(!_)return;const n=H[t],a=Be[t];if(!n||!a)return;const r=a.isHidden?Mo(n):Co(n);if(!r)return;const u=[...H];u[t]=r,g===t&&At(),et(u)},da=t=>{if(!_)return;const n=H[t],a=Be[t];if(!n||!a||a.isMultivariate)return;const r=Po(n);if(!r)return;const u=[...H];u[t]=r,g===t&&At(),et(u)},ma=t=>{if(!_)return;const n=H[t],a=Be[t];if(!n||!a?.isSavedBlock)return;const r=jt(n,a,i);if(!r?.data)return;const{name:u,...h}=r.data,f=[...H];a.isLazy?f[t]={...n,section:h}:f[t]=h,g===t&&At(),et(f)},fa=t=>{if(!_)return;const n=[...H,{__resolveType:t.resolveType}],a=n.length-1;et(n,{onSuccess:()=>{re(!1),M(a),Oe(0),A([]),J(f=>f+1);const r=n[a],u=tn(n,i)[a];if(!r||!u)return;if(u.isMultivariate){mt(r,u,0);return}const h=jt(r,u,i);if(!h){D(null),K(null),We(null),$e(null);return}D(h.data),K(h.resolveType),We(null),$e(null)}})},Bn=t=>{Y.current=t.append,re(!0)},pa=t=>{const n=Y.current;if(!n){fa(t);return}n({__resolveType:t.resolveType}),re(!1),Y.current=null},ga=t=>{if(g===null)return;const n=H[g],a=Be[g];!n||!a?.isMultivariate||(Oe(t),A([]),J(r=>r+1),mt(n,a,t,g,!0))},ha=t=>{if(g===null||!_)return;const n=H[g],a=Be[g];if(!n||!a?.isMultivariate)return;const r=at(n,a);if(!r)return;const u=No(r,t);if(!u){L.error(m("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const h=[...H];h[g]=kt(n,a,u);const f=u.variants;let j=we;t===we?j=Math.min(t,f.length-1):t<we&&(j=we-1),Oe(j),A([]),J(I=>I+1),mt(h[g],a,j),et(h)},va=t=>{if(g===null||!_)return;const n=H[g],a=Be[g];if(!n||!a?.isMultivariate)return;const r=at(n,a);if(!r)return;const u=Ao(r,t),h=[...H];h[g]=kt(n,a,u);const f=t+1;Oe(f),A([]),J(j=>j+1),mt(h[g],a,f),et(h)},ya=(t,n)=>{if(g===null||!_||t===n)return;const a=H[g],r=Be[g];if(!a||!r?.isMultivariate)return;const u=at(a,r);if(!u)return;const h=To(u,t,n),f=[...H];f[g]=kt(a,r,h);let j=we;we===t?j=n:t<we&&n>=we?j=we-1:t>we&&n<=we&&(j=we+1),Oe(j),mt(f[g],r,j),et(f)},bn=t=>{const n=t??g;if(n===null||!_)return;const a=H[n],r=Be[n];if(!a||!r)return;const u=ko(a,r);if(!u){L.error(m("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const h=[...H];h[n]=u.section;const f=tn(h,i)[n];if(!f?.isMultivariate){L.error(m("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}M(n),Oe(u.newVariantIndex),A([]),J(j=>j+1),mt(u.section,f,u.newVariantIndex,n),et(h)},Sa=()=>{if(g===null||!_)return;const t=H[g],n=Be[g];if(!t||!n?.isMultivariate)return;const a=at(t,n);if(!a)return;const r=Vo(t,n,a);if(!r){L.error(m("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const u=[...H];u[g]=r;const h=tn(u,i)[g];if(!h)return;Oe(0),We(null),$e(null),A([]),J(j=>j+1);const f=jt(r,h,i);f?(D(f.data),K(f.resolveType)):(D(null),K(null)),Nt(null,g,0),et(u)},ba=async t=>{if(fe===null||!_)return;const n=rn(t,i);if(n){L.error(n);return}const a=H[fe],r=Be[fe];if(!a||!r)return;const u=jt(a,r,i);if(!u){L.error(m("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const h={...u.data,name:t};try{await le.mutateAsync({blockKey:t,data:h});const f=[...H];f[fe]={__resolveType:t},await le.mutateAsync({blockKey:_,data:Ft(i,_,f,Pe,Fe)}),g===fe&&At(),Ce(null),L.success(m("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),E?.()}catch(f){L.error(f instanceof Error?f.message:m("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},In=it?.rule;if(Vt&&g===null&&Ve===null&&In){const{resolveType:t,formValue:n}=Ot(In,i??{},d??void 0);Ee(t),ye(n)}const Jt=d?ho(d):[],Ln=d&&i?vo(d,i):[],xa=!xe&&!!(Te&&d&&i),_a=Ve&&d?an(Ve,d):null,ft=()=>{ot.current&&(clearTimeout(ot.current),ot.current=null),rt.current&&(clearTimeout(rt.current),rt.current=null)},bt=async(t,n)=>{if(!(Bo(n,t,d)>0))try{await qt.mutateAsync({blockKey:t})}catch(a){L.error(a instanceof Error?a.message:m("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},On=t=>{ot.current&&clearTimeout(ot.current),ot.current=setTimeout(()=>{const{activePageKey:n,decofile:a,variantIndex:r}=Ze.current;if(!n)return;const u={...a[n]},h={...u.sections},f=[...h.variants??[]],j=f[r],I=j?.rule;if(Rt(I,a,d)){const S=I?.__resolveType??"",w=a[S],T=typeof w?.name=="string"?w.name:S,{__resolveType:de,...$}=t;le.mutate({blockKey:S,data:vt(de??"",$,T)},{onSuccess:()=>E?.(),onError:G=>L.error(m("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))});return}j&&(f[r]={...j,rule:t}),u.sections={...h,variants:f},le.mutate({blockKey:n,data:u},{onSuccess:()=>E?.(),onError:S=>L.error(m("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},jn)},Ea=t=>{Ee(t);const n=t?ss(t,d):{__resolveType:as};ye(t?n:{}),On(n)},ja=t=>{const n=t;ye(n);const a=Ve?{__resolveType:Ve,...n}:{...n};On(a)},ka=async t=>{ft();const{activePageKey:n,decofile:a,variantIndex:r}=Ze.current;if(!n)return;const u=a[n],h=u?.sections;if(!h||typeof h!="object"||Array.isArray(h))return;const f=h;if(!Array.isArray(f.variants))return;const j=[...f.variants],I=j[r];if(!I)return;const S=Pt(I.rule,a,d),w=Mt(t);j[r]={...I,rule:w};const T={...a,[n]:{...u,sections:{...f,variants:j}}},{resolveType:de,formValue:$}=Ot(w,T,d??void 0);Ee(de),ye($);try{await le.mutateAsync({blockKey:n,data:T[n]}),S&&S!==t&&await bt(S,T),E?.()}catch(G){L.error(G instanceof Error?G.message:m("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Fn=t=>{rt.current&&clearTimeout(rt.current);const{selectedSectionIndex:n,sectionVariantIndex:a}=Ze.current;n!==null&&(rt.current=setTimeout(()=>{const{rawSections:r,parsedSections:u,decofile:h,activePageKey:f,pageVariants:j,variantIndex:I}=Ze.current;if(!f)return;const S=r[n],w=u[n];if(!S||!w?.isMultivariate)return;const T=at(S,w);if(!T)return;const $=(T.variants??[])[a]?.rule;if(Rt($,h,d)){const ve=$?.__resolveType??"",tt=h[ve],lt=typeof tt?.name=="string"?tt.name:ve,{__resolveType:pt,...ct}=t;le.mutate({blockKey:ve,data:vt(pt??"",ct,lt)},{onSuccess:()=>E?.(),onError:gt=>L.error(m("sectionsEditor.sectionsEditor.saveFailed",{error:gt.message}))});return}const G=ns(T,a,t),Me=[...r];Me[n]=kt(S,w,G);const st=Ft(h,f,Me,I,j);le.mutate({blockKey:f,data:st},{onSuccess:()=>E?.(),onError:ve=>L.error(m("sectionsEditor.sectionsEditor.saveFailed",{error:ve.message}))})},jn))},Ra=t=>{We(t);const n=t?ss(t,d):{__resolveType:as};$e(t?n:{}),Fn(n)},wa=t=>{const n=t;$e(n);const a=wt?{__resolveType:wt,...n}:{...n};Fn(a)},Ta=async t=>{ft();const{selectedSectionIndex:n,sectionVariantIndex:a,rawSections:r,parsedSections:u,decofile:h,activePageKey:f,pageVariants:j,variantIndex:I}=Ze.current;if(n===null||!f)return;const S=r[n],w=u[n];if(!S||!w?.isMultivariate)return;const T=at(S,w);if(!T)return;const de=T.variants??[],$=Pt(de[a]?.rule,h,d),G=Mt(t),Me=ns(T,a,G),st=[...r];st[n]=kt(S,w,Me);const ve=Ft(h,f,st,I,j),tt={...h,[f]:ve},{resolveType:lt,formValue:pt}=Ot(G,tt,d??void 0);We(lt),$e(pt);try{await le.mutateAsync({blockKey:f,data:ve}),$&&$!==t&&await bt($,tt),E?.()}catch(ct){L.error(ct instanceof Error?ct.message:m("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!xe&&!Ye)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:m("sectionsEditor.sectionsEditor.noPageFound",{currentPath:x})});if(xe&&!dn)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:m("sectionsEditor.sectionsEditor.globalBlockNotFound")});const nt=g!==null?Be[g]??null:null,zn=g!==null?H[g]:null,$n=zn&&nt?.isMultivariate?at(zn,nt):null,xt=$n?Qn($n,ht):[],xn=Math.min(we,Math.max(xt.length-1,0)),Dt=xt[xn]??null,_t=nt?.isMultivariate===!0,Hn=g!==null&&nt!==null,Qt=Hn&&(_t||!!(yn&&ke)),Va=Qt&&!xe&&nt?.isSavedBlock===!0,Et=xe||Va,Na=xe?Mn:nt?.label??"",Aa=wt&&d?an(wt,d):null,Zt=Qt&&(!xe||z.length>0)?xe?[Mn,...z]:[Ye.name,..._t&&Dt?X?[`${nt.variantOf??nt.label} · ${Dt.label}`]:[nt.label,Dt.label]:[nt.label],...z]:[],Gn=B&&Ye?[Ye.name,"SEO",...Qe]:[],Xt=Gn.length>0?Gn:Et?Zt.length>0?Zt:[Na]:Zt.length>0?Zt:[Ye.name],Un=Hn&&!_t&&!nt?.isHidden&&!!_,Da=Et||!xe&&Vt&&!!it||Un,Pa=!X&&!B&&!xe&&_t&&z.length===0,qn=()=>{if(!_)return;ft(),he.current&&(clearTimeout(he.current),he.current=null);const t=i[_],n=Ro(t.sections,H);if(!n)return;const a=wo(n);le.mutate({blockKey:_,data:{...t,sections:n}},{onSuccess:()=>{ae(a),M(null),D(null),K(null),A([]),ye(null),Ee(null)},onError:r=>L.error(m("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},_n=(t,n,a)=>{if(!_)return;ft(),he.current&&(clearTimeout(he.current),he.current=null);const r=i[_],u=r.sections;if(!u||typeof u!="object"||Array.isArray(u))return;const h=u;if(!Array.isArray(h.variants))return;const f=t([...h.variants]);if(!f)return;const j=Oo(h,f),I={...i,[_]:{...r,sections:j}};le.mutate({blockKey:_,data:I[_]},{onSuccess:()=>{n?.(),a&&bt(a,I)},onError:S=>L.error(m("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},Ma=t=>{ee(null),ae(t),M(null),D(null),K(null),A([]);const n=Fe[t]?.rule,{resolveType:a,formValue:r}=Ot(n,i??{},d??void 0);Ee(a),ye(r),hn(Fe.map(u=>({rule:u.rule})),t)},Ca=(t,n)=>{if(t===n)return;let a=Pe;Pe===t?a=n:t<Pe&&n>=Pe?a=Pe-1:t>Pe&&n<=Pe&&(a=Pe+1),ae(a);const r=$t(Fe.map(u=>({rule:u.rule})),t,n);hn(r,a),_n(u=>$t(u,t,n))},Ka=t=>{const n=Fe[t]?.rule,a=Pt(n,i??{},d??void 0);_n(r=>r.length<=1?null:(r.splice(t,1),r),()=>{Fe.length-1===1?ae(0):t<Pe?ae(Pe-1):t===Pe&&ae(Math.max(0,t-1)),M(null),D(null),K(null),A([]),ye(null),Ee(null)},a)},Ba=t=>{_n(n=>Fo(n,t),()=>{ae(t+1),M(null),D(null),K(null),A([]),ye(null),Ee(null)})},Ia=async(t,n)=>{ft(),he.current&&(clearTimeout(he.current),he.current=null);const a=Ze.current.activePageKey,r=Ze.current.decofile;if(!a)return;const u=r[a],h=u.sections;if(!h||typeof h!="object"||Array.isArray(h))return;const f=h;if(!Array.isArray(f.variants))return;const j=[...f.variants],I=j[t];if(!I?.rule||typeof I.rule!="object"){L.error(m("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const S=I.rule,w=n.trim();Tt(!0);try{if(!w){if(!Rt(S,r,d)){ee(null);return}const st=S.__resolveType??"";j[t]={...I,rule:Rn(S,r,d)};const ve={...r,[a]:{...u,sections:{...f,variants:j}}};await le.mutateAsync({blockKey:a,data:ve[a]}),await bt(st,ve),ee(null),E?.();return}const T=wn(S,r,d);if(!T){L.error(m("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(T.blockKey){await le.mutateAsync({blockKey:T.blockKey,data:vt(T.resolveType,T.data,w)}),ee(null),E?.();return}const de=on(w),$=rn(de,r);if($){L.error($);return}const G=vt(T.resolveType,T.data,w);let Me=null;try{await le.mutateAsync({blockKey:de,data:G}),Me=de,j[t]={...I,rule:Mt(de)},await le.mutateAsync({blockKey:a,data:{...u,sections:{...f,variants:j}}}),Me=null}catch(st){throw Me&&await qt.mutateAsync({blockKey:Me}).catch(()=>{}),st}ee(null),L.success(m("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:w})),E?.()}catch(T){L.error(T instanceof Error?T.message:m("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Tt(!1)}},La=async(t,n)=>{ft(),he.current&&(clearTimeout(he.current),he.current=null);const{selectedSectionIndex:a,rawSections:r,parsedSections:u,decofile:h,activePageKey:f,pageVariants:j,variantIndex:I}=Ze.current;if(a===null||!f)return;const S=r[a],w=u[a];if(!S||!w?.isMultivariate)return;const T=at(S,w);if(!T)return;const de=T.variants??[],$=de[t];if(!$?.rule||typeof $.rule!="object"){L.error(m("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const G=$.rule,Me=n.trim();Tt(!0);const st=async ve=>{const tt={...T,variants:ve},lt=[...r];lt[a]=kt(S,w,tt);const pt=Ft(h,f,lt,I,j);return await le.mutateAsync({blockKey:f,data:pt}),{...h,[f]:pt}};try{if(!Me){if(!Rt(G,h,d)){Q(null);return}const gt=G.__resolveType??"",Yn=[...de];Yn[t]={...$,rule:Rn(G,h,d)};const Ga=await st(Yn);await bt(gt,Ga),Q(null),E?.();return}const ve=wn(G,h,d);if(!ve){L.error(m("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(ve.blockKey){await le.mutateAsync({blockKey:ve.blockKey,data:vt(ve.resolveType,ve.data,Me)}),Q(null),E?.();return}const tt=on(Me),lt=rn(tt,h);if(lt){L.error(lt);return}const pt=vt(ve.resolveType,ve.data,Me);let ct=null;try{await le.mutateAsync({blockKey:tt,data:pt}),ct=tt;const gt=[...de];gt[t]={...$,rule:Mt(tt)},await st(gt),ct=null}catch(gt){throw ct&&await qt.mutateAsync({blockKey:ct}).catch(()=>{}),gt}Q(null),L.success(m("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Me})),E?.()}catch(ve){L.error(ve instanceof Error?ve.message:m("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Tt(!1)}},Oa={rename:async(t,n,a)=>{ft(),he.current&&(clearTimeout(he.current),he.current=null);const{activePageKey:r,decofile:u}=Ze.current;if(!r)return;const h=Array.isArray(t.variants)?[...t.variants]:[],f=h[n],j=f?.rule&&typeof f.rule=="object"?f.rule:void 0,I=async w=>{const T={...t,variants:w};return await le.mutateAsync({blockKey:r,data:T}),{...u,[r]:T}},S=Hr(j,a,u,d);if(S.kind!=="noop"){if(S.kind==="error"){L.error(S.reason==="no-matcher-rule"?m("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):S.reason==="unreadable-rule"?m("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):S.message??m("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}Tt(!0);try{if(S.kind==="inline"){const T=[...h];T[n]={...f,rule:S.inlinedRule};const de=await I(T);await bt(S.blockKey,de),E?.();return}if(S.kind==="updateBlock"){await le.mutateAsync({blockKey:S.blockKey,data:S.blockData}),E?.();return}let w=null;try{await le.mutateAsync({blockKey:S.blockId,data:S.blockData}),w=S.blockId;const T=[...h];T[n]={...f,rule:S.reference},await I(T),w=null}catch(T){throw w&&await qt.mutateAsync({blockKey:w}).catch(()=>{}),T}L.success(m("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:a.trim()})),E?.()}catch(w){L.error(w instanceof Error?w.message:m("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Tt(!1)}}},selectGlobal:async(t,n,a)=>{ft(),he.current&&(clearTimeout(he.current),he.current=null);const{activePageKey:r,decofile:u}=Ze.current;if(!r)return;const h=Array.isArray(t.variants)?[...t.variants]:[],f=h[n];if(!f)return;const j=Pt(f.rule,u,d);h[n]={...f,rule:Mt(a)};const I={...t,variants:h},S={...u,[r]:I};try{await le.mutateAsync({blockKey:r,data:I}),j&&j!==a&&await bt(j,S),E?.()}catch(w){L.error(w instanceof Error?w.message:m("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}}},Wn=()=>{At()},Fa=t=>{ie(t),Sn({inner:t})},za=t=>{R(t),Sn({raw:t})},$a=()=>{ie(null),qe([])},Ha=()=>Xe(t=>t+1),En=t=>{if(B){if(t===0){Gt.flush(),te(!1),ie(null),R(void 0),qe([]),Xe(a=>a+1),ne?.();return}if(t===1){qe([]),Xe(a=>a+1);return}qe(Qe.slice(0,t-1)),Xe(a=>a+1);return}if(xe){A(z.slice(0,t)),J(a=>a+1);return}if(t===0){Wn();return}if(t===1){A([]),J(a=>a+1);return}const n=!X&&_t&&Dt?1:0;if(n===1&&t===2){A([]),J(a=>a+1);return}A(z.slice(0,t-1-n))},en=Xt.length>1?s.jsx("button",{type:"button",onClick:()=>En(jo(Xt.length,{isMultivariateSectionTop:Pa})),title:m("sectionsEditor.sectionsEditor.back"),"aria-label":m("sectionsEditor.sectionsEditor.back"),className:Ke("shrink-0 inline-flex size-6 items-center justify-center classic:rounded-md compact:rounded-lg transition-colors",Et?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:s.jsx(qo,{className:"size-4"})}):null;return s.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!X&&en&&s.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:en}),(X||Xt.length>1)&&s.jsx(yo,{crumbs:Xt,onSelect:En,onSelectRoot:()=>{Gt.flush(),Z?Z():En(0)}}),s.jsx("div",{className:"shrink-0",children:Et||Qt||B?(Da||X&&en)&&s.jsxs("div",{className:Ke("border-b px-3 py-2.5",Et&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[X&&en,!xe&&Vt&&it&&s.jsxs("button",{type:"button",onClick:Wn,title:m("sectionsEditor.sectionsEditor.editingInVariant",{variant:it.label}),className:Ke("shrink-0 inline-flex items-center gap-1 rounded-lg h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",So),children:[s.jsx(An,{rule:zt(it.rule,i??{},d??void 0),matchers:Jt}),s.jsx("span",{className:"max-w-[160px] truncate",children:it.label})]}),s.jsx("div",{className:"flex-1"}),Et&&s.jsxs(Ct,{children:[s.jsx(Kt,{asChild:!0,children:s.jsx("span",{className:"shrink-0 cursor-help",children:s.jsx(ys,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),s.jsx(Bt,{side:"bottom",className:"max-w-[260px]",children:m("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Un&&s.jsx(Zn,{onClick:()=>bn()})]}),Et&&s.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:m("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):s.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(bo,{pageKey:_,initialName:Ye.name,initialPath:Ye.path,onFieldChange:ra})}),s.jsxs(Ct,{children:[s.jsx(Kt,{asChild:!0,children:s.jsx(ut,{type:"button",variant:"ghost",size:"icon","aria-label":m("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>te(!0),children:s.jsx(Wo,{size:14})})}),s.jsx(Bt,{side:"bottom",children:m("sectionsEditor.sectionsEditor.editSeo")})]}),s.jsxs(Ct,{children:[s.jsx(Kt,{asChild:!0,children:s.jsx(ut,{type:"button",variant:"ghost",size:"icon","aria-label":m("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>U&&_?U():ge(!0),children:s.jsx(Yo,{size:14})})}),s.jsx(Bt,{side:"bottom",children:m("sectionsEditor.sectionsEditor.viewJson")})]}),s.jsx(Zn,{onClick:qn})]})}),B?s.jsx(sn,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsx("div",{className:"mx-auto max-w-2xl",children:Wt&&_?s.jsx(cr,{rawSeo:fn,innerSeo:Cn,defaultResolveType:ea,seoSchema:ta,activeResolveType:pn,seoTypeOptions:Xs,formResetKey:dt,siteDefaultSeo:na,onBreadcrumbChange:qe,onPersistRaw:za,onInnerChange:Fa,onClearForm:$a,onBumpFormKey:Ha}):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:m("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"):Qt?s.jsxs(sn,{viewportRef:me,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[_t&&xt.length>0&&z.length===0&&s.jsxs(s.Fragment,{children:[s.jsx(xo,{listKey:`${_??""}:${g??""}`,variants:xt.map((t,n)=>({index:n,label:t.label})),selectedIndex:xn,onSelect:ga,onRename:Q,onDuplicate:va,onDelete:ha,onRemoveAll:Sa,onReorder:ya,onAdd:()=>bn()}),_t&&s.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:m("sectionsEditor.sectionsEditor.variantRule")}),s.jsx(Xn,{currentRt:wt??"",currentLabel:nn(Dt?.rule,i??{},ht,d??void 0),currentGlobalKey:Pt(Dt?.rule,i??{},d??void 0)??void 0,matchers:Jt,globals:Ln,onSelect:Ra,onSelectGlobal:Ta,schema:Aa,formValue:Ls,onChange:wa,formKey:`${g??"none"}:${xn}:${wt??""}`,formWrapperClassName:"pt-1",meta:d??void 0,decofile:i,onSaveReferencedBlock:Ut,sandbox:Yt})]})]}),s.jsx(es,{activeSchema:yn,formValue:ke,formResetKey:Ne,onFormChange:Kn,onBreadcrumbChange:A,breadcrumbPath:z,emptyMessage:m("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:d,decofile:i,onSaveReferencedBlock:Ut,sandbox:Yt,previewBaseUrl:Te,onRequestAddSection:Bn})]},"editor-section-form"):xe?s.jsx(sn,{viewportRef:me,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx(es,{activeSchema:yn,formValue:ke,formResetKey:Ne,onFormChange:Kn,onBreadcrumbChange:A,breadcrumbPath:z,emptyMessage:m("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:d,decofile:i,onSaveReferencedBlock:Ut,sandbox:Yt,previewBaseUrl:Te,onRequestAddSection:Bn,onVariantMatcherOp:Oa})},"editor-global-block"):s.jsxs(sn,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Vt&&_&&s.jsx(zr,{listKey:_,variants:Fe,activeIndex:Pe,decofile:i??{},meta:d,matchers:Jt,onSelect:Ma,onReorder:Ca,onRename:ee,onDuplicate:Ba,onDelete:Ka,onAdd:qn}),Vt&&Ve!==null&&s.jsxs("div",{className:Ke("px-3 border-b",ce?"pt-3 pb-5 space-y-3":"py-2"),children:[s.jsxs("button",{type:"button",onClick:()=>je(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer classic:rounded-sm compact:rounded-lg py-0.5 hover:bg-muted/40","aria-expanded":ce,children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:m("sectionsEditor.sectionsEditor.variantRule")}),ce?s.jsx($o,{className:"size-3.5 shrink-0 text-muted-foreground"}):s.jsx(Ho,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),ce&&s.jsx("div",{className:Ke("space-y-3",It&&"pointer-events-none opacity-50"),children:s.jsx(Xn,{currentRt:Ve,currentLabel:nn(it?.rule,i??{},ht,d??void 0),currentGlobalKey:Pt(it?.rule,i??{},d??void 0)??void 0,matchers:Jt,globals:Ln,onSelect:Ea,onSelectGlobal:ka,schema:_a,formValue:ze,onChange:ja,formKey:`${Pe}:${Ve??""}`,formWrapperClassName:"space-y-3",meta:d??void 0,decofile:i,onSaveReferencedBlock:Ut,sandbox:Yt})})]}),s.jsx("div",{className:"p-2 pt-3",children:s.jsx(Pr,{listKey:`${_??""}-${Pe}`,rawSections:H,sections:Be,meta:d,decofile:i,selectedIndex:g,onSelect:oa,onReorder:ia,onDelete:la,onDuplicate:ca,onMakeReusable:Ce,onToggleHidden:ua,onToggleLazy:da,onAddVariant:bn,onDetach:ma,onAddSection:()=>re(!0),canAddSection:xa})})]},"editor-section-list"),s.jsx(_o,{open:fe!==null,onOpenChange:t=>{t||Ce(null)},defaultBlockId:fe!==null?on(Be[fe]?.label??""):"",isPending:le.isPending,onSubmit:ba}),Te&&s.jsx(fr,{open:Ae,onOpenChange:t=>{re(t),t||(Y.current=null)},meta:d,decofile:i,previewBaseUrl:Te,onSelect:pa}),Re&&_&&i&&s.jsx(Zo,{open:Re,onOpenChange:ge,pageKey:_,decofile:i}),oe!==null&&s.jsx(ts,{open:!0,initialName:Rt(Fe[oe]?.rule,i??{},d??void 0)?nn(Fe[oe]?.rule,i??{},ht,d??void 0):"",autoLabel:ht(zt(Fe[oe]?.rule,i??{},d??void 0)),isPending:It,onSubmit:async t=>{await Ia(oe,t)},onOpenChange:t=>{!t&&!It&&ee(null)}}),pe!==null&&s.jsx(ts,{open:!0,initialName:Rt(xt[pe]?.rule,i??{},d??void 0)?nn(xt[pe]?.rule,i??{},ht,d??void 0):"",autoLabel:ht(zt(xt[pe]?.rule,i??{},d??void 0)),isPending:It,onSubmit:async t=>{await La(pe,t)},onOpenChange:t=>{!t&&!It&&Q(null)}})]})}export{xc as SectionsEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,bo as k,bp as Ie,j as c,bq as j,br as P,bs as st,bt as $,bu as rt,aO as Ee,bv as lt,bw as Ne,bx as at,by as it,bz as Re,bA as ct,bB as dt,bC as ut,bD as pt,bE as ft,bF as mt,bG as ht,bH as vt,bI as gt,bJ as xt,bK as St,c as ee,l as oe,a9 as wt}from"./index-fmzc-5YR.js";import{V as yt}from"./index-BHJ4Cdqa.js";import{t as je,n as Ct}from"./ChevronUp-DsbltOpN.js";function Pe(s,[e,t]){return Math.min(t,Math.max(e,s))}var bt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,Tt]=it(J),[ne]=vt(J,[Tt,Re]),pe=Re(),[Nt,G]=ne(J),[Pt,_t]=ne(J),Me=s=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:a,value:r,defaultValue:l,onValueChange:i,dir:u,name:m,autoComplete:g,disabled:w,required:y,form:S}=s,p=pe(e),[v,C]=d.useState(null),[h,x]=d.useState(null),[F,M]=d.useState(!1),se=lt(u),[_,O]=Ne({prop:o,defaultProp:n??!1,onChange:a,caller:J}),[U,q]=Ne({prop:r,defaultProp:l,onChange:i,caller:J}),L=d.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return c.jsx(at,{...p,children:c.jsxs(Nt,{required:y,scope:e,trigger:v,onTriggerChange:C,valueNode:h,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:se,triggerPointerDownPosRef:L,disabled:w,children:[c.jsx(de.Provider,{scope:e,children:c.jsx(Pt,{scope:s.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?c.jsxs(et,{"aria-hidden":!0,required:y,tabIndex:-1,name:m,autoComplete:g,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?c.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=J;var Ae="SelectTrigger",Oe=d.forwardRef((s,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=s,a=pe(t),r=G(Ae,t),l=r.disabled||o,i=k(e,r.onTriggerChange),u=ue(t),m=d.useRef("touch"),[g,w,y]=ot(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===r.value),h=nt(v,p,C);h!==void 0&&r.onValueChange(h.value)}),S=p=>{l||(r.onOpenChange(!0),y()),p&&(r.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(st,{asChild:!0,...a,children:c.jsx(j.button,{type:"button",role:"combobox","aria-controls":r.contentId,"aria-expanded":r.open,"aria-required":r.required,"aria-autocomplete":"none",dir:r.dir,"data-state":r.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":tt(r.value)?"":void 0,...n,ref:i,onClick:P(n.onClick,p=>{p.currentTarget.focus(),m.current!=="mouse"&&S(p)}),onPointerDown:P(n.onPointerDown,p=>{m.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(v&&p.key===" ")&&bt.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,children:a,placeholder:r="",...l}=s,i=G(De,t),{onValueNodeHasChildrenChange:u}=i,m=a!==void 0,g=k(e,i.onValueNodeChange);return $(()=>{u(m)},[u,m]),c.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:tt(i.value)?c.jsx(c.Fragment,{children:r}):a})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((s,e)=>{const{__scopeSelect:t,children:o,...n}=s;return c.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=s=>c.jsx(rt,{asChild:!0,...s});Be.displayName=Rt;var Q="SelectContent",Ve=d.forwardRef((s,e)=>{const t=G(Q,s.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const a=o;return a?Ee.createPortal(c.jsx(He,{scope:s.__scopeSelect,children:c.jsx(de.Slot,{scope:s.__scopeSelect,children:c.jsx("div",{children:s.children})})}),a):null}return c.jsx(ze,{...s,ref:e})});Ve.displayName=Q;var A=10,[He,Y]=ne(Q),jt="SelectContentImpl",Mt=gt("SelectContent.RemoveScroll"),ze=d.forwardRef((s,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:a,onPointerDownOutside:r,side:l,sideOffset:i,align:u,alignOffset:m,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=s,h=G(Q,t),[x,F]=d.useState(null),[M,se]=d.useState(null),_=k(e,f=>F(f)),[O,U]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=d.useCallback(f=>{const[T,...R]=B().map(N=>N.ref.current),[b]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===b&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=h;d.useEffect(()=>{if(x){let f={x:0,y:0};const T=b=>{f={x:Math.abs(Math.round(b.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(K.current?.y??0))}},R=b=>{f.x<=10&&f.y<=10?b.preventDefault():x.contains(b.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),d.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=ot(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),b=nt(T,f,R);b&&setTimeout(()=>b.ref.current.focus())}),me=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&(U(f),b&&(H.current=!0))},[h.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&L(f)},[h.value]),ie=o==="popper"?Se:Fe,re=ie===Se?{side:l,sideOffset:i,align:u,alignOffset:m,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return c.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:se,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:c.jsx(pt,{as:Mt,allowPinchZoom:!0,children:c.jsx(ft,{asChild:!0,trapped:h.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(n,f=>{h.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:c.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:c.jsx(ie,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:f=>f.preventDefault(),...C,...re,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:P(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let b=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,N=b.indexOf(I);b=b.slice(N+1)}setTimeout(()=>E(b)),f.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((s,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=s,a=G(Q,t),r=Y(Q,t),[l,i]=d.useState(null),[u,m]=d.useState(null),g=k(e,_=>m(_)),w=ue(t),y=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:h}=r,x=d.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&p&&v&&C){const _=a.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=a.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(a.dir!=="rtl"){const I=q.left-O.left,N=U.left-I,X=_.left-N,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,N=window.innerWidth-U.right-I,X=window.innerWidth-_.right-N,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ie=B-te,re=v.offsetHeight/2,f=v.offsetTop+re,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,re+(I?he:0)+N+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+re)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>y.current=!0)}},[w,a.trigger,a.valueNode,l,u,p,v,C,a.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const se=d.useCallback(_=>{_&&S.current===!0&&(x(),h?.(),S.current=!1)},[x,h]);return c.jsx(Dt,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:se,children:c.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:c.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((s,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...a}=s,r=pe(t);return c.jsx(xt,{...r,...a,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=Ot;var[Dt,Te]=ne(Q,{}),we="SelectViewport",Ue=d.forwardRef((s,e)=>{const{__scopeSelect:t,nonce:o,...n}=s,a=Y(we,t),r=Te(we,t),l=k(e,a.onViewportChange),i=d.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(de.Slot,{scope:t,children:c.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:P(n.onScroll,u=>{const m=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:w}=r;if(w?.current&&g){const y=Math.abs(i.current-m.scrollTop);if(y>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const h=C+y,x=Math.min(S,h),F=h-x;g.style.height=x+"px",g.style.bottom==="0px"&&(m.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}i.current=m.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Ie();return c.jsx(kt,{scope:t,id:n,children:c.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Lt(Ke,t);return c.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ce="SelectItem",[Ht,$e]=ne(ce),Ge=d.forwardRef((s,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:a,...r}=s,l=G(ce,t),i=Y(ce,t),u=l.value===o,[m,g]=d.useState(a??""),[w,y]=d.useState(!1),S=k(e,h=>i.itemRefCallback?.(h,o,n)),p=Ie(),v=d.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(h=>{g(x=>x||(h?.textContent??"").trim())},[]),children:c.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:m,children:c.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...r,ref:S,onFocus:P(r.onFocus,()=>y(!0)),onBlur:P(r.onBlur,()=>y(!1)),onClick:P(r.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:P(r.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:P(r.onPointerDown,h=>{v.current=h.pointerType}),onPointerMove:P(r.onPointerMove,h=>{v.current=h.pointerType,n?i.onItemLeave?.():v.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(r.onPointerLeave,h=>{h.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:P(r.onKeyDown,h=>{i.searchRef?.current!==""&&h.key===" "||(It.includes(h.key)&&C(),h.key===" "&&h.preventDefault())})})})})});Ge.displayName=ce;var le="SelectItemText",Ye=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,...a}=s,r=G(le,t),l=Y(le,t),i=$e(le,t),u=_t(le,t),[m,g]=d.useState(null),w=k(e,C=>g(C),i.onItemTextChange,C=>l.itemTextRefCallback?.(C,i.value,i.disabled)),y=m?.textContent,S=d.useMemo(()=>c.jsx("option",{value:i.value,disabled:i.disabled,children:y},i.value),[i.disabled,i.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),c.jsxs(c.Fragment,{children:[c.jsx(j.span,{id:i.textId,...a,ref:w}),i.isSelected&&r.valueNode&&!r.valueNodeHasChildren?Ee.createPortal(a.children,r.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return $e(qe,t).isSelected?c.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var ye="SelectScrollUpButton",Ze=d.forwardRef((s,e)=>{const t=Y(ye,s.__scopeSelect),o=Te(ye,s.__scopeSelect),[n,a]=d.useState(!1),r=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=i.scrollTop>0;a(u)};const i=t.viewport;return l(),i.addEventListener("scroll",l),()=>i.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:i}=t;l&&i&&(l.scrollTop=l.scrollTop-i.offsetHeight)}}):null});Ze.displayName=ye;var Ce="SelectScrollDownButton",Je=d.forwardRef((s,e)=>{const t=Y(Ce,s.__scopeSelect),o=Te(Ce,s.__scopeSelect),[n,a]=d.useState(!1),r=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=i.scrollHeight-i.clientHeight,m=Math.ceil(i.scrollTop)<u;a(m)};const i=t.viewport;return l(),i.addEventListener("scroll",l),()=>i.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:i}=t;l&&i&&(l.scrollTop=l.scrollTop+i.offsetHeight)}}):null});Je.displayName=Ce;var Qe=d.forwardRef((s,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=s,a=Y("SelectScrollButton",t),r=d.useRef(null),l=ue(t),i=d.useCallback(()=>{r.current!==null&&(window.clearInterval(r.current),r.current=null)},[]);return d.useEffect(()=>()=>i(),[i]),$(()=>{l().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),c.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:P(n.onPointerDown,()=>{r.current===null&&(r.current=window.setInterval(o,50))}),onPointerMove:P(n.onPointerMove,()=>{a.onItemLeave?.(),r.current===null&&(r.current=window.setInterval(o,50))}),onPointerLeave:P(n.onPointerLeave,()=>{i()})})}),zt="SelectSeparator",Ft=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return c.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var be="SelectArrow",Ut=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=pe(t),a=G(be,t),r=Y(be,t);return a.open&&r.position==="popper"?c.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=be;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:s,value:e,...t},o)=>{const n=d.useRef(null),a=k(o,n),r=ht(e);return d.useEffect(()=>{const l=n.current;if(!l)return;const i=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(i,"value").set;if(r!==e&&m){const g=new Event("change",{bubbles:!0});m.call(l,e),l.dispatchEvent(g)}},[r,e]),c.jsx(j.select,{...t,style:{...yt,...t.style},ref:a,defaultValue:e})});et.displayName=Wt;function tt(s){return s===""||s===void 0}function ot(s){const e=ct(s),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(r=>{const l=t.current+r;e(l),(function i(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>i(""),1e3))})(l)},[e]),a=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,a]}function nt(s,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,a=t?s.indexOf(t):-1;let r=Kt(s,Math.max(a,0));n.length===1&&(r=r.filter(u=>u!==t));const i=r.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==t?i:void 0}function Kt(s,e){return s.map((t,o)=>s[(e+o)%s.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,Xt=Be,Zt=Ve,Jt=Ue,Qt=Ge,_e=Ye,eo=Xe,to=Ze,oo=Je;function io(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function co(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(s){const e=ee.c(13);let t,o,n,a;e[0]!==s?({className:o,size:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a):(t=e[1],o=e[2],n=e[3],a=e[4]);const r=a===void 0?"default":a;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-[var(--studio-outline-hover-background)] hover:text-accent-foreground flex w-fit items-center justify-between gap-2 rounded-lg bg-[var(--studio-input-background)] px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(qt,{asChild:!0,children:c.jsx(je,{className:"size-4 opacity-50"})}),e[7]=i):i=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==r||e[11]!==l?(u=c.jsxs(Gt,{"data-slot":"select-trigger","data-size":r,className:l,...n,children:[t,i]}),e[8]=t,e[9]=n,e[10]=r,e[11]=l,e[12]=u):u=e[12],u}function po(s){const e=ee.c(25);let t,o,n,a,r;e[0]!==s?({className:o,children:t,position:a,hideScrollButtons:r,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=a===void 0?"popper":a,i=r===void 0?!1:r,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let m;e[6]!==o||e[7]!==u?(m=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=m):m=e[8];let g;e[9]!==i?(g=!i&&c.jsx(no,{}),e[9]=i,e[10]=g):g=e[10];const w=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let y;e[11]!==w?(y=oe("p-1",w),e[11]=w,e[12]=y):y=e[12];let S;e[13]!==t||e[14]!==y?(S=c.jsx(Jt,{className:y,children:t}),e[13]=t,e[14]=y,e[15]=S):S=e[15];let p;e[16]!==i?(p=!i&&c.jsx(so,{}),e[16]=i,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==m||e[21]!==g||e[22]!==S||e[23]!==p?(v=c.jsx(Xt,{children:c.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:m,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=m,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function fo(s){const e=ee.c(19);let t,o,n,a,r;e[0]!==s?({className:o,children:t,description:n,hideCheck:r,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=r===void 0?!1:r,i=n&&"items-start py-2";let u;e[6]!==o||e[7]!==i?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",i,o),e[6]=o,e[7]=i,e[8]=u):u=e[8];let m;e[9]!==l?(m=!l&&c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(eo,{children:c.jsx(wt,{className:"size-4"})})}),e[9]=l,e[10]=m):m=e[10];let g;e[11]!==t||e[12]!==n?(g=n?c.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c.jsx(_e,{children:t}),c.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):c.jsx(_e,{children:t}),e[11]=t,e[12]=n,e[13]=g):g=e[13];let w;return e[14]!==a||e[15]!==u||e[16]!==m||e[17]!==g?(w=c.jsxs(Qt,{"data-slot":"select-item",className:u,...a,children:[m,g]}),e[14]=a,e[15]=u,e[16]=m,e[17]=g,e[18]=w):w=e[18],w}function no(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(Ct,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}function so(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(je,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}export{io as S,co as a,uo as b,fo as c,po as d,Pe as e};
|
|
1
|
+
import{r as d,bo as k,bp as Ie,j as c,bq as j,br as P,bs as st,bt as $,bu as rt,aO as Ee,bv as lt,bw as Ne,bx as at,by as it,bz as Re,bA as ct,bB as dt,bC as ut,bD as pt,bE as ft,bF as mt,bG as ht,bH as vt,bI as gt,bJ as xt,bK as St,c as ee,l as oe,a9 as wt}from"./index-Br65nWs8.js";import{V as yt}from"./index-CvuZZryV.js";import{t as je,n as Ct}from"./ChevronUp-CWbL6T1G.js";function Pe(s,[e,t]){return Math.min(t,Math.max(e,s))}var bt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,Tt]=it(J),[ne]=vt(J,[Tt,Re]),pe=Re(),[Nt,G]=ne(J),[Pt,_t]=ne(J),Me=s=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:a,value:r,defaultValue:l,onValueChange:i,dir:u,name:m,autoComplete:g,disabled:w,required:y,form:S}=s,p=pe(e),[v,C]=d.useState(null),[h,x]=d.useState(null),[F,M]=d.useState(!1),se=lt(u),[_,O]=Ne({prop:o,defaultProp:n??!1,onChange:a,caller:J}),[U,q]=Ne({prop:r,defaultProp:l,onChange:i,caller:J}),L=d.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return c.jsx(at,{...p,children:c.jsxs(Nt,{required:y,scope:e,trigger:v,onTriggerChange:C,valueNode:h,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:se,triggerPointerDownPosRef:L,disabled:w,children:[c.jsx(de.Provider,{scope:e,children:c.jsx(Pt,{scope:s.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?c.jsxs(et,{"aria-hidden":!0,required:y,tabIndex:-1,name:m,autoComplete:g,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?c.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=J;var Ae="SelectTrigger",Oe=d.forwardRef((s,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=s,a=pe(t),r=G(Ae,t),l=r.disabled||o,i=k(e,r.onTriggerChange),u=ue(t),m=d.useRef("touch"),[g,w,y]=ot(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===r.value),h=nt(v,p,C);h!==void 0&&r.onValueChange(h.value)}),S=p=>{l||(r.onOpenChange(!0),y()),p&&(r.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(st,{asChild:!0,...a,children:c.jsx(j.button,{type:"button",role:"combobox","aria-controls":r.contentId,"aria-expanded":r.open,"aria-required":r.required,"aria-autocomplete":"none",dir:r.dir,"data-state":r.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":tt(r.value)?"":void 0,...n,ref:i,onClick:P(n.onClick,p=>{p.currentTarget.focus(),m.current!=="mouse"&&S(p)}),onPointerDown:P(n.onPointerDown,p=>{m.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(v&&p.key===" ")&&bt.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,children:a,placeholder:r="",...l}=s,i=G(De,t),{onValueNodeHasChildrenChange:u}=i,m=a!==void 0,g=k(e,i.onValueNodeChange);return $(()=>{u(m)},[u,m]),c.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:tt(i.value)?c.jsx(c.Fragment,{children:r}):a})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((s,e)=>{const{__scopeSelect:t,children:o,...n}=s;return c.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=s=>c.jsx(rt,{asChild:!0,...s});Be.displayName=Rt;var Q="SelectContent",Ve=d.forwardRef((s,e)=>{const t=G(Q,s.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const a=o;return a?Ee.createPortal(c.jsx(He,{scope:s.__scopeSelect,children:c.jsx(de.Slot,{scope:s.__scopeSelect,children:c.jsx("div",{children:s.children})})}),a):null}return c.jsx(ze,{...s,ref:e})});Ve.displayName=Q;var A=10,[He,Y]=ne(Q),jt="SelectContentImpl",Mt=gt("SelectContent.RemoveScroll"),ze=d.forwardRef((s,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:a,onPointerDownOutside:r,side:l,sideOffset:i,align:u,alignOffset:m,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=s,h=G(Q,t),[x,F]=d.useState(null),[M,se]=d.useState(null),_=k(e,f=>F(f)),[O,U]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=d.useCallback(f=>{const[T,...R]=B().map(N=>N.ref.current),[b]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===b&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=h;d.useEffect(()=>{if(x){let f={x:0,y:0};const T=b=>{f={x:Math.abs(Math.round(b.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(K.current?.y??0))}},R=b=>{f.x<=10&&f.y<=10?b.preventDefault():x.contains(b.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),d.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=ot(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),b=nt(T,f,R);b&&setTimeout(()=>b.ref.current.focus())}),me=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&(U(f),b&&(H.current=!0))},[h.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&L(f)},[h.value]),ie=o==="popper"?Se:Fe,re=ie===Se?{side:l,sideOffset:i,align:u,alignOffset:m,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return c.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:se,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:c.jsx(pt,{as:Mt,allowPinchZoom:!0,children:c.jsx(ft,{asChild:!0,trapped:h.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(n,f=>{h.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:c.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:c.jsx(ie,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:f=>f.preventDefault(),...C,...re,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:P(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let b=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,N=b.indexOf(I);b=b.slice(N+1)}setTimeout(()=>E(b)),f.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((s,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=s,a=G(Q,t),r=Y(Q,t),[l,i]=d.useState(null),[u,m]=d.useState(null),g=k(e,_=>m(_)),w=ue(t),y=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:h}=r,x=d.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&p&&v&&C){const _=a.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=a.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(a.dir!=="rtl"){const I=q.left-O.left,N=U.left-I,X=_.left-N,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,N=window.innerWidth-U.right-I,X=window.innerWidth-_.right-N,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ie=B-te,re=v.offsetHeight/2,f=v.offsetTop+re,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,re+(I?he:0)+N+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+re)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>y.current=!0)}},[w,a.trigger,a.valueNode,l,u,p,v,C,a.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const se=d.useCallback(_=>{_&&S.current===!0&&(x(),h?.(),S.current=!1)},[x,h]);return c.jsx(Dt,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:se,children:c.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:c.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((s,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...a}=s,r=pe(t);return c.jsx(xt,{...r,...a,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=Ot;var[Dt,Te]=ne(Q,{}),we="SelectViewport",Ue=d.forwardRef((s,e)=>{const{__scopeSelect:t,nonce:o,...n}=s,a=Y(we,t),r=Te(we,t),l=k(e,a.onViewportChange),i=d.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(de.Slot,{scope:t,children:c.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:P(n.onScroll,u=>{const m=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:w}=r;if(w?.current&&g){const y=Math.abs(i.current-m.scrollTop);if(y>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const h=C+y,x=Math.min(S,h),F=h-x;g.style.height=x+"px",g.style.bottom==="0px"&&(m.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}i.current=m.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Ie();return c.jsx(kt,{scope:t,id:n,children:c.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Lt(Ke,t);return c.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ce="SelectItem",[Ht,$e]=ne(ce),Ge=d.forwardRef((s,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:a,...r}=s,l=G(ce,t),i=Y(ce,t),u=l.value===o,[m,g]=d.useState(a??""),[w,y]=d.useState(!1),S=k(e,h=>i.itemRefCallback?.(h,o,n)),p=Ie(),v=d.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(h=>{g(x=>x||(h?.textContent??"").trim())},[]),children:c.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:m,children:c.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...r,ref:S,onFocus:P(r.onFocus,()=>y(!0)),onBlur:P(r.onBlur,()=>y(!1)),onClick:P(r.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:P(r.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:P(r.onPointerDown,h=>{v.current=h.pointerType}),onPointerMove:P(r.onPointerMove,h=>{v.current=h.pointerType,n?i.onItemLeave?.():v.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(r.onPointerLeave,h=>{h.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:P(r.onKeyDown,h=>{i.searchRef?.current!==""&&h.key===" "||(It.includes(h.key)&&C(),h.key===" "&&h.preventDefault())})})})})});Ge.displayName=ce;var le="SelectItemText",Ye=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,...a}=s,r=G(le,t),l=Y(le,t),i=$e(le,t),u=_t(le,t),[m,g]=d.useState(null),w=k(e,C=>g(C),i.onItemTextChange,C=>l.itemTextRefCallback?.(C,i.value,i.disabled)),y=m?.textContent,S=d.useMemo(()=>c.jsx("option",{value:i.value,disabled:i.disabled,children:y},i.value),[i.disabled,i.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),c.jsxs(c.Fragment,{children:[c.jsx(j.span,{id:i.textId,...a,ref:w}),i.isSelected&&r.valueNode&&!r.valueNodeHasChildren?Ee.createPortal(a.children,r.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return $e(qe,t).isSelected?c.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var ye="SelectScrollUpButton",Ze=d.forwardRef((s,e)=>{const t=Y(ye,s.__scopeSelect),o=Te(ye,s.__scopeSelect),[n,a]=d.useState(!1),r=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=i.scrollTop>0;a(u)};const i=t.viewport;return l(),i.addEventListener("scroll",l),()=>i.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:i}=t;l&&i&&(l.scrollTop=l.scrollTop-i.offsetHeight)}}):null});Ze.displayName=ye;var Ce="SelectScrollDownButton",Je=d.forwardRef((s,e)=>{const t=Y(Ce,s.__scopeSelect),o=Te(Ce,s.__scopeSelect),[n,a]=d.useState(!1),r=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=i.scrollHeight-i.clientHeight,m=Math.ceil(i.scrollTop)<u;a(m)};const i=t.viewport;return l(),i.addEventListener("scroll",l),()=>i.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:i}=t;l&&i&&(l.scrollTop=l.scrollTop+i.offsetHeight)}}):null});Je.displayName=Ce;var Qe=d.forwardRef((s,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=s,a=Y("SelectScrollButton",t),r=d.useRef(null),l=ue(t),i=d.useCallback(()=>{r.current!==null&&(window.clearInterval(r.current),r.current=null)},[]);return d.useEffect(()=>()=>i(),[i]),$(()=>{l().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),c.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:P(n.onPointerDown,()=>{r.current===null&&(r.current=window.setInterval(o,50))}),onPointerMove:P(n.onPointerMove,()=>{a.onItemLeave?.(),r.current===null&&(r.current=window.setInterval(o,50))}),onPointerLeave:P(n.onPointerLeave,()=>{i()})})}),zt="SelectSeparator",Ft=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return c.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var be="SelectArrow",Ut=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=pe(t),a=G(be,t),r=Y(be,t);return a.open&&r.position==="popper"?c.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=be;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:s,value:e,...t},o)=>{const n=d.useRef(null),a=k(o,n),r=ht(e);return d.useEffect(()=>{const l=n.current;if(!l)return;const i=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(i,"value").set;if(r!==e&&m){const g=new Event("change",{bubbles:!0});m.call(l,e),l.dispatchEvent(g)}},[r,e]),c.jsx(j.select,{...t,style:{...yt,...t.style},ref:a,defaultValue:e})});et.displayName=Wt;function tt(s){return s===""||s===void 0}function ot(s){const e=ct(s),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(r=>{const l=t.current+r;e(l),(function i(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>i(""),1e3))})(l)},[e]),a=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,a]}function nt(s,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,a=t?s.indexOf(t):-1;let r=Kt(s,Math.max(a,0));n.length===1&&(r=r.filter(u=>u!==t));const i=r.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==t?i:void 0}function Kt(s,e){return s.map((t,o)=>s[(e+o)%s.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,Xt=Be,Zt=Ve,Jt=Ue,Qt=Ge,_e=Ye,eo=Xe,to=Ze,oo=Je;function io(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function co(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(s){const e=ee.c(13);let t,o,n,a;e[0]!==s?({className:o,size:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a):(t=e[1],o=e[2],n=e[3],a=e[4]);const r=a===void 0?"default":a;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-[var(--studio-outline-hover-background)] hover:text-accent-foreground flex w-fit items-center justify-between gap-2 rounded-lg bg-[var(--studio-input-background)] px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(qt,{asChild:!0,children:c.jsx(je,{className:"size-4 opacity-50"})}),e[7]=i):i=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==r||e[11]!==l?(u=c.jsxs(Gt,{"data-slot":"select-trigger","data-size":r,className:l,...n,children:[t,i]}),e[8]=t,e[9]=n,e[10]=r,e[11]=l,e[12]=u):u=e[12],u}function po(s){const e=ee.c(25);let t,o,n,a,r;e[0]!==s?({className:o,children:t,position:a,hideScrollButtons:r,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=a===void 0?"popper":a,i=r===void 0?!1:r,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let m;e[6]!==o||e[7]!==u?(m=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=m):m=e[8];let g;e[9]!==i?(g=!i&&c.jsx(no,{}),e[9]=i,e[10]=g):g=e[10];const w=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let y;e[11]!==w?(y=oe("p-1",w),e[11]=w,e[12]=y):y=e[12];let S;e[13]!==t||e[14]!==y?(S=c.jsx(Jt,{className:y,children:t}),e[13]=t,e[14]=y,e[15]=S):S=e[15];let p;e[16]!==i?(p=!i&&c.jsx(so,{}),e[16]=i,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==m||e[21]!==g||e[22]!==S||e[23]!==p?(v=c.jsx(Xt,{children:c.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:m,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=m,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function fo(s){const e=ee.c(19);let t,o,n,a,r;e[0]!==s?({className:o,children:t,description:n,hideCheck:r,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=r===void 0?!1:r,i=n&&"items-start py-2";let u;e[6]!==o||e[7]!==i?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",i,o),e[6]=o,e[7]=i,e[8]=u):u=e[8];let m;e[9]!==l?(m=!l&&c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(eo,{children:c.jsx(wt,{className:"size-4"})})}),e[9]=l,e[10]=m):m=e[10];let g;e[11]!==t||e[12]!==n?(g=n?c.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c.jsx(_e,{children:t}),c.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):c.jsx(_e,{children:t}),e[11]=t,e[12]=n,e[13]=g):g=e[13];let w;return e[14]!==a||e[15]!==u||e[16]!==m||e[17]!==g?(w=c.jsxs(Qt,{"data-slot":"select-item",className:u,...a,children:[m,g]}),e[14]=a,e[15]=u,e[16]=m,e[17]=g,e[18]=w):w=e[18],w}function no(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(Ct,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}function so(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(je,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}export{io as S,co as a,uo as b,fo as c,po as d,Pe as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as $,b as A,r as R,l as G,j as s,B as H}from"./index-
|
|
1
|
+
import{c as $,b as A,r as R,l as G,j as s,B as H}from"./index-Br65nWs8.js";import{a as J,d as K,b as Q,D as U}from"./dialog-DAOqbLTM.js";import{c as V,b as W,a as X,D as Y}from"./drawer-CzplXqA6.js";import{u as Z}from"./use-mobile-CLWwR5Aq.js";import{c as ee}from"./chat-context-Xotq8Uwe.js";import{S as F,M as se}from"./decopilot-ONeLQXU1.js";import{M as le,a as oe}from"./index-C3hYf8V4.js";function he(L){const e=$.c(48),{variant:t,className:o,placeholder:n,model:l,isLoading:I,credentialId:P,onCredentialChange:k,onModelChange:v,filterModels:E}=L,z=t===void 0?"borderless":t,w=n===void 0?"Select model":n,r=A(),[a,S]=R.useState(!1),i=v!==void 0,q=Z(),O=z==="borderless"?"ghost":"outline",_=z==="borderless"&&"md:border-none";let d;e[0]!==o||e[1]!==_?(d=G("text-sm hover:bg-accent classic:rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",_,o),e[0]=o,e[1]=_,e[2]=d):d=e[2];let c;e[3]!==I||e[4]!==l||e[5]!==w||e[6]!==i?(c=i?s.jsx(F,{model:l??null,placeholder:w,isLoading:I}):s.jsx(ne,{placeholder:w}),e[3]=I,e[4]=l,e[5]=w,e[6]=i,e[7]=c):c=e[7];let D;e[8]!==O||e[9]!==d||e[10]!==c?(D=s.jsx(H,{variant:O,size:"sm",className:d,children:c}),e[8]=O,e[9]=d,e[10]=c,e[11]=D):D=e[11];const f=D;let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(se,{}),e[12]=y):y=e[12];let N;e[13]!==P||e[14]!==E||e[15]!==l||e[16]!==k||e[17]!==v||e[18]!==i?(N=s.jsx(R.Suspense,{fallback:y,children:i?s.jsx(le,{onClose:()=>S(!1),credentialId:P??null,onCredentialChange:k??te,selectedModel:l??null,onModelChange:v,filterModels:E}):s.jsx(oe,{onClose:()=>S(!1)})}),e[13]=P,e[14]=E,e[15]=l,e[16]=k,e[17]=v,e[18]=i,e[19]=N):N=e[19];const m=N;if(q){let g;e[20]!==f?(g=s.jsx(V,{asChild:!0,children:f}),e[20]=f,e[21]=g):g=e[21];let j;e[22]!==r?(j=r("chat.selectModel.selectModel"),e[22]=r,e[23]=j):j=e[23];let M;e[24]!==j?(M=s.jsx(W,{className:"sr-only",children:j}),e[24]=j,e[25]=M):M=e[25];let b;e[26]!==m?(b=s.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:m}),e[26]=m,e[27]=b):b=e[27];let C;e[28]!==M||e[29]!==b?(C=s.jsxs(X,{className:"p-0 flex flex-col max-h-[95vh]",children:[M,b]}),e[28]=M,e[29]=b,e[30]=C):C=e[30];let T;return e[31]!==a||e[32]!==g||e[33]!==C?(T=s.jsxs(Y,{open:a,onOpenChange:S,children:[g,C]}),e[31]=a,e[32]=g,e[33]=C,e[34]=T):T=e[34],T}let h;e[35]!==f?(h=s.jsx(J,{asChild:!0,children:f}),e[35]=f,e[36]=h):h=e[36];let x;e[37]!==r?(x=r("chat.selectModel.selectModel"),e[37]=r,e[38]=x):x=e[38];let p;e[39]!==x?(p=s.jsx(K,{className:"sr-only",children:x}),e[39]=x,e[40]=p):p=e[40];let u;e[41]!==m||e[42]!==p?(u=s.jsxs(Q,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[p,m]}),e[41]=m,e[42]=p,e[43]=u):u=e[43];let B;return e[44]!==a||e[45]!==h||e[46]!==u?(B=s.jsxs(U,{open:a,onOpenChange:S,children:[h,u]}),e[44]=a,e[45]=h,e[46]=u,e[47]=B):B=e[47],B}function te(){}function ne(L){const e=$.c(4),{placeholder:t}=L,{selectedModel:o,isModelsLoading:n}=ee();let l;return e[0]!==n||e[1]!==o||e[2]!==t?(l=s.jsx(F,{model:o,placeholder:t,isLoading:n}),e[0]=n,e[1]=o,e[2]=t,e[3]=l):l=e[3],l}export{he as M};
|