decocms 4.517.0 → 4.518.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/{ActiveShapeUtils-BB436TvV.js → ActiveShapeUtils-DC4ySNWR.js} +1 -1
- package/dist/client/assets/{AlertCircle-Cch634f7.js → AlertCircle-DgnxHqxe.js} +1 -1
- package/dist/client/assets/{AreaChart-CpsihjcZ.js → AreaChart-Ccsbdjec.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CohopnCT.js → ArrowLeft-BJ1448l4.js} +1 -1
- package/dist/client/assets/{ArrowUp-DLUdomd9.js → ArrowUp-723TVuFG.js} +1 -1
- package/dist/client/assets/{BarChart-DC5-aC-9.js → BarChart-BdOKvWnK.js} +1 -1
- package/dist/client/assets/{Building02-BHJQSDUK.js → Building02-DU823ZCw.js} +1 -1
- package/dist/client/assets/{CartesianChart-dMOiAgfo.js → CartesianChart-3-g5kX2i.js} +1 -1
- package/dist/client/assets/{CategoricalChart-BCAB1JR1.js → CategoricalChart-CinaMpxG.js} +1 -1
- package/dist/client/assets/{CheckCircle-Cs8i9zYt.js → CheckCircle-C7csYE-y.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-C5d75KyY.js → ChevronSelectorVertical-B0Z7parR.js} +1 -1
- package/dist/client/assets/{ChevronUp-BT7eMKPK.js → ChevronUp-DiTVmUiH.js} +1 -1
- package/dist/client/assets/{Copy01-B341DqLV.js → Copy01-DRNuKy-h.js} +1 -1
- package/dist/client/assets/{CreditCard01-4Fwr0tNh.js → CreditCard01-C3f2i_qY.js} +1 -1
- package/dist/client/assets/{DotsVertical-DbrlDgFh.js → DotsVertical-eX97dPc6.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-t45nElJh.js → ErrorBarContext-CCb5UZ88.js} +1 -1
- package/dist/client/assets/{Globe04-BE6c1UDj.js → Globe04-ByvV2bPX.js} +1 -1
- package/dist/client/assets/{Image01-hTzc15CE.js → Image01-QuVxFosz.js} +1 -1
- package/dist/client/assets/{Key01-kTu6t6u_.js → Key01-C-QXsN23.js} +1 -1
- package/dist/client/assets/{Link01-hfA48cFL.js → Link01-CbpFxbNY.js} +1 -1
- package/dist/client/assets/{LinkBroken01-Dioz3u9i.js → LinkBroken01-DDgMbBWJ.js} +1 -1
- package/dist/client/assets/{Minus-DqDPTtRG.js → Minus-DnJ8wbLv.js} +1 -1
- package/dist/client/assets/{Monitor01-Bz6QaUO4.js → Monitor01-DD5_JCl8.js} +1 -1
- package/dist/client/assets/{Play-CByslM3d.js → Play-BgEaB30r.js} +1 -1
- package/dist/client/assets/{Plus-Dewm72je.js → Plus-BnqPSlPj.js} +1 -1
- package/dist/client/assets/{ReferenceLine-DV9hYxt_.js → ReferenceLine-PgVE-Dmr.js} +1 -1
- package/dist/client/assets/{SearchMd-7Jo0ZofC.js → SearchMd-GQAKwnQD.js} +1 -1
- package/dist/client/assets/{Sector-D64VY8hG.js → Sector-DG1U_Qdd.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-BStpgW0a.js → ShoppingBag01-DVHnZchK.js} +1 -1
- package/dist/client/assets/{Sun-C37Hpdko.js → Sun-Ct5gftPt.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CrC4ThKg.js → SwitchHorizontal01-_kdH1ete.js} +1 -1
- package/dist/client/assets/{Tool01-2gJDR0Ho.js → Tool01-rTZNmFct.js} +1 -1
- package/dist/client/assets/{Trash01-DjE7Raat.js → Trash01-TPK4gSsp.js} +1 -1
- package/dist/client/assets/{Upload01-CYfTR3aZ.js → Upload01-D6tRQTgc.js} +1 -1
- package/dist/client/assets/{User01-X6IeKYZH.js → User01-1q78INo2.js} +1 -1
- package/dist/client/assets/{UserSquare-pmxb5ZdZ.js → UserSquare-B_yRFcN6.js} +1 -1
- package/dist/client/assets/{Users01-uKJoVSle.js → Users01-D5MhP5r0.js} +1 -1
- package/dist/client/assets/{XClose-BVxVAZ6V.js → XClose-DOXmYMF_.js} +1 -1
- package/dist/client/assets/{ZoomOut-DixQygt2.js → ZoomOut-DLICjI1h.js} +1 -1
- package/dist/client/assets/{access-gate-BpfEc6VH.js → access-gate-p2OBWc28.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BZwLO1Ja.js → add-connection-dialog-BluC5xOJ.js} +1 -1
- package/dist/client/assets/agent-analytics-D7PovqhV.js +1 -0
- package/dist/client/assets/agent-app-DEsjnzHy.js +1 -0
- package/dist/client/assets/{agent-assets-e6Gk5J-Q.js → agent-assets-CsYWD2CR.js} +1 -1
- package/dist/client/assets/{agent-automation-jGwXvC8f.js → agent-automation-J7szToQ3.js} +1 -1
- package/dist/client/assets/{agent-automations-DzW1crP1.js → agent-automations-tGwSufFx.js} +1 -1
- package/dist/client/assets/agent-calendar-Co4HNR_x.js +1 -0
- package/dist/client/assets/{agent-connect-sources-6bCKMOK5.js → agent-connect-sources-Bf7YpJtB.js} +1 -1
- package/dist/client/assets/agent-deck-Bra-oqcr.js +1 -0
- package/dist/client/assets/{agent-e2e-DwASXEee.js → agent-e2e-B01kqUsN.js} +1 -1
- package/dist/client/assets/agent-experiments-W5vP2PHw.js +1 -0
- package/dist/client/assets/agent-file-_hkGq1Y2.js +1 -0
- package/dist/client/assets/{agent-hosting-BVT3wdCc.js → agent-hosting-8jYjdLhJ.js} +1 -1
- package/dist/client/assets/{agent-icon-CiKTiUdq.js → agent-icon-g2PIrjzs.js} +1 -1
- package/dist/client/assets/agent-library-BTKjZMW2.js +1 -0
- package/dist/client/assets/agent-library-file-ClGbfS7a.js +1 -0
- package/dist/client/assets/{agent-monitor-C_MtaF0x.js → agent-monitor-Dtdyok8Z.js} +1 -1
- package/dist/client/assets/{agent-overview-BaJQVLzH.js → agent-overview-uVNzU6d3.js} +1 -1
- package/dist/client/assets/agent-releases-DVFEJ-Ad.js +2 -0
- package/dist/client/assets/agent-settings-DQDpgZ05.js +1 -0
- package/dist/client/assets/{agent-site-editor-DGIssniL.js → agent-site-editor-DI9lfD7X.js} +2 -2
- package/dist/client/assets/agent-site-editor-code-CiWALb3j.js +2 -0
- package/dist/client/assets/agent-site-editor-content-BrDlLQPy.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-Da7g0LlC.js +1 -0
- package/dist/client/assets/{agent-view-guard-Cz_9FSeB.js → agent-view-guard-Bhzmxyux.js} +1 -1
- package/dist/client/assets/agent-view-l1LYqbmp.js +1 -0
- package/dist/client/assets/{agents-list-BehVRlw8.js → agents-list-CbFcTa4A.js} +1 -1
- package/dist/client/assets/{ai-providers-Cfzh0dop.js → ai-providers-Da7yjmwG.js} +1 -1
- package/dist/client/assets/{alert-dialog-BdWXpnme.js → alert-dialog-KKnJELoX.js} +1 -1
- package/dist/client/assets/{alert-DlpN1nbO.js → alert-kpgdNVxk.js} +1 -1
- package/dist/client/assets/{analytics-sections-CBRurMfi.js → analytics-sections-DlComRmC.js} +1 -1
- package/dist/client/assets/{analytics-tab-Bu3yOSFE.js → analytics-tab-B_HbOlqF.js} +1 -1
- package/dist/client/assets/{api-keys-SwcfBYZn.js → api-keys-DNrkQCkt.js} +1 -1
- package/dist/client/assets/api-keys-kxUaur7Y.js +1 -0
- package/dist/client/assets/{app-editor-BzaLO82-.js → app-editor-CKdeak5r.js} +1 -1
- package/dist/client/assets/{asset-utils-CYj7sEud.js → asset-utils-CYyNDrFK.js} +1 -1
- package/dist/client/assets/{auth-DVebpHI3.js → auth-DHZfBLZ5.js} +1 -1
- package/dist/client/assets/{auth-catchall-CM988zgH.js → auth-catchall-BS8FAipd.js} +1 -1
- package/dist/client/assets/{auth-entry-BM6bA3ji.js → auth-entry-34SQAdx9.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BnlVBIeL.js → auth-split-layout-DF-Z-sUB.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-qcbNyaRp.js → authenticate-and-persist-oauth-CbgraxNg.js} +1 -1
- package/dist/client/assets/{automation-list-row-BIlvc0v-.js → automation-list-row-DtCSZcdc.js} +1 -1
- package/dist/client/assets/{automation-runs-jRApvuta.js → automation-runs-Lelpmww0.js} +1 -1
- package/dist/client/assets/{automations-DMHgje9o.js → automations-CV4vMVkc.js} +1 -1
- package/dist/client/assets/{autosend-BTx7-p6a.js → autosend-Cwww7_9j.js} +1 -1
- package/dist/client/assets/{avatar-DjIkOwsx.js → avatar-BRRGslVN.js} +1 -1
- package/dist/client/assets/{badge-BfMggcm8.js → badge-DmeqGssZ.js} +1 -1
- package/dist/client/assets/{block-document-DKju3Lsl.js → block-document-DtA_3M8z.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-AokvrTWO.js → blocks-preview-workspace-context--o78Y3yp.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-5tpSikld.js → blocks-tab-states-Dps89GrH.js} +1 -1
- package/dist/client/assets/{blog-schema-B8hGgOKc.js → blog-schema-CEYO8j-N.js} +1 -1
- package/dist/client/assets/{buckets-DzW1ArnB.js → buckets-CXMlDLcD.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-BGKe2ED3.js → build-improve-prompt-doc-C7S9lWPM.js} +1 -1
- package/dist/client/assets/{calendar-kdikRXDO.js → calendar-B6BpOXfC.js} +1 -1
- package/dist/client/assets/{campaigns-view-CXUV2H04.js → campaigns-view-DtQvcOC6.js} +1 -1
- package/dist/client/assets/{capability-load-error-BuC7MxXm.js → capability-load-error-CDC4LjDf.js} +1 -1
- package/dist/client/assets/category-editor-BvoAtPRs.js +1 -0
- package/dist/client/assets/{chart-aHPEwhl0.js → chart-CTinHp-8.js} +1 -1
- package/dist/client/assets/{chat-context-BEyCIAaN.js → chat-context-DLezfYEa.js} +1 -1
- package/dist/client/assets/{chat-draft-Dql_zG1A.js → chat-draft-BlRnwK9v.js} +1 -1
- package/dist/client/assets/{checkbox-R6Pm_B33.js → checkbox-BlB_jfat.js} +1 -1
- package/dist/client/assets/{choose-editor-C1zV1Fp9.js → choose-editor-DHZGPvHu.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Dw0y5N0L.js → cli-auth-success-DFaLHvgO.js} +1 -1
- package/dist/client/assets/{client-icons-C_WiAP0u.js → client-icons-CpqRIiQr.js} +1 -1
- package/dist/client/assets/cms-settings-editor-Dh-qBReE.js +1 -0
- package/dist/client/assets/{collapsible-BcZaehP2.js → collapsible-DZTt-UAc.js} +1 -1
- package/dist/client/assets/{collection-detail-AO17C_8B.js → collection-detail-BjUkXIkv.js} +1 -1
- package/dist/client/assets/{collection-display-button-C0cYhq66.js → collection-display-button-Dmr1DpXh.js} +1 -1
- package/dist/client/assets/{collection-search-7sBPioRN.js → collection-search-DcBOG84t.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BzgZq6u7.js → collection-table-wrapper-CBLUEZ5z.js} +1 -1
- package/dist/client/assets/{collection-tabs-DMsbicTn.js → collection-tabs-D5lfCRgo.js} +1 -1
- package/dist/client/assets/{column-rules-CBkHBJjn.js → column-rules-B3eVnEiY.js} +1 -1
- package/dist/client/assets/{combobox-CEzxugDA.js → combobox-CVTULN6N.js} +1 -1
- package/dist/client/assets/{command-KmLWWmqo.js → command-R1e1yMQ9.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-vJ3FRpYP.js → companion-mcps-section-hGQWfzwk.js} +1 -1
- package/dist/client/assets/{config-0t8v4_10.js → config-BWrcU7H3.js} +1 -1
- package/dist/client/assets/{connect-Ceo_a42v.js → connect-CNN0l2XT.js} +1 -1
- package/dist/client/assets/{connect-layout-DXn91Bwy.js → connect-layout-DiWD8YTg.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-DCA13Vr9.js → connect-source-dialog-xgaD8LgG.js} +1 -1
- package/dist/client/assets/{connection-BXCm7RUN.js → connection-WJRbuDz1.js} +1 -1
- package/dist/client/assets/{connection-card-DudSxk_f.js → connection-card-DnICQFn9.js} +1 -1
- package/dist/client/assets/{connection-detail-Bzj7ZAYC.js → connection-detail-C0OJOuef.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BCgvOrMH.js → connection-form-helpers-CBYCAzPl.js} +1 -1
- package/dist/client/assets/{connections-DZsQ6PqI.js → connections-DjwbhWNZ.js} +1 -1
- package/dist/client/assets/{content-tab-B8CAyeYn.js → content-tab-CAJ559-P.js} +3 -3
- package/dist/client/assets/{context-Dxx9Nppi.js → context-BkZJrbqd.js} +1 -1
- package/dist/client/assets/{context-menu-Bup14w-O.js → context-menu-B7wqDsW2.js} +1 -1
- package/dist/client/assets/{context-shell-YuMc6M7u.js → context-shell-DkaK_BOn.js} +3 -3
- package/dist/client/assets/{core.esm-BmE_KURk.js → core.esm-DHAYYfZu.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-oYjru5bh.js → create-organization-dialog-u0Ud2kaY.js} +1 -1
- package/dist/client/assets/{daily-pulse-Cj6zflmn.js → daily-pulse-DRJB1hcS.js} +1 -1
- package/dist/client/assets/{discover-BsfuhgQD.js → discover-gZu3Sfan.js} +1 -1
- package/dist/client/assets/{domain-settings-BCFlmNLU.js → domain-settings-USbT8NUs.js} +1 -1
- package/dist/client/assets/{drawer-Bi1-udV5.js → drawer-C9bfrQZ2.js} +1 -1
- package/dist/client/assets/{editor-DAekV0he.js → editor-4LyrkCqm.js} +1 -1
- package/dist/client/assets/{editor-classes-BaBC2QPU.js → editor-classes-_dczAbCq.js} +1 -1
- package/dist/client/assets/{empty-state-wXIjf_EN.js → empty-state-4Hlytpdt.js} +1 -1
- package/dist/client/assets/{empty-state-B4dSQMeM.js → empty-state-_a1QMwjl.js} +1 -1
- package/dist/client/assets/{experiments-tab-PntzDOfu.js → experiments-tab-DdHl8yk7.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-CQ5EsK8h.js → experiments-tab-choice-C9wWsYd4.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Bg9K46Rs.js → extract-connection-data-mbA-zNaE.js} +1 -1
- package/dist/client/assets/{feature-gate-4u7sb4lR.js → feature-gate-iJnsMeBr.js} +1 -1
- package/dist/client/assets/{feature-paywall-BsVH1P4Z.js → feature-paywall-DcguOiJA.js} +1 -1
- package/dist/client/assets/{file-explorer-CsBngoR2.js → file-explorer-B_iKC9bp.js} +1 -1
- package/dist/client/assets/{file-preview-CVVpAx14.js → file-preview-Dy07kmgf.js} +1 -1
- package/dist/client/assets/{file-share-button-Dh2OblA7.js → file-share-button-DOM1SplI.js} +1 -1
- package/dist/client/assets/{file-type-icon-DYeFNgMs.js → file-type-icon-CP6Bm0Pm.js} +1 -1
- package/dist/client/assets/{folder-icon-CMfbCZZj.js → folder-icon-D_8O1LWU.js} +1 -1
- package/dist/client/assets/{form-BGI3x6he.js → form-B2fhil9l.js} +1 -1
- package/dist/client/assets/{general-AgdwRV2K.js → general-BE0anzP1.js} +1 -1
- package/dist/client/assets/{home-B3JLIiqG.js → home-Bb5YZQHS.js} +1 -1
- package/dist/client/assets/{icon-button-Du_O8eku.js → icon-button-BQwa115u.js} +1 -1
- package/dist/client/assets/{index-BnbMIYQC.js → index-B4yeJC5N.js} +1 -1
- package/dist/client/assets/{index-BEaGR-Ng.js → index-BWgOKGMR.js} +1 -1
- package/dist/client/assets/{index-CEnumkKh.js → index-CK40JGB6.js} +1 -1
- package/dist/client/assets/{index-CqX2WR0x.js → index-CO7uP6ut.js} +1 -1
- package/dist/client/assets/{index-CdhgpKbn.js → index-CXWqnDP7.js} +1 -1
- package/dist/client/assets/{index-BWEksKOa.js → index-CYHGIatu.js} +1 -1
- package/dist/client/assets/{index-Dw3D39xs.js → index-Ccma-e_l.js} +1 -1
- package/dist/client/assets/{index-DVxNOEMj.js → index-CeLGzS5y.js} +1 -1
- package/dist/client/assets/{index-CqllmV-p.js → index-Cs4qaYPX.js} +1 -1
- package/dist/client/assets/{index-BeWb3VLq.js → index-D2MFYEzD.js} +4 -4
- package/dist/client/assets/{index-BXwVgYyP.js → index-DU8BFhZD.js} +1 -1
- package/dist/client/assets/{index-CkwxAoM4.js → index-DXMlJvYf.js} +1 -1
- package/dist/client/assets/{index-BflgjdLH.js → index-DiVZA6vr.js} +1 -1
- package/dist/client/assets/{index-BliYmmPu.js → index-R_qB4INp.js} +1 -1
- package/dist/client/assets/{index-CcDpskhn.js → index-rKWXOhdZ.js} +1 -1
- package/dist/client/assets/{index-redirect-BpERt5XK.js → index-redirect-D2LQ3n9D.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BOCgDRcQ.js → infiniteQueryObserver-CaSjeDsE.js} +1 -1
- package/dist/client/assets/{infra-billing-443Q4BKf.js → infra-billing-_cCsUnUO.js} +1 -1
- package/dist/client/assets/{input-D9vH1igB.js → input-D43D11gI.js} +1 -1
- package/dist/client/assets/{input-D1nDj3Gx.js → input-D9iDAvwy.js} +3 -3
- package/dist/client/assets/{integration-icon-VoZokpOe.js → integration-icon-CqbOWyvX.js} +1 -1
- package/dist/client/assets/{jira-icon-BOD4UX3O.js → jira-icon-Y_2uACKb.js} +1 -1
- package/dist/client/assets/{label-TKhfC6jr.js → label-3hTmrxoy.js} +1 -1
- package/dist/client/assets/{layout-OvvfNrHJ.js → layout-EYuYXIPk.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-Bj2cFPCz.js → legacy-agents-deep-Y0g29rl5.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-Y-IABTgs.js → legacy-main-redirect-Pt1vRyf-.js} +1 -1
- package/dist/client/assets/library-DJ51ehEw.js +1 -0
- package/dist/client/assets/{login-d1G00P7v.js → login-DTF43M9h.js} +1 -1
- package/dist/client/assets/{markdown-D_Bab0vD.js → markdown-BeKN4MPt.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-C5DYTOzS.js → mcp-app-renderer-DcbWj_cd.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Bv0ymH6e.js → mcp-oauth-BVLnM3ir.js} +1 -1
- package/dist/client/assets/{mcp-oauth-gJmjFND6.js → mcp-oauth-DQ__DCEs.js} +1 -1
- package/dist/client/assets/{members-CGCmgk2j.js → members-DdYed_-G.js} +1 -1
- package/dist/client/assets/{memory-DjHNNPOW.js → memory-CbDGJpdj.js} +1 -1
- package/dist/client/assets/{mini-report-page-BSYlfSmZ.js → mini-report-page-I5w2A9ue.js} +1 -1
- package/dist/client/assets/{mock-board-BCQJ9AHq.js → mock-board-D64wFJ9x.js} +3 -3
- package/dist/client/assets/{monaco-editor-CVRVgXSh.js → monaco-editor-DEU78sxw.js} +1 -1
- package/dist/client/assets/{monitoring-mogv5pNr.js → monitoring-Bklr39Mh.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BEpenrU2.js → monitoring-stats-row-BLFmMtG4.js} +1 -1
- package/dist/client/assets/{multi-select-ZwwArowo.js → multi-select-DxNv8sxt.js} +1 -1
- package/dist/client/assets/{mustache-B20fDMb8.js → mustache-Cm6mC1mo.js} +2 -2
- package/dist/client/assets/{named-rule-uses-Bxr3PCeC.js → named-rule-uses-BBN_5zyZ.js} +1 -1
- package/dist/client/assets/{named-rule-view-pF5yBmDb.js → named-rule-view-Dgj56LCZ.js} +1 -1
- package/dist/client/assets/{new-project-dialog-DfI138Mw.js → new-project-dialog-qMTAvOP0.js} +1 -1
- package/dist/client/assets/{oauth-callback-C0l4AVA-.js → oauth-callback-DzKW1jLM.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DlpJWGZf.js → oauth-callback-ai-provider-BhTg9J9_.js} +1 -1
- package/dist/client/assets/{onboarding-DMkG4-4M.js → onboarding-CcHHvf_v.js} +1 -1
- package/dist/client/assets/{openai-conversation-BcQvnIOU.js → openai-conversation-X6iReX5A.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-CBzXyVUz.js → optimistic-project-sidebar-views-Wa4vMG32.js} +1 -1
- package/dist/client/assets/{order-monitor-day-raWLiT1v.js → order-monitor-day-d8yh4cv8.js} +1 -1
- package/dist/client/assets/{organization-choice-CSBUJWem.js → organization-choice-DKOeafiU.js} +1 -1
- package/dist/client/assets/{orgs-DYr5Iir2.js → orgs-CReR2HvS.js} +1 -1
- package/dist/client/assets/{page-seo-form-C0_Mzxj0.js → page-seo-form-BTZBPUqn.js} +1 -1
- package/dist/client/assets/{pair-v8_ULhan.js → pair-DSps2zoM.js} +1 -1
- package/dist/client/assets/{parse-sections-CigeyiXV.js → parse-sections-Bc_lvOtq.js} +1 -1
- package/dist/client/assets/{plan-BYiUi2-G.js → plan-CxnMa3En.js} +1 -1
- package/dist/client/assets/{plan-ladder-CtR99jrd.js → plan-ladder-7wUcVwfI.js} +1 -1
- package/dist/client/assets/{popover-s88DXvPL.js → popover-Dm_x8CV9.js} +1 -1
- package/dist/client/assets/{post-calendar-DbUDJn5r.js → post-calendar-BtFE-61n.js} +1 -1
- package/dist/client/assets/{post-editor-CdhtoksR.js → post-editor-QChnOq6Y.js} +2 -2
- package/dist/client/assets/{preview-content-BNZ95rhM.js → preview-content-BUlAqj-X.js} +1 -1
- package/dist/client/assets/{preview-dialog-BZcvH5f1.js → preview-dialog-39V6ZO2Y.js} +1 -1
- package/dist/client/assets/preview-link-C762yHOt.js +1 -0
- package/dist/client/assets/{preview-panel-CjWzxG-O.js → preview-panel-BvoYfTNF.js} +1 -1
- package/dist/client/assets/preview-tab-jmFSMM-R.js +551 -0
- package/dist/client/assets/{product-picker-dialog-CecFCJox.js → product-picker-dialog-iaXbdjia.js} +1 -1
- package/dist/client/assets/{profile-Bo384oXV.js → profile-IgWNvITK.js} +1 -1
- package/dist/client/assets/{project-app-view-C-JC6Lnp.js → project-app-view-Bc-wof7y.js} +1 -1
- package/dist/client/assets/{project-apps-BQ30Q_BX.js → project-apps-DVzn0z1g.js} +1 -1
- package/dist/client/assets/{project-feed--d7Txdh1.js → project-feed-BIwmxSQY.js} +1 -1
- package/dist/client/assets/{project-icon-Ds8VtVRG.js → project-icon-CJmvnLdz.js} +1 -1
- package/dist/client/assets/project-reports-DnaQ9nW_.js +1 -0
- package/dist/client/assets/project-tasks-cwxXGcyN.js +1 -0
- package/dist/client/assets/{projects-BN_UNvg1.js → projects-D8Cbhxnj.js} +1 -1
- package/dist/client/assets/{projects-empty-state-CmS_yrG7.js → projects-empty-state-CmtOjsbv.js} +1 -1
- package/dist/client/assets/{prompts-g_Bby1s0.js → prompts-BFb-SeSC.js} +1 -1
- package/dist/client/assets/record-editor-hWJJMGCG.js +1 -0
- package/dist/client/assets/{redirect-editor-CBEbRvVY.js → redirect-editor-XmMaGVJV.js} +1 -1
- package/dist/client/assets/releases-api-AYZ93qlv.js +1 -0
- package/dist/client/assets/{reports-Bgmc-lqT.js → reports-AyOb4hhI.js} +1 -1
- package/dist/client/assets/reports-BQij5juA.js +1 -0
- package/dist/client/assets/{reports-onboarding-D6-A2sL7.js → reports-onboarding-BDPMVaDo.js} +1 -1
- package/dist/client/assets/{reports-tab-B_Sk2TLl.js → reports-tab-D2iADtiN.js} +2 -2
- package/dist/client/assets/{repositories-C2vwcNjc.js → repositories-BNDNB0vE.js} +1 -1
- package/dist/client/assets/repositories-BiNU-Xfn.js +1 -0
- package/dist/client/assets/{repository-binding-Cf_thK-b.js → repository-binding-4nTgXz1S.js} +1 -1
- package/dist/client/assets/{repository-import-picker-BOku3VrR.js → repository-import-picker-De4sf2Gs.js} +1 -1
- package/dist/client/assets/{repository-picker-CeCsQGv8.js → repository-picker-HOHNvmaE.js} +1 -1
- package/dist/client/assets/{require-capability-DC_q9Xad.js → require-capability-ChTCz2WH.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DhxdstQv.js → required-auth-layout-BZllo6Io.js} +1 -1
- package/dist/client/assets/{reset-password-BCS7WVZ6.js → reset-password-Ui3G6CJw.js} +1 -1
- package/dist/client/assets/{resizable-BySAwPSW.js → resizable-DAXTAODq.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-B7CsMGsC.js → resolve-tab-icon-CAixh6_W.js} +1 -1
- package/dist/client/assets/{review-settings-DtZi6zHg.js → review-settings-BDP4bMe5.js} +1 -1
- package/dist/client/assets/{roles-CGYNn4dv.js → roles-Clx4HYW_.js} +1 -1
- package/dist/client/assets/{route-ChD1cXkH.js → route-B9jYymiu.js} +1 -1
- package/dist/client/assets/route-BjK3qzB4.js +1 -0
- package/dist/client/assets/{route-ChLLCXC9.js → route-CaI6hSyT.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-Bod17qTV.js → runnable-block-editor-LQjhwiX1.js} +6 -6
- package/dist/client/assets/{sandbox-lifecycle-context-CCjKxqdS.js → sandbox-lifecycle-context-CJodiAqU.js} +1 -1
- package/dist/client/assets/{schema-b5uziS6S.js → schema-DrNvzI26.js} +1 -1
- package/dist/client/assets/{schema-ClGCzPdy.js → schema-xPkTs0YZ.js} +1 -1
- package/dist/client/assets/{scroll-area-BVZXqx5M.js → scroll-area-BBBDJLpH.js} +1 -1
- package/dist/client/assets/{search-input-BL6XGlmm.js → search-input-DSx8LWNe.js} +1 -1
- package/dist/client/assets/{search-toggle-IRNGzCzn.js → search-toggle-B9X5GBEJ.js} +1 -1
- package/dist/client/assets/{secret-ciphertext-CKG2rzpX.js → secret-ciphertext-qv17emf3.js} +1 -1
- package/dist/client/assets/{secret-picker-NNIqKwTx.js → secret-picker-DBs-gr5P.js} +1 -1
- package/dist/client/assets/{secrets-BLs8g0Qc.js → secrets-5nLK_pSH.js} +1 -1
- package/dist/client/assets/{sections-Dw8sSpTv.js → sections-ALAbnAYY.js} +1 -1
- package/dist/client/assets/{sections-editor-IbsR8YsO.js → sections-editor-DVqxZTWF.js} +2 -2
- package/dist/client/assets/{select-H4FJk0rp.js → select-C9_0SSgH.js} +1 -1
- package/dist/client/assets/{select-model-VSltfcKe.js → select-model-BaxH4IRV.js} +1 -1
- package/dist/client/assets/{seo-editor-DJxK0wxd.js → seo-editor-Cd-ANp55.js} +1 -1
- package/dist/client/assets/{separator-l8ktDBQ-.js → separator-DXuISWBW.js} +1 -1
- package/dist/client/assets/settings-tab-D_D1vl9t.js +1 -0
- package/dist/client/assets/{sheet-DdrzSnyB.js → sheet-BQCLSAhw.js} +1 -1
- package/dist/client/assets/{shell-layout-Dpds4_um.js → shell-layout-CnXya3zZ.js} +1 -1
- package/dist/client/assets/site-draft-actions-BG_Fzxj9.js +12 -0
- package/dist/client/assets/site-draft-view-BYdCjysm.js +2 -0
- package/dist/client/assets/site-editor-B7kc0tIQ.js +1 -0
- package/dist/client/assets/{site-editor-toast-C48kJZ8y.js → site-editor-toast-BKVRfpA8.js} +1 -1
- package/dist/client/assets/{skills-F7XSMMWV.js → skills-mFhfnuy4.js} +1 -1
- package/dist/client/assets/{slider-tSRa1HDF.js → slider-DTKLr6aL.js} +1 -1
- package/dist/client/assets/{sortable.esm-CE2eXOQU.js → sortable.esm-D2---7Ab.js} +1 -1
- package/dist/client/assets/{sso-B_KsCvoW.js → sso-DrhiuaNt.js} +1 -1
- package/dist/client/assets/{suggestion-Bu3BweEe.js → suggestion-B0A7rwRG.js} +1 -1
- package/dist/client/assets/{switch-BI2l0q9a.js → switch-CESJ2RZK.js} +1 -1
- package/dist/client/assets/{symbol-CW0bfPL3.js → symbol-CYXY7_SE.js} +1 -1
- package/dist/client/assets/{synced-repos-BXQtYjtL.js → synced-repos--pWS_C_z.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-B_hAV_wB.js → tab-icon-glyph-Cjt9sANI.js} +1 -1
- package/dist/client/assets/{table-BI-3H0Nx.js → table-BkZK8rXZ.js} +1 -1
- package/dist/client/assets/{tabs-Cw5epDK7.js → tabs-B6EQUSl_.js} +1 -1
- package/dist/client/assets/{task-assignee-avatar-B4jYRjC8.js → task-assignee-avatar-Dodx9W4w.js} +1 -1
- package/dist/client/assets/{task-board-ByNQwZsl.js → task-board-6nf7vbPi.js} +1 -1
- package/dist/client/assets/{task-route-B8oSJFnj.js → task-route-BvbHuTGP.js} +1 -1
- package/dist/client/assets/{task-status-GAY2L2Vz.js → task-status-GUWtXwyC.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-MtxZahkF.js → taskboard-analytics-BXSTC1m2.js} +1 -1
- package/dist/client/assets/tasks-Cd3DKWnU.js +1 -0
- package/dist/client/assets/{tasks-CaRFrr2H.js → tasks-DEvPbHif.js} +1 -1
- package/dist/client/assets/{textarea-7I-DLD6x.js → textarea-DG3FcnmS.js} +1 -1
- package/dist/client/assets/{thread-analytics-BhyMnytl.js → thread-analytics-BUqostwA.js} +1 -1
- package/dist/client/assets/{thread-intent-CoB1rbzj.js → thread-intent-Ds79TVrW.js} +1 -1
- package/dist/client/assets/{thread-route-Bjcqwe4C.js → thread-route-Cf5GTfDW.js} +1 -1
- package/dist/client/assets/{thread-route-BPSSuk8V.js → thread-route-UuA5SD5X.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-DyDxpawL.js → thread-sheet-body-p9veuPgz.js} +1 -1
- package/dist/client/assets/{time-range-picker-DJ-TaM2M.js → time-range-picker-Bo0eqMw9.js} +1 -1
- package/dist/client/assets/{toggle-group-BngkTNsG.js → toggle-group-C7NFln-0.js} +1 -1
- package/dist/client/assets/{tool-namespace-DePiqr-m.js → tool-namespace-CMW8ZB5L.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DKjsnGdZ.js → toolbar-icon-button-BiR5ntfC.js} +1 -1
- package/dist/client/assets/{tooltip-4vv5k-uR.js → tooltip-bQVm_Ope.js} +1 -1
- package/dist/client/assets/{tooltipContext-B3bWUtmi.js → tooltipContext-CMDZ9J9X.js} +1 -1
- package/dist/client/assets/{track-C0wfSYRO.js → track-COIlf0dl.js} +1 -1
- package/dist/client/assets/{types-CNU-uWw-.js → types-DLna4BAB.js} +1 -1
- package/dist/client/assets/{url-slug-DU3tFMUC.js → url-slug-BWq-dgp6.js} +1 -1
- package/dist/client/assets/{usage-stats-CKpL0uWf.js → usage-stats-CvT3PVJT.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Ct47MIru.js → use-ai-providers-CzmKfSB9.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-R20A_NaL.js → use-apply-named-rule-BLEqLp1R.js} +1 -1
- package/dist/client/assets/{use-automations-Ho0ayZT_.js → use-automations-DHA5_uZh.js} +1 -1
- package/dist/client/assets/{use-autosave-DzNsVsl3.js → use-autosave-BlShc4A-.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-CWI-mwQI.js → use-chat-layout-state-BV7ldzPe.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DE4s8Okz.js → use-clock-tick-C61VlTs_.js} +1 -1
- package/dist/client/assets/{use-connect-companion-Dmdscsai.js → use-connect-companion-DxCCqNf4.js} +1 -1
- package/dist/client/assets/{use-connection-HenJjVMr.js → use-connection-DTSe3r1K.js} +1 -1
- package/dist/client/assets/{use-content-sync-C0CqYtRD.js → use-content-sync-Dj6rb1LD.js} +1 -1
- package/dist/client/assets/{use-copy-C4LbXPXl.js → use-copy-Bc8JMSws.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-dBeQ8KM_.js → use-create-virtual-mcp-Dpe8iA_9.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-DBqQ9Xwt.js → use-date-fns-locale-BGkTB4Mm.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-B_kpX8YN.js → use-debounced-autosave-BhCHbQGN.js} +1 -1
- package/dist/client/assets/{use-debounced-value-Br6JzfN-.js → use-debounced-value-Cm7nwcam.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DhL8Ql0T.js → use-deco-credits-BgLGkCcl.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CuBncVze.js → use-decopilot-events-C_BQo06W.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DuErB0IF.js → use-delete-connection-BEv8pmzy.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BOXhbvir.js → use-deployment-admin-Ck9xx8zz.js} +1 -1
- package/dist/client/assets/use-fast-preview-draft-url-B7ECUHMP.js +1 -0
- package/dist/client/assets/{use-file-configs-B_k4AoEo.js → use-file-configs-C7kUU5_U.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-D96kN3Ph.js → use-inbox-feed-U2BOY_0m.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Ba0Xf9MO.js → use-infinite-scroll-CpvqXWve.js} +1 -1
- package/dist/client/assets/{use-join-requests-DNpCy_xv.js → use-join-requests-ldwvbhU3.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-BndsHuRH.js → use-main-panel-tabs-BvDesOKd.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-BOQ5PtOH.js → use-mcp-auth-status-D6FLEMEz.js} +1 -1
- package/dist/client/assets/{use-mcp-client-2WkK0AxE.js → use-mcp-client-Cby5XqT6.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-BY0itm-N.js → use-mcp-prompts-DpGHOlEI.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Wkfd46Rr.js → use-mcp-tools-7EpnWJvB.js} +1 -1
- package/dist/client/assets/{use-members-Cl1_-fx1.js → use-members-oF45MDF1.js} +1 -1
- package/dist/client/assets/{use-mobile-BAnIvR27.js → use-mobile-h4hHhZkm.js} +1 -1
- package/dist/client/assets/{use-move-blocks-lN8kagdi.js → use-move-blocks-DFQHiQ1n.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-C2NQ-36B.js → use-navigate-to-agent-DwJfjSMG.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-Bewtr0D-.js → use-open-billing-url-CjWCFQM1.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-vWdVrvgR.js → use-org-auth-client-BFDehTsp.js} +1 -1
- package/dist/client/assets/{use-org-fs-CxjQMzFd.js → use-org-fs-CyxFz8rw.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-dRJpc7Ti.js → use-org-repo-syncs-BsUWjWH7.js} +1 -1
- package/dist/client/assets/{use-org-sso-BnFa9r-G.js → use-org-sso-D5M4Sxwu.js} +1 -1
- package/dist/client/assets/{use-organization-roles-D9hV-WPT.js → use-organization-roles-t12r77qZ.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CE5BJyh9.js → use-organization-settings-NOur1Lvu.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-CXkMPISv.js → use-panel-navigate-DxGjTjIo.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-D4-BL2Rg.js → use-project-native-view-presence-USh7_bNt.js} +1 -1
- package/dist/client/assets/{use-project-scope-BOj2O9A_.js → use-project-scope-CBw0FSEz.js} +1 -1
- package/dist/client/assets/{use-recent-apps-Cj-iBJUa.js → use-recent-apps-B2LVD6z4.js} +1 -1
- package/dist/client/assets/{use-releases-2-Z6BMdW.js → use-releases-x9nrIfuE.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-D--oIp45.js → use-reports-diagnostic-qSw4HttT.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-BVhJrX2Z.js → use-sandbox-events-D98uWMd_.js} +1 -1
- package/dist/client/assets/{use-secrets-CQ9dfY46.js → use-secrets-CvBGDTuP.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-CrcAXE9z.js → use-section-preview-base-DmjOJ885.js} +1 -1
- package/dist/client/assets/{use-session-runtime-CqJF6neP.js → use-session-runtime-BrkTaSa6.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-NZNztmvG.js → use-sidebar-collapsed-Bijbdhqq.js} +1 -1
- package/dist/client/assets/{use-tags-BG7cxCCb.js → use-tags-BMQZw2TW.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BhvhSxL9.js → use-task-board-analytics-DdtvZ4ju.js} +1 -1
- package/dist/client/assets/{use-task-board-events-CtQgceab.js → use-task-board-events-B5yNhg5i.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-Dp099nXL.js → use-task-board-item-prs-D9gfgNig.js} +1 -1
- package/dist/client/assets/{use-task-metadata-BBoC1uvX.js → use-task-metadata-DuF2rBuH.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-g0_FCkSl.js → use-thread-analytics-B03W7aQi.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-C38yfNsJ.js → use-thread-outputs-D_k8NizM.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Dobhsojg.js +1 -0
- package/dist/client/assets/{useQueries-DSs3oNbf.js → useQueries-BSehCBUp.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CqyfVE9R.js +1 -0
- package/dist/client/assets/{users-BAyRTNUi.js → users-Cej3U7P5.js} +1 -1
- package/dist/client/assets/{utils-t1gjPfET.js → utils-CkwBhBMS.js} +1 -1
- package/dist/client/assets/{variant-calendar-BYITnHO8.js → variant-calendar-kJB8Qi3I.js} +1 -1
- package/dist/client/assets/variant-draft-pointer-BeAKcq_c.js +1 -0
- package/dist/client/assets/variant-matcher-override-XY7K79P5.js +1 -0
- package/dist/client/assets/{virtual-mcp-cTWrWR4Y.js → virtual-mcp-BzmRbmfQ.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-C9NPGTmI.js → watch-sse-pool-CmsmQLFo.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +628 -628
- package/package.json +1 -1
- package/dist/client/assets/agent-analytics-Cb2tda3-.js +0 -1
- package/dist/client/assets/agent-app-HX00w6TV.js +0 -1
- package/dist/client/assets/agent-calendar-DCHNIRTc.js +0 -1
- package/dist/client/assets/agent-deck-BV-5B8og.js +0 -1
- package/dist/client/assets/agent-experiments-DetDutY3.js +0 -1
- package/dist/client/assets/agent-file-BvfhZ3mT.js +0 -1
- package/dist/client/assets/agent-library-DSuyqe6T.js +0 -1
- package/dist/client/assets/agent-library-file-B1l2ZLvA.js +0 -1
- package/dist/client/assets/agent-releases-rSbadgkl.js +0 -2
- package/dist/client/assets/agent-settings-DCjo4ZYC.js +0 -1
- package/dist/client/assets/agent-site-editor-code-BVwfCzHc.js +0 -2
- package/dist/client/assets/agent-site-editor-content-BU-vFmu-.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-Coo-Ni4u.js +0 -1
- package/dist/client/assets/agent-view-CftHb5tC.js +0 -1
- package/dist/client/assets/api-keys-jGYtI-cW.js +0 -1
- package/dist/client/assets/category-editor-jRguVRoH.js +0 -1
- package/dist/client/assets/cms-settings-editor-BAGntXvx.js +0 -1
- package/dist/client/assets/hosted-publish-api-Cg6A3e6a.js +0 -1
- package/dist/client/assets/hosted-publish-feedback-R86hK4rw.js +0 -1
- package/dist/client/assets/library-CEpc5ko6.js +0 -1
- package/dist/client/assets/preview-tab-ztwq5J9Z.js +0 -551
- package/dist/client/assets/project-reports-BRMk8sbv.js +0 -1
- package/dist/client/assets/project-tasks-DPFfk-Co.js +0 -1
- package/dist/client/assets/record-editor-CmI7uwKH.js +0 -1
- package/dist/client/assets/releases-api-DbKlRR9w.js +0 -1
- package/dist/client/assets/reports-BKtNuFy0.js +0 -1
- package/dist/client/assets/repositories-CszhODTX.js +0 -1
- package/dist/client/assets/route-_su_B2um.js +0 -1
- package/dist/client/assets/settings-tab-D08h17sS.js +0 -1
- package/dist/client/assets/site-draft-actions-B1VIigls.js +0 -12
- package/dist/client/assets/site-draft-view-BvQXujRd.js +0 -2
- package/dist/client/assets/site-editor-B8qpeTpl.js +0 -1
- package/dist/client/assets/tasks-Zus8qgLK.js +0 -1
- package/dist/client/assets/use-fast-preview-draft-url-BPrZ2XMf.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CxzyY6DS.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CWvS_hOW.js +0 -1
- package/dist/client/assets/variant-draft-pointer-Cjn_TXkR.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as P,o as q,m as F,K as m,dX as Ye,aF as Nt,aG as Dt,r as U,a as Rt,aw as ce,a2 as xt,au as Pt,dG as At,t as X,j as V}from"./index-BeWb3VLq.js";import{u as We}from"./use-session-runtime-CqJF6neP.js";import{M as $t,j as Lt,i as le,s as xe}from"./thread-intent-CoB1rbzj.js";import{u as pe,b as Ft}from"./experiments-tab-choice-CQ5EsK8h.js";import{b as ne}from"./sandbox-url-D3mC8qhT.js";import{s as Ut}from"./utils-t1gjPfET.js";import{a as Mt}from"./repository-binding-Cf_thK-b.js";import{u as jt}from"./chat-context-BEyCIAaN.js";import{i as Bt,u as Qt}from"./use-sandbox-events-BVhJrX2Z.js";import{a as Vt}from"./sandbox-git-api-CH_-QFpD.js";import{e as Ht}from"./backoff-CrEUbyZT.js";const p={MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,NotFound:-32001,Conflict:-32002,InvalidBlock:-32003,ReadOnly:-32005,Unsupported:-32006,LimitExceeded:-32007,Unavailable:-32008,Unauthorized:-32010};class T extends Error{code;data;constructor(t,n,o){super(n),this.name="ContentProtocolError",this.code=t,this.data=o}toJSON(){return this.data===void 0?{code:this.code,message:this.message}:{code:this.code,message:this.message,data:this.data}}static from(t){return new T(t.code,t.message,t.data)}}const K="deco-content",ue={major:1},ze=1;async function Gt(e){let t=new Uint8Array(await e.arrayBuffer());if(t[0]===31&&t[1]===139){const n=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip"));t=new Uint8Array(await new Response(n).arrayBuffer())}return JSON.parse(new TextDecoder().decode(t))}const de={major:ue.major,minor:ze},Xe=`the endpoint speaks an older ${K} than this client needs (${de.major}.${de.minor} or newer): update @decocms/blocks in the site (8.2.0 or newer) and start deco serve again`;function W(e,t,n){const o={reason:t,required:{...de}};if(n){o.actual={protocol:n.protocol,major:n.version?.major,minor:n.version?.minor};const r=n.server;typeof r?.name=="string"&&typeof r.version=="string"&&(o.server={name:r.name,version:r.version})}return new T(p.Unsupported,e,o)}function Ze(e){const t=e??{},{protocol:n,version:o}=t;if(n!==K)throw W(`the endpoint speaks ${JSON.stringify(n)}, not ${K}`,"protocol",t);if(o?.major!==ue.major)throw W(`the endpoint speaks ${K} ${String(o?.major)}.x; this client speaks ${ue.major}.x`,"major",t);if(typeof o.minor!="number"||o.minor<ze)throw W(Xe,"outdated",t);return e}function Pe(e,t){return t.code===p.MethodNotFound&&e.startsWith("changes.")?W(Xe,"outdated"):T.from(t)}function ye(e){const t=e.fetch??(s=>fetch(s));let n=1;async function o(s){const i={"content-type":"application/json",accept:"application/json",...e.headers},a=await t(new Request(e.endpoint,{method:"POST",headers:i,body:JSON.stringify(s)}));let c;try{c=await Gt(a)}catch{throw new T(p.Unavailable,`the endpoint answered HTTP ${a.status} without a JSON-RPC body`)}if(!a.ok||!Array.isArray(c)&&c?.id===null){const l=c?.error;throw l?T.from(l):new T(p.Unavailable,`the endpoint answered HTTP ${a.status}`)}return c}const r=async(s,i)=>{const a=n++,c=await o({jsonrpc:"2.0",id:a,method:s,params:i??{}});if(c.error)throw Pe(s,c.error);return c.result};return{call:r,describe:async()=>Ze(await r("describe")),schemaGet:s=>r("schema.get",s),blocksList:s=>r("blocks.list",s),blocksApply:s=>r("blocks.apply",s),changesList:s=>r("changes.list",s),changesGet:s=>r("changes.get",s),changesDiscard:s=>r("changes.discard",s),async batch(s){const i=s.map(()=>n++),a=await o(s.map((l,d)=>({jsonrpc:"2.0",id:i[d],method:l.method,params:l.params??{}}))),c=new Map(a.map(l=>[l.id,l]));return i.map((l,d)=>{const u=c.get(l);return u?u.error?{ok:!1,error:Pe(s[d].method,u.error)}:{ok:!0,result:u.result}:{ok:!1,error:new T(p.InternalError,"no response for this call")}})}}}const fe=".json";[...Array.from({length:9},(e,t)=>`COM${t+1}`),...Array.from({length:9},(e,t)=>`LPT${t+1}`)];new TextEncoder;function Kt(e){return`${encodeURIComponent(e)}${fe}`}function et(e){return e.endsWith(fe)?e.slice(0,-fe.length):e}function ko(e){const t=et(e);try{return decodeURIComponent(t)}catch{return t}}function qt(e){let t=et(e),n=0;for(;t.includes("%");){let o;try{o=decodeURIComponent(t)}catch{break}if(o===t)break;t=o,n++}return{name:t,passes:n}}function Co(e){return qt(Kt(e)).name}const Ae=20,$e=5,Le=500;function Se(e){return e instanceof T?e.code===p.MethodNotFound?!0:e.code===p.Unsupported&&e.data?.reason==="outdated":!1}function he(e,t){return t.notModified?e?{...e,base:t.base}:null:{revision:t.revision,base:t.base,changes:t.changes}}async function Jt(e,t,n){const o=m.contentChanges(n),r=e.getQueryData(o),s=await t.changesList(r?{ifNoneMatch:r.revision}:{}),i=he(r,s);if(i)return i;const a=await t.changesList({});return he(void 0,a)}async function Yt(e,t){const n=[];for(let s=0;s<t.length;s+=Ae)n.push(t.slice(s,s+Ae));const o=Object.create(null),r=[];for(let s=0;s<n.length;s+=$e){const i=await e.batch(n.slice(s,s+$e).map(a=>({method:"changes.get",params:{names:a}})));for(const a of i){if(!a.ok)throw a.error;const c=a.result;Object.assign(o,c.entries),r.push(...c.diagnostics)}}return{entries:o,diagnostics:r}}async function Io(e,t){let n={revision:"",versions:{}};for(let o=0;o<t.length;o+=Le){const r=t.slice(o,o+Le),s=await e.changesDiscard({names:r.map(i=>i.name),ifMatch:Object.fromEntries(r.map(i=>[i.name,i.version]))});n={revision:s.revision,versions:{...n.versions,...s.versions}}}return n}function Oo(e){return e instanceof T&&e.code===p.Conflict}function tt(e){return e?.kind==="protocol"?e:null}function To(e,t,n){const o=P.c(14);let r;o[0]!==n?(r={},o[0]=n,o[1]=r):r=o[1];const s=r,i=q();let a;o[2]!==e?(a=tt(e),o[2]=e,o[3]=a):a=o[3];const c=a,l=!!c&&!!t&&s.enabled!==!1;let d;o[4]!==t?(d=m.contentChanges(t??""),o[4]=t,o[5]=d):d=o[5];let u;o[6]!==t||o[7]!==l||o[8]!==c||o[9]!==i?(u=l?()=>Jt(i,c.client,t):Ye,o[6]=t,o[7]=l,o[8]=c,o[9]=i,o[10]=u):u=o[10];let h;return o[11]!==d||o[12]!==u?(h={queryKey:d,queryFn:u,staleTime:0},o[11]=d,o[12]=u,o[13]=h):h=o[13],F(h)}function _o(e,t,n){const o=P.c(14);let r;o[0]!==e?(r=tt(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i;o[2]!==n?(i=n?Object.keys(n.changes):[],o[2]=n,o[3]=i):i=o[3];const a=i,c=!!s&&!!t&&!!n&&a.length>0;let l;o[4]!==t||o[5]!==n?.revision?(l=m.contentChangeSides(t??"",n?.revision??""),o[4]=t,o[5]=n?.revision,o[6]=l):l=o[6];let d;o[7]!==c||o[8]!==a||o[9]!==s?(d=c?()=>Yt(s.client,a):Ye,o[7]=c,o[8]=a,o[9]=s,o[10]=d):d=o[10];let u;return o[11]!==l||o[12]!==d?(u={queryKey:l,queryFn:d,staleTime:Number.POSITIVE_INFINITY},o[11]=l,o[12]=d,o[13]=u):u=o[13],F(u)}function nt(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")return!1;const n=t.hostname.toLowerCase();return n==="127.0.0.1"||n==="[::1]"||n==="localhost"}catch{return!1}}function Z(e){try{const t=new URL(e);return(t.hostname==="127.0.0.1"||t.hostname==="[::1]")&&(t.hostname="localhost"),t.href}catch{return e}}const ot=Nt({endpoint:Dt().max(2048).refine(e=>nt(e)&&new URL(e).pathname==="/rpc").transform(Z)});function No(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=ot.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function rt(e){const t=ot.safeParse(e);return t.success?t.data:null}const st="studio:deco-serve-last";function Do(e){try{localStorage.setItem(st,JSON.stringify(e))}catch{}}function Ro(){try{const e=localStorage.getItem(st);return e?rt(JSON.parse(e)):null}catch{return null}}function xo(e){try{return new URL(Z(e)).host}catch{return e}}function Wt(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const zt="http://localhost:4545/rpc",Po="npx @decocms/blocks serve",Ao="npx @decocms/blocks schema";class Ee extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function Xt(e){if(e instanceof Ee)return{reason:"not-deco-serve"};if(!(e instanceof T))return{reason:"not-answering"};switch(e.code){case p.Unauthorized:case p.MethodNotFound:return{reason:"outdated"};case p.Unsupported:return Se(e)?{reason:"outdated"}:{reason:"version-mismatch"};case p.Unavailable:return/^the endpoint answered HTTP/.test(e.message)?{reason:"not-deco-serve"}:{reason:"error",detail:e.message};default:return{reason:"error",detail:e.message}}}function $o(e,t){if(e)return[Z(e.endpoint)];const n=[t?.endpoint,zt].filter(o=>!!o).map(Z);return[...new Set(n)]}const it=U.createContext(null);function Zt(e){const t=P.c(27),n=U.useContext(it),o=pe(n?null:e),{data:r}=Rt.useSession(),s=r?.user?.id??"",i=!!e&&!!s;let a;t[0]!==i||t[1]!==s||t[2]!==e?(a=i?ce.decoServeConnection(s,e):null,t[0]=i,t[1]=s,t[2]=e,t[3]=a):a=t[3];const[c,l]=Ue(a);let d;t[4]!==i||t[5]!==s||t[6]!==e?(d=i?ce.decoServeEndpoint(s,e):null,t[4]=i,t[5]=s,t[6]=e,t[7]=d):d=t[7];const[u,h]=Ue(d);if(n)return n;let b;t[8]!==c||t[9]!==i?(b=i?rt(c):null,t[8]=c,t[9]=i,t[10]=b):b=t[10];const g=b,k=!!g;let C;t[11]!==o||t[12]!==k?(C=en(o,k),t[11]=o,t[12]=k,t[13]=C):C=t[13];const{applies:R,undecided:_}=C,N=R?g:null,I=i&&o==="v8"&&typeof u=="string"?u:null;let O;t[14]!==h||t[15]!==l||t[16]!==i?(O=S=>{i&&(l(S),h(S.endpoint))},t[14]=h,t[15]=l,t[16]=i,t[17]=O):O=t[17];let w;t[18]!==l||t[19]!==i?(w=()=>{i&&l(null)},t[18]=l,t[19]=i,t[20]=w):w=t[20];let y;return t[21]!==N||t[22]!==I||t[23]!==O||t[24]!==w||t[25]!==_?(y={connection:N,undecided:_,lastEndpoint:I,set:O,clear:w},t[21]=N,t[22]=I,t[23]=O,t[24]=w,t[25]=_,t[26]=y):y=t[26],y}function en(e,t){return t?e==="loading"?{applies:!1,undecided:!0}:{applies:e==="v8"||e==="error",undecided:!1}:{applies:!1,undecided:!1}}function Fe(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function Ue(e){const t=P.c(17),n=q(),o=e??"";let r;t[0]!==o?(r=["localStorage",o],t[0]=o,t[1]=r):r=t[1];const s=r;let i,a;t[2]!==e?(i=()=>e?Fe(e):null,a=()=>e?Fe(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const c=!!e;let l;t[5]!==s||t[6]!==i||t[7]!==a||t[8]!==c?(l={queryKey:s,queryFn:i,initialData:a,enabled:c,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=s,t[6]=i,t[7]=a,t[8]=c,t[9]=l):l=t[9];const{data:d}=F(l);let u;t[10]!==e||t[11]!==n||t[12]!==s?(u=k=>{if(e){try{k===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(k))}catch{}n.setQueryData(s,k)}},t[10]=e,t[11]=n,t[12]=s,t[13]=u):u=t[13];const h=u,b=e?d??null:null;let g;return t[14]!==h||t[15]!==b?(g=[b,h],t[14]=h,t[15]=b,t[16]=g):g=t[16],g}function Lo(e){return e.kind==="protocol"||e.kind==="unavailable"}function Fo(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n==="protocol"||n==="unavailable"?!0:n==="pending"?t===!0?!0:void 0:t}function Uo(e,t,n){return t!=="github"||n!=="v8"?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function Mo(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&nt(t)?t:null}function jo(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function at(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function tn(e){if(!e.hasProject)return"legacy";const t=at(e);if(t==="local")return"protocol-local";if(e.serveConnectionUndecided)return"pending";if(t==="sandbox"){const o=e.sandboxSite;return o==="v8"?"protocol-sandbox":o==="v7"?"legacy":o==="error"?e.markedV8?"retrying-sandbox":"legacy":"pending"}if(e.mainSchema==="loading")return"pending";if(e.mainSchema==="error")return"retrying-github";if(e.mainSchema==="v7")return"legacy";const n=e.githubSite;return n==="v8"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":n==="v7"?"legacy":"pending"}function nn(e){return{github:e.mode==="github"&&e.mainSchema==="v8",sandbox:e.mode==="sandbox"&&e.workingTreeReady}}function Me(e){return e.isError||e.errorUpdateCount>0}function on(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const r of n)Object.hasOwn(t,r)?o[r]=t[r]:delete o[r];return o}function rn(e){if(!e||typeof e!="object")return[];const t=e,n=[];return typeof t.blockKey=="string"&&n.push(t.blockKey),t.writes&&typeof t.writes=="object"&&n.push(...Object.keys(t.writes)),Array.isArray(t.deletes)&&n.push(...t.deletes.filter(o=>typeof o=="string")),n}function oe(e){return{[$t]:e}}class ke extends Error{status=409;constructor(){super("main's schema changed")}}async function Ce(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code===Lt}function Ie(e,t,n){e.resetQueries({predicate:o=>{const r=o.queryKey;return r[1]!==t||r[2]!==n?!1:r[0]===m.mainSchemaV8(t,n)[0]||r[0]===m.contentBackend()[0]&&r[4]==="github"}})}function ct(e,t,n){return e.getQueryData(m.mainSchemaV8(t,n))}const lt="__noSchema";function sn(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[lt]:!0}}function Bo(e){return!!e&&e[lt]===!0}function ut(e){if(!e.ok)return e.error.code===p.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function an(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const cn=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function Qo(e){const t=new Map;for(const[n,o]of Object.entries(e)){const r=o&&typeof o=="object"&&!Array.isArray(o)?o:{},s=typeof r.__resolveType=="string"?r.__resolveType:null,i=t.get(s)??[];i.push({key:n,label:an(n,r)}),t.set(s,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(cn)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:je(n.resolveType).localeCompare(je(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function je(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function Be(e,t,n){if(t.length===0)return n;const[o,...r]=t;if(Array.isArray(e)&&typeof o=="number"){const s=e.slice();return s[o]=Be(e[o],r,n),s}if(e&&typeof e=="object"&&typeof o=="string"){const s=e,i={};for(const a of Object.keys(s))i[a]=a===o?Be(s[a],r,n):s[a];return i}return e}function Vo(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class Qe extends Error{}class Ve extends Error{}const dt="site-not-owned";async function ln(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function un(e,t=r=>fetch(r),n,o){const r=ye({endpoint:e,fetch:async s=>{const i=new Request(s);for(const[c,l]of Object.entries(oe("v8")))i.headers.set(c,l);const a=await t(i);if(await ln(a))throw new Ve;if(await Ce(a))throw n?.(),new ke;return a}});try{const s=await Te(r,le(o)?{schema:o}:void 0);return s.v8Schema?s:null}catch(s){if(s instanceof Ve)return dt;throw s}}const Oe=5e3;function dn(e){return new URL(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/rpc`,window.location.origin).href}function fn(e){return new URL(ne(e,"rpc"),window.location.origin).href}async function Te(e,t){const[n,o]=await e.batch(t?[{method:"describe"}]:[{method:"describe"},{method:"schema.get"}]);if(!n?.ok)throw n?.error??new Error("no describe");if(n.result?.protocol!==K)throw new Ee;const s=Ze(n.result);if(t)return{client:e,describe:s,hasSchema:t.schema!=null,v8Schema:le(t.schema)};if(!o)throw new Error("no schema.get");if(ut(o))return{client:e,describe:s,hasSchema:!1,v8Schema:!1};if(o.ok){const i=o.result;return{client:e,describe:s,hasSchema:!0,v8Schema:le(i?.schema)}}throw o.error}async function hn(e,t=n=>fetch(n)){const n=ye({endpoint:e,fetch:async o=>{const r=await t(o);if(r.status===404)throw new Qe;return r}});try{const o=await Te(n);return o.v8Schema?o:null}catch(o){if(o instanceof Qe)return null;throw o}}function ft(e,t){const n=P.c(53),{org:o}=xt(),{connection:r,undecided:s}=Zt(e),{runtime:i}=We(e),a=U.useContext(it),c=pe(a?null:e),l=Ft(e),d=at({hasServeConnection:!!r,runtime:i}),u=jt()?.taskId??null,h=Bt(Qt().lifecycle.phase),b=q(),g=nn({mode:d,mainSchema:c,workingTreeReady:h}),k=g.github&&!!o.slug&&!!e&&!!t;let C;n[0]!==t||n[1]!==o.slug||n[2]!==b||n[3]!==e?(C=()=>un(dn({orgSlug:o.slug,virtualMcpId:e,branch:t}),void 0,()=>Ie(b,o.slug,e),ct(b,o.slug,e)?.schema),n[0]=t,n[1]=o.slug,n[2]=b,n[3]=e,n[4]=C):C=n[4];const R=F({queryKey:m.contentBackend(o.slug,e??"",t??"","github"),queryFn:C,enabled:k,staleTime:Number.POSITIVE_INFINITY,...He}),_=g.sandbox&&!!o.slug&&!!e&&!!t;let N;n[5]!==t||n[6]!==o.slug||n[7]!==u||n[8]!==e?(N=async()=>hn(fn({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:u})),n[5]=t,n[6]=o.slug,n[7]=u,n[8]=e,n[9]=N):N=n[9];const I=F({queryKey:m.contentBackend(o.slug,e??"",t??"","sandbox",u??""),queryFn:N,enabled:_,staleTime:Number.POSITIVE_INFINITY,...He}),O=!!r;let w;n[10]!==r?.endpoint||n[11]!==o.slug||n[12]!==e?(w=m.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[10]=r?.endpoint,n[11]=o.slug,n[12]=e,n[13]=w):w=n[13];let y;n[14]!==r?(y=()=>Te(ye({endpoint:r.endpoint})),n[14]=r,n[15]=y):y=n[15];let S;n[16]!==O||n[17]!==w||n[18]!==y?(S={queryKey:w,queryFn:y,enabled:O,staleTime:Number.POSITIVE_INFINITY,retry:vn,retryDelay:mn,refetchInterval:gn},n[16]=O,n[17]=w,n[18]=y,n[19]=S):S=n[19];const v=F(S);let A;n[20]!==r?.endpoint||n[21]!==o.slug||n[22]!==e?(A=m.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[20]=r?.endpoint,n[21]=o.slug,n[22]=e,n[23]=A):A=n[23];const $=A;let E;n[24]!==r?.endpoint||n[25]!==o.slug||n[26]!==e?(E=m.contentBackend(o.slug,e??"","local-describe",r?.endpoint??""),n[24]=r?.endpoint,n[25]=o.slug,n[26]=e,n[27]=E):E=n[27];let D;n[28]!==v.data||n[29]!==$||n[30]!==b?(D=async()=>{try{return await v.data.client.describe()}catch(f){const G=f;throw b.invalidateQueries({queryKey:$,exact:!0},{cancelRefetch:!1}),G}},n[28]=v.data,n[29]=$,n[30]=b,n[31]=D):D=n[31];const x=!!v.data&&!a;let M;n[32]!==E||n[33]!==D||n[34]!==x?(M={queryKey:E,queryFn:D,enabled:x,refetchInterval:Oe,retry:!1},n[32]=E,n[33]=D,n[34]=x,n[35]=M):M=n[35];const Q=F(M).data??v.data?.describe,L=tn({hasProject:!!e,hasServeConnection:!!r,serveConnectionUndecided:s,runtime:i,mainSchema:c,githubSite:R.data===dt?"not-owned":R.data?"v8":R.data===null?"v7":Me(R)?"error":"loading",sandboxSite:bn({data:I.data,isError:Me(I),workingTreeReady:h}),markedV8:l});if(L==="pending"){let f;return n[36]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"pending"},n[36]=f):f=n[36],f}if(L==="retrying-github"){let f;return n[37]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"pending",retrying:"github"},n[37]=f):f=n[37],f}if(L==="retrying-sandbox"){let f;return n[38]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"pending",retrying:"sandbox"},n[38]=f):f=n[38],f}if(L==="legacy"){let f;return n[39]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"legacy"},n[39]=f):f=n[39],f}if(L==="protocol-github"){const f=R.data;let G;return n[40]!==f?(G=ge("github",f,""),n[40]=f,n[41]=G):G=n[41],G}if(L==="site-not-owned-github"){let f;return n[42]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"unavailable",source:"github",siteNotOwned:!0},n[42]=f):f=n[42],f}if(L==="protocol-sandbox"){let f;return n[43]!==I.data?(f=ge("sandbox",I.data,":sandbox"),n[43]=I.data,n[44]=f):f=n[44],f}if(L==="unavailable-github"){let f;return n[45]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"unavailable",source:"github"},n[45]=f):f=n[45],f}const ie=v.error??v.failureReason,ae=r?.endpoint??"";let Y;return n[46]!==Q||n[47]!==v.data||n[48]!==v.failureCount||n[49]!==v.isError||n[50]!==ie||n[51]!==ae?(Y=pn({probed:v.data,isError:v.isError,failureCount:v.failureCount,failure:ie,describe:Q,endpoint:ae}),n[46]=Q,n[47]=v.data,n[48]=v.failureCount,n[49]=v.isError,n[50]=ie,n[51]=ae,n[52]=Y):Y=n[52],Y}function gn(e){return e.state.status==="error"||e.state.data?.v8Schema===!1?Oe:!1}function mn(e){return Wt(e+1)}function vn(e,t){return!(t instanceof T)&&!(t instanceof Ee)}function bn(e){return e.data!==void 0?e.data?"v8":"v7":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const wn=3;function pn(e){if(e.probed?.hasSchema&&!e.probed.v8Schema)return{kind:"unavailable",source:"local",problem:{reason:"not-v8"}};const t=e.probed?ge("local",{...e.probed,describe:e.describe??e.probed.describe},`:serve:${e.endpoint}`):null;return e.isError||e.failureCount>0?t?.kind==="protocol"&&!e.isError&&e.failureCount<wn?t:{kind:"unavailable",source:"local",problem:Xt(e.failure)}:t??{kind:"pending"}}const He={retry:2,refetchInterval:e=>e.state.status==="error"?Oe:!1};function ge(e,t,n){return{kind:"protocol",source:e,client:t.client,describe:t.describe,cacheKeySuffix:n,hasSchema:t.hasSchema}}function ht(e){const t=P.c(13);let n;t[0]!==e?(n=ce.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[r,s]=Pt(o,null),i=pe(e);let a;if(t[2]!==i||t[3]!==r||t[4]!==e){const h=e?xe(r):null;a=yn({saved:h,main:i}),t[2]=i,t[3]=r,t[4]=e,t[5]=a}else a=t[5];const c=a;let l,d;t[6]!==s?(l=h=>s(xe(h)),d=()=>s(null),t[6]=s,t[7]=l,t[8]=d):(l=t[7],d=t[8]);let u;return t[9]!==c||t[10]!==l||t[11]!==d?(u={...c,setUrl:l,clear:d},t[9]=c,t[10]=l,t[11]=d,t[12]=u):u=t[12],u}function yn(e){return e.saved?e.main==="v7"?{url:e.saved,undecided:!1}:e.main==="v8"?{url:null,undecided:!1}:{url:null,undecided:!0}:{url:null,undecided:!1}}function Sn(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function Ge(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}class _e extends Error{constructor(t,n,o=[]){super(n),this.blocks=t,this.fields=o,this.name="BlockConflictError"}blocks;fields}function Ne(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function re(e,t,n){return["decofile-write",e,t,n]}function En(e,t,n){return{id:re(e,t,n).join(":")}}function De(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function kn(e,t){const n=await e.json().catch(()=>({}));throw new Error(n.error??`${t} failed (${e.status})`)}function Cn(e,t,n){e.setQueryData(m.decofileDraft(Ne(t)),n)}function In(e,t){return e.getQueryData(m.decofileDraft(Ne(t)))??null}async function On(e,t){const n=await fetch(De(e),{cache:"no-store",headers:{...oe("v7"),"if-none-match":`"${t}"`}}).catch(()=>null);return n?.status===200||n?.status===409}function Ho(e){const t=P.c(4);let n;t[0]!==e?(n=m.decofileDraft(e?Ne(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Tn,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r??null}async function Tn(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function _n(e,t){const n=await fetch(De(t),{cache:"no-store",headers:oe("v7")});if(await Ce(n))throw Ie(e,t.orgSlug,t.virtualMcpId),new ke;if(!n.ok){const r=new Error(`Failed to fetch decofile: ${n.status}`);throw r.status=n.status,r}const o=await n.json();return o.token&&Cn(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function Go(e,t){const n=await fetch(De(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const r=await n.json().catch(()=>({}));throw r.code==="block-conflict"?new _e(r.blocks??[],r.error??"Block changed"):new Error(r.error??`Save failed (${n.status})`)}if(!n.ok)return kn(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const gt=3e3,Nn=15e3,Dn=2*6e4,mt={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function Rn(e){return e<Dn?gt:Nn}function xn(e,t=mt){const n=t.now();let o=!1,r=!1,s=null;const i=()=>{o||(s=t.setTimeout(a,Rn(t.now()-n)))},a=()=>{if(s=null,o)return;const{read:c,skip:l}=e();if(r||t.hidden()||l?.()){i();return}r=!0;let d;try{d=c()}catch{d=void 0}Promise.resolve(d).catch(()=>{}).finally(()=>{r=!1}),i()};return i(),()=>{o=!0,s!==null&&t.clearTimeout(s)}}const Ke=()=>0;function Pn(e,t,n=mt){const o=U.useRef(t);o.current=t;const[r]=U.useState(()=>({polling:()=>xn(()=>o.current,n),idle:()=>()=>{}}));U.useSyncExternalStore(e?r.polling:r.idle,Ke,Ke)}function vt(e,t){return ne(e,t)}function An(e,t){return ne(e,"preview-fetch",{path:t})}function Ko(e){return vt(e,"preview-invoke")}function qo(e){return vt(e,"catalog-invoke")}function bt(e){try{const{hostname:t}=new URL(e);return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}function $n(){if(typeof document>"u")return null;const e=Array.from(document.querySelectorAll("iframe"));for(const t of e){const n=t.getAttribute("src");if(n&&bt(n))return n}return null}function Ln(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??$n();return n&&bt(n)?new URL(t,n).toString():An(e,t)}function Fn(e){return Ln(e,"/.decofile")}function Un(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function qe(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function Mn(e,t){const n=ne(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),r=Un(o.status);if(r==="absent")return{kind:"absent"};if(r==="unavailable")return{kind:"unavailable"};if(r==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const s=await o.json();return typeof s.content!="string"?{kind:"unavailable"}:{kind:"data",data:Ut(s.content)}}async function jn(e,t){const n=await Mn(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function Jo(e){const t=`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/meta`,n=await fetch(t,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok){const o=new Error(`Failed to read committed meta: ${n.status}`);throw o.status=n.status,o}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function Bn(e){return Mt(e)?.metadata?.runtime?.path??null}class wt extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function Yo(e){return e instanceof T&&e.code===p.Conflict}function pt(e){const t=e.data?.violations;return!Array.isArray(t)||t.length===0?e.message:t.slice(0,3).map(n=>n.message).join("; ")}function Qn(e,t,n){if(t instanceof _e)return t.message;if(n==="local")return Hn(e,t);if(t instanceof T)switch(t.code){case p.Conflict:return e("siteEditor.save.conflict");case p.ReadOnly:return e("siteEditor.save.readOnly");case p.InvalidBlock:case p.InvalidParams:return e("siteEditor.save.invalid");case p.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function Vn(e,t){if(t==="local"||e instanceof _e)return null;if(e instanceof T){const n=e.code===p.InvalidBlock||e.code===p.InvalidParams?pt(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function Hn(e,t){if(t instanceof wt)return e("decoServe.save.serverGone");if(t instanceof T)switch(t.code){case p.Conflict:return e("decoServe.save.conflict");case p.ReadOnly:return e("decoServe.save.readOnly");case p.InvalidBlock:case p.InvalidParams:return e("decoServe.save.invalid",{detail:pt(t)});case p.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function Gn(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function Kn(e,t){const[n,o]=U.useState(e),r=U.useRef(null);return e&&!n&&o(!0),U.useEffect(()=>{if(e){r.current??=Date.now();return}if(!n)return;const s=()=>{r.current=null,o(!1)},i=Gn(r.current,Date.now(),t);if(i===0){s();return}const a=setTimeout(s,i);return()=>clearTimeout(a)},[e,n,t]),n}const yt={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},qn=15e3,ee=new Map;function H(e,t){return`${e}/${t}`}function j(e){let t=ee.get(e);return t||(t={state:yt,listeners:new Set,previews:0,timer:null,discardListeners:new Set},ee.set(e,t)),t}function B(e,t){const n=j(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function se(e){e.timer&&clearTimeout(e.timer),e.timer=null}function Re(e){return ee.get(e)?.state??yt}function Jn(e,t){const n=j(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function Wo(e){const t=j(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(se(t),B(e,{phase:"idle"}))}}function zo(e){const t=ee.get(e);!t||t.state.phase!=="reloading"||(se(t),B(e,{phase:"idle"}))}function St(e){const t=j(e);se(t),B(e,{phase:"saving",inFlight:t.state.inFlight+1})}function me(e,t){const n=j(e),o=Math.max(0,n.state.inFlight-1);if(o>0){B(e,{inFlight:o});return}if(!t.ok||n.previews===0){B(e,{phase:"idle",inFlight:o});return}Et(e,t.navigates,o)}function Et(e,t,n=0){const o=j(e);se(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&B(e,{phase:"idle"})},qn),B(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function Yn(e){return e?.kind==="protocol"&&e.source==="github"}async function ve(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s,backend:i,cacheKey:a}=e,c=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:m.hostedReleases(o,r)}):null;if(i?.kind!=="protocol")return await c,{navigates:!1};const l=s?m.protocolDraftRead(o,r,s):null,d=l?JSON.stringify(n.getQueryData(l)??null):null,u=c?[c]:[];if(a&&t.reread&&u.push(n.invalidateQueries({queryKey:m.decofile(a)})),a&&u.push(n.invalidateQueries({queryKey:m.contentChanges(a)})),s&&i.source==="sandbox"&&u.push(n.invalidateQueries({queryKey:Vt(o,r,s)})),Yn(i)&&l&&u.push(n.invalidateQueries({queryKey:l})),await Promise.all(u),t.kind!=="edit"){const g=H(o,r);B(g,{epoch:Re(g).epoch+1})}const h=l?JSON.stringify(n.getQueryData(l)??null):null,b=d!==h;return b&&await new Promise(g=>At.schedule(g)),{navigates:b}}async function Wn(e,t){return St(H(e.orgSlug,e.virtualMcpId)),kt(e,t)}async function kt(e,t){const n=H(e.orgSlug,e.virtualMcpId);let o;try{o=await t.write()}catch(s){throw me(n,{ok:!1,navigates:!1}),t.refreshOnError&&ve(e,{kind:t.kind,reread:!0}).catch(()=>{}),s}let r=!1;try{({navigates:r}=await ve(e,t))}catch{}finally{me(n,{ok:!0,navigates:r})}return o}function Xo(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s}=e,i=H(o,r),a=new Set(t.blockKeys);for(const d of[...j(i).discardListeners])d(a);St(i);let c=!1;const l=()=>(c=!0,kt(e,{kind:"discard",reread:!0,write:t.write}));return s?n.getMutationCache().build(n,{mutationKey:re(o,r,s),scope:En(o,r,s),mutationFn:l}).execute(void 0).catch(d=>{throw c||me(i,{ok:!1,navigates:!1}),d}):l()}function Zo(e,t,n){const o=P.c(8);let r;o[0]!==e||o[1]!==t?(r=H(e,t),o[0]=e,o[1]=t,o[2]=r):r=o[2];const s=r;let i;o[3]!==n||o[4]!==s?(i=()=>{const c=j(s).discardListeners;return c.add(n),()=>{c.delete(n)}},o[3]=n,o[4]=s,o[5]=i):i=o[5];let a;o[6]!==s?(a=[s],o[6]=s,o[7]=a):a=o[7],U.useEffect(i,a)}function zn(e){const t=H(e.orgSlug,e.virtualMcpId);Re(t).inFlight>0||ve(e,{kind:"external"}).then(({navigates:n})=>{const o=j(t);o.previews>0&&o.state.inFlight===0&&Et(t,n)}).catch(()=>{})}function Xn(e,t){const n=P.c(7);let o;n[0]!==e||n[1]!==t?(o=H(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const r=o;let s;n[3]!==r?(s=l=>Jn(r,l),n[3]=r,n[4]=s):s=n[4];const i=s;let a;n[5]!==r?(a=()=>Re(r),n[5]=r,n[6]=a):a=n[6];const c=a;return U.useSyncExternalStore(i,c,c)}const Zn=500;function er(e,t){const{phase:n}=Xn(e,t);return Kn(n!=="idle",Zn)}function eo(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function to(e,t){return m.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function tr(e,t,n){const o=e.getQueryData(m.contentVersions(t));if(!o)return;if(Object.hasOwn(o,n))return o[n];const r=e.getQueryData(m.decofile(t));return r&&Object.hasOwn(r,n)?void 0:null}function Ct(e,t,n){e.setQueryData(m.contentVersions(t),o=>{const r={...o};for(const[s,i]of Object.entries(n))i===null?delete r[s]:r[s]=i;return r})}function no(e,t){const n=e.getMutationCache().findAll({mutationKey:re(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>rn(o.state.variables)))}function be(e,t){e.resetQueries({queryKey:m.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function te(e,t,n,o){try{return await o()}catch(r){const s=!(r instanceof T);throw t.source==="local"&&s?(be(e,n),new wt(r)):(t.source==="local"&&Se(r)&&be(e,n),r)}}const z=new Map;function It(e,t,n,o){const r=z.get(o);if(r)return r;const s=Ot(e,t,n,o,!0);return z.set(o,s),s.finally(()=>z.delete(o))}async function nr(e,t,n,o){const r=z.get(o);return r&&await r.catch(()=>{}),It(e,t,n,o)}async function Ot(e,t,n,o,r){const s=m.decofile(o),i=to(n,t),a=m.contentRevision(o),c=e.getQueryData(s),l=e.getQueryData(i),d=e.getQueryData(a)??void 0,u=t.source==="github"&&!l?ct(e,n.orgSlug,n.virtualMcpId):void 0,h=u?.isV8&&u.schema&&u.version?u:void 0,b=l??h?.schema,g=h?{...d,schemaVersion:h.version}:d,k=r&&c?g?.revision:void 0,C=r&&b?g?.schemaVersion:void 0,R=m.contentChanges(o),_=e.getQueryData(R),[N,I,O]=await te(e,t,n,()=>t.client.batch([{method:"blocks.list",params:k?{ifNoneMatch:k}:{}},{method:"schema.get",params:C?{ifNoneMatch:C}:{}},{method:"changes.list",params:_?{ifNoneMatch:_.revision}:{}}]));if(O?.ok){const x=he(_,O.result);x&&e.setQueryData(R,x)}else O&&t.source==="local"&&Se(O.error)&&be(e,n);if(!N?.ok)throw N?.error??new Error("no blocks.list");if(!I)throw new Error("no schema.get");const w=N.result,y=ut(I),S=I.ok&&!y?I.result:null;if(w.notModified&&!c||S?.notModified&&!b)return Ot(e,t,n,o,!1);const v=w.notModified?new Set:no(e,n),A=w.notModified?c:on(w.blocks,c,v),$=y?sn():S?S.notModified?b:S.schema:I.error,E=e.getQueryData(a)?.revision,D=E!==void 0&&E!==g?.revision;if(e.setQueryData(a,{revision:D?E:w.notModified?g?.revision:w.revision,schemaVersion:S?S.notModified?g?.schemaVersion:S.version??void 0:void 0}),e.setQueryData(s,A),!w.notModified){const x=m.contentVersions(o),M=e.getQueryData(x),J={...w.versions};for(const Q of v){const L=M?.[Q];L!==void 0?J[Q]=L:delete J[Q]}e.setQueryData(x,J)}return $ instanceof T||e.setQueryData(i,$),!D&&!w.notModified&&c&&g?.revision&&w.revision!==g.revision&&zn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:A,meta:$}}async function or(e,t,n,o,r,s){return Wn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o},{kind:"edit",write:async()=>{const i=await te(e,t,n,()=>t.client.blocksApply({set:r.set,delete:r.delete,...s?{ifMatch:s}:{}}));e.setQueryData(m.contentRevision(o),c=>({...c,revision:i.revision}));const a=i.versions??{};return Ct(e,o,a),{revision:i.revision,versions:a}}})}async function rr(e,t,n,o,r){await e.invalidateQueries({queryKey:m.decofile(o)});let s;try{const a=(await te(e,t,n,()=>t.client.changesGet({names:[r]}))).entries[r];if(a&&a.after===null&&a.version!==null)return;s={value:a?.after??null,version:a?.version??null}}catch{const i=await te(e,t,n,()=>t.client.blocksList({}));if(i.notModified)return;s={value:i.blocks[r]??null,version:i.versions[r]??null}}e.setQueryData(m.decofile(o),i=>{const a={...i};return s.value===null?delete a[r]:a[r]=s.value,a}),Ct(e,o,{[r]:s.version})}function sr(e){const t=P.c(11),n=q();let o;t[0]!==e?.branch||t[1]!==e?.orgSlug||t[2]!==e?.virtualMcpId?(o=m.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[0]=e?.branch,t[1]=e?.orgSlug,t[2]=e?.virtualMcpId,t[3]=o):o=t[3];let r;t[4]!==e||t[5]!==n?(r=async()=>{const c=await fetch(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`,{cache:"no-store",headers:oe("v8")});if(await Ce(c))throw Ie(n,e.orgSlug,e.virtualMcpId),new ke;if(!c.ok)throw new Error(`draft pointer read failed: ${c.status}`);return await c.json()},t[4]=e,t[5]=n,t[6]=r):r=t[6];const s=!!e;let i;t[7]!==o||t[8]!==r||t[9]!==s?(i={queryKey:o,queryFn:r,enabled:s,staleTime:Number.POSITIVE_INFINITY},t[7]=o,t[8]=r,t[9]=s,t[10]=i):i=t[10];const{data:a}=F(i);return!e||!a?.draft||!a.version?null:`${a.draft}@${a.version}`}function ir(e){const t=P.c(4);let n;t[0]!==e?(n=m.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:oo,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r?.revision}async function oo(){throw new Error("content revisions are set by reads and writes")}function Je(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function ro(e,t){const n=P.c(6),{url:o}=ht(e?.virtualMcpId),r=ft(e?.virtualMcpId,e?.branch);if(!e)return"";let s;return n[0]!==r.cacheKeySuffix||n[1]!==r.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(s=r.kind==="protocol"?Je({...e,protocolSuffix:r.cacheKeySuffix}):Je({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=r.cacheKeySuffix,n[1]=r.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=s):s=n[5],s}function ar(e,t){const n=P.c(39),{url:o,undecided:r}=ht(e?.virtualMcpId),s=!!o,i=ft(e?.virtualMcpId,e?.branch),a=i.kind==="protocol"?i:null,c=ro(e),l=t?.fetchEnabled??!0,d=Bn(e?.virtualMcpId),u=We(e?.virtualMcpId).runtime==="cms",h=q();let b;n[0]!==c?(b=m.decofile(c),n[0]=c,n[1]=b):b=n[1];const g=b;let k;n[2]!==e||n[3]!==h||n[4]!==g?(k=()=>{if(!e||h.isMutating({mutationKey:re(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const v=h.getQueryState(g);return v?.fetchStatus==="fetching"||Date.now()-(v?.dataUpdatedAt??0)<gt/2},n[2]=e,n[3]=h,n[4]=g,n[5]=k):k=n[5];let C;n[6]!==u||n[7]!==s||n[8]!==e||n[9]!==a||n[10]!==h||n[11]!==g?(C=async()=>{if(e){if(!a&&u&&!s){const v=In(h,e)?.version;if(v&&!await On(e,v))return}await h.refetchQueries({queryKey:g,exact:!0},{cancelRefetch:!1})}},n[6]=u,n[7]=s,n[8]=e,n[9]=a,n[10]=h,n[11]=g,n[12]=C):C=n[12];let R;n[13]!==k||n[14]!==C?(R={skip:k,read:C},n[13]=k,n[14]=C,n[15]=R):R=n[15],Pn(!!t?.pollWhile&&!!e,R);let _;n[16]!==i.kind||n[17]!==u||n[18]!==l||n[19]!==c||n[20]!==s||n[21]!==o||n[22]!==d||n[23]!==e||n[24]!==a||n[25]!==h?(_=async()=>{if(a)return(await It(h,a,e,c)).blocks;if(i.kind==="unavailable")throw eo("decofile");if(s){const E=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(ao),D=E?.ok?Ge(await E.text()):null;if(D)return D;const x=new Error("decofile unavailable (local tunnel unreachable)");throw x.status=502,x}if(u)return _n(h,e);const v=()=>jn(e,Sn(d,".deco/blocks.gen.json"));if(l){const E=await fetch(Fn(e),{cache:"no-store"}).catch(io);if(E?.ok){const M=Ge(await E.text());if(M)return M}const D=await v();if(D.kind==="data")return D.data;const x=new Error(`Failed to fetch decofile: ${E?.status??"network error"}`);throw x.status=qe({liveOk:!!E?.ok,liveStatus:E?.status,committedAbsent:D.kind==="absent"}),x}const A=await v();if(A.kind==="data")return A.data;const $=new Error("decofile unavailable (preview down, no committed snapshot)");throw $.status=qe({liveOk:!1,committedAbsent:A.kind==="absent"}),$},n[16]=i.kind,n[17]=u,n[18]=l,n[19]=c,n[20]=s,n[21]=o,n[22]=d,n[23]=e,n[24]=a,n[25]=h,n[26]=_):_=n[26];const N=!!e&&i.kind!=="pending"&&!r,I=a?0:3e4,O=a?.describe.pollIntervalMs,w=a?"always":void 0;let y;n[27]!==u||n[28]!==s||n[29]!==a?(y=(v,A)=>{if(a||u||s)return v<3;const $=A.status;return $!==502&&$!==404&&v<2},n[27]=u,n[28]=s,n[29]=a,n[30]=y):y=n[30];let S;return n[31]!==g||n[32]!==_||n[33]!==N||n[34]!==I||n[35]!==O||n[36]!==w||n[37]!==y?(S={queryKey:g,queryFn:_,enabled:N,staleTime:I,refetchInterval:O,refetchIntervalInBackground:!1,refetchOnWindowFocus:w,retry:y,retryDelay:so},n[31]=g,n[32]=_,n[33]=N,n[34]=I,n[35]=O,n[36]=w,n[37]=y,n[38]=S):S=n[38],F(S)}function so(e){return Ht(5e3,1e3,e,2,0)}function io(){return null}function ao(){return null}const co="site-editor-save",lo={id:co,description:void 0,action:void 0,cancel:void 0},cr="site-editor-undo",we="site-editor-publish";function uo(e){const t=P.c(7),{label:n,detail:o}=e;let r;t[0]!==n?(r=V.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=r):r=t[1];let s;t[2]!==o?(s=V.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=s):s=t[3];let i;return t[4]!==r||t[5]!==s?(i=V.jsxs("details",{className:"mt-1 text-xs",children:[r,s]}),t[4]=r,t[5]=s,t[6]=i):i=t[6],i}function Tt(e,t){return t?V.jsx(uo,{label:e("siteEditor.details"),detail:t}):void 0}function lr(e,t,n){X.error(Qn(e,t,n),{...lo,description:Tt(e,Vn(t,n))})}const _t={action:void 0,duration:void 0};function ur(e,t){X.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{..._t,id:we,description:void 0})}function dr(e,{headline:t,body:n,detail:o,retry:r,pending:s,tone:i="error"}){const a=Tt(e,o??null);X[i](t,{id:we,description:n&&a?V.jsxs(V.Fragment,{children:[V.jsx("p",{children:n}),a]}):n??a,action:r?{label:e("siteEditor.tryAgain"),onClick:c=>{c.preventDefault(),X.loading(s??e("thread.publishPopover.publishing"),{..._t,id:we,description:void 0}),r()}}:void 0,duration:r?Number.POSITIVE_INFINITY:void 0})}function fr(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{zt as $,Xn as A,zo as B,ro as C,ir as D,En as E,re as F,Wn as G,Mn as H,kn as I,_e as J,Yo as K,or as L,rr as M,lr as N,Cn as O,Go as P,Zo as Q,Fo as R,Po as S,it as T,Qo as U,je as V,Be as W,Vo as X,Ao as Y,Ln as Z,jo as _,$o as a,Tt as a0,fr as a1,Co as a2,ko as a3,Kt as a4,Ie as a5,ur as a6,Xo as a7,Io as a8,Oo as a9,Se as aa,_o as ab,to as ac,Jt as ad,uo as ae,To as af,It as ag,eo as ah,Jo as ai,jn as aj,Ho as ak,sr as al,oe as am,dr as an,we as ao,_t as ap,cr as aq,lo as ar,nr as as,tr as at,qo as au,Zt as b,ht as c,Wt as d,xo as e,Xt as f,Te as g,ye as h,nt as i,Ko as j,An as k,ar as l,Lo as m,Bo as n,Bn as o,No as p,Sn as q,Ro as r,Do as s,at as t,ft as u,Mo as v,er as w,Uo as x,H as y,Wo as z};
|
|
1
|
+
import{c as P,o as q,m as F,K as v,dX as Ye,aF as Nt,aG as Dt,r as U,a as Rt,aw as ce,a2 as xt,au as Pt,dG as At,t as X,j as V}from"./index-D2MFYEzD.js";import{u as We}from"./use-session-runtime-BrkTaSa6.js";import{M as $t,j as Lt,i as le,s as xe}from"./thread-intent-Ds79TVrW.js";import{u as we,b as Ft}from"./experiments-tab-choice-C9wWsYd4.js";import{b as ne}from"./sandbox-url-D3mC8qhT.js";import{s as Ut}from"./utils-CkwBhBMS.js";import{a as Mt}from"./repository-binding-4nTgXz1S.js";import{u as jt}from"./chat-context-DLezfYEa.js";import{i as Bt,u as Qt}from"./use-sandbox-events-D98uWMd_.js";import{a as Vt}from"./sandbox-git-api-CH_-QFpD.js";import{e as Ht}from"./backoff-CrEUbyZT.js";const w={MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,NotFound:-32001,Conflict:-32002,InvalidBlock:-32003,ReadOnly:-32005,Unsupported:-32006,LimitExceeded:-32007,Unavailable:-32008,Unauthorized:-32010};class T extends Error{code;data;constructor(t,n,o){super(n),this.name="ContentProtocolError",this.code=t,this.data=o}toJSON(){return this.data===void 0?{code:this.code,message:this.message}:{code:this.code,message:this.message,data:this.data}}static from(t){return new T(t.code,t.message,t.data)}}const K="deco-content",ue={major:1},ze=1;async function Gt(e){let t=new Uint8Array(await e.arrayBuffer());if(t[0]===31&&t[1]===139){const n=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip"));t=new Uint8Array(await new Response(n).arrayBuffer())}return JSON.parse(new TextDecoder().decode(t))}const de={major:ue.major,minor:ze},Xe=`the endpoint speaks an older ${K} than this client needs (${de.major}.${de.minor} or newer): update @decocms/blocks in the site (8.2.0 or newer) and start deco serve again`;function W(e,t,n){const o={reason:t,required:{...de}};if(n){o.actual={protocol:n.protocol,major:n.version?.major,minor:n.version?.minor};const r=n.server;typeof r?.name=="string"&&typeof r.version=="string"&&(o.server={name:r.name,version:r.version})}return new T(w.Unsupported,e,o)}function Ze(e){const t=e??{},{protocol:n,version:o}=t;if(n!==K)throw W(`the endpoint speaks ${JSON.stringify(n)}, not ${K}`,"protocol",t);if(o?.major!==ue.major)throw W(`the endpoint speaks ${K} ${String(o?.major)}.x; this client speaks ${ue.major}.x`,"major",t);if(typeof o.minor!="number"||o.minor<ze)throw W(Xe,"outdated",t);return e}function Pe(e,t){return t.code===w.MethodNotFound&&e.startsWith("changes.")?W(Xe,"outdated"):T.from(t)}function ye(e){const t=e.fetch??(s=>fetch(s));let n=1;async function o(s){const i={"content-type":"application/json",accept:"application/json",...e.headers},a=await t(new Request(e.endpoint,{method:"POST",headers:i,body:JSON.stringify(s)}));let c;try{c=await Gt(a)}catch{throw new T(w.Unavailable,`the endpoint answered HTTP ${a.status} without a JSON-RPC body`)}if(!a.ok||!Array.isArray(c)&&c?.id===null){const l=c?.error;throw l?T.from(l):new T(w.Unavailable,`the endpoint answered HTTP ${a.status}`)}return c}const r=async(s,i)=>{const a=n++,c=await o({jsonrpc:"2.0",id:a,method:s,params:i??{}});if(c.error)throw Pe(s,c.error);return c.result};return{call:r,describe:async()=>Ze(await r("describe")),schemaGet:s=>r("schema.get",s),blocksList:s=>r("blocks.list",s),blocksApply:s=>r("blocks.apply",s),changesList:s=>r("changes.list",s),changesGet:s=>r("changes.get",s),changesDiscard:s=>r("changes.discard",s),async batch(s){const i=s.map(()=>n++),a=await o(s.map((l,d)=>({jsonrpc:"2.0",id:i[d],method:l.method,params:l.params??{}}))),c=new Map(a.map(l=>[l.id,l]));return i.map((l,d)=>{const u=c.get(l);return u?u.error?{ok:!1,error:Pe(s[d].method,u.error)}:{ok:!0,result:u.result}:{ok:!1,error:new T(w.InternalError,"no response for this call")}})}}}const fe=".json";[...Array.from({length:9},(e,t)=>`COM${t+1}`),...Array.from({length:9},(e,t)=>`LPT${t+1}`)];new TextEncoder;function Kt(e){return`${encodeURIComponent(e)}${fe}`}function et(e){return e.endsWith(fe)?e.slice(0,-fe.length):e}function Co(e){const t=et(e);try{return decodeURIComponent(t)}catch{return t}}function qt(e){let t=et(e),n=0;for(;t.includes("%");){let o;try{o=decodeURIComponent(t)}catch{break}if(o===t)break;t=o,n++}return{name:t,passes:n}}function Io(e){return qt(Kt(e)).name}const Ae=20,$e=5,Le=500;function Se(e){return e instanceof T?e.code===w.MethodNotFound?!0:e.code===w.Unsupported&&e.data?.reason==="outdated":!1}function he(e,t){return t.notModified?e?{...e,base:t.base}:null:{revision:t.revision,base:t.base,changes:t.changes}}async function Jt(e,t,n){const o=v.contentChanges(n),r=e.getQueryData(o),s=await t.changesList(r?{ifNoneMatch:r.revision}:{}),i=he(r,s);if(i)return i;const a=await t.changesList({});return he(void 0,a)}async function Yt(e,t){const n=[];for(let s=0;s<t.length;s+=Ae)n.push(t.slice(s,s+Ae));const o=Object.create(null),r=[];for(let s=0;s<n.length;s+=$e){const i=await e.batch(n.slice(s,s+$e).map(a=>({method:"changes.get",params:{names:a}})));for(const a of i){if(!a.ok)throw a.error;const c=a.result;Object.assign(o,c.entries),r.push(...c.diagnostics)}}return{entries:o,diagnostics:r}}async function Oo(e,t){let n={revision:"",versions:{}};for(let o=0;o<t.length;o+=Le){const r=t.slice(o,o+Le),s=await e.changesDiscard({names:r.map(i=>i.name),ifMatch:Object.fromEntries(r.map(i=>[i.name,i.version]))});n={revision:s.revision,versions:{...n.versions,...s.versions}}}return n}function To(e){return e instanceof T&&e.code===w.Conflict}function tt(e){return e?.kind==="protocol"?e:null}function _o(e,t,n){const o=P.c(14);let r;o[0]!==n?(r={},o[0]=n,o[1]=r):r=o[1];const s=r,i=q();let a;o[2]!==e?(a=tt(e),o[2]=e,o[3]=a):a=o[3];const c=a,l=!!c&&!!t&&s.enabled!==!1;let d;o[4]!==t?(d=v.contentChanges(t??""),o[4]=t,o[5]=d):d=o[5];let u;o[6]!==t||o[7]!==l||o[8]!==c||o[9]!==i?(u=l?()=>Jt(i,c.client,t):Ye,o[6]=t,o[7]=l,o[8]=c,o[9]=i,o[10]=u):u=o[10];let f;return o[11]!==d||o[12]!==u?(f={queryKey:d,queryFn:u,staleTime:0},o[11]=d,o[12]=u,o[13]=f):f=o[13],F(f)}function No(e,t,n){const o=P.c(14);let r;o[0]!==e?(r=tt(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i;o[2]!==n?(i=n?Object.keys(n.changes):[],o[2]=n,o[3]=i):i=o[3];const a=i,c=!!s&&!!t&&!!n&&a.length>0;let l;o[4]!==t||o[5]!==n?.revision?(l=v.contentChangeSides(t??"",n?.revision??""),o[4]=t,o[5]=n?.revision,o[6]=l):l=o[6];let d;o[7]!==c||o[8]!==a||o[9]!==s?(d=c?()=>Yt(s.client,a):Ye,o[7]=c,o[8]=a,o[9]=s,o[10]=d):d=o[10];let u;return o[11]!==l||o[12]!==d?(u={queryKey:l,queryFn:d,staleTime:Number.POSITIVE_INFINITY},o[11]=l,o[12]=d,o[13]=u):u=o[13],F(u)}function nt(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")return!1;const n=t.hostname.toLowerCase();return n==="127.0.0.1"||n==="[::1]"||n==="localhost"}catch{return!1}}function Z(e){try{const t=new URL(e);return(t.hostname==="127.0.0.1"||t.hostname==="[::1]")&&(t.hostname="localhost"),t.href}catch{return e}}const ot=Nt({endpoint:Dt().max(2048).refine(e=>nt(e)&&new URL(e).pathname==="/rpc").transform(Z)});function Do(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=ot.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function rt(e){const t=ot.safeParse(e);return t.success?t.data:null}const st="studio:deco-serve-last";function Ro(e){try{localStorage.setItem(st,JSON.stringify(e))}catch{}}function xo(){try{const e=localStorage.getItem(st);return e?rt(JSON.parse(e)):null}catch{return null}}function Po(e){try{return new URL(Z(e)).host}catch{return e}}function Wt(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const zt="http://localhost:4545/rpc",Ao="npx @decocms/blocks serve",$o="npx @decocms/blocks schema";class Ee extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function Xt(e){if(e instanceof Ee)return{reason:"not-deco-serve"};if(!(e instanceof T))return{reason:"not-answering"};switch(e.code){case w.Unauthorized:case w.MethodNotFound:return{reason:"outdated"};case w.Unsupported:return Se(e)?{reason:"outdated"}:{reason:"version-mismatch"};case w.Unavailable:return/^the endpoint answered HTTP/.test(e.message)?{reason:"not-deco-serve"}:{reason:"error",detail:e.message};default:return{reason:"error",detail:e.message}}}function Lo(e,t){if(e)return[Z(e.endpoint)];const n=[t?.endpoint,zt].filter(o=>!!o).map(Z);return[...new Set(n)]}const it=U.createContext(null);function Zt(e){const t=P.c(27),n=U.useContext(it),o=we(n?null:e),{data:r}=Rt.useSession(),s=r?.user?.id??"",i=!!e&&!!s;let a;t[0]!==i||t[1]!==s||t[2]!==e?(a=i?ce.decoServeConnection(s,e):null,t[0]=i,t[1]=s,t[2]=e,t[3]=a):a=t[3];const[c,l]=Ue(a);let d;t[4]!==i||t[5]!==s||t[6]!==e?(d=i?ce.decoServeEndpoint(s,e):null,t[4]=i,t[5]=s,t[6]=e,t[7]=d):d=t[7];const[u,f]=Ue(d);if(n)return n;let g;t[8]!==c||t[9]!==i?(g=i?rt(c):null,t[8]=c,t[9]=i,t[10]=g):g=t[10];const m=g,k=!!m;let C;t[11]!==o||t[12]!==k?(C=en(o,k),t[11]=o,t[12]=k,t[13]=C):C=t[13];const{applies:R,undecided:_}=C,N=R?m:null,I=i&&o==="v8"&&typeof u=="string"?u:null;let O;t[14]!==f||t[15]!==l||t[16]!==i?(O=S=>{i&&(l(S),f(S.endpoint))},t[14]=f,t[15]=l,t[16]=i,t[17]=O):O=t[17];let p;t[18]!==l||t[19]!==i?(p=()=>{i&&l(null)},t[18]=l,t[19]=i,t[20]=p):p=t[20];let y;return t[21]!==N||t[22]!==I||t[23]!==O||t[24]!==p||t[25]!==_?(y={connection:N,undecided:_,lastEndpoint:I,set:O,clear:p},t[21]=N,t[22]=I,t[23]=O,t[24]=p,t[25]=_,t[26]=y):y=t[26],y}function en(e,t){return t?e==="loading"?{applies:!1,undecided:!0}:{applies:e==="v8"||e==="error",undecided:!1}:{applies:!1,undecided:!1}}function Fe(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function Ue(e){const t=P.c(17),n=q(),o=e??"";let r;t[0]!==o?(r=["localStorage",o],t[0]=o,t[1]=r):r=t[1];const s=r;let i,a;t[2]!==e?(i=()=>e?Fe(e):null,a=()=>e?Fe(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const c=!!e;let l;t[5]!==s||t[6]!==i||t[7]!==a||t[8]!==c?(l={queryKey:s,queryFn:i,initialData:a,enabled:c,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=s,t[6]=i,t[7]=a,t[8]=c,t[9]=l):l=t[9];const{data:d}=F(l);let u;t[10]!==e||t[11]!==n||t[12]!==s?(u=k=>{if(e){try{k===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(k))}catch{}n.setQueryData(s,k)}},t[10]=e,t[11]=n,t[12]=s,t[13]=u):u=t[13];const f=u,g=e?d??null:null;let m;return t[14]!==f||t[15]!==g?(m=[g,f],t[14]=f,t[15]=g,t[16]=m):m=t[16],m}function Fo(e){return e.kind==="protocol"||e.kind==="unavailable"}function Uo(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n==="protocol"||n==="unavailable"?!0:n==="pending"?t===!0?!0:void 0:t}function Mo(e,t,n){return t!=="github"||n!=="v8"?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function jo(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&nt(t)?t:null}function Bo(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function at(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function tn(e){if(!e.hasProject)return"legacy";const t=at(e);if(t==="local")return"protocol-local";if(e.serveConnectionUndecided)return"pending";if(t==="sandbox"){const o=e.sandboxSite;return o==="v8"?"protocol-sandbox":o==="v7"?"legacy":o==="error"?e.markedV8?"retrying-sandbox":"legacy":"pending"}if(e.mainSchema==="loading")return"pending";if(e.mainSchema==="error")return"retrying-github";if(e.mainSchema==="v7")return"legacy";const n=e.githubSite;return n==="v8"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":n==="v7"?"legacy":"pending"}function nn(e){return{github:e.mode==="github"&&e.mainSchema==="v8",sandbox:e.mode==="sandbox"&&e.workingTreeReady}}function Me(e){return e.isError||e.errorUpdateCount>0}function on(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const r of n)Object.hasOwn(t,r)?o[r]=t[r]:delete o[r];return o}function rn(e){if(!e||typeof e!="object")return[];const t=e,n=[];return typeof t.blockKey=="string"&&n.push(t.blockKey),t.writes&&typeof t.writes=="object"&&n.push(...Object.keys(t.writes)),Array.isArray(t.deletes)&&n.push(...t.deletes.filter(o=>typeof o=="string")),n}function oe(e){return{[$t]:e}}class ke extends Error{status=409;constructor(){super("main's schema changed")}}async function Ce(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code===Lt}function Ie(e,t,n){e.resetQueries({predicate:o=>{const r=o.queryKey;return r[1]!==t||r[2]!==n?!1:r[0]===v.mainSchemaV8(t,n)[0]||r[0]===v.contentBackend()[0]&&r[4]==="github"}})}function ct(e,t,n){return e.getQueryData(v.mainSchemaV8(t,n))}const lt="__noSchema";function sn(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[lt]:!0}}function Qo(e){return!!e&&e[lt]===!0}function ut(e){if(!e.ok)return e.error.code===w.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function an(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const cn=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function Vo(e){const t=new Map;for(const[n,o]of Object.entries(e)){const r=o&&typeof o=="object"&&!Array.isArray(o)?o:{},s=typeof r.__resolveType=="string"?r.__resolveType:null,i=t.get(s)??[];i.push({key:n,label:an(n,r)}),t.set(s,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(cn)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:je(n.resolveType).localeCompare(je(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function je(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function Be(e,t,n){if(t.length===0)return n;const[o,...r]=t;if(Array.isArray(e)&&typeof o=="number"){const s=e.slice();return s[o]=Be(e[o],r,n),s}if(e&&typeof e=="object"&&typeof o=="string"){const s=e,i={};for(const a of Object.keys(s))i[a]=a===o?Be(s[a],r,n):s[a];return i}return e}function Ho(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class Qe extends Error{}class Ve extends Error{}const dt="site-not-owned";async function ln(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function un(e,t=r=>fetch(r),n,o){const r=ye({endpoint:e,fetch:async s=>{const i=new Request(s);for(const[c,l]of Object.entries(oe("v8")))i.headers.set(c,l);const a=await t(i);if(await ln(a))throw new Ve;if(await Ce(a))throw n?.(),new ke;return a}});try{const s=await Te(r,le(o)?{schema:o}:void 0);return s.v8Schema?s:null}catch(s){if(s instanceof Ve)return dt;throw s}}const Oe=5e3;function dn(e){return new URL(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/rpc`,window.location.origin).href}function fn(e){return new URL(ne(e,"rpc"),window.location.origin).href}async function Te(e,t){const[n,o]=await e.batch(t?[{method:"describe"}]:[{method:"describe"},{method:"schema.get"}]);if(!n?.ok)throw n?.error??new Error("no describe");if(n.result?.protocol!==K)throw new Ee;const s=Ze(n.result);if(t)return{client:e,describe:s,hasSchema:t.schema!=null,v8Schema:le(t.schema)};if(!o)throw new Error("no schema.get");if(ut(o))return{client:e,describe:s,hasSchema:!1,v8Schema:!1};if(o.ok){const i=o.result;return{client:e,describe:s,hasSchema:!0,v8Schema:le(i?.schema)}}throw o.error}async function hn(e,t=n=>fetch(n)){const n=ye({endpoint:e,fetch:async o=>{const r=await t(o);if(r.status===404)throw new Qe;return r}});try{const o=await Te(n);return o.v8Schema?o:null}catch(o){if(o instanceof Qe)return null;throw o}}function ft(e,t){const n=P.c(53),{org:o}=xt(),{connection:r,undecided:s}=Zt(e),{runtime:i}=We(e),a=U.useContext(it),c=we(a?null:e),l=Ft(e),d=at({hasServeConnection:!!r,runtime:i}),u=jt()?.taskId??null,f=Bt(Qt().lifecycle.phase),g=q(),m=nn({mode:d,mainSchema:c,workingTreeReady:f}),k=m.github&&!!o.slug&&!!e&&!!t;let C;n[0]!==t||n[1]!==o.slug||n[2]!==g||n[3]!==e?(C=()=>un(dn({orgSlug:o.slug,virtualMcpId:e,branch:t}),void 0,()=>Ie(g,o.slug,e),ct(g,o.slug,e)?.schema),n[0]=t,n[1]=o.slug,n[2]=g,n[3]=e,n[4]=C):C=n[4];const R=F({queryKey:v.contentBackend(o.slug,e??"",t??"","github"),queryFn:C,enabled:k,staleTime:Number.POSITIVE_INFINITY,...He}),_=m.sandbox&&!!o.slug&&!!e&&!!t;let N;n[5]!==t||n[6]!==o.slug||n[7]!==u||n[8]!==e?(N=async()=>hn(fn({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:u})),n[5]=t,n[6]=o.slug,n[7]=u,n[8]=e,n[9]=N):N=n[9];const I=F({queryKey:v.contentBackend(o.slug,e??"",t??"","sandbox",u??""),queryFn:N,enabled:_,staleTime:Number.POSITIVE_INFINITY,...He}),O=!!r;let p;n[10]!==r?.endpoint||n[11]!==o.slug||n[12]!==e?(p=v.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[10]=r?.endpoint,n[11]=o.slug,n[12]=e,n[13]=p):p=n[13];let y;n[14]!==r?(y=()=>Te(ye({endpoint:r.endpoint})),n[14]=r,n[15]=y):y=n[15];let S;n[16]!==O||n[17]!==p||n[18]!==y?(S={queryKey:p,queryFn:y,enabled:O,staleTime:Number.POSITIVE_INFINITY,retry:vn,retryDelay:mn,refetchInterval:gn},n[16]=O,n[17]=p,n[18]=y,n[19]=S):S=n[19];const b=F(S);let A;n[20]!==r?.endpoint||n[21]!==o.slug||n[22]!==e?(A=v.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[20]=r?.endpoint,n[21]=o.slug,n[22]=e,n[23]=A):A=n[23];const $=A;let E;n[24]!==r?.endpoint||n[25]!==o.slug||n[26]!==e?(E=v.contentBackend(o.slug,e??"","local-describe",r?.endpoint??""),n[24]=r?.endpoint,n[25]=o.slug,n[26]=e,n[27]=E):E=n[27];let D;n[28]!==b.data||n[29]!==$||n[30]!==g?(D=async()=>{try{return await b.data.client.describe()}catch(h){const G=h;throw g.invalidateQueries({queryKey:$,exact:!0},{cancelRefetch:!1}),G}},n[28]=b.data,n[29]=$,n[30]=g,n[31]=D):D=n[31];const x=!!b.data&&!a;let M;n[32]!==E||n[33]!==D||n[34]!==x?(M={queryKey:E,queryFn:D,enabled:x,refetchInterval:Oe,retry:!1},n[32]=E,n[33]=D,n[34]=x,n[35]=M):M=n[35];const Q=F(M).data??b.data?.describe,L=tn({hasProject:!!e,hasServeConnection:!!r,serveConnectionUndecided:s,runtime:i,mainSchema:c,githubSite:R.data===dt?"not-owned":R.data?"v8":R.data===null?"v7":Me(R)?"error":"loading",sandboxSite:bn({data:I.data,isError:Me(I),workingTreeReady:f}),markedV8:l});if(L==="pending"){let h;return n[36]===Symbol.for("react.memo_cache_sentinel")?(h={kind:"pending"},n[36]=h):h=n[36],h}if(L==="retrying-github"){let h;return n[37]===Symbol.for("react.memo_cache_sentinel")?(h={kind:"pending",retrying:"github"},n[37]=h):h=n[37],h}if(L==="retrying-sandbox"){let h;return n[38]===Symbol.for("react.memo_cache_sentinel")?(h={kind:"pending",retrying:"sandbox"},n[38]=h):h=n[38],h}if(L==="legacy"){let h;return n[39]===Symbol.for("react.memo_cache_sentinel")?(h={kind:"legacy"},n[39]=h):h=n[39],h}if(L==="protocol-github"){const h=R.data;let G;return n[40]!==h?(G=ge("github",h,""),n[40]=h,n[41]=G):G=n[41],G}if(L==="site-not-owned-github"){let h;return n[42]===Symbol.for("react.memo_cache_sentinel")?(h={kind:"unavailable",source:"github",siteNotOwned:!0},n[42]=h):h=n[42],h}if(L==="protocol-sandbox"){let h;return n[43]!==I.data?(h=ge("sandbox",I.data,":sandbox"),n[43]=I.data,n[44]=h):h=n[44],h}if(L==="unavailable-github"){let h;return n[45]===Symbol.for("react.memo_cache_sentinel")?(h={kind:"unavailable",source:"github"},n[45]=h):h=n[45],h}const ie=b.error??b.failureReason,ae=r?.endpoint??"";let Y;return n[46]!==Q||n[47]!==b.data||n[48]!==b.failureCount||n[49]!==b.isError||n[50]!==ie||n[51]!==ae?(Y=wn({probed:b.data,isError:b.isError,failureCount:b.failureCount,failure:ie,describe:Q,endpoint:ae}),n[46]=Q,n[47]=b.data,n[48]=b.failureCount,n[49]=b.isError,n[50]=ie,n[51]=ae,n[52]=Y):Y=n[52],Y}function gn(e){return e.state.status==="error"||e.state.data?.v8Schema===!1?Oe:!1}function mn(e){return Wt(e+1)}function vn(e,t){return!(t instanceof T)&&!(t instanceof Ee)}function bn(e){return e.data!==void 0?e.data?"v8":"v7":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const pn=3;function wn(e){if(e.probed?.hasSchema&&!e.probed.v8Schema)return{kind:"unavailable",source:"local",problem:{reason:"not-v8"}};const t=e.probed?ge("local",{...e.probed,describe:e.describe??e.probed.describe},`:serve:${e.endpoint}`):null;return e.isError||e.failureCount>0?t?.kind==="protocol"&&!e.isError&&e.failureCount<pn?t:{kind:"unavailable",source:"local",problem:Xt(e.failure)}:t??{kind:"pending"}}const He={retry:2,refetchInterval:e=>e.state.status==="error"?Oe:!1};function ge(e,t,n){return{kind:"protocol",source:e,client:t.client,describe:t.describe,cacheKeySuffix:n,hasSchema:t.hasSchema}}function ht(e){const t=P.c(13);let n;t[0]!==e?(n=ce.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[r,s]=Pt(o,null),i=we(e);let a;if(t[2]!==i||t[3]!==r||t[4]!==e){const f=e?xe(r):null;a=yn({saved:f,main:i}),t[2]=i,t[3]=r,t[4]=e,t[5]=a}else a=t[5];const c=a;let l,d;t[6]!==s?(l=f=>s(xe(f)),d=()=>s(null),t[6]=s,t[7]=l,t[8]=d):(l=t[7],d=t[8]);let u;return t[9]!==c||t[10]!==l||t[11]!==d?(u={...c,setUrl:l,clear:d},t[9]=c,t[10]=l,t[11]=d,t[12]=u):u=t[12],u}function yn(e){return e.saved?e.main==="v7"?{url:e.saved,undecided:!1}:e.main==="v8"?{url:null,undecided:!1}:{url:null,undecided:!0}:{url:null,undecided:!1}}function Sn(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function Ge(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}class _e extends Error{constructor(t,n,o=[]){super(n),this.blocks=t,this.fields=o,this.name="BlockConflictError"}blocks;fields}function Ne(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function re(e,t,n){return["decofile-write",e,t,n]}function En(e,t,n){return{id:re(e,t,n).join(":")}}function De(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function kn(e,t){const n=await e.json().catch(()=>({}));throw new Error(n.error??`${t} failed (${e.status})`)}function Cn(e,t,n){e.setQueryData(v.decofileDraft(Ne(t)),n)}function In(e,t){return e.getQueryData(v.decofileDraft(Ne(t)))??null}async function On(e,t){const n=await fetch(De(e),{cache:"no-store",headers:{...oe("v7"),"if-none-match":`"${t}"`}}).catch(()=>null);return n?.status===200||n?.status===409}function Go(e){const t=P.c(4);let n;t[0]!==e?(n=v.decofileDraft(e?Ne(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Tn,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r??null}async function Tn(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function _n(e,t){const n=await fetch(De(t),{cache:"no-store",headers:oe("v7")});if(await Ce(n))throw Ie(e,t.orgSlug,t.virtualMcpId),new ke;if(!n.ok){const r=new Error(`Failed to fetch decofile: ${n.status}`);throw r.status=n.status,r}const o=await n.json();return o.token&&Cn(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function Ko(e,t){const n=await fetch(De(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const r=await n.json().catch(()=>({}));throw r.code==="block-conflict"?new _e(r.blocks??[],r.error??"Block changed"):new Error(r.error??`Save failed (${n.status})`)}if(!n.ok)return kn(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const gt=3e3,Nn=15e3,Dn=2*6e4,mt={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function Rn(e){return e<Dn?gt:Nn}function xn(e,t=mt){const n=t.now();let o=!1,r=!1,s=null;const i=()=>{o||(s=t.setTimeout(a,Rn(t.now()-n)))},a=()=>{if(s=null,o)return;const{read:c,skip:l}=e();if(r||t.hidden()||l?.()){i();return}r=!0;let d;try{d=c()}catch{d=void 0}Promise.resolve(d).catch(()=>{}).finally(()=>{r=!1}),i()};return i(),()=>{o=!0,s!==null&&t.clearTimeout(s)}}const Ke=()=>0;function Pn(e,t,n=mt){const o=U.useRef(t);o.current=t;const[r]=U.useState(()=>({polling:()=>xn(()=>o.current,n),idle:()=>()=>{}}));U.useSyncExternalStore(e?r.polling:r.idle,Ke,Ke)}function vt(e,t){return ne(e,t)}function An(e,t){return ne(e,"preview-fetch",{path:t})}function qo(e){return vt(e,"preview-invoke")}function Jo(e){return vt(e,"catalog-invoke")}function bt(e){try{const{hostname:t}=new URL(e);return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}function $n(){if(typeof document>"u")return null;const e=Array.from(document.querySelectorAll("iframe"));for(const t of e){const n=t.getAttribute("src");if(n&&bt(n))return n}return null}function Ln(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??$n();return n&&bt(n)?new URL(t,n).toString():An(e,t)}function Fn(e){return Ln(e,"/.decofile")}function Un(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function qe(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function Mn(e,t){const n=ne(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),r=Un(o.status);if(r==="absent")return{kind:"absent"};if(r==="unavailable")return{kind:"unavailable"};if(r==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const s=await o.json();return typeof s.content!="string"?{kind:"unavailable"}:{kind:"data",data:Ut(s.content)}}async function jn(e,t){const n=await Mn(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function Yo(e){const t=`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/meta`,n=await fetch(t,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok){const o=new Error(`Failed to read committed meta: ${n.status}`);throw o.status=n.status,o}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function Bn(e){return Mt(e)?.metadata?.runtime?.path??null}class pt extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function Wo(e){return e instanceof T&&e.code===w.Conflict}function wt(e){const t=e.data?.violations;return!Array.isArray(t)||t.length===0?e.message:t.slice(0,3).map(n=>n.message).join("; ")}function Qn(e,t,n){if(t instanceof _e)return t.message;if(n==="local")return Hn(e,t);if(t instanceof T)switch(t.code){case w.Conflict:return e("siteEditor.save.conflict");case w.ReadOnly:return e("siteEditor.save.readOnly");case w.InvalidBlock:case w.InvalidParams:return e("siteEditor.save.invalid");case w.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function Vn(e,t){if(t==="local"||e instanceof _e)return null;if(e instanceof T){const n=e.code===w.InvalidBlock||e.code===w.InvalidParams?wt(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function Hn(e,t){if(t instanceof pt)return e("decoServe.save.serverGone");if(t instanceof T)switch(t.code){case w.Conflict:return e("decoServe.save.conflict");case w.ReadOnly:return e("decoServe.save.readOnly");case w.InvalidBlock:case w.InvalidParams:return e("decoServe.save.invalid",{detail:wt(t)});case w.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function Gn(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function Kn(e,t){const[n,o]=U.useState(e),r=U.useRef(null);return e&&!n&&o(!0),U.useEffect(()=>{if(e){r.current??=Date.now();return}if(!n)return;const s=()=>{r.current=null,o(!1)},i=Gn(r.current,Date.now(),t);if(i===0){s();return}const a=setTimeout(s,i);return()=>clearTimeout(a)},[e,n,t]),n}const yt={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},qn=15e3,ee=new Map;function H(e,t){return`${e}/${t}`}function j(e){let t=ee.get(e);return t||(t={state:yt,listeners:new Set,previews:0,timer:null,discardListeners:new Set},ee.set(e,t)),t}function B(e,t){const n=j(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function se(e){e.timer&&clearTimeout(e.timer),e.timer=null}function Re(e){return ee.get(e)?.state??yt}function Jn(e,t){const n=j(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function zo(e){const t=j(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(se(t),B(e,{phase:"idle"}))}}function Xo(e){const t=ee.get(e);!t||t.state.phase!=="reloading"||(se(t),B(e,{phase:"idle"}))}function St(e){const t=j(e);se(t),B(e,{phase:"saving",inFlight:t.state.inFlight+1})}function me(e,t){const n=j(e),o=Math.max(0,n.state.inFlight-1);if(o>0){B(e,{inFlight:o});return}if(!t.ok||n.previews===0){B(e,{phase:"idle",inFlight:o});return}Et(e,t.navigates,o)}function Et(e,t,n=0){const o=j(e);se(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&B(e,{phase:"idle"})},qn),B(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function Yn(e){return e?.kind==="protocol"&&e.source==="github"}async function ve(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s,backend:i,cacheKey:a}=e,c=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:v.hostedReleases(o,r)}):null;if(i?.kind!=="protocol")return await c,{navigates:!1};const l=s?v.protocolDraftRead(o,r,s):null,d=l?JSON.stringify(n.getQueryData(l)??null):null,u=c?[c]:[];if(a&&t.reread&&u.push(n.invalidateQueries({queryKey:v.decofile(a)})),a&&u.push(n.invalidateQueries({queryKey:v.contentChanges(a)})),s&&i.source==="sandbox"&&u.push(n.invalidateQueries({queryKey:Vt(o,r,s)})),Yn(i)&&l&&u.push(n.invalidateQueries({queryKey:l})),await Promise.all(u),t.kind!=="edit"){const m=H(o,r);B(m,{epoch:Re(m).epoch+1})}const f=l?JSON.stringify(n.getQueryData(l)??null):null,g=d!==f;return g&&await new Promise(m=>At.schedule(m)),{navigates:g}}async function Wn(e,t){return St(H(e.orgSlug,e.virtualMcpId)),kt(e,t)}async function kt(e,t){const n=H(e.orgSlug,e.virtualMcpId);let o;try{o=await t.write()}catch(s){throw me(n,{ok:!1,navigates:!1}),t.refreshOnError&&ve(e,{kind:t.kind,reread:!0}).catch(()=>{}),s}let r=!1;try{({navigates:r}=await ve(e,t))}catch{}finally{me(n,{ok:!0,navigates:r})}return o}function Zo(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s}=e,i=H(o,r),a=new Set(t.blockKeys);for(const d of[...j(i).discardListeners])d(a);St(i);let c=!1;const l=()=>(c=!0,kt(e,{kind:"discard",reread:!0,write:t.write}));return s?n.getMutationCache().build(n,{mutationKey:re(o,r,s),scope:En(o,r,s),mutationFn:l}).execute(void 0).catch(d=>{throw c||me(i,{ok:!1,navigates:!1}),d}):l()}function er(e,t,n){const o=P.c(8);let r;o[0]!==e||o[1]!==t?(r=H(e,t),o[0]=e,o[1]=t,o[2]=r):r=o[2];const s=r;let i;o[3]!==n||o[4]!==s?(i=()=>{const c=j(s).discardListeners;return c.add(n),()=>{c.delete(n)}},o[3]=n,o[4]=s,o[5]=i):i=o[5];let a;o[6]!==s?(a=[s],o[6]=s,o[7]=a):a=o[7],U.useEffect(i,a)}function zn(e){const t=H(e.orgSlug,e.virtualMcpId);Re(t).inFlight>0||ve(e,{kind:"external"}).then(({navigates:n})=>{const o=j(t);o.previews>0&&o.state.inFlight===0&&Et(t,n)}).catch(()=>{})}function Xn(e,t){const n=P.c(7);let o;n[0]!==e||n[1]!==t?(o=H(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const r=o;let s;n[3]!==r?(s=l=>Jn(r,l),n[3]=r,n[4]=s):s=n[4];const i=s;let a;n[5]!==r?(a=()=>Re(r),n[5]=r,n[6]=a):a=n[6];const c=a;return U.useSyncExternalStore(i,c,c)}const Zn=500;function tr(e,t){const{phase:n}=Xn(e,t);return Kn(n!=="idle",Zn)}function eo(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function to(e,t){return v.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function nr(e,t,n){const o=e.getQueryData(v.contentVersions(t));if(!o)return;if(Object.hasOwn(o,n))return o[n];const r=e.getQueryData(v.decofile(t));return r&&Object.hasOwn(r,n)?void 0:null}function Ct(e,t,n){e.setQueryData(v.contentVersions(t),o=>{const r={...o};for(const[s,i]of Object.entries(n))i===null?delete r[s]:r[s]=i;return r})}function no(e,t){const n=e.getMutationCache().findAll({mutationKey:re(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>rn(o.state.variables)))}function be(e,t){e.resetQueries({queryKey:v.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function te(e,t,n,o){try{return await o()}catch(r){const s=!(r instanceof T);throw t.source==="local"&&s?(be(e,n),new pt(r)):(t.source==="local"&&Se(r)&&be(e,n),r)}}const z=new Map;function It(e,t,n,o){const r=z.get(o);if(r)return r;const s=Ot(e,t,n,o,!0);return z.set(o,s),s.finally(()=>z.delete(o))}async function or(e,t,n,o){const r=z.get(o);return r&&await r.catch(()=>{}),It(e,t,n,o)}async function Ot(e,t,n,o,r){const s=v.decofile(o),i=to(n,t),a=v.contentRevision(o),c=e.getQueryData(s),l=e.getQueryData(i),d=e.getQueryData(a)??void 0,u=t.source==="github"&&!l?ct(e,n.orgSlug,n.virtualMcpId):void 0,f=u?.isV8&&u.schema&&u.version?u:void 0,g=l??f?.schema,m=f?{...d,schemaVersion:f.version}:d,k=r&&c?m?.revision:void 0,C=r&&g?m?.schemaVersion:void 0,R=v.contentChanges(o),_=e.getQueryData(R),[N,I,O]=await te(e,t,n,()=>t.client.batch([{method:"blocks.list",params:k?{ifNoneMatch:k}:{}},{method:"schema.get",params:C?{ifNoneMatch:C}:{}},{method:"changes.list",params:_?{ifNoneMatch:_.revision}:{}}]));if(O?.ok){const x=he(_,O.result);x&&e.setQueryData(R,x)}else O&&t.source==="local"&&Se(O.error)&&be(e,n);if(!N?.ok)throw N?.error??new Error("no blocks.list");if(!I)throw new Error("no schema.get");const p=N.result,y=ut(I),S=I.ok&&!y?I.result:null;if(p.notModified&&!c||S?.notModified&&!g)return Ot(e,t,n,o,!1);const b=p.notModified?new Set:no(e,n),A=p.notModified?c:on(p.blocks,c,b),$=y?sn():S?S.notModified?g:S.schema:I.error,E=e.getQueryData(a)?.revision,D=E!==void 0&&E!==m?.revision;if(e.setQueryData(a,{revision:D?E:p.notModified?m?.revision:p.revision,schemaVersion:S?S.notModified?m?.schemaVersion:S.version??void 0:void 0}),e.setQueryData(s,A),!p.notModified){const x=v.contentVersions(o),M=e.getQueryData(x),J={...p.versions};for(const Q of b){const L=M?.[Q];L!==void 0?J[Q]=L:delete J[Q]}e.setQueryData(x,J)}return $ instanceof T||e.setQueryData(i,$),!D&&!p.notModified&&c&&m?.revision&&p.revision!==m.revision&&zn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:A,meta:$}}async function rr(e,t,n,o,r,s){return Wn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o},{kind:"edit",write:async()=>{const i=await te(e,t,n,()=>t.client.blocksApply({set:r.set,delete:r.delete,...s?{ifMatch:s}:{}}));e.setQueryData(v.contentRevision(o),c=>({...c,revision:i.revision}));const a=i.versions??{};return Ct(e,o,a),{revision:i.revision,versions:a}}})}async function sr(e,t,n,o,r){await e.invalidateQueries({queryKey:v.decofile(o)});let s;try{const a=(await te(e,t,n,()=>t.client.changesGet({names:[r]}))).entries[r];if(a&&a.after===null&&a.version!==null)return;s={value:a?.after??null,version:a?.version??null}}catch{const i=await te(e,t,n,()=>t.client.blocksList({}));if(i.notModified)return;s={value:i.blocks[r]??null,version:i.versions[r]??null}}e.setQueryData(v.decofile(o),i=>{const a={...i};return s.value===null?delete a[r]:a[r]=s.value,a}),Ct(e,o,{[r]:s.version})}function oo(e){const t=P.c(15),n=q();let o;t[0]!==e?.branch||t[1]!==e?.orgSlug||t[2]!==e?.virtualMcpId?(o=v.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[0]=e?.branch,t[1]=e?.orgSlug,t[2]=e?.virtualMcpId,t[3]=o):o=t[3];let r;t[4]!==e||t[5]!==n?(r=async()=>{const g=await fetch(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`,{cache:"no-store",headers:oe("v8")});if(await Ce(g))throw Ie(n,e.orgSlug,e.virtualMcpId),new ke;if(!g.ok)throw new Error(`draft pointer read failed: ${g.status}`);return await g.json()},t[4]=e,t[5]=n,t[6]=r):r=t[6];const s=!!e;let i;t[7]!==o||t[8]!==r||t[9]!==s?(i={queryKey:o,queryFn:r,enabled:s,staleTime:Number.POSITIVE_INFINITY},t[7]=o,t[8]=r,t[9]=s,t[10]=i):i=t[10];const{data:a,isPending:c,isError:l}=F(i),d=!!e&&c&&!l;if(!e||!a?.draft||!a.version){let g;return t[11]!==d?(g={pointer:null,pending:d},t[11]=d,t[12]=g):g=t[12],g}const u=`${a.draft}@${a.version}`;let f;return t[13]!==u?(f={pointer:u,pending:!1},t[13]=u,t[14]=f):f=t[14],f}function ir(e){return oo(e).pointer}function ar(e){const t=P.c(4);let n;t[0]!==e?(n=v.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:ro,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r?.revision}async function ro(){throw new Error("content revisions are set by reads and writes")}function Je(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function so(e,t){const n=P.c(6),{url:o}=ht(e?.virtualMcpId),r=ft(e?.virtualMcpId,e?.branch);if(!e)return"";let s;return n[0]!==r.cacheKeySuffix||n[1]!==r.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(s=r.kind==="protocol"?Je({...e,protocolSuffix:r.cacheKeySuffix}):Je({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=r.cacheKeySuffix,n[1]=r.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=s):s=n[5],s}function cr(e,t){const n=P.c(39),{url:o,undecided:r}=ht(e?.virtualMcpId),s=!!o,i=ft(e?.virtualMcpId,e?.branch),a=i.kind==="protocol"?i:null,c=so(e),l=t?.fetchEnabled??!0,d=Bn(e?.virtualMcpId),u=We(e?.virtualMcpId).runtime==="cms",f=q();let g;n[0]!==c?(g=v.decofile(c),n[0]=c,n[1]=g):g=n[1];const m=g;let k;n[2]!==e||n[3]!==f||n[4]!==m?(k=()=>{if(!e||f.isMutating({mutationKey:re(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const b=f.getQueryState(m);return b?.fetchStatus==="fetching"||Date.now()-(b?.dataUpdatedAt??0)<gt/2},n[2]=e,n[3]=f,n[4]=m,n[5]=k):k=n[5];let C;n[6]!==u||n[7]!==s||n[8]!==e||n[9]!==a||n[10]!==f||n[11]!==m?(C=async()=>{if(e){if(!a&&u&&!s){const b=In(f,e)?.version;if(b&&!await On(e,b))return}await f.refetchQueries({queryKey:m,exact:!0},{cancelRefetch:!1})}},n[6]=u,n[7]=s,n[8]=e,n[9]=a,n[10]=f,n[11]=m,n[12]=C):C=n[12];let R;n[13]!==k||n[14]!==C?(R={skip:k,read:C},n[13]=k,n[14]=C,n[15]=R):R=n[15],Pn(!!t?.pollWhile&&!!e,R);let _;n[16]!==i.kind||n[17]!==u||n[18]!==l||n[19]!==c||n[20]!==s||n[21]!==o||n[22]!==d||n[23]!==e||n[24]!==a||n[25]!==f?(_=async()=>{if(a)return(await It(f,a,e,c)).blocks;if(i.kind==="unavailable")throw eo("decofile");if(s){const E=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(co),D=E?.ok?Ge(await E.text()):null;if(D)return D;const x=new Error("decofile unavailable (local tunnel unreachable)");throw x.status=502,x}if(u)return _n(f,e);const b=()=>jn(e,Sn(d,".deco/blocks.gen.json"));if(l){const E=await fetch(Fn(e),{cache:"no-store"}).catch(ao);if(E?.ok){const M=Ge(await E.text());if(M)return M}const D=await b();if(D.kind==="data")return D.data;const x=new Error(`Failed to fetch decofile: ${E?.status??"network error"}`);throw x.status=qe({liveOk:!!E?.ok,liveStatus:E?.status,committedAbsent:D.kind==="absent"}),x}const A=await b();if(A.kind==="data")return A.data;const $=new Error("decofile unavailable (preview down, no committed snapshot)");throw $.status=qe({liveOk:!1,committedAbsent:A.kind==="absent"}),$},n[16]=i.kind,n[17]=u,n[18]=l,n[19]=c,n[20]=s,n[21]=o,n[22]=d,n[23]=e,n[24]=a,n[25]=f,n[26]=_):_=n[26];const N=!!e&&i.kind!=="pending"&&!r,I=a?0:3e4,O=a?.describe.pollIntervalMs,p=a?"always":void 0;let y;n[27]!==u||n[28]!==s||n[29]!==a?(y=(b,A)=>{if(a||u||s)return b<3;const $=A.status;return $!==502&&$!==404&&b<2},n[27]=u,n[28]=s,n[29]=a,n[30]=y):y=n[30];let S;return n[31]!==m||n[32]!==_||n[33]!==N||n[34]!==I||n[35]!==O||n[36]!==p||n[37]!==y?(S={queryKey:m,queryFn:_,enabled:N,staleTime:I,refetchInterval:O,refetchIntervalInBackground:!1,refetchOnWindowFocus:p,retry:y,retryDelay:io},n[31]=m,n[32]=_,n[33]=N,n[34]=I,n[35]=O,n[36]=p,n[37]=y,n[38]=S):S=n[38],F(S)}function io(e){return Ht(5e3,1e3,e,2,0)}function ao(){return null}function co(){return null}const lo="site-editor-save",uo={id:lo,description:void 0,action:void 0,cancel:void 0},lr="site-editor-undo",pe="site-editor-publish";function fo(e){const t=P.c(7),{label:n,detail:o}=e;let r;t[0]!==n?(r=V.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=r):r=t[1];let s;t[2]!==o?(s=V.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=s):s=t[3];let i;return t[4]!==r||t[5]!==s?(i=V.jsxs("details",{className:"mt-1 text-xs",children:[r,s]}),t[4]=r,t[5]=s,t[6]=i):i=t[6],i}function Tt(e,t){return t?V.jsx(fo,{label:e("siteEditor.details"),detail:t}):void 0}function ur(e,t,n){X.error(Qn(e,t,n),{...uo,description:Tt(e,Vn(t,n))})}const _t={action:void 0,duration:void 0};function dr(e,t){X.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{..._t,id:pe,description:void 0})}function fr(e,{headline:t,body:n,detail:o,retry:r,pending:s,tone:i="error"}){const a=Tt(e,o??null);X[i](t,{id:pe,description:n&&a?V.jsxs(V.Fragment,{children:[V.jsx("p",{children:n}),a]}):n??a,action:r?{label:e("siteEditor.tryAgain"),onClick:c=>{c.preventDefault(),X.loading(s??e("thread.publishPopover.publishing"),{..._t,id:pe,description:void 0}),r()}}:void 0,duration:r?Number.POSITIVE_INFINITY:void 0})}function hr(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{Bo as $,zo as A,Xn as B,Xo as C,so as D,ar as E,En as F,re as G,Wn as H,Mn as I,kn as J,_e as K,Wo as L,rr as M,sr as N,ur as O,Cn as P,Ko as Q,er as R,Ao as S,it as T,Uo as U,Vo as V,je as W,Be as X,Ho as Y,$o as Z,Ln as _,Lo as a,zt as a0,Tt as a1,hr as a2,Io as a3,Co as a4,Kt as a5,Ie as a6,dr as a7,Zo as a8,Oo as a9,To as aa,Se as ab,No as ac,to as ad,Jt as ae,fo as af,_o as ag,It as ah,eo as ai,Yo as aj,jn as ak,Go as al,ir as am,oe as an,fr as ao,pe as ap,_t as aq,lr as ar,uo as as,or as at,nr as au,Jo as av,Zt as b,ht as c,Wt as d,Po as e,Xt as f,Te as g,ye as h,nt as i,qo as j,An as k,cr as l,Fo as m,Qo as n,Bn as o,Do as p,Sn as q,xo as r,Ro as s,at as t,ft as u,jo as v,tr as w,Mo as x,oo as y,H as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as te,a2 as se,o as ae,r as T,aa as ce,j as t,B as U,n as $,b1 as de,a3 as me,t as D,az as ue,c as ie,l as pe,X as ge,T as fe,V as he,U as xe,K as Q,f0 as je}from"./index-BeWb3VLq.js";import{i as ke}from"./DotsVertical-DbrlDgFh.js";import{i as le,a as ve}from"./ZoomOut-DixQygt2.js";import{s as ye}from"./Trash01-DjE7Raat.js";import{i as Se}from"./Upload01-CYfTR3aZ.js";import{S as be}from"./search-input-BL6XGlmm.js";import{S as we}from"./search-toggle-IRNGzCzn.js";import{f as Ce,e as De,b as Ne,A as Pe,a as Ae,d as Ee,c as Te,g as Me}from"./alert-dialog-BdWXpnme.js";import{E as Y}from"./empty-state-B4dSQMeM.js";import{C as Oe}from"./collection-tabs-DMsbicTn.js";import{p as Ie,S as ze,F as Fe}from"./folder-icon-CMfbCZZj.js";import{h as Re,i as $e,r as _e}from"./use-org-fs-CxjQMzFd.js";import{S as Le,H as J,f as Be}from"./location-V0VwTJTt.js";import"./SearchMd-7Jo0ZofC.js";import"./icon-button-Du_O8eku.js";import"./tooltip-4vv5k-uR.js";import"./index-CdhgpKbn.js";import"./badge-BfMggcm8.js";import"./markdown-D_Bab0vD.js";import"./use-copy-C4LbXPXl.js";import"./Copy01-B341DqLV.js";import"./use-mobile-BAnIvR27.js";import"./use-panel-navigate-CXkMPISv.js";import"./thread-route-BPSSuk8V.js";import"./use-project-scope-BOj2O9A_.js";import"./repository-binding-Cf_thK-b.js";import"./use-mcp-client-2WkK0AxE.js";import"./auth-DVebpHI3.js";import"./file-preview-CVVpAx14.js";import"./utils-t1gjPfET.js";import"./Image01-hTzc15CE.js";import"./editor-DAekV0he.js";import"./file-type-icon-DYeFNgMs.js";import"./useInfiniteQuery-CxzyY6DS.js";import"./infiniteQueryObserver-BOCgDRcQ.js";const Z=200,Ke=new Set(["node_modules","__pycache__"]);function q(s){const[,...e]=s.webkitRelativePath.split("/");return e.length>0?e.join("/"):s.name}function He(s){return q(s).split("/").every(e=>!e.startsWith(".")&&!Ke.has(e))}function Qe(s){return s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"skill"}function Ue(s,e){const l=new Map;for(const r of s){const c=q(r).split("/");c.pop();const a=["skills",e,...c].join("/");l.set(a,[...l.get(a)??[],r])}return l}async function qe(s,e){const r=(await Promise.allSettled([...s].map(([c,a])=>e({dir:c,files:a})))).find(c=>c.status==="rejected");if(r)throw r.reason}function Ge(s,e){const l=Ie(e),r=`skills/${s}`;return{id:`home/${r}`,name:l.name??s,description:l.description,disableModelInvocation:l.disableModelInvocation,source:"home",volume:J,path:r,sandboxPath:`${Le}/${J}/${r}`}}const L="*";function B(s){return s.volume==="home"}function re(s,e){const l=s.indexOf(":");return l===-1?{label:e,glyph:le}:{label:s.slice(l+1),glyph:s.startsWith("repo:")?ue:ve}}function Xe(s){const e=ie.c(48),{entry:l,pending:r,onOpen:c,onDelete:a}=s,o=te(),{org:m}=se();let S;e[0]!==l.source||e[1]!==m.name?(S=re(l.source,m.name),e[0]=l.source,e[1]=m.name,e[2]=S):S=e[2];const{label:M,glyph:O}=S;let I;e[3]!==l?(I=B(l),e[3]=l,e[4]=I):I=e[4];const F=I,z=r?"opacity-60":"hover:bg-accent";let u;e[5]!==z?(u=pe("relative transition-colors group overflow-hidden flex flex-col h-full",z),e[5]=z,e[6]=u):u=e[6];let f;e[7]!==l.name||e[8]!==c||e[9]!==r?(f=!r&&t.jsx("button",{type:"button",onClick:c,className:"absolute inset-0 z-0","aria-label":l.name}),e[7]=l.name,e[8]=c,e[9]=r,e[10]=f):f=e[10];const b=F?"default":"system",N=!F;let w;e[11]!==O||e[12]!==b||e[13]!==N?(w=t.jsx(Fe,{glyph:O,tone:b,readOnly:N,className:"size-8 shrink-0"}),e[11]=O,e[12]=b,e[13]=N,e[14]=w):w=e[14];let h;e[15]!==a||e[16]!==o?(h=a&&t.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:t.jsxs(ge,{children:[t.jsx(fe,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",children:t.jsx(ke,{size:16})})}),t.jsx(he,{align:"end",children:t.jsxs(xe,{variant:"destructive",onClick:K=>{K.stopPropagation(),a()},children:[t.jsx(ye,{size:16}),o("settings.skills.deleteButton")]})})]})}),e[15]=a,e[16]=o,e[17]=h):h=e[17];let x;e[18]!==w||e[19]!==h?(x=t.jsxs("div",{className:"flex items-start justify-between",children:[w,h]}),e[18]=w,e[19]=h,e[20]=x):x=e[20];let j;e[21]!==l.name?(j=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:l.name}),e[21]=l.name,e[22]=j):j=e[22];let C;e[23]!==l.description||e[24]!==o?(C=l.description||o("settings.skills.noDescription"),e[23]=l.description,e[24]=o,e[25]=C):C=e[25];let k;e[26]!==C?(k=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:C}),e[26]=C,e[27]=k):k=e[27];let d;e[28]!==j||e[29]!==k?(d=t.jsxs("div",{className:"flex flex-col gap-1",children:[j,k]}),e[28]=j,e[29]=k,e[30]=d):d=e[30];let v;e[31]!==x||e[32]!==d?(v=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[x,d]}),e[31]=x,e[32]=d,e[33]=v):v=e[33];let p;e[34]!==M||e[35]!==r||e[36]!==o?(p=r?o("settings.skills.importing"):M,e[34]=M,e[35]=r,e[36]=o,e[37]=p):p=e[37];let y;e[38]!==p?(y=t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:"h-10 flex items-center px-4.5",children:t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:p})})}),e[38]=p,e[39]=y):y=e[39];let g;e[40]!==v||e[41]!==y?(g=t.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[v,y]}),e[40]=v,e[41]=y,e[42]=g):g=e[42];let P;return e[43]!==r||e[44]!==g||e[45]!==u||e[46]!==f?(P=t.jsxs(je,{size:"flush","aria-busy":r,className:u,children:[f,g]}),e[43]=r,e[44]=g,e[45]=u,e[46]=f,e[47]=P):P=e[47],P}function ee(s){const e=ie.c(2),{children:l}=s;let r;return e[0]!==l?(r=t.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:l}),e[0]=l,e[1]=r):r=e[1],r}function Et(){const s=te(),{org:e}=se(),l=Re(),{remove:r,upload:c}=$e("home"),a=ae(),o=T.useRef(null),[m,S]=T.useState(""),M=ce(),[O,I]=T.useState(L),[F,z]=T.useState(!1),[u,f]=T.useState(null),[b,N]=T.useState(null),[w,h]=T.useState(null),x=()=>{a.invalidateQueries({queryKey:Q.slashSkills(e.id)}),a.invalidateQueries({queryKey:Q.orgFsSkills(e.id)})},j=i=>a.setQueryData(Q.slashSkills(e.id),n=>i(n??[]));async function C(i){const n=[...i??[]];if(o.current&&(o.current.value=""),n.length===0)return;const A=n[0]?.webkitRelativePath??"";if(!A){D.error(s("settings.skills.importNeedsFolder"));return}const H=A.split("/")[0]??"",_=n.filter(He),X=_.find(E=>q(E)==="SKILL.md");if(!X){D.error(s("settings.skills.importMissingSkillMd"));return}if(_.length>Z){D.error(s("settings.skills.importTooManyFiles",{count:String(_.length),max:String(Z)}));return}const R=Qe(H),W=`skills/${R}`;let V=!1;z(!0);try{if(await _e(e.slug,"home",W)){D.error(s("settings.skills.importSlugTaken",{slug:R}));return}V=!0;const E=Ge(R,await X.text());j(oe=>[E,...oe]),h(E.id),await qe(Ue(_,R),c.mutateAsync),D.success(s("settings.skills.importSuccess",{name:R}))}catch(E){V&&await r.mutateAsync(W).catch(()=>{}),D.error(E instanceof Error?E.message:s("settings.skills.importError"))}finally{h(null),x(),z(!1)}}const k=m.toLowerCase(),d=(l.data??[]).filter(i=>i.name.toLowerCase().includes(k)||(i.description??"").toLowerCase().includes(k)).sort((i,n)=>Number(B(n))-Number(B(i))||i.name.localeCompare(n.name)),v=new Set((l.data??[]).map(i=>i.source)),p=new Map;for(const i of d)p.set(i.source,(p.get(i.source)??0)+1);const y=[{id:L,label:s("settings.skills.filterAll"),count:d.length},...[...v].map(i=>({id:i,label:re(i,e.name).label,count:p.get(i)??0}))],g=v.has(O)?O:L,P=g===L?d:d.filter(i=>i.source===g),K=i=>f(Be(i.volume,i.path)),ne=async()=>{if(!b)return;const{id:i,path:n}=b;N(null),j(A=>A.filter(H=>H.id!==i));try{await r.mutateAsync(n),D.success(s("settings.skills.deleteSuccess"))}catch(A){D.error(A instanceof Error?A.message:s("settings.skills.deleteError"))}finally{x()}},G=t.jsxs(U,{size:"sm",disabled:F,onClick:()=>o.current?.click(),children:[t.jsx(Se,{size:14}),s(F?"settings.skills.importing":"settings.skills.importButton")]});return t.jsxs($,{children:[t.jsx($.Content,{children:t.jsx($.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[M?t.jsx($.Actions,{secondary:t.jsx(we,{value:m,onChange:S,label:s("library.context.search"),placeholder:s("settings.skills.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),children:G}):t.jsx($.Title,{actions:G,children:s("settings.skills.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3 empty:hidden",children:!M&&t.jsx(be,{value:m,onChange:S,placeholder:s("settings.skills.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(S(""),i.target.blur())}})}),t.jsx("input",{ref:o,type:"file",multiple:!0,webkitdirectory:"",className:"hidden",onChange:i=>{C(i.target.files)}}),y.length>2&&t.jsx(Oe,{placement:"page",tabs:y,activeTab:g,onTabChange:I}),l.isPending?t.jsx("div",{className:"@container",children:t.jsx(ee,{children:Array.from({length:8},(i,n)=>t.jsx(de,{className:"h-[168px] rounded-xl"},n))})}):l.isError?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(me,{size:48,className:"text-muted-foreground"}),title:s("settings.skills.errorTitle"),description:l.error instanceof Error?l.error.message:s("settings.skills.errorDescription"),actions:t.jsx(U,{size:"sm",variant:"outline",onClick:()=>{l.refetch()},children:s("settings.skills.retry")})})}):P.length===0?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(le,{size:48,className:"text-muted-foreground"}),title:s(m?"settings.skills.noResultsTitle":"settings.skills.emptyTitle"),description:m?s("settings.skills.noResultsDescription",{search:m}):s("settings.skills.emptyDescription"),actions:!1})}):t.jsx("div",{className:"@container",children:t.jsx(ee,{children:P.map(i=>{const n=i.id===w;return t.jsx(Xe,{entry:i,pending:n,onOpen:()=>K(i),onDelete:B(i)&&!n?()=>N(i):void 0},i.id)})})})]})})}),u&&t.jsx(ze,{skillPath:u,onClose:()=>f(null)},u),t.jsx(Ce,{open:b!==null,onOpenChange:i=>!i&&N(null),children:t.jsxs(De,{children:[t.jsxs(Ne,{children:[t.jsx(Pe,{children:s("settings.skills.deleteDialogTitle")}),t.jsx(Ae,{children:s("settings.skills.deleteDialogDescription",{name:b?.name??""})})]}),t.jsxs(Ee,{children:[t.jsx(Te,{children:s("settings.skills.cancel")}),t.jsx(Me,{onClick:ne,variant:"destructive",children:s("settings.skills.deleteButton")})]})]})})]})}export{Et as default};
|
|
1
|
+
import{b as te,a2 as se,o as ae,r as T,aa as ce,j as t,B as U,n as $,b1 as de,a3 as me,t as D,az as ue,c as ie,l as pe,X as ge,T as fe,V as he,U as xe,K as Q,f0 as je}from"./index-D2MFYEzD.js";import{i as ke}from"./DotsVertical-eX97dPc6.js";import{i as le,a as ve}from"./ZoomOut-DLICjI1h.js";import{s as ye}from"./Trash01-TPK4gSsp.js";import{i as Se}from"./Upload01-D6tRQTgc.js";import{S as be}from"./search-input-DSx8LWNe.js";import{S as we}from"./search-toggle-B9X5GBEJ.js";import{f as Ce,e as De,b as Ne,A as Pe,a as Ae,d as Ee,c as Te,g as Me}from"./alert-dialog-KKnJELoX.js";import{E as Y}from"./empty-state-_a1QMwjl.js";import{C as Oe}from"./collection-tabs-D5lfCRgo.js";import{p as Ie,S as ze,F as Fe}from"./folder-icon-D_8O1LWU.js";import{h as Re,i as $e,r as _e}from"./use-org-fs-CyxFz8rw.js";import{S as Le,H as J,f as Be}from"./location-V0VwTJTt.js";import"./SearchMd-GQAKwnQD.js";import"./icon-button-BQwa115u.js";import"./tooltip-bQVm_Ope.js";import"./index-CXWqnDP7.js";import"./badge-DmeqGssZ.js";import"./markdown-BeKN4MPt.js";import"./use-copy-Bc8JMSws.js";import"./Copy01-DRNuKy-h.js";import"./use-mobile-h4hHhZkm.js";import"./use-panel-navigate-DxGjTjIo.js";import"./thread-route-UuA5SD5X.js";import"./use-project-scope-CBw0FSEz.js";import"./repository-binding-4nTgXz1S.js";import"./use-mcp-client-Cby5XqT6.js";import"./auth-DHZfBLZ5.js";import"./file-preview-Dy07kmgf.js";import"./utils-CkwBhBMS.js";import"./Image01-QuVxFosz.js";import"./editor-4LyrkCqm.js";import"./file-type-icon-CP6Bm0Pm.js";import"./useInfiniteQuery-Dobhsojg.js";import"./infiniteQueryObserver-CaSjeDsE.js";const Z=200,Ke=new Set(["node_modules","__pycache__"]);function q(s){const[,...e]=s.webkitRelativePath.split("/");return e.length>0?e.join("/"):s.name}function He(s){return q(s).split("/").every(e=>!e.startsWith(".")&&!Ke.has(e))}function Qe(s){return s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"skill"}function Ue(s,e){const l=new Map;for(const r of s){const c=q(r).split("/");c.pop();const a=["skills",e,...c].join("/");l.set(a,[...l.get(a)??[],r])}return l}async function qe(s,e){const r=(await Promise.allSettled([...s].map(([c,a])=>e({dir:c,files:a})))).find(c=>c.status==="rejected");if(r)throw r.reason}function Ge(s,e){const l=Ie(e),r=`skills/${s}`;return{id:`home/${r}`,name:l.name??s,description:l.description,disableModelInvocation:l.disableModelInvocation,source:"home",volume:J,path:r,sandboxPath:`${Le}/${J}/${r}`}}const L="*";function B(s){return s.volume==="home"}function re(s,e){const l=s.indexOf(":");return l===-1?{label:e,glyph:le}:{label:s.slice(l+1),glyph:s.startsWith("repo:")?ue:ve}}function Xe(s){const e=ie.c(48),{entry:l,pending:r,onOpen:c,onDelete:a}=s,o=te(),{org:m}=se();let S;e[0]!==l.source||e[1]!==m.name?(S=re(l.source,m.name),e[0]=l.source,e[1]=m.name,e[2]=S):S=e[2];const{label:M,glyph:O}=S;let I;e[3]!==l?(I=B(l),e[3]=l,e[4]=I):I=e[4];const F=I,z=r?"opacity-60":"hover:bg-accent";let u;e[5]!==z?(u=pe("relative transition-colors group overflow-hidden flex flex-col h-full",z),e[5]=z,e[6]=u):u=e[6];let f;e[7]!==l.name||e[8]!==c||e[9]!==r?(f=!r&&t.jsx("button",{type:"button",onClick:c,className:"absolute inset-0 z-0","aria-label":l.name}),e[7]=l.name,e[8]=c,e[9]=r,e[10]=f):f=e[10];const b=F?"default":"system",N=!F;let w;e[11]!==O||e[12]!==b||e[13]!==N?(w=t.jsx(Fe,{glyph:O,tone:b,readOnly:N,className:"size-8 shrink-0"}),e[11]=O,e[12]=b,e[13]=N,e[14]=w):w=e[14];let h;e[15]!==a||e[16]!==o?(h=a&&t.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:t.jsxs(ge,{children:[t.jsx(fe,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",children:t.jsx(ke,{size:16})})}),t.jsx(he,{align:"end",children:t.jsxs(xe,{variant:"destructive",onClick:K=>{K.stopPropagation(),a()},children:[t.jsx(ye,{size:16}),o("settings.skills.deleteButton")]})})]})}),e[15]=a,e[16]=o,e[17]=h):h=e[17];let x;e[18]!==w||e[19]!==h?(x=t.jsxs("div",{className:"flex items-start justify-between",children:[w,h]}),e[18]=w,e[19]=h,e[20]=x):x=e[20];let j;e[21]!==l.name?(j=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:l.name}),e[21]=l.name,e[22]=j):j=e[22];let C;e[23]!==l.description||e[24]!==o?(C=l.description||o("settings.skills.noDescription"),e[23]=l.description,e[24]=o,e[25]=C):C=e[25];let k;e[26]!==C?(k=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:C}),e[26]=C,e[27]=k):k=e[27];let d;e[28]!==j||e[29]!==k?(d=t.jsxs("div",{className:"flex flex-col gap-1",children:[j,k]}),e[28]=j,e[29]=k,e[30]=d):d=e[30];let v;e[31]!==x||e[32]!==d?(v=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[x,d]}),e[31]=x,e[32]=d,e[33]=v):v=e[33];let p;e[34]!==M||e[35]!==r||e[36]!==o?(p=r?o("settings.skills.importing"):M,e[34]=M,e[35]=r,e[36]=o,e[37]=p):p=e[37];let y;e[38]!==p?(y=t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:"h-10 flex items-center px-4.5",children:t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:p})})}),e[38]=p,e[39]=y):y=e[39];let g;e[40]!==v||e[41]!==y?(g=t.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[v,y]}),e[40]=v,e[41]=y,e[42]=g):g=e[42];let P;return e[43]!==r||e[44]!==g||e[45]!==u||e[46]!==f?(P=t.jsxs(je,{size:"flush","aria-busy":r,className:u,children:[f,g]}),e[43]=r,e[44]=g,e[45]=u,e[46]=f,e[47]=P):P=e[47],P}function ee(s){const e=ie.c(2),{children:l}=s;let r;return e[0]!==l?(r=t.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:l}),e[0]=l,e[1]=r):r=e[1],r}function Et(){const s=te(),{org:e}=se(),l=Re(),{remove:r,upload:c}=$e("home"),a=ae(),o=T.useRef(null),[m,S]=T.useState(""),M=ce(),[O,I]=T.useState(L),[F,z]=T.useState(!1),[u,f]=T.useState(null),[b,N]=T.useState(null),[w,h]=T.useState(null),x=()=>{a.invalidateQueries({queryKey:Q.slashSkills(e.id)}),a.invalidateQueries({queryKey:Q.orgFsSkills(e.id)})},j=i=>a.setQueryData(Q.slashSkills(e.id),n=>i(n??[]));async function C(i){const n=[...i??[]];if(o.current&&(o.current.value=""),n.length===0)return;const A=n[0]?.webkitRelativePath??"";if(!A){D.error(s("settings.skills.importNeedsFolder"));return}const H=A.split("/")[0]??"",_=n.filter(He),X=_.find(E=>q(E)==="SKILL.md");if(!X){D.error(s("settings.skills.importMissingSkillMd"));return}if(_.length>Z){D.error(s("settings.skills.importTooManyFiles",{count:String(_.length),max:String(Z)}));return}const R=Qe(H),W=`skills/${R}`;let V=!1;z(!0);try{if(await _e(e.slug,"home",W)){D.error(s("settings.skills.importSlugTaken",{slug:R}));return}V=!0;const E=Ge(R,await X.text());j(oe=>[E,...oe]),h(E.id),await qe(Ue(_,R),c.mutateAsync),D.success(s("settings.skills.importSuccess",{name:R}))}catch(E){V&&await r.mutateAsync(W).catch(()=>{}),D.error(E instanceof Error?E.message:s("settings.skills.importError"))}finally{h(null),x(),z(!1)}}const k=m.toLowerCase(),d=(l.data??[]).filter(i=>i.name.toLowerCase().includes(k)||(i.description??"").toLowerCase().includes(k)).sort((i,n)=>Number(B(n))-Number(B(i))||i.name.localeCompare(n.name)),v=new Set((l.data??[]).map(i=>i.source)),p=new Map;for(const i of d)p.set(i.source,(p.get(i.source)??0)+1);const y=[{id:L,label:s("settings.skills.filterAll"),count:d.length},...[...v].map(i=>({id:i,label:re(i,e.name).label,count:p.get(i)??0}))],g=v.has(O)?O:L,P=g===L?d:d.filter(i=>i.source===g),K=i=>f(Be(i.volume,i.path)),ne=async()=>{if(!b)return;const{id:i,path:n}=b;N(null),j(A=>A.filter(H=>H.id!==i));try{await r.mutateAsync(n),D.success(s("settings.skills.deleteSuccess"))}catch(A){D.error(A instanceof Error?A.message:s("settings.skills.deleteError"))}finally{x()}},G=t.jsxs(U,{size:"sm",disabled:F,onClick:()=>o.current?.click(),children:[t.jsx(Se,{size:14}),s(F?"settings.skills.importing":"settings.skills.importButton")]});return t.jsxs($,{children:[t.jsx($.Content,{children:t.jsx($.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[M?t.jsx($.Actions,{secondary:t.jsx(we,{value:m,onChange:S,label:s("library.context.search"),placeholder:s("settings.skills.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),children:G}):t.jsx($.Title,{actions:G,children:s("settings.skills.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3 empty:hidden",children:!M&&t.jsx(be,{value:m,onChange:S,placeholder:s("settings.skills.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(S(""),i.target.blur())}})}),t.jsx("input",{ref:o,type:"file",multiple:!0,webkitdirectory:"",className:"hidden",onChange:i=>{C(i.target.files)}}),y.length>2&&t.jsx(Oe,{placement:"page",tabs:y,activeTab:g,onTabChange:I}),l.isPending?t.jsx("div",{className:"@container",children:t.jsx(ee,{children:Array.from({length:8},(i,n)=>t.jsx(de,{className:"h-[168px] rounded-xl"},n))})}):l.isError?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(me,{size:48,className:"text-muted-foreground"}),title:s("settings.skills.errorTitle"),description:l.error instanceof Error?l.error.message:s("settings.skills.errorDescription"),actions:t.jsx(U,{size:"sm",variant:"outline",onClick:()=>{l.refetch()},children:s("settings.skills.retry")})})}):P.length===0?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(le,{size:48,className:"text-muted-foreground"}),title:s(m?"settings.skills.noResultsTitle":"settings.skills.emptyTitle"),description:m?s("settings.skills.noResultsDescription",{search:m}):s("settings.skills.emptyDescription"),actions:!1})}):t.jsx("div",{className:"@container",children:t.jsx(ee,{children:P.map(i=>{const n=i.id===w;return t.jsx(Xe,{entry:i,pending:n,onOpen:()=>K(i),onDelete:B(i)&&!n?()=>N(i):void 0},i.id)})})})]})})}),u&&t.jsx(ze,{skillPath:u,onClose:()=>f(null)},u),t.jsx(Ce,{open:b!==null,onOpenChange:i=>!i&&N(null),children:t.jsxs(De,{children:[t.jsxs(Ne,{children:[t.jsx(Pe,{children:s("settings.skills.deleteDialogTitle")}),t.jsx(Ae,{children:s("settings.skills.deleteDialogDescription",{name:b?.name??""})})]}),t.jsxs(Ee,{children:[t.jsx(Te,{children:s("settings.skills.cancel")}),t.jsx(Me,{onClick:ne,variant:"destructive",children:s("settings.skills.deleteButton")})]})]})})]})}export{Et as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as _,l as N,j}from"./index-
|
|
1
|
+
import{c as _,l as N,j}from"./index-D2MFYEzD.js";import{T as k,R as z,a as D,b as S}from"./index-BWgOKGMR.js";function V(T){const e=_.c(41);let i,t,n,s,c,b,g,o,r,a;e[0]!==T?({className:i,defaultValue:t,value:a,min:b,max:g,onPointerDown:s,onKeyDown:n,thumbLabel:o,thumbValueText:r,...c}=T,e[0]=T,e[1]=i,e[2]=t,e[3]=n,e[4]=s,e[5]=c,e[6]=b,e[7]=g,e[8]=o,e[9]=r,e[10]=a):(i=e[1],t=e[2],n=e[3],s=e[4],c=e[5],b=e[6],g=e[7],o=e[8],r=e[9],a=e[10]);const d=b===void 0?0:b,u=g===void 0?100:g;let p;e[11]!==t||e[12]!==u||e[13]!==d||e[14]!==a?(p=Array.isArray(a)?a:Array.isArray(t)?t:[d,u],e[11]=t,e[12]=u,e[13]=d,e[14]=a,e[15]=p):p=e[15];const A=p;let f;e[16]!==i?(f=N("relative flex w-full touch-none items-center py-2 select-none data-[disabled]:opacity-50 data-[orientation=vertical]:px-2 data-[orientation=vertical]:py-0 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",i),e[16]=i,e[17]=f):f=e[17];let m;e[18]!==s?(m=l=>{l.currentTarget.dataset.pointer="",s?.(l)},e[18]=s,e[19]=m):m=e[19];let h;e[20]!==n?(h=l=>{delete l.currentTarget.dataset.pointer,n?.(l)},e[20]=n,e[21]=h):h=e[21];let x;e[22]===Symbol.for("react.memo_cache_sentinel")?(x=N("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1"),e[22]=x):x=e[22];let w;e[23]===Symbol.for("react.memo_cache_sentinel")?(w=j.jsx(k,{"data-slot":"slider-track",className:x,children:j.jsx(z,{"data-slot":"slider-range",className:N("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),e[23]=w):w=e[23];let v;if(e[24]!==A.length||e[25]!==o||e[26]!==r){let l;e[28]!==o||e[29]!==r?(l=(E,R)=>j.jsx(S,{"data-slot":"slider-thumb",...o!==void 0?{"aria-label":o}:{},...r!==void 0?{"aria-valuetext":r}:{},className:"relative block size-4 shrink-0 cursor-grab rounded-full bg-white shadow-edge transition-transform duration-150 after:absolute after:-inset-3 after:rounded-full after:content-[''] hover:scale-110 focus-ring in-data-pointer:outline-none! active:scale-110 active:cursor-grabbing disabled:pointer-events-none motion-reduce:transition-none"},R),e[28]=o,e[29]=r,e[30]=l):l=e[30],v=Array.from({length:A.length},l),e[24]=A.length,e[25]=o,e[26]=r,e[27]=v}else v=e[27];let y;return e[31]!==t||e[32]!==u||e[33]!==d||e[34]!==c||e[35]!==f||e[36]!==m||e[37]!==h||e[38]!==v||e[39]!==a?(y=j.jsxs(D,{"data-slot":"slider",defaultValue:t,value:a,min:d,max:u,className:f,...c,onPointerDown:m,onKeyDown:h,children:[w,v]}),e[31]=t,e[32]=u,e[33]=d,e[34]=c,e[35]=f,e[36]=m,e[37]=h,e[38]=v,e[39]=a,e[40]=y):y=e[40],y}export{V as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as v,d$ as K}from"./index-
|
|
1
|
+
import{r as v,d$ as K}from"./index-D2MFYEzD.js";import{d as de,e as fe,f as U,g as ge,h as pe,i as be,j as ve,C as Y,k as he,l as y,m as me,n as xe,o as Ie,s as ye}from"./core.esm-DHAYYfZu.js";function q(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Re(e,t){return e.reduce((n,r,s)=>{const a=t.get(r);return a&&(n[s]=a),n},Array(e.length))}function O(e){return e!==null&&e>=0}function Ce(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function we(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const B=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const a=q(t,r,n),o=t[s],c=a[s];return!c||!o?null:{x:c.left-o.left,y:c.top-o.top,scaleX:c.width/o.width,scaleY:c.height/o.height}},L={scaleX:1,scaleY:1},Xe=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:a,overIndex:o}=e;const c=(t=a[n])!=null?t:r;if(!c)return null;if(s===n){const u=a[o];return u?{x:0,y:n<o?u.top+u.height-(c.top+c.height):u.top-c.top,...L}:null}const f=De(a,s,n);return s>n&&s<=o?{x:0,y:-c.height-f,...L}:s<n&&s>=o?{x:0,y:c.height+f,...L}:{x:0,y:0,...L}};function De(e,t,n){const r=e[t],s=e[t-1],a=e[t+1];return r?n<t?s?r.top-(s.top+s.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const H="Sortable",V=K.createContext({activeIndex:-1,containerId:H,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:B,disabled:{draggable:!1,droppable:!1}});function _e(e){let{children:t,id:n,items:r,strategy:s=B,disabled:a=!1}=e;const{active:o,dragOverlay:c,droppableRects:f,over:u,measureDroppableContainers:i}=de(),l=fe(H,n),d=c.rect!==null,g=v.useMemo(()=>r.map(I=>typeof I=="object"&&"id"in I?I.id:I),[r]),R=o!=null,C=o?g.indexOf(o.id):-1,h=u?g.indexOf(u.id):-1,w=v.useRef(g),x=!Ce(g,w.current),m=h!==-1&&C===-1||x,b=we(a);U(()=>{x&&R&&i(g)},[x,g,R,i]),v.useEffect(()=>{w.current=g},[g]);const D=v.useMemo(()=>({activeIndex:C,containerId:l,disabled:b,disableTransforms:m,items:g,overIndex:h,useDragOverlay:d,sortedRects:Re(g,f),strategy:s}),[C,l,b.draggable,b.droppable,m,g,h,f,d,s]);return K.createElement(V.Provider,{value:D},t)}const Se=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return q(n,r,s).indexOf(t)},Ae=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:a,newIndex:o,previousItems:c,previousContainerId:f,transition:u}=e;return!u||!r||c!==a&&s===o?!1:n?!0:o!==s&&t===f},Te={duration:200,easing:"ease"},J="transform",Ee=Y.Transition.toString({property:J,duration:0,easing:"linear"}),Ne={roleDescription:"sortable"};function Oe(e){let{disabled:t,index:n,node:r,rect:s}=e;const[a,o]=v.useState(null),c=v.useRef(n);return U(()=>{if(!t&&n!==c.current&&r.current){const f=s.current;if(f){const u=he(r.current,{ignoreTransform:!0}),i={x:f.left-u.left,y:f.top-u.top,scaleX:f.width/u.width,scaleY:f.height/u.height};(i.x||i.y)&&o(i)}}n!==c.current&&(c.current=n)},[t,n,r,s]),v.useEffect(()=>{a&&o(null)},[a]),a}function je(e){let{animateLayoutChanges:t=Ae,attributes:n,disabled:r,data:s,getNewIndex:a=Se,id:o,strategy:c,resizeObserverConfig:f,transition:u=Te}=e;const{items:i,containerId:l,activeIndex:d,disabled:g,disableTransforms:R,sortedRects:C,overIndex:h,useDragOverlay:w,strategy:x}=v.useContext(V),m=Le(r,g),b=i.indexOf(o),D=v.useMemo(()=>({sortable:{containerId:l,index:b,items:i},...s}),[l,s,b,i]),I=v.useMemo(()=>i.slice(i.indexOf(o)),[i,o]),{rect:N,node:z,isOver:W,setNodeRef:P}=ge({id:o,data:D,disabled:m.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...f}}),{active:T,activatorEvent:Z,activeNodeRect:ee,attributes:te,setNodeRef:X,listeners:re,isDragging:M,over:ne,setActivatorNodeRef:se,transform:oe}=pe({id:o,data:D,attributes:{...Ne,...n},disabled:m.draggable}),ae=be(P,X),S=!!T,_=S&&!R&&O(d)&&O(h),j=!w&&M,F=j&&_?oe:null,ie=_?F??(c??x)({rects:C,activeNodeRect:ee,activeIndex:d,overIndex:h,index:b}):null,E=O(d)&&O(h)?a({id:o,items:i,activeIndex:d,overIndex:h}):b,A=T?.id,p=v.useRef({activeId:A,items:i,newIndex:E,containerId:l}),ce=i!==p.current.items,G=t({active:T,containerId:l,isDragging:M,isSorting:S,id:o,index:b,items:i,newIndex:p.current.newIndex,previousItems:p.current.items,previousContainerId:p.current.containerId,transition:u,wasDragging:p.current.activeId!=null}),$=Oe({disabled:!G,index:b,node:z,rect:N});return v.useEffect(()=>{S&&p.current.newIndex!==E&&(p.current.newIndex=E),l!==p.current.containerId&&(p.current.containerId=l),i!==p.current.items&&(p.current.items=i)},[S,E,l,i]),v.useEffect(()=>{if(A===p.current.activeId)return;if(A!=null&&p.current.activeId==null){p.current.activeId=A;return}const ue=setTimeout(()=>{p.current.activeId=A},50);return()=>clearTimeout(ue)},[A]),{active:T,activeIndex:d,attributes:te,data:D,rect:N,index:b,newIndex:E,items:i,isOver:W,isSorting:S,isDragging:M,listeners:re,node:z,overIndex:h,over:ne,setNodeRef:ae,setActivatorNodeRef:se,setDroppableNodeRef:P,setDraggableNodeRef:X,transform:$??ie,transition:le()};function le(){if($||ce&&p.current.newIndex===b)return Ee;if(!(j&&!ve(Z)||!u)&&(S||G))return Y.Transition.toString({...u,property:J})}}function Le(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function k(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const ke=[y.Down,y.Right,y.Up,y.Left],Fe=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:a,over:o,scrollableAncestors:c}}=t;if(ke.includes(e.code)){if(e.preventDefault(),!n||!r)return;const f=[];a.getEnabled().forEach(l=>{if(!l||l!=null&&l.disabled)return;const d=s.get(l.id);if(d)switch(e.code){case y.Down:r.top<d.top&&f.push(l);break;case y.Up:r.top>d.top&&f.push(l);break;case y.Left:r.left>d.left&&f.push(l);break;case y.Right:r.left<d.left&&f.push(l);break}});const u=me({collisionRect:r,droppableRects:s,droppableContainers:f});let i=xe(u,"id");if(i===o?.id&&u.length>1&&(i=u[1].id),i!=null){const l=a.get(n.id),d=a.get(i),g=d?s.get(d.id):null,R=d?.node.current;if(R&&g&&l&&d){const h=Ie(R).some((I,N)=>c[N]!==I),w=Q(l,d),x=Me(l,d),m=h||!w?{x:0,y:0}:{x:x?r.width-g.width:0,y:x?r.height-g.height:0},b={x:g.left,y:g.top};return m.x&&m.y?b:ye(b,m)}}}};function Q(e,t){return!k(e)||!k(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Me(e,t){return!k(e)||!k(t)||!Q(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}export{_e as S,q as a,B as r,Fe as s,je as u,Xe as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as B,a2 as L,r as v,j as e,n as x,fM as k,ew as y,ex as E,ey as a,gb as D,B as u,I as d,y as C,t as c,c as z}from"./index-
|
|
1
|
+
import{b as B,a2 as L,r as v,j as e,n as x,fM as k,ew as y,ex as E,ey as a,gb as D,B as u,I as d,y as C,t as c,c as z}from"./index-D2MFYEzD.js";import{D as T}from"./domain-settings-USbT8NUs.js";import{f as O,e as R,b as F,A as M,d as q,c as U,g as $}from"./alert-dialog-KKnJELoX.js";import{S as H}from"./switch-CESJ2RZK.js";import{a as G,b as J,c as K,d as Q}from"./use-org-sso-D5M4Sxwu.js";import{s as V}from"./Trash01-TPK4gSsp.js";import{R as W}from"./require-capability-ChTCz2WH.js";import"./badge-DmeqGssZ.js";import"./select-C9_0SSgH.js";import"./index-BdQq_4o_.js";import"./index-CXWqnDP7.js";import"./ChevronUp-DiTVmUiH.js";import"./access-gate-p2OBWc28.js";import"./capability-load-error-CDC4LjDf.js";function X(){const s=B(),{org:o}=L(),{data:h,isLoading:I}=G(o.id,o.slug),f=J(o.id,o.slug),S=K(o.id,o.slug),b=Q(o.id,o.slug),[i,l]=v.useState({issuer:"",clientId:"",clientSecret:"",discoveryEndpoint:"",domain:"",scopes:"openid email profile"}),[g,p]=v.useState(!1),[P,j]=v.useState(!1),m=h?.configured&&h.config,n=h?.config,w=()=>{n&&l({issuer:n.issuer,clientId:n.clientId,clientSecret:"",discoveryEndpoint:n.discoveryEndpoint??"",domain:n.domain,scopes:n.scopes.join(" ")}),p(!0)},_=async()=>{if(!i.issuer||!i.clientId||!i.domain){c.error(s("settings.orgSso.requiredFieldsError"));return}if(!m&&!i.clientSecret){c.error(s("settings.orgSso.clientSecretRequiredError"));return}try{await f.mutateAsync({issuer:i.issuer,clientId:i.clientId,clientSecret:i.clientSecret,discoveryEndpoint:i.discoveryEndpoint||void 0,scopes:i.scopes.split(/\s+/).filter(Boolean),domain:i.domain,enforced:n?.enforced??!1}),C(m?"sso_config_updated":"sso_configured",{organization_id:o.id,email_domain:i.domain}),c.success(s("settings.orgSso.configurationSavedSuccess")),p(!1)}catch(t){c.error(t instanceof Error?t.message:s("settings.orgSso.saveSsoConfigError"))}},A=async()=>{try{await S.mutateAsync(),C("sso_config_removed",{organization_id:o.id}),c.success(s("settings.orgSso.configurationRemovedSuccess")),p(!1),j(!1)}catch{c.error(s("settings.orgSso.removeSsoConfigError"))}},N=async t=>{try{await b.mutateAsync(t),C("sso_enforcement_toggled",{organization_id:o.id,enforced:t}),c.success(s(t?"settings.orgSso.enforcementEnabledSuccess":"settings.orgSso.enforcementDisabledSuccess"))}catch{c.error(s("settings.orgSso.toggleEnforcementError"))}};return e.jsxs(x,{children:[e.jsx(x.Content,{children:e.jsx(x.Container,{children:e.jsxs(k,{children:[e.jsx(x.Title,{children:s("settings.orgSso.securityTitle")}),e.jsx(T,{}),I?e.jsx("div",{className:"text-sm text-muted-foreground",children:s("settings.orgSso.loading")}):e.jsxs(e.Fragment,{children:[m&&!g&&e.jsx(y,{title:s("settings.orgSso.sectionTitle"),children:e.jsxs(E,{children:[e.jsx(a,{title:s("settings.orgSso.providerLabel"),action:e.jsx("span",{className:"font-medium",children:n.issuer})}),e.jsx(a,{title:s("settings.orgSso.clientIdLabel"),action:e.jsx("span",{className:"font-mono text-xs",children:n.clientId})}),e.jsx(a,{title:s("settings.orgSso.domainLabel"),action:e.jsx("span",{className:"font-medium",children:n.domain})}),e.jsx(a,{title:s("settings.orgSso.scopesLabel"),action:e.jsx("span",{className:"font-mono text-xs",children:n.scopes.join(" ")})}),e.jsx("div",{className:"h-px bg-border mx-5"}),e.jsx(a,{title:s("settings.orgSso.enforceSsoLabel"),description:s("settings.orgSso.enforceSsoDescription"),action:e.jsx(H,{checked:n.enforced,onCheckedChange:N,disabled:b.isPending})}),e.jsxs(D,{children:[e.jsxs(u,{variant:"ghost",size:"sm",onClick:()=>j(!0),disabled:S.isPending,className:"text-destructive hover:text-destructive mr-auto",children:[e.jsx(V,{size:14}),s("settings.orgSso.removeButton")]}),e.jsx(u,{variant:"outline",size:"sm",onClick:()=>{window.open(`/api/${o.slug}/sso/authorize`,"_blank")},children:s("settings.orgSso.testSsoButton")}),e.jsx(u,{variant:"outline",size:"sm",onClick:w,children:s("settings.orgSso.editConfigButton")})]})]})}),(!m||g)&&e.jsx(y,{title:s("settings.orgSso.sectionTitle"),children:e.jsxs(E,{children:[e.jsx(a,{title:s("settings.orgSso.issuerUrlLabel"),description:s("settings.orgSso.issuerUrlDescription"),action:e.jsx(d,{id:"sso-issuer",placeholder:s("settings.orgSso.issuerUrlPlaceholder"),value:i.issuer,onChange:t=>l(r=>({...r,issuer:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.clientIdLabel"),action:e.jsx(d,{id:"sso-client-id",placeholder:s("settings.orgSso.clientIdPlaceholder"),value:i.clientId,onChange:t=>l(r=>({...r,clientId:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.clientSecretLabel"),description:g&&m?s("settings.orgSso.clientSecretEditDescription"):void 0,action:e.jsx(d,{id:"sso-client-secret",type:"password",placeholder:s("settings.orgSso.clientSecretPlaceholder"),value:i.clientSecret,onChange:t=>l(r=>({...r,clientSecret:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.emailDomainLabel"),description:s("settings.orgSso.emailDomainDescription"),action:e.jsx(d,{id:"sso-domain",placeholder:s("settings.orgSso.emailDomainPlaceholder"),value:i.domain,onChange:t=>l(r=>({...r,domain:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.scopesLabel"),action:e.jsx(d,{id:"sso-scopes",placeholder:s("settings.orgSso.scopesPlaceholder"),value:i.scopes,onChange:t=>l(r=>({...r,scopes:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.discoveryEndpointLabel"),description:s("settings.orgSso.discoveryEndpointDescription"),action:e.jsx(d,{id:"sso-discovery",placeholder:s("settings.orgSso.discoveryEndpointPlaceholder"),value:i.discoveryEndpoint,onChange:t=>l(r=>({...r,discoveryEndpoint:t.target.value})),className:"w-[280px]"})}),e.jsxs(D,{children:[g&&e.jsx(u,{variant:"outline",size:"sm",onClick:()=>p(!1),children:s("settings.orgSso.cancelButton")}),e.jsx(u,{onClick:_,disabled:f.isPending,size:"sm",children:f.isPending?s("settings.orgSso.savingButton"):s(g?"settings.orgSso.updateButton":"settings.orgSso.configureSsoButton")})]})]})})]})]})})}),e.jsx(O,{open:P,onOpenChange:j,children:e.jsxs(R,{children:[e.jsx(F,{children:e.jsx(M,{children:s("settings.orgSso.removeConfirmation")})}),e.jsxs(q,{children:[e.jsx(U,{disabled:S.isPending,children:s("settings.orgSso.cancelButton")}),e.jsx($,{onClick:A,disabled:S.isPending,variant:"destructive",children:s("settings.orgSso.removeButton")})]})]})})]})}function me(){const s=z.c(1);let o;return s[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(W,{capability:"org:manage",area:"security",children:e.jsx(X,{})}),s[0]=o):o=s[0],o}export{me as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as Ye,n as ie,o as Qe,D as Ge,v as ze,w as Ze}from"./usage-stats-CKpL0uWf.js";import{r as p,eL as Je,eB as we,eM as et,eN as j,eO as te,j as I,b2 as tt,eP as nt,eQ as ne,eR as ot,eS as rt,eT as st,eU as it,eV as at,eW as lt,eX as Ce,eY as ct,c as X,R as ut,K as dt,eZ as ft,e_ as gt,e$ as mt,b as pt,l as vt,h as ht}from"./index-BeWb3VLq.js";import{g as bt,d as xt}from"./tool-namespace-DePiqr-m.js";import{A as yt}from"./agent-icon-CiKTiUdq.js";var Xn=Ye;var Rt=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],ae=Rt.join(","),Ie=typeof Element>"u",G=Ie?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,J=!Ie&&Element.prototype.getRootNode?function(n){var e;return n==null||(e=n.getRootNode)===null||e===void 0?void 0:e.call(n)}:function(n){return n?.ownerDocument},ee=function(e,t){var o;t===void 0&&(t=!0);var r=e==null||(o=e.getAttribute)===null||o===void 0?void 0:o.call(e,"inert"),s=r===""||r==="true",i=s||t&&e&&(typeof e.closest=="function"?e.closest("[inert]"):ee(e.parentNode));return i},St=function(e){var t,o=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return o===""||o==="true"},Et=function(e,t,o){if(ee(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ae));return t&&G.call(e,ae)&&r.unshift(e),r=r.filter(o),r},le=function(e,t,o){for(var r=[],s=Array.from(e);s.length;){var i=s.shift();if(!ee(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,c=le(l,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:i,candidates:c})}else{var d=G.call(i,ae);d&&o.filter(i)&&(t||!e.includes(i))&&r.push(i);var u=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),g=!ee(u,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(u&&g){var h=le(u===!0?i.children:u.children,!0,o);o.flatten?r.push.apply(r,h):r.push({scopeParent:i,candidates:h})}else s.unshift.apply(s,i.children)}}return r},Te=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Pe=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||St(e))&&!Te(e)?0:e.tabIndex},wt=function(e,t){var o=Pe(e);return o<0&&t&&!Te(e)?0:o},Ct=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ae=function(e){return e.tagName==="INPUT"},It=function(e){return Ae(e)&&e.type==="hidden"},Tt=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(o){return o.tagName==="SUMMARY"});return t},Pt=function(e,t){for(var o=0;o<e.length;o++)if(e[o].checked&&e[o].form===t)return e[o]},At=function(e){if(!e.name)return!0;var t=e.form||J(e),o=function(a){return t.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(e.name));else try{r=o(e.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Pt(r,e.form);return!s||s===e},Nt=function(e){return Ae(e)&&e.type==="radio"},Dt=function(e){return Nt(e)&&!At(e)},Mt=function(e){var t,o=e&&J(e),r=(t=o)===null||t===void 0?void 0:t.host,s=!1;if(o&&o!==e){var i,a,l;for(s=!!((i=r)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(r)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!s&&r;){var c,d,u;o=J(r),r=(c=o)===null||c===void 0?void 0:c.host,s=!!((d=r)!==null&&d!==void 0&&(u=d.ownerDocument)!==null&&u!==void 0&&u.contains(r))}}return s},ge=function(e){var t=e.getBoundingClientRect(),o=t.width,r=t.height;return o===0&&r===0},Ot=function(e,t){var o=t.displayCheck,r=t.getShadowRoot;if(o==="full-native"&&"checkVisibility"in e){var s=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(e).visibility==="hidden")return!0;var i=G.call(e,"details>summary:first-of-type"),a=i?e.parentElement:e;if(G.call(a,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var l=e;e;){var c=e.parentElement,d=J(e);if(c&&!c.shadowRoot&&r(c)===!0)return ge(e);e.assignedSlot?e=e.assignedSlot:!c&&d!==e.ownerDocument?e=d.host:e=c}e=l}if(Mt(e))return!e.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return ge(e);return!1},Ft=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var o=0;o<t.children.length;o++){var r=t.children.item(o);if(r.tagName==="LEGEND")return G.call(t,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},$t=function(e,t){return!(t.disabled||It(t)||Ot(t,e)||Tt(t)||Ft(t))},me=function(e,t){return!(Dt(t)||Pe(t)<0||!$t(e,t))},qt=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ne=function(e){var t=[],o=[];return e.forEach(function(r,s){var i=!!r.scopeParent,a=i?r.scopeParent:r,l=wt(a,i),c=i?Ne(r.candidates):a;l===0?i?t.push.apply(t,c):t.push(a):o.push({documentOrder:s,tabIndex:l,item:r,isScope:i,content:c})}),o.sort(Ct).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(t)},De=function(e,t){t=t||{};var o;return t.getShadowRoot?o=le([e],t.includeContainer,{filter:me.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:qt}):o=Et(e,t.includeContainer,me.bind(null,t)),Ne(o)};function _t(){return/apple/i.test(navigator.vendor)}const pe="data-floating-ui-focusable";function kt(n){let e=n.activeElement;for(;((t=e)==null||(t=t.shadowRoot)==null?void 0:t.activeElement)!=null;){var t;e=e.shadowRoot.activeElement}return e}function ce(n,e){if(!n||!e)return!1;const t=e.getRootNode==null?void 0:e.getRootNode();if(n.contains(e))return!0;if(t&&Je(t)){let o=e;for(;o;){if(n===o)return!0;o=o.parentNode||o.host}}return!1}function Q(n){return"composedPath"in n?n.composedPath()[0]:n.target}function oe(n,e){if(e==null)return!1;if("composedPath"in n)return n.composedPath().includes(e);const t=n;return t.target!=null&&e.contains(t.target)}function Lt(n){return n.matches("html,body")}function z(n){return n?.ownerDocument||document}function jt(n){return n?n.hasAttribute(pe)?n:n.querySelector("["+pe+"]")||n:null}function Z(n,e,t){return t===void 0&&(t=!0),n.filter(r=>{var s;return r.parentId===e&&(!t||((s=r.context)==null?void 0:s.open))}).flatMap(r=>[r,...Z(n,r.id,t)])}function Kt(n){return"nativeEvent"in n}var Bt=typeof document<"u",Ut=function(){},V=Bt?p.useLayoutEffect:Ut;const Vt={...we},Wt=Vt.useInsertionEffect,Xt=Wt||(n=>n());function W(n){const e=p.useRef(()=>{});return Xt(()=>{e.current=n}),p.useCallback(function(){for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return e.current==null?void 0:e.current(...o)},[])}const Me=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Oe(n,e){const t=De(n,Me()),o=t.length;if(o===0)return;const r=kt(z(n)),s=t.indexOf(r),i=s===-1?e===1?0:o-1:s+e;return t[i]}function Ht(n){return Oe(z(n).body,1)||n}function Yt(n){return Oe(z(n).body,-1)||n}function re(n,e){const t=e||n.currentTarget,o=n.relatedTarget;return!o||!ce(t,o)}function Qt(n){De(n,Me()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function ve(n){n.querySelectorAll("[data-tabindex]").forEach(t=>{const o=t.dataset.tabindex;delete t.dataset.tabindex,o?t.setAttribute("tabindex",o):t.removeAttribute("tabindex")})}const Gt="data-floating-ui-focusable",he="active",be="selected",zt={...we};let xe=!1,Zt=0;const ye=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Zt++;function Jt(){const[n,e]=p.useState(()=>xe?ye():void 0);return V(()=>{n==null&&e(ye())},[]),p.useEffect(()=>{xe=!0},[]),n}const en=zt.useId,ue=en||Jt;function tn(){const n=new Map;return{emit(e,t){var o;(o=n.get(e))==null||o.forEach(r=>r(t))},on(e,t){n.has(e)||n.set(e,new Set),n.get(e).add(t)},off(e,t){var o;(o=n.get(e))==null||o.delete(t)}}}const nn=p.createContext(null),on=p.createContext(null),Fe=()=>{var n;return((n=p.useContext(nn))==null?void 0:n.id)||null},$e=()=>p.useContext(on);function de(n){return"data-floating-ui-"+n}const rn={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Re=p.forwardRef(function(e,t){const[o,r]=p.useState();V(()=>{_t()&&r("button")},[]);const s={ref:t,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[de("focus-guard")]:"",style:rn};return I.jsx("span",{...e,...s})}),sn={clipPath:"inset(50%)",position:"fixed",top:0,left:0},qe=p.createContext(null),Se=de("portal");function an(n){n===void 0&&(n={});const{id:e,root:t}=n,o=ue(),r=cn(),[s,i]=p.useState(null),a=p.useRef(null);return V(()=>()=>{s?.remove(),queueMicrotask(()=>{a.current=null})},[s]),V(()=>{if(!o||a.current)return;const l=e?document.getElementById(e):null;if(!l)return;const c=document.createElement("div");c.id=o,c.setAttribute(Se,""),l.appendChild(c),a.current=c,i(c)},[e,o]),V(()=>{if(t===null||!o||a.current)return;let l=t||r?.portalNode;l&&!it(l)&&(l=l.current),l=l||document.body;let c=null;e&&(c=document.createElement("div"),c.id=e,l.appendChild(c));const d=document.createElement("div");d.id=o,d.setAttribute(Se,""),l=c||l,l.appendChild(d),a.current=d,i(d)},[e,t,o,r]),s}function ln(n){const{children:e,id:t,root:o,preserveTabOrder:r=!0}=n,s=an({id:t,root:o}),[i,a]=p.useState(null),l=p.useRef(null),c=p.useRef(null),d=p.useRef(null),u=p.useRef(null),g=i?.modal,h=i?.open,y=!!i&&!i.modal&&i.open&&r&&!!(o||s);return p.useEffect(()=>{if(!s||!r||g)return;function m(f){s&&re(f)&&(f.type==="focusin"?ve:Qt)(s)}return s.addEventListener("focusin",m,!0),s.addEventListener("focusout",m,!0),()=>{s.removeEventListener("focusin",m,!0),s.removeEventListener("focusout",m,!0)}},[s,r,g]),p.useEffect(()=>{s&&(h||ve(s))},[h,s]),I.jsxs(qe.Provider,{value:p.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:u,portalNode:s,setFocusManagerState:a}),[r,s]),children:[y&&s&&I.jsx(Re,{"data-type":"outside",ref:l,onFocus:m=>{if(re(m,s)){var f;(f=d.current)==null||f.focus()}else{const x=i?i.domReference:null,b=Yt(x);b?.focus()}}}),y&&s&&I.jsx("span",{"aria-owns":s.id,style:sn}),s&&tt.createPortal(e,s),y&&s&&I.jsx(Re,{"data-type":"outside",ref:c,onFocus:m=>{if(re(m,s)){var f;(f=u.current)==null||f.focus()}else{const x=i?i.domReference:null,b=Ht(x);b?.focus(),i?.closeOnFocusOut&&i?.onOpenChange(!1,m.nativeEvent,"focus-out")}}})]})}const cn=()=>p.useContext(qe),un={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},dn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ee=n=>{var e,t;return{escapeKey:typeof n=="boolean"?n:(e=n?.escapeKey)!=null?e:!1,outsidePress:typeof n=="boolean"?n:(t=n?.outsidePress)!=null?t:!0}};function fn(n,e){e===void 0&&(e={});const{open:t,onOpenChange:o,elements:r,dataRef:s}=n,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:d=!1,referencePressEvent:u="pointerdown",ancestorScroll:g=!1,bubbles:h,capture:y}=e,m=$e(),f=W(typeof l=="function"?l:()=>!1),x=typeof l=="function"?f:l,b=p.useRef(!1),{escapeKey:R,outsidePress:v}=Ee(h),{escapeKey:D,outsidePress:C}=Ee(y),O=p.useRef(!1),A=W(S=>{var E;if(!t||!i||!a||S.key!=="Escape"||O.current)return;const P=(E=s.current.floatingContext)==null?void 0:E.nodeId,M=m?Z(m.nodesRef.current,P):[];if(!R&&(S.stopPropagation(),M.length>0)){let w=!0;if(M.forEach(N=>{var $;if(($=N.context)!=null&&$.open&&!N.context.dataRef.current.__escapeKeyBubbles){w=!1;return}}),!w)return}o(!1,Kt(S)?S.nativeEvent:S,"escape-key")}),F=W(S=>{var E;const P=()=>{var M;A(S),(M=Q(S))==null||M.removeEventListener("keydown",P)};(E=Q(S))==null||E.addEventListener("keydown",P)}),T=W(S=>{var E;const P=s.current.insideReactTree;s.current.insideReactTree=!1;const M=b.current;if(b.current=!1,c==="click"&&M||P||typeof x=="function"&&!x(S))return;const w=Q(S),N="["+de("inert")+"]",$=z(r.floating).querySelectorAll(N);let L=j(w)?w:null;for(;L&&!ne(L);){const _=ot(L);if(ne(_)||!j(_))break;L=_}if($.length&&j(w)&&!Lt(w)&&!ce(w,r.floating)&&Array.from($).every(_=>!ce(L,_)))return;if(rt(w)&&K){const _=ne(w),B=st(w),Y=/auto|scroll/,Ke=_||Y.test(B.overflowX),Be=_||Y.test(B.overflowY),Ue=Ke&&w.clientWidth>0&&w.scrollWidth>w.clientWidth,Ve=Be&&w.clientHeight>0&&w.scrollHeight>w.clientHeight,We=B.direction==="rtl",Xe=Ve&&(We?S.offsetX<=w.offsetWidth-w.clientWidth:S.offsetX>w.clientWidth),He=Ue&&S.offsetY>w.clientHeight;if(Xe||He)return}const U=(E=s.current.floatingContext)==null?void 0:E.nodeId,H=m&&Z(m.nodesRef.current,U).some(_=>{var B;return oe(S,(B=_.context)==null?void 0:B.elements.floating)});if(oe(S,r.floating)||oe(S,r.domReference)||H)return;const fe=m?Z(m.nodesRef.current,U):[];if(fe.length>0){let _=!0;if(fe.forEach(B=>{var Y;if((Y=B.context)!=null&&Y.open&&!B.context.dataRef.current.__outsidePressBubbles){_=!1;return}}),!_)return}o(!1,S,"outside-press")}),q=W(S=>{var E;const P=()=>{var M;T(S),(M=Q(S))==null||M.removeEventListener(c,P)};(E=Q(S))==null||E.addEventListener(c,P)});p.useEffect(()=>{if(!t||!i)return;s.current.__escapeKeyBubbles=R,s.current.__outsidePressBubbles=v;let S=-1;function E($){o(!1,$,"ancestor-scroll")}function P(){window.clearTimeout(S),O.current=!0}function M(){S=window.setTimeout(()=>{O.current=!1},nt()?5:0)}const w=z(r.floating);a&&(w.addEventListener("keydown",D?F:A,D),w.addEventListener("compositionstart",P),w.addEventListener("compositionend",M)),x&&w.addEventListener(c,C?q:T,C);let N=[];return g&&(j(r.domReference)&&(N=te(r.domReference)),j(r.floating)&&(N=N.concat(te(r.floating))),!j(r.reference)&&r.reference&&r.reference.contextElement&&(N=N.concat(te(r.reference.contextElement)))),N=N.filter($=>{var L;return $!==((L=w.defaultView)==null?void 0:L.visualViewport)}),N.forEach($=>{$.addEventListener("scroll",E,{passive:!0})}),()=>{a&&(w.removeEventListener("keydown",D?F:A,D),w.removeEventListener("compositionstart",P),w.removeEventListener("compositionend",M)),x&&w.removeEventListener(c,C?q:T,C),N.forEach($=>{$.removeEventListener("scroll",E)}),window.clearTimeout(S)}},[s,r,a,x,c,t,o,g,i,R,v,A,D,F,T,C,q]),p.useEffect(()=>{s.current.insideReactTree=!1},[s,x,c]);const k=p.useMemo(()=>({onKeyDown:A,...d&&{[un[u]]:S=>{o(!1,S.nativeEvent,"reference-press")},...u!=="click"&&{onClick(S){o(!1,S.nativeEvent,"reference-press")}}}}),[A,o,d,u]),K=p.useMemo(()=>{function S(E){E.button===0&&(b.current=!0)}return{onKeyDown:A,onMouseDown:S,onMouseUp:S,[dn[c]]:()=>{s.current.insideReactTree=!0}}},[A,c,s]);return p.useMemo(()=>i?{reference:k,floating:K}:{},[i,k,K])}function gn(n){const{open:e=!1,onOpenChange:t,elements:o}=n,r=ue(),s=p.useRef({}),[i]=p.useState(()=>tn()),a=Fe()!=null,[l,c]=p.useState(o.reference),d=W((h,y,m)=>{s.current.openEvent=h?y:void 0,i.emit("openchange",{open:h,event:y,reason:m,nested:a}),t?.(h,y,m)}),u=p.useMemo(()=>({setPositionReference:c}),[]),g=p.useMemo(()=>({reference:l||o.reference||null,floating:o.floating||null,domReference:o.reference}),[l,o.reference,o.floating]);return p.useMemo(()=>({dataRef:s,open:e,onOpenChange:d,elements:g,events:i,floatingId:r,refs:u}),[e,d,g,i,r,u])}function mn(n){n===void 0&&(n={});const{nodeId:e}=n,t=gn({...n,elements:{reference:null,floating:null,...n.elements}}),o=n.rootContext||t,r=o.elements,[s,i]=p.useState(null),[a,l]=p.useState(null),d=r?.domReference||s,u=p.useRef(null),g=$e();V(()=>{d&&(u.current=d)},[d]);const h=et({...n,elements:{...r,...a&&{reference:a}}}),y=p.useCallback(R=>{const v=j(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;l(v),h.refs.setReference(v)},[h.refs]),m=p.useCallback(R=>{(j(R)||R===null)&&(u.current=R,i(R)),(j(h.refs.reference.current)||h.refs.reference.current===null||R!==null&&!j(R))&&h.refs.setReference(R)},[h.refs]),f=p.useMemo(()=>({...h.refs,setReference:m,setPositionReference:y,domReference:u}),[h.refs,m,y]),x=p.useMemo(()=>({...h.elements,domReference:d}),[h.elements,d]),b=p.useMemo(()=>({...h,...o,refs:f,elements:x,nodeId:e}),[h,f,x,e,o]);return V(()=>{o.dataRef.current.floatingContext=b;const R=g?.nodesRef.current.find(v=>v.id===e);R&&(R.context=b)}),p.useMemo(()=>({...h,context:b,refs:f,elements:x}),[h,f,x,b])}function se(n,e,t){const o=new Map,r=t==="item";let s=n;if(r&&n){const{[he]:i,[be]:a,...l}=n;s=l}return{...t==="floating"&&{tabIndex:-1,[Gt]:""},...s,...e.map(i=>{const a=i?i[t]:null;return typeof a=="function"?n?a(n):null:a}).concat(n).reduce((i,a)=>(a&&Object.entries(a).forEach(l=>{let[c,d]=l;if(!(r&&[he,be].includes(c)))if(c.indexOf("on")===0){if(o.has(c)||o.set(c,[]),typeof d=="function"){var u;(u=o.get(c))==null||u.push(d),i[c]=function(){for(var g,h=arguments.length,y=new Array(h),m=0;m<h;m++)y[m]=arguments[m];return(g=o.get(c))==null?void 0:g.map(f=>f(...y)).find(f=>f!==void 0)}}}else i[c]=d}),i),{})}}function pn(n){n===void 0&&(n=[]);const e=n.map(a=>a?.reference),t=n.map(a=>a?.floating),o=n.map(a=>a?.item),r=p.useCallback(a=>se(a,n,"reference"),e),s=p.useCallback(a=>se(a,n,"floating"),t),i=p.useCallback(a=>se(a,n,"item"),o);return p.useMemo(()=>({getReferenceProps:r,getFloatingProps:s,getItemProps:i}),[r,s,i])}const vn=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function hn(n,e){var t,o;e===void 0&&(e={});const{open:r,elements:s,floatingId:i}=n,{enabled:a=!0,role:l="dialog"}=e,c=ue(),d=((t=s.domReference)==null?void 0:t.id)||c,u=p.useMemo(()=>{var b;return((b=jt(s.floating))==null?void 0:b.id)||i},[s.floating,i]),g=(o=vn.get(l))!=null?o:l,y=Fe()!=null,m=p.useMemo(()=>g==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:r?u:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":g==="alertdialog"?"dialog":g,"aria-controls":r?u:void 0,...g==="listbox"&&{role:"combobox"},...g==="menu"&&{id:d},...g==="menu"&&y&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[g,u,y,r,d,l]),f=p.useMemo(()=>{const b={id:u,...g&&{role:g}};return g==="tooltip"||l==="label"?b:{...b,...g==="menu"&&{"aria-labelledby":d}}},[g,u,d,l]),x=p.useCallback(b=>{let{active:R,selected:v}=b;const D={role:"option",...R&&{id:u+"-fui-option"}};switch(l){case"select":case"combobox":return{...D,"aria-selected":v}}return{}},[u,l]);return p.useMemo(()=>a?{reference:m,floating:f,item:x}:{},[a,m,f,x])}function bn(n){var e;const{char:t,allowSpaces:o,allowToIncludeChar:r,allowedPrefixes:s,startOfLine:i,$position:a}=n,l=o&&!r,c=Ze(t),d=new RegExp(`\\s${c}$`),u=i?"^":"",g=r?"":c,h=l?new RegExp(`${u}${c}.*?(?=\\s${g}|$)`,"gm"):new RegExp(`${u}(?:^)?${c}[^\\s${g}]*`,"gm"),y=((e=a.nodeBefore)===null||e===void 0?void 0:e.isText)&&a.nodeBefore.text;if(!y)return null;const m=a.pos-y.length,f=Array.from(y.matchAll(h)).pop();if(!f||f.input===void 0||f.index===void 0)return null;const x=f.input.slice(Math.max(0,f.index-1),f.index),b=new RegExp(`^[${s?.join("")}\0]?$`).test(x);if(s!==null&&!b)return null;const R=m+f.index;let v=R+f[0].length;return l&&d.test(y.slice(v-1,v+1))&&(f[0]+=" ",v+=1),R<a.pos&&v>=a.pos?{range:{from:R,to:v},query:f[0].slice(t.length),text:f[0]}:null}function xn(n){return n.docChanged?n.steps.some(e=>{const t=e.slice;if(!t?.content)return!1;const o=t.content.textBetween(0,t.content.size,`
|
|
1
|
+
import{t as Ye,n as ie,o as Qe,D as Ge,v as ze,w as Ze}from"./usage-stats-CvT3PVJT.js";import{r as p,eL as Je,eB as we,eM as et,eN as j,eO as te,j as I,b2 as tt,eP as nt,eQ as ne,eR as ot,eS as rt,eT as st,eU as it,eV as at,eW as lt,eX as Ce,eY as ct,c as X,R as ut,K as dt,eZ as ft,e_ as gt,e$ as mt,b as pt,l as vt,h as ht}from"./index-D2MFYEzD.js";import{g as bt,d as xt}from"./tool-namespace-CMW8ZB5L.js";import{A as yt}from"./agent-icon-g2PIrjzs.js";var Xn=Ye;var Rt=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],ae=Rt.join(","),Ie=typeof Element>"u",G=Ie?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,J=!Ie&&Element.prototype.getRootNode?function(n){var e;return n==null||(e=n.getRootNode)===null||e===void 0?void 0:e.call(n)}:function(n){return n?.ownerDocument},ee=function(e,t){var o;t===void 0&&(t=!0);var r=e==null||(o=e.getAttribute)===null||o===void 0?void 0:o.call(e,"inert"),s=r===""||r==="true",i=s||t&&e&&(typeof e.closest=="function"?e.closest("[inert]"):ee(e.parentNode));return i},St=function(e){var t,o=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return o===""||o==="true"},Et=function(e,t,o){if(ee(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ae));return t&&G.call(e,ae)&&r.unshift(e),r=r.filter(o),r},le=function(e,t,o){for(var r=[],s=Array.from(e);s.length;){var i=s.shift();if(!ee(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,c=le(l,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:i,candidates:c})}else{var d=G.call(i,ae);d&&o.filter(i)&&(t||!e.includes(i))&&r.push(i);var u=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),g=!ee(u,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(u&&g){var h=le(u===!0?i.children:u.children,!0,o);o.flatten?r.push.apply(r,h):r.push({scopeParent:i,candidates:h})}else s.unshift.apply(s,i.children)}}return r},Te=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Pe=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||St(e))&&!Te(e)?0:e.tabIndex},wt=function(e,t){var o=Pe(e);return o<0&&t&&!Te(e)?0:o},Ct=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ae=function(e){return e.tagName==="INPUT"},It=function(e){return Ae(e)&&e.type==="hidden"},Tt=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(o){return o.tagName==="SUMMARY"});return t},Pt=function(e,t){for(var o=0;o<e.length;o++)if(e[o].checked&&e[o].form===t)return e[o]},At=function(e){if(!e.name)return!0;var t=e.form||J(e),o=function(a){return t.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(e.name));else try{r=o(e.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Pt(r,e.form);return!s||s===e},Nt=function(e){return Ae(e)&&e.type==="radio"},Dt=function(e){return Nt(e)&&!At(e)},Mt=function(e){var t,o=e&&J(e),r=(t=o)===null||t===void 0?void 0:t.host,s=!1;if(o&&o!==e){var i,a,l;for(s=!!((i=r)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(r)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!s&&r;){var c,d,u;o=J(r),r=(c=o)===null||c===void 0?void 0:c.host,s=!!((d=r)!==null&&d!==void 0&&(u=d.ownerDocument)!==null&&u!==void 0&&u.contains(r))}}return s},ge=function(e){var t=e.getBoundingClientRect(),o=t.width,r=t.height;return o===0&&r===0},Ot=function(e,t){var o=t.displayCheck,r=t.getShadowRoot;if(o==="full-native"&&"checkVisibility"in e){var s=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(e).visibility==="hidden")return!0;var i=G.call(e,"details>summary:first-of-type"),a=i?e.parentElement:e;if(G.call(a,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var l=e;e;){var c=e.parentElement,d=J(e);if(c&&!c.shadowRoot&&r(c)===!0)return ge(e);e.assignedSlot?e=e.assignedSlot:!c&&d!==e.ownerDocument?e=d.host:e=c}e=l}if(Mt(e))return!e.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return ge(e);return!1},Ft=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var o=0;o<t.children.length;o++){var r=t.children.item(o);if(r.tagName==="LEGEND")return G.call(t,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},$t=function(e,t){return!(t.disabled||It(t)||Ot(t,e)||Tt(t)||Ft(t))},me=function(e,t){return!(Dt(t)||Pe(t)<0||!$t(e,t))},qt=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ne=function(e){var t=[],o=[];return e.forEach(function(r,s){var i=!!r.scopeParent,a=i?r.scopeParent:r,l=wt(a,i),c=i?Ne(r.candidates):a;l===0?i?t.push.apply(t,c):t.push(a):o.push({documentOrder:s,tabIndex:l,item:r,isScope:i,content:c})}),o.sort(Ct).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(t)},De=function(e,t){t=t||{};var o;return t.getShadowRoot?o=le([e],t.includeContainer,{filter:me.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:qt}):o=Et(e,t.includeContainer,me.bind(null,t)),Ne(o)};function _t(){return/apple/i.test(navigator.vendor)}const pe="data-floating-ui-focusable";function kt(n){let e=n.activeElement;for(;((t=e)==null||(t=t.shadowRoot)==null?void 0:t.activeElement)!=null;){var t;e=e.shadowRoot.activeElement}return e}function ce(n,e){if(!n||!e)return!1;const t=e.getRootNode==null?void 0:e.getRootNode();if(n.contains(e))return!0;if(t&&Je(t)){let o=e;for(;o;){if(n===o)return!0;o=o.parentNode||o.host}}return!1}function Q(n){return"composedPath"in n?n.composedPath()[0]:n.target}function oe(n,e){if(e==null)return!1;if("composedPath"in n)return n.composedPath().includes(e);const t=n;return t.target!=null&&e.contains(t.target)}function Lt(n){return n.matches("html,body")}function z(n){return n?.ownerDocument||document}function jt(n){return n?n.hasAttribute(pe)?n:n.querySelector("["+pe+"]")||n:null}function Z(n,e,t){return t===void 0&&(t=!0),n.filter(r=>{var s;return r.parentId===e&&(!t||((s=r.context)==null?void 0:s.open))}).flatMap(r=>[r,...Z(n,r.id,t)])}function Kt(n){return"nativeEvent"in n}var Bt=typeof document<"u",Ut=function(){},V=Bt?p.useLayoutEffect:Ut;const Vt={...we},Wt=Vt.useInsertionEffect,Xt=Wt||(n=>n());function W(n){const e=p.useRef(()=>{});return Xt(()=>{e.current=n}),p.useCallback(function(){for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return e.current==null?void 0:e.current(...o)},[])}const Me=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Oe(n,e){const t=De(n,Me()),o=t.length;if(o===0)return;const r=kt(z(n)),s=t.indexOf(r),i=s===-1?e===1?0:o-1:s+e;return t[i]}function Ht(n){return Oe(z(n).body,1)||n}function Yt(n){return Oe(z(n).body,-1)||n}function re(n,e){const t=e||n.currentTarget,o=n.relatedTarget;return!o||!ce(t,o)}function Qt(n){De(n,Me()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function ve(n){n.querySelectorAll("[data-tabindex]").forEach(t=>{const o=t.dataset.tabindex;delete t.dataset.tabindex,o?t.setAttribute("tabindex",o):t.removeAttribute("tabindex")})}const Gt="data-floating-ui-focusable",he="active",be="selected",zt={...we};let xe=!1,Zt=0;const ye=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Zt++;function Jt(){const[n,e]=p.useState(()=>xe?ye():void 0);return V(()=>{n==null&&e(ye())},[]),p.useEffect(()=>{xe=!0},[]),n}const en=zt.useId,ue=en||Jt;function tn(){const n=new Map;return{emit(e,t){var o;(o=n.get(e))==null||o.forEach(r=>r(t))},on(e,t){n.has(e)||n.set(e,new Set),n.get(e).add(t)},off(e,t){var o;(o=n.get(e))==null||o.delete(t)}}}const nn=p.createContext(null),on=p.createContext(null),Fe=()=>{var n;return((n=p.useContext(nn))==null?void 0:n.id)||null},$e=()=>p.useContext(on);function de(n){return"data-floating-ui-"+n}const rn={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Re=p.forwardRef(function(e,t){const[o,r]=p.useState();V(()=>{_t()&&r("button")},[]);const s={ref:t,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[de("focus-guard")]:"",style:rn};return I.jsx("span",{...e,...s})}),sn={clipPath:"inset(50%)",position:"fixed",top:0,left:0},qe=p.createContext(null),Se=de("portal");function an(n){n===void 0&&(n={});const{id:e,root:t}=n,o=ue(),r=cn(),[s,i]=p.useState(null),a=p.useRef(null);return V(()=>()=>{s?.remove(),queueMicrotask(()=>{a.current=null})},[s]),V(()=>{if(!o||a.current)return;const l=e?document.getElementById(e):null;if(!l)return;const c=document.createElement("div");c.id=o,c.setAttribute(Se,""),l.appendChild(c),a.current=c,i(c)},[e,o]),V(()=>{if(t===null||!o||a.current)return;let l=t||r?.portalNode;l&&!it(l)&&(l=l.current),l=l||document.body;let c=null;e&&(c=document.createElement("div"),c.id=e,l.appendChild(c));const d=document.createElement("div");d.id=o,d.setAttribute(Se,""),l=c||l,l.appendChild(d),a.current=d,i(d)},[e,t,o,r]),s}function ln(n){const{children:e,id:t,root:o,preserveTabOrder:r=!0}=n,s=an({id:t,root:o}),[i,a]=p.useState(null),l=p.useRef(null),c=p.useRef(null),d=p.useRef(null),u=p.useRef(null),g=i?.modal,h=i?.open,y=!!i&&!i.modal&&i.open&&r&&!!(o||s);return p.useEffect(()=>{if(!s||!r||g)return;function m(f){s&&re(f)&&(f.type==="focusin"?ve:Qt)(s)}return s.addEventListener("focusin",m,!0),s.addEventListener("focusout",m,!0),()=>{s.removeEventListener("focusin",m,!0),s.removeEventListener("focusout",m,!0)}},[s,r,g]),p.useEffect(()=>{s&&(h||ve(s))},[h,s]),I.jsxs(qe.Provider,{value:p.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:u,portalNode:s,setFocusManagerState:a}),[r,s]),children:[y&&s&&I.jsx(Re,{"data-type":"outside",ref:l,onFocus:m=>{if(re(m,s)){var f;(f=d.current)==null||f.focus()}else{const x=i?i.domReference:null,b=Yt(x);b?.focus()}}}),y&&s&&I.jsx("span",{"aria-owns":s.id,style:sn}),s&&tt.createPortal(e,s),y&&s&&I.jsx(Re,{"data-type":"outside",ref:c,onFocus:m=>{if(re(m,s)){var f;(f=u.current)==null||f.focus()}else{const x=i?i.domReference:null,b=Ht(x);b?.focus(),i?.closeOnFocusOut&&i?.onOpenChange(!1,m.nativeEvent,"focus-out")}}})]})}const cn=()=>p.useContext(qe),un={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},dn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ee=n=>{var e,t;return{escapeKey:typeof n=="boolean"?n:(e=n?.escapeKey)!=null?e:!1,outsidePress:typeof n=="boolean"?n:(t=n?.outsidePress)!=null?t:!0}};function fn(n,e){e===void 0&&(e={});const{open:t,onOpenChange:o,elements:r,dataRef:s}=n,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:d=!1,referencePressEvent:u="pointerdown",ancestorScroll:g=!1,bubbles:h,capture:y}=e,m=$e(),f=W(typeof l=="function"?l:()=>!1),x=typeof l=="function"?f:l,b=p.useRef(!1),{escapeKey:R,outsidePress:v}=Ee(h),{escapeKey:D,outsidePress:C}=Ee(y),O=p.useRef(!1),A=W(S=>{var E;if(!t||!i||!a||S.key!=="Escape"||O.current)return;const P=(E=s.current.floatingContext)==null?void 0:E.nodeId,M=m?Z(m.nodesRef.current,P):[];if(!R&&(S.stopPropagation(),M.length>0)){let w=!0;if(M.forEach(N=>{var $;if(($=N.context)!=null&&$.open&&!N.context.dataRef.current.__escapeKeyBubbles){w=!1;return}}),!w)return}o(!1,Kt(S)?S.nativeEvent:S,"escape-key")}),F=W(S=>{var E;const P=()=>{var M;A(S),(M=Q(S))==null||M.removeEventListener("keydown",P)};(E=Q(S))==null||E.addEventListener("keydown",P)}),T=W(S=>{var E;const P=s.current.insideReactTree;s.current.insideReactTree=!1;const M=b.current;if(b.current=!1,c==="click"&&M||P||typeof x=="function"&&!x(S))return;const w=Q(S),N="["+de("inert")+"]",$=z(r.floating).querySelectorAll(N);let L=j(w)?w:null;for(;L&&!ne(L);){const _=ot(L);if(ne(_)||!j(_))break;L=_}if($.length&&j(w)&&!Lt(w)&&!ce(w,r.floating)&&Array.from($).every(_=>!ce(L,_)))return;if(rt(w)&&K){const _=ne(w),B=st(w),Y=/auto|scroll/,Ke=_||Y.test(B.overflowX),Be=_||Y.test(B.overflowY),Ue=Ke&&w.clientWidth>0&&w.scrollWidth>w.clientWidth,Ve=Be&&w.clientHeight>0&&w.scrollHeight>w.clientHeight,We=B.direction==="rtl",Xe=Ve&&(We?S.offsetX<=w.offsetWidth-w.clientWidth:S.offsetX>w.clientWidth),He=Ue&&S.offsetY>w.clientHeight;if(Xe||He)return}const U=(E=s.current.floatingContext)==null?void 0:E.nodeId,H=m&&Z(m.nodesRef.current,U).some(_=>{var B;return oe(S,(B=_.context)==null?void 0:B.elements.floating)});if(oe(S,r.floating)||oe(S,r.domReference)||H)return;const fe=m?Z(m.nodesRef.current,U):[];if(fe.length>0){let _=!0;if(fe.forEach(B=>{var Y;if((Y=B.context)!=null&&Y.open&&!B.context.dataRef.current.__outsidePressBubbles){_=!1;return}}),!_)return}o(!1,S,"outside-press")}),q=W(S=>{var E;const P=()=>{var M;T(S),(M=Q(S))==null||M.removeEventListener(c,P)};(E=Q(S))==null||E.addEventListener(c,P)});p.useEffect(()=>{if(!t||!i)return;s.current.__escapeKeyBubbles=R,s.current.__outsidePressBubbles=v;let S=-1;function E($){o(!1,$,"ancestor-scroll")}function P(){window.clearTimeout(S),O.current=!0}function M(){S=window.setTimeout(()=>{O.current=!1},nt()?5:0)}const w=z(r.floating);a&&(w.addEventListener("keydown",D?F:A,D),w.addEventListener("compositionstart",P),w.addEventListener("compositionend",M)),x&&w.addEventListener(c,C?q:T,C);let N=[];return g&&(j(r.domReference)&&(N=te(r.domReference)),j(r.floating)&&(N=N.concat(te(r.floating))),!j(r.reference)&&r.reference&&r.reference.contextElement&&(N=N.concat(te(r.reference.contextElement)))),N=N.filter($=>{var L;return $!==((L=w.defaultView)==null?void 0:L.visualViewport)}),N.forEach($=>{$.addEventListener("scroll",E,{passive:!0})}),()=>{a&&(w.removeEventListener("keydown",D?F:A,D),w.removeEventListener("compositionstart",P),w.removeEventListener("compositionend",M)),x&&w.removeEventListener(c,C?q:T,C),N.forEach($=>{$.removeEventListener("scroll",E)}),window.clearTimeout(S)}},[s,r,a,x,c,t,o,g,i,R,v,A,D,F,T,C,q]),p.useEffect(()=>{s.current.insideReactTree=!1},[s,x,c]);const k=p.useMemo(()=>({onKeyDown:A,...d&&{[un[u]]:S=>{o(!1,S.nativeEvent,"reference-press")},...u!=="click"&&{onClick(S){o(!1,S.nativeEvent,"reference-press")}}}}),[A,o,d,u]),K=p.useMemo(()=>{function S(E){E.button===0&&(b.current=!0)}return{onKeyDown:A,onMouseDown:S,onMouseUp:S,[dn[c]]:()=>{s.current.insideReactTree=!0}}},[A,c,s]);return p.useMemo(()=>i?{reference:k,floating:K}:{},[i,k,K])}function gn(n){const{open:e=!1,onOpenChange:t,elements:o}=n,r=ue(),s=p.useRef({}),[i]=p.useState(()=>tn()),a=Fe()!=null,[l,c]=p.useState(o.reference),d=W((h,y,m)=>{s.current.openEvent=h?y:void 0,i.emit("openchange",{open:h,event:y,reason:m,nested:a}),t?.(h,y,m)}),u=p.useMemo(()=>({setPositionReference:c}),[]),g=p.useMemo(()=>({reference:l||o.reference||null,floating:o.floating||null,domReference:o.reference}),[l,o.reference,o.floating]);return p.useMemo(()=>({dataRef:s,open:e,onOpenChange:d,elements:g,events:i,floatingId:r,refs:u}),[e,d,g,i,r,u])}function mn(n){n===void 0&&(n={});const{nodeId:e}=n,t=gn({...n,elements:{reference:null,floating:null,...n.elements}}),o=n.rootContext||t,r=o.elements,[s,i]=p.useState(null),[a,l]=p.useState(null),d=r?.domReference||s,u=p.useRef(null),g=$e();V(()=>{d&&(u.current=d)},[d]);const h=et({...n,elements:{...r,...a&&{reference:a}}}),y=p.useCallback(R=>{const v=j(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;l(v),h.refs.setReference(v)},[h.refs]),m=p.useCallback(R=>{(j(R)||R===null)&&(u.current=R,i(R)),(j(h.refs.reference.current)||h.refs.reference.current===null||R!==null&&!j(R))&&h.refs.setReference(R)},[h.refs]),f=p.useMemo(()=>({...h.refs,setReference:m,setPositionReference:y,domReference:u}),[h.refs,m,y]),x=p.useMemo(()=>({...h.elements,domReference:d}),[h.elements,d]),b=p.useMemo(()=>({...h,...o,refs:f,elements:x,nodeId:e}),[h,f,x,e,o]);return V(()=>{o.dataRef.current.floatingContext=b;const R=g?.nodesRef.current.find(v=>v.id===e);R&&(R.context=b)}),p.useMemo(()=>({...h,context:b,refs:f,elements:x}),[h,f,x,b])}function se(n,e,t){const o=new Map,r=t==="item";let s=n;if(r&&n){const{[he]:i,[be]:a,...l}=n;s=l}return{...t==="floating"&&{tabIndex:-1,[Gt]:""},...s,...e.map(i=>{const a=i?i[t]:null;return typeof a=="function"?n?a(n):null:a}).concat(n).reduce((i,a)=>(a&&Object.entries(a).forEach(l=>{let[c,d]=l;if(!(r&&[he,be].includes(c)))if(c.indexOf("on")===0){if(o.has(c)||o.set(c,[]),typeof d=="function"){var u;(u=o.get(c))==null||u.push(d),i[c]=function(){for(var g,h=arguments.length,y=new Array(h),m=0;m<h;m++)y[m]=arguments[m];return(g=o.get(c))==null?void 0:g.map(f=>f(...y)).find(f=>f!==void 0)}}}else i[c]=d}),i),{})}}function pn(n){n===void 0&&(n=[]);const e=n.map(a=>a?.reference),t=n.map(a=>a?.floating),o=n.map(a=>a?.item),r=p.useCallback(a=>se(a,n,"reference"),e),s=p.useCallback(a=>se(a,n,"floating"),t),i=p.useCallback(a=>se(a,n,"item"),o);return p.useMemo(()=>({getReferenceProps:r,getFloatingProps:s,getItemProps:i}),[r,s,i])}const vn=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function hn(n,e){var t,o;e===void 0&&(e={});const{open:r,elements:s,floatingId:i}=n,{enabled:a=!0,role:l="dialog"}=e,c=ue(),d=((t=s.domReference)==null?void 0:t.id)||c,u=p.useMemo(()=>{var b;return((b=jt(s.floating))==null?void 0:b.id)||i},[s.floating,i]),g=(o=vn.get(l))!=null?o:l,y=Fe()!=null,m=p.useMemo(()=>g==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:r?u:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":g==="alertdialog"?"dialog":g,"aria-controls":r?u:void 0,...g==="listbox"&&{role:"combobox"},...g==="menu"&&{id:d},...g==="menu"&&y&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[g,u,y,r,d,l]),f=p.useMemo(()=>{const b={id:u,...g&&{role:g}};return g==="tooltip"||l==="label"?b:{...b,...g==="menu"&&{"aria-labelledby":d}}},[g,u,d,l]),x=p.useCallback(b=>{let{active:R,selected:v}=b;const D={role:"option",...R&&{id:u+"-fui-option"}};switch(l){case"select":case"combobox":return{...D,"aria-selected":v}}return{}},[u,l]);return p.useMemo(()=>a?{reference:m,floating:f,item:x}:{},[a,m,f,x])}function bn(n){var e;const{char:t,allowSpaces:o,allowToIncludeChar:r,allowedPrefixes:s,startOfLine:i,$position:a}=n,l=o&&!r,c=Ze(t),d=new RegExp(`\\s${c}$`),u=i?"^":"",g=r?"":c,h=l?new RegExp(`${u}${c}.*?(?=\\s${g}|$)`,"gm"):new RegExp(`${u}(?:^)?${c}[^\\s${g}]*`,"gm"),y=((e=a.nodeBefore)===null||e===void 0?void 0:e.isText)&&a.nodeBefore.text;if(!y)return null;const m=a.pos-y.length,f=Array.from(y.matchAll(h)).pop();if(!f||f.input===void 0||f.index===void 0)return null;const x=f.input.slice(Math.max(0,f.index-1),f.index),b=new RegExp(`^[${s?.join("")}\0]?$`).test(x);if(s!==null&&!b)return null;const R=m+f.index;let v=R+f[0].length;return l&&d.test(y.slice(v-1,v+1))&&(f[0]+=" ",v+=1),R<a.pos&&v>=a.pos?{range:{from:R,to:v},query:f[0].slice(t.length),text:f[0]}:null}function xn(n){return n.docChanged?n.steps.some(e=>{const t=e.slice;if(!t?.content)return!1;const o=t.content.textBetween(0,t.content.size,`
|
|
2
2
|
`);return/\s/.test(o)}):!1}function yn(n){return()=>{const e=n.state.selection.$anchor.pos,{top:t,right:o,bottom:r,left:s}=n.view.coordsAtPos(e);try{return new DOMRect(s,t,o-s,r-t)}catch{return null}}}function Rn(n,e,t,o){return t?()=>{const r=o.getState(n.state),s=r?.decorationId,i=e.dom.querySelector(`[data-decoration-id="${s}"]`);return i?.getBoundingClientRect()||null}:yn(n)}function Sn({match:n,dismissedRange:e,state:t,transaction:o,editor:r,shouldResetDismissed:s,effectiveAllowSpaces:i}){return s?.({editor:r,state:t,range:e,match:n,transaction:o,allowSpaces:i})?!1:i?n.range.from===e.from:n.range.from===e.from&&!xn(o)}function En({view:n,pluginKeyRef:e}){const t=n.state.tr.setMeta(e,{exit:!0});n.dispatch(t)}function wn({pluginKey:n,decorationTag:e,decorationClass:t,decorationContent:o,decorationEmptyClass:r,renderer:s,dispatchExit:i}){return{handleKeyDown(a,l){var c;const d=n.getState(a.state);if(!d.active)return!1;if(l.key==="Escape"||l.key==="Esc"){var u;return s==null||(u=s.onKeyDown)===null||u===void 0||u.call(s,{view:a,event:l,range:d.range}),i(a),!0}return(s==null||(c=s.onKeyDown)===null||c===void 0?void 0:c.call(s,{view:a,event:l,range:d.range}))||!1},decorations(a){const{active:l,range:c,decorationId:d,query:u}=n.getState(a);if(!l)return null;const g=!u?.length,h=[t];return g&&h.push(r),Ge.create(a.doc,[ze.inline(c.from,c.to,{nodeName:e,class:h.join(" "),"data-decoration-id":d||void 0,"data-decoration-content":o})])}}}function Cn({editor:n,char:e,effectiveAllowSpaces:t,allowToIncludeChar:o,allowedPrefixes:r,startOfLine:s,findSuggestionMatch:i,allow:a,shouldShow:l,shouldKeepDismissed:c,pluginKey:d}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(u,g,h,y){const{isEditable:m}=n,{composing:f}=n.view,{selection:x}=u,{empty:b,from:R}=x,v={...g},D=u.getMeta(d);if(D&&D.exit)return v.active=!1,v.decorationId=null,v.range={from:0,to:0},v.query=null,v.text=null,v.dismissedRange=g.active?{...g.range}:g.dismissedRange,v;if(v.composing=f,u.docChanged&&v.dismissedRange!==null&&(v.dismissedRange={from:u.mapping.map(v.dismissedRange.from),to:u.mapping.map(v.dismissedRange.to)}),m&&(b||n.view.composing)){(R<g.range.from||R>g.range.to)&&!f&&!g.composing&&(v.active=!1);const C=i({char:e,allowSpaces:t,allowToIncludeChar:o,allowedPrefixes:r,startOfLine:s,$position:x.$from}),O=`id_${Math.floor(Math.random()*4294967295)}`;C&&a({editor:n,state:y,range:C.range,isActive:g.active})&&(!l||l({editor:n,range:C.range,query:C.query,text:C.text,transaction:u}))?(v.dismissedRange!==null&&!c({match:C,dismissedRange:v.dismissedRange,state:y,transaction:u})&&(v.dismissedRange=null),v.dismissedRange===null?(v.active=!0,v.decorationId=g.decorationId||O,v.range=C.range,v.query=C.query,v.text=C.text):v.active=!1):(C||(v.dismissedRange=null),v.active=!1)}else v.active=!1;return v.active||(v.decorationId=null,v.range={from:0,to:0},v.query=null,v.text=null),v}}}function In({editor:n,items:e}){let t=null,o=null,r=null;const s=()=>{o!==null&&(clearTimeout(o),o=null),r?.(),r=null},i=c=>new Promise(d=>{r=d,o=setTimeout(()=>{o=null;const u=r;r=null,u?.()},c)}),a=()=>{t?.abort(),s(),t=null};return{abort:a,fetch:async(c,d)=>{a(),t=new AbortController;const u=t;if(d>0&&await i(d),t!==u||u.signal.aborted)return{status:"aborted"};try{const g=await e({editor:n,query:c,signal:u.signal});return t!==u||u.signal.aborted?{status:"aborted"}:{status:"resolved",items:g}}catch{return t!==u||u.signal.aborted?{status:"aborted"}:{status:"error"}}}}}function Tn({placement:n,offset:e,flip:t,floatingUi:o}){var r,s,i,a;const l=[at({mainAxis:(r=e.mainAxis)!==null&&r!==void 0?r:4,crossAxis:(s=e.crossAxis)!==null&&s!==void 0?s:0})];return t&&l.push(lt()),!(o==null||(i=o.middleware)===null||i===void 0)&&i.length&&l.push(...o.middleware),{placement:n,strategy:(a=o?.strategy)!==null&&a!==void 0?a:"absolute",middleware:l}}function Pn(n){if(n instanceof HTMLElement)return n;if(typeof n=="string")try{const e=document.querySelector(n);if(e)return e}catch{return document.body}return document.body}function An({getReferenceRect:n,contextElement:e,config:t,container:o,dismissOnOutsideClick:r,dismiss:s}){return(i,a={})=>{const l={getBoundingClientRect:()=>{var y;return(y=n())!==null&&y!==void 0?y:new DOMRect},contextElement:e};let c=!1;const d=!i.isConnected;d&&Pn(o).appendChild(i),a.onPosition||(i.style.visibility="hidden",i.style.width="max-content");const g=Ce(l,i,()=>{ct(l,i,{placement:t.placement,strategy:t.strategy,middleware:t.middleware}).then(({x:y,y:m,placement:f,strategy:x})=>{if(a.onPosition){a.onPosition({x:y,y:m,placement:f,strategy:x});return}Object.assign(i.style,{position:x,left:`${y}px`,top:`${m}px`}),c||(c=!0,i.style.visibility="")})},a.autoUpdate);let h;return r&&(h=y=>{const m=y.target;!(m instanceof Node)||i.contains(m)||e.contains(m)||s()},document.addEventListener("pointerdown",h,!0)),()=>{g(),h&&document.removeEventListener("pointerdown",h,!0),d&&i.remove()}}}function Nn({editor:n,pluginKey:e,items:t,renderer:o,minQueryLength:r,debounce:s,initialItems:i,placement:a,offset:l,container:c,flip:d,floatingUi:u,dismissOnOutsideClick:g,command:h,clientRectFor:y,dispatchExit:m}){let f;const x=In({editor:n,items:t}),b=Tn({placement:a,offset:l,flip:d,floatingUi:u});function R(v,D){switch(v){case"started":var C;o==null||(C=o.onStart)===null||C===void 0||C.call(o,D);break;case"updated":var O;o==null||(O=o.onUpdate)===null||O===void 0||O.call(o,D);break;case"stopped":var A;o==null||(A=o.onExit)===null||A===void 0||A.call(o,D)}}return{update:async(v,D)=>{var C,O;const A=e.getState(D),F=e.getState(v.state);if(!A||!F)return;let T=null;const q=A.query!==F.query,k=A.text!==F.text,K=A.range.from!==F.range.from||A.range.to!==F.range.to,S=q||k||K;if(!A.active&&F.active)T="started";else if(A.active&&!F.active)T="stopped";else if(F.active&&S)T="updated";else return;const E=T==="stopped"?A:F,P=v.dom.querySelector(`[data-decoration-id="${E.decorationId}"]`),M=y(v,P),w=r===0||(E.query?E.query.length>=r:!1),N=(T==="started"||T==="updated")&&w;if(f={editor:n,range:E.range,query:E.query||"",text:E.text||"",items:i??[],command:U=>h({editor:n,range:E.range,props:U}),decorationNode:P,clientRect:M,loading:N,placement:a,offset:{mainAxis:(C=l.mainAxis)!==null&&C!==void 0?C:4,crossAxis:(O=l.crossAxis)!==null&&O!==void 0?O:0},container:c,flip:d,floatingUi:b,mount:An({getReferenceRect:M,contextElement:v.dom,config:b,container:c,dismissOnOutsideClick:g,dismiss:()=>m(n.view)})},T==="started"){var $;o==null||($=o.onBeforeStart)===null||$===void 0||$.call(o,f)}if(T==="updated"){var L;o==null||(L=o.onBeforeUpdate)===null||L===void 0||L.call(o,f)}if(T==="started"&&R(T,f),T==="started"||T==="updated")if(!N)x.abort(),f={...f,items:i??[],loading:!1};else{f={...f,items:i??[],loading:!0},T="updated",R(T,f);const U=await x.fetch(E.query||"",s);if(U.status==="aborted")return;const H=e.getState(v.state);if(!H?.active){x.abort();return}f=U.status==="resolved"?{...f,items:U.items,loading:!1}:{...f,loading:!1}}if(T==="stopped"){x.abort(),R(T,f),f=void 0;return}T==="updated"&&R(T,f)},destroy:()=>{var v;x.abort(),f&&(o==null||(v=o.onExit)===null||v===void 0||v.call(o,f))}}}const _e=new ie("suggestion");function ke({pluginKey:n=_e,editor:e,char:t="@",allowSpaces:o=!1,allowToIncludeChar:r=!1,allowedPrefixes:s=[" "],startOfLine:i=!1,decorationTag:a="span",decorationClass:l="suggestion",decorationContent:c="",decorationEmptyClass:d="is-empty",command:u=()=>null,items:g=()=>[],minQueryLength:h=0,debounce:y=0,initialItems:m,placement:f="bottom-start",offset:x={},container:b,flip:R=!0,floatingUi:v,dismissOnOutsideClick:D=!0,render:C=()=>({}),allow:O=()=>!0,findSuggestionMatch:A=bn,shouldShow:F,shouldResetDismissed:T}){const q=C?.(),k=o&&!r,K=(P,M)=>Rn(e,P,M,n);function S(P){return Sn({...P,editor:e,shouldResetDismissed:T,effectiveAllowSpaces:k})}const E=P=>En({view:P,pluginKeyRef:n});return new Qe({key:n,view:()=>Nn({editor:e,pluginKey:n,items:g,renderer:q,minQueryLength:h,debounce:y,initialItems:m,placement:f,offset:x,container:b,flip:R,floatingUi:v,dismissOnOutsideClick:D,command:u,clientRectFor:K,dispatchExit:E}),state:Cn({editor:e,char:t,effectiveAllowSpaces:k,allowToIncludeChar:r,allowedPrefixes:s,startOfLine:i,findSuggestionMatch:A,allow:O,shouldShow:F,shouldKeepDismissed:S,pluginKey:n}),props:wn({pluginKey:n,decorationTag:a,decorationClass:l,decorationContent:c,decorationEmptyClass:d,renderer:q,dispatchExit:E})})}function Hn(n,e=_e){const t=n.state.tr.setMeta(e,{exit:!0});n.dispatch(t)}var Yn=ke;function Dn(n){const e=X.c(17),{editor:t,query:o,items:r,onSelect:s,onClose:i}=n,[a,l]=p.useState(0),c=p.useRef(r),d=p.useRef(a),u=p.useRef(s),g=p.useRef(i),h=p.useDeferredValue(o),[y,m]=p.useState(h);y!==h&&(m(h),l(0)),a>=r.length&&r.length>0&&l(0);let f,x;e[0]!==r?(f=()=>{c.current=r},x=[r],e[0]=r,e[1]=f,e[2]=x):(f=e[1],x=e[2]),p.useEffect(f,x);let b,R;e[3]!==a?(b=()=>{d.current=a},R=[a],e[3]=a,e[4]=b,e[5]=R):(b=e[4],R=e[5]),p.useEffect(b,R);let v,D;e[6]!==s?(v=()=>{u.current=s},D=[s],e[6]=s,e[7]=v,e[8]=D):(v=e[7],D=e[8]),p.useEffect(v,D);let C,O;e[9]!==i?(C=()=>{g.current=i},O=[i],e[9]=i,e[10]=C,e[11]=O):(C=e[10],O=e[11]),p.useEffect(C,O);let A,F;e[12]!==t?(F=()=>{if(t?.isDestroyed)return;let k;try{k=t.view.dom}catch{return}if(!k)return;const K=E=>{const P=c.current;if(!P.length)return!1;const M=()=>l(N=>(N+1)%P.length),w=()=>l(N=>(N-1+P.length)%P.length);switch(E.key){case"ArrowUp":return E.preventDefault(),w(),!0;case"ArrowDown":return E.preventDefault(),M(),!0;case"Tab":return E.preventDefault(),E.shiftKey?w():M(),!0;case"Home":return E.preventDefault(),l(0),!0;case"End":return E.preventDefault(),l(P.length-1),!0;case"Enter":{if(E.isComposing)return!1;E.preventDefault();const N=d.current;return N!==-1&&P[N]&&u.current?.(P[N],N),!0}case"Escape":return E.preventDefault(),g.current?.(),!0;default:return!1}},S=E=>{K(E)};return k.addEventListener("keydown",S,!0),()=>{k?.removeEventListener("keydown",S,!0)}},A=[t],e[12]=t,e[13]=A,e[14]=F):(A=e[13],F=e[14]),p.useEffect(F,A);const T=r.length?a:void 0;let q;return e[15]!==T?(q={selectedIndex:T,setSelectedIndex:l},e[15]=T,e[16]=q):q=e[16],q}function Mn(n,e){switch(e.type){case"SET_SELECTED_ITEM":return{...n,selectedItem:e.payload};case"ON_START":return{...n,open:!0,selectedItem:null,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_UPDATE":return{...n,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_EXIT":return{open:!1,element:null,query:"",range:null,selectedItem:null};default:return n}}const Le=p.createContext(void 0);function je(){const n=p.useContext(Le);if(!n)throw new Error("useSuggestionContext must be used within a SuggestionContext.Provider");return n}function On(n){const e=X.c(16),{editor:t,char:o,pluginKey:r,allow:s,onOpenChange:i}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={open:!1,element:null,query:"",range:null,selectedItem:null},e[0]=a):a=e[0];const[l,c]=p.useReducer(Mn,a);let d;e[1]!==i?(d=m=>{i?.(m)},e[1]=i,e[2]=d):d=e[2];const u=p.useEffectEvent(d);let g;e[3]!==o||e[4]!==s||e[5]!==t||e[6]!==u||e[7]!==r?(g=()=>{if(t?.isDestroyed)return;const m=r instanceof ie?r:new ie(r);t.state.plugins.find(b=>b.spec.key===m)&&t.unregisterPlugin(m);const x=ke({pluginKey:m,editor:t,char:o,allow(b){const R=t.state.doc.resolve(b.range.from);for(let v=R.depth;v>0;v--)if(R.node(v).type.name==="image")return!1;return!(s&&!s(b))},command(){},render:()=>({onStart:b=>{c({type:"ON_START",payload:{element:b.decorationNode??null,query:b.query,range:b.range}}),u(!0)},onUpdate:b=>{c({type:"ON_UPDATE",payload:{element:b.decorationNode??null,query:b.query,range:b.range}})},onKeyDown:b=>b.event.key==="Escape"?(c({type:"ON_EXIT"}),!0):!1,onExit:()=>{c({type:"ON_EXIT"}),u(!1)}}),items:Fn});return t.registerPlugin(x),()=>{t?.isDestroyed||t.unregisterPlugin(m)}},e[3]=o,e[4]=s,e[5]=t,e[6]=u,e[7]=r,e[8]=g):g=e[8];let h;e[9]!==o||e[10]!==s||e[11]!==t||e[12]!==r?(h=[t,r,o,c,s],e[9]=o,e[10]=s,e[11]=t,e[12]=r,e[13]=h):h=e[13],p.useEffect(g,h);let y;return e[14]!==l?(y={state:l,dispatch:c},e[14]=l,e[15]=y):y=e[15],y}function Fn(){return[]}function $n({editor:n,queryKey:e,queryFn:t,onSelect:o}){const{state:r,dispatch:s}=je(),i=p.useDeferredValue(r.query),{data:a}=ut({queryKey:dt.suggestionItems(e,r.open,i),queryFn:()=>r.open?t({query:i}):[]}),l=()=>{s({type:"ON_EXIT"})},c=async(u,g)=>{if(!(r.selectedItem!==null||!r.range)){s({type:"SET_SELECTED_ITEM",payload:u});try{const{view:h}=n,m=h.state.selection.$to.nodeAfter?.text?.startsWith(" "),f=r.range?{...r.range}:{from:0,to:0};m&&r.range&&(f.to+=1),await o({range:f,item:u})===!1?s({type:"SET_SELECTED_ITEM",payload:null}):l()}catch{l()}}},{selectedIndex:d}=Dn({editor:n,query:i,items:a,onSelect:c,onClose:l});return{selectedItem:r.selectedItem,items:a,selectedIndex:d,close:l,onSelect:c}}function qn({children:n}){const{state:e,dispatch:t}=je(),{open:o,element:r}=e,s=()=>{t({type:"ON_EXIT"})},{refs:i,floatingStyles:a,context:l}=mn({placement:"bottom-start",open:o,onOpenChange:g=>{g||s()},elements:{reference:r},middleware:[ft(10),gt(),mt()],whileElementsMounted:Ce}),c=fn(l,{outsidePress:g=>!(g.target instanceof Element&&g.target.closest(".ProseMirror"))}),d=hn(l,{role:"listbox"}),{getFloatingProps:u}=pn([c,d]);return o?I.jsx(ln,{children:I.jsx("div",{ref:i.setFloating,style:a,...u(),className:"z-50 w-auto min-w-[360px] max-w-[520px] rounded-lg border bg-popover p-0 text-popover-foreground shadow-soft outline-hidden overflow-hidden",children:n})}):null}const _n=n=>{const e=X.c(17),{item:t,isSelected:o,onSelect:r,isLoading:s,ref:i,renderItem:a}=n;let l;if(e[0]!==t){const x=bt(t._meta);l=t.title||xt(t.name,x),e[0]=t,e[1]=l}else l=e[1];const c=l,d=t.description||null,u=t.icon,g=o&&"bg-accent text-accent-foreground",h=s&&"pointer-events-none opacity-50";let y;e[2]!==g||e[3]!==h?(y=vt("relative flex w-full cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors","hover:bg-accent hover:text-accent-foreground","focus:bg-accent focus:text-accent-foreground",g,h),e[2]=g,e[3]=h,e[4]=y):y=e[4];let m;e[5]!==d||e[6]!==u||e[7]!==s||e[8]!==t||e[9]!==c||e[10]!==a?(m=a?a(t):I.jsxs(I.Fragment,{children:[u!==void 0&&I.jsx(yt,{icon:u,name:c,size:"xs",className:"mr-2"}),I.jsxs("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[I.jsxs("div",{className:"flex items-center justify-between gap-2",children:[I.jsx("span",{className:"font-medium flex items-center truncate capitalize",children:c}),s&&I.jsx(ht,{size:"xs"})]}),d&&I.jsx("div",{className:"text-xs text-muted-foreground line-clamp-1",children:d})]}),t.drillable&&I.jsx("kbd",{className:"shrink-0 ml-2 px-1.5 py-0.5 text-2xs font-medium text-muted-foreground bg-muted border border-border rounded",children:"↵"})]}),e[5]=d,e[6]=u,e[7]=s,e[8]=t,e[9]=c,e[10]=a,e[11]=m):m=e[11];let f;return e[12]!==r||e[13]!==i||e[14]!==y||e[15]!==m?(f=I.jsx("div",{ref:i,onClick:r,className:y,children:m}),e[12]=r,e[13]=i,e[14]=y,e[15]=m,e[16]=f):f=e[16],f},kn=n=>{const e=X.c(24),{editor:t,queryKey:o,queryFn:r,onSelect:s,renderItem:i,emptyLabel:a}=n,l=pt();let c;e[0]!==t||e[1]!==s||e[2]!==r||e[3]!==o?(c={editor:t,queryKey:o,queryFn:r,onSelect:s},e[0]=t,e[1]=s,e[2]=r,e[3]=o,e[4]=c):c=e[4];const{items:d,selectedIndex:u,onSelect:g,selectedItem:h}=$n(c);if(!d.length){let x;e[5]!==a||e[6]!==l?(x=a??l("chat.mention.noItemsFound"),e[5]=a,e[6]=l,e[7]=x):x=e[7];let b;return e[8]!==x?(b=I.jsx("div",{className:"min-w-[360px] max-w-[520px] bg-popover text-popover-foreground rounded-md border shadow-soft p-3 text-sm",children:x}),e[8]=x,e[9]=b):b=e[9],b}let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y={maxHeight:"min(320px, var(--radix-popover-content-available-height, 320px))"},e[10]=y):y=e[10];let m;if(e[11]!==g||e[12]!==d||e[13]!==i||e[14]!==u||e[15]!==h?.name){let x;e[17]!==g||e[18]!==i||e[19]!==u||e[20]!==h?.name?(x=(b,R)=>I.jsx(_n,{item:b,isSelected:R===u,ref:R===u?Kn:void 0,onSelect:()=>g(b,R),isLoading:h?.name===b.name,renderItem:i},`${b.kind??"item"}:${b.name}`),e[17]=g,e[18]=i,e[19]=u,e[20]=h?.name,e[21]=x):x=e[21],m=d.map(x),e[11]=g,e[12]=d,e[13]=i,e[14]=u,e[15]=h?.name,e[16]=m}else m=e[16];let f;return e[22]!==m?(f=I.jsx("div",{className:"min-w-[360px] max-w-[520px] bg-popover text-popover-foreground rounded-md overflow-y-auto",style:y,children:I.jsx("div",{className:"p-1",children:m})}),e[22]=m,e[23]=f):f=e[23],f};function Ln(){const n=X.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=I.jsx("div",{className:"p-1",children:[...Array(3)].map(jn)}),n[0]=e):e=n[0],e}function jn(n,e){return I.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 animate-pulse",children:[I.jsx("div",{className:"h-4 w-24 bg-muted rounded"}),I.jsx("div",{className:"h-3 w-32 bg-muted rounded"})]},e)}function Qn(n){const e=X.c(20),{editor:t,char:o,pluginKey:r,queryKey:s,queryFn:i,onSelect:a,allow:l,onOpenChange:c,renderItem:d,emptyLabel:u}=n;let g;e[0]!==l||e[1]!==o||e[2]!==t||e[3]!==c||e[4]!==r?(g={editor:t,char:o,pluginKey:r,allow:l,onOpenChange:c},e[0]=l,e[1]=o,e[2]=t,e[3]=c,e[4]=r,e[5]=g):g=e[5];const{state:h,dispatch:y}=On(g);let m;e[6]!==y||e[7]!==h?(m={state:h,dispatch:y},e[6]=y,e[7]=h,e[8]=m):m=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=I.jsx(Ln,{}),e[9]=f):f=e[9];let x;e[10]!==t||e[11]!==u||e[12]!==a||e[13]!==i||e[14]!==s||e[15]!==d?(x=I.jsx(qn,{children:I.jsx(p.Suspense,{fallback:f,children:I.jsx(kn,{editor:t,queryKey:s,queryFn:i,onSelect:a,renderItem:d,emptyLabel:u})})}),e[10]=t,e[11]=u,e[12]=a,e[13]=i,e[14]=s,e[15]=d,e[16]=x):x=e[16];let b;return e[17]!==m||e[18]!==x?(b=I.jsx(Le.Provider,{value:m,children:x}),e[17]=m,e[18]=x,e[19]=b):b=e[19],b}function Kn(n){n&&n.scrollIntoView({block:"center",behavior:"smooth"})}export{Qn as S,Yn as a,Hn as e,Xn as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,j as i,bC as C,bA as _,bx as B,bD as I,bI as M,bT as A,bP as H,c as z,l as g}from"./index-
|
|
1
|
+
import{r as c,j as i,bC as C,bA as _,bx as B,bD as I,bI as M,bT as A,bP as H,c as z,l as g}from"./index-D2MFYEzD.js";var m="Switch",[U]=H(m),[q,D]=U(m),y=c.forwardRef((o,e)=>{const{__scopeSwitch:t,name:s,checked:r,defaultChecked:n,required:a,disabled:d,value:u="on",onCheckedChange:w,form:l,...k}=o,[p,h]=c.useState(null),S=_(e,b=>h(b)),x=c.useRef(!1),v=p?l||!!p.closest("form"):!0,[f,N]=B({prop:r,defaultProp:n??!1,onChange:w,caller:m});return i.jsxs(q,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":a,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...k,ref:S,onClick:I(o.onClick,b=>{N(T=>!T),v&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})}),v&&i.jsx(R,{control:p,bubbles:!x.current,name:s,value:u,checked:f,required:a,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});y.displayName=m;var P="SwitchThumb",E=c.forwardRef((o,e)=>{const{__scopeSwitch:t,...s}=o,r=D(P,t);return i.jsx(C.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...s,ref:e})});E.displayName=P;var L="SwitchBubbleInput",R=c.forwardRef(({__scopeSwitch:o,control:e,checked:t,bubbles:s=!0,...r},n)=>{const a=c.useRef(null),d=_(a,n),u=M(t),w=A(e);return c.useEffect(()=>{const l=a.current;if(!l)return;const k=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(k,"checked").set;if(u!==t&&h){const S=new Event("click",{bubbles:s});h.call(l,t),l.dispatchEvent(S)}},[u,t,s]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...r,tabIndex:-1,ref:d,style:{...r.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});R.displayName=L;function j(o){return o?"checked":"unchecked"}var O=y,$=E;function W(o){const e=z.c(9);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-foreground/15 inline-flex h-[1.125rem] w-8 shrink-0 items-center rounded-full border-2 border-transparent transition-colors outline-none focus-ring disabled:opacity-50",t),e[3]=t,e[4]=r):r=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx($,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-3.5 rounded-full shadow-[0_0_0_1px_#0000000f] ring-0 transition-transform data-[state=checked]:translate-x-3.5 data-[state=unchecked]:translate-x-0")}),e[5]=n):n=e[5];let a;return e[6]!==s||e[7]!==r?(a=i.jsx(O,{"data-slot":"switch",className:r,...s,children:n}),e[6]=s,e[7]=r,e[8]=a):a=e[8],a}export{W as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ao as P,ap as m}from"./CategoricalChart-
|
|
1
|
+
import{ao as P,ap as m}from"./CategoricalChart-CinaMpxG.js";const w=Math.cos,f=Math.sin,c=Math.sqrt,y=Math.PI,h=2*y,v={draw(n,l){const o=c(l/y);n.moveTo(o,0),n.arc(0,0,o,0,h)}},I={draw(n,l){const o=c(l/5)/2;n.moveTo(-3*o,-o),n.lineTo(-o,-o),n.lineTo(-o,-3*o),n.lineTo(o,-3*o),n.lineTo(o,-o),n.lineTo(3*o,-o),n.lineTo(3*o,o),n.lineTo(o,o),n.lineTo(o,3*o),n.lineTo(-o,3*o),n.lineTo(-o,o),n.lineTo(-3*o,o),n.closePath()}},g=c(1/3),k=g*2,W={draw(n,l){const o=c(l/k),a=o*g;n.moveTo(0,-o),n.lineTo(a,0),n.lineTo(0,o),n.lineTo(-a,0),n.closePath()}},$={draw(n,l){const o=c(l),a=-o/2;n.rect(a,a,o,o)}},q=.8908130915292852,p=f(y/10)/f(7*y/10),M=f(h/10)*p,S=-w(h/10)*p,j={draw(n,l){const o=c(l*q),a=M*o,i=S*o;n.moveTo(0,-o),n.lineTo(a,i);for(let s=1;s<5;++s){const t=h*s/5,u=w(t),e=f(t);n.lineTo(e*o,-u*o),n.lineTo(u*a-e*i,e*a+u*i)}n.closePath()}},d=c(3),A={draw(n,l){const o=-c(l/(d*3));n.moveTo(0,o*2),n.lineTo(-d*o,-o),n.lineTo(d*o,-o),n.closePath()}},r=-.5,T=c(3)/2,b=1/c(12),C=(b/2+1)*3,B={draw(n,l){const o=c(l/C),a=o/2,i=o*b,s=a,t=o*b+o,u=-s,e=t;n.moveTo(a,i),n.lineTo(s,t),n.lineTo(u,e),n.lineTo(r*a-T*i,T*a+r*i),n.lineTo(r*s-T*t,T*s+r*t),n.lineTo(r*u-T*e,T*u+r*e),n.lineTo(r*a+T*i,r*i-T*a),n.lineTo(r*s+T*t,r*t-T*s),n.lineTo(r*u+T*e,r*e-T*u),n.closePath()}};function E(n,l){let o=null,a=P(i);n=typeof n=="function"?n:m(n||v),l=typeof l=="function"?l:m(l===void 0?64:+l);function i(){let s;if(o||(o=s=a()),n.apply(this,arguments).draw(o,+l.apply(this,arguments)),s)return o=null,s+""||null}return i.type=function(s){return arguments.length?(n=typeof s=="function"?s:m(s),i):n},i.size=function(s){return arguments.length?(l=typeof s=="function"?s:m(+s),i):l},i.context=function(s){return arguments.length?(o=s??null,i):o},i}export{E as S,A as a,j as b,$ as c,W as d,I as e,v as f,B as s};
|