@lobu/runtime-server 24.0.0 → 24.1.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/component.json +1 -1
- package/dist/connectors/x-dm-adapter.js +65 -30
- package/dist/db/migrations/20261021010000_views_compile_config_hash.sql +16 -0
- package/dist/dependencies.bun.lock +1 -1
- package/dist/owletto/dist/assets/{_-CC8cTmRg.js → _-BorucF19.js} +3 -3
- package/dist/owletto/dist/assets/_-CkGyNi0G.js +2 -0
- package/dist/owletto/dist/assets/_agentId-BrhcaxUk.js +2 -0
- package/dist/owletto/dist/assets/{_agentId-DWUFSrVp.js → _agentId-DgRrCE2B.js} +2 -2
- package/dist/owletto/dist/assets/{_automationId-BnHqdXOC.js → _automationId-DSrZIYcs.js} +2 -2
- package/dist/owletto/dist/assets/{_connectorKey._connectionId-CefXIqy2.js → _connectorKey._connectionId-DWxv1uoi.js} +2 -2
- package/dist/owletto/dist/assets/{_connectorKey.index-C1QPGf9E.js → _connectorKey.index-BTP5ijdT.js} +2 -2
- package/dist/owletto/dist/assets/{_conversationId-DinuPCUp.js → _conversationId-98Y3RuRO.js} +2 -2
- package/dist/owletto/dist/assets/{_deploymentId-BeyzVjRm.js → _deploymentId-B1UWPY0i.js} +2 -2
- package/dist/owletto/dist/assets/{_eventId-3L_qeL_l.js → _eventId-BAnr8g8z.js} +2 -2
- package/dist/owletto/dist/assets/_name-BUfFO_A0.js +2 -0
- package/dist/owletto/dist/assets/{_owner-DbrKma4e.js → _owner-C79BwQ0I.js} +3 -3
- package/dist/owletto/dist/assets/_shape-Ep6JpyFX.js +2 -0
- package/dist/owletto/dist/assets/_skillKey-B24alBfT.js +2 -0
- package/dist/owletto/dist/assets/{_slug-ndDr_CUg.js → _slug-DbPdDc-5.js} +2 -2
- package/dist/owletto/dist/assets/_viewKey-DDUxjjFD.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-hdpq3RoX.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-CRKbM2Xy.js → accept-invitation-UXU5Fx2G.js} +2 -2
- package/dist/owletto/dist/assets/{activity-route-view-CFLNukhD.js → activity-route-view-D7ORHntE.js} +2 -2
- package/dist/owletto/dist/assets/{agent-card-controls-Be1Okb2C.js → agent-card-controls-CplnPhbv.js} +2 -2
- package/dist/owletto/dist/assets/{agent-client-setup-list-BA8dU_C6.js → agent-client-setup-list-BlXB4SE5.js} +2 -2
- package/dist/owletto/dist/assets/{agent-connect-pages-CAV-yXus.js → agent-connect-pages-BmknviTI.js} +2 -2
- package/dist/owletto/dist/assets/{agent-editor-form-Bi6WvYX-.js → agent-editor-form-DsSoeQeF.js} +2 -2
- package/dist/owletto/dist/assets/{agent-guardrails-route-DMOjG1D4.js → agent-guardrails-route-TdvvIc_J.js} +2 -2
- package/dist/owletto/dist/assets/{agent-loading-shells-De_2d8Lr.js → agent-loading-shells-B7v6Cffw.js} +2 -2
- package/dist/owletto/dist/assets/{agent-permissions-matrix-gZWl6mAe.js → agent-permissions-matrix-BkZu1LYE.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skill-context-JLaTamGR.js → agent-skill-context-DFucg4c4.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skills-route-DcK41PWj.js → agent-skills-route-B3vvvZZe.js} +2 -2
- package/dist/owletto/dist/assets/{agent-subpage-shell-BBJoyTuC.js → agent-subpage-shell-CZJvnjNC.js} +2 -2
- package/dist/owletto/dist/assets/agent-thread-D38STyeu.js +6 -0
- package/dist/owletto/dist/assets/agents-DAOln24A.js +2 -0
- package/dist/owletto/dist/assets/{agents-workbench-CqaKGggb.js → agents-workbench-DJ67GZ93.js} +2 -2
- package/dist/owletto/dist/assets/{app._appId-Cl1fTuIt.js → app._appId-Cp78oEZ9.js} +2 -2
- package/dist/owletto/dist/assets/{automation-detail-content-BMLL4lxO.js → automation-detail-content-DSwbRpbx.js} +2 -2
- package/dist/owletto/dist/assets/automations-DAOln24A.js +2 -0
- package/dist/owletto/dist/assets/{callback-DTKKsfkz.js → callback-CBexCo3F.js} +2 -2
- package/dist/owletto/dist/assets/{card-yU0TmNRH.js → card-jzhQrMDP.js} +2 -2
- package/dist/owletto/dist/assets/{claim-DJfTvlT2.js → claim-B-wq745Q.js} +2 -2
- package/dist/owletto/dist/assets/{client-rows--FrZfJol.js → client-rows-BYbsXGy9.js} +2 -2
- package/dist/owletto/dist/assets/{clients-L4K1UT8c.js → clients-BhNl1tVq.js} +2 -2
- package/dist/owletto/dist/assets/{code-editor-U54Gwjit.js → code-editor-CEqoCky-.js} +2 -2
- package/dist/owletto/dist/assets/connect-wx-qqLir.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-kk0_4Svo.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-QR8o-7M5.js +2 -0
- package/dist/owletto/dist/assets/{connected._clientId.activity-DTpSW1Xy.js → connected._clientId.activity-BqprYeOX.js} +2 -2
- package/dist/owletto/dist/assets/{connected._clientId.index-h9X5H1x8.js → connected._clientId.index-DhRoSzBr.js} +2 -2
- package/dist/owletto/dist/assets/{connection-ByvKkyFm.js → connection-CNm2ukrI.js} +2 -2
- package/dist/owletto/dist/assets/{connection-feed-detail-DWM9lTao.js → connection-feed-detail-WcGCA6qY.js} +2 -2
- package/dist/owletto/dist/assets/{connections-browser-CEwYrYqt.js → connections-browser-CrtnAs0Q.js} +2 -2
- package/dist/owletto/dist/assets/{connector-provenance-BocTm__v.js → connector-provenance-D-ECOlMJ.js} +2 -2
- package/dist/owletto/dist/assets/{connector-scope-lists-OYDOydtz.js → connector-scope-lists-CRFEpSvk.js} +2 -2
- package/dist/owletto/dist/assets/{connectors-CyZpcE5f.js → connectors-CH4KBZyT.js} +2 -2
- package/dist/owletto/dist/assets/{consent-DdfINrVp.js → consent-C9ZpHb7V.js} +2 -2
- package/dist/owletto/dist/assets/{conversations-table-BSznfdYt.js → conversations-table-D_HOe1jN.js} +2 -2
- package/dist/owletto/dist/assets/{core.esm-Dr7tcIB-.js → core.esm-BupT3V0i.js} +2 -2
- package/dist/owletto/dist/assets/create-C4lptGWj.js +2 -0
- package/dist/owletto/dist/assets/{create-CBGwASon.js → create-CCjZxIkK.js} +2 -2
- package/dist/owletto/dist/assets/create-DkgUQAbB.js +2 -0
- package/dist/owletto/dist/assets/{create-automation-form-9T5WnoUs.js → create-automation-form-Bpy92SM5.js} +2 -2
- package/dist/owletto/dist/assets/create._connectorKey-D6Kc-YQ3.js +2 -0
- package/dist/owletto/dist/assets/{cronstrue-BWFEyy_P.js → cronstrue-CWImw-kf.js} +2 -2
- package/dist/owletto/dist/assets/{deployments-wG_8QzOF.js → deployments-C5hvipQh.js} +2 -2
- package/dist/owletto/dist/assets/deployments-CPpFAd_w.js +2 -0
- package/dist/owletto/dist/assets/{deployments-body-2xKS8gRo.js → deployments-body-DGII20dQ.js} +2 -2
- package/dist/owletto/dist/assets/{device-6z-xgsoW.js → device-D-7WBe9E.js} +2 -2
- package/dist/owletto/dist/assets/{device-pin-tombstone-Cwq88RMU.js → device-pin-tombstone-2U0UMu3_.js} +2 -2
- package/dist/owletto/dist/assets/{device._deviceId-BDerBfD9.js → device._deviceId-Bn37UpWH.js} +2 -2
- package/dist/owletto/dist/assets/{entity-avatar-Cc1CuI-0.js → entity-avatar-mdh7Kq5D.js} +2 -2
- package/dist/owletto/dist/assets/{entity-options-DHdMC1Lx.js → entity-options-Clz_WXK-.js} +2 -2
- package/dist/owletto/dist/assets/{entity-page--OkXmlNP.js → entity-page-D3e4iPle.js} +2 -2
- package/dist/owletto/dist/assets/{entity-type-page-89RoK_-P.js → entity-type-page-DebN1vCM.js} +2 -2
- package/dist/owletto/dist/assets/{event-detail-D4YZRtrA.js → event-detail-DV_zfWnC.js} +2 -2
- package/dist/owletto/dist/assets/events-feed-DO3IiJO2.js +2 -0
- package/dist/owletto/dist/assets/{filter-editors-B1_QUpg_.js → filter-editors-Bwhqj7lY.js} +2 -2
- package/dist/owletto/dist/assets/{full-page-spinner-Cqih-8IW.js → full-page-spinner-BVbcpW3R.js} +2 -2
- package/dist/owletto/dist/assets/guardrails-BiJollCA.js +2 -0
- package/dist/owletto/dist/assets/identity-HCFWtdaI.js +2 -0
- package/dist/owletto/dist/assets/index-8wxsyxqt.js +2 -0
- package/dist/owletto/dist/assets/{index-DYCqXaMf.js → index-9YuSRymd.js} +4 -4
- package/dist/owletto/dist/assets/index-B3c-0eZG.js +2 -0
- package/dist/owletto/dist/assets/{index-TgRS2v_F.js → index-B64PGxQm.js} +2 -2
- package/dist/owletto/dist/assets/{index-DfyDUpuI.js → index-BTlx9K_t.js} +2 -2
- package/dist/owletto/dist/assets/index-BX0EA_oB.js +2 -0
- package/dist/owletto/dist/assets/index-CdJJaQDX.js +2 -0
- package/dist/owletto/dist/assets/index-CfT_W8Vo.js +2 -0
- package/dist/owletto/dist/assets/{index-DYzWV5_z.js → index-CxF2XXzl.js} +2 -2
- package/dist/owletto/dist/assets/index-D3WHeGql.js +2 -0
- package/dist/owletto/dist/assets/{index-ZNlrDc_f.js → index-D7gHOpfg.js} +2 -2
- package/dist/owletto/dist/assets/{index-DKPwCasf.js → index-DB1iWI_a.js} +2 -2
- package/dist/owletto/dist/assets/index-DMNzF8Lf.js +2 -0
- package/dist/owletto/dist/assets/index-DyB3IzOA.js +2 -0
- package/dist/owletto/dist/assets/{index-DAOyXG1X.js → index-fgAJydgX.js} +2 -2
- package/dist/owletto/dist/assets/{json-diff-DFvYINBT.js → json-diff-DIN5Jhfx.js} +2 -2
- package/dist/owletto/dist/assets/{list-skeleton-DFsEqLU1.js → list-skeleton-CepswBka.js} +2 -2
- package/dist/owletto/dist/assets/{login-DO0j-AYr.js → login-DxGYyE4n.js} +2 -2
- package/dist/owletto/dist/assets/{logout-BmNwoAf7.js → logout-Bkzc7J44.js} +2 -2
- package/dist/owletto/dist/assets/{member-scope-gate-B2LrMWBU.js → member-scope-gate-DD4YBFn-.js} +2 -2
- package/dist/owletto/dist/assets/{memory-browse-page-Cjpl8EbB.js → memory-browse-page-D_UlBa27.js} +2 -2
- package/dist/owletto/dist/assets/{model-selector-TQcA93xm.js → model-selector-CDrAjH31.js} +2 -2
- package/dist/owletto/dist/assets/models-BAVeysNq.js +2 -0
- package/dist/owletto/dist/assets/{new-BMrFy5Qa.js → new-C2av0diq.js} +2 -2
- package/dist/owletto/dist/assets/{new-ByBhteWA.js → new-ktz9Cs_P.js} +2 -2
- package/dist/owletto/dist/assets/{new-DWp3deoW.js → new-snm1ctHn.js} +2 -2
- package/dist/owletto/dist/assets/{oauth-workspace-access-D_5uESuz.js → oauth-workspace-access-lZNZ9gul.js} +2 -2
- package/dist/owletto/dist/assets/{organization-DTFoYP4V.js → organization-Cb0W823y.js} +2 -2
- package/dist/owletto/dist/assets/{peek-pane-content-DF5iGC3c.js → peek-pane-content-BNR9ImQY.js} +2 -2
- package/dist/owletto/dist/assets/{permissions-C_auqxfP.js → permissions-Dv39zWKt.js} +2 -2
- package/dist/owletto/dist/assets/{proposal-review-shell-DsNiavG_.js → proposal-review-shell-CFhOqCLf.js} +2 -2
- package/dist/owletto/dist/assets/public-shell-ready-DqX8AXfw.js +2 -0
- package/dist/owletto/dist/assets/{recent-3d99S2IE.js → recent-QhnLDU1_.js} +2 -2
- package/dist/owletto/dist/assets/{record-activity-C9KfBkXb.js → record-activity-ZJntBfN_.js} +2 -2
- package/dist/owletto/dist/assets/{record-field-peek-BBZcRuGT.js → record-field-peek-Brh1IQGy.js} +2 -2
- package/dist/owletto/dist/assets/{record-session-BizRugWs.js → record-session-Pbr5czGw.js} +2 -2
- package/dist/owletto/dist/assets/{reset-password-DqfcSn8M.js → reset-password-CzZw6RcC.js} +2 -2
- package/dist/owletto/dist/assets/{runs-panel-T1ZxTVz6.js → runs-panel-C0_DNTcq.js} +2 -2
- package/dist/owletto/dist/assets/{runs-table-D_8QlCCN.js → runs-table-B1APZv7d.js} +2 -2
- package/dist/owletto/dist/assets/{schema-value-normalization-CylKX3PK.js → schema-value-normalization-CKdPjdPC.js} +2 -2
- package/dist/owletto/dist/assets/settings-CgZ5Z7wD.js +2 -0
- package/dist/owletto/dist/assets/{settings-B_ClYztB.js → settings-VDNiffKU.js} +2 -2
- package/dist/owletto/dist/assets/skills-DgDGscm5.js +2 -0
- package/dist/owletto/dist/assets/{source-record-panels-Cg249m1S.js → source-record-panels-BdfOVPWn.js} +2 -2
- package/dist/owletto/dist/assets/{use-mention-search-BYbFvHbJ.js → use-mention-search-Dcunv4L0.js} +2 -2
- package/dist/owletto/dist/assets/{view-param-filters-DMSqkN2J.js → view-param-filters-B0quibBi.js} +2 -2
- package/dist/owletto/dist/index.html +1 -1
- package/dist/server-main.bundle.mjs +354 -142
- package/npm-shrinkwrap.json +8 -8
- package/package.json +1 -1
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/contracts/tools/view-runtime.d.ts +74 -0
- package/vendor/core/dist/contracts/tools/view-runtime.js +86 -0
- package/vendor/core/package.json +6 -1
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-ksFp4zVf.js +0 -2
- package/dist/owletto/dist/assets/_agentId-MENLoohA.js +0 -2
- package/dist/owletto/dist/assets/_name-Dgedji78.js +0 -2
- package/dist/owletto/dist/assets/_shape-DtVfRFz_.js +0 -2
- package/dist/owletto/dist/assets/_skillKey-CqLHzm7L.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-3CH5w8mr.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-DHQY9A8u.js +0 -2
- package/dist/owletto/dist/assets/agent-thread-Buz3naVF.js +0 -6
- package/dist/owletto/dist/assets/agents-C-ReckCa.js +0 -2
- package/dist/owletto/dist/assets/automations-C-ReckCa.js +0 -2
- package/dist/owletto/dist/assets/connect-4zqtnDHb.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-Dj0SqgbE.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-sgtocSvf.js +0 -2
- package/dist/owletto/dist/assets/create-Cf5hp6Z8.js +0 -2
- package/dist/owletto/dist/assets/create-CwThQtd3.js +0 -2
- package/dist/owletto/dist/assets/create._connectorKey-sNHQHNpg.js +0 -2
- package/dist/owletto/dist/assets/deployments-DHh9dyzv.js +0 -2
- package/dist/owletto/dist/assets/events-feed-DsrkV2ix.js +0 -2
- package/dist/owletto/dist/assets/guardrails-B8Rs1be3.js +0 -2
- package/dist/owletto/dist/assets/identity-B0nH4yiC.js +0 -2
- package/dist/owletto/dist/assets/index-4TSkcsth.js +0 -2
- package/dist/owletto/dist/assets/index-BgkhXElB.js +0 -2
- package/dist/owletto/dist/assets/index-CoW4Bz3w.js +0 -2
- package/dist/owletto/dist/assets/index-Codw-Qqi.js +0 -2
- package/dist/owletto/dist/assets/index-DMyXd3bJ.js +0 -2
- package/dist/owletto/dist/assets/index-DYYZLcJ0.js +0 -2
- package/dist/owletto/dist/assets/index-Da6CrGEu.js +0 -2
- package/dist/owletto/dist/assets/index-DneshLbf.js +0 -2
- package/dist/owletto/dist/assets/models-D7aED5Sa.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-B2NUI89V.js +0 -2
- package/dist/owletto/dist/assets/settings-DgX1-xo7.js +0 -2
- package/dist/owletto/dist/assets/skills-Drw5tcZw.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ic as n,j as o,ai as r}from"./index-9YuSRymd.js";import{A as a}from"./agent-connect-pages-BmknviTI.js";import"./agent-client-setup-list-BlXB4SE5.js";import"./clients-BhNl1tVq.js";import"./client-rows-BYbsXGy9.js";function g(){const{owner:t}=n.useParams();return o.jsx(r,{owner:t,children:({ownerSlug:e})=>o.jsx(a,{owner:e})})}export{g as component};
|
|
2
|
+
//# sourceMappingURL=index-B3c-0eZG.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{aZ as o,o as u,a_ as i,r as c,j as g}from"./index-
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{aZ as o,o as u,a_ as i,r as c,j as g}from"./index-9YuSRymd.js";import{C as f}from"./agent-loading-shells-B7v6Cffw.js";function d(t,n,e){const a=t.find(r=>r.system)??t[0];return a?{to:"/$owner/chat/$agentId",params:{owner:n,agentId:a.agentId},search:e,replace:!0}:null}function h(){const{owner:t}=o.useParams(),n=o.useSearch(),e=u(),{data:a=[],isLoading:r}=i(),s=d(a,t,n);return c.useEffect(()=>{s&&e(s)},[e,s]),c.useEffect(()=>{r||a.length>0||e({to:"/$owner/agents",params:{owner:t},replace:!0})},[a.length,r,e,t]),g.jsx(f,{})}export{d as chatEntryTarget,h as component};
|
|
2
|
+
//# sourceMappingURL=index-B64PGxQm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as y,o as C,q as U,r as v,s as S,t as L,j as I}from"./index-
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{n as y,o as C,q as U,r as v,s as S,t as L,j as I}from"./index-9YuSRymd.js";import{F as P}from"./full-page-spinner-BVbcpW3R.js";function f(t){return t?.trim().toLowerCase()||null}function _(t){return t?.methods??[]}function k(t,s){const e=f(s);if(!e)return null;for(const i of t){const o=_(i.auth_schema);if(!o.some(n=>n.type==="oauth"&&f(n.provider)===e&&Array.isArray(n.loginScopes)&&n.loginScopes.length>0))continue;const r=o.find(n=>n.type==="app_installation"&&f(n.provider)===e);if(r)return{connectorKey:i.key,provider:e,installShape:r.installShape??null}}return null}function q(){const{isAuthenticated:t,authReady:s,currentOwner:e,orgsReady:i}=y(),o=C(),p=U(),r=v.useRef(!1),n=new URLSearchParams(window.location.search).get("onboard_provider"),d=new URLSearchParams(window.location.search).get("connector"),l=d&&/^[a-z0-9][a-z0-9._-]{0,127}$/.test(d)&&!["create","deployments"].includes(d)?d:null;return v.useEffect(()=>{if(s&&p.pathname==="/"){if(t&&e){const a=new URLSearchParams(window.location.hash.replace(/^#/,"")),m=a.get("agent")?.trim(),h=a.get("thread")?.trim(),$=a.get("message")?.trim()||a.get("message_id")?.trim(),c=a.get("run")?.trim(),g=a.get("worker")?.trim();if(!!m&&!!h||!!c&&/^\d+$/.test(c)||!!g){if(r.current)return;if(r.current=!0,window.history.replaceState(null,"",`${window.location.pathname}${window.location.search}`),m&&h){const u=$?`?message_id=${encodeURIComponent($)}`:"";window.location.replace(`/${encodeURIComponent(e)}/chat/${encodeURIComponent(m)}/c/${encodeURIComponent(h)}${u}`);return}if(c&&/^\d+$/.test(c)){const u=new URLSearchParams({run_ids:c,peek:"1",peek_run_id:c});window.location.replace(`/${encodeURIComponent(e)}/events?${u.toString()}`);return}if(g){window.location.replace(`/${encodeURIComponent(e)}/connectors/device/${encodeURIComponent(g)}`);return}}if(r.current)return;if(r.current=!0,l){o({to:"/$owner/connectors/$connectorKey",params:{owner:e,connectorKey:l},replace:!0});return}const w=()=>void o({to:"/$owner",params:{owner:e},replace:!0});if(n){S(e).then(u=>{const R=k(u,n);if(R){window.location.assign(`/${encodeURIComponent(e)}/connectors/${encodeURIComponent(R.connectorKey)}`);return}w()}).catch(w);return}w();return}if(t){i&&o({to:"/account/settings",replace:!0});return}o({to:"/auth/login",search:L({callbackUrl:l?`/?connector=${encodeURIComponent(l)}`:void 0}),replace:!0})}},[s,e,t,i,o,p.pathname,n,l]),I.jsx("div",{"data-public-loading":"true",children:I.jsx(P,{delayMs:0,className:"min-h-0 py-16"})})}export{q as component};
|
|
2
|
+
//# sourceMappingURL=index-BTlx9K_t.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{iT as o,j as e}from"./index-9YuSRymd.js";import{A as n}from"./agent-guardrails-route-TdvvIc_J.js";import"./model-selector-CDrAjH31.js";import"./agent-subpage-shell-CZJvnjNC.js";import"./agent-loading-shells-B7v6Cffw.js";import"./agent-card-controls-CplnPhbv.js";function x(){const{owner:r,agentId:t}=o.useParams();return e.jsx(n,{owner:r,agentId:t})}export{x as component};
|
|
2
|
+
//# sourceMappingURL=index-BX0EA_oB.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{bm as t,j as m,bn as p}from"./index-9YuSRymd.js";import{M as i}from"./memory-browse-page-D_UlBa27.js";import"./public-shell-ready-DqX8AXfw.js";import"./entity-type-page-DebN1vCM.js";import"./json-diff-DIN5Jhfx.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./code-editor-CEqoCky-.js";import"./schema-value-normalization-CKdPjdPC.js";import"./card-jzhQrMDP.js";import"./entity-avatar-mdh7Kq5D.js";import"./filter-editors-Bwhqj7lY.js";import"./core.esm-BupT3V0i.js";import"./view-param-filters-B0quibBi.js";import"./app-bridge-BCm4muqj.js";import"./member-scope-gate-DD4YBFn-.js";function d(){const{owner:o,entityType:r}=t.useParams(),{create:e}=t.useSearch();return m.jsx(i,{ownerSlug:o,typeScope:p(r),create:e??!1})}export{d as component};
|
|
2
|
+
//# sourceMappingURL=index-CdJJaQDX.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{as as r,j as e}from"./index-9YuSRymd.js";import{M as m}from"./memory-browse-page-D_UlBa27.js";import"./public-shell-ready-DqX8AXfw.js";import"./entity-type-page-DebN1vCM.js";import"./json-diff-DIN5Jhfx.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./code-editor-CEqoCky-.js";import"./schema-value-normalization-CKdPjdPC.js";import"./card-jzhQrMDP.js";import"./entity-avatar-mdh7Kq5D.js";import"./filter-editors-Bwhqj7lY.js";import"./core.esm-BupT3V0i.js";import"./view-param-filters-B0quibBi.js";import"./app-bridge-BCm4muqj.js";import"./member-scope-gate-DD4YBFn-.js";function M(){const{owner:t}=r.useParams(),o=r.useSearch();return e.jsx(m,{ownerSlug:t,create:!1,createType:o.create_type==="true"})}export{M as component};
|
|
2
|
+
//# sourceMappingURL=index-CfT_W8Vo.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{bh as A,a_ as $,r as l,j as e,B as p,L as u,bi as C,aR as M,ag as S,bj as B,bk as E,bl as W,ai as R}from"./index-
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{bh as A,a_ as $,r as l,j as e,B as p,L as u,bi as C,aR as M,ag as S,bj as B,bk as E,bl as W,ai as R}from"./index-9YuSRymd.js";import{A as O}from"./agent-client-setup-list-BlXB4SE5.js";import{L as T}from"./list-skeleton-CepswBka.js";import{u as _}from"./clients-BhNl1tVq.js";import{g as z,c as F}from"./client-rows-BYbsXGy9.js";const G={all:"All",managed:"Managed",connected:"Connected"};function P({owner:t,item:a,last:g}){const c=`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${g?"":"border-b"}`;if(a.kind==="managed"){const n=a.agent,d=[n.status==="active"?"Working":"Idle",`${n.connectionCount} ${n.connectionCount===1?"connection":"connections"}`,`${n.userCount} ${n.userCount===1?"user":"users"}`].filter(Boolean).join(" · ");return e.jsxs(u,{to:"/$owner/agents/$agentId/settings",params:{owner:t,agentId:n.agentId},search:{run_id:void 0},className:c,children:[e.jsx("span",{"aria-hidden":"true",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",children:e.jsx(B,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-sm font-medium",children:n.name}),e.jsx("p",{className:"truncate text-xs",children:d})]}),n.status==="active"?e.jsx("span",{role:"img","aria-label":"Working",className:"h-2 w-2 shrink-0 rounded-full bg-emerald-500"}):null]})}if(a.kind==="connected"){const n=a.group;return e.jsxs(u,{to:"/$owner/agents/connected/$clientId",params:{owner:t,clientId:n.clientId},className:c,children:[e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border text-muted-foreground",children:e.jsx(E,{name:n.title})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:n.title}),e.jsxs("p",{className:"truncate text-xs",children:["Connected · ",F(n)]})]}),e.jsx("span",{role:"img","aria-label":"Connected",className:"h-2 w-2 shrink-0 rounded-full bg-emerald-500"})]})}}function q({owner:t,isWorkspaceLoading:a}){const{isMember:g,isLoading:c}=A(),n=g&&!c,{data:d=[],isLoading:y}=$({enabled:n}),{data:f=[]}=_(null),j=l.useMemo(()=>z(f).filter(s=>s.connected),[f]),i=l.useMemo(()=>{const s=d.map(r=>({kind:"managed",key:r.agentId,agent:{agentId:r.agentId,name:r.name,status:r.status,connectionCount:r.connectionCount,userCount:r.userCount}})),h=j.map(r=>({kind:"connected",key:r.key,group:r}));return[...s,...h]},[d,j]),w=l.useMemo(()=>i.length>0?["all","managed","connected"]:[],[i]),[N,v]=l.useState("all"),o=w.includes(N)?N:"all",x=l.useMemo(()=>i.filter(s=>o==="all"?!0:o==="managed"?s.kind==="managed":s.kind==="connected"),[i,o]),b=a||c||y,m=i.length>0,k=!b&&!m&&n,L=n?m?o==="managed"?"No managed agents yet":o==="connected"?"No connected agents yet":"No agents match this filter":"No agents yet":"Workspace membership required",I=n?m?o==="managed"?"Build a managed agent to add one here.":o==="connected"?"Bring an agent you already run to this workspace.":"Try another filter.":"Build a managed agent, or bring one you already run to this workspace.":"Only workspace members can manage agents here.";return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Who works here — your agents and the ones connected to this workspace."}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:[w.map(s=>e.jsx(p,{type:"button",variant:o===s?"secondary":"ghost","aria-pressed":o===s,size:"sm",className:"h-7 px-2 text-xs",onClick:()=>v(s),children:G[s]},s)),k?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect an agent below or build one with Lobu."}):null]}),e.jsxs("div",{className:"flex w-full flex-wrap items-center gap-2 sm:ml-auto sm:w-auto sm:shrink-0",children:[m?e.jsx(p,{asChild:!0,size:"sm",className:"h-8 text-xs",children:e.jsxs(u,{to:"/$owner/agents/connect",params:{owner:t},children:[e.jsx(C,{className:"mr-1.5 h-3.5 w-3.5"}),"Connect an agent"]})}):null,e.jsx(p,{asChild:!0,variant:"outline",size:"sm",className:"h-8 text-xs",children:e.jsxs(u,{to:"/$owner/agents/new",params:{owner:t},search:{},children:[e.jsx(C,{className:"mr-1.5 h-3.5 w-3.5"}),"Build a managed agent"]})})]})]}),b?e.jsx(T,{label:"Loading agents"}):x.length===0?k?e.jsx(O,{owner:t,dashed:!0}):e.jsx(M,{icon:S.agents.icon,title:L,description:I}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:x.map((s,h)=>e.jsx(P,{owner:t,item:s,last:h===x.length-1},s.key))})]})}function U(){const{owner:t}=W.useParams();return e.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-3 px-4 pt-2.5 pb-8 lg:px-6",children:e.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:e.jsx(R,{owner:t,children:a=>e.jsx("div",{className:"mx-auto flex min-h-0 w-full min-w-0 max-w-3xl flex-1 flex-col",children:e.jsx(q,{owner:a.ownerSlug,isWorkspaceLoading:a.isWorkspaceLoading})})})})})}export{U as component};
|
|
2
|
+
//# sourceMappingURL=index-CxF2XXzl.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{aq as s,ar as m,j as o}from"./index-9YuSRymd.js";import{A as n}from"./activity-route-view-D7ORHntE.js";import{E as p}from"./events-feed-DO3IiJO2.js";import"./record-activity-ZJntBfN_.js";import"./filter-editors-Bwhqj7lY.js";import"./connection-label-BobuYiAG.js";import"./source-record-panels-BdfOVPWn.js";import"./clients-BhNl1tVq.js";import"./client-rows-BYbsXGy9.js";import"./schema-value-normalization-CKdPjdPC.js";import"./card-jzhQrMDP.js";import"./agent-loading-shells-B7v6Cffw.js";import"./member-scope-gate-DD4YBFn-.js";import"./public-shell-ready-DqX8AXfw.js";import"./conversations-table-D_HOe1jN.js";function A(){const{owner:r}=s.useParams(),e=s.useSearch();if(r==="me"){const t=m(e),i={sortBy:"date",sortOrder:"desc",...t.contentIds?.length?{contentIds:t.contentIds}:{clientIds:t.clientIds,mcpActivityId:t.mcpActivityId}};return o.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-6 px-4 pt-2.5 pb-8 lg:px-6",children:[o.jsx("h1",{className:"text-lg font-semibold",children:"Your MCP activity"}),o.jsx(p,{organizationId:null,ownerSlug:"me",filters:i})]})}return o.jsx(n,{owner:r,search:e})}export{A as component};
|
|
2
|
+
//# sourceMappingURL=index-D3WHeGql.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{hp as n,j as s,hq as r}from"./index-
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{hp as n,j as s,hq as r}from"./index-9YuSRymd.js";function c(){const{owner:e}=n.useParams(),{connector:o,install:t}=n.useSearch();return s.jsx(r,{owner:e,initialConnectorKey:o||t})}export{c as component};
|
|
2
|
+
//# sourceMappingURL=index-D7gHOpfg.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{at as z,j as n,ai as q,au as V,av as H,aw as J,ax as Q,ay as Z,az as ee,aA as ne,r as D,aB as se,aC as G,B as W,o as oe,aD as ae,aE as te,aF as re,aG as ie,aH as ce,aI as de,aJ as le,aK as ue,aL as pe,aM as me,aN as U,aO as he,aP as fe,S as T,L,aQ as xe,aR as X,ag as Y,aS as ve,aT as ge,aU as ye,aV as _e,aW as Ne,aX as je,P as be,aY as ke}from"./index-
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{at as z,j as n,ai as q,au as V,av as H,aw as J,ax as Q,ay as Z,az as ee,aA as ne,r as D,aB as se,aC as G,B as W,o as oe,aD as ae,aE as te,aF as re,aG as ie,aH as ce,aI as de,aJ as le,aK as ue,aL as pe,aM as me,aN as U,aO as he,aP as fe,S as T,L,aQ as xe,aR as X,ag as Y,aS as ve,aT as ge,aU as ye,aV as _e,aW as Ne,aX as je,P as be,aY as ke}from"./index-9YuSRymd.js";function Le(){const{owner:a}=z.useParams(),{filter:c}=z.useSearch();return n.jsx(q,{owner:a,children:r=>n.jsx(Ce,{ownerSlug:r.ownerSlug,organizationId:r.organizationId,isWorkspaceLoading:r.isWorkspaceLoading,requestedFilter:c})})}function Ce({ownerSlug:a,organizationId:c,isWorkspaceLoading:r,requestedFilter:m}){const{data:h=[],isLoading:d,isError:E,refetch:j}=V(c??""),{data:y=[],isLoading:S,isError:K,refetch:P}=H(c??""),{data:b=[]}=J(c,{}),{data:k=[],isLoading:f,isError:C,refetch:O}=Q(),{data:I=[]}=Z(),{data:R,isLoading:M,isError:s,refetch:t}=ee(),{data:x=[],isLoading:p,isError:w,refetch:v}=ne(),e=r||d||S||f||M||p,o=R?.sandboxes??[],i=D.useMemo(()=>x.filter(l=>se(l,a)),[x,a]);return E||K||C||s||w?n.jsx(G,{children:n.jsxs("div",{role:"alert",className:"space-y-2",children:[n.jsx("p",{children:"Could not load the connector inventory."}),n.jsx(W,{variant:"outline",size:"sm",onClick:()=>{Promise.all([j(),P(),O(),t(),v()])},children:"Retry"})]})}):n.jsx(G,{className:"flex flex-1 flex-col gap-6",children:n.jsx(Ie,{ownerSlug:a,isContentLoading:e,groups:h,installedDefs:y,authProfiles:b,inferenceProviders:k,inferenceCatalog:I,sandboxes:o,devices:i,requestedFilter:m})})}function Ie({ownerSlug:a,isContentLoading:c,groups:r,installedDefs:m,authProfiles:h,inferenceProviders:d,inferenceCatalog:E,sandboxes:j,devices:y,requestedFilter:S}){const K=oe(),P=S??"all",b=D.useMemo(()=>{const s=new Map(r.map(e=>[e.connector_key,e])),t=new Map;for(const e of m)t.set(e.key,e);for(const e of r)t.has(e.connector_key)||t.set(e.connector_key,{key:e.connector_key,name:e.connector_name??e.connector_key,description:null,version:"",auth_schema:null,feeds_schema:null,actions_schema:null,options_schema:null,status:"active",login_enabled:!1,favicon_domain:e.favicon_domain,facets:e.facets});const x=ae(d).filter((e,o,i)=>i.findIndex(l=>l.provider.kind===e.provider.kind)===o).map(e=>({connector:{...e.connector,key:`${te}${e.provider.kind}`,name:E.find(o=>o.slug===e.provider.kind)?.displayName??e.provider.kind},group:void 0,profileCounts:{env:0,oauth_app:0,oauth_account:0,browser_session:0},facets:e.facets,needsSetup:!1,provider:e.provider,sandbox:void 0,device:void 0,deviceFamily:void 0})),p=re(j).filter((e,o,i)=>i.findIndex(l=>l.sandbox.providerKind===e.sandbox.providerKind)===o).map(e=>({connector:{...e.connector,key:`${ie}${e.sandbox.providerKind}`,name:ce(e.sandbox.providerKind)},group:void 0,profileCounts:{env:0,oauth_app:0,oauth_account:0,browser_session:0},facets:e.facets,needsSetup:j.some(o=>o.providerKind===e.sandbox.providerKind&&!o.connected),provider:void 0,sandbox:e.sandbox,device:void 0,deviceFamily:void 0})),w=de(y,r,a).map(e=>({connector:e.connector,group:void 0,profileCounts:{env:0,oauth_app:0,oauth_account:0,browser_session:0},facets:e.facets,needsSetup:!1,isDevice:!0,provider:void 0,sandbox:void 0,device:e.device,deviceFamily:e}));return[...Array.from(t.values()).filter(e=>e.installed||(s.get(e.key)?.connection_count??0)>0).filter(e=>!le(e)).map(e=>{const o=s.get(e.key),i=ue(e.auth_schema),l=h.reduce((g,N)=>(N.connector_key!==e.key||(g[N.profile_kind]+=1),g),{env:0,oauth_app:0,oauth_account:0,browser_session:0}),A=pe(e,o),_=y.some(g=>g.connectors.some(N=>N.organization_slug===a&&N.connector_key===e.key)),$=we(e,o,i,l);return{connector:e,group:o,profileCounts:l,facets:A,needsSetup:$,isDevice:_,provider:void 0,sandbox:void 0,device:void 0,deviceFamily:void 0}}),...x,...p,...w].sort((e,o)=>e.needsSetup&&!o.needsSetup?-1:!e.needsSetup&&o.needsSetup?1:e.connector.name.localeCompare(o.connector.name))},[a,h,y,r,m,d,E,j]),k=D.useMemo(()=>{const s=me.filter(t=>t!=="all"&&b.some(x=>U(x,t)));return s.length>1?["all",...s]:[]},[b]),f=k.includes(P)?P:"all",C=D.useMemo(()=>b.filter(s=>U(s,f)),[b,f]),O=C.length,I=D.useMemo(()=>f==="all"?he(a,y,fe()):[],[f,a,y]),R=n.jsx(W,{asChild:!0,size:"sm",className:"h-8 shrink-0 text-xs",children:n.jsxs(L,{to:"/$owner/connectors/create",params:{owner:a},children:[n.jsx(ke,{className:"mr-1.5 h-3.5 w-3.5"}),"Add connector"]})});if(c)return n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex justify-end",children:R}),n.jsx("div",{className:"overflow-hidden rounded-lg border",role:"status","aria-label":"Loading connectors",children:Array.from({length:6}).map((s,t)=>n.jsxs("div",{className:`flex items-center gap-3 px-3 py-2.5 ${t===5?"":"border-b"}`,children:[n.jsx(T,{className:"h-7 w-7 shrink-0 rounded-md"}),n.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[n.jsx(T,{className:"h-4 w-40"}),n.jsx(T,{className:"h-3 w-24"})]})]},t))})]});const M=s=>{K({to:"/$owner/connectors",params:{owner:a},search:t=>({...t,filter:s==="all"?void 0:s}),replace:!0})};return n.jsxs("div",{className:"space-y-4",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"What your agents can reach — data, tools, models, and runtimes."}),I.length>0?n.jsx("div",{className:"grid grid-cols-2 gap-px overflow-hidden rounded-lg border border-dashed bg-border sm:grid-cols-[repeat(auto-fit,minmax(10rem,1fr))]",children:I.map(s=>n.jsxs(L,{to:"/$owner/connectors/app/$appId",params:{owner:a,appId:s.id},title:s.tagline,className:"flex min-w-0 items-center gap-2 bg-background px-3 py-2.5 text-muted-foreground transition-colors last:odd:col-span-2 hover:bg-accent/50 hover:text-foreground sm:last:odd:col-span-1",children:[n.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center text-muted-foreground",children:s.icon}),n.jsx("span",{className:"truncate text-sm font-medium",children:s.name})]},s.id))}):null,n.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[n.jsxs("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:[k.map(s=>n.jsx(W,{type:"button",variant:f===s?"secondary":"ghost","aria-pressed":f===s,size:"sm",className:"h-7 px-2 text-xs",onClick:()=>M(s),children:xe[s]},s)),k.length===0&&C.length===0&&I.length>0?n.jsx("p",{className:"text-sm text-muted-foreground",children:"Nothing connected yet — set up one of the apps above."}):null]}),n.jsx("div",{className:"ml-auto shrink-0",children:R})]}),C.length===0?k.length>0?n.jsx(X,{icon:Y.connectors.icon,title:"No connectors match this filter",description:"Try another capability.",secondaryActionLabel:"Show all",secondaryOnAction:()=>M("all")}):I.length>0?null:n.jsx(X,{icon:Y.connectors.icon,title:"No connectors yet",description:"Connect your first connector to this workspace."}):n.jsx("div",{className:"overflow-hidden rounded-lg border",children:C.map(({connector:s,group:t,facets:x,profileCounts:p,needsSetup:w,provider:v,sandbox:e,device:o,deviceFamily:i},l)=>{const A=new Map(m.map(u=>[u.key,u])),_=ve(s.key,A,{name:s.name,iconUrl:v?E.find(u=>u.slug===v.kind)?.iconUrl:void 0,faviconDomain:s.favicon_domain??t?.favicon_domain??(e?ge(e.providerKind):void 0)}),$=p.oauth_account+p.browser_session,g=t?.connection_count??0,N=o?`${i?.devices.length??1} ${o.platform==="chrome-extension"?i?.devices.length===1?"profile":"profiles":i?.devices.length===1?"device":"devices"} · ${i?.devices.filter(u=>u.online).length??0} online`:v?`${d.filter(u=>u.kind===v.kind).length} configured accounts`:e?`${j.filter(u=>u.providerKind===e.providerKind).length} instances`:[`${g} ${g===1?"connection":"connections"}`,$>0?`${$} ${$===1?"saved authorization":"saved authorizations"}`:null,p.oauth_app>0?`${p.oauth_app} OAuth app${p.oauth_app===1?"":"s"}`:null].filter(Boolean).join(" · "),F=Ee(l,O),B=n.jsxs(n.Fragment,{children:[o?n.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:n.jsx(ye,{platform:_e(o)})}):n.jsx(Ne,{icon:_.icon,iconUrl:_.iconUrl,name:_.name,faviconDomain:_.faviconDomain,className:"h-7 w-7 shrink-0 rounded-md text-[10px]"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("span",{className:"truncate text-sm font-medium",children:_.name}),n.jsx(je,{facets:x})]}),n.jsx("p",{className:"truncate text-xs text-muted-foreground",children:N})]}),w?n.jsx(be,{variant:"secondary",className:"shrink-0 text-[10px]",children:"Needs setup"}):null]});return i?.appId?n.jsx(L,{to:"/$owner/connectors/app/$appId",params:{owner:a,appId:i.appId},className:F,children:B},s.key):o?n.jsx(L,{to:"/$owner/connectors/device/$deviceId",params:{owner:a,deviceId:o.id},className:F,children:B},s.key):n.jsx(L,{to:"/$owner/connectors/$connectorKey",params:{owner:a,connectorKey:s.key},search:v||e?{instances:!0}:{},className:F,children:B},s.key)})})]})}function Ee(a,c){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${a===c-1?"":"border-b"}`}function we(a,c,r,m){if((c?.connection_count??0)>0)return!1;const h=r.some(d=>d.type==="none");return!!(!h&&r.some(d=>d.type==="oauth")&&m.oauth_app===0||!h&&r.some(d=>d.type==="env_keys")&&m.env===0||!h&&r.some(d=>d.type==="app_installation")&&!c||a.required_capability&&!c)}export{Le as component};
|
|
2
|
+
//# sourceMappingURL=index-DB1iWI_a.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{iR as r,j as e}from"./index-9YuSRymd.js";import{A as i}from"./agent-skills-route-B3vvvZZe.js";import"./agent-subpage-shell-CZJvnjNC.js";import"./agent-skill-context-DFucg4c4.js";import"./core.esm-BupT3V0i.js";import"./skill-editor-D_W3QlRz.js";import"./agent-loading-shells-B7v6Cffw.js";import"./agent-card-controls-CplnPhbv.js";function l(){const{owner:t,agentId:o}=r.useParams();return e.jsx(i,{owner:t,agentId:o})}export{l as component};
|
|
2
|
+
//# sourceMappingURL=index-DMNzF8Lf.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{v as t,j as i}from"./index-9YuSRymd.js";import{A as m}from"./activity-route-view-D7ORHntE.js";import"./record-activity-ZJntBfN_.js";import"./filter-editors-Bwhqj7lY.js";import"./connection-label-BobuYiAG.js";import"./source-record-panels-BdfOVPWn.js";import"./events-feed-DO3IiJO2.js";import"./conversations-table-D_HOe1jN.js";import"./clients-BhNl1tVq.js";import"./schema-value-normalization-CKdPjdPC.js";import"./card-jzhQrMDP.js";import"./client-rows-BYbsXGy9.js";import"./agent-loading-shells-B7v6Cffw.js";import"./member-scope-gate-DD4YBFn-.js";import"./public-shell-ready-DqX8AXfw.js";function y(){const{owner:o}=t.useParams(),r=t.useSearch();return i.jsx(m,{owner:o,search:r})}export{y as component};
|
|
2
|
+
//# sourceMappingURL=index-DyB3IzOA.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as x,j as n,B as p,a$ as T,b0 as C,b1 as S,a_ as L,aA as E,av as R,b2 as M,aR as N,b3 as I,ag as D,aS as P,L as j,b4 as W,b5 as B,b6 as O,b7 as z,aW as U,P as v,b8 as F,b9 as K,ba as H,bb as G,bc as Q,bd as A,be as Z,bf as q,bg as J,ai as V}from"./index-
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{r as x,j as n,B as p,a$ as T,b0 as C,b1 as S,a_ as L,aA as E,av as R,b2 as M,aR as N,b3 as I,ag as D,aS as P,L as j,b4 as W,b5 as B,b6 as O,b7 as z,aW as U,P as v,b8 as F,b9 as K,ba as H,bb as G,bc as Q,bd as A,be as Z,bf as q,bg as J,ai as V}from"./index-9YuSRymd.js";import{L as X}from"./list-skeleton-CepswBka.js";import{c as Y}from"./cronstrue-CWImw-kf.js";const ee=[{value:"all",label:"All"},{value:"event",label:"Event"},{value:"schedule",label:"Schedule"},{value:"manual",label:"Manual"}];function te({pending:e,onConfirm:t}){const[s,o]=x.useState(!1);return s?n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(p,{type:"button",variant:"destructive",size:"sm",disabled:e,onClick:t,children:"Delete"}),n.jsx(p,{type:"button",variant:"ghost",size:"sm",onClick:()=>o(!1),children:"Cancel"})]}):n.jsx(p,{type:"button",variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive","aria-label":"Delete",onClick:()=>o(!0),children:n.jsx(T,{className:"h-4 w-4"})})}function ne(e){try{return Y.toString(e.trim(),{throwExceptionOnParseError:!0})}catch{return`On schedule ${e.trim()}`}}function se(e){return e.toLowerCase()==="github"?"GitHub":C(e)}function ae(e){return C(e.replace(/^\$/,""))}function oe(e){if(!e||typeof e!="object"||Array.isArray(e))return"";const t=e;return typeof t.repository=="string"?` in ${t.repository}`:typeof t.channel_id=="string"?` in #${t.channel_id}`:typeof t.resource_ref=="string"?` for ${t.resource_ref}`:""}function re(e){return Array.isArray(e.triggers)?e.triggers.filter(t=>!!t&&typeof t=="object"):[]}function ie(e){if(e.kind==="schedule"&&typeof e.cron=="string")return ne(e.cron);if(e.kind==="event"&&e.source!=="workspace"&&typeof e.connector_key=="string"){const t=Array.isArray(e.event_types)?e.event_types.filter(o=>typeof o=="string"):[],s=t.length>0?t.join(" or "):"an event";return`${se(e.connector_key)} sends ${s}${oe(e.match)}`}if(e.kind==="event"&&e.source==="workspace"){const t=Array.isArray(e.event_types)?e.event_types.filter(l=>typeof l=="string"):[],s=t.length>0?t.join(" or "):"an event",o=typeof e.entity_type=="string"?` on ${ae(e.entity_type)}`:"";return`another Automation writes ${s}${o}`}return null}function le(e){return e.health==="degraded"?"error":"enabled"}function ce(e){const t=re(e),s=e.name?.trim()||"Untitled automation",o=t.some(r=>r.kind==="event"),l=t.some(r=>r.kind==="schedule"),m=o?"event":l?"schedule":"manual",u=t.map(ie).filter(r=>!!r);let d="When started manually";u.length===1?d=`When ${u[0]}`:u.length>1&&(d=`When ${u[0]}${u.slice(1).map(r=>`, or when ${r}`).join("")}`);const i=t.some(r=>r.kind==="event"&&r.output==="reply_to_source")?"source":"silent";return{key:`automation:${e.automation_id}`,kind:m,when:d,does:s,output:{destination:i},state:le(e),sortTime:e.next_run_at?Date.parse(e.next_run_at):null,automation:e}}const y={event:0,schedule:1,manual:2};function ue(e){return e.map(ce).sort((t,s)=>t.state!==s.state?t.state==="enabled"?-1:1:y[t.kind]!==y[s.kind]?y[t.kind]-y[s.kind]:t.sortTime!==s.sortTime?t.sortTime===null?1:s.sortTime===null?-1:t.sortTime-s.sortTime:t.when.localeCompare(s.when)||t.key.localeCompare(s.key))}const de={kind:"all",output:"any",state:"any"};function me(e,t){return e.filter(s=>(t.kind==="all"||s.kind===t.kind)&&(t.output==="any"||(t.output==="reply"?s.output.destination==="source":s.output.destination==="silent"))&&(t.state==="any"||(t.state==="active"?s.state==="enabled":s.state==="error")))}const w="bg-muted text-muted-foreground",fe={event:{label:"Event",icon:z},schedule:{label:"Schedule",icon:O},manual:{label:"Manual",icon:B}};function he({agentName:e,deviceLabel:t}){const s=t?{label:t,icon:H}:e?{label:e,icon:G}:{label:"Manual · any client",icon:Q},{label:o,icon:l}=s;return n.jsxs(v,{variant:"secondary",className:w,children:[n.jsx(l,{className:"h-3 w-3"}),o]})}function xe({lastRunAt:e,nextRunAt:t}){const s=e?`Ran ${A(e)}`:t?`Next run ${A(t)}`:"Never run";return n.jsxs(v,{variant:"secondary",className:w,children:[n.jsx(Z,{className:"h-3 w-3"}),s]})}function pe({count:e}){return e<=0?null:n.jsxs(v,{variant:"secondary",className:w,children:[n.jsx(q,{className:"h-3 w-3"}),e," ",e===1?"client":"clients"]})}function ye(e){const t=Array.isArray(e.triggers)?e.triggers:[];for(const s of t)if(s&&typeof s=="object"&&s.kind==="event"&&s.source!=="workspace"&&typeof s.connector_key=="string")return s.connector_key;return null}function ve(e,t){return`flex items-center gap-3 px-3 py-2.5 text-left transition-colors hover:bg-accent/50 ${e===t-1?"":"border-b"}`}function ge({automation:e,agentName:t,deviceLabel:s,connectorDisplay:o,owner:l,onRemove:m,removing:u,rowClass:d}){const i=e.automation,r=i.automation_id,g=fe[e.kind],b=i.entity_name&&i.entity_type?`${i.entity_name} · ${i.entity_type}`:null,f=[e.when,b].filter(Boolean).join(" — "),h=i.health==="degraded"?i.health_reasons?.[0]||"Needs attention":null;return n.jsxs("div",{className:d,children:[n.jsxs(j,{to:"/$owner/automations/$automationId",params:{owner:l,automationId:r},search:{view:"activity",run_id:void 0},className:"flex min-w-0 flex-1 items-center gap-3",children:[o?n.jsx(U,{icon:o.icon,iconUrl:o.iconUrl,name:o.name,faviconDomain:o.faviconDomain,className:"h-7 w-7 shrink-0 rounded-md text-[10px]"}):n.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:n.jsx(g.icon,{className:"h-3.5 w-3.5 text-muted-foreground"})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("span",{className:"truncate text-sm font-medium",children:e.does}),n.jsx(he,{agentName:t,deviceLabel:s}),n.jsx(xe,{lastRunAt:i.last_run_completed_at??i.last_fired_at??null,nextRunAt:i.next_run_at??null}),n.jsx(pe,{count:i.processing_client_count??0}),h?n.jsxs(v,{variant:"secondary",className:"max-w-full whitespace-normal bg-amber-500/10 text-left text-amber-700 dark:text-amber-400",children:[n.jsx(F,{className:"h-3 w-3 shrink-0"}),h]}):null]}),f?n.jsx("p",{className:"truncate text-xs text-muted-foreground",children:f}):null]})]}),n.jsx(j,{to:"/$owner/automations/$automationId",params:{owner:l,automationId:r},search:{view:"definition",run_id:void 0},className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground","aria-label":"Edit",children:n.jsx(K,{className:"h-3.5 w-3.5"})}),n.jsx(te,{pending:u,onConfirm:m})]})}function be({owner:e,organizationId:t,isWorkspaceLoading:s}){const[o,l]=x.useState(de),m=S(t??void 0),{data:u=[]}=L({enabled:!!t}),{data:d=[]}=E(),{data:i=[]}=R(t),r=M(),g=x.useMemo(()=>{const a=new Map;for(const c of u)a.set(c.agentId,c.name);return a},[u]),b=x.useMemo(()=>{const a=new Map;for(const c of d)a.set(c.id,c.label||c.platform||c.id);return a},[d]),f=x.useMemo(()=>ue(m.data??[]),[m.data]),h=x.useMemo(()=>me(f,o),[f,o]),$=s||m.isLoading,_=n.jsx(p,{asChild:!0,size:"sm",className:"h-8 shrink-0 text-xs",children:n.jsxs(j,{to:"/$owner/automations/new",params:{owner:e},children:[n.jsx(W,{className:"mr-1.5 h-3.5 w-3.5"}),"New automation"]})});return $?n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex justify-end",children:_}),n.jsx(X,{label:"Loading automations",actions:!0})]}):n.jsxs("div",{className:"space-y-4",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"What runs on its own — on a schedule, on an event, or when you ask."}),n.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[n.jsx("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:ee.map(a=>n.jsx(p,{type:"button",variant:o.kind===a.value?"secondary":"ghost","aria-pressed":o.kind===a.value,size:"sm",className:"h-7 px-2 text-xs",onClick:()=>l(c=>({...c,kind:a.value})),children:a.label},a.value))}),n.jsx("div",{className:"ml-auto shrink-0",children:_})]}),f.length===0?n.jsx(N,{icon:I,title:"No automations yet",description:"Automations act on their own — reply to a message, run a nightly summary, react to a ticket. Use New automation to create one."}):h.length===0?n.jsx(N,{icon:D.automations.icon,title:"No automations match this filter",description:"Try another trigger type.",secondaryActionLabel:"Show all",secondaryOnAction:()=>l(a=>({...a,kind:"all"}))}):n.jsx("div",{className:"overflow-hidden rounded-lg border",children:h.map((a,c)=>n.jsx(ge,{automation:a,agentName:a.automation.managed_agent_id?g.get(a.automation.managed_agent_id)??a.automation.managed_agent_id:null,deviceLabel:a.automation.device_worker_id?b.get(a.automation.device_worker_id)??a.automation.device_worker_id:null,connectorDisplay:(()=>{const k=ye(a.automation);return k?P(k,i):null})(),owner:e,rowClass:ve(c,h.length),removing:r.isPending,onRemove:()=>r.mutate(a.automation.automation_id)},a.key))})]})}function ke(){const{owner:e}=J.useParams();return n.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-3 px-4 pt-2.5 pb-8 lg:px-6",children:n.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:n.jsx(V,{owner:e,children:t=>n.jsx("div",{className:"mx-auto flex min-h-0 w-full min-w-0 max-w-3xl flex-1 flex-col",children:n.jsx(be,{owner:t.ownerSlug,organizationId:t.organizationId,isWorkspaceLoading:t.isWorkspaceLoading})})})})})}export{ke as component};
|
|
2
|
+
//# sourceMappingURL=index-fgAJydgX.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as _,j as L,d$ as Ue,dF as Ve,Q as ze,af as _e}from"./index-DYCqXaMf.js";import{T as Be,P as be,E as S,S as J,g as qe,R as $e,V as Ke,F as ve,a as K,b as H,G as Q,W as Z,D as M,l as Qe,h as Ze,c as Ye,C as Xe,d as le,s as et,e as tt,j as nt}from"./index-CDz3-ieP.js";class x{constructor(e,n,l,i){this.fromA=e,this.toA=n,this.fromB=l,this.toB=i}offset(e,n=e){return new x(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function E(t,e,n,l,i,r){if(t==l)return[];let o=X(t,e,n,l,i,r),a=ee(t,e+o,n,l,i+o,r);e+=o,n-=a,i+=o,r-=a;let d=n-e,c=r-i;if(!d||!c)return[new x(e,n,i,r)];if(d>c){let s=t.slice(e,n).indexOf(l.slice(i,r));if(s>-1)return[new x(e,e+s,i,i),new x(e+s+c,n,r,r)]}else if(c>d){let s=l.slice(i,r).indexOf(t.slice(e,n));if(s>-1)return[new x(e,e,i,i+s),new x(n,n,i+s+d,r)]}if(d==1||c==1)return[new x(e,n,i,r)];let f=Me(t,e,n,l,i,r);if(f){let[s,u,h]=f;return E(t,e,s,l,i,u).concat(E(t,s+h,n,l,u+h,r))}return rt(t,e,n,l,i,r)}let G=1e9,R=0,Y=!1;function rt(t,e,n,l,i,r){let o=n-e,a=r-i;if(G<1e9&&Math.min(o,a)>G*16||R>0&&Date.now()>R)return Math.min(o,a)>G*64?[new x(e,n,i,r)]:oe(t,e,n,l,i,r);let d=Math.ceil((o+a)/2);V.reset(d),z.reset(d);let c=(h,m)=>t.charCodeAt(e+h)==l.charCodeAt(i+m),f=(h,m)=>t.charCodeAt(n-h-1)==l.charCodeAt(r-m-1),s=(o-a)%2!=0?z:null,u=s?null:V;for(let h=0;h<d;h++){if(h>G||R>0&&!(h&63)&&Date.now()>R)return oe(t,e,n,l,i,r);let m=V.advance(h,o,a,d,s,!1,c)||z.advance(h,o,a,d,u,!0,f);if(m)return it(t,e,n,e+m[0],l,i,r,i+m[1])}return[new x(e,n,i,r)]}class Le{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,n,l,i,r,o,a){for(let d=-e+this.start;d<=e-this.end;d+=2){let c=i+d,f=d==-e||d!=e&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,s=f-d;for(;f<n&&s<l&&a(f,s);)f++,s++;if(this.vec[c]=f,f>n)this.end+=2;else if(s>l)this.start+=2;else if(r){let u=i+(n-l)-d;if(u>=0&&u<this.len&&r.vec[u]!=-1)if(o){let h=r.vec[u];if(h>=n-f)return[h,i+h-u]}else{let h=n-r.vec[u];if(f>=h)return[f,s]}}}return null}}const V=new Le,z=new Le;function it(t,e,n,l,i,r,o,a){let d=!1;return!O(t,l)&&++l==n&&(d=!0),!O(i,a)&&++a==o&&(d=!0),d?[new x(e,n,r,o)]:E(t,e,l,i,r,a).concat(E(t,l,n,i,a,o))}function De(t,e){let n=1,l=Math.min(t,e);for(;n<l;)n=n<<1;return n}function X(t,e,n,l,i,r){if(e==n||e==r||t.charCodeAt(e)!=l.charCodeAt(i))return 0;let o=De(n-e,r-i);for(let a=e,d=i;;){let c=a+o,f=d+o;if(c>n||f>r||t.slice(a,c)!=l.slice(d,f)){if(o==1)return a-e-(O(t,a)?0:1);o=o>>1}else{if(c==n||f==r)return c-e;a=c,d=f}}}function ee(t,e,n,l,i,r){if(e==n||i==r||t.charCodeAt(n-1)!=l.charCodeAt(r-1))return 0;let o=De(n-e,r-i);for(let a=n,d=r;;){let c=a-o,f=d-o;if(c<e||f<i||t.slice(c,a)!=l.slice(f,d)){if(o==1)return n-a-(O(t,a)?0:1);o=o>>1}else{if(c==e||f==i)return n-c;a=c,d=f}}}function q(t,e,n,l,i,r,o,a){let d=l.slice(i,r),c=null;for(;;){if(c||o<a)return c;for(let f=e+o;;){O(t,f)||f++;let s=f+o;if(O(t,s)||(s+=s==f+1?1:-1),s>=n)break;let u=t.slice(f,s),h=-1;for(;(h=d.indexOf(u,h+1))!=-1;){let m=X(t,s,n,l,i+h+u.length,r),p=ee(t,e,f,l,i,i+h),g=u.length+m+p;(!c||c[2]<g)&&(c=[f-p,i+h-p,g])}f=s}if(a<0)return c;o=o>>1}}function Me(t,e,n,l,i,r){let o=n-e,a=r-i;if(o<a){let d=Me(l,i,r,t,e,n);return d&&[d[1],d[0],d[2]]}return o<4||a*2<o?null:q(t,e,n,l,i,r,Math.floor(o/4),-1)}function oe(t,e,n,l,i,r){Y=!0;let o=n-e,a=r-i,d;if(o<a){let u=q(l,i,r,t,e,n,Math.floor(o/6),50);d=u&&[u[1],u[0],u[2]]}else d=q(t,e,n,l,i,r,Math.floor(a/6),50);if(!d)return[new x(e,n,i,r)];let[c,f,s]=d;return E(t,e,c,l,i,f).concat(E(t,c+s,n,l,f+s,r))}function Se(t,e){for(let n=1;n<t.length;n++){let l=t[n-1],i=t[n];l.toA>i.fromA-e&&l.toB>i.fromB-e&&(t[n-1]=new x(l.fromA,i.toA,l.fromB,i.toB),t.splice(n--,1))}}function lt(t,e,n){for(;;){Se(n,1);let l=!1;for(let i=0;i<n.length;i++){let r=n[i],o,a;(o=X(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new x(r.fromA+o,r.toA,r.fromB+o,r.toB)),(a=ee(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new x(r.fromA,r.toA-a,r.fromB,r.toB-a));let d=r.toA-r.fromA,c=r.toB-r.fromB;if(d&&c)continue;let f=r.fromA-(i?n[i-1].toA:0),s=(i<n.length-1?n[i+1].fromA:t.length)-r.toA;if(!f||!s)continue;let u=d?t.slice(r.fromA,r.toA):e.slice(r.fromB,r.toB);f<=u.length&&t.slice(r.fromA-f,r.fromA)==u.slice(u.length-f)?(n[i]=new x(r.fromA-f,r.toA-f,r.fromB-f,r.toB-f),l=!0):s<=u.length&&t.slice(r.toA,r.toA+s)==u.slice(0,s)&&(n[i]=new x(r.fromA+s,r.toA+s,r.fromB+s,r.toB+s),l=!0)}if(!l)break}return n}function ot(t,e,n){for(let l=0,i=0;i<t.length;i++){let r=t[i],o=r.toA-r.fromA,a=r.toB-r.fromB;if(o&&a||o>3||a>3){let d=i==t.length-1?e.length:t[i+1].fromA,c=r.fromA-l,f=d-r.toA,s=fe(e,r.fromA,c),u=ae(e,r.toA,f),h=r.fromA-s,m=u-r.toA;if((!o||!a)&&h&&m){let p=Math.max(o,a),[g,A,T]=o?[e,r.fromA,r.toA]:[n,r.fromB,r.toB];p>h&&e.slice(s,r.fromA)==g.slice(T-h,T)?(r=t[i]=new x(s,s+o,r.fromB-h,r.toB-h),s=r.fromA,u=ae(e,r.toA,d-r.toA)):p>m&&e.slice(r.toA,u)==g.slice(A,A+m)&&(r=t[i]=new x(u-o,u,r.fromB+m,r.toB+m),u=r.toA,s=fe(e,r.fromA,r.fromA-l)),h=r.fromA-s,m=u-r.toA}if(h||m)r=t[i]=new x(r.fromA-h,r.toA+m,r.fromB-h,r.toB+m);else if(o){if(!a){let p=de(e,r.fromA,r.toA),g,A=p<0?-1:se(e,r.toA,r.fromA);p>-1&&(g=p-r.fromA)<=f&&e.slice(r.fromA,p)==e.slice(r.toA,r.toA+g)?r=t[i]=r.offset(g):A>-1&&(g=r.toA-A)<=c&&e.slice(r.fromA-g,r.fromA)==e.slice(A,r.toA)&&(r=t[i]=r.offset(-g))}}else{let p=de(n,r.fromB,r.toB),g,A=p<0?-1:se(n,r.toB,r.fromB);p>-1&&(g=p-r.fromB)<=f&&n.slice(r.fromB,p)==n.slice(r.toB,r.toB+g)?r=t[i]=r.offset(g):A>-1&&(g=r.toB-A)<=c&&n.slice(r.fromB-g,r.fromB)==n.slice(A,r.toB)&&(r=t[i]=r.offset(-g))}}l=r.toA}return Se(t,3),t}let y;try{y=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function ye(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function Ee(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?ye(n)?1:0:y?!Ne(n)||e==t.length-1?y.test(String.fromCharCode(n))?1:0:y.test(t.slice(e,e+2))?2:0:0}function je(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?ye(n)?1:0:y?!Te(n)||e==1?y.test(String.fromCharCode(n))?1:0:y.test(t.slice(e-2,e))?2:0:0}const Oe=8;function ae(t,e,n){if(e==t.length||!je(t,e))return e;for(let l=e,i=e+n,r=0;r<Oe;r++){let o=Ee(t,l);if(!o||l+o>i)return l;l+=o}return e}function fe(t,e,n){if(!e||!Ee(t,e))return e;for(let l=e,i=e-n,r=0;r<Oe;r++){let o=je(t,l);if(!o||l-o<i)return l;l-=o}return e}function se(t,e,n){for(;e!=n;e--)if(t.charCodeAt(e-1)==10)return e;return-1}function de(t,e,n){for(;e!=n;e++)if(t.charCodeAt(e)==10)return e;return-1}const Ne=t=>t>=55296&&t<=56319,Te=t=>t>=56320&&t<=57343;function O(t,e){return!e||e==t.length||!Ne(t.charCodeAt(e-1))||!Te(t.charCodeAt(e))}function at(t,e,n){var l;let i=n?.override;return i?i(t,e):(G=((l=n?.scanLimit)!==null&&l!==void 0?l:1e9)>>1,R=n?.timeout?Date.now()+n.timeout:0,Y=!1,lt(t,e,E(t,0,t.length,e,0,e.length)))}function Fe(){return!Y}function Ge(t,e,n){return ot(at(t,e,n),t,e)}const D=ve.define({combine:t=>t[0]}),ft=K.define(),Re=ve.define(),k=J.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(ft)&&(t=n.value);for(let n of e.state.facet(Re))t=n(t,e);return t}});class j{constructor(e,n,l,i,r,o=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=i,this.toB=r,this.precise=o}offset(e,n){return e||n?new j(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,l){let i=Ge(e.toString(),n.toString(),l);return Ie(i,e,n,0,0,Fe())}static updateA(e,n,l,i,r){return ge(me(e,i,!0,l.length),e,n,l,r)}static updateB(e,n,l,i,r){return ge(me(e,i,!1,n.length),e,n,l,r)}}function ce(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.to==t&&r.to==e&&t<n.length&&e<l.length?[t+1,e+1]:[i.from,r.from]}function ue(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.from==t&&r.from==e?[t,e]:[i.to+1,r.to+1]}function Ie(t,e,n,l,i,r){let o=[];for(let a=0;a<t.length;a++){let d=t[a],[c,f]=ce(d.fromA+l,d.fromB+i,e,n),[s,u]=ue(d.toA+l,d.toB+i,e,n),h=[d.offset(-c+l,-f+i)];for(;a<t.length-1;){let m=t[a+1],[p,g]=ce(m.fromA+l,m.fromB+i,e,n);if(p>s+1&&g>u+1)break;h.push(m.offset(-c+l,-f+i)),[s,u]=ue(m.toA+l,m.toB+i,e,n),a++}o.push(new j(h,c,Math.max(c,s),f,Math.max(f,u),r))}return o}const W=1e3;function he(t,e,n,l){let i=0,r=t.length;for(;;){if(i==r){let f=0,s=0;i&&({toA:f,toB:s}=t[i-1]);let u=e-(n?f:s);return[f+u,s+u]}let o=i+r>>1,a=t[o],[d,c]=n?[a.fromA,a.toA]:[a.fromB,a.toB];if(d>e)r=o;else if(c<=e)i=o+1;else return l?[a.fromA,a.fromB]:[a.toA,a.toB]}}function me(t,e,n,l){let i=[];return e.iterChangedRanges((r,o,a,d)=>{let c=0,f=n?e.length:l,s=0,u=n?l:e.length;r>W&&([c,s]=he(t,r-W,n,!0)),o<e.length-W&&([f,u]=he(t,o+W,n,!1));let h=d-a-(o-r),m,[p,g]=n?[h,0]:[0,h];i.length&&(m=i[i.length-1]).toA>=c?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:f,toB:u,diffA:m.diffA+p,diffB:m.diffB+g}:i.push({fromA:c,toA:f,fromB:s,toB:u,diffA:p,diffB:g})}),i}function ge(t,e,n,l,i){if(!t.length)return e;let r=[];for(let o=0,a=0,d=0,c=0;;o++){let f=o==t.length?null:t[o],s=f?f.fromA+a:n.length,u=f?f.fromB+d:l.length;for(;c<e.length;){let g=e[c];if(f&&(g.toA+a>s||g.toB+d>u))break;r.push(g.offset(a,d)),c++}if(!f)break;let h=f.toA+a+f.diffA,m=f.toB+d+f.diffB,p=Ge(n.sliceString(s,h),l.sliceString(u,m),i);for(let g of Ie(p,n,l,s,u,Fe()))r.push(g);for(a+=f.diffA,d+=f.diffB;c<e.length;){let g=e[c];if(g.fromA+a>h&&g.fromB+d>m)break;c++}}return r}const st={scanLimit:500},We=Ke.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Ce(t))}update(t){(t.docChanged||t.viewportChanged||dt(t.startState,t.state)||ct(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Ce(t.view))}},{decorations:t=>t.deco});function dt(t,e){return t.field(k,!1)!=e.field(k,!1)}function ct(t,e){return t.facet(D)!=e.facet(D)}const pe=M.line({class:"cm-changedLine"}),He=M.mark({class:"cm-changedText"}),ut=M.mark({tagName:"ins",class:"cm-insertedLine"}),ht=M.mark({tagName:"del",class:"cm-deletedLine"}),xe=new class extends Q{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function mt(t,e,n,l,i,r){let o=n?t.fromA:t.fromB,a=n?t.toA:t.toB,d=0;if(o!=a){i.add(o,o,pe),i.add(o,a,n?ht:ut),r&&r.add(o,o,xe);for(let c=e.iterRange(o,a-1),f=o;!c.next().done;){if(c.lineBreak){f++,i.add(f,f,pe),r&&r.add(f,f,xe);continue}let s=f+c.value.length;if(l)for(;d<t.changes.length;){let u=t.changes[d],h=o+(n?u.fromA:u.fromB),m=o+(n?u.toA:u.toB),p=Math.max(f,h),g=Math.min(s,m);if(p<g&&i.add(p,g,He),m<s)d++;else break}f=s}}}function Ce(t){let e=t.state.field(k),{side:n,highlightChanges:l,markGutter:i,overrideChunk:r}=t.state.facet(D),o=n=="a",a=new H,d=i?new H:null,{from:c,to:f}=t.viewport;for(let s of e){if((o?s.fromA:s.fromB)>=f)break;(o?s.toA:s.toB)>c&&(!r||!r(t.state,s,a,d))&&mt(s,t.state.doc,o,l,a,d)}return{deco:a.finish(),gutter:d&&d.finish()}}const $=K.define({map:(t,e)=>e.mapPos(t)});class gt extends Z{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let i=e.posAtDOM(l.target);e.dispatch({effects:$.of(i)});let{side:r,sibling:o}=e.state.facet(D);o&&o().dispatch({effects:$.of(pt(i,e.state.field(k),r=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function pt(t,e,n){let l=0,i=0;for(let r=0;;r++){let o=r<e.length?e[r]:null;if(!o||(n?o.fromA:o.fromB)>=t)return i+(t-l);[l,i]=n?[o.toA,o.toB]:[o.toB,o.toA]}}const xt=J.define({create(t){return M.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is($)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(k)!=e.startState.field(k,!1)){let n=e.state.facet(D).side=="a",l=[];for(let i of e.state.field(k))t.between(n?i.fromA:i.fromB,n?i.toA:i.toB,r=>{l.push(r)});l.length&&(t=t.update({filter:i=>l.indexOf(i)<0}))}return t},provide:t=>S.decorations.from(t)});function Ct({margin:t=3,minSize:e=4}){return xt.init(n=>At(n,t,e))}function At(t,e,n){let l=new H,i=t.facet(D).side=="a",r=t.field(k),o=1;for(let a=0;;a++){let d=a<r.length?r[a]:null,c=a?o+e:1,f=d?t.doc.lineAt(i?d.fromA:d.fromB).number-1-e:t.doc.lines,s=f-c+1;if(s>=n&&l.add(t.doc.line(c).from,t.doc.line(f).to,M.replace({widget:new gt(s),block:!0})),!d)break;o=t.doc.lineAt(Math.min(t.doc.length,i?d.toA:d.toB)).number}return l.finish()}const kt=S.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),wt=new class extends Q{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Bt=be.low(qe({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(We))===null||e===void 0?void 0:e.gutter)||$e.empty},widgetMarker:(t,e)=>e instanceof Pe?wt:null}));function bt(t){var e;let n=typeof t.original=="string"?Be.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||st;return[be.low(We),Mt,kt,S.editorAttributes.of({class:"cm-merge-b"}),Re.of((i,r)=>{let o=r.effects.find(a=>a.is(te));return o&&(i=j.updateA(i,o.value.doc,r.startState.doc,o.value.changes,l)),r.docChanged&&(i=j.updateB(i,r.state.field(N),r.newDoc,r.changes,l)),i}),D.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:t.allowInlineDiffs?jt:void 0,side:"b"}),N.init(()=>n),t.gutter!==!1?Bt:[],t.collapseUnchanged?Ct(t.collapseUnchanged):[],k.init(i=>j.build(n,i.doc,l))]}const te=K.define(),N=J.define({create:()=>Be.empty,update(t,e){for(let n of e.effects)n.is(te)&&(t=n.value.doc);return t}}),Ae=new WeakMap;class Pe extends Z{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function vt(t,e,n){let l=Ae.get(e.changes);if(l)return l;let i=o=>{let{highlightChanges:a,syntaxHighlightDeletions:d,syntaxHighlightDeletionsMaxLength:c,mergeControls:f}=t.facet(D),s=document.createElement("div");if(s.className="cm-deletedChunk",f){let w=s.appendChild(document.createElement("div"));w.className="cm-chunkButtons";let b=C=>{C.preventDefault(),Lt(o,o.posAtDOM(s))},v=C=>{C.preventDefault(),Dt(o,o.posAtDOM(s))};if(typeof f=="function")w.appendChild(f("accept",b)),w.appendChild(f("reject",v));else{let C=w.appendChild(document.createElement("button"));C.name="accept",C.textContent=t.phrase("Accept"),C.onmousedown=b;let B=w.appendChild(document.createElement("button"));B.name="reject",B.textContent=t.phrase("Reject"),B.onmousedown=v}}if(n||e.fromA>=e.toA)return s;let u=o.state.field(N).sliceString(e.fromA,e.endA),h=d&&t.facet(Qe),m=T(),p=e.changes,g=0,A=!1;function T(){let w=s.appendChild(document.createElement("div"));return w.className="cm-deletedLine",w.appendChild(document.createElement("del"))}function I(w,b,v){for(let C=w;C<b;){if(u.charAt(C)==`
|
|
1
|
+
import{r as _,j as L,d$ as Ue,dF as Ve,Q as ze,af as _e}from"./index-9YuSRymd.js";import{T as Be,P as be,E as S,S as J,g as qe,R as $e,V as Ke,F as ve,a as K,b as H,G as Q,W as Z,D as M,l as Qe,h as Ze,c as Ye,C as Xe,d as le,s as et,e as tt,j as nt}from"./index-CDz3-ieP.js";class x{constructor(e,n,l,i){this.fromA=e,this.toA=n,this.fromB=l,this.toB=i}offset(e,n=e){return new x(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function E(t,e,n,l,i,r){if(t==l)return[];let o=X(t,e,n,l,i,r),a=ee(t,e+o,n,l,i+o,r);e+=o,n-=a,i+=o,r-=a;let d=n-e,c=r-i;if(!d||!c)return[new x(e,n,i,r)];if(d>c){let s=t.slice(e,n).indexOf(l.slice(i,r));if(s>-1)return[new x(e,e+s,i,i),new x(e+s+c,n,r,r)]}else if(c>d){let s=l.slice(i,r).indexOf(t.slice(e,n));if(s>-1)return[new x(e,e,i,i+s),new x(n,n,i+s+d,r)]}if(d==1||c==1)return[new x(e,n,i,r)];let f=Me(t,e,n,l,i,r);if(f){let[s,u,h]=f;return E(t,e,s,l,i,u).concat(E(t,s+h,n,l,u+h,r))}return rt(t,e,n,l,i,r)}let G=1e9,R=0,Y=!1;function rt(t,e,n,l,i,r){let o=n-e,a=r-i;if(G<1e9&&Math.min(o,a)>G*16||R>0&&Date.now()>R)return Math.min(o,a)>G*64?[new x(e,n,i,r)]:oe(t,e,n,l,i,r);let d=Math.ceil((o+a)/2);V.reset(d),z.reset(d);let c=(h,m)=>t.charCodeAt(e+h)==l.charCodeAt(i+m),f=(h,m)=>t.charCodeAt(n-h-1)==l.charCodeAt(r-m-1),s=(o-a)%2!=0?z:null,u=s?null:V;for(let h=0;h<d;h++){if(h>G||R>0&&!(h&63)&&Date.now()>R)return oe(t,e,n,l,i,r);let m=V.advance(h,o,a,d,s,!1,c)||z.advance(h,o,a,d,u,!0,f);if(m)return it(t,e,n,e+m[0],l,i,r,i+m[1])}return[new x(e,n,i,r)]}class Le{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,n,l,i,r,o,a){for(let d=-e+this.start;d<=e-this.end;d+=2){let c=i+d,f=d==-e||d!=e&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,s=f-d;for(;f<n&&s<l&&a(f,s);)f++,s++;if(this.vec[c]=f,f>n)this.end+=2;else if(s>l)this.start+=2;else if(r){let u=i+(n-l)-d;if(u>=0&&u<this.len&&r.vec[u]!=-1)if(o){let h=r.vec[u];if(h>=n-f)return[h,i+h-u]}else{let h=n-r.vec[u];if(f>=h)return[f,s]}}}return null}}const V=new Le,z=new Le;function it(t,e,n,l,i,r,o,a){let d=!1;return!O(t,l)&&++l==n&&(d=!0),!O(i,a)&&++a==o&&(d=!0),d?[new x(e,n,r,o)]:E(t,e,l,i,r,a).concat(E(t,l,n,i,a,o))}function De(t,e){let n=1,l=Math.min(t,e);for(;n<l;)n=n<<1;return n}function X(t,e,n,l,i,r){if(e==n||e==r||t.charCodeAt(e)!=l.charCodeAt(i))return 0;let o=De(n-e,r-i);for(let a=e,d=i;;){let c=a+o,f=d+o;if(c>n||f>r||t.slice(a,c)!=l.slice(d,f)){if(o==1)return a-e-(O(t,a)?0:1);o=o>>1}else{if(c==n||f==r)return c-e;a=c,d=f}}}function ee(t,e,n,l,i,r){if(e==n||i==r||t.charCodeAt(n-1)!=l.charCodeAt(r-1))return 0;let o=De(n-e,r-i);for(let a=n,d=r;;){let c=a-o,f=d-o;if(c<e||f<i||t.slice(c,a)!=l.slice(f,d)){if(o==1)return n-a-(O(t,a)?0:1);o=o>>1}else{if(c==e||f==i)return n-c;a=c,d=f}}}function q(t,e,n,l,i,r,o,a){let d=l.slice(i,r),c=null;for(;;){if(c||o<a)return c;for(let f=e+o;;){O(t,f)||f++;let s=f+o;if(O(t,s)||(s+=s==f+1?1:-1),s>=n)break;let u=t.slice(f,s),h=-1;for(;(h=d.indexOf(u,h+1))!=-1;){let m=X(t,s,n,l,i+h+u.length,r),p=ee(t,e,f,l,i,i+h),g=u.length+m+p;(!c||c[2]<g)&&(c=[f-p,i+h-p,g])}f=s}if(a<0)return c;o=o>>1}}function Me(t,e,n,l,i,r){let o=n-e,a=r-i;if(o<a){let d=Me(l,i,r,t,e,n);return d&&[d[1],d[0],d[2]]}return o<4||a*2<o?null:q(t,e,n,l,i,r,Math.floor(o/4),-1)}function oe(t,e,n,l,i,r){Y=!0;let o=n-e,a=r-i,d;if(o<a){let u=q(l,i,r,t,e,n,Math.floor(o/6),50);d=u&&[u[1],u[0],u[2]]}else d=q(t,e,n,l,i,r,Math.floor(a/6),50);if(!d)return[new x(e,n,i,r)];let[c,f,s]=d;return E(t,e,c,l,i,f).concat(E(t,c+s,n,l,f+s,r))}function Se(t,e){for(let n=1;n<t.length;n++){let l=t[n-1],i=t[n];l.toA>i.fromA-e&&l.toB>i.fromB-e&&(t[n-1]=new x(l.fromA,i.toA,l.fromB,i.toB),t.splice(n--,1))}}function lt(t,e,n){for(;;){Se(n,1);let l=!1;for(let i=0;i<n.length;i++){let r=n[i],o,a;(o=X(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new x(r.fromA+o,r.toA,r.fromB+o,r.toB)),(a=ee(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new x(r.fromA,r.toA-a,r.fromB,r.toB-a));let d=r.toA-r.fromA,c=r.toB-r.fromB;if(d&&c)continue;let f=r.fromA-(i?n[i-1].toA:0),s=(i<n.length-1?n[i+1].fromA:t.length)-r.toA;if(!f||!s)continue;let u=d?t.slice(r.fromA,r.toA):e.slice(r.fromB,r.toB);f<=u.length&&t.slice(r.fromA-f,r.fromA)==u.slice(u.length-f)?(n[i]=new x(r.fromA-f,r.toA-f,r.fromB-f,r.toB-f),l=!0):s<=u.length&&t.slice(r.toA,r.toA+s)==u.slice(0,s)&&(n[i]=new x(r.fromA+s,r.toA+s,r.fromB+s,r.toB+s),l=!0)}if(!l)break}return n}function ot(t,e,n){for(let l=0,i=0;i<t.length;i++){let r=t[i],o=r.toA-r.fromA,a=r.toB-r.fromB;if(o&&a||o>3||a>3){let d=i==t.length-1?e.length:t[i+1].fromA,c=r.fromA-l,f=d-r.toA,s=fe(e,r.fromA,c),u=ae(e,r.toA,f),h=r.fromA-s,m=u-r.toA;if((!o||!a)&&h&&m){let p=Math.max(o,a),[g,A,T]=o?[e,r.fromA,r.toA]:[n,r.fromB,r.toB];p>h&&e.slice(s,r.fromA)==g.slice(T-h,T)?(r=t[i]=new x(s,s+o,r.fromB-h,r.toB-h),s=r.fromA,u=ae(e,r.toA,d-r.toA)):p>m&&e.slice(r.toA,u)==g.slice(A,A+m)&&(r=t[i]=new x(u-o,u,r.fromB+m,r.toB+m),u=r.toA,s=fe(e,r.fromA,r.fromA-l)),h=r.fromA-s,m=u-r.toA}if(h||m)r=t[i]=new x(r.fromA-h,r.toA+m,r.fromB-h,r.toB+m);else if(o){if(!a){let p=de(e,r.fromA,r.toA),g,A=p<0?-1:se(e,r.toA,r.fromA);p>-1&&(g=p-r.fromA)<=f&&e.slice(r.fromA,p)==e.slice(r.toA,r.toA+g)?r=t[i]=r.offset(g):A>-1&&(g=r.toA-A)<=c&&e.slice(r.fromA-g,r.fromA)==e.slice(A,r.toA)&&(r=t[i]=r.offset(-g))}}else{let p=de(n,r.fromB,r.toB),g,A=p<0?-1:se(n,r.toB,r.fromB);p>-1&&(g=p-r.fromB)<=f&&n.slice(r.fromB,p)==n.slice(r.toB,r.toB+g)?r=t[i]=r.offset(g):A>-1&&(g=r.toB-A)<=c&&n.slice(r.fromB-g,r.fromB)==n.slice(A,r.toB)&&(r=t[i]=r.offset(-g))}}l=r.toA}return Se(t,3),t}let y;try{y=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function ye(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function Ee(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?ye(n)?1:0:y?!Ne(n)||e==t.length-1?y.test(String.fromCharCode(n))?1:0:y.test(t.slice(e,e+2))?2:0:0}function je(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?ye(n)?1:0:y?!Te(n)||e==1?y.test(String.fromCharCode(n))?1:0:y.test(t.slice(e-2,e))?2:0:0}const Oe=8;function ae(t,e,n){if(e==t.length||!je(t,e))return e;for(let l=e,i=e+n,r=0;r<Oe;r++){let o=Ee(t,l);if(!o||l+o>i)return l;l+=o}return e}function fe(t,e,n){if(!e||!Ee(t,e))return e;for(let l=e,i=e-n,r=0;r<Oe;r++){let o=je(t,l);if(!o||l-o<i)return l;l-=o}return e}function se(t,e,n){for(;e!=n;e--)if(t.charCodeAt(e-1)==10)return e;return-1}function de(t,e,n){for(;e!=n;e++)if(t.charCodeAt(e)==10)return e;return-1}const Ne=t=>t>=55296&&t<=56319,Te=t=>t>=56320&&t<=57343;function O(t,e){return!e||e==t.length||!Ne(t.charCodeAt(e-1))||!Te(t.charCodeAt(e))}function at(t,e,n){var l;let i=n?.override;return i?i(t,e):(G=((l=n?.scanLimit)!==null&&l!==void 0?l:1e9)>>1,R=n?.timeout?Date.now()+n.timeout:0,Y=!1,lt(t,e,E(t,0,t.length,e,0,e.length)))}function Fe(){return!Y}function Ge(t,e,n){return ot(at(t,e,n),t,e)}const D=ve.define({combine:t=>t[0]}),ft=K.define(),Re=ve.define(),k=J.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(ft)&&(t=n.value);for(let n of e.state.facet(Re))t=n(t,e);return t}});class j{constructor(e,n,l,i,r,o=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=i,this.toB=r,this.precise=o}offset(e,n){return e||n?new j(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,l){let i=Ge(e.toString(),n.toString(),l);return Ie(i,e,n,0,0,Fe())}static updateA(e,n,l,i,r){return ge(me(e,i,!0,l.length),e,n,l,r)}static updateB(e,n,l,i,r){return ge(me(e,i,!1,n.length),e,n,l,r)}}function ce(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.to==t&&r.to==e&&t<n.length&&e<l.length?[t+1,e+1]:[i.from,r.from]}function ue(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.from==t&&r.from==e?[t,e]:[i.to+1,r.to+1]}function Ie(t,e,n,l,i,r){let o=[];for(let a=0;a<t.length;a++){let d=t[a],[c,f]=ce(d.fromA+l,d.fromB+i,e,n),[s,u]=ue(d.toA+l,d.toB+i,e,n),h=[d.offset(-c+l,-f+i)];for(;a<t.length-1;){let m=t[a+1],[p,g]=ce(m.fromA+l,m.fromB+i,e,n);if(p>s+1&&g>u+1)break;h.push(m.offset(-c+l,-f+i)),[s,u]=ue(m.toA+l,m.toB+i,e,n),a++}o.push(new j(h,c,Math.max(c,s),f,Math.max(f,u),r))}return o}const W=1e3;function he(t,e,n,l){let i=0,r=t.length;for(;;){if(i==r){let f=0,s=0;i&&({toA:f,toB:s}=t[i-1]);let u=e-(n?f:s);return[f+u,s+u]}let o=i+r>>1,a=t[o],[d,c]=n?[a.fromA,a.toA]:[a.fromB,a.toB];if(d>e)r=o;else if(c<=e)i=o+1;else return l?[a.fromA,a.fromB]:[a.toA,a.toB]}}function me(t,e,n,l){let i=[];return e.iterChangedRanges((r,o,a,d)=>{let c=0,f=n?e.length:l,s=0,u=n?l:e.length;r>W&&([c,s]=he(t,r-W,n,!0)),o<e.length-W&&([f,u]=he(t,o+W,n,!1));let h=d-a-(o-r),m,[p,g]=n?[h,0]:[0,h];i.length&&(m=i[i.length-1]).toA>=c?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:f,toB:u,diffA:m.diffA+p,diffB:m.diffB+g}:i.push({fromA:c,toA:f,fromB:s,toB:u,diffA:p,diffB:g})}),i}function ge(t,e,n,l,i){if(!t.length)return e;let r=[];for(let o=0,a=0,d=0,c=0;;o++){let f=o==t.length?null:t[o],s=f?f.fromA+a:n.length,u=f?f.fromB+d:l.length;for(;c<e.length;){let g=e[c];if(f&&(g.toA+a>s||g.toB+d>u))break;r.push(g.offset(a,d)),c++}if(!f)break;let h=f.toA+a+f.diffA,m=f.toB+d+f.diffB,p=Ge(n.sliceString(s,h),l.sliceString(u,m),i);for(let g of Ie(p,n,l,s,u,Fe()))r.push(g);for(a+=f.diffA,d+=f.diffB;c<e.length;){let g=e[c];if(g.fromA+a>h&&g.fromB+d>m)break;c++}}return r}const st={scanLimit:500},We=Ke.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Ce(t))}update(t){(t.docChanged||t.viewportChanged||dt(t.startState,t.state)||ct(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Ce(t.view))}},{decorations:t=>t.deco});function dt(t,e){return t.field(k,!1)!=e.field(k,!1)}function ct(t,e){return t.facet(D)!=e.facet(D)}const pe=M.line({class:"cm-changedLine"}),He=M.mark({class:"cm-changedText"}),ut=M.mark({tagName:"ins",class:"cm-insertedLine"}),ht=M.mark({tagName:"del",class:"cm-deletedLine"}),xe=new class extends Q{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function mt(t,e,n,l,i,r){let o=n?t.fromA:t.fromB,a=n?t.toA:t.toB,d=0;if(o!=a){i.add(o,o,pe),i.add(o,a,n?ht:ut),r&&r.add(o,o,xe);for(let c=e.iterRange(o,a-1),f=o;!c.next().done;){if(c.lineBreak){f++,i.add(f,f,pe),r&&r.add(f,f,xe);continue}let s=f+c.value.length;if(l)for(;d<t.changes.length;){let u=t.changes[d],h=o+(n?u.fromA:u.fromB),m=o+(n?u.toA:u.toB),p=Math.max(f,h),g=Math.min(s,m);if(p<g&&i.add(p,g,He),m<s)d++;else break}f=s}}}function Ce(t){let e=t.state.field(k),{side:n,highlightChanges:l,markGutter:i,overrideChunk:r}=t.state.facet(D),o=n=="a",a=new H,d=i?new H:null,{from:c,to:f}=t.viewport;for(let s of e){if((o?s.fromA:s.fromB)>=f)break;(o?s.toA:s.toB)>c&&(!r||!r(t.state,s,a,d))&&mt(s,t.state.doc,o,l,a,d)}return{deco:a.finish(),gutter:d&&d.finish()}}const $=K.define({map:(t,e)=>e.mapPos(t)});class gt extends Z{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let i=e.posAtDOM(l.target);e.dispatch({effects:$.of(i)});let{side:r,sibling:o}=e.state.facet(D);o&&o().dispatch({effects:$.of(pt(i,e.state.field(k),r=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function pt(t,e,n){let l=0,i=0;for(let r=0;;r++){let o=r<e.length?e[r]:null;if(!o||(n?o.fromA:o.fromB)>=t)return i+(t-l);[l,i]=n?[o.toA,o.toB]:[o.toB,o.toA]}}const xt=J.define({create(t){return M.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is($)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(k)!=e.startState.field(k,!1)){let n=e.state.facet(D).side=="a",l=[];for(let i of e.state.field(k))t.between(n?i.fromA:i.fromB,n?i.toA:i.toB,r=>{l.push(r)});l.length&&(t=t.update({filter:i=>l.indexOf(i)<0}))}return t},provide:t=>S.decorations.from(t)});function Ct({margin:t=3,minSize:e=4}){return xt.init(n=>At(n,t,e))}function At(t,e,n){let l=new H,i=t.facet(D).side=="a",r=t.field(k),o=1;for(let a=0;;a++){let d=a<r.length?r[a]:null,c=a?o+e:1,f=d?t.doc.lineAt(i?d.fromA:d.fromB).number-1-e:t.doc.lines,s=f-c+1;if(s>=n&&l.add(t.doc.line(c).from,t.doc.line(f).to,M.replace({widget:new gt(s),block:!0})),!d)break;o=t.doc.lineAt(Math.min(t.doc.length,i?d.toA:d.toB)).number}return l.finish()}const kt=S.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),wt=new class extends Q{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Bt=be.low(qe({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(We))===null||e===void 0?void 0:e.gutter)||$e.empty},widgetMarker:(t,e)=>e instanceof Pe?wt:null}));function bt(t){var e;let n=typeof t.original=="string"?Be.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||st;return[be.low(We),Mt,kt,S.editorAttributes.of({class:"cm-merge-b"}),Re.of((i,r)=>{let o=r.effects.find(a=>a.is(te));return o&&(i=j.updateA(i,o.value.doc,r.startState.doc,o.value.changes,l)),r.docChanged&&(i=j.updateB(i,r.state.field(N),r.newDoc,r.changes,l)),i}),D.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:t.allowInlineDiffs?jt:void 0,side:"b"}),N.init(()=>n),t.gutter!==!1?Bt:[],t.collapseUnchanged?Ct(t.collapseUnchanged):[],k.init(i=>j.build(n,i.doc,l))]}const te=K.define(),N=J.define({create:()=>Be.empty,update(t,e){for(let n of e.effects)n.is(te)&&(t=n.value.doc);return t}}),Ae=new WeakMap;class Pe extends Z{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function vt(t,e,n){let l=Ae.get(e.changes);if(l)return l;let i=o=>{let{highlightChanges:a,syntaxHighlightDeletions:d,syntaxHighlightDeletionsMaxLength:c,mergeControls:f}=t.facet(D),s=document.createElement("div");if(s.className="cm-deletedChunk",f){let w=s.appendChild(document.createElement("div"));w.className="cm-chunkButtons";let b=C=>{C.preventDefault(),Lt(o,o.posAtDOM(s))},v=C=>{C.preventDefault(),Dt(o,o.posAtDOM(s))};if(typeof f=="function")w.appendChild(f("accept",b)),w.appendChild(f("reject",v));else{let C=w.appendChild(document.createElement("button"));C.name="accept",C.textContent=t.phrase("Accept"),C.onmousedown=b;let B=w.appendChild(document.createElement("button"));B.name="reject",B.textContent=t.phrase("Reject"),B.onmousedown=v}}if(n||e.fromA>=e.toA)return s;let u=o.state.field(N).sliceString(e.fromA,e.endA),h=d&&t.facet(Qe),m=T(),p=e.changes,g=0,A=!1;function T(){let w=s.appendChild(document.createElement("div"));return w.className="cm-deletedLine",w.appendChild(document.createElement("del"))}function I(w,b,v){for(let C=w;C<b;){if(u.charAt(C)==`
|
|
2
2
|
`){m.firstChild||m.appendChild(document.createElement("br")),m=T(),C++;continue}let B=b,ne=v+(A?" cm-deletedText":""),re=!1,U=u.indexOf(`
|
|
3
3
|
`,C);if(U>-1&&U<b&&(B=U),a&&g<p.length){let F=Math.max(0,A?p[g].toA:p[g].fromA);F<=B&&(B=F,A&&g++,re=!0)}if(B>C){let F=document.createTextNode(u.slice(C,B));if(ne){let ie=m.appendChild(document.createElement("span"));ie.className=ne,ie.appendChild(F)}else m.appendChild(F);C=B}re&&(A=!A)}}if(h&&e.toA-e.fromA<=c){let w=h.parser.parse(u),b=0;Ze(w,{style:v=>Ye(t,v)},(v,C,B)=>{v>b&&I(b,v,""),I(v,C,B),b=C}),I(b,u.length,"")}else I(0,u.length,"");return m.firstChild||m.appendChild(document.createElement("br")),s},r=M.widget({block:!0,side:-1,widget:new Pe(i)});return Ae.set(e.changes,r),r}function Lt(t,e){let{state:n}=t,l=e??n.selection.main.head,i=t.state.field(k).find(d=>d.fromB<=l&&d.endB>=l);if(!i)return!1;let r=t.state.sliceDoc(i.fromB,Math.max(i.fromB,i.toB-1)),o=t.state.field(N);i.fromB!=i.toB&&i.toA<=o.length&&(r+=t.state.lineBreak);let a=Xe.of({from:i.fromA,to:Math.min(o.length,i.toA),insert:r},o.length);return t.dispatch({effects:te.of({doc:a.apply(o),changes:a}),userEvent:"accept"}),!0}function Dt(t,e){let{state:n}=t,l=e??n.selection.main.head,i=n.field(k).find(a=>a.fromB<=l&&a.endB>=l);if(!i)return!1;let o=n.field(N).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=n.doc.length&&(o+=n.lineBreak),t.dispatch({changes:{from:i.fromB,to:Math.min(n.doc.length,i.toB),insert:o},userEvent:"revert"}),!0}function ke(t){let e=new H;for(let n of t.field(k)){let l=t.facet(D).overrideChunk&&Je(t,n);e.add(n.fromB,n.fromB,vt(t,n,!!l))}return e.finish()}const Mt=J.define({create:t=>ke(t),update(t,e){return e.state.field(k,!1)!=e.startState.field(k,!1)?ke(e.state):t},provide:t=>S.decorations.from(t)}),we=new WeakMap;function Je(t,e){let n=we.get(e);if(n!==void 0)return n;n=null;let l=t.field(N),i=t.doc,r=l.lineAt(e.endA).number-l.lineAt(e.fromA).number+1,o=i.lineAt(e.endB).number-i.lineAt(e.fromB).number+1;e:if(r==o&&r<10){let a=[],d=0,c=e.fromA,f=e.fromB;for(let s of e.changes){if(s.fromA<s.toA){d+=s.toA-s.fromA;let u=l.sliceString(c+s.fromA,c+s.toA);if(/\n/.test(u))break e;a.push(M.widget({widget:new St(u),side:-1}).range(f+s.fromB))}s.fromB<s.toB&&a.push(He.range(f+s.fromB,f+s.toB))}d<e.endA-e.fromA-r*2&&(n=a)}return we.set(e,n),n}class St extends Z{constructor(e){super(),this.text=e}eq(e){return this.text==e.text}toDOM(e){let n=document.createElement("del");return n.className="cm-deletedText",n.textContent=this.text,n}}const yt=new class extends Q{constructor(){super(...arguments),this.elementClass="cm-inlineChangedLineGutter"}},Et=M.line({class:"cm-inlineChangedLine"});function jt(t,e,n,l){let i=Je(t,e),r=0;if(!i)return!1;for(let o=t.doc.lineAt(e.fromB);;){for(l&&l.add(o.from,o.from,yt),n.add(o.from,o.from,Et);r<i.length&&i[r].to<=o.to;){let a=i[r++];n.add(a.from,a.to,a.value)}if(o.to>=e.endB)break;o=t.doc.lineAt(o.to+1)}return!0}const Ot=S.theme({"&":{backgroundColor:"var(--background)",color:"var(--foreground)",fontSize:"12px",border:"1px solid var(--border)",borderRadius:"0.5rem",overflow:"hidden",width:"100%"},"& .cm-scroller":{overflow:"auto",maxHeight:"20rem",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace'},".cm-content":{padding:"6px 0"},".cm-gutters":{backgroundColor:"var(--muted)",color:"var(--muted-foreground)",border:"none",borderRight:"1px solid var(--border)"},".cm-changedLine":{backgroundColor:"color-mix(in oklch, var(--chart-2) 14%, transparent)"},".cm-changedText":{background:"color-mix(in oklch, var(--chart-2) 32%, transparent)"},".cm-deletedChunk":{backgroundColor:"color-mix(in oklch, var(--destructive) 10%, transparent)"},".cm-deletedText":{background:"color-mix(in oklch, var(--destructive) 28%, transparent)"},".cm-collapsedLines":{background:"var(--muted)",color:"var(--muted-foreground)",padding:"2px 8px"}});function P(t){if(Array.isArray(t))return t.map(P);if(t&&typeof t=="object"){const e={};for(const n of Object.keys(t).sort())e[n]=P(t[n]);return e}return t}function Nt({before:t,after:e}){const n=_.useRef(null);return _.useEffect(()=>{if(!n.current)return;const l=new S({state:le.create({doc:e,extensions:[le.readOnly.of(!0),S.editable.of(!1),S.lineWrapping,et(tt,{fallback:!0}),nt(),bt({original:t,mergeControls:!1,gutter:!0,collapseUnchanged:{margin:3,minSize:4}}),Ot]}),parent:n.current});return()=>l.destroy()},[t,e]),L.jsx("div",{ref:n,className:"w-full"})}function Gt({before:t,after:e}){const[n,l]=_.useState(!1);if(!t&&!e)return null;const i=!!(t&&e);return L.jsxs("div",{className:"mt-2",children:[L.jsxs("button",{type:"button",onClick:()=>l(!n),className:"flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground",children:[n?L.jsx(Ue,{className:"h-3 w-3"}):L.jsx(Ve,{className:"h-3 w-3"}),i?n?"Hide diff":"Show diff":n?"Hide details":"Show details"]}),n&&(i?L.jsx("div",{className:"mt-2",children:L.jsx(Nt,{before:JSON.stringify(P(t),null,2),after:JSON.stringify(P(e),null,2)})}):L.jsxs("div",{className:"mt-2",children:[L.jsx("p",{className:"mb-1 text-[10px] font-medium uppercase text-muted-foreground",children:e?"After":"Before"}),L.jsx("pre",{className:ze(_e,"max-h-48 overflow-auto p-2 text-xs"),children:JSON.stringify(e??t,null,2)})]}))]})}export{Gt as J};
|
|
4
|
-
//# sourceMappingURL=json-diff-
|
|
4
|
+
//# sourceMappingURL=json-diff-DIN5Jhfx.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as s,S as e}from"./index-
|
|
2
|
-
//# sourceMappingURL=list-skeleton-
|
|
1
|
+
import{j as s,S as e}from"./index-9YuSRymd.js";function m({label:r,actions:l=!1}){return s.jsx("div",{className:"overflow-hidden rounded-lg border",role:"status","aria-label":r,children:Array.from({length:4},(d,a)=>s.jsxs("div",{className:`flex items-center gap-3 px-3 py-2.5 ${a===3?"":"border-b"}`,children:[s.jsx(e,{className:"h-7 w-7 shrink-0 rounded-md"}),s.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[s.jsx(e,{className:"h-4 w-40"}),s.jsx(e,{className:"h-3 w-24"})]}),l?s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(e,{className:"h-8 w-8 rounded-md"}),s.jsx(e,{className:"h-8 w-8 rounded-md"})]}):null]},a))})}export{m as L};
|
|
2
|
+
//# sourceMappingURL=list-skeleton-CepswBka.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as ke,$ as Ne,i as Se,a0 as Ce,w as Ee,r as s,a1 as ae,j as e,a2 as b,a3 as Le,a4 as ce,a5 as $,a6 as Fe,a7 as Ue,a8 as Pe,W as Me,J as Ie,Y as ze,a9 as oe}from"./index-DYCqXaMf.js";import{C as Ae,c as Re}from"./card-yU0TmNRH.js";function q(o){if(!o||typeof o!="object")return null;const f=o.error;if(typeof f=="string")return f;if(f&&typeof f=="object"){const y=f.message;if(typeof y=="string"&&y.length>0)return y}const m=o.message;return typeof m=="string"&&m.length>0?m:null}async function le(o,f){if(typeof window>"u")return;const m=window.PasswordCredential;if(!(!m||!navigator.credentials?.store))try{const y=new m({id:o,password:f});await navigator.credentials.store(y)}catch{}}function $e({domain:o}){const[f,m]=s.useState(!1);return!(o.length>0&&o.length<=253&&/^[A-Za-z0-9.-]+$/.test(o))||f?e.jsx(ce,{className:"w-4 h-4"}):e.jsx("img",{src:`https://www.google.com/s2/favicons?domain=${encodeURIComponent(o)}&sz=32`,alt:"",width:16,height:16,className:"h-4 w-4",onError:()=>m(!0)})}function E(o){return o?o.toLowerCase().replaceAll("_"," ").trim().includes("account not linked")?"This social account matches an existing Lobu user. Sign in with a magic link to verify ownership, then continue.":o:null}function Be(){const o=ke(),f=Ne(),{session:m,isReady:y}=Se(),{data:i,isLoading:F,error:W}=Ce(),l=Ee({from:"/auth/login"}),B=l.invitationOrg,[p,j]=s.useState("social"),[d,P]=s.useState(l.intent??"sign-in"),[O,de]=s.useState(""),[a,T]=s.useState(()=>l.loginHint??""),[k,ue]=s.useState(""),[N,me]=s.useState(""),[M,V]=s.useState(""),[ge,J]=s.useState(!1),[c,u]=s.useState(null),[I,r]=s.useState(null),[Q,G]=s.useState(!1),[fe,K]=s.useState(!1),[Y,pe]=s.useState(!1),Z=s.useRef(!1),L=l.callbackUrl,X=l.mode==="extension",D=l.error==="account_not_linked",ee=E(l.errorDescription||l.error),z=Object.values(i?.social??{}).some(Boolean),w=!!i?.magicLink,A=!!i?.phone,h=!!i?.emailPassword,te=!!i?.passkey,x=!!i?.singleUserMode,ne=!!i?.hasUser,H=x,U=p==="magic-link"&&w&&Q,v=s.useMemo(()=>{const t=[];return h&&t.push("email-password"),z&&t.push("social"),w&&t.push("magic-link"),A&&t.push("whatsapp"),t},[h,w,z,A]),he=s.useMemo(()=>h?v.filter(t=>t!=="magic-link"&&t!=="social"):v,[v,h]),_=W instanceof Error?W.message:W?"Unable to load sign-in options.":null;s.useEffect(()=>{if(m){const t=ae(L);L?window.location.href=t:o({to:"/"})}},[m,o,L]),s.useEffect(()=>{!i||v.length===0||v.includes(p)||j(v[0])},[i,p,v]),s.useEffect(()=>{!w||!D||(j("magic-link"),l.loginHint&&!a&&T(l.loginHint))},[w,D,l.loginHint,a]),s.useEffect(()=>{l.intent&&P(l.intent)},[l.intent]),s.useEffect(()=>{if(!x||!i)return;const t=ne?"sign-in":"sign-up";d!==t&&P(t)},[x,ne,i,d]);const S=()=>L?ae(L):"/",se=async(t,{quiet:n=!1}={})=>{u(t),r(null);try{const g=await $.social({provider:t,callbackURL:S(),newUserCallbackURL:L?S():`/?onboard_provider=${encodeURIComponent(t)}`}),C=q(g);if(C&&!n){const R=E(C);R?.toLowerCase().includes("magic link")&&j("magic-link"),r(R)}}catch(g){if(n)return;r(E(g instanceof Error?g.message:`Failed to sign in with ${t}`))}finally{u(null)}};s.useEffect(()=>{if(Z.current||!y||m||F||!i||l.error)return;const t=l.provider;if(!t)return;Z.current=!0;const n=Object.hasOwn(i.social??{},t)&&!!i.social?.[t];se(t,{quiet:!n})},[i,F,m,y,l.provider,l.error]);const re=async()=>{if(a){u("magic-link"),r(null);try{return await $.magicLink({email:a,callbackURL:S()}),G(!0),!0}catch(t){return r(t instanceof Error?t.message:"Failed to send magic link"),!1}finally{u(null)}}},xe=async t=>{t.preventDefault(),await re()},be=async t=>{if(t.preventDefault(),!(!a||!k)){u("email-password"),r(null);try{if(d==="sign-up"){const n=await Ue.email({email:a,password:k,name:O||a.split("@")[0]||"User",callbackURL:S()}),g=q(n);if(g){r(E(g));return}if(await le(a,k),await f.invalidateQueries({queryKey:["organizations"]}),x&&te)try{await Pe.passkey.addPasskey({name:O||`${navigator.platform||"This device"}`})}catch{}}else{const n=await $.email({email:a,password:k,callbackURL:S()}),g=q(n);if(g){r(E(g));return}if(!n?.data){r("Invalid email or password");return}await le(a,k)}}catch(n){const g=n instanceof Error?n.message:typeof n=="string"?n:q(n);r(g||"Authentication failed")}finally{u(null)}}},ie=async()=>{r(null),pe(!0),u("local");try{const t=await Fe();if(!t.ok){const n=await t.json().catch(()=>null);r(n?.error_description??"Could not sign in to your local install.");return}window.location.href=S()}catch(t){r(t instanceof Error?t.message:"Could not sign in to your local install.")}finally{u(null)}};s.useEffect(()=>{H&&i&&!m&&!Y&&ie()},[H,i,m,Y]);const ye=async()=>{if(!a){r("Enter your email address first to reset your password.");return}u("reset-password-request"),r(null);try{const t=`${window.location.origin}/auth/reset-password`,n=await Me(`${Ie}/api/auth/request-password-reset`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:a,redirectTo:t})});if(!n.ok)throw await ze(n);K(!0)}catch(t){r(t instanceof Error?t.message:"Failed to send password reset email")}finally{u(null)}},je=async t=>{if(t.preventDefault(),!!N){u("phone"),r(null);try{await oe.sendOtp({phoneNumber:N}),J(!0)}catch(n){r(n instanceof Error?n.message:"Failed to send verification code")}finally{u(null)}}},we=async t=>{if(t.preventDefault(),!(!N||!M)){u("verify"),r(null);try{await oe.verify({phoneNumber:N,code:M})}catch(n){r(n instanceof Error?n.message:"Invalid verification code"),u(null)}}};return e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:e.jsxs("div",{className:"w-full max-w-md p-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"mx-auto mb-6 h-8 w-auto"}),e.jsx("h1",{className:"text-2xl font-bold",children:B?`Sign in to join ${B}`:x&&d==="sign-up"?"Set up your local install":x?"Welcome back":d==="sign-up"?"Create your account":"Sign in"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:B?"Sign in with the email your invitation was sent to.":x&&d==="sign-up"?"This account stays on this machine. Email is just an identifier — pick anything you’ll remember.":x?"Sign in to your local install.":X?"Sign in to connect the browser extension":d==="sign-up"?"Choose a sign-up method":"Choose your preferred sign-in method"}),x&&e.jsxs("div",{className:"mt-3 inline-flex items-center gap-2 px-3 py-1.5 bg-muted text-muted-foreground rounded-full text-xs",children:[e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),"Local install · nothing sent to lobu.ai"]}),X&&e.jsxs("div",{className:"mt-3 inline-flex items-center gap-2 px-3 py-1.5 bg-primary/10 text-primary rounded-full text-sm",children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),"Browser Extension"]})]}),e.jsx(Ae,{children:e.jsx(Re,{children:H?e.jsx("div",{className:"space-y-4",children:I?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:I}),e.jsx("button",{type:"button",disabled:c!==null,onClick:ie,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:"Try again"})]}):e.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[e.jsx(b,{size:"lg"}),e.jsx("span",{children:"Signing you into your local install…"})]})}):e.jsxs(e.Fragment,{children:[F&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[e.jsx(b,{size:"lg"}),e.jsx("span",{children:"Loading sign-in options…"})]}),!F&&_&&e.jsxs("div",{className:"text-sm text-destructive",children:["Failed to load sign-in options. ",_]}),!F&&!_&&v.length===0&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"No sign-in methods are configured. Contact support for access."}),h&&!U&&e.jsxs("div",{className:"mb-4 flex rounded-lg border p-1",children:[e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${d==="sign-in"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>P("sign-in"),children:"Sign In"}),e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${d==="sign-up"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>P("sign-up"),children:"Sign Up"})]}),!U&&he.length>1&&e.jsxs("div",{className:"mb-6 flex rounded-lg border p-1",children:[h&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${p==="email-password"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>j("email-password"),children:"Email + Password"}),z&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${p==="social"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>j("social"),children:"Social"}),!h&&w&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${p==="magic-link"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>j("magic-link"),children:"Magic Link"}),A&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${p==="whatsapp"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>j("whatsapp"),children:"WhatsApp"})]}),D&&e.jsx("div",{className:"mb-4 rounded-lg border border-amber-300 bg-amber-50 p-3 text-sm text-amber-900",children:"We found an existing account for this identity. To protect the account, verify with a magic link before linking social sign-in."}),ee&&e.jsx("div",{className:"mb-4 p-3 text-sm text-destructive bg-destructive/10 rounded-lg",children:ee}),I&&e.jsx("div",{className:"mb-4 p-3 text-sm text-destructive bg-destructive/10 rounded-lg",children:I}),!U&&(h||p==="social")&&z&&e.jsxs("div",{className:"space-y-3",children:[Object.entries(i?.social??{}).filter(([,t])=>t).map(([t])=>{const n=Le.find(ve=>ve.provider===t),g=n?.icon,C=i?.socialMeta?.[t],R=n?.name??C?.name??t.charAt(0).toUpperCase()+t.slice(1);return e.jsxs("button",{type:"button",onClick:()=>se(t),disabled:c!==null,className:"w-full flex items-center justify-center gap-3 h-10 px-4 border border-input rounded-lg bg-background hover:bg-accent hover:text-accent-foreground transition-colors disabled:opacity-50",children:[c===t?e.jsx(b,{size:"lg"}):g?e.jsx(g,{className:"w-4 h-4"}):C?.faviconDomain?e.jsx($e,{domain:C.faviconDomain},C.faviconDomain):e.jsx(ce,{className:"w-4 h-4"}),"Continue with ",R]},t)}),h&&e.jsxs("div",{className:"relative my-2",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full border-t"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-card px-2 text-muted-foreground",children:"or"})})]})]}),!U&&h&&e.jsxs("form",{onSubmit:be,className:"space-y-4",children:[d==="sign-up"&&e.jsxs("div",{children:[e.jsx("label",{htmlFor:"full-name",className:"block text-sm font-medium",children:"Full name"}),e.jsx("input",{id:"full-name",type:"text",value:O,onChange:t=>de(t.target.value),placeholder:"Jane Doe",className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email-password-email",className:"block text-sm font-medium",children:"Email address"}),e.jsx("input",{id:"email-password-email",type:"email",value:a,onChange:t=>{T(t.target.value),K(!1)},placeholder:"you@example.com",required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email-password-password",className:"block text-sm font-medium",children:"Password"}),e.jsx("input",{id:"email-password-password",type:"password",value:k,onChange:t=>ue(t.target.value),placeholder:"Enter a password",required:!0,minLength:8,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsx("button",{type:"submit",disabled:c!==null||!a||!k,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:c==="email-password"?e.jsxs(e.Fragment,{children:[e.jsx(b,{size:"lg"}),e.jsx("span",{className:"ml-2",children:d==="sign-up"?"Creating account...":"Signing in..."})]}):d==="sign-up"?x?"Create local account":"Create Account":"Sign In"}),d==="sign-in"&&te&&e.jsx("button",{type:"button",disabled:c!==null,onClick:async()=>{r(null),u("passkey");try{const t=await $.passkey();if(t?.error){const n=t.error.message??"Passkey sign-in failed.";r(E(n)??n);return}window.location.href=S()}catch(t){const n=t instanceof Error?t.message:String(t);r(E(n)??n)}finally{u(null)}},className:"flex h-10 w-full items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50",children:c==="passkey"?e.jsxs(e.Fragment,{children:[e.jsx(b,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Waiting for passkey…"})]}):"Sign in with passkey"}),d==="sign-in"&&w&&e.jsx("button",{type:"button",disabled:c!==null||!a,onClick:async()=>{await re()&&j("magic-link")},className:"flex h-10 w-full items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50",children:c==="magic-link"?e.jsxs(e.Fragment,{children:[e.jsx(b,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending magic link..."})]}):"Send me a magic link instead"}),d==="sign-in"&&e.jsx("button",{type:"button",disabled:c!==null||!a,onClick:ye,className:"flex h-10 w-full items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50",children:c==="reset-password-request"?e.jsxs(e.Fragment,{children:[e.jsx(b,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending reset email..."})]}):"Forgot password?"}),d==="sign-in"&&fe&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"If this email exists, we sent a password reset link."})]}),p==="magic-link"&&w&&(Q?e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"mb-4 flex justify-center",children:e.jsx("svg",{className:"h-12 w-12 text-primary",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),e.jsx("h2",{className:"text-lg font-medium",children:"Check your email"}),e.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["We sent a magic link to ",e.jsx("strong",{children:a}),".",e.jsx("br",{}),"Click the link in the email to sign in."]}),e.jsx("button",{type:"button",className:"mt-4 text-sm text-primary hover:underline",onClick:()=>G(!1),children:"Use a different email"})]}):e.jsxs("form",{onSubmit:xe,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email",className:"block text-sm font-medium",children:"Email address"}),e.jsx("input",{id:"email",type:"email",value:a,onChange:t=>T(t.target.value),placeholder:"you@example.com",required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsx("button",{type:"submit",disabled:c!==null||!a,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:c==="magic-link"?e.jsxs(e.Fragment,{children:[e.jsx(b,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending..."})]}):"Send Magic Link"})]})),!U&&p==="whatsapp"&&A&&(ge?e.jsxs("form",{onSubmit:we,className:"space-y-4",children:[e.jsxs("div",{className:"text-center text-sm text-muted-foreground",children:["Enter the 6-digit code sent to ",e.jsx("strong",{children:N})]}),e.jsx("div",{children:e.jsx("input",{type:"text",value:M,onChange:t=>V(t.target.value),placeholder:"000000",maxLength:6,pattern:"[0-9]{6}",required:!0,className:"block h-12 w-full rounded-md border border-input bg-background px-3 py-2 text-center text-xl tracking-widest placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})}),e.jsx("button",{type:"submit",disabled:c!==null||M.length!==6,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:c==="verify"?e.jsxs(e.Fragment,{children:[e.jsx(b,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Verifying..."})]}):"Verify & Sign In"}),e.jsx("button",{type:"button",className:"w-full text-sm text-primary hover:underline",onClick:()=>{J(!1),V("")},children:"Use a different number"})]}):e.jsxs("form",{onSubmit:je,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"phone",className:"block text-sm font-medium",children:"WhatsApp Number"}),e.jsx("input",{id:"phone",type:"tel",value:N,onChange:t=>me(t.target.value),placeholder:"+1234567890",required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Include country code (e.g., +1 for US)"})]}),e.jsx("button",{type:"submit",disabled:c!==null||!N,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:c==="phone"?e.jsxs(e.Fragment,{children:[e.jsx(b,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending..."})]}):"Send Code via WhatsApp"})]}))]})})})]})})}export{Be as component};
|
|
2
|
-
//# sourceMappingURL=login-
|
|
1
|
+
import{o as ke,$ as Ne,i as Se,a0 as Ce,w as Ee,r as s,a1 as ae,j as e,a2 as b,a3 as Le,a4 as ce,a5 as $,a6 as Fe,a7 as Ue,a8 as Pe,W as Me,J as Ie,Y as ze,a9 as oe}from"./index-9YuSRymd.js";import{C as Ae,c as Re}from"./card-jzhQrMDP.js";function q(o){if(!o||typeof o!="object")return null;const f=o.error;if(typeof f=="string")return f;if(f&&typeof f=="object"){const y=f.message;if(typeof y=="string"&&y.length>0)return y}const m=o.message;return typeof m=="string"&&m.length>0?m:null}async function le(o,f){if(typeof window>"u")return;const m=window.PasswordCredential;if(!(!m||!navigator.credentials?.store))try{const y=new m({id:o,password:f});await navigator.credentials.store(y)}catch{}}function $e({domain:o}){const[f,m]=s.useState(!1);return!(o.length>0&&o.length<=253&&/^[A-Za-z0-9.-]+$/.test(o))||f?e.jsx(ce,{className:"w-4 h-4"}):e.jsx("img",{src:`https://www.google.com/s2/favicons?domain=${encodeURIComponent(o)}&sz=32`,alt:"",width:16,height:16,className:"h-4 w-4",onError:()=>m(!0)})}function E(o){return o?o.toLowerCase().replaceAll("_"," ").trim().includes("account not linked")?"This social account matches an existing Lobu user. Sign in with a magic link to verify ownership, then continue.":o:null}function Be(){const o=ke(),f=Ne(),{session:m,isReady:y}=Se(),{data:i,isLoading:F,error:W}=Ce(),l=Ee({from:"/auth/login"}),B=l.invitationOrg,[p,j]=s.useState("social"),[d,P]=s.useState(l.intent??"sign-in"),[O,de]=s.useState(""),[a,T]=s.useState(()=>l.loginHint??""),[k,ue]=s.useState(""),[N,me]=s.useState(""),[M,V]=s.useState(""),[ge,J]=s.useState(!1),[c,u]=s.useState(null),[I,r]=s.useState(null),[Q,G]=s.useState(!1),[fe,K]=s.useState(!1),[Y,pe]=s.useState(!1),Z=s.useRef(!1),L=l.callbackUrl,X=l.mode==="extension",D=l.error==="account_not_linked",ee=E(l.errorDescription||l.error),z=Object.values(i?.social??{}).some(Boolean),w=!!i?.magicLink,A=!!i?.phone,h=!!i?.emailPassword,te=!!i?.passkey,x=!!i?.singleUserMode,ne=!!i?.hasUser,H=x,U=p==="magic-link"&&w&&Q,v=s.useMemo(()=>{const t=[];return h&&t.push("email-password"),z&&t.push("social"),w&&t.push("magic-link"),A&&t.push("whatsapp"),t},[h,w,z,A]),he=s.useMemo(()=>h?v.filter(t=>t!=="magic-link"&&t!=="social"):v,[v,h]),_=W instanceof Error?W.message:W?"Unable to load sign-in options.":null;s.useEffect(()=>{if(m){const t=ae(L);L?window.location.href=t:o({to:"/"})}},[m,o,L]),s.useEffect(()=>{!i||v.length===0||v.includes(p)||j(v[0])},[i,p,v]),s.useEffect(()=>{!w||!D||(j("magic-link"),l.loginHint&&!a&&T(l.loginHint))},[w,D,l.loginHint,a]),s.useEffect(()=>{l.intent&&P(l.intent)},[l.intent]),s.useEffect(()=>{if(!x||!i)return;const t=ne?"sign-in":"sign-up";d!==t&&P(t)},[x,ne,i,d]);const S=()=>L?ae(L):"/",se=async(t,{quiet:n=!1}={})=>{u(t),r(null);try{const g=await $.social({provider:t,callbackURL:S(),newUserCallbackURL:L?S():`/?onboard_provider=${encodeURIComponent(t)}`}),C=q(g);if(C&&!n){const R=E(C);R?.toLowerCase().includes("magic link")&&j("magic-link"),r(R)}}catch(g){if(n)return;r(E(g instanceof Error?g.message:`Failed to sign in with ${t}`))}finally{u(null)}};s.useEffect(()=>{if(Z.current||!y||m||F||!i||l.error)return;const t=l.provider;if(!t)return;Z.current=!0;const n=Object.hasOwn(i.social??{},t)&&!!i.social?.[t];se(t,{quiet:!n})},[i,F,m,y,l.provider,l.error]);const re=async()=>{if(a){u("magic-link"),r(null);try{return await $.magicLink({email:a,callbackURL:S()}),G(!0),!0}catch(t){return r(t instanceof Error?t.message:"Failed to send magic link"),!1}finally{u(null)}}},xe=async t=>{t.preventDefault(),await re()},be=async t=>{if(t.preventDefault(),!(!a||!k)){u("email-password"),r(null);try{if(d==="sign-up"){const n=await Ue.email({email:a,password:k,name:O||a.split("@")[0]||"User",callbackURL:S()}),g=q(n);if(g){r(E(g));return}if(await le(a,k),await f.invalidateQueries({queryKey:["organizations"]}),x&&te)try{await Pe.passkey.addPasskey({name:O||`${navigator.platform||"This device"}`})}catch{}}else{const n=await $.email({email:a,password:k,callbackURL:S()}),g=q(n);if(g){r(E(g));return}if(!n?.data){r("Invalid email or password");return}await le(a,k)}}catch(n){const g=n instanceof Error?n.message:typeof n=="string"?n:q(n);r(g||"Authentication failed")}finally{u(null)}}},ie=async()=>{r(null),pe(!0),u("local");try{const t=await Fe();if(!t.ok){const n=await t.json().catch(()=>null);r(n?.error_description??"Could not sign in to your local install.");return}window.location.href=S()}catch(t){r(t instanceof Error?t.message:"Could not sign in to your local install.")}finally{u(null)}};s.useEffect(()=>{H&&i&&!m&&!Y&&ie()},[H,i,m,Y]);const ye=async()=>{if(!a){r("Enter your email address first to reset your password.");return}u("reset-password-request"),r(null);try{const t=`${window.location.origin}/auth/reset-password`,n=await Me(`${Ie}/api/auth/request-password-reset`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:a,redirectTo:t})});if(!n.ok)throw await ze(n);K(!0)}catch(t){r(t instanceof Error?t.message:"Failed to send password reset email")}finally{u(null)}},je=async t=>{if(t.preventDefault(),!!N){u("phone"),r(null);try{await oe.sendOtp({phoneNumber:N}),J(!0)}catch(n){r(n instanceof Error?n.message:"Failed to send verification code")}finally{u(null)}}},we=async t=>{if(t.preventDefault(),!(!N||!M)){u("verify"),r(null);try{await oe.verify({phoneNumber:N,code:M})}catch(n){r(n instanceof Error?n.message:"Invalid verification code"),u(null)}}};return e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:e.jsxs("div",{className:"w-full max-w-md p-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"mx-auto mb-6 h-8 w-auto"}),e.jsx("h1",{className:"text-2xl font-bold",children:B?`Sign in to join ${B}`:x&&d==="sign-up"?"Set up your local install":x?"Welcome back":d==="sign-up"?"Create your account":"Sign in"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:B?"Sign in with the email your invitation was sent to.":x&&d==="sign-up"?"This account stays on this machine. Email is just an identifier — pick anything you’ll remember.":x?"Sign in to your local install.":X?"Sign in to connect the browser extension":d==="sign-up"?"Choose a sign-up method":"Choose your preferred sign-in method"}),x&&e.jsxs("div",{className:"mt-3 inline-flex items-center gap-2 px-3 py-1.5 bg-muted text-muted-foreground rounded-full text-xs",children:[e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),"Local install · nothing sent to lobu.ai"]}),X&&e.jsxs("div",{className:"mt-3 inline-flex items-center gap-2 px-3 py-1.5 bg-primary/10 text-primary rounded-full text-sm",children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),"Browser Extension"]})]}),e.jsx(Ae,{children:e.jsx(Re,{children:H?e.jsx("div",{className:"space-y-4",children:I?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:I}),e.jsx("button",{type:"button",disabled:c!==null,onClick:ie,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:"Try again"})]}):e.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[e.jsx(b,{size:"lg"}),e.jsx("span",{children:"Signing you into your local install…"})]})}):e.jsxs(e.Fragment,{children:[F&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[e.jsx(b,{size:"lg"}),e.jsx("span",{children:"Loading sign-in options…"})]}),!F&&_&&e.jsxs("div",{className:"text-sm text-destructive",children:["Failed to load sign-in options. ",_]}),!F&&!_&&v.length===0&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"No sign-in methods are configured. Contact support for access."}),h&&!U&&e.jsxs("div",{className:"mb-4 flex rounded-lg border p-1",children:[e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${d==="sign-in"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>P("sign-in"),children:"Sign In"}),e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${d==="sign-up"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>P("sign-up"),children:"Sign Up"})]}),!U&&he.length>1&&e.jsxs("div",{className:"mb-6 flex rounded-lg border p-1",children:[h&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${p==="email-password"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>j("email-password"),children:"Email + Password"}),z&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${p==="social"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>j("social"),children:"Social"}),!h&&w&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${p==="magic-link"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>j("magic-link"),children:"Magic Link"}),A&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${p==="whatsapp"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>j("whatsapp"),children:"WhatsApp"})]}),D&&e.jsx("div",{className:"mb-4 rounded-lg border border-amber-300 bg-amber-50 p-3 text-sm text-amber-900",children:"We found an existing account for this identity. To protect the account, verify with a magic link before linking social sign-in."}),ee&&e.jsx("div",{className:"mb-4 p-3 text-sm text-destructive bg-destructive/10 rounded-lg",children:ee}),I&&e.jsx("div",{className:"mb-4 p-3 text-sm text-destructive bg-destructive/10 rounded-lg",children:I}),!U&&(h||p==="social")&&z&&e.jsxs("div",{className:"space-y-3",children:[Object.entries(i?.social??{}).filter(([,t])=>t).map(([t])=>{const n=Le.find(ve=>ve.provider===t),g=n?.icon,C=i?.socialMeta?.[t],R=n?.name??C?.name??t.charAt(0).toUpperCase()+t.slice(1);return e.jsxs("button",{type:"button",onClick:()=>se(t),disabled:c!==null,className:"w-full flex items-center justify-center gap-3 h-10 px-4 border border-input rounded-lg bg-background hover:bg-accent hover:text-accent-foreground transition-colors disabled:opacity-50",children:[c===t?e.jsx(b,{size:"lg"}):g?e.jsx(g,{className:"w-4 h-4"}):C?.faviconDomain?e.jsx($e,{domain:C.faviconDomain},C.faviconDomain):e.jsx(ce,{className:"w-4 h-4"}),"Continue with ",R]},t)}),h&&e.jsxs("div",{className:"relative my-2",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full border-t"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-card px-2 text-muted-foreground",children:"or"})})]})]}),!U&&h&&e.jsxs("form",{onSubmit:be,className:"space-y-4",children:[d==="sign-up"&&e.jsxs("div",{children:[e.jsx("label",{htmlFor:"full-name",className:"block text-sm font-medium",children:"Full name"}),e.jsx("input",{id:"full-name",type:"text",value:O,onChange:t=>de(t.target.value),placeholder:"Jane Doe",className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email-password-email",className:"block text-sm font-medium",children:"Email address"}),e.jsx("input",{id:"email-password-email",type:"email",value:a,onChange:t=>{T(t.target.value),K(!1)},placeholder:"you@example.com",required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email-password-password",className:"block text-sm font-medium",children:"Password"}),e.jsx("input",{id:"email-password-password",type:"password",value:k,onChange:t=>ue(t.target.value),placeholder:"Enter a password",required:!0,minLength:8,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsx("button",{type:"submit",disabled:c!==null||!a||!k,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:c==="email-password"?e.jsxs(e.Fragment,{children:[e.jsx(b,{size:"lg"}),e.jsx("span",{className:"ml-2",children:d==="sign-up"?"Creating account...":"Signing in..."})]}):d==="sign-up"?x?"Create local account":"Create Account":"Sign In"}),d==="sign-in"&&te&&e.jsx("button",{type:"button",disabled:c!==null,onClick:async()=>{r(null),u("passkey");try{const t=await $.passkey();if(t?.error){const n=t.error.message??"Passkey sign-in failed.";r(E(n)??n);return}window.location.href=S()}catch(t){const n=t instanceof Error?t.message:String(t);r(E(n)??n)}finally{u(null)}},className:"flex h-10 w-full items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50",children:c==="passkey"?e.jsxs(e.Fragment,{children:[e.jsx(b,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Waiting for passkey…"})]}):"Sign in with passkey"}),d==="sign-in"&&w&&e.jsx("button",{type:"button",disabled:c!==null||!a,onClick:async()=>{await re()&&j("magic-link")},className:"flex h-10 w-full items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50",children:c==="magic-link"?e.jsxs(e.Fragment,{children:[e.jsx(b,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending magic link..."})]}):"Send me a magic link instead"}),d==="sign-in"&&e.jsx("button",{type:"button",disabled:c!==null||!a,onClick:ye,className:"flex h-10 w-full items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50",children:c==="reset-password-request"?e.jsxs(e.Fragment,{children:[e.jsx(b,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending reset email..."})]}):"Forgot password?"}),d==="sign-in"&&fe&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"If this email exists, we sent a password reset link."})]}),p==="magic-link"&&w&&(Q?e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"mb-4 flex justify-center",children:e.jsx("svg",{className:"h-12 w-12 text-primary",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),e.jsx("h2",{className:"text-lg font-medium",children:"Check your email"}),e.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["We sent a magic link to ",e.jsx("strong",{children:a}),".",e.jsx("br",{}),"Click the link in the email to sign in."]}),e.jsx("button",{type:"button",className:"mt-4 text-sm text-primary hover:underline",onClick:()=>G(!1),children:"Use a different email"})]}):e.jsxs("form",{onSubmit:xe,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email",className:"block text-sm font-medium",children:"Email address"}),e.jsx("input",{id:"email",type:"email",value:a,onChange:t=>T(t.target.value),placeholder:"you@example.com",required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsx("button",{type:"submit",disabled:c!==null||!a,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:c==="magic-link"?e.jsxs(e.Fragment,{children:[e.jsx(b,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending..."})]}):"Send Magic Link"})]})),!U&&p==="whatsapp"&&A&&(ge?e.jsxs("form",{onSubmit:we,className:"space-y-4",children:[e.jsxs("div",{className:"text-center text-sm text-muted-foreground",children:["Enter the 6-digit code sent to ",e.jsx("strong",{children:N})]}),e.jsx("div",{children:e.jsx("input",{type:"text",value:M,onChange:t=>V(t.target.value),placeholder:"000000",maxLength:6,pattern:"[0-9]{6}",required:!0,className:"block h-12 w-full rounded-md border border-input bg-background px-3 py-2 text-center text-xl tracking-widest placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})}),e.jsx("button",{type:"submit",disabled:c!==null||M.length!==6,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:c==="verify"?e.jsxs(e.Fragment,{children:[e.jsx(b,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Verifying..."})]}):"Verify & Sign In"}),e.jsx("button",{type:"button",className:"w-full text-sm text-primary hover:underline",onClick:()=>{J(!1),V("")},children:"Use a different number"})]}):e.jsxs("form",{onSubmit:je,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"phone",className:"block text-sm font-medium",children:"WhatsApp Number"}),e.jsx("input",{id:"phone",type:"tel",value:N,onChange:t=>me(t.target.value),placeholder:"+1234567890",required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Include country code (e.g., +1 for US)"})]}),e.jsx("button",{type:"submit",disabled:c!==null||!N,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:c==="phone"?e.jsxs(e.Fragment,{children:[e.jsx(b,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending..."})]}):"Send Code via WhatsApp"})]}))]})})})]})})}export{Be as component};
|
|
2
|
+
//# sourceMappingURL=login-DxGYyE4n.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as n,Z as o,j as e}from"./index-
|
|
2
|
-
//# sourceMappingURL=logout-
|
|
1
|
+
import{r as n,Z as o,j as e}from"./index-9YuSRymd.js";function s(){return n.useEffect(()=>{o().catch(t=>console.error("Sign out failed:",t)).finally(()=>{window.location.href="/"})},[]),e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:e.jsx("p",{className:"text-muted-foreground",children:"Signing out..."})})}export{s as component};
|
|
2
|
+
//# sourceMappingURL=logout-Bkzc7J44.js.map
|
package/dist/owletto/dist/assets/{member-scope-gate-B2LrMWBU.js → member-scope-gate-DD4YBFn-.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,S as o,i as c,bh as d,q as u,aR as h,dp as b,B as p,L as x,t as g}from"./index-
|
|
2
|
-
//# sourceMappingURL=member-scope-gate-
|
|
1
|
+
import{j as e,S as o,i as c,bh as d,q as u,aR as h,dp as b,B as p,L as x,t as g}from"./index-9YuSRymd.js";function j({rows:t=5}){return e.jsx("div",{className:"space-y-2",role:"status","aria-label":"Loading members",children:Array.from({length:t}).map((n,s)=>e.jsxs("div",{className:"flex items-center gap-3 rounded-lg px-3 py-2",children:[e.jsx(o,{className:"h-8 w-8 shrink-0 rounded-full"}),e.jsx(o,{className:"h-4 w-40"})]},s))})}function l({title:t,body:n,ctaLabel:s,showCta:a,callbackUrl:r}){return e.jsx(h,{icon:b,title:t,description:n,children:s&&a?e.jsx(p,{asChild:!0,className:"mt-4",children:e.jsx(x,{to:"/auth/login",search:g({callbackUrl:r,intent:"sign-in"}),children:s})}):null})}function y({children:t}){const{isAuthenticated:n,isReady:s}=c(),{isMember:a,isLoading:r}=d(),i=u({select:m=>m.href});return!s||r?e.jsx(j,{}):n?a?e.jsx(e.Fragment,{children:t}):e.jsx(l,{title:"Join to see members",body:"Emails and member details are only visible to members of this workspace. Use the banner above to join.",callbackUrl:i}):e.jsx(l,{title:"Sign in to see members",body:"The members of this workspace are only visible to people who have signed in.",ctaLabel:"Sign in",showCta:!0,callbackUrl:i})}export{y as M};
|
|
2
|
+
//# sourceMappingURL=member-scope-gate-DD4YBFn-.js.map
|