decocms 3.2.3 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-C8E06jfW.js → AlertCircle-CQVrG_vJ.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CkF0i1No.js → ArrowUpRight-RSgKJAKz.js} +1 -1
- package/dist/client/assets/{Check-DwRXhDYN.js → Check-_9fGuqcU.js} +1 -1
- package/dist/client/assets/{CheckCircle-2iMrjx7D.js → CheckCircle-BrIielg3.js} +1 -1
- package/dist/client/assets/{ChevronDown-k1VC2srD.js → ChevronDown-D8ki1YTV.js} +1 -1
- package/dist/client/assets/{ChevronLeft-7V2_qQ3E.js → ChevronLeft-Bn25DZii.js} +1 -1
- package/dist/client/assets/{ChevronRight-bA2PmkN9.js → ChevronRight-sANym5JO.js} +1 -1
- package/dist/client/assets/{ChevronUp-gzUJvPqk.js → ChevronUp-DWIsv9KU.js} +1 -1
- package/dist/client/assets/{Container-DrffveDY.js → Container-I8CLKgQT.js} +1 -1
- package/dist/client/assets/{DotsVertical-BZEdPJTY.js → DotsVertical-UEiFsiMu.js} +1 -1
- package/dist/client/assets/{Eye-CbDINxSR.js → Eye-MExi_r3W.js} +1 -1
- package/dist/client/assets/{FilterLines-DGIJAfna.js → FilterLines-4rC1xrIb.js} +1 -1
- package/dist/client/assets/{Globe01-CXHtWC8F.js → Globe01-Dv5kpprP.js} +1 -1
- package/dist/client/assets/{HardDrive-HIDpzn4I.js → HardDrive-D9IQyxX5.js} +1 -1
- package/dist/client/assets/{Key01-BTeVSARy.js → Key01-CjH_GA8o.js} +1 -1
- package/dist/client/assets/{LinkExternal01-D7lnMhd-.js → LinkExternal01-Bh2jIX62.js} +1 -1
- package/dist/client/assets/{Monitor01-F6bKl6tK.js → Monitor01-A1_9QQaN.js} +1 -1
- package/dist/client/assets/{Palette-szvJEqXU.js → Palette-BKIsz_ok.js} +1 -1
- package/dist/client/assets/{Play-sw2az4p0.js → Play-m26DvF8I.js} +1 -1
- package/dist/client/assets/{Plus-dxS60FPA.js → Plus-zYQzJd1M.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-B2-HH-To.js → RefreshCcw01-D0f_Eh8k.js} +1 -1
- package/dist/client/assets/{SearchMd-88iVjfqP.js → SearchMd-DeMPnpHH.js} +1 -1
- package/dist/client/assets/{Settings02-CdYsqAUT.js → Settings02-TwTRrSvQ.js} +1 -1
- package/dist/client/assets/{Shield01-D6lV8m1d.js → Shield01-CohVSmIO.js} +1 -1
- package/dist/client/assets/{Star01-K2L8_aik.js → Star01-DxtsQeOL.js} +1 -1
- package/dist/client/assets/{Stars01-Bmg9xGSu.js → Stars01-oKRH_HZK.js} +1 -1
- package/dist/client/assets/{Stars02-nn8T1-WQ.js → Stars02-CFg4uA06.js} +1 -1
- package/dist/client/assets/{Sun-Bk5MW5gf.js → Sun-prsTZZ-c.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Caie0gIK.js → SwitchHorizontal01-DtrvJRJv.js} +1 -1
- package/dist/client/assets/{Tool01-CBtpfChg.js → Tool01-Blh-dWzw.js} +1 -1
- package/dist/client/assets/{Trash01-DDKaJVRQ.js → Trash01-BtO3xPfa.js} +1 -1
- package/dist/client/assets/{Upload01-B5AbRmag.js → Upload01-DuGEhzNC.js} +1 -1
- package/dist/client/assets/{User01-C5NUNAi1.js → User01-Cbs3uEng.js} +1 -1
- package/dist/client/assets/{Users01-BCOOK-yw.js → Users01-D1iLhJqh.js} +1 -1
- package/dist/client/assets/{Users03-CS9FNDsP.js → Users03-BpVRJS2k.js} +1 -1
- package/dist/client/assets/{X-D96et_XK.js → X-C7X3rsvo.js} +1 -1
- package/dist/client/assets/{XCircle-toDSs4J6.js → XCircle-28kRMNtc.js} +1 -1
- package/dist/client/assets/{XClose-C8XjR0Oj.js → XClose-C-93XSA0.js} +1 -1
- package/dist/client/assets/{Zap-DPY_aC88.js → Zap-Dv5TVml0.js} +1 -1
- package/dist/client/assets/{ZapSquare-D_bnCoLi.js → ZapSquare-C0D82h8r.js} +1 -1
- package/dist/client/assets/{ZoomOut-CFJklA2J.js → ZoomOut-DsFvQG0e.js} +1 -1
- package/dist/client/assets/{access-gate-Bxa3dGfK.js → access-gate-baJeia1A.js} +1 -1
- package/dist/client/assets/{accordion-7Hq31-jA.js → accordion-CBzWT5bz.js} +1 -1
- package/dist/client/assets/{add-section-modal-ctMF5sBw.js → add-section-modal-BWU52XJT.js} +1 -1
- package/dist/client/assets/agent-capabilities-DcmXZCtP.js +3 -0
- package/dist/client/assets/{agent-icon-CEtrmBbc.js → agent-icon-DqIYS1ir.js} +1 -1
- package/dist/client/assets/{agent-icons-CasiUZSA.js → agent-icons-DZENi63W.js} +1 -1
- package/dist/client/assets/{agents-list-CSKXo2_8.js → agents-list-DafoPLUH.js} +1 -1
- package/dist/client/assets/{ai-providers-DFSkJ7HL.js → ai-providers-BdnACxNs.js} +1 -1
- package/dist/client/assets/{alert-C0wwDo4J.js → alert-DQ3f-8ft.js} +1 -1
- package/dist/client/assets/{alert-dialog-jD0HIb4F.js → alert-dialog-DFtcSlfd.js} +1 -1
- package/dist/client/assets/app-editor-BD2ZoSqj.js +1 -0
- package/dist/client/assets/{auth-catchall-CQy9rKP1.js → auth-catchall-CDPdAyEO.js} +1 -1
- package/dist/client/assets/{auth-split-layout-D2GxEaTP.js → auth-split-layout-RuDPAksj.js} +1 -1
- package/dist/client/assets/{automation-list-row-XWf2Pzvs.js → automation-list-row-CCCDTeX2.js} +1 -1
- package/dist/client/assets/{automation-runs-d4uENwdC.js → automation-runs-CWg3SAkQ.js} +1 -1
- package/dist/client/assets/{automations-Cn-4c3Au.js → automations-CUUdoVDT.js} +1 -1
- package/dist/client/assets/{avatar-DXqnRYfU.js → avatar-Ht4phHyw.js} +1 -1
- package/dist/client/assets/{badge-CnPW-GqK.js → badge-793iqcSm.js} +1 -1
- package/dist/client/assets/{brand-context-C1cfILrc.js → brand-context-CKrOzy_j.js} +1 -1
- package/dist/client/assets/{buckets-ByaOx_bc.js → buckets-Cuou8oZr.js} +1 -1
- package/dist/client/assets/{calendar-DeW_DdNU.js → calendar-BcwgSBqk.js} +1 -1
- package/dist/client/assets/{capability-load-error-BGVv1fL5.js → capability-load-error-C5U_XP-e.js} +1 -1
- package/dist/client/assets/{card-DJApDAXW.js → card-Bp1tvcjx.js} +1 -1
- package/dist/client/assets/chat-context-2VONJLj0.js +20 -0
- package/dist/client/assets/{checkbox-BIvxdAqx.js → checkbox-DjyXVlr3.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BHBjLjeF.js → cli-auth-success-WSYP5g8Z.js} +1 -1
- package/dist/client/assets/{collection-detail-C_EFjExv.js → collection-detail-d9ogG-zy.js} +1 -1
- package/dist/client/assets/{collection-display-button-Bj56qTcS.js → collection-display-button-DnHMSi9n.js} +1 -1
- package/dist/client/assets/{collection-search-BJxAlGyH.js → collection-search-7VpMRm-O.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-D6peytAO.js → collection-table-wrapper-Dupw7cC8.js} +1 -1
- package/dist/client/assets/{collection-tabs-CbsCH9v8.js → collection-tabs-FGkin6ZU.js} +1 -1
- package/dist/client/assets/{collections-Btisq60d.js → collections-q49v565i.js} +1 -1
- package/dist/client/assets/{command-BFgPrNtf.js → command-HR08HRGs.js} +1 -1
- package/dist/client/assets/connect-desktop-dialog-DlfiZAax.js +1 -0
- package/dist/client/assets/{connection-card-DHoKYS6O.js → connection-card-BcO2lPF3.js} +1 -1
- package/dist/client/assets/{connection-detail-Bp6uv95F.js → connection-detail-B5bRn-XD.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-q_5sAECo.js → connection-form-helpers-Bh0i7TML.js} +1 -1
- package/dist/client/assets/{connections-BH-sbBlr.js → connections-m2A2Bnzk.js} +1 -1
- package/dist/client/assets/{constants-C-D4Pmy6.js → constants-DcPOVd9N.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-BrQw0UAm.js → decopilot-sse-pool-C7otyoNt.js} +1 -1
- package/dist/client/assets/{dialog-m1msdckr.js → dialog-BTuyAnJD.js} +1 -1
- package/dist/client/assets/{domain-settings-De5BKpSF.js → domain-settings-44sFM9Gz.js} +1 -1
- package/dist/client/assets/{drawer-KxvT14L5.js → drawer-NfOOjKiq.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BXhpM-R_.js → dropdown-menu-Ci4-mVLy.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-DLRUs164.js → dynamic-plugin-layout-CyE7k6GQ.js} +1 -1
- package/dist/client/assets/{empty-state-BXMuvewe.js → empty-state-CeClTvy4.js} +1 -1
- package/dist/client/assets/{empty-state-D3juNsZ6.js → empty-state-DtzOtYNQ.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CvUd4tJL.js → extract-connection-data-CnlTupOc.js} +1 -1
- package/dist/client/assets/{features--cEA_34N.js → features-CK9ndiq8.js} +1 -1
- package/dist/client/assets/{file-explorer-CwfYBal8.js → file-explorer-BJRVDBLN.js} +1 -1
- package/dist/client/assets/{file-type-icon-aSS_wfKX.js → file-type-icon-Dj99fHuB.js} +1 -1
- package/dist/client/assets/{files-CKP66dnf.js → files-CMweUrQp.js} +1 -1
- package/dist/client/assets/{form-DIz1lXzt.js → form-BBZRauXH.js} +1 -1
- package/dist/client/assets/{general-CSQvrtS8.js → general-BmyzjAV8.js} +1 -1
- package/dist/client/assets/{generate-id-MICojNT7.js → generate-id-D_UH3sxI.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CUBnWzWO.js → github-repo-picker-CWWi7O1C.js} +1 -1
- package/dist/client/assets/{header-tab-button-BCxnrLni.js → header-tab-button-jijhwXxy.js} +1 -1
- package/dist/client/assets/{hover-card-BagBBHwl.js → hover-card-CV9VXkH7.js} +1 -1
- package/dist/client/assets/{image-field-DInBNYXf.js → image-field-Crbqbizw.js} +1 -1
- package/dist/client/assets/{index-eeLoYk5O.js → index-B-uccEBH.js} +1 -1
- package/dist/client/assets/{index-ZsTpfnpi.js → index-BQLIK8jZ.js} +1 -1
- package/dist/client/assets/{index-DLIj-Jcg.js → index-BRntdJGH.js} +1 -1
- package/dist/client/assets/{index-42kOoh0P.js → index-Bp1M4ln7.js} +1 -1
- package/dist/client/assets/{index-ChQwZqpG.js → index-C5ZyXQHr.js} +1 -1
- package/dist/client/assets/{index-C3NmhGwz.js → index-CpOkTB99.js} +1 -1
- package/dist/client/assets/{index-DfrAcw3c.js → index-DHRRSUmw.js} +1 -1
- package/dist/client/assets/{index-CN3cwfwy.js → index-DJ3cGaJ6.js} +4 -4
- package/dist/client/assets/{index-BWtmYkwi.js → index-DVzdQ0e0.js} +1 -1
- package/dist/client/assets/{index-CWjORjiD.js → index-DjxxQl8A.js} +1 -1
- package/dist/client/assets/{index-BCwnQG_j.js → index-DlJh9T8T.js} +1 -1
- package/dist/client/assets/{index-DHt9Mf9G.js → index-Dpo5EC2L.js} +3 -3
- package/dist/client/assets/{index-Csz3ibNb.js → index-Dwsjb3YT.js} +1 -1
- package/dist/client/assets/{index-Dla-fDpI.js → index-c6-XkL5H.js} +1 -1
- package/dist/client/assets/{index-redirect-BTEQzwYi.js → index-redirect-Ey8lx3Da.js} +1 -1
- package/dist/client/assets/{index-Dg2RoULU.js → index-sKMKGB16.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-C0HsJFoc.js → infiniteQueryObserver-Ykg8iLnd.js} +1 -1
- package/dist/client/assets/{input-D2dMhViX.js → input-DdFNzbfV.js} +1 -1
- package/dist/client/assets/{integration-icon-D5ZAVm0g.js → integration-icon-DZLuTxs6.js} +1 -1
- package/dist/client/assets/{label-W8QKQ71a.js → label-e4yRWBjb.js} +1 -1
- package/dist/client/assets/{layout-C3II9QQW.js → layout-D67abH6w.js} +1 -1
- package/dist/client/assets/{login-CN2Q_xpv.js → login-By3dhxoa.js} +1 -1
- package/dist/client/assets/{members-Dx-3G2q9.js → members-D2YkNBZt.js} +1 -1
- package/dist/client/assets/{monaco-editor-637MBJHf.js → monaco-editor-0uL_TQZd.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-vcZ8M2dk.js → monitoring-stats-row-GIY4z6nm.js} +1 -1
- package/dist/client/assets/{oauth-callback-MkSvb6XB.js → oauth-callback-DfXh9mNP.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BRN5UHIt.js → oauth-callback-ai-provider-D4kRRNKX.js} +1 -1
- package/dist/client/assets/{onboarding-Ci3GX3X7.js → onboarding-DQobqsv0.js} +1 -1
- package/dist/client/assets/{org-install-DvKUkehf.js → org-install-CiC9K4Ph.js} +1 -1
- package/dist/client/assets/{org-layout-CDF7rmnv.js → org-layout-jmM6ngno.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-C7dImV9m.js → org-plugin-layout-CHHdNNaK.js} +1 -1
- package/dist/client/assets/{page-seo-form-_pRbcmAC.js → page-seo-form-C-Kp4kFq.js} +1 -1
- package/dist/client/assets/page-seo-sheet-voFjiS6Q.js +1 -0
- package/dist/client/assets/{pair-BzvzVihx.js → pair-DywksGK8.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-RFNgD2Hl.js → plugin-empty-state-CyOhDphY.js} +1 -1
- package/dist/client/assets/{plugin-header-Cjy2H9Lt.js → plugin-header-hE0fGQHf.js} +1 -1
- package/dist/client/assets/{plugin-layout-CMzjQ3je.js → plugin-layout-DavzLUS9.js} +1 -1
- package/dist/client/assets/{popover-CBH5jqt8.js → popover-C68whzsY.js} +1 -1
- package/dist/client/assets/{post-editor-DgGiGnFb.js → post-editor-BPISWxsB.js} +1 -1
- package/dist/client/assets/{primitives-DIzZ8vtF.js → primitives-BqT_BizM.js} +1 -1
- package/dist/client/assets/{profile-CzlZVbcz.js → profile-BN88mKeH.js} +1 -1
- package/dist/client/assets/project-app-view-BcSwLB1G.js +1 -0
- package/dist/client/assets/record-editor-ts0XVKWT.js +1 -0
- package/dist/client/assets/registry-DNnKhVDs.js +2 -0
- package/dist/client/assets/{registry-layout-CK2u5-1Q.js → registry-layout-DnclO53f.js} +1 -1
- package/dist/client/assets/{require-capability-DvXpu1NE.js → require-capability-BSwqUQcE.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CceJrchr.js → required-auth-layout-2LAJNWxM.js} +1 -1
- package/dist/client/assets/{reset-password-MOrCv-Jk.js → reset-password-DivAvSnW.js} +1 -1
- package/dist/client/assets/{resizable-B9nPHbdY.js → resizable-0Wn5JpiT.js} +1 -1
- package/dist/client/assets/roles-C16A7h0o.js +1 -0
- package/dist/client/assets/{save-status-XRuEx_--.js → save-status-Ba2w8UKP.js} +1 -1
- package/dist/client/assets/{schema-form-CB484siM.js → schema-form-Ca7i7qHP.js} +1 -1
- package/dist/client/assets/{scroll-area-DVU-pYpl.js → scroll-area-JdApnymr.js} +1 -1
- package/dist/client/assets/{search-input-BMiEmNCi.js → search-input-BAlo7hPY.js} +1 -1
- package/dist/client/assets/{secrets-Cnbscr4a.js → secrets-QyqqDJ7A.js} +1 -1
- package/dist/client/assets/{sections-editor-CFNE6H-Z.js → sections-editor-BkVG_0Sr.js} +1 -1
- package/dist/client/assets/{select-BISzCSVs.js → select-BcoiasFF.js} +1 -1
- package/dist/client/assets/{select-model-DYDHHLGi.js → select-model-bFQD_87Y.js} +1 -1
- package/dist/client/assets/{seo-editor-0nVP1sQh.js → seo-editor-D1uGcych.js} +1 -1
- package/dist/client/assets/{settings-layout-BVrDhJki.js → settings-layout-YokPajU7.js} +1 -1
- package/dist/client/assets/{settings-section-BZG2d-sE.js → settings-section-C-qvClXS.js} +1 -1
- package/dist/client/assets/{sheet-C-msc_1A.js → sheet-BtJYdh0l.js} +1 -1
- package/dist/client/assets/{shell-controls-BvFNuvl3.js → shell-controls-D7CASrif.js} +1 -1
- package/dist/client/assets/{shell-layout-xcJQ-oXv.js → shell-layout-0P_-b-nq.js} +1 -1
- package/dist/client/assets/{shell-route-loading-BToLUOm_.js → shell-route-loading-DHB1qvk5.js} +1 -1
- package/dist/client/assets/{sidebar-C1EbFBeG.js → sidebar-DA2nzz_x.js} +1 -1
- package/dist/client/assets/{skeleton-HacfcGLU.js → skeleton-CpdmEGkq.js} +1 -1
- package/dist/client/assets/{sortable.esm-Dlj8q3TW.js → sortable.esm-X7KYMyOP.js} +1 -1
- package/dist/client/assets/{spinner-CXR5LEFP.js → spinner-D1gJYDcd.js} +1 -1
- package/dist/client/assets/{sso-DlZR7eJk.js → sso-BbX9axOk.js} +1 -1
- package/dist/client/assets/{store-C2kJGW5G.js → store-BcoC_jAQ.js} +1 -1
- package/dist/client/assets/store-registry-CVC0Fzo_.js +2 -0
- package/dist/client/assets/{switch-CWfvQ3qI.js → switch-NrMSEE-I.js} +1 -1
- package/dist/client/assets/{tab-id-CuSxDIM1.js → tab-id-Bd9aEZGd.js} +1 -1
- package/dist/client/assets/{table--UQXxBBH.js → table-HsedM5wi.js} +1 -1
- package/dist/client/assets/{tabs-33vYy1bT.js → tabs-CF-_gZ_h.js} +1 -1
- package/dist/client/assets/{task-status-DdX5GyQu.js → task-status-DwULjc9j.js} +1 -1
- package/dist/client/assets/{textarea-C-zVkKAJ.js → textarea-Dlde-1OC.js} +1 -1
- package/dist/client/assets/{toggle-group-CoUQzFHk.js → toggle-group-CaJEsTJW.js} +1 -1
- package/dist/client/assets/{toolbar-BmXelHzT.js → toolbar-1jwB3OBh.js} +1 -1
- package/dist/client/assets/{tools-list-CV_q_f0Z.js → tools-list-bR0GQjtD.js} +1 -1
- package/dist/client/assets/{tooltip-DY1LX4fr.js → tooltip-CnTONKZv.js} +1 -1
- package/dist/client/assets/{types-Dl5kxJ-o.js → types-Cy_Ngnr7.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BcOqTKKC.js → use-ai-providers-Dc4GEqMk.js} +1 -1
- package/dist/client/assets/{use-automations-BPP1PerV.js → use-automations-wbB32tlZ.js} +1 -1
- package/dist/client/assets/{use-capability-BsGHGYLW.js → use-capability-BgKTO1vN.js} +1 -1
- package/dist/client/assets/{use-collections-ZGWkQryR.js → use-collections-C6vSjty8.js} +1 -1
- package/dist/client/assets/{use-connection-BAOUEhf6.js → use-connection-DHFQC4eq.js} +1 -1
- package/dist/client/assets/{use-copy-eq8o4JlH.js → use-copy-zJQ-7Mci.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-KZ5vkVjY.js → use-create-virtual-mcp-DXgKXXwR.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CVMWB9VT.js → use-debounced-autosave-CegS5org.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BddckOeq.js → use-delete-connection-Crgi2dup.js} +1 -1
- package/dist/client/assets/{use-file-configs-BDCkFZ7E.js → use-file-configs-BGEpvSvj.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CAJkZLHC.js → use-infinite-scroll-rNa7__7x.js} +1 -1
- package/dist/client/assets/{use-list-state-ufhhKZZh.js → use-list-state-DTqrRKHV.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-BJKxU2Na.js → use-mcp-prompts-B_UVPJoG.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-ftOL48Fr.js → use-mcp-tools-DO4I7PYX.js} +1 -1
- package/dist/client/assets/{use-members-D0MeIqsF.js → use-members-WKgQqTSP.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BYyEy_zS.js → use-navigate-to-agent-k6jWIqgZ.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-YKBoNqBy.js → use-org-auth-client-DY5JwLAM.js} +1 -1
- package/dist/client/assets/{use-org-sso-Lxt3NvQV.js → use-org-sso-C5ckgDRh.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DE5F_seS.js → use-organization-roles-KNrmN_Ah.js} +1 -1
- package/dist/client/assets/{use-organization-settings-C-jLCwb5.js → use-organization-settings-pl01D-rl.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DWZHQxm0.js → use-registry-connections-Drhpxg0Z.js} +1 -1
- package/dist/client/assets/{use-secrets-BT7pvkDh.js → use-secrets-NYjq8Fmy.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DLyX7i_J.js → use-status-sounds-lg6Y6CRj.js} +1 -1
- package/dist/client/assets/{use-view-mode-ljpeZqvp.js → use-view-mode-DzNy4Hyk.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Rn9fsUNN.js → use-virtual-mcp-CJt6reVB.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BQyXdojd.js +1 -0
- package/dist/client/assets/{useRouterState-CXGDCAP4.js → useRouterState-D3ymnfxm.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DZbKMeAX.js +1 -0
- package/dist/client/assets/{user-Dh7nE-E-.js → user-Cg4afsI8.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-7zw5kq-m.js → view-mode-toggle-COafKFpZ.js} +1 -1
- package/dist/client/assets/{workflow-BAq_lzuZ.js → workflow-B4FJSGuD.js} +1 -1
- package/dist/client/assets/workflow-detail-DhzF6uRf.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +416 -416
- package/dist/server/server.js +262 -262
- package/package.json +1 -1
- package/dist/client/assets/agent-capabilities-BLrQsLZt.js +0 -3
- package/dist/client/assets/app-editor-DJDkUDig.js +0 -1
- package/dist/client/assets/chat-context-CQlAaKi3.js +0 -20
- package/dist/client/assets/connect-desktop-dialog-Dh1zqCgF.js +0 -1
- package/dist/client/assets/page-seo-sheet-CKWQNz11.js +0 -1
- package/dist/client/assets/project-app-view-CpvI7p3P.js +0 -1
- package/dist/client/assets/record-editor-CVyJ-HfI.js +0 -1
- package/dist/client/assets/registry-vLK01UDd.js +0 -2
- package/dist/client/assets/roles-C0nb3z6u.js +0 -1
- package/dist/client/assets/store-registry-DESNxNEj.js +0 -2
- package/dist/client/assets/useInfiniteQuery-CWJ6mtkH.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DDVcuWif.js +0 -1
- package/dist/client/assets/workflow-detail-DpURA77E.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as w,q as be,a as Ne,K as ke,j as t,E as we,r as $,c as de,B as Y,l as Ce,M as Ie,o as Q}from"./index-DHt9Mf9G.js";import{a as W}from"./Tool01-CBtpfChg.js";import{s as Se}from"./Trash01-DDKaJVRQ.js";import{i as fe}from"./Upload01-B5AbRmag.js";import{I as _e}from"./input-D2dMhViX.js";import{L as Pe}from"./label-W8QKQ71a.js";import{i as Ue}from"./AlertCircle-C8E06jfW.js";import{i as ge}from"./Check-DwRXhDYN.js";import{a as $e}from"./Eye-CbDINxSR.js";import{i as De}from"./DotsVertical-BZEdPJTY.js";import{F as ze}from"./agent-icon-CEtrmBbc.js";import{n as Fe}from"./LinkExternal01-D7lnMhd-.js";import{D as Te,c as Ee,e as Le,b as Oe,a as Ae}from"./dialog-m1msdckr.js";import{c as ce,a as Me,D as Re,b as Be}from"./dropdown-menu-BXhpM-R_.js";import{S as Ge}from"./skeleton-HacfcGLU.js";import{T as Ve,a as Ke,b as qe,c as Je}from"./tabs-33vYy1bT.js";import{u as Qe,c as Ye}from"./use-file-configs-BDCkFZ7E.js";import{u as We}from"./useInfiniteQuery-CWJ6mtkH.js";import{S as He,u as Xe}from"./constants-C-D4Pmy6.js";import{u as Ze}from"./unwrap-tool-result-BYXdCQMg.js";function et(s){if(typeof s=="string")return s;if(!s||typeof s!="object")return"";const e=s;if(Array.isArray(e.variants)){const n=e.variants,l=n.find(o=>o.rule?.__resolveType?.includes("always"));if(typeof l?.value=="string")return l.value;const i=n.find(o=>typeof o.value=="string");if(i)return i.value}return typeof e.src=="string"?e.src:typeof e.url=="string"?e.url:typeof e.value=="string"?e.value:""}function tt(s){const e=w.c(13),{org:n}=be();let l;e[0]!==n.id||e[1]!==n.slug?(l={connectionId:He,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=l):l=e[2];const i=Xe(l);let o;e[3]!==n.id||e[4]!==s.configId?(o=ke.filePickerObjects(n.id,s.configId),e[3]=n.id,e[4]=s.configId,e[5]=o):o=e[5];const a=s.enabled!==!1&&!!s.configId;let r;e[6]!==i||e[7]!==s.configId?(r=async c=>{const{pageParam:g}=c,f=await i.callTool({name:"FILE_OBJECTS_LIST",arguments:{configId:s.configId,cursor:g??void 0}});return Ze(f)},e[6]=i,e[7]=s.configId,e[8]=r):r=e[8];let d;return e[9]!==o||e[10]!==a||e[11]!==r?(d={queryKey:o,enabled:a,staleTime:3e4,initialPageParam:null,queryFn:r,getNextPageParam:st},e[9]=o,e[10]=a,e[11]=r,e[12]=d):d=e[12],We(d)}function st(s){return s.nextCursor??void 0}function je(){const s=w.c(2),{org:e}=be();let n;return s[0]!==e?(n={mutationFn:async l=>{const i=l.file.type||"application/octet-stream",o=await fetch(`/api/${encodeURIComponent(e.slug)}/file-configs/${encodeURIComponent(l.configId)}/upload?filename=${encodeURIComponent(l.file.name)}`,{method:"POST",headers:{"Content-Type":i},body:l.file});if(!o.ok){const a=await o.text().catch(nt);let r=`${o.status} ${o.statusText}`;try{const d=JSON.parse(a);d.message&&(r=d.message)}catch{a&&(r=a.slice(0,200))}throw new Error(`Upload failed: ${r}`)}return await o.json()}},s[0]=e,s[1]=n):n=s[1],Ne(n)}function nt(){return""}const ue="file-picker:last-config-id";function it(s){const e=w.c(18),n=s.mode==="image"?"Pick an image":"Pick a file";let l;e[0]!==n?(l=t.jsx(Ee,{children:n}),e[0]=n,e[1]=l):l=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Le,{children:"Upload a new file or pick one previously uploaded to a configured bucket."}),e[2]=i):i=e[2];let o;e[3]!==l?(o=t.jsxs(Oe,{children:[l,i]}),e[3]=l,e[4]=o):o=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Ge,{className:"h-64 w-full"}),e[5]=a):a=e[5];let r;e[6]!==s?(r=f=>{s.onSelect(f),s.onOpenChange(!1)},e[6]=s,e[7]=r):r=e[7];let d;e[8]!==s.mode||e[9]!==r?(d=t.jsx(we,{fallback:lt,children:t.jsx($.Suspense,{fallback:a,children:t.jsx(ot,{mode:s.mode,onSelect:r})})}),e[8]=s.mode,e[9]=r,e[10]=d):d=e[10];let c;e[11]!==o||e[12]!==d?(c=t.jsxs(Ae,{className:"sm:max-w-3xl max-h-[85vh] overflow-hidden flex flex-col",children:[o,d]}),e[11]=o,e[12]=d,e[13]=c):c=e[13];let g;return e[14]!==s.onOpenChange||e[15]!==s.open||e[16]!==c?(g=t.jsx(Te,{open:s.open,onOpenChange:s.onOpenChange,children:c}),e[14]=s.onOpenChange,e[15]=s.open,e[16]=c,e[17]=g):g=e[17],g}function lt(s){const{error:e}=s;return t.jsx(rt,{error:e??new Error("Failed to load buckets")})}function rt(s){const e=w.c(3),{error:n}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Ue,{size:16}),e[0]=l):l=e[0];let i;return e[1]!==n.message?(i=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,t.jsx("span",{className:"text-sm font-medium",children:n.message})]}),e[1]=n.message,e[2]=i):i=e[2],i}function ot(s){const e=w.c(23),{mode:n,onSelect:l}=s,i=Qe();if(i.length===0){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(dt,{}),e[0]=u):u=e[0],u}if(i.length===1){const u=i[0];let p;return e[1]!==u||e[2]!==n||e[3]!==l?(p=t.jsx(pe,{config:u,mode:n,onSelect:l}),e[1]=u,e[2]=n,e[3]=l,e[4]=p):p=e[4],p}let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=typeof window<"u"?window.localStorage.getItem(ue):null,e[5]=o):o=e[5];const a=o;let r;e[6]!==i?(r=i.find(u=>u.id===a)?.id??i[0].id,e[6]=i,e[7]=r):r=e[7];const d=r;let c;e[8]!==i?(c=i.map(at),e[8]=i,e[9]=c):c=e[9];let g;e[10]!==c?(g=t.jsx(Ke,{className:"self-start",children:c}),e[10]=c,e[11]=g):g=e[11];let f;if(e[12]!==i||e[13]!==n||e[14]!==l){let u;e[16]!==n||e[17]!==l?(u=p=>t.jsx(qe,{value:p.id,className:"min-h-0 flex-1 overflow-hidden",children:t.jsx(pe,{config:p,mode:n,onSelect:l})},p.id),e[16]=n,e[17]=l,e[18]=u):u=e[18],f=i.map(u),e[12]=i,e[13]=n,e[14]=l,e[15]=f}else f=e[15];let x;return e[19]!==d||e[20]!==g||e[21]!==f?(x=t.jsxs(Je,{defaultValue:d,onValueChange:ct,className:"min-h-0 flex-1 flex flex-col",children:[g,f]}),e[19]=d,e[20]=g,e[21]=f,e[22]=x):x=e[22],x}function at(s){return t.jsx(Ve,{value:s.id,children:s.name},s.id)}function ct(s){typeof window<"u"&&window.localStorage.setItem(ue,s)}function dt(){const s=w.c(3);let e,n;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(fe,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No bucket configured"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Add an S3-compatible bucket in Settings before you can upload files."})]}),s[0]=e,s[1]=n):(e=s[0],n=s[1]);let l;return s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{className:"rounded-xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[e,n,t.jsx(Y,{asChild:!0,size:"sm",className:"mt-2",children:t.jsx(Ie,{to:"/settings/files",children:"Configure a bucket"})})]}),s[2]=l):l=s[2],l}function pe({config:s,mode:e,onSelect:n}){const l=tt({configId:s.id}),i=je(),[o,a]=$.useState(!1),r=$.useRef(null),d=e==="image"?"image/*":void 0;async function c(m){if(!m)return;const y=Array.from(m);if(y.length===0)return;let k=null;const b=[];for(const N of y)try{const h=await i.mutateAsync({configId:s.id,file:N});k??=h.publicUrl}catch(h){b.push(`${N.name} (${h instanceof Error?h.message:"upload failed"})`)}await l.refetch(),b.length>0&&Q.error(b.length===y.length?`Upload failed: ${b.join("; ")}`:`Some files failed: ${b.join("; ")}`),k&&n(k)}function g(m){m.preventDefault(),a(!0)}function f(){a(!1)}function x(m){m.preventDefault(),a(!1),c(m.dataTransfer.files)}const p=(l.data?.pages??[]).flatMap(m=>m.items),j=p.filter(m=>e==="image"?ye(m.key):!0);return t.jsxs("div",{className:"flex flex-col gap-3 min-h-0 h-full",children:[t.jsxs("button",{type:"button",onClick:()=>r.current?.click(),onDragOver:g,onDragLeave:f,onDrop:x,className:de("rounded-xl border border-dashed border-border/60 p-6 flex flex-col items-center justify-center gap-2 text-center transition-colors",o&&"border-primary bg-primary/5",i.isPending&&"opacity-60 pointer-events-none"),children:[t.jsx(fe,{size:18,className:"text-muted-foreground"}),t.jsx("p",{className:"text-sm font-medium",children:i.isPending?"Uploading…":"Drop files here or click to upload"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Up to 100 MB."," ",e==="image"?"Images only (PNG, JPEG, WebP, GIF, SVG, AVIF).":"Common image, video, audio, and document types."]}),t.jsx("input",{ref:r,type:"file",accept:d,multiple:!0,className:"hidden",onChange:m=>{const y=m.target.files;m.target.value="",c(y)}})]}),l.isFetching&&!l.isFetchingNextPage?t.jsx("div",{className:"flex justify-end",children:t.jsx("span",{className:"text-xs text-muted-foreground",children:"Loading…"})}):null,t.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:[j.length===0?e==="image"&&p.length>0?t.jsx(ut,{}):t.jsx(ft,{}):e==="image"?t.jsx(gt,{items:j,onSelect:n}):t.jsx(pt,{items:j,onSelect:n}),l.hasNextPage&&t.jsx("div",{className:"flex justify-center py-4",children:t.jsx(Y,{type:"button",variant:"outline",size:"sm",disabled:l.isFetchingNextPage,onClick:()=>l.fetchNextPage(),children:l.isFetchingNextPage?t.jsxs(t.Fragment,{children:[t.jsx(Ce,{size:14,className:"animate-spin"}),"Loading…"]}):"Load more"})})]})]})}function ft(){const s=w.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex h-full min-h-40 flex-col items-center justify-center gap-2 py-8 text-center",children:[t.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-muted",children:t.jsx(W,{size:18,className:"text-muted-foreground"})}),t.jsx("p",{className:"text-sm font-medium",children:"No files in this bucket yet"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Drop a file above to get started."})]}),s[0]=e):e=s[0],e}function ut(){const s=w.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex h-full min-h-40 flex-col items-center justify-center gap-2 py-8 text-center",children:[t.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-muted",children:t.jsx(W,{size:18,className:"text-muted-foreground"})}),t.jsx("p",{className:"text-sm font-medium",children:"No images in this bucket yet"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"The bucket has other files, but none match common image formats."})]}),s[0]=e):e=s[0],e}function ye(s){return/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i.test(s)}function mt(s){const e=s.lastIndexOf(".");return e<0||e===s.length-1?"file":s.slice(e+1).toLowerCase()}function gt(s){const e=w.c(7),{items:n,onSelect:l}=s;let i;if(e[0]!==n||e[1]!==l){let a;e[3]!==l?(a=r=>t.jsx(ve,{item:r,variant:"image",onSelect:l},r.key),e[3]=l,e[4]=a):a=e[4],i=n.map(a),e[0]=n,e[1]=l,e[2]=i}else i=e[2];let o;return e[5]!==i?(o=t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:i}),e[5]=i,e[6]=o):o=e[6],o}function pt(s){const e=w.c(7),{items:n,onSelect:l}=s;let i;if(e[0]!==n||e[1]!==l){let a;e[3]!==l?(a=r=>t.jsx("li",{children:t.jsx(ve,{item:r,variant:"row",onSelect:l})},r.key),e[3]=l,e[4]=a):a=e[4],i=n.map(a),e[0]=n,e[1]=l,e[2]=i}else i=e[2];let o;return e[5]!==i?(o=t.jsx("ul",{className:"divide-y divide-border/60 rounded-lg border border-border/60",children:i}),e[5]=i,e[6]=o):o=e[6],o}function ve(s){const e=w.c(58),{item:n,variant:l,onSelect:i}=s;let o;e[0]!==n.key?(o=mt(n.key),e[0]=n.key,e[1]=o):o=e[1];const a=o;if(l==="image"){let b;e[2]!==n.publicUrl||e[3]!==i?(b=()=>i(n.publicUrl),e[2]=n.publicUrl,e[3]=i,e[4]=b):b=e[4];let N;e[5]!==n.key||e[6]!==n.publicUrl?(N=t.jsx("img",{src:n.publicUrl,alt:n.key,loading:"lazy",className:"h-full w-full object-cover",onError:xt}),e[5]=n.key,e[6]=n.publicUrl,e[7]=N):N=e[7];let h;e[8]!==n.key||e[9]!==b||e[10]!==N?(h=t.jsx("button",{type:"button",onClick:b,className:"block h-full w-full transition hover:ring-2 hover:ring-primary",title:n.key,children:N}),e[8]=n.key,e[9]=b,e[10]=N,e[11]=h):h=e[11];let C;e[12]!==a?(C=t.jsx("span",{className:"pointer-events-none absolute left-1.5 top-1.5 rounded bg-background/80 px-1.5 py-0.5 text-[10px] font-medium uppercase text-foreground opacity-0 backdrop-blur-sm transition-opacity group-hover:opacity-100",children:a}),e[12]=a,e[13]=C):C=e[13];let S;e[14]!==n||e[15]!==i?(S=t.jsx("div",{className:"absolute right-1.5 top-1.5 opacity-0 transition-opacity group-hover:opacity-100",children:t.jsx(xe,{item:n,onSelect:i})}),e[14]=n,e[15]=i,e[16]=S):S=e[16];let I;e[17]!==n.key?(I=he(n.key),e[17]=n.key,e[18]=I):I=e[18];let _;e[19]!==I?(_=t.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/70 to-transparent p-2 opacity-0 transition-opacity group-hover:opacity-100",children:t.jsx("p",{className:"truncate text-xs text-white",children:I})}),e[19]=I,e[20]=_):_=e[20];let P;return e[21]!==h||e[22]!==C||e[23]!==S||e[24]!==_?(P=t.jsxs("div",{className:"group relative aspect-square overflow-hidden rounded-lg border border-border/60 bg-muted",children:[h,C,S,_]}),e[21]=h,e[22]=C,e[23]=S,e[24]=_,e[25]=P):P=e[25],P}let r;e[26]!==n.publicUrl||e[27]!==i?(r=()=>i(n.publicUrl),e[26]=n.publicUrl,e[27]=i,e[28]=r):r=e[28];let d;e[29]!==n.key?(d=t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-md bg-muted",children:ye(n.key)?t.jsx(W,{size:16,className:"text-muted-foreground"}):t.jsx(ze,{size:16,className:"text-muted-foreground"})}),e[29]=n.key,e[30]=d):d=e[30];let c;e[31]!==n.key?(c=he(n.key),e[31]=n.key,e[32]=c):c=e[32];let g;e[33]!==c?(g=t.jsx("p",{className:"truncate text-sm font-medium",children:c}),e[33]=c,e[34]=g):g=e[34];let f;e[35]!==n.key?(f=t.jsx("p",{className:"truncate font-mono text-xs text-muted-foreground",children:n.key}),e[35]=n.key,e[36]=f):f=e[36];let x;e[37]!==g||e[38]!==f?(x=t.jsxs("div",{className:"min-w-0 flex-1",children:[g,f]}),e[37]=g,e[38]=f,e[39]=x):x=e[39];let u;e[40]!==a?(u=t.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground",children:a}),e[40]=a,e[41]=u):u=e[41];let p;e[42]!==n.size?(p=yt(n.size),e[42]=n.size,e[43]=p):p=e[43];let j;e[44]!==p?(j=t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:p}),e[44]=p,e[45]=j):j=e[45];let m;e[46]!==j||e[47]!==r||e[48]!==d||e[49]!==x||e[50]!==u?(m=t.jsxs("button",{type:"button",onClick:r,className:"flex min-w-0 flex-1 items-center gap-3 text-left",children:[d,x,u,j]}),e[46]=j,e[47]=r,e[48]=d,e[49]=x,e[50]=u,e[51]=m):m=e[51];let y;e[52]!==n||e[53]!==i?(y=t.jsx(xe,{item:n,onSelect:i}),e[52]=n,e[53]=i,e[54]=y):y=e[54];let k;return e[55]!==m||e[56]!==y?(k=t.jsxs("div",{className:"group flex items-center gap-3 px-3 py-2 transition hover:bg-muted/50",children:[m,y]}),e[55]=m,e[56]=y,e[57]=k):k=e[57],k}function xt(s){s.target.style.display="none"}function xe(s){const e=w.c(22),{item:n,onSelect:l}=s,[i,o]=$.useState(!1);let a;e[0]!==n.publicUrl?(a=async function(b){b.preventDefault(),b.stopPropagation();try{await navigator.clipboard.writeText(n.publicUrl),o(!0),window.setTimeout(()=>o(!1),1500)}catch{Q.error("Failed to copy URL")}},e[0]=n.publicUrl,e[1]=a):a=e[1];const r=a;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Me,{asChild:!0,children:t.jsx(Y,{type:"button",variant:"ghost",size:"icon",className:"size-7 rounded-md bg-background/80 backdrop-blur-sm",onClick:jt,"aria-label":"Asset actions",children:t.jsx(De,{size:14})})}),e[2]=d):d=e[2];let c;e[3]!==n.publicUrl||e[4]!==l?(c=()=>l(n.publicUrl),e[3]=n.publicUrl,e[4]=l,e[5]=c):c=e[5];let g;e[6]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(ge,{size:14}),e[6]=g):g=e[6];let f;e[7]!==c?(f=t.jsxs(ce,{onClick:c,children:[g,"Use this"]}),e[7]=c,e[8]=f):f=e[8];let x;e[9]!==i?(x=i?t.jsx(ge,{size:14}):t.jsx($e,{size:14}),e[9]=i,e[10]=x):x=e[10];const u=i?"Copied":"Copy URL";let p;e[11]!==r||e[12]!==x||e[13]!==u?(p=t.jsxs(ce,{onClick:r,children:[x,u]}),e[11]=r,e[12]=x,e[13]=u,e[14]=p):p=e[14];let j;e[15]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(Fe,{size:14}),e[15]=j):j=e[15];let m;e[16]!==n.publicUrl?(m=t.jsx(ce,{asChild:!0,children:t.jsxs("a",{href:n.publicUrl,target:"_blank",rel:"noreferrer",onClick:ht,children:[j,"Open in new tab"]})}),e[16]=n.publicUrl,e[17]=m):m=e[17];let y;return e[18]!==m||e[19]!==f||e[20]!==p?(y=t.jsxs(Re,{children:[d,t.jsxs(Be,{align:"end",onClick:bt,children:[f,p,m]})]}),e[18]=m,e[19]=f,e[20]=p,e[21]=y):y=e[21],y}function ht(s){return s.stopPropagation()}function bt(s){return s.stopPropagation()}function jt(s){return s.stopPropagation()}function he(s){const e=s.split("/");return e[e.length-1]??s}function yt(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`}function vt(s){try{const e=new URL(s).pathname;return decodeURIComponent(e.split("/").pop()??s)}catch{return s.split("/").pop()??s}}function Nt(s){const e=s.lastIndexOf(".");return e<0||e===s.length-1?"":s.slice(e+1).toLowerCase()}const kt=new Set(["image/png","image/jpeg","image/gif","image/webp","image/svg+xml","image/avif"]);function Kt(s){const e=w.c(79),{schema:n,value:l,onChange:i,path:o,label:a}=s,r=et(l),[d,c]=$.useState(!1),[g,f]=$.useState(!1),[x,u]=$.useState(!1),[p,j]=$.useState(!1),m=r?vt(r):"",y=m?Nt(m):"",k=Ye(),b=je();let N;e[0]!==i||e[1]!==j||e[2]!==u?(N=function(v){u(!1),j(!1),i(v)},e[0]=i,e[1]=j,e[2]=u,e[3]=N):N=e[3];const h=N;let C;e[4]!==k.data?.configs?(C=function(){const v=k.data?.configs??[];if(v.length===1)return v[0].id;if(v.length===0)return null;const D=typeof window<"u"?window.localStorage.getItem(ue):null;return v.some(te=>te.id===D)?D:null},e[4]=k.data?.configs,e[5]=C):C=e[5];const S=C;let I;e[6]!==S||e[7]!==c||e[8]!==h||e[9]!==b?(I=async function(v){if(!v)return;const D=Array.from(v).filter(wt);if(D.length===0){Q.error("Only image files are accepted here.");return}const te=S();if(!te){c(!0);return}try{const ae=await b.mutateAsync({configId:te,file:D[0]});h(ae.publicUrl),D.length>1&&Q.info(`Uploaded ${D[0].name}; extra files were ignored (single-select field).`)}catch(ae){const me=ae;Q.error(me instanceof Error?me.message:"Upload failed")}},e[6]=S,e[7]=c,e[8]=h,e[9]=b,e[10]=I):I=e[10];const _=I;let P;e[11]!==f?(P=function(v){v.preventDefault(),v.dataTransfer.types.includes("Files")&&f(!0)},e[11]=f,e[12]=P):P=e[12];const se=P;let H;e[13]!==f?(H=function(v){v.currentTarget===v.target&&f(!1)},e[13]=f,e[14]=H):H=e[14];const ne=H;let X;e[15]!==_||e[16]!==f?(X=function(v){v.preventDefault(),f(!1),_(v.dataTransfer.files)},e[15]=_,e[16]=f,e[17]=X):X=e[17];const ie=X;let z;e[18]!==a||e[19]!==o?(z=t.jsx(Pe,{htmlFor:o,className:"text-muted-foreground",children:a}),e[18]=a,e[19]=o,e[20]=z):z=e[20];let F;e[21]!==n.description?(F=n.description&&t.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:n.description}),e[21]=n.description,e[22]=F):F=e[22];let T;e[23]!==z||e[24]!==F?(T=t.jsxs("div",{className:"min-w-0 space-y-0.5",children:[z,F]}),e[23]=z,e[24]=F,e[25]=T):T=e[25];const le=g&&"border-primary ring-2 ring-primary/30",re=b.isPending&&"pointer-events-none opacity-60";let E;e[26]!==le||e[27]!==re?(E=de("group relative w-full overflow-hidden rounded-xl border border-border/60 bg-muted/30 transition",le,re),e[26]=le,e[27]=re,e[28]=E):E=e[28];let L;e[29]!==y||e[30]!==m||e[31]!==p||e[32]!==x||e[33]!==a||e[34]!==j||e[35]!==u||e[36]!==c||e[37]!==r||e[38]!==b.isPending?(L=r?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"relative h-40 w-full bg-[image:linear-gradient(45deg,rgba(0,0,0,0.04)_25%,transparent_25%,transparent_75%,rgba(0,0,0,0.04)_75%),linear-gradient(45deg,rgba(0,0,0,0.04)_25%,transparent_25%,transparent_75%,rgba(0,0,0,0.04)_75%)] bg-[position:0_0,8px_8px] [background-size:16px_16px]",children:[!p&&t.jsx("img",{src:r,alt:a,className:de("h-full w-full object-contain transition-opacity",!x&&"opacity-0"),onLoad:()=>u(!0),onError:()=>j(!0)},r),p&&t.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-1 text-muted-foreground",children:[t.jsx(W,{size:20}),t.jsx("p",{className:"text-xs",children:"Preview unavailable"})]}),!x&&!p&&t.jsx("div",{className:"absolute inset-0 animate-pulse bg-muted/60"})]}),t.jsxs("div",{className:"flex items-center gap-2 border-t border-border/60 bg-background/50 px-3 py-2",children:[t.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium",children:m}),y&&t.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground",children:y})]})]}):t.jsxs("button",{type:"button",onClick:()=>c(!0),className:"flex h-40 w-full flex-col items-center justify-center gap-2 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[t.jsx(W,{size:20}),t.jsx("span",{className:"text-sm font-medium",children:b.isPending?"Uploading…":"Drop an image or click to browse"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"PNG, JPEG, WebP, GIF, SVG, AVIF — up to 100 MB"})]}),e[29]=y,e[30]=m,e[31]=p,e[32]=x,e[33]=a,e[34]=j,e[35]=u,e[36]=c,e[37]=r,e[38]=b.isPending,e[39]=L):L=e[39];let O;e[40]!==g?(O=g&&t.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-primary/10 backdrop-blur-[1px]",children:t.jsx("span",{className:"rounded-md bg-background px-3 py-1.5 text-xs font-medium shadow",children:"Drop to upload"})}),e[40]=g,e[41]=O):O=e[41];let A;e[42]!==ne||e[43]!==se||e[44]!==ie||e[45]!==E||e[46]!==L||e[47]!==O?(A=t.jsxs("div",{onDragOver:se,onDragLeave:ne,onDrop:ie,className:E,children:[L,O]}),e[42]=ne,e[43]=se,e[44]=ie,e[45]=E,e[46]=L,e[47]=O,e[48]=A):A=e[48];let M;e[49]!==h?(M=U=>h(U.target.value),e[49]=h,e[50]=M):M=e[50];let R;e[51]!==o||e[52]!==r||e[53]!==M?(R=t.jsx(_e,{id:o,type:"url",value:r,onChange:M,placeholder:"https://...",className:"h-9 min-w-0 flex-1"}),e[51]=o,e[52]=r,e[53]=M,e[54]=R):R=e[54];let B;e[55]!==c?(B=()=>c(!0),e[55]=c,e[56]=B):B=e[56];let Z;e[57]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx(fe,{size:14}),e[57]=Z):Z=e[57];const oe=r?"Replace":"Browse";let G;e[58]!==B||e[59]!==oe?(G=t.jsxs(Y,{type:"button",variant:"outline",size:"sm",onClick:B,className:"h-9 shrink-0",children:[Z,oe]}),e[58]=B,e[59]=oe,e[60]=G):G=e[60];let V;e[61]!==h||e[62]!==r?(V=r&&t.jsx(Y,{type:"button",variant:"ghost",size:"sm",onClick:()=>h(""),className:"h-9 shrink-0","aria-label":"Remove image",children:t.jsx(Se,{size:14})}),e[61]=h,e[62]=r,e[63]=V):V=e[63];let K;e[64]!==R||e[65]!==G||e[66]!==V?(K=t.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[R,G,V]}),e[64]=R,e[65]=G,e[66]=V,e[67]=K):K=e[67];let q;e[68]!==h?(q=U=>h(U),e[68]=h,e[69]=q):q=e[69];let J;e[70]!==d||e[71]!==c||e[72]!==q?(J=t.jsx(it,{open:d,onOpenChange:c,mode:"image",onSelect:q}),e[70]=d,e[71]=c,e[72]=q,e[73]=J):J=e[73];let ee;return e[74]!==A||e[75]!==K||e[76]!==J||e[77]!==T?(ee=t.jsxs("div",{className:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] gap-2",children:[T,A,K,J]}),e[74]=A,e[75]=K,e[76]=J,e[77]=T,e[78]=ee):ee=e[78],ee}function wt(s){return kt.has(s.type||"")}export{it as F,Kt as I,ue as L,et as e,je as u};
|
|
1
|
+
import{e as w,q as be,a as Ne,K as ke,j as t,E as we,r as $,c as de,B as Y,l as Ce,M as Ie,o as Q}from"./index-Dpo5EC2L.js";import{a as W}from"./Tool01-Blh-dWzw.js";import{s as Se}from"./Trash01-BtO3xPfa.js";import{i as fe}from"./Upload01-DuGEhzNC.js";import{I as _e}from"./input-DdFNzbfV.js";import{L as Pe}from"./label-e4yRWBjb.js";import{i as Ue}from"./AlertCircle-CQVrG_vJ.js";import{i as ge}from"./Check-_9fGuqcU.js";import{a as $e}from"./Eye-MExi_r3W.js";import{i as De}from"./DotsVertical-UEiFsiMu.js";import{F as ze}from"./agent-icon-DqIYS1ir.js";import{n as Fe}from"./LinkExternal01-Bh2jIX62.js";import{D as Te,c as Ee,e as Le,b as Oe,a as Ae}from"./dialog-BTuyAnJD.js";import{c as ce,a as Me,D as Re,b as Be}from"./dropdown-menu-Ci4-mVLy.js";import{S as Ge}from"./skeleton-CpdmEGkq.js";import{T as Ve,a as Ke,b as qe,c as Je}from"./tabs-CF-_gZ_h.js";import{u as Qe,c as Ye}from"./use-file-configs-BGEpvSvj.js";import{u as We}from"./useInfiniteQuery-BQyXdojd.js";import{S as He,u as Xe}from"./constants-DcPOVd9N.js";import{u as Ze}from"./unwrap-tool-result-BYXdCQMg.js";function et(s){if(typeof s=="string")return s;if(!s||typeof s!="object")return"";const e=s;if(Array.isArray(e.variants)){const n=e.variants,l=n.find(o=>o.rule?.__resolveType?.includes("always"));if(typeof l?.value=="string")return l.value;const i=n.find(o=>typeof o.value=="string");if(i)return i.value}return typeof e.src=="string"?e.src:typeof e.url=="string"?e.url:typeof e.value=="string"?e.value:""}function tt(s){const e=w.c(13),{org:n}=be();let l;e[0]!==n.id||e[1]!==n.slug?(l={connectionId:He,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=l):l=e[2];const i=Xe(l);let o;e[3]!==n.id||e[4]!==s.configId?(o=ke.filePickerObjects(n.id,s.configId),e[3]=n.id,e[4]=s.configId,e[5]=o):o=e[5];const a=s.enabled!==!1&&!!s.configId;let r;e[6]!==i||e[7]!==s.configId?(r=async c=>{const{pageParam:g}=c,f=await i.callTool({name:"FILE_OBJECTS_LIST",arguments:{configId:s.configId,cursor:g??void 0}});return Ze(f)},e[6]=i,e[7]=s.configId,e[8]=r):r=e[8];let d;return e[9]!==o||e[10]!==a||e[11]!==r?(d={queryKey:o,enabled:a,staleTime:3e4,initialPageParam:null,queryFn:r,getNextPageParam:st},e[9]=o,e[10]=a,e[11]=r,e[12]=d):d=e[12],We(d)}function st(s){return s.nextCursor??void 0}function je(){const s=w.c(2),{org:e}=be();let n;return s[0]!==e?(n={mutationFn:async l=>{const i=l.file.type||"application/octet-stream",o=await fetch(`/api/${encodeURIComponent(e.slug)}/file-configs/${encodeURIComponent(l.configId)}/upload?filename=${encodeURIComponent(l.file.name)}`,{method:"POST",headers:{"Content-Type":i},body:l.file});if(!o.ok){const a=await o.text().catch(nt);let r=`${o.status} ${o.statusText}`;try{const d=JSON.parse(a);d.message&&(r=d.message)}catch{a&&(r=a.slice(0,200))}throw new Error(`Upload failed: ${r}`)}return await o.json()}},s[0]=e,s[1]=n):n=s[1],Ne(n)}function nt(){return""}const ue="file-picker:last-config-id";function it(s){const e=w.c(18),n=s.mode==="image"?"Pick an image":"Pick a file";let l;e[0]!==n?(l=t.jsx(Ee,{children:n}),e[0]=n,e[1]=l):l=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Le,{children:"Upload a new file or pick one previously uploaded to a configured bucket."}),e[2]=i):i=e[2];let o;e[3]!==l?(o=t.jsxs(Oe,{children:[l,i]}),e[3]=l,e[4]=o):o=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Ge,{className:"h-64 w-full"}),e[5]=a):a=e[5];let r;e[6]!==s?(r=f=>{s.onSelect(f),s.onOpenChange(!1)},e[6]=s,e[7]=r):r=e[7];let d;e[8]!==s.mode||e[9]!==r?(d=t.jsx(we,{fallback:lt,children:t.jsx($.Suspense,{fallback:a,children:t.jsx(ot,{mode:s.mode,onSelect:r})})}),e[8]=s.mode,e[9]=r,e[10]=d):d=e[10];let c;e[11]!==o||e[12]!==d?(c=t.jsxs(Ae,{className:"sm:max-w-3xl max-h-[85vh] overflow-hidden flex flex-col",children:[o,d]}),e[11]=o,e[12]=d,e[13]=c):c=e[13];let g;return e[14]!==s.onOpenChange||e[15]!==s.open||e[16]!==c?(g=t.jsx(Te,{open:s.open,onOpenChange:s.onOpenChange,children:c}),e[14]=s.onOpenChange,e[15]=s.open,e[16]=c,e[17]=g):g=e[17],g}function lt(s){const{error:e}=s;return t.jsx(rt,{error:e??new Error("Failed to load buckets")})}function rt(s){const e=w.c(3),{error:n}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Ue,{size:16}),e[0]=l):l=e[0];let i;return e[1]!==n.message?(i=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,t.jsx("span",{className:"text-sm font-medium",children:n.message})]}),e[1]=n.message,e[2]=i):i=e[2],i}function ot(s){const e=w.c(23),{mode:n,onSelect:l}=s,i=Qe();if(i.length===0){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(dt,{}),e[0]=u):u=e[0],u}if(i.length===1){const u=i[0];let p;return e[1]!==u||e[2]!==n||e[3]!==l?(p=t.jsx(pe,{config:u,mode:n,onSelect:l}),e[1]=u,e[2]=n,e[3]=l,e[4]=p):p=e[4],p}let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=typeof window<"u"?window.localStorage.getItem(ue):null,e[5]=o):o=e[5];const a=o;let r;e[6]!==i?(r=i.find(u=>u.id===a)?.id??i[0].id,e[6]=i,e[7]=r):r=e[7];const d=r;let c;e[8]!==i?(c=i.map(at),e[8]=i,e[9]=c):c=e[9];let g;e[10]!==c?(g=t.jsx(Ke,{className:"self-start",children:c}),e[10]=c,e[11]=g):g=e[11];let f;if(e[12]!==i||e[13]!==n||e[14]!==l){let u;e[16]!==n||e[17]!==l?(u=p=>t.jsx(qe,{value:p.id,className:"min-h-0 flex-1 overflow-hidden",children:t.jsx(pe,{config:p,mode:n,onSelect:l})},p.id),e[16]=n,e[17]=l,e[18]=u):u=e[18],f=i.map(u),e[12]=i,e[13]=n,e[14]=l,e[15]=f}else f=e[15];let x;return e[19]!==d||e[20]!==g||e[21]!==f?(x=t.jsxs(Je,{defaultValue:d,onValueChange:ct,className:"min-h-0 flex-1 flex flex-col",children:[g,f]}),e[19]=d,e[20]=g,e[21]=f,e[22]=x):x=e[22],x}function at(s){return t.jsx(Ve,{value:s.id,children:s.name},s.id)}function ct(s){typeof window<"u"&&window.localStorage.setItem(ue,s)}function dt(){const s=w.c(3);let e,n;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(fe,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No bucket configured"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Add an S3-compatible bucket in Settings before you can upload files."})]}),s[0]=e,s[1]=n):(e=s[0],n=s[1]);let l;return s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{className:"rounded-xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[e,n,t.jsx(Y,{asChild:!0,size:"sm",className:"mt-2",children:t.jsx(Ie,{to:"/settings/files",children:"Configure a bucket"})})]}),s[2]=l):l=s[2],l}function pe({config:s,mode:e,onSelect:n}){const l=tt({configId:s.id}),i=je(),[o,a]=$.useState(!1),r=$.useRef(null),d=e==="image"?"image/*":void 0;async function c(m){if(!m)return;const y=Array.from(m);if(y.length===0)return;let k=null;const b=[];for(const N of y)try{const h=await i.mutateAsync({configId:s.id,file:N});k??=h.publicUrl}catch(h){b.push(`${N.name} (${h instanceof Error?h.message:"upload failed"})`)}await l.refetch(),b.length>0&&Q.error(b.length===y.length?`Upload failed: ${b.join("; ")}`:`Some files failed: ${b.join("; ")}`),k&&n(k)}function g(m){m.preventDefault(),a(!0)}function f(){a(!1)}function x(m){m.preventDefault(),a(!1),c(m.dataTransfer.files)}const p=(l.data?.pages??[]).flatMap(m=>m.items),j=p.filter(m=>e==="image"?ye(m.key):!0);return t.jsxs("div",{className:"flex flex-col gap-3 min-h-0 h-full",children:[t.jsxs("button",{type:"button",onClick:()=>r.current?.click(),onDragOver:g,onDragLeave:f,onDrop:x,className:de("rounded-xl border border-dashed border-border/60 p-6 flex flex-col items-center justify-center gap-2 text-center transition-colors",o&&"border-primary bg-primary/5",i.isPending&&"opacity-60 pointer-events-none"),children:[t.jsx(fe,{size:18,className:"text-muted-foreground"}),t.jsx("p",{className:"text-sm font-medium",children:i.isPending?"Uploading…":"Drop files here or click to upload"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Up to 100 MB."," ",e==="image"?"Images only (PNG, JPEG, WebP, GIF, SVG, AVIF).":"Common image, video, audio, and document types."]}),t.jsx("input",{ref:r,type:"file",accept:d,multiple:!0,className:"hidden",onChange:m=>{const y=m.target.files;m.target.value="",c(y)}})]}),l.isFetching&&!l.isFetchingNextPage?t.jsx("div",{className:"flex justify-end",children:t.jsx("span",{className:"text-xs text-muted-foreground",children:"Loading…"})}):null,t.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:[j.length===0?e==="image"&&p.length>0?t.jsx(ut,{}):t.jsx(ft,{}):e==="image"?t.jsx(gt,{items:j,onSelect:n}):t.jsx(pt,{items:j,onSelect:n}),l.hasNextPage&&t.jsx("div",{className:"flex justify-center py-4",children:t.jsx(Y,{type:"button",variant:"outline",size:"sm",disabled:l.isFetchingNextPage,onClick:()=>l.fetchNextPage(),children:l.isFetchingNextPage?t.jsxs(t.Fragment,{children:[t.jsx(Ce,{size:14,className:"animate-spin"}),"Loading…"]}):"Load more"})})]})]})}function ft(){const s=w.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex h-full min-h-40 flex-col items-center justify-center gap-2 py-8 text-center",children:[t.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-muted",children:t.jsx(W,{size:18,className:"text-muted-foreground"})}),t.jsx("p",{className:"text-sm font-medium",children:"No files in this bucket yet"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Drop a file above to get started."})]}),s[0]=e):e=s[0],e}function ut(){const s=w.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex h-full min-h-40 flex-col items-center justify-center gap-2 py-8 text-center",children:[t.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-muted",children:t.jsx(W,{size:18,className:"text-muted-foreground"})}),t.jsx("p",{className:"text-sm font-medium",children:"No images in this bucket yet"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"The bucket has other files, but none match common image formats."})]}),s[0]=e):e=s[0],e}function ye(s){return/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i.test(s)}function mt(s){const e=s.lastIndexOf(".");return e<0||e===s.length-1?"file":s.slice(e+1).toLowerCase()}function gt(s){const e=w.c(7),{items:n,onSelect:l}=s;let i;if(e[0]!==n||e[1]!==l){let a;e[3]!==l?(a=r=>t.jsx(ve,{item:r,variant:"image",onSelect:l},r.key),e[3]=l,e[4]=a):a=e[4],i=n.map(a),e[0]=n,e[1]=l,e[2]=i}else i=e[2];let o;return e[5]!==i?(o=t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:i}),e[5]=i,e[6]=o):o=e[6],o}function pt(s){const e=w.c(7),{items:n,onSelect:l}=s;let i;if(e[0]!==n||e[1]!==l){let a;e[3]!==l?(a=r=>t.jsx("li",{children:t.jsx(ve,{item:r,variant:"row",onSelect:l})},r.key),e[3]=l,e[4]=a):a=e[4],i=n.map(a),e[0]=n,e[1]=l,e[2]=i}else i=e[2];let o;return e[5]!==i?(o=t.jsx("ul",{className:"divide-y divide-border/60 rounded-lg border border-border/60",children:i}),e[5]=i,e[6]=o):o=e[6],o}function ve(s){const e=w.c(58),{item:n,variant:l,onSelect:i}=s;let o;e[0]!==n.key?(o=mt(n.key),e[0]=n.key,e[1]=o):o=e[1];const a=o;if(l==="image"){let b;e[2]!==n.publicUrl||e[3]!==i?(b=()=>i(n.publicUrl),e[2]=n.publicUrl,e[3]=i,e[4]=b):b=e[4];let N;e[5]!==n.key||e[6]!==n.publicUrl?(N=t.jsx("img",{src:n.publicUrl,alt:n.key,loading:"lazy",className:"h-full w-full object-cover",onError:xt}),e[5]=n.key,e[6]=n.publicUrl,e[7]=N):N=e[7];let h;e[8]!==n.key||e[9]!==b||e[10]!==N?(h=t.jsx("button",{type:"button",onClick:b,className:"block h-full w-full transition hover:ring-2 hover:ring-primary",title:n.key,children:N}),e[8]=n.key,e[9]=b,e[10]=N,e[11]=h):h=e[11];let C;e[12]!==a?(C=t.jsx("span",{className:"pointer-events-none absolute left-1.5 top-1.5 rounded bg-background/80 px-1.5 py-0.5 text-[10px] font-medium uppercase text-foreground opacity-0 backdrop-blur-sm transition-opacity group-hover:opacity-100",children:a}),e[12]=a,e[13]=C):C=e[13];let S;e[14]!==n||e[15]!==i?(S=t.jsx("div",{className:"absolute right-1.5 top-1.5 opacity-0 transition-opacity group-hover:opacity-100",children:t.jsx(xe,{item:n,onSelect:i})}),e[14]=n,e[15]=i,e[16]=S):S=e[16];let I;e[17]!==n.key?(I=he(n.key),e[17]=n.key,e[18]=I):I=e[18];let _;e[19]!==I?(_=t.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/70 to-transparent p-2 opacity-0 transition-opacity group-hover:opacity-100",children:t.jsx("p",{className:"truncate text-xs text-white",children:I})}),e[19]=I,e[20]=_):_=e[20];let P;return e[21]!==h||e[22]!==C||e[23]!==S||e[24]!==_?(P=t.jsxs("div",{className:"group relative aspect-square overflow-hidden rounded-lg border border-border/60 bg-muted",children:[h,C,S,_]}),e[21]=h,e[22]=C,e[23]=S,e[24]=_,e[25]=P):P=e[25],P}let r;e[26]!==n.publicUrl||e[27]!==i?(r=()=>i(n.publicUrl),e[26]=n.publicUrl,e[27]=i,e[28]=r):r=e[28];let d;e[29]!==n.key?(d=t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-md bg-muted",children:ye(n.key)?t.jsx(W,{size:16,className:"text-muted-foreground"}):t.jsx(ze,{size:16,className:"text-muted-foreground"})}),e[29]=n.key,e[30]=d):d=e[30];let c;e[31]!==n.key?(c=he(n.key),e[31]=n.key,e[32]=c):c=e[32];let g;e[33]!==c?(g=t.jsx("p",{className:"truncate text-sm font-medium",children:c}),e[33]=c,e[34]=g):g=e[34];let f;e[35]!==n.key?(f=t.jsx("p",{className:"truncate font-mono text-xs text-muted-foreground",children:n.key}),e[35]=n.key,e[36]=f):f=e[36];let x;e[37]!==g||e[38]!==f?(x=t.jsxs("div",{className:"min-w-0 flex-1",children:[g,f]}),e[37]=g,e[38]=f,e[39]=x):x=e[39];let u;e[40]!==a?(u=t.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground",children:a}),e[40]=a,e[41]=u):u=e[41];let p;e[42]!==n.size?(p=yt(n.size),e[42]=n.size,e[43]=p):p=e[43];let j;e[44]!==p?(j=t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:p}),e[44]=p,e[45]=j):j=e[45];let m;e[46]!==j||e[47]!==r||e[48]!==d||e[49]!==x||e[50]!==u?(m=t.jsxs("button",{type:"button",onClick:r,className:"flex min-w-0 flex-1 items-center gap-3 text-left",children:[d,x,u,j]}),e[46]=j,e[47]=r,e[48]=d,e[49]=x,e[50]=u,e[51]=m):m=e[51];let y;e[52]!==n||e[53]!==i?(y=t.jsx(xe,{item:n,onSelect:i}),e[52]=n,e[53]=i,e[54]=y):y=e[54];let k;return e[55]!==m||e[56]!==y?(k=t.jsxs("div",{className:"group flex items-center gap-3 px-3 py-2 transition hover:bg-muted/50",children:[m,y]}),e[55]=m,e[56]=y,e[57]=k):k=e[57],k}function xt(s){s.target.style.display="none"}function xe(s){const e=w.c(22),{item:n,onSelect:l}=s,[i,o]=$.useState(!1);let a;e[0]!==n.publicUrl?(a=async function(b){b.preventDefault(),b.stopPropagation();try{await navigator.clipboard.writeText(n.publicUrl),o(!0),window.setTimeout(()=>o(!1),1500)}catch{Q.error("Failed to copy URL")}},e[0]=n.publicUrl,e[1]=a):a=e[1];const r=a;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Me,{asChild:!0,children:t.jsx(Y,{type:"button",variant:"ghost",size:"icon",className:"size-7 rounded-md bg-background/80 backdrop-blur-sm",onClick:jt,"aria-label":"Asset actions",children:t.jsx(De,{size:14})})}),e[2]=d):d=e[2];let c;e[3]!==n.publicUrl||e[4]!==l?(c=()=>l(n.publicUrl),e[3]=n.publicUrl,e[4]=l,e[5]=c):c=e[5];let g;e[6]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(ge,{size:14}),e[6]=g):g=e[6];let f;e[7]!==c?(f=t.jsxs(ce,{onClick:c,children:[g,"Use this"]}),e[7]=c,e[8]=f):f=e[8];let x;e[9]!==i?(x=i?t.jsx(ge,{size:14}):t.jsx($e,{size:14}),e[9]=i,e[10]=x):x=e[10];const u=i?"Copied":"Copy URL";let p;e[11]!==r||e[12]!==x||e[13]!==u?(p=t.jsxs(ce,{onClick:r,children:[x,u]}),e[11]=r,e[12]=x,e[13]=u,e[14]=p):p=e[14];let j;e[15]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(Fe,{size:14}),e[15]=j):j=e[15];let m;e[16]!==n.publicUrl?(m=t.jsx(ce,{asChild:!0,children:t.jsxs("a",{href:n.publicUrl,target:"_blank",rel:"noreferrer",onClick:ht,children:[j,"Open in new tab"]})}),e[16]=n.publicUrl,e[17]=m):m=e[17];let y;return e[18]!==m||e[19]!==f||e[20]!==p?(y=t.jsxs(Re,{children:[d,t.jsxs(Be,{align:"end",onClick:bt,children:[f,p,m]})]}),e[18]=m,e[19]=f,e[20]=p,e[21]=y):y=e[21],y}function ht(s){return s.stopPropagation()}function bt(s){return s.stopPropagation()}function jt(s){return s.stopPropagation()}function he(s){const e=s.split("/");return e[e.length-1]??s}function yt(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`}function vt(s){try{const e=new URL(s).pathname;return decodeURIComponent(e.split("/").pop()??s)}catch{return s.split("/").pop()??s}}function Nt(s){const e=s.lastIndexOf(".");return e<0||e===s.length-1?"":s.slice(e+1).toLowerCase()}const kt=new Set(["image/png","image/jpeg","image/gif","image/webp","image/svg+xml","image/avif"]);function Kt(s){const e=w.c(79),{schema:n,value:l,onChange:i,path:o,label:a}=s,r=et(l),[d,c]=$.useState(!1),[g,f]=$.useState(!1),[x,u]=$.useState(!1),[p,j]=$.useState(!1),m=r?vt(r):"",y=m?Nt(m):"",k=Ye(),b=je();let N;e[0]!==i||e[1]!==j||e[2]!==u?(N=function(v){u(!1),j(!1),i(v)},e[0]=i,e[1]=j,e[2]=u,e[3]=N):N=e[3];const h=N;let C;e[4]!==k.data?.configs?(C=function(){const v=k.data?.configs??[];if(v.length===1)return v[0].id;if(v.length===0)return null;const D=typeof window<"u"?window.localStorage.getItem(ue):null;return v.some(te=>te.id===D)?D:null},e[4]=k.data?.configs,e[5]=C):C=e[5];const S=C;let I;e[6]!==S||e[7]!==c||e[8]!==h||e[9]!==b?(I=async function(v){if(!v)return;const D=Array.from(v).filter(wt);if(D.length===0){Q.error("Only image files are accepted here.");return}const te=S();if(!te){c(!0);return}try{const ae=await b.mutateAsync({configId:te,file:D[0]});h(ae.publicUrl),D.length>1&&Q.info(`Uploaded ${D[0].name}; extra files were ignored (single-select field).`)}catch(ae){const me=ae;Q.error(me instanceof Error?me.message:"Upload failed")}},e[6]=S,e[7]=c,e[8]=h,e[9]=b,e[10]=I):I=e[10];const _=I;let P;e[11]!==f?(P=function(v){v.preventDefault(),v.dataTransfer.types.includes("Files")&&f(!0)},e[11]=f,e[12]=P):P=e[12];const se=P;let H;e[13]!==f?(H=function(v){v.currentTarget===v.target&&f(!1)},e[13]=f,e[14]=H):H=e[14];const ne=H;let X;e[15]!==_||e[16]!==f?(X=function(v){v.preventDefault(),f(!1),_(v.dataTransfer.files)},e[15]=_,e[16]=f,e[17]=X):X=e[17];const ie=X;let z;e[18]!==a||e[19]!==o?(z=t.jsx(Pe,{htmlFor:o,className:"text-muted-foreground",children:a}),e[18]=a,e[19]=o,e[20]=z):z=e[20];let F;e[21]!==n.description?(F=n.description&&t.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:n.description}),e[21]=n.description,e[22]=F):F=e[22];let T;e[23]!==z||e[24]!==F?(T=t.jsxs("div",{className:"min-w-0 space-y-0.5",children:[z,F]}),e[23]=z,e[24]=F,e[25]=T):T=e[25];const le=g&&"border-primary ring-2 ring-primary/30",re=b.isPending&&"pointer-events-none opacity-60";let E;e[26]!==le||e[27]!==re?(E=de("group relative w-full overflow-hidden rounded-xl border border-border/60 bg-muted/30 transition",le,re),e[26]=le,e[27]=re,e[28]=E):E=e[28];let L;e[29]!==y||e[30]!==m||e[31]!==p||e[32]!==x||e[33]!==a||e[34]!==j||e[35]!==u||e[36]!==c||e[37]!==r||e[38]!==b.isPending?(L=r?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"relative h-40 w-full bg-[image:linear-gradient(45deg,rgba(0,0,0,0.04)_25%,transparent_25%,transparent_75%,rgba(0,0,0,0.04)_75%),linear-gradient(45deg,rgba(0,0,0,0.04)_25%,transparent_25%,transparent_75%,rgba(0,0,0,0.04)_75%)] bg-[position:0_0,8px_8px] [background-size:16px_16px]",children:[!p&&t.jsx("img",{src:r,alt:a,className:de("h-full w-full object-contain transition-opacity",!x&&"opacity-0"),onLoad:()=>u(!0),onError:()=>j(!0)},r),p&&t.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-1 text-muted-foreground",children:[t.jsx(W,{size:20}),t.jsx("p",{className:"text-xs",children:"Preview unavailable"})]}),!x&&!p&&t.jsx("div",{className:"absolute inset-0 animate-pulse bg-muted/60"})]}),t.jsxs("div",{className:"flex items-center gap-2 border-t border-border/60 bg-background/50 px-3 py-2",children:[t.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium",children:m}),y&&t.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground",children:y})]})]}):t.jsxs("button",{type:"button",onClick:()=>c(!0),className:"flex h-40 w-full flex-col items-center justify-center gap-2 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[t.jsx(W,{size:20}),t.jsx("span",{className:"text-sm font-medium",children:b.isPending?"Uploading…":"Drop an image or click to browse"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"PNG, JPEG, WebP, GIF, SVG, AVIF — up to 100 MB"})]}),e[29]=y,e[30]=m,e[31]=p,e[32]=x,e[33]=a,e[34]=j,e[35]=u,e[36]=c,e[37]=r,e[38]=b.isPending,e[39]=L):L=e[39];let O;e[40]!==g?(O=g&&t.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-primary/10 backdrop-blur-[1px]",children:t.jsx("span",{className:"rounded-md bg-background px-3 py-1.5 text-xs font-medium shadow",children:"Drop to upload"})}),e[40]=g,e[41]=O):O=e[41];let A;e[42]!==ne||e[43]!==se||e[44]!==ie||e[45]!==E||e[46]!==L||e[47]!==O?(A=t.jsxs("div",{onDragOver:se,onDragLeave:ne,onDrop:ie,className:E,children:[L,O]}),e[42]=ne,e[43]=se,e[44]=ie,e[45]=E,e[46]=L,e[47]=O,e[48]=A):A=e[48];let M;e[49]!==h?(M=U=>h(U.target.value),e[49]=h,e[50]=M):M=e[50];let R;e[51]!==o||e[52]!==r||e[53]!==M?(R=t.jsx(_e,{id:o,type:"url",value:r,onChange:M,placeholder:"https://...",className:"h-9 min-w-0 flex-1"}),e[51]=o,e[52]=r,e[53]=M,e[54]=R):R=e[54];let B;e[55]!==c?(B=()=>c(!0),e[55]=c,e[56]=B):B=e[56];let Z;e[57]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx(fe,{size:14}),e[57]=Z):Z=e[57];const oe=r?"Replace":"Browse";let G;e[58]!==B||e[59]!==oe?(G=t.jsxs(Y,{type:"button",variant:"outline",size:"sm",onClick:B,className:"h-9 shrink-0",children:[Z,oe]}),e[58]=B,e[59]=oe,e[60]=G):G=e[60];let V;e[61]!==h||e[62]!==r?(V=r&&t.jsx(Y,{type:"button",variant:"ghost",size:"sm",onClick:()=>h(""),className:"h-9 shrink-0","aria-label":"Remove image",children:t.jsx(Se,{size:14})}),e[61]=h,e[62]=r,e[63]=V):V=e[63];let K;e[64]!==R||e[65]!==G||e[66]!==V?(K=t.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[R,G,V]}),e[64]=R,e[65]=G,e[66]=V,e[67]=K):K=e[67];let q;e[68]!==h?(q=U=>h(U),e[68]=h,e[69]=q):q=e[69];let J;e[70]!==d||e[71]!==c||e[72]!==q?(J=t.jsx(it,{open:d,onOpenChange:c,mode:"image",onSelect:q}),e[70]=d,e[71]=c,e[72]=q,e[73]=J):J=e[73];let ee;return e[74]!==A||e[75]!==K||e[76]!==J||e[77]!==T?(ee=t.jsxs("div",{className:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] gap-2",children:[T,A,K,J]}),e[74]=A,e[75]=K,e[76]=J,e[77]=T,e[78]=ee):ee=e[78],ee}function wt(s){return kt.has(s.type||"")}export{it as F,Kt as I,ue as L,et as e,je as u};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{e as C,q as A,F as Fe,a as oe,K as _,n as M,b2 as Qe,r as R,j as t,B as U,c as ee,f as De,d as ze,E as ae,z as Xe,o as H}from"./index-
|
|
1
|
+
import{e as C,q as A,F as Fe,a as oe,K as _,n as M,b2 as Qe,r as R,j as t,B as U,c as ee,f as De,d as ze,E as ae,z as Xe,o as H}from"./index-Dpo5EC2L.js";import{i as We}from"./ChevronRight-sANym5JO.js";import{s as Oe}from"./Eye-MExi_r3W.js";import{n as de,i as Ye}from"./Globe01-Dv5kpprP.js";import{i as Ze,b as Je}from"./ZoomOut-DsFvQG0e.js";import{s as et}from"./Plus-zYQzJd1M.js";import{t as tt}from"./Stars01-oKRH_HZK.js";import{i as Pe}from"./Upload01-DuGEhzNC.js";import{b as Q,T as X,a as W,u as Te}from"./tooltip-CnTONKZv.js";import{A as st,a as lt,b as nt,c as it,d as rt,e as ot,f as at,g as ct}from"./alert-dialog-DFtcSlfd.js";import{D as fe,a as ue,c as me,f as dt,b as ft,e as ut,d as mt}from"./dialog-BTuyAnJD.js";import{I as ht}from"./input-DdFNzbfV.js";import{S as V}from"./skeleton-CpdmEGkq.js";import{F as E,d as _e,M as xt}from"./file-type-icon-Dj99fHuB.js";import{a as pt}from"./toolbar-1jwB3OBh.js";import{f as Ue,a as he,F as Ee,H as gt}from"./header-tab-button-jijhwXxy.js";import{i as xe}from"./DotsVertical-UEiFsiMu.js";import{s as pe}from"./Trash01-BtO3xPfa.js";import{i as Ae}from"./Zap-Dv5TVml0.js";import{a as ge,c as Y,b as je,D as ye}from"./dropdown-menu-Ci4-mVLy.js";import{R as Ne,a as jt,b as yt}from"./resizable-0Wn5JpiT.js";import{n as Me}from"./LinkExternal01-Bh2jIX62.js";import{s as bt}from"./XClose-C-93XSA0.js";import{i as wt}from"./X-C7X3rsvo.js";import"./Check-_9fGuqcU.js";import"./ChevronLeft-Bn25DZii.js";import"./index-sKMKGB16.js";const vt=new Set(["output","upload","public","home"]),Nt=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function kt(l){return vt.has(l)||!Nt.test(l)?"home":l}function q(l,e,s,n){const i=new URLSearchParams(n).toString();return`/api/${encodeURIComponent(l)}/fs/${encodeURIComponent(e)}/${s}${i?`?${i}`:""}`}async function K(l,e){const s=await fetch(l,e);if(!s.ok){let n="";try{n=(await s.json()).error??""}catch{}throw new Error(n||`HTTP ${s.status}`)}return s}function Re(l,e){const s=C.c(11),{org:n}=A();let i;s[0]!==n.id||s[1]!==e||s[2]!==l?(i=_.orgFsList(n.id,l,e),s[0]=n.id,s[1]=e,s[2]=l,s[3]=i):i=s[3];let o;s[4]!==n.slug||s[5]!==e||s[6]!==l?(o=async()=>(await(await K(q(n.slug,l,"list",{path:e}))).json()).entries.toSorted($t),s[4]=n.slug,s[5]=e,s[6]=l,s[7]=o):o=s[7];let a;return s[8]!==i||s[9]!==o?(a={queryKey:i,placeholderData:Qe,queryFn:o},s[8]=i,s[9]=o,s[10]=a):a=s[10],M(a)}function $t(l,e){return l.kind!==e.kind?l.kind==="dir"?-1:1:l.path.localeCompare(e.path)}function qe(l,e){const s=C.c(12),{org:n}=A();let i;s[0]!==n.id||s[1]!==e||s[2]!==l?(i=_.orgFsStat(n.id,l??"",e),s[0]=n.id,s[1]=e,s[2]=l,s[3]=i):i=s[3];const o=l!==null;let a;s[4]!==n.slug||s[5]!==e||s[6]!==l?(a=async()=>{const r=await fetch(q(n.slug,l??"","stat",{path:e}));if(r.status===404)return null;if(!r.ok)throw new Error(`HTTP ${r.status}`);return(await r.json()).entry},s[4]=n.slug,s[5]=e,s[6]=l,s[7]=a):a=s[7];let c;return s[8]!==i||s[9]!==o||s[10]!==a?(c={queryKey:i,enabled:o,queryFn:a},s[8]=i,s[9]=o,s[10]=a,s[11]=c):c=s[11],M(c)}function Ct(l){const e=C.c(9),{org:s}=A();let n;e[0]!==s.id||e[1]!==l?(n=_.orgFsUsage(s.id,l),e[0]=s.id,e[1]=l,e[2]=n):n=e[2];let i;e[3]!==s.slug||e[4]!==l?(i=async()=>await(await K(q(s.slug,l,"usage"))).json(),e[3]=s.slug,e[4]=l,e[5]=i):i=e[5];let o;return e[6]!==n||e[7]!==i?(o={queryKey:n,queryFn:i},e[6]=n,e[7]=i,e[8]=o):o=e[8],M(o)}function St(l){const e=C.c(8),s=60,{org:n}=A();let i;e[0]!==n.id?(i=_.orgFsRecent(n.id),e[0]=n.id,e[1]=i):i=e[1];let o;e[2]!==s||e[3]!==n.slug?(o=async()=>(await(await K(`/api/${encodeURIComponent(n.slug)}/fs/recent?limit=${s}`)).json()).entries,e[2]=s,e[3]=n.slug,e[4]=o):o=e[4];let a;return e[5]!==i||e[6]!==o?(a={queryKey:i,queryFn:o},e[5]=i,e[6]=o,e[7]=a):a=e[7],M(a)}function Le(){const l=C.c(7),{org:e}=A();let s;l[0]!==e.id?(s=_.orgFsPublicSets(e.id),l[0]=e.id,l[1]=s):s=l[1];let n;l[2]!==e.slug?(n=async()=>(await(await K(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,l[2]=e.slug,l[3]=n):n=l[3];let i;return l[4]!==s||l[5]!==n?(i={queryKey:s,staleTime:3e5,queryFn:n},l[4]=s,l[5]=n,l[6]=i):i=l[6],M(i)}function Ie(l){const e=C.c(3),{org:s}=A();let n;return e[0]!==s.slug||e[1]!==l?(n=i=>q(s.slug,l,"read",{path:i}),e[0]=s.slug,e[1]=l,e[2]=n):n=e[2],n}function be(){const l=C.c(2),{org:e}=A();let s;return l[0]!==e.slug?(s=(n,i)=>q(e.slug,n,"read",{path:i}),l[0]=e.slug,l[1]=s):s=l[1],s}function ke(l){const e=C.c(26),{org:s}=A(),n=Fe();let i;e[0]!==s||e[1]!==n||e[2]!==l?(i=()=>{n.invalidateQueries({queryKey:_.orgFsVolume(s.id,l)}),n.invalidateQueries({queryKey:_.orgFsRecent(s.id)})},e[0]=s,e[1]=n,e[2]=l,e[3]=i):i=e[3];const o=i;let a;e[4]!==s||e[5]!==l?(a=async p=>{for(const h of p.files){const v=p.dir?`${p.dir}/${h.name}`:h.name;await K(q(s.slug,l,"file",{path:v}),{method:"PUT",headers:{"content-type":h.type||"application/octet-stream"},body:h})}},e[4]=s,e[5]=l,e[6]=a):a=e[6];let c;e[7]!==o||e[8]!==a?(c={mutationFn:a,onSettled:o},e[7]=o,e[8]=a,e[9]=c):c=e[9];const r=oe(c);let d;e[10]!==s||e[11]!==l?(d=async p=>{await K(q(s.slug,l,"dir",{path:p}),{method:"POST"})},e[10]=s,e[11]=l,e[12]=d):d=e[12];let u;e[13]!==o||e[14]!==d?(u={mutationFn:d,onSuccess:o},e[13]=o,e[14]=d,e[15]=u):u=e[15];const f=oe(u);let m;e[16]!==s||e[17]!==l?(m=async p=>{await K(q(s.slug,l,"file",{path:p}),{method:"DELETE"})},e[16]=s,e[17]=l,e[18]=m):m=e[18];let x;e[19]!==o||e[20]!==m?(x={mutationFn:m,onSuccess:o},e[19]=o,e[20]=m,e[21]=x):x=e[21];const y=oe(x);let g;return e[22]!==f||e[23]!==y||e[24]!==r?(g={upload:r,mkdir:f,remove:y},e[22]=f,e[23]=y,e[24]=r,e[25]=g):g=e[25],g}function Ft(l){const e=C.c(33);let s,n,i;e[0]!==l?({glyph:s,readOnly:i,...n}=l,e[0]=l,e[1]=s,e[2]=n,e[3]=i):(s=e[1],n=e[2],i=e[3]);const o=R.useId(),a=`${o}-back`,c=`${o}-front`,r=`url(#${a})`;let d;e[4]!==r?(d=t.jsx("path",{d:"M2.53738 2.55C1.13602 2.55 0 3.68602 0 5.08738V11.535H31.931V7.65326C31.931 6.23616 30.7822 5.08738 29.3651 5.08738H14.7681L13.8775 5.02542C13.3886 4.99141 12.9197 4.81809 12.5261 4.52596L10.7726 3.22419C10.1828 2.78638 9.46784 2.55 8.73334 2.55H2.53738Z",fill:r}),e[4]=r,e[5]=d):d=e[5];const u=`url(#${c})`;let f;e[6]!==u?(f=t.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:u}),e[6]=u,e[7]=f):f=e[7];let m,x,y;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),x=t.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:"#84CDFB"}),y=t.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:"#84CDFB"}),e[8]=m,e[9]=x,e[10]=y):(m=e[8],x=e[9],y=e[10]);let g;e[11]!==s?(g=s&&t.jsx(s,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:"#014AC9",opacity:.55}}),e[11]=s,e[12]=g):g=e[12];let p;e[13]!==i?(p=i&&t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),t.jsx(Oe,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),e[13]=i,e[14]=p):p=e[14];let h,v;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("stop",{offset:"0.3",stopColor:"#4D87DF"}),v=t.jsx("stop",{offset:"1",stopColor:"#296FE8"}),e[15]=h,e[16]=v):(h=e[15],v=e[16]);let w;e[17]!==a?(w=t.jsxs("linearGradient",{id:a,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[h,v]}),e[17]=a,e[18]=w):w=e[18];let k,j;e[19]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("stop",{stopColor:"#72B6FA"}),j=t.jsx("stop",{offset:"1",stopColor:"#5BB1EF"}),e[19]=k,e[20]=j):(k=e[19],j=e[20]);let N;e[21]!==c?(N=t.jsxs("radialGradient",{id:c,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[k,j]}),e[21]=c,e[22]=N):N=e[22];let $;e[23]!==w||e[24]!==N?($=t.jsxs("defs",{children:[w,N]}),e[23]=w,e[24]=N,e[25]=$):$=e[25];let S;return e[26]!==n||e[27]!==$||e[28]!==d||e[29]!==f||e[30]!==g||e[31]!==p?(S=t.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...n,children:[d,f,m,x,y,g,p,$]}),e[26]=n,e[27]=$,e[28]=d,e[29]=f,e[30]=g,e[31]=p,e[32]=S):S=e[32],S}function Dt(l){const e={};for(const s of l.split(`
|
|
2
2
|
`)){const n=s.match(/^([A-Za-z][\w-]*):\s*(.*)$/);n?.[1]&&n[2]!==void 0&&(e[n[1].toLowerCase()]=n[2].trim())}return e}function $e(l){for(const e of l.split(/\n\s*\n/)){const s=e.trim();if(!(!s||s.startsWith("#")))return s.replace(/\n/g," ")}return null}function Ke(l){const e=l.match(/^---\n([\s\S]*?)\n---\n?/);if(!e||e[1]===void 0)return{name:null,description:$e(l),body:l};const s=Dt(e[1]),n=l.slice(e[0].length);return{name:s.name||null,description:s.description||$e(n),body:n}}const zt=new Set(["png","jpg","jpeg","gif","webp","svg","avif"]),Ot=new Set(["csv","tsv"]),Pt=new Set(["mp4","webm","mov","m4v"]),Tt=new Set(["txt","md","markdown","json","log","yaml","yml","xml","html","htm"]),_t=256*1024;function te(l){const e=new Date(l);if(Number.isNaN(e.getTime()))return"";const s=Date.now()-e.getTime(),n=Math.floor(s/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const i=Math.floor(n/60);if(i<24)return`${i}h ago`;const o=Math.floor(i/24);return o<30?`${o}d ago`:e.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Ut(l){return l.split(".").pop()?.toLowerCase()??""}function Be(l){const e=C.c(15),{downloadUrl:s,filename:n,onDelete:i}=l,o=`Actions for ${n}`;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(xe,{size:14}),e[0]=a):a=e[0];let c;e[1]!==o?(c=t.jsx(ge,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:At,"aria-label":o,children:a})}),e[1]=o,e[2]=c):c=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(de,{size:14}),e[3]=r):r=e[3];let d;e[4]!==s||e[5]!==n?(d=t.jsx(Y,{asChild:!0,children:t.jsxs("a",{href:s,download:n,children:[r,"Download"]})}),e[4]=s,e[5]=n,e[6]=d):d=e[6];let u;e[7]!==i?(u=i&&t.jsxs(Y,{variant:"destructive",onClick:i,children:[t.jsx(pe,{size:14}),"Delete"]}),e[7]=i,e[8]=u):u=e[8];let f;e[9]!==d||e[10]!==u?(f=t.jsxs(je,{align:"end",onClick:Et,children:[d,u]}),e[9]=d,e[10]=u,e[11]=f):f=e[11];let m;return e[12]!==c||e[13]!==f?(m=t.jsxs(ye,{children:[c,f]}),e[12]=c,e[13]=f,e[14]=m):m=e[14],m}function Et(l){return l.stopPropagation()}function At(l){return l.stopPropagation()}function se(l){const e=C.c(9),{onOpen:s,children:n,className:i}=l;let o;e[0]!==s?(o=r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),s())},e[0]=s,e[1]=o):o=e[1];let a;e[2]!==i?(a=ee("group/card flex cursor-pointer flex-col gap-3 rounded-2xl border border-border bg-background p-4 text-left transition-colors hover:border-border hover:bg-muted/40",i),e[2]=i,e[3]=a):a=e[3];let c;return e[4]!==n||e[5]!==s||e[6]!==o||e[7]!==a?(c=t.jsx("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:o,className:a,children:n}),e[4]=n,e[5]=s,e[6]=o,e[7]=a,e[8]=c):c=e[8],c}function le(l){const e=C.c(16),{icon:s,name:n,meta:i,subtitle:o,actions:a}=l;let c;e[0]!==n?(c=t.jsx("span",{className:"min-w-0 flex-1 truncate text-[13px] text-foreground",title:n,children:n}),e[0]=n,e[1]=c):c=e[1];let r;e[2]!==i?(r=i&&t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:i}),e[2]=i,e[3]=r):r=e[3];let d;e[4]!==c||e[5]!==r?(d=t.jsxs("div",{className:"flex items-start gap-3",children:[c,r]}),e[4]=c,e[5]=r,e[6]=d):d=e[6];let u;e[7]!==o?(u=o&&t.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[7]=o,e[8]=u):u=e[8];let f;e[9]!==d||e[10]!==u?(f=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col justify-center",children:[d,u]}),e[9]=d,e[10]=u,e[11]=f):f=e[11];let m;return e[12]!==a||e[13]!==s||e[14]!==f?(m=t.jsxs("div",{className:"flex w-full items-center gap-2.5",children:[s,f,a]}),e[12]=a,e[13]=s,e[14]=f,e[15]=m):m=e[15],m}function ne(l){const e=C.c(15),{name:s,meta:n,subtitle:i,glyph:o,readOnly:a,onOpen:c,onDelete:r}=l;let d;e[0]!==o||e[1]!==a?(d=t.jsx(Ft,{glyph:o,readOnly:a,className:"size-8 shrink-0"}),e[0]=o,e[1]=a,e[2]=d):d=e[2];let u;e[3]!==s||e[4]!==r?(u=r?t.jsxs(ye,{children:[t.jsx(ge,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:Rt,"aria-label":`Actions for ${s}`,children:t.jsx(xe,{size:14})})}),t.jsx(je,{align:"end",onClick:Mt,children:t.jsxs(Y,{variant:"destructive",onClick:r,children:[t.jsx(pe,{size:14}),"Delete"]})})]}):void 0,e[3]=s,e[4]=r,e[5]=u):u=e[5];let f;e[6]!==n||e[7]!==s||e[8]!==i||e[9]!==d||e[10]!==u?(f=t.jsx(le,{icon:d,name:s,meta:n,subtitle:i,actions:u}),e[6]=n,e[7]=s,e[8]=i,e[9]=d,e[10]=u,e[11]=f):f=e[11];let m;return e[12]!==c||e[13]!==f?(m=t.jsx(se,{onOpen:c,children:f}),e[12]=c,e[13]=f,e[14]=m):m=e[14],m}function Mt(l){return l.stopPropagation()}function Rt(l){return l.stopPropagation()}function He(l){const e=C.c(19),{filename:s,updatedAt:n,downloadUrl:i,onOpen:o,onDelete:a}=l;let c;e[0]!==s?(c=t.jsx(E,{filename:s,className:"h-8 w-6.5 shrink-0"}),e[0]=s,e[1]=c):c=e[1];let r;e[2]!==n?(r=te(n),e[2]=n,e[3]=r):r=e[3];let d;e[4]!==s?(d=_e(s),e[4]=s,e[5]=d):d=e[5];let u;e[6]!==i||e[7]!==s||e[8]!==a?(u=t.jsx(Be,{downloadUrl:i,filename:s,onDelete:a}),e[6]=i,e[7]=s,e[8]=a,e[9]=u):u=e[9];let f;e[10]!==s||e[11]!==c||e[12]!==r||e[13]!==d||e[14]!==u?(f=t.jsx(le,{icon:c,name:s,meta:r,subtitle:d,actions:u}),e[10]=s,e[11]=c,e[12]=r,e[13]=d,e[14]=u,e[15]=f):f=e[15];let m;return e[16]!==o||e[17]!==f?(m=t.jsx(se,{onOpen:o,children:f}),e[16]=o,e[17]=f,e[18]=m):m=e[18],m}function qt(l){const e=C.c(36),{dirName:s,updatedAt:n,skillMdUrl:i,onOpen:o,onBrowse:a,onDelete:c}=l;let r;e[0]!==i?(r=_.fileText(i),e[0]=i,e[1]=r):r=e[1];let d;e[2]!==i?(d=async()=>{const O=await fetch(i,{credentials:"include"});if(!O.ok)throw new Error(`fetch failed: ${O.status}`);return O.text()},e[2]=i,e[3]=d):d=e[3];let u;e[4]!==r||e[5]!==d?(u={queryKey:r,queryFn:d,staleTime:6e4,retry:!1},e[4]=r,e[5]=d,e[6]=u):u=e[6];const{data:f}=M(u);let m;e[7]!==f?(m=f?Ke(f):null,e[7]=f,e[8]=m):m=e[8];const x=m;let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:t.jsx(Ae,{size:16})}),e[9]=y):y=e[9];const g=x?.name??s;let p;e[10]!==n?(p=te(n),e[10]=n,e[11]=p):p=e[11];const h=`Actions for ${s}`;let v;e[12]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(xe,{size:14}),e[12]=v):v=e[12];let w;e[13]!==h?(w=t.jsx(ge,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:It,"aria-label":h,children:v})}),e[13]=h,e[14]=w):w=e[14];let k;e[15]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ze,{size:14}),e[15]=k):k=e[15];let j;e[16]!==a?(j=t.jsxs(Y,{onClick:a,children:[k,"Browse files"]}),e[16]=a,e[17]=j):j=e[17];let N;e[18]!==c?(N=c&&t.jsxs(Y,{variant:"destructive",onClick:c,children:[t.jsx(pe,{size:14}),"Delete"]}),e[18]=c,e[19]=N):N=e[19];let $;e[20]!==j||e[21]!==N?($=t.jsxs(je,{align:"end",onClick:Lt,children:[j,N]}),e[20]=j,e[21]=N,e[22]=$):$=e[22];let S;e[23]!==w||e[24]!==$?(S=t.jsxs(ye,{children:[w,$]}),e[23]=w,e[24]=$,e[25]=S):S=e[25];let F;e[26]!==S||e[27]!==g||e[28]!==p?(F=t.jsx(le,{icon:y,name:g,meta:p,subtitle:"Skill",actions:S}),e[26]=S,e[27]=g,e[28]=p,e[29]=F):F=e[29];const z=x?.description??"";let D;e[30]!==z?(D=t.jsx("p",{className:"line-clamp-2 min-h-8 text-xs leading-4 text-muted-foreground",children:z}),e[30]=z,e[31]=D):D=e[31];let b;return e[32]!==o||e[33]!==F||e[34]!==D?(b=t.jsxs(se,{onOpen:o,children:[F,D]}),e[32]=o,e[33]=F,e[34]=D,e[35]=b):b=e[35],b}function Lt(l){return l.stopPropagation()}function It(l){return l.stopPropagation()}function ce(l){const e=C.c(4),{children:s}=l,[n,i]=R.useState(!1);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>r=>{if(!r)return;const d=new IntersectionObserver(u=>{const[f]=u;f?.isIntersecting&&(i(!0),d.disconnect())},{rootMargin:"200px"});d.observe(r)},e[0]=o):o=e[0];const[a]=R.useState(o);if(n){let r;return e[1]!==s?(r=t.jsx(t.Fragment,{children:s}),e[1]=s,e[2]=r):r=e[2],r}let c;return e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{ref:a,className:"h-full w-full"}),e[3]=c):c=e[3],c}function Kt(l){const e=C.c(11),{url:s}=l;let n;e[0]!==s?(n=_.fileText(s),e[0]=s,e[1]=n):n=e[1];let i;e[2]!==s?(i=async()=>{const d=await fetch(s,{credentials:"include"});if(!d.ok)throw new Error(`fetch failed: ${d.status}`);return d.text()},e[2]=s,e[3]=i):i=e[3];let o;e[4]!==n||e[5]!==i?(o={queryKey:n,queryFn:i,staleTime:6e4,retry:!1},e[4]=n,e[5]=i,e[6]=o):o=e[6];const{data:a}=M(o);if(!a)return null;let c;e[7]!==a?(c=a.slice(0,2e3),e[7]=a,e[8]=c):c=e[8];let r;return e[9]!==c?(r=t.jsx("pre",{className:"pointer-events-none h-full w-full overflow-hidden bg-background p-3 font-mono text-[9px] leading-[1.5] text-muted-foreground select-none",children:c}),e[9]=c,e[10]=r):r=e[10],r}function Bt(l){const e=C.c(23),{url:s,ext:n}=l;let i;e[0]!==s?(i=_.csvThumb(s),e[0]=s,e[1]=i):i=e[1];let o;e[2]!==s?(o=async()=>{const p=await fetch(s,{credentials:"include",headers:{Range:"bytes=0-8191"}});if(!p.ok)throw new Error(`fetch failed: ${p.status}`);return p.text()},e[2]=s,e[3]=o):o=e[3];let a;e[4]!==i||e[5]!==o?(a={queryKey:i,queryFn:o,staleTime:6e4,retry:!1},e[4]=i,e[5]=o,e[6]=a):a=e[6];const{data:c}=M(a);if(!c)return null;const r=n==="tsv"?" ":",";let d,u,f,m;if(e[7]!==c||e[8]!==r){m=Symbol.for("react.early_return_sentinel");e:{let p;e[13]!==r?(p=v=>v.split(r).slice(0,6).map(Gt),e[13]=r,e[14]=p):p=e[14];const h=c.split(`
|
|
3
3
|
`).filter(Boolean).slice(0,7).map(p);if(h.length===0){m=null;break e}f="pointer-events-none h-full w-full overflow-hidden bg-background p-2 select-none",u="w-full border-collapse",d=h.map(Ht)}e[7]=c,e[8]=r,e[9]=d,e[10]=u,e[11]=f,e[12]=m}else d=e[9],u=e[10],f=e[11],m=e[12];if(m!==Symbol.for("react.early_return_sentinel"))return m;let x;e[15]!==d?(x=t.jsx("tbody",{children:d}),e[15]=d,e[16]=x):x=e[16];let y;e[17]!==u||e[18]!==x?(y=t.jsx("table",{className:u,children:x}),e[17]=u,e[18]=x,e[19]=y):y=e[19];let g;return e[20]!==f||e[21]!==y?(g=t.jsx("div",{className:f,children:y}),e[20]=f,e[21]=y,e[22]=g):g=e[22],g}function Ht(l,e){return t.jsx("tr",{className:ee(e===0&&"bg-muted/50 font-medium"),children:l.map(Vt)},e)}function Vt(l,e){return t.jsx("td",{className:"max-w-[56px] overflow-hidden border border-border/30 px-1 py-px text-[7px] leading-[1.4] text-muted-foreground",style:{maxWidth:56},children:t.jsx("span",{className:"block truncate",children:l})},e)}function Gt(l){return l.trim().replace(/^"|"$/g,"")}function Qt(l){const e=C.c(14),{filename:s,size:n,downloadUrl:i}=l;let o;if(e[0]!==i||e[1]!==s||e[2]!==n){const a=Ut(s);let c;if(zt.has(a)){let r;e[4]!==i?(r=t.jsx("img",{src:i,alt:"",loading:"lazy",className:"h-full w-full object-cover"}),e[4]=i,e[5]=r):r=e[5],c=r}else if(Pt.has(a)){const r=`${i}#t=0.1`;let d;e[6]!==r?(d=t.jsx(ce,{children:t.jsx("video",{src:r,preload:"metadata",muted:!0,playsInline:!0,className:"pointer-events-none h-full w-full object-cover"})}),e[6]=r,e[7]=d):d=e[7],c=d}else if(a==="pdf"){let r;e[8]!==s?(r=t.jsx("div",{className:"flex h-full w-full items-center justify-center",children:t.jsx(E,{filename:s,className:"h-14 w-11 opacity-60"})}),e[8]=s,e[9]=r):r=e[9],c=r}else if(Ot.has(a))c=t.jsx(ce,{children:t.jsx(Bt,{url:i,ext:a})});else if(Tt.has(a)&&n<=_t){let r;e[10]!==i?(r=t.jsx(ce,{children:t.jsx(Kt,{url:i})}),e[10]=i,e[11]=r):r=e[11],c=r}else{let r;e[12]!==s?(r=t.jsx("div",{className:"flex h-full w-full items-center justify-center",children:t.jsx(E,{filename:s,className:"h-14 w-11 opacity-60"})}),e[12]=s,e[13]=r):r=e[13],c=r}o=t.jsx("div",{className:"aspect-[400/265] w-full overflow-hidden rounded-lg border border-border/60 bg-muted/30",children:c}),e[0]=i,e[1]=s,e[2]=n,e[3]=o}else o=e[3];return o}function Xt(l){const e=C.c(24),s=l.onOpen;let n;e[0]!==l.filename?(n=t.jsx(E,{filename:l.filename,className:"h-8 w-6.5 shrink-0"}),e[0]=l.filename,e[1]=n):n=e[1];const i=l.filename;let o;e[2]!==l.updatedAt?(o=te(l.updatedAt),e[2]=l.updatedAt,e[3]=o):o=e[3];let a;e[4]!==l.filename?(a=_e(l.filename),e[4]=l.filename,e[5]=a):a=e[5];let c;e[6]!==l.downloadUrl||e[7]!==l.filename||e[8]!==l.onDelete?(c=t.jsx(Be,{downloadUrl:l.downloadUrl,filename:l.filename,onDelete:l.onDelete}),e[6]=l.downloadUrl,e[7]=l.filename,e[8]=l.onDelete,e[9]=c):c=e[9];let r;e[10]!==l.filename||e[11]!==n||e[12]!==o||e[13]!==a||e[14]!==c?(r=t.jsx(le,{icon:n,name:i,meta:o,subtitle:a,actions:c}),e[10]=l.filename,e[11]=n,e[12]=o,e[13]=a,e[14]=c,e[15]=r):r=e[15];let d;e[16]!==l.downloadUrl||e[17]!==l.filename||e[18]!==l.size?(d=t.jsx(Qt,{filename:l.filename,size:l.size,downloadUrl:l.downloadUrl}),e[16]=l.downloadUrl,e[17]=l.filename,e[18]=l.size,e[19]=d):d=e[19];let u;return e[20]!==l.onOpen||e[21]!==r||e[22]!==d?(u=t.jsxs(se,{onOpen:s,children:[r,d]}),e[20]=l.onOpen,e[21]=r,e[22]=d,e[23]=u):u=e[23],u}function ie(l){const e=l?l.split("/").filter(Boolean):[],s=e[0]==="public",n=s?e[1]??null:null,i=s?n?`public-${n}`:null:e[0]??null,o=(s?e.slice(2):e.slice(1)).join("/");return{segments:e,volume:i,dirPath:o,isPublic:s,publicSet:n,readOnly:s}}function J(l,e){return l.isPublic&&l.publicSet?`public/${l.publicSet}/${e}`:l.volume?`${l.volume}/${e}`:e}function T(l){const e=l.lastIndexOf("/");return e===-1?l:l.slice(e+1)}function Wt(l){const e=C.c(48),{previewPath:s,onClose:n}=l;let i;e[0]!==s?(i=ie(s),e[0]=s,e[1]=i):i=e[1];const o=i,{volume:a,dirPath:c}=o,{data:r,isPending:d}=qe(a,c),u=Ie(a??"");let f,m,x,y,g,p,h,v,w,k,j,N;e[2]!==u||e[3]!==r||e[4]!==c||e[5]!==n||e[6]!==s?(y=T(c),x=r&&r.kind==="file"?{key:s,filename:y,size:r.size,downloadUrl:u(r.path)}:null,m=fe,j=!0,e[19]!==n?(N=O=>{O||n()},e[19]=n,e[20]=N):N=e[20],f=ue,k="flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",w="flex h-11 shrink-0 items-center gap-1 border-b border-border/60 py-1 pr-12 pl-2",g="flex min-w-0 flex-1 items-center gap-2 px-2",p=t.jsx(E,{filename:y,className:"h-4.5 w-3.5 shrink-0"}),e[21]!==y?(h=t.jsx(me,{className:"truncate text-xs font-medium text-foreground",children:y}),e[21]=y,e[22]=h):h=e[22],v=x&&t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Ue(x.size)}),e[2]=u,e[3]=r,e[4]=c,e[5]=n,e[6]=s,e[7]=f,e[8]=m,e[9]=x,e[10]=y,e[11]=g,e[12]=p,e[13]=h,e[14]=v,e[15]=w,e[16]=k,e[17]=j,e[18]=N):(f=e[7],m=e[8],x=e[9],y=e[10],g=e[11],p=e[12],h=e[13],v=e[14],w=e[15],k=e[16],j=e[17],N=e[18]);let $;e[23]!==g||e[24]!==p||e[25]!==h||e[26]!==v?($=t.jsxs("div",{className:g,children:[p,h,v]}),e[23]=g,e[24]=p,e[25]=h,e[26]=v,e[27]=$):$=e[27];let S;e[28]!==x?(S=x&&t.jsxs(t.Fragment,{children:[t.jsxs(Q,{children:[t.jsx(X,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",asChild:!0,children:t.jsx("a",{href:x.downloadUrl,download:x.filename,children:t.jsx(de,{size:14})})})}),t.jsx(W,{side:"bottom",children:"Download"})]}),t.jsxs(Q,{children:[t.jsx(X,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",onClick:()=>window.open(x.downloadUrl,"_blank","noopener"),children:t.jsx(Me,{size:14})})}),t.jsx(W,{side:"bottom",children:"Open in new tab"})]})]}),e[28]=x,e[29]=S):S=e[29];let F;e[30]!==$||e[31]!==S||e[32]!==w?(F=t.jsxs("div",{className:w,children:[$,S]}),e[30]=$,e[31]=S,e[32]=w,e[33]=F):F=e[33];let z;e[34]!==x||e[35]!==y||e[36]!==d?(z=t.jsx("div",{className:"relative min-h-0 flex-1 bg-background",children:x?t.jsx(he,{file:x}):d?t.jsx(Ee,{}):t.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[t.jsx(E,{filename:y,className:"h-7.5 w-6"}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"This file is no longer available."})]})}),e[34]=x,e[35]=y,e[36]=d,e[37]=z):z=e[37];let D;e[38]!==f||e[39]!==F||e[40]!==z||e[41]!==k?(D=t.jsxs(f,{className:k,children:[F,z]}),e[38]=f,e[39]=F,e[40]=z,e[41]=k,e[42]=D):D=e[42];let b;return e[43]!==m||e[44]!==D||e[45]!==j||e[46]!==N?(b=t.jsx(m,{open:j,onOpenChange:N,children:D}),e[43]=m,e[44]=D,e[45]=j,e[46]=N,e[47]=b):b=e[47],b}function Yt(l){const e=C.c(42),{previewPath:s,onClose:n}=l;let i;e[0]!==s?(i=ie(s),e[0]=s,e[1]=i):i=e[1];const o=i,{volume:a,dirPath:c}=o,{data:r,isPending:d}=qe(a,c),u=Ie(a??"");let f,m,x,y,g,p,h,v;e[2]!==u||e[3]!==r||e[4]!==c||e[5]!==s?(m=T(c),f=r&&r.kind==="file"?{key:s,filename:m,size:r.size,downloadUrl:u(r.path)}:null,v="flex h-full w-full flex-col bg-background",h="flex h-9 shrink-0 items-center gap-1 border-b border-border/60 px-2",x="flex min-w-0 flex-1 items-center gap-2 px-2",y=t.jsx(E,{filename:m,className:"h-4.5 w-3.5 shrink-0"}),e[14]!==m?(g=t.jsx("span",{className:"truncate text-xs font-medium text-foreground",children:m}),e[14]=m,e[15]=g):g=e[15],p=f&&t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Ue(f.size)}),e[2]=u,e[3]=r,e[4]=c,e[5]=s,e[6]=f,e[7]=m,e[8]=x,e[9]=y,e[10]=g,e[11]=p,e[12]=h,e[13]=v):(f=e[6],m=e[7],x=e[8],y=e[9],g=e[10],p=e[11],h=e[12],v=e[13]);let w;e[16]!==x||e[17]!==y||e[18]!==g||e[19]!==p?(w=t.jsxs("div",{className:x,children:[y,g,p]}),e[16]=x,e[17]=y,e[18]=g,e[19]=p,e[20]=w):w=e[20];let k;e[21]!==f?(k=f&&t.jsxs(t.Fragment,{children:[t.jsxs(Q,{children:[t.jsx(X,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",asChild:!0,children:t.jsx("a",{href:f.downloadUrl,download:f.filename,children:t.jsx(de,{size:14})})})}),t.jsx(W,{side:"bottom",children:"Download"})]}),t.jsxs(Q,{children:[t.jsx(X,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",onClick:()=>window.open(f.downloadUrl,"_blank","noopener"),children:t.jsx(Me,{size:14})})}),t.jsx(W,{side:"bottom",children:"Open in new tab"})]})]}),e[21]=f,e[22]=k):k=e[22];let j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(bt,{size:14}),e[23]=j):j=e[23];let N;e[24]!==n?(N=t.jsx(X,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",onClick:n,children:j})}),e[24]=n,e[25]=N):N=e[25];let $;e[26]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(W,{side:"bottom",children:"Close"}),e[26]=$):$=e[26];let S;e[27]!==N?(S=t.jsxs(Q,{children:[N,$]}),e[27]=N,e[28]=S):S=e[28];let F;e[29]!==S||e[30]!==h||e[31]!==w||e[32]!==k?(F=t.jsxs("div",{className:h,children:[w,k,S]}),e[29]=S,e[30]=h,e[31]=w,e[32]=k,e[33]=F):F=e[33];let z;e[34]!==f||e[35]!==m||e[36]!==d?(z=t.jsx("div",{className:"relative min-h-0 flex-1",children:f?t.jsx(he,{file:f}):d?t.jsx(Ee,{}):t.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[t.jsx(E,{filename:m,className:"h-7.5 w-6"}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"This file is no longer available."})]})}),e[34]=f,e[35]=m,e[36]=d,e[37]=z):z=e[37];let D;return e[38]!==F||e[39]!==z||e[40]!==v?(D=t.jsxs("div",{className:v,children:[F,z]}),e[38]=F,e[39]=z,e[40]=v,e[41]=D):D=e[41],D}function Zt(l){const e=C.c(21),{skillPath:s,onClose:n}=l,i=ie(s),{volume:o,dirPath:a}=i,c=be(),r=c(o??"",`${a}/SKILL.md`),d=_.fileText(r);let u;e[0]!==r?(u=async()=>{const P=await fetch(r,{credentials:"include"});if(!P.ok)throw new Error(`fetch failed: ${P.status}`);return P.text()},e[0]=r,e[1]=u):u=e[1];let f;e[2]!==d||e[3]!==u?(f={queryKey:d,queryFn:u,staleTime:6e4,retry:!1},e[2]=d,e[3]=u,e[4]=f):f=e[4];const m=M(f),x=Re(o??"",a);let y;e[5]!==a?(y=T(a),e[5]=a,e[6]=y):y=e[6];const g=y;let p;e[7]!==m.data?(p=m.data?Ke(m.data):null,e[7]=m.data,e[8]=p):p=e[8];const h=p,v=es;let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=(P,G)=>v(P.path)?-1:v(G.path)?1:T(P.path).localeCompare(T(G.path)),e[9]=w):w=e[9];const k=(x.data??[]).filter(Jt).sort(w),[j,N]=R.useState(null),$=j===null?null:k.find(P=>P.path===j)??null;let S;e[10]!==n?(S=P=>{P||n()},e[10]=n,e[11]=S):S=e[11];let F;e[12]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t.jsx(Ae,{size:18})}),e[12]=F):F=e[12];const z=h?.name??g;let D;e[13]!==z?(D=t.jsx(me,{className:"flex-1 truncate text-base font-medium text-foreground",children:z}),e[13]=z,e[14]=D):D=e[14];let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(dt,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:t.jsx(wt,{size:16})})}),e[15]=b):b=e[15];let O;e[16]!==D?(O=t.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[F,D,b]}),e[16]=D,e[17]=O):O=e[17];let B;e[18]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx("p",{className:"px-2 py-1.5 text-sm font-medium text-foreground",children:"Files"}),e[18]=B):B=e[18];const Ge="relative flex min-w-0 flex-1 flex-col overflow-y-auto",re=$?t.jsx(he,{file:{key:$.path,filename:T($.path),size:$.size,downloadUrl:c(o??"",$.path)}}):m.isPending?t.jsxs("div",{className:"flex flex-col gap-2 p-6",children:[t.jsx(V,{className:"h-4 w-1/3"}),t.jsx(V,{className:"h-3 w-full"}),t.jsx(V,{className:"h-3 w-5/6"}),t.jsx(V,{className:"h-3 w-2/3"})]}):m.isError||!h?t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This skill is no longer available."}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-col gap-4 border-b border-border p-6",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Description"}),t.jsx("p",{className:"text-base text-muted-foreground",children:h.description??"Claude Code skill"})]}),t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-6",children:t.jsx(xt,{id:`skill-preview-${s}`,text:h.body})})]});let Z;return e[19]!==re?(Z=t.jsx("div",{className:Ge,children:re}),e[19]=re,e[20]=Z):Z=e[20],t.jsx(fe,{open:!0,onOpenChange:S,children:t.jsxs(ue,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",closeButtonClassName:"hidden",children:[O,t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("div",{className:"flex w-[220px] shrink-0 flex-col gap-1 overflow-y-auto border-r border-border bg-muted p-3",children:[B,x.isPending?t.jsx(V,{className:"mx-2 h-4 w-24"}):k.map(P=>{const G=v(P.path)?$===null:j===P.path;return t.jsxs("button",{type:"button",onClick:()=>N(v(P.path)?null:P.path),className:ee("flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left",G?"bg-background shadow-sm":"hover:bg-muted/60"),children:[t.jsx(E,{filename:T(P.path),className:"h-6 w-5 shrink-0"}),t.jsx("span",{className:ee("truncate text-sm",G?"text-foreground":"text-muted-foreground"),children:T(P.path)})]},P.path)})]}),Z]})]})})}function Jt(l){return l.kind==="file"}function es(l){return T(l)==="SKILL.md"}const Ve=[{id:"home",description:"Your organization's home folder",glyph:Je},{id:"uploads",description:"Files your team uploads",glyph:Pe},{id:"outputs",description:"Agent run outputs",glyph:tt}],Ce=3;function I(l){const e=C.c(2),{children:s}=l;let n;return e[0]!==s?(n=t.jsx("p",{className:"text-[13px] text-foreground",children:s}),e[0]=s,e[1]=n):n=e[1],n}function L(l){const e=C.c(2),{children:s}=l;let n;return e[0]!==s?(n=t.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:s}),e[0]=s,e[1]=n):n=e[1],n}function we(l){const e=C.c(2),{rows:s}=l,n=s===void 0?1:s;let i;return e[0]!==n?(i=t.jsx(L,{children:Array.from({length:n*3},ts)}),e[0]=n,e[1]=i):i=e[1],i}function ts(l,e){return t.jsx(V,{className:"h-16 rounded-2xl"},e)}function ve(l){const e=C.c(2),{children:s}=l;let n;return e[0]!==s?(n=t.jsx("p",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=n):n=e[1],n}function ss(l){const e=C.c(6),{volume:s,displayName:n,description:i,glyph:o,onOpen:a}=l,c=Ct(s),r=n??s,d=c.data?`${c.data.files} files`:void 0;let u;return e[0]!==i||e[1]!==o||e[2]!==a||e[3]!==r||e[4]!==d?(u=t.jsx(ne,{name:r,meta:d,subtitle:i,glyph:o,onOpen:a}),e[0]=i,e[1]=o,e[2]=a,e[3]=r,e[4]=d,e[5]=u):u=e[5],u}function ls(l){const e=C.c(8),{segments:s,onNavigate:n}=l;let i;e[0]!==n?(i=t.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground hover:underline",onClick:()=>n(""),children:"Library"}),e[0]=n,e[1]=i):i=e[1];let o;e[2]!==n||e[3]!==s?(o=s.map((c,r)=>{const d=s.slice(0,r+1).join("/"),u=r===s.length-1;return t.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[t.jsx(We,{size:12,className:"shrink-0 text-muted-foreground"}),u?t.jsx("span",{className:"truncate font-medium text-foreground",children:c}):t.jsx("button",{type:"button",className:"truncate text-muted-foreground hover:text-foreground hover:underline",onClick:()=>n(d),children:c})]},d)}),e[2]=n,e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==i||e[6]!==o?(a=t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1 text-sm",children:[i,o]}),e[5]=i,e[6]=o,e[7]=a):a=e[7],a}function ns(l){const e=C.c(19),{onOpenDir:s,onOpenFile:n,onDelete:i}=l,{org:o}=A(),a=St(),c=Le(),r=be();let d;if(e[0]!==r||e[1]!==i||e[2]!==s||e[3]!==n||e[4]!==o||e[5]!==c.data?.length||e[6]!==a.data||e[7]!==a.isPending){const u=a.data??[],f=u.slice(0,Ce),m=u.slice(Ce);let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(I,{children:"Folders"}),e[9]=x):x=e[9];let y;e[10]!==s||e[11]!==o?(y=Ve.map(h=>t.jsx(ss,{volume:h.id,displayName:h.id==="home"?kt(o.slug):void 0,description:h.description,glyph:h.glyph,onOpen:()=>s(h.id)},h.id)),e[10]=s,e[11]=o,e[12]=y):y=e[12];let g;e[13]!==s||e[14]!==c.data?.length?(g=(c.data?.length??0)>0&&t.jsx(ne,{name:"public",meta:`${c.data?.length} sets`,subtitle:"Curated skill sets — read-only",glyph:Ye,readOnly:!0,onOpen:()=>s("public")}),e[13]=s,e[14]=c.data?.length,e[15]=g):g=e[15];let p;e[16]!==y||e[17]!==g?(p=t.jsxs("div",{className:"flex flex-col gap-3",children:[x,t.jsxs(L,{children:[y,g]})]}),e[16]=y,e[17]=g,e[18]=p):p=e[18],d=t.jsxs(t.Fragment,{children:[a.isPending?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(I,{children:"Recently added"}),t.jsx(we,{})]}):f.length>0?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(I,{children:"Recently added"}),t.jsx(L,{children:f.map(h=>t.jsx(Xt,{filename:T(h.path),updatedAt:h.updatedAt,size:h.size,downloadUrl:r(h.volume,h.path),onOpen:()=>n(`${h.volume}/${h.path}`),onDelete:()=>i({volume:h.volume,path:h.path,kind:"file"})},`${h.volume}/${h.path}`))})]}):t.jsx(ve,{children:"No files yet — upload one, or ask an agent to produce something."}),p,m.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(I,{children:"All files"}),t.jsx(L,{children:m.map(h=>t.jsx(He,{filename:T(h.path),updatedAt:h.updatedAt,downloadUrl:r(h.volume,h.path),onOpen:()=>n(`${h.volume}/${h.path}`),onDelete:()=>i({volume:h.volume,path:h.path,kind:"file"})},`${h.volume}/${h.path}`))})]})]}),e[0]=r,e[1]=i,e[2]=s,e[3]=n,e[4]=o,e[5]=c.data?.length,e[6]=a.data,e[7]=a.isPending,e[8]=d}else d=e[8];return d}function is(l){const e=C.c(11),{onOpenDir:s}=l,n=Le();if(n.isPending){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(we,{}),e[0]=r):r=e[0],r}let i;e[1]!==n.data?(i=n.data??[],e[1]=n.data,e[2]=i):i=e[2];const o=i;if(o.length===0){let r;return e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ve,{children:"No public skill sets are configured."}),e[3]=r):r=e[3],r}let a;if(e[4]!==s||e[5]!==o){let r;e[7]!==s?(r=d=>t.jsx(ne,{name:d,subtitle:"Read-only",readOnly:!0,onOpen:()=>s(`public/${d}`)},d),e[7]=s,e[8]=r):r=e[8],a=o.map(r),e[4]=s,e[5]=o,e[6]=a}else a=e[6];let c;return e[9]!==a?(c=t.jsx(L,{children:a}),e[9]=a,e[10]=c):c=e[10],c}function rs(l){const e=C.c(25),{location:s,onOpenDir:n,onOpenFile:i,onOpenSkill:o,onDelete:a}=l,c=s.volume??"",r=Re(c,s.dirPath),d=be();if(r.isPending){let g;return e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(we,{rows:2}),e[0]=g):g=e[0],g}if(r.isError){const g=r.error instanceof Error?r.error.message:"Failed to load";let p;return e[1]!==g?(p=t.jsx("p",{className:"text-sm text-destructive",children:g}),e[1]=g,e[2]=p):p=e[2],p}let u,f,m,x;if(e[3]!==d||e[4]!==r.data||e[5]!==s||e[6]!==a||e[7]!==n||e[8]!==i||e[9]!==o||e[10]!==c){x=Symbol.for("react.early_return_sentinel");e:{const g=r.data??[],p=g.filter(cs),h=g.filter(as),v=g.filter(os);if(g.length===0){const j=s.readOnly?"Empty — this read-only set syncs from its GitHub source.":"Empty folder — upload a file or create a folder to get started.";let N;e[15]!==j?(N=t.jsx(ve,{children:j}),e[15]=j,e[16]=N):N=e[16],x=N;break e}let w;e[17]!==s.readOnly||e[18]!==a||e[19]!==c?(w=j=>s.readOnly?void 0:()=>a({volume:c,path:j.path,kind:j.kind}),e[17]=s.readOnly,e[18]=a,e[19]=c,e[20]=w):w=e[20];const k=w;u=p.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(I,{children:"Skills"}),t.jsx(L,{children:p.map(j=>t.jsx(qt,{dirName:T(j.path),updatedAt:j.updatedAt,skillMdUrl:d(c,`${j.path}/SKILL.md`),onOpen:()=>o(J(s,j.path)),onBrowse:()=>n(J(s,j.path)),onDelete:k(j)},j.path))})]}),f=h.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(I,{children:"Folders"}),t.jsx(L,{children:h.map(j=>t.jsx(ne,{name:T(j.path),meta:te(j.updatedAt),readOnly:s.readOnly,onOpen:()=>n(J(s,j.path)),onDelete:k(j)},j.path))})]}),m=v.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(I,{children:"Files"}),t.jsx(L,{children:v.map(j=>t.jsx(He,{filename:T(j.path),updatedAt:j.updatedAt,downloadUrl:d(c,j.path),onOpen:()=>i(J(s,j.path)),onDelete:k(j)},j.path))})]})}e[3]=d,e[4]=r.data,e[5]=s,e[6]=a,e[7]=n,e[8]=i,e[9]=o,e[10]=c,e[11]=u,e[12]=f,e[13]=m,e[14]=x}else u=e[11],f=e[12],m=e[13],x=e[14];if(x!==Symbol.for("react.early_return_sentinel"))return x;let y;return e[21]!==u||e[22]!==f||e[23]!==m?(y=t.jsxs(t.Fragment,{children:[u,f,m]}),e[21]=u,e[22]=f,e[23]=m,e[24]=y):y=e[24],y}function os(l){return l.kind==="file"}function as(l){return l.kind==="dir"&&!l.hasSkill}function cs(l){return l.kind==="dir"&&l.hasSkill}function Se(){const{org:l}=A(),e=Fe(),s=De(),n=Te(),i=ze({strict:!1}),o=i.path??"",a=ie(o),c=a.segments.length===0,r=(b,O)=>s({to:".",search:B=>({...B,[b]:O||void 0})}),d=b=>r("path",b),u=b=>r("preview",b),f=b=>r("skill",b),[m,x]=R.useState(null),[y,g]=R.useState(!1),[p,h]=R.useState(""),v=R.useRef(null),w=a.readOnly?null:a.volume??"uploads",k=a.volume?a.dirPath:"",{upload:j,mkdir:N}=ke(w??"uploads"),{remove:$}=ke(m?.volume??"uploads");async function S(b){if(!(!w||!b||b.length===0))try{await j.mutateAsync({dir:k,files:[...b]}),H.success(b.length===1?`Uploaded ${b[0]?.name}`:`Uploaded ${b.length} files`)}catch(O){H.error(O instanceof Error?O.message:"Upload failed")}finally{v.current&&(v.current.value="")}}async function F(){const b=p.trim();if(!(!w||!b))try{await N.mutateAsync(k?`${k}/${b}`:b),H.success(`Folder "${b}" created`),g(!1),h("")}catch(O){H.error(O instanceof Error?O.message:"Failed to create folder")}}async function z(){if(!m)return;const b=m;try{await $.mutateAsync(b.path),H.success(`Deleted ${T(b.path)}`)}catch(O){H.error(O instanceof Error?O.message:"Delete failed")}finally{x(null)}}function D(){for(const b of Ve)e.invalidateQueries({queryKey:_.orgFsVolume(l.id,b.id)});a.volume&&e.invalidateQueries({queryKey:_.orgFsVolume(l.id,a.volume)}),e.invalidateQueries({queryKey:_.orgFsRecent(l.id)}),e.invalidateQueries({queryKey:_.orgFsPublicSets(l.id)})}return t.jsxs("div",{className:"h-full overflow-y-auto",children:[t.jsxs("div",{className:"mx-auto flex w-full max-w-[900px] flex-col gap-10 px-6 py-10 lg:px-10",children:[t.jsxs("div",{className:"flex flex-col gap-2",children:[!c&&t.jsx(ls,{segments:a.segments,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h1",{className:"min-w-0 flex-1 truncate text-xl font-medium text-foreground",children:c?"Library":a.segments.at(-1)??"Library"}),t.jsx(U,{variant:"ghost",size:"icon",onClick:D,"aria-label":"Refresh",children:t.jsx(Xe,{size:14})}),!c&&w&&t.jsxs(U,{variant:"outline",size:"sm",onClick:()=>g(!0),children:[t.jsx(et,{size:14}),"New folder"]}),a.readOnly?t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[t.jsx(Oe,{size:12}),"Read-only"]}):t.jsxs(U,{size:"sm",disabled:j.isPending,onClick:()=>v.current?.click(),children:[t.jsx(Pe,{size:14}),j.isPending?"Uploading…":"Upload file"]}),t.jsx("input",{ref:v,type:"file",multiple:!0,className:"hidden",onChange:b=>{S(b.target.files)}})]})]}),c?t.jsx(ns,{onOpenDir:d,onOpenFile:u,onDelete:x}):a.volume===null?t.jsx(is,{onOpenDir:d}):t.jsx(rs,{location:a,onOpenDir:d,onOpenFile:u,onOpenSkill:f,onDelete:x},a.volume)]}),i.preview?n&&t.jsx(Wt,{previewPath:i.preview,onClose:()=>r("preview",null)}):i.skill?t.jsx(Zt,{skillPath:i.skill,onClose:()=>r("skill",null)},i.skill):null,t.jsx(fe,{open:y,onOpenChange:g,children:t.jsxs(ue,{children:[t.jsxs(ft,{children:[t.jsx(me,{children:"New folder"}),t.jsxs(ut,{children:["Create a folder in ",o||"the library","."]})]}),t.jsx(ht,{autoFocus:!0,placeholder:"folder-name",value:p,onChange:b=>h(b.target.value),onKeyDown:b=>{b.key==="Enter"&&F()}}),t.jsxs(mt,{children:[t.jsx(U,{variant:"outline",onClick:()=>g(!1),children:"Cancel"}),t.jsx(U,{disabled:!p.trim()||N.isPending,onClick:()=>{F()},children:"Create"})]})]})}),t.jsx(st,{open:m!==null,onOpenChange:b=>{b||x(null)},children:t.jsxs(lt,{children:[t.jsxs(nt,{children:[t.jsxs(it,{children:["Delete ",m?T(m.path):"","?"]}),t.jsx(rt,{children:m?.kind==="dir"?"The folder and everything inside it will be deleted for the whole organization. Sandboxes see this change within seconds.":"The file will be deleted for the whole organization. Sandboxes see this change within seconds."})]}),t.jsxs(ot,{children:[t.jsx(at,{children:"Cancel"}),t.jsx(ct,{onClick:()=>{z()},children:"Delete"})]})]})})]})}function Ms(){const l=C.c(13),e=Te(),s=De();let n;l[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},l[0]=n):n=l[0];const o=ze(n).preview;let a;l[1]!==o?(a=o?T(o):"",l[1]=o,l[2]=a):a=l[2];const c=a;let r;l[3]!==s?(r=()=>s({to:".",search:ds}),l[3]=s,l[4]=r):r=l[4];const d=r;if(e){let x;return l[5]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden bg-background",children:t.jsx(ae,{children:t.jsx(Se,{})})}),l[5]=x):x=l[5],x}let u;l[6]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ne,{order:1,minSize:30,defaultSize:55,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:t.jsx(ae,{children:t.jsx(Se,{})})})})}),l[6]=u):u=l[6];let f;l[7]!==d||l[8]!==c||l[9]!==o?(f=o&&t.jsxs(t.Fragment,{children:[t.jsx(pt.Tabs,{children:t.jsx(gt,{title:c,icon:{kind:"component",Component:x=>t.jsx(E,{filename:c,...x})},active:!0,onClick:d})}),t.jsx(jt,{className:"bg-sidebar"}),t.jsx(Ne,{order:2,minSize:25,defaultSize:45,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:t.jsx(ae,{children:t.jsx(Yt,{previewPath:o,onClose:d})})})})})]}),l[7]=d,l[8]=c,l[9]=o,l[10]=f):f=l[10];let m;return l[11]!==f?(m=t.jsxs(yt,{direction:"horizontal",className:"min-h-0 flex-1 pt-0 pr-1 pb-1 pl-0",children:[u,f]}),l[11]=f,l[12]=m):m=l[12],m}function ds(l){return{...l,preview:void 0}}export{Ms as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{dW as se,e as I,j as o,B as te,l as Yt,b1 as We,dX as Gs,r as X,q as oe,c as $,g as Qs,F as Zt,dY as Nt,dZ as es,o as Ys,v as Zs,d_ as en,d$ as tn}from"./index-DHt9Mf9G.js";import{D as sn,F as nn,B as on}from"./index-DfrAcw3c.js";import{h as De,i as rn,u as ae}from"./constants-C-D4Pmy6.js";import{a as ts}from"./use-virtual-mcp-Rn9fsUNN.js";import{M as Oe}from"./monaco-editor-637MBJHf.js";import{b as ln,R as zt,a as cn}from"./resizable-B9nPHbdY.js";import{B as le}from"./badge-CnPW-GqK.js";import{b as xt,d as ht,c as Ze,a as gt,S as bt}from"./select-BISzCSVs.js";import{S as et}from"./spinner-CXR5LEFP.js";import{V as an}from"./view-mode-toggle-7zw5kq-m.js";import{ah as un,o as dn,i as fn,y as ss,ai as mn,a2 as pn,s as xn,aj as ns,a8 as hn,M as os,ak as gn,al as bn,a4 as ft,am as jn}from"./agent-icon-CEtrmBbc.js";import{i as rs}from"./Play-sw2az4p0.js";import{b as Sn,a as yn,V as Ge}from"./layout-C3II9QQW.js";import{c as is,b as ls,T as cs,a as as}from"./tooltip-DY1LX4fr.js";import{u as wn,a as vn}from"./use-connection-BAOUEhf6.js";import{u as kt,d as It,b as us}from"./use-mcp-tools-ftOL48Fr.js";import{b as Nn,c as kn,e as In,d as _n,a as Cn,D as Tn}from"./dialog-m1msdckr.js";import"./index-DLIj-Jcg.js";import{N as En,m as $n,n as On,o as Ke,P as Mn,i as Rn,R as Ln,u as zn,p as Wn,e as Wt,d as An,q as Pn,S as Dn}from"./scroll-area-DVU-pYpl.js";import{S as Fn}from"./index-ChQwZqpG.js";import{H as Vn,a as qn,b as Hn}from"./hover-card-BagBBHwl.js";import{D as ds,a as fs,b as ms,c as Qe}from"./dropdown-menu-BXhpM-R_.js";import{s as Un}from"./Plus-dxS60FPA.js";import{b as ps}from"./Tool01-CBtpfChg.js";import{i as Fe}from"./Check-DwRXhDYN.js";import{s as _t}from"./XClose-C8XjR0Oj.js";import{I as Ct}from"./integration-icon-D5ZAVm0g.js";import{A as Kn,c as Bn,a as Xn,b as Jn}from"./accordion-7Hq31-jA.js";import"./index-Dla-fDpI.js";import{i as xs}from"./X-D96et_XK.js";import{u as hs,a as Gn}from"./use-collections-ZGWkQryR.js";import{E as gs}from"./empty-state-BXMuvewe.js";import{c as Qn}from"./create-sse-subscription-BS5983N4.js";import{I as At}from"./input-D2dMhViX.js";const bs=se("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const js=se("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const tt=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const st=se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Yn=se("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ss=se("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Zn=se("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const ys=se("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const ws=se("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const vs=se("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const eo=se("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ns=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const ks=se("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const to=se("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const Is=se("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function so(t){const e=I.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(un,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(Yt,{size:14,className:"animate-spin"}):o.jsx(dn,{size:14}),e[5]=r,e[6]=m):m=e[6];let p;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(p=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=p):p=e[11];let x;return e[12]!==f||e[13]!==p?(x=o.jsxs(o.Fragment,{children:[f,p]}),e[12]=f,e[13]=p,e[14]=x):x=e[14],x}const Pt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(p=>p(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Tt=(t=>t?Pt(t):Pt),no=t=>t;function jt(t,e=no){const n=We.useSyncExternalStore(t.subscribe,We.useCallback(()=>e(t.getState()),[t,e]),We.useCallback(()=>e(t.getInitialState()),[t,e]));return We.useDebugValue(n),n}const oo=t=>{const e=Tt(t),n=s=>jt(e,s);return Object.assign(n,e),n},ro=(t=>oo);function _s(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const St=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return St(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return St(s)(n)}}}},io=(t,e)=>(n,s,i)=>{let r={storage:_s(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const p=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>p;let x;const h=()=>{var g,b;if(!d)return;const S=++c;l=!1,a.forEach(y=>{var j;return y((j=s())!=null?j:p)});const w=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:p))||void 0;return St(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const j=r.migrate(y.state,y.version);return j instanceof Promise?j.then(v=>[!0,v]):[!0,j]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var j;if(S!==c)return;const[v,N]=y;if(x=r.merge(N,(j=s())!=null?j:p),n(x,!0),v)return f()}).then(()=>{S===c&&(w?.(s(),void 0),x=s(),l=!0,u.forEach(y=>y(x)))}).catch(y=>{S===c&&w?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),x||p},Cs=io,{useSyncExternalStoreWithSelector:lo}=Gs,co=t=>t;function ao(t,e=co,n){const s=lo(t.subscribe,t.getState,t.getInitialState,e,n);return We.useDebugValue(s),s}const Dt=t=>Symbol.iterator in t,Ft=t=>"entries"in t,Vt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},uo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function fo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Dt(t)&&Dt(e)?Ft(t)&&Ft(e)?Vt(t,e):uo(t,e):Vt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Ts(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
|
|
1
|
+
import{dW as se,e as I,j as o,B as te,l as Yt,b1 as We,dX as Gs,r as X,q as oe,c as $,g as Qs,F as Zt,dY as Nt,dZ as es,o as Ys,v as Zs,d_ as en,d$ as tn}from"./index-Dpo5EC2L.js";import{D as sn,F as nn,B as on}from"./index-DHRRSUmw.js";import{h as De,i as rn,u as ae}from"./constants-DcPOVd9N.js";import{a as ts}from"./use-virtual-mcp-CJt6reVB.js";import{M as Oe}from"./monaco-editor-0uL_TQZd.js";import{b as ln,R as zt,a as cn}from"./resizable-0Wn5JpiT.js";import{B as le}from"./badge-793iqcSm.js";import{b as xt,d as ht,c as Ze,a as gt,S as bt}from"./select-BcoiasFF.js";import{S as et}from"./spinner-D1gJYDcd.js";import{V as an}from"./view-mode-toggle-COafKFpZ.js";import{ah as un,o as dn,i as fn,y as ss,ai as mn,a2 as pn,s as xn,aj as ns,a8 as hn,M as os,ak as gn,al as bn,a4 as ft,am as jn}from"./agent-icon-DqIYS1ir.js";import{i as rs}from"./Play-m26DvF8I.js";import{b as Sn,a as yn,V as Ge}from"./layout-D67abH6w.js";import{c as is,b as ls,T as cs,a as as}from"./tooltip-CnTONKZv.js";import{u as wn,a as vn}from"./use-connection-DHFQC4eq.js";import{u as kt,d as It,b as us}from"./use-mcp-tools-DO4I7PYX.js";import{b as Nn,c as kn,e as In,d as _n,a as Cn,D as Tn}from"./dialog-BTuyAnJD.js";import"./index-BRntdJGH.js";import{N as En,m as $n,n as On,o as Ke,P as Mn,i as Rn,R as Ln,u as zn,p as Wn,e as Wt,d as An,q as Pn,S as Dn}from"./scroll-area-JdApnymr.js";import{S as Fn}from"./index-C5ZyXQHr.js";import{H as Vn,a as qn,b as Hn}from"./hover-card-CV9VXkH7.js";import{D as ds,a as fs,b as ms,c as Qe}from"./dropdown-menu-Ci4-mVLy.js";import{s as Un}from"./Plus-zYQzJd1M.js";import{b as ps}from"./Tool01-Blh-dWzw.js";import{i as Fe}from"./Check-_9fGuqcU.js";import{s as _t}from"./XClose-C-93XSA0.js";import{I as Ct}from"./integration-icon-DZLuTxs6.js";import{A as Kn,c as Bn,a as Xn,b as Jn}from"./accordion-CBzWT5bz.js";import"./index-c6-XkL5H.js";import{i as xs}from"./X-C7X3rsvo.js";import{u as hs,a as Gn}from"./use-collections-C6vSjty8.js";import{E as gs}from"./empty-state-CeClTvy4.js";import{c as Qn}from"./create-sse-subscription-BS5983N4.js";import{I as At}from"./input-DdFNzbfV.js";const bs=se("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const js=se("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const tt=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const st=se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Yn=se("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ss=se("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Zn=se("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const ys=se("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const ws=se("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const vs=se("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const eo=se("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ns=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const ks=se("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const to=se("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const Is=se("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function so(t){const e=I.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(un,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(Yt,{size:14,className:"animate-spin"}):o.jsx(dn,{size:14}),e[5]=r,e[6]=m):m=e[6];let p;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(p=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=p):p=e[11];let x;return e[12]!==f||e[13]!==p?(x=o.jsxs(o.Fragment,{children:[f,p]}),e[12]=f,e[13]=p,e[14]=x):x=e[14],x}const Pt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(p=>p(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Tt=(t=>t?Pt(t):Pt),no=t=>t;function jt(t,e=no){const n=We.useSyncExternalStore(t.subscribe,We.useCallback(()=>e(t.getState()),[t,e]),We.useCallback(()=>e(t.getInitialState()),[t,e]));return We.useDebugValue(n),n}const oo=t=>{const e=Tt(t),n=s=>jt(e,s);return Object.assign(n,e),n},ro=(t=>oo);function _s(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const St=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return St(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return St(s)(n)}}}},io=(t,e)=>(n,s,i)=>{let r={storage:_s(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const p=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>p;let x;const h=()=>{var g,b;if(!d)return;const S=++c;l=!1,a.forEach(y=>{var j;return y((j=s())!=null?j:p)});const w=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:p))||void 0;return St(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const j=r.migrate(y.state,y.version);return j instanceof Promise?j.then(v=>[!0,v]):[!0,j]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var j;if(S!==c)return;const[v,N]=y;if(x=r.merge(N,(j=s())!=null?j:p),n(x,!0),v)return f()}).then(()=>{S===c&&(w?.(s(),void 0),x=s(),l=!0,u.forEach(y=>y(x)))}).catch(y=>{S===c&&w?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),x||p},Cs=io,{useSyncExternalStoreWithSelector:lo}=Gs,co=t=>t;function ao(t,e=co,n){const s=lo(t.subscribe,t.getState,t.getInitialState,e,n);return We.useDebugValue(s),s}const Dt=t=>Symbol.iterator in t,Ft=t=>"entries"in t,Vt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},uo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function fo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Dt(t)&&Dt(e)?Ft(t)&&Ft(e)?Vt(t,e):uo(t,e):Vt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Ts(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
|
|
2
2
|
${Object.entries(l).map(([u,d])=>{const f=c.has(u)?"":"?";return`${d.description?` /** ${d.description} */
|
|
3
3
|
`:""} ${u}${f}: ${n(d)};`}).join(`
|
|
4
4
|
`)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bv as _}from"./index-
|
|
1
|
+
import{bv as _}from"./index-Dpo5EC2L.js";var S={exports:{}},r={};var $;function I(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function C(){return v||(v=1,S.exports=I()),S.exports}var g=C();const h=_(g);export{h as R,g as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as le,r as K,f as bt,q as Be,j as t,B as Z,o as Ce,c as ce,K as it,n as yt,v as rs,d as ls,t as xt,E as os}from"./index-
|
|
1
|
+
import{e as le,r as K,f as bt,q as Be,j as t,B as Z,o as Ce,c as ce,K as it,n as yt,v as rs,d as ls,t as xt,E as os}from"./index-Dpo5EC2L.js";import{S as as}from"./search-input-BAlo7hPY.js";import{P as Me}from"./index-DVzdQ0e0.js";import{E as wt}from"./empty-state-DtzOtYNQ.js";import{R as ns}from"./require-capability-BSwqUQcE.js";import{B as rt}from"./badge-793iqcSm.js";import{P as ct,a as dt,b as mt}from"./popover-C68whzsY.js";import{b as Ze,T as et,a as tt}from"./tooltip-CnTONKZv.js";import{i as ft}from"./Check-_9fGuqcU.js";import{a as Xe}from"./Eye-MExi_r3W.js";import{n as Mt}from"./Globe01-Dv5kpprP.js";import{i as Vt}from"./FilterLines-4rC1xrIb.js";import{i as is}from"./Key01-CjH_GA8o.js";import{i as cs}from"./Play-m26DvF8I.js";import{a7 as ds,a8 as ms,P as us,E as xs}from"./agent-icon-DqIYS1ir.js";import{M as _t}from"./monaco-editor-0uL_TQZd.js";import{u as fs}from"./use-members-WKgQqTSP.js";import{u as Dt}from"./use-connection-DHFQC4eq.js";import{S as St,u as It,W as ps}from"./constants-DcPOVd9N.js";import{a as hs}from"./use-virtual-mcp-CJt6reVB.js";import{n as Qe}from"./Container-I8CLKgQT.js";import{c as gs}from"./SwitchHorizontal01-DtrvJRJv.js";import{s as js}from"./Plus-zYQzJd1M.js";import{s as vs}from"./Trash01-BtO3xPfa.js";import{I as Ge}from"./input-DdFNzbfV.js";import{g as Ns,b as Lt,f as st,a as Ut,c as pt,d as bs,e as Ft,h as Kt,A as ys,T as ws,i as Ss,M as ht}from"./automation-runs-CWg3SAkQ.js";import{S as lt,a as ot,b as at,c as Fe,d as nt}from"./select-BcoiasFF.js";import{S as Is}from"./scroll-area-JdApnymr.js";import{t as qt}from"./ChevronDown-D8ki1YTV.js";import{C as Cs}from"./calendar-BcwgSBqk.js";import{T as ks}from"./textarea-Dlde-1OC.js";import{C as Bt}from"./collection-tabs-FGkin6ZU.js";import{S as Ts}from"./switch-NrMSEE-I.js";import{L as Ms}from"./label-e4yRWBjb.js";import{I as qe}from"./integration-icon-DZLuTxs6.js";import{A as Ht}from"./avatar-Ht4phHyw.js";import{A as _s,a as Ds,b as Ls}from"./alert-DQ3f-8ft.js";import{C as Jt}from"./card-Bp1tvcjx.js";import{K as ke}from"./monitoring-stats-row-GIY4z6nm.js";import{g as Fs}from"./connection-slug-eyAPH6o3.js";import{u as $s}from"./useSuspenseInfiniteQuery-DZbKMeAX.js";import{d as Rs,S as Os,a as zs,b as Es}from"./sheet-BtJYdh0l.js";import{T as De,a as ut,b as Gt,c as Qt,d as Wt,e as oe}from"./table-HsedM5wi.js";import{n as Ps}from"./ChevronUp-DWIsv9KU.js";import{u as As}from"./use-infinite-scroll-rNa7__7x.js";import{c as Vs,b as Us}from"./use-automations-wbB32tlZ.js";import"./SearchMd-DeMPnpHH.js";import"./sidebar-DA2nzz_x.js";import"./use-capability-BgKTO1vN.js";import"./access-gate-baJeia1A.js";import"./capability-load-error-C5U_XP-e.js";import"./AlertCircle-CQVrG_vJ.js";import"./Tool01-Blh-dWzw.js";import"./RefreshCcw01-D0f_Eh8k.js";import"./XCircle-28kRMNtc.js";import"./ArrowUpRight-RSgKJAKz.js";import"./ZapSquare-C0D82h8r.js";import"./Users03-BpVRJS2k.js";import"./CheckCircle-BrIielg3.js";import"./ChevronLeft-Bn25DZii.js";import"./ChevronRight-sANym5JO.js";import"./DotsVertical-UEiFsiMu.js";import"./ZoomOut-DsFvQG0e.js";import"./Star01-DxtsQeOL.js";import"./Palette-BKIsz_ok.js";import"./HardDrive-D9IQyxX5.js";import"./Stars02-CFg4uA06.js";import"./LinkExternal01-Bh2jIX62.js";import"./Monitor01-A1_9QQaN.js";import"./Sun-prsTZZ-c.js";import"./Settings02-TwTRrSvQ.js";import"./Shield01-CohVSmIO.js";import"./Stars01-oKRH_HZK.js";import"./Upload01-DuGEhzNC.js";import"./User01-Cbs3uEng.js";import"./Users01-D1iLhJqh.js";import"./XClose-C-93XSA0.js";import"./X-C7X3rsvo.js";import"./Zap-Dv5TVml0.js";import"./index-sKMKGB16.js";import"./spinner-D1gJYDcd.js";import"./use-org-auth-client-DY5JwLAM.js";import"./use-collections-C6vSjty8.js";import"./useInfiniteQuery-BQyXdojd.js";import"./infiniteQueryObserver-Ykg8iLnd.js";import"./task-status-DwULjc9j.js";import"./checkbox-DjyXVlr3.js";import"./command-HR08HRGs.js";import"./index-DjxxQl8A.js";import"./dialog-BTuyAnJD.js";import"./pair-DywksGK8.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-zJQ-7Mci.js";import"./file-type-icon-Dj99fHuB.js";import"./content-blocks-o63cs2vh.js";import"./types-Cy_Ngnr7.js";import"./chat-context-2VONJLj0.js";import"./tab-id-Bd9aEZGd.js";import"./decopilot-sse-pool-C7otyoNt.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-ai-providers-Dc4GEqMk.js";import"./use-organization-settings-pl01D-rl.js";import"./shell-layout-0P_-b-nq.js";import"./required-auth-layout-2LAJNWxM.js";import"./useRouterState-D3ymnfxm.js";import"./use-org-sso-C5ckgDRh.js";import"./use-navigate-to-agent-k6jWIqgZ.js";import"./use-mcp-prompts-B_UVPJoG.js";import"./form-BBZRauXH.js";import"./index-BRntdJGH.js";const vt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Le(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),l=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${l}`}).join(",")}function Ks(s){return s?s.split(",").map(e=>{const[r,l,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:l||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
|
|
2
2
|
`)}function $t(s){return s.trim()?s.split(`
|
|
3
3
|
`).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[r,...l]=e.split("=");return{key:r||"",operator:"eq",value:l.join("=")}}if(e.includes("~")){const[r,...l]=e.split("~");return{key:r||"",operator:"contains",value:l.join("~")}}if(e.includes("@")){const[r,...l]=e.split("@");return{key:r||"",operator:"in",value:l.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function qs(s){const e={},r={},l=[],a={};for(const o of s)if(o.key.trim())switch(o.operator){case"eq":o.value&&(e[o.key]=o.value);break;case"contains":o.value&&(r[o.key]=`%${o.value}%`);break;case"exists":l.push(o.key);break;case"in":o.value&&(a[o.key]=o.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(r).length>0?r:void 0,propertyKeys:l.length>0?l:void 0,propertyInValues:Object.keys(a).length>0?a:void 0}}function Rt(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};if(typeof s._decocms_truncated=="string")return{content:s._decocms_truncated,isTruncated:!0,originalSize:s._decocms_truncated.length};const e=JSON.stringify(s,null,2),r=e.length;return r<=vt.maxJsonRenderSize?{content:e,isTruncated:!1,originalSize:r}:{content:e.slice(0,vt.maxJsonRenderSize)+`
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as z,a as G,D as H,h as J,j as Q}from"./scroll-area-
|
|
1
|
+
import{P as z,a as G,D as H,h as J,j as Q}from"./scroll-area-JdApnymr.js";function V(x){var l;const{char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:j,$position:v}=x,B=b&&!P,y=Q(D),F=new RegExp(`\\s${y}$`),h=j?"^":"",M=P?"":y,N=B?new RegExp(`${h}${y}.*?(?=\\s${M}|$)`,"gm"):new RegExp(`${h}(?:^)?${y}[^\\s${M}]*`,"gm"),q=((l=v.nodeBefore)==null?void 0:l.isText)&&v.nodeBefore.text;if(!q)return null;const K=v.pos-q.length,u=Array.from(q.matchAll(N)).pop();if(!u||u.input===void 0||u.index===void 0)return null;const d=u.input.slice(Math.max(0,u.index-1),u.index),e=new RegExp(`^[${E?.join("")}\0]?$`).test(d);if(E!==null&&!e)return null;const I=K+u.index;let p=I+u[0].length;return B&&F.test(q.slice(p-1,p+1))&&(u[0]+=" ",p+=1),I<v.pos&&p>=v.pos?{range:{from:I,to:p},query:u[0].slice(D.length),text:u[0]}:null}var W=new z("suggestion");function Y({pluginKey:x=W,editor:l,char:D="@",allowSpaces:b=!1,allowToIncludeChar:P=!1,allowedPrefixes:E=[" "],startOfLine:j=!1,decorationTag:v="span",decorationClass:B="suggestion",decorationContent:y="",decorationEmptyClass:F="is-empty",command:h=()=>null,items:M=()=>[],render:N=()=>({}),allow:q=()=>!0,findSuggestionMatch:K=V,shouldShow:u}){let d;const e=N?.(),I=()=>{const n=l.state.selection.$anchor.pos,a=l.view.coordsAtPos(n),{top:r,right:s,bottom:o,left:c}=a;try{return new DOMRect(c,r,s-c,o-r)}catch{return null}},p=(n,a)=>a?()=>{const r=x.getState(l.state),s=r?.decorationId,o=n.dom.querySelector(`[data-decoration-id="${s}"]`);return o?.getBoundingClientRect()||null}:I;function U(n,a){var r;try{const o=x.getState(n.state),c=o?.decorationId?n.dom.querySelector(`[data-decoration-id="${o.decorationId}"]`):null,g={editor:l,range:o?.range||{from:0,to:0},query:o?.query||null,text:o?.text||null,items:[],command:m=>h({editor:l,range:o?.range||{from:0,to:0},props:m}),decorationNode:c,clientRect:p(n,c)};(r=e?.onExit)==null||r.call(e,g)}catch{}const s=n.state.tr.setMeta(a,{exit:!0});n.dispatch(s)}const C=new G({key:x,view(){return{update:async(n,a)=>{var r,s,o,c,g,m,S;const t=(r=this.key)==null?void 0:r.getState(a),f=(s=this.key)==null?void 0:s.getState(n.state),i=t.active&&f.active&&t.range.from!==f.range.from,_=!t.active&&f.active,A=t.active&&!f.active,R=!_&&!A&&t.query!==f.query,w=_||i&&R,k=R||i,O=A||i&&R;if(!w&&!k&&!O)return;const $=O&&!w?t:f,T=n.dom.querySelector(`[data-decoration-id="${$.decorationId}"]`);d={editor:l,range:$.range,query:$.query,text:$.text,items:[],command:L=>h({editor:l,range:$.range,props:L}),decorationNode:T,clientRect:p(n,T)},w&&((o=e?.onBeforeStart)==null||o.call(e,d)),k&&((c=e?.onBeforeUpdate)==null||c.call(e,d)),(k||w)&&(d.items=await M({editor:l,query:$.query})),O&&((g=e?.onExit)==null||g.call(e,d)),k&&((m=e?.onUpdate)==null||m.call(e,d)),w&&((S=e?.onStart)==null||S.call(e,d))},destroy:()=>{var n;d&&((n=e?.onExit)==null||n.call(e,d))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(n,a,r,s){const{isEditable:o}=l,{composing:c}=l.view,{selection:g}=n,{empty:m,from:S}=g,t={...a},f=n.getMeta(x);if(f&&f.exit)return t.active=!1,t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null,t;if(t.composing=c,o&&(m||l.view.composing)){(S<a.range.from||S>a.range.to)&&!c&&!a.composing&&(t.active=!1);const i=K({char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:j,$position:g.$from}),_=`id_${Math.floor(Math.random()*4294967295)}`;i&&q({editor:l,state:s,range:i.range,isActive:a.active})&&(!u||u({editor:l,range:i.range,query:i.query,text:i.text,transaction:n}))?(t.active=!0,t.decorationId=a.decorationId?a.decorationId:_,t.range=i.range,t.query=i.query,t.text=i.text):t.active=!1}else t.active=!1;return t.active||(t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null),t}},props:{handleKeyDown(n,a){var r,s,o,c;const{active:g,range:m}=C.getState(n.state);if(!g)return!1;if(a.key==="Escape"||a.key==="Esc"){const t=C.getState(n.state),f=(r=d?.decorationNode)!=null?r:null,i=f??(t?.decorationId?n.dom.querySelector(`[data-decoration-id="${t.decorationId}"]`):null);if(((s=e?.onKeyDown)==null?void 0:s.call(e,{view:n,event:a,range:t.range}))||!1)return!0;const A={editor:l,range:t.range,query:t.query,text:t.text,items:[],command:R=>h({editor:l,range:t.range,props:R}),decorationNode:i,clientRect:i?()=>i.getBoundingClientRect()||null:null};return(o=e?.onExit)==null||o.call(e,A),U(n,x),!0}return((c=e?.onKeyDown)==null?void 0:c.call(e,{view:n,event:a,range:m}))||!1},decorations(n){const{active:a,range:r,decorationId:s,query:o}=C.getState(n);if(!a)return null;const c=!o?.length,g=[B];return c&&g.push(F),H.create(n.doc,[J.inline(r.from,r.to,{nodeName:v,class:g.join(" "),"data-decoration-id":s,"data-decoration-content":y})])}}});return C}export{Y as S};
|