decocms 4.63.3 → 4.64.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CqDLg4E0.js → AlertCircle-dr6ILuKf.js} +1 -1
- package/dist/client/assets/{AreaChart-fkEDVRVu.js → AreaChart-CaX5c9y0.js} +1 -1
- package/dist/client/assets/{ArrowUp-y4qiws93.js → ArrowUp-8So0Bq3Z.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-fu_iMwrL.js → ArrowUpRight-ZWne81mJ.js} +1 -1
- package/dist/client/assets/{Check-CQjJylK6.js → Check-C20qcvbJ.js} +1 -1
- package/dist/client/assets/{CheckCircle-Bk4jVW7c.js → CheckCircle-CuOPYcQA.js} +1 -1
- package/dist/client/assets/{ChevronDown-D0HdYvxS.js → ChevronDown-BnV5AXIG.js} +1 -1
- package/dist/client/assets/{ChevronRight-e9_7KV61.js → ChevronRight-Ci_JPJWU.js} +1 -1
- package/dist/client/assets/{ChevronUp-hFG8HdCY.js → ChevronUp-Da2eeqcc.js} +1 -1
- package/dist/client/assets/{Circle-C2Vu6xbB.js → Circle-DL23Wx_b.js} +1 -1
- package/dist/client/assets/{Copy01-B_L_kofR.js → Copy01-C24DhTWP.js} +1 -1
- package/dist/client/assets/{DotsVertical-D2l5wspb.js → DotsVertical-DFuruUkv.js} +1 -1
- package/dist/client/assets/{Eye-DqWJbQD8.js → Eye-VnEjOTzI.js} +1 -1
- package/dist/client/assets/{FilterLines-Cp18AAlg.js → FilterLines--THtbRwf.js} +1 -1
- package/dist/client/assets/{Globe01-BPH4QSYr.js → Globe01-BGV8Z3CQ.js} +1 -1
- package/dist/client/assets/{Globe04-BHPtBBwM.js → Globe04-DDRIYErK.js} +1 -1
- package/dist/client/assets/{HardDrive-BbOBIb1x.js → HardDrive-CpgdgtFw.js} +1 -1
- package/dist/client/assets/{Key01-MruRu6FB.js → Key01-SAoA6jAR.js} +1 -1
- package/dist/client/assets/{LayoutLeft-Btc5kA34.js → LayoutLeft-_kD5nnHP.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DaXyeXMC.js → LinkExternal01-t-RWmRo-.js} +1 -1
- package/dist/client/assets/{List-B9BMYMsL.js → List-axGlciVK.js} +1 -1
- package/dist/client/assets/{Monitor01-XhoZ48SW.js → Monitor01-DaPwaUZe.js} +1 -1
- package/dist/client/assets/{Package-D4FjGHlZ.js → Package-_DrjUOHQ.js} +1 -1
- package/dist/client/assets/{Palette-Qilg0lma.js → Palette-8ffm1RG8.js} +1 -1
- package/dist/client/assets/{Play-BinR83so.js → Play-CGn78rrg.js} +1 -1
- package/dist/client/assets/{Plus-DUEQJ6Dq.js → Plus-1xHXOv56.js} +1 -1
- package/dist/client/assets/{SearchLg-CFb4RdYX.js → SearchLg-DEDRam66.js} +1 -1
- package/dist/client/assets/{SearchMd-ClupCW3U.js → SearchMd-DcoXeZ0G.js} +1 -1
- package/dist/client/assets/{Settings02-CiDkLfc2.js → Settings02-jYwqxyPX.js} +1 -1
- package/dist/client/assets/{Shield01-DwhqGz1N.js → Shield01-BJY_C13I.js} +1 -1
- package/dist/client/assets/{Star01--k_y5js5.js → Star01-Be8dRYiI.js} +1 -1
- package/dist/client/assets/{Stars01-CUp5AWO9.js → Stars01-DWVSqNPI.js} +1 -1
- package/dist/client/assets/{Stars02-CjLOPFO-.js → Stars02-IVJ1KAw4.js} +1 -1
- package/dist/client/assets/{Sun-gdDoFC0z.js → Sun-CB3x04tX.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Cx70rbaz.js → SwitchHorizontal01-cmUUOrhq.js} +1 -1
- package/dist/client/assets/{Tool01-TTerLlhX.js → Tool01-B4m9Aj-8.js} +1 -1
- package/dist/client/assets/{Tool02-CuulG4Zm.js → Tool02-CriPVsQR.js} +1 -1
- package/dist/client/assets/{Trash01-D6a6rHm7.js → Trash01-EHy0oSME.js} +1 -1
- package/dist/client/assets/{Trash03-ApRuYZcp.js → Trash03-4nYQQS93.js} +1 -1
- package/dist/client/assets/{TrendUp01-vfQPSjAQ.js → TrendUp01-B_v3WyCd.js} +1 -1
- package/dist/client/assets/{Upload01-qHg-k01G.js → Upload01-CdIav2kQ.js} +1 -1
- package/dist/client/assets/{User01-Bh7a4wfo.js → User01-rmTK9V-t.js} +1 -1
- package/dist/client/assets/{Users01-BOa_T7-l.js → Users01-D3cEcNRL.js} +1 -1
- package/dist/client/assets/{Users03-CoBRlJkB.js → Users03-BIZ3MNsv.js} +1 -1
- package/dist/client/assets/{X-DyjfKbz8.js → X-DyoCFJZC.js} +1 -1
- package/dist/client/assets/{XCircle-C-sHcbib.js → XCircle-CJVa_Lit.js} +1 -1
- package/dist/client/assets/{XClose-hFrmy8Kh.js → XClose-DtNGa57c.js} +1 -1
- package/dist/client/assets/{Zap-C54DyH6J.js → Zap-CKyHL0Rr.js} +1 -1
- package/dist/client/assets/{ZapSquare-sm-ESnXi.js → ZapSquare-C-_Jmda6.js} +1 -1
- package/dist/client/assets/{ZoomOut-qGM7S5aC.js → ZoomOut-juftUA7n.js} +1 -1
- package/dist/client/assets/{access-gate-DU_TeSxf.js → access-gate-vyNhg-g-.js} +1 -1
- package/dist/client/assets/{add-section-modal-CdFF32EI.js → add-section-modal-0x_XcUff.js} +1 -1
- package/dist/client/assets/{agent-icon-Cn3pvSY1.js → agent-icon-CVEVKDp9.js} +1 -1
- package/dist/client/assets/{agents-list-CF4p5Rs9.js → agents-list-C2FvfhBd.js} +1 -1
- package/dist/client/assets/{ai-providers-BFICBoVk.js → ai-providers-H8Av-W_Y.js} +1 -1
- package/dist/client/assets/{alert-C7o1ddSa.js → alert-DV2ObbOZ.js} +1 -1
- package/dist/client/assets/{alert-dialog-qefhsonV.js → alert-dialog-ynqoq_zD.js} +1 -1
- package/dist/client/assets/{app-editor-C4DdN908.js → app-editor-CyYEZvBA.js} +1 -1
- package/dist/client/assets/{auth-Dz4ZnGBZ.js → auth-Cxv3qO74.js} +1 -1
- package/dist/client/assets/{auth-catchall-CWbMy765.js → auth-catchall-BDFxaAJz.js} +1 -1
- package/dist/client/assets/{auth-entry-CUEj8xR9.js → auth-entry-DmvTUGfz.js} +1 -1
- package/dist/client/assets/{auth-split-layout-ltcelxw4.js → auth-split-layout-D3uYBv7b.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-C5bv8dSc.js → authenticate-and-persist-oauth-B-ZBhEDu.js} +1 -1
- package/dist/client/assets/{automation-list-row-TWr0b03X.js → automation-list-row-BwaR4D3_.js} +1 -1
- package/dist/client/assets/{automation-runs-LgYaU7NT.js → automation-runs-DBYfjIwt.js} +1 -1
- package/dist/client/assets/{automations-CsAa80EW.js → automations-PBwWSMdr.js} +1 -1
- package/dist/client/assets/{autosend-nk4Rnt6q.js → autosend-BjNFEiKQ.js} +1 -1
- package/dist/client/assets/{avatar-Mvk4Pr6q.js → avatar-d5Fji5lR.js} +1 -1
- package/dist/client/assets/{badge-DPo5atq1.js → badge-w9muzbch.js} +1 -1
- package/dist/client/assets/{block-document-Dg30aQSW.js → block-document-BD3a2-FJ.js} +2 -2
- package/dist/client/assets/{brand-context-Dhg7U_V0.js → brand-context-DicQ2rNw.js} +1 -1
- package/dist/client/assets/{buckets-BEmUUHe9.js → buckets-kNR1_m6U.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-CycI-RhI.js → bulk-category-panel-Cg9PaKBV.js} +1 -1
- package/dist/client/assets/{calendar-BJlaa-tp.js → calendar-DBx8U-rn.js} +1 -1
- package/dist/client/assets/{capability-load-error-BJsCCDoC.js → capability-load-error-BgeIJtvX.js} +1 -1
- package/dist/client/assets/{card-CQ82z7ux.js → card-DhD3eH0l.js} +1 -1
- package/dist/client/assets/category-editor-CXY9JkyG.js +1 -0
- package/dist/client/assets/{chat-context-DWZk_XUk.js → chat-context-CmDafxo7.js} +1 -1
- package/dist/client/assets/{checkbox-Ci379OZ6.js → checkbox-BGxG-_W4.js} +1 -1
- package/dist/client/assets/{cli-auth-success-H2Mu-YzX.js → cli-auth-success-CzrjijBI.js} +1 -1
- package/dist/client/assets/{collection-detail-gbmXdfyo.js → collection-detail-CNZ89XDU.js} +1 -1
- package/dist/client/assets/{collection-display-button-BEL7jV2D.js → collection-display-button-xAH311aR.js} +1 -1
- package/dist/client/assets/{collection-search-zDpqz1Y6.js → collection-search-YR2RcNz5.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BwUeEiyV.js → collection-table-wrapper-CjPUk06q.js} +1 -1
- package/dist/client/assets/{collection-tabs-CpVhSZXL.js → collection-tabs-CJcVdpM8.js} +1 -1
- package/dist/client/assets/{command-D0oHu6yC.js → command-BAvfX7Is.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-DHHGk3Tu.js → commerce-onboarding-AZ93XbS6.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-kTPFYpDX.js → connect-desktop-dialog-D957Sp9T.js} +1 -1
- package/dist/client/assets/{connection-card-i6t_iiUW.js → connection-card-CaTKE99J.js} +1 -1
- package/dist/client/assets/{connection-detail-CYgpB80y.js → connection-detail-BMGRuWS3.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BHtBtUMl.js → connection-form-helpers-CGSHmzU6.js} +1 -1
- package/dist/client/assets/{connections-C2SOOxBy.js → connections-VSFQNqae.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-v_-kLso6.js → decopilot-sse-pool-DHwAJ7c-.js} +1 -1
- package/dist/client/assets/{dialog-df3kXkJ6.js → dialog-CkMBaOxP.js} +1 -1
- package/dist/client/assets/{domain-settings-D3lNyhbU.js → domain-settings-aA01iyFs.js} +1 -1
- package/dist/client/assets/{drawer-CDEnz8Vo.js → drawer-kA0uCnKS.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Bccvvqlu.js → dropdown-menu-BeYH-oH8.js} +1 -1
- package/dist/client/assets/{empty-state-BIk42_em.js → empty-state-DNC-9vac.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Ds-QcBxj.js → extract-connection-data-DgMBRlKf.js} +1 -1
- package/dist/client/assets/{file-explorer-BMPDp0P9.js → file-explorer-BdAGbOOd.js} +1 -1
- package/dist/client/assets/{file-type-icon-BA-Uo760.js → file-type-icon-CKCqz3Lk.js} +1 -1
- package/dist/client/assets/{files-N7PjuEfZ.js → files-DsRYF37h.js} +1 -1
- package/dist/client/assets/{form-Dn-2qr3X.js → form-C2_rR9E2.js} +1 -1
- package/dist/client/assets/{general-C_gTTNgW.js → general-CMxCLDqK.js} +1 -1
- package/dist/client/assets/{github-repo-picker-DO2Q3TKU.js → github-repo-picker-CazDUvnU.js} +1 -1
- package/dist/client/assets/{hooks-hF_71sFE.js → hooks-X5o4K0K4.js} +1 -1
- package/dist/client/assets/{index-3YUbhWxY.js → index-Bo6F3tTz.js} +1 -1
- package/dist/client/assets/{index-qJ1WxKPj.js → index-C1EvhcC4.js} +1 -1
- package/dist/client/assets/{index-B5nxmOre.js → index-CctjkHau.js} +1 -1
- package/dist/client/assets/{index-CPBEAxML.js → index-Cjm3iH4d.js} +28 -28
- package/dist/client/assets/{index-CjeRZZ8Z.js → index-CpSxMQLN.js} +1 -1
- package/dist/client/assets/{index-DeNFvz9A.js → index-D3RtBmpf.js} +1 -1
- package/dist/client/assets/{index-CvHdT8wM.js → index-D9d7Q7iM.js} +1 -1
- package/dist/client/assets/{index-DHeYoHcI.js → index-DGl7TlXL.js} +1 -1
- package/dist/client/assets/{index-DgXATCJ-.js → index-Dj0tk98b.js} +1 -1
- package/dist/client/assets/{index-Dm83E3iX.js → index-DzGwqsH6.js} +1 -1
- package/dist/client/assets/{index-BX44TYXY.js → index-HlYIpfaK.js} +1 -1
- package/dist/client/assets/{index-Bhm9Bs1H.js → index-R8Byrplo.js} +3 -3
- package/dist/client/assets/{index-cxmaQW5O.js → index-T7gNfO2S.js} +1 -1
- package/dist/client/assets/{index-redirect-Bt11ZHdI.js → index-redirect-2z4OXGur.js} +1 -1
- package/dist/client/assets/{index-D6hE8whu.js → index-ut1i6vfc.js} +1 -1
- package/dist/client/assets/{input-DospeWmi.js → input-CuETklW2.js} +1 -1
- package/dist/client/assets/{integration-icon-BGWuRbhS.js → integration-icon-gWmea2fK.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-GWLlNlTr.js → invite-member-dialog-2eWaLC3S.js} +1 -1
- package/dist/client/assets/{label-BosGIEt_.js → label-De4Gq62Z.js} +1 -1
- package/dist/client/assets/{layout-Cb7BN-pG.js → layout-CSwCvM_M.js} +1 -1
- package/dist/client/assets/{login-Dv68kU9z.js → login-CJDmzL8w.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BDrL0Lxz.js → mcp-oauth-BmlzekLr.js} +1 -1
- package/dist/client/assets/{members-u0ZQQe44.js → members-CLTDrIv4.js} +1 -1
- package/dist/client/assets/{monaco-editor-DUt2Vaks.js → monaco-editor-C1HwuGku.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BRmrkF2L.js → monitoring-stats-row-CRm8aaJd.js} +1 -1
- package/dist/client/assets/{oauth-callback-CPxVmlpn.js → oauth-callback-78vmNoZE.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-81UU3hp1.js → oauth-callback-ai-provider-DDueNZxf.js} +1 -1
- package/dist/client/assets/{onboarding-daOS8one.js → onboarding-0GF2LHlV.js} +1 -1
- package/dist/client/assets/{org-install-DfNkFZLw.js → org-install-aqkE4Jgj.js} +1 -1
- package/dist/client/assets/{org-layout-DZc1KUks.js → org-layout-CS7qkH1l.js} +1 -1
- package/dist/client/assets/{organization-choice-C2ERvF2i.js → organization-choice-Cc2bF-7d.js} +1 -1
- package/dist/client/assets/{orgs-BR051vSM.js → orgs-Dk0yYyeN.js} +1 -1
- package/dist/client/assets/{page-seo-form-CojnY8G_.js → page-seo-form-JpKtzPF0.js} +1 -1
- package/dist/client/assets/page-seo-sheet-DUYXc0VW.js +1 -0
- package/dist/client/assets/{popover-CqoWWaG4.js → popover-BTGVDLnm.js} +1 -1
- package/dist/client/assets/post-editor-70qqxpYm.js +1 -0
- package/dist/client/assets/{primitives-DLS11ccE.js → primitives-Ch4czy-w.js} +1 -1
- package/dist/client/assets/{profile-Dkf4Cr8c.js → profile-wkr728sO.js} +1 -1
- package/dist/client/assets/project-app-view-vmypRgGa.js +1 -0
- package/dist/client/assets/record-editor-DolHiAng.js +1 -0
- package/dist/client/assets/registry-BZMs9OSJ.js +2 -0
- package/dist/client/assets/{registry-layout-D80tOcFJ.js → registry-layout-DoFxkNFD.js} +1 -1
- package/dist/client/assets/{reports-CWqLneIh.js → reports-CimDNAnm.js} +1 -1
- package/dist/client/assets/{require-capability-Ct_Ojh8K.js → require-capability-DWNm-bJE.js} +1 -1
- package/dist/client/assets/{required-auth-layout-C_gORevl.js → required-auth-layout-sHyhCUnz.js} +1 -1
- package/dist/client/assets/{reset-password-DvcxKapF.js → reset-password-DqJJAPnX.js} +1 -1
- package/dist/client/assets/{roles-BKUN8edV.js → roles-0UAZr6JH.js} +1 -1
- package/dist/client/assets/{search-input-fh_pNTUU.js → search-input-Ds1ilB-d.js} +1 -1
- package/dist/client/assets/{secrets-ag6AC19e.js → secrets-BfnPVFEi.js} +1 -1
- package/dist/client/assets/sections-editor-CrRg74i6.js +2 -0
- package/dist/client/assets/{select-b1vNfzCY.js → select-CyqPGt-o.js} +1 -1
- package/dist/client/assets/{select-model-DdtZCC-h.js → select-model-b-kuUyj-.js} +1 -1
- package/dist/client/assets/self-tool-result-Bnpf0rwt.js +1 -0
- package/dist/client/assets/{seo-editor-CeADvhMm.js → seo-editor-4Ox3d5d1.js} +1 -1
- package/dist/client/assets/{settings-layout-pVc_DMvj.js → settings-layout-CbJnAH6a.js} +1 -1
- package/dist/client/assets/{settings-section-DmXhlL47.js → settings-section-Bapz1bFt.js} +1 -1
- package/dist/client/assets/{shell-controls-YiekLdtP.js → shell-controls-Dw_ImS9u.js} +1 -1
- package/dist/client/assets/{shell-layout-CXtvlsY5.js → shell-layout-Cs7WmdkA.js} +1 -1
- package/dist/client/assets/{sidebar-CVCJDFEY.js → sidebar-Dwsj9nV9.js} +1 -1
- package/dist/client/assets/{skeleton-B7bqRPfS.js → skeleton-C3owgioi.js} +1 -1
- package/dist/client/assets/{sso-CtB3sWb9.js → sso-ot-YhJ5P.js} +1 -1
- package/dist/client/assets/{store-Di7nhFnI.js → store-Da36LPs0.js} +1 -1
- package/dist/client/assets/store-registry-c7IV8QNo.js +2 -0
- package/dist/client/assets/{studio-tools-C158uWMN.js → studio-tools-VpZtc3x4.js} +1 -1
- package/dist/client/assets/{switch-jhzFDXbX.js → switch-yVX8OSgY.js} +1 -1
- package/dist/client/assets/{table-Cw-KhGHY.js → table-CYb-xXGy.js} +1 -1
- package/dist/client/assets/{tabs-2LSj3D0O.js → tabs-C3TBZOI4.js} +1 -1
- package/dist/client/assets/{textarea-CaTaS5aM.js → textarea-BlVgpSxW.js} +1 -1
- package/dist/client/assets/{toggle-group-Baz9dJJh.js → toggle-group-COVE5DD2.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-D9MmLXQ-.js → toolbar-icon-button-CxQRykmk.js} +1 -1
- package/dist/client/assets/{toolbar-CJdn53aQ.js → toolbar-uACcAT9m.js} +1 -1
- package/dist/client/assets/{tools-list-BFSiq3Ya.js → tools-list-DDzm575S.js} +1 -1
- package/dist/client/assets/{tooltip-0Tj-MlQQ.js → tooltip-CSKqYV2o.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Bp2eeB1_.js → use-ai-providers-DbzMqvRw.js} +1 -1
- package/dist/client/assets/{use-automations-9lVGXcc7.js → use-automations-rVffOJ9P.js} +1 -1
- package/dist/client/assets/{use-capability-CxpcJysD.js → use-capability-Dfq1Tv1s.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CAhIFZB2.js → use-clock-tick-CiJYYEvg.js} +1 -1
- package/dist/client/assets/{use-collections-Dl176bBd.js → use-collections-Dgegwdyj.js} +1 -1
- package/dist/client/assets/{use-connection-DZnUxHel.js → use-connection-CfJO5ZeS.js} +1 -1
- package/dist/client/assets/{use-copy-iOzmDtUv.js → use-copy-C8H8ajYI.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-C0MgphvT.js → use-create-virtual-mcp-4IQkbMp6.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CcCn7QVF.js → use-debounced-autosave-BMawogEl.js} +1 -1
- package/dist/client/assets/{use-debounced-value-C58Qyt5I.js → use-debounced-value-B74I46Ng.js} +1 -1
- package/dist/client/assets/{use-deco-credits-D-zIU8pp.js → use-deco-credits-C7ttPE2W.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DRFp7dsG.js → use-decopilot-events-CECoQxB1.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CzrZ4mQH.js → use-delete-connection-CzeRdYmF.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-C_vlzdm0.js → use-deployment-admin-BxahlTDD.js} +1 -1
- package/dist/client/assets/{use-file-configs-sSRaKhuP.js → use-file-configs-DkhFcq5Y.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BLQ78HyQ.js → use-infinite-scroll-enysl5iA.js} +1 -1
- package/dist/client/assets/{use-join-requests-Bmy8CfcY.js → use-join-requests-DkxXOPeL.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Cm__SCrY.js → use-mcp-client-DSEtHMzZ.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BBTNMsyU.js → use-mcp-tools-Ws8Uq0PO.js} +1 -1
- package/dist/client/assets/{use-members-Ccfmy0Gn.js → use-members-CzWiJzqP.js} +1 -1
- package/dist/client/assets/{use-mobile-Bp-djo0i.js → use-mobile-CpdOT8rj.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-C6M7Wtez.js → use-navigate-to-agent-BYI1ruBK.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Cv2k88wA.js → use-org-auth-client-Cq0wieBj.js} +1 -1
- package/dist/client/assets/{use-org-sso-mBCV7A_Y.js → use-org-sso-DIYkldj9.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DSBH_MSz.js → use-organization-roles-XaT8E2St.js} +1 -1
- package/dist/client/assets/{use-organization-settings-ChRdOQ4P.js → use-organization-settings-tw76RRiy.js} +1 -1
- package/dist/client/assets/{use-registry-connections-ByfUE9xQ.js → use-registry-connections-bxhzGEE0.js} +1 -1
- package/dist/client/assets/{use-secrets-DU_HoJG7.js → use-secrets-eOHxIh-E.js} +1 -1
- package/dist/client/assets/{use-status-sounds-D1XP90rS.js → use-status-sounds-DVD0jIZZ.js} +1 -1
- package/dist/client/assets/{use-view-mode-B-CLvSm1.js → use-view-mode-C3_MACOf.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Do4TNc3V.js → use-virtual-mcp-DbuyUGsA.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CGZs8b_0.js +1 -0
- package/dist/client/assets/{useRouterState-D8jCYuF7.js → useRouterState-CiMUD-eY.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CtDuoK5n.js +1 -0
- package/dist/client/assets/{users-BbtJ2R-L.js → users-D6Rzw3AO.js} +1 -1
- package/dist/client/assets/{variant-calendar-sXMgN6GG.js → variant-calendar-CVkKmTF0.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-B9xOnDKv.js → view-mode-toggle-CiKSiwo5.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/category-editor-BeORbrMO.js +0 -1
- package/dist/client/assets/page-seo-sheet-DGb4ld91.js +0 -1
- package/dist/client/assets/post-editor-DwHJt0-E.js +0 -1
- package/dist/client/assets/project-app-view-BbX8ZVqk.js +0 -1
- package/dist/client/assets/record-editor-BCAeMtFU.js +0 -1
- package/dist/client/assets/registry-CA7_2i3l.js +0 -2
- package/dist/client/assets/sections-editor-DFJpcghW.js +0 -2
- package/dist/client/assets/self-tool-result-DBIxxKX-.js +0 -1
- package/dist/client/assets/store-registry-DgWk0Vtp.js +0 -2
- package/dist/client/assets/useInfiniteQuery-C1NVu96X.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-9qA33-wr.js +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as q,r as S,l as Q,j as t,B as U,i as V,t as I}from"./index-Bhm9Bs1H.js";import{i as X}from"./XCircle-C-sHcbib.js";import{aG as Y,ab as T}from"./agent-icon-Cn3pvSY1.js";import{n as Z}from"./LinkExternal01-DaXyeXMC.js";import{f as K,a as _,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-qefhsonV.js";import{I as L}from"./input-DospeWmi.js";import{L as M}from"./label-BosGIEt_.js";import{v as at,w as mt,T as nt,o as lt,x as R,y as pt,U as ct}from"./index-CPBEAxML.js";import{c as dt,B as ut,a as gt}from"./block-document-Dg30aQSW.js";import{u as xt,s as v,E as ft}from"./primitives-DLS11ccE.js";import{t as ht}from"./ChevronDown-D0HdYvxS.js";import{J as yt,K as jt,I as vt}from"./automation-runs-LgYaU7NT.js";import"./AlertCircle-CqDLg4E0.js";import"./Trash03-ApRuYZcp.js";import"./Tool01-TTerLlhX.js";import"./ArrowUp-y4qiws93.js";import"./Settings02-CiDkLfc2.js";import"./Tool02-CuulG4Zm.js";import"./ArrowUpRight-fu_iMwrL.js";import"./TrendUp01-vfQPSjAQ.js";import"./ZapSquare-sm-ESnXi.js";import"./Users03-CoBRlJkB.js";import"./CheckCircle-Bk4jVW7c.js";import"./Check-CQjJylK6.js";import"./ChevronRight-e9_7KV61.js";import"./ChevronUp-hFG8HdCY.js";import"./Circle-C2Vu6xbB.js";import"./Stars02-CjLOPFO-.js";import"./Copy01-B_L_kofR.js";import"./ZoomOut-qGM7S5aC.js";import"./DotsVertical-D2l5wspb.js";import"./Globe01-BPH4QSYr.js";import"./Eye-DqWJbQD8.js";import"./FilterLines-Cp18AAlg.js";import"./Star01--k_y5js5.js";import"./Globe04-BHPtBBwM.js";import"./SwitchHorizontal01-Cx70rbaz.js";import"./HardDrive-BbOBIb1x.js";import"./Key01-MruRu6FB.js";import"./LayoutLeft-Btc5kA34.js";import"./List-B9BMYMsL.js";import"./Monitor01-XhoZ48SW.js";import"./Sun-gdDoFC0z.js";import"./Package-D4FjGHlZ.js";import"./Palette-Qilg0lma.js";import"./Play-BinR83so.js";import"./Plus-DUEQJ6Dq.js";import"./SearchLg-CFb4RdYX.js";import"./SearchMd-ClupCW3U.js";import"./Shield01-DwhqGz1N.js";import"./Stars01-CUp5AWO9.js";import"./Trash01-D6a6rHm7.js";import"./Upload01-qHg-k01G.js";import"./User01-Bh7a4wfo.js";import"./Users01-BOa_T7-l.js";import"./XClose-hFrmy8Kh.js";import"./X-DyjfKbz8.js";import"./Zap-C54DyH6J.js";import"./chat-context-DWZk_XUk.js";import"./autosend-nk4Rnt6q.js";import"./hooks-hF_71sFE.js";import"./use-mcp-client-Cm__SCrY.js";import"./constants-D_FQAPnt.js";import"./auth-Dz4ZnGBZ.js";import"./decopilot-sse-pool-v_-kLso6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-C158uWMN.js";import"./use-virtual-mcp-Do4TNc3V.js";import"./use-collections-Dl176bBd.js";import"./use-ai-providers-Bp2eeB1_.js";import"./use-decopilot-events-DRFp7dsG.js";import"./tab-id-bb-jjgGv.js";import"./use-organization-settings-ChRdOQ4P.js";import"./tooltip-0Tj-MlQQ.js";import"./dialog-df3kXkJ6.js";import"./drawer-CDEnz8Vo.js";import"./collection-search-zDpqz1Y6.js";import"./use-mobile-Bp-djo0i.js";import"./AreaChart-fkEDVRVu.js";import"./index-DgXATCJ-.js";import"./shell-layout-CXtvlsY5.js";import"./avatar-Mvk4Pr6q.js";import"./required-auth-layout-C_gORevl.js";import"./use-org-sso-mBCV7A_Y.js";import"./form-Dn-2qr3X.js";import"./select-b1vNfzCY.js";import"./tabs-2LSj3D0O.js";import"./toggle-group-Baz9dJJh.js";import"./use-deco-credits-D-zIU8pp.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-i6t_iiUW.js";import"./use-registry-connections-ByfUE9xQ.js";import"./use-connection-DZnUxHel.js";import"./useInfiniteQuery-C1NVu96X.js";import"./use-infinite-scroll-BLQ78HyQ.js";import"./extract-connection-data-Ds-QcBxj.js";import"./card-CQ82z7ux.js";import"./integration-icon-BGWuRbhS.js";import"./collection-tabs-CpVhSZXL.js";import"./badge-DPo5atq1.js";import"./textarea-CaTaS5aM.js";import"./connection-form-helpers-BHtBtUMl.js";import"./authenticate-and-persist-oauth-C5bv8dSc.js";import"./mcp-oauth-BDrL0Lxz.js";import"./useSuspenseInfiniteQuery-9qA33-wr.js";import"./connect-desktop-dialog-kTPFYpDX.js";import"./select-model-DdtZCC-h.js";import"./checkbox-Ci379OZ6.js";import"./skeleton-B7bqRPfS.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DmXhlL47.js";import"./command-D0oHu6yC.js";import"./index-D6hE8whu.js";import"./popover-CqoWWaG4.js";import"./dropdown-menu-Bccvvqlu.js";import"./index-Dm83E3iX.js";import"./file-type-icon-BA-Uo760.js";import"./toolbar-CJdn53aQ.js";import"./use-debounced-value-C58Qyt5I.js";import"./index-BX44TYXY.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-D1XP90rS.js";import"./empty-state-BIk42_em.js";import"./use-mcp-tools-BBTNMsyU.js";import"./use-capability-CxpcJysD.js";import"./tools-list-BFSiq3Ya.js";import"./switch-jhzFDXbX.js";import"./use-debounced-autosave-CcCn7QVF.js";import"./index-DHeYoHcI.js";import"./sidebar-CVCJDFEY.js";import"./search-input-fh_pNTUU.js";import"./github-repo-picker-DO2Q3TKU.js";import"./use-navigate-to-agent-C6M7Wtez.js";import"./reusable-new-chat-CouMjkYR.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-DU_HoJG7.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./format-time-BnbuEtat.js";import"./use-members-Ccfmy0Gn.js";import"./use-org-auth-client-Cv2k88wA.js";import"./index-cxmaQW5O.js";import"./get-initials-D-f_fDFw.js";import"./calendar-BJlaa-tp.js";import"./toolbar-icon-button-D9MmLXQ-.js";import"./use-file-configs-sSRaKhuP.js";import"./monaco-editor-DUt2Vaks.js";import"./use-automations-9lVGXcc7.js";import"./automation-list-row-TWr0b03X.js";import"./table-Cw-KhGHY.js";import"./use-clock-tick-CAhIFZB2.js";import"./use-copy-iOzmDtUv.js";function bt(k){const e=q.c(18),{icon:f,title:n,defaultOpen:b,children:d}=k,D=b===void 0?!1:b,[x,A]=S.useState(D);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=x&&"rotate-180";let r;e[4]!==h?(r=Q("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(yt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(jt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==x||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:x,onOpenChange:A,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function gr({orgSlug:k,virtualMcpId:e,branch:f,blockKey:n,block:b,decofile:d,meta:D,onManagePosts:x,onOpenPost:A,previewBaseUrl:l}){const i=at({orgSlug:k,virtualMcpId:e,branch:f}),h=mt(b,"categories"),[r,p,c]=xt(h,o=>{i.mutate({blockKey:n,data:R(n,"categories",o)})}),s=(o,w)=>p({...r,[o]:w}),u=dt({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[B,y]=S.useState(a),[m,C]=S.useState(null),[N,$]=S.useState(!1),z=a?nt(d).filter(o=>o.categorySlugs.includes(a)):[],j=z.length,G=o=>s("slug",o),H=async(o,w)=>{const W=v(r.name);$(!0);try{let g=0;for(const{key:P,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:W,slug:w});F!==O&&(await i.mutateAsync({blockKey:P,data:R(P,"posts",F)}),g+=1)}const E={...r,slug:w};await i.mutateAsync({blockKey:n,data:R(n,"categories",E)}),c(E),I.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(g){y(o),C(null),I.error(g instanceof Error?g.message:"Rename failed")}finally{$(!1)}},J=()=>{const o=B.trim();if(o===a){B!==o&&y(o);return}if(!o){y(a);return}if(j===0){G(o);return}C({oldSlug:a,newSlug:o,count:j})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(U,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Z,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(ft,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(M,{htmlFor:"category-slug",children:"Slug"}),t.jsx(L,{id:"category-slug",value:B,onChange:o=>y(o.target.value),onBlur:J,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(M,{htmlFor:"category-description",children:"Description"}),t.jsx(L,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(bt,{icon:Y,title:"Content",defaultOpen:!0,children:t.jsx(ut,{value:gt(r.sections),onChange:o=>s("sections",o),meta:D,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[j," ",j===1?"post":"posts"," in this category"]})]}),t.jsxs(U,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>x(a),children:["Add posts",t.jsx(X,{size:14})]})]}),j>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:z.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>A(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(K,{open:!!m,onOpenChange:o=>{o||N||(y(a),C(null))},children:t.jsxs(_,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:m?`Changing the slug from "${m.oldSlug}" to "${m.newSlug}" will update ${m.count} ${m.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:N,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),m&&H(m.oldSlug,m.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(V,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{gr as CategoryEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as it,r as E,j as e,i as rt}from"./index-Bhm9Bs1H.js";import{m as mt,o as pt,p as st,q as at}from"./sidebar-CVCJDFEY.js";import{A as nt}from"./automation-runs-LgYaU7NT.js";import{r as lt,u as ct,a as dt,b as St,i as ft,f as ut,d as vt,P as ht,S as gt}from"./page-seo-form-CojnY8G_.js";import{r as xt}from"./index-CPBEAxML.js";import"./LayoutLeft-Btc5kA34.js";import"./use-mobile-Bp-djo0i.js";import"./X-DyjfKbz8.js";import"./tooltip-0Tj-MlQQ.js";import"./select-b1vNfzCY.js";import"./Check-CQjJylK6.js";import"./ChevronDown-D0HdYvxS.js";import"./ChevronUp-hFG8HdCY.js";import"./useInfiniteQuery-C1NVu96X.js";import"./use-infinite-scroll-BLQ78HyQ.js";import"./use-connection-DZnUxHel.js";import"./use-collections-Dl176bBd.js";import"./use-mcp-client-Cm__SCrY.js";import"./constants-D_FQAPnt.js";import"./auth-Dz4ZnGBZ.js";import"./use-virtual-mcp-Do4TNc3V.js";import"./card-CQ82z7ux.js";import"./table-Cw-KhGHY.js";import"./empty-state-BIk42_em.js";import"./use-members-Ccfmy0Gn.js";import"./use-org-auth-client-Cv2k88wA.js";import"./use-clock-tick-CAhIFZB2.js";import"./AlertCircle-CqDLg4E0.js";import"./CheckCircle-Bk4jVW7c.js";import"./Circle-C2Vu6xbB.js";import"./agent-icon-Cn3pvSY1.js";import"./Trash03-ApRuYZcp.js";import"./Tool01-TTerLlhX.js";import"./ArrowUp-y4qiws93.js";import"./Settings02-CiDkLfc2.js";import"./Tool02-CuulG4Zm.js";import"./XCircle-C-sHcbib.js";import"./ArrowUpRight-fu_iMwrL.js";import"./TrendUp01-vfQPSjAQ.js";import"./ZapSquare-sm-ESnXi.js";import"./Users03-CoBRlJkB.js";import"./ChevronRight-e9_7KV61.js";import"./Stars02-CjLOPFO-.js";import"./Copy01-B_L_kofR.js";import"./ZoomOut-qGM7S5aC.js";import"./DotsVertical-D2l5wspb.js";import"./Globe01-BPH4QSYr.js";import"./Eye-DqWJbQD8.js";import"./FilterLines-Cp18AAlg.js";import"./Star01--k_y5js5.js";import"./Globe04-BHPtBBwM.js";import"./SwitchHorizontal01-Cx70rbaz.js";import"./HardDrive-BbOBIb1x.js";import"./Key01-MruRu6FB.js";import"./LinkExternal01-DaXyeXMC.js";import"./List-B9BMYMsL.js";import"./Monitor01-XhoZ48SW.js";import"./Sun-gdDoFC0z.js";import"./Package-D4FjGHlZ.js";import"./Palette-Qilg0lma.js";import"./Play-BinR83so.js";import"./Plus-DUEQJ6Dq.js";import"./SearchLg-CFb4RdYX.js";import"./SearchMd-ClupCW3U.js";import"./Shield01-DwhqGz1N.js";import"./Stars01-CUp5AWO9.js";import"./Trash01-D6a6rHm7.js";import"./Upload01-qHg-k01G.js";import"./User01-Bh7a4wfo.js";import"./Users01-BOa_T7-l.js";import"./XClose-hFrmy8Kh.js";import"./Zap-C54DyH6J.js";import"./use-automations-9lVGXcc7.js";import"./studio-tools-C158uWMN.js";import"./useSuspenseInfiniteQuery-9qA33-wr.js";import"./badge-DPo5atq1.js";import"./checkbox-Ci379OZ6.js";import"./command-D0oHu6yC.js";import"./index-D6hE8whu.js";import"./dialog-df3kXkJ6.js";import"./popover-CqoWWaG4.js";import"./avatar-Mvk4Pr6q.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-iOzmDtUv.js";import"./file-type-icon-BA-Uo760.js";import"./tab-id-bb-jjgGv.js";import"./monaco-editor-DUt2Vaks.js";import"./index-BX44TYXY.js";import"./chat-context-DWZk_XUk.js";import"./autosend-nk4Rnt6q.js";import"./hooks-hF_71sFE.js";import"./decopilot-sse-pool-v_-kLso6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-Bp2eeB1_.js";import"./use-decopilot-events-DRFp7dsG.js";import"./use-organization-settings-ChRdOQ4P.js";import"./index-DgXATCJ-.js";import"./shell-layout-CXtvlsY5.js";import"./alert-dialog-qefhsonV.js";import"./required-auth-layout-C_gORevl.js";import"./use-org-sso-mBCV7A_Y.js";import"./integration-icon-BGWuRbhS.js";import"./use-navigate-to-agent-C6M7Wtez.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-fkEDVRVu.js";import"./form-Dn-2qr3X.js";import"./label-BosGIEt_.js";import"./input-DospeWmi.js";import"./switch-jhzFDXbX.js";import"./drawer-CDEnz8Vo.js";import"./collection-search-zDpqz1Y6.js";import"./tabs-2LSj3D0O.js";import"./toggle-group-Baz9dJJh.js";import"./use-deco-credits-D-zIU8pp.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-i6t_iiUW.js";import"./use-registry-connections-ByfUE9xQ.js";import"./extract-connection-data-Ds-QcBxj.js";import"./collection-tabs-CpVhSZXL.js";import"./textarea-CaTaS5aM.js";import"./connection-form-helpers-BHtBtUMl.js";import"./authenticate-and-persist-oauth-C5bv8dSc.js";import"./mcp-oauth-BDrL0Lxz.js";import"./connect-desktop-dialog-kTPFYpDX.js";import"./select-model-DdtZCC-h.js";import"./skeleton-B7bqRPfS.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DmXhlL47.js";import"./dropdown-menu-Bccvvqlu.js";import"./index-Dm83E3iX.js";import"./toolbar-CJdn53aQ.js";import"./use-debounced-value-C58Qyt5I.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-D1XP90rS.js";import"./use-mcp-tools-BBTNMsyU.js";import"./use-capability-CxpcJysD.js";import"./tools-list-BFSiq3Ya.js";import"./use-debounced-autosave-CcCn7QVF.js";import"./index-DHeYoHcI.js";import"./search-input-fh_pNTUU.js";import"./github-repo-picker-DO2Q3TKU.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-DU_HoJG7.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-cxmaQW5O.js";import"./get-initials-D-f_fDFw.js";import"./calendar-BJlaa-tp.js";import"./toolbar-icon-button-D9MmLXQ-.js";import"./use-file-configs-sSRaKhuP.js";import"./automation-list-row-TWr0b03X.js";function Si(u){const t=it.c(46),{open:N,onOpenChange:P,orgSlug:Q,virtualMcpId:U,branch:W,decofile:G,meta:s,target:m,onSaved:X}=u,o=lt(G,m,s),k=m.kind==="site"?"site":m.pageKey,[Y,Z]=E.useState(k),[tt,i]=E.useState(null),[J,g]=E.useState(void 0),[x,y]=E.useState(0);Y!==k&&(Z(k),i(null),g(void 0),y(wt));const{persistSeo:a,persistRawSeo:I,flush:K,isPending:D}=ct({orgSlug:Q,virtualMcpId:U,branch:W,target:m,resolved:o,onSaved:X}),w=m.kind==="page",ot=w?o?.rawSeoData:void 0,v=J!==void 0?J:ot,et=w?dt(v)??void 0:void 0,h=tt??et??o?.seoData??{},p=o?St(h,o):null,n=p&&(!w||ft(v))?xt(p,s):null,_=m.kind==="page"?ut(G,s)?.seoData??void 0:void 0;let j;t[0]!==s?(j=vt(s),t[0]=s,t[1]=j):j=t[1];const A=j;let R;t[2]!==a||t[3]!==o||t[4]!==i?(R=r=>{if(!o)return;const L=r;i(L),a(L)},t[2]=a,t[3]=o,t[4]=i,t[5]=R):R=t[5];const M=R;let F;t[6]!==K||t[7]!==P?(F=r=>{r||K(),P(r)},t[6]=K,t[7]=P,t[8]=F):F=t[8];const V=F,q=m.kind==="site"?"Site SEO":"Page SEO",T=w&&o,z=m.kind==="site"&&o&&n,B=m.kind==="site"?"No site-level SEO block found.":o?"SEO schema not found for this page.":"Could not load page SEO.";let C;t[9]!==i?(C=()=>i(null),t[9]=i,t[10]=C):C=t[10];const H=C;let O;t[11]!==y?(O=()=>y(yt),t[11]=y,t[12]=O):O=t[12];const $=O;let l;t[13]!==q?(l=e.jsx(mt,{className:"text-sm font-semibold",children:q}),t[13]=q,t[14]=l):l=t[14];let c;t[15]!==D?(c=D&&e.jsx(rt,{size:14,className:"animate-spin text-muted-foreground"}),t[15]=D,t[16]=c):c=t[16];let d;t[17]!==l||t[18]!==c?(d=e.jsxs(pt,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[l,c]}),t[17]=l,t[18]=c,t[19]=d):d=t[19];let S;t[20]!==p||t[21]!==$||t[22]!==H||t[23]!==A||t[24]!==v||t[25]!==h||t[26]!==B||t[27]!==x||t[28]!==M||t[29]!==I||t[30]!==a||t[31]!==o||t[32]!==n||t[33]!==i||t[34]!==g||t[35]!==T||t[36]!==z||t[37]!==_?(S=!o||!T&&!z?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:B}):e.jsx(nt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-4",children:e.jsx("div",{className:"mx-auto max-w-sm",children:T?e.jsx(ht,{rawSeo:v,innerSeo:h,defaultResolveType:A,seoSchema:n,activeResolveType:p,seoTypeOptions:o.seoTypeOptions,formResetKey:x,siteDefaultSeo:_,onPersistRaw:r=>{g(r),I(r)},onInnerChange:r=>{i(r),a(r)},onClearForm:H,onBumpFormKey:$}):n&&p&&e.jsx(gt,{schema:n,resolveType:p,value:h,formResetKey:x,onChange:M})})})}),t[20]=p,t[21]=$,t[22]=H,t[23]=A,t[24]=v,t[25]=h,t[26]=B,t[27]=x,t[28]=M,t[29]=I,t[30]=a,t[31]=o,t[32]=n,t[33]=i,t[34]=g,t[35]=T,t[36]=z,t[37]=_,t[38]=S):S=t[38];let f;t[39]!==d||t[40]!==S?(f=e.jsxs(st,{side:"right",className:"w-[400px] sm:max-w-[440px] p-0 gap-0",children:[d,S]}),t[39]=d,t[40]=S,t[41]=f):f=t[41];let b;return t[42]!==V||t[43]!==N||t[44]!==f?(b=e.jsx(at,{open:N,onOpenChange:V,children:f}),t[42]=V,t[43]=N,t[44]=f,t[45]=b):b=t[45],b}function yt(u){return u+1}function wt(u){return u+1}export{Si as SeoSheet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as H,j as t,B as Z}from"./index-Bhm9Bs1H.js";import{n as ee}from"./LinkExternal01-DaXyeXMC.js";import{aG as te,h as oe}from"./agent-icon-Cn3pvSY1.js";import{I as J}from"./input-DospeWmi.js";import{L as q}from"./label-BosGIEt_.js";import{a1 as ie}from"./automation-runs-LgYaU7NT.js";import{b as Q,c as se,T as W,a as re}from"./tabs-2LSj3D0O.js";import{T as le}from"./textarea-CaTaS5aM.js";import{v as ae,w as me,o as pe,x as ne,I as ce,y as de,z as fe}from"./index-CPBEAxML.js";import{b as ue,a as xe,B as he}from"./block-document-Dg30aQSW.js";import{u as ge,s as F,E as ve,R as ye,A as je}from"./primitives-DLS11ccE.js";import"./AlertCircle-CqDLg4E0.js";import"./Trash03-ApRuYZcp.js";import"./Tool01-TTerLlhX.js";import"./ArrowUp-y4qiws93.js";import"./Settings02-CiDkLfc2.js";import"./Tool02-CuulG4Zm.js";import"./XCircle-C-sHcbib.js";import"./ArrowUpRight-fu_iMwrL.js";import"./TrendUp01-vfQPSjAQ.js";import"./ZapSquare-sm-ESnXi.js";import"./Users03-CoBRlJkB.js";import"./CheckCircle-Bk4jVW7c.js";import"./Check-CQjJylK6.js";import"./ChevronDown-D0HdYvxS.js";import"./ChevronRight-e9_7KV61.js";import"./ChevronUp-hFG8HdCY.js";import"./Circle-C2Vu6xbB.js";import"./Stars02-CjLOPFO-.js";import"./Copy01-B_L_kofR.js";import"./ZoomOut-qGM7S5aC.js";import"./DotsVertical-D2l5wspb.js";import"./Globe01-BPH4QSYr.js";import"./Eye-DqWJbQD8.js";import"./FilterLines-Cp18AAlg.js";import"./Star01--k_y5js5.js";import"./Globe04-BHPtBBwM.js";import"./SwitchHorizontal01-Cx70rbaz.js";import"./HardDrive-BbOBIb1x.js";import"./Key01-MruRu6FB.js";import"./LayoutLeft-Btc5kA34.js";import"./List-B9BMYMsL.js";import"./Monitor01-XhoZ48SW.js";import"./Sun-gdDoFC0z.js";import"./Package-D4FjGHlZ.js";import"./Palette-Qilg0lma.js";import"./Play-BinR83so.js";import"./Plus-DUEQJ6Dq.js";import"./SearchLg-CFb4RdYX.js";import"./SearchMd-ClupCW3U.js";import"./Shield01-DwhqGz1N.js";import"./Stars01-CUp5AWO9.js";import"./Trash01-D6a6rHm7.js";import"./Upload01-qHg-k01G.js";import"./User01-Bh7a4wfo.js";import"./Users01-BOa_T7-l.js";import"./XClose-hFrmy8Kh.js";import"./X-DyjfKbz8.js";import"./Zap-C54DyH6J.js";import"./select-b1vNfzCY.js";import"./tooltip-0Tj-MlQQ.js";import"./useInfiniteQuery-C1NVu96X.js";import"./use-infinite-scroll-BLQ78HyQ.js";import"./use-connection-DZnUxHel.js";import"./use-collections-Dl176bBd.js";import"./use-mcp-client-Cm__SCrY.js";import"./constants-D_FQAPnt.js";import"./auth-Dz4ZnGBZ.js";import"./use-virtual-mcp-Do4TNc3V.js";import"./card-CQ82z7ux.js";import"./sidebar-CVCJDFEY.js";import"./use-mobile-Bp-djo0i.js";import"./table-Cw-KhGHY.js";import"./empty-state-BIk42_em.js";import"./use-members-Ccfmy0Gn.js";import"./use-org-auth-client-Cv2k88wA.js";import"./use-clock-tick-CAhIFZB2.js";import"./use-automations-9lVGXcc7.js";import"./studio-tools-C158uWMN.js";import"./useSuspenseInfiniteQuery-9qA33-wr.js";import"./badge-DPo5atq1.js";import"./checkbox-Ci379OZ6.js";import"./command-D0oHu6yC.js";import"./index-D6hE8whu.js";import"./dialog-df3kXkJ6.js";import"./popover-CqoWWaG4.js";import"./avatar-Mvk4Pr6q.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-iOzmDtUv.js";import"./file-type-icon-BA-Uo760.js";import"./tab-id-bb-jjgGv.js";import"./monaco-editor-DUt2Vaks.js";import"./index-BX44TYXY.js";import"./chat-context-DWZk_XUk.js";import"./autosend-nk4Rnt6q.js";import"./hooks-hF_71sFE.js";import"./decopilot-sse-pool-v_-kLso6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-Bp2eeB1_.js";import"./use-decopilot-events-DRFp7dsG.js";import"./use-organization-settings-ChRdOQ4P.js";import"./index-DgXATCJ-.js";import"./shell-layout-CXtvlsY5.js";import"./alert-dialog-qefhsonV.js";import"./required-auth-layout-C_gORevl.js";import"./use-org-sso-mBCV7A_Y.js";import"./integration-icon-BGWuRbhS.js";import"./use-navigate-to-agent-C6M7Wtez.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-fkEDVRVu.js";import"./form-Dn-2qr3X.js";import"./drawer-CDEnz8Vo.js";import"./collection-search-zDpqz1Y6.js";import"./toggle-group-Baz9dJJh.js";import"./use-deco-credits-D-zIU8pp.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-i6t_iiUW.js";import"./use-registry-connections-ByfUE9xQ.js";import"./extract-connection-data-Ds-QcBxj.js";import"./collection-tabs-CpVhSZXL.js";import"./connection-form-helpers-BHtBtUMl.js";import"./authenticate-and-persist-oauth-C5bv8dSc.js";import"./mcp-oauth-BDrL0Lxz.js";import"./connect-desktop-dialog-kTPFYpDX.js";import"./select-model-DdtZCC-h.js";import"./skeleton-B7bqRPfS.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DmXhlL47.js";import"./dropdown-menu-Bccvvqlu.js";import"./index-Dm83E3iX.js";import"./toolbar-CJdn53aQ.js";import"./use-debounced-value-C58Qyt5I.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-D1XP90rS.js";import"./use-mcp-tools-BBTNMsyU.js";import"./use-capability-CxpcJysD.js";import"./tools-list-BFSiq3Ya.js";import"./switch-jhzFDXbX.js";import"./use-debounced-autosave-CcCn7QVF.js";import"./index-DHeYoHcI.js";import"./search-input-fh_pNTUU.js";import"./github-repo-picker-DO2Q3TKU.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-DU_HoJG7.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-cxmaQW5O.js";import"./get-initials-D-f_fDFw.js";import"./calendar-BJlaa-tp.js";import"./toolbar-icon-button-D9MmLXQ-.js";import"./use-file-configs-sSRaKhuP.js";import"./automation-list-row-TWr0b03X.js";function be(A){return Array.isArray(A)?A.map(e=>({key:F(e?.key),value:F(e?.value)})):[]}function hi(A){const e=H.c(66),{orgSlug:i,virtualMcpId:d,branch:o,blockKey:r,block:p,decofile:m,meta:u,previewBaseUrl:x}=A;let y;e[0]!==o||e[1]!==i||e[2]!==d?(y={orgSlug:i,virtualMcpId:d,branch:o},e[0]=o,e[1]=i,e[2]=d,e[3]=y):y=e[3];const s=ae(y);let n;e[4]!==p?(n=me(p,"posts"),e[4]=p,e[5]=n):n=e[5];const j=n;let b;e[6]!==r||e[7]!==s?(b=T=>{s.mutate({blockKey:r,data:ne(r,"posts",T)})},e[6]=r,e[7]=s,e[8]=b):b=e[8];const[l,_]=ge(j,b);let C;e[9]!==l||e[10]!==_?(C=(T,Y)=>_({...l,[T]:Y}),e[9]=l,e[10]=_,e[11]=C):C=e[11];const h=C;let S;e[12]!==m||e[13]!==l||e[14]!==x?(S=ue({decofile:m,post:l,previewBaseUrl:x}),e[12]=m,e[13]=l,e[14]=x,e[15]=S):S=e[15];const f=S;let a;e[16]!==l.title?(a=F(l.title)||"Untitled post",e[16]=l.title,e[17]=a):a=e[17];let c;e[18]!==a?(c=t.jsx("span",{className:"truncate text-sm font-medium",children:a}),e[18]=a,e[19]=c):c=e[19];let g;e[20]!==s.isError||e[21]!==s.isPending?(g=t.jsx(pe,{isPending:s.isPending,isError:s.isError}),e[20]=s.isError,e[21]=s.isPending,e[22]=g):g=e[22];const k=!f,P=f?"Open the post preview in a new tab":"Set the post slug (and its category) plus the blog app's pageSlug to preview";let N;e[23]!==f?(N=()=>{f&&window.open(f,"_blank","noopener,noreferrer")},e[23]=f,e[24]=N):N=e[24];let B;e[25]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(ee,{size:14}),e[25]=B):B=e[25];let w;e[26]!==P||e[27]!==N||e[28]!==k?(w=t.jsxs(Z,{type:"button",variant:"outline",size:"sm",disabled:k,title:P,onClick:N,children:[B,"See preview"]}),e[26]=P,e[27]=N,e[28]=k,e[29]=w):w=e[29];let E;e[30]!==w||e[31]!==g?(E=t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[g,w]}),e[30]=w,e[31]=g,e[32]=E):E=e[32];let v;e[33]!==E||e[34]!==c?(v=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[c,E]}),e[33]=E,e[34]=c,e[35]=v):v=e[35];let L;e[36]!==l.title?(L=F(l.title),e[36]=l.title,e[37]=L):L=e[37];let R;e[38]!==h?(R=T=>h("title",T),e[38]=h,e[39]=R):R=e[39];let I;e[40]!==L||e[41]!==R?(I=t.jsx(ve,{value:L,onChange:R,placeholder:"Post title",className:"py-1 text-4xl font-bold text-foreground"}),e[40]=L,e[41]=R,e[42]=I):I=e[42];let O;e[43]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(Q,{value:"content",children:[t.jsx(te,{}),"Content"]}),e[43]=O):O=e[43];let G;e[44]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsxs(se,{children:[O,t.jsxs(Q,{value:"settings",children:[t.jsx(oe,{}),"Settings"]})]}),e[44]=G):G=e[44];let U;e[45]!==l.sections?(U=xe(l.sections),e[45]=l.sections,e[46]=U):U=e[46];let $;e[47]!==h?($=T=>h("sections",T),e[47]=h,e[48]=$):$=e[48];let z;e[49]!==u||e[50]!==U||e[51]!==$?(z=t.jsx(W,{value:"content",children:t.jsx("div",{className:"rounded-xl border bg-card p-8 shadow-sm",children:t.jsx(he,{value:U,onChange:$,meta:u,emptyMessage:"This post has no content yet. Use ⊕ to add your first block."})})}),e[49]=u,e[50]=U,e[51]=$,e[52]=z):z=e[52];let D;e[53]!==m||e[54]!==l||e[55]!==h?(D=t.jsx(W,{value:"settings",children:t.jsx("div",{className:"rounded-xl border bg-card p-6 shadow-sm",children:t.jsx(Ce,{post:l,decofile:m,onChange:h})})}),e[53]=m,e[54]=l,e[55]=h,e[56]=D):D=e[56];let M;e[57]!==z||e[58]!==D?(M=t.jsxs(re,{defaultValue:"content",className:"mt-6 gap-4",children:[G,z,D]}),e[57]=z,e[58]=D,e[59]=M):M=e[59];let V;e[60]!==I||e[61]!==M?(V=t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[I,M]})}),e[60]=I,e[61]=M,e[62]=V):V=e[62];let K;return e[63]!==v||e[64]!==V?(K=t.jsxs("div",{className:"flex h-full flex-col",children:[v,V]}),e[63]=v,e[64]=V,e[65]=K):K=e[65],K}function Ce(A){const e=H.c(59),{post:i,decofile:d,onChange:o}=A;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(q,{htmlFor:"post-excerpt",children:"Excerpt"}),e[0]=r):r=e[0];let p;e[1]!==i.excerpt?(p=F(i.excerpt),e[1]=i.excerpt,e[2]=p):p=e[2];let m;e[3]!==o?(m=v=>o("excerpt",v.target.value),e[3]=o,e[4]=m):m=e[4];let u;e[5]!==p||e[6]!==m?(u=t.jsxs("div",{className:"space-y-2",children:[r,t.jsx(le,{id:"post-excerpt",value:p,onChange:m,rows:2})]}),e[5]=p,e[6]=m,e[7]=u):u=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(q,{htmlFor:"post-slug",children:"Slug"}),e[8]=x):x=e[8];let y;e[9]!==i.slug?(y=F(i.slug),e[9]=i.slug,e[10]=y):y=e[10];let s;e[11]!==o?(s=v=>o("slug",v.target.value),e[11]=o,e[12]=s):s=e[12];let n;e[13]!==y||e[14]!==s?(n=t.jsxs("div",{className:"space-y-2",children:[x,t.jsx(J,{id:"post-slug",value:y,onChange:s,placeholder:"my-post",className:"h-10"})]}),e[13]=y,e[14]=s,e[15]=n):n=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j={type:"string",format:"date",title:"Date"},e[16]=j):j=e[16];let b;e[17]!==i.date?(b=F(i.date),e[17]=i.date,e[18]=b):b=e[18];let l;e[19]!==o?(l=v=>o("date",v),e[19]=o,e[20]=l):l=e[20];let _;e[21]!==b||e[22]!==l?(_=t.jsx(fe,{schema:j,value:b,onChange:l,path:"post-date",label:"Date"}),e[21]=b,e[22]=l,e[23]=_):_=e[23];let C;e[24]!==_||e[25]!==n?(C=t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n,_]}),e[24]=_,e[25]=n,e[26]=C):C=e[26];let h;e[27]===Symbol.for("react.memo_cache_sentinel")?(h={type:"string",format:"image-uri",title:"Cover image"},e[27]=h):h=e[27];let S;e[28]!==o?(S=v=>o("image",v),e[28]=o,e[29]=S):S=e[29];let f;e[30]!==i.image||e[31]!==S?(f=t.jsx(ce,{schema:h,value:i.image,onChange:S,path:"post-image",label:"Cover image"}),e[30]=i.image,e[31]=S,e[32]=f):f=e[32];let a;e[33]===Symbol.for("react.memo_cache_sentinel")?(a=["email"],e[33]=a):a=e[33];let c;e[34]!==o?(c=v=>o("authors",v),e[34]=o,e[35]=c):c=e[35];let g;e[36]!==d||e[37]!==i.authors||e[38]!==c?(g=t.jsx(X,{label:"Authors",decofile:d,kind:"authors",valueField:"email",extraFields:a,selected:i.authors,onChange:c}),e[36]=d,e[37]=i.authors,e[38]=c,e[39]=g):g=e[39];let k;e[40]===Symbol.for("react.memo_cache_sentinel")?(k=["slug"],e[40]=k):k=e[40];let P;e[41]!==o?(P=v=>o("categories",v),e[41]=o,e[42]=P):P=e[42];let N;e[43]!==d||e[44]!==i.categories||e[45]!==P?(N=t.jsx(X,{label:"Categories",decofile:d,kind:"categories",valueField:"slug",extraFields:k,selected:i.categories,onChange:P}),e[43]=d,e[44]=i.categories,e[45]=P,e[46]=N):N=e[46];let B;e[47]!==o?(B=v=>o("extraProps",v),e[47]=o,e[48]=B):B=e[48];let w;e[49]!==i.extraProps||e[50]!==B?(w=t.jsx(ke,{value:i.extraProps,onChange:B}),e[49]=i.extraProps,e[50]=B,e[51]=w):w=e[51];let E;return e[52]!==C||e[53]!==f||e[54]!==g||e[55]!==N||e[56]!==w||e[57]!==u?(E=t.jsxs("div",{className:"space-y-5",children:[u,C,f,g,N,w]}),e[52]=C,e[53]=f,e[54]=g,e[55]=N,e[56]=w,e[57]=u,e[58]=E):E=e[58],E}function ke(A){const e=H.c(15),{value:i,onChange:d}=A;let o,r,p,m;if(e[0]!==d||e[1]!==i){o=be(i);const y=(s,n)=>d(o.map((j,b)=>b===s?{...j,...n}:j));r="space-y-2",e[6]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(q,{children:"Extra props"}),e[6]=p):p=e[6],m=o.length>0&&t.jsx("ul",{className:"space-y-2",children:o.map((s,n)=>t.jsxs("li",{className:"group/item flex items-center gap-2",children:[t.jsx(J,{value:s.key,onChange:j=>y(n,{key:j.target.value}),placeholder:"key",className:"h-9 flex-1"}),t.jsx(J,{value:s.value,onChange:j=>y(n,{value:j.target.value}),placeholder:"value",className:"h-9 flex-1"}),t.jsx(ye,{label:"Remove prop",onClick:()=>d(o.filter((j,b)=>b!==n))})]},n))}),e[0]=d,e[1]=i,e[2]=o,e[3]=r,e[4]=p,e[5]=m}else o=e[2],r=e[3],p=e[4],m=e[5];let u;e[7]!==o||e[8]!==d?(u=t.jsx(je,{label:"Add prop",onClick:()=>d([...o,{key:"",value:""}])}),e[7]=o,e[8]=d,e[9]=u):u=e[9];let x;return e[10]!==r||e[11]!==p||e[12]!==m||e[13]!==u?(x=t.jsxs("div",{className:r,children:[p,m,u]}),e[10]=r,e[11]=p,e[12]=m,e[13]=u,e[14]=x):x=e[14],x}function X(A){const e=H.c(31),{label:i,decofile:d,kind:o,valueField:r,extraFields:p,selected:m,onChange:u}=A;let x,y,s;if(e[0]!==d||e[1]!==o||e[2]!==r){x=de(d,o);let f;e[6]!==r?(f=(c,g)=>F(c[r])||g,e[6]=r,e[7]=f):f=e[7],s=f;let a;e[8]!==s?(a=c=>{const{key:g,payload:k}=c;return{value:s(k,g),label:F(k.name)||s(k,g)}},e[8]=s,e[9]=a):a=e[9],y=x.map(a),e[0]=d,e[1]=o,e[2]=r,e[3]=x,e[4]=y,e[5]=s}else x=e[3],y=e[4],s=e[5];const n=y;let j;if(e[10]!==m||e[11]!==r){const f=Array.isArray(m)?m:[];let a;e[13]!==r?(a=c=>F(c[r]),e[13]=r,e[14]=a):a=e[14],j=f.map(a).filter(Boolean),e[10]=m,e[11]=r,e[12]=j}else j=e[12];const b=j;let l;e[15]!==p||e[16]!==u||e[17]!==x||e[18]!==r||e[19]!==s?(l=f=>{u(f.map(a=>{const c=x.find(k=>{const{key:P,payload:N}=k;return s(N,P)===a});if(!c)return{name:a,[r]:a};const g={name:F(c.payload.name)};for(const k of p)g[k]=c.payload[k]??a;return g}))},e[15]=p,e[16]=u,e[17]=x,e[18]=r,e[19]=s,e[20]=l):l=e[20];const _=l;let C;e[21]!==i?(C=t.jsx(q,{children:i}),e[21]=i,e[22]=C):C=e[22];let h;e[23]!==b||e[24]!==_||e[25]!==i||e[26]!==n?(h=n.length===0?t.jsxs("p",{className:"text-xs text-muted-foreground",children:["No ",i.toLowerCase()," yet — create some in the"," ",i.toLowerCase()," collection."]}):t.jsx(ie,{options:n,defaultValue:b,onValueChange:_,placeholder:`Select ${i.toLowerCase()}`,maxCount:4}),e[23]=b,e[24]=_,e[25]=i,e[26]=n,e[27]=h):h=e[27];let S;return e[28]!==C||e[29]!==h?(S=t.jsxs("div",{className:"space-y-2",children:[C,h]}),e[28]=C,e[29]=h,e[30]=S):S=e[30],S}export{hi as PostEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as $,C as H,j as v}from"./index-Bhm9Bs1H.js";import{a as L,g as E,s as b}from"./automation-runs-LgYaU7NT.js";import{u as O}from"./use-mcp-client-Cm__SCrY.js";import{p as k}from"./constants-D_FQAPnt.js";import{b as q,c as B}from"./use-mcp-tools-BBTNMsyU.js";import{u as Y}from"./index-CPBEAxML.js";import{c as G}from"./monaco-editor-DUt2Vaks.js";import{g as K,M as V,a as w}from"./index-DgXATCJ-.js";import{b as z,a as F}from"./chat-context-DWZk_XUk.js";import{u as J}from"./shell-layout-CXtvlsY5.js";import"./select-b1vNfzCY.js";import"./tooltip-0Tj-MlQQ.js";import"./Check-CQjJylK6.js";import"./ChevronDown-D0HdYvxS.js";import"./ChevronUp-hFG8HdCY.js";import"./useInfiniteQuery-C1NVu96X.js";import"./use-infinite-scroll-BLQ78HyQ.js";import"./use-connection-DZnUxHel.js";import"./use-collections-Dl176bBd.js";import"./use-virtual-mcp-Do4TNc3V.js";import"./card-CQ82z7ux.js";import"./sidebar-CVCJDFEY.js";import"./LayoutLeft-Btc5kA34.js";import"./use-mobile-Bp-djo0i.js";import"./X-DyjfKbz8.js";import"./table-Cw-KhGHY.js";import"./empty-state-BIk42_em.js";import"./use-members-Ccfmy0Gn.js";import"./use-org-auth-client-Cv2k88wA.js";import"./use-clock-tick-CAhIFZB2.js";import"./AlertCircle-CqDLg4E0.js";import"./CheckCircle-Bk4jVW7c.js";import"./Circle-C2Vu6xbB.js";import"./agent-icon-Cn3pvSY1.js";import"./Trash03-ApRuYZcp.js";import"./Tool01-TTerLlhX.js";import"./ArrowUp-y4qiws93.js";import"./Settings02-CiDkLfc2.js";import"./Tool02-CuulG4Zm.js";import"./XCircle-C-sHcbib.js";import"./ArrowUpRight-fu_iMwrL.js";import"./TrendUp01-vfQPSjAQ.js";import"./ZapSquare-sm-ESnXi.js";import"./Users03-CoBRlJkB.js";import"./ChevronRight-e9_7KV61.js";import"./Stars02-CjLOPFO-.js";import"./Copy01-B_L_kofR.js";import"./ZoomOut-qGM7S5aC.js";import"./DotsVertical-D2l5wspb.js";import"./Globe01-BPH4QSYr.js";import"./Eye-DqWJbQD8.js";import"./FilterLines-Cp18AAlg.js";import"./Star01--k_y5js5.js";import"./Globe04-BHPtBBwM.js";import"./SwitchHorizontal01-Cx70rbaz.js";import"./HardDrive-BbOBIb1x.js";import"./Key01-MruRu6FB.js";import"./LinkExternal01-DaXyeXMC.js";import"./List-B9BMYMsL.js";import"./Monitor01-XhoZ48SW.js";import"./Sun-gdDoFC0z.js";import"./Package-D4FjGHlZ.js";import"./Palette-Qilg0lma.js";import"./Play-BinR83so.js";import"./Plus-DUEQJ6Dq.js";import"./SearchLg-CFb4RdYX.js";import"./SearchMd-ClupCW3U.js";import"./Shield01-DwhqGz1N.js";import"./Stars01-CUp5AWO9.js";import"./Trash01-D6a6rHm7.js";import"./Upload01-qHg-k01G.js";import"./User01-Bh7a4wfo.js";import"./Users01-BOa_T7-l.js";import"./XClose-hFrmy8Kh.js";import"./Zap-C54DyH6J.js";import"./use-automations-9lVGXcc7.js";import"./studio-tools-C158uWMN.js";import"./useSuspenseInfiniteQuery-9qA33-wr.js";import"./badge-DPo5atq1.js";import"./checkbox-Ci379OZ6.js";import"./command-D0oHu6yC.js";import"./index-D6hE8whu.js";import"./dialog-df3kXkJ6.js";import"./popover-CqoWWaG4.js";import"./avatar-Mvk4Pr6q.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-iOzmDtUv.js";import"./file-type-icon-BA-Uo760.js";import"./tab-id-bb-jjgGv.js";import"./hooks-hF_71sFE.js";import"./decopilot-sse-pool-v_-kLso6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./integration-icon-BGWuRbhS.js";import"./use-navigate-to-agent-C6M7Wtez.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-fkEDVRVu.js";import"./form-Dn-2qr3X.js";import"./label-BosGIEt_.js";import"./input-DospeWmi.js";import"./auth-Dz4ZnGBZ.js";import"./drawer-CDEnz8Vo.js";import"./collection-search-zDpqz1Y6.js";import"./autosend-nk4Rnt6q.js";import"./tabs-2LSj3D0O.js";import"./toggle-group-Baz9dJJh.js";import"./use-deco-credits-D-zIU8pp.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-i6t_iiUW.js";import"./use-registry-connections-ByfUE9xQ.js";import"./use-organization-settings-ChRdOQ4P.js";import"./extract-connection-data-Ds-QcBxj.js";import"./collection-tabs-CpVhSZXL.js";import"./textarea-CaTaS5aM.js";import"./connection-form-helpers-BHtBtUMl.js";import"./authenticate-and-persist-oauth-C5bv8dSc.js";import"./mcp-oauth-BDrL0Lxz.js";import"./use-ai-providers-Bp2eeB1_.js";import"./connect-desktop-dialog-kTPFYpDX.js";import"./select-model-DdtZCC-h.js";import"./skeleton-B7bqRPfS.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DmXhlL47.js";import"./dropdown-menu-Bccvvqlu.js";import"./index-Dm83E3iX.js";import"./alert-dialog-qefhsonV.js";import"./toolbar-CJdn53aQ.js";import"./use-debounced-value-C58Qyt5I.js";import"./index-BX44TYXY.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-D1XP90rS.js";import"./use-decopilot-events-DRFp7dsG.js";import"./use-capability-CxpcJysD.js";import"./tools-list-BFSiq3Ya.js";import"./switch-jhzFDXbX.js";import"./use-debounced-autosave-CcCn7QVF.js";import"./index-DHeYoHcI.js";import"./search-input-fh_pNTUU.js";import"./github-repo-picker-DO2Q3TKU.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-DU_HoJG7.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-cxmaQW5O.js";import"./get-initials-D-f_fDFw.js";import"./calendar-BJlaa-tp.js";import"./toolbar-icon-button-D9MmLXQ-.js";import"./use-file-configs-sSRaKhuP.js";import"./automation-list-row-TWr0b03X.js";import"./required-auth-layout-C_gORevl.js";import"./use-org-sso-mBCV7A_Y.js";const Q={};function W(A){const t=$.c(37),{client:i,resourceURI:h,tool:o,connectionId:p,orgId:l,args:M}=A,{sendMessage:I}=z(),{setAppContext:u,clearAppContext:n}=F(),{openSidePanel:f,openTab:g}=J(),r=`${p}:${o.name}`;let a;t[0]!==g?(a=C=>C==="inline"?(g("0"),"inline"):"fullscreen",t[0]=g,t[1]=a):a=t[1];const m=a,s=M??Q;let c;t[2]!==i||t[3]!==o.name||t[4]!==s?(c={client:i,toolName:o.name,toolArguments:s},t[2]=i,t[3]=o.name,t[4]=s,t[5]=c):c=t[5];const{data:e}=B(c);let x;if(t[6]!==o._meta||t[7]!==o.name){const C=E(o._meta);x=b(o.name,C),t[6]=o._meta,t[7]=o.name,t[8]=x}else x=t[8];const U=x;let d;t[9]!==o.inputSchema?(d=o.inputSchema??{type:"object"},t[9]=o.inputSchema,t[10]=d):d=t[10];let N;t[11]!==U||t[12]!==d||t[13]!==o?(N={...o,name:U,inputSchema:d},t[11]=U,t[12]=d,t[13]=o,t[14]=N):N=t[14];const j=N;let S;t[15]!==f||t[16]!==I?(S=C=>{const D=G(C.content);D.content.length>0&&(f("chat"),I({tiptapDoc:D}))},t[15]=f,t[16]=I,t[17]=S):S=t[17];const y=S;let P;t[18]!==j?(P={tool:j},t[18]=j,t[19]=P):P=t[19];let T;t[20]!==u||t[21]!==r?(T=C=>u(r,C),t[20]=u,t[21]=r,t[22]=T):T=t[22];let R;t[23]!==n||t[24]!==r?(R=()=>n(r),t[23]=n,t[24]=r,t[25]=R):R=t[25];let _;return t[26]!==i||t[27]!==y||t[28]!==m||t[29]!==l||t[30]!==h||t[31]!==P||t[32]!==T||t[33]!==R||t[34]!==s||t[35]!==e?(_=v.jsx(V,{resourceURI:h,orgId:l,toolInfo:P,toolInput:s,toolResult:e,displayMode:"fullscreen",minHeight:w.fullscreen.minHeight,maxHeight:w.fullscreen.maxHeight,client:i,onMessage:y,onUpdateModelContext:T,onTeardown:R,onRequestDisplayMode:m,className:"h-full"}),t[26]=i,t[27]=y,t[28]=m,t[29]=l,t[30]=h,t[31]=P,t[32]=T,t[33]=R,t[34]=s,t[35]=e,t[36]=_):_=t[36],_}function Br(A){const t=$.c(24),{connectionId:i,toolName:h,args:o}=A,{org:p}=H(),l=Y();let M;t[0]!==i||t[1]!==l?(M=k(i)&&l.vmEntry?.sandboxProviderKind==="user-desktop"&&l.previewUrl?`${l.previewUrl.replace(/\/+$/,"")}/api/mcp`:void 0,t[0]=i,t[1]=l,t[2]=M):M=t[2];const I=M;let u;t[3]!==i||t[4]!==I||t[5]!==p.id||t[6]!==p.slug?(u={connectionId:i,orgId:p.id,orgSlug:p.slug,mcpUrl:I},t[3]=i,t[4]=I,t[5]=p.id,t[6]=p.slug,t[7]=u):u=t[7];const n=O(u);let f;t[8]!==n?(f={client:n},t[8]=n,t[9]=f):f=t[9];const{data:g}=q(f);let r,a,m;t[10]!==h||t[11]!==g.tools?(r=L(decodeURIComponent(h)),m=g.tools.find(e=>e.name===r)??g.tools.find(e=>{const x=E(e._meta);if(!x)return!1;if(b(e.name,x)===r)return!0;const d=b(r,x);return d!==r&&e.name===d}),a=m?._meta?K(m._meta):void 0,t[10]=h,t[11]=g.tools,t[12]=r,t[13]=a,t[14]=m):(r=t[12],a=t[13],m=t[14]);const s=a;if(!m||!s){let e;return t[15]!==r?(e=v.jsx("div",{className:"flex items-center justify-center h-full w-full",children:v.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',r,'" not found or has no UI']})}),t[15]=r,t[16]=e):e=t[16],e}let c;return t[17]!==o||t[18]!==n||t[19]!==i||t[20]!==p.id||t[21]!==s||t[22]!==m?(c=v.jsx(W,{client:n,resourceURI:s,tool:m,connectionId:i,orgId:p.id,args:o}),t[17]=o,t[18]=n,t[19]=i,t[20]=p.id,t[21]=s,t[22]=m,t[23]=c):c=t[23],c}export{Br as AppViewContent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as S,j as r}from"./index-Bhm9Bs1H.js";import{I as T}from"./input-DospeWmi.js";import{L as C}from"./label-BosGIEt_.js";import{T as L}from"./textarea-CaTaS5aM.js";import{v as A,w as R,o as D,x as J,I as K}from"./index-CPBEAxML.js";import{u as M,s as P}from"./primitives-DLS11ccE.js";import"./ArrowUp-y4qiws93.js";import"./chat-context-DWZk_XUk.js";import"./autosend-nk4Rnt6q.js";import"./hooks-hF_71sFE.js";import"./use-mcp-client-Cm__SCrY.js";import"./constants-D_FQAPnt.js";import"./auth-Dz4ZnGBZ.js";import"./decopilot-sse-pool-v_-kLso6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-C158uWMN.js";import"./use-virtual-mcp-Do4TNc3V.js";import"./use-collections-Dl176bBd.js";import"./use-ai-providers-Bp2eeB1_.js";import"./use-decopilot-events-DRFp7dsG.js";import"./tab-id-bb-jjgGv.js";import"./use-organization-settings-ChRdOQ4P.js";import"./automation-runs-LgYaU7NT.js";import"./select-b1vNfzCY.js";import"./tooltip-0Tj-MlQQ.js";import"./Check-CQjJylK6.js";import"./ChevronDown-D0HdYvxS.js";import"./ChevronUp-hFG8HdCY.js";import"./useInfiniteQuery-C1NVu96X.js";import"./use-infinite-scroll-BLQ78HyQ.js";import"./use-connection-DZnUxHel.js";import"./card-CQ82z7ux.js";import"./sidebar-CVCJDFEY.js";import"./LayoutLeft-Btc5kA34.js";import"./use-mobile-Bp-djo0i.js";import"./X-DyjfKbz8.js";import"./table-Cw-KhGHY.js";import"./empty-state-BIk42_em.js";import"./use-members-Ccfmy0Gn.js";import"./use-org-auth-client-Cv2k88wA.js";import"./use-clock-tick-CAhIFZB2.js";import"./AlertCircle-CqDLg4E0.js";import"./CheckCircle-Bk4jVW7c.js";import"./Circle-C2Vu6xbB.js";import"./agent-icon-Cn3pvSY1.js";import"./Trash03-ApRuYZcp.js";import"./Tool01-TTerLlhX.js";import"./Settings02-CiDkLfc2.js";import"./Tool02-CuulG4Zm.js";import"./XCircle-C-sHcbib.js";import"./ArrowUpRight-fu_iMwrL.js";import"./TrendUp01-vfQPSjAQ.js";import"./ZapSquare-sm-ESnXi.js";import"./Users03-CoBRlJkB.js";import"./ChevronRight-e9_7KV61.js";import"./Stars02-CjLOPFO-.js";import"./Copy01-B_L_kofR.js";import"./ZoomOut-qGM7S5aC.js";import"./DotsVertical-D2l5wspb.js";import"./Globe01-BPH4QSYr.js";import"./Eye-DqWJbQD8.js";import"./FilterLines-Cp18AAlg.js";import"./Star01--k_y5js5.js";import"./Globe04-BHPtBBwM.js";import"./SwitchHorizontal01-Cx70rbaz.js";import"./HardDrive-BbOBIb1x.js";import"./Key01-MruRu6FB.js";import"./LinkExternal01-DaXyeXMC.js";import"./List-B9BMYMsL.js";import"./Monitor01-XhoZ48SW.js";import"./Sun-gdDoFC0z.js";import"./Package-D4FjGHlZ.js";import"./Palette-Qilg0lma.js";import"./Play-BinR83so.js";import"./Plus-DUEQJ6Dq.js";import"./SearchLg-CFb4RdYX.js";import"./SearchMd-ClupCW3U.js";import"./Shield01-DwhqGz1N.js";import"./Stars01-CUp5AWO9.js";import"./Trash01-D6a6rHm7.js";import"./Upload01-qHg-k01G.js";import"./User01-Bh7a4wfo.js";import"./Users01-BOa_T7-l.js";import"./XClose-hFrmy8Kh.js";import"./Zap-C54DyH6J.js";import"./use-automations-9lVGXcc7.js";import"./useSuspenseInfiniteQuery-9qA33-wr.js";import"./badge-DPo5atq1.js";import"./checkbox-Ci379OZ6.js";import"./command-D0oHu6yC.js";import"./index-D6hE8whu.js";import"./dialog-df3kXkJ6.js";import"./popover-CqoWWaG4.js";import"./avatar-Mvk4Pr6q.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-iOzmDtUv.js";import"./file-type-icon-BA-Uo760.js";import"./monaco-editor-DUt2Vaks.js";import"./index-BX44TYXY.js";import"./index-DgXATCJ-.js";import"./shell-layout-CXtvlsY5.js";import"./alert-dialog-qefhsonV.js";import"./required-auth-layout-C_gORevl.js";import"./use-org-sso-mBCV7A_Y.js";import"./integration-icon-BGWuRbhS.js";import"./use-navigate-to-agent-C6M7Wtez.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-fkEDVRVu.js";import"./form-Dn-2qr3X.js";import"./drawer-CDEnz8Vo.js";import"./collection-search-zDpqz1Y6.js";import"./tabs-2LSj3D0O.js";import"./toggle-group-Baz9dJJh.js";import"./use-deco-credits-D-zIU8pp.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-i6t_iiUW.js";import"./use-registry-connections-ByfUE9xQ.js";import"./extract-connection-data-Ds-QcBxj.js";import"./collection-tabs-CpVhSZXL.js";import"./connection-form-helpers-BHtBtUMl.js";import"./authenticate-and-persist-oauth-C5bv8dSc.js";import"./mcp-oauth-BDrL0Lxz.js";import"./connect-desktop-dialog-kTPFYpDX.js";import"./select-model-DdtZCC-h.js";import"./skeleton-B7bqRPfS.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DmXhlL47.js";import"./dropdown-menu-Bccvvqlu.js";import"./index-Dm83E3iX.js";import"./toolbar-CJdn53aQ.js";import"./use-debounced-value-C58Qyt5I.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-D1XP90rS.js";import"./use-mcp-tools-BBTNMsyU.js";import"./use-capability-CxpcJysD.js";import"./tools-list-BFSiq3Ya.js";import"./switch-jhzFDXbX.js";import"./use-debounced-autosave-CcCn7QVF.js";import"./index-DHeYoHcI.js";import"./search-input-fh_pNTUU.js";import"./github-repo-picker-DO2Q3TKU.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-DU_HoJG7.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-cxmaQW5O.js";import"./get-initials-D-f_fDFw.js";import"./calendar-BJlaa-tp.js";import"./toolbar-icon-button-D9MmLXQ-.js";import"./use-file-configs-sSRaKhuP.js";import"./automation-list-row-TWr0b03X.js";const $={authors:[{key:"name",label:"Name",widget:"text"},{key:"email",label:"Email",widget:"text",placeholder:"author@example.com"},{key:"jobTitle",label:"Job title",widget:"text"},{key:"company",label:"Company",widget:"text"},{key:"avatar",label:"Avatar",widget:"image"}]},q={authors:"Author"};function Lr(B){const t=S.c(34),{orgSlug:v,virtualMcpId:j,branch:w,kind:p,blockKey:g,block:f}=B;let y;t[0]!==w||t[1]!==v||t[2]!==j?(y={orgSlug:v,virtualMcpId:j,branch:w},t[0]=w,t[1]=v,t[2]=j,t[3]=y):y=t[3];const m=A(y);let d;t[4]!==f||t[5]!==p?(d=R(f,p),t[4]=f,t[5]=p,t[6]=d):d=t[6];const F=d;let h;t[7]!==g||t[8]!==p||t[9]!==m?(h=e=>{m.mutate({blockKey:g,data:J(g,p,e)})},t[7]=g,t[8]=p,t[9]=m,t[10]=h):h=t[10];const[i,E]=M(F,h);let k;t[11]!==i||t[12]!==E?(k=(e,o)=>E({...i,[e]:o}),t[11]=i,t[12]=E,t[13]=k):k=t[13];const a=k,N=q[p];let s;t[14]!==N?(s=r.jsx("span",{className:"text-sm font-medium",children:N}),t[14]=N,t[15]=s):s=t[15];let l;t[16]!==m.isError||t[17]!==m.isPending?(l=r.jsx(D,{isPending:m.isPending,isError:m.isError}),t[16]=m.isError,t[17]=m.isPending,t[18]=l):l=t[18];let n;t[19]!==s||t[20]!==l?(n=r.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[s,l]}),t[19]=s,t[20]=l,t[21]=n):n=t[21];const I=$[p];let c;if(t[22]!==i||t[23]!==a||t[24]!==I){let e;t[26]!==i||t[27]!==a?(e=o=>r.jsx("div",{className:"space-y-2",children:o.widget==="image"?r.jsx(K,{schema:{type:"string",format:"image-uri",title:o.label},value:i[o.key],onChange:u=>a(o.key,u),path:o.key,label:o.label}):r.jsxs(r.Fragment,{children:[r.jsx(C,{htmlFor:o.key,children:o.label}),o.widget==="textarea"?r.jsx(L,{id:o.key,value:P(i[o.key]),onChange:u=>a(o.key,u.target.value),rows:3}):r.jsx(T,{id:o.key,value:P(i[o.key]),placeholder:o.placeholder,onChange:u=>a(o.key,u.target.value),className:"h-10"})]})},o.key),t[26]=i,t[27]=a,t[28]=e):e=t[28],c=I.map(e),t[22]=i,t[23]=a,t[24]=I,t[25]=c}else c=t[25];let x;t[29]!==c?(x=r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto px-6 py-6",children:r.jsx("div",{className:"mx-auto max-w-xl space-y-6",children:c})}),t[29]=c,t[30]=x):x=t[30];let b;return t[31]!==x||t[32]!==n?(b=r.jsxs("div",{className:"flex h-full flex-col",children:[n,x]}),t[31]=x,t[32]=n,t[33]=b):b=t[33],b}export{Lr as RecordEditor};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-D80tOcFJ.js","assets/index-Bhm9Bs1H.js","assets/index-Ct4UCmlw.css","assets/Tool02-CuulG4Zm.js","assets/CheckCircle-Bk4jVW7c.js","assets/Settings02-CiDkLfc2.js","assets/use-mcp-client-Cm__SCrY.js","assets/constants-D_FQAPnt.js","assets/auth-Dz4ZnGBZ.js","assets/useInfiniteQuery-C1NVu96X.js","assets/use-infinite-scroll-BLQ78HyQ.js","assets/studio-tools-C158uWMN.js","assets/badge-DPo5atq1.js","assets/input-DospeWmi.js","assets/dropdown-menu-Bccvvqlu.js","assets/Check-CQjJylK6.js","assets/ChevronRight-e9_7KV61.js","assets/Circle-C2Vu6xbB.js","assets/table-Cw-KhGHY.js","assets/toggle-group-Baz9dJJh.js","assets/use-view-mode-B-CLvSm1.js","assets/use-mobile-Bp-djo0i.js","assets/DotsVertical-D2l5wspb.js","assets/FilterLines-Cp18AAlg.js","assets/Globe01-BPH4QSYr.js","assets/SearchMd-ClupCW3U.js","assets/dialog-df3kXkJ6.js","assets/X-DyjfKbz8.js","assets/AlertCircle-CqDLg4E0.js","assets/Upload01-qHg-k01G.js","assets/alert-dialog-qefhsonV.js","assets/card-CQ82z7ux.js","assets/Trash01-D6a6rHm7.js","assets/label-BosGIEt_.js","assets/select-b1vNfzCY.js","assets/tooltip-0Tj-MlQQ.js","assets/ChevronDown-D0HdYvxS.js","assets/ChevronUp-hFG8HdCY.js","assets/switch-jhzFDXbX.js","assets/textarea-CaTaS5aM.js","assets/XCircle-C-sHcbib.js","assets/checkbox-Ci379OZ6.js","assets/Eye-DqWJbQD8.js","assets/LinkExternal01-DaXyeXMC.js","assets/use-copy-iOzmDtUv.js","assets/Copy01-B_L_kofR.js","assets/Key01-MruRu6FB.js","assets/Plus-DUEQJ6Dq.js","assets/mcp-oauth-BDrL0Lxz.js","assets/Play-BinR83so.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as s,j as e,r as i,i as a,aX as o}from"./index-Bhm9Bs1H.js";import{R as m}from"./require-capability-Ct_Ojh8K.js";import"./use-capability-CxpcJysD.js";import"./access-gate-DU_TeSxf.js";import"./capability-load-error-BJsCCDoC.js";const n=i.lazy(()=>o(()=>import("./registry-layout-D80tOcFJ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49])));function f(){const r=s.c(1);let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(m,{capability:"registry:manage",area:"the registry",children:e.jsx(i.Suspense,{fallback:e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(a,{size:20,className:"animate-spin text-muted-foreground"})}),children:e.jsx(n,{})})}),r[0]=t):t=r[0],t}export{f as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as He,r as w,l as Ee,j as n,B as Ge,i as Hn,n as Ss,t as W,K as xs}from"./index-Bhm9Bs1H.js";import{V as ys,W as bs,X as _s,H as Un,J as zt,K as Wn,P as Gn,i as Yn,Y as js,D as qn,E as Jn,Z as ks,G as ws,_ as Rs,L as Qn,M as Rt,Q as Xn,R as Zn,N as ea,O as ta,$ as na,a0 as Ds,a1 as Dt,a2 as Ns,a3 as Vs,a4 as Cs,e as Ps,k as Ts,a5 as As,a6 as Ms,a7 as Es,a8 as Ks,r as Ot,a9 as Bt,aa as $s,ab as ut,ac as jt,ad as Os,ae as Bs,af as Je,ag as Cn,ah as Ls,ai as Pn,aj as kt,ak as Lt,al as Fs,am as sn,an as Is,ao as tt,ap as xt,aq as zs,ar as Hs,as as Us,at as Ws,au as Gs,av as Ys,aw as dt,ax as qs,ay as Js,az as Qs,aA as Tn,aB as wt,m as Xs,aC as Zs,aD as er,aE as tr,aF as nr,aG as rn,aH as An,aI as Mn,aJ as yt,aK as Ft,aL as En,aM as ar,aN as sr,aO as on,aP as rr,aQ as or,S as aa,aR as Kn,aS as ir}from"./index-CPBEAxML.js";import{t as lr}from"./ChevronDown-D0HdYvxS.js";import{n as sa}from"./Trash03-ApRuYZcp.js";import{i as ra}from"./ChevronRight-e9_7KV61.js";import{n as cr}from"./ChevronUp-hFG8HdCY.js";import{W as cn,P as oa,B as ur,X as dr,Y as mr}from"./agent-icon-Cn3pvSY1.js";import{s as ia}from"./TrendUp01-vfQPSjAQ.js";import{i as fr}from"./Globe01-BPH4QSYr.js";import{A as It}from"./automation-runs-LgYaU7NT.js";import{b as mt,T as ft,a as pt}from"./tooltip-0Tj-MlQQ.js";import{a as pr,D as hr,h as gr,c as vr,d as Sr,e as xr}from"./dialog-df3kXkJ6.js";import{I as yr}from"./input-DospeWmi.js";import{a as la}from"./Copy01-B_L_kofR.js";import{b as br}from"./ZoomOut-qGM7S5aC.js";import{i as _r}from"./Settings02-CiDkLfc2.js";import{s as jr}from"./Eye-DqWJbQD8.js";import{s as un}from"./Plus-DUEQJ6Dq.js";import{s as ca}from"./Trash01-D6a6rHm7.js";import{i as kr}from"./Zap-C54DyH6J.js";import{d as it,a as ua,D as da,c as ma,j as wr}from"./dropdown-menu-Bccvvqlu.js";import{r as $n,a as Rr,d as Dr,b as Nr,i as Vr,f as Cr,P as Pr,c as Tr,S as Ar}from"./page-seo-form-CojnY8G_.js";import{c as Mr}from"./Tool01-TTerLlhX.js";import{A as Er}from"./add-section-modal-CdFF32EI.js";import"./ArrowUp-y4qiws93.js";import"./chat-context-DWZk_XUk.js";import"./autosend-nk4Rnt6q.js";import"./hooks-hF_71sFE.js";import"./use-mcp-client-Cm__SCrY.js";import"./constants-D_FQAPnt.js";import"./auth-Dz4ZnGBZ.js";import"./decopilot-sse-pool-v_-kLso6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-C158uWMN.js";import"./use-virtual-mcp-Do4TNc3V.js";import"./use-collections-Dl176bBd.js";import"./use-ai-providers-Bp2eeB1_.js";import"./use-decopilot-events-DRFp7dsG.js";import"./tab-id-bb-jjgGv.js";import"./use-organization-settings-ChRdOQ4P.js";import"./drawer-CDEnz8Vo.js";import"./collection-search-zDpqz1Y6.js";import"./SearchMd-ClupCW3U.js";import"./use-mobile-Bp-djo0i.js";import"./AreaChart-fkEDVRVu.js";import"./index-DgXATCJ-.js";import"./X-DyjfKbz8.js";import"./shell-layout-CXtvlsY5.js";import"./avatar-Mvk4Pr6q.js";import"./User01-Bh7a4wfo.js";import"./Users03-CoBRlJkB.js";import"./SearchLg-CFb4RdYX.js";import"./Stars02-CjLOPFO-.js";import"./XClose-hFrmy8Kh.js";import"./CheckCircle-Bk4jVW7c.js";import"./FilterLines-Cp18AAlg.js";import"./alert-dialog-qefhsonV.js";import"./required-auth-layout-C_gORevl.js";import"./use-org-sso-mBCV7A_Y.js";import"./ZapSquare-sm-ESnXi.js";import"./Check-CQjJylK6.js";import"./Star01--k_y5js5.js";import"./Upload01-qHg-k01G.js";import"./AlertCircle-CqDLg4E0.js";import"./form-Dn-2qr3X.js";import"./label-BosGIEt_.js";import"./select-b1vNfzCY.js";import"./XCircle-C-sHcbib.js";import"./tabs-2LSj3D0O.js";import"./Tool02-CuulG4Zm.js";import"./toggle-group-Baz9dJJh.js";import"./use-deco-credits-D-zIU8pp.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-i6t_iiUW.js";import"./use-registry-connections-ByfUE9xQ.js";import"./use-connection-DZnUxHel.js";import"./useInfiniteQuery-C1NVu96X.js";import"./use-infinite-scroll-BLQ78HyQ.js";import"./extract-connection-data-Ds-QcBxj.js";import"./card-CQ82z7ux.js";import"./integration-icon-BGWuRbhS.js";import"./collection-tabs-CpVhSZXL.js";import"./badge-DPo5atq1.js";import"./textarea-CaTaS5aM.js";import"./connection-form-helpers-BHtBtUMl.js";import"./authenticate-and-persist-oauth-C5bv8dSc.js";import"./mcp-oauth-BDrL0Lxz.js";import"./useSuspenseInfiniteQuery-9qA33-wr.js";import"./Monitor01-XhoZ48SW.js";import"./connect-desktop-dialog-kTPFYpDX.js";import"./select-model-DdtZCC-h.js";import"./checkbox-Ci379OZ6.js";import"./skeleton-B7bqRPfS.js";import"./Key01-MruRu6FB.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DmXhlL47.js";import"./ArrowUpRight-fu_iMwrL.js";import"./Stars01-CUp5AWO9.js";import"./command-D0oHu6yC.js";import"./index-D6hE8whu.js";import"./popover-CqoWWaG4.js";import"./index-Dm83E3iX.js";import"./Palette-Qilg0lma.js";import"./file-type-icon-BA-Uo760.js";import"./toolbar-CJdn53aQ.js";import"./Package-D4FjGHlZ.js";import"./use-debounced-value-C58Qyt5I.js";import"./DotsVertical-D2l5wspb.js";import"./LinkExternal01-DaXyeXMC.js";import"./index-BX44TYXY.js";import"./LayoutLeft-Btc5kA34.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-D1XP90rS.js";import"./empty-state-BIk42_em.js";import"./use-mcp-tools-BBTNMsyU.js";import"./use-capability-CxpcJysD.js";import"./tools-list-BFSiq3Ya.js";import"./switch-jhzFDXbX.js";import"./Play-BinR83so.js";import"./use-debounced-autosave-CcCn7QVF.js";import"./index-DHeYoHcI.js";import"./sidebar-CVCJDFEY.js";import"./search-input-fh_pNTUU.js";import"./github-repo-picker-DO2Q3TKU.js";import"./use-navigate-to-agent-C6M7Wtez.js";import"./reusable-new-chat-CouMjkYR.js";import"./github-installations-D2vHSx02.js";import"./Users01-BOa_T7-l.js";import"./use-secrets-DU_HoJG7.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./format-time-BnbuEtat.js";import"./use-members-Ccfmy0Gn.js";import"./use-org-auth-client-Cv2k88wA.js";import"./index-cxmaQW5O.js";import"./get-initials-D-f_fDFw.js";import"./List-B9BMYMsL.js";import"./Circle-C2Vu6xbB.js";import"./calendar-BJlaa-tp.js";import"./toolbar-icon-button-D9MmLXQ-.js";import"./SwitchHorizontal01-Cx70rbaz.js";import"./use-file-configs-sSRaKhuP.js";import"./monaco-editor-DUt2Vaks.js";import"./use-automations-9lVGXcc7.js";import"./automation-list-row-TWr0b03X.js";import"./Globe04-BHPtBBwM.js";import"./HardDrive-BbOBIb1x.js";import"./Sun-gdDoFC0z.js";import"./Shield01-DwhqGz1N.js";import"./table-Cw-KhGHY.js";import"./use-clock-tick-CAhIFZB2.js";import"./use-copy-iOzmDtUv.js";function Kr(m){return m.schema?.definitions??m.schema?.$defs??{}}function $r(m,e){const r=Kr(e),c=r[btoa(m)];if(!c)return;let d=typeof c.image=="string"?c.image:void 0;if(!d&&Array.isArray(c.allOf)){const h=c.allOf.find(S=>typeof S.$ref=="string")?.$ref;if(typeof h=="string"){const S=h.replace("#/definitions/",""),p=r[S];d=typeof p?.image=="string"?p.image:void 0}}if(d?.includes("{{{"))return d}function Or(m,e){if(!e)return;const r=ys(m);if(!r)return;const c=$r(r.resolveType,e);if(!c)return;const d=bs(c,r.data);if(d)return _s(d)}const Br="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Lr="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function On(m){return Array.from({length:m},(e,r)=>({id:crypto.randomUUID(),index:r}))}function fa(m){return m.map((e,r)=>({...e,index:r}))}function Fr(m,e){if(e===m.length)return m;if(e<m.length)return fa(m.slice(0,e));const r=Array.from({length:e-m.length},(c,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...r]}function pa(m){const e=He.c(20),{section:r,raw:c,meta:d}=m,h=r.isSavedBlock===!0,S=r.isMultivariate===!0;let p;e[0]!==d||e[1]!==c?(p=c&&d?Or(c,d):void 0,e[0]=d,e[1]=c,e[2]=p):p=e[2];const v=p;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(br,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let b;e[4]!==v?(b=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=b):b=e[5];let C;e[6]!==S||e[7]!==h?(C=h?{color:ws}:S?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=S,e[7]=h,e[8]=C):C=e[8];let R;e[9]!==C?(R=n.jsx(cn,{className:"h-4 w-4 shrink-0",style:C}),e[9]=C,e[10]=R):R=e[10];const _=r.isHidden&&"line-through opacity-50";let k;e[11]!==_?(k=Ee("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=k):k=e[12];let o;e[13]!==r.label||e[14]!==k?(o=n.jsx("span",{className:k,children:r.label}),e[13]=r.label,e[14]=k,e[15]=o):o=e[15];let D;return e[16]!==b||e[17]!==R||e[18]!==o?(D=n.jsxs(n.Fragment,{children:[g,b,R,o]}),e[16]=b,e[17]=R,e[18]=o,e[19]=D):D=e[19],D}function ha(m,e){const r=m.isSavedBlock===!0,c=m.isMultivariate===!0;return Ee("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?Br:c?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Ir(m){const e=He.c(64),{section:r,raw:c,meta:d,sortableId:h,selected:S,onSelect:p,onDelete:v,onDuplicate:g,onMakeReusable:b,onToggleHidden:C,onToggleLazy:R,onAddVariant:_,onDetach:k}=m,o=c?Yn(c.__resolveType??""):!1;let D;e[0]!==r?(D=js(r),e[0]=r,e[1]=D):D=e[1];const l=D;let J;e[2]!==h?(J={id:h,animateLayoutChanges:Gr},e[2]=h,e[3]=J):J=e[3];const{attributes:H,listeners:K,setNodeRef:u,transform:P,isDragging:se}=qn(J);let T;e[4]!==P?(T=Jn.Transform.toString(P?{...P,x:0}:null),e[4]=P,e[5]=T):T=e[5];const pe=se?0:void 0;let N;e[6]!==T||e[7]!==pe?(N={transform:T,opacity:pe},e[6]=T,e[7]=pe,e[8]=N):N=e[8];const ce=N;let B;e[9]!==r?(B=ks(r),e[9]=r,e[10]=B):B=e[10];const te=B,oe="button",Ce=0;let E;e[11]!==p?(E=$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),p())},e[11]=p,e[12]=E):E=e[12];const ue=se?"cursor-grabbing":"cursor-pointer";let ie;e[13]!==r||e[14]!==S||e[15]!==ue?(ie=Ee("touch-none transition-colors",ue,ha(r,S)),e[13]=r,e[14]=S,e[15]=ue,e[16]=ie):ie=e[16];let je;e[17]!==d||e[18]!==c||e[19]!==r?(je=n.jsx(pa,{section:r,raw:c,meta:d}),e[17]=d,e[18]=c,e[19]=r,e[20]=je):je=e[20];const M=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Ee("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),R()},onPointerDown:Wr,children:n.jsx(kr,{className:Ee("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(pt,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let Ae;e[21]!==C||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(Ae=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Ee("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),C()},onPointerDown:Ur,children:r.isHidden?n.jsx(_r,{className:"h-3.5 w-3.5"}):n.jsx(jr,{className:"h-3.5 w-3.5"})})}),n.jsx(pt,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=C,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=Ae):Ae=e[24];let X;e[25]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(ua,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Hr,onPointerDown:zr,children:n.jsx(oa,{className:"h-3.5 w-3.5"})})}),e[25]=X):X=e[25];let Ne;e[26]!==g?(Ne=$=>{$.stopPropagation(),g()},e[26]=g,e[27]=Ne):Ne=e[27];let ve;e[28]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(la,{className:"h-4 w-4"}),e[28]=ve):ve=e[28];let re;e[29]!==Ne?(re=n.jsxs(it,{onClick:Ne,children:[ve,"Duplicate"]}),e[29]=Ne,e[30]=re):re=e[30];let G;e[31]!==l||e[32]!==_?(G=l&&n.jsxs(it,{className:Rs,onClick:$=>{$.stopPropagation(),_()},children:[n.jsx(ia,{className:"h-4 w-4"}),"Add variant"]}),e[31]=l,e[32]=_,e[33]=G):G=e[33];let Y;e[34]!==te||e[35]!==b?(Y=te&&n.jsxs(it,{className:Lr,onClick:$=>{$.stopPropagation(),b()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=te,e[35]=b,e[36]=Y):Y=e[36];let ne;e[37]!==k||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(ne=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(it,{onClick:$=>{$.stopPropagation(),k()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Detach"]}),e[37]=k,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=ne):ne=e[40];let le;e[41]!==v?(le=$=>{$.stopPropagation(),v()},e[41]=v,e[42]=le):le=e[42];let ke;e[43]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(ca,{className:"h-4 w-4"}),e[43]=ke):ke=e[43];let Se;e[44]!==le?(Se=n.jsxs(it,{className:"text-destructive focus:text-destructive",onClick:le,children:[ke,"Delete"]}),e[44]=le,e[45]=Se):Se=e[45];let de;e[46]!==re||e[47]!==G||e[48]!==Y||e[49]!==ne||e[50]!==Se?(de=n.jsxs(da,{children:[X,n.jsxs(ma,{align:"end",className:"w-44",children:[re,G,Y,ne,Se]})]}),e[46]=re,e[47]=G,e[48]=Y,e[49]=ne,e[50]=Se,e[51]=de):de=e[51];let be;return e[52]!==H||e[53]!==K||e[54]!==p||e[55]!==u||e[56]!==ce||e[57]!==ie||e[58]!==je||e[59]!==M||e[60]!==Ae||e[61]!==de||e[62]!==E?(be=n.jsxs("div",{ref:u,style:ce,...H,...K,role:oe,tabIndex:Ce,onClick:p,onKeyDown:E,className:ie,children:[je,M,Ae,de]}),e[52]=H,e[53]=K,e[54]=p,e[55]=u,e[56]=ce,e[57]=ie,e[58]=je,e[59]=M,e[60]=Ae,e[61]=de,e[62]=E,e[63]=be):be=e[63],be}function zr(m){return m.stopPropagation()}function Hr(m){return m.stopPropagation()}function Ur(m){return m.stopPropagation()}function Wr(m){return m.stopPropagation()}function Gr(){return!1}function Yr(m){const e=He.c(90),{listKey:r,rawSections:c,sections:d,meta:h,selectedIndex:S,onSelect:p,onReorder:v,onDelete:g,onDuplicate:b,onMakeReusable:C,onToggleHidden:R,onToggleLazy:_,onAddVariant:k,onDetach:o,onAddSection:D,canAddSection:l}=m,J=l===void 0?!0:l;let H;e[0]!==d.length?(H=()=>On(d.length),e[0]=d.length,e[1]=H):H=e[1];const[K,u]=w.useState(H),[P,se]=w.useState(null),[T,pe]=w.useState(r),[N,ce]=w.useState(d.length),B=w.useRef(!1);T!==r?(pe(r),ce(d.length),u(On(d.length))):N!==d.length&&(ce(d.length),u(L=>Fr(L,d.length)));let te;e[2]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[2]=te):te=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:Qn},e[3]=oe):oe=e[3];const Ce=Un(zt(Gn,te),zt(Wn,oe));let E;e[4]!==K?(E=K.map(qr),e[4]=K,e[5]=E):E=e[5];const ue=E;let ie;e[6]===Symbol.for("react.memo_cache_sentinel")?(ie=L=>{se(String(L.active.id))},e[6]=ie):ie=e[6];const je=ie;let M;e[7]!==ue||e[8]!==v?(M=L=>{se(null);const{active:ae,over:Q}=L;if(!Q||ae.id===Q.id)return;const Ie=ue.indexOf(String(ae.id)),he=ue.indexOf(String(Q.id));Ie===-1||he===-1||(u(Qe=>fa(Rt([...Qe],Ie,he))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),v?.(Ie,he))},e[7]=ue,e[8]=v,e[9]=M):M=e[9];const Ae=M;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{se(null)},e[10]=X):X=e[10];const Ne=X;let ve,re,G,Y,ne,le,ke,Se,de,be,$,Z,we,Ke,$e;if(e[11]!==P||e[12]!==J||e[13]!==K||e[14]!==ue||e[15]!==Ae||e[16]!==h||e[17]!==D||e[18]!==k||e[19]!==g||e[20]!==o||e[21]!==b||e[22]!==C||e[23]!==p||e[24]!==R||e[25]!==_||e[26]!==c||e[27]!==d||e[28]!==S||e[29]!==Ce){Ke=Symbol.for("react.early_return_sentinel");e:{const L=ae=>{B.current||p(ae)};if(e[45]!==P||e[46]!==J||e[47]!==K||e[48]!==D||e[49]!==c||e[50]!==d){const ae=P?K.find(Q=>Q.id===P):null;if(Y=ae!=null?d[ae.index]:null,G=ae!=null?c[ae.index]:void 0,K.length===0){let Q;e[54]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=Q):Q=e[54];const Ie=!J;let he;e[55]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(un,{size:14}),e[55]=he):he=e[55];let Qe;e[56]!==D||e[57]!==Ie?(Qe=n.jsxs("div",{className:"space-y-2",children:[Q,n.jsxs(Ge,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ie,onClick:D,children:[he,"Add section"]})]}),e[56]=D,e[57]=Ie,e[58]=Qe):Qe=e[58],Ke=Qe;break e}we=Ee(ae&&"cursor-grabbing"),e[45]=P,e[46]=J,e[47]=K,e[48]=D,e[49]=c,e[50]=d,e[51]=G,e[52]=Y,e[53]=we}else G=e[51],Y=e[52],we=e[53];re=Xn,Se=Ce,de=Zn,be=je,$=Ae,Z=Ne,ve=ea,le=ue,ke=ta,$e="space-y-1",ne=K.map(ae=>{const Q=d[ae.index];return Q?n.jsx(Ir,{sortableId:ae.id,section:Q,raw:c[ae.index],meta:h,selected:S===ae.index,onSelect:()=>L(ae.index),onDelete:()=>g(ae.index),onDuplicate:()=>b(ae.index),onMakeReusable:()=>C(ae.index),onToggleHidden:()=>R(ae.index),onToggleLazy:()=>_(ae.index),onAddVariant:()=>k(ae.index),onDetach:()=>o(ae.index)},ae.id):null})}e[11]=P,e[12]=J,e[13]=K,e[14]=ue,e[15]=Ae,e[16]=h,e[17]=D,e[18]=k,e[19]=g,e[20]=o,e[21]=b,e[22]=C,e[23]=p,e[24]=R,e[25]=_,e[26]=c,e[27]=d,e[28]=S,e[29]=Ce,e[30]=ve,e[31]=re,e[32]=G,e[33]=Y,e[34]=ne,e[35]=le,e[36]=ke,e[37]=Se,e[38]=de,e[39]=be,e[40]=$,e[41]=Z,e[42]=we,e[43]=Ke,e[44]=$e}else ve=e[30],re=e[31],G=e[32],Y=e[33],ne=e[34],le=e[35],ke=e[36],Se=e[37],de=e[38],be=e[39],$=e[40],Z=e[41],we=e[42],Ke=e[43],$e=e[44];if(Ke!==Symbol.for("react.early_return_sentinel"))return Ke;let Le;e[59]!==ne||e[60]!==$e?(Le=n.jsx("div",{className:$e,children:ne}),e[59]=ne,e[60]=$e,e[61]=Le):Le=e[61];let Pe;e[62]!==ve||e[63]!==le||e[64]!==ke||e[65]!==Le?(Pe=n.jsx(ve,{items:le,strategy:ke,children:Le}),e[62]=ve,e[63]=le,e[64]=ke,e[65]=Le,e[66]=Pe):Pe=e[66];let Oe;e[67]!==G||e[68]!==Y||e[69]!==h?(Oe=Y?n.jsx("div",{className:Ee("cursor-grabbing shadow-lg ring-1 ring-border/60",ha(Y,!1)),children:n.jsx(pa,{section:Y,raw:G,meta:h})}):null,e[67]=G,e[68]=Y,e[69]=h,e[70]=Oe):Oe=e[70];let Fe;e[71]!==Oe?(Fe=n.jsx(na,{dropAnimation:null,children:Oe}),e[71]=Oe,e[72]=Fe):Fe=e[72];let Me;e[73]!==re||e[74]!==Se||e[75]!==de||e[76]!==be||e[77]!==$||e[78]!==Z||e[79]!==Pe||e[80]!==Fe?(Me=n.jsxs(re,{sensors:Se,collisionDetection:de,onDragStart:be,onDragEnd:$,onDragCancel:Z,children:[Pe,Fe]}),e[73]=re,e[74]=Se,e[75]=de,e[76]=be,e[77]=$,e[78]=Z,e[79]=Pe,e[80]=Fe,e[81]=Me):Me=e[81];const xe=!J;let Re;e[82]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(un,{size:14}),e[82]=Re):Re=e[82];let me;e[83]!==D||e[84]!==xe?(me=n.jsxs(Ge,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:xe,onClick:D,children:[Re,"Add section"]}),e[83]=D,e[84]=xe,e[85]=me):me=e[85];let ee;return e[86]!==we||e[87]!==Me||e[88]!==me?(ee=n.jsxs("div",{className:we,children:[Me,me]}),e[86]=we,e[87]=Me,e[88]=me,e[89]=ee):ee=e[89],ee}function qr(m){return m.id}function Bn(m){const e=He.c(38),{open:r,initialName:c,autoLabel:d,isPending:h,onSubmit:S,onOpenChange:p}=m,v=h===void 0?!1:h,[g,b]=w.useState(c),[C,R]=w.useState(r);r!==C&&(R(r),r&&b(c));let _;e[0]!==v||e[1]!==p?(_=oe=>{!oe&&!v&&p(!1)},e[0]=v,e[1]=p,e[2]=_):_=e[2];const k=_;let o;e[3]!==v||e[4]!==g||e[5]!==S?(o=async oe=>{oe.preventDefault(),!v&&await S(g.trim())},e[3]=v,e[4]=g,e[5]=S,e[6]=o):o=e[6];const D=o;let l;e[7]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(pr,{children:"Rename variant"}),e[7]=l):l=e[7];const J=d||"the rule";let H;e[8]!==J?(H=n.jsxs(hr,{children:[l,n.jsxs(gr,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",n.jsx("span",{className:"font-medium",children:J}),"."]})]}),e[8]=J,e[9]=H):H=e[9];let K;e[10]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=K):K=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=oe=>b(oe.target.value),e[11]=u):u=e[11];let P;e[12]!==d||e[13]!==v||e[14]!==g?(P=n.jsxs("div",{className:"space-y-1.5 py-4",children:[K,n.jsx(yr,{id:"variant-rename-name",value:g,onChange:u,placeholder:d,autoFocus:!0,disabled:v})]}),e[12]=d,e[13]=v,e[14]=g,e[15]=P):P=e[15];let se;e[16]!==p?(se=()=>p(!1),e[16]=p,e[17]=se):se=e[17];let T;e[18]!==v||e[19]!==se?(T=n.jsx(Ge,{type:"button",variant:"outline",onClick:se,disabled:v,children:"Cancel"}),e[18]=v,e[19]=se,e[20]=T):T=e[20];let pe;e[21]!==v?(pe=v?n.jsxs(n.Fragment,{children:[n.jsx(Hn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=v,e[22]=pe):pe=e[22];let N;e[23]!==v||e[24]!==pe?(N=n.jsx(Ge,{type:"submit",disabled:v,children:pe}),e[23]=v,e[24]=pe,e[25]=N):N=e[25];let ce;e[26]!==T||e[27]!==N?(ce=n.jsxs(vr,{children:[T,N]}),e[26]=T,e[27]=N,e[28]=ce):ce=e[28];let B;e[29]!==D||e[30]!==ce||e[31]!==H||e[32]!==P?(B=n.jsx(Sr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:D,children:[H,P,ce]})}),e[29]=D,e[30]=ce,e[31]=H,e[32]=P,e[33]=B):B=e[33];let te;return e[34]!==k||e[35]!==r||e[36]!==B?(te=n.jsx(xr,{open:r,onOpenChange:k,children:B}),e[34]=k,e[35]=r,e[36]=B,e[37]=te):te=e[37],te}const Jr="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",ga="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function va(m){const e=He.c(5),{rule:r,matchers:c}=m,d=r?.__resolveType??"";let h;if(e[0]!==c||e[1]!==d){const g=c.find(b=>b.resolveType===d)?.iconName??Ds(d);h=ur(g),e[0]=c,e[1]=d,e[2]=h}else h=e[2];const S=h;if(!S)return null;let p;return e[3]!==S?(p=n.jsx(S,{size:14,className:"shrink-0"}),e[3]=S,e[4]=p):p=e[4],p}function Ln(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
-
`)}function ln(m){return m.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Qr(m){return m.map((e,r)=>({...e,index:r}))}function Sa(m){const e=He.c(16),{label:r,effectiveRule:c,matchers:d,canDelete:h,dragging:S,onRename:p,onDuplicate:v,onDelete:g}=m;let b;e[0]!==c||e[1]!==d?(b=n.jsx(va,{rule:c,matchers:d}),e[0]=c,e[1]=d,e[2]=b):b=e[2];let C;e[3]!==r?(C=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:r}),e[3]=r,e[4]=C):C=e[4];let R;e[5]!==h||e[6]!==S||e[7]!==r||e[8]!==g||e[9]!==v||e[10]!==p?(R=!S&&n.jsxs(da,{children:[n.jsx(ua,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":`Actions for ${r}`,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Zr,onPointerDown:Xr,children:n.jsx(oa,{size:14})})}),n.jsxs(ma,{align:"end",className:"w-36",children:[n.jsxs(it,{onClick:k=>{k.stopPropagation(),p?.()},children:[n.jsx(Mr,{size:14}),"Rename"]}),n.jsxs(it,{onClick:k=>{k.stopPropagation(),v?.()},children:[n.jsx(la,{size:14}),"Duplicate"]}),n.jsx(wr,{}),n.jsxs(it,{variant:"destructive",disabled:!h,onClick:k=>{k.stopPropagation(),g?.()},children:[n.jsx(ca,{size:14}),"Delete"]})]})]}),e[5]=h,e[6]=S,e[7]=r,e[8]=g,e[9]=v,e[10]=p,e[11]=R):R=e[11];let _;return e[12]!==b||e[13]!==C||e[14]!==R?(_=n.jsxs(n.Fragment,{children:[b,C,R]}),e[12]=b,e[13]=C,e[14]=R,e[15]=_):_=e[15],_}function Xr(m){return m.stopPropagation()}function Zr(m){return m.stopPropagation()}function eo(m){const e=He.c(33),{entry:r,sortableId:c,isActive:d,canDelete:h,decofile:S,meta:p,matchers:v,onSelect:g,onRename:b,onDuplicate:C,onDelete:R}=m;let _;e[0]!==c?(_={id:c,animateLayoutChanges:to},e[0]=c,e[1]=_):_=e[1];const{attributes:k,listeners:o,setNodeRef:D,transform:l,isDragging:J}=qn(_);let H;e[2]!==l?(H=Jn.Transform.toString(l?{...l,x:0}:null),e[2]=l,e[3]=H):H=e[3];const K=J?0:void 0;let u;e[4]!==H||e[5]!==K?(u={transform:H,opacity:K},e[4]=H,e[5]=K,e[6]=u):u=e[6];const P=u,se=p??void 0;let T;e[7]!==S||e[8]!==r.variant.rule||e[9]!==se?(T=Dt(r.variant.rule,S,se),e[7]=S,e[8]=r.variant.rule,e[9]=se,e[10]=T):T=e[10];const pe=T;let N;e[11]!==g?(N=E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),g())},e[11]=g,e[12]=N):N=e[12];const ce=J?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",B=d?ga:Jr;let te;e[13]!==ce||e[14]!==B?(te=Ee("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",ce,B),e[13]=ce,e[14]=B,e[15]=te):te=e[15];let oe;e[16]!==h||e[17]!==pe||e[18]!==r.variant.label||e[19]!==v||e[20]!==R||e[21]!==C||e[22]!==b?(oe=n.jsx(Sa,{label:r.variant.label,effectiveRule:pe,matchers:v,canDelete:h,onRename:b,onDuplicate:C,onDelete:R}),e[16]=h,e[17]=pe,e[18]=r.variant.label,e[19]=v,e[20]=R,e[21]=C,e[22]=b,e[23]=oe):oe=e[23];let Ce;return e[24]!==k||e[25]!==o||e[26]!==g||e[27]!==D||e[28]!==P||e[29]!==te||e[30]!==oe||e[31]!==N?(Ce=n.jsx("div",{ref:D,style:P,...k,...o,onClick:g,onKeyDown:N,className:te,children:oe}),e[24]=k,e[25]=o,e[26]=g,e[27]=D,e[28]=P,e[29]=te,e[30]=oe,e[31]=N,e[32]=Ce):Ce=e[32],Ce}function to(){return!1}function no(m){const e=He.c(9),{variant:r,decofile:c,meta:d,matchers:h}=m,S=d??void 0;let p;e[0]!==c||e[1]!==S||e[2]!==r.rule?(p=Dt(r.rule,c,S),e[0]=c,e[1]=S,e[2]=r.rule,e[3]=p):p=e[3];const v=p;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Ee("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",ga),e[4]=g):g=e[4];let b;return e[5]!==v||e[6]!==h||e[7]!==r.label?(b=n.jsx("div",{className:g,children:n.jsx(Sa,{label:r.label,effectiveRule:v,matchers:h,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=h,e[7]=r.label,e[8]=b):b=e[8],b}function ao(m){const e=He.c(77),{listKey:r,variants:c,activeIndex:d,decofile:h,meta:S,matchers:p,onSelect:v,onReorder:g,onRename:b,onDuplicate:C,onDelete:R,onAdd:_}=m;let k;e[0]!==c?(k=()=>ln(c),e[0]=c,e[1]=k):k=e[1];const[o,D]=w.useState(k),[l,J]=w.useState(null),[H,K]=w.useState(r),[u,P]=w.useState(c.length);let se;e[2]!==c?(se=()=>Ln(c),e[2]=c,e[3]=se):se=e[3];const[T,pe]=w.useState(se),N=w.useRef(!1),ce=Ln(c);H!==r?(K(r),P(c.length),pe(ce),D(ln(c))):u!==c.length?(P(c.length),pe(ce),D(ln(c))):T!==ce&&(pe(ce),D(Me=>c.map((xe,Re)=>({id:Me[Re]?.id??crypto.randomUUID(),index:Re,variant:xe}))));let B;e[4]===Symbol.for("react.memo_cache_sentinel")?(B={activationConstraint:{distance:8}},e[4]=B):B=e[4];let te;e[5]===Symbol.for("react.memo_cache_sentinel")?(te={coordinateGetter:Qn},e[5]=te):te=e[5];const oe=Un(zt(Gn,B),zt(Wn,te));let Ce;e[6]!==o?(Ce=o.map(so),e[6]=o,e[7]=Ce):Ce=e[7];const E=Ce,ue=c.length>1;let ie;e[8]!==o?(ie=Me=>{const xe=String(Me.active.id);J(o.find(Re=>Re.id===xe)??null)},e[8]=o,e[9]=ie):ie=e[9];const je=ie;let M;e[10]!==E||e[11]!==g?(M=Me=>{J(null);const{active:xe,over:Re}=Me;if(!Re||xe.id===Re.id)return;const me=E.indexOf(String(xe.id)),ee=E.indexOf(String(Re.id));me===-1||ee===-1||(D(L=>Qr(Rt([...L],me,ee))),N.current=!0,requestAnimationFrame(()=>{N.current=!1}),g(me,ee))},e[10]=E,e[11]=g,e[12]=M):M=e[12];const Ae=M;let X;e[13]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{J(null)},e[13]=X):X=e[13];const Ne=X;let ve,re,G,Y,ne,le,ke,Se,de,be,$,Z,we;if(e[14]!==d||e[15]!==ue||e[16]!==h||e[17]!==o||e[18]!==E||e[19]!==Ae||e[20]!==je||e[21]!==p||e[22]!==S||e[23]!==_||e[24]!==R||e[25]!==C||e[26]!==b||e[27]!==v||e[28]!==oe){const Me=L=>{N.current||v(L)};$="space-y-1 border-b p-2";let xe;e[42]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[42]=xe):xe=e[42];let Re;e[43]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(un,{size:14}),e[43]=Re):Re=e[43];let me;e[44]!==_?(me=n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-6",onClick:_,children:Re})}),e[44]=_,e[45]=me):me=e[45];let ee;e[46]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(pt,{children:"Add variant"}),e[46]=ee):ee=e[46],e[47]!==me?(Z=n.jsxs("div",{className:"flex items-center justify-between",children:[xe,n.jsxs(mt,{children:[me,ee]})]}),e[47]=me,e[48]=Z):Z=e[48],re=Xn,le=oe,ke=Zn,Se=je,de=Ae,be=Ne,ve=ea,Y=E,ne=ta,we="space-y-0.5",G=o.map(L=>n.jsx(eo,{sortableId:L.id,entry:L,isActive:L.index===d,canDelete:ue,decofile:h,meta:S,matchers:p,onSelect:()=>Me(L.index),onRename:()=>b(L.index),onDuplicate:()=>C(L.index),onDelete:()=>R(L.index)},L.id)),e[14]=d,e[15]=ue,e[16]=h,e[17]=o,e[18]=E,e[19]=Ae,e[20]=je,e[21]=p,e[22]=S,e[23]=_,e[24]=R,e[25]=C,e[26]=b,e[27]=v,e[28]=oe,e[29]=ve,e[30]=re,e[31]=G,e[32]=Y,e[33]=ne,e[34]=le,e[35]=ke,e[36]=Se,e[37]=de,e[38]=be,e[39]=$,e[40]=Z,e[41]=we}else ve=e[29],re=e[30],G=e[31],Y=e[32],ne=e[33],le=e[34],ke=e[35],Se=e[36],de=e[37],be=e[38],$=e[39],Z=e[40],we=e[41];let Ke;e[49]!==G||e[50]!==we?(Ke=n.jsx("div",{className:we,children:G}),e[49]=G,e[50]=we,e[51]=Ke):Ke=e[51];let $e;e[52]!==ve||e[53]!==Y||e[54]!==ne||e[55]!==Ke?($e=n.jsx(ve,{items:Y,strategy:ne,children:Ke}),e[52]=ve,e[53]=Y,e[54]=ne,e[55]=Ke,e[56]=$e):$e=e[56];let Le;e[57]!==l||e[58]!==h||e[59]!==p||e[60]!==S?(Le=l?n.jsx(no,{variant:l.variant,decofile:h,meta:S,matchers:p}):null,e[57]=l,e[58]=h,e[59]=p,e[60]=S,e[61]=Le):Le=e[61];let Pe;e[62]!==Le?(Pe=n.jsx(na,{dropAnimation:null,children:Le}),e[62]=Le,e[63]=Pe):Pe=e[63];let Oe;e[64]!==re||e[65]!==le||e[66]!==ke||e[67]!==Se||e[68]!==de||e[69]!==be||e[70]!==$e||e[71]!==Pe?(Oe=n.jsxs(re,{sensors:le,collisionDetection:ke,onDragStart:Se,onDragEnd:de,onDragCancel:be,children:[$e,Pe]}),e[64]=re,e[65]=le,e[66]=ke,e[67]=Se,e[68]=de,e[69]=be,e[70]=$e,e[71]=Pe,e[72]=Oe):Oe=e[72];let Fe;return e[73]!==$||e[74]!==Z||e[75]!==Oe?(Fe=n.jsxs("div",{className:$,children:[Z,Oe]}),e[73]=$,e[74]=Z,e[75]=Oe,e[76]=Fe):Fe=e[76],Fe}function so(m){return m.id}function Fn(m){const e=He.c(15),{schema:r,value:c,onChange:d,meta:h,decofile:S,onSaveReferencedBlock:p,sandbox:v}=m;let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[b,C]=w.useState(g);let R;e[1]!==b?(R=b.length>0&&n.jsxs("nav",{"aria-label":"Variant rule breadcrumb",className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>C([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:"Back to rule",children:n.jsx(sa,{className:"size-3.5"})}),b.map((o,D)=>{const l=D===b.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[D>0&&n.jsx(ra,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>C(b.slice(0,D+1)),title:o,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",l?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${D}`)})]}),e[1]=b,e[2]=R):R=e[2];let _;e[3]!==b||e[4]!==S||e[5]!==h||e[6]!==d||e[7]!==p||e[8]!==v||e[9]!==r||e[10]!==c?(_=n.jsx(aa,{schema:r,value:c,onChange:d,basePath:"",breadcrumbPath:b,onBreadcrumbChange:C,meta:h,decofile:S,onSaveReferencedBlock:p,sandbox:v}),e[3]=b,e[4]=S,e[5]=h,e[6]=d,e[7]=p,e[8]=v,e[9]=r,e[10]=c,e[11]=_):_=e[11];let k;return e[12]!==R||e[13]!==_?(k=n.jsxs("div",{className:"space-y-2",children:[R,_]}),e[12]=R,e[13]=_,e[14]=k):k=e[14],k}function In(m){const e=He.c(21),{activeSchema:r,formValue:c,formResetKey:d,onFormChange:h,onBreadcrumbChange:S,breadcrumbPath:p,emptyMessage:v,beforeForm:g,seoResolveType:b,siteDefaultSeo:C,meta:R,decofile:_,onSaveReferencedBlock:k,sandbox:o}=m;let D;e[0]!==p?(D=p===void 0?[]:p,e[0]=p,e[1]=D):D=e[1];const l=D;let J;e[2]!==r||e[3]!==l||e[4]!==_||e[5]!==d||e[6]!==c||e[7]!==R||e[8]!==S||e[9]!==h||e[10]!==k||e[11]!==o||e[12]!==b||e[13]!==C?(J=r&&c?b?n.jsx(Ar,{schema:r,resolveType:b,value:c,formResetKey:d,onChange:h,onBreadcrumbChange:S,siteDefaultSeo:C}):n.jsx(aa,{schema:r,value:c,onChange:h,basePath:"",breadcrumbPath:l,onBreadcrumbChange:S,meta:R,decofile:_,onSaveReferencedBlock:k,sandbox:o},d):null,e[2]=r,e[3]=l,e[4]=_,e[5]=d,e[6]=c,e[7]=R,e[8]=S,e[9]=h,e[10]=k,e[11]=o,e[12]=b,e[13]=C,e[14]=J):J=e[14];const H=J;let K;e[15]!==v||e[16]!==H?(K=H??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[15]=v,e[16]=H,e[17]=K):K=e[17];let u;return e[18]!==g||e[19]!==K?(u=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[g,K]})}),e[18]=g,e[19]=K,e[20]=u):u=e[20],u}const ro="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function oo(m,e){return zs(m,e,tt)}function io(m){const e=He.c(13),{pageKey:r,initialName:c,initialPath:d,onFieldChange:h}=m,[S,p]=w.useState(c),[v,g]=w.useState(d),[b,C]=w.useState(r);b!==r&&(C(r),p(c),g(d));let R;e[0]!==h?(R=l=>{p(l.target.value),h("name",l.target.value)},e[0]=h,e[1]=R):R=e[1];let _;e[2]!==S||e[3]!==R?(_=n.jsx("input",{type:"text",value:S,onChange:R,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"Page name"}),e[2]=S,e[3]=R,e[4]=_):_=e[4];let k;e[5]!==h?(k=l=>{g(l.target.value),h("path",l.target.value)},e[5]=h,e[6]=k):k=e[6];let o;e[7]!==v||e[8]!==k?(o=n.jsx("input",{type:"text",value:v,onChange:k,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"/path"}),e[7]=v,e[8]=k,e[9]=o):o=e[9];let D;return e[10]!==_||e[11]!==o?(D=n.jsxs("div",{className:"space-y-1",children:[_,o]}),e[10]=_,e[11]=o,e[12]=D):D=e[12],D}function zn(m){const e=He.c(6),{onClick:r}=m;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ia,{size:14}),e[0]=c):c=e[0];let d;e[1]!==r?(d=n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:r,children:c})}),e[1]=r,e[2]=d):d=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(pt,{side:"bottom",children:"Add variant"}),e[3]=h):h=e[3];let S;return e[4]!==d?(S=n.jsxs(mt,{children:[d,h]}),e[4]=d,e[5]=S):S=e[5],S}function ec({orgSlug:m,virtualMcpId:e,branch:r,previewReady:c=!0,previewUrl:d,currentPath:h,activePageBlockKey:S=null,activeGlobalBlockKey:p=null,externalSelectedIndex:v,onSaved:g,initialEditSeo:b=!1,onExitSeo:C,onViewJsonFile:R,onVariantPreviewOverride:_}){const k=c?{orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d}:null,{data:o,isLoading:D}=Ns(k),{data:l,isLoading:J}=Vs(k),H=Cs(),K=H?.entity?.id===e?H.entity.metadata?.siteSlug??null:null,[u,P]=w.useState(null),[se,T]=w.useState(null),[pe,N]=w.useState(null),[ce,B]=w.useState(0),[te,oe]=w.useState(void 0),[Ce,E]=w.useState(null),[ue,ie]=w.useState(null),[je,M]=w.useState([]),[Ae,X]=w.useState(0),[Ne,ve]=w.useState(null),[re,G]=w.useState(null),[Y,ne]=w.useState(null),[le,ke]=w.useState(!0),[Se,de]=w.useState(!1),[be,$]=w.useState(!1),[Z,we]=w.useState(b),[Ke,$e]=w.useState(b);b&&!Ke&&($e(!0),we(!0),P(null),T(null),N(null),M([])),!b&&Ke&&$e(!1);const[Le,Pe]=w.useState(null),[Oe,Fe]=w.useState(void 0),[Me,xe]=w.useState([]),[Re,me]=w.useState(0),[ee,L]=w.useState(0),[ae,Q]=w.useState(null),[Ie,he]=w.useState(null),[Qe,dn]=w.useState(null),xa=Ss(),ya=`${m}/${e}/${r}`,Ht=Ps({orgSlug:m,virtualMcpId:e,branch:r}),[ba,_a]=w.useState(h),[ja,ka]=w.useState(S),[wa,Ra]=w.useState(p);(ba!==h||ja!==S||wa!==p)&&(queueMicrotask(()=>Ht.flush()),_a(h),ka(S),Ra(p),P(null),T(null),N(null),B(0),E(null),ie(null),L(0),Q(null),he(null),M([]),X(t=>t+1),we(!1),Pe(null),Fe(void 0),xe([]),me(t=>t+1));const ye=Ts({orgSlug:m,virtualMcpId:e,branch:r}),Nt=Xs((t,a)=>{ye.mutate({blockKey:t,data:a},{onSuccess:()=>g?.(),onError:s=>W.error(`Save failed: ${s.message}`)})}),Ut=As({orgSlug:m,virtualMcpId:e,branch:r}),[bt,Vt]=w.useState(!1),Wt=w.useRef(null),ht=w.useRef(null),gt=w.useRef(null),Gt=w.useRef({}),Ye=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!c||D||J)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Hn,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const Da=Ms(o),_e=!!p,ze=_e?null:Es(Da,h,S),j=_e?p:ze?.key??null,Yt=_e&&p?o[p]:void 0,mn=_e&&p&&Yt?Ks(p,Yt):_e&&p?p:"",Ct=!_e&&j&&o[j]?o[j]:null,qt=Z&&o&&l&&j&&ze?$n(o,{kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},l):null,Na=Z?Ct?.seo:void 0,Jt=Oe!==void 0?Oe:Na,Va=Z?Rr(Jt):void 0,Ca=qt?.seoTypeOptions??[],Pa=Z&&l?Dr(l):"",fn=Le??Va??{},Qt=Z&&qt?Nr(fn,qt):null,Ta=Z&&Qt&&Vr(Jt)?Ot(Qt,l):null,Aa=Z?Cr(o,l)?.seoData:void 0,Be=_e?[{label:"Default",sections:[{__resolveType:p}]}]:oo(Ct?.sections,o??{}),Pt=Be.length>1,Ve=Math.min(ce,Be.length-1),nt=Be[Ve],I=nt?.sections??[],Te=Bt(I,o),pn=!_e&&$s(Ct?.sections);if(_e&&p&&Qe!==p){dn(p);const t=I[0],a=Te[0];if(t&&a){P(0),L(0),M([]);const s=ut(t,a,o);s&&(T(s.data),N(s.resolveType),he(null),Q(null))}}!_e&&Qe!==null&&dn(null),Ye.current={rawSections:I,parsedSections:Te,decofile:o??{},activePageKey:j,pageVariants:Be,variantIndex:Ve,sectionVariantIndex:ee,selectedSectionIndex:u};const Ma=()=>({multivariate:pn,index:Ve,variants:Be.map(t=>({rule:t.rule}))}),hn=(t,a)=>{if(!_)return;if(!j||!pn||t.length<=1){_(null);return}const s=En(j,{multivariate:!0,index:a,variants:t},o,l);_(s.length>0?s:null)},vt=(t,a,s)=>{if(!_)return;if(!j){_(null);return}const i=Ma(),f=En(j,i,o,l);if(!t||a<0){_(f.length>0?f:null);return}const y=ar({pageKey:j,page:i,sectionIndex:a,sectionLazy:Te[a]?.isLazy??!1,mvObj:t,selectedVariantIndex:s,decofile:o,meta:l}),x=[...f,...y];_(x.length>0?x:null)},at=(t,a,s,i=u??-1,f=!1)=>{const y=Je(t,a);if(!y){T(null),N(null),he(null),Q(null),f&&vt(null,i,s);return}const V=Cn(y,tt)[s];if(!V){T(null),N(null),he(null),Q(null),f&&vt(null,i,s);return}const q=Hs(V.value,o);T(q?.data??null),N(q?.resolveType??null);const{resolveType:A,formValue:O}=jt(V.rule,o,l??void 0);he(A),Q(O),f&&vt(y,i,s)};if(v!==void 0&&v!==te&&(oe(v??null),typeof v=="number")){const t=I[v],a=Te[v];if(t&&a)if(P(v),L(0),M([]),X(s=>s+1),a.isMultivariate)at(t,a,0,v);else{const s=ut(t,a,o);s?(T(s.data),N(s.resolveType)):(T(null),N(null)),he(null),Q(null)}}const Tt={orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d??void 0,siteSlug:K},Xt=pe&&l?Ot(pe,l):null,Ue=(t,a)=>{if(!j)return;const s=wt(o,j,t,Ve,Be);ye.mutate({blockKey:j,data:s},{onSuccess:()=>a?.onSuccess?.()??g?.(),onError:i=>W.error(`Save failed: ${i.message}`)})},St=()=>{P(null),T(null),N(null),L(0),Q(null),he(null),M([]),X(t=>t+1)},Ea=(t,a)=>{Wt.current&&clearTimeout(Wt.current);const s=Ye.current.sectionVariantIndex;Wt.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:V,variantIndex:q}=Ye.current,A=i[a];if(!A)return;const O=f[a];if(!O)return;if(O.isSavedBlock){const z=O.isLazy?A.section?.__resolveType??A.__resolveType:A.__resolveType;ye.mutate({blockKey:z,data:t},{onSuccess:()=>g?.(),onError:U=>W.error(`Save failed: ${U.message}`)});return}if(!x)return;const F={...y[x]},ge=[...i];if(O.isMultivariate){const z=Je(A,O);if(!z||!x)return;const U=rr(z,s,t);ge[a]=dt(A,O,U)}else if(O.isHidden){const z=Yn(A.__resolveType),U=z?{...A.section}:{...A},De=Array.isArray(U.variants)?[...U.variants]:[];De[0]&&(De[0]={...De[0],value:t}),U.variants=De,z?ge[a]={...A,section:U}:ge[a]=U}else O.isLazy?ge[a]={...A,section:t}:ge[a]=t;if(V.length>1){const z=F.sections,U=[...z?.variants??[]];U[q]&&(U[q]={...U[q],value:ge}),F.sections={...z,variants:U}}else F.sections=ge;ye.mutate({blockKey:x,data:F},{onSuccess:()=>g?.(),onError:z=>W.error(`Save failed: ${z.message}`)})},on)},Ka=t=>{P(t),L(0),M([]),X(f=>f+1);const a=I[t],s=Te[t];if(!a||!s)return;if(s.isMultivariate){at(a,s,0,t);return}const i=ut(a,s,o);if(!i){T(null),N(null),he(null),Q(null),vt(null,t,0);return}T(i.data),N(i.resolveType),he(null),Q(null),vt(null,t,0)},gn=t=>{const a=t;T(a),u!==null&&Ea(a,u)},Zt=t=>{if(!j||!o||!l||!ze)return;const a={kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},s=$n(o,a,l);s&&Ht.save(j,()=>{const i=xa.getQueryData(xs.decofile(ya))?.[j];if(!i||typeof i!="object"||i===null||Array.isArray(i))return null;const f={...i,...Gt.current};return Gt.current={},t?.raw!==void 0?{...f,seo:t.raw}:t?.inner!==void 0?Tr(a,s,f,t.inner):f})},$a=(t,a)=>{j&&(Gt.current[t]=a,Zt())},Oa=(t,a)=>{if(!j)return;const s=Rt([...I],t,a);u!==null&&(u===t?P(a):t<u&&a>=u?P(u-1):t>u&&a<=u&&P(u+1)),Ue(s)},Ba=t=>{if(!j)return;const a=I.filter((s,i)=>i!==t);u===t?St():u!==null&&u>t&&P(u-1),Ue(a)},La=t=>{if(!j)return;const a=I[t];if(!a)return;const s=[...I];s.splice(t+1,0,nr(a)),u!==null&&u>t&&P(u+1),Ue(s)},Fa=t=>{if(!j)return;const a=I[t],s=Te[t];if(!a||!s||s.isMultivariate)return;const i=s.isHidden?er(a):tr(a);if(!i)return;const f=[...I];f[t]=i,u===t&&St(),Ue(f)},Ia=t=>{if(!j)return;const a=I[t],s=Te[t];if(!a||!s||s.isMultivariate)return;const i=Zs(a);if(!i)return;const f=[...I];f[t]=i,u===t&&St(),Ue(f)},za=t=>{if(!j)return;const a=I[t],s=Te[t];if(!a||!s?.isSavedBlock)return;const i=ut(a,s,o);if(!i?.data)return;const{name:f,...y}=i.data,x=[...I];s.isLazy?x[t]={...a,section:y}:x[t]=y,u===t&&St(),Ue(x)},Ha=t=>{if(!j)return;const a=[...I,{__resolveType:t.resolveType}],s=a.length-1;Ue(a,{onSuccess:()=>{de(!1),P(s),L(0),M([]),X(x=>x+1);const i=a[s],f=Bt(a,o)[s];if(!i||!f)return;if(f.isMultivariate){at(i,f,0);return}const y=ut(i,f,o);if(!y){T(null),N(null),he(null),Q(null);return}T(y.data),N(y.resolveType),he(null),Q(null)}})},Ua=t=>{if(u===null)return;const a=I[u],s=Te[u];!a||!s?.isMultivariate||(L(t),M([]),X(i=>i+1),at(a,s,t,u,!0))},Wa=t=>{if(u===null||!j)return;const a=I[u],s=Te[u];if(!a||!s?.isMultivariate)return;const i=Je(a,s);if(!i)return;const f=Js(i,t);if(!f){W.error("Cannot delete the only variant.");return}const y=[...I];y[u]=dt(a,s,f);const x=f.variants;let V=ee;t===ee?V=Math.min(t,x.length-1):t<ee&&(V=ee-1),L(V),M([]),X(q=>q+1),at(y[u],s,V),Ue(y)},Ga=t=>{if(u===null||!j)return;const a=I[u],s=Te[u];if(!a||!s?.isMultivariate)return;const i=Je(a,s);if(!i)return;const f=Qs(i,t),y=[...I];y[u]=dt(a,s,f);const x=t+1;L(x),M([]),X(V=>V+1),at(y[u],s,x),Ue(y)},Ya=(t,a)=>{if(u===null||!j||t===a)return;const s=I[u],i=Te[u];if(!s||!i?.isMultivariate)return;const f=Je(s,i);if(!f)return;const y=Ys(f,t,a),x=[...I];x[u]=dt(s,i,y);let V=ee;ee===t?V=a:t<ee&&a>=ee?V=ee-1:t>ee&&a<=ee&&(V=ee+1),L(V),at(x[u],i,V),Ue(x)},en=t=>{const a=t??u;if(a===null||!j)return;const s=I[a],i=Te[a];if(!s||!i)return;const f=Us(s,i);if(!f){W.error("This section cannot have variants.");return}const y=[...I];y[a]=f.section;const x=Bt(y,o)[a];if(!x?.isMultivariate){W.error("Could not add variant.");return}P(a),L(f.newVariantIndex),M([]),X(V=>V+1),at(f.section,x,f.newVariantIndex,a),Ue(y)},qa=()=>{if(u===null||!j)return;const t=I[u],a=Te[u];if(!t||!a?.isMultivariate)return;const s=Je(t,a);if(!s)return;const i=qs(t,a,s);if(!i){W.error("Could not remove variants.");return}const f=[...I];f[u]=i;const y=Bt(f,o)[u];if(!y)return;L(0),he(null),Q(null),M([]),X(V=>V+1);const x=ut(i,y,o);x?(T(x.data),N(x.resolveType)):(T(null),N(null)),vt(null,u,0),Ue(f)},Ja=async t=>{if(Ne===null||!j)return;const a=rn(t,o);if(a){W.error(a);return}const s=I[Ne],i=Te[Ne];if(!s||!i)return;const f=ut(s,i,o);if(!f){W.error("This section cannot be saved as global.");return}const y={...f.data,name:t};try{await ye.mutateAsync({blockKey:t,data:y});const x=[...I];x[Ne]={__resolveType:t},await ye.mutateAsync({blockKey:j,data:wt(o,j,x,Ve,Be)}),u===Ne&&St(),ve(null),W.success(`Saved global block "${t}"`),g?.()}catch(x){W.error(x instanceof Error?x.message:"Failed to save global block")}},vn=nt?.rule;if(Pt&&u===null&&ue===null&&vn){const{resolveType:t,formValue:a}=jt(vn,o??{},l??void 0);ie(t),E(a)}const At=l?Os(l):[],Sn=l&&o?Bs(l,o):[],Qa=!_e&&!!(d&&l&&o),xn=ue&&l?Ot(ue,l):null,Mt=()=>{ht.current&&(clearTimeout(ht.current),ht.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null)},_t=async(t,a)=>{if(!(sr(a,t,l)>0))try{await Ut.mutateAsync({blockKey:t})}catch(s){W.error(s instanceof Error?s.message:"Could not delete matcher block")}},yn=t=>{ht.current&&clearTimeout(ht.current),ht.current=setTimeout(()=>{const{activePageKey:a,decofile:s,variantIndex:i}=Ye.current;if(!a)return;const f={...s[a]},y={...f.sections},x=[...y.variants??[]],V=x[i],q=V?.rule;if(xt(q,s,l)){const A=q?.__resolveType??"",O=s[A],F=typeof O?.name=="string"?O.name:A,{__resolveType:ge,...z}=t;ye.mutate({blockKey:A,data:yt(ge??"",z,F)},{onSuccess:()=>g?.(),onError:U=>W.error(`Save failed: ${U.message}`)});return}V&&(x[i]={...V,rule:t}),f.sections={...y,variants:x},ye.mutate({blockKey:a,data:f},{onSuccess:()=>g?.(),onError:A=>W.error(`Save failed: ${A.message}`)})},on)},Xa=t=>{ie(t);const a=t?{__resolveType:t}:{__resolveType:Kn};E({}),yn(a)},Za=t=>{const a=t;E(a);const s=ue?{__resolveType:ue,...a}:{...a};yn(s)},es=async t=>{Mt();const{activePageKey:a,decofile:s,variantIndex:i}=Ye.current;if(!a)return;const f=s[a],y=f?.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const x=y;if(!Array.isArray(x.variants))return;const V=[...x.variants],q=V[i];if(!q)return;const A=kt(q.rule,s,l),O=Ft(t);V[i]={...q,rule:O};const F={...s,[a]:{...f,sections:{...x,variants:V}}},{resolveType:ge,formValue:z}=jt(O,F,l??void 0);ie(ge),E(z);try{await ye.mutateAsync({blockKey:a,data:F[a]}),A&&A!==t&&await _t(A,F),g?.()}catch(U){W.error(U instanceof Error?U.message:"Could not apply saved rule")}},bn=t=>{gt.current&&clearTimeout(gt.current);const{selectedSectionIndex:a,sectionVariantIndex:s}=Ye.current;a!==null&&(gt.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:V,variantIndex:q}=Ye.current;if(!x)return;const A=i[a],O=f[a];if(!A||!O?.isMultivariate)return;const F=Je(A,O);if(!F)return;const z=(F.variants??[])[s]?.rule;if(xt(z,y,l)){const fe=z?.__resolveType??"",We=y[fe],Ze=typeof We?.name=="string"?We.name:fe,{__resolveType:rt,...et}=t;ye.mutate({blockKey:fe,data:yt(rt??"",et,Ze)},{onSuccess:()=>g?.(),onError:ot=>W.error(`Save failed: ${ot.message}`)});return}const U=Tn(F,s,t),De=[...i];De[a]=dt(A,O,U);const qe=wt(y,x,De,q,V);ye.mutate({blockKey:x,data:qe},{onSuccess:()=>g?.(),onError:fe=>W.error(`Save failed: ${fe.message}`)})},on))},ts=t=>{he(t),Q({}),bn(t?{__resolveType:t}:{__resolveType:Kn})},ns=t=>{const a=t;Q(a);const s=Ie?{__resolveType:Ie,...a}:{...a};bn(s)},as=async t=>{Mt();const{selectedSectionIndex:a,sectionVariantIndex:s,rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:V,variantIndex:q}=Ye.current;if(a===null||!x)return;const A=i[a],O=f[a];if(!A||!O?.isMultivariate)return;const F=Je(A,O);if(!F)return;const ge=F.variants??[],z=kt(ge[s]?.rule,y,l),U=Ft(t),De=Tn(F,s,U),qe=[...i];qe[a]=dt(A,O,De);const fe=wt(y,x,qe,q,V),We={...y,[x]:fe},{resolveType:Ze,formValue:rt}=jt(U,We,l??void 0);he(Ze),Q(rt);try{await ye.mutateAsync({blockKey:x,data:fe}),z&&z!==t&&await _t(z,We),g?.()}catch(et){W.error(et instanceof Error?et.message:"Could not apply saved rule")}};if(!_e&&!ze)return n.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",h]});if(_e&&!Yt)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const st=u!==null?Te[u]??null:null,_n=u!==null?I[u]:null,jn=_n&&st?.isMultivariate?Je(_n,st):null,lt=jn?Cn(jn,tt):[],tn=Math.min(ee,Math.max(lt.length-1,0)),Et=lt[tn]??null,ct=st?.isMultivariate===!0,kn=u!==null&&st!==null,Kt=kn&&(ct||!!(Xt&&se)),ss=Kt&&!_e&&st?.isSavedBlock===!0,Xe=_e||ss,rs=_e?mn:st?.label??"",wn=Ie&&l?Ot(Ie,l):null,nn=Kt&&(!_e||je.length>0)?_e?[mn,...je]:[ze.name,st.label,...ct&&Et?[Et.label]:[],...je]:[],os=Z&&ze?[ze.name,"SEO",...Me]:[],$t=Z?os:Xe?nn.length>0?nn:[rs]:nn,Rn=()=>{if(!j)return;const t=o[j],a=Ws(t.sections,I);if(!a)return;const s=Gs(a);ye.mutate({blockKey:j,data:{...t,sections:a}},{onSuccess:()=>{B(s),P(null),T(null),N(null),M([]),E(null),ie(null)},onError:i=>W.error(`Save failed: ${i.message}`)})},an=(t,a,s)=>{if(!j)return;const i=o[j],f=i.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const y=f;if(!Array.isArray(y.variants))return;const x=t([...y.variants]);if(!x)return;const V=or(y,x),q={...o,[j]:{...i,sections:V}};ye.mutate({blockKey:j,data:q[j]},{onSuccess:()=>{a?.(),s&&_t(s,q)},onError:A=>W.error(`Save failed: ${A.message}`)})},is=t=>{G(null),B(t),P(null),T(null),N(null),M([]);const a=Be[t]?.rule,{resolveType:s,formValue:i}=jt(a,o??{},l??void 0);ie(s),E(i),hn(Be.map(f=>({rule:f.rule})),t)},ls=(t,a)=>{if(t===a)return;let s=Ve;Ve===t?s=a:t<Ve&&a>=Ve?s=Ve-1:t>Ve&&a<=Ve&&(s=Ve+1),B(s);const i=Rt(Be.map(f=>({rule:f.rule})),t,a);hn(i,s),an(f=>Rt(f,t,a))},cs=t=>{const a=Be[t]?.rule,s=kt(a,o??{},l??void 0);an(i=>i.length<=1?null:(i.splice(t,1),i),()=>{Be.length-1===1?B(0):t<Ve?B(Ve-1):t===Ve&&B(Math.max(0,t-1)),P(null),T(null),N(null),M([]),E(null),ie(null)},s)},us=t=>{an(a=>ir(a,t),()=>{B(t+1),P(null),T(null),N(null),M([]),E(null),ie(null)})},ds=async(t,a)=>{Mt();const s=Ye.current.activePageKey,i=Ye.current.decofile;if(!s)return;const f=i[s],y=f.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const x=y;if(!Array.isArray(x.variants))return;const V=[...x.variants],q=V[t];if(!q?.rule||typeof q.rule!="object"){W.error("This variant has no matcher rule to rename.");return}const A=q.rule,O=a.trim();Vt(!0);try{if(!O){if(!xt(A,i,l)){G(null);return}const qe=A.__resolveType??"";V[t]={...q,rule:An(A,i,l)};const fe={...i,[s]:{...f,sections:{...x,variants:V}}};await ye.mutateAsync({blockKey:s,data:fe[s]}),await _t(qe,fe),G(null),g?.();return}const F=Mn(A,i,l);if(!F){W.error("Could not read this variant's matcher rule.");return}if(F.blockKey){await ye.mutateAsync({blockKey:F.blockKey,data:yt(F.resolveType,F.data,O)}),G(null),g?.();return}const ge=sn(O),z=rn(ge,i);if(z){W.error(z);return}const U=yt(F.resolveType,F.data,O);let De=null;try{await ye.mutateAsync({blockKey:ge,data:U}),De=ge,V[t]={...q,rule:Ft(ge)},await ye.mutateAsync({blockKey:s,data:{...f,sections:{...x,variants:V}}}),De=null}catch(qe){throw De&&await Ut.mutateAsync({blockKey:De}).catch(()=>{}),qe}G(null),W.success(`Saved matcher as global block "${O}"`),g?.()}catch(F){W.error(F instanceof Error?F.message:"Failed to rename variant")}finally{Vt(!1)}},ms=async(t,a)=>{Mt();const{selectedSectionIndex:s,rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:V,variantIndex:q}=Ye.current;if(s===null||!x)return;const A=i[s],O=f[s];if(!A||!O?.isMultivariate)return;const F=Je(A,O);if(!F)return;const ge=F.variants??[],z=ge[t];if(!z?.rule||typeof z.rule!="object"){W.error("This variant has no matcher rule to rename.");return}const U=z.rule,De=a.trim();Vt(!0);const qe=async fe=>{const We={...F,variants:fe},Ze=[...i];Ze[s]=dt(A,O,We);const rt=wt(y,x,Ze,q,V);return await ye.mutateAsync({blockKey:x,data:rt}),{...y,[x]:rt}};try{if(!De){if(!xt(U,y,l)){ne(null);return}const ot=U.__resolveType??"",Vn=[...ge];Vn[t]={...z,rule:An(U,y,l)};const vs=await qe(Vn);await _t(ot,vs),ne(null),g?.();return}const fe=Mn(U,y,l);if(!fe){W.error("Could not read this variant's matcher rule.");return}if(fe.blockKey){await ye.mutateAsync({blockKey:fe.blockKey,data:yt(fe.resolveType,fe.data,De)}),ne(null),g?.();return}const We=sn(De),Ze=rn(We,y);if(Ze){W.error(Ze);return}const rt=yt(fe.resolveType,fe.data,De);let et=null;try{await ye.mutateAsync({blockKey:We,data:rt}),et=We;const ot=[...ge];ot[t]={...z,rule:Ft(We)},await qe(ot),et=null}catch(ot){throw et&&await Ut.mutateAsync({blockKey:et}).catch(()=>{}),ot}ne(null),W.success(`Saved matcher as global block "${De}"`),g?.()}catch(fe){W.error(fe instanceof Error?fe.message:"Failed to rename variant")}finally{Vt(!1)}},Dn=()=>{St()},fs=t=>{Pe(t),Zt({inner:t})},ps=t=>{Fe(t),Zt({raw:t})},hs=()=>{Pe(null),xe([])},gs=()=>me(t=>t+1),Nn=t=>{if(Z){if(t===0){Ht.flush(),we(!1),Pe(null),Fe(void 0),xe([]),me(s=>s+1),C?.();return}if(t===1){xe([]),me(s=>s+1);return}xe(Me.slice(0,t-1)),me(s=>s+1);return}if(_e){M(je.slice(0,t)),X(s=>s+1);return}if(t===0){Dn();return}if(t===1){M([]),X(s=>s+1);return}if(ct&&t===2){M([]),X(s=>s+1);return}const a=ct?2:1;M(je.slice(0,t-a))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:Xe||Kt||Z?n.jsxs("div",{className:Ee("border-b px-3 py-2.5",Xe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[$t.length>1&&n.jsx("button",{type:"button",onClick:()=>Nn($t.length-2),title:"Back","aria-label":"Back",className:Ee("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",Xe?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(sa,{className:"size-4"})}),!_e&&Pt&&nt&&n.jsxs("button",{type:"button",onClick:Dn,title:`Editing in variant: ${nt.label}`,className:Ee("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",ro),children:[n.jsx(va,{rule:Dt(nt.rule,o??{},l??void 0),matchers:At}),n.jsx("span",{className:"max-w-[160px] truncate",children:nt.label})]}),n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:$t.map((t,a)=>{const s=a===$t.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[a>0&&n.jsx(ra,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Nn(a),title:t,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",s?Xe?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":Xe?"text-foreground/80":"text-muted-foreground",Xe?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${a}`)})}),Xe&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fr,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(pt,{side:"bottom",className:"max-w-[260px]",children:"A global section is a reusable block shared across your site. Editing it here updates it everywhere it's used."})]}),kn&&!ct&&!st?.isHidden&&j&&n.jsx(zn,{onClick:()=>en()})]}),Xe&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:"This is a global section. Changes apply everywhere this section is used across your site."})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(io,{pageKey:j,initialName:ze.name,initialPath:ze.path,onFieldChange:$a})}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>we(!0),children:n.jsx(dr,{size:14})})}),n.jsx(pt,{side:"bottom",children:"Edit SEO"})]}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>R&&j?R(j):$(!0),children:n.jsx(mr,{size:14})})}),n.jsx(pt,{side:"bottom",children:"View JSON"})]}),n.jsx(zn,{onClick:Rn})]})}),Z?n.jsx(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ct&&j?n.jsx(Pr,{rawSeo:Jt,innerSeo:fn,defaultResolveType:Pa,seoSchema:Ta,activeResolveType:Qt,seoTypeOptions:Ca,formResetKey:Re,siteDefaultSeo:Aa,onBreadcrumbChange:xe,onPersistRaw:ps,onInnerChange:fs,onClearForm:hs,onBumpFormKey:gs}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):Kt?n.jsxs(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ct&<.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Ls,{listKey:`${j??""}:${u??""}`,variants:lt.map((t,a)=>({index:a,label:t.label})),selectedIndex:tn,onSelect:Ua,onRename:ne,onDuplicate:Ga,onDelete:Wa,onRemoveAll:qa,onReorder:Ya,onAdd:()=>en()}),ct&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),n.jsx(Pn,{currentRt:Ie??"",currentLabel:Lt(Et?.rule,o??{},tt,l??void 0),currentGlobalKey:kt(Et?.rule,o??{},l??void 0)??void 0,matchers:At,globals:Sn,onSelect:ts,onSelectGlobal:as}),wn&&ae&&n.jsx("div",{className:"pt-1",children:n.jsx(Fn,{schema:wn,value:ae,onChange:ns,meta:l??void 0,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt},`${u??"none"}:${tn}:${Ie??""}`)})]})]}),n.jsx(In,{activeSchema:Xt,formValue:se,formResetKey:Ae,onFormChange:gn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this variant.",meta:l,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt})]}):_e?n.jsx(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(In,{activeSchema:Xt,formValue:se,formResetKey:Ae,onFormChange:gn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this global block.",meta:l,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt})}):n.jsxs(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Pt&&j&&n.jsx(ao,{listKey:j,variants:Be,activeIndex:Ve,decofile:o??{},meta:l,matchers:At,onSelect:is,onReorder:ls,onRename:G,onDuplicate:us,onDelete:cs,onAdd:Rn}),Pt&&ue!==null&&n.jsxs("div",{className:Ee("px-3 border-b",le?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>ke(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":le,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),le?n.jsx(cr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(lr,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),le&&n.jsxs("div",{className:Ee("space-y-3",bt&&"pointer-events-none opacity-50"),children:[n.jsx(Pn,{currentRt:ue,currentLabel:Lt(nt?.rule,o??{},tt,l??void 0),currentGlobalKey:kt(nt?.rule,o??{},l??void 0)??void 0,matchers:At,globals:Sn,onSelect:Xa,onSelectGlobal:es}),xn&&Ce&&n.jsx("div",{className:"space-y-3",children:n.jsx(Fn,{schema:xn,value:Ce,onChange:Za,meta:l??void 0,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt},`${Ve}:${ue??""}`)})]})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(Yr,{listKey:`${j??""}-${Ve}`,rawSections:I,sections:Te,meta:l,selectedIndex:u,onSelect:Ka,onReorder:Oa,onDelete:Ba,onDuplicate:La,onMakeReusable:ve,onToggleHidden:Fa,onToggleLazy:Ia,onAddVariant:en,onDetach:za,onAddSection:()=>de(!0),canAddSection:Qa})})]}),n.jsx(Fs,{open:Ne!==null,onOpenChange:t=>{t||ve(null)},defaultBlockId:Ne!==null?sn(Te[Ne]?.label??""):"",isPending:ye.isPending,onSubmit:Ja}),d&&n.jsx(Er,{open:Se,onOpenChange:de,meta:l,decofile:o,previewBaseUrl:d,onSelect:Ha}),be&&j&&o&&n.jsx(Is,{open:be,onOpenChange:$,pageKey:j,decofile:o}),re!==null&&n.jsx(Bn,{open:!0,initialName:xt(Be[re]?.rule,o??{},l??void 0)?Lt(Be[re]?.rule,o??{},tt,l??void 0):"",autoLabel:tt(Dt(Be[re]?.rule,o??{},l??void 0)),isPending:bt,onSubmit:async t=>{await ds(re,t)},onOpenChange:t=>{!t&&!bt&&G(null)}}),Y!==null&&n.jsx(Bn,{open:!0,initialName:xt(lt[Y]?.rule,o??{},l??void 0)?Lt(lt[Y]?.rule,o??{},tt,l??void 0):"",autoLabel:tt(Dt(lt[Y]?.rule,o??{},l??void 0)),isPending:bt,onSubmit:async t=>{await ms(Y,t)},onOpenChange:t=>{!t&&!bt&&ne(null)}})]})}export{ec as SectionsEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Z as ot,_ as we,$ as it,a0 as rt,a1 as Qe,n as fe,a2 as at,a3 as lt,r as B,a4 as ct,a5 as dt,a6 as ut,a7 as mt,a8 as Fe,a9 as ft,aa as pt,ab as ht,c as Q,l as oe,j as s,B as W,d as _e,K as Z,H as he,I as ie,J as ge,M as xe,i as Ce,m as de,t as Se,v as Ne,p as ne,Q as gt,E as xt,a as yt}from"./index-Bhm9Bs1H.js";import{u as Te}from"./use-mcp-client-Cm__SCrY.js";import{W as Ge,S as bt}from"./constants-D_FQAPnt.js";import{I as Ie}from"./integration-icon-BGWuRbhS.js";import{c as ue,a as Be,h as Ve,D as He,d as We,e as Ye}from"./dialog-df3kXkJ6.js";import{b as Oe,T as ke,a as Ae}from"./tooltip-0Tj-MlQQ.js";import{i as Re}from"./CheckCircle-Bk4jVW7c.js";import{e as Ze,g as vt,h as Xe}from"./agent-icon-Cn3pvSY1.js";import{g as Ct,c as jt,e as _t}from"./extract-connection-data-Ds-QcBxj.js";import{g as St,f as Nt}from"./github-installations-D2vHSx02.js";import{F as re,a as ye,b as ae,c as ve,d as le,f as ce,e as wt}from"./form-Dn-2qr3X.js";import{I as be}from"./input-DospeWmi.js";import{i as Et}from"./Check-CQjJylK6.js";import{a as Je}from"./Copy01-B_L_kofR.js";import{i as Tt}from"./Settings02-CiDkLfc2.js";import{s as It}from"./Eye-DqWJbQD8.js";import{u as Ot}from"./use-debounced-value-C58Qyt5I.js";import{a as kt}from"./authenticate-and-persist-oauth-C5bv8dSc.js";import{i as et}from"./ArrowUpRight-fu_iMwrL.js";function Ue(n,e){const t=new Set(e);return n.filter(o=>!t.has(o))}function At(n,e,t){const o=n.slice(0);return o[e]=t,o}var Rt=class extends ot{#o;#e;#i;#n;#t;#s;#r;#a;#l;#c=[];constructor(n,e,t){super(),this.#o=n,this.#n=t,this.#i=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(n=>{n.subscribe(e=>{this.#f(n,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(n=>{n.destroy()})}setQueries(n,e){this.#i=n,this.#n=e,we.batch(()=>{const t=this.#t,o=this.#m(this.#i);o.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const i=o.map(a=>a.observer),r=i.map(a=>a.getCurrentResult()),l=t.length!==i.length,c=i.some((a,f)=>a!==t[f]),d=l||c,p=d?!0:r.some((a,f)=>{const u=this.#e[f];return!u||!it(a,u)});!d&&!p||(d&&(this.#c=o,this.#t=i),this.#e=r,this.hasListeners()&&(d&&(Ue(t,i).forEach(a=>{a.destroy()}),Ue(i,t).forEach(a=>{a.subscribe(f=>{this.#f(a,f)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(n=>n.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(n,e){const t=this.#m(n),o=t.map(r=>r.observer.getOptimisticResult(r.defaultedQueryOptions)),i=t.map(r=>r.defaultedQueryOptions.queryHash);return[o,r=>this.#u(r??o,e,i),()=>this.#d(o,t)]}#d(n,e){return e.map((t,o)=>{const i=n[o];return t.defaultedQueryOptions.notifyOnChangeProps?i:t.observer.trackResult(i,r=>{e.forEach(l=>{l.observer.trackProp(r)})})})}#u(n,e,t){if(e){const o=this.#l,i=t!==void 0&&o!==void 0&&(o.length!==t.length||t.some((r,l)=>r!==o[l]));return(!this.#s||this.#e!==this.#a||i||e!==this.#r)&&(this.#r=e,this.#a=this.#e,t!==void 0&&(this.#l=t),this.#s=rt(this.#s,e(n))),this.#s}return n}#h(){return this.#n?.combine!==void 0&&this.#t.some((n,e)=>n.options.suspense&&this.#e[e]?.data===void 0)}#m(n){const e=new Map;this.#t.forEach(o=>{const i=o.options.queryHash;if(!i)return;const r=e.get(i);r?r.push(o):e.set(i,[o])});const t=[];return n.forEach(o=>{const i=this.#o.defaultQueryOptions(o),l=e.get(i.queryHash)?.shift()??new Qe(this.#o,i);t.push({defaultedQueryOptions:i,observer:l})}),t}#f(n,e){const t=this.#t.indexOf(n);t!==-1&&(this.#e=At(this.#e,t,e),this.#p())}#p(){if(this.hasListeners()){const n=this.#d(this.#e,this.#c),e=this.#h(),t=this.#s,o=e?t:this.#u(n,this.#n?.combine);(e||t!==o)&&we.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function Pt({queries:n,...e},t){const o=fe(t),i=at(),r=lt(),l=B.useMemo(()=>n.map(b=>{const h=o.defaultQueryOptions(b);return h._optimisticResults=i?"isRestoring":"optimistic",h}),[n,o,i]);l.forEach(b=>{ct(b);const h=o.getQueryCache().get(b.queryHash);dt(b,r,h)}),ut(r);const[c]=B.useState(()=>new Rt(o,l,e)),[d,p,a]=c.getOptimisticResult(l,e.combine),f=!i&&e.subscribed!==!1;B.useSyncExternalStore(B.useCallback(b=>f?c.subscribe(we.batchCalls(b)):mt,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),B.useEffect(()=>{c.setQueries(l,e)},[l,e,c]);const g=d.some((b,h)=>Fe(l[h],b))?d.flatMap((b,h)=>{const m=l[h];if(m&&Fe(m,b)){const y=new Qe(o,m);return ft(m,y,r)}return[]}):[];if(g.length>0)throw Promise.all(g);const _=d.find((b,h)=>{const m=l[h];return m&&pt({result:b,errorResetBoundary:r,throwOnError:m.throwOnError,query:o.getQueryCache().get(m.queryHash),suspense:m.suspense})});if(_?.error)throw _.error;return p(a())}function Dt(n,e){return Pt({...n,queries:n.queries.map(t=>({...t,suspense:!0,throwOnError:ht,enabled:!0,placeholderData:void 0}))},e)}const Lt=/^[a-zA-Z][a-zA-Z\d+.-]*:/,$t=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,Kt=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,zt=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function je(n){const e=n.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const t=Lt.test(e),o=$t.test(e),i=Kt.test(e);if(t&&!o&&!i)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const r=o?e:`https://${e}`;let l;try{l=new URL(r)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(l.protocol!=="http:"&&l.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const c=l.hostname.split(".");return c.length<2||c.some(d=>!d||!zt.test(d))?{ok:!1,error:"Enter a valid website URL."}:(l.protocol="https:",{ok:!0,value:l.origin})}function jn(n,e){if(!n.trim())return!0;const t=je(n);if(!t.ok||!e)return!1;const o=je(e);return o.ok&&o.value===t.value}function _n(n){if(!n)return null;const e=je(n);return e.ok?new URL(e.value).hostname:null}function qt(n){const e=Q.c(14),{children:t,className:o,wrapperClassName:i}=n,[r,l]=B.useState(!0);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=b=>{if(!b)return;const h=()=>{const y=b.scrollHeight-b.scrollTop-b.clientHeight<8;l(y)};h(),b.addEventListener("scroll",h,{passive:!0});const m=new ResizeObserver(h);m.observe(b);for(const y of Array.from(b.children))m.observe(y);return()=>{b.removeEventListener("scroll",h),m.disconnect()}},e[0]=c):c=e[0];const d=c;let p;e[1]!==i?(p=oe("relative",i),e[1]=i,e[2]=p):p=e[2];let a;e[3]!==t||e[4]!==o?(a=s.jsx("div",{ref:d,className:o,children:t}),e[3]=t,e[4]=o,e[5]=a):a=e[5];const f=r?"opacity-0":"opacity-100";let u;e[6]!==f?(u=oe("pointer-events-none absolute inset-x-0 -bottom-px h-[72px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[1px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",f),e[6]=f,e[7]=u):u=e[7];let g;e[8]!==u?(g=s.jsx("div",{"aria-hidden":!0,className:u}),e[8]=u,e[9]=g):g=e[9];let _;return e[10]!==p||e[11]!==a||e[12]!==g?(_=s.jsxs("div",{className:p,children:[a,g]}),e[10]=p,e[11]=a,e[12]=g,e[13]=_):_=e[13],_}function Ft(n){const e=n.properties;if(!e)return[];const t=[];for(const[o,i]of Object.entries(e)){const c=i?.properties?.__type?.const;typeof c=="string"&&c.length>0&&t.push({fieldKey:o,bindingType:c})}return t}const Ut=[{fieldKey:"vtex",bindingType:"vtex"},{fieldKey:"ga4",bindingType:"google-analytics"},{fieldKey:"gsc",bindingType:"google-search-console"},{fieldKey:"github",bindingType:"github"}];function Mt(n,e){const t=[];if(n.length&&t.push({field:["id"],operator:"in",value:n}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function te(n){const e=n;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??n}function Qt(n,e,t,o){return{...n??{},[e]:{__type:t,value:o}}}function Ee(n){return n==null?!1:typeof n=="string"?n.trim().length>0:typeof n=="number"||typeof n=="boolean"?!0:Array.isArray(n)?n.some(Ee):typeof n=="object"?Object.entries(n).some(([e,t])=>!e.startsWith("__")&&Ee(t)):!1}function Gt(n){const e={accountName:"Nome da conta",appKey:"App Key",appToken:"App Token",propertyId:"Propriedade",siteUrl:"Site"};return e[n]?e[n]:n.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}function Bt(n){return Ee(n)?typeof n=="string"?n.trim():typeof n=="number"||typeof n=="boolean"?String(n):JSON.stringify(n):null}function Vt(n){return n?Object.entries(n).flatMap(([e,t])=>{if(e.startsWith("__"))return[];const o=Bt(t);return o?[{key:e,label:Gt(e),value:o}]:[]}):[]}function Ht({autoOpenFieldKey:n,card:e}){return n===e.fieldKey&&e.satisfied&&!!e.linkedConnectionId}function Wt(n,e,t){const o=n.filter(i=>(i.app_name===e||!!t&&i.app_id===t)&&St(i)===null);return o.length===0?null:(o.sort((i,r)=>{const l=c=>c.status==="active"?0:1;return l(i)!==l(r)?l(i)-l(r):(r.updated_at??"").localeCompare(i.updated_at??"")}),o[0].id)}function Yt(n){return n.server?.icons?.[0]?.src??Ct(n.server?.repository)??null}function Zt(n,e){const t=n._meta?.["mcp.mesh"];return t?.friendlyName||t?.friendly_name||n.title||n.server?.title||n.server?.name||e}function Xt(n){const e=[],t=new Map(n.connections.map(o=>[o.id,o]));for(const o of n.requirements){const i=n.curated[o.bindingType],r=i?n.itemsById[i.registryAppId]:n.itemsByName[o.bindingType];if(!r)continue;const l=n.configurationState?.[o.fieldKey]?.value,c=l?t.get(l):void 0,d=l&&c?l:null,p=d?n.connectionReadiness?.[d]!==!1:!1,a=!!d&&p,f=a?void 0:n.saBindings?.[o.bindingType],u=a||!!f,g=a?"oauth":f?"sa":null;e.push({fieldKey:o.fieldKey,bindingType:o.bindingType,registryItem:r,title:Zt(r,o.bindingType),icon:Yt(r),headline:i?.headline??r._meta?.["mcp.mesh"]?.short_description??null,area:i?.area??null,bullets:i?.bullets??[],satisfied:u,candidateConnectionId:u?null:d||Wt(n.connections,o.bindingType,i?.registryAppId),linkedConnectionId:d,configurationState:c?.configuration_state??null,boundVia:g,boundResource:f?.resource??null})}return e}function Jt(n,e){if(!n)return null;const t=i=>{const r=i.startsWith("sc-domain:")?i.substring(10):(()=>{try{return new URL(i.startsWith("http")?i:`https://${i}`).hostname}catch{return null}})();return r===null?i:r.startsWith("www.")?r.substring(4):r},o=t(n);for(const i of e)if(t(i.siteUrl)===o)return i.siteUrl;return null}function es(n){return(n?.response?.accountSummaries??[]).map(o=>({account:o.account,options:(o.propertySummaries??[]).map(i=>({value:i.property,label:`${i.displayName} (${o.displayName})`}))}))}function Me(n){const e=Q.c(38);let t,o,i,r,l;e[0]!==n?({value:l,onChange:o,placeholder:i,className:t,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=i,e[4]=r,e[5]=l):(t=e[1],o=e[2],i=e[3],r=e[4],l=e[5]);const[c,d]=B.useState(!1),[p,a]=B.useState(!1);let f;e[6]!==l?(f=async()=>{if(l)try{await navigator.clipboard.writeText(l),a(!0),setTimeout(()=>a(!1),2e3)}catch(T){console.error("Failed to copy text: ",T)}},e[6]=l,e[7]=f):f=e[7];const u=f;let g;e[8]!==c?(g=()=>{d(!c)},e[8]=c,e[9]=g):g=e[9];const _=g,b=c?"text":"password";let h;e[10]!==t?(h=oe("pr-20",t),e[10]=t,e[11]=h):h=e[11];let m;e[12]!==o||e[13]!==i||e[14]!==r||e[15]!==b||e[16]!==h||e[17]!==l?(m=s.jsx(be,{type:b,value:l,onChange:o,placeholder:i,className:h,...r}),e[12]=o,e[13]=i,e[14]=r,e[15]=b,e[16]=h,e[17]=l,e[18]=m):m=e[18];const y=c?"Hide password":"Show password";let C;e[19]!==c?(C=c?s.jsx(Tt,{size:16}):s.jsx(It,{size:16}),e[19]=c,e[20]=C):C=e[20];let x;e[21]!==y||e[22]!==C||e[23]!==_?(x=s.jsx(W,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:_,title:y,children:C}),e[21]=y,e[22]=C,e[23]=_,e[24]=x):x=e[24];const N=!l,E=p?"Copied!":"Copy token";let j;e[25]!==p?(j=p?s.jsx(Et,{size:16}):s.jsx(Je,{size:16}),e[25]=p,e[26]=j):j=e[26];let v;e[27]!==u||e[28]!==E||e[29]!==j||e[30]!==N?(v=s.jsx(W,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:u,disabled:N,title:E,children:j}),e[27]=u,e[28]=E,e[29]=j,e[30]=N,e[31]=v):v=e[31];let w;e[32]!==v||e[33]!==x?(w=s.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[x,v]}),e[32]=v,e[33]=x,e[34]=w):w=e[34];let I;return e[35]!==w||e[36]!==m?(I=s.jsxs("div",{className:"relative",children:[m,w]}),e[35]=w,e[36]=m,e[37]=I):I=e[37],I}function Pe(n){const e=Q.c(19),{card:t,selfClient:o,org:i,onDone:r,onError:l}=n,c=fe();let d;e[0]!==t||e[1]!==o?(d=async h=>{const m={...t.configurationState??{},...h};await o.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:t.linkedConnectionId||t.candidateConnectionId,data:{configuration_state:m}}})},e[0]=t,e[1]=o,e[2]=d):d=e[2];let p;e[3]!==r||e[4]!==i||e[5]!==c?(p=async()=>{await c.invalidateQueries({queryKey:Z.commerceDiscoveryCompanionConnectionsPrefix(i.id)}),r()},e[3]=r,e[4]=i,e[5]=c,e[6]=p):p=e[6];let a;e[7]!==l?(a=h=>{l?.(h)},e[7]=l,e[8]=a):a=e[8];let f;e[9]!==d||e[10]!==p||e[11]!==a?(f={mutationFn:d,onSuccess:p,onError:a},e[9]=d,e[10]=p,e[11]=a,e[12]=f):f=e[12];const u=_e(f);let g;e[13]!==u?(g=h=>u.mutate(h),e[13]=u,e[14]=g):g=e[14];const _=g;let b;return e[15]!==u.error||e[16]!==u.isPending||e[17]!==_?(b={save:_,isPending:u.isPending,error:u.error},e[15]=u.error,e[16]=u.isPending,e[17]=_,e[18]=b):b=e[18],b}const ts=he({accountName:ie().min(1,"Informe o nome da conta"),appKey:ie().optional(),appToken:ie().optional()});function ss(n){const e=Q.c(63),{card:t,selfClient:o,org:i,onDone:r,onIsPendingChange:l}=n;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=ge(ts),e[0]=c):c=e[0];const d=t.configurationState?.accountName||"",p=t.configurationState?.appKey||"",a=t.configurationState?.appToken||"";let f;e[1]!==d||e[2]!==p||e[3]!==a?(f={resolver:c,defaultValues:{accountName:d,appKey:p,appToken:a}},e[1]=d,e[2]=p,e[3]=a,e[4]=f):f=e[4];const u=xe(f);let g;e[5]!==t.configurationState?.accountName||e[6]!==t.configurationState?.appKey||e[7]!==t.configurationState?.appToken||e[8]!==u?(g=()=>{u.reset({accountName:t.configurationState?.accountName||"",appKey:t.configurationState?.appKey||"",appToken:t.configurationState?.appToken||""})},e[5]=t.configurationState?.accountName,e[6]=t.configurationState?.appKey,e[7]=t.configurationState?.appToken,e[8]=u,e[9]=g):g=e[9];let _;e[10]!==t.configurationState||e[11]!==u?(_=[t.configurationState,u],e[10]=t.configurationState,e[11]=u,e[12]=_):_=e[12],B.useEffect(g,_);let b;e[13]!==t||e[14]!==r||e[15]!==i||e[16]!==o?(b={card:t,selfClient:o,org:i,onDone:r},e[13]=t,e[14]=r,e[15]=i,e[16]=o,e[17]=b):b=e[17];const{save:h,isPending:m,error:y}=Pe(b);let C,x;e[18]!==m||e[19]!==l?(x=()=>{l?.(m)},C=[m,l],e[18]=m,e[19]=l,e[20]=C,e[21]=x):(C=e[20],x=e[21]),B.useEffect(x,C);let N;if(e[22]!==u||e[23]!==h){let L;e[25]!==h?(L=async O=>{h(O)},e[25]=h,e[26]=L):L=e[26],N=u.handleSubmit(L),e[22]=u,e[23]=h,e[24]=N}else N=e[24];const E=N;let j;e[27]!==m?(j=L=>{const{field:O}=L;return s.jsxs(ae,{children:[s.jsx(ve,{children:"Nome da conta"}),s.jsx(le,{children:s.jsx(be,{placeholder:"Nome da sua conta VTEX",...O,disabled:m})}),s.jsx(ce,{})]})},e[27]=m,e[28]=j):j=e[28];let v;e[29]!==u.control||e[30]!==j?(v=s.jsx(re,{control:u.control,name:"accountName",render:j}),e[29]=u.control,e[30]=j,e[31]=v):v=e[31];let w;e[32]!==m?(w=L=>{const{field:O}=L;return s.jsxs(ae,{children:[s.jsx(ve,{children:"App Key (opcional)"}),s.jsx(le,{children:s.jsx(Me,{placeholder:"App Key da VTEX",...O,disabled:m})}),s.jsx(ce,{})]})},e[32]=m,e[33]=w):w=e[33];let I;e[34]!==u.control||e[35]!==w?(I=s.jsx(re,{control:u.control,name:"appKey",render:w}),e[34]=u.control,e[35]=w,e[36]=I):I=e[36];let T;e[37]!==m?(T=L=>{const{field:O}=L;return s.jsxs(ae,{children:[s.jsx(ve,{children:"App Token (opcional)"}),s.jsx(le,{children:s.jsx(Me,{placeholder:"App Token da VTEX",...O,disabled:m})}),s.jsx(ce,{})]})},e[37]=m,e[38]=T):T=e[38];let S;e[39]!==u.control||e[40]!==T?(S=s.jsx(re,{control:u.control,name:"appToken",render:T}),e[39]=u.control,e[40]=T,e[41]=S):S=e[41];let k;e[42]!==u||e[43]!==v||e[44]!==I||e[45]!==S?(k=s.jsxs(ye,{...u,children:[v,I,S]}),e[42]=u,e[43]=v,e[44]=I,e[45]=S,e[46]=k):k=e[46];let A;e[47]!==y?(A=y&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:y instanceof Error?y.message:"Não foi possível salvar a configuração"}),e[47]=y,e[48]=A):A=e[48];let P;e[49]!==m||e[50]!==r?(P=s.jsx(W,{type:"button",variant:"outline",onClick:r,disabled:m,children:"Cancelar"}),e[49]=m,e[50]=r,e[51]=P):P=e[51];const F=m?"Salvando...":"Salvar";let K;e[52]!==m||e[53]!==F?(K=s.jsx(W,{type:"submit",disabled:m,children:F}),e[52]=m,e[53]=F,e[54]=K):K=e[54];let q;e[55]!==P||e[56]!==K?(q=s.jsxs(ue,{className:"pt-4",children:[P,K]}),e[55]=P,e[56]=K,e[57]=q):q=e[57];let D;return e[58]!==E||e[59]!==k||e[60]!==A||e[61]!==q?(D=s.jsxs("form",{onSubmit:E,className:"space-y-4",children:[k,A,q]}),e[58]=E,e[59]=k,e[60]=A,e[61]=q,e[62]=D):D=e[62],D}function De(n){const e=Q.c(29),{options:t,value:o,onChange:i,disabled:r,ariaLabel:l,searchPlaceholder:c,hideSearch:d}=n,p=c===void 0?"Buscar...":c,a=d===void 0?!1:d,[f,u]=B.useState("");let g,_,b;if(e[0]!==t||e[1]!==f||e[2]!==o){const j=f.trim().toLowerCase();g=j?t.filter(v=>v.label.toLowerCase().includes(j)):t,_=g.map(ns),b=_.includes(o)?o:_[0]??"",e[0]=t,e[1]=f,e[2]=o,e[3]=g,e[4]=_,e[5]=b}else g=e[3],_=e[4],b=e[5];const h=b;let m;e[6]!==r||e[7]!==_||e[8]!==i?(m=function(v){if(r||!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft","Home","End"].includes(v.key))return;v.preventDefault();const I=v.currentTarget.dataset.value,T=_.indexOf(I),S=_.length;if(S===0)return;let k;v.key==="ArrowDown"||v.key==="ArrowRight"?k=(T+1)%S:v.key==="ArrowUp"||v.key==="ArrowLeft"?k=(T-1+S)%S:v.key==="Home"?k=0:k=S-1;const A=_[k];i(A),v.currentTarget.closest('[role="radiogroup"]')?.querySelector(`[data-value="${CSS.escape(A)}"]`)?.focus()},e[6]=r,e[7]=_,e[8]=i,e[9]=m):m=e[9];const y=m;let C;e[10]!==l||e[11]!==r||e[12]!==a||e[13]!==f||e[14]!==p?(C=a?null:s.jsxs("div",{className:"relative",children:[s.jsx(Ze,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(be,{type:"text",value:f,onChange:j=>u(j.target.value),disabled:r,placeholder:p,"aria-label":`Buscar ${l}`,className:"h-8 pl-8"})]}),e[10]=l,e[11]=r,e[12]=a,e[13]=f,e[14]=p,e[15]=C):C=e[15];let x;e[16]!==r||e[17]!==g||e[18]!==y||e[19]!==i||e[20]!==h||e[21]!==o?(x=g.length===0?s.jsx("div",{className:"px-2 py-2 text-sm text-muted-foreground",children:"Nenhum resultado"}):g.map(j=>{const v=j.value===o;return s.jsxs("button",{type:"button",role:"radio","aria-checked":v,disabled:r,"data-value":j.value,tabIndex:j.value===h?0:-1,onClick:()=>i(j.value),onKeyDown:y,className:oe("flex w-full items-center justify-between gap-2 rounded-sm px-2 py-2 text-left text-sm","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",v?"bg-muted font-medium text-foreground":"text-foreground hover:bg-muted/50"),children:[s.jsx("span",{className:"truncate",children:j.label}),v?s.jsx(Re,{size:16,className:"shrink-0 text-primary"}):null]},j.value)}),e[16]=r,e[17]=g,e[18]=y,e[19]=i,e[20]=h,e[21]=o,e[22]=x):x=e[22];let N;e[23]!==l||e[24]!==x?(N=s.jsx("div",{role:"radiogroup","aria-label":l,className:"max-h-[280px] overflow-y-auto",children:x}),e[23]=l,e[24]=x,e[25]=N):N=e[25];let E;return e[26]!==C||e[27]!==N?(E=s.jsxs("div",{className:"space-y-2",children:[C,N]}),e[26]=C,e[27]=N,e[28]=E):E=e[28],E}function ns(n){return n.value}function Le(n){const e=Q.c(16),{label:t,iconSize:o,className:i,iconClassName:r,labelClassName:l}=n,c=o===void 0?14:o;let d;e[0]!==i?(d=oe("inline-flex items-center gap-2",i),e[0]=i,e[1]=d):d=e[1];let p;e[2]!==r?(p=oe("shrink-0 animate-spin",r),e[2]=r,e[3]=p):p=e[3];let a;e[4]!==c||e[5]!==p?(a=s.jsx(Ce,{size:c,className:p}),e[4]=c,e[5]=p,e[6]=a):a=e[6];let f;e[7]!==l?(f=oe("text-sm",l),e[7]=l,e[8]=f):f=e[8];let u;e[9]!==t||e[10]!==f?(u=s.jsx("span",{className:f,children:t}),e[9]=t,e[10]=f,e[11]=u):u=e[11];let g;return e[12]!==d||e[13]!==a||e[14]!==u?(g=s.jsxs("span",{className:d,children:[a,u]}),e[12]=d,e[13]=a,e[14]=u,e[15]=g):g=e[15],g}const os=he({propertyId:ie().min(1,"Selecione uma propriedade")});function is(n){const e=Q.c(68),{card:t,connectionId:o,companionClient:i,selfClient:r,org:l,onDone:c,onDisconnect:d,onIsPendingChange:p}=n;let a;e[0]!==o||e[1]!==l.id?(a=Z.commerceDiscoveryCompanionGaProperties(l.id,o),e[0]=o,e[1]=l.id,e[2]=a):a=e[2];let f;e[3]!==i?(f=async()=>{const $=await i.callTool({name:"get-account-summaries",arguments:{}}),U=te($);return es(U)},e[3]=i,e[4]=f):f=e[4];let u;e[5]!==a||e[6]!==f?(u={queryKey:a,queryFn:f},e[5]=a,e[6]=f,e[7]=u):u=e[7];const g=de(u);let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=ge(os),e[8]=_):_=e[8];const b=t.configurationState?.propertyId||"";let h;e[9]!==b?(h={resolver:_,defaultValues:{propertyId:b}},e[9]=b,e[10]=h):h=e[10];const m=xe(h);let y;e[11]!==t||e[12]!==c||e[13]!==l||e[14]!==r?(y={card:t,selfClient:r,org:l,onDone:c},e[11]=t,e[12]=c,e[13]=l,e[14]=r,e[15]=y):y=e[15];const{save:C,isPending:x,error:N}=Pe(y);let E,j;e[16]!==x||e[17]!==p?(E=()=>{p?.(x)},j=[x,p],e[16]=x,e[17]=p,e[18]=E,e[19]=j):(E=e[18],j=e[19]),B.useEffect(E,j);let v;if(e[20]!==m||e[21]!==C){let $;e[23]!==C?($=async U=>{C(U)},e[23]=C,e[24]=$):$=e[24],v=m.handleSubmit($),e[20]=m,e[21]=C,e[22]=v}else v=e[22];const w=v;if(g.isLoading){let $;return e[25]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:s.jsx(Le,{label:"Carregando propriedades..."})}),e[25]=$):$=e[25],$}if(g.isError){let $;return e[26]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx("div",{className:"space-y-4",children:s.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar as propriedades do Google Analytics."})}),e[26]=$):$=e[26],$}let I;e[27]!==g.data?(I=g.data||[],e[27]=g.data,e[28]=I):I=e[28];const T=I;if(T.flatMap(as).length===0){let $;e[29]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhuma propriedade do Google Analytics foi encontrada. Conecte uma conta do Google Analytics com propriedades."}),e[29]=$):$=e[29];let U;e[30]!==d?(U=d?s.jsx("button",{type:"button",onClick:d,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-destructive",children:"Desconectar conta"}):s.jsx("span",{}),e[30]=d,e[31]=U):U=e[31];let V;e[32]!==c?(V=s.jsx(W,{type:"button",variant:"outline",onClick:c,children:"Fechar"}),e[32]=c,e[33]=V):V=e[33];let Y;return e[34]!==U||e[35]!==V?(Y=s.jsxs("div",{className:"space-y-4",children:[$,s.jsxs(ue,{className:"flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[U,V]})]}),e[34]=U,e[35]=V,e[36]=Y):Y=e[36],Y}let k;e[37]!==x||e[38]!==T?(k=$=>{const{field:U}=$;return s.jsxs(ae,{children:[s.jsx(le,{children:s.jsx(De,{options:T.flatMap(rs),value:U.value,onChange:U.onChange,disabled:x,ariaLabel:"Propriedade do Google Analytics"})}),s.jsx(ce,{})]})},e[37]=x,e[38]=T,e[39]=k):k=e[39];let A;e[40]!==m.control||e[41]!==k?(A=s.jsx(re,{control:m.control,name:"propertyId",render:k}),e[40]=m.control,e[41]=k,e[42]=A):A=e[42];let P;e[43]!==m||e[44]!==A?(P=s.jsx(ye,{...m,children:A}),e[43]=m,e[44]=A,e[45]=P):P=e[45];let F;e[46]!==N?(F=N&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:N instanceof Error?N.message:"Não foi possível salvar a configuração"}),e[46]=N,e[47]=F):F=e[47];let K;e[48]!==x||e[49]!==d?(K=d?s.jsx("button",{type:"button",onClick:d,disabled:x,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-destructive disabled:opacity-50",children:"Desconectar conta"}):s.jsx("span",{}),e[48]=x,e[49]=d,e[50]=K):K=e[50];let q;e[51]!==x||e[52]!==c?(q=s.jsx(W,{type:"button",variant:"outline",onClick:c,disabled:x,children:"Cancelar"}),e[51]=x,e[52]=c,e[53]=q):q=e[53];const D=x?"Salvando...":"Salvar";let L;e[54]!==x||e[55]!==D?(L=s.jsx(W,{type:"submit",disabled:x,children:D}),e[54]=x,e[55]=D,e[56]=L):L=e[56];let O;e[57]!==q||e[58]!==L?(O=s.jsxs("div",{className:"flex gap-2",children:[q,L]}),e[57]=q,e[58]=L,e[59]=O):O=e[59];let z;e[60]!==K||e[61]!==O?(z=s.jsxs(ue,{className:"flex-col gap-2 pt-4 sm:flex-row sm:items-center sm:justify-between",children:[K,O]}),e[60]=K,e[61]=O,e[62]=z):z=e[62];let M;return e[63]!==w||e[64]!==P||e[65]!==F||e[66]!==z?(M=s.jsxs("form",{onSubmit:w,className:"space-y-4",children:[P,F,z]}),e[63]=w,e[64]=P,e[65]=F,e[66]=z,e[67]=M):M=e[67],M}function rs(n){return n.options}function as(n){return n.options}const ls=he({siteUrl:ie().min(1,"Selecione um site")});function cs(n){const e=Q.c(59),{card:t,connectionId:o,companionClient:i,selfClient:r,org:l,contextSiteUrl:c,onDone:d,onIsPendingChange:p}=n;let a;e[0]!==o||e[1]!==l.id?(a=Z.commerceDiscoveryCompanionGscSites(l.id,o),e[0]=o,e[1]=l.id,e[2]=a):a=e[2];let f;e[3]!==i?(f=async()=>{const O=await i.callTool({name:"list_sites",arguments:{}});return te(O).sites||[]},e[3]=i,e[4]=f):f=e[4];let u;e[5]!==a||e[6]!==f?(u={queryKey:a,queryFn:f},e[5]=a,e[6]=f,e[7]=u):u=e[7];const g=de(u);let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=ge(ls),e[8]=_):_=e[8];const b=t.configurationState?.siteUrl||"";let h;e[9]!==b?(h={resolver:_,defaultValues:{siteUrl:b}},e[9]=b,e[10]=h):h=e[10];const m=xe(h);let y;e[11]!==t||e[12]!==d||e[13]!==l||e[14]!==r?(y={card:t,selfClient:r,org:l,onDone:d},e[11]=t,e[12]=d,e[13]=l,e[14]=r,e[15]=y):y=e[15];const{save:C,isPending:x,error:N}=Pe(y);let E,j;e[16]!==x||e[17]!==p?(E=()=>{p?.(x)},j=[x,p],e[16]=x,e[17]=p,e[18]=E,e[19]=j):(E=e[18],j=e[19]),B.useEffect(E,j);let v;if(e[20]!==m||e[21]!==C){let O;e[23]!==C?(O=async z=>{C(z)},e[23]=C,e[24]=O):O=e[24],v=m.handleSubmit(O),e[20]=m,e[21]=C,e[22]=v}else v=e[22];const w=v;if(g.isLoading){let O;return e[25]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:s.jsx(Le,{label:"Carregando sites..."})}),e[25]=O):O=e[25],O}if(g.isError){let O;return e[26]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx("div",{className:"space-y-4",children:s.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar os sites do Google Search Console."})}),e[26]=O):O=e[26],O}let I,T;if(e[27]!==t.configurationState?.siteUrl||e[28]!==c||e[29]!==m||e[30]!==g.data){T=Symbol.for("react.early_return_sentinel");e:{if(I=g.data||[],I.length===0){let z;e[33]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx("div",{className:"space-y-4",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum site verificado foi encontrado. Verifique um site no Google Search Console."})}),e[33]=z):z=e[33],T=z;break e}const O=t.configurationState?.siteUrl;if(O&&m.getValues("siteUrl")!==O)m.setValue("siteUrl",O);else if(!O&&!m.getValues("siteUrl")){const z=Jt(c,I);z&&m.setValue("siteUrl",z)}}e[27]=t.configurationState?.siteUrl,e[28]=c,e[29]=m,e[30]=g.data,e[31]=I,e[32]=T}else I=e[31],T=e[32];if(T!==Symbol.for("react.early_return_sentinel"))return T;let S;e[34]!==x||e[35]!==I?(S=O=>{const{field:z}=O;return s.jsxs(ae,{children:[s.jsx(le,{children:s.jsx(De,{options:I.map(ds),value:z.value,onChange:z.onChange,disabled:x,ariaLabel:"Site verificado"})}),s.jsx(ce,{})]})},e[34]=x,e[35]=I,e[36]=S):S=e[36];let k;e[37]!==m.control||e[38]!==S?(k=s.jsx(re,{control:m.control,name:"siteUrl",render:S}),e[37]=m.control,e[38]=S,e[39]=k):k=e[39];let A;e[40]!==m||e[41]!==k?(A=s.jsx(ye,{...m,children:k}),e[40]=m,e[41]=k,e[42]=A):A=e[42];let P;e[43]!==N?(P=N&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:N instanceof Error?N.message:"Não foi possível salvar a configuração"}),e[43]=N,e[44]=P):P=e[44];let F;e[45]!==x||e[46]!==d?(F=s.jsx(W,{type:"button",variant:"outline",onClick:d,disabled:x,children:"Cancelar"}),e[45]=x,e[46]=d,e[47]=F):F=e[47];const K=x?"Salvando...":"Salvar";let q;e[48]!==x||e[49]!==K?(q=s.jsx(W,{type:"submit",disabled:x,children:K}),e[48]=x,e[49]=K,e[50]=q):q=e[50];let D;e[51]!==F||e[52]!==q?(D=s.jsxs(ue,{className:"pt-4",children:[F,q]}),e[51]=F,e[52]=q,e[53]=D):D=e[53];let L;return e[54]!==w||e[55]!==A||e[56]!==P||e[57]!==D?(L=s.jsxs("form",{onSubmit:w,className:"space-y-4",children:[A,P,D]}),e[54]=w,e[55]=A,e[56]=P,e[57]=D,e[58]=L):L=e[58],L}function ds(n){return{value:n.siteUrl,label:n.siteUrl}}const us=he({githubRepo:ie().min(1,"Selecione um repositório")}),ms=15e3,fs=/^[\w.-]+\/[\w.-]+$/;async function ps(n,e,t,o){const{installations:i}=await Nt(n,t),r=o.trim(),l=await Promise.allSettled(i.map(async a=>{const f=a.type==="User"?"user":"org",u=r?`${f}:${a.login} ${r} in:name`:`${f}:${a.login}`,_=await e.callTool({name:"search_repositories",arguments:{query:u,page:1,perPage:50}},void 0,{signal:AbortSignal.timeout(ms)}),b=_.content?.[0]?.text;if(_.isError)throw new Error(b??"search_repositories failed");if(!b)throw new Error("empty search_repositories response");return JSON.parse(b).items??[]})),c=new Map;let d=0;for(const a of l){if(a.status==="rejected"){d+=1;continue}for(const f of a.value)f.full_name&&!c.has(f.full_name)&&c.set(f.full_name,f)}return{repos:Array.from(c.values()).sort((a,f)=>(f.updated_at??"").localeCompare(a.updated_at??"")).map(a=>a.full_name),failed:d,total:i.length}}function hs(n){const e=Q.c(80),{connectionId:t,companionClient:o,selfClient:i,org:r,onDone:l,onIsPendingChange:c}=n,d=fe();let p;e[0]!==r.id?(p=Ge.COMMERCE_DISCOVERY(r.id),e[0]=r.id,e[1]=p):p=e[1];const a=p,[f,u]=B.useState(""),g=Ot(f,300);let _;e[2]!==t||e[3]!==r.id?(_=Z.commerceDiscoveryCompanionGithubSelected(r.id,t),e[2]=t,e[3]=r.id,e[4]=_):_=e[4];let b;e[5]!==a||e[6]!==i?(b=async()=>{const H=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:a}}),ee=te(H).item?.configuration_state??null;return typeof ee?.github_repo=="string"?ee.github_repo:""},e[5]=a,e[6]=i,e[7]=b):b=e[7];let h;e[8]!==_||e[9]!==b?(h={queryKey:_,queryFn:b},e[8]=_,e[9]=b,e[10]=h):h=e[10];const m=de(h);let y;e[11]!==t||e[12]!==g||e[13]!==r.id?(y=Z.commerceDiscoveryCompanionGithubRepos(r.id,t,g.trim()),e[11]=t,e[12]=g,e[13]=r.id,e[14]=y):y=e[14];let C;e[15]!==o||e[16]!==t||e[17]!==g||e[18]!==i?(C=()=>ps(H=>i.callTool(H),o,t,g),e[15]=o,e[16]=t,e[17]=g,e[18]=i,e[19]=C):C=e[19];let x;e[20]!==y||e[21]!==C?(x={queryKey:y,queryFn:C},e[20]=y,e[21]=C,e[22]=x):x=e[22];const N=de(x);let E;e[23]===Symbol.for("react.memo_cache_sentinel")?(E={resolver:ge(us),defaultValues:{githubRepo:""}},e[23]=E):E=e[23];const j=xe(E);let v;e[24]!==a||e[25]!==i?(v=async H=>{const ee=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:a}}),nt={...te(ee).item?.configuration_state??null??{},github_repo:H};await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:a,data:{configuration_state:nt}}})},e[24]=a,e[25]=i,e[26]=v):v=e[26];let w;e[27]!==a||e[28]!==l||e[29]!==r.id||e[30]!==d?(w=async()=>{await d.invalidateQueries({queryKey:Z.commerceDiscoveryConnection(r.id,a)}),await d.invalidateQueries({queryKey:Z.commerceDiscoveryCompanionConnectionsPrefix(r.id)}),l()},e[27]=a,e[28]=l,e[29]=r.id,e[30]=d,e[31]=w):w=e[31];let I;e[32]!==w||e[33]!==v?(I={mutationFn:v,onSuccess:w},e[32]=w,e[33]=v,e[34]=I):I=e[34];const T=_e(I),S=T.isPending;let k,A;e[35]!==S||e[36]!==c?(k=()=>{c?.(S)},A=[S,c],e[35]=S,e[36]=c,e[37]=k,e[38]=A):(k=e[37],A=e[38]),B.useEffect(k,A);let P;if(e[39]!==j||e[40]!==T){let H;e[42]!==T?(H=async ee=>{T.mutate(ee.githubRepo)},e[42]=T,e[43]=H):H=e[43],P=j.handleSubmit(H),e[39]=j,e[40]=T,e[41]=P}else P=e[41];const F=P,K=m.data??"";K&&j.getValues("githubRepo")!==K&&j.setValue("githubRepo",K);let q,D,L;if(e[44]!==g||e[45]!==N.data?.failed||e[46]!==N.data?.repos||e[47]!==N.data?.total||e[48]!==K){const H=N.data?.repos??[];q=N.data?.failed??0,L=N.data?.total??0;const ee=g.trim();D=[...H],ee&&fs.test(ee)&&!D.includes(ee)&&D.unshift(ee),K&&!D.includes(K)&&D.push(K),e[44]=g,e[45]=N.data?.failed,e[46]=N.data?.repos,e[47]=N.data?.total,e[48]=K,e[49]=q,e[50]=D,e[51]=L}else q=e[49],D=e[50],L=e[51];const O=L>0&&q===L,z=N.isError||O?"Não foi possível buscar os repositórios (erro ou tempo esgotado). Tente novamente ou digite o repositório no formato owner/nome.":q>0?"Parte da busca falhou — alguns repositórios podem não ter aparecido. Tente novamente ou digite owner/nome.":null;let M;e[52]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(Ze,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[52]=M):M=e[52];let $;e[53]===Symbol.for("react.memo_cache_sentinel")?($=H=>u(H.target.value),e[53]=$):$=e[53];let U;e[54]!==S||e[55]!==f?(U=s.jsxs("div",{className:"relative",children:[M,s.jsx(be,{type:"text",value:f,onChange:$,disabled:S,placeholder:"Buscar repositório","aria-label":"Buscar repositório",className:"h-8 pl-8"})]}),e[54]=S,e[55]=f,e[56]=U):U=e[56];let V;e[57]!==j||e[58]!==S||e[59]!==D||e[60]!==N.isLoading||e[61]!==z?(V=N.isLoading?s.jsx("div",{className:"flex min-h-[160px] items-center justify-center",children:s.jsx(Le,{label:"Carregando repositórios..."})}):s.jsxs(s.Fragment,{children:[z&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:z}),D.length===0?!z&&s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum repositório encontrado. Digite o nome do repositório (owner/nome) para buscar."}):s.jsx(ye,{...j,children:s.jsx(re,{control:j.control,name:"githubRepo",render:H=>{const{field:ee}=H;return s.jsxs(ae,{children:[s.jsx(le,{children:s.jsx(De,{options:D.map(gs),value:ee.value,onChange:ee.onChange,disabled:S,ariaLabel:"Repositório",hideSearch:!0})}),s.jsx(ce,{})]})}})})]}),e[57]=j,e[58]=S,e[59]=D,e[60]=N.isLoading,e[61]=z,e[62]=V):V=e[62];let Y;e[63]!==T.error?(Y=T.error&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:T.error instanceof Error?T.error.message:"Não foi possível salvar a configuração"}),e[63]=T.error,e[64]=Y):Y=e[64];let X;e[65]!==S||e[66]!==l?(X=s.jsx(W,{type:"button",variant:"outline",onClick:l,disabled:S,children:"Cancelar"}),e[65]=S,e[66]=l,e[67]=X):X=e[67];const se=S?"Salvando...":"Salvar";let G;e[68]!==S||e[69]!==se?(G=s.jsx(W,{type:"submit",disabled:S,children:se}),e[68]=S,e[69]=se,e[70]=G):G=e[70];let R;e[71]!==X||e[72]!==G?(R=s.jsxs(ue,{className:"pt-4",children:[X,G]}),e[71]=X,e[72]=G,e[73]=R):R=e[73];let J;return e[74]!==F||e[75]!==U||e[76]!==V||e[77]!==Y||e[78]!==R?(J=s.jsxs("form",{onSubmit:F,className:"space-y-4",children:[U,V,Y,R]}),e[74]=F,e[75]=U,e[76]=V,e[77]=Y,e[78]=R,e[79]=J):J=e[79],J}function gs(n){return{value:n,label:n}}const xs={vtex:ss,"google-analytics":is,"google-search-console":cs,github:hs},me="deco-reader@decocms.iam.gserviceaccount.com",tt={"google-analytics":"ga4","google-search-console":"gsc"},st={ga4:{label:"Google Analytics",resourceLabel:"ID da propriedade",resourcePlaceholder:"ex: 123456789",resourceHint:"No GA4: Admin → Detalhes da propriedade → ID da propriedade (só números).",connectSteps:["Abra o Google Analytics (GA4) da sua loja.","Vá em Admin → Acesso à propriedade (Gerenciamento de acesso).",`Clique em + → Adicionar usuários, cole ${me} e conceda o papel Leitor.`,"Copie o ID da propriedade (Admin → Detalhes da propriedade) e cole abaixo."]},gsc:{label:"Google Search Console",resourceLabel:"Site / propriedade",resourcePlaceholder:"ex: sc-domain:sualoja.com.br",resourceHint:"Use o mesmo formato que aparece no Search Console: sc-domain:sualoja.com.br ou https://www.sualoja.com.br/.",connectSteps:["Abra o Google Search Console da sua loja.","Vá em Configurações → Usuários e permissões.",`Clique em Adicionar usuário, cole ${me} e escolha permissão Completa.`,"Copie o endereço do site como aparece no seletor de propriedades e cole abaixo."]}};function ys(n,e){const t=st[n].label;switch(e){case"no-access":return{title:`Ainda não conseguimos acessar este recurso no ${t}.`,steps:n==="ga4"?[`Confirme que ${me} foi adicionado em Admin → Acesso à propriedade com o papel Leitor.`,"Confira se o ID da propriedade está correto (só números, sem o prefixo 'properties/').","A concessão de acesso pode levar alguns segundos — tente novamente."]:[`Confirme que ${me} foi adicionado em Configurações → Usuários e permissões.`,"A permissão precisa ser Completa ou Restrita — 'Não verificado' não funciona.","Confira se o endereço do site está exatamente como aparece no Search Console."]};case"no-web-stream":return{title:"Esta propriedade do GA4 não tem um fluxo de dados da Web (site) configurado.",steps:["No GA4, vá em Admin → Fluxos de dados.","Clique em Adicionar fluxo → Web.","Informe a URL do site da sua loja e salve o fluxo.","Volte aqui e tente vincular de novo. (Propriedades só de app precisam de vínculo manual — fale com o suporte.)"]};case"no-match":return{title:"O recurso informado não corresponde ao domínio desta loja.",steps:n==="ga4"?["Verifique se digitou o ID da propriedade certa — provavelmente é de outro site.","No GA4, o site medido aparece em Admin → Fluxos de dados → (seu fluxo Web) → URL do stream."]:["Verifique se selecionou a propriedade do Search Console referente a esta loja.","O endereço precisa cobrir o mesmo domínio do diagnóstico."]};case"resource_already_bound":return{title:"Este recurso já está vinculado a outra loja.",steps:["Se este recurso é realmente desta loja, fale com o suporte para uma revisão manual.","Caso tenha digitado o id errado, confira e tente novamente."]};default:return{title:"Não foi possível verificar o acesso a este recurso.",steps:["Revise os passos de acesso acima e tente novamente.","Se persistir, fale com o suporte."]}}}function bs(n){const e=Q.c(76),{provider:t,siteUrl:o,selfClient:i,org:r,initialResourceId:l,onDone:c,onIsPendingChange:d,onOAuthInstead:p}=n,a=st[t],f=fe(),[u,g]=B.useState(null);let _,b;if(e[0]!==a.resourceLabel){const G=he({resourceId:ie().trim().min(1,`Informe o ${a.resourceLabel.toLowerCase()}`)});b=xe,_=ge(G),e[0]=a.resourceLabel,e[1]=_,e[2]=b}else _=e[1],b=e[2];const h=l??"";let m;e[3]!==h?(m={resourceId:h},e[3]=h,e[4]=m):m=e[4];let y;e[5]!==_||e[6]!==m?(y={resolver:_,defaultValues:m},e[5]=_,e[6]=m,e[7]=y):y=e[7];const C=b(y);let x;e[8]!==t||e[9]!==i||e[10]!==o?(x=async G=>{if(!o)throw new Error("URL da loja indisponível — recarregue a página.");const R=await i.callTool({name:"COMMERCE_DISCOVERY_BIND",arguments:{siteUrl:o,provider:t,resourceId:G.resourceId}});return te(R)},e[8]=t,e[9]=i,e[10]=o,e[11]=x):x=e[11];let N,E;e[12]!==d?(N=()=>d?.(!0),E=()=>d?.(!1),e[12]=d,e[13]=N,e[14]=E):(N=e[13],E=e[14]);let j;e[15]!==a.label||e[16]!==c||e[17]!==r||e[18]!==t||e[19]!==f||e[20]!==o?(j=async G=>{if(G.ok){g(null),Se.success(`${a.label} conectado`),o&&await f.invalidateQueries({queryKey:Z.commerceDiscoveryConnectionStatus(r.id,o)}),c();return}g({...ys(t,G.reason??"unknown"),detail:G.detail})},e[15]=a.label,e[16]=c,e[17]=r,e[18]=t,e[19]=f,e[20]=o,e[21]=j):j=e[21];let v;e[22]!==x||e[23]!==N||e[24]!==E||e[25]!==j?(v={mutationFn:x,onMutate:N,onSettled:E,onSuccess:j},e[22]=x,e[23]=N,e[24]=E,e[25]=j,e[26]=v):v=e[26];const w=_e(v);let I;if(e[27]!==C||e[28]!==w){let G;e[30]!==w?(G=R=>w.mutate(R),e[30]=w,e[31]=G):G=e[31],I=C.handleSubmit(G),e[27]=C,e[28]=w,e[29]=I}else I=e[29];const T=I,S=w.isPending,k=js;let A;e[32]!==a.connectSteps?(A=a.connectSteps.map(Cs),e[32]=a.connectSteps,e[33]=A):A=e[33];let P;e[34]!==A?(P=s.jsx("ol",{className:"space-y-2 text-sm text-muted-foreground",children:A}),e[34]=A,e[35]=P):P=e[35];let F;e[36]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx("code",{className:"min-w-0 flex-1 truncate text-xs text-foreground",children:me}),e[36]=F):F=e[36];let K;e[37]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/40 p-2",children:[F,s.jsx(W,{type:"button",variant:"ghost",size:"icon-sm",onClick:k,"aria-label":"Copiar e-mail do service account",children:s.jsx(Je,{size:16})})]}),e[37]=K):K=e[37];let q;e[38]!==a.resourceHint||e[39]!==a.resourceLabel||e[40]!==a.resourcePlaceholder||e[41]!==S?(q=G=>{const{field:R}=G;return s.jsxs(ae,{children:[s.jsx(ve,{children:a.resourceLabel}),s.jsx(le,{children:s.jsx(be,{...R,placeholder:a.resourcePlaceholder,disabled:S,autoComplete:"off"})}),s.jsx(wt,{children:a.resourceHint}),s.jsx(ce,{})]})},e[38]=a.resourceHint,e[39]=a.resourceLabel,e[40]=a.resourcePlaceholder,e[41]=S,e[42]=q):q=e[42];let D;e[43]!==C.control||e[44]!==q?(D=s.jsx(re,{control:C.control,name:"resourceId",render:q}),e[43]=C.control,e[44]=q,e[45]=D):D=e[45];let L;e[46]!==C||e[47]!==D?(L=s.jsx(ye,{...C,children:D}),e[46]=C,e[47]=D,e[48]=L):L=e[48];let O;e[49]!==u?(O=u&&s.jsxs("div",{role:"alert",className:"space-y-2 rounded-lg border border-destructive/40 bg-destructive/5 p-3",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:u.title}),s.jsx("ol",{className:"space-y-1 text-sm text-muted-foreground",children:u.steps.map(vs)})]}),e[49]=u,e[50]=O):O=e[50];let z;e[51]!==w.error||e[52]!==w.isError?(z=w.isError&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:w.error instanceof Error?w.error.message:"Não foi possível vincular."}),e[51]=w.error,e[52]=w.isError,e[53]=z):z=e[53];let M;e[54]!==S||e[55]!==p?(M=p?s.jsx("button",{type:"button",onClick:p,disabled:S,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-foreground disabled:opacity-50",children:"autorizar via login do Google"}):s.jsx("span",{}),e[54]=S,e[55]=p,e[56]=M):M=e[56];let $;e[57]!==S||e[58]!==c?($=s.jsx(W,{type:"button",variant:"outline",onClick:c,disabled:S,children:"Cancelar"}),e[57]=S,e[58]=c,e[59]=$):$=e[59];const U=S?"Verificando...":"Vincular";let V;e[60]!==S||e[61]!==U?(V=s.jsx(W,{type:"submit",disabled:S,children:U}),e[60]=S,e[61]=U,e[62]=V):V=e[62];let Y;e[63]!==$||e[64]!==V?(Y=s.jsxs("div",{className:"flex gap-2",children:[$,V]}),e[63]=$,e[64]=V,e[65]=Y):Y=e[65];let X;e[66]!==M||e[67]!==Y?(X=s.jsxs(ue,{className:"flex-col gap-2 pt-2 sm:flex-row sm:items-center sm:justify-between",children:[M,Y]}),e[66]=M,e[67]=Y,e[68]=X):X=e[68];let se;return e[69]!==T||e[70]!==P||e[71]!==L||e[72]!==O||e[73]!==z||e[74]!==X?(se=s.jsxs("form",{onSubmit:T,className:"space-y-4",children:[P,K,L,O,z,X]}),e[69]=T,e[70]=P,e[71]=L,e[72]=O,e[73]=z,e[74]=X,e[75]=se):se=e[75],se}function vs(n){return s.jsxs("li",{className:"flex gap-2",children:[s.jsx("span",{"aria-hidden":!0,children:"•"}),s.jsx("span",{children:n})]},n)}function Cs(n,e){return s.jsxs("li",{className:"flex gap-2",children:[s.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium text-foreground",children:e+1}),s.jsx("span",{children:n})]},n)}function js(){navigator.clipboard?.writeText(me),Se.success("E-mail copiado")}function _s(){const n=Q.c(2);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),n[0]=e):e=n[0];let t;return n[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-card p-3 sm:h-full sm:flex-col sm:items-stretch sm:p-4",children:[e,s.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[s.jsx("div",{className:"h-4 w-24 animate-pulse rounded bg-muted/60"}),s.jsx("div",{className:"hidden h-3 w-full animate-pulse rounded bg-muted/60 sm:block"})]}),s.jsx("div",{className:"h-8 w-20 shrink-0 animate-pulse rounded-lg bg-muted/60 sm:mt-auto sm:w-full"})]}),n[1]=t):t=n[1],t}const Ss="rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground";function Ns(n){const e=Q.c(36),{card:t,connecting:o,disconnecting:i,disabled:r,onConnect:l,onDisconnect:c,org:d,selfClient:p,siteUrl:a,autoOpenConfigFieldKey:f,onAutoOpenConfigHandled:u}=n,g=t.linkedConnectionId,_=tt[t.bindingType],b=!!_&&t.boundVia!=="oauth";let h;e[0]!==f||e[1]!==t||e[2]!==o||e[3]!==r||e[4]!==i||e[5]!==g||e[6]!==u||e[7]!==l||e[8]!==c||e[9]!==d||e[10]!==_||e[11]!==p||e[12]!==a||e[13]!==b?(h=b&&_?s.jsx(ws,{card:t,provider:_,org:d,selfClient:p,siteUrl:a,onOAuthInstead:l,disabled:r,connecting:o}):t.satisfied&&g?s.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[s.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[s.jsx(Re,{size:16,className:"text-success"})," Conectado"]}),s.jsx(B.Suspense,{fallback:s.jsx(Es,{}),children:s.jsx(Ts,{card:t,org:d,selfClient:p,connectionId:g,contextSiteUrl:a,autoOpen:Ht({autoOpenFieldKey:f,card:t}),onAutoOpenHandled:u})}),s.jsxs(Oe,{children:[s.jsx(ke,{asChild:!0,children:s.jsx(W,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground hover:text-destructive",disabled:r||i,onClick:c,"aria-label":`Desconectar ${t.title}`,children:i?s.jsx(Ce,{size:16,className:"animate-spin"}):s.jsx(vt,{size:16})})}),s.jsx(Ae,{children:"Desconectar"})]})]}):s.jsx(W,{type:"button",variant:"outline",size:"sm",className:"sm:w-full",disabled:r||o,onClick:l,"aria-label":`Conectar ${t.title}`,children:o?s.jsx(Ce,{size:16,className:"animate-spin"}):"Conectar"}),e[0]=f,e[1]=t,e[2]=o,e[3]=r,e[4]=i,e[5]=g,e[6]=u,e[7]=l,e[8]=c,e[9]=d,e[10]=_,e[11]=p,e[12]=a,e[13]=b,e[14]=h):h=e[14];const m=h;let y;e[15]!==t.icon||e[16]!==t.title?(y=s.jsx(Ie,{icon:t.icon,name:t.title,size:"sm",fit:"contain",className:"shrink-0 p-1.5"}),e[15]=t.icon,e[16]=t.title,e[17]=y):y=e[17];let C;e[18]!==t.area?(C=t.area&&s.jsx("span",{className:oe("hidden sm:inline-block",Ss),children:t.area}),e[18]=t.area,e[19]=C):C=e[19];let x;e[20]!==y||e[21]!==C?(x=s.jsxs("div",{className:"shrink-0 sm:flex sm:w-full sm:items-center sm:justify-between sm:gap-2",children:[y,C]}),e[20]=y,e[21]=C,e[22]=x):x=e[22];let N;e[23]!==t.title?(N=s.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),e[23]=t.title,e[24]=N):N=e[24];let E;e[25]!==t.headline?(E=t.headline&&s.jsx("p",{className:"hidden text-sm leading-5 text-muted-foreground sm:mt-0.5 sm:line-clamp-2 sm:block",children:t.headline}),e[25]=t.headline,e[26]=E):E=e[26];let j;e[27]!==N||e[28]!==E?(j=s.jsxs("div",{className:"min-w-0 flex-1",children:[N,E]}),e[27]=N,e[28]=E,e[29]=j):j=e[29];let v;e[30]!==m?(v=s.jsx("div",{className:"shrink-0 sm:mt-auto sm:w-full sm:pt-1",children:m}),e[30]=m,e[31]=v):v=e[31];let w;return e[32]!==x||e[33]!==j||e[34]!==v?(w=s.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-card p-3 sm:h-full sm:flex-col sm:items-stretch sm:p-4",children:[x,j,v]}),e[32]=x,e[33]=j,e[34]=v,e[35]=w):w=e[35],w}function ws(n){const e=Q.c(39),{card:t,provider:o,org:i,selfClient:r,siteUrl:l,onOAuthInstead:c,disabled:d,connecting:p}=n,[a,f]=B.useState(!1),[u,g]=B.useState(!1);let _;e[0]!==u?(_=k=>{!k&&u||f(k)},e[0]=u,e[1]=_):_=e[1];const b=_;let h;e[2]!==t.satisfied||e[3]!==t.title||e[4]!==p||e[5]!==d?(h=t.satisfied?s.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[s.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[s.jsx(Re,{size:16,className:"text-success"})," Conectado"]}),s.jsxs(Oe,{children:[s.jsx(ke,{asChild:!0,children:s.jsx(W,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:()=>f(!0),"aria-label":`Configurar ${t.title}`,children:s.jsx(Xe,{size:16})})}),s.jsx(Ae,{children:"Editar configuração"})]})]}):s.jsx(W,{type:"button",variant:"outline",size:"sm",className:"sm:w-full",disabled:d||p,onClick:()=>f(!0),"aria-label":`Conectar ${t.title}`,children:p?s.jsx(Ce,{size:16,className:"animate-spin"}):"Conectar"}),e[2]=t.satisfied,e[3]=t.title,e[4]=p,e[5]=d,e[6]=h):h=e[6];let m;e[7]!==t.icon||e[8]!==t.title?(m=s.jsx(Ie,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-1.5"}),e[7]=t.icon,e[8]=t.title,e[9]=m):m=e[9];let y;e[10]!==t.title?(y=s.jsx(Be,{children:t.title}),e[10]=t.title,e[11]=y):y=e[11];let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(Ve,{children:"Conceda acesso ao nosso leitor e informe o identificador"}),e[12]=C):C=e[12];let x;e[13]!==y?(x=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[y,C]}),e[13]=y,e[14]=x):x=e[14];let N;e[15]!==m||e[16]!==x?(N=s.jsxs(He,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[m,x]}),e[15]=m,e[16]=x,e[17]=N):N=e[17];const E=t.boundResource??void 0;let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=()=>f(!1),e[18]=j):j=e[18];let v;e[19]!==t.satisfied||e[20]!==c?(v=t.satisfied?void 0:()=>{f(!1),c()},e[19]=t.satisfied,e[20]=c,e[21]=v):v=e[21];let w;e[22]!==i||e[23]!==o||e[24]!==r||e[25]!==l||e[26]!==v||e[27]!==E?(w=s.jsx(bs,{provider:o,siteUrl:l,selfClient:r,org:i,initialResourceId:E,onDone:j,onIsPendingChange:g,onOAuthInstead:v}),e[22]=i,e[23]=o,e[24]=r,e[25]=l,e[26]=v,e[27]=E,e[28]=w):w=e[28];let I;e[29]!==w||e[30]!==N?(I=s.jsxs(We,{className:"sm:max-w-lg",children:[N,w]}),e[29]=w,e[30]=N,e[31]=I):I=e[31];let T;e[32]!==b||e[33]!==a||e[34]!==I?(T=s.jsx(Ye,{open:a,onOpenChange:b,children:I}),e[32]=b,e[33]=a,e[34]=I,e[35]=T):T=e[35];let S;return e[36]!==T||e[37]!==h?(S=s.jsxs(s.Fragment,{children:[h,T]}),e[36]=T,e[37]=h,e[38]=S):S=e[38],S}function Es(){const n=Q.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"size-8 shrink-0 animate-pulse rounded-lg bg-muted/60"}),n[0]=e):e=n[0],e}function Ts(n){const e=Q.c(60),{card:t,org:o,selfClient:i,connectionId:r,contextSiteUrl:l,autoOpen:c,onAutoOpenHandled:d}=n;let p;e[0]!==r||e[1]!==o.id||e[2]!==o.slug?(p={connectionId:r,orgId:o.id,orgSlug:o.slug},e[0]=r,e[1]=o.id,e[2]=o.slug,e[3]=p):p=e[3];const a=Te(p),[f,u]=B.useState(c),[g,_]=B.useState(!1),b=fe(),h=xs[t.bindingType],m=Vt(t.configurationState);let y;e[4]!==c||e[5]!==d?(y=()=>{u(!1),c&&d()},e[4]=c,e[5]=d,e[6]=y):y=e[6];const C=y;let x;e[7]!==C||e[8]!==g?(x=U=>{if(!(!U&&g)){if(!U){C();return}u(!0)}},e[7]=C,e[8]=g,e[9]=x):x=e[9];const N=x;let E;e[10]!==r||e[11]!==i?(E=async()=>{await i.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:r,force:!0}})},e[10]=r,e[11]=i,e[12]=E):E=e[12];let j;e[13]!==t.title||e[14]!==C||e[15]!==o.id||e[16]!==b?(j=async()=>{await b.invalidateQueries({queryKey:Z.commerceDiscoveryCompanionConnectionsPrefix(o.id)}),Se.success(`${t.title} desconectado`),C()},e[13]=t.title,e[14]=C,e[15]=o.id,e[16]=b,e[17]=j):j=e[17];let v;e[18]!==E||e[19]!==j?(v={mutationFn:E,onSuccess:j,onError:Is},e[18]=E,e[19]=j,e[20]=v):v=e[20];const w=_e(v);if(!h)return null;let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=()=>u(!0),e[21]=I):I=e[21];const T=`Configurar ${t.title}`;let S;e[22]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Xe,{size:16}),e[22]=S):S=e[22];let k;e[23]!==T?(k=s.jsx(ke,{asChild:!0,children:s.jsx(W,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:I,"aria-label":T,children:S})}),e[23]=T,e[24]=k):k=e[24];const A=m.length>0?"Editar configuração":"Configurar";let P;e[25]!==A?(P=s.jsx(Ae,{children:A}),e[25]=A,e[26]=P):P=e[26];let F;e[27]!==k||e[28]!==P?(F=s.jsxs(Oe,{children:[k,P]}),e[27]=k,e[28]=P,e[29]=F):F=e[29];let K;e[30]!==t.icon||e[31]!==t.title?(K=s.jsx(Ie,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-1.5"}),e[30]=t.icon,e[31]=t.title,e[32]=K):K=e[32];let q;e[33]!==t.title?(q=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[s.jsx(Be,{children:t.title}),s.jsxs(Ve,{children:["Configure o ",t.title," para enriquecer os dados"]})]}),e[33]=t.title,e[34]=q):q=e[34];let D;e[35]!==K||e[36]!==q?(D=s.jsxs(He,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[K,q]}),e[35]=K,e[36]=q,e[37]=D):D=e[37];let L;e[38]!==w?(L=()=>w.mutate(),e[38]=w,e[39]=L):L=e[39];let O;e[40]!==h||e[41]!==t||e[42]!==C||e[43]!==a||e[44]!==r||e[45]!==l||e[46]!==o||e[47]!==i||e[48]!==L?(O=s.jsx(h,{card:t,connectionId:r,companionClient:a,selfClient:i,org:o,contextSiteUrl:l,onDone:C,onDisconnect:L,onIsPendingChange:_}),e[40]=h,e[41]=t,e[42]=C,e[43]=a,e[44]=r,e[45]=l,e[46]=o,e[47]=i,e[48]=L,e[49]=O):O=e[49];let z;e[50]!==D||e[51]!==O?(z=s.jsxs(We,{className:"sm:max-w-lg",children:[D,O]}),e[50]=D,e[51]=O,e[52]=z):z=e[52];let M;e[53]!==f||e[54]!==N||e[55]!==z?(M=s.jsx(Ye,{open:f,onOpenChange:N,children:z}),e[53]=f,e[54]=N,e[55]=z,e[56]=M):M=e[56];let $;return e[57]!==F||e[58]!==M?($=s.jsxs(s.Fragment,{children:[F,M]}),e[57]=F,e[58]=M,e[59]=$):$=e[59],$}function Is(){Se.error("Não foi possível desconectar. Tente novamente.")}const $e={vtex:{registryAppId:"deco/vtex",area:"Catálogo",headline:"Rupturas e PDPs que travam suas vendas."},"google-analytics":{registryAppId:"deco/google-analytics",area:"Funil",headline:"Onde a receita vaza no seu funil."},"google-search-console":{registryAppId:"deco/google-search-console",area:"Busca",headline:"O tráfego de busca que você deixa na mesa."},github:{registryAppId:"deco/mcp-github",area:"Engenharia",headline:"A saúde da entrega de código por trás da sua loja."}};function Os(n){const e=Q.c(40),{selfClient:t,org:o,cdConnectionId:i,siteUrl:r}=n;let l;e[0]!==i||e[1]!==o.id||e[2]!==o.slug?(l={connectionId:i,orgId:o.id,orgSlug:o.slug},e[0]=i,e[1]=o.id,e[2]=o.slug,e[3]=l):l=e[3];const c=Te(l);let d;e[4]!==i||e[5]!==o.id?(d=Z.commerceDiscoveryCompanionSchema(o.id,i),e[4]=i,e[5]=o.id,e[6]=d):d=e[6];let p;e[7]!==c?(p=async()=>{const R=await c.callTool({name:"MCP_CONFIGURATION",arguments:{}});return te(R)},e[7]=c,e[8]=p):p=e[8];let a;e[9]!==d||e[10]!==p?(a={queryKey:d,queryFn:p,retry:!1},e[9]=d,e[10]=p,e[11]=a):a=e[11];const f=de(a),u=f.data?.stateSchema?Ft(f.data.stateSchema):null,g=u&&u.length>0?u:Ut,_=g.map(qs),b=g.map(zs).filter(Ks),h=g.filter($s).map(Ls),m=[...b,...h].sort().join(",");let y;e[12]!==i||e[13]!==o.id?(y=Z.commerceDiscoveryConnection(o.id,i),e[12]=i,e[13]=o.id,e[14]=y):y=e[14];let C;e[15]!==i||e[16]!==t?(C=async()=>{const R=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}});return te(R)},e[15]=i,e[16]=t,e[17]=C):C=e[17];let x;e[18]!==y||e[19]!==C?(x={queryKey:y,queryFn:C},e[18]=y,e[19]=C,e[20]=x):x=e[20];const E=Ne(x).data?.item?.configuration_state??null;let j;e[21]!==E?(j=R=>E?.[R.fieldKey]?.value,e[21]=E,e[22]=j):j=e[22];const v=g.map(j).filter(Ds),w=[..._.map(Ps),...b.map(Rs),...v.map(As)].sort().join(","),T=Ne({queryKey:Z.commerceDiscoveryCompanionConnections(o.id,w),queryFn:async()=>{if(g.length===0)return{items:[]};const R=[{field:["app_name"],operator:"in",value:_},{field:["app_id"],operator:"in",value:b}];v.length>0&&R.push({field:["id"],operator:"in",value:v});const J=await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:R},limit:1e3}});return te(J)}}).data?.items??[],S=new Set(v),k=T.filter(R=>S.has(R.id)),A=k.filter(ks);let P;e[23]!==o.id||e[24]!==o.slug?(P=R=>({queryKey:Z.commerceDiscoveryCompanionOAuthStatus(o.id,R.id),queryFn:async()=>{try{const J=await fetch(`/api/${encodeURIComponent(o.slug)}/connections/${encodeURIComponent(R.id)}/oauth-token/status`,{credentials:"include"});return J.ok?{hasToken:(await J.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}},retry:!1}),e[23]=o.id,e[24]=o.slug,e[25]=P):P=e[25];const F=Dt({queries:A.map(P)});let K;e[26]!==F?(K=(R,J)=>[R.id,F[J]?.data?.hasToken===!0],e[26]=F,e[27]=K):K=e[27];const q=new Map(A.map(K)),D={};for(const R of k)D[R.id]=!R.oauth_config||!!R.connection_token||q.get(R.id)===!0;const L=Ne({queryKey:Z.commerceDiscoveryCompanionRegistry(o.id,m),queryFn:async()=>{if(g.length===0)return{items:[]};const R=Mt(b,h),J=await jt(Ge.REGISTRY(o.id),o.id,o.slug,"COLLECTION_REGISTRY_APP_LIST",{...R?{where:R}:{},limit:1e3});return te(J)}}),O={},z={};for(const R of L.data?.items??[])O[R.id]=R,R.server?.name&&(z[R.server.name]=R);let M;e[28]!==o.id||e[29]!==r?(M=Z.commerceDiscoveryConnectionStatus(o.id,r??""),e[28]=o.id,e[29]=r,e[30]=M):M=e[30];const $=!!r;let U;e[31]!==t||e[32]!==r?(U=async()=>{const R=await t.callTool({name:"COMMERCE_DISCOVERY_CONNECTION_STATUS",arguments:{siteUrl:r}});return te(R)},e[31]=t,e[32]=r,e[33]=U):U=e[33];let V;e[34]!==M||e[35]!==$||e[36]!==U?(V={queryKey:M,enabled:$,queryFn:U},e[34]=M,e[35]=$,e[36]=U,e[37]=V):V=e[37];const Y=de(V),X={};for(const[R,J]of Object.entries(tt)){const H=Y.data?.providers?.[J];H?.connected&&H.via==="sa"&&(X[R]={resource:H.resource??null})}const se=Xt({requirements:g,itemsById:O,itemsByName:z,connections:T,connectionReadiness:D,configurationState:E,curated:$e,saBindings:X});let G;return e[38]!==se?(G={cards:se},e[38]=se,e[39]=G):G=e[39],G}function ks(n){return n.oauth_config&&!n.connection_token}function As(n){return`linked:${n}`}function Rs(n){return`app:${n}`}function Ps(n){return`binding:${n}`}function Ds(n){return typeof n=="string"&&n.length>0}function Ls(n){return n.bindingType}function $s(n){return!$e[n.bindingType]}function Ks(n){return!!n}function zs(n){return $e[n.bindingType]?.registryAppId}function qs(n){return n.bindingType}function Fs({selfClient:n,org:e,userId:t,cdConnectionId:o,domain:i,siteUrl:r}){const l=fe(),[c,d]=B.useState(null),[p,a]=B.useState(null),[f,u]=B.useState(null),g=async(h,m)=>{const y=await n.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:h,data:m}});return te(y)};async function _(h){d(h.fieldKey),u(null);const m={app_name:h.title,field_key:h.fieldKey,organization_id:e.id,domain:i,site_url:r};ne("commerce_onboarding_companion_connect_clicked",m);try{let y=h.candidateConnectionId;if(!y){const v=_t(h.registryItem,e.id,t,{remoteIndex:0}),w=v.connection_type==="STDIO",I=!!v.connection_url,T=w&&v.connection_headers&&typeof v.connection_headers=="object"&&"command"in v.connection_headers;if(!I&&!T)return ne("commerce_onboarding_companion_connect_failed",{...m,error:"no_connection_method"}),u(`${h.title} cannot be connected: no connection method available`),!1;const S=await n.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:v}});y=te(S).item.id}const C=y,x=await kt({connectionId:C,orgId:e.id,orgSlug:e.slug,persistFallback:v=>g(C,{connection_token:v}).then(()=>{})});if(!x.ok)return ne("commerce_onboarding_companion_connect_failed",{...m,error:x.error}),u(`Couldn't sign in to ${h.title}: ${x.error}`),!1;const N=await n.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}}),E=te(N).item?.configuration_state??null,j=Qt(E,h.fieldKey,h.bindingType,C);return h.bindingType==="github"&&delete j.github_repo,await g(o,{configuration_state:j}),await l.invalidateQueries({queryKey:Z.commerceDiscoveryConnection(e.id,o)}),await l.invalidateQueries({queryKey:Z.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),ne("commerce_onboarding_companion_connected",m),!0}catch(y){return ne("commerce_onboarding_companion_connect_failed",{...m,error:y instanceof Error?y.message:String(y)}),u(y instanceof Error?y.message:String(y)),!1}finally{d(null)}}async function b(h){a(h.fieldKey),u(null);const m={app_name:h.title,field_key:h.fieldKey,organization_id:e.id,domain:i,site_url:r};ne("commerce_onboarding_companion_disconnect_clicked",m);try{const y=await n.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}}),x={...te(y).item?.configuration_state??null??{}};return delete x[h.fieldKey],h.bindingType==="github"&&delete x.github_repo,await g(o,{configuration_state:x}),await l.invalidateQueries({queryKey:Z.commerceDiscoveryConnection(e.id,o)}),await l.invalidateQueries({queryKey:Z.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),ne("commerce_onboarding_companion_disconnected",m),!0}catch(y){return ne("commerce_onboarding_companion_disconnect_failed",{...m,error:y instanceof Error?y.message:String(y)}),u(y instanceof Error?y.message:String(y)),!1}finally{a(null)}}return{connect:_,connectingFieldKey:c,disconnect:b,disconnectingFieldKey:p,error:f}}const Ke="flex min-h-0 flex-1 flex-col gap-4 md:grid md:flex-none md:gap-4";function ze(){const n=Q.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("h1",{className:"text-lg font-medium leading-6 text-foreground lg:text-2xl lg:leading-8",children:"Conecte suas ferramentas para ver o diagnóstico completo"}),n[0]=e):e=n[0],e}function Us(){const n=Q.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[0,1,2,3].map(Ms)}),n[0]=e):e=n[0],e}function Ms(n){return s.jsx(_s,{},n)}function Qs(){const n=Q.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:Ke,children:[s.jsx(ze,{}),s.jsx(Us,{})]}),n[0]=e):e=n[0],e}function Gs(n){const e=Q.c(5),{onRetry:t}=n;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ze,{}),e[0]=o):o=e[0];let i,r;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("p",{className:"text-sm text-foreground",children:"Não foi possível carregar as integrações complementares."}),r=s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Algo deu errado ao carregar suas integrações."}),e[1]=i,e[2]=r):(i=e[1],r=e[2]);let l;return e[3]!==t?(l=s.jsxs("div",{className:Ke,children:[o,s.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[i,r,s.jsx(W,{type:"button",variant:"outline",size:"sm",className:"mt-3",onClick:t,children:"Tentar novamente"})]})]}),e[3]=t,e[4]=l):l=e[4],l}function Sn(n){const e=Q.c(2);let t;return e[0]!==n?(t=s.jsx(gt,{children:o=>{const{reset:i}=o;return s.jsx(xt,{fallback:r=>{const{resetError:l}=r;return s.jsx(Gs,{onRetry:()=>{i(),l()}})},children:s.jsx(B.Suspense,{fallback:s.jsx(Qs,{}),children:s.jsx(Bs,{...n})})})}}),e[0]=n,e[1]=t):t=e[1],t}function Bs(n){const e=Q.c(46),{org:t,cdConnectionId:o,siteUrl:i,onReadinessChange:r}=n,{data:l}=yt.useSession(),c=l?.user?.id??"";let d;if(e[0]!==i){const T=i?je(i):null;if(T?.ok)try{d=new URL(T.value).hostname}catch{d=void 0}e[0]=i,e[1]=d}else d=e[1];let p;e[2]!==t.id||e[3]!==t.slug?(p={connectionId:bt,orgId:t.id,orgSlug:t.slug},e[2]=t.id,e[3]=t.slug,e[4]=p):p=e[4];const a=Te(p);let f;e[5]!==o||e[6]!==t||e[7]!==a||e[8]!==i?(f={selfClient:a,org:t,cdConnectionId:o,siteUrl:i},e[5]=o,e[6]=t,e[7]=a,e[8]=i,e[9]=f):f=e[9];const{cards:u}=Os(f);let g;e[10]!==o||e[11]!==t||e[12]!==a||e[13]!==d||e[14]!==i||e[15]!==c?(g={selfClient:a,org:t,userId:c,cdConnectionId:o,domain:d,siteUrl:i},e[10]=o,e[11]=t,e[12]=a,e[13]=d,e[14]=i,e[15]=c,e[16]=g):g=e[16];const{connect:_,connectingFieldKey:b,disconnect:h,disconnectingFieldKey:m,error:y}=Fs(g),[C,x]=B.useState(null);if(r?.(u.length===0||u.some(Vs)),u.length===0)return null;const N=b!==null||m!==null;let E;e[17]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(ze,{}),e[17]=E):E=e[17];let j;e[18]!==y?(j=y&&s.jsx("p",{role:"alert",className:"mb-3 text-sm text-destructive",children:y}),e[18]=y,e[19]=j):j=e[19];let v;if(e[20]!==C||e[21]!==N||e[22]!==u||e[23]!==_||e[24]!==b||e[25]!==h||e[26]!==m||e[27]!==t||e[28]!==a||e[29]!==i){let T;e[31]!==C||e[32]!==N||e[33]!==_||e[34]!==b||e[35]!==h||e[36]!==m||e[37]!==t||e[38]!==a||e[39]!==i?(T=S=>{const k=async()=>{await _(S)&&x(S.fieldKey)};return s.jsx(Ns,{card:S,connecting:b===S.fieldKey,disconnecting:m===S.fieldKey,disabled:N&&b!==S.fieldKey&&m!==S.fieldKey,org:t,selfClient:a,siteUrl:i,autoOpenConfigFieldKey:C,onAutoOpenConfigHandled:()=>x(A=>A===S.fieldKey?null:A),onConnect:()=>{k()},onDisconnect:()=>{h(S)}},S.fieldKey)},e[31]=C,e[32]=N,e[33]=_,e[34]=b,e[35]=h,e[36]=m,e[37]=t,e[38]=a,e[39]=i,e[40]=T):T=e[40],v=u.map(T),e[20]=C,e[21]=N,e[22]=u,e[23]=_,e[24]=b,e[25]=h,e[26]=m,e[27]=t,e[28]=a,e[29]=i,e[30]=v}else v=e[30];let w;e[41]!==v?(w=s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:v}),e[41]=v,e[42]=w):w=e[42];let I;return e[43]!==j||e[44]!==w?(I=s.jsxs("div",{className:Ke,children:[E,s.jsxs(qt,{wrapperClassName:"flex min-h-0 flex-1 flex-col md:block",className:"-mx-1 min-h-0 flex-1 overflow-y-auto px-1 md:max-h-[min(60vh,calc(100dvh-330px))] md:flex-none",children:[j,w]})]}),e[43]=j,e[44]=w,e[45]=I):I=e[45],I}function Vs(n){return n.satisfied}const qe="https://decocms.com/agendar",Hs="Precisa de ajuda? Fale conosco",Ws="Agende uma chamada e ajudamos você a conectar suas ferramentas.",pe=[{photo:"https://decoims.com/image?src=decocms%2Fb07a1c19-0cd6-49c8-b326-86055ee78605%2Fauthor-1763423987973-baby.jpeg&quality=original&fit=cover&width=200&height=200",alt:"Especialista da deco"},{photo:"https://decoims.com/decocms/07c2daf4-a3c2-485e-a1a8-341585a06e3b/cecilia.png",alt:"Especialista da deco"},{photo:"https://decoims.com/decocms/48013ca2-3277-464b-b0f1-dd5f1f08d986/tavano.png",alt:"Especialista da deco"}],Ys="var(--brand-green-dark)";function Nn({siteUrl:n,email:e}){const t=new URL(qe);return n&&t.searchParams.set("siteUrl",n),e&&t.searchParams.set("email",e),t.toString()}function Zs(n){const e=Q.c(12),{href:t,size:o,className:i,orgId:r}=n,l=t===void 0?qe:t,c=o===void 0?"lg":o;let d;e[0]!==i?(d=oe("w-full",i),e[0]=i,e[1]=d):d=e[1];let p;e[2]!==r?(p=()=>ne("commerce_onboarding_meeting_cta_clicked",{placement:"visual_card",organization_id:r}),e[2]=r,e[3]=p):p=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(et,{size:16}),e[4]=a):a=e[4];let f;e[5]!==l||e[6]!==p?(f=s.jsxs("a",{href:l,target:"_blank",rel:"noreferrer",onClick:p,children:["Agendar uma reunião",a]}),e[5]=l,e[6]=p,e[7]=f):f=e[7];let u;return e[8]!==c||e[9]!==d||e[10]!==f?(u=s.jsx(W,{asChild:!0,variant:"outline",size:c,className:d,children:f}),e[8]=c,e[9]=d,e[10]=f,e[11]=u):u=e[11],u}function Xs(n){const e=Q.c(10),{size:t}=n,o=t===void 0?72:t;let i;e[0]!==o?(i=Math.round(o*.3),e[0]=o,e[1]=i):i=e[1];const r=i;let l;e[2]!==o?(l={height:o},e[2]=o,e[3]=l):l=e[3];let c;e[4]!==r||e[5]!==o?(c=pe.map((p,a)=>s.jsxs("div",{className:"relative shrink-0",style:{width:o,height:o,marginLeft:a===0?0:-r,zIndex:pe.length-a},children:[s.jsx("div",{className:"h-full w-full overflow-hidden rounded-full border-4 border-card bg-muted",children:s.jsx("img",{src:p.photo,alt:p.alt,className:"h-full w-full object-cover",loading:"lazy"})}),a===0&&s.jsxs("span",{className:"absolute bottom-1.5 right-1.5 flex h-3.5 w-3.5",children:[s.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-success opacity-60 motion-safe:animate-ping","aria-hidden":!0}),s.jsx("span",{className:"relative inline-flex h-3.5 w-3.5 rounded-full border-2 border-card bg-success"})]})]},p.photo)),e[4]=r,e[5]=o,e[6]=c):c=e[6];let d;return e[7]!==l||e[8]!==c?(d=s.jsx("div",{className:"flex items-end",style:l,children:c}),e[7]=l,e[8]=c,e[9]=d):d=e[9],d}function wn(n){const e=Q.c(6),{href:t,orgId:o}=n;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"h-20",style:{backgroundColor:Ys}}),e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"-mt-9 mb-4",children:s.jsx(Xs,{})}),e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx("h2",{className:"text-lg font-medium leading-6 text-foreground",children:Hs}),s.jsx("p",{className:"text-sm leading-5 text-muted-foreground",children:Ws})]}),e[2]=l):l=e[2];let c;return e[3]!==t||e[4]!==o?(c=s.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:s.jsxs("div",{className:"w-full max-w-[440px] overflow-hidden rounded-3xl border border-border bg-card card-shadow",children:[i,s.jsxs("div",{className:"px-8 pb-8",children:[r,l,s.jsx(Zs,{href:t,size:"lg",className:"mt-6",orgId:o})]})]})}),e[3]=t,e[4]=o,e[5]=c):c=e[5],c}function En(n){const e=Q.c(13),{className:t,href:o,orgId:i}=n,r=o===void 0?qe:o;let l;e[0]!==i?(l=()=>ne("commerce_onboarding_meeting_cta_clicked",{placement:"mobile_banner",organization_id:i}),e[0]=i,e[1]=l):l=e[1];let c;e[2]!==t?(c=oe("flex items-center gap-3 rounded-xl border border-border bg-card p-3 card-shadow transition-colors hover:bg-accent",t),e[2]=t,e[3]=c):c=e[3];let d,p;e[4]===Symbol.for("react.memo_cache_sentinel")?(d={height:32,width:32+2*Math.round(22.4)},p=pe.map(Js),e[4]=d,e[5]=p):(d=e[4],p=e[5]);let a,f,u;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("span",{className:"relative flex shrink-0 items-center",style:d,children:[p,s.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-2.5 w-2.5 rounded-full border-2 border-card bg-success","aria-hidden":!0,style:{zIndex:pe.length+1}})]}),f=s.jsx("span",{className:"flex-1 text-sm font-medium leading-tight text-foreground",children:"Precisa de ajuda? Fale conosco"}),u=s.jsx(et,{size:16,className:"shrink-0 text-muted-foreground"}),e[6]=a,e[7]=f,e[8]=u):(a=e[6],f=e[7],u=e[8]);let g;return e[9]!==r||e[10]!==l||e[11]!==c?(g=s.jsxs("a",{href:r,target:"_blank",rel:"noreferrer",onClick:l,className:c,children:[a,f,u]}),e[9]=r,e[10]=l,e[11]=c,e[12]=g):g=e[12],g}function Js(n,e){return s.jsx("span",{className:"absolute block h-8 w-8 overflow-hidden rounded-full border-2 border-card",style:{left:e*Math.round(22.4),zIndex:pe.length-e},children:s.jsx("img",{src:n.photo,alt:n.alt,className:"h-full w-full object-cover",loading:"lazy"})},n.photo)}function Tn(n){const e=Q.c(10),{host:t}=n,o=`https://www.google.com/s2/favicons?domain=${t}&sz=128`;let i,r,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),r=s.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),l=s.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=i,e[1]=r,e[2]=l):(i=e[0],r=e[1],l=e[2]);let c;e[3]!==o?(c=s.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:s.jsx("img",{src:o,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=o,e[4]=c):c=e[4];let d;e[5]!==t?(d=s.jsx("span",{className:"text-lg font-medium text-foreground",children:t}),e[5]=t,e[6]=d):d=e[6];let p;return e[7]!==c||e[8]!==d?(p=s.jsxs("div",{className:"flex items-center gap-3",children:[i,r,l,c,d]}),e[7]=c,e[8]=d,e[9]=p):p=e[9],p}function en(n){return n.content?.find(e=>e.text)?.text??"A configuração do Commerce Discovery falhou."}function In(n){const e=n;if(e.isError)throw new Error(en(e));return e.structuredContent??n}export{Qs as C,Le as L,Tn as S,qt as a,Nn as b,wn as c,Sn as d,En as e,jn as i,je as n,In as p,_n as s};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-D80tOcFJ.js","assets/index-Bhm9Bs1H.js","assets/index-Ct4UCmlw.css","assets/Tool02-CuulG4Zm.js","assets/CheckCircle-Bk4jVW7c.js","assets/Settings02-CiDkLfc2.js","assets/use-mcp-client-Cm__SCrY.js","assets/constants-D_FQAPnt.js","assets/auth-Dz4ZnGBZ.js","assets/useInfiniteQuery-C1NVu96X.js","assets/use-infinite-scroll-BLQ78HyQ.js","assets/studio-tools-C158uWMN.js","assets/badge-DPo5atq1.js","assets/input-DospeWmi.js","assets/dropdown-menu-Bccvvqlu.js","assets/Check-CQjJylK6.js","assets/ChevronRight-e9_7KV61.js","assets/Circle-C2Vu6xbB.js","assets/table-Cw-KhGHY.js","assets/toggle-group-Baz9dJJh.js","assets/use-view-mode-B-CLvSm1.js","assets/use-mobile-Bp-djo0i.js","assets/DotsVertical-D2l5wspb.js","assets/FilterLines-Cp18AAlg.js","assets/Globe01-BPH4QSYr.js","assets/SearchMd-ClupCW3U.js","assets/dialog-df3kXkJ6.js","assets/X-DyjfKbz8.js","assets/AlertCircle-CqDLg4E0.js","assets/Upload01-qHg-k01G.js","assets/alert-dialog-qefhsonV.js","assets/card-CQ82z7ux.js","assets/Trash01-D6a6rHm7.js","assets/label-BosGIEt_.js","assets/select-b1vNfzCY.js","assets/tooltip-0Tj-MlQQ.js","assets/ChevronDown-D0HdYvxS.js","assets/ChevronUp-hFG8HdCY.js","assets/switch-jhzFDXbX.js","assets/textarea-CaTaS5aM.js","assets/XCircle-C-sHcbib.js","assets/checkbox-Ci379OZ6.js","assets/Eye-DqWJbQD8.js","assets/LinkExternal01-DaXyeXMC.js","assets/use-copy-iOzmDtUv.js","assets/Copy01-B_L_kofR.js","assets/Key01-MruRu6FB.js","assets/Plus-DUEQJ6Dq.js","assets/mcp-oauth-BDrL0Lxz.js","assets/Play-BinR83so.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as m,b as n,e as c,j as t,i as p,r as l,aX as f}from"./index-Bhm9Bs1H.js";import{R as u}from"./require-capability-Ct_Ojh8K.js";import"./use-capability-CxpcJysD.js";import"./access-gate-DU_TeSxf.js";import"./capability-load-error-BJsCCDoC.js";const g=l.lazy(()=>f(()=>import("./registry-layout-D80tOcFJ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49])));function j(){const e=m.c(5),i=n();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=c(s);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"h-full flex items-center justify-center",children:t.jsx(p,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=t.jsx(u,{capability:"registry:manage",area:"the registry",children:t.jsx(l.Suspense,{fallback:r,children:t.jsx(g,{onBack:()=>i({to:"/$org/settings/store",params:{org:o}})})})}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}export{j as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as u}from"./use-infinite-scroll-BLQ78HyQ.js";import{dK as i}from"./index-Bhm9Bs1H.js";function t(e,r){return i(e,u,r)}export{t as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as s}from"./use-infinite-scroll-BLQ78HyQ.js";import{dK as u,ab as n}from"./index-Bhm9Bs1H.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
|