@lobu/runtime-server 24.9.0 → 24.10.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/catalogs/automations.json +2 -2
- package/dist/catalogs/connectors.json +16 -4
- package/dist/catalogs/skills.json +1 -1
- package/dist/component.json +1 -1
- package/dist/connectors/postgres.ts +39 -24
- package/dist/connectors/whatsapp-web-adapter.js +41 -10
- package/dist/connectors/whatsapp-web-helpers.ts +12 -2
- package/dist/connectors/whatsapp_web.ts +18 -2
- package/dist/db/migrations/20261112210000_instance_identity.sql +18 -0
- package/dist/dependencies.bun.lock +62 -60
- package/dist/embeddings-server.mjs +38 -5
- package/dist/owletto/dist/assets/_-CYvj1y65.js +3 -0
- package/dist/owletto/dist/assets/_-CeLTSYYY.js +2 -0
- package/dist/owletto/dist/assets/_agentId-BB5E-L6T.js +2 -0
- package/dist/owletto/dist/assets/{_agentId-bna2tPsW.js → _agentId-DN0EwMAC.js} +2 -2
- package/dist/owletto/dist/assets/_automationId-DvUl9CSd.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-CVKfL9AG.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-Cv6FzK1v.js +2 -0
- package/dist/owletto/dist/assets/{_conversationId-zcs-S3dY.js → _conversationId-CPpNySjO.js} +2 -2
- package/dist/owletto/dist/assets/_eventId-DZKicuq6.js +2 -0
- package/dist/owletto/dist/assets/_owner-Dauk3YuD.js +3 -0
- package/dist/owletto/dist/assets/_shape-cKrEID3T.js +2 -0
- package/dist/owletto/dist/assets/_slug-DJx_8fsV.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-CPVzVKEf.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-CW8gexOQ.js +2 -0
- package/dist/owletto/dist/assets/accept-invitation-Dwq1GAnG.js +2 -0
- package/dist/owletto/dist/assets/activity-route-location-C1jcXC7v.js +2 -0
- package/dist/owletto/dist/assets/activity-route-view-D78Wj0RH.js +2 -0
- package/dist/owletto/dist/assets/agent-connect-pages-DoI9UR0a.js +4 -0
- package/dist/owletto/dist/assets/{agent-editor-form-Bnc_q5WD.js → agent-editor-form-DlavYg2q.js} +2 -2
- package/dist/owletto/dist/assets/{agent-loading-shells-xteN-pyK.js → agent-loading-shells-DYqQphN7.js} +2 -2
- package/dist/owletto/dist/assets/agent-permissions-matrix-C1L8IcYR.js +2 -0
- package/dist/owletto/dist/assets/{agent-skill-context-r0O0BVOu.js → agent-skill-context-D1nMrVod.js} +2 -2
- package/dist/owletto/dist/assets/{agent-subpage-shell-C2KpYdu3.js → agent-subpage-shell-2w7vTeXw.js} +2 -2
- package/dist/owletto/dist/assets/{agent-thread-Bv_chdPy.js → agent-thread-BopD-2k1.js} +3 -3
- package/dist/owletto/dist/assets/{app._appId-BUcNaSMS.js → app._appId-BXeFXW1w.js} +2 -2
- package/dist/owletto/dist/assets/{assist-composer-B1LykXpD.js → assist-composer-CL5x8pNt.js} +2 -2
- package/dist/owletto/dist/assets/automation-run-now-MtxUTfzd.js +2 -0
- package/dist/owletto/dist/assets/{callback-kSLa4n5s.js → callback-BgfwP1Eo.js} +2 -2
- package/dist/owletto/dist/assets/{card-C01y1O-W.js → card-DtLIFq7D.js} +2 -2
- package/dist/owletto/dist/assets/{claim-Dnux9Lqf.js → claim-CT3hYVMF.js} +2 -2
- package/dist/owletto/dist/assets/{client-activity-scopes-BBIq16tG.js → client-activity-scopes-BPbRX-Pe.js} +2 -2
- package/dist/owletto/dist/assets/{client-rows-DGh1O-Fu.js → client-rows-vrNA6FLs.js} +2 -2
- package/dist/owletto/dist/assets/clients-xnzZeEdZ.js +2 -0
- package/dist/owletto/dist/assets/{code-editor-BdRMYojw.js → code-editor-mrKkAfcE.js} +2 -2
- package/dist/owletto/dist/assets/connect-NUCSay8X.js +2 -0
- package/dist/owletto/dist/assets/{connect-menu-D4w-JhJW.js → connect-menu-C6iVtuSo.js} +2 -2
- package/dist/owletto/dist/assets/connect._clientId-Cp-d9Q5b.js +2 -0
- package/dist/owletto/dist/assets/{connected._clientId-BsDzltNz.js → connected._clientId-ROfVgp9h.js} +2 -2
- package/dist/owletto/dist/assets/connection-BMz740Wi.js +2 -0
- package/dist/owletto/dist/assets/{connection-feed-detail-CJju0qiw.js → connection-feed-detail-0VAJiZTP.js} +2 -2
- package/dist/owletto/dist/assets/connector-page-shell-BFv21yuv.js +2 -0
- package/dist/owletto/dist/assets/{connector-provenance-B2C2cjBg.js → connector-provenance-b59RfBtk.js} +2 -2
- package/dist/owletto/dist/assets/connectors-nYS31lO2.js +2 -0
- package/dist/owletto/dist/assets/consent-cPRF9JQv.js +2 -0
- package/dist/owletto/dist/assets/{copy-button-BhXeXLIm.js → copy-button-C3wMMv63.js} +2 -2
- package/dist/owletto/dist/assets/{core.esm-CJUp2aNZ.js → core.esm-C9QlSrgK.js} +3 -3
- package/dist/owletto/dist/assets/{create-DUlRsFNn.js → create-ASRN3Obq.js} +2 -2
- package/dist/owletto/dist/assets/create-CBcodaSO.js +2 -0
- package/dist/owletto/dist/assets/create-CGOWfMk4.js +2 -0
- package/dist/owletto/dist/assets/{create-automation-form-D141prEG.js → create-automation-form-CLicoPH5.js} +3 -3
- package/dist/owletto/dist/assets/create._connectorKey-s4xkktTC.js +2 -0
- package/dist/owletto/dist/assets/{custom-guardrail-edits-DuQ28xv3.js → custom-guardrail-edits-BUL7nmuO.js} +2 -2
- package/dist/owletto/dist/assets/{definition-comparison-BUDNuAN_.js → definition-comparison-4UYMI6BK.js} +2 -2
- package/dist/owletto/dist/assets/{detail-page-skeleton-BRHaq5Sj.js → detail-page-skeleton-C8v3rJXK.js} +2 -2
- package/dist/owletto/dist/assets/device-BBwsOi7q.js +2 -0
- package/dist/owletto/dist/assets/{device-pin-tombstone-BIM-ziCH.js → device-pin-tombstone-Bcpe7nAA.js} +2 -2
- package/dist/owletto/dist/assets/{device._deviceId-BnPqTgK1.js → device._deviceId-DLT4jh0Z.js} +2 -2
- package/dist/owletto/dist/assets/{dynamic-schema-form-OkIZImgp.js → dynamic-schema-form-BDT8x0Vg.js} +2 -2
- package/dist/owletto/dist/assets/{entity-options-CpeX7iiX.js → entity-options-B9hm9V87.js} +2 -2
- package/dist/owletto/dist/assets/entity-page-DZjzQ2V4.js +2 -0
- package/dist/owletto/dist/assets/entity-pages-BWBpttz3.js +2 -0
- package/dist/owletto/dist/assets/entity-schema-graph-lMMx3HhR.js +2 -0
- package/dist/owletto/dist/assets/{entity-type-page-MgZ7_0oh.js → entity-type-page-CkQm0yEu.js} +2 -2
- package/dist/owletto/dist/assets/{event-detail-D6AH6a2C.js → event-detail-CkzfakTK.js} +2 -2
- package/dist/owletto/dist/assets/events-feed-DmRzikZW.js +2 -0
- package/dist/owletto/dist/assets/{filter-editors-DDTwyYt0.js → filter-editors-CQoSj-20.js} +3 -3
- package/dist/owletto/dist/assets/{full-page-spinner-DWo519BU.js → full-page-spinner-CYyCnKve.js} +2 -2
- package/dist/owletto/dist/assets/index-BE7eb2kE.js +2 -0
- package/dist/owletto/dist/assets/index-BFR0uiKY.js +2 -0
- package/dist/owletto/dist/assets/{index-Cd8jMsz8.js → index-BS5Ty3tf.js} +2 -2
- package/dist/owletto/dist/assets/index-C38OzBpB.js +2 -0
- package/dist/owletto/dist/assets/{index-D1UCJQl1.js → index-C3hz9tzx.js} +2 -2
- package/dist/owletto/dist/assets/index-CDyFQ32o.js +2 -0
- package/dist/owletto/dist/assets/{index-BW7IFKXC.js → index-CUndAH6o.js} +2 -2
- package/dist/owletto/dist/assets/index-CiKysEhV.js +2 -0
- package/dist/owletto/dist/assets/{index-CdDNNAx2.js → index-DByaMzsG.js} +274 -274
- package/dist/owletto/dist/assets/index-DfdinB7B.js +2 -0
- package/dist/owletto/dist/assets/index-DgMM4Zt5.css +1 -0
- package/dist/owletto/dist/assets/index-Xk711gVC.js +2 -0
- package/dist/owletto/dist/assets/{index-DmqnKGqW.js → index-ittfA0k8.js} +2 -2
- package/dist/owletto/dist/assets/{json-diff-C-WQqyIf.js → json-diff-mcDgyct_.js} +2 -2
- package/dist/owletto/dist/assets/{list-skeleton-0B1bTrAK.js → list-skeleton-DsYGUHxi.js} +2 -2
- package/dist/owletto/dist/assets/login-EoLq136v.js +2 -0
- package/dist/owletto/dist/assets/{logout-D474YsYQ.js → logout-gLgEQOiX.js} +2 -2
- package/dist/owletto/dist/assets/{member-scope-gate-CH_0jHiM.js → member-scope-gate-vvkgSAb2.js} +2 -2
- package/dist/owletto/dist/assets/memory-browse-page-DvDtwrEI.js +74 -0
- package/dist/owletto/dist/assets/{model-selector-XYmk7Iru.js → model-selector-D3vSMLO2.js} +2 -2
- package/dist/owletto/dist/assets/{needs-you-list-Bd4iiiqm.js → needs-you-list-B5Bgd05M.js} +2 -2
- package/dist/owletto/dist/assets/{new-CJ6TF3Vc.js → new-BPW3V0Y1.js} +2 -2
- package/dist/owletto/dist/assets/new-Bk_flKQO.js +2 -0
- package/dist/owletto/dist/assets/new-C5HtQdM_.js +2 -0
- package/dist/owletto/dist/assets/new-dLXsCHBd.js +2 -0
- package/dist/owletto/dist/assets/organization-DBfgBkzq.js +2 -0
- package/dist/owletto/dist/assets/{peek-pane-content-Cc8YX1oy.js → peek-pane-content-c2PG3TEX.js} +2 -2
- package/dist/owletto/dist/assets/{pending-seed-D7-ld7as.js → pending-seed-CBhx2Ql-.js} +2 -2
- package/dist/owletto/dist/assets/{proposal-review-shell-BWRJidwb.js → proposal-review-shell-B-jYcKfB.js} +2 -2
- package/dist/owletto/dist/assets/public-shell-ready-D8TijlRY.js +2 -0
- package/dist/owletto/dist/assets/record-activity-DnRVOrG2.js +2 -0
- package/dist/owletto/dist/assets/{record-session-ClKBr1_C.js → record-session-CAmGHMyM.js} +2 -2
- package/dist/owletto/dist/assets/{renderer-DZ0w2k2r.js → renderer-olRv_HMI.js} +3 -3
- package/dist/owletto/dist/assets/reset-password-B9_xi8Pq.js +2 -0
- package/dist/owletto/dist/assets/{run-initiator-B8IRlRd-.js → run-initiator-DhE5v4z0.js} +2 -2
- package/dist/owletto/dist/assets/runs-C8sZQr4o.js +2 -0
- package/dist/owletto/dist/assets/{runs-list-8gUPWjP4.js → runs-list-CwtH-wmk.js} +2 -2
- package/dist/owletto/dist/assets/{schema-value-k19Ata7u.js → schema-value-zTJGE4eh.js} +3 -3
- package/dist/owletto/dist/assets/{scoped-feed-bar-L7h-Ca4u.js → scoped-feed-bar-BKyJSa3_.js} +2 -2
- package/dist/owletto/dist/assets/{settings-BZqntV3E.js → settings-z02cvVS3.js} +2 -2
- package/dist/owletto/dist/assets/source-record-panels-CGmKIJdN.js +2 -0
- package/dist/owletto/dist/assets/{status-variants-BR_iGWN5.js → status-variants-DyRCXBzM.js} +2 -2
- package/dist/owletto/dist/assets/subDays-D8nHthaS.js +2 -0
- package/dist/owletto/dist/assets/{table-C3DMoL4K.js → table-C637cQxG.js} +2 -2
- package/dist/owletto/dist/assets/use-automations-CgWNoYio.js +2 -0
- package/dist/owletto/dist/assets/use-login-redirect-tDdhXTpt.js +2 -0
- package/dist/owletto/dist/assets/{use-mention-search-CtbixPEE.js → use-mention-search-D-kIKchD.js} +2 -2
- package/dist/owletto/dist/assets/view-param-filters-CUCj9Df-.js +2 -0
- package/dist/owletto/dist/assets/{views-access-required-CvIIxdS_.js → views-access-required-C35Dyt91.js} +2 -2
- package/dist/owletto/dist/index.html +2 -2
- package/dist/server-main.bundle.mjs +2733 -1795
- package/npm-shrinkwrap.json +238 -221
- package/package.json +1 -1
- package/vendor/connector-sdk/dist/connector-types.d.ts +6 -0
- package/vendor/connector-sdk/dist/index.d.ts +1 -0
- package/vendor/connector-sdk/dist/index.js +1 -0
- package/vendor/connector-sdk/dist/ip-reachability.d.ts +1 -1
- package/vendor/connector-sdk/dist/ip-reachability.js +1 -1
- package/vendor/connector-sdk/dist/logger.d.ts +1 -1
- package/vendor/connector-sdk/dist/logger.js +1 -1
- package/vendor/connector-sdk/dist/reaction-client-types.d.ts +3 -1
- package/vendor/connector-sdk/dist/retry.d.ts +1 -1
- package/vendor/connector-sdk/dist/retry.js +1 -1
- package/vendor/connector-sdk/dist/source-withheld-error.d.ts +16 -0
- package/vendor/connector-sdk/dist/source-withheld-error.js +19 -0
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/classify-error.d.ts +1 -1
- package/vendor/core/dist/classify-error.js +2 -2
- package/vendor/core/dist/contracts/tools/manage-automations.d.ts +28 -3
- package/vendor/core/dist/contracts/tools/manage-automations.js +27 -8
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +8 -0
- package/vendor/core/dist/contracts/tools/manage-entity.js +11 -3
- package/vendor/core/dist/contracts/tools/save-memory.d.ts +11 -1
- package/vendor/core/dist/contracts/tools/save-memory.js +25 -3
- package/vendor/core/dist/contracts/tools/search-memory.js +1 -1
- package/vendor/core/dist/credentials.d.ts +12 -0
- package/vendor/core/dist/credentials.js +1 -0
- package/vendor/core/dist/errors.js +2 -2
- package/vendor/core/dist/worker/auth.d.ts +5 -0
- package/vendor/core/dist/worker/auth.js +15 -4
- package/vendor/core/package.json +1 -1
- package/vendor/postgres/cf/src/connection.js +7 -2
- package/vendor/postgres/cjs/src/connection.js +7 -2
- package/vendor/postgres/src/connection.js +7 -2
- package/vendor/views/dist/native.d.ts +33 -1
- package/vendor/views/dist/native.js +3 -0
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-B2C9B2RM.js +0 -2
- package/dist/owletto/dist/assets/_-CjyiGzwB.js +0 -3
- package/dist/owletto/dist/assets/_agentId-DKHXGvS2.js +0 -2
- package/dist/owletto/dist/assets/_automationId-CowRFD4E.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-dE6im18z.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-DqwSv8Zs.js +0 -2
- package/dist/owletto/dist/assets/_eventId-BVOVizs4.js +0 -2
- package/dist/owletto/dist/assets/_owner-DsvIC94q.js +0 -3
- package/dist/owletto/dist/assets/_shape-CWjpzcvv.js +0 -2
- package/dist/owletto/dist/assets/_slug-DuCxYsJk.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-BqVeHB6Z.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-DzyOCG5U.js +0 -2
- package/dist/owletto/dist/assets/accept-invitation-k1u3zBcn.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-jTBMW7a9.js +0 -2
- package/dist/owletto/dist/assets/agent-connect-pages-D3mVM_q4.js +0 -4
- package/dist/owletto/dist/assets/agent-permissions-matrix-C_ayr0pd.js +0 -2
- package/dist/owletto/dist/assets/automation-run-now-CjkJIkaZ.js +0 -2
- package/dist/owletto/dist/assets/clients-BCvjAJDT.js +0 -2
- package/dist/owletto/dist/assets/connect-DZeFSGIH.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-IZEMQJ64.js +0 -2
- package/dist/owletto/dist/assets/connection-C7glVpPE.js +0 -2
- package/dist/owletto/dist/assets/connector-page-shell-BeuyjiB2.js +0 -2
- package/dist/owletto/dist/assets/connectors-DSQ5AWPf.js +0 -2
- package/dist/owletto/dist/assets/consent-B6Aw_89N.js +0 -2
- package/dist/owletto/dist/assets/create-CWcza8NT.js +0 -2
- package/dist/owletto/dist/assets/create-bGOYifof.js +0 -2
- package/dist/owletto/dist/assets/create._connectorKey-Ds4tpwHP.js +0 -2
- package/dist/owletto/dist/assets/device-D3fzoIrM.js +0 -2
- package/dist/owletto/dist/assets/entity-page-Cjc8oXA2.js +0 -2
- package/dist/owletto/dist/assets/entity-pages-18xSANrS.js +0 -2
- package/dist/owletto/dist/assets/entity-schema-graph-uwZ-P0t8.js +0 -2
- package/dist/owletto/dist/assets/events-feed-BI7wNRUY.js +0 -2
- package/dist/owletto/dist/assets/index-9tTjJo_J.css +0 -1
- package/dist/owletto/dist/assets/index-BYcFrinP.js +0 -2
- package/dist/owletto/dist/assets/index-BhJsTy-C.js +0 -2
- package/dist/owletto/dist/assets/index-CEcsgXDj.js +0 -2
- package/dist/owletto/dist/assets/index-CPscKk2u.js +0 -2
- package/dist/owletto/dist/assets/index-CfJ2-EpK.js +0 -2
- package/dist/owletto/dist/assets/index-D5DM4g2w.js +0 -2
- package/dist/owletto/dist/assets/index-DznAbTOF.js +0 -2
- package/dist/owletto/dist/assets/login-CH7P2AyR.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-Ba4aYavw.js +0 -74
- package/dist/owletto/dist/assets/new-BOsrRqp8.js +0 -2
- package/dist/owletto/dist/assets/new-DGPOjak2.js +0 -2
- package/dist/owletto/dist/assets/new-Q0XqiZq2.js +0 -2
- package/dist/owletto/dist/assets/organization-hD_Z6TSd.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-CRyAZATw.js +0 -2
- package/dist/owletto/dist/assets/record-activity-9ux6SfCd.js +0 -2
- package/dist/owletto/dist/assets/reset-password-D2RfrEVZ.js +0 -2
- package/dist/owletto/dist/assets/runs-CuC7WMtd.js +0 -2
- package/dist/owletto/dist/assets/source-record-panels-C4UItfdk.js +0 -2
- package/dist/owletto/dist/assets/subDays-hOwerOLo.js +0 -2
- package/dist/owletto/dist/assets/use-automations-CdtiVLCv.js +0 -2
- package/dist/owletto/dist/assets/use-login-redirect-CYlVkAhE.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-BdN8OU35.js +0 -2
- /package/vendor/postgres/{.bun-tag-c81dacd34e959a7a → .bun-tag-652f2580b8090d71} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{eC as xn,j as t,af as hn,a4 as gn,dK as yn,u as Pe,eD as jn,i as G,cX as $t,eE as ct,r as j,eF as Ot,eG as vn,ev as _n,a7 as H,eH as Je,L as W,bf as Le,bg as Qe,eI as bn,cv as Nn,eJ as wn,eK as kn,db as Pt,eL as Cn,eM as An,aP as Rn,eN as Sn,cx as $n,q as In,eO as En,K as Re,H as et,eP as gt,z as Ye,Q as Tn,dI as Ae,eQ as Bt,eR as Ut,eS as Ge,eT as zt,ch as Kt,eU as Mn,eV as Dn,eW as Fn,eX as Ln,B as O,eY as dt,dh as ut,eZ as qt,e_ as Vt,e$ as On,aE as Ht,aF as Wt,aH as Jt,dB as Pn,dC as Bn,ac as Qt,dD as Un,f0 as zn,c as Kn,P as qn,M as Vn,by as Ue,cJ as Hn,y as Wn,f1 as mt,f2 as Jn,$ as Qn,f3 as Yn,bR as Gn,al as Ne,f4 as Yt,dc as yt,ex as Xn,f5 as Zn,f6 as es,f7 as ts,f8 as ns,c3 as ss,f9 as rs,c8 as as,fa as is,a9 as os,fb as ls,X as cs,dE as ds,c9 as us,fc as ms,fd as ps,fe as fs,d as xs,v as hs,ff as gs,fg as ys,e7 as Se,fh as Gt,fi as js,fj as vs,fk as _s,fl as bs,fm as Ns,fn as ws,fo as ks,n as Cs,cM as As,eb as Rs,cK as Ss,s as $s,t as Is,ee as Es,fp as Ts,fq as Ms,fr as Ds,fs as It,ft as Fs,fu as Ls,fv as Os,b$ as Ps,fw as ze,fx as Bs,fy as Us,fz as zs}from"./index-DByaMzsG.js";import{D as Ks,A as qs,a as Vs,T as Hs,b as Ws,c as Js,d as Qs}from"./definition-comparison-4UYMI6BK.js";import{R as Ys,p as Gs,a as Xs,i as Zs,b as er}from"./run-initiator-DhE5v4z0.js";import{a as Xt}from"./use-automations-CgWNoYio.js";import{l as tr,s as nr,J as sr}from"./renderer-olRv_HMI.js";import{S as rr}from"./schema-value-zTJGE4eh.js";import{J as We}from"./json-diff-mcDgyct_.js";import{C as Et}from"./copy-button-C3wMMv63.js";import{A as Tt}from"./device-automation-Dp3faMvp.js";function Zt(e){const n=Array.isArray(e?.records)?e.records:Array.isArray(e?.current)?e.current:[];return[e?.from_entity_id??e?.entity_id,e?.to_entity_id].map(s=>{const a=n.find(i=>i&&typeof i=="object"&&"id"in i&&i.id===s);return{id:String(s??"unknown"),name:typeof a?.name=="string"?a.name:`Record ${String(s??"unknown")}`}})}function en(e,n){return n==="rejected"?"The proposed relationship change was rejected. Both records remain available.":n==="failed"?"The relationship change failed. Both records remain available.":n==="completed"?e==="link"?"The records were linked. Both records remain available.":"The relationship was removed. Both records remain available.":n==="approved"||n==="confirmed"?"The relationship change was approved. Both records remain available.":e==="link"?"If approved, these records will be linked. Both records remain available.":"If approved, this relationship will be removed. Both records remain available."}function Va(e){const n=Zt(e.proposal);return{title:e.action==="link"?"Link records":"Unlink records",icon:"entity",impact:{level:"normal"},tone:"default",blocks:[...n.map((s,r)=>({type:"text",label:r===0?"From":"To",value:s.name})),{type:"text",label:"Relationship",value:String(e.proposal?.relationship_type??e.proposal?.relationship_type_slug??"Relationship")},{type:"text",value:en(e.action,typeof e.status=="string"?e.status:void 0),muted:!0},...typeof e.reason=="string"&&e.reason?[{type:"text",label:"Why this needs approval",value:e.reason}]:[]],actions:[{id:"approve",label:"Approve",variant:"primary",icon:"check",confirm:e.action==="unlink",confirmPrompt:"Remove this relationship? Both records will remain available.",tool:"manage_operations",args:{action:"approve"},resolvedLabel:"Approval submitted."},{id:"reject",label:"Reject",variant:"outline",icon:"x",confirm:!0,confirmPrompt:"Reject this relationship change?",tool:"manage_operations",args:{action:"reject"},resolvedLabel:"Relationship change rejected."}]}}function rt(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function ar(e){const n=rt(e.proposal);if(!n)return null;const s=rt(e.current);if(e.tool==="manage_agents"){if(!["create","update","delete"].includes(String(n.action)))return null;const r=xn({current:s,proposal:n});return{kind:"agent",current:n.action==="create"?null:r.current,proposed:n.action==="delete"?null:r.proposed}}if(e.tool==="manage_automations"){const r=rt(n.args);if(!r||!["create","update","create_version","set_reaction_script"].includes(String(r.action)))return null;const{action:a,automation_id:i,expected_version:c,...o}=r;return{kind:"automation",current:a==="create"?null:s,proposed:{...a==="create"?null:s,...o}}}return null}function ir({proposal:e}){return t.jsxs("div",{className:"space-y-3",children:[t.jsx("p",{className:"text-xs text-muted-foreground",children:"Recorded configuration and requested changes. Fields absent from the snapshot are not shown; creation uses the normal defaults."}),t.jsx(Ks,{current:e.current,proposed:e.proposed,render:n=>e.kind==="agent"?t.jsx(qs,{value:n}):t.jsx(Vs,{value:n})})]})}async function or(e,n,s,r){const a=await hn(`${gn}/api/${encodeURIComponent(e)}/events/${n}/actions/${encodeURIComponent(s.action)}`,{method:"POST",timeoutMs:9e4,credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:s.value,interaction_id:r})});return await yn(a,"Could not record interaction"),a.json()}function U(e){if(typeof e!="string")return;const n=e.trim();return n.length>0?n:void 0}function at(e){return typeof e=="boolean"?e:void 0}function lr(e,n,s){const r=(s??"").toLowerCase();return!!(r==="prepare_comment"||r==="verify_staged_comment"||r.includes("prepare_")||r.includes("verify_staged")||n?.prepared===!0||typeof n?.verified=="boolean"||U(n?.reason_preview)&&U(n?.message)||U(e?.body)&&(U(e?.post_url)||U(e?.activity_id)))}function cr(e,n,s){if(!lr(e,n,s))return null;const r=(s??"").toLowerCase(),a=U(n?.body)??U(e?.body),i=U(n?.reason_preview)??U(e?.reason),c=U(n?.post_url)??U(e?.post_url)??(U(e?.activity_id)?`https://www.linkedin.com/feed/update/urn:li:activity:${U(e?.activity_id)}`:void 0),o=at(n?.prepared),l=at(n?.verified),d=at(n?.banner_shown),p=U(n?.message),u=n?.match&&typeof n.match=="object"?n.match:null,m=U(u?.text_preview),b=U(u?.author);let w="generic";r==="verify_staged_comment"||r.includes("verify")||typeof l=="boolean"?w="verify":(r==="prepare_comment"||r.includes("prepare")||o===!0||a&&c)&&(w="prepare");const h=[];return o===!0&&h.push("Staged — not posted"),o===!1&&h.push("Not staged"),l===!0&&h.push("Verified posted"),l===!1&&h.push("Not verified as posted"),d===!0&&h.push("In-page banner"),d===!1&&h.push("No banner"),{kind:w,message:p,reason:i,body:a,postUrl:c,prepared:o,bannerShown:d,verified:l,matchPreview:m,matchAuthor:b,chips:h}}const Ke="inline-flex max-w-full items-center truncate rounded-md border border-border px-1.5 py-0.5 text-xs";function tn({peer:e,ownerSlug:n,orgContext:s}){const r=Pe();if(e.url&&!e.self&&e.type){const i=jn(e.url);return i?t.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:G(Ke,"hover:bg-muted"),title:e.type,onClick:c=>c.stopPropagation(),children:t.jsx("span",{className:"truncate",children:e.name})}):t.jsx("span",{className:G(Ke,"text-muted-foreground"),children:e.name})}if(e.self||!e.type||!r)return t.jsx("span",{className:G(Ke,"text-muted-foreground"),children:e.name});const a=r.item?.recordPeer?.entityId===e.id;return t.jsx("button",{type:"button","aria-pressed":a,title:e.type,className:G(Ke,"hover:bg-muted",a&&"ring-1 ring-primary"),onClick:i=>{i.stopPropagation(),r.open(tr({...typeof e.id=="number"?{entityId:e.id}:{record:{type:e.type,key:e.id}},ownerSlug:n,orgContext:s,name:e.name}))},children:t.jsx("span",{className:"truncate",children:e.name})})}function Ha(e,n=e.relationship_type_name){const s=e.from_entity_name??`Record #${e.from_entity_id}`,r=e.to_entity_name??`Record #${e.to_entity_id}`;return e.is_symmetric?`${s} ${n} ${r}`:`${s} → ${n} → ${r}`}function Wa({row:e,entityId:n,entityType:s,ownerSlug:r,orgContext:a,label:i=e.relationship_type_name}){const c=(o,l,d,p)=>t.jsx(tn,{peer:{id:o,name:l??`Record #${o}`,type:d,url:p,self:!p&&o===n&&(typeof o=="number"||d===s)},ownerSlug:r,orgContext:a});return t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1 text-xs",children:[c(e.from_entity_id,e.from_entity_name,e.from_entity_type,e.from_entity_url),!e.is_symmetric&&t.jsx($t,{"aria-hidden":"true",className:"size-3 shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-muted-foreground",children:i}),!e.is_symmetric&&t.jsx($t,{"aria-hidden":"true",className:"size-3 shrink-0 text-muted-foreground"}),c(e.to_entity_id,e.to_entity_name,e.to_entity_type,e.to_entity_url)]})}function Ja({count:e,onRetry:n}){return e?t.jsxs("p",{role:"status",className:"text-xs text-muted-foreground",children:["Some linked records could not be read."," ",t.jsx("button",{type:"button",className:"underline",onClick:n,children:"Retry"})]}):null}const nn={name:"Name",slug:"URL slug",parent_id:"Parent",content:"Content changed"};function _e(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function qe(e){return e==null||e===""}function dr(e,n){return ct(e??null)===ct(n??null)}function ur(e){return!!(e?.type==="array"&&(e.items?.type==="object"||e.items?.properties))}function mr(e){return!!(e&&(e.type==="object"||e.properties)&&e.type!=="array")}function jt(e,n){return nr({key:e,prop:n??{}})}function pr(e,n){return e?.properties?.[n]}function pt(e,n,s,r,a){if(dr(n,s))return;const i=l=>Array.isArray(l)?l:[];if((Array.isArray(n)||qe(n))&&(Array.isArray(s)||qe(s))&&(Array.isArray(n)||Array.isArray(s)||r?.type==="array")){const l=i(n),d=i(s);if(ur(r)||[...l,...d].some(v=>_e(v))){const v=Math.min(l.length,d.length);for(let S=0;S<v;S++)pt([...e,`item ${S+1}`],l[S],d[S],r?.items,a);const N=Math.max(0,d.length-l.length),k=Math.max(0,l.length-d.length);(N||k)&&a.push({kind:"items",path:e,added:N,removed:k});return}const u=v=>ct(v),m=new Set(l.map(u)),b=new Set(d.map(u)),w=d.filter(v=>!m.has(u(v))),h=l.filter(v=>!b.has(u(v)));a.push(w.length||h.length?{kind:"values",path:e,added:w,removed:h,prop:r?.items}:{kind:"reordered",path:e});return}if((_e(n)||qe(n))&&(_e(s)||qe(s))&&(_e(n)||_e(s)||mr(r))){const l=_e(n)?n:{},d=_e(s)?s:{},p=[...new Set([...Object.keys(r?.properties??{}),...Object.keys(l),...Object.keys(d)])];for(const u of p){const m=pr(r,u);pt([...e,jt(u,m)],l[u],d[u],m,a)}return}a.push({kind:"set",path:e,old:n,new:s,prop:r})}function fr(e,n){const s=nn[e.field];if(s)return e.field==="content"?[{kind:"note",path:[s]}]:e.field==="parent_id"?[{kind:"parent",path:[s],old:e.old,new:e.new}]:[{kind:"set",path:[s],old:e.old,new:e.new}];const r=n?.properties?.[e.field],a=[];return pt([jt(e.field,r)],e.old,e.new,r,a),a}function xr(e,n){const s=n?.properties;return e.map(r=>r.field==="content"?"Content":nn[r.field]??jt(r.field,s?.[r.field]))}const hr="entity.updated",gr=new Set(["link","unlink","update_link"]);function Mt(e){const n=typeof e=="string"||typeof e=="number"?Number(e):Number.NaN;return Number.isSafeInteger(n)&&n>0?n:null}function yr(e){const n=e.split("_").join(" ").trim();return n?`${n.charAt(0).toUpperCase()}${n.slice(1)}`:e}function jr(e){const n=e.metadata;if(e.semantic_type!=="change"||!n||n._lobu_relationship_change!==!0||typeof n.op!="string"||!gr.has(n.op))return null;const s=Mt(n.fromEntityId),r=Mt(n.toEntityId);if(s==null||r==null)return null;const a=typeof n.relationshipTypeSlug=="string"?n.relationshipTypeSlug:null,i=Array.isArray(n.changes)?n.changes:[];return{op:n.op,fromId:s,toId:r,typeLabel:a?yr(a):"relationship",changedFields:i.flatMap(c=>c&&typeof c=="object"&&typeof c.field=="string"?[c.field]:[])}}function ft({id:e,ownerSlug:n}){const s={slug:n},{data:r,isLoading:a,isError:i}=Ot(e,s);return a?t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Record #",e]}):i||!r?t.jsx("span",{className:"text-xs text-muted-foreground",title:"Deleted, or you do not have access to it",children:"Unavailable record"}):t.jsx(tn,{peer:{id:e,name:r.name,type:r.entity_type},ownerSlug:n,orgContext:s})}function vr({change:e,ownerSlug:n}){const s=e.op==="link"?`Linked as ${e.typeLabel}`:e.op==="unlink"?`Unlinked ${e.typeLabel}`:`Updated ${e.typeLabel} link`;return t.jsxs("span",{"data-testid":"relationship-change",className:"inline-flex flex-wrap items-center gap-1.5",children:[t.jsx(ft,{id:e.fromId,ownerSlug:n}),t.jsx("span",{children:s}),t.jsx("span",{"aria-hidden":"true",children:"→"}),t.jsx(ft,{id:e.toId,ownerSlug:n}),e.op==="update_link"&&e.changedFields.length>0?t.jsxs("span",{className:"text-xs text-muted-foreground",children:["· ",e.changedFields.join(", ")]}):null]})}function _r(e){if(!Array.isArray(e)||e.length===0)return null;const n=[];for(const s of e){if(!s||typeof s!="object"||typeof s.field!="string")return null;const{field:r,old:a,new:i}=s;n.push({field:r,old:a??null,new:i??null})}return n}function br(e){const n=jr(e);if(n)return{kind:"relationship",change:n};const s=e.metadata;if(e.semantic_type!=="change"||!s)return null;const r=s._lobu_event_type;if(r!==hr&&(r!==void 0||s.category))return null;const a=_r(s.changes);if(!a)return null;const i=e.entity_ids?.[0];return{kind:"fields",entityId:typeof i=="number"?i:null,changes:a}}function sn(e,n){const s={slug:n},{data:r}=Ot(e.entityType?void 0:e.entityId??void 0,s),{data:a}=vn(e.entityType??r?.entity_type??"",s);return a?.metadata_schema}const Nr=4;function Ve({value:e,prop:n}){return t.jsx("span",{className:"inline-block max-w-[18rem] truncate align-bottom",title:typeof e=="string"?e:void 0,children:t.jsx(rr,{value:e,prop:n,empty:t.jsx("span",{className:"italic",children:"empty"})})})}function Dt({id:e,ownerSlug:n}){const s=typeof e=="number"||typeof e=="string"?Number(e):Number.NaN;return Number.isSafeInteger(s)&&s>0?t.jsx(ft,{id:s,ownerSlug:n}):t.jsx("span",{className:"italic text-muted-foreground",children:"empty"})}function xt(e,n){return`${e} ${n}${e===1?"":"s"}`}function wr({line:e,ownerSlug:n}){const s=t.jsx("span",{className:"text-muted-foreground",children:e.path.join(" · ")});switch(e.kind){case"note":return s;case"set":return t.jsxs(t.Fragment,{children:[s,": ",t.jsx(Ve,{value:e.old,prop:e.prop})," ",t.jsx("span",{"aria-hidden":"true",children:"→"})," ",t.jsx(Ve,{value:e.new,prop:e.prop})]});case"parent":return t.jsxs(t.Fragment,{children:[s,": ",t.jsx(Dt,{id:e.old,ownerSlug:n})," ",t.jsx("span",{"aria-hidden":"true",children:"→"})," ",t.jsx(Dt,{id:e.new,ownerSlug:n})]});case"items":return t.jsxs(t.Fragment,{children:[s,":"," ",[e.added?`${xt(e.added,"item")} added`:null,e.removed?`${xt(e.removed,"item")} removed`:null].filter(Boolean).join(", ")]});case"values":return t.jsxs(t.Fragment,{children:[s,":",e.added.map((r,a)=>t.jsxs("span",{className:"ml-1.5",children:["+",t.jsx(Ve,{value:r,prop:e.prop})]},`+${a}`)),e.removed.map((r,a)=>t.jsxs("span",{className:"ml-1.5 text-muted-foreground",children:["−",t.jsx(Ve,{value:r,prop:e.prop})]},`-${a}`))]});case"reordered":return t.jsxs(t.Fragment,{children:[s,": reordered"]})}}function kr({change:e,ownerSlug:n}){const s=sn(e,n);return t.jsxs(t.Fragment,{children:["Updated ",xr(e.changes,s).join(", ")]})}function vt({changes:e,entityId:n,entityType:s,ownerSlug:r,showAll:a=!1}){const i=sn({entityId:n,entityType:s},r),[c,o]=j.useState(a),l=e.flatMap(u=>fr(u,i)),d=c?l:l.slice(0,Nr),p=l.length-d.length;return t.jsxs("ul",{"data-testid":"field-changes",className:"space-y-0.5 text-sm",children:[d.map((u,m)=>t.jsx("li",{className:"min-w-0 truncate",children:t.jsx(wr,{line:u,ownerSlug:r})},m)),p>0?t.jsx("li",{children:t.jsxs("button",{type:"button",className:"text-xs text-primary hover:underline",onClick:u=>{u.stopPropagation(),o(!0)},children:["+",xt(p,"more change")]})}):null]})}function Cr({event:e,ownerSlug:n}){return e.kind==="relationship"?t.jsx(vr,{change:e.change,ownerSlug:n}):t.jsx(kr,{change:e,ownerSlug:n})}function Ar({event:e,ownerSlug:n}){return e.kind==="fields"?t.jsx(vt,{changes:e.changes,entityId:e.entityId,ownerSlug:n}):null}function Rr({operation:e}){switch(e){case"create":case"created":return t.jsx(H,{variant:"default",children:"Created"});case"update":case"updated":return t.jsx(H,{variant:"secondary",children:"Updated"});case"delete":case"deleted":return t.jsx(H,{variant:"destructive",children:"Deleted"});default:return t.jsx(H,{variant:"outline",children:e||"Change"})}}function Sr({operation:e,actor:n,createdAt:s,resource:r,changedFields:a}){return t.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r?t.jsx("span",{className:"break-words text-sm font-medium",children:r}):null,t.jsx(Rr,{operation:e}),t.jsx("time",{dateTime:s,title:s,className:"ml-auto text-xs text-muted-foreground",children:_n(s)})]}),t.jsxs("p",{className:"break-words text-xs text-muted-foreground",children:["by ",n||"unknown"]}),a?.length?t.jsxs("p",{className:"break-words text-xs text-muted-foreground",children:["Changed: ",a.join(", ")]}):null]})}function $r(e){return e.semantic_type==="change"&&(e.metadata?.category==="config"||e.metadata?.category==="deployment")}function be(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function Ir({content:e}){const n=e.metadata??{},s=e.payload_data??{},r=n.category==="deployment",a=typeof n.apply_id=="string"?n.apply_id:null,i=be(s.manifest),c=a&&/^apl_[A-Za-z0-9-]{1,48}$/.test(a)&&e.origin_type==="deployment"&&e.origin_id===`deployment_${a}`&&(n.status==="succeeded"||n.status==="partial_failure")&&be(i?.state);return t.jsxs("div",{className:"space-y-3","data-testid":"config-change-event",children:[t.jsx(Sr,{operation:r?String(n.status??"Apply"):typeof n.op=="string"?n.op:null,actor:e.author_name??(typeof n.actor_source=="string"?n.actor_source:null),createdAt:e.occurred_at??e.created_at,resource:r?"Configuration apply":`${n.resource_kind??"Configuration"} · ${n.resource_id??""}`,changedFields:Array.isArray(n.changed_fields)?n.changed_fields.filter(o=>typeof o=="string"):void 0}),a?t.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{className:"break-all",children:["Apply ",a]}),t.jsx(Et,{text:a,label:"Copy apply ID"})]}):null,r?t.jsxs(t.Fragment,{children:[typeof n.rollback_of=="string"?t.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:["Restores apply ",n.rollback_of]}):null,be(n.counts)?t.jsx("dl",{className:"flex flex-wrap gap-4 text-xs",children:Object.entries(be(n.counts)??{}).map(([o,l])=>t.jsxs("div",{children:[t.jsx("dt",{className:"text-muted-foreground",children:o}),t.jsx("dd",{children:String(l)})]},o))}):null,typeof s.error=="string"?t.jsx("p",{className:"text-sm text-destructive",children:s.error}):null,c?t.jsxs("div",{className:"space-y-2 rounded-md border p-3",children:[t.jsx("p",{className:"text-sm font-medium",children:"Restore this deployment"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Preview restoring this saved configuration with the CLI. Secret values stay unchanged."}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("code",{className:"break-all text-xs",children:["lobu rollback ",a]}),t.jsx(Et,{text:`lobu rollback ${a}`,label:"restore command",iconOnly:!0})]})]}):null,t.jsx(We,{before:null,after:i})]}):Object.hasOwn(s,"before")?t.jsx(We,{before:be(s.before),after:be(s.state)}):t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"text-xs text-muted-foreground",children:"The earlier state was not recorded for this change."}),t.jsx(We,{before:null,after:be(s.state)})]})]})}const Er={slack:"Slack",telegram:"Telegram",whatsapp:"WhatsApp",discord:"Discord",gchat:"Google Chat",teams:"Microsoft Teams",web:"Web"};function Tr(e){return Er[e]??null}function Mr(e){return e?e.kind==="automation"?`Ran ${e.automationName}`:e.platform==="web"?"Chatted in Lobu":`Replied on ${Tr(e.platform)??e.platform}`:"No activity yet"}function Dr({owner:e,item:n,last:s,appearance:r="row"}){const a=r==="inline",i=a?"inline-flex items-center gap-1.5 rounded-md bg-accent px-1.5 py-0.5 text-sm font-medium":G(Je,!s&&"border-b");if(n.kind==="managed"){const l=n.agent,d=[l.lastActivity===void 0?null:Mr(l.lastActivity),l.connectionCount===void 0?null:`${l.connectionCount} ${l.connectionCount===1?"connection":"connections"}`,l.userCount===void 0?null:`${l.userCount} ${l.userCount===1?"user":"users"}`].filter(u=>!!u),p=t.jsx(Nn,{className:"h-4 w-4 text-muted-foreground"});return t.jsx(W,{to:"/$owner/agents/$agentId",params:{owner:e,agentId:l.agentId},className:i,children:a?t.jsxs(t.Fragment,{children:[p,l.name]}):t.jsx(Le,{mark:p,name:l.name,details:t.jsx(Qe,{parts:d.length>0?d:[l.description]}),at:l.lastActivity?Date.parse(l.lastActivity.at):void 0})})}const c=n.group,o=t.jsx(bn,{name:c.title});return t.jsx(W,{to:"/$owner/agents/connected/$clientId",params:{owner:e,clientId:c.clientId},className:i,children:a?t.jsxs(t.Fragment,{children:[o,c.title]}):t.jsx(Le,{mark:o,name:c.title,details:t.jsx(Qe,{parts:[c.connected?"Connected app":"Disconnected",c.linkedUser,c.drivenBy&&c.drivenBy!==c.title?`via ${c.drivenBy}`:null]}),at:c.lastSeenAt})})}const Fr={event:{label:"Event",icon:Pt},schedule:{label:"Schedule",icon:kn},manual:{label:"Manual",icon:wn}};function Lr(e,n,s){switch(Sn(e)){case"script":return["Script"];case"external":case"manual":return["Outside client"];case"device":{const r=e.agent_kind,a=r&&r in Tt?Tt[r]:r;return[n,s,a].filter(i=>!!i)}case"agent":return[n??"Agent","Hosted"]}}function Or({automation:e,agentName:n,deviceLabel:s,connectorDisplay:r,owner:a,actions:i,rowClass:c,appearance:o="row"}){const l=e.automation,d=l.automation_id,p=Fr[e.kind];if(o==="inline")return t.jsxs(W,{to:"/$owner/automations/$automationId",params:{owner:a,automationId:d},search:{view:"definition",run_id:void 0},className:"inline-flex items-center gap-1.5 rounded-md bg-accent px-1.5 py-0.5 text-sm font-medium",children:[t.jsx(p.icon,{className:"h-3.5 w-3.5 shrink-0"}),e.does,l.status==="archived"?t.jsx(H,{variant:"outline",children:"Archived"}):null]});const u=Cn(e,Date.now()),m=l.processing_client_count??0,b=l.entity_name&&l.entity_type?`${l.entity_name} · ${l.entity_type}`:null;return t.jsxs("div",{className:c,children:[t.jsx(W,{to:"/$owner/automations/$automationId",params:{owner:a,automationId:d},search:{view:"definition",run_id:void 0},className:"flex min-w-0 flex-1 items-center gap-3",children:t.jsx(Le,{mark:r?t.jsx(Rn,{icon:r.icon,iconUrl:r.iconUrl,name:r.name,faviconDomain:r.faviconDomain,className:"h-7 w-7 text-[10px]"}):t.jsx(p.icon,{className:"h-4 w-4 text-muted-foreground"}),name:e.does,badge:l.status==="archived"?t.jsx(H,{variant:"outline",children:"Archived"}):null,tone:u.problem?"destructive":null,details:t.jsx(Qe,{parts:[u.text,...Lr(l,n,s),m>0?`${m} ${m===1?"client":"clients"}`:null,An(e.when),b]}),at:u.at})}),i]})}function Pr({record:e,workspace:n,appearance:s}){return t.jsx(Or,{automation:In(e),owner:n,agentName:e.managed_agent_id??null,deviceLabel:e.device_worker_id?"Device-pinned":null,connectorDisplay:null,appearance:s,rowClass:"flex items-center gap-3 rounded-lg border px-3 py-2.5"})}function Br({agent:e,workspace:n,appearance:s}){return t.jsx(Dr,{owner:n,appearance:s,last:!0,item:{kind:"managed",key:e.id,agent:{agentId:e.id,name:e.name,description:e.description??void 0}}})}function Ur({connector:e,connection:n,workspace:s,appearance:r}){const a=e.key,i=t.jsx(En,{connector:e,showDescription:r!=="inline"});return t.jsx("div",{className:r==="inline"?"inline-flex items-center gap-2":"rounded-lg border p-3",children:n?t.jsxs(W,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:s,connectorKey:a,connectionId:String(n.id)},search:{},children:[i,t.jsx("span",{className:"text-xs text-muted-foreground",children:$n(n)})]}):t.jsx(W,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:a},children:i})})}function He(e,n){return typeof e=="string"&&e.trim().length>0&&e.length<=n}function _t(e,n){if(!n||typeof n!="object"||Array.isArray(n))return null;const s=n;if(s.mode!=="live"||!He(s.workspace,128)||!/^[a-zA-Z0-9][a-zA-Z0-9_.-]*$/.test(s.workspace)||s.appearance!==void 0&&s.appearance!=="inline"&&s.appearance!=="row")return null;const r={mode:"live",workspace:s.workspace,appearance:s.appearance??"row"};return e==="automation-ref"?!He(s.automationId,128)||!/^[1-9][0-9]*$/.test(s.automationId)||!Number.isSafeInteger(Number(s.automationId))?null:{...r,automationId:s.automationId}:e==="connector-ref"?!He(s.connectorKey,128)||s.connectionId!==void 0&&(typeof s.connectionId!="number"||!Number.isSafeInteger(s.connectionId)||s.connectionId<=0)?null:{...r,connectorKey:s.connectorKey,...s.connectionId!==void 0?{connectionId:s.connectionId}:{}}:He(s.agentId,128)?{...r,agentId:s.agentId}:null}const zr=4,Kr=128;let it=0;const De=[];async function qr(e,n){if(e.aborted)throw e.reason;await new Promise((s,r)=>{const a=()=>{const c=De.indexOf(i);c>=0&&De.splice(c,1),r(e.reason)},i=()=>{e.removeEventListener("abort",a),it++,s()};it<zr?i():De.length>=Kr?r(new Error("Reference read capacity exceeded")):(De.push(i),e.addEventListener("abort",a,{once:!0}))});try{if(e.aborted)throw e.reason;return await n()}finally{it--,De.shift()?.()}}const Xe={retry:!1,staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:"always",refetchOnReconnect:"always"};function we({error:e}){const n=e instanceof Re&&(e.status===401||e.status===403)?"Access required to view this reference.":e instanceof Re&&e.status===404?"Reference not found.":"Reference unavailable.";return t.jsx("span",{role:"status",className:"text-sm text-muted-foreground",children:n})}function bt(){return t.jsx("span",{role:"status",className:"text-sm text-muted-foreground",children:"Loading reference…"})}function Vr({workspace:e,automationId:n,appearance:s}){const{session:r,isReady:a}=et(),i=gt(),c=Ye({...Xe,enabled:a&&!i,queryKey:["automations-list",e,"native-reference",r?.user.id??null,n],queryFn:({signal:l})=>qr(l,async()=>{let d;for(const u of["active","archived"])if(d=(await Ae("manage_automations",{action:"list",automation_id:n,status:u,include_details:!1,limit:1},{slug:e},{signal:l})).automations?.find(b=>b.automation_id===n),d)break;if(!d)throw new Re("Reference not found",404);const p=d.execution_config?.executor;return d={automation_id:d.automation_id,name:d.name,status:d.status,triggers:d.triggers,next_run_at:d.next_run_at,last_fired_at:d.last_fired_at,last_run_completed_at:d.last_run_completed_at,managed_agent_id:d.managed_agent_id,device_worker_id:d.device_worker_id,health:d.health,health_reasons:d.health_reasons,processing_client_count:d.processing_client_count,execution_config:p&&typeof p=="object"?{executor:{kind:p.kind}}:void 0},d})});if(i)return t.jsx("span",{role:"status",children:"Unavailable in visitor preview."});if(c.isPending||c.isFetching)return t.jsx(bt,{});if(c.error||!c.data)return t.jsx(we,{error:c.error});const o=c.data;return t.jsx(Pr,{record:o,workspace:e,appearance:s})}function Hr({workspace:e,connectorKey:n,connectionId:s,appearance:r}){const{session:a,isReady:i}=et(),c=gt(),o=Ye({...Xe,enabled:i&&!c,queryKey:["connector-definitions",e,"native-reference",a?.user.id??null],queryFn:async({signal:u})=>(await Tn({slug:e},{signal:u})).map(m=>({key:m.key,name:m.name,description:m.description,icon:m.icon}))}),l=Ye({...Xe,enabled:i&&!c&&s!==void 0,queryKey:["connections",e,"native-reference",a?.user.id??null,n,s??null],queryFn:async({signal:u})=>{const m=s===void 0?void 0:(await Ae("manage_connections",{action:"list",connection_ids:[s],connector_key:n,limit:1},{slug:e},{signal:u})).connections?.find(b=>b.id===s);if(s!==void 0&&(!m||m.id!==s||m.connector_key!==n))throw new Re("Reference not found",404);return{connection:m?{id:m.id,connector_key:m.connector_key,display_name:m.display_name,connector_name:m.connector_name,auth_profile_name:m.auth_profile_name,auth_profile_slug:m.auth_profile_slug}:void 0}}});if(c)return t.jsx("span",{role:"status",children:"Unavailable in visitor preview."});if(o.isPending||o.isFetching||s!==void 0&&(l.isPending||l.isFetching))return t.jsx(bt,{});if(o.error||s!==void 0&&(l.error||!l.data))return t.jsx(we,{error:o.error||l.error});const d=o.data?.find(u=>u.key===n);if(!d)return t.jsx(we,{error:new Re("Reference not found",404)});const p=l.data?.connection;return t.jsx(Ur,{connector:d,connection:p,workspace:e,appearance:r})}function Wr({workspace:e,agentId:n,appearance:s}){const{session:r,isReady:a}=et(),i=gt(),c=Ye({...Xe,enabled:a&&!i,queryKey:["agents",e,"native-reference",r?.user.id??null,n],queryFn:async({signal:l})=>{const d=await Ae("manage_agents",{action:"get",agent_id:n},{slug:e},{signal:l});if(d.agent?.id!==n)throw new Re("Reference not found",404);return{id:d.agent.id,name:d.agent.name,description:d.agent.description}}});if(i)return t.jsx("span",{role:"status",children:"Unavailable in visitor preview."});if(c.isPending||c.isFetching)return t.jsx(bt,{});if(c.error||!c.data)return t.jsx(we,{error:c.error});const o=c.data;return t.jsx(Br,{agent:o,workspace:e,appearance:s})}function Jr(e){const n=_t("automation-ref",e);return n?t.jsx(Vr,{...n}):t.jsx(we,{})}function Qr(e){const n=_t("connector-ref",e);return n?t.jsx(Hr,{...n}):t.jsx(we,{})}function Yr(e){const n=_t("agent-ref",e);return n?t.jsx(Wr,{...n}):t.jsx(we,{})}const ot=e=>typeof e=="string"&&e.trim().length>0&&e.length<=128,Gr={tabs:({defaultValue:e,children:n})=>ot(e)?t.jsx(Qs,{defaultValue:e,children:n}):null,"tabs-list":({label:e,children:n})=>t.jsx(Js,{label:typeof e=="string"&&e.length<=200?e:void 0,children:n}),"tabs-trigger":({value:e,children:n})=>ot(e)?t.jsx(Ws,{value:e,children:n}):null,"tabs-content":({value:e,children:n})=>ot(e)?t.jsx(Hs,{value:e,children:n}):null,"automation-ref":Jr,"connector-ref":Qr,"agent-ref":Yr,"json-diff":(({before:e,after:n})=>{const s=r=>r!==null&&typeof r=="object"&&!Array.isArray(r)?r:null;return t.jsx(We,{before:s(e),after:s(n)})})};function Fe(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Xr({template:e,data:n,onAction:s}){const[r,a]=j.useState(null),[i,c]=j.useState(!1),[o,l]=j.useState(null),[d,p]=j.useState(!1),u=j.useRef(!1),m=j.useRef(!0);j.useEffect(()=>(m.current=!0,()=>{m.current=!1}),[]);const b=async w=>{if(!(!s||u.current)){u.current=!0,c(!0),l(null),p(!1);try{const h=await s(w);if(!m.current)return;if(Fe(h)&&h.kind==="sdk"){const v=h.result;if(!Fe(v)||v.success!==!0){const N=Fe(v)&&Fe(v.error)?v.error.message:null;throw new Error(typeof N=="string"?N:"Could not update this event.")}if(v.return_truncated||!Fe(v.return_value))throw new Error("The update did not return a complete data object.");a(v.return_value),p(!0)}}catch(h){m.current&&l(h instanceof Error?h.message:"Could not update this event.")}finally{u.current=!1,m.current&&c(!1)}}};return t.jsxs("div",{className:"space-y-2",children:[i?t.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:"Updating…"}):null,d?t.jsx("p",{role:"status",className:"sr-only",children:"Updated"}):null,o?t.jsxs("p",{role:"alert",className:"text-sm text-destructive",children:[o," Previous data is still shown."]}):null,t.jsx("div",{"aria-busy":i,className:"min-w-0",children:t.jsx(sr,{template:{root:e.root},data:r??n,onAction:s?b:void 0,interactions:e.interactions,components:Gr,actionsDisabled:!s||i})})]})}function rn(e){return{audit:Yt(e),operation:e.interaction_type==="approval"||e.semantic_type==="operation",changeSet:e.semantic_type==="change_set"}}const Zr={},ea={notification:"Notification",tool_invocation:"Action",deployment:"Deployment",config_change:"Config change",message:"Message",msg:"Note",summary:"Summary"};function ta(e){return e.author_name?e.author_name:e.platform?Ge(e.platform):e.origin_type?ea[e.origin_type]??Ge(e.origin_type):null}function na(e){return e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):Array.isArray(e)?e.length===0?"":e.every(n=>typeof n!="object")?e.map(n=>String(n)).join(", "):t.jsx("pre",{className:"overflow-x-auto rounded bg-muted/40 p-2 text-[11px] leading-relaxed whitespace-pre-wrap",children:JSON.stringify(e,null,2)}):t.jsx("pre",{className:"overflow-x-auto rounded bg-muted/40 p-2 text-[11px] leading-relaxed whitespace-pre-wrap",children:JSON.stringify(e,null,2)})}const lt=1e5;function Ft({value:e}){const n=JSON.stringify(e,null,2)??"null",s=n.length>lt;return t.jsxs(t.Fragment,{children:[t.jsx("pre",{className:"max-h-80 overflow-auto whitespace-pre-wrap break-words rounded-md border bg-muted/40 p-3 font-mono text-xs",children:s?n.slice(0,lt):n}),s&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing the first ",lt.toLocaleString()," of"," ",n.length.toLocaleString()," characters."]})]})}function sa(e){return Object.entries(e).filter(([,n])=>n==null?!1:typeof n=="string"?n.trim().length>0:Array.isArray(n)?n.length>0:typeof n=="object"?Object.keys(n).length>0:!0).sort(([n],[s])=>n.localeCompare(s))}function ra({breakdown:e}){if(!e)return null;const n=[{label:"Engagement",value:e.engagement,max:100},{label:"Criticality",value:e.criticality,max:100},{label:"Depth",value:e.depth,max:100},{label:"Authority",value:e.authority,max:100},{label:"Recency",value:e.recency,max:100},{label:"Quality",value:e.quality,max:100}];return t.jsx("div",{className:"space-y-2 text-sm",children:n.map(s=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"w-20 text-muted-foreground",children:s.label}),t.jsx("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden",children:t.jsx("div",{className:"h-full bg-primary",style:{width:`${s.value/s.max*100}%`}})}),t.jsx("span",{className:"w-8 text-right",children:s.value})]},s.label))})}function aa({slug:e,value:n,isManual:s}){return t.jsxs(H,{variant:"secondary",className:"text-xs",children:[e,": ",n,s&&t.jsx(zt,{className:"ml-1 h-2.5 w-2.5 fill-current"})]})}function ia(e){if(e&&typeof e=="object"){const n=e;if(Array.isArray(n.values))return{values:n.values.map(s=>String(s)).filter(s=>s.length>0),isManual:n.is_manual===!0};if(n.value!==void 0&&n.value!==null)return{values:[String(n.value)],isManual:n.is_manual===!0};if(typeof n.values=="string"&&n.values.length>0)return{values:[n.values],isManual:n.is_manual===!0}}return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?{values:[String(e)],isManual:!1}:{values:[],isManual:!1}}function an(e,n){if(e)switch(e){case"pending":return"pending_approval";case"approved":return"confirmed";case"rejected":return"rejected";case"completed":return"completed";case"failed":return"failed";default:return e}return n||"pending_approval"}function ht(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function oa(e){return e.replace(/\s+[—-]\s+pending approval$/i,"")}function Ze(e){return e.replace(/^\$/,"").replace(/[_-]/g," ").replace(/\s+/g," ").trim().replace(/^./,n=>n.toUpperCase())}function la(e){const n=Object.keys(e.fields),s=n.map(Ze).join(", ")||"field",r=n.length===1?"field":"fields";return`Update ${e.entityType?Ze(e.entityType).toLowerCase():"entity"} ${r}: ${s}`}function ca(e,n){const s=ht(n.fields);if(!s||Object.keys(s).length===0||n.action_key!=="entity_field_change"&&n.tool!=="entity_field_change")return null;const r=ht(n.current)??{},a=e;return{fields:s,current:r,reason:typeof n.reason=="string"?n.reason:void 0,automationId:n.automation_id!=null?String(n.automation_id):void 0,automationName:typeof n.automation_name=="string"?n.automation_name:void 0,automationAgentId:typeof n.automation_agent_id=="string"?n.automation_agent_id:void 0,entityType:typeof n.entity_type=="string"?n.entity_type:void 0,entityName:(typeof n.entity_name=="string"?n.entity_name:void 0)??a.entity_name??void 0,entitySlug:typeof n.entity_slug=="string"?n.entity_slug:void 0,parentSlug:typeof n.parent_slug=="string"?n.parent_slug:void 0,parentEntityType:typeof n.parent_entity_type=="string"?n.parent_entity_type:void 0,attribution:typeof n.attribution=="string"?n.attribution:void 0,initiator:n.initiator&&typeof n.initiator=="object"?n.initiator:void 0}}function da(e){const n=e.entityType?Ze(e.entityType).toLowerCase():"entity";return`${Ze(e.operation)} ${n}`}function ua(e,n){if(n.action_key!=="entity_change"&&n.tool!=="entity_change")return null;const s=n.action;if(s!=="create"&&s!=="delete"&&s!=="link"&&s!=="unlink")return null;const r=e;return{operation:s,proposal:ht(n.proposal),reason:typeof n.reason=="string"?n.reason:void 0,automationId:n.automation_id!=null?String(n.automation_id):void 0,automationName:typeof n.automation_name=="string"?n.automation_name:void 0,automationAgentId:typeof n.automation_agent_id=="string"?n.automation_agent_id:void 0,entityType:typeof n.entity_type=="string"?n.entity_type:void 0,entityName:(typeof n.entity_name=="string"?n.entity_name:void 0)??r.entity_name??void 0,entitySlug:typeof n.entity_slug=="string"?n.entity_slug:void 0,parentSlug:typeof n.parent_slug=="string"?n.parent_slug:void 0,parentEntityType:typeof n.parent_entity_type=="string"?n.parent_entity_type:void 0,attribution:typeof n.attribution=="string"?n.attribution:void 0,proposerRationale:typeof n.proposer_rationale=="string"?n.proposer_rationale:void 0,initiator:n.initiator&&typeof n.initiator=="object"?n.initiator:void 0}}function ma(e,n){return!n.entityType||!n.entitySlug?null:fs(e,n.parentEntityType&&n.parentSlug?[{entity_type:n.parentEntityType,slug:n.parentSlug},{entity_type:n.entityType,slug:n.entitySlug}]:[{entity_type:n.entityType,slug:n.entitySlug}])}function on({ownerSlug:e,runId:n,details:s}){const a=Xt(s.automationId,void 0,void 0,{ownerSlug:e,includeVersions:!1}).data?.automation,i=Pe(),c=Gs(s.initiator,s.attribution,s.automationId),o=a?.automation_name??s.automationName??c;return t.jsxs("div",{className:"text-sm text-muted-foreground",children:["Requested by"," ",s.automationId?t.jsx(W,{to:"/$owner/automations/$automationId",params:{owner:e,automationId:s.automationId},search:{view:"definition",run_id:void 0},className:"font-medium text-foreground underline-offset-4 hover:underline",children:o}):t.jsx("span",{className:"font-medium text-foreground",children:o}),n&&t.jsxs(t.Fragment,{children:[t.jsx("span",{children:" · "}),t.jsxs(W,{to:"/$owner/events",params:{owner:e},search:{run_ids:String(n)},className:"font-medium text-foreground underline-offset-4 hover:underline",onClick:l=>{!i||l.button!==0||l.metaKey||l.ctrlKey||l.shiftKey||l.altKey||(l.preventDefault(),i.open({href:`/${e}/events?run_ids=${n}`,title:`Run #${n}`,runId:n}))},children:["Run #",n]})]})]})}function ln({ownerSlug:e,details:n}){const s=ma(e,n);return n.entityName?t.jsxs("div",{className:"rounded-md bg-muted/40 px-3 py-2",children:[t.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Entity"}),t.jsx("div",{className:"mt-1 text-sm font-medium",children:s?t.jsx(W,{to:s,className:"underline-offset-4 hover:underline",children:n.entityName}):n.entityName})]}):null}function pa({ownerSlug:e,runId:n,details:s}){return t.jsxs("div",{className:"space-y-3",children:[t.jsx(on,{ownerSlug:e,runId:n,details:s}),t.jsx(ln,{ownerSlug:e,details:s}),t.jsx("div",{className:"rounded-md border border-border/70 px-3 py-2",children:t.jsx(vt,{changes:Object.entries(s.fields).map(([r,a])=>({field:r,old:s.current[r]??null,new:a??null})),entityType:s.entityType,ownerSlug:e,showAll:!0})}),s.reason&&t.jsxs("div",{className:"rounded-md bg-muted/40 px-3 py-2",children:[t.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Reasoning"}),t.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:s.reason})]})]})}function fa({ownerSlug:e,runId:n,details:s,status:r}){const{operation:a}=s,i=a==="link"||a==="unlink";return t.jsxs("div",{className:"space-y-3",children:[t.jsx(on,{ownerSlug:e,runId:n,details:s}),!i&&t.jsx(ln,{ownerSlug:e,details:s}),t.jsxs("div",{className:"rounded-lg bg-muted/40 px-3 py-2",children:[t.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"Change"}),t.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:i?en(a,r):a==="create"?"Create a new entity after approval.":"Delete this entity after approval."}),i&&t.jsxs("div",{className:"mt-2 space-y-1 text-sm",children:[Zt(s.proposal).map((c,o)=>t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:o===0?"From: ":"To: "}),c.name]},c.id)),t.jsxs("div",{className:"text-muted-foreground",children:["Relationship:"," ",String(s.proposal?.relationship_type??s.proposal?.relationship_type_slug??"Relationship")]})]})]}),!i&&s.proposal&&t.jsxs("div",{className:"rounded-lg border border-border/70 p-3",children:[t.jsx("div",{className:"mb-1 text-xs font-medium text-muted-foreground",children:"Proposal"}),t.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-xs leading-relaxed",children:JSON.stringify(s.proposal,null,2)})]}),s.proposerRationale&&t.jsxs("div",{className:"rounded-lg bg-muted/40 px-3 py-2",children:[t.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:s.attribution==="agent"?"The agent's reasoning":"The Automation's reasoning"}),t.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:s.proposerRationale})]}),s.reason&&t.jsxs("div",{className:"rounded-lg bg-muted/40 px-3 py-2",children:[t.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"Why this needs approval"}),t.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:s.reason})]})]})}function xa({summary:e}){return t.jsxs("div",{className:"space-y-2 rounded-md border border-border/70 bg-muted/30 p-3 text-sm",children:[e.chips.length>0&&t.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.chips.map(n=>t.jsx(H,{variant:"outline",className:"text-[10px] font-normal",children:n},n))}),e.message&&t.jsx("p",{className:"leading-relaxed text-foreground",children:e.message}),e.reason&&t.jsxs("div",{className:"rounded-md bg-background/80 px-2.5 py-2",children:[t.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Why"}),t.jsx("div",{className:"mt-0.5 leading-relaxed",children:e.reason})]}),e.body&&t.jsxs("div",{className:"rounded-md bg-background/80 px-2.5 py-2",children:[t.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:e.kind==="verify"?"Expected comment":"Draft"}),t.jsx("div",{className:"mt-0.5 whitespace-pre-wrap leading-relaxed",children:e.body})]}),e.matchPreview&&t.jsxs("div",{className:"rounded-md bg-background/80 px-2.5 py-2",children:[t.jsxs("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:["Matched comment",e.matchAuthor?` · ${e.matchAuthor}`:""]}),t.jsx("div",{className:"mt-0.5 whitespace-pre-wrap leading-relaxed text-muted-foreground",children:e.matchPreview})]}),e.postUrl&&t.jsxs("a",{href:e.postUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:["Open post",t.jsx(Qt,{className:"h-3 w-3"})]})]})}function ha({ownerSlug:e,content:n,batchReview:s}){const r=n.metadata||{},a=n.run_id??void 0,i=ar(r),c=ca(n,r),o=ua(n,r),l=(c?la(c):o?da(o):void 0)||r.operation_name||r.action_name||(n.title?oa(n.title):void 0)||"Action",d=r.connection_name,p=r.operation_key||r.action_key||null,u=n.interaction_input_schema||r.input_schema||null,m=j.useMemo(()=>n.interaction_input||r.action_input||r.operation_input||Zr,[n.interaction_input,r.action_input,r.operation_input]),b=n.interaction_output||r.action_output||void 0,w=cr(m,b??null,p),h=n.interaction_error||r.error_message||void 0,v=an(n.interaction_status,r.status),N=r.reviewed_by_name||r.reviewed_by_id||void 0,k=r.reject_reason||void 0,S=r.initiator,R=ts({slug:e}),E=ns({slug:e}),T=ss(n.id,rs(u,m),u),{values:M,setValues:F}=T,[C,x]=j.useState(null),[B,V]=j.useState(!1),[P,y]=j.useState(""),L=v==="pending_approval"&&C?C:v,D=L==="pending_approval",X=typeof r.source_run_id=="number";return t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Pt,{className:"h-4 w-4 text-yellow-500"}),t.jsx("span",{className:"font-medium",children:l}),d&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:["on ",d]}),L==="confirmed"&&t.jsx(H,{variant:"outline",className:"text-blue-700 border-blue-300 bg-blue-50 dark:bg-blue-950/30 text-[10px]",children:"Approved"}),L==="completed"&&t.jsx(H,{variant:"outline",className:"text-green-700 border-green-300 bg-green-50 dark:bg-green-950/30 text-[10px]",children:"Completed"}),L==="failed"&&t.jsx(H,{variant:"outline",className:"text-red-700 border-red-300 bg-red-50 dark:bg-red-950/30 text-[10px]",children:"Failed"}),L==="rejected"&&t.jsx(H,{variant:"outline",className:"text-muted-foreground text-[10px]",children:"Rejected"})]}),!c&&!o&&(n.author_name||N)&&t.jsxs("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-xs text-muted-foreground",children:[n.author_name&&t.jsxs("span",{children:["Requested by"," ",t.jsx(Ys,{ownerSlug:e,initiator:S,clientName:n.author_name,fallback:n.author_name})]}),n.author_name&&N&&t.jsx("span",{children:"·"}),N&&t.jsxs("span",{children:[L==="rejected"?"Rejected":"Approved"," by"," ",t.jsx("span",{className:"font-medium text-foreground",children:N})]})]}),c&&t.jsx(pa,{ownerSlug:e,runId:a,details:c}),!c&&o&&t.jsx(fa,{ownerSlug:e,runId:a,details:o,status:L}),L==="rejected"&&k&&t.jsxs("div",{className:"rounded-md bg-muted/50 p-2 text-xs text-muted-foreground",children:[t.jsx("span",{className:"font-medium text-foreground",children:"Reason:"})," ",k]}),w&&t.jsx(xa,{summary:w}),i&&t.jsx(ir,{proposal:i}),!i&&(D?T.revision:u)&&(D||Object.keys(m).length>0)&&t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:w?"Full input":"Input"}),D?t.jsxs(t.Fragment,{children:[t.jsx(as,{visible:T.hasConflict,onReload:T.reset}),t.jsx(is,{schema:T.revision,values:M,onValuesChange:F,fieldIdPrefix:`action-${n.id}-`},`action-${n.id}`)]}):w?t.jsxs("details",{className:"text-xs",children:[t.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:"Raw input"}),t.jsx("pre",{className:"mt-1 bg-muted/50 rounded p-2 font-mono overflow-auto max-h-32",children:JSON.stringify(m,null,2)})]}):t.jsx("pre",{className:"text-xs bg-muted/50 rounded p-2 font-mono overflow-auto max-h-32",children:JSON.stringify(m,null,2)})]}),L==="completed"&&b&&Object.keys(b).length>0&&!w&&t.jsxs("div",{className:"rounded-md bg-green-50 dark:bg-green-950/30 p-3 text-sm space-y-1",children:[t.jsxs("div",{className:"flex items-center gap-1.5 text-green-700 dark:text-green-400 font-medium",children:[t.jsx(Vt,{className:"h-3.5 w-3.5"}),"Output"]}),t.jsx("pre",{className:"text-xs text-green-800 dark:text-green-300 font-mono whitespace-pre-wrap",children:JSON.stringify(b,null,2)})]}),L==="completed"&&b&&Object.keys(b).length>0&&w&&t.jsxs("details",{className:"text-xs",children:[t.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:"Raw output"}),t.jsx("pre",{className:"mt-1 rounded bg-green-50 p-2 font-mono dark:bg-green-950/30 overflow-auto max-h-32",children:JSON.stringify(b,null,2)})]}),L==="failed"&&h&&t.jsxs("div",{className:"rounded-md bg-red-50 dark:bg-red-950/30 p-3 text-sm",children:[t.jsxs("div",{className:"flex items-center gap-1.5 text-red-700 dark:text-red-400 font-medium",children:[t.jsx(qt,{className:"h-3.5 w-3.5"}),"Error"]}),t.jsx("p",{className:"text-xs text-red-800 dark:text-red-300 font-mono mt-1",children:h})]}),D&&!C&&X&&t.jsxs("div",{className:"pt-1 text-xs text-muted-foreground",children:["Review this proposal with the other changes in its Automation run.",s]}),D&&a&&!C&&!X&&t.jsx("div",{className:"flex items-center gap-2 pt-1",children:B?t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[t.jsx("input",{type:"text",placeholder:"Reason (optional)",value:P,onChange:le=>y(le.target.value),className:"h-7 text-xs border rounded px-2 flex-1 bg-background"}),t.jsxs(O,{size:"sm",variant:"destructive",className:"h-7 text-xs",onClick:()=>E.mutate({run_id:a,reason:P||void 0},{onSuccess:()=>{x("rejected")}}),disabled:E.isPending,children:[E.isPending&&t.jsx(Ne,{size:"sm",className:"mr-1"}),"Confirm Reject"]}),t.jsx(O,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:()=>{V(!1),y("")},children:"Cancel"})]}):t.jsxs(t.Fragment,{children:[t.jsxs(O,{size:"sm",className:"h-7 text-xs",onClick:()=>R.mutate({run_id:a,...i?{}:{input:ls(M)}},{onSuccess:()=>{x("confirmed")}}),disabled:!i&&!T.canSubmit||R.isPending||E.isPending,children:[R.isPending?t.jsx(Ne,{size:"sm",className:"mr-1"}):t.jsx(os,{className:"h-3 w-3 mr-1"}),i?"Approve":"Confirm"]}),t.jsxs(O,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>V(!0),disabled:R.isPending||E.isPending,children:[t.jsx(cs,{className:"h-3 w-3 mr-1"}),"Reject"]})]})})]})}function ga({content:e,ownerSlug:n}){const s=e.metadata||{},r=s.kind,a=e.run_id??null,i=typeof s.automation_id=="number"?s.automation_id:null,l=Xt(i!=null?String(i):void 0,void 0,void 0,{includeVersions:!1,ownerSlug:n}).data?.automation?.automation_name??(i!=null?`Automation ${i}`:"An Automation"),d=Zn({slug:n}),p=es({slug:n}),[u,m]=j.useState(!1),[b,w]=j.useState(""),[h,v]=j.useState(null);if(r==="automation_batch_reject"){const x=s.reason||void 0;return t.jsxs("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 p-3",children:[t.jsx("div",{className:"text-sm font-medium",children:"Proposals rejected"}),x&&t.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:x}),t.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:"Ask the agent to revise its proposals with this feedback."})]})}const N=Array.isArray(s.changes)?s.changes:[],k=typeof s.created_count=="number"?s.created_count:N.filter(x=>x.kind==="created").length,S=typeof s.updated_count=="number"?s.updated_count:N.filter(x=>x.kind==="updated").length,R=typeof s.denied_count=="number"?s.denied_count:N.filter(x=>x.kind==="denied").length,E=N.filter(x=>x.kind==="denied"),T=N.filter(x=>x.kind==="updated"&&Object.keys(x.applied||{}).length>0),M=typeof s.pending_proposal_count=="number"?s.pending_proposal_count:null,F=M==null||M>0,C=F?"proposed":"applied";return t.jsxs("div",{className:"rounded-md border p-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1",children:[t.jsxs("div",{className:"text-sm font-medium",children:[C==="proposed"?"Proposed":"Applied"," ",k," ","new + ",S," updated",R>0&&t.jsxs(t.Fragment,{children:[" + ",R," denied"]})]}),t.jsxs("div",{className:"text-xs text-muted-foreground",children:[i!=null?t.jsx(W,{to:"/$owner/automations/$automationId",params:{owner:n,automationId:String(i)},search:{view:"definition",run_id:void 0},className:"font-medium text-foreground underline-offset-4 hover:underline",children:l}):t.jsx("span",{className:"font-medium text-foreground",children:l}),a!=null&&t.jsxs("span",{children:[" · run #",a]}),M!=null&&M>0&&t.jsxs("span",{children:[" · ",M," pending"]})]})]}),T.length>0&&t.jsx("div",{className:"mt-3 space-y-2",children:T.map(x=>t.jsxs("div",{className:"space-y-1.5",children:[t.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:x.name}),t.jsx(vt,{changes:Object.entries(x.applied).map(([B,V])=>({field:B,old:V.old??null,new:V.new??null})),entityId:x.entityId,ownerSlug:n,showAll:!0})]},x.entityId))}),E.length>0&&t.jsx("div",{className:"mt-3 space-y-1.5",children:E.map(x=>t.jsxs("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-2.5 py-2",children:[t.jsxs("div",{className:"text-xs font-medium",children:[x.name," — not written"]}),x.denied&&t.jsxs("div",{className:"mt-0.5 text-xs text-muted-foreground",children:[x.denied.reason,t.jsxs("span",{className:"ml-1 opacity-70",children:["(refused by"," ",x.denied.source==="rule"?"a write rule":"org policy",")"]})]})]},`denied-${x.entityId}-${x.name}`))}),a!=null&&h==null&&F&&t.jsx("div",{className:"mt-3 border-t border-border/70 pt-3",children:u?t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[t.jsx("input",{type:"text",placeholder:"What should the agent change?",value:b,onChange:x=>w(x.target.value),className:"h-7 text-xs border rounded px-2 flex-1 bg-background"}),t.jsxs(O,{size:"sm",variant:"destructive",className:"h-7 text-xs",onClick:()=>p.mutate({run_id:a,reason:b||void 0},{onSuccess:()=>v("rejected")}),disabled:p.isPending,children:[p.isPending&&t.jsx(Ne,{size:"sm",className:"mr-1"}),"Reject all"]}),t.jsx(O,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:()=>{m(!1),w("")},children:"Cancel"})]}):t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(O,{size:"sm",className:"h-7 text-xs",onClick:()=>d.mutate({run_id:a},{onSuccess:()=>v("approved")}),disabled:d.isPending||p.isPending,children:[d.isPending&&t.jsx(Ne,{size:"sm",className:"mr-1"}),"Approve all proposals"]}),t.jsx(O,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>m(!0),disabled:d.isPending||p.isPending,children:"Reject with feedback"})]})}),h==="approved"&&t.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"All proposals approved."}),h==="rejected"&&t.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Proposals rejected — ask the agent to revise them."}),a!=null&&h==null&&!F&&t.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"All proposals reviewed."})]})}function ya(e){if(!e)return;const n={};for(const[s,r]of Object.entries(e))s==="_lobu_idempotency_key"||s==="agent_id"||(n[s]=r);return Object.keys(n).length>0?n:void 0}function ja({renderDetail:e,ownerSlug:n,content:s,connectorDefinitions:r,hideDetails:a=!1}){const[i,c]=j.useState(null),[o,l]=j.useState(!1),[d,p]=j.useState(!1),[u,m]=j.useState(!1),[b,w]=j.useState(!1),[h,v]=j.useState(!1),[N,k]=j.useState(null),[S,R]=j.useState(s.title??""),[E,T]=j.useState(s.text_content??""),M=Kn(),F=qn(),C=Pe(),{currentOwner:x,allOrgs:B,isAuthenticated:V}=Vn(),P=n??x,y=P==="me"?null:P,L=j.useCallback(async g=>{if(!y){Ue.error("Open this event inside a workspace to interact with it.");return}const $=await or(y,Number(s.id),g,crypto.randomUUID());return"event_id"in $&&Ue.success("Recorded"),$},[s.id,y]),D=s.payload_data??{},{audit:X,operation:le,changeSet:J}=rn(s),pe=X&&(D.request!==void 0||D.request_status==="too_large"),Q=X&&Array.isArray(D.sdk_call_trace)&&D.sdk_call_trace.length>0,Z=V&&y?(B??[]).find(g=>g.slug===y):void 0,ce=s.semantic_type==="guidance",{isAdmin:fe,isLoading:ee}=Hn(ce?Z?.id:void 0),ne=Wn(),je=$r(s),Y=mt(C?.item?.href.split(/[?#]/)[0]??""),se=Y?.owner===P&&Y?.eventId===Number(s.id),re=(g,$,K)=>{C?C.open({href:g,title:$,...K==null?{}:{runId:K}}):M({to:g})},ae=(g,$)=>{if(!y)return null;const K=`/${y}/events?run_ids=${g}`;if(C?.item?.href===K)return null;const ge=()=>re(K,`Run #${g}`,g),Me="Show everything this run recorded";return $?t.jsxs(O,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:ge,title:Me,children:[t.jsx(Xn,{className:"h-3.5 w-3.5"}),$]}):t.jsxs("button",{type:"button",className:"hover:text-foreground hover:underline",onClick:ge,title:Me,children:["Run #",g]})},ie=s.run_id!=null&&!(C&&y&&s.automation_id!=null)?ae(s.run_id):null,de=Jn(s),ue=s.automation_id,xe=C&&y&&de!=null&&ue!=null?()=>C.open({href:`/${y}/automations/${ue}?view=activity&run_id=${de}`,title:`${s.automation_name??`Automation ${ue}`} · Run #${de}`,runId:de}):void 0,te=s.metadata?.source_run_id,z=br(s),ve=(!s.platform||s.platform==="lobu")&&s.connection_id==null&&s.feed_id==null&&s.origin_type==null&&s.automation_id==null&&!X&&!le&&!J&&!je&&z==null&&s.semantic_type!=="tombstone"&&s.semantic_type!=="notification"&&s.metadata?.tombstone!==!0&&s.interaction_type!=="approval"&&s.interaction_status==null&&!s.is_superseded&&s.superseded_by==null,ke=!!(y&&Z&&ve&&(!ce||!ee&&fe)),_=ke&&s.payload_type!=="json_template"&&s.payload_type!=="media",I=()=>{ne.invalidateQueries({queryKey:[ms]}),ne.invalidateQueries({queryKey:[ps]}),ne.invalidateQueries({queryKey:["search-memory"]})},me=async()=>{if(!(!y||!_)){if(w(!1),k(null),s.payload_truncated){p(!0);try{const $=(await Ae("read_knowledge",{content_ids:[Number(s.id)]},{slug:y})).content?.find(K=>Number(K.id)===Number(s.id));R($?.title??s.title??""),T($?.text_content??$?.payload_text??s.text_content??""),l(!0)}catch(g){k(g instanceof Error?g.message:"Failed to load full memory.")}finally{p(!1)}return}R(s.title??""),T(s.text_content??""),l(!0)}},$e=async()=>{if(!y||u)return;if(!E.trim()){k("Memory content cannot be empty.");return}m(!0),k(null);try{const $=s.payload_type==="markdown"||s.payload_type==="text"?s.payload_type:"text",K=ya(s.metadata);await Ae("save_memory",{supersedes_event_id:Number(s.id),semantic_type:s.semantic_type||"note",payload_type:$,title:S.trim()||void 0,content:E,...Array.isArray(s.entity_ids)&&s.entity_ids.length>0?{entity_ids:s.entity_ids}:{},...s.source_url?{source_url:s.source_url}:{},...s.author_name?{author:s.author_name}:{},...s.occurred_at?{occurred_at:s.occurred_at}:{},...s.payload_data&&Object.keys(s.payload_data).length>0?{payload_data:s.payload_data}:{},...K?{metadata:K}:{}},{slug:y}),l(!1),I(),Ue.success("Memory updated")}catch($){k($ instanceof Error?$.message:"Failed to update memory.")}finally{m(!1)}},Ie=async()=>{if(!(!y||h)){v(!0),k(null);try{const g=Number(s.id),$=await Ae("run_sdk",{title:"Delete memory",script:`export default async (_ctx, client) => client.knowledge.delete(${JSON.stringify({content_id:g,reason:"Deleted from web UI"})});`},{slug:y});if($?.success===!1){const ge=typeof $.error=="string"?$.error:$.error?.message||"Failed to delete memory.";throw new Error(ge)}w(!1),se&&C?.close();const K=mt(F.pathname);K?.owner===y&&K.eventId===g&&M({to:"/$owner/events",params:{owner:y}}),I(),Ue.success("Memory deleted")}catch(g){k(g instanceof Error?g.message:"Failed to delete memory.")}finally{v(!1)}}},Ee=ke&&!o?b?t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t.jsxs(O,{type:"button",variant:"destructive",size:"sm",className:"h-7 px-2.5 text-xs",disabled:h,onClick:()=>void Ie(),children:[h&&t.jsx(Ne,{size:"xs",className:"mr-1.5"}),h?"Deleting...":"Delete"]}),t.jsx(O,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",disabled:h,onClick:()=>{w(!1),k(null)},children:"Cancel"})]}):t.jsxs(t.Fragment,{children:[_&&t.jsxs(O,{type:"button",variant:"ghost",size:"sm","aria-label":"Edit memory",className:"h-7 gap-1 px-2 text-xs text-muted-foreground hover:text-foreground",disabled:d||h,onClick:()=>void me(),children:[d?t.jsx(Ne,{size:"xs"}):t.jsx(ds,{className:"h-3.5 w-3.5"}),t.jsx("span",{children:d?"Loading...":"Edit"})]}),t.jsxs(O,{type:"button",variant:"ghost",size:"sm","aria-label":"Delete memory",className:"h-7 gap-1 px-2 text-xs text-muted-foreground hover:text-destructive",disabled:d,onClick:()=>{k(null),w(!0)},children:[t.jsx(us,{className:"h-3.5 w-3.5"}),t.jsx("span",{children:"Delete"})]})]}):null,tt=o?t.jsxs("form",{className:"mt-2 space-y-3 rounded-lg border bg-background p-3 text-foreground",onSubmit:g=>{g.preventDefault(),$e()},children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx("label",{htmlFor:`memory-title-${s.id}`,className:"block text-xs font-medium text-muted-foreground",children:"Title"}),t.jsx(Qn,{id:`memory-title-${s.id}`,"aria-label":"Memory title",value:S,onChange:g=>R(g.target.value),placeholder:"Optional short summary",disabled:u})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs("label",{htmlFor:`memory-content-${s.id}`,className:"block text-xs font-medium text-muted-foreground",children:["Content",t.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),t.jsx(Yn,{id:`memory-content-${s.id}`,"aria-label":"Memory content",value:E,onChange:g=>T(g.target.value),rows:5,disabled:u})]}),N&&t.jsx("div",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:N}),t.jsx(Gn,{onCancel:()=>{l(!1),k(null)},cancelDisabled:u,children:t.jsxs(O,{type:"submit",disabled:u||E.trim().length===0,children:[u&&t.jsx(Ne,{size:"xs",className:"mr-1.5"}),u?"Saving...":"Save"]})})]}):null,Be=!o&&N?t.jsx("div",{role:"alert",className:"mt-2 rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:N}):null,Te=je?t.jsx(Ir,{content:s}):y?J?t.jsx(ga,{content:s,ownerSlug:y}):le?t.jsx(ha,{ownerSlug:y,content:s,batchReview:typeof te=="number"?ae(te,"Review run"):null}):void 0:void 0,he=e?e(Te):{content:Te,nativeHeading:Te!=null};return t.jsx(ba,{primaryContent:he.content,nativeHeading:he.nativeHeading,heading:z&&y?t.jsx(Cr,{event:z,ownerSlug:y}):void 0,body:tt??(z&&y?t.jsx(Ar,{event:z,ownerSlug:y}):void 0),detailLinks:he.links,headingAside:he.headingAside,hideDetails:a,presentation:"detail",content:s,ownerSlug:P??void 0,connectorDefinitions:r,onRenderedAction:y?L:void 0,runAction:ie,memoryActions:Ee,memoryFeedback:Be,runId:de??s.run_id??null,onRunSelect:xe,auditDetails:(pe||Q)&&t.jsxs("div",{className:"space-y-3",children:[t.jsx("div",{className:"flex flex-wrap gap-2",children:[{key:"request",label:"Request",available:pe},{key:"calls",label:"SDK calls",available:Q}].map(g=>g.available?t.jsxs(O,{variant:"outline",size:"sm","aria-expanded":i===g.key,onClick:()=>c($=>$===g.key?null:g.key),children:[i===g.key?t.jsx(dt,{className:"h-3.5 w-3.5"}):t.jsx(ut,{className:"h-3.5 w-3.5"}),g.label]},g.key):null)}),i==="request"&&(D.request_status==="too_large"?t.jsxs("p",{className:"text-sm text-muted-foreground",children:["The request was too large to retain",typeof D.request_bytes=="number"?` (${D.request_bytes.toLocaleString()} bytes).`:"."]}):t.jsx(Ft,{value:D.request})),i==="calls"&&t.jsx(Ft,{value:D.sdk_call_trace})]})})}function va(e,n){const s=e.payload_data??{},r=e.metadata??{};if(n.audit&&typeof s.success=="boolean")return s.success?"completed":"failed";if(n.changeSet)return r.kind==="automation_batch_reject"?"rejected":typeof r.pending_proposal_count!="number"?void 0:r.pending_proposal_count>0?"pending_approval":"completed";if(n.operation)return an(e.interaction_status,typeof r.status=="string"?r.status:void 0)}function _a(e){return e==="pending_approval"?"Needs approval":e==="confirmed"?"Approved":e?Ge(e):null}function ba({presentation:e,primaryContent:n,nativeHeading:s=!1,heading:r,body:a,detailLinks:i,headingAside:c,content:o,ownerSlug:l,connectorDefinitions:d,onRenderedAction:p,runAction:u,memoryActions:m,memoryFeedback:b,auditDetails:w,runId:h,onRunSelect:v,hideDetails:N=!1}){const[k,S]=j.useState(!1),R=o.metadata??{},E=typeof o.score=="number"&&Number.isFinite(o.score)?Math.round(o.score):"-",T=o.payload_type||"text",M=T==="text"&&(o.semantic_type==="notification"||o.automation_id!=null)?"markdown":T,F=o.text_content||"",C=e==null&&(M==="text"||M==="markdown")&&F.length>500,x=C&&!k?`${F.slice(0,500)}...`:F,B=o.payload_data??{},V=rn(o),{audit:P,operation:y}=V,L=va(o,V),D=_a(L),X=(P?Bt(o).title:null)??o.title,le=P&&B.error&&typeof B.error=="object"?B.error.message:void 0,[J,pe]=j.useState(P&&n==null&&i==null),Q=P?B.duration_ms:R.duration_ms,Z=typeof Q=="number"&&Number.isFinite(Q)&&Q>=0?Q:null,ce=P&&typeof B.sdk_call_count=="number"&&Number.isSafeInteger(B.sdk_call_count)&&B.sdk_call_count>=0?B.sdk_call_count:null,fe=R.thumbnail_url||R.thumbnail,ee=R.media_url,ne=sa(R),je=Object.entries(o.classifications||{}).flatMap(([_,I])=>{const me=ia(I);return me.values.map($e=>({slug:_,value:$e,isManual:me.isManual}))}),Y=(()=>{const _=o.platform||(typeof R.platform=="string"?R.platform:null),I=o.connection_id!=null?o.connection_id:R.source_connection_id!=null?Number(R.source_connection_id):null;return{...o,platform:_,connection_id:I!=null&&Number.isFinite(I)?I:null}})(),se=(()=>{const _=o.source_url??R.browser_url;if(typeof _!="string"||!URL.canParse(_))return null;const I=new URL(_);return I.protocol==="https:"||I.protocol==="http:"?I:null})(),re=o.occurred_at?new Date(o.occurred_at):null,{KindIcon:ae,kindLabel:ie}=Ut(o),de=t.jsx(yt,{source:Y,connectorDefinitions:d,sourceUrl:se,label:ie,fallback:t.jsx(ae,{className:"h-4 w-4"})}),ue=ne.length>0?t.jsx("dl",{className:"grid gap-x-3 gap-y-2 text-sm sm:grid-cols-[minmax(140px,180px)_1fr]",children:ne.map(([_,I])=>t.jsxs("div",{className:"contents",children:[t.jsx("dt",{className:"text-muted-foreground",children:Ge(_)}),t.jsx("dd",{className:"min-w-0 break-words font-mono text-xs sm:text-sm",children:na(I)})]},_))}):null,xe=a?t.jsx("div",{className:"mt-1",children:a}):t.jsxs(t.Fragment,{children:[o.rating&&t.jsx("div",{className:"flex items-center gap-1 mb-2",children:[1,2,3,4,5].map(_=>t.jsx(zt,{className:`h-4 w-4 ${_<=Number(o.rating)?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},_))}),fe&&t.jsx("a",{href:ee||o.source_url||"#",target:"_blank",rel:"noopener noreferrer",className:"block mb-2",children:t.jsx("img",{src:fe,alt:"",className:`rounded-md object-cover ${M==="media"?"max-h-96 w-full":"max-h-48"}`,loading:"lazy"})}),(()=>{switch(M){case"markdown":if(x)return t.jsx("div",{className:"max-w-none text-sm space-y-2",children:t.jsx(Mn,{text:x})});break;case"json_template":{const _=o.payload_data;if(_?._truncated===!0&&typeof _.bytes=="number")return t.jsxs("div",{className:"space-y-2 text-sm",children:[t.jsx("p",{role:"status",children:"This report is too large for the feed preview. Open the full event to view its complete data."}),l?t.jsx(W,{to:Kt(l,Number(o.id)),className:"underline underline-offset-4",children:"Open full report"}):null]});const I=o.payload_template;if(I?.root)return t.jsx(Xr,{template:I,data:o.payload_data||{},onAction:n?void 0:p},`${l}:${o.id}`);if(x)return t.jsx("div",{className:"text-sm whitespace-pre-wrap",children:x});break}case"media":return t.jsxs("div",{className:"space-y-3",children:[!fe&&ee&&t.jsx("a",{href:ee,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary hover:underline truncate block",children:ee}),x&&t.jsx("div",{className:"text-sm whitespace-pre-wrap text-muted-foreground",children:x})]});case"empty":return t.jsxs("div",{className:"space-y-3",children:[w,ue??(w?null:t.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No content"}))]});default:if(x)return t.jsx("div",{className:"text-sm whitespace-pre-wrap",children:x});break}return t.jsxs("div",{className:"space-y-3",children:[ee&&!fe&&t.jsx("a",{href:ee,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-muted-foreground hover:text-foreground truncate block",children:ee}),ue]})})()]}),te=n!=null||e==="detail"&&P,z=c!==void 0,ve=te||i!=null,ke=!!(D&&!s||ce!=null||Z!=null||!z&&m!=null||E!=="-"&&o.score_breakdown!=null||se!=null);return j.useEffect(()=>{if(!z||!J)return;const _=I=>{I.key==="Escape"&&(I.preventDefault(),pe(!1))};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[z,J]),t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:G("flex gap-3",e==="detail"&&"mb-5",z&&"relative"),children:[t.jsx(Dn,{children:de}),t.jsxs("div",{className:"min-w-0 flex-1",children:[e==="detail"&&(()=>{const _={semantic_types:o.semantic_type,...typeof o.automation_id=="number"?{produced_by:String(o.automation_id)}:{},...typeof o.run_id=="number"?{run_ids:String(o.run_id)}:{}};return t.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[o.semantic_type?l?t.jsx(W,{to:"/$owner/events",params:{owner:l},search:_,className:"hover:underline",title:`Show all ${ie} events`,children:ie}):t.jsx("span",{children:ie}):t.jsx("span",{children:ie}),re&&t.jsx("time",{dateTime:re.toISOString(),children:Fn(re)}),u]})})(),t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[(r??X)&&!s&&t.jsx("h4",{className:G("min-w-0 font-medium",e==="detail"?"text-xl leading-snug":"line-clamp-2 text-sm"),children:r??X}),e!=="detail"&&re&&t.jsx(Ln,{at:re}),z&&t.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-1 pt-0.5",children:[c,m,ve&&t.jsxs(O,{type:"button",variant:"ghost",size:"sm",className:"h-7 gap-1 px-2 text-muted-foreground hover:text-foreground","aria-expanded":J,onClick:()=>pe(_=>!_),children:["Details",J?t.jsx(dt,{className:"h-3.5 w-3.5"}):t.jsx(ut,{className:"h-3.5 w-3.5"})]})]})]}),ke&&t.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[D&&!s&&t.jsxs(H,{variant:L==="failed"?"destructive":"secondary",className:"gap-1 text-xs",children:[L==="failed"?t.jsx(qt,{className:"h-3 w-3"}):L==="completed"?t.jsx(Vt,{className:"h-3 w-3"}):null,D]}),ce!=null&&t.jsxs("span",{children:[ce," SDK ",ce===1?"call":"calls"]}),Z!=null&&t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(On,{className:"h-3 w-3"}),Z<1e3?`${Math.round(Z)}ms`:`${Number((Z/1e3).toFixed(2))}s`]}),E==="-"?null:o.score_breakdown?t.jsxs(Ht,{children:[t.jsx(Wt,{asChild:!0,children:t.jsx(O,{variant:"ghost",size:"sm",className:"h-7 px-2",children:t.jsx("span",{className:"font-medium",children:E})})}),t.jsx(Jt,{className:"w-64",align:"end",children:t.jsxs("div",{className:"space-y-2",children:[t.jsx("h4",{className:"font-medium",children:"Score Breakdown"}),t.jsx(ra,{breakdown:o.score_breakdown})]})})]}):null,se&&t.jsxs(Pn,{children:[t.jsx(Bn,{asChild:!0,children:t.jsx(O,{variant:"ghost",size:"sm",className:"h-7 gap-1 px-1",asChild:!0,children:t.jsxs("a",{href:se.href,target:"_blank",rel:"noopener noreferrer",children:[t.jsx(Qt,{className:"h-3.5 w-3.5"}),t.jsx("span",{children:"View original"})]})})}),t.jsx(Un,{children:"View original"})]}),!z&&m]}),b,l&&!(e==="detail"&&y)&&t.jsx(zn,{owner:l,source:Y,connectorDefinitions:d,variant:"chips",className:"mt-2 text-xs",runId:h,onRunSelect:v}),(o.author_name||!l)&&!(e==="detail"&&y)&&t.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:o.author_name||ta(o)})]}),z&&J&&ve&&t.jsxs("div",{className:"absolute inset-x-0 top-full z-20 mt-2 max-h-[65vh] space-y-3 overflow-y-auto rounded-lg border bg-background p-3 shadow-lg",children:[i,te&&xe]})]}),typeof le=="string"&&t.jsx("p",{className:"mb-2 text-sm whitespace-pre-wrap text-destructive",children:le}),n,!te&&xe,(te||i!=null)&&c===void 0&&!(N&&n!=null)&&t.jsxs("details",{className:"mt-5 border-t pt-3",open:J,onToggle:_=>pe(_.currentTarget.open),children:[t.jsx("summary",{className:"cursor-pointer text-sm text-muted-foreground",children:"Details"}),J&&t.jsxs("div",{className:"mt-3 space-y-3",children:[i,te&&xe]})]}),C&&t.jsx(O,{variant:"link",size:"sm",className:"px-0 h-6 mt-1",onClick:()=>S(!k),children:k?t.jsxs(t.Fragment,{children:[t.jsx(dt,{className:"h-3 w-3 mr-1"})," Show less"]}):t.jsxs(t.Fragment,{children:[t.jsx(ut,{className:"h-3 w-3 mr-1"})," Show more"]})}),je.length>0&&t.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:je.map(_=>t.jsx(aa,{slug:_.slug,value:_.value||"",isManual:_.isManual},_.slug))})]})}function Na(e,n){const s=e.metadata??{},r=Yt(e)?Bt(e,n):null,{KindIcon:a,kindLabel:i}=Ut(e),c=hs(e,n),o=e.interaction_error??(typeof s.error_message=="string"?s.error_message:r?.failed?"Failed":null),l=e.platform||(typeof s.platform=="string"?s.platform:null);return{title:c,kindLabel:i,error:o,KindIcon:a,platform:l}}function wa(e,n){const s=Number(e.metadata?.resource_id);return n!=="me"&&e.semantic_type==="notification"&&e.metadata?.resource_type==="automation"&&Number.isSafeInteger(s)&&s>0?gs(n,String(s)):Kt(n,Number(e.id))}function ka(e,n){const s=ys(e);return s&&n?n(s):null}function Ca({content:e,ownerSlug:n,connectorDefinitions:s,hideOriginator:r=!1,showEntity:a=!1,connectionName:i,callerName:c,extra:o,unread:l=!1,onOpen:d}){const p=Pe(),{title:u,kindLabel:m,error:b,KindIcon:w,platform:h}=Na(e,i),v=e.interaction_status==="pending",N=!!b||e.interaction_status==="failed",k=n?wa(e,n):null,S=mt(p?.item?.href.split(/[?#]/)[0]??""),R=S!=null&&S.owner===n&&S.eventId===Number(e.id),E=[m,a?e.entity_name:null,e.automation_name,r?null:e.connection_name??e.feed_name,e.agent_name??e.client_name??e.device_label??ka(e,c),o],T=t.jsx(Le,{mark:t.jsx(yt,{source:{...e,platform:h},connectorDefinitions:s,label:m,fallback:t.jsx(w,{className:"h-4 w-4 text-muted-foreground"})}),name:u,badge:l&&!N?t.jsx("span",{className:"sr-only",children:"Unread"}):null,tone:v||l&&!N?"amber":N?"destructive":null,details:t.jsx(Qe,{parts:E}),at:e.occurred_at?new Date(e.occurred_at).getTime():null});if(!k)return t.jsx("div",{className:G(Je,"cursor-default"),children:T});const M=C=>{d?.(),!(!p||C.metaKey||C.ctrlKey||C.shiftKey||C.altKey||C.button!==0)&&(C.preventDefault(),p.open({href:k,title:u}))},F=xs(k);return t.jsx(W,{to:F.pathname,search:F.search,"aria-current":R?"true":void 0,className:G(Je,R&&"bg-accent"),onClick:M,children:T})}function Oe(e,n,s=`${n}s`){return`${e} ${e===1?n:s}`}function Nt(e){const n=[...new Set(e.apps.map(r=>r.name))];if(n.length>1)return Oe(e.apps.length,"app");const s=n[0]??"Unknown app";return e.apps.length>1?`${s} (${e.apps.length})`:s}function Lt(e){const{oldestAt:n,newestAt:s}=e;if(n==null||s==null)return null;const r=ks(n,s),a=Se(n,r?"p":"d MMM p"),i=Se(s,r?"p":"d MMM p");return a===i?a:`${a}–${i}`}function cn(e){const n=new Map;for(const s of e.calls)n.set(s.call.title,(n.get(s.call.title)??0)+1);return[...n].map(([s,r])=>({title:s,count:r})).sort((s,r)=>r.count-s.count)}function dn(e){const n=cn(e)[0]?.title??"Ran background checks";return`${Nt(e)} ${n.charAt(0).toLowerCase()}${n.slice(1)}`}function un(e){return cn(e).slice(1).map(n=>`${n.title.charAt(0).toLowerCase()}${n.title.slice(1)} ${n.count}×`)}function Aa(e,n){if(e.source)return e.source.name;if(e.kind==="background")return dn(e);if(n.idle)return"Looked around, changed nothing";const{topAction:s}=n;return n.changed[0]??(s?`${s.title}${s.count>1?` · ${s.count}×`:""}`:null)??n.explicitTitles[0]??Nt(e)}function Ra(e){return[e.reads>0?Oe(e.reads,"read"):null,e.actions>0?Oe(e.actions,"action"):null].filter(Boolean).join(" · ")}function Sa({summary:e,headline:n}){const s=Ra(e),r=e.changed[0]===n?e.changed.slice(1):e.changed;if(r.length===0){const c=e.idle?e.explicitTitles.slice(0,2):[];return t.jsx("span",{className:"block truncate",children:[...c,s].filter(Boolean).join(" · ")})}const a=r.slice(0,2),i=r.length-a.length;return t.jsxs("span",{className:"block truncate text-foreground/80",children:["Changed: ",a.join(" · "),i>0?` · ${i} more`:"",s?t.jsxs("span",{className:"text-muted-foreground",children:[" — ",s]}):null]})}function $a({stretch:e,ownerSlug:n,connectorDefinitions:s,connectionName:r,sourceConnection:a,showEntity:i=!1},c){const o=Pe();return!o||!n?{open:null,selected:!1}:{selected:o.item?.key===e.key,open:()=>o.open({href:"",key:e.key,title:c,workStretch:{stretch:e,ownerSlug:n,connectorDefinitions:s,connectionName:r,sourceConnection:a,showEntity:i}})}}function Ia(e){if(e.length<2)return null;const n=Math.max(...e)-Math.min(...e),s=Math.round(n/(e.length-1)/1e3);return s<1?null:s<90?`every ${s}s`:`every ${Math.round(s/60)} min`}function Ea(e){const n=new Map;for(const s of e.calls){const r=ws(s.content),a=n.get(r.key)??{name:r.name,titles:new Map,ats:[]};a.titles.set(s.call.title,(a.titles.get(s.call.title)??0)+1),s.at!=null&&a.ats.push(s.at),n.set(r.key,a)}return[...n].map(([s,{name:r,titles:a,ats:i}])=>({key:s,name:r,checks:[...a].sort((c,o)=>o[1]-c[1]).map(([c,o])=>`${c} · ${o}×`),every:Ia(i),lastAt:i.length>0?Math.max(...i):null}))}function Ta({stretch:e}){const n=dn(e),s=un(e),r=[`${n} · ${e.calls.length}×`,e.oldestAt!=null?`since ${Se(e.oldestAt,"p")}`:null,...s].filter(Boolean).join(" · ");return t.jsxs(Ht,{children:[t.jsx(Wt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1 text-left text-xs text-muted-foreground hover:bg-accent/50 data-[state=open]:bg-accent data-[state=open]:text-foreground",children:[t.jsx(Gt,{"aria-hidden":"true",className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:r})]})}),t.jsxs(Jt,{align:"start",className:"w-80 p-0",children:[t.jsx("p",{className:"border-b border-border px-3 py-2 text-xs text-muted-foreground",children:"Apps checking in today. Background, not work they did."}),t.jsx("ul",{className:"divide-y divide-border",children:Ea(e).map(a=>t.jsxs("li",{className:"px-3 py-2",children:[t.jsx("div",{className:"text-sm font-medium",children:a.name}),t.jsx("div",{className:"text-xs text-muted-foreground",children:[...a.checks,a.every,a.lastAt!=null?`last checked ${js(a.lastAt,{addSuffix:!0})}`:null].filter(Boolean).join(" · ")})]},a.key))})]})]})}function Ma({hideOriginator:e=!1,...n}){const{stretch:s,connectorDefinitions:r,sourceConnection:a}=n,i=j.useMemo(()=>vs(s),[s]),c=Aa(s,i),{open:o,selected:l}=$a(n,c),d=s.kind==="background",{source:p}=s,u=i.failedCalls.length+i.failedOperations.length+s.flagged.length,m=!u&&!p&&(d||i.idle),b=d?Gt:i.idle&&!p?_s:bs,w=p?[Lt(s),Oe(s.items.length,"item"),u>0?`${u} failed`:null]:d?[s.oldestAt!=null?`since ${Se(s.oldestAt,"p")}`:null,...un(s)]:[e?null:Nt(s),Oe(s.calls.length,"call"),Lt(s),u>0?`${u} failed`:null],h=t.jsx(Le,{mark:p?t.jsx(yt,{source:{platform:a?.(p.connectionId)?.connectorKey??s.items[0]?.group.root?.platform??null},connectorDefinitions:r,label:p.name,fallback:t.jsx(b,{className:"h-4 w-4 text-muted-foreground"})}):t.jsx(b,{className:"h-4 w-4 text-muted-foreground"}),name:c,badge:d?t.jsxs("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:[s.calls.length,"×"]}):null,tone:u>0?"destructive":null,details:t.jsxs(t.Fragment,{children:[p?t.jsx("span",{className:"block truncate text-foreground/80",children:Ns(s).map(N=>N.label).join(" · ")}):d?null:t.jsx(Sa,{summary:i,headline:c}),t.jsx("span",{className:"block truncate",children:w.filter(Boolean).join(" · ")})]}),at:s.newestAt}),v=G(Je,m&&"opacity-60");return o?t.jsx("button",{type:"button","aria-current":l?"true":void 0,className:G(v,l&&"bg-accent opacity-100"),onClick:o,children:h}):t.jsx("div",{className:G(v,"cursor-default"),children:h})}function Qa({presentation:e="summary",renderDetail:n,hideDetails:s=!1,organizationId:r,ownerSlug:a,entityId:i,filters:c,showEntityLinks:o=!1,hideOriginator:l=!1,emptyState:d,groupStretches:p=!1,foldRunSatellites:u=!0,renderLead:m,hiddenPinned:b,unreadNotices:w,onMarkRead:h,extraRows:v,onGoToLatest:N}){const{isAuthenticated:k,isReady:S,session:R}=et(),{isMember:E,isLoading:T}=Cs(),M=a==="me",F=!M&&S&&k&&E,C=!M&&S&&(!k||!T&&!E),{data:x=[]}=As(S&&F?r:null),{data:B=[]}=Rs(C?a:null),V=F?x:B,{data:P}=Ss(p&&S&&F?r:null),y=j.useMemo(()=>{const f=new Map((P??[]).map(A=>[A.id,A.display_name??A.connector_name]));return A=>f.get(A)??null},[P]),{data:L}=$s({enabled:S&&F}),D=R?.user?.id??null,X=j.useCallback(f=>f.kind==="user"?f.userId===D?"You":null:L?.find(A=>A.agentId===f.agentId)?.name??f.agentId,[L,D]),le=j.useMemo(()=>{const f=new Map((P??[]).map(A=>[A.id,A.connector_key]));return A=>{const q=f.get(A);return q&&r?{connectorKey:q,organizationId:r}:null}},[P,r]),J=Is(S&&F?r:null,i,c,a),pe=Es(C?a:null,i,c),Q=C?pe:J,{data:Z,isLoading:ce,error:fe,fetchNextPage:ee,hasNextPage:ne,isFetchingNextPage:je}=Q,Y=j.useMemo(()=>Z?.pages.flatMap(f=>f.content)??[],[Z]),se=j.useMemo(()=>{const f=Ts(Y,{foldRunSatellites:u}),A=f.map(oe=>oe.head),q=new Map(f.map(oe=>[oe.head.id,oe])),ye=Ms(A),Ce=Array.from(ye.entries()).map(([oe,st])=>{const Rt=st.root||st.replies[0],St=Rt?q.get(Rt.id):void 0;return{rootId:oe,group:st,history:St?.history??[],runId:St?.runId??null}});return b?Ds(Ce,b):Ce},[Y,u,b]),re=m?se[0]:void 0,ae=re?It(re)??void 0:void 0,ie=ae?se.slice(1):se,de=f=>w?.(f)??[],ue=p&&Fs(c),xe=`${r}:${i}:${JSON.stringify(Ls(c))}:${c.beforeOccurredAt}:${c.beforeId}`,[te,z]=j.useState(null),ve=()=>{let f=Number.NEGATIVE_INFINITY;for(const A of Y){const q=Date.parse(A.occurred_at);q>f&&(f=q)}z({scope:xe,ids:new Set(Y.map(A=>A.id)),newestAt:f})},ke=ue&&Y.length>0&&!Q.isFetching,_=te?.scope!==xe;j.useEffect(()=>{ke&&_&&ve()});const I=j.useRef(null),me=ue?Os(ie,_?null:te,f=>Bs(f,{connectionName:y,groupSources:!Us(c,i)})):{entries:ie.map(f=>({kind:"single",node:f})),pending:[]},$e=new Date().toDateString(),Ie=f=>f.kind==="stretch"&&f.stretch.kind==="background"&&f.stretch.newestAt!=null&&new Date(f.stretch.newestAt).toDateString()===$e,Ee=[...me.entries,...me.pending].find(Ie),tt=me.entries.filter(f=>!Ie(f)),Be=me.pending.filter(f=>!Ie(f)).length,Te=!M&&(!S||k&&T||F&&Q.isPending);if(fe)return t.jsx(Ps,{label:"events"});const he=e==="detail",g=(f,A,q={})=>{const ye=de(f);return{key:A,occurredAt:f.occurred_at,content:t.jsx(Ca,{content:f,ownerSlug:a,connectorDefinitions:V,connectionName:y,callerName:X,hideOriginator:l,showEntity:o,extra:q.extra,unread:ye.length>0,onOpen:ye.length>0&&h?()=>h(ye):void 0})}},$=f=>{if(f.kind==="stretch"){const{stretch:oe}=f;return[{key:oe.key,occurredAt:oe.newestAt,content:t.jsx(Ma,{stretch:oe,ownerSlug:a,connectorDefinitions:V,connectionName:y,sourceConnection:le,hideOriginator:l,showEntity:o})}]}const{rootId:A,group:q}=f.node,ye=q.root||q.replies[0];if(!ye)return[];const Ce=q.root?q.replies.length:q.replies.length-1;return[g(ye,A,{extra:Ce>0?`${Ce} ${Ce===1?"reply":"replies"}`:null})]},K=f=>{if(f.kind!=="single")return[];const A=It(f.node);return A?[{key:f.node.rootId,occurredAt:A.occurred_at,content:t.jsx(ja,{ownerSlug:a,content:A,renderDetail:n,connectorDefinitions:V,hideDetails:s})}]:[]},ge=tt.flatMap(he?K:$),Me=Y.at(-1)?.occurred_at,wt=(v??[]).filter(f=>!ne||Me==null||(ze(f.occurredAt)??0)>=(ze(Me)??0)),kt=wt.length>0&&(ge.length>0||ae)?[...ge,...wt].sort((f,A)=>(ze(A.occurredAt)??0)-(ze(f.occurredAt)??0)):ge,mn=t.jsx(Xs,{rows:!he,groupByDate:!he,isLoading:ce||Te,emptyState:ae||Ee?.kind==="stretch"?null:d,hasNextPage:!!ne,isFetching:Q.isFetching,isFetchingNextPage:je,onLoadMore:()=>void ee(),items:kt}),pn=Be>0?t.jsx("div",{className:"pointer-events-none sticky top-2 z-10 flex h-0 justify-center overflow-visible",children:t.jsxs(O,{size:"sm",className:"pointer-events-auto h-7 rounded-full px-3 text-xs shadow-md",onClick:()=>{ve(),I.current?.scrollIntoView?.({block:"start",behavior:"smooth"})},children:[Be," new"]})}):null,Ct=Ee?.kind==="stretch"?t.jsx(Ta,{stretch:Ee.stretch}):null,nt=c.beforeOccurredAt?Da(c.beforeOccurredAt):null,fn=Ct||nt||N?t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx("div",{className:"min-w-0 flex-1",children:Ct}),nt?t.jsxs("span",{className:"shrink-0 text-xs text-muted-foreground",children:["From ",nt]}):null,N&&t.jsxs(O,{variant:"ghost",size:"sm",className:"h-7 shrink-0 gap-1.5 px-2 text-xs font-normal text-muted-foreground",onClick:N,children:[t.jsx(zs,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),"Back to latest"]})]}):null,At=t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:I,className:"scroll-mt-4"}),pn,fn,mn]});return!ae||!m?At:t.jsxs(t.Fragment,{children:[m(ae,{hasEarlier:kt.length>0||!!ne}),At]})}function Da(e){const n=new Date(e);return Number.isNaN(n.getTime())?null:Zs(n)?Se(n,"p"):Se(n,er(n)?"d MMM, p":"d MMM yyyy, p")}export{Qa as E,Ja as R,ba as a,Wa as b,Va as c,Tr as d,Nt as e,Ca as f,Oe as p,Ha as r,Lt as s};
|
|
2
|
+
//# sourceMappingURL=events-feed-DmRzikZW.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{j as e,i as g,r as x,B as j,
|
|
2
|
-
`),className:g("inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border px-2.5 text-sm tabular-nums",b?"border-amber-500/60 bg-amber-500/10":"bg-muted text-muted-foreground",l&&"ring-1 ring-ring"),children:n?e.jsxs(e.Fragment,{children:[e.jsx(
|
|
3
|
-
//# sourceMappingURL=filter-editors-
|
|
1
|
+
import{j as e,i as g,r as x,B as j,aE as D,aF as L,ex as E,dh as Z,aH as O,k as B,aI as W,aJ as _,aK as A,aL as H,aM as Q,aO as V,a9 as U,X as q,ab as ee,e7 as N,ey as se,ez as k,eA as w,$ as R,eB as te}from"./index-DByaMzsG.js";import{s as I}from"./subDays-D8nHthaS.js";function G(s){return s&&s.kind!=="toggle"?s:void 0}const T="w-72";function ne(s){return s<=0?Number.POSITIVE_INFINITY:s<=359?0:s<=479?2:3}function re(){const s=x.useRef(null),[t,n]=x.useState(0);return x.useLayoutEffect(()=>{const l=s.current;if(!l||(n(l.clientWidth),typeof ResizeObserver>"u"))return;const i=new ResizeObserver(()=>n(l.clientWidth));return i.observe(l),()=>i.disconnect()},[]),[s,t]}function $(s){return s.value?s.op?[s.label,s.op,s.value].join(" "):`${s.label}: ${s.value}`:s.label}function M({editor:s,close:t,header:n,footer:l}){const[i,a]=x.useState("");return e.jsxs(e.Fragment,{children:[n,s.kind==="list"?e.jsxs(W,{shouldFilter:!s.onQueryChange,children:[e.jsx(_,{autoFocus:!0,placeholder:s.searchPlaceholder,value:i,onValueChange:u=>{a(u),s.onQueryChange?.(u)}}),e.jsxs(A,{children:[e.jsx(H,{children:s.emptyText}),e.jsx(Q,{children:s.items(t,i)})]})]}):s.render(t),l]})}function ae({chip:s,editor:t}){const[n,l]=x.useState(!1),i=s.onRemove!=null,a=$(s),u=s.value?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-muted-foreground",children:s.op?s.label:`${s.label}:`}),s.op?e.jsx("span",{className:"text-muted-foreground",children:s.op}):null,e.jsx("span",{className:"min-w-0 truncate font-medium",children:s.value})]}):e.jsx("span",{className:"min-w-0 truncate font-medium",children:s.label}),r=t?e.jsx(L,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Edit filter: ${a}`,className:"flex min-w-0 items-center gap-1.5 pl-2.5 pr-1 focus-visible:outline-none",children:u})}):e.jsx("span",{className:"flex min-w-0 items-center gap-1.5 pl-2.5 pr-1",children:u});return e.jsxs(D,{open:n,onOpenChange:l,children:[e.jsxs("div",{"data-filter-chip":s.id,title:s.title,className:g("inline-flex h-8 min-w-0 max-w-full items-stretch rounded-md border text-sm",s.tone==="warning"?"border-amber-500/60 bg-amber-500/10":i?"bg-muted":"border-dashed bg-transparent",n&&"ring-1 ring-ring",!i&&"pr-1.5"),children:[r,i?e.jsx("button",{type:"button","aria-label":`Remove filter: ${a}`,onClick:s.onRemove,className:"flex w-7 shrink-0 items-center justify-center text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(q,{className:"h-3.5 w-3.5"})}):null]}),t?e.jsx(O,{align:"start",className:g("p-0",T,t.className),children:e.jsx(M,{editor:t,close:()=>l(!1),footer:i?e.jsx("div",{className:"border-t p-1",children:e.jsx(j,{variant:"ghost",size:"sm",className:"w-full justify-start text-destructive hover:text-destructive",onClick:()=>{l(!1),s.onRemove?.()},children:"Remove filter"})}):null})}):null]})}function P({chips:s,editorFor:t,collapsed:n=!1}){const[l,i]=x.useState(!1),[a,u]=x.useState(),r=s.find(o=>o.id===a),m=r?t(r):void 0,b=s.some(o=>o.tone==="warning"),h=()=>{i(!1),u(void 0)};return e.jsxs(D,{open:l,onOpenChange:o=>{i(o),o||u(void 0)},children:[e.jsx(L,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":n?`Show ${s.length} applied filters`:`Show ${s.length} more filters`,title:s.map($).join(`
|
|
2
|
+
`),className:g("inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border px-2.5 text-sm tabular-nums",b?"border-amber-500/60 bg-amber-500/10":"bg-muted text-muted-foreground",l&&"ring-1 ring-ring"),children:n?e.jsxs(e.Fragment,{children:[e.jsx(E,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),e.jsx("span",{children:"Filters"}),e.jsxs("span",{className:"text-foreground",children:["· ",s.length]})]}):e.jsxs("span",{className:"text-foreground",children:["+",s.length]})})}),e.jsx(O,{align:"start",className:g("max-h-80 overflow-y-auto p-0",T,m?.className),children:r&&m?e.jsx(M,{editor:m,close:h,header:e.jsxs("div",{className:"flex items-center gap-1 border-b px-1 py-1 text-sm font-medium",children:[e.jsx(j,{variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Back to filters",onClick:()=>u(void 0),children:e.jsx(B,{className:"h-4 w-4"})}),r.label]}),footer:r.onRemove?e.jsx("div",{className:"border-t p-1",children:e.jsx(j,{variant:"ghost",size:"sm",className:"w-full justify-start text-destructive hover:text-destructive",onClick:()=>{h(),r.onRemove?.()},children:"Remove filter"})}):null},r.id):e.jsx("div",{className:"py-1",children:s.map(o=>{const c=$(o),d=t(o)!=null;return e.jsxs("div",{className:"flex items-center gap-1 px-1",children:[e.jsxs("button",{type:"button",disabled:!d,"aria-label":d?`Edit filter: ${c}`:void 0,onClick:d?()=>u(o.id):void 0,className:"flex min-w-0 flex-1 items-center gap-1.5 rounded-sm px-1.5 py-1.5 text-left text-sm hover:bg-accent/50 disabled:hover:bg-transparent",children:[e.jsx("span",{className:"shrink-0 text-muted-foreground",children:o.op||!o.value?o.label:`${o.label}:`}),o.op?e.jsx("span",{className:"shrink-0 text-muted-foreground",children:o.op}):null,o.value?e.jsx("span",{className:"min-w-0 truncate font-medium",children:o.value}):null]}),o.onRemove?e.jsx("button",{type:"button","aria-label":`Remove filter: ${c}`,onClick:o.onRemove,className:"flex w-7 shrink-0 self-stretch items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(q,{className:"h-3.5 w-3.5"})}):null]},o.id)})})})]})}function le({fields:s,triggerClassName:t}){const n=s.filter(c=>c.inMenu!==!1),[l,i]=x.useState(!1),[a,u]=x.useState(),r=n.find(c=>c.key===a),m=G(r?.editor),b=n.filter(c=>c.editor.kind==="toggle"&&c.editor.checked).length,h=[...new Set(n.map(c=>c.group??""))],o=()=>{i(!1),u(void 0)};return e.jsxs(D,{open:l,onOpenChange:c=>{i(c),c||u(void 0)},children:[e.jsx(L,{asChild:!0,children:t?e.jsxs("button",{type:"button",className:g("flex shrink-0 items-center gap-1.5 px-2.5 text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",t),children:[e.jsx(E,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),"Filter",b>0?e.jsx("span",{className:"tabular-nums text-foreground",children:b}):null,e.jsx(Z,{"aria-hidden":"true",className:"h-3.5 w-3.5"})]}):e.jsxs(j,{variant:"outline",size:"sm",className:"h-8 gap-1.5 font-normal text-muted-foreground",children:[e.jsx(E,{className:"h-3.5 w-3.5"}),"Filter"]})}),e.jsx(O,{align:t?"end":"start",className:g("p-0",T,m?.className),children:r&&m?e.jsx(M,{editor:m,close:o,header:e.jsxs("div",{className:"flex items-center gap-1 border-b px-1 py-1 text-sm font-medium",children:[e.jsx(j,{variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Back to filters",onClick:()=>u(void 0),children:e.jsx(B,{className:"h-4 w-4"})}),r.label]})},r.key):e.jsxs(W,{children:[e.jsx(_,{autoFocus:!0,placeholder:"Filter by…"}),e.jsxs(A,{children:[e.jsx(H,{children:"No matching filter"}),h.map(c=>e.jsx(Q,{heading:c||void 0,children:n.filter(d=>(d.group??"")===c).map(d=>e.jsxs(V,{value:`${d.label} ${d.key}`,onSelect:()=>d.editor.kind==="toggle"?d.editor.onToggle():u(d.key),"aria-checked":d.editor.kind==="toggle"?d.editor.checked:void 0,className:"gap-2",children:[d.icon?e.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground",children:d.icon}):null,e.jsx("span",{className:"min-w-0 flex-1 truncate",children:d.label}),d.editor.kind==="toggle"?e.jsxs(e.Fragment,{children:[d.editor.count!=null?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:d.editor.count.toLocaleString()}):null,e.jsx(U,{"aria-hidden":"true",className:g("h-4 w-4 shrink-0",!d.editor.checked&&"invisible")})]}):null]},d.key))},c))]})]})})]})}function he({fields:s,chips:t,meta:n,actions:l,trailing:i,onClearAll:a,hasClearableState:u=!1,className:r,label:m="Filters",menu:b=!0,clearAllMin:h=1,maxVisible:o}){const c=s.filter(f=>f.inMenu!==!1),d=t.filter(f=>f.onRemove).length,[v,J]=re(),C=Math.min(o??ne(J),t.length),K=t.slice(0,C),z=t.slice(C),S=f=>G(f.editor??s.find(Y=>Y.key===(f.field??f.id))?.editor),y=a!=null&&d+(u?1:0)>=h?e.jsx(j,{variant:"ghost",size:"sm",className:"h-8 text-muted-foreground",onClick:a,children:"Clear all"}):null,F=t.length>0,p=f=>f!=null&&f!==!1,X=b&&c.length>0||p(l)||p(n)||p(i)||!F&&y!=null;return e.jsxs("div",{ref:v,role:"search","aria-label":m,className:g("flex min-w-0 flex-col items-stretch gap-2",r),children:[X?e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[b&&c.length>0?e.jsx(le,{fields:c}):null,p(l)?l:null,e.jsxs("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[p(n)?e.jsx("span",{className:"text-sm text-muted-foreground",children:n}):null,F?null:y,p(i)?i:null]})]}):null,F?e.jsxs("div",{"data-filter-chips":!0,className:"flex min-w-0 flex-nowrap items-center gap-2",children:[C===0?e.jsx(P,{chips:t,editorFor:S,collapsed:!0}):e.jsxs(e.Fragment,{children:[K.map(f=>e.jsx(ae,{chip:f,editor:S(f)},f.id)),z.length>0?e.jsx(P,{chips:z,editorFor:S}):null]}),y?e.jsx("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:y}):null]}):null]})}function oe({selected:s}){return e.jsx(U,{className:g("h-4 w-4 shrink-0",s?"opacity-100":"opacity-0")})}function be({searchPlaceholder:s,emptyText:t="No options",options:n,selected:l,multiple:i=!1,onSelect:a}){return{kind:"list",searchPlaceholder:s,emptyText:t,items:u=>n.map(r=>{const m=l.includes(r.value);return e.jsxs(V,{value:`${r.label} ${r.keywords??r.value}`,onSelect:()=>{a(r.value),i||u()},"aria-label":r.label,className:"group gap-2",children:[i?e.jsx(ee,{checked:m,className:"mr-1"}):e.jsx(oe,{selected:m}),r.icon,e.jsx("span",{className:"min-w-0 flex-1 truncate",children:r.label}),r.count!=null?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:r.count.toLocaleString()}):null,r.action]},r.value)})}}function ge([s,t],n,l){return s<=n?`≤ ${t}`:t>=l?`≥ ${s}`:`${s}–${t}`}function ie({value:s,min:t,max:n,onApply:l,close:i}){const[a,u]=x.useState(String(s?.[0]??t)),[r,m]=x.useState(String(s?.[1]??n)),[b,h]=x.useState(),o=c=>{c.preventDefault();const d=Number(a),v=Number(r);if(!Number.isFinite(d)||!Number.isFinite(v)){h("Enter a number.");return}if(d<t||v>n){h(`Use values between ${t} and ${n}.`);return}if(d>v){h("The lower bound must not exceed the upper bound.");return}l([d,v]),i()};return e.jsxs("form",{className:"space-y-3 p-3",onSubmit:o,children:[e.jsxs("div",{className:"grid grid-cols-[1fr_auto_1fr] items-center gap-2",children:[e.jsx(R,{"aria-label":"From",type:"number",min:t,max:n,value:a,onChange:c=>u(c.target.value)}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"to"}),e.jsx(R,{"aria-label":"To",type:"number",min:t,max:n,value:r,onChange:c=>m(c.target.value)})]}),b?e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:b}):null,e.jsx(j,{type:"submit",size:"sm",className:"w-full",children:"Apply"})]})}function je(s){return{kind:"custom",render:t=>e.jsx(ie,{...s,close:t})}}const ce=[{label:"Today",range:()=>[k(new Date),w(new Date)]},{label:"Last 7 days",range:()=>[k(I(new Date,6)),w(new Date)]},{label:"Last 30 days",range:()=>[k(I(new Date,29)),w(new Date)]},{label:"This month",range:()=>[te(new Date),w(new Date)]}];function ve([s,t]){return N(s,"yyyy-MM-dd")===N(t,"yyyy-MM-dd")?N(s,"LLL d, y"):`${N(s,"LLL d")} – ${N(t,"LLL d, y")}`}function de({value:s,onApply:t,close:n}){const[l,i]=x.useState(s?{from:s[0],to:s[1]}:void 0);return e.jsxs("div",{className:"flex flex-col sm:flex-row",children:[e.jsx("div",{className:"flex flex-col gap-0.5 border-b p-2 sm:w-36 sm:border-b-0 sm:border-r",children:ce.map(a=>e.jsx(j,{variant:"ghost",size:"sm",className:"justify-start font-normal",onClick:()=>{t(a.range()),n()},children:a.label},a.label))}),e.jsx(se,{mode:"range",defaultMonth:l?.from,selected:l,onSelect:a=>{i(a),a?.from&&a.to&&a.from!==a.to&&(t([k(a.from),w(a.to)]),n())},numberOfMonths:1})]})}function pe(s){return{kind:"custom",className:"w-auto",render:t=>e.jsx(de,{...s,close:t})}}function ue({type:s,label:t,value:n,onApply:l,close:i}){const[a,u]=x.useState(n==null?"":String(n)),[r,m]=x.useState(),b=h=>{if(h.preventDefault(),s==="number"){const o=Number(a);if(a.trim()===""||!Number.isFinite(o)){m("Enter a number.");return}l(o)}else l(a);i()};return e.jsxs("form",{className:"space-y-3 p-3",onSubmit:b,children:[e.jsx(R,{autoFocus:!0,"aria-label":t,type:s,step:s==="number"?"any":void 0,value:a,onChange:h=>u(h.target.value),placeholder:"Enter a value…"}),r?e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:r}):null,e.jsx(j,{type:"submit",size:"sm",className:"w-full",children:"Apply"})]})}function Ne(s){return{kind:"custom",render:t=>e.jsx(ue,{...s,close:t})}}export{he as F,oe as S,ge as a,le as b,pe as d,ve as f,be as o,je as r,Ne as v};
|
|
3
|
+
//# sourceMappingURL=filter-editors-CQoSj-20.js.map
|
package/dist/owletto/dist/assets/{full-page-spinner-DWo519BU.js → full-page-spinner-CYyCnKve.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r,j as t,i as u}from"./index-
|
|
2
|
-
//# sourceMappingURL=full-page-spinner-
|
|
1
|
+
import{r,j as t,i as u}from"./index-DByaMzsG.js";function l({className:i,delayMs:e=500}){const[s,n]=r.useState(e<=0);return r.useEffect(()=>{if(e<=0)return;const a=setTimeout(()=>n(!0),e);return()=>clearTimeout(a)},[e]),s?t.jsx("div",{className:u("flex min-h-[50vh] items-center justify-center",i),role:"status","aria-label":"Loading",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})}):null}export{l as F};
|
|
2
|
+
//# sourceMappingURL=full-page-spinner-CYyCnKve.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{aA as e,aB as s,j as t,at as p,au as a}from"./index-DByaMzsG.js";import{A as n}from"./activity-route-view-D78Wj0RH.js";import{E as c}from"./events-feed-DmRzikZW.js";import"./record-activity-DnRVOrG2.js";import"./filter-editors-CQoSj-20.js";import"./subDays-D8nHthaS.js";import"./runs-C8sZQr4o.js";import"./activity-route-location-C1jcXC7v.js";import"./event-kind-options-fHAIXu24.js";import"./source-record-panels-CGmKIJdN.js";import"./run-initiator-DhE5v4z0.js";import"./list-skeleton-DsYGUHxi.js";import"./use-automations-CgWNoYio.js";import"./clients-xnzZeEdZ.js";import"./client-activity-scopes-BPbRX-Pe.js";import"./client-rows-vrNA6FLs.js";import"./renderer-olRv_HMI.js";import"./schema-value-zTJGE4eh.js";import"./card-DtLIFq7D.js";import"./table-C637cQxG.js";import"./agent-loading-shells-DYqQphN7.js";import"./member-scope-gate-vvkgSAb2.js";import"./needs-you-list-B5Bgd05M.js";import"./entity-schema-graph-lMMx3HhR.js";import"./feed-event-kinds-BYuZCoU4.js";import"./public-shell-ready-D8TijlRY.js";import"./definition-comparison-4UYMI6BK.js";import"./json-diff-mcDgyct_.js";import"./code-editor-mrKkAfcE.js";import"./index-Vcq4gwWv.js";import"./copy-button-C3wMMv63.js";import"./device-automation-Dp3faMvp.js";function H(){const{owner:r}=e.useParams(),i=e.useSearch();if(r==="me"){const o=s(i),m={sortBy:"date",sortOrder:"desc",...o.contentIds?.length?{contentIds:o.contentIds}:{clientIds:o.clientIds,mcpActivityId:o.mcpActivityId}};return t.jsx(p,{className:"gap-6 pt-2.5 pb-8",children:t.jsxs(a,{className:"flex flex-col gap-6",children:[t.jsx("h1",{className:"text-lg font-semibold",children:"Your MCP activity"}),t.jsx(c,{organizationId:null,ownerSlug:"me",filters:m})]})})}return t.jsx(n,{owner:r,search:i})}export{H as component};
|
|
2
|
+
//# sourceMappingURL=index-BFR0uiKY.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bw as vr,bx as pr,r as u,by as St,j as v,bz as Mt,bA as yt,bB as Er,bC as On,bD as mr,bE as gr,bF as _r,bG as Or,bH as F,bI as Tn,bJ as Ut,X as Tr,a4 as Ar,bK as Ir,bL as Rr,bM as Sr}from"./index-CdDNNAx2.js";function x(...e){return vr(pr(e))}function Be({error:e,localization:t,localizeErrors:n=!0}){var r;const o="Request failed";if(!n)return e?.message?e.message:(r=e?.error)!=null&&r.message?e.error.message:o;if(typeof e=="string"&&t?.[e])return t[e];if(e?.error){if(e.error.code){const a=e.error.code;if(t?.[a])return t[a]}return e.error.message||e.error.code||e.error.statusText||t?.REQUEST_FAILED}return e?.message||t?.REQUEST_FAILED||o}function An(e){return typeof window<"u"?new URLSearchParams(window.location.search).get(e):null}var yr={FAILED_TO_CREATE_USER:"Failed to create user",USER_ALREADY_EXISTS:"User already exists",YOU_CANNOT_BAN_YOURSELF:"You cannot ban yourself",YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE:"You are not allowed to change users role",YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS:"You are not allowed to create users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS:"You are not allowed to list users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS:"You are not allowed to list users sessions",YOU_ARE_NOT_ALLOWED_TO_BAN_USERS:"You are not allowed to ban users",YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS:"You are not allowed to impersonate users",YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS:"You are not allowed to revoke users sessions",YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS:"You are not allowed to delete users",YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD:"You are not allowed to set users password",BANNED_USER:"You have been banned from this application"},Nr={FAILED_TO_CREATE_USER:"Failed to create user",COULD_NOT_CREATE_SESSION:"Could not create session",ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY:"Anonymous users cannot sign in again anonymously"},Cr={INVALID_METADATA_TYPE:"metadata must be an object or undefined",REFILL_AMOUNT_AND_INTERVAL_REQUIRED:"refillAmount is required when refillInterval is provided",REFILL_INTERVAL_AND_AMOUNT_REQUIRED:"refillInterval is required when refillAmount is provided",USER_BANNED:"User is banned",UNAUTHORIZED_SESSION:"Unauthorized or invalid session",KEY_NOT_FOUND:"API Key not found",KEY_DISABLED:"API Key is disabled",KEY_EXPIRED:"API Key has expired",USAGE_EXCEEDED:"API Key has reached its usage limit",KEY_NOT_RECOVERABLE:"API Key is not recoverable",EXPIRES_IN_IS_TOO_SMALL:"The expiresIn is smaller than the predefined minimum value.",EXPIRES_IN_IS_TOO_LARGE:"The expiresIn is larger than the predefined maximum value.",INVALID_REMAINING:"The remaining count is either too large or too small.",INVALID_PREFIX_LENGTH:"The prefix length is either too large or too small.",INVALID_NAME_LENGTH:"The name length is either too large or too small.",METADATA_DISABLED:"Metadata is disabled.",RATE_LIMIT_EXCEEDED:"Rate limit exceeded.",NO_VALUES_TO_UPDATE:"No values to update.",KEY_DISABLED_EXPIRATION:"Custom key expiration values are disabled.",INVALID_API_KEY:"Invalid API key.",INVALID_USER_ID_FROM_API_KEY:"The user id from the API key is invalid.",INVALID_API_KEY_GETTER_RETURN_TYPE:"API Key getter returned an invalid key type. Expected string.",SERVER_ONLY_PROPERTY:"The property you're trying to set can only be set from the server auth instance only."},wr={USER_NOT_FOUND:"User not found",FAILED_TO_CREATE_USER:"Failed to create user",FAILED_TO_CREATE_SESSION:"Failed to create session",FAILED_TO_UPDATE_USER:"Failed to update user",FAILED_TO_GET_SESSION:"Failed to get session",INVALID_PASSWORD:"Invalid password",INVALID_EMAIL:"Invalid email",INVALID_EMAIL_OR_PASSWORD:"Invalid email or password",SOCIAL_ACCOUNT_ALREADY_LINKED:"Social account already linked",PROVIDER_NOT_FOUND:"Provider not found",INVALID_TOKEN:"Invalid token",ID_TOKEN_NOT_SUPPORTED:"id_token not supported",FAILED_TO_GET_USER_INFO:"Failed to get user info",USER_EMAIL_NOT_FOUND:"User email not found",EMAIL_NOT_VERIFIED:"Email not verified",PASSWORD_TOO_SHORT:"Password too short",PASSWORD_TOO_LONG:"Password too long",USER_ALREADY_EXISTS:"User already exists",EMAIL_CAN_NOT_BE_UPDATED:"Email can not be updated",CREDENTIAL_ACCOUNT_NOT_FOUND:"Credential account not found",SESSION_EXPIRED:"Session expired. Re-authenticate to perform this action.",FAILED_TO_UNLINK_LAST_ACCOUNT:"You can't unlink your last account",ACCOUNT_NOT_FOUND:"Account not found",USER_ALREADY_HAS_PASSWORD:"User already has a password. Provide that to delete the account."},br={VERIFICATION_FAILED:"Captcha verification failed",MISSING_RESPONSE:"Missing CAPTCHA response",UNKNOWN_ERROR:"Something went wrong"},Dr={MISSING_SECRET_KEY:"Missing secret key",SERVICE_UNAVAILABLE:"CAPTCHA service unavailable"},xr={...br,...Dr},Pr={OTP_EXPIRED:"otp expired",INVALID_OTP:"Invalid OTP",INVALID_EMAIL:"Invalid email",USER_NOT_FOUND:"User not found",TOO_MANY_ATTEMPTS:"Too many attempts"},Lr={INVALID_OAUTH_CONFIGURATION:"Invalid OAuth configuration"},Mr={PASSWORD_COMPROMISED:"The password you entered has been compromised. Please choose a different password."},Ur={INVALID_SESSION_TOKEN:"Invalid session token"},kr={YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION:"You are not allowed to create a new organization",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS:"You have reached the maximum number of organizations",ORGANIZATION_ALREADY_EXISTS:"Organization already exists",ORGANIZATION_NOT_FOUND:"Organization not found",USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION:"User is not a member of the organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION:"You are not allowed to update this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION:"You are not allowed to delete this organization",NO_ACTIVE_ORGANIZATION:"No active organization",USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION:"User is already a member of this organization",MEMBER_NOT_FOUND:"Member not found",ROLE_NOT_FOUND:"Role not found",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM:"You are not allowed to create a new team",TEAM_ALREADY_EXISTS:"Team already exists",TEAM_NOT_FOUND:"Team not found",YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER:"You cannot leave the organization as the only owner",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER:"You are not allowed to delete this member",YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION:"You are not allowed to invite users to this organization",USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION:"User is already invited to this organization",INVITATION_NOT_FOUND:"Invitation not found",YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION:"You are not the recipient of the invitation",YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION:"You are not allowed to cancel this invitation",INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION:"Inviter is no longer a member of the organization",YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE:"you are not allowed to invite user with this role",FAILED_TO_RETRIEVE_INVITATION:"Failed to retrieve invitation",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS:"You have reached the maximum number of teams",UNABLE_TO_REMOVE_LAST_TEAM:"Unable to remove last team",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER:"You are not allowed to update this member",ORGANIZATION_MEMBERSHIP_LIMIT_REACHED:"Organization membership limit reached",YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to create teams in this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to delete teams in this organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM:"You are not allowed to update this team",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM:"You are not allowed to delete this team",INVITATION_LIMIT_REACHED:"Invitation limit reached"},Fr={CHALLENGE_NOT_FOUND:"Challenge not found",YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY:"You are not allowed to register this passkey",FAILED_TO_VERIFY_REGISTRATION:"Failed to verify registration",PASSKEY_NOT_FOUND:"Passkey not found",AUTHENTICATION_FAILED:"Authentication failed",UNABLE_TO_CREATE_SESSION:"Unable to create session",FAILED_TO_UPDATE_PASSKEY:"Failed to update passkey"},Br={INVALID_PHONE_NUMBER:"Invalid phone number",PHONE_NUMBER_EXIST:"Phone number already exists",INVALID_PHONE_NUMBER_OR_PASSWORD:"Invalid phone number or password",UNEXPECTED_ERROR:"Unexpected error",OTP_NOT_FOUND:"OTP not found",OTP_EXPIRED:"OTP expired",INVALID_OTP:"Invalid OTP",PHONE_NUMBER_NOT_VERIFIED:"Phone number not verified"},jr={SUBSCRIPTION_NOT_FOUND:"Subscription not found",SUBSCRIPTION_PLAN_NOT_FOUND:"Subscription plan not found",ALREADY_SUBSCRIBED_PLAN:"You're already subscribed to this plan",UNABLE_TO_CREATE_CUSTOMER:"Unable to create customer",FAILED_TO_FETCH_PLANS:"Failed to fetch plans",EMAIL_VERIFICATION_REQUIRED:"Email verification is required before you can subscribe to a plan",SUBSCRIPTION_NOT_ACTIVE:"Subscription is not active",SUBSCRIPTION_NOT_SCHEDULED_FOR_CANCELLATION:"Subscription is not scheduled for cancellation"},Hr={TEAM_LIMIT_REACHED:"Team limit reached for this organization",TEAM_MEMBER_LIMIT_REACHED:"Team member limit reached for this team",TEAM_NOT_FOUND:"Team not found",TEAM_MEMBER_NOT_FOUND:"Team member not found",TEAM_NAME_TOO_LONG:"Team name is too long",CANNOT_REMOVE_LAST_TEAM:"Cannot remove the last team",NOT_ORGANIZATION_MEMBER:"User is not a member of the organization",ALREADY_TEAM_MEMBER:"User is already a member of this team",INSUFFICIENT_TEAM_PERMISSIONS:"Insufficient permissions to perform this action on team"},zr={OTP_NOT_ENABLED:"OTP not enabled",OTP_HAS_EXPIRED:"OTP has expired",TOTP_NOT_ENABLED:"TOTP not enabled",TWO_FACTOR_NOT_ENABLED:"Two factor isn't enabled",BACKUP_CODES_NOT_ENABLED:"Backup codes aren't enabled",INVALID_BACKUP_CODE:"Invalid backup code",INVALID_CODE:"Invalid code",TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE:"Too many attempts. Please request a new code.",INVALID_TWO_FACTOR_COOKIE:"Invalid two factor cookie"},Vr={INVALID_USERNAME_OR_PASSWORD:"invalid username or password",EMAIL_NOT_VERIFIED:"email not verified",UNEXPECTED_ERROR:"unexpected error",USERNAME_IS_ALREADY_TAKEN:"username is already taken. please try another.",USERNAME_TOO_SHORT:"username is too short",USERNAME_TOO_LONG:"username is too long",INVALID_USERNAME:"username is invalid"},Wr={APP:"App",ACCOUNT:"Account",ACCOUNTS:"Accounts",ACCOUNTS_DESCRIPTION:"Switch between your currently signed in accounts.",ACCOUNTS_INSTRUCTIONS:"Sign in to an additional account.",ADD_ACCOUNT:"Add Account",ADD_PASSKEY:"Add Passkey",ALREADY_HAVE_AN_ACCOUNT:"Already have an account?",AVATAR:"Avatar",AVATAR_DESCRIPTION:"Click on the avatar to upload a custom one from your files.",AVATAR_INSTRUCTIONS:"An avatar is optional but strongly recommended.",BACKUP_CODE_REQUIRED:"Backup code is required",BACKUP_CODES:"Backup Codes",BACKUP_CODES_DESCRIPTION:"Save these backup codes in a secure place. You can use them to access your account if you lose your two-factor authentication method.",BACKUP_CODE_PLACEHOLDER:"Backup Code",BACKUP_CODE:"Backup Code",CANCEL:"Cancel",CHANGE_PASSWORD:"Change Password",CHANGE_PASSWORD_DESCRIPTION:"Enter your current password and a new password.",CHANGE_PASSWORD_INSTRUCTIONS:"Please use 8 characters at minimum.",CHANGE_PASSWORD_SUCCESS:"Your password has been changed.",CONFIRM_PASSWORD:"Confirm Password",CONFIRM_PASSWORD_PLACEHOLDER:"Confirm Password",CONFIRM_PASSWORD_REQUIRED:"Confirm password is required",CONTINUE_WITH_AUTHENTICATOR:"Continue with Authenticator",COPIED_TO_CLIPBOARD:"Copied to clipboard",COPY_TO_CLIPBOARD:"Copy to clipboard",COPY_ALL_CODES:"Copy all codes",CONTINUE:"Continue",CURRENT_PASSWORD:"Current Password",CURRENT_PASSWORD_PLACEHOLDER:"Current Password",CURRENT_SESSION:"Current Session",UPDATE:"Update",DELETE:"Delete",DELETE_AVATAR:"Delete Avatar",DELETE_ACCOUNT:"Delete Account",DELETE_ACCOUNT_DESCRIPTION:"Permanently remove your account and all of its contents. This action is not reversible, so please continue with caution.",DELETE_ACCOUNT_INSTRUCTIONS:"Please confirm the deletion of your account. This action is not reversible, so please continue with caution.",DELETE_ACCOUNT_VERIFY:"Please check your email to verify the deletion of your account.",DELETE_ACCOUNT_SUCCESS:"Your account has been deleted.",DISABLE_TWO_FACTOR:"Disable Two-Factor",DISABLED_CREDENTIALS_DESCRIPTION:"Choose a provider to login to your account",DONT_HAVE_AN_ACCOUNT:"Don't have an account?",DONE:"Done",EMAIL:"Email",EMAIL_DESCRIPTION:"Enter the email address you want to use to log in.",EMAIL_INSTRUCTIONS:"Please enter a valid email address.",EMAIL_IS_THE_SAME:"Email is the same",EMAIL_PLACEHOLDER:"m@example.com",EMAIL_REQUIRED:"Email address is required",EMAIL_VERIFY_CHANGE:"Please check your email to verify the change.",EMAIL_VERIFICATION:"Email Verification",EMAIL_VERIFICATION_DESCRIPTION:"Please check your email for the verification code to complete your registration.",EMAIL_VERIFICATION_SUCCESS:"Email verification successful.",ENABLE_TWO_FACTOR:"Enable Two-Factor",IS_INVALID:"is invalid",IS_REQUIRED:"is required",IS_THE_SAME:"is the same",FORGOT_AUTHENTICATOR:"Forgot authenticator?",FORGOT_PASSWORD:"Forgot Password",FORGOT_PASSWORD_ACTION:"Send reset link",FORGOT_PASSWORD_DESCRIPTION:"Enter your email to reset your password",FORGOT_PASSWORD_EMAIL:"Check your email for the password reset link.",FORGOT_PASSWORD_LINK:"Forgot your password?",LINK:"Link",MAGIC_LINK:"Magic Link",MAGIC_LINK_ACTION:"Send magic link",MAGIC_LINK_DESCRIPTION:"Enter your email to receive a magic link",MAGIC_LINK_EMAIL:"Check your email for the magic link",EMAIL_OTP:"Email Code",EMAIL_OTP_SEND_ACTION:"Send code",EMAIL_OTP_VERIFY_ACTION:"Verify code",EMAIL_OTP_DESCRIPTION:"Enter your email to receive a code",EMAIL_OTP_VERIFICATION_SENT:"Please check your email for the verification code.",NAME:"Name",NAME_DESCRIPTION:"Please enter your full name, or a display name.",NAME_INSTRUCTIONS:"Please use 32 characters at maximum.",NAME_PLACEHOLDER:"Name",NEW_PASSWORD:"New Password",NEW_PASSWORD_PLACEHOLDER:"New Password",NEW_PASSWORD_REQUIRED:"New password is required",ONE_TIME_PASSWORD:"One-Time Password",OR_CONTINUE_WITH:"Or continue with",PASSKEY:"Passkey",PASSKEYS:"Passkeys",PASSKEYS_DESCRIPTION:"Manage your passkeys for secure access.",PASSKEYS_INSTRUCTIONS:"Securely access your account without a password.",PERSONAL_ACCOUNT:"Personal Account",API_KEYS:"API Keys",API_KEYS_DESCRIPTION:"Manage your API keys for secure access.",API_KEYS_INSTRUCTIONS:"Generate API keys to access your account programmatically.",CREATE_API_KEY:"Create API Key",CREATE_API_KEY_DESCRIPTION:"Enter a unique name for your API key to differentiate it from other keys.",API_KEY_NAME_PLACEHOLDER:"New API Key",API_KEY_CREATED:"API Key Created",CREATE_API_KEY_SUCCESS:"Please copy your API key and store it in a safe place. For security reasons we cannot show it again.",NEVER_EXPIRES:"Never Expires",EXPIRES:"Expires",NO_EXPIRATION:"No Expiration",CREATE_ORGANIZATION:"Create Organization",ORGANIZATION:"Organization",ORGANIZATION_NAME:"Name",ORGANIZATION_NAME_PLACEHOLDER:"Acme Inc.",ORGANIZATION_NAME_DESCRIPTION:"This is your organization's visible name.",ORGANIZATION_NAME_INSTRUCTIONS:"Please use 32 characters at maximum.",ORGANIZATION_SLUG:"Slug URL",ORGANIZATION_SLUG_DESCRIPTION:"This is your organization's URL namespace.",ORGANIZATION_SLUG_INSTRUCTIONS:"Please use 48 characters at maximum.",ORGANIZATION_SLUG_PLACEHOLDER:"acme-inc",CREATE_ORGANIZATION_SUCCESS:"Organization created successfully",PASSWORD:"Password",PASSWORD_PLACEHOLDER:"Password",PASSWORD_REQUIRED:"Password is required",PASSWORDS_DO_NOT_MATCH:"Passwords do not match",PROVIDERS:"Providers",PROVIDERS_DESCRIPTION:"Connect your account with a third-party service.",RECOVER_ACCOUNT:"Recover Account",RECOVER_ACCOUNT_ACTION:"Recover account",RECOVER_ACCOUNT_DESCRIPTION:"Please enter a backup code to access your account",REMEMBER_ME:"Remember me",RESEND_CODE:"Resend code",RESEND_VERIFICATION_EMAIL:"Resend Verification Email",RESET_PASSWORD:"Reset Password",RESET_PASSWORD_ACTION:"Save new password",RESET_PASSWORD_DESCRIPTION:"Enter your new password below",RESET_PASSWORD_SUCCESS:"Password reset successfully",REQUEST_FAILED:"Request failed",REVOKE:"Revoke",DELETE_API_KEY:"Delete API Key",DELETE_API_KEY_CONFIRM:"Are you sure you want to delete this API key?",API_KEY:"API Key",SIGN_IN:"Sign In",SIGN_IN_ACTION:"Login",SIGN_IN_DESCRIPTION:"Enter your email below to login to your account",SIGN_IN_USERNAME_DESCRIPTION:"Enter your username or email to login to your account",SIGN_IN_WITH:"Sign in with",SIGN_OUT:"Sign Out",SIGN_UP:"Sign Up",SIGN_UP_ACTION:"Create an account",SIGN_UP_DESCRIPTION:"Enter your information to create an account",SIGN_UP_EMAIL:"Check your email for the verification link.",SESSIONS:"Sessions",SESSIONS_DESCRIPTION:"Manage your active sessions and revoke access.",SET_PASSWORD:"Set Password",SET_PASSWORD_DESCRIPTION:"Click the button below to receive an email to set up a password for your account.",SETTINGS:"Settings",SAVE:"Save",SECURITY:"Security",SWITCH_ACCOUNT:"Switch Account",TRUST_DEVICE:"Trust this device",TWO_FACTOR:"Two-Factor",TWO_FACTOR_ACTION:"Verify code",TWO_FACTOR_DESCRIPTION:"Please enter your one-time password to continue",TWO_FACTOR_CARD_DESCRIPTION:"Add an extra layer of security to your account.",TWO_FACTOR_DISABLE_INSTRUCTIONS:"Please enter your password to disable 2FA.",TWO_FACTOR_ENABLE_INSTRUCTIONS:"Please enter your password to enable 2FA.",TWO_FACTOR_ENABLED:"Two-factor authentication has been enabled",TWO_FACTOR_DISABLED:"Two-Factor Authentication has been disabled",TWO_FACTOR_PROMPT:"Two-Factor Authentication",TWO_FACTOR_TOTP_LABEL:"Scan the QR Code with your Authenticator",SEND_VERIFICATION_CODE:"Send verification code",UNLINK:"Unlink",UPDATED_SUCCESSFULLY:"updated successfully",USERNAME:"Username",USERNAME_DESCRIPTION:"Enter the username you want to use to log in.",USERNAME_INSTRUCTIONS:"Please use 32 characters at maximum.",USERNAME_PLACEHOLDER:"Username",OPTIONAL_BRACKETS:"(Optional)",SIGN_IN_USERNAME_PLACEHOLDER:"Username or email",VERIFY_YOUR_EMAIL:"Verify Your Email",VERIFY_YOUR_EMAIL_DESCRIPTION:"Please verify your email address. Check your inbox for the verification email. If you haven't received the email, click the button below to resend.",GO_BACK:"Go back",SESSION_NOT_FRESH:"Your session is not fresh. Please sign in again.",UPLOAD_AVATAR:"Upload Avatar",LOGO:"Logo",LOGO_DESCRIPTION:"Click on the logo to upload a custom one from your files.",LOGO_INSTRUCTIONS:"A logo is optional but strongly recommended.",UPLOAD:"Upload",UPLOAD_LOGO:"Upload Logo",DELETE_LOGO:"Delete Logo",PRIVACY_POLICY:"Privacy Policy",TERMS_OF_SERVICE:"Terms of Service",PROTECTED_BY_RECAPTCHA:"This site is protected by reCAPTCHA.",BY_CONTINUING_YOU_AGREE:"By continuing, you agree to the",USER:"User",ORGANIZATIONS:"Organizations",ORGANIZATIONS_DESCRIPTION:"Manage your organizations and memberships.",ORGANIZATIONS_INSTRUCTIONS:"Create an organization to collaborate with other users.",LEAVE_ORGANIZATION:"Leave Organization",LEAVE_ORGANIZATION_CONFIRM:"Are you sure you want to leave this organization?",LEAVE_ORGANIZATION_SUCCESS:"You have successfully left the organization.",MANAGE_ORGANIZATION:"Manage Organization",REMOVE_MEMBER:"Remove Member",REMOVE_MEMBER_CONFIRM:"Are you sure you want to remove this member from the organization?",REMOVE_MEMBER_SUCCESS:"Member removed successfully",INVITE_MEMBER:"Invite Member",MEMBERS:"Members",MEMBERS_DESCRIPTION:"Add or remove members and manage their roles.",MEMBERS_INSTRUCTIONS:"Invite new members to your organization.",INVITE_MEMBER_DESCRIPTION:"Send an invitation to add a new member to your organization.",ROLE:"Role",SELECT_ROLE:"Select a role",ADMIN:"Admin",MEMBER:"Member",GUEST:"Guest",OWNER:"Owner",UPDATE_ROLE_DESCRIPTION:"Update the role for this member",UPDATE_ROLE:"Update Role",MEMBER_ROLE_UPDATED:"Member role updated successfully",SEND_INVITATION:"Send Invitation",SEND_INVITATION_SUCCESS:"Invitation sent successfully",PENDING_INVITATIONS:"Pending Invitations",PENDING_INVITATIONS_DESCRIPTION:"Manage pending invitations to your organization.",PENDING_USER_INVITATIONS_DESCRIPTION:"Invitations you've received from organizations.",CANCEL_INVITATION:"Cancel Invitation",INVITATION_CANCELLED:"Invitation cancelled successfully",ACCEPT_INVITATION:"Accept Invitation",ACCEPT_INVITATION_DESCRIPTION:"You have been invited to join an organization.",INVITATION_ACCEPTED:"Invitation accepted successfully",INVITATION_REJECTED:"Invitation rejected successfully",ACCEPT:"Accept",REJECT:"Reject",INVITATION_EXPIRED:"This invitation has expired",DELETE_ORGANIZATION:"Delete Organization",DELETE_ORGANIZATION_DESCRIPTION:"Permanently remove your organization and all of its contents. This action is not reversible — please continue with caution.",DELETE_ORGANIZATION_SUCCESS:"Organization deleted successfully",DELETE_ORGANIZATION_INSTRUCTIONS:"Enter the organization slug to continue:",SLUG_REQUIRED:"Organization slug is required",SLUG_DOES_NOT_MATCH:"The slug does not match",TEAM:"Team",TEAMS:"Teams",TEAM_ACTIVE:"Active",TEAM_SET_ACTIVE:"Set Active",CREATE_TEAM:"Create Team",CREATE_TEAM_SUCCESS:"Team created successfully",UPDATE_TEAM:"Update Team",UPDATE_TEAMS:"Update Teams",SELECT_TEAMS:"Select teams",ADD:"Add",REMOVE:"Remove",UPDATE_TEAM_DESCRIPTION:"Update the name for this team",UPDATE_TEAMS_DESCRIPTION:"Add or remove teams for this member",REMOVE_TEAM_CONFIRM:"Are you sure you want to remove this team from the organization?",CREATE_TEAM_INSTRUCTIONS:"Add new team to your organization.",TEAM_NAME:"Team Name",TEAM_NAME_PLACEHOLDER:"Engineering Team",TEAM_NAME_DESCRIPTION:"This is your team's visible name.",TEAM_NAME_INSTRUCTIONS:"Please use 64 characters at maximum.",TEAMS_DESCRIPTION:"Manage your teams within your organization.",USER_TEAMS_DESCRIPTION:"You are a member of the following teams.",DELETE_TEAM:"Delete Team",DELETE_TEAM_DESCRIPTION:"Permanently remove this team and all of its contents.",DELETE_TEAM_SUCCESS:"Team deleted successfully",DELETE_TEAM_INSTRUCTIONS:"Enter the team name to continue:",TEAM_NAME_REQUIRED:"Team name is required",TEAM_NAME_DOES_NOT_MATCH:"The team name does not match",TEAM_MEMBERS:"Team Members",TEAM_MEMBERS_DESCRIPTION:"Manage your team members and their roles.",ADD_TEAM_MEMBER:"Add Team Member",REMOVE_TEAM_MEMBER:"Remove Team Member",REMOVE_TEAM_MEMBER_CONFIRM:"Are you sure you want to remove this member from the team?",REMOVE_TEAM_MEMBER_SUCCESS:"Team member removed successfully",ADD_TEAM_MEMBER_SUCCESS:"Team member added successfully",UPDATE_TEAM_SUCCESS:"Team updated successfully",MANAGE_TEAM_MEMBERS:"Manage Team Members",MANAGE_TEAM_MEMBERS_DESCRIPTION:"Search and add organization members to this team.",NO_TEAMS_FOUND:"No teams found",MEMBER_SINGULAR:"member",MEMBER_PLURAL:"members",UNKNOWN:"Unknown",...wr,...yr,...Nr,...Cr,...xr,...Pr,...Lr,...Mr,...Ur,...kr,...Fr,...Br,...jr,...Hr,...zr,...Vr},Gr={CALLBACK:"callback",EMAIL_OTP:"email-otp",EMAIL_VERIFICATION:"email-verification",FORGOT_PASSWORD:"forgot-password",MAGIC_LINK:"magic-link",RECOVER_ACCOUNT:"recover-account",RESET_PASSWORD:"reset-password",SIGN_IN:"sign-in",SIGN_OUT:"sign-out",SIGN_UP:"sign-up",TWO_FACTOR:"two-factor",ACCEPT_INVITATION:"accept-invitation"},kt={SETTINGS:"settings",SECURITY:"security",TEAMS:"teams",API_KEYS:"api-keys",ORGANIZATIONS:"organizations"},Ft={SETTINGS:"settings",MEMBERS:"members",TEAMS:"teams",API_KEYS:"api-keys"};const In=u.createContext({});function Yr(){return u.useContext(In)}var Xe,Bt;function Kr(){if(Bt)return Xe;Bt=1;var e=function(){};return Xe=e,Xe}var qr=Kr();const $r=St(qr);function Zr({async:e,appendTo:t,defer:n,id:r,nonce:o,src:a}){const c=document.createElement("script");e!==void 0&&(c.async=e),n!==void 0&&(c.defer=n),r&&(c.id=r),o&&c.setAttribute("nonce",o),c.src=a,(t==="head"?document.head:document.body).appendChild(c)}var Xr=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let we=null,be=!1;const je=new Set,He=new Set,Qr=typeof window<"u",ye="___grecaptcha_cfg",Rn=`onLoadCallback_${Math.random().toString(36).slice(2)}`;function Jr(){if(!Qr)return;function e(n){if(be)n();else{window[ye]||(window[ye]={});const r=window[ye];r.fns||(r.fns=[]),r.fns.push(n)}}window.grecaptcha||(window.grecaptcha={}),window.grecaptcha.enterprise||(window.grecaptcha.enterprise={}),window.grecaptcha.ready=e,window.grecaptcha.enterprise.ready=e;function t(){be=!0;for(const n of He)n();He.clear()}window[Rn]=t}function eo({language:e,onLoadCallbackName:t,render:n,useEnterprise:r=!1,useRecaptchaNet:o=!1}){const a=o?"recaptcha.net":"google.com",c=r?"enterprise.js":"api.js",s=new URLSearchParams({render:n});return t&&s.set("onload",t),e&&s.set("hl",e),`https://www.${a}/recaptcha/${c}?${s.toString()}`}function to({language:e,render:t,scriptProps:n,useEnterprise:r,useRecaptchaNet:o}){const a={id:"google-recaptcha-v3"},c=eo({language:e,onLoadCallbackName:Rn,render:t,useEnterprise:r,useRecaptchaNet:o});if(we){if(we!==c)throw new Error("reCAPTCHA has already been loaded with different parameters. Remove the existing script and load it again.");return}we=c,Zr(Object.assign(Object.assign(Object.assign({},a),n),{src:c}))}function no(e){if(!window[ye])return;const t=window[ye];t.clients&&delete t.clients[e]}function ro(e,t){var{onLoadCallback:n,onLoadCallbackName:r}=t,o=Xr(t,["onLoadCallback","onLoadCallbackName"]);if(je.size===0&&Jr(),to(o),je.add(e),n&&(be?n():He.add(n)),r){let a=function(){if(!r)return;const c=window[r];typeof c=="function"&&c()};be?a():He.add(a)}}function oo(e){var t,n,r;je.delete(e),je.size===0&&(window.grecaptcha=void 0,window[ye]=void 0,(t=document.querySelector(".grecaptcha-badge"))===null||t===void 0||t.remove(),(n=document.querySelector(`script[src="${we}"]`))===null||n===void 0||n.remove(),(r=document.querySelector('script[src^="https://www.gstatic.com/recaptcha/releases"]'))===null||r===void 0||r.remove(),we=null,be=!1)}let jt=!1;function ao({container:e,children:t,language:n,reCaptchaKey:r,scriptProps:o,useEnterprise:a,useRecaptchaNet:c}){var s,l,i,h,d,f,p;const E=u.useId(),[_,R]=u.useState(null),[g,S]=u.useState(null),O=u.useRef(!1);u.useEffect(()=>{function I(){var D;const C=a?(D=window.grecaptcha)===null||D===void 0?void 0:D.enterprise:window.grecaptcha;if(!C)throw new Error("reCAPTCHA not found");if(!C.ready)throw new Error("reCAPTCHA ready callback not found");C.ready(()=>{R(C)})}return ro(E,{language:n,onLoadCallback:I,onLoadCallbackName:o?.onLoadCallbackName,render:e?.element?"explicit":r,scriptProps:{appendTo:o?.appendTo,async:o?.async,defer:o?.defer,id:o?.id,nonce:o?.nonce},useEnterprise:a,useRecaptchaNet:c}),()=>{oo(E),R(null)}},[e?.element,E,n,r,o?.appendTo,o?.async,o?.defer,o?.id,o?.nonce,o?.onLoadCallbackName,a,c]),u.useEffect(()=>{var I,D,C;if(!e?.element||!_?.render)return;const M={"error-callback":e.parameters.errorCallback,"expired-callback":e.parameters.expiredCallback,badge:((I=e.parameters)===null||I===void 0?void 0:I.badge)||"inline",callback:e.parameters.callback,sitekey:r,size:"invisible",tabindex:e.parameters.tabindex,theme:e.parameters.theme},L=typeof e?.element=="string"?document.getElementById(e.element):e?.element;if(!L)throw new Error("reCAPTCHA container element not found");const k=_.render(L,M);return!((D=e?.parameters)===null||D===void 0)&&D.hidden&&(jt||($r(!1,"reCAPTCHA badge hidden. See https://cloud.google.com/recaptcha/docs/faq#id_like_to_hide_the_badge_what_is_allowed for more information."),jt=!0),(C=L.querySelector(".grecaptcha-badge"))===null||C===void 0||C.style.setProperty("display","none")),S(k),O.current=!0,()=>{S(null),O.current=!1,no(k),L.innerHTML=""}},[e?.element,(s=e?.parameters)===null||s===void 0?void 0:s.badge,(l=e?.parameters)===null||l===void 0?void 0:l.hidden,(i=e?.parameters)===null||i===void 0?void 0:i.callback,(h=e?.parameters)===null||h===void 0?void 0:h.errorCallback,(d=e?.parameters)===null||d===void 0?void 0:d.expiredCallback,(f=e?.parameters)===null||f===void 0?void 0:f.tabindex,(p=e?.parameters)===null||p===void 0?void 0:p.theme,_,r]);const A=!!e?.element,m=A?g:r,N=u.useMemo(()=>m!==null&&_?.execute?I=>{if(m===null||!_?.execute)throw new Error("reCAPTCHA has not been loaded");return A&&!O.current?(console.warn("Client ID not mounted"),null):_.execute(m,{action:I})}:void 0,[m,_,A]);return v.jsx(In.Provider,{value:{container:e?.element,executeRecaptcha:N,reCaptchaInstance:_},children:t})}var io=class{cache=new Map;listeners=new Map;inFlightRequests=new Map;get(e){return this.cache.get(e)}set(e,t){const n={data:t,timestamp:Date.now(),isRefetching:!1};this.cache.set(e,n),this.notify(e)}setRefetching(e,t){const n=this.cache.get(e);n&&(n.isRefetching=t,this.notify(e))}clear(e){if(e)this.cache.delete(e),this.inFlightRequests.delete(e),this.notify(e);else{this.cache.clear(),this.inFlightRequests.clear();const t=Array.from(this.listeners.keys());for(const n of t)this.notify(n)}}getInFlightRequest(e){return this.inFlightRequests.get(e)}setInFlightRequest(e,t){this.inFlightRequests.set(e,t)}removeInFlightRequest(e){this.inFlightRequests.delete(e)}subscribe(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>{const n=this.listeners.get(e);n&&(n.delete(t),n.size===0&&this.listeners.delete(e))}}notify(e){const t=this.listeners.get(e);if(t){const n=Array.from(t);for(const r of n)r()}}},te=new io;function so(){return()=>{}}function lo(){return u.useSyncExternalStore(so,()=>!0,()=>!1)}function co(){const[e,t]=u.useState();return u.useEffect(()=>{const n=()=>{const o=document.documentElement.getAttribute("lang");t(o??void 0)};n();const r=new MutationObserver(o=>{for(const a of o)a.attributeName==="lang"&&n()});return r.observe(document.documentElement,{attributes:!0}),()=>{r.disconnect()}},[]),{lang:e}}function uo(){const[e,t]=u.useState("light");return u.useEffect(()=>{const n=()=>{var o;const a=document.documentElement.classList.contains("dark")||((o=document.documentElement.getAttribute("style"))==null?void 0:o.includes("color-scheme: dark"));t(a?"dark":"light")};n();const r=new MutationObserver(o=>{for(const a of o)(a.attributeName==="style"||a.attributeName==="class")&&n()});return r.observe(document.documentElement,{attributes:!0}),()=>{r.disconnect()}},[]),{theme:e}}function fo({children:e}){const t=lo(),{captcha:n}=u.useContext(ae);return n?.provider!=="google-recaptcha-v3"?e:v.jsxs(ao,{reCaptchaKey:n.siteKey,useEnterprise:n.enterprise,useRecaptchaNet:n.recaptchaNet,children:[t&&v.jsx("style",{children:`
|
|
1
|
+
import{bv as vr,bw as pr,r as u,bx as St,j as v,by as Mt,bz as yt,bA as Er,bB as On,bC as mr,bD as gr,bE as _r,bF as Or,bG as F,bH as Tn,bI as Ut,X as Tr,a9 as Ar,bJ as Ir,bK as Rr,bL as Sr}from"./index-DByaMzsG.js";function x(...e){return vr(pr(e))}function Be({error:e,localization:t,localizeErrors:n=!0}){var r;const o="Request failed";if(!n)return e?.message?e.message:(r=e?.error)!=null&&r.message?e.error.message:o;if(typeof e=="string"&&t?.[e])return t[e];if(e?.error){if(e.error.code){const a=e.error.code;if(t?.[a])return t[a]}return e.error.message||e.error.code||e.error.statusText||t?.REQUEST_FAILED}return e?.message||t?.REQUEST_FAILED||o}function An(e){return typeof window<"u"?new URLSearchParams(window.location.search).get(e):null}var yr={FAILED_TO_CREATE_USER:"Failed to create user",USER_ALREADY_EXISTS:"User already exists",YOU_CANNOT_BAN_YOURSELF:"You cannot ban yourself",YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE:"You are not allowed to change users role",YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS:"You are not allowed to create users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS:"You are not allowed to list users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS:"You are not allowed to list users sessions",YOU_ARE_NOT_ALLOWED_TO_BAN_USERS:"You are not allowed to ban users",YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS:"You are not allowed to impersonate users",YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS:"You are not allowed to revoke users sessions",YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS:"You are not allowed to delete users",YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD:"You are not allowed to set users password",BANNED_USER:"You have been banned from this application"},Nr={FAILED_TO_CREATE_USER:"Failed to create user",COULD_NOT_CREATE_SESSION:"Could not create session",ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY:"Anonymous users cannot sign in again anonymously"},Cr={INVALID_METADATA_TYPE:"metadata must be an object or undefined",REFILL_AMOUNT_AND_INTERVAL_REQUIRED:"refillAmount is required when refillInterval is provided",REFILL_INTERVAL_AND_AMOUNT_REQUIRED:"refillInterval is required when refillAmount is provided",USER_BANNED:"User is banned",UNAUTHORIZED_SESSION:"Unauthorized or invalid session",KEY_NOT_FOUND:"API Key not found",KEY_DISABLED:"API Key is disabled",KEY_EXPIRED:"API Key has expired",USAGE_EXCEEDED:"API Key has reached its usage limit",KEY_NOT_RECOVERABLE:"API Key is not recoverable",EXPIRES_IN_IS_TOO_SMALL:"The expiresIn is smaller than the predefined minimum value.",EXPIRES_IN_IS_TOO_LARGE:"The expiresIn is larger than the predefined maximum value.",INVALID_REMAINING:"The remaining count is either too large or too small.",INVALID_PREFIX_LENGTH:"The prefix length is either too large or too small.",INVALID_NAME_LENGTH:"The name length is either too large or too small.",METADATA_DISABLED:"Metadata is disabled.",RATE_LIMIT_EXCEEDED:"Rate limit exceeded.",NO_VALUES_TO_UPDATE:"No values to update.",KEY_DISABLED_EXPIRATION:"Custom key expiration values are disabled.",INVALID_API_KEY:"Invalid API key.",INVALID_USER_ID_FROM_API_KEY:"The user id from the API key is invalid.",INVALID_API_KEY_GETTER_RETURN_TYPE:"API Key getter returned an invalid key type. Expected string.",SERVER_ONLY_PROPERTY:"The property you're trying to set can only be set from the server auth instance only."},wr={USER_NOT_FOUND:"User not found",FAILED_TO_CREATE_USER:"Failed to create user",FAILED_TO_CREATE_SESSION:"Failed to create session",FAILED_TO_UPDATE_USER:"Failed to update user",FAILED_TO_GET_SESSION:"Failed to get session",INVALID_PASSWORD:"Invalid password",INVALID_EMAIL:"Invalid email",INVALID_EMAIL_OR_PASSWORD:"Invalid email or password",SOCIAL_ACCOUNT_ALREADY_LINKED:"Social account already linked",PROVIDER_NOT_FOUND:"Provider not found",INVALID_TOKEN:"Invalid token",ID_TOKEN_NOT_SUPPORTED:"id_token not supported",FAILED_TO_GET_USER_INFO:"Failed to get user info",USER_EMAIL_NOT_FOUND:"User email not found",EMAIL_NOT_VERIFIED:"Email not verified",PASSWORD_TOO_SHORT:"Password too short",PASSWORD_TOO_LONG:"Password too long",USER_ALREADY_EXISTS:"User already exists",EMAIL_CAN_NOT_BE_UPDATED:"Email can not be updated",CREDENTIAL_ACCOUNT_NOT_FOUND:"Credential account not found",SESSION_EXPIRED:"Session expired. Re-authenticate to perform this action.",FAILED_TO_UNLINK_LAST_ACCOUNT:"You can't unlink your last account",ACCOUNT_NOT_FOUND:"Account not found",USER_ALREADY_HAS_PASSWORD:"User already has a password. Provide that to delete the account."},br={VERIFICATION_FAILED:"Captcha verification failed",MISSING_RESPONSE:"Missing CAPTCHA response",UNKNOWN_ERROR:"Something went wrong"},Dr={MISSING_SECRET_KEY:"Missing secret key",SERVICE_UNAVAILABLE:"CAPTCHA service unavailable"},xr={...br,...Dr},Pr={OTP_EXPIRED:"otp expired",INVALID_OTP:"Invalid OTP",INVALID_EMAIL:"Invalid email",USER_NOT_FOUND:"User not found",TOO_MANY_ATTEMPTS:"Too many attempts"},Lr={INVALID_OAUTH_CONFIGURATION:"Invalid OAuth configuration"},Mr={PASSWORD_COMPROMISED:"The password you entered has been compromised. Please choose a different password."},Ur={INVALID_SESSION_TOKEN:"Invalid session token"},kr={YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION:"You are not allowed to create a new organization",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS:"You have reached the maximum number of organizations",ORGANIZATION_ALREADY_EXISTS:"Organization already exists",ORGANIZATION_NOT_FOUND:"Organization not found",USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION:"User is not a member of the organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION:"You are not allowed to update this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION:"You are not allowed to delete this organization",NO_ACTIVE_ORGANIZATION:"No active organization",USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION:"User is already a member of this organization",MEMBER_NOT_FOUND:"Member not found",ROLE_NOT_FOUND:"Role not found",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM:"You are not allowed to create a new team",TEAM_ALREADY_EXISTS:"Team already exists",TEAM_NOT_FOUND:"Team not found",YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER:"You cannot leave the organization as the only owner",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER:"You are not allowed to delete this member",YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION:"You are not allowed to invite users to this organization",USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION:"User is already invited to this organization",INVITATION_NOT_FOUND:"Invitation not found",YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION:"You are not the recipient of the invitation",YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION:"You are not allowed to cancel this invitation",INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION:"Inviter is no longer a member of the organization",YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE:"you are not allowed to invite user with this role",FAILED_TO_RETRIEVE_INVITATION:"Failed to retrieve invitation",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS:"You have reached the maximum number of teams",UNABLE_TO_REMOVE_LAST_TEAM:"Unable to remove last team",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER:"You are not allowed to update this member",ORGANIZATION_MEMBERSHIP_LIMIT_REACHED:"Organization membership limit reached",YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to create teams in this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to delete teams in this organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM:"You are not allowed to update this team",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM:"You are not allowed to delete this team",INVITATION_LIMIT_REACHED:"Invitation limit reached"},Fr={CHALLENGE_NOT_FOUND:"Challenge not found",YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY:"You are not allowed to register this passkey",FAILED_TO_VERIFY_REGISTRATION:"Failed to verify registration",PASSKEY_NOT_FOUND:"Passkey not found",AUTHENTICATION_FAILED:"Authentication failed",UNABLE_TO_CREATE_SESSION:"Unable to create session",FAILED_TO_UPDATE_PASSKEY:"Failed to update passkey"},Br={INVALID_PHONE_NUMBER:"Invalid phone number",PHONE_NUMBER_EXIST:"Phone number already exists",INVALID_PHONE_NUMBER_OR_PASSWORD:"Invalid phone number or password",UNEXPECTED_ERROR:"Unexpected error",OTP_NOT_FOUND:"OTP not found",OTP_EXPIRED:"OTP expired",INVALID_OTP:"Invalid OTP",PHONE_NUMBER_NOT_VERIFIED:"Phone number not verified"},jr={SUBSCRIPTION_NOT_FOUND:"Subscription not found",SUBSCRIPTION_PLAN_NOT_FOUND:"Subscription plan not found",ALREADY_SUBSCRIBED_PLAN:"You're already subscribed to this plan",UNABLE_TO_CREATE_CUSTOMER:"Unable to create customer",FAILED_TO_FETCH_PLANS:"Failed to fetch plans",EMAIL_VERIFICATION_REQUIRED:"Email verification is required before you can subscribe to a plan",SUBSCRIPTION_NOT_ACTIVE:"Subscription is not active",SUBSCRIPTION_NOT_SCHEDULED_FOR_CANCELLATION:"Subscription is not scheduled for cancellation"},Hr={TEAM_LIMIT_REACHED:"Team limit reached for this organization",TEAM_MEMBER_LIMIT_REACHED:"Team member limit reached for this team",TEAM_NOT_FOUND:"Team not found",TEAM_MEMBER_NOT_FOUND:"Team member not found",TEAM_NAME_TOO_LONG:"Team name is too long",CANNOT_REMOVE_LAST_TEAM:"Cannot remove the last team",NOT_ORGANIZATION_MEMBER:"User is not a member of the organization",ALREADY_TEAM_MEMBER:"User is already a member of this team",INSUFFICIENT_TEAM_PERMISSIONS:"Insufficient permissions to perform this action on team"},zr={OTP_NOT_ENABLED:"OTP not enabled",OTP_HAS_EXPIRED:"OTP has expired",TOTP_NOT_ENABLED:"TOTP not enabled",TWO_FACTOR_NOT_ENABLED:"Two factor isn't enabled",BACKUP_CODES_NOT_ENABLED:"Backup codes aren't enabled",INVALID_BACKUP_CODE:"Invalid backup code",INVALID_CODE:"Invalid code",TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE:"Too many attempts. Please request a new code.",INVALID_TWO_FACTOR_COOKIE:"Invalid two factor cookie"},Vr={INVALID_USERNAME_OR_PASSWORD:"invalid username or password",EMAIL_NOT_VERIFIED:"email not verified",UNEXPECTED_ERROR:"unexpected error",USERNAME_IS_ALREADY_TAKEN:"username is already taken. please try another.",USERNAME_TOO_SHORT:"username is too short",USERNAME_TOO_LONG:"username is too long",INVALID_USERNAME:"username is invalid"},Wr={APP:"App",ACCOUNT:"Account",ACCOUNTS:"Accounts",ACCOUNTS_DESCRIPTION:"Switch between your currently signed in accounts.",ACCOUNTS_INSTRUCTIONS:"Sign in to an additional account.",ADD_ACCOUNT:"Add Account",ADD_PASSKEY:"Add Passkey",ALREADY_HAVE_AN_ACCOUNT:"Already have an account?",AVATAR:"Avatar",AVATAR_DESCRIPTION:"Click on the avatar to upload a custom one from your files.",AVATAR_INSTRUCTIONS:"An avatar is optional but strongly recommended.",BACKUP_CODE_REQUIRED:"Backup code is required",BACKUP_CODES:"Backup Codes",BACKUP_CODES_DESCRIPTION:"Save these backup codes in a secure place. You can use them to access your account if you lose your two-factor authentication method.",BACKUP_CODE_PLACEHOLDER:"Backup Code",BACKUP_CODE:"Backup Code",CANCEL:"Cancel",CHANGE_PASSWORD:"Change Password",CHANGE_PASSWORD_DESCRIPTION:"Enter your current password and a new password.",CHANGE_PASSWORD_INSTRUCTIONS:"Please use 8 characters at minimum.",CHANGE_PASSWORD_SUCCESS:"Your password has been changed.",CONFIRM_PASSWORD:"Confirm Password",CONFIRM_PASSWORD_PLACEHOLDER:"Confirm Password",CONFIRM_PASSWORD_REQUIRED:"Confirm password is required",CONTINUE_WITH_AUTHENTICATOR:"Continue with Authenticator",COPIED_TO_CLIPBOARD:"Copied to clipboard",COPY_TO_CLIPBOARD:"Copy to clipboard",COPY_ALL_CODES:"Copy all codes",CONTINUE:"Continue",CURRENT_PASSWORD:"Current Password",CURRENT_PASSWORD_PLACEHOLDER:"Current Password",CURRENT_SESSION:"Current Session",UPDATE:"Update",DELETE:"Delete",DELETE_AVATAR:"Delete Avatar",DELETE_ACCOUNT:"Delete Account",DELETE_ACCOUNT_DESCRIPTION:"Permanently remove your account and all of its contents. This action is not reversible, so please continue with caution.",DELETE_ACCOUNT_INSTRUCTIONS:"Please confirm the deletion of your account. This action is not reversible, so please continue with caution.",DELETE_ACCOUNT_VERIFY:"Please check your email to verify the deletion of your account.",DELETE_ACCOUNT_SUCCESS:"Your account has been deleted.",DISABLE_TWO_FACTOR:"Disable Two-Factor",DISABLED_CREDENTIALS_DESCRIPTION:"Choose a provider to login to your account",DONT_HAVE_AN_ACCOUNT:"Don't have an account?",DONE:"Done",EMAIL:"Email",EMAIL_DESCRIPTION:"Enter the email address you want to use to log in.",EMAIL_INSTRUCTIONS:"Please enter a valid email address.",EMAIL_IS_THE_SAME:"Email is the same",EMAIL_PLACEHOLDER:"m@example.com",EMAIL_REQUIRED:"Email address is required",EMAIL_VERIFY_CHANGE:"Please check your email to verify the change.",EMAIL_VERIFICATION:"Email Verification",EMAIL_VERIFICATION_DESCRIPTION:"Please check your email for the verification code to complete your registration.",EMAIL_VERIFICATION_SUCCESS:"Email verification successful.",ENABLE_TWO_FACTOR:"Enable Two-Factor",IS_INVALID:"is invalid",IS_REQUIRED:"is required",IS_THE_SAME:"is the same",FORGOT_AUTHENTICATOR:"Forgot authenticator?",FORGOT_PASSWORD:"Forgot Password",FORGOT_PASSWORD_ACTION:"Send reset link",FORGOT_PASSWORD_DESCRIPTION:"Enter your email to reset your password",FORGOT_PASSWORD_EMAIL:"Check your email for the password reset link.",FORGOT_PASSWORD_LINK:"Forgot your password?",LINK:"Link",MAGIC_LINK:"Magic Link",MAGIC_LINK_ACTION:"Send magic link",MAGIC_LINK_DESCRIPTION:"Enter your email to receive a magic link",MAGIC_LINK_EMAIL:"Check your email for the magic link",EMAIL_OTP:"Email Code",EMAIL_OTP_SEND_ACTION:"Send code",EMAIL_OTP_VERIFY_ACTION:"Verify code",EMAIL_OTP_DESCRIPTION:"Enter your email to receive a code",EMAIL_OTP_VERIFICATION_SENT:"Please check your email for the verification code.",NAME:"Name",NAME_DESCRIPTION:"Please enter your full name, or a display name.",NAME_INSTRUCTIONS:"Please use 32 characters at maximum.",NAME_PLACEHOLDER:"Name",NEW_PASSWORD:"New Password",NEW_PASSWORD_PLACEHOLDER:"New Password",NEW_PASSWORD_REQUIRED:"New password is required",ONE_TIME_PASSWORD:"One-Time Password",OR_CONTINUE_WITH:"Or continue with",PASSKEY:"Passkey",PASSKEYS:"Passkeys",PASSKEYS_DESCRIPTION:"Manage your passkeys for secure access.",PASSKEYS_INSTRUCTIONS:"Securely access your account without a password.",PERSONAL_ACCOUNT:"Personal Account",API_KEYS:"API Keys",API_KEYS_DESCRIPTION:"Manage your API keys for secure access.",API_KEYS_INSTRUCTIONS:"Generate API keys to access your account programmatically.",CREATE_API_KEY:"Create API Key",CREATE_API_KEY_DESCRIPTION:"Enter a unique name for your API key to differentiate it from other keys.",API_KEY_NAME_PLACEHOLDER:"New API Key",API_KEY_CREATED:"API Key Created",CREATE_API_KEY_SUCCESS:"Please copy your API key and store it in a safe place. For security reasons we cannot show it again.",NEVER_EXPIRES:"Never Expires",EXPIRES:"Expires",NO_EXPIRATION:"No Expiration",CREATE_ORGANIZATION:"Create Organization",ORGANIZATION:"Organization",ORGANIZATION_NAME:"Name",ORGANIZATION_NAME_PLACEHOLDER:"Acme Inc.",ORGANIZATION_NAME_DESCRIPTION:"This is your organization's visible name.",ORGANIZATION_NAME_INSTRUCTIONS:"Please use 32 characters at maximum.",ORGANIZATION_SLUG:"Slug URL",ORGANIZATION_SLUG_DESCRIPTION:"This is your organization's URL namespace.",ORGANIZATION_SLUG_INSTRUCTIONS:"Please use 48 characters at maximum.",ORGANIZATION_SLUG_PLACEHOLDER:"acme-inc",CREATE_ORGANIZATION_SUCCESS:"Organization created successfully",PASSWORD:"Password",PASSWORD_PLACEHOLDER:"Password",PASSWORD_REQUIRED:"Password is required",PASSWORDS_DO_NOT_MATCH:"Passwords do not match",PROVIDERS:"Providers",PROVIDERS_DESCRIPTION:"Connect your account with a third-party service.",RECOVER_ACCOUNT:"Recover Account",RECOVER_ACCOUNT_ACTION:"Recover account",RECOVER_ACCOUNT_DESCRIPTION:"Please enter a backup code to access your account",REMEMBER_ME:"Remember me",RESEND_CODE:"Resend code",RESEND_VERIFICATION_EMAIL:"Resend Verification Email",RESET_PASSWORD:"Reset Password",RESET_PASSWORD_ACTION:"Save new password",RESET_PASSWORD_DESCRIPTION:"Enter your new password below",RESET_PASSWORD_SUCCESS:"Password reset successfully",REQUEST_FAILED:"Request failed",REVOKE:"Revoke",DELETE_API_KEY:"Delete API Key",DELETE_API_KEY_CONFIRM:"Are you sure you want to delete this API key?",API_KEY:"API Key",SIGN_IN:"Sign In",SIGN_IN_ACTION:"Login",SIGN_IN_DESCRIPTION:"Enter your email below to login to your account",SIGN_IN_USERNAME_DESCRIPTION:"Enter your username or email to login to your account",SIGN_IN_WITH:"Sign in with",SIGN_OUT:"Sign Out",SIGN_UP:"Sign Up",SIGN_UP_ACTION:"Create an account",SIGN_UP_DESCRIPTION:"Enter your information to create an account",SIGN_UP_EMAIL:"Check your email for the verification link.",SESSIONS:"Sessions",SESSIONS_DESCRIPTION:"Manage your active sessions and revoke access.",SET_PASSWORD:"Set Password",SET_PASSWORD_DESCRIPTION:"Click the button below to receive an email to set up a password for your account.",SETTINGS:"Settings",SAVE:"Save",SECURITY:"Security",SWITCH_ACCOUNT:"Switch Account",TRUST_DEVICE:"Trust this device",TWO_FACTOR:"Two-Factor",TWO_FACTOR_ACTION:"Verify code",TWO_FACTOR_DESCRIPTION:"Please enter your one-time password to continue",TWO_FACTOR_CARD_DESCRIPTION:"Add an extra layer of security to your account.",TWO_FACTOR_DISABLE_INSTRUCTIONS:"Please enter your password to disable 2FA.",TWO_FACTOR_ENABLE_INSTRUCTIONS:"Please enter your password to enable 2FA.",TWO_FACTOR_ENABLED:"Two-factor authentication has been enabled",TWO_FACTOR_DISABLED:"Two-Factor Authentication has been disabled",TWO_FACTOR_PROMPT:"Two-Factor Authentication",TWO_FACTOR_TOTP_LABEL:"Scan the QR Code with your Authenticator",SEND_VERIFICATION_CODE:"Send verification code",UNLINK:"Unlink",UPDATED_SUCCESSFULLY:"updated successfully",USERNAME:"Username",USERNAME_DESCRIPTION:"Enter the username you want to use to log in.",USERNAME_INSTRUCTIONS:"Please use 32 characters at maximum.",USERNAME_PLACEHOLDER:"Username",OPTIONAL_BRACKETS:"(Optional)",SIGN_IN_USERNAME_PLACEHOLDER:"Username or email",VERIFY_YOUR_EMAIL:"Verify Your Email",VERIFY_YOUR_EMAIL_DESCRIPTION:"Please verify your email address. Check your inbox for the verification email. If you haven't received the email, click the button below to resend.",GO_BACK:"Go back",SESSION_NOT_FRESH:"Your session is not fresh. Please sign in again.",UPLOAD_AVATAR:"Upload Avatar",LOGO:"Logo",LOGO_DESCRIPTION:"Click on the logo to upload a custom one from your files.",LOGO_INSTRUCTIONS:"A logo is optional but strongly recommended.",UPLOAD:"Upload",UPLOAD_LOGO:"Upload Logo",DELETE_LOGO:"Delete Logo",PRIVACY_POLICY:"Privacy Policy",TERMS_OF_SERVICE:"Terms of Service",PROTECTED_BY_RECAPTCHA:"This site is protected by reCAPTCHA.",BY_CONTINUING_YOU_AGREE:"By continuing, you agree to the",USER:"User",ORGANIZATIONS:"Organizations",ORGANIZATIONS_DESCRIPTION:"Manage your organizations and memberships.",ORGANIZATIONS_INSTRUCTIONS:"Create an organization to collaborate with other users.",LEAVE_ORGANIZATION:"Leave Organization",LEAVE_ORGANIZATION_CONFIRM:"Are you sure you want to leave this organization?",LEAVE_ORGANIZATION_SUCCESS:"You have successfully left the organization.",MANAGE_ORGANIZATION:"Manage Organization",REMOVE_MEMBER:"Remove Member",REMOVE_MEMBER_CONFIRM:"Are you sure you want to remove this member from the organization?",REMOVE_MEMBER_SUCCESS:"Member removed successfully",INVITE_MEMBER:"Invite Member",MEMBERS:"Members",MEMBERS_DESCRIPTION:"Add or remove members and manage their roles.",MEMBERS_INSTRUCTIONS:"Invite new members to your organization.",INVITE_MEMBER_DESCRIPTION:"Send an invitation to add a new member to your organization.",ROLE:"Role",SELECT_ROLE:"Select a role",ADMIN:"Admin",MEMBER:"Member",GUEST:"Guest",OWNER:"Owner",UPDATE_ROLE_DESCRIPTION:"Update the role for this member",UPDATE_ROLE:"Update Role",MEMBER_ROLE_UPDATED:"Member role updated successfully",SEND_INVITATION:"Send Invitation",SEND_INVITATION_SUCCESS:"Invitation sent successfully",PENDING_INVITATIONS:"Pending Invitations",PENDING_INVITATIONS_DESCRIPTION:"Manage pending invitations to your organization.",PENDING_USER_INVITATIONS_DESCRIPTION:"Invitations you've received from organizations.",CANCEL_INVITATION:"Cancel Invitation",INVITATION_CANCELLED:"Invitation cancelled successfully",ACCEPT_INVITATION:"Accept Invitation",ACCEPT_INVITATION_DESCRIPTION:"You have been invited to join an organization.",INVITATION_ACCEPTED:"Invitation accepted successfully",INVITATION_REJECTED:"Invitation rejected successfully",ACCEPT:"Accept",REJECT:"Reject",INVITATION_EXPIRED:"This invitation has expired",DELETE_ORGANIZATION:"Delete Organization",DELETE_ORGANIZATION_DESCRIPTION:"Permanently remove your organization and all of its contents. This action is not reversible — please continue with caution.",DELETE_ORGANIZATION_SUCCESS:"Organization deleted successfully",DELETE_ORGANIZATION_INSTRUCTIONS:"Enter the organization slug to continue:",SLUG_REQUIRED:"Organization slug is required",SLUG_DOES_NOT_MATCH:"The slug does not match",TEAM:"Team",TEAMS:"Teams",TEAM_ACTIVE:"Active",TEAM_SET_ACTIVE:"Set Active",CREATE_TEAM:"Create Team",CREATE_TEAM_SUCCESS:"Team created successfully",UPDATE_TEAM:"Update Team",UPDATE_TEAMS:"Update Teams",SELECT_TEAMS:"Select teams",ADD:"Add",REMOVE:"Remove",UPDATE_TEAM_DESCRIPTION:"Update the name for this team",UPDATE_TEAMS_DESCRIPTION:"Add or remove teams for this member",REMOVE_TEAM_CONFIRM:"Are you sure you want to remove this team from the organization?",CREATE_TEAM_INSTRUCTIONS:"Add new team to your organization.",TEAM_NAME:"Team Name",TEAM_NAME_PLACEHOLDER:"Engineering Team",TEAM_NAME_DESCRIPTION:"This is your team's visible name.",TEAM_NAME_INSTRUCTIONS:"Please use 64 characters at maximum.",TEAMS_DESCRIPTION:"Manage your teams within your organization.",USER_TEAMS_DESCRIPTION:"You are a member of the following teams.",DELETE_TEAM:"Delete Team",DELETE_TEAM_DESCRIPTION:"Permanently remove this team and all of its contents.",DELETE_TEAM_SUCCESS:"Team deleted successfully",DELETE_TEAM_INSTRUCTIONS:"Enter the team name to continue:",TEAM_NAME_REQUIRED:"Team name is required",TEAM_NAME_DOES_NOT_MATCH:"The team name does not match",TEAM_MEMBERS:"Team Members",TEAM_MEMBERS_DESCRIPTION:"Manage your team members and their roles.",ADD_TEAM_MEMBER:"Add Team Member",REMOVE_TEAM_MEMBER:"Remove Team Member",REMOVE_TEAM_MEMBER_CONFIRM:"Are you sure you want to remove this member from the team?",REMOVE_TEAM_MEMBER_SUCCESS:"Team member removed successfully",ADD_TEAM_MEMBER_SUCCESS:"Team member added successfully",UPDATE_TEAM_SUCCESS:"Team updated successfully",MANAGE_TEAM_MEMBERS:"Manage Team Members",MANAGE_TEAM_MEMBERS_DESCRIPTION:"Search and add organization members to this team.",NO_TEAMS_FOUND:"No teams found",MEMBER_SINGULAR:"member",MEMBER_PLURAL:"members",UNKNOWN:"Unknown",...wr,...yr,...Nr,...Cr,...xr,...Pr,...Lr,...Mr,...Ur,...kr,...Fr,...Br,...jr,...Hr,...zr,...Vr},Gr={CALLBACK:"callback",EMAIL_OTP:"email-otp",EMAIL_VERIFICATION:"email-verification",FORGOT_PASSWORD:"forgot-password",MAGIC_LINK:"magic-link",RECOVER_ACCOUNT:"recover-account",RESET_PASSWORD:"reset-password",SIGN_IN:"sign-in",SIGN_OUT:"sign-out",SIGN_UP:"sign-up",TWO_FACTOR:"two-factor",ACCEPT_INVITATION:"accept-invitation"},kt={SETTINGS:"settings",SECURITY:"security",TEAMS:"teams",API_KEYS:"api-keys",ORGANIZATIONS:"organizations"},Ft={SETTINGS:"settings",MEMBERS:"members",TEAMS:"teams",API_KEYS:"api-keys"};const In=u.createContext({});function Yr(){return u.useContext(In)}var Xe,Bt;function Kr(){if(Bt)return Xe;Bt=1;var e=function(){};return Xe=e,Xe}var qr=Kr();const $r=St(qr);function Zr({async:e,appendTo:t,defer:n,id:r,nonce:o,src:a}){const c=document.createElement("script");e!==void 0&&(c.async=e),n!==void 0&&(c.defer=n),r&&(c.id=r),o&&c.setAttribute("nonce",o),c.src=a,(t==="head"?document.head:document.body).appendChild(c)}var Xr=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let we=null,be=!1;const je=new Set,He=new Set,Qr=typeof window<"u",ye="___grecaptcha_cfg",Rn=`onLoadCallback_${Math.random().toString(36).slice(2)}`;function Jr(){if(!Qr)return;function e(n){if(be)n();else{window[ye]||(window[ye]={});const r=window[ye];r.fns||(r.fns=[]),r.fns.push(n)}}window.grecaptcha||(window.grecaptcha={}),window.grecaptcha.enterprise||(window.grecaptcha.enterprise={}),window.grecaptcha.ready=e,window.grecaptcha.enterprise.ready=e;function t(){be=!0;for(const n of He)n();He.clear()}window[Rn]=t}function eo({language:e,onLoadCallbackName:t,render:n,useEnterprise:r=!1,useRecaptchaNet:o=!1}){const a=o?"recaptcha.net":"google.com",c=r?"enterprise.js":"api.js",s=new URLSearchParams({render:n});return t&&s.set("onload",t),e&&s.set("hl",e),`https://www.${a}/recaptcha/${c}?${s.toString()}`}function to({language:e,render:t,scriptProps:n,useEnterprise:r,useRecaptchaNet:o}){const a={id:"google-recaptcha-v3"},c=eo({language:e,onLoadCallbackName:Rn,render:t,useEnterprise:r,useRecaptchaNet:o});if(we){if(we!==c)throw new Error("reCAPTCHA has already been loaded with different parameters. Remove the existing script and load it again.");return}we=c,Zr(Object.assign(Object.assign(Object.assign({},a),n),{src:c}))}function no(e){if(!window[ye])return;const t=window[ye];t.clients&&delete t.clients[e]}function ro(e,t){var{onLoadCallback:n,onLoadCallbackName:r}=t,o=Xr(t,["onLoadCallback","onLoadCallbackName"]);if(je.size===0&&Jr(),to(o),je.add(e),n&&(be?n():He.add(n)),r){let a=function(){if(!r)return;const c=window[r];typeof c=="function"&&c()};be?a():He.add(a)}}function oo(e){var t,n,r;je.delete(e),je.size===0&&(window.grecaptcha=void 0,window[ye]=void 0,(t=document.querySelector(".grecaptcha-badge"))===null||t===void 0||t.remove(),(n=document.querySelector(`script[src="${we}"]`))===null||n===void 0||n.remove(),(r=document.querySelector('script[src^="https://www.gstatic.com/recaptcha/releases"]'))===null||r===void 0||r.remove(),we=null,be=!1)}let jt=!1;function ao({container:e,children:t,language:n,reCaptchaKey:r,scriptProps:o,useEnterprise:a,useRecaptchaNet:c}){var s,l,i,h,d,f,p;const E=u.useId(),[_,R]=u.useState(null),[g,S]=u.useState(null),O=u.useRef(!1);u.useEffect(()=>{function I(){var D;const C=a?(D=window.grecaptcha)===null||D===void 0?void 0:D.enterprise:window.grecaptcha;if(!C)throw new Error("reCAPTCHA not found");if(!C.ready)throw new Error("reCAPTCHA ready callback not found");C.ready(()=>{R(C)})}return ro(E,{language:n,onLoadCallback:I,onLoadCallbackName:o?.onLoadCallbackName,render:e?.element?"explicit":r,scriptProps:{appendTo:o?.appendTo,async:o?.async,defer:o?.defer,id:o?.id,nonce:o?.nonce},useEnterprise:a,useRecaptchaNet:c}),()=>{oo(E),R(null)}},[e?.element,E,n,r,o?.appendTo,o?.async,o?.defer,o?.id,o?.nonce,o?.onLoadCallbackName,a,c]),u.useEffect(()=>{var I,D,C;if(!e?.element||!_?.render)return;const M={"error-callback":e.parameters.errorCallback,"expired-callback":e.parameters.expiredCallback,badge:((I=e.parameters)===null||I===void 0?void 0:I.badge)||"inline",callback:e.parameters.callback,sitekey:r,size:"invisible",tabindex:e.parameters.tabindex,theme:e.parameters.theme},L=typeof e?.element=="string"?document.getElementById(e.element):e?.element;if(!L)throw new Error("reCAPTCHA container element not found");const k=_.render(L,M);return!((D=e?.parameters)===null||D===void 0)&&D.hidden&&(jt||($r(!1,"reCAPTCHA badge hidden. See https://cloud.google.com/recaptcha/docs/faq#id_like_to_hide_the_badge_what_is_allowed for more information."),jt=!0),(C=L.querySelector(".grecaptcha-badge"))===null||C===void 0||C.style.setProperty("display","none")),S(k),O.current=!0,()=>{S(null),O.current=!1,no(k),L.innerHTML=""}},[e?.element,(s=e?.parameters)===null||s===void 0?void 0:s.badge,(l=e?.parameters)===null||l===void 0?void 0:l.hidden,(i=e?.parameters)===null||i===void 0?void 0:i.callback,(h=e?.parameters)===null||h===void 0?void 0:h.errorCallback,(d=e?.parameters)===null||d===void 0?void 0:d.expiredCallback,(f=e?.parameters)===null||f===void 0?void 0:f.tabindex,(p=e?.parameters)===null||p===void 0?void 0:p.theme,_,r]);const A=!!e?.element,m=A?g:r,N=u.useMemo(()=>m!==null&&_?.execute?I=>{if(m===null||!_?.execute)throw new Error("reCAPTCHA has not been loaded");return A&&!O.current?(console.warn("Client ID not mounted"),null):_.execute(m,{action:I})}:void 0,[m,_,A]);return v.jsx(In.Provider,{value:{container:e?.element,executeRecaptcha:N,reCaptchaInstance:_},children:t})}var io=class{cache=new Map;listeners=new Map;inFlightRequests=new Map;get(e){return this.cache.get(e)}set(e,t){const n={data:t,timestamp:Date.now(),isRefetching:!1};this.cache.set(e,n),this.notify(e)}setRefetching(e,t){const n=this.cache.get(e);n&&(n.isRefetching=t,this.notify(e))}clear(e){if(e)this.cache.delete(e),this.inFlightRequests.delete(e),this.notify(e);else{this.cache.clear(),this.inFlightRequests.clear();const t=Array.from(this.listeners.keys());for(const n of t)this.notify(n)}}getInFlightRequest(e){return this.inFlightRequests.get(e)}setInFlightRequest(e,t){this.inFlightRequests.set(e,t)}removeInFlightRequest(e){this.inFlightRequests.delete(e)}subscribe(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>{const n=this.listeners.get(e);n&&(n.delete(t),n.size===0&&this.listeners.delete(e))}}notify(e){const t=this.listeners.get(e);if(t){const n=Array.from(t);for(const r of n)r()}}},te=new io;function so(){return()=>{}}function lo(){return u.useSyncExternalStore(so,()=>!0,()=>!1)}function co(){const[e,t]=u.useState();return u.useEffect(()=>{const n=()=>{const o=document.documentElement.getAttribute("lang");t(o??void 0)};n();const r=new MutationObserver(o=>{for(const a of o)a.attributeName==="lang"&&n()});return r.observe(document.documentElement,{attributes:!0}),()=>{r.disconnect()}},[]),{lang:e}}function uo(){const[e,t]=u.useState("light");return u.useEffect(()=>{const n=()=>{var o;const a=document.documentElement.classList.contains("dark")||((o=document.documentElement.getAttribute("style"))==null?void 0:o.includes("color-scheme: dark"));t(a?"dark":"light")};n();const r=new MutationObserver(o=>{for(const a of o)(a.attributeName==="style"||a.attributeName==="class")&&n()});return r.observe(document.documentElement,{attributes:!0}),()=>{r.disconnect()}},[]),{theme:e}}function fo({children:e}){const t=lo(),{captcha:n}=u.useContext(ae);return n?.provider!=="google-recaptcha-v3"?e:v.jsxs(ao,{reCaptchaKey:n.siteKey,useEnterprise:n.enterprise,useRecaptchaNet:n.recaptchaNet,children:[t&&v.jsx("style",{children:`
|
|
2
2
|
.grecaptcha-badge {
|
|
3
3
|
visibility: hidden;
|
|
4
4
|
border-radius: var(--radius) !important;
|
|
@@ -50,4 +50,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
50
50
|
.st0{fill:#FFFFFF}
|
|
51
51
|
.st1{fill:#9146FF}
|
|
52
52
|
`}),v.jsx("title",{children:"Asset 2"}),v.jsxs("g",{children:[v.jsx("polygon",{className:"st0",points:"2200,1300 1800,1700 1400,1700 1050,2050 1050,1700 600,1700 600,200 2200,200"}),v.jsx("g",{children:v.jsxs("g",{children:[v.jsx("path",{className:"st1",d:"M500,0L0,500v1800h600v500l500-500h400l900-900V0H500z M2200,1300l-400,400h-400l-350,350v-350H600V200h1600V1300z"}),v.jsx("rect",{className:"st1",height:"600",width:"200",x:"1700",y:"550"}),v.jsx("rect",{className:"st1",height:"600",width:"200",x:"1150",y:"550"})]})})]})]}),ss=({className:e})=>v.jsx("svg",{"data-testid":"geist-icon",height:"16","stroke-linejoin":"round",viewBox:"0 0 16 16",width:"16",className:e,style:{color:"currentcolor"},children:v.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 1L16 15H0L8 1Z",fill:"currentColor"})}),ls=({className:e})=>v.jsx("svg",{className:e,viewBox:"0 0 576 512",xmlns:"http://www.w3.org/2000/svg",children:v.jsx("path",{d:"M545 117.7c3.7-12.5 0-21.7-17.8-21.7h-58.9c-15 0-21.9 7.9-25.6 16.7c0 0-30 73.1-72.4 120.5c-13.7 13.7-20 18.1-27.5 18.1c-3.7 0-9.4-4.4-9.4-16.9V117.7c0-15-4.2-21.7-16.6-21.7h-92.6c-9.4 0-15 7-15 13.5c0 14.2 21.2 17.5 23.4 57.5v86.8c0 19-3.4 22.5-10.9 22.5c-20 0-68.6-73.4-97.4-157.4c-5.8-16.3-11.5-22.9-26.6-22.9H38.8c-16.8 0-20.2 7.9-20.2 16.7c0 15.6 20 93.1 93.1 195.5C160.4 378.1 229 416 291.4 416c37.5 0 42.1-8.4 42.1-22.9c0-66.8-3.4-73.1 15.4-73.1c8.7 0 23.7 4.4 58.7 38.1c40 40 46.6 57.9 69 57.9h58.9c16.8 0 25.3-8.4 20.4-25c-11.2-34.9-86.9-106.7-90.3-111.5c-8.7-11.2-6.2-16.2 0-26.2c.1-.1 72-101.3 79.4-135.6",fill:"currentColor"})}),cs=({className:e})=>v.jsx("svg",{className:e,viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",children:v.jsx("path",{d:"M389.2 48h70.6L305.6 224.2L487 464H345L233.7 318.6L106.5 464H35.8l164.9-188.5L26.8 48h145.6l100.5 132.9zm-24.8 373.8h39.1L151.1 88h-42z",fill:"currentColor"})}),us=({className:e})=>v.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",width:512,height:117,viewBox:"0 0 512 117",children:v.jsx("path",{fill:"#0b5cff",d:"M107.472 114.706H16.348c-5.968 0-11.791-3.203-14.557-8.589C-1.41 99.858-.247 92.434 4.702 87.63L68.17 24.164H22.607C10.088 24.164.044 13.974.044 1.6h83.992c5.968 0 11.79 3.203 14.556 8.589c3.203 6.259 2.038 13.683-2.911 18.486L32.214 92.143h52.55c12.518 0 22.708 10.19 22.708 22.563M468.183 0c-13.1 0-24.746 5.677-32.898 14.702C427.134 5.677 415.488 0 402.388 0c-24.164 0-43.961 20.67-43.961 44.834v69.872c12.518 0 22.562-10.19 22.562-22.563V44.689c0-11.646 9.025-21.544 20.67-21.98c12.228-.437 22.272 9.315 22.272 21.397v48.037c0 12.519 10.19 22.563 22.563 22.563V44.543c0-11.645 9.025-21.544 20.67-21.98c12.228-.437 22.272 9.316 22.272 21.398v48.036c0 12.52 10.19 22.563 22.563 22.563V44.69C512.144 20.67 492.347 0 468.183 0M221.595 58.226c0 32.17-26.056 58.226-58.226 58.226s-58.226-26.056-58.226-58.226S131.199 0 163.369 0s58.226 26.056 58.226 58.226m-22.563 0c0-19.651-16.012-35.663-35.663-35.663s-35.664 16.012-35.664 35.663c0 19.652 16.013 35.664 35.664 35.664s35.663-16.012 35.663-35.664m148.04 0c0 32.17-26.056 58.226-58.226 58.226S230.62 90.396 230.62 58.226S256.676 0 288.846 0s58.227 26.056 58.227 58.226m-22.562 0c0-19.651-16.012-35.663-35.664-35.663c-19.65 0-35.663 16.012-35.663 35.663c0 19.652 16.012 35.664 35.663 35.664c19.652 0 35.664-16.012 35.664-35.664"})}),ms=[{provider:"apple",name:"Apple",icon:zi},{provider:"discord",name:"Discord",icon:Vi},{provider:"dropbox",name:"Dropbox",icon:Wi},{provider:"facebook",name:"Facebook",icon:Gi},{provider:"github",name:"GitHub",icon:Yi},{provider:"gitlab",name:"GitLab",icon:Ki},{provider:"google",name:"Google",icon:qi},{provider:"huggingface",name:"Hugging Face",icon:$i},{provider:"kick",name:"Kick",icon:Zi},{provider:"linear",name:"Linear",icon:Xi},{provider:"linkedin",name:"LinkedIn",icon:Qi},{provider:"microsoft",name:"Microsoft",icon:Ji},{provider:"notion",name:"Notion",icon:es},{provider:"reddit",name:"Reddit",icon:ts},{provider:"roblox",name:"Roblox",icon:ns},{provider:"slack",name:"Slack",icon:rs},{provider:"spotify",name:"Spotify",icon:os},{provider:"tiktok",name:"TikTok",icon:as},{provider:"twitch",name:"Twitch",icon:is},{provider:"vercel",name:"Vercel",icon:ss},{provider:"vk",name:"VK",icon:ls},{provider:"twitter",name:"X",icon:cs},{provider:"zoom",name:"Zoom",icon:us}];function gs({className:e,classNames:t,localization:n}){const{localization:r,redirectTo:o,replace:a,toast:c}=u.useContext(ae),s=u.useMemo(()=>({...r,...n}),[r,n]),{data:l}=Li(),[i,h]=u.useState(null);return u.useEffect(()=>{const d=An("invitationId");if(!d){c({variant:"error",message:s.INVITATION_NOT_FOUND}),a(o);return}h(d)},[s.INVITATION_NOT_FOUND,c,a,o]),!l||!i?v.jsx(cr,{className:e,classNames:t}):v.jsx(ds,{className:e,classNames:t,localization:s,invitationId:i})}function ds({className:e,classNames:t,localization:n,invitationId:r}){var o;const{authClient:a,hooks:{useInvitation:c},localization:s,organization:l,redirectTo:i,replace:h,toast:d,localizeErrors:f}=u.useContext(ae),p=u.useMemo(()=>({...s,...n}),[s,n]),[E,_]=u.useState(!1),[R,g]=u.useState(!1),S=E||R,{data:O,isPending:A}=c({query:{id:r}}),m=u.useCallback(()=>An("redirectTo")||i,[i]);u.useEffect(()=>{if(!(A||!r)){if(!O){d({variant:"error",message:p.INVITATION_NOT_FOUND}),h(i);return}(O.status!=="pending"||new Date(O.expiresAt)<new Date)&&(d({variant:"error",message:new Date(O.expiresAt)<new Date?p.INVITATION_EXPIRED:p.INVITATION_NOT_FOUND}),h(i))}},[O,A,r,p,d,h,i]);const N=async()=>{g(!0);try{await a.organization.acceptInvitation({invitationId:r,fetchOptions:{throw:!0}}),d({variant:"success",message:p.INVITATION_ACCEPTED||"Invitation accepted"}),h(m())}catch(L){d({variant:"error",message:Be({error:L,localization:p,localizeErrors:f})}),g(!1)}},I=async()=>{_(!0);try{await a.organization.rejectInvitation({invitationId:r,fetchOptions:{throw:!0}}),d({variant:"success",message:p.INVITATION_REJECTED}),h(i)}catch(L){d({variant:"error",message:Be({error:L,localization:p,localizeErrors:f})}),_(!1)}},M=((o=[...[{role:"owner",label:p.OWNER},{role:"admin",label:p.ADMIN},{role:"member",label:p.MEMBER}],...l?.customRoles||[]].find(L=>L.role===O?.role))==null?void 0:o.label)||O?.role;return O?v.jsxs(Ge,{className:x("w-full max-w-sm",e,t?.base),children:[v.jsxs(ir,{className:x("justify-items-center text-center",t?.header),children:[v.jsx(Mi,{className:x("text-lg md:text-xl",t?.title),children:p.ACCEPT_INVITATION}),v.jsx(Ui,{className:x("text-xs md:text-sm",t?.description),children:p.ACCEPT_INVITATION_DESCRIPTION})]}),v.jsxs(sr,{className:x("flex flex-col gap-6 truncate",t?.content),children:[v.jsxs(Ge,{className:x("flex-row items-center p-4"),children:[v.jsx(lr,{organization:{id:O.organizationId,name:O.organizationName,slug:O.organizationSlug,logo:O.organizationLogo,createdAt:new Date},localization:p}),v.jsx("p",{className:"ml-auto text-muted-foreground text-sm",children:M})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[v.jsxs(_n,{variant:"outline",className:x(t?.button,t?.outlineButton),onClick:I,disabled:S,children:[E?v.jsx(Ut,{className:"animate-spin"}):v.jsx(Tr,{}),p.REJECT]}),v.jsxs(_n,{className:x(t?.button,t?.primaryButton),onClick:N,disabled:S,children:[R?v.jsx(Ut,{className:"animate-spin"}):v.jsx(Ar,{}),p.ACCEPT]})]})]})]}):v.jsx(cr,{className:e,classNames:t})}var cr=({className:e,classNames:t,localization:n})=>v.jsxs(Ge,{className:x("w-full max-w-sm",e,t?.base),children:[v.jsxs(ir,{className:x("justify-items-center",t?.header),children:[v.jsx(me,{className:x("my-1 h-5 w-full max-w-32 md:h-5.5 md:w-40",t?.skeleton)}),v.jsx(me,{className:x("my-0.5 h-3 w-full max-w-56 md:h-3.5 md:w-64",t?.skeleton)})]}),v.jsxs(sr,{className:x("flex flex-col gap-6 truncate",t?.content),children:[v.jsxs(Ge,{className:x("flex-row items-center p-4"),children:[v.jsx(lr,{isPending:!0,localization:n}),v.jsx(me,{className:"mt-0.5 ml-auto h-4 w-full max-w-14 shrink-2"})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[v.jsx(me,{className:"h-9 w-full"}),v.jsx(me,{className:"h-9 w-full"})]})]})]});function _s({children:e}){const{hooks:{useSession:t}}=u.useContext(ae),{data:n}=t();return n?e:null}export{gs as A,_s as S,hs as a,ms as s};
|
|
53
|
-
//# sourceMappingURL=index-
|
|
53
|
+
//# sourceMappingURL=index-BS5Ty3tf.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{hd as B,iZ as M,r as N,j as e,c as E,i_ as te,i6 as q,B as k,by as y,hl as z,bQ as ae,b$ as ne,bc as L,hn as ie,a7 as re,i$ as oe,cE as le,C as ce,i as w,bS as T,dg as J,j0 as Z,Z as K,$ as de,f3 as ue,j1 as me,ge,M as Q,aw as xe,H as he,n as pe,s as fe,dr as be,m as je,ds as ve,L as ke,dt as Ne,cJ as ye,i8 as C,dv as A,cv as Ce,j2 as Se,j3 as O}from"./index-DByaMzsG.js";import{A as we}from"./agent-editor-form-DlavYg2q.js";import{A as Ae,v as Le,u as De,r as Ee,s as Re}from"./custom-guardrail-edits-BUL7nmuO.js";import{T as Ge,a as Pe,b as _,c as R,d as Te,e as G}from"./table-C637cQxG.js";import{f as V}from"./agent-loading-shells-DYqQphN7.js";import{A as $e}from"./agent-permissions-matrix-C1L8IcYR.js";import{u as Be,a as H,m as Me,P as Fe,D as Ie,n as Ke,C as Oe}from"./core.esm-C9QlSrgK.js";import{u as F,s as _e,a as He,S as Ue,v as We,b as qe}from"./agent-skill-context-D1nMrVod.js";import{s as Y,a as U}from"./skill-route-key-sF006xiz.js";import{P as ze}from"./proposal-review-shell-B-jYcKfB.js";import{C as Je}from"./connector-page-shell-BFv21yuv.js";import"./definition-comparison-4UYMI6BK.js";import"./json-diff-mcDgyct_.js";import"./code-editor-mrKkAfcE.js";import"./index-Vcq4gwWv.js";import"./schema-value-zTJGE4eh.js";import"./model-selector-D3vSMLO2.js";import"./skill-editor-D_W3QlRz.js";import"./runs-C8sZQr4o.js";function $(s,t){const a=new Set(s?.guardrails??[]),n=new Set(t.map(r=>r.name)),o=t.map(r=>({name:r.name,stages:r.stages,description:r.description,enabled:a.has(r.name),unknown:!1})),i=(s?.guardrails??[]).filter(r=>!n.has(r)).map(r=>({name:r,stages:[],enabled:!0,unknown:!0}));return[...o,...i]}function Ze(s){return s.filter(t=>t.enabled||t.unknown).map(t=>t.name)}function Qe(s,t,a){return Ze(s.map(n=>n.name===t&&!n.unknown?{...n,enabled:a}:n))}const D={input:"Input",output:"Output","pre-tool":"Pre-tool",egress:"Egress"};function Ve(s){const t=new Date(s);return Number.isNaN(t.getTime())?s:oe(t,{addSuffix:!0})}function Ye({owner:s,agentId:t,name:a}){const{data:n}=B(t),{data:o}=M(t),i=N.useMemo(()=>$(n,o??[]).find(d=>d.name===a)??null,[n,o,a]),r=(n?.guardrailsInline??[]).find(d=>d.name===a);return r?e.jsx(es,{owner:s,agentId:t,guardrail:r}):i?e.jsx(Xe,{agentId:t,name:a,row:i}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Guardrail not found."})}function Xe({agentId:s,name:t,row:a}){return e.jsxs("div",{className:"space-y-8",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:a.description??(a.stages.length>0?`Built-in. Short-circuits this agent's ${a.stages.map(n=>D[n].toLowerCase()).join(", ")} stage${a.stages.length>1?"s":""} when it matches.`:"Configured out of band — toggling is managed via lobu apply.")}),e.jsx(X,{agentId:s,guardrail:t})]})}function es({owner:s,agentId:t,guardrail:a}){const n=E(),{data:o}=B(t),{data:i}=M(t),{data:r=null}=te(t),d=q(t),[f,m]=N.useState(!1),x=o?.guardrailsInline??[],h=(i??[]).map(u=>u.name),b=async(u,c)=>{if(!o)return y.error("Still loading agent settings — try again in a moment"),!1;try{return await d.mutateAsync({guardrailsInline:u}),y.success(c),!0}catch(g){return y.error(g instanceof Error?g.message:"Failed to save guardrail"),!1}},p=async u=>{const c=Le(u,x,h,r,a.name);if(c){y.error(c);return}await b(De(x,a.name,u),"Guardrail saved")&&u.name.trim()!==a.name&&n({to:"/$owner/agents/$agentId",params:{owner:s,agentId:t},search:l=>({...l,guardrail:u.name.trim()}),resetScroll:!1})},j=async()=>{await b(Ee(x,a.name),"Guardrail deleted")&&n({to:"/$owner/agents/$agentId",params:{owner:s,agentId:t},search:c=>({...c,guardrail:void 0}),resetScroll:!1})};return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:a.kind==="require-tool"?"Required tools":"Policy"}),e.jsx(Ae,{initial:a,judgeModelDefault:r,submitLabel:"Save changes",submitting:d.isPending,onSubmit:p})]}),e.jsx("div",{className:"flex justify-end",children:f?e.jsxs("div",{className:"flex gap-2",children:[e.jsx(k,{type:"button",variant:"destructive",onClick:()=>void j(),disabled:d.isPending,children:"Delete guardrail"}),e.jsx(k,{type:"button",variant:"outline",onClick:()=>m(!1),disabled:d.isPending,children:"Cancel"})]}):e.jsxs(k,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>m(!0),children:["Delete ",a.name]})}),e.jsx(X,{agentId:t,guardrail:a.name})]})}function X({agentId:s,guardrail:t}){const{data:a=[],isLoading:n,isError:o}=z(s,{guardrail:t});return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Recent catches"}),n?e.jsx(ae,{label:"catches",variant:"table",rows:4}):o?e.jsx(ne,{label:"catches"}):a.length===0?e.jsx(L,{icon:ie,title:"No catches yet",description:"This guardrail hasn't short-circuited anything on this agent."}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:e.jsxs(Ge,{children:[e.jsx(Pe,{children:e.jsxs(_,{children:[e.jsx(R,{className:"w-[180px]",children:"When"}),e.jsx(R,{className:"w-[120px]",children:"Stage"}),e.jsx(R,{children:"Reason"})]})}),e.jsx(Te,{children:a.map(i=>e.jsxs(_,{children:[e.jsx(G,{className:"text-xs text-muted-foreground",title:i.occurredAt,children:Ve(i.occurredAt)}),e.jsx(G,{children:e.jsx(re,{variant:"outline",className:"text-[10px]",children:D[i.stage]})}),e.jsx(G,{className:"text-sm text-muted-foreground",children:i.reason??e.jsx("span",{className:"italic",children:"no reason recorded"})})]},i.id))})]})})]})}function I({description:s,action:t}){return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("p",{className:"min-w-0 flex-1 text-sm text-muted-foreground",children:s}),t?e.jsx("div",{className:"shrink-0",children:t}):null]})}function W(s,t){return s.get(t)??0}function ss(s,t,a){const n=s.map(i=>{const r=i.stages.map(d=>D[d]);return i.unknown&&r.push("Unknown"),{id:i.name,name:i.name,kind:"builtin",description:i.description,stages:i.stages,enabled:i.enabled,unknown:i.unknown,badges:r,tripCount:W(a,i.name)}}),o=t.map(i=>{const r=[D[i.stage],"Custom"];return{id:i.name,name:i.name,kind:"custom",description:i.policy,stages:[i.stage],enabled:i.enabled,unknown:!1,badges:r,tripCount:W(a,i.name)}});return[...n,...o]}function ee({enabled:s,name:t,expanded:a,onToggleEnabled:n,toggleDisabled:o,onToggle:i}){return e.jsxs("div",{className:"flex shrink-0 items-center gap-2 self-center",children:[e.jsx(le,{checked:s,onCheckedChange:n,disabled:o,"aria-label":s?`Disable ${t}`:`Enable ${t}`}),e.jsx("button",{type:"button",onClick:i,"aria-label":a?"Collapse":"Expand",className:"text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(ce,{className:w("h-4 w-4 transition-transform",a&&"rotate-90")})})]})}function ts({owner:s,agentId:t,expandedName:a}){const n=E(),{data:o,isLoading:i}=B(t),{data:r,isLoading:d}=M(t),{data:f=[]}=z(t),m=q(t),x=async(c,g)=>{if(!o){y.error("Still loading agent settings — try again in a moment");return}try{if(c.kind==="custom")await m.mutateAsync({guardrailsInline:Re(o.guardrailsInline??[],c.name,g)});else{const l=$(o,r??[]);await m.mutateAsync({guardrails:Qe(l,c.name,g)})}y.success(g?"Guardrail enabled":"Guardrail disabled")}catch(l){y.error(l instanceof Error?l.message:"Failed to save guardrail")}},h=r===null,b=N.useMemo(()=>{const c=$(o,r??[]),g=o?.guardrailsInline??[],l=new Map;for(const v of f)l.set(v.guardrailName,(l.get(v.guardrailName)??0)+1);return ss(c,g,l)},[o,r,f]),p=c=>{n({to:"/$owner/agents/$agentId",params:{owner:s,agentId:t},search:g=>({...g,guardrail:c===a?void 0:c}),resetScroll:!1})},j=()=>{n({to:"/$owner/agents/$agentId/guardrails/create",params:{owner:s,agentId:t}})},u=i||d;return!u&&b.length===0?e.jsx("div",{className:"space-y-6",children:h?e.jsx(L,{icon:T,title:"Guardrails catalog unavailable",description:"Guardrails will appear here once the gateway publishes its catalog.",actionLabel:"New guardrail",onAction:j}):e.jsx(L,{icon:T,title:"No guardrails yet",description:"Enable a built-in in lobu.toml or write a custom policy guardrail.",actionLabel:"New guardrail",onAction:j})}):e.jsxs("div",{className:"space-y-6",children:[e.jsx(I,{description:"Each guardrail short-circuits this agent's input, output, or tool-call stages. Built-ins are toggle-only; add a custom guardrail to judge messages against a policy you write.",action:u?void 0:e.jsxs(k,{type:"button",onClick:j,children:[e.jsx(J,{className:"mr-1.5 h-4 w-4"}),"New guardrail"]})}),u?e.jsx(V,{rows:3}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:b.map((c,g)=>{const l=c.name===a;return e.jsx(as,{card:c,expanded:l,isLast:g===b.length-1,onToggle:()=>p(c.name),onToggleEnabled:v=>void x(c,v),toggleDisabled:c.unknown||m.isPending,children:l?e.jsx(Ye,{owner:s,agentId:t,name:c.name}):null},c.id)})})]})}function as({card:s,expanded:t,isLast:a,onToggle:n,onToggleEnabled:o,toggleDisabled:i,children:r}){return e.jsxs("div",{className:w("bg-background",!a||t?"border-b":""),children:[e.jsxs("div",{className:"flex items-stretch gap-1 pr-3",children:[e.jsxs("button",{type:"button",onClick:n,"aria-expanded":t,className:w("flex min-w-0 flex-1 items-center gap-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",!s.enabled&&!s.unknown&&!t&&"opacity-70"),children:[e.jsx(T,{className:"ml-2 h-4 w-4 shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx("span",{className:w("truncate text-sm text-foreground",s.unknown&&"font-mono text-xs"),children:s.name}),s.kind==="custom"&&s.description?e.jsx("p",{className:"line-clamp-1 text-xs text-muted-foreground",children:s.description}):e.jsx("p",{className:"text-xs text-muted-foreground",children:s.tripCount>0?`${s.tripCount} recent ${s.tripCount===1?"catch":"catches"}`:"No recent catches"}),e.jsx(Z,{badges:s.badges})]})]}),e.jsx(ee,{enabled:s.enabled,name:s.name,expanded:t,onToggleEnabled:o,toggleDisabled:i,onToggle:n})]}),t&&r?e.jsx("div",{className:"border-t border-border px-4 py-4",children:r}):null]})}function ns({row:s}){const{isSaving:t,updateSkillRow:a}=F(),n=s.system===!0;return e.jsx("div",{className:"space-y-6",children:n?e.jsx("p",{className:"text-sm text-muted-foreground",children:"System skill metadata is managed by Lobu. You can enable or disable it and change its position in the skill list."}):e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(K,{htmlFor:"skill-name",children:"Name"}),e.jsx(de,{id:"skill-name",value:s.name,onChange:o=>a(s.repo,{name:o.target.value}),disabled:t})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(K,{htmlFor:"skill-instructions",children:"Instructions"}),e.jsx(ue,{id:"skill-instructions",value:s.instructions??"",onChange:o=>{const i=o.target.value;a(s.repo,{instructions:i,content:i.trim()||s.name})},rows:4,disabled:t})]})]})})}function is({owner:s,agentId:t,skillKey:a}){const n=E(),[o,i]=N.useState(!1),r=Y(a),{skillRows:d,catalog:f,isSaving:m,saveSkills:x,removeSkillAndSave:h,addSkillFromCatalog:b}=F(),p=d.find(g=>g.repo===r)??null,j=f?.catalog.find(g=>g.repo===r);N.useEffect(()=>{!p&&j&&b(r)},[b,j,r,p]);const u=async()=>{await h(r)&&(i(!1),n({to:"/$owner/agents/$agentId",params:{owner:s,agentId:t},search:l=>({...l,skill:void 0}),resetScroll:!1}))};if(!p)return j?null:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Skill not found."});const c=!p.system;return e.jsxs("div",{className:"space-y-6",children:[e.jsx(ns,{row:p}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-end",children:[c?o?e.jsxs(e.Fragment,{children:[e.jsx(k,{type:"button",variant:"destructive",onClick:()=>void u(),disabled:m,children:m?"Removing...":"Remove skill"}),e.jsx(k,{type:"button",variant:"outline",onClick:()=>i(!1),disabled:m,children:"Cancel"})]}):e.jsxs(k,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>i(!0),disabled:m,children:["Remove ",p.name]}):null,e.jsx(k,{type:"button",onClick:()=>void x(),disabled:m||o,children:m?"Saving...":"Save changes"})]})]})}function rs(s){return s.map(t=>{const a=_e(t).map(String);return{id:t.repo,repo:t.repo,name:t.name,description:t.description,badges:a,enabled:t.enabled}})}const P="Skills bundle instructions, tools, and knowledge an agent can reuse. Add one from the catalog or write your own; drag to set which the agent reaches for first.";function os({owner:s,agentId:t,expandedRepo:a}){const n=E(),{skillRows:o,catalog:i,isLoading:r,isSaving:d,reorderSkills:f,setSkillEnabledAndSave:m,addSkillFromCatalog:x}=F();N.useEffect(()=>{a&&(o.some(l=>l.repo===a)||i?.catalog.some(l=>l.repo===a)&&x(a))},[a,o,i,x]);const h=N.useMemo(()=>rs(o),[o]),b=N.useMemo(()=>h.map(l=>l.repo),[h]),p=Be(H(Fe,{activationConstraint:{distance:8}}),H(Me,{coordinateGetter:He})),j=()=>{n({to:"/$owner/agents/$agentId/skills/create",params:{owner:s,agentId:t}})},u=e.jsxs(k,{type:"button",onClick:j,children:[e.jsx(J,{className:"mr-1.5 h-4 w-4"}),"Add skill"]}),c=l=>{n({to:"/$owner/agents/$agentId",params:{owner:s,agentId:t},search:v=>({...v,skill:l===a?void 0:U(l)}),resetScroll:!1})},g=l=>{const{active:v,over:S}=l;!S||v.id===S.id||f(String(v.id),String(S.id))};return r?e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:P}),e.jsx(V,{rows:2})]}):h.length===0?e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:P}),e.jsx(L,{icon:me,title:"No skills yet",description:"Add a system skill from the catalog or create a custom skill for this agent.",actionLabel:"Add skill",onAction:j})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(I,{description:P,action:u}),e.jsx(Ie,{sensors:p,collisionDetection:Ke,onDragEnd:g,children:e.jsx(Ue,{items:b,strategy:We,children:e.jsx("div",{className:"overflow-hidden rounded-lg border",children:h.map((l,v)=>{const S=l.repo===a;return e.jsx(ls,{card:l,rank:v+1,disabled:d,expanded:S,isLast:v===h.length-1,onToggle:()=>c(l.repo),onToggleEnabled:se=>void m(l.repo,se),toggleDisabled:d,children:S?e.jsx(is,{owner:s,agentId:t,skillKey:U(l.repo)}):null},l.id)})})})})]})}function ls({card:s,rank:t,disabled:a,expanded:n,isLast:o,onToggle:i,onToggleEnabled:r,toggleDisabled:d,children:f}){const m=a||n,{attributes:x,listeners:h,setNodeRef:b,transform:p,transition:j,isDragging:u}=qe({id:s.repo,disabled:m}),c={transform:Oe.Transform.toString(p),transition:j};return e.jsxs("div",{ref:b,style:c,className:w("bg-background",!o||n?"border-b":"",u&&"z-10 bg-card opacity-80 "),children:[e.jsxs("div",{className:"flex items-stretch gap-1 pr-3",children:[e.jsx("button",{type:"button",className:"flex shrink-0 cursor-grab touch-none items-center px-2 text-muted-foreground hover:text-foreground active:cursor-grabbing disabled:cursor-not-allowed disabled:opacity-50","aria-label":`Reorder ${s.name}`,disabled:m,...x,...h,children:e.jsx(ge,{className:"h-4 w-4"})}),e.jsxs("button",{type:"button",className:w("flex min-w-0 flex-1 items-center gap-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",!s.enabled&&!n&&"opacity-70"),onClick:i,"aria-expanded":n,children:[e.jsx("span",{className:"w-4 shrink-0 text-center text-xs tabular-nums text-muted-foreground",children:t}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:s.name}),s.description?e.jsx("p",{className:"line-clamp-1 text-xs text-muted-foreground",children:s.description}):null,e.jsx(Z,{badges:s.badges})]})]}),e.jsx(ee,{enabled:s.enabled,name:s.name,expanded:n,onToggleEnabled:r,toggleDisabled:d,onToggle:i})]}),n&&f?e.jsx("div",{className:"border-t border-border px-4 py-4",children:f}):null]})}function cs(){return 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(Ce,{className:"h-4 w-4"})})}function ds({agentId:s}){const[t,a]=N.useState(!1),n=Se(s);return e.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border border-destructive/30 p-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Deleting removes this agent and its configuration from the workspace."}),t?e.jsxs("div",{className:"flex shrink-0 gap-2",children:[e.jsx(k,{type:"button",variant:"destructive",onClick:()=>n.mutate(),disabled:n.isPending,children:n.isPending?"Deleting...":"Delete agent"}),e.jsx(k,{type:"button",variant:"outline",onClick:()=>a(!1),disabled:n.isPending,children:"Cancel"})]}):e.jsx(k,{type:"button",variant:"outline",className:"shrink-0 text-destructive hover:text-destructive",onClick:()=>a(!0),children:"Delete agent"})]})}function us({owner:s,agent:t,runId:a,expandedSkill:n,expandedGuardrail:o}){const{orgContext:i}=Q(),{isAdmin:r}=ye(i.organizationId),{agentId:d}=t;return e.jsxs(e.Fragment,{children:[e.jsx(ze,{resource:{kind:"agent",agentId:d},runId:a,children:({reviewMode:f,proposal:m,controlsDisabled:x})=>e.jsx(we,{mode:{kind:"edit",agent:t},reviewMode:f,reviewProposal:m,reviewControlsDisabled:x},d)}),e.jsx(C,{id:"skills",title:"Skills",children:e.jsx(os,{owner:s,agentId:d,expandedRepo:n?Y(n):void 0})}),e.jsx(C,{id:"guardrails",title:"Guardrails",children:e.jsx(ts,{owner:s,agentId:d,expandedName:o})}),r?e.jsx(C,{id:"permissions",title:"Permissions",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(I,{description:"Control which data, agent settings, and connector actions this agent may use automatically, with approval, or not at all."}),e.jsx("div",{className:"overflow-x-auto",children:e.jsx($e,{owner:s,agentId:d})})]})}):null,a?null:e.jsx(ds,{agentId:d})]})}function ms(){return e.jsxs(e.Fragment,{children:[e.jsx(C,{title:"Settings",children:e.jsx(A,{rows:6})}),e.jsx(C,{title:"Models",children:e.jsx(A,{rows:2})}),e.jsx(C,{title:"Skills",children:e.jsx(A,{rows:2})}),e.jsx(C,{title:"Guardrails",children:e.jsx(A,{rows:2})})]})}function gs({owner:s,agentId:t,runId:a,expandedSkill:n,expandedGuardrail:o}){const{orgContext:i,hasOrgContext:r}=Q(),{isLoading:d}=xe(`/${s}`,i),{isAuthenticated:f}=he(),{isMember:m,isLoading:x}=pe(),h=f&&m,{data:b=[],isLoading:p}=fe({enabled:h}),u=(h?!r||d||p||x:d||x)?null:b.find(c=>c.agentId===t)??null;return e.jsx(Je,{header:e.jsx(be,{breadcrumb:e.jsx(ve,{crumbs:[e.jsx(ke,{to:"/$owner",params:{owner:s},search:{section:"agent"},className:Ne,children:"Agents"},"agents")]}),icon:e.jsx(cs,{}),title:u?u.name:e.jsx(je,{className:"h-6 w-40"}),caption:u?.description||void 0}),children:u?e.jsx(us,{owner:s,agent:u,runId:a,expandedSkill:n,expandedGuardrail:o}):e.jsx(ms,{})})}function Ps(){const{owner:s,agentId:t}=O.useParams(),{run_id:a,skill:n,guardrail:o}=O.useSearch();return e.jsx(gs,{owner:s,agentId:t,runId:a,expandedSkill:n,expandedGuardrail:o})}export{Ps as component};
|
|
2
|
+
//# sourceMappingURL=index-C38OzBpB.js.map
|