@inkeep/open-knowledge 0.79.7-beta.0 → 0.79.7-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +6 -6
- package/dist/constants-C-oO9k3g.mjs +1 -0
- package/dist/index.mjs +1 -1
- package/dist/{init-B0SGcorG.mjs → init-0aHVguPF.mjs} +2 -2
- package/dist/init-MI5n1QT3.mjs +1 -0
- package/dist/{launch-json-removal-Cr-DYX7w.mjs → launch-json-removal-fhuDhC0b.mjs} +1 -1
- package/dist/loader-BQmfqBig.mjs +1 -0
- package/dist/{loader-DXE3A1f_.mjs → loader-Jq1y_vM1.mjs} +1 -1
- package/dist/{preview-DIr9-6Qy.mjs → preview-QNlYLP0L.mjs} +1 -1
- package/dist/preview-jWmllR7c.mjs +1 -0
- package/dist/public/assets/{AddPropertiesButton-DuAEj_yV.js → AddPropertiesButton-DzZJSDcj.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-Vhn4Kjqo.js → AgentDiffPane-C_J2EXBI.js} +1 -1
- package/dist/public/assets/{AgentIconCluster-D5LuHNJO.js → AgentIconCluster-HlKRqN5I.js} +1 -1
- package/dist/public/assets/FeedbackForm-UIxjWgNu.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-COdPkBmu.js → ManagedArtifactProperties-C1qDczBS.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-xmz9KkCG.js +1 -0
- package/dist/public/assets/{OpenInAgentMenuItem-bGK86cMV.js → OpenInAgentMenuItem-D89q7FuT.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-B48wSj8S.js → PropertyDisplayRow-7M9rWkt3.js} +1 -1
- package/dist/public/assets/{SessionsHost-CkxNQ20D.js → SessionsHost-BhvuDK9n.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-N8dtpQFx.js → SettingsDialogBody-Uck3JVdv.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-CB9B4a1-.js → SkillInstallMenu-CkOeQ2Ai.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-DFtsQTPD.js → SkillToolbarControls-Dj7R3GkY.js} +1 -1
- package/dist/public/assets/{TerminalPanel-CmRsNKO-.js → TerminalPanel-z3y7j-D4.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-DDb2ftA2.js → TerminalWindowApp-Ctoh28BW.js} +1 -1
- package/dist/public/assets/ThreadView-BkhNLpJZ.js +24 -0
- package/dist/public/assets/{TimelineDiffPane-rvex4tDo.js → TimelineDiffPane-CSYkW8mr.js} +1 -1
- package/dist/public/assets/{agent-connection-status-DZOB3Cf4.js → agent-connection-status-Bbe4NIF_.js} +1 -1
- package/dist/public/assets/{auth-state-cache-BgoyU8tN.js → auth-state-cache-ZHMSQvEG.js} +1 -1
- package/dist/public/assets/{dropdown-menu-raSZ06x1.js → dropdown-menu-BEhl0wvu.js} +1 -1
- package/dist/public/assets/globals-Cf4IxpBt.css +1 -0
- package/dist/public/assets/index-C-SD147F.js +2205 -0
- package/dist/public/assets/{preferred-session-events-C7578rLS.js → preferred-session-events-De_KsFPj.js} +1 -1
- package/dist/public/assets/progress-C4Fet8z9.js +10 -0
- package/dist/public/assets/{uninstall-Dpv7hvKF.js → uninstall-DY48fG1z.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-DXOCXwxz.js → use-timeline-entry-diff-BpaS64rQ.js} +1 -1
- package/dist/public/index.html +13 -13
- package/dist/public/uninstall.html +3 -3
- package/dist/{registry-probes-BauhGsVQ.mjs → registry-probes-BmpKdaC9.mjs} +1 -1
- package/dist/{removal-file-path-BgvdUaCg.mjs → removal-file-path-CDX7S2WT.mjs} +1 -1
- package/dist/{repair-launch-json-CRqTjn8N.mjs → repair-launch-json-DiJm7tG6.mjs} +1 -1
- package/dist/{repair-mcp-configs-WZGWmcxe.mjs → repair-mcp-configs-CNWqh6hj.mjs} +1 -1
- package/dist/src-BFc8Vkrp.mjs +1 -0
- package/dist/{src-CRw9jMgg.mjs → src-CxpXA3IW.mjs} +1 -1
- package/dist/{start-BxOT8qfs.mjs → start-BhX-dp0_.mjs} +2 -2
- package/dist/start-mq5fIgxQ.mjs +1 -0
- package/package.json +4 -4
- package/dist/constants-B0uUoaJY.mjs +0 -1
- package/dist/init-CfWJMuan.mjs +0 -1
- package/dist/loader-Csy_24kd.mjs +0 -1
- package/dist/preview-GkaZCMI-.mjs +0 -1
- package/dist/public/assets/FeedbackForm-DCgnnGws.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-CkAUcvoQ.js +0 -1
- package/dist/public/assets/ThreadView-CnrkDGDG.js +0 -24
- package/dist/public/assets/globals-Dg-24adS.css +0 -1
- package/dist/public/assets/index-C8TnJ96J.js +0 -2205
- package/dist/public/assets/progress-CrdCluk1.js +0 -10
- package/dist/src-rxzxM-9c.mjs +0 -1
- package/dist/start-D0-XL6JS.mjs +0 -1
- /package/dist/public/assets/{globals-BXFJsup3.js → globals-DZgD7JHR.js} +0 -0
package/dist/public/assets/{SettingsDialogBody-N8dtpQFx.js → SettingsDialogBody-Uck3JVdv.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{B as r,O as i,at as a,dt as o,hi as s,lt as c,st as l,ut as u,xr as d,z as f}from"./DocumentContext-iWAOyWo0.js";import{t as p}from"./react-f2sANaYj.js";import{n as m,r as h}from"./dist-Nvb76hAm.js";import{t as g}from"./useQuery-ZeEDLtxh.js";import{n as _}from"./dist-PQ5KMVDh.js";import{t as v}from"./react-dom-DPxgxlDT.js";import{t as y}from"./compiler-runtime-BfE3aGVn.js";import{t as b}from"./utils-CPqDy6Hr.js";import{n as x,r as S,t as C}from"./AgentIconCluster-D5LuHNJO.js";import{t as w}from"./button-BeFNZANd.js";import{i as T,n as E,r as D,t as O}from"./tooltip-DVBVVaAs.js";import{n as k,r as A,t as j}from"./collapsible-DYySK8La.js";import{a as M,c as N,i as P,l as F,n as I,o as L,r as R,s as z,t as B}from"./alert-dialog-CqqfqWNT.js";import{n as V,t as H}from"./with-selector-PRoyWQiu.js";import{t as U}from"./checkbox-BZdMjUlq.js";import{A as W,C as G,D as K,E as ee,O as te,S as q,T as J,_ as Y,b as ne,f as re,g as ie,h as ae,j as oe,k as se,m as ce,p as le,r as ue,v as de,w as fe,x as pe,y as me}from"./floating-ui.dom-CDtYEnEj.js";import{c as he,d as ge,l as _e,o as ve,s as ye,u as be}from"./dist-DYso7MCm.js";import{t as xe}from"./label-D-K3fWtj.js";import{i as Se,n as Ce,o as we,s as Te,t as Ee}from"./select-D_BhUvh8.js";import{n as De,t as Oe}from"./radio-group-npdxiS6E.js";import{t as ke}from"./switch-iwBsEWej.js";import{n as Ae,r as je,t as Me}from"./toggle-group-BxIyZnUJ.js";import{a as Ne,c as Pe,d as Fe,f as Ie,g as Le,h as Re,i as ze,l as Be,s as Ve,t as He,u as Ue,y as We}from"./RegisteredAgentIcon-COLTpZlS.js";import{a as Ge,i as Ke,o as qe}from"./terminal-telemetry-Bo0-Yp4s.js";import{$c as Je,$o as Ye,As as Xe,Bo as Ze,Bs as Qe,Cc as $e,Cn as et,Cs as tt,Dc as nt,Ec as rt,Es as it,Gs as at,Hn as ot,Ho as st,Hs as ct,Io as lt,Ko as ut,Lo as dt,Ms as ft,Ns as pt,Oc as mt,Ot as ht,Qo as gt,Rc as _t,Ro as vt,Sc as yt,Ss as bt,Tc as xt,Ts as St,Uo as Ct,Vc as wt,Vo as Tt,Wc as Et,Xo as Dt,Yn as Ot,Zo as kt,as as At,ds as jt,es as Mt,gs as Nt,jr as Pt,js as Ft,kc as It,ks as Lt,ls as Rt,mi as zt,mt as Bt,ns as Vt,os as Ht,ot as Ut,pt as Wt,ss as Gt,ts as Kt,ui as qt,us as Jt,va as Yt,vc as Xt,wn as Zt,ws as Qt,xi as $t,ys as en}from"./dist-BS18tPvg.js";import{t as tn}from"./trace-api-BP9dN1Hz.js";import{n as X}from"./dist-CJhtNlOm2.js";import{d as nn,f as rn,h as an,n as on,o as sn,p as cn,r as ln,u as un,v as dn}from"./use-settings-route--nlw92BG.js";import{t as fn}from"./dist-Cr4-nBVI.js";import{c as pn}from"./documents-events-CJhE88yE.js";import{a as mn,i as hn,o as gn}from"./local-menu-action-bus-DaoT7_kL.js";import{a as _n,i as vn,t as yn}from"./use-apply-config-theme-B5w38X1P.js";import{t as bn}from"./OpenInAgentMenuItem-bGK86cMV.js";import{t as xn}from"./createLucideIcon-B6ULg5PN.js";import{a as Sn,c as Cn,f as wn,l as Tn,p as En,s as Dn,t as On}from"./EnableSyncConfirmDialog-B4Eq35CQ.js";import{p as kn}from"./Mermaid-BG4D_HOk.js";import{t as An}from"./arrow-up-right-B3B9a7te.js";import{t as jn}from"./check-BzfGb3KU.js";import{t as Mn}from"./chevron-right-C-g4JuT4.js";import{n as Nn,t as Pn}from"./lint-plugin-meta-zA9wHIBR.js";import{t as Fn}from"./circle-alert-Czw40trT.js";import{i as In,r as Ln}from"./prop-types-DasLWSYV.js";import{a as Rn,h as zn,r as Bn,t as Vn}from"./dropdown-menu-raSZ06x1.js";import{A as Hn,B as Un,C as Wn,F as Gn,G as Kn,H as qn,J as Jn,K as Yn,L as Xn,M as Zn,N as Qn,O as $n,P as er,Q as tr,R as nr,S as rr,U as ir,V as ar,W as or,Y as sr,at as cr,b as lr,c as ur,d as dr,et as fr,f as pr,h as mr,i as hr,j as gr,k as _r,l as vr,m as yr,n as br,nt as xr,o as Sr,p as Cr,q as wr,v as Tr,w as Er,x as Dr,y as Or}from"./auth-state-cache-BgoyU8tN.js";import{g as kr,h as Ar,p as jr}from"./SkillInstallMenu-CB9B4a1-.js";import{It as Mr}from"./CodeMirrorPropInput-Tn1no_ym.js";import{r as Nr,t as Pr}from"./use-git-sync-status-OS-MtdFB.js";import{o as Fr}from"./folder-config-api-BTtUsUJc.js";import{t as Ir}from"./info-Bem3FDH_.js";import{t as Lr}from"./spinner-D7ppCG-D.js";import{n as Rr,r as zr,t as Br}from"./ThemePicker-Dkq_b6uC.js";import{t as Vr}from"./rotate-ccw-BeKroAIS.js";import{t as Hr}from"./square-pen-C1BBBLlZ.js";import{t as Ur}from"./terminal-D89Kc5tD.js";import{t as Wr}from"./trash-2-CYyUeKpx.js";import{t as Gr}from"./triangle-alert--Fl5KoVX.js";import{t as Kr}from"./x-BcfoD9-8.js";import{d as qr}from"./doc-paths-wf1Zwihi.js";import{a as Jr}from"./startup-marks-JBqTw7J_.js";import{n as Yr}from"./config-provider-B75KsU34.js";import{a as Xr}from"./skill-scope-BkSXs9Lm.js";import{a as Zr,c as Qr,i as $r,n as ei,o as ti,r as ni,s as ri,t as ii}from"./dialog-BfHNtxM9.js";import{m as ai}from"./skills-api-Cvk5ZT2-.js";import{t as oi}from"./input-B87iFAAQ.js";import{a as si,i as ci,t as li}from"./popover-Cy1VhL3a.js";import{_ as ui,a as di,d as fi,f as pi,g as mi,h as hi,m as gi,p as _i,u as vi,v as yi,y as bi}from"./css-color-to-hex-CceC2fgU.js";import{n as xi}from"./use-apply-config-language-CsFHXy7e.js";import{t as Si}from"./external-link-CHXmlzco.js";import{t as Ci}from"./badge-lmgHBfMn.js";import{t as wi}from"./tool-list-format-C9KSFYHU.js";import{i as Ti,o as Ei,r as Di,t as Oi}from"./field-BLH6hVAa.js";import{t as ki}from"./ConfigSharingInfoTooltip-DJhEv6QQ.js";import{t as Ai}from"./use-skills--ee80y05.js";import{o as ji,s as Mi,t as Ni}from"./use-open-skill-BoyleT3C.js";import{r as Pi,t as Fi}from"./DeleteConfirmationDialog-DQ_i0S6n.js";import{t as Ii}from"./skeleton-DscvcfA0.js";import{d as Li,n as Ri,r as zi,t as Bi,u as Vi}from"./lint-config-client-BrKjdAjt.js";import{_ as Hi,a as Ui,d as Wi,f as Gi,g as Ki,h as qi,i as Ji,o as Yi,s as Xi,t as Zi,u as Qi}from"./sortable.esm-BwLsMP2r.js";import{t as $i}from"./textarea-DVoGSfK8.js";import{i as ea,n as ta,t as na}from"./input-group-Brp49uT-.js";import{a as ra,f as ia,i as aa,n as oa,o as sa,p as ca,r as la,s as ua,t as da}from"./form--KmzMeAQ.js";import{r as fa,t as pa}from"./terminal-command-events-LkibGwt_.js";import{t as ma}from"./tag-pill-input-Kw1eRXQ5.js";import{t as ha}from"./markdownlint-rule-browser-Cv--E2sT.js";import{n as ga}from"./schema-fields-view-intent-Dwms69SB.js";import{n as _a,t as va}from"./use-terminal-enabled-DDGp3D4I.js";import{_ as ya,a as ba,c as xa,d as Sa,f as Ca,g as wa,h as Ta,i as Ea,l as Da,m as Oa,n as ka,o as Aa,p as ja,r as Ma,s as Na,t as Pa,u as Fa,v as Ia}from"./agent-connection-status-DZOB3Cf4.js";var La=xn(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),Ra=xn(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),za=xn(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),Ba=xn(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Z=e(p(),1),Q=y(),$=n();function Va(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Ci,{variant:`gray`,children:(0,$.jsx)(m,{id:`YBt9YP`})}),e[0]=t):t=e[0],t}function Ha(e){let t=(0,Q.c)(10),{scope:n}=e,r=`settings-scope-badge-${n}`,i;t[0]===n?i=t[1]:(i=n===`user`?(0,$.jsx)(m,{id:`7PzzBU`}):n===`project-local`?(0,$.jsx)(m,{id:`ImTzPZ`}):(0,$.jsx)(m,{id:`e0NrBM`}),t[0]=n,t[1]=i);let a;t[2]!==r||t[3]!==i?(a=(0,$.jsx)(T,{asChild:!0,children:(0,$.jsx)(Ci,{variant:`gray`,tabIndex:0,className:`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,"data-testid":r,children:i})}),t[2]=r,t[3]=i,t[4]=a):a=t[4];let o;t[5]===n?o=t[6]:(o=(0,$.jsx)(E,{children:n===`user`?(0,$.jsx)(m,{id:`cFSbbh`}):n===`project-local`?(0,$.jsx)(m,{id:`YlwI5F`}):(0,$.jsx)(m,{id:`ebqMh6`})}),t[5]=n,t[6]=o);let s;return t[7]!==a||t[8]!==o?(s=(0,$.jsx)(D,{children:(0,$.jsxs)(O,{children:[a,o]})}),t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function Ua(e){let t=(0,Q.c)(27),{titleId:n,title:r,scope:i,level:a,beta:o,adornment:s,docUrl:c,children:l}=e,u=a===void 0?`page`:a,{_:d}=h(),f=u===`page`?`h3`:`h4`,p=u===`page`?`text-lg`:`text-base`,g;t[0]===p?g=t[1]:(g=b(`font-semibold`,p),t[0]=p,t[1]=g);let _;t[2]!==f||t[3]!==g||t[4]!==r||t[5]!==n?(_=(0,$.jsx)(f,{id:n,className:g,children:r}),t[2]=f,t[3]=g,t[4]=r,t[5]=n,t[6]=_):_=t[6];let v;t[7]===o?v=t[8]:(v=o?(0,$.jsx)(Va,{}):null,t[7]=o,t[8]=v);let y;t[9]===i?y=t[10]:(y=i?(0,$.jsx)(Ha,{scope:i}):null,t[9]=i,t[10]=y);let x;t[11]!==s||t[12]!==_||t[13]!==v||t[14]!==y?(x=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_,s,v,y]}),t[11]=s,t[12]=_,t[13]=v,t[14]=y,t[15]=x):x=t[15];let S;t[16]===l?S=t[17]:(S=l?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:l}):null,t[16]=l,t[17]=S);let C;t[18]!==d||t[19]!==c||t[20]!==r||t[21]!==n?(C=c===void 0?null:(0,$.jsxs)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>Si(e,c),onAuxClick:e=>Si(e,c),"aria-label":d(typeof r==`string`?{id:`Li4U-T`,values:{title:r}}:{id:`zwWKhA`}),className:`inline-flex items-center gap-0.5 text-sm text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,"data-testid":`${n}-docs-link`,children:[(0,$.jsx)(m,{id:`zwWKhA`}),(0,$.jsx)(An,{"aria-hidden":!0,className:`size-3`})]}),t[18]=d,t[19]=c,t[20]=r,t[21]=n,t[22]=C):C=t[22];let w;return t[23]!==x||t[24]!==S||t[25]!==C?(w=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[x,S,C]}),t[23]=x,t[24]=S,t[25]=C,t[26]=w):w=t[26],w}var Wa=`settings-sharing-title`;function Ga(){let e=(0,Q.c)(1),t=(typeof window<`u`?window.okDesktop:void 0)?.sharing,n;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=t===void 0?(0,$.jsx)(Ka,{}):(0,$.jsx)(qa,{}),e[0]=n):n=e[0],n}function Ka(){let e=(0,Q.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(m,{id:`cs4mps`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`section`,{"aria-labelledby":Wa,className:`space-y-3`,"data-field":`section:sharing`,children:(0,$.jsx)(Ua,{titleId:Wa,title:t,scope:`project`,level:`block`,children:(0,$.jsx)(m,{id:`7YRrJ9`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{})}})})}),e[1]=n):n=e[1],n}function qa(){let e=(0,Q.c)(29),{_:t}=h(),[n,r]=(0,Z.useState)(null),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c;e[0]===t?c=e[1]:(c=async function(){let e=window.okDesktop?.sharing;if(e)try{r(await e.status())}catch(e){let n=e;X.error(n instanceof Error?n.message:t({id:`K0N7zS`})),r(Ya)}},e[0]=t,e[1]=c);let l=c,u;e[2]===l?u=e[3]:(u=()=>{l()},e[2]=l,e[3]=u);let d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=[],e[4]=d):d=e[4],(0,Z.useEffect)(u,d);let f;e[5]!==t||e[6]!==i||e[7]!==l||e[8]!==n?(f=async function(e){let r=window.okDesktop?.sharing;if(!r||n===null||i||n.mode===e)return;a(!0),s(null);let o=null,c=null;try{o=await r.setMode(e)}catch(e){c=e}if(a(!1),c!==null){X.error(c instanceof Error?c.message:t({id:`qZv5ZR`}));return}o!==null&&(o.kind===`refused-tracked`?(s({tracked:o.tracked,remediation:o.remediation}),X.error(t({id:`z2JdQ-`}),{duration:5e3})):o.kind===`no-exclude`?X.warning(o.reason===`no-git`?t({id:`YSFv5w`}):t({id:`8cS0nH`,values:{0:o.reason}})):X.success(t(e===`local-only`?{id:`wdzBgi`}:{id:`k_pade`})),await l())},e[5]=t,e[6]=i,e[7]=l,e[8]=n,e[9]=f):f=e[9];let p=f;if(n===null){let t;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Ua,{titleId:Wa,title:(0,$.jsx)(m,{id:`cs4mps`}),scope:`project`,level:`block`}),e[10]=t):t=e[10];let n;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`section`,{"aria-labelledby":Wa,className:`space-y-3`,"data-field":`section:sharing`,children:[t,(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(m,{id:`eQn7nI`})}),(0,$.jsx)(Ii,{className:`h-24`})]})]}),e[11]=n):n=e[11],n}let g=n.mode===`no-git`,_;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(m,{id:`cs4mps`}),e[12]=_):_=e[12];let v;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(Ua,{titleId:Wa,title:_,scope:`project`,level:`block`,adornment:(0,$.jsx)(ki,{}),children:(0,$.jsx)(m,{id:`N55YNr`})}),e[13]=v):v=e[13];let y;e[14]!==i||e[15]!==g||e[16]!==p||e[17]!==n.mode?(y=g?(0,$.jsx)(`p`,{className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,role:`status`,"data-testid":`settings-sharing-no-git`,children:(0,$.jsx)(m,{id:`ju38ms`})}):(0,$.jsxs)(Oe,{value:n.mode,onValueChange:e=>void p(e),disabled:i,className:`gap-2`,"aria-labelledby":Wa,"data-testid":`settings-sharing-radiogroup`,children:[(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-local-only`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(De,{id:`settings-sharing-local-only`,value:`local-only`,"data-testid":`settings-sharing-local-only`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(m,{id:`QjzFZj`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`un-K1H`})})]})]}),(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-shared`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(De,{id:`settings-sharing-shared`,value:`shared`,"data-testid":`settings-sharing-shared`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(m,{id:`0Gd0NU`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`dJw2_7`})})]})]})]}),e[14]=i,e[15]=g,e[16]=p,e[17]=n.mode,e[18]=y):y=e[18];let b;e[19]===o?b=e[20]:(b=o===null?null:(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm`,role:`alert`,"data-testid":`settings-sharing-refusal`,children:[(0,$.jsx)(`p`,{className:`font-semibold`,children:(0,$.jsx)(m,{id:`ZscwQ0`})}),(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-relaxed`,children:o.remediation}),(0,$.jsx)(w,{variant:`outline`,size:`sm`,onClick:()=>s(null),children:(0,$.jsx)(m,{id:`1QfxQT`})})]}),e[19]=o,e[20]=b);let x;e[21]!==o||e[22]!==n.mode||e[23]!==n.trackedUpstream?(x=n.trackedUpstream.length>0&&n.mode!==`no-git`&&o===null?(0,$.jsxs)(`div`,{className:`space-y-1 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-tracked-info`,children:[(0,$.jsx)(`p`,{className:`font-medium`,children:(0,$.jsx)(m,{id:`LhWYpm`})}),(0,$.jsx)(`ul`,{className:`list-disc pl-5 font-mono text-xs text-muted-foreground`,children:n.trackedUpstream.map(Ja)}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`1XSMhZ`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]}):null,e[21]=o,e[22]=n.mode,e[23]=n.trackedUpstream,e[24]=x):x=e[24];let S;return e[25]!==y||e[26]!==b||e[27]!==x?(S=(0,$.jsxs)(`section`,{"aria-labelledby":Wa,className:`space-y-4`,"data-testid":`settings-sharing`,"data-field":`section:sharing`,children:[v,y,b,x]}),e[25]=y,e[26]=b,e[27]=x,e[28]=S):S=e[28],S}function Ja(e){return(0,$.jsx)(`li`,{children:e},e)}function Ya(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[]}}var Xa=`[a-z0-9](?:[a-z0-9-]*[a-z0-9])?`,Za=RegExp(`^${Xa}(?:\\.${Xa})*$`),Qa=/^[a-z][a-z0-9+.-]*:\/\//i;function $a(e){if(Qa.test(e))try{return new URL(e).host}catch{return null}let t=e.split(`/`)[0]??``;return t.slice(t.lastIndexOf(`@`)+1).replace(/:(?!\d+$).*$/,``)}function eo(e,t){let n=e.trim();if(n===``)return{ok:!1,reason:`empty`};let r=$a(n);if(r===null||r===``)return{ok:!1,reason:`invalid`};let i=Qt(r);return Za.test(i)?i===`github.com`?{ok:!1,reason:`github-com`}:t.has(i)?{ok:!1,reason:`duplicate`}:{ok:!0,host:i}:{ok:!1,reason:`invalid`}}function to(e){let t=e.git?.hosts??{};return Object.entries(t).filter(([,e])=>e?.provider===`github`).map(([e])=>e).sort((e,t)=>e.localeCompare(t))}function no(e){let t=(0,Q.c)(59),{binding:n}=e,{_:r}=h(),i=(0,Z.useId)(),a=(0,Z.useId)(),o;t[0]===n?o=t[1]:(o=()=>to(n.current()),t[0]=n,t[1]=o);let[s,c]=(0,Z.useState)(o),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(null),[p,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(null),y;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=new Map,t[2]=y):y=t[2];let b=(0,Z.useRef)(y),x=(0,Z.useRef)(null),S,C;t[3]===_?(S=t[4],C=t[5]):(S=()=>{_!==null&&(((_.host===null?null:b.current.get(_.host))??x.current)?.focus(),v(null))},C=[_],t[3]=_,t[4]=S,t[5]=C),(0,Z.useEffect)(S,C);let T,E;t[6]===n?(T=t[7],E=t[8]):(T=()=>n.subscribe(e=>c(to(e))),E=[n],t[6]=n,t[7]=T,t[8]=E),(0,Z.useEffect)(T,E);let D;t[9]===r?D=t[10]:(D=function(e){switch(e){case`empty`:return r({id:`cFONFy`});case`invalid`:return r({id:`QsnBxE`});case`github-com`:return r({id:`UK3GW4`});case`duplicate`:return r({id:`DEkRZA`})}},t[9]=r,t[10]=D);let O=D,k;t[11]!==n||t[12]!==l||t[13]!==s||t[14]!==O?(k=function(e){e.preventDefault();let t=eo(l,new Set(s.map(ro)));if(!t.ok){f(O(t.reason));return}let r=n.patch({git:{hosts:{[t.host]:{provider:`github`}}}});if(!r.ok){f(jt(r.error));return}c(to(r.effective)),u(``),f(null),g(!0)},t[11]=n,t[12]=l,t[13]=s,t[14]=O,t[15]=k):k=t[15];let A=k,j;t[16]!==n||t[17]!==s?(j=function(e){let t=s.indexOf(e),r=s[t+1]??s[t-1]??null,i=n.patch({git:{hosts:{[e]:null}}});if(!i.ok){f(jt(i.error));return}c(to(i.effective)),v({host:r}),f(null),g(!0)},t[16]=n,t[17]=s,t[18]=j):j=t[18];let M=j,N;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(`h4`,{id:`settings-enterprise-hosts-title`,className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`J2-D_a`})}),t[19]=N):N=t[19];let P;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(m,{id:`PgY2nN`}),t[20]=P):P=t[20];let F;t[21]===i?F=t[22]:(F=(0,$.jsxs)(`div`,{children:[N,(0,$.jsx)(`p`,{id:i,className:`text-1sm text-muted-foreground`,children:P})]}),t[21]=i,t[22]=F);let I;t[23]!==r||t[24]!==M||t[25]!==s?(I=s.length>0?(0,$.jsx)(`ul`,{className:`space-y-1`,"data-testid":`settings-enterprise-hosts-list`,children:s.map(e=>(0,$.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs`,children:e}),(0,$.jsx)(w,{variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":r({id:`xVMoYb`,values:{host:e}}),ref:t=>{t?b.current.set(e,t):b.current.delete(e)},onClick:()=>M(e),children:(0,$.jsx)(Wr,{"aria-hidden":`true`})})]},e))}):(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-enterprise-hosts-empty`,children:(0,$.jsx)(m,{id:`HK2eIK`})}),t[23]=r,t[24]=M,t[25]=s,t[26]=I):I=t[26];let L;t[27]===r?L=t[28]:(L=r({id:`Qbf7Q4`}),t[27]=r,t[28]=L);let R=d!==null,z=d===null?i:`${i} ${a}`,B;t[29]===d?B=t[30]:(B=e=>{u(e.target.value),d!==null&&f(null)},t[29]=d,t[30]=B);let V;t[31]!==l||t[32]!==L||t[33]!==R||t[34]!==z||t[35]!==B?(V=(0,$.jsx)(oi,{ref:x,value:l,"aria-label":L,placeholder:`github.example.com`,autoComplete:`off`,spellCheck:!1,inputMode:`url`,className:`h-7 flex-1 font-mono text-xs`,"aria-invalid":R,"aria-describedby":z,onChange:B}),t[31]=l,t[32]=L,t[33]=R,t[34]=z,t[35]=B,t[36]=V):V=t[36];let H;t[37]===l?H=t[38]:(H=l.trim(),t[37]=l,t[38]=H);let U=H===``,W;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(m,{id:`ALFlyF`}),t[39]=W):W=t[39];let G;t[40]===U?G=t[41]:(G=(0,$.jsx)(w,{type:`submit`,size:`sm`,variant:`secondary`,disabled:U,className:`h-7 px-2 font-normal text-xs`,children:W}),t[40]=U,t[41]=G);let K;t[42]!==A||t[43]!==V||t[44]!==G?(K=(0,$.jsxs)(`form`,{className:`flex items-center gap-2 pt-1`,onSubmit:A,noValidate:!0,children:[V,G]}),t[42]=A,t[43]=V,t[44]=G,t[45]=K):K=t[45];let ee;t[46]!==d||t[47]!==a?(ee=d===null?null:(0,$.jsx)(`p`,{id:a,role:`alert`,className:`text-1sm text-destructive`,children:d}),t[46]=d,t[47]=a,t[48]=ee):ee=t[48];let te;t[49]===p?te=t[50]:(te=p?(0,$.jsx)(`p`,{role:`status`,className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`3LuFP-`})}):null,t[49]=p,t[50]=te);let q;t[51]!==I||t[52]!==K||t[53]!==ee||t[54]!==te?(q=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-lg border bg-card p-3`,children:[I,K,ee,te]}),t[51]=I,t[52]=K,t[53]=ee,t[54]=te,t[55]=q):q=t[55];let J;return t[56]!==F||t[57]!==q?(J=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-enterprise-hosts-title`,className:`space-y-4 pt-5`,"data-field":`section:enterprise-hosts`,"data-testid":`settings-enterprise-hosts`,children:[F,q]}),t[56]=F,t[57]=q,t[58]=J):J=t[58],J}function ro(e){return Qt(e)}function io(e){let t=(0,Q.c)(38),{authQueryTransport:n,authTransport:r,userBinding:i}=e,{_:a}=h(),o;t[0]===n?o=t[1]:(o=n??tr(),t[0]=n,t[1]=o);let s=o,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c={phase:`loading`},t[2]=c):c=t[2];let[l,u]=(0,Z.useState)(c),[d,f]=(0,Z.useState)(!1),[p,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(null),y=(0,Z.useRef)(!1),b;t[3]===s?b=t[4]:(b=async function(){u({phase:`loading`});try{let e=await s.status();u({phase:`loaded`,result:e}),br(e)}catch(e){console.warn(`[AccountSection] GitHub status check failed`,e),u({phase:`check-failed`})}},t[3]=s,t[4]=b);let x=b,S;t[5]===x?S=t[6]:(S=()=>{x()},t[5]=x,t[6]=S);let C;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(C=[],t[7]=C):C=t[7],(0,Z.useEffect)(S,C);let T;t[8]!==a||t[9]!==x||t[10]!==s?(T=async function(){if(y.current)return;y.current=!0,f(!1),g(!0),v(null);let e=null;try{let t=s.signout?await s.signout():{ok:!1,error:a({id:`8cpOa8`})};t.ok||(e=t.error??a({id:`8cpOa8`}))}catch(t){console.warn(`[AccountSection] GitHub disconnect failed`,t),e=a({id:`8cpOa8`})}await x(),e&&v(e),g(!1),y.current=!1},t[8]=a,t[9]=x,t[10]=s,t[11]=T):T=t[11];let E=T,D;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(m,{id:`AeXO77`}),t[12]=D):D=t[12];let O;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(Ua,{titleId:`settings-account-title`,title:D,scope:`user`,children:(0,$.jsx)(m,{id:`E6lrpp`})}),t[13]=O):O=t[13];let k;t[14]!==_||t[15]!==p||t[16]!==E||t[17]!==x||t[18]!==l.phase||t[19]!==l.result?(k=l.phase===`loading`?(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-loading`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(m,{id:`IWGfGF`})}),(0,$.jsx)(Ii,{className:`h-4 w-40`}),(0,$.jsx)(Ii,{className:`h-8 w-32`})]}):l.phase===`check-failed`?(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-check-failed`,children:[(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`T_wG4n`})}),(0,$.jsx)(w,{variant:`outline`,size:`sm`,onClick:()=>void x(),children:(0,$.jsx)(m,{id:`KDw4GX`})})]}):l.result.authenticated?l.result.tier===`A`?(0,$.jsx)(oo,{login:l.result.login}):(0,$.jsx)(ao,{login:l.result.login,disconnecting:p,error:_,onDisconnect:()=>void E()}):l.result.unsupportedOrigin===void 0?(0,$.jsx)(co,{onConnect:()=>f(!0)}):(0,$.jsx)(so,{host:l.result.unsupportedOrigin.host}),t[14]=_,t[15]=p,t[16]=E,t[17]=x,t[18]=l.phase,t[19]=l.result,t[20]=k):k=t[20];let A;t[21]===i?A=t[22]:(A=(0,$.jsx)(no,{binding:i}),t[21]=i,t[22]=A);let j;t[23]===x?j=t[24]:(j=e=>{f(e),e||x()},t[23]=x,t[24]=j);let M=l.phase===`loaded`?l.result.host:void 0,N=l.phase===`loaded`?l.result.ghAvailable:void 0,P;t[25]===x?P=t[26]:(P=()=>{x()},t[25]=x,t[26]=P);let F;t[27]!==d||t[28]!==r||t[29]!==j||t[30]!==M||t[31]!==N||t[32]!==P?(F=(0,$.jsx)(sr,{open:d,onOpenChange:j,transport:r,host:M,ghAvailable:N,onSuccess:P}),t[27]=d,t[28]=r,t[29]=j,t[30]=M,t[31]=N,t[32]=P,t[33]=F):F=t[33];let I;return t[34]!==A||t[35]!==F||t[36]!==k?(I=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-3`,"data-testid":`settings-account`,children:[O,k,A,F]}),t[34]=A,t[35]=F,t[36]=k,t[37]=I):I=t[37],I}function ao(e){let t=(0,Q.c)(20),{login:n,disconnecting:r,error:i,onDisconnect:a}=e,o;t[0]===n?o=t[1]:(o=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(m,{id:`nxlOpL`})}),t[2]=s):s=t[2];let c;t[3]===o?c=t[4]:(c=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[o,s]}),t[3]=o,t[4]=c);let l;t[5]===r?l=t[6]:(l=r?(0,$.jsx)(m,{id:`rppgXF`}):(0,$.jsx)(m,{id:`-K0AvT`}),t[5]=r,t[6]=l);let u;t[7]!==r||t[8]!==a||t[9]!==l?(u=(0,$.jsx)(w,{variant:`outline`,onClick:a,disabled:r,"aria-describedby":`settings-account-disconnect-caveat`,"data-testid":`settings-account-disconnect`,children:l}),t[7]=r,t[8]=a,t[9]=l,t[10]=u):u=t[10];let d;t[11]!==c||t[12]!==u?(d=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[c,u]}),t[11]=c,t[12]=u,t[13]=d):d=t[13];let f;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`p`,{id:`settings-account-disconnect-caveat`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-account-disconnect-caveat`,children:(0,$.jsx)(m,{id:`msOK6I`})}),t[14]=f):f=t[14];let p;t[15]===i?p=t[16]:(p=i?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-account-disconnect-error`,children:i}):null,t[15]=i,t[16]=p);let h;return t[17]!==d||t[18]!==p?(h=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-connected`,children:[d,f,p]}),t[17]=d,t[18]=p,t[19]=h):h=t[19],h}function oo(e){let t=(0,Q.c)(5),{login:n}=e,r;t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(m,{id:`ny6vNn`})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-gh-cli`,children:(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[r,i]})}),t[3]=r,t[4]=a),a}function so(e){let t=(0,Q.c)(3),{host:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`xBjIs7`})}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,$.jsxs)(`div`,{role:`status`,className:`space-y-1 rounded-md border p-3`,"data-testid":`settings-account-unsupported-origin`,children:[r,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:n===null?(0,$.jsx)(m,{id:`XBpH6-`}):(0,$.jsx)(m,{id:`7_I248`,values:{host:n}})})]}),t[1]=n,t[2]=i),i}function co(e){let t=(0,Q.c)(5),{onConnect:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`S33tz3`})}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[r,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(m,{id:`EJuO7B`})})]}),t[1]=i):i=t[1];let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(m,{id:`5lWFkC`}),t[2]=a):a=t[2];let o;return t[3]===n?o=t[4]:(o=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-disconnected`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[i,(0,$.jsx)(w,{onClick:n,"data-testid":`settings-account-connect`,children:a})]})}),t[3]=n,t[4]=o),o}function lo(e){if(e===void 0)return null;let t=e.params?.agent;if(typeof t!=`string`)return null;let n=Je[t]??t;return e.id===`followup.enable-manually`?fn._({id:`followup.enable-manually`,values:{agent:n}}):null}function uo(e){let{enabled:t,installedCount:n,presence:r,configurable:i,setupDocSlug:a,installUrl:o}=e,s=n>0,c=r===`absent`,l=()=>a===null?{kind:`none`}:{kind:`setup-doc`,slug:a};return c?o==null||o===``?l():{kind:`install`,url:o}:i?t?s?{kind:`manage`}:{kind:`connect`}:s?{kind:`remove`}:{kind:`none`}:s?{kind:`remove`}:l()}function fo(e){return e.presence===`absent`&&e.installedCount>0}function po(e){let t=(0,Q.c)(32),{icon:n,name:r,hint:i,status:a,action:o,checked:s,disabled:c,ariaLabel:l,testId:u,rowTestId:d,statusId:f,onToggle:p}=e,m=i?`${d}-hint`:void 0,h;t[0]===n?h=t[1]:(h=(0,$.jsx)(`span`,{className:`flex h-5 shrink-0 items-center`,children:n}),t[0]=n,t[1]=h);let g;t[2]===r?g=t[3]:(g=(0,$.jsx)(`span`,{className:`truncate text-sm leading-5`,children:r}),t[2]=r,t[3]=g);let _;t[4]!==i||t[5]!==m?(_=i?(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,$.jsx)(`span`,{id:m,className:`truncate text-muted-foreground text-1sm`,children:i.text}),i.action]}):null,t[4]=i,t[5]=m,t[6]=_):_=t[6];let v;t[7]!==a||t[8]!==f?(v=a?(0,$.jsx)(`span`,{id:f,children:a}):null,t[7]=a,t[8]=f,t[9]=v):v=t[9];let y;t[10]!==g||t[11]!==_||t[12]!==v?(y=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[g,_,v]}),t[10]=g,t[11]=_,t[12]=v,t[13]=y):y=t[13];let b;t[14]!==h||t[15]!==y?(b=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2.5`,children:[h,y]}),t[14]=h,t[15]=y,t[16]=b):b=t[16];let x;t[17]!==l||t[18]!==s||t[19]!==c||t[20]!==m||t[21]!==p||t[22]!==f||t[23]!==u?(x=p===void 0?null:(0,$.jsx)(ke,{checked:s??!1,disabled:c,onCheckedChange:p,"aria-label":l,"aria-describedby":[m,f].filter(Boolean).join(` `)||void 0,"data-testid":u}),t[17]=l,t[18]=s,t[19]=c,t[20]=m,t[21]=p,t[22]=f,t[23]=u,t[24]=x):x=t[24];let S;t[25]!==o||t[26]!==x?(S=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[o,x]}),t[25]=o,t[26]=x,t[27]=S):S=t[27];let C;return t[28]!==d||t[29]!==b||t[30]!==S?(C=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,"data-testid":d,children:[b,S]}),t[28]=d,t[29]=b,t[30]=S,t[31]=C):C=t[31],C}function mo(e,t){return e===`absent`&&!t}function ho(e){let t=(0,Q.c)(15),{label:n,labelIcon:r,subtitle:i,children:a,labelId:o}=e,s;t[0]!==n||t[1]!==r||t[2]!==o?(s=(0,$.jsxs)(`h4`,{id:o,tabIndex:-1,className:`flex items-center gap-1.5 font-mono text-muted-foreground text-xs uppercase tracking-wide`,children:[n,r]}),t[0]=n,t[1]=r,t[2]=o,t[3]=s):s=t[3];let c;t[4]===i?c=t[5]:(c=i?(0,$.jsx)(`p`,{className:`mt-1 text-muted-foreground text-xs`,children:i}):null,t[4]=i,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,$.jsxs)(`div`,{className:`mb-2`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]===a?u=t[10]:(u=(0,$.jsx)(`div`,{className:`divide-y overflow-hidden rounded-md border`,children:a}),t[9]=a,t[10]=u);let d;return t[11]!==o||t[12]!==l||t[13]!==u?(d=(0,$.jsxs)(`section`,{"aria-labelledby":o,children:[l,u]}),t[11]=o,t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function go(e){if(e)return()=>{e.ownerDocument.activeElement===e&&ya(e)?.focus()}}function _o(e){let t=(0,Q.c)(9),{hiddenCount:n,expanded:r,onToggle:i,testId:a}=e,{_:o}=h();if(n<=0)return null;let s;t[0]!==o||t[1]!==r||t[2]!==n?(s=o(r?{id:`6lGV3K`}:{id:`INN7OX`,values:{hiddenCount:n}}),t[0]=o,t[1]=r,t[2]=n,t[3]=s):s=t[3];let c;return t[4]!==r||t[5]!==i||t[6]!==s||t[7]!==a?(c=(0,$.jsx)(w,{ref:go,type:`button`,variant:`ghost`,onClick:i,"aria-expanded":r,className:`w-full justify-center rounded-none font-normal text-1sm text-muted-foreground`,"data-testid":a,children:s}),t[4]=r,t[5]=i,t[6]=s,t[7]=a,t[8]=c):c=t[8],c}function vo(e){let t=(0,Q.c)(10),{status:n,enabled:r}=e,{_:i}=h();if(n===`connected`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(jn,{"aria-hidden":!0,className:`size-3.5`}),t[0]=e):e=t[0];let n;t[1]===i?n=t[2]:(n=i({id:`QHcLEN`}),t[1]=i,t[2]=n);let r;return t[3]===n?r=t[4]:(r=(0,$.jsxs)(`span`,{className:`mt-0.5 inline-flex items-center gap-1 text-muted-foreground text-xs`,children:[e,n]}),t[3]=n,t[4]=r),r}if(n===`not-connected`&&r){let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Gr,{"aria-hidden":!0,className:`size-3.5`}),t[5]=e):e=t[5];let n;t[6]===i?n=t[7]:(n=i({id:`S33tz3`}),t[6]=i,t[7]=n);let r;return t[8]===n?r=t[9]:(r=(0,$.jsxs)(`span`,{className:`mt-0.5 inline-flex items-center gap-1 text-amber-700 text-xs dark:text-amber-400`,children:[e,n]}),t[8]=n,t[9]=r),r}return null}function yo(e){let t=(0,Q.c)(52),{action:n,rowLabel:r,describedById:i,onConfigure:a,onRemove:o}=e,{_:s}=h();switch(n.kind){case`none`:return null;case`install`:{let e=n.url,a;t[0]!==s||t[1]!==r?(a=s({id:`wfZwqe`,values:{rowLabel:r}}),t[0]=s,t[1]=r,t[2]=a):a=t[2];let o;t[3]===s?o=t[4]:(o=s({id:`TKQ7K-`}),t[3]=s,t[4]=o);let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(An,{"aria-hidden":!0}),t[5]=c):c=t[5];let l;return t[6]!==n.url||t[7]!==i||t[8]!==a||t[9]!==o?(l=(0,$.jsx)(w,{variant:`link`,size:`sm`,className:`shrink-0 text-muted-foreground hover:text-foreground`,asChild:!0,children:(0,$.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,"aria-label":a,"aria-describedby":i,children:[o,c]})}),t[6]=n.url,t[7]=i,t[8]=a,t[9]=o,t[10]=l):l=t[10],l}case`setup-doc`:{let e=`https://openknowledge.ai/docs/integrations/${n.slug}`,a;t[11]!==s||t[12]!==r?(a=s({id:`Kuw5NN`,values:{rowLabel:r}}),t[11]=s,t[12]=r,t[13]=a):a=t[13];let o;t[14]===s?o=t[15]:(o=s({id:`P_bX4O`}),t[14]=s,t[15]=o);let c;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(An,{"aria-hidden":!0}),t[16]=c):c=t[16];let l;return t[17]!==i||t[18]!==e||t[19]!==a||t[20]!==o?(l=(0,$.jsx)(w,{variant:`link`,size:`sm`,className:`shrink-0 text-muted-foreground hover:text-foreground`,asChild:!0,children:(0,$.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,"aria-label":a,"aria-describedby":i,children:[o,c]})}),t[17]=i,t[18]=e,t[19]=a,t[20]=o,t[21]=l):l=t[21],l}case`connect`:{let e;t[22]!==s||t[23]!==r?(e=s({id:`_uxBz5`,values:{rowLabel:r}}),t[22]=s,t[23]=r,t[24]=e):e=t[24];let n;t[25]===s?n=t[26]:(n=s({id:`q63KUv`}),t[25]=s,t[26]=n);let o;return t[27]!==i||t[28]!==a||t[29]!==e||t[30]!==n?(o=(0,$.jsx)(w,{size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:a,"aria-label":e,"aria-describedby":i,children:n}),t[27]=i,t[28]=a,t[29]=e,t[30]=n,t[31]=o):o=t[31],o}case`manage`:{let e;t[32]!==s||t[33]!==r?(e=s({id:`wSBXaS`,values:{rowLabel:r}}),t[32]=s,t[33]=r,t[34]=e):e=t[34];let n;t[35]===s?n=t[36]:(n=s({id:`wckWOP`}),t[35]=s,t[36]=n);let o;return t[37]!==i||t[38]!==a||t[39]!==e||t[40]!==n?(o=(0,$.jsx)(w,{variant:`outline`,size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:a,"aria-label":e,"aria-describedby":i,children:n}),t[37]=i,t[38]=a,t[39]=e,t[40]=n,t[41]=o):o=t[41],o}case`remove`:{let e;t[42]!==s||t[43]!==r?(e=s({id:`vRlzx-`,values:{rowLabel:r}}),t[42]=s,t[43]=r,t[44]=e):e=t[44];let n;t[45]===s?n=t[46]:(n=s({id:`t_YqKh`}),t[45]=s,t[46]=n);let a;return t[47]!==i||t[48]!==o||t[49]!==e||t[50]!==n?(a=(0,$.jsx)(w,{variant:`outline`,size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:o,"aria-label":e,"aria-describedby":i,children:n}),t[47]=i,t[48]=o,t[49]=e,t[50]=n,t[51]=a):a=t[51],a}}}function bo(e){let t=(0,Q.c)(9),{rowLabel:n,onRemove:r}=e,{_:i}=h(),a;t[0]!==i||t[1]!==n?(a=i({id:`vRlzx-`,values:{rowLabel:n}}),t[0]=i,t[1]=n,t[2]=a):a=t[2];let o;t[3]===i?o=t[4]:(o=i({id:`t_YqKh`}),t[3]=i,t[4]=o);let s;return t[5]!==r||t[6]!==a||t[7]!==o?(s=(0,$.jsx)(w,{type:`button`,variant:`link-muted`,className:`h-auto p-0 text-1sm underline underline-offset-4 hover:text-destructive`,onClick:r,"aria-label":a,children:o}),t[5]=r,t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function xo(e){return e===void 0?null:yt[e].external?.installUrl??null}function So(e){return e!==null&&Object.values(e.probes.satisfiers).some(e=>e!==void 0&&e.state!==`unprobed`)}function Co(e){return`${e.source}:${e.id}`}function wo(e,t,n){let r=t.has(Co(n)),i=qe(n);return Ne(e,n.source,n.id,r||i,n.supported)}function To(e,t,n){return n.harness!==void 0&&Ge(n)===0||wo(e,t,n)}function Eo(e,t,n){let r=new Set(n.map(e=>Co(e))),i=e=>To(t,r,e),a=[...e].sort((e,t)=>Number(i(t))-Number(i(e))||e.name.localeCompare(t.name));return{primaryKeys:new Set(a.filter(i).map(Co)),ranks:new Map(a.map((e,t)=>[Co(e),t]))}}function Do(e,t,n,r){let i=t.filter(t=>!e.ranks.has(Co(t)));if(i.length===0)return e;let a=new Set(r.map(e=>Co(e))),o=e=>To(n,a,e),s=i.filter(o).sort((e,t)=>e.name.localeCompare(t.name)),c=i.filter(e=>!o(e)).sort((e,t)=>e.name.localeCompare(t.name)),l=[...e.ranks.entries()].sort(([,e],[,t])=>e-t).map(([e])=>e),u=l.filter(t=>e.primaryKeys.has(t)),d=l.filter(t=>!e.primaryKeys.has(t)),f=[...u,...s.map(Co),...d,...c.map(Co)];return{primaryKeys:new Set([...e.primaryKeys,...s.map(Co)]),ranks:new Map(f.map((e,t)=>[e,t]))}}function Oo(e){let t=(0,Q.c)(124),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{applyConnections:r}=n,i=r===void 0?Ia:r,{_:a}=h(),o=Ie(),s=We(),{states:c,refresh:l}=kr(),u=Ar(),[d,f]=(0,Z.useState)(``),[p,m]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(!1),[y,b]=(0,Z.useState)(!1),[x,S]=(0,Z.useState)(null),[C,T]=(0,Z.useState)(!1),[E,D]=(0,Z.useState)(!1),[O,k]=(0,Z.useState)(0),[A,j]=(0,Z.useState)(null),[M,N]=(0,Z.useState)(null),P=(0,Z.useRef)(null),F=(0,Z.useRef)(0),I;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(I={queryKey:[`acp-catalog`],queryFn:Ro,staleTime:3e5},t[2]=I):I=t[2];let L=g(I),R;t[3]!==L.data||t[4]!==o||t[5]!==s?(R=()=>L.data===void 0?null:Eo(L.data.agents,o,s),t[3]=L.data,t[4]=o,t[5]=s,t[6]=R):R=t[6];let[z,B]=(0,Z.useState)(R),V=z??Eo([],o,s);if(L.data!==void 0){let e;t[7]!==L.data.agents||t[8]!==z||t[9]!==o||t[10]!==s?(e=z===null?Eo(L.data.agents,o,s):Do(z,L.data.agents,o,s),t[7]=L.data.agents,t[8]=z,t[9]=o,t[10]=s,t[11]=e):e=t[11];let n=e;n!==z&&B(n),V=n}let H;t[12]===l?H=t[13]:(H=()=>{l()},t[12]=l,t[13]=H);let U=(0,Z.useEffectEvent)(H),W;t[14]===U?W=t[15]:(W=()=>{U()},t[14]=U,t[15]=W);let G;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(G=[],t[16]=G):G=t[16],(0,Z.useEffect)(W,G);let K;t[17]===i?K=t[18]:(K=()=>{let e=!0,t=F.current+=1;return i([]).then(n=>{!e||F.current!==t||(n.snapshot!==null&&S(n.snapshot),T(!So(n.snapshot)),D(n.unavailable===!0))}).catch(()=>{e&&F.current===t&&T(!0)}),()=>{e=!1}},t[17]=i,t[18]=K);let ee;t[19]!==i||t[20]!==O?(ee=[i,O],t[19]=i,t[20]=O,t[21]=ee):ee=t[21],(0,Z.useEffect)(K,ee);let te=L.data?.agents,q=new Set(s.map(Lo)),J;t[22]===u?.installedClis?J=t[23]:(J=u?.installedClis??{},t[22]=u?.installedClis,t[23]=J);let Y=J,ne=x===null?[]:Fa(x),re=ne.find(e=>e.id===A)??null,ie=ne.find(e=>e.id===M)??null,ae;t[24]===i?ae=t[25]:(ae=async function(e){let t=await i(e);return F.current+=1,t.snapshot!==null&&S(t.snapshot),T(!So(t.snapshot)),t.unavailable===!0&&D(!0),t},t[24]=i,t[25]=ae);let oe=ae,se;t[26]===x?se=t[27]:(se=function(e,t){return t===!1?`absent`:t===!0?`present`:e===void 0?`unknown`:Ea(e,x,t)},t[26]=x,t[27]=se);let ce=se,le;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(le=new Set(rt.map(It).filter(Io)),t[28]=le):le=t[28];let ue=le,de;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(de=new Set(nt.map(Fo).filter(Po)),t[29]=de):de=t[29];let fe=de,pe;t[30]!==Y||t[31]!==ce||t[32]!==c?(pe=function(e,t){if(t===`terminal`){let t=yt[e].external?.targetId;return t===void 0?`unknown`:ce(e,c[t]?.installed??null)}let n=rt.find(t=>It(t)===e);return n===void 0?`unknown`:ce(e,Y[n]??null)},t[30]=Y,t[31]=ce,t[32]=c,t[33]=pe):pe=t[33];let me=pe,he=function(e,t,n,r,i,a,o,s){let c=e===void 0?void 0:ne.find(t=>t.id===e);if(c===void 0||e===void 0||x===null||!So(x))return{status:void 0,action:void 0,hintAction:void 0,residualFiles:!1,statusId:void 0};let l={enabled:i,installedCount:ja(Ta(c)),presence:o,configurable:Sa(c),setupDocSlug:c.row.setupDocSlug,installUrl:s===void 0?yt[e].external?.installUrl??null:s},u=uo(l),d=Ca(e)&&me(e,r)!==`absent`,f=fo(l)&&!d,p=Pa({agentId:e,mode:r,snapshot:x,detected:a}),m=p===`connected`||p===`not-connected`&&i,h=m?`${n}-status`:void 0,g=!E||u.kind===`install`||u.kind===`setup-doc`,_=c.cells.projectMcp,v=_===void 0||!Ca(e)||Ma(_.consentClass)===r?lo(ka({agentId:e,mode:r,snapshot:x,detected:a,projectMcp:_})):null;return{status:m?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(vo,{status:p,enabled:i}),v===null?null:(0,$.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground text-xs`,"data-testid":`${n}-followup`,children:v})]}):void 0,action:g?(0,$.jsx)(yo,{action:u,rowLabel:t,describedById:h,onConfigure:()=>j(e),onRemove:()=>N(e)}):void 0,hintAction:f&&!E?(0,$.jsx)(bo,{rowLabel:t,onRemove:()=>N(e)}):void 0,residualFiles:f,statusId:h}},ge;t[34]===a?ge=t[35]:(ge=function(e,t){return a(e===`not-installed`?t?{id:`06Ucfz`}:{id:`5SwVv1`}:t?{id:`V0Jk_K`}:{id:`EDD3UL`})},t[34]=a,t[35]=ge);let _e=ge,ve=function(e,t,n,r,i){if(Ue(e,r),!r||E||t===void 0||x===null)return;let a=ne.find(e=>e.id===t);a===void 0||!Sa(a)||Pa({agentId:t,mode:n,snapshot:x,detected:i})===`not-connected`&&(P.current=e,j(t))},ye;t[36]!==te||t[37]!==o||t[38]!==s?(ye=function(){te!==void 0&&B(Eo(te,o,s))},t[36]=te,t[37]=o,t[38]=s,t[39]=ye):ye=t[39];let be=ye,xe;t[40]!==d||t[41]!==be?(xe=function(e){d.trim()!==``&&e.trim()===``&&be(),f(e)},t[40]=d,t[41]=be,t[42]=xe):xe=t[42];let Se=xe,Ce;t[43]!==be||t[44]!==p?(Ce=function(){p&&be(),m(!p)},t[43]=be,t[44]=p,t[45]=Ce):Ce=t[45];let we=Ce,Te=d.trim().toLowerCase(),Ee=e=>Te===``||e.toLowerCase().includes(Te),De=(te??[]).filter(e=>Ee(e.name)),Oe;t[46]===Y?Oe=t[47]:(Oe=e=>Y[e]!==!1,t[46]=Y,t[47]=Oe);let ke=Oe,Ae;t[48]===ke?Ae=t[49]:(Ae=(e,t)=>Number(ke(t))-Number(ke(e))||xt[e].displayName.localeCompare(xt[t].displayName),t[48]=ke,t[49]=Ae);let je=rt.filter(e=>{let{displayName:t}=xt[e];return Ee(t)||Ee(a({id:`QYfQdv`,values:{displayName:t}}))||Ee(e)}).sort(Ae),Me;t[50]!==ce||t[51]!==c?(Me=e=>ce(mt(e),c[e]?.installed??null),t[50]=ce,t[51]=c,t[52]=Me):Me=t[52];let Ge=Me,Ke;t[53]===Ge?Ke=t[54]:(Ke=(e,t)=>Number(Ge(e.id)===`absent`)-Number(Ge(t.id)===`absent`),t[53]=Ge,t[54]=Ke);let Je=nt.filter(e=>{let{displayName:t}=e;return Ee(a({id:`CZBqrX`,values:{displayName:t}}))||Ee(e.id)}).sort(Ke),Ye=u!==null,Xe;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=new Set([...ue,...fe]),t[55]=Xe):Xe=t[55];let Ze=Xe,Qe=$e.filter(e=>!Ze.has(e)&&Ee(Da(e))),et=Te!==``,tt=!L.isLoading&&!L.isError,it=et&&tt&&De.length===0&&je.length===0&&Je.length===0&&Qe.length===0,at=!et||L.isLoading||L.isError||De.length>0,ot=!et||je.length>0,st=!et||Je.length>0||Qe.length>0,ct=e=>wo(o,q,e),lt=e=>V.primaryKeys.has(Co(e)),ut=e=>V.ranks.get(Co(e))??2**53-1,dt=De.filter(lt),ft=[...et||p?De:dt].sort((e,t)=>ut(e)-ut(t)||e.name.localeCompare(t.name)),pt=et?0:De.length-dt.length,ht=je.filter(ke),gt=ht.length>0&&ht.length<je.length,_t=!gt||et||_?je:ht,vt=gt&&!et?je.length-ht.length:0,bt;t[56]===Ge?bt=t[57]:(bt=e=>Ge(e.id)!==`absent`,t[56]=Ge,t[57]=bt);let St=Je.filter(bt),Ct=Qe.filter(e=>ce(e,ne.find(t=>t.id===e)?.row.detected??null)!==`absent`),wt=St.length+Ct.length,Tt=Je.length+Qe.length,Et=wt>0&&wt<Tt,Dt=!Et||et||y,Ot=Dt?Je:St,kt=Dt?Qe:Ct,At=Et&&!et?Tt-wt:0,jt=!tt||De.some(qe),Mt=Ye&&je.some(ke),Nt;t[58]===c?Nt=t[59]:(Nt=e=>c[e.id]?.installed===!0,t[58]=c,t[59]=Nt);let Pt=Je.some(Nt),Ft=at?(0,$.jsx)(ho,{label:a({id:`RXEbZy`}),labelId:`settings-configure-agents-in-app`,children:L.isLoading?(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-2 px-3 py-6 text-muted-foreground text-sm`,children:[(0,$.jsx)(Lr,{className:`size-4`,"aria-hidden":`true`}),a({id:`ucXZ0k`})]}):L.isError?(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-3 py-6 text-center text-muted-foreground text-sm`,children:[(0,$.jsx)(Ba,{className:`size-5`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:a({id:`FqGWeR`})}),(0,$.jsx)(w,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void L.refetch(),children:a({id:`6gRgw8`})})]}):(te?.length??0)===0?(0,$.jsx)(`p`,{className:`px-3 py-6 text-center text-muted-foreground text-sm`,children:a({id:`QQbwzK`})}):(0,$.jsxs)($.Fragment,{children:[ft.map(e=>{let t=Co(e),n=ct(e),r=e.supported?e.description:a({id:`5jEnaB`});return(0,$.jsx)(po,{icon:(0,$.jsx)(He,{agentId:e.id,iconUrl:e.iconUrl,className:`size-4`}),name:e.name,hint:r===void 0?void 0:{text:r},checked:n,disabled:!e.supported,ariaLabel:a({id:`FZtBeR`,values:{0:e.name}}),testId:`configure-agents-in-app-${t}`,rowTestId:`configure-agents-in-app-row-${t}`,onToggle:n=>{n?(Le({source:e.source,id:e.id,name:e.name,supported:e.supported,featured:e.featured,...e.iconUrl===void 0?{}:{iconUrl:e.iconUrl}},{makeDefault:!1}),Ue(Be(e.source,e.id),!0)):(Ue(Be(e.source,e.id),!1),Re(t,e=>Ne(o,e.source,e.id,!0,e.supported)))}},t)}),(0,$.jsx)(_o,{hiddenCount:pt,expanded:p,onToggle:we,testId:`configure-agents-in-app-show-more`})]})},`in-app`):null,Lt=ot?(0,$.jsxs)(ho,{label:a({id:`ALhMYW`}),labelId:`settings-configure-agents-terminal`,children:[_t.map(e=>{let{displayName:t}=xt[e],n=Y[e]??null,r=ce(It(e),n),i=Ve(o,e,r===`absent`),s=`configure-agents-terminal-row-${e}`,{status:c,action:l,hintAction:u,residualFiles:d,statusId:f}=he(It(e),a({id:`QYfQdv`,values:{displayName:t}}),s,`terminal`,i,n,r,xo(It(e))??xt[e].docsUrl);return(0,$.jsx)(po,{icon:(0,$.jsx)(bn,{id:Pi(e),className:`size-4`,"aria-hidden":`true`}),name:a({id:`QYfQdv`,values:{displayName:t}}),hint:r===`absent`?{text:_e(`not-installed`,d),action:u}:void 0,status:c,action:l,checked:i,disabled:mo(r,i),ariaLabel:a({id:`27TLNq`,values:{displayName:t}}),testId:`configure-agents-terminal-${e}`,rowTestId:s,statusId:f,onToggle:Ye?t=>ve(Fe(e),It(e),`terminal`,t,Y[e]??null):void 0},e)}),(0,$.jsx)(_o,{hiddenCount:vt,expanded:_,onToggle:()=>v(No),testId:`configure-agents-terminal-show-more`})]},`terminal`):null,Rt=st?(0,$.jsxs)(ho,{label:a({id:`BwKH4d`}),labelId:`settings-configure-agents-desktop`,labelIcon:(0,$.jsx)(An,{"aria-hidden":`true`,className:`size-3`}),children:[Ot.map(e=>{let t=c[e.id]?.installed??null,{displayName:n}=e,r=ze(o,e.id,t),i=ce(mt(e.id),t),s=`configure-agents-desktop-row-${e.id}`,{status:l,action:u,hintAction:d,residualFiles:f,statusId:p}=he(mt(e.id),a({id:`CZBqrX`,values:{displayName:n}}),s,`external`,r,t,i);return(0,$.jsx)(po,{icon:(0,$.jsx)(bn,{id:e.id,className:`size-4`,"aria-hidden":`true`}),name:a({id:`CZBqrX`,values:{displayName:n}}),hint:i===`absent`?{text:_e(`not-installed`,f),action:d}:void 0,status:l,action:u,checked:r,disabled:mo(i,r),ariaLabel:a({id:`cdBape`,values:{displayName:n}}),testId:`configure-agents-desktop-${e.id}`,rowTestId:s,statusId:p,onToggle:n=>ve(Pe(e.id),mt(e.id),`external`,n,t)},e.id)}),kt.map(e=>{let t=ne.find(t=>t.id===e)??null,n=t?.row.detected??null,r=Da(e),i=ce(e,n),a=`agent-connection-${e}`,o=he(e,r,a,`external`,t===null||!xa(t),n,i);return(0,$.jsx)(po,{icon:(0,$.jsx)(Aa,{agentId:e,className:`size-4 text-muted-foreground`}),name:r,hint:i===`absent`?{text:_e(`not-detected`,o.residualFiles),action:o.hintAction}:void 0,status:o.status,action:o.action,ariaLabel:r,testId:`configure-agents-unlaunchable-${e}`,rowTestId:a,statusId:o.statusId},e)}),(0,$.jsx)(_o,{hiddenCount:At,expanded:y,onToggle:()=>b(Mo),testId:`configure-agents-desktop-show-more`})]},`desktop`):null,zt=[{node:Ft,hasPresent:jt},{node:Lt,hasPresent:Mt},{node:Rt,hasPresent:Pt}].sort(jo).map(Ao),Bt;t[60]===a?Bt=t[61]:(Bt=a({id:`lBN3T6`}),t[60]=a,t[61]=Bt);let Vt;t[62]===a?Vt=t[63]:(Vt=a({id:`D4I0F9`}),t[62]=a,t[63]=Vt);let Ht;t[64]!==Bt||t[65]!==Vt?(Ht=(0,$.jsx)(Ua,{titleId:`settings-configure-agents-title`,title:Bt,children:Vt}),t[64]=Bt,t[65]=Vt,t[66]=Ht):Ht=t[66];let Ut;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(Ut=(0,$.jsx)(hn,{className:`-translate-y-1/2 absolute top-1/2 start-2.5 size-4 text-muted-foreground`,"aria-hidden":`true`}),t[67]=Ut):Ut=t[67];let Wt;t[68]===Se?Wt=t[69]:(Wt=e=>Se(e.target.value),t[68]=Se,t[69]=Wt);let Gt;t[70]===a?Gt=t[71]:(Gt=a({id:`-7s4fw`}),t[70]=a,t[71]=Gt);let Kt;t[72]===a?Kt=t[73]:(Kt=a({id:`-7s4fw`}),t[72]=a,t[73]=Kt);let qt;t[74]!==d||t[75]!==Wt||t[76]!==Gt||t[77]!==Kt?(qt=(0,$.jsxs)(`div`,{className:`relative`,children:[Ut,(0,$.jsx)(oi,{value:d,onChange:Wt,placeholder:Gt,"aria-label":Kt,className:`ps-8`,"data-testid":`configure-agents-search`})]}),t[74]=d,t[75]=Wt,t[76]=Gt,t[77]=Kt,t[78]=qt):qt=t[78];let Jt;t[79]!==a||t[80]!==E?(Jt=E?(0,$.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2 rounded-md border px-3 py-2.5 text-muted-foreground text-sm`,"data-testid":`configure-agents-read-only`,children:[(0,$.jsx)(Gr,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{children:a({id:`RD8cCw`})})]}):null,t[79]=a,t[80]=E,t[81]=Jt):Jt=t[81];let Yt;t[82]!==a||t[83]!==C?(Yt=C?(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border px-3 py-2.5 text-muted-foreground text-sm`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Ba,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{role:`status`,children:a({id:`4sE6E9`})})]}),(0,$.jsx)(w,{type:`button`,variant:`outline`,size:`sm`,className:`shrink-0`,onClick:()=>k(ko),children:a({id:`6gRgw8`})})]}):null,t[82]=a,t[83]=C,t[84]=Yt):Yt=t[84];let Xt;t[85]!==a||t[86]!==it?(Xt=it?(0,$.jsx)(`p`,{className:`py-6 text-center text-muted-foreground text-sm`,"data-testid":`configure-agents-no-results`,children:a({id:`Nay2Yr`})}):null,t[85]=a,t[86]=it,t[87]=Xt):Xt=t[87];let Zt=`configure:${A??`closed`}`,Qt;t[88]===A?Qt=t[89]:(Qt=A!==null&&Ca(A),t[88]=A,t[89]=Qt);let $t=re!==null,en;t[90]===P?en=t[91]:(en=e=>{e||(P.current!==null&&(Ue(P.current,!1),P.current=null),j(null))},t[90]=P,t[91]=en);let tn;t[92]!==oe||t[93]!==re||t[94]!==P?(tn=(e,t)=>re===null?Promise.resolve({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null}):oe(Oa(re,e,t)).then(e=>(e.ok&&(P.current=null),e)),t[92]=oe,t[93]=re,t[94]=P,t[95]=tn):tn=t[95];let X;t[96]!==re||t[97]!==Zt||t[98]!==Qt||t[99]!==$t||t[100]!==en||t[101]!==tn?(X=(0,$.jsx)(ba,{connection:re,paired:Qt,open:$t,onOpenChange:en,onSave:tn},Zt),t[96]=re,t[97]=Zt,t[98]=Qt,t[99]=$t,t[100]=en,t[101]=tn,t[102]=X):X=t[102];let nn=`remove:${M??`closed`}`,rn;t[103]===M?rn=t[104]:(rn=M!==null&&Ca(M),t[103]=M,t[104]=rn);let an=ie!==null,on;t[105]===Symbol.for(`react.memo_cache_sentinel`)?(on=e=>{e||N(null)},t[105]=on):on=t[105];let sn;t[106]!==oe||t[107]!==ie?(sn=e=>ie===null?Promise.resolve({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null}):oe(wa(ie,e===void 0?[]:e)),t[106]=oe,t[107]=ie,t[108]=sn):sn=t[108];let cn;t[109]!==ie||t[110]!==nn||t[111]!==rn||t[112]!==an||t[113]!==sn?(cn=(0,$.jsx)(Na,{connection:ie,paired:rn,open:an,onOpenChange:on,onRemove:sn},nn),t[109]=ie,t[110]=nn,t[111]=rn,t[112]=an,t[113]=sn,t[114]=cn):cn=t[114];let ln;return t[115]!==zt||t[116]!==Ht||t[117]!==qt||t[118]!==Jt||t[119]!==Yt||t[120]!==Xt||t[121]!==X||t[122]!==cn?(ln=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-configure-agents-title`,className:`space-y-6`,"data-field":`section:agent-connections`,"data-testid":`settings-configure-agents`,children:[Ht,qt,Jt,Yt,Xt,zt,X,cn]}),t[115]=zt,t[116]=Ht,t[117]=qt,t[118]=Jt,t[119]=Yt,t[120]=Xt,t[121]=X,t[122]=cn,t[123]=ln):ln=t[123],ln}function ko(e){return e+1}function Ao(e){return e.node}function jo(e,t){return Number(t.hasPresent)-Number(e.hasPresent)}function Mo(e){return!e}function No(e){return!e}function Po(e){return e!==void 0}function Fo(e){return mt(e.id)}function Io(e){return e!==void 0}function Lo(e){return Co(e)}function Ro(e){let{signal:t}=e;return Ke(t)}var zo=`open-knowledge-app`;function Bo({from:e,to:t}){try{tn.getTracer(zo).startSpan(`ok.language.preferenceChanged`,{attributes:{"ok.language.from":e,"ok.language.to":t}}).end()}catch(e){console.warn(`[language-telemetry] span emit failed:`,e instanceof Error?e:String(e))}}var Vo=`open-knowledge-app`;function Ho(e){let t=e.light.startsWith(`saved-`),n=e.dark.startsWith(`saved-`);return!t||!n?`incomplete`:e.light===e.dark?`same`:`different`}function Uo(e){try{tn.getTracer(Vo).startSpan(`ok.saved_themes.assignment`,{attributes:{"saved_theme.pair":Ho(e)}}).end()}catch(e){console.warn(`[saved-theme-telemetry] assignment span emit failed:`,e instanceof Error?e:String(e))}}var Wo=`system`;function Go(e){return typeof e==`string`&&Mt.includes(e)}function Ko(e){return Go(e)?e:Wo}function qo(e){return new Intl.DisplayNames([e],{type:`language`}).of(e)??e}function Jo(e){let t=(0,Q.c)(6),{choice:n}=e;if(n===Wo){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(m,{id:`D-NlUC`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=qo(n),t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,$.jsx)(`span`,{lang:n,className:`capitalize`,children:r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Yo(e){let t=(0,Q.c)(22),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({value:o,onValueChange:r,onBlur:n,ref:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===o?s=t[7]:(s=Ko(o),t[6]=o,t[7]=s);let c=s,l;t[8]===r?l=t[9]:(l=e=>r(Ko(e)),t[8]=r,t[9]=l);let u;t[10]===c?u=t[11]:(u=(0,$.jsx)(Te,{children:(0,$.jsx)(Jo,{choice:c})}),t[10]=c,t[11]=u);let d;t[12]!==n||t[13]!==i||t[14]!==a||t[15]!==u?(d=(0,$.jsx)(we,{...a,ref:i,onBlur:n,size:`sm`,className:`w-48`,children:u}),t[12]=n,t[13]=i,t[14]=a,t[15]=u,t[16]=d):d=t[16];let f;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(Ce,{children:[(0,$.jsx)(Se,{value:Wo,children:(0,$.jsx)(Jo,{choice:Wo})}),Ye.map(Xo)]}),t[17]=f):f=t[17];let p;return t[18]!==c||t[19]!==l||t[20]!==d?(p=(0,$.jsxs)(Ee,{value:c,onValueChange:l,children:[d,f]}),t[18]=c,t[19]=l,t[20]=d,t[21]=p):p=t[21],p}function Xo(e){return(0,$.jsx)(Se,{value:e,children:(0,$.jsx)(Jo,{choice:e})},e)}function Zo(e){return{chrome:e.sidebar,surface:e.background,bar:e.primary,line:e.border,dots:[e[`syntax-string`],e[`syntax-keyword`],e[`syntax-atom`]]}}function Qo(e,t,n){return e.id===`custom`?Zo(At(bi(t))):e.scheme?Zo(At(e.scheme)):Zo(mi(n))}function $o(e){let t=(0,Q.c)(38),{theme:n,customSeed:r,slotMode:i}=e,a,o,s,c,l,u,d,f,p,m;t[0]!==r||t[1]!==i||t[2]!==n?(a=Qo(n,r,i),u=!0,d=``,f=`aspect-[4/3] w-full overflow-hidden rounded-md border`,p={backgroundColor:a.surface,borderColor:a.line},m=(0,$.jsxs)(`div`,{className:`flex h-1/3 items-center gap-1 px-1.5`,style:{backgroundColor:a.chrome,borderBottom:`1px solid ${a.line}`},children:[(0,$.jsx)(`span`,{className:`h-1.5 w-5 rounded-full`,style:{backgroundColor:a.bar}}),(0,$.jsx)(`span`,{className:`h-1.5 flex-1 rounded-full opacity-50`,style:{backgroundColor:a.line}})]}),l=`flex h-2/3`,o=`flex w-1/4 flex-col items-center justify-center gap-1`,s={backgroundColor:a.chrome,borderRight:`1px solid ${a.line}`},c=a.dots.map(es),t[0]=r,t[1]=i,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m):(a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]);let h;t[13]!==o||t[14]!==s||t[15]!==c?(h=(0,$.jsx)(`div`,{className:o,style:s,children:c}),t[13]=o,t[14]=s,t[15]=c,t[16]=h):h=t[16];let g;t[17]===a.dots[1]?g=t[18]:(g=(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-full`,style:{backgroundColor:a.dots[1]}}),t[17]=a.dots[1],t[18]=g);let _;t[19]===a.line?_=t[20]:(_=(0,$.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-full opacity-60`,style:{backgroundColor:a.line}}),t[19]=a.line,t[20]=_);let v;t[21]===a.dots[0]?v=t[22]:(v=(0,$.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-full`,style:{backgroundColor:a.dots[0]}}),t[21]=a.dots[0],t[22]=v);let y;t[23]!==g||t[24]!==_||t[25]!==v?(y=(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1 px-1.5`,children:[g,_,v]}),t[23]=g,t[24]=_,t[25]=v,t[26]=y):y=t[26];let b;t[27]!==h||t[28]!==y||t[29]!==l?(b=(0,$.jsxs)(`div`,{className:l,children:[h,y]}),t[27]=h,t[28]=y,t[29]=l,t[30]=b):b=t[30];let x;return t[31]!==b||t[32]!==u||t[33]!==d||t[34]!==f||t[35]!==p||t[36]!==m?(x=(0,$.jsxs)(`div`,{"aria-hidden":u,"data-theme-swatch":d,className:f,style:p,children:[m,b]}),t[31]=b,t[32]=u,t[33]=d,t[34]=f,t[35]=p,t[36]=m,t[37]=x):x=t[37],x}function es(e,t){return(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{backgroundColor:e}},t)}function ts(e){return b(`size-6 min-w-6 rounded-md border p-0 transition-colors`,e?`border-primary bg-primary/15 text-primary hover:bg-primary/20 data-[state=on]:bg-primary/15`:`border-border/70 text-muted-foreground/70 hover:text-foreground`)}function ns(e){return b(`size-3.5`,e&&`fill-current`)}function rs(e){let t=(0,Q.c)(33),{selection:n,themes:r,unavailableThemes:i,onAssign:a,editControl:o,deleteControl:s,createControl:c,slotMode:l,customSeed:u,firstItemId:d,"aria-label":f,"aria-describedby":p,"aria-invalid":m}=e,g=r===void 0?Vt:r,_;t[0]===i?_=t[1]:(_=i===void 0?[]:i,t[0]=i,t[1]=_);let v=_,y=l===void 0?`light`:l,{_:x}=h(),S;if(t[2]!==x||t[3]!==u||t[4]!==s||t[5]!==o||t[6]!==d||t[7]!==a||t[8]!==n||t[9]!==y||t[10]!==g){let e;t[12]!==x||t[13]!==u||t[14]!==s||t[15]!==o||t[16]!==d||t[17]!==a||t[18]!==n||t[19]!==y?(e=(e,t)=>{let r=n.light===e.id,i=n.dark===e.id,c=o?.themeIds.includes(e.id)??!1,l=s?.themeIds.includes(e.id)??!1,f=o?.selectedId===e.id,p=x(y===`light`?{id:`hgF0al`,values:{0:e.label}}:{id:`6Nea1q`,values:{0:e.label}});return(0,$.jsxs)(`fieldset`,{"aria-label":e.label,className:b(`relative flex min-w-0 flex-col gap-1.5 rounded-lg border-2 p-1 text-left`,n[y]===e.id?`border-primary`:`border-transparent`),children:[(0,$.jsx)(w,{type:`button`,variant:`ghost`,"aria-label":p,"data-theme-focus-target":``,onClick:()=>a(y,e.id),className:`h-auto w-full cursor-pointer p-0 transition-opacity hover:bg-transparent hover:opacity-90`,children:(0,$.jsx)($o,{theme:e,customSeed:u,slotMode:y})}),l?(0,$.jsx)(w,{type:`button`,variant:`outline`,size:`icon-sm`,title:x({id:`Y2tU6I`,values:{0:e.label}}),"aria-label":x({id:`Y2tU6I`,values:{0:e.label}}),className:`absolute top-2 end-2 z-10 border-border/80 bg-background/85 text-muted-foreground shadow-sm backdrop-blur-sm hover:border-destructive/50 hover:bg-destructive/15 hover:text-destructive focus-visible:border-destructive/50 focus-visible:text-destructive focus-visible:ring-destructive/20 dark:bg-background/80 dark:hover:bg-destructive/20`,onClick:async t=>{let n=t.currentTarget.closest(`fieldset`),r=n?.previousElementSibling?.querySelector(`[data-theme-focus-target]`)??n?.nextElementSibling?.querySelector(`[data-theme-focus-target]`);await s?.onDelete(e.id)!==!1&&r?.focus()},children:(0,$.jsx)(Wr,{"aria-hidden":!0})}):null,(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-1 px-0.5`,children:[(0,$.jsx)(`span`,{className:`truncate text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[c?(0,$.jsx)(je,{className:ts(f),pressed:f,onPressedChange:t=>{o?.onSelect(t?e.id:null)},"aria-label":x(f?{id:`8x6zk9`,values:{0:e.label}}:{id:`N6j2JH`,values:{0:e.label}}),children:(0,$.jsx)(gn,{className:`size-3.5`})}):null,(0,$.jsx)(je,{id:t===0?d:void 0,className:ts(r),pressed:r,onPressedChange:t=>{t&&a(`light`,e.id)},"aria-label":x({id:`sq4WQH`,values:{0:e.label}}),children:(0,$.jsx)(Rr,{className:ns(r)})}),(0,$.jsx)(je,{className:ts(i),pressed:i,onPressedChange:t=>{t&&a(`dark`,e.id)},"aria-label":x({id:`lZvQrY`,values:{0:e.label}}),children:(0,$.jsx)(zr,{className:ns(i)})})]})]})]},e.id)},t[12]=x,t[13]=u,t[14]=s,t[15]=o,t[16]=d,t[17]=a,t[18]=n,t[19]=y,t[20]=e):e=t[20],S=g.map(e),t[2]=x,t[3]=u,t[4]=s,t[5]=o,t[6]=d,t[7]=a,t[8]=n,t[9]=y,t[10]=g,t[11]=S}else S=t[11];let C;t[21]!==x||t[22]!==c?(C=c?(0,$.jsxs)(w,{type:`button`,variant:`ghost`,onClick:c.onCreate,className:`group h-auto min-w-0 flex-col items-stretch gap-1.5 rounded-lg border-2 border-transparent p-1 text-left text-muted-foreground hover:bg-transparent hover:text-foreground`,children:[(0,$.jsx)(`span`,{className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-dashed border-border bg-muted/10 transition-colors group-hover:border-foreground/40`,children:(0,$.jsx)(mn,{"aria-hidden":!0,className:`size-6`})}),(0,$.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium`,children:x({id:`AJ7_B2`})})]}):null,t[21]=x,t[22]=c,t[23]=C):C=t[23];let T;t[24]===v?T=t[25]:(T=v.map(is),t[24]=v,t[25]=T);let E;return t[26]!==p||t[27]!==m||t[28]!==f||t[29]!==S||t[30]!==C||t[31]!==T?(E=(0,$.jsxs)(`fieldset`,{"aria-label":f,"aria-describedby":p,"aria-invalid":m,className:`grid w-full min-w-0 grid-cols-2 gap-2 sm:grid-cols-3`,children:[S,C,T]}),t[26]=p,t[27]=m,t[28]=f,t[29]=S,t[30]=C,t[31]=T,t[32]=E):E=t[32],E}function is(e){return(0,$.jsxs)(`fieldset`,{"aria-label":e.label,className:`flex min-w-0 flex-col gap-1.5 rounded-lg border-2 border-destructive/40 bg-destructive/5 p-1 text-left`,children:[(0,$.jsx)(`div`,{"aria-hidden":!0,className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-destructive/30 bg-muted/40 text-destructive`,children:(0,$.jsx)(Fn,{className:`size-6`})}),(0,$.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`px-0.5 text-xs font-medium text-destructive`,children:e.problem}),(0,$.jsx)(`span`,{className:`px-0.5 pb-0.5 text-xs text-muted-foreground`,children:e.detail})]},e.key)}var as=12e3;function os(e){let t=(0,Q.c)(210),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({appearance:n,onAssign:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{_:a}=h(),{themes:o,warnings:s,truncated:c,loadError:l,refresh:u,deleteTheme:d,restoreTheme:f,editingThemeId:p,themeEditorOpen:m,selectThemeToEdit:g}=Yr(),[_,v]=(0,Z.useState)(!1),[y,b]=(0,Z.useState)(``),[x,S]=(0,Z.useState)(null),[C,T]=(0,Z.useState)(!1),E=(0,Z.useRef)(null),D,O;t[4]===u?(D=t[5],O=t[6]):(D=()=>{u()},O=[u],t[4]=u,t[5]=D,t[6]=O),(0,Z.useEffect)(D,O);let k;t[7]!==n||t[8]!==o?(k=Xe(n,o),t[7]=n,t[8]=o,t[9]=k):k=t[9];let A=k,j,M,N,P,F,I,L,R,z,B,V,H,U,W,G,K,ee,te,q,J,Y;if(t[10]!==a||t[11]!==x||t[12]!==y||t[13]!==_||t[14]!==d||t[15]!==p||t[16]!==C||t[17]!==l||t[18]!==r||t[19]!==i||t[20]!==u||t[21]!==f||t[22]!==g||t[23]!==A||t[24]!==m||t[25]!==o||t[26]!==c||t[27]!==s){let e=Rt(y),n;t[49]===o?n=t[50]:(n=o.filter(ds),t[49]=o,t[50]=n);let h=n,D,O,k,ne,re,ie,ae,oe,se;if(t[51]!==a||t[52]!==y||t[53]!==d||t[54]!==p||t[55]!==h||t[56]!==C||t[57]!==l||t[58]!==r||t[59]!==i||t[60]!==u||t[61]!==f||t[62]!==g||t[63]!==A||t[64]!==m||t[65]!==o||t[66]!==c||t[67]!==s){let e=o.flatMap(us),n;t[80]!==a||t[81]!==u||t[82]!==f?(n=async function(e){let t=await f({id:e.id,name:e.scheme.name,stem:e.stem,scheme:{...e.scheme,palette:{...e.scheme.palette}},extension:e.filename.endsWith(`.yml`)?`.yml`:`.yaml`});if(t.ok){await u(),X.success(a({id:`Kx881F`,values:{0:e.label}}));return}if(t.reason===`name-taken`){X.error(a({id:`oZUYMv`,values:{0:e.label}}));return}X.error(a({id:`7O7REc`,values:{0:e.label}}))},t[80]=a,t[81]=u,t[82]=f,t[83]=n):n=t[83];let _=n;k=async function(t){let n=e.find(e=>e.id===t);if(!n)return X.error(a({id:`ANFxWn`})),!1;let r=await d(n.id);if(!r.ok)return X.error(a({id:`kkux8f`,values:{0:n.label}})),!1;if(p===n.id&&g(null),await u(),!r.existed)return X(a({id:`ekSPiP`,values:{0:n.label}})),!0;let i={...n,filename:r.filename,label:r.scheme.name,scheme:r.scheme};return X(a({id:`YCmS3k`,values:{0:i.label}}),{duration:as,action:{label:a({id:`9uI_rE`}),onClick:()=>_(i)}}),!0};let x;t[84]!==a||t[85]!==y||t[86]!==C||t[87]!==r||t[88]!==i||t[89]!==u||t[90]!==f||t[91]!==g||t[92]!==A||t[93]!==o?(x=async function(e){if(e.preventDefault(),C)return;let t=Rt(y);if(!t.ok){S(a({id:`RG3yW6`})),E.current?.focus();return}let n=i.slotMode??`light`,s=o.find(e=>e.id===A[n])?.scheme??bi(i.customSeed),c={name:t.name,variant:s.variant,palette:{...s.palette}};S(null),T(!0);let l=await f({id:t.id,name:t.name,scheme:c});if(!l.ok){S(l.reason===`name-taken`?a({id:`_IfSZn`}):l.reason===`name-invalid`?a({id:`qtnmEX`}):a({id:`DmkTrb`})),T(!1),E.current?.focus();return}let d={id:l.id,label:c.name,kind:c.variant,scheme:c,toTokens:()=>At(c)};r(n,l.id,A,[...o,d]),await u(),b(``),v(!1),T(!1),g(l.id)},t[84]=a,t[85]=y,t[86]=C,t[87]=r,t[88]=i,t[89]=u,t[90]=f,t[91]=g,t[92]=A,t[93]=o,t[94]=x):x=t[94],O=x;let j;if(t[95]!==a||t[96]!==s){let e;t[98]===a?e=t[99]:(e=e=>{let t;bb90:switch(e.code){case`unparseable`:t=a({id:`g12y1g`});break bb90;case`not-a-scheme`:t=a({id:`p7Utw8`});break bb90;case`missing-slots`:t=a({id:`GUZHkL`});break bb90;case`bad-hex`:t=a({id:`IMLUBh`});break bb90;case`empty`:t=a({id:`k_tFzX`});break bb90;case`too-long`:t=a({id:`FyyIjH`});break bb90;case`invalid-chars`:t=a({id:`JaU1ld`});break bb90;case`unsupported-extension-case`:t=a({id:`R30SFt`});break bb90;case`duplicate-identity`:t=a({id:`DUb7Ax`});break bb90;case`symlink`:t=a({id:`hFmYGU`});break bb90;case`not-regular-file`:t=a({id:`UH0Zqw`});break bb90;case`file-too-large`:t=a({id:`-othoN`});break bb90;case`read-failed`:t=a({id:`cLn264`});break bb90;default:t=a({id:`WBNpt9`,values:{0:e.code}})}return{key:e.filename,label:e.filename,problem:t,detail:e.conflictingFilenames?a({id:`QwG_zJ`,values:{0:e.conflictingFilenames.join(`, `)}}):a({id:`kwNS82`})}},t[98]=a,t[99]=e),j=s.map(e),t[95]=a,t[96]=s,t[97]=j}else j=t[97];let M=j;H=`flex w-full min-w-0 flex-col gap-2`,t[100]!==a||t[101]!==l||t[102]!==u?(U=l?(0,$.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-foreground`,children:[(0,$.jsx)(`span`,{children:a({id:`hVzt9x`})}),(0,$.jsx)(w,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>void u(),children:a({id:`KDw4GX`})})]}):null,t[100]=a,t[101]=l,t[102]=u,t[103]=U):U=t[103];let N;t[104]!==a||t[105]!==c?(N=c?(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-sm text-foreground`,children:[(0,$.jsx)(Gr,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-amber-600`}),(0,$.jsx)(`span`,{children:a({id:`DLIljL`})})]}):null,t[104]=a,t[105]=c,t[106]=N):N=t[106],t[107]===N?W=t[108]:(W=(0,$.jsx)(`div`,{role:`status`,children:N}),t[107]=N,t[108]=W),D=rs,re=i,ie=A,ae=h,oe=M;let P;t[109]===o?P=t[110]:(P=o.filter(ls).map(cs),t[109]=o,t[110]=P);let F=m?p:null;t[111]!==g||t[112]!==P||t[113]!==F?(se={themeIds:P,selectedId:F,onSelect:g},t[111]=g,t[112]=P,t[113]=F,t[114]=se):se=t[114],ne=e.map(ss),t[51]=a,t[52]=y,t[53]=d,t[54]=p,t[55]=h,t[56]=C,t[57]=l,t[58]=r,t[59]=i,t[60]=u,t[61]=f,t[62]=g,t[63]=A,t[64]=m,t[65]=o,t[66]=c,t[67]=s,t[68]=D,t[69]=O,t[70]=k,t[71]=H,t[72]=U,t[73]=W,t[74]=ne,t[75]=re,t[76]=ie,t[77]=ae,t[78]=oe,t[79]=se}else D=t[68],O=t[69],k=t[70],H=t[71],U=t[72],W=t[73],ne=t[74],re=t[75],ie=t[76],ae=t[77],oe=t[78],se=t[79];let ce;t[115]!==k||t[116]!==ne?(ce={themeIds:ne,onDelete:k},t[115]=k,t[116]=ne,t[117]=ce):ce=t[117];let le;t[118]===Symbol.for(`react.memo_cache_sentinel`)?(le={onCreate:()=>v(!0)},t[118]=le):le=t[118];let ue;t[119]!==r||t[120]!==A||t[121]!==o?(ue=(e,t)=>r(e,t,A,o),t[119]=r,t[120]=A,t[121]=o,t[122]=ue):ue=t[122],t[123]!==D||t[124]!==re||t[125]!==ie||t[126]!==ae||t[127]!==oe||t[128]!==se||t[129]!==ce||t[130]!==ue?(G=(0,$.jsx)(D,{...re,selection:ie,themes:ae,unavailableThemes:oe,editControl:se,deleteControl:ce,createControl:le,onAssign:ue}),t[123]=D,t[124]=re,t[125]=ie,t[126]=ae,t[127]=oe,t[128]=se,t[129]=ce,t[130]=ue,t[131]=G):G=t[131],F=ii,B=_,t[132]===C?V=t[133]:(V=e=>{C||v(e)},t[132]=C,t[133]=V),P=$r;let de;t[134]===a?de=t[135]:(de=a({id:`Z_nNa2`}),t[134]=a,t[135]=de);let fe;t[136]===de?fe=t[137]:(fe=(0,$.jsx)(Qr,{children:de}),t[136]=de,t[137]=fe);let pe;t[138]===a?pe=t[139]:(pe=a({id:`nTM8ab`}),t[138]=a,t[139]=pe);let me;t[140]===pe?me=t[141]:(me=(0,$.jsx)(Zr,{children:pe}),t[140]=pe,t[141]=me),t[142]!==fe||t[143]!==me?(z=(0,$.jsxs)(ri,{className:`gap-2`,children:[fe,me]}),t[142]=fe,t[143]=me,t[144]=z):z=t[144],N=ei,I=`create-saved-theme-form`,L=!0,R=O,M=Oi,q=x!==null;let he;t[145]===a?he=t[146]:(he=a({id:`HZ7fEu`}),t[145]=a,t[146]=he),t[147]===he?J=t[148]:(J=(0,$.jsx)(Ei,{htmlFor:`create-saved-theme-name`,children:he}),t[147]=he,t[148]=J);let ge=x!==null,_e=x?`create-saved-theme-help create-saved-theme-error`:`create-saved-theme-help`,ve;t[149]===x?ve=t[150]:(ve=e=>{b(e.target.value),x&&S(null)},t[149]=x,t[150]=ve),t[151]!==y||t[152]!==C||t[153]!==ge||t[154]!==_e||t[155]!==ve?(Y=(0,$.jsx)(oi,{ref:E,id:`create-saved-theme-name`,value:y,autoFocus:!0,autoComplete:`off`,required:!0,readOnly:C,"aria-invalid":ge,"aria-describedby":_e,onChange:ve}),t[151]=y,t[152]=C,t[153]=ge,t[154]=_e,t[155]=ve,t[156]=Y):Y=t[156],j=Di,K=`create-saved-theme-help`,ee=`font-mono`,te=e.ok?a({id:`Yb82LN`,values:{0:e.stem}}):a({id:`4d0VYJ`}),t[10]=a,t[11]=x,t[12]=y,t[13]=_,t[14]=d,t[15]=p,t[16]=C,t[17]=l,t[18]=r,t[19]=i,t[20]=u,t[21]=f,t[22]=g,t[23]=A,t[24]=m,t[25]=o,t[26]=c,t[27]=s,t[28]=j,t[29]=M,t[30]=N,t[31]=P,t[32]=F,t[33]=I,t[34]=L,t[35]=R,t[36]=z,t[37]=B,t[38]=V,t[39]=H,t[40]=U,t[41]=W,t[42]=G,t[43]=K,t[44]=ee,t[45]=te,t[46]=q,t[47]=J,t[48]=Y}else j=t[28],M=t[29],N=t[30],P=t[31],F=t[32],I=t[33],L=t[34],R=t[35],z=t[36],B=t[37],V=t[38],H=t[39],U=t[40],W=t[41],G=t[42],K=t[43],ee=t[44],te=t[45],q=t[46],J=t[47],Y=t[48];let ne;t[157]!==j||t[158]!==K||t[159]!==ee||t[160]!==te?(ne=(0,$.jsx)(j,{id:K,className:ee,children:te}),t[157]=j,t[158]=K,t[159]=ee,t[160]=te,t[161]=ne):ne=t[161];let re;t[162]===x?re=t[163]:(re=x?(0,$.jsx)(Ti,{id:`create-saved-theme-error`,children:x}):null,t[162]=x,t[163]=re);let ie;t[164]!==M||t[165]!==ne||t[166]!==re||t[167]!==q||t[168]!==J||t[169]!==Y?(ie=(0,$.jsxs)(M,{"data-invalid":q,children:[J,Y,ne,re]}),t[164]=M,t[165]=ne,t[166]=re,t[167]=q,t[168]=J,t[169]=Y,t[170]=ie):ie=t[170];let ae;t[171]!==I||t[172]!==L||t[173]!==R||t[174]!==ie?(ae=(0,$.jsx)(`form`,{id:I,noValidate:L,onSubmit:R,children:ie}),t[171]=I,t[172]=L,t[173]=R,t[174]=ie,t[175]=ae):ae=t[175];let oe;t[176]!==N||t[177]!==ae?(oe=(0,$.jsx)(N,{children:ae}),t[176]=N,t[177]=ae,t[178]=oe):oe=t[178];let se;t[179]===Symbol.for(`react.memo_cache_sentinel`)?(se=()=>v(!1),t[179]=se):se=t[179];let ce;t[180]===a?ce=t[181]:(ce=a({id:`dEgA5A`}),t[180]=a,t[181]=ce);let le;t[182]!==C||t[183]!==ce?(le=(0,$.jsx)(w,{type:`button`,variant:`outline`,disabled:C,onClick:se,children:ce}),t[182]=C,t[183]=ce,t[184]=le):le=t[184];let ue;t[185]!==a||t[186]!==C?(ue=a(C?{id:`_DwR-n`}:{id:`cuHhjo`}),t[185]=a,t[186]=C,t[187]=ue):ue=t[187];let de;t[188]!==C||t[189]!==ue?(de=(0,$.jsx)(w,{type:`submit`,form:`create-saved-theme-form`,disabled:C,children:ue}),t[188]=C,t[189]=ue,t[190]=de):de=t[190];let fe;t[191]!==le||t[192]!==de?(fe=(0,$.jsxs)(ti,{children:[le,de]}),t[191]=le,t[192]=de,t[193]=fe):fe=t[193];let pe;t[194]!==P||t[195]!==z||t[196]!==oe||t[197]!==fe?(pe=(0,$.jsxs)(P,{children:[z,oe,fe]}),t[194]=P,t[195]=z,t[196]=oe,t[197]=fe,t[198]=pe):pe=t[198];let me;t[199]!==F||t[200]!==B||t[201]!==V||t[202]!==pe?(me=(0,$.jsx)(F,{open:B,onOpenChange:V,children:pe}),t[199]=F,t[200]=B,t[201]=V,t[202]=pe,t[203]=me):me=t[203];let he;return t[204]!==H||t[205]!==U||t[206]!==W||t[207]!==G||t[208]!==me?(he=(0,$.jsxs)(`div`,{className:H,children:[U,W,G,me]}),t[204]=H,t[205]=U,t[206]=W,t[207]=G,t[208]=me,t[209]=he):he=t[209],he}function ss(e){return e.id}function cs(e){return e.id}function ls(e){return e.id.startsWith(`saved-`)}function us(e){let t=it(e.id);return!t.ok||!e.scheme?[]:[{id:e.id,stem:t.stem,label:e.label,scheme:e.scheme}]}function ds(e){return e.id!==`custom`}function fs(e,t){if(e.length===0)throw Error(`buildPatch: path must be non-empty`);let[n,...r]=e;return r.length===0?{[String(n)]:t}:{[String(n)]:fs(r,t)}}function ps(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(e?.type===`default`){let t=e.defaultValue;return typeof t==`function`?t():t}let n=t?._zod?.def?.innerType;if(n===void 0)return;t=n}}function ms(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`default`||e.type===`optional`||e.type===`nullable`){t=e.innerType;continue}return e.type}}function hs(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`enum`)return e.entries?Object.values(e.entries):void 0;if(e.innerType!==void 0){t=e.innerType;continue}return}}function gs(e){let t=(0,Q.c)(14),n;t[0]===e?n=t[1]:(n=e.current(),t[0]=e,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i={defaultValues:r,mode:`onBlur`},t[2]=r,t[3]=i);let a=ia(i),o,s;t[4]!==e||t[5]!==a?(o=()=>e.subscribe(e=>{_s(a,e)}),s=[e,a],t[4]=e,t[5]=a,t[6]=o,t[7]=s):(o=t[6],s=t[7]),(0,Z.useEffect)(o,s);let c;t[8]!==e||t[9]!==a?(c=t=>vs(a,e,t),t[8]=e,t[9]=a,t[10]=c):c=t[10];let l=c,u;return t[11]!==l||t[12]!==a?(u={form:a,commitField:l},t[11]=l,t[12]=a,t[13]=u):u=t[13],u}function _s(e,t){e.reset(t,{keepDirtyValues:!0,keepDirty:!0,keepTouched:!0})}function vs(e,t,n){let r=e.getValues(n),i=fs(xs(n),r),a=t.patch(i);if(a.ok)return e.clearErrors(n),e.resetField(n,{defaultValue:r,keepError:!1}),!0;if(Nt(a.error)&&a.error.code===`SCHEMA_INVALID`&&a.error.issues.length>0){e.clearErrors(n);for(let t of a.error.issues){let r=t.path.length>0?t.path.map(String).join(`.`):n;e.setError(r,{type:`config-binding`,message:t.message})}}else e.setError(n,{type:`config-binding`,message:ys(a.error,n)});return!1}function ys(e,t){if(Nt(e)&&e.code===`SCHEMA_INVALID`){let n=e.issues.find(e=>bs(e,t));if(n)return n.message}return jt(e)}function bs(e,t){return e.path.map(String).join(`.`)===t}function xs(e){return e.split(`.`)}function Ss(e){if(!Nt(e)||e.code!==`SCHEMA_INVALID`)return null;let t=e.issues[0];return!t||t.path.length===0?null:t.path.map(String).join(`.`)}function Cs(){let e=(0,Q.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Ii,{className:`h-5 w-32`}),n=(0,$.jsx)(Ii,{className:`h-4 w-64`}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[t,n,(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(Ii,{className:`h-9 w-full`}),(0,$.jsx)(Ii,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function ws({field:e,scope:t,commitField:n,isFlashed:r}){"use no memo";let{_:i}=h(),a=ca(),{setTheme:o}=_(),s=_n(),c=Ft(vt,e.path),l=c?ms(c):void 0,u=c?ps(c):void 0,d=c?hs(c):void 0,f=c?Jt(c):void 0,p=f?.scope===`project`&&t!==`project`||f?.scope===`user`&&t!==`user`,g=e.path.join(`.`),v=i(e.label),[y,x]=(0,Z.useState)(!1),S=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>{S.current&&clearTimeout(S.current)},[]);let C=()=>{x(!0),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>x(!1),1200)},D=()=>{let e=n(g);return e&&C(),e},k=()=>a.getFieldState(g).isDirty?D():!0,A=()=>{if(e.control===`theme-tiles`){let e=s?.userBinding;if(!e)return;let t=e.patch({appearance:pi()});t.ok?C():a.setError(g,{type:`manual`,message:ys(t.error,g)});return}let t=u===void 0?null:u;a.setValue(g,t,{shouldDirty:!1}),e.control===`theme-cards`&&o(yn(t)),D()},j=b(`relative`,r&&`animate-settings-flash`);return(0,$.jsx)(aa,{control:a.control,name:g,render:({field:n})=>{let r=!p&&(u!==void 0||n.value!==void 0);return(0,$.jsxs)(ra,{className:j,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(sa,{className:`text-sm font-medium`,children:v}),r?(0,$.jsxs)(O,{children:[(0,$.jsx)(T,{asChild:!0,children:(0,$.jsx)(w,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:A,"aria-label":i({id:`lhjq3G`,values:{labelText:v}}),children:(0,$.jsx)(Vr,{className:`size-3.5`})})}),(0,$.jsx)(E,{children:(0,$.jsx)(m,{id:`L-rMC9`})})]}):null]}),e.description?(0,$.jsx)(la,{className:`text-muted-foreground text-1sm`,children:i(e.description)}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(oa,{children:(0,$.jsx)(Es,{field:e,ctl:n,typeTag:l,enumOptions:d,onCommit:k,onRevertToBaseline:()=>a.resetField(g,{keepError:!0}),onSavedOutsideForm:C,onWriteRejected:e=>{a.setError(g,{type:`manual`,message:ys(e,g)})}})}),(0,$.jsx)(As,{visible:y,srOnly:Ts(e.control)})]}),(0,$.jsx)(ua,{"data-field-error":e.path.join(`.`)})]})}})}function Ts(e){return e===`theme-tiles`||e===`theme-cards`}function Es({field:e,ctl:t,typeTag:n,enumOptions:r,onCommit:i,onRevertToBaseline:a,onSavedOutsideForm:o,onWriteRejected:s,...c}){"use no memo";let{_:l}=h(),{setTheme:u,systemTheme:d}=_(),f=_n(),p=f?.merged??null;if(e.control===`language-select`)return(0,$.jsx)(Yo,{...c,value:t.value,ref:t.ref,onBlur:t.onBlur,onValueChange:e=>{let n=xi(t.value)??`system`;n!==e&&Bo({from:n,to:e}),t.onChange(e),i()}});if(e.control===`theme-cards`){let{id:n,...r}=c;return(0,$.jsx)(Br,{...r,firstItemId:n,value:yn(t.value),"aria-label":l(e.label),onValueChange:e=>{let n=yn(t.value);u(e),t.onChange(e),!i()&&(u(n),a())}})}if(e.control===`theme-tiles`){let{id:t,...n}=c,r=p?.appearance?.customTheme,i=p?.appearance?.theme,a=pt(i,d===`dark`);return(0,$.jsx)(os,{...n,firstItemId:t,appearance:p?.appearance,customSeed:r,slotMode:a,"aria-label":l(e.label),onAssign:(e,t,n,c)=>{let l=f?.userBinding;if(!l)return;let d={...n,[e]:t},p=e=>{let t=e[a];return t===`custom`?gi(bi(r)):fi(t,c)};di({selection:d,modePreference:i,slotMode:a,customSeed:r,themes:c}),u(p(d)??i??`system`);let m=l.patch({appearance:_i(d)});if(m.ok){Uo(d),o();return}di({selection:n,modePreference:i,slotMode:a,customSeed:r,themes:c}),u(p(n)??i??`system`),s(m.error)}})}if(n===`boolean`)return(0,$.jsx)(ke,{...c,checked:!!t.value,ref:t.ref,onCheckedChange:e=>{t.onChange(e),i()},onBlur:t.onBlur});if(n===`enum`&&r&&r.length>0&&(e.control===`enum-toggle`||r.length<=4)){let{id:n,...a}=c;return(0,$.jsx)(Me,{...a,type:`single`,value:typeof t.value==`string`?t.value:``,ref:t.ref,onValueChange:e=>{e&&(t.onChange(e),i())},onBlur:t.onBlur,variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-lg`,"aria-label":l(e.label),children:r.map((e,t)=>(0,$.jsx)(Ae,{value:e,id:t===0?n:void 0,className:`text-1sm capitalize`,children:e},e))})}return n===`number`||n===`int`?(0,$.jsx)(Os,{ctl:t,onCommit:i,...c}):n===`array`?(0,$.jsx)(ks,{ctl:t,onCommit:i,...c}):(0,$.jsx)(Ds,{ctl:t,onCommit:i,...c})}function Ds({ctl:e,onCommit:t,...n}){"use no memo";return(0,$.jsx)(oi,{...n,value:typeof e.value==`string`?e.value:``,ref:e.ref,onChange:t=>e.onChange(t.target.value),onBlur:()=>{e.onBlur(),t()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),t())},className:`h-8 text-sm`})}function Os({ctl:e,onCommit:t,...n}){"use no memo";let[r,i]=(0,Z.useState)(e.value===void 0?``:String(e.value)),a=(0,Z.useRef)(e.value);(0,Z.useEffect)(()=>{a.current!==e.value&&(i(e.value===void 0?``:String(e.value)),a.current=e.value)},[e.value]);let o=()=>{let n=Number(r);if(!Number.isFinite(n)){e.onChange(r),t();return}e.onChange(n),t(),a.current=n};return(0,$.jsx)(oi,{...n,type:`number`,value:r,ref:e.ref,onChange:e=>i(e.target.value),onBlur:()=>{e.onBlur(),o()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())},className:`h-8 w-28 text-sm tabular-nums`})}function ks({ctl:e,onCommit:t,...n}){"use no memo";let r=Array.isArray(e.value)?e.value.join(`
|
|
1
|
+
import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{B as r,O as i,at as a,dt as o,hi as s,lt as c,st as l,ut as u,xr as d,z as f}from"./DocumentContext-iWAOyWo0.js";import{t as p}from"./react-f2sANaYj.js";import{n as m,r as h}from"./dist-Nvb76hAm.js";import{t as g}from"./useQuery-ZeEDLtxh.js";import{n as _}from"./dist-PQ5KMVDh.js";import{t as v}from"./react-dom-DPxgxlDT.js";import{t as y}from"./compiler-runtime-BfE3aGVn.js";import{t as b}from"./utils-CPqDy6Hr.js";import{n as x,r as S,t as C}from"./AgentIconCluster-HlKRqN5I.js";import{t as w}from"./button-BeFNZANd.js";import{i as T,n as E,r as D,t as O}from"./tooltip-DVBVVaAs.js";import{n as k,r as A,t as j}from"./collapsible-DYySK8La.js";import{a as M,c as N,i as P,l as F,n as I,o as L,r as R,s as z,t as B}from"./alert-dialog-CqqfqWNT.js";import{n as V,t as H}from"./with-selector-PRoyWQiu.js";import{t as U}from"./checkbox-BZdMjUlq.js";import{A as W,C as G,D as K,E as ee,O as te,S as q,T as J,_ as Y,b as ne,f as re,g as ie,h as ae,j as oe,k as se,m as ce,p as le,r as ue,v as de,w as fe,x as pe,y as me}from"./floating-ui.dom-CDtYEnEj.js";import{c as he,d as ge,l as _e,o as ve,s as ye,u as be}from"./dist-DYso7MCm.js";import{t as xe}from"./label-D-K3fWtj.js";import{i as Se,n as Ce,o as we,s as Te,t as Ee}from"./select-D_BhUvh8.js";import{n as De,t as Oe}from"./radio-group-npdxiS6E.js";import{t as ke}from"./switch-iwBsEWej.js";import{n as Ae,r as je,t as Me}from"./toggle-group-BxIyZnUJ.js";import{a as Ne,c as Pe,d as Fe,f as Ie,g as Le,h as Re,i as ze,l as Be,s as Ve,t as He,u as Ue,y as We}from"./RegisteredAgentIcon-COLTpZlS.js";import{a as Ge,i as Ke,o as qe}from"./terminal-telemetry-Bo0-Yp4s.js";import{$c as Je,$o as Ye,As as Xe,Bo as Ze,Bs as Qe,Cc as $e,Cn as et,Cs as tt,Dc as nt,Ec as rt,Es as it,Gs as at,Hn as ot,Ho as st,Hs as ct,Io as lt,Ko as ut,Lo as dt,Ms as ft,Ns as pt,Oc as mt,Ot as ht,Qo as gt,Rc as _t,Ro as vt,Sc as yt,Ss as bt,Tc as xt,Ts as St,Uo as Ct,Vc as wt,Vo as Tt,Wc as Et,Xo as Dt,Yn as Ot,Zo as kt,as as At,ds as jt,es as Mt,gs as Nt,jr as Pt,js as Ft,kc as It,ks as Lt,ls as Rt,mi as zt,mt as Bt,ns as Vt,os as Ht,ot as Ut,pt as Wt,ss as Gt,ts as Kt,ui as qt,us as Jt,va as Yt,vc as Xt,wn as Zt,ws as Qt,xi as $t,ys as en}from"./dist-BS18tPvg.js";import{t as tn}from"./trace-api-BP9dN1Hz.js";import{n as X}from"./dist-CJhtNlOm2.js";import{d as nn,f as rn,h as an,n as on,o as sn,p as cn,r as ln,u as un,v as dn}from"./use-settings-route--nlw92BG.js";import{t as fn}from"./dist-Cr4-nBVI.js";import{c as pn}from"./documents-events-CJhE88yE.js";import{a as mn,i as hn,o as gn}from"./local-menu-action-bus-DaoT7_kL.js";import{a as _n,i as vn,t as yn}from"./use-apply-config-theme-B5w38X1P.js";import{t as bn}from"./OpenInAgentMenuItem-D89q7FuT.js";import{t as xn}from"./createLucideIcon-B6ULg5PN.js";import{a as Sn,c as Cn,f as wn,l as Tn,p as En,s as Dn,t as On}from"./EnableSyncConfirmDialog-B4Eq35CQ.js";import{p as kn}from"./Mermaid-BG4D_HOk.js";import{t as An}from"./arrow-up-right-B3B9a7te.js";import{t as jn}from"./check-BzfGb3KU.js";import{t as Mn}from"./chevron-right-C-g4JuT4.js";import{n as Nn,t as Pn}from"./lint-plugin-meta-zA9wHIBR.js";import{t as Fn}from"./circle-alert-Czw40trT.js";import{i as In,r as Ln}from"./prop-types-DasLWSYV.js";import{a as Rn,h as zn,r as Bn,t as Vn}from"./dropdown-menu-BEhl0wvu.js";import{A as Hn,B as Un,C as Wn,F as Gn,G as Kn,H as qn,J as Jn,K as Yn,L as Xn,M as Zn,N as Qn,O as $n,P as er,Q as tr,R as nr,S as rr,U as ir,V as ar,W as or,Y as sr,at as cr,b as lr,c as ur,d as dr,et as fr,f as pr,h as mr,i as hr,j as gr,k as _r,l as vr,m as yr,n as br,nt as xr,o as Sr,p as Cr,q as wr,v as Tr,w as Er,x as Dr,y as Or}from"./auth-state-cache-ZHMSQvEG.js";import{g as kr,h as Ar,p as jr}from"./SkillInstallMenu-CkOeQ2Ai.js";import{It as Mr}from"./CodeMirrorPropInput-Tn1no_ym.js";import{r as Nr,t as Pr}from"./use-git-sync-status-OS-MtdFB.js";import{o as Fr}from"./folder-config-api-BTtUsUJc.js";import{t as Ir}from"./info-Bem3FDH_.js";import{t as Lr}from"./spinner-D7ppCG-D.js";import{n as Rr,r as zr,t as Br}from"./ThemePicker-Dkq_b6uC.js";import{t as Vr}from"./rotate-ccw-BeKroAIS.js";import{t as Hr}from"./square-pen-C1BBBLlZ.js";import{t as Ur}from"./terminal-D89Kc5tD.js";import{t as Wr}from"./trash-2-CYyUeKpx.js";import{t as Gr}from"./triangle-alert--Fl5KoVX.js";import{t as Kr}from"./x-BcfoD9-8.js";import{d as qr}from"./doc-paths-wf1Zwihi.js";import{a as Jr}from"./startup-marks-JBqTw7J_.js";import{n as Yr}from"./config-provider-B75KsU34.js";import{a as Xr}from"./skill-scope-BkSXs9Lm.js";import{a as Zr,c as Qr,i as $r,n as ei,o as ti,r as ni,s as ri,t as ii}from"./dialog-BfHNtxM9.js";import{m as ai}from"./skills-api-Cvk5ZT2-.js";import{t as oi}from"./input-B87iFAAQ.js";import{a as si,i as ci,t as li}from"./popover-Cy1VhL3a.js";import{_ as ui,a as di,d as fi,f as pi,g as mi,h as hi,m as gi,p as _i,u as vi,v as yi,y as bi}from"./css-color-to-hex-CceC2fgU.js";import{n as xi}from"./use-apply-config-language-CsFHXy7e.js";import{t as Si}from"./external-link-CHXmlzco.js";import{t as Ci}from"./badge-lmgHBfMn.js";import{t as wi}from"./tool-list-format-C9KSFYHU.js";import{i as Ti,o as Ei,r as Di,t as Oi}from"./field-BLH6hVAa.js";import{t as ki}from"./ConfigSharingInfoTooltip-DJhEv6QQ.js";import{t as Ai}from"./use-skills--ee80y05.js";import{o as ji,s as Mi,t as Ni}from"./use-open-skill-BoyleT3C.js";import{r as Pi,t as Fi}from"./DeleteConfirmationDialog-DQ_i0S6n.js";import{t as Ii}from"./skeleton-DscvcfA0.js";import{d as Li,n as Ri,r as zi,t as Bi,u as Vi}from"./lint-config-client-BrKjdAjt.js";import{_ as Hi,a as Ui,d as Wi,f as Gi,g as Ki,h as qi,i as Ji,o as Yi,s as Xi,t as Zi,u as Qi}from"./sortable.esm-BwLsMP2r.js";import{t as $i}from"./textarea-DVoGSfK8.js";import{i as ea,n as ta,t as na}from"./input-group-Brp49uT-.js";import{a as ra,f as ia,i as aa,n as oa,o as sa,p as ca,r as la,s as ua,t as da}from"./form--KmzMeAQ.js";import{r as fa,t as pa}from"./terminal-command-events-LkibGwt_.js";import{t as ma}from"./tag-pill-input-Kw1eRXQ5.js";import{t as ha}from"./markdownlint-rule-browser-Cv--E2sT.js";import{n as ga}from"./schema-fields-view-intent-Dwms69SB.js";import{n as _a,t as va}from"./use-terminal-enabled-DDGp3D4I.js";import{_ as ya,a as ba,c as xa,d as Sa,f as Ca,g as wa,h as Ta,i as Ea,l as Da,m as Oa,n as ka,o as Aa,p as ja,r as Ma,s as Na,t as Pa,u as Fa,v as Ia}from"./agent-connection-status-Bbe4NIF_.js";var La=xn(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),Ra=xn(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),za=xn(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),Ba=xn(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Z=e(p(),1),Q=y(),$=n();function Va(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Ci,{variant:`gray`,children:(0,$.jsx)(m,{id:`YBt9YP`})}),e[0]=t):t=e[0],t}function Ha(e){let t=(0,Q.c)(10),{scope:n}=e,r=`settings-scope-badge-${n}`,i;t[0]===n?i=t[1]:(i=n===`user`?(0,$.jsx)(m,{id:`7PzzBU`}):n===`project-local`?(0,$.jsx)(m,{id:`ImTzPZ`}):(0,$.jsx)(m,{id:`e0NrBM`}),t[0]=n,t[1]=i);let a;t[2]!==r||t[3]!==i?(a=(0,$.jsx)(T,{asChild:!0,children:(0,$.jsx)(Ci,{variant:`gray`,tabIndex:0,className:`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,"data-testid":r,children:i})}),t[2]=r,t[3]=i,t[4]=a):a=t[4];let o;t[5]===n?o=t[6]:(o=(0,$.jsx)(E,{children:n===`user`?(0,$.jsx)(m,{id:`cFSbbh`}):n===`project-local`?(0,$.jsx)(m,{id:`YlwI5F`}):(0,$.jsx)(m,{id:`ebqMh6`})}),t[5]=n,t[6]=o);let s;return t[7]!==a||t[8]!==o?(s=(0,$.jsx)(D,{children:(0,$.jsxs)(O,{children:[a,o]})}),t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function Ua(e){let t=(0,Q.c)(27),{titleId:n,title:r,scope:i,level:a,beta:o,adornment:s,docUrl:c,children:l}=e,u=a===void 0?`page`:a,{_:d}=h(),f=u===`page`?`h3`:`h4`,p=u===`page`?`text-lg`:`text-base`,g;t[0]===p?g=t[1]:(g=b(`font-semibold`,p),t[0]=p,t[1]=g);let _;t[2]!==f||t[3]!==g||t[4]!==r||t[5]!==n?(_=(0,$.jsx)(f,{id:n,className:g,children:r}),t[2]=f,t[3]=g,t[4]=r,t[5]=n,t[6]=_):_=t[6];let v;t[7]===o?v=t[8]:(v=o?(0,$.jsx)(Va,{}):null,t[7]=o,t[8]=v);let y;t[9]===i?y=t[10]:(y=i?(0,$.jsx)(Ha,{scope:i}):null,t[9]=i,t[10]=y);let x;t[11]!==s||t[12]!==_||t[13]!==v||t[14]!==y?(x=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_,s,v,y]}),t[11]=s,t[12]=_,t[13]=v,t[14]=y,t[15]=x):x=t[15];let S;t[16]===l?S=t[17]:(S=l?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:l}):null,t[16]=l,t[17]=S);let C;t[18]!==d||t[19]!==c||t[20]!==r||t[21]!==n?(C=c===void 0?null:(0,$.jsxs)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>Si(e,c),onAuxClick:e=>Si(e,c),"aria-label":d(typeof r==`string`?{id:`Li4U-T`,values:{title:r}}:{id:`zwWKhA`}),className:`inline-flex items-center gap-0.5 text-sm text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,"data-testid":`${n}-docs-link`,children:[(0,$.jsx)(m,{id:`zwWKhA`}),(0,$.jsx)(An,{"aria-hidden":!0,className:`size-3`})]}),t[18]=d,t[19]=c,t[20]=r,t[21]=n,t[22]=C):C=t[22];let w;return t[23]!==x||t[24]!==S||t[25]!==C?(w=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[x,S,C]}),t[23]=x,t[24]=S,t[25]=C,t[26]=w):w=t[26],w}var Wa=`settings-sharing-title`;function Ga(){let e=(0,Q.c)(1),t=(typeof window<`u`?window.okDesktop:void 0)?.sharing,n;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=t===void 0?(0,$.jsx)(Ka,{}):(0,$.jsx)(qa,{}),e[0]=n):n=e[0],n}function Ka(){let e=(0,Q.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(m,{id:`cs4mps`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`section`,{"aria-labelledby":Wa,className:`space-y-3`,"data-field":`section:sharing`,children:(0,$.jsx)(Ua,{titleId:Wa,title:t,scope:`project`,level:`block`,children:(0,$.jsx)(m,{id:`7YRrJ9`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{})}})})}),e[1]=n):n=e[1],n}function qa(){let e=(0,Q.c)(29),{_:t}=h(),[n,r]=(0,Z.useState)(null),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c;e[0]===t?c=e[1]:(c=async function(){let e=window.okDesktop?.sharing;if(e)try{r(await e.status())}catch(e){let n=e;X.error(n instanceof Error?n.message:t({id:`K0N7zS`})),r(Ya)}},e[0]=t,e[1]=c);let l=c,u;e[2]===l?u=e[3]:(u=()=>{l()},e[2]=l,e[3]=u);let d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=[],e[4]=d):d=e[4],(0,Z.useEffect)(u,d);let f;e[5]!==t||e[6]!==i||e[7]!==l||e[8]!==n?(f=async function(e){let r=window.okDesktop?.sharing;if(!r||n===null||i||n.mode===e)return;a(!0),s(null);let o=null,c=null;try{o=await r.setMode(e)}catch(e){c=e}if(a(!1),c!==null){X.error(c instanceof Error?c.message:t({id:`qZv5ZR`}));return}o!==null&&(o.kind===`refused-tracked`?(s({tracked:o.tracked,remediation:o.remediation}),X.error(t({id:`z2JdQ-`}),{duration:5e3})):o.kind===`no-exclude`?X.warning(o.reason===`no-git`?t({id:`YSFv5w`}):t({id:`8cS0nH`,values:{0:o.reason}})):X.success(t(e===`local-only`?{id:`wdzBgi`}:{id:`k_pade`})),await l())},e[5]=t,e[6]=i,e[7]=l,e[8]=n,e[9]=f):f=e[9];let p=f;if(n===null){let t;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Ua,{titleId:Wa,title:(0,$.jsx)(m,{id:`cs4mps`}),scope:`project`,level:`block`}),e[10]=t):t=e[10];let n;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`section`,{"aria-labelledby":Wa,className:`space-y-3`,"data-field":`section:sharing`,children:[t,(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(m,{id:`eQn7nI`})}),(0,$.jsx)(Ii,{className:`h-24`})]})]}),e[11]=n):n=e[11],n}let g=n.mode===`no-git`,_;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(m,{id:`cs4mps`}),e[12]=_):_=e[12];let v;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(Ua,{titleId:Wa,title:_,scope:`project`,level:`block`,adornment:(0,$.jsx)(ki,{}),children:(0,$.jsx)(m,{id:`N55YNr`})}),e[13]=v):v=e[13];let y;e[14]!==i||e[15]!==g||e[16]!==p||e[17]!==n.mode?(y=g?(0,$.jsx)(`p`,{className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,role:`status`,"data-testid":`settings-sharing-no-git`,children:(0,$.jsx)(m,{id:`ju38ms`})}):(0,$.jsxs)(Oe,{value:n.mode,onValueChange:e=>void p(e),disabled:i,className:`gap-2`,"aria-labelledby":Wa,"data-testid":`settings-sharing-radiogroup`,children:[(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-local-only`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(De,{id:`settings-sharing-local-only`,value:`local-only`,"data-testid":`settings-sharing-local-only`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(m,{id:`QjzFZj`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`un-K1H`})})]})]}),(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-shared`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(De,{id:`settings-sharing-shared`,value:`shared`,"data-testid":`settings-sharing-shared`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(m,{id:`0Gd0NU`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`dJw2_7`})})]})]})]}),e[14]=i,e[15]=g,e[16]=p,e[17]=n.mode,e[18]=y):y=e[18];let b;e[19]===o?b=e[20]:(b=o===null?null:(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm`,role:`alert`,"data-testid":`settings-sharing-refusal`,children:[(0,$.jsx)(`p`,{className:`font-semibold`,children:(0,$.jsx)(m,{id:`ZscwQ0`})}),(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-relaxed`,children:o.remediation}),(0,$.jsx)(w,{variant:`outline`,size:`sm`,onClick:()=>s(null),children:(0,$.jsx)(m,{id:`1QfxQT`})})]}),e[19]=o,e[20]=b);let x;e[21]!==o||e[22]!==n.mode||e[23]!==n.trackedUpstream?(x=n.trackedUpstream.length>0&&n.mode!==`no-git`&&o===null?(0,$.jsxs)(`div`,{className:`space-y-1 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-tracked-info`,children:[(0,$.jsx)(`p`,{className:`font-medium`,children:(0,$.jsx)(m,{id:`LhWYpm`})}),(0,$.jsx)(`ul`,{className:`list-disc pl-5 font-mono text-xs text-muted-foreground`,children:n.trackedUpstream.map(Ja)}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`1XSMhZ`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]}):null,e[21]=o,e[22]=n.mode,e[23]=n.trackedUpstream,e[24]=x):x=e[24];let S;return e[25]!==y||e[26]!==b||e[27]!==x?(S=(0,$.jsxs)(`section`,{"aria-labelledby":Wa,className:`space-y-4`,"data-testid":`settings-sharing`,"data-field":`section:sharing`,children:[v,y,b,x]}),e[25]=y,e[26]=b,e[27]=x,e[28]=S):S=e[28],S}function Ja(e){return(0,$.jsx)(`li`,{children:e},e)}function Ya(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[]}}var Xa=`[a-z0-9](?:[a-z0-9-]*[a-z0-9])?`,Za=RegExp(`^${Xa}(?:\\.${Xa})*$`),Qa=/^[a-z][a-z0-9+.-]*:\/\//i;function $a(e){if(Qa.test(e))try{return new URL(e).host}catch{return null}let t=e.split(`/`)[0]??``;return t.slice(t.lastIndexOf(`@`)+1).replace(/:(?!\d+$).*$/,``)}function eo(e,t){let n=e.trim();if(n===``)return{ok:!1,reason:`empty`};let r=$a(n);if(r===null||r===``)return{ok:!1,reason:`invalid`};let i=Qt(r);return Za.test(i)?i===`github.com`?{ok:!1,reason:`github-com`}:t.has(i)?{ok:!1,reason:`duplicate`}:{ok:!0,host:i}:{ok:!1,reason:`invalid`}}function to(e){let t=e.git?.hosts??{};return Object.entries(t).filter(([,e])=>e?.provider===`github`).map(([e])=>e).sort((e,t)=>e.localeCompare(t))}function no(e){let t=(0,Q.c)(59),{binding:n}=e,{_:r}=h(),i=(0,Z.useId)(),a=(0,Z.useId)(),o;t[0]===n?o=t[1]:(o=()=>to(n.current()),t[0]=n,t[1]=o);let[s,c]=(0,Z.useState)(o),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(null),[p,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(null),y;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=new Map,t[2]=y):y=t[2];let b=(0,Z.useRef)(y),x=(0,Z.useRef)(null),S,C;t[3]===_?(S=t[4],C=t[5]):(S=()=>{_!==null&&(((_.host===null?null:b.current.get(_.host))??x.current)?.focus(),v(null))},C=[_],t[3]=_,t[4]=S,t[5]=C),(0,Z.useEffect)(S,C);let T,E;t[6]===n?(T=t[7],E=t[8]):(T=()=>n.subscribe(e=>c(to(e))),E=[n],t[6]=n,t[7]=T,t[8]=E),(0,Z.useEffect)(T,E);let D;t[9]===r?D=t[10]:(D=function(e){switch(e){case`empty`:return r({id:`cFONFy`});case`invalid`:return r({id:`QsnBxE`});case`github-com`:return r({id:`UK3GW4`});case`duplicate`:return r({id:`DEkRZA`})}},t[9]=r,t[10]=D);let O=D,k;t[11]!==n||t[12]!==l||t[13]!==s||t[14]!==O?(k=function(e){e.preventDefault();let t=eo(l,new Set(s.map(ro)));if(!t.ok){f(O(t.reason));return}let r=n.patch({git:{hosts:{[t.host]:{provider:`github`}}}});if(!r.ok){f(jt(r.error));return}c(to(r.effective)),u(``),f(null),g(!0)},t[11]=n,t[12]=l,t[13]=s,t[14]=O,t[15]=k):k=t[15];let A=k,j;t[16]!==n||t[17]!==s?(j=function(e){let t=s.indexOf(e),r=s[t+1]??s[t-1]??null,i=n.patch({git:{hosts:{[e]:null}}});if(!i.ok){f(jt(i.error));return}c(to(i.effective)),v({host:r}),f(null),g(!0)},t[16]=n,t[17]=s,t[18]=j):j=t[18];let M=j,N;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(`h4`,{id:`settings-enterprise-hosts-title`,className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`J2-D_a`})}),t[19]=N):N=t[19];let P;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(m,{id:`PgY2nN`}),t[20]=P):P=t[20];let F;t[21]===i?F=t[22]:(F=(0,$.jsxs)(`div`,{children:[N,(0,$.jsx)(`p`,{id:i,className:`text-1sm text-muted-foreground`,children:P})]}),t[21]=i,t[22]=F);let I;t[23]!==r||t[24]!==M||t[25]!==s?(I=s.length>0?(0,$.jsx)(`ul`,{className:`space-y-1`,"data-testid":`settings-enterprise-hosts-list`,children:s.map(e=>(0,$.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs`,children:e}),(0,$.jsx)(w,{variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":r({id:`xVMoYb`,values:{host:e}}),ref:t=>{t?b.current.set(e,t):b.current.delete(e)},onClick:()=>M(e),children:(0,$.jsx)(Wr,{"aria-hidden":`true`})})]},e))}):(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-enterprise-hosts-empty`,children:(0,$.jsx)(m,{id:`HK2eIK`})}),t[23]=r,t[24]=M,t[25]=s,t[26]=I):I=t[26];let L;t[27]===r?L=t[28]:(L=r({id:`Qbf7Q4`}),t[27]=r,t[28]=L);let R=d!==null,z=d===null?i:`${i} ${a}`,B;t[29]===d?B=t[30]:(B=e=>{u(e.target.value),d!==null&&f(null)},t[29]=d,t[30]=B);let V;t[31]!==l||t[32]!==L||t[33]!==R||t[34]!==z||t[35]!==B?(V=(0,$.jsx)(oi,{ref:x,value:l,"aria-label":L,placeholder:`github.example.com`,autoComplete:`off`,spellCheck:!1,inputMode:`url`,className:`h-7 flex-1 font-mono text-xs`,"aria-invalid":R,"aria-describedby":z,onChange:B}),t[31]=l,t[32]=L,t[33]=R,t[34]=z,t[35]=B,t[36]=V):V=t[36];let H;t[37]===l?H=t[38]:(H=l.trim(),t[37]=l,t[38]=H);let U=H===``,W;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(m,{id:`ALFlyF`}),t[39]=W):W=t[39];let G;t[40]===U?G=t[41]:(G=(0,$.jsx)(w,{type:`submit`,size:`sm`,variant:`secondary`,disabled:U,className:`h-7 px-2 font-normal text-xs`,children:W}),t[40]=U,t[41]=G);let K;t[42]!==A||t[43]!==V||t[44]!==G?(K=(0,$.jsxs)(`form`,{className:`flex items-center gap-2 pt-1`,onSubmit:A,noValidate:!0,children:[V,G]}),t[42]=A,t[43]=V,t[44]=G,t[45]=K):K=t[45];let ee;t[46]!==d||t[47]!==a?(ee=d===null?null:(0,$.jsx)(`p`,{id:a,role:`alert`,className:`text-1sm text-destructive`,children:d}),t[46]=d,t[47]=a,t[48]=ee):ee=t[48];let te;t[49]===p?te=t[50]:(te=p?(0,$.jsx)(`p`,{role:`status`,className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`3LuFP-`})}):null,t[49]=p,t[50]=te);let q;t[51]!==I||t[52]!==K||t[53]!==ee||t[54]!==te?(q=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-lg border bg-card p-3`,children:[I,K,ee,te]}),t[51]=I,t[52]=K,t[53]=ee,t[54]=te,t[55]=q):q=t[55];let J;return t[56]!==F||t[57]!==q?(J=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-enterprise-hosts-title`,className:`space-y-4 pt-5`,"data-field":`section:enterprise-hosts`,"data-testid":`settings-enterprise-hosts`,children:[F,q]}),t[56]=F,t[57]=q,t[58]=J):J=t[58],J}function ro(e){return Qt(e)}function io(e){let t=(0,Q.c)(38),{authQueryTransport:n,authTransport:r,userBinding:i}=e,{_:a}=h(),o;t[0]===n?o=t[1]:(o=n??tr(),t[0]=n,t[1]=o);let s=o,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c={phase:`loading`},t[2]=c):c=t[2];let[l,u]=(0,Z.useState)(c),[d,f]=(0,Z.useState)(!1),[p,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(null),y=(0,Z.useRef)(!1),b;t[3]===s?b=t[4]:(b=async function(){u({phase:`loading`});try{let e=await s.status();u({phase:`loaded`,result:e}),br(e)}catch(e){console.warn(`[AccountSection] GitHub status check failed`,e),u({phase:`check-failed`})}},t[3]=s,t[4]=b);let x=b,S;t[5]===x?S=t[6]:(S=()=>{x()},t[5]=x,t[6]=S);let C;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(C=[],t[7]=C):C=t[7],(0,Z.useEffect)(S,C);let T;t[8]!==a||t[9]!==x||t[10]!==s?(T=async function(){if(y.current)return;y.current=!0,f(!1),g(!0),v(null);let e=null;try{let t=s.signout?await s.signout():{ok:!1,error:a({id:`8cpOa8`})};t.ok||(e=t.error??a({id:`8cpOa8`}))}catch(t){console.warn(`[AccountSection] GitHub disconnect failed`,t),e=a({id:`8cpOa8`})}await x(),e&&v(e),g(!1),y.current=!1},t[8]=a,t[9]=x,t[10]=s,t[11]=T):T=t[11];let E=T,D;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(m,{id:`AeXO77`}),t[12]=D):D=t[12];let O;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(Ua,{titleId:`settings-account-title`,title:D,scope:`user`,children:(0,$.jsx)(m,{id:`E6lrpp`})}),t[13]=O):O=t[13];let k;t[14]!==_||t[15]!==p||t[16]!==E||t[17]!==x||t[18]!==l.phase||t[19]!==l.result?(k=l.phase===`loading`?(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-loading`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(m,{id:`IWGfGF`})}),(0,$.jsx)(Ii,{className:`h-4 w-40`}),(0,$.jsx)(Ii,{className:`h-8 w-32`})]}):l.phase===`check-failed`?(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-check-failed`,children:[(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`T_wG4n`})}),(0,$.jsx)(w,{variant:`outline`,size:`sm`,onClick:()=>void x(),children:(0,$.jsx)(m,{id:`KDw4GX`})})]}):l.result.authenticated?l.result.tier===`A`?(0,$.jsx)(oo,{login:l.result.login}):(0,$.jsx)(ao,{login:l.result.login,disconnecting:p,error:_,onDisconnect:()=>void E()}):l.result.unsupportedOrigin===void 0?(0,$.jsx)(co,{onConnect:()=>f(!0)}):(0,$.jsx)(so,{host:l.result.unsupportedOrigin.host}),t[14]=_,t[15]=p,t[16]=E,t[17]=x,t[18]=l.phase,t[19]=l.result,t[20]=k):k=t[20];let A;t[21]===i?A=t[22]:(A=(0,$.jsx)(no,{binding:i}),t[21]=i,t[22]=A);let j;t[23]===x?j=t[24]:(j=e=>{f(e),e||x()},t[23]=x,t[24]=j);let M=l.phase===`loaded`?l.result.host:void 0,N=l.phase===`loaded`?l.result.ghAvailable:void 0,P;t[25]===x?P=t[26]:(P=()=>{x()},t[25]=x,t[26]=P);let F;t[27]!==d||t[28]!==r||t[29]!==j||t[30]!==M||t[31]!==N||t[32]!==P?(F=(0,$.jsx)(sr,{open:d,onOpenChange:j,transport:r,host:M,ghAvailable:N,onSuccess:P}),t[27]=d,t[28]=r,t[29]=j,t[30]=M,t[31]=N,t[32]=P,t[33]=F):F=t[33];let I;return t[34]!==A||t[35]!==F||t[36]!==k?(I=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-3`,"data-testid":`settings-account`,children:[O,k,A,F]}),t[34]=A,t[35]=F,t[36]=k,t[37]=I):I=t[37],I}function ao(e){let t=(0,Q.c)(20),{login:n,disconnecting:r,error:i,onDisconnect:a}=e,o;t[0]===n?o=t[1]:(o=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(m,{id:`nxlOpL`})}),t[2]=s):s=t[2];let c;t[3]===o?c=t[4]:(c=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[o,s]}),t[3]=o,t[4]=c);let l;t[5]===r?l=t[6]:(l=r?(0,$.jsx)(m,{id:`rppgXF`}):(0,$.jsx)(m,{id:`-K0AvT`}),t[5]=r,t[6]=l);let u;t[7]!==r||t[8]!==a||t[9]!==l?(u=(0,$.jsx)(w,{variant:`outline`,onClick:a,disabled:r,"aria-describedby":`settings-account-disconnect-caveat`,"data-testid":`settings-account-disconnect`,children:l}),t[7]=r,t[8]=a,t[9]=l,t[10]=u):u=t[10];let d;t[11]!==c||t[12]!==u?(d=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[c,u]}),t[11]=c,t[12]=u,t[13]=d):d=t[13];let f;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`p`,{id:`settings-account-disconnect-caveat`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-account-disconnect-caveat`,children:(0,$.jsx)(m,{id:`msOK6I`})}),t[14]=f):f=t[14];let p;t[15]===i?p=t[16]:(p=i?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-account-disconnect-error`,children:i}):null,t[15]=i,t[16]=p);let h;return t[17]!==d||t[18]!==p?(h=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-connected`,children:[d,f,p]}),t[17]=d,t[18]=p,t[19]=h):h=t[19],h}function oo(e){let t=(0,Q.c)(5),{login:n}=e,r;t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(m,{id:`ny6vNn`})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-gh-cli`,children:(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[r,i]})}),t[3]=r,t[4]=a),a}function so(e){let t=(0,Q.c)(3),{host:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`xBjIs7`})}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,$.jsxs)(`div`,{role:`status`,className:`space-y-1 rounded-md border p-3`,"data-testid":`settings-account-unsupported-origin`,children:[r,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:n===null?(0,$.jsx)(m,{id:`XBpH6-`}):(0,$.jsx)(m,{id:`7_I248`,values:{host:n}})})]}),t[1]=n,t[2]=i),i}function co(e){let t=(0,Q.c)(5),{onConnect:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`S33tz3`})}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[r,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(m,{id:`EJuO7B`})})]}),t[1]=i):i=t[1];let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(m,{id:`5lWFkC`}),t[2]=a):a=t[2];let o;return t[3]===n?o=t[4]:(o=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-disconnected`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[i,(0,$.jsx)(w,{onClick:n,"data-testid":`settings-account-connect`,children:a})]})}),t[3]=n,t[4]=o),o}function lo(e){if(e===void 0)return null;let t=e.params?.agent;if(typeof t!=`string`)return null;let n=Je[t]??t;return e.id===`followup.enable-manually`?fn._({id:`followup.enable-manually`,values:{agent:n}}):null}function uo(e){let{enabled:t,installedCount:n,presence:r,configurable:i,setupDocSlug:a,installUrl:o}=e,s=n>0,c=r===`absent`,l=()=>a===null?{kind:`none`}:{kind:`setup-doc`,slug:a};return c?o==null||o===``?l():{kind:`install`,url:o}:i?t?s?{kind:`manage`}:{kind:`connect`}:s?{kind:`remove`}:{kind:`none`}:s?{kind:`remove`}:l()}function fo(e){return e.presence===`absent`&&e.installedCount>0}function po(e){let t=(0,Q.c)(32),{icon:n,name:r,hint:i,status:a,action:o,checked:s,disabled:c,ariaLabel:l,testId:u,rowTestId:d,statusId:f,onToggle:p}=e,m=i?`${d}-hint`:void 0,h;t[0]===n?h=t[1]:(h=(0,$.jsx)(`span`,{className:`flex h-5 shrink-0 items-center`,children:n}),t[0]=n,t[1]=h);let g;t[2]===r?g=t[3]:(g=(0,$.jsx)(`span`,{className:`truncate text-sm leading-5`,children:r}),t[2]=r,t[3]=g);let _;t[4]!==i||t[5]!==m?(_=i?(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,$.jsx)(`span`,{id:m,className:`truncate text-muted-foreground text-1sm`,children:i.text}),i.action]}):null,t[4]=i,t[5]=m,t[6]=_):_=t[6];let v;t[7]!==a||t[8]!==f?(v=a?(0,$.jsx)(`span`,{id:f,children:a}):null,t[7]=a,t[8]=f,t[9]=v):v=t[9];let y;t[10]!==g||t[11]!==_||t[12]!==v?(y=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[g,_,v]}),t[10]=g,t[11]=_,t[12]=v,t[13]=y):y=t[13];let b;t[14]!==h||t[15]!==y?(b=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2.5`,children:[h,y]}),t[14]=h,t[15]=y,t[16]=b):b=t[16];let x;t[17]!==l||t[18]!==s||t[19]!==c||t[20]!==m||t[21]!==p||t[22]!==f||t[23]!==u?(x=p===void 0?null:(0,$.jsx)(ke,{checked:s??!1,disabled:c,onCheckedChange:p,"aria-label":l,"aria-describedby":[m,f].filter(Boolean).join(` `)||void 0,"data-testid":u}),t[17]=l,t[18]=s,t[19]=c,t[20]=m,t[21]=p,t[22]=f,t[23]=u,t[24]=x):x=t[24];let S;t[25]!==o||t[26]!==x?(S=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[o,x]}),t[25]=o,t[26]=x,t[27]=S):S=t[27];let C;return t[28]!==d||t[29]!==b||t[30]!==S?(C=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,"data-testid":d,children:[b,S]}),t[28]=d,t[29]=b,t[30]=S,t[31]=C):C=t[31],C}function mo(e,t){return e===`absent`&&!t}function ho(e){let t=(0,Q.c)(15),{label:n,labelIcon:r,subtitle:i,children:a,labelId:o}=e,s;t[0]!==n||t[1]!==r||t[2]!==o?(s=(0,$.jsxs)(`h4`,{id:o,tabIndex:-1,className:`flex items-center gap-1.5 font-mono text-muted-foreground text-xs uppercase tracking-wide`,children:[n,r]}),t[0]=n,t[1]=r,t[2]=o,t[3]=s):s=t[3];let c;t[4]===i?c=t[5]:(c=i?(0,$.jsx)(`p`,{className:`mt-1 text-muted-foreground text-xs`,children:i}):null,t[4]=i,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,$.jsxs)(`div`,{className:`mb-2`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]===a?u=t[10]:(u=(0,$.jsx)(`div`,{className:`divide-y overflow-hidden rounded-md border`,children:a}),t[9]=a,t[10]=u);let d;return t[11]!==o||t[12]!==l||t[13]!==u?(d=(0,$.jsxs)(`section`,{"aria-labelledby":o,children:[l,u]}),t[11]=o,t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function go(e){if(e)return()=>{e.ownerDocument.activeElement===e&&ya(e)?.focus()}}function _o(e){let t=(0,Q.c)(9),{hiddenCount:n,expanded:r,onToggle:i,testId:a}=e,{_:o}=h();if(n<=0)return null;let s;t[0]!==o||t[1]!==r||t[2]!==n?(s=o(r?{id:`6lGV3K`}:{id:`INN7OX`,values:{hiddenCount:n}}),t[0]=o,t[1]=r,t[2]=n,t[3]=s):s=t[3];let c;return t[4]!==r||t[5]!==i||t[6]!==s||t[7]!==a?(c=(0,$.jsx)(w,{ref:go,type:`button`,variant:`ghost`,onClick:i,"aria-expanded":r,className:`w-full justify-center rounded-none font-normal text-1sm text-muted-foreground`,"data-testid":a,children:s}),t[4]=r,t[5]=i,t[6]=s,t[7]=a,t[8]=c):c=t[8],c}function vo(e){let t=(0,Q.c)(10),{status:n,enabled:r}=e,{_:i}=h();if(n===`connected`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(jn,{"aria-hidden":!0,className:`size-3.5`}),t[0]=e):e=t[0];let n;t[1]===i?n=t[2]:(n=i({id:`QHcLEN`}),t[1]=i,t[2]=n);let r;return t[3]===n?r=t[4]:(r=(0,$.jsxs)(`span`,{className:`mt-0.5 inline-flex items-center gap-1 text-muted-foreground text-xs`,children:[e,n]}),t[3]=n,t[4]=r),r}if(n===`not-connected`&&r){let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Gr,{"aria-hidden":!0,className:`size-3.5`}),t[5]=e):e=t[5];let n;t[6]===i?n=t[7]:(n=i({id:`S33tz3`}),t[6]=i,t[7]=n);let r;return t[8]===n?r=t[9]:(r=(0,$.jsxs)(`span`,{className:`mt-0.5 inline-flex items-center gap-1 text-amber-700 text-xs dark:text-amber-400`,children:[e,n]}),t[8]=n,t[9]=r),r}return null}function yo(e){let t=(0,Q.c)(52),{action:n,rowLabel:r,describedById:i,onConfigure:a,onRemove:o}=e,{_:s}=h();switch(n.kind){case`none`:return null;case`install`:{let e=n.url,a;t[0]!==s||t[1]!==r?(a=s({id:`wfZwqe`,values:{rowLabel:r}}),t[0]=s,t[1]=r,t[2]=a):a=t[2];let o;t[3]===s?o=t[4]:(o=s({id:`TKQ7K-`}),t[3]=s,t[4]=o);let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(An,{"aria-hidden":!0}),t[5]=c):c=t[5];let l;return t[6]!==n.url||t[7]!==i||t[8]!==a||t[9]!==o?(l=(0,$.jsx)(w,{variant:`link`,size:`sm`,className:`shrink-0 text-muted-foreground hover:text-foreground`,asChild:!0,children:(0,$.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,"aria-label":a,"aria-describedby":i,children:[o,c]})}),t[6]=n.url,t[7]=i,t[8]=a,t[9]=o,t[10]=l):l=t[10],l}case`setup-doc`:{let e=`https://openknowledge.ai/docs/integrations/${n.slug}`,a;t[11]!==s||t[12]!==r?(a=s({id:`Kuw5NN`,values:{rowLabel:r}}),t[11]=s,t[12]=r,t[13]=a):a=t[13];let o;t[14]===s?o=t[15]:(o=s({id:`P_bX4O`}),t[14]=s,t[15]=o);let c;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(An,{"aria-hidden":!0}),t[16]=c):c=t[16];let l;return t[17]!==i||t[18]!==e||t[19]!==a||t[20]!==o?(l=(0,$.jsx)(w,{variant:`link`,size:`sm`,className:`shrink-0 text-muted-foreground hover:text-foreground`,asChild:!0,children:(0,$.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,"aria-label":a,"aria-describedby":i,children:[o,c]})}),t[17]=i,t[18]=e,t[19]=a,t[20]=o,t[21]=l):l=t[21],l}case`connect`:{let e;t[22]!==s||t[23]!==r?(e=s({id:`_uxBz5`,values:{rowLabel:r}}),t[22]=s,t[23]=r,t[24]=e):e=t[24];let n;t[25]===s?n=t[26]:(n=s({id:`q63KUv`}),t[25]=s,t[26]=n);let o;return t[27]!==i||t[28]!==a||t[29]!==e||t[30]!==n?(o=(0,$.jsx)(w,{size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:a,"aria-label":e,"aria-describedby":i,children:n}),t[27]=i,t[28]=a,t[29]=e,t[30]=n,t[31]=o):o=t[31],o}case`manage`:{let e;t[32]!==s||t[33]!==r?(e=s({id:`wSBXaS`,values:{rowLabel:r}}),t[32]=s,t[33]=r,t[34]=e):e=t[34];let n;t[35]===s?n=t[36]:(n=s({id:`wckWOP`}),t[35]=s,t[36]=n);let o;return t[37]!==i||t[38]!==a||t[39]!==e||t[40]!==n?(o=(0,$.jsx)(w,{variant:`outline`,size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:a,"aria-label":e,"aria-describedby":i,children:n}),t[37]=i,t[38]=a,t[39]=e,t[40]=n,t[41]=o):o=t[41],o}case`remove`:{let e;t[42]!==s||t[43]!==r?(e=s({id:`vRlzx-`,values:{rowLabel:r}}),t[42]=s,t[43]=r,t[44]=e):e=t[44];let n;t[45]===s?n=t[46]:(n=s({id:`t_YqKh`}),t[45]=s,t[46]=n);let a;return t[47]!==i||t[48]!==o||t[49]!==e||t[50]!==n?(a=(0,$.jsx)(w,{variant:`outline`,size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:o,"aria-label":e,"aria-describedby":i,children:n}),t[47]=i,t[48]=o,t[49]=e,t[50]=n,t[51]=a):a=t[51],a}}}function bo(e){let t=(0,Q.c)(9),{rowLabel:n,onRemove:r}=e,{_:i}=h(),a;t[0]!==i||t[1]!==n?(a=i({id:`vRlzx-`,values:{rowLabel:n}}),t[0]=i,t[1]=n,t[2]=a):a=t[2];let o;t[3]===i?o=t[4]:(o=i({id:`t_YqKh`}),t[3]=i,t[4]=o);let s;return t[5]!==r||t[6]!==a||t[7]!==o?(s=(0,$.jsx)(w,{type:`button`,variant:`link-muted`,className:`h-auto p-0 text-1sm underline underline-offset-4 hover:text-destructive`,onClick:r,"aria-label":a,children:o}),t[5]=r,t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function xo(e){return e===void 0?null:yt[e].external?.installUrl??null}function So(e){return e!==null&&Object.values(e.probes.satisfiers).some(e=>e!==void 0&&e.state!==`unprobed`)}function Co(e){return`${e.source}:${e.id}`}function wo(e,t,n){let r=t.has(Co(n)),i=qe(n);return Ne(e,n.source,n.id,r||i,n.supported)}function To(e,t,n){return n.harness!==void 0&&Ge(n)===0||wo(e,t,n)}function Eo(e,t,n){let r=new Set(n.map(e=>Co(e))),i=e=>To(t,r,e),a=[...e].sort((e,t)=>Number(i(t))-Number(i(e))||e.name.localeCompare(t.name));return{primaryKeys:new Set(a.filter(i).map(Co)),ranks:new Map(a.map((e,t)=>[Co(e),t]))}}function Do(e,t,n,r){let i=t.filter(t=>!e.ranks.has(Co(t)));if(i.length===0)return e;let a=new Set(r.map(e=>Co(e))),o=e=>To(n,a,e),s=i.filter(o).sort((e,t)=>e.name.localeCompare(t.name)),c=i.filter(e=>!o(e)).sort((e,t)=>e.name.localeCompare(t.name)),l=[...e.ranks.entries()].sort(([,e],[,t])=>e-t).map(([e])=>e),u=l.filter(t=>e.primaryKeys.has(t)),d=l.filter(t=>!e.primaryKeys.has(t)),f=[...u,...s.map(Co),...d,...c.map(Co)];return{primaryKeys:new Set([...e.primaryKeys,...s.map(Co)]),ranks:new Map(f.map((e,t)=>[e,t]))}}function Oo(e){let t=(0,Q.c)(124),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{applyConnections:r}=n,i=r===void 0?Ia:r,{_:a}=h(),o=Ie(),s=We(),{states:c,refresh:l}=kr(),u=Ar(),[d,f]=(0,Z.useState)(``),[p,m]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(!1),[y,b]=(0,Z.useState)(!1),[x,S]=(0,Z.useState)(null),[C,T]=(0,Z.useState)(!1),[E,D]=(0,Z.useState)(!1),[O,k]=(0,Z.useState)(0),[A,j]=(0,Z.useState)(null),[M,N]=(0,Z.useState)(null),P=(0,Z.useRef)(null),F=(0,Z.useRef)(0),I;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(I={queryKey:[`acp-catalog`],queryFn:Ro,staleTime:3e5},t[2]=I):I=t[2];let L=g(I),R;t[3]!==L.data||t[4]!==o||t[5]!==s?(R=()=>L.data===void 0?null:Eo(L.data.agents,o,s),t[3]=L.data,t[4]=o,t[5]=s,t[6]=R):R=t[6];let[z,B]=(0,Z.useState)(R),V=z??Eo([],o,s);if(L.data!==void 0){let e;t[7]!==L.data.agents||t[8]!==z||t[9]!==o||t[10]!==s?(e=z===null?Eo(L.data.agents,o,s):Do(z,L.data.agents,o,s),t[7]=L.data.agents,t[8]=z,t[9]=o,t[10]=s,t[11]=e):e=t[11];let n=e;n!==z&&B(n),V=n}let H;t[12]===l?H=t[13]:(H=()=>{l()},t[12]=l,t[13]=H);let U=(0,Z.useEffectEvent)(H),W;t[14]===U?W=t[15]:(W=()=>{U()},t[14]=U,t[15]=W);let G;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(G=[],t[16]=G):G=t[16],(0,Z.useEffect)(W,G);let K;t[17]===i?K=t[18]:(K=()=>{let e=!0,t=F.current+=1;return i([]).then(n=>{!e||F.current!==t||(n.snapshot!==null&&S(n.snapshot),T(!So(n.snapshot)),D(n.unavailable===!0))}).catch(()=>{e&&F.current===t&&T(!0)}),()=>{e=!1}},t[17]=i,t[18]=K);let ee;t[19]!==i||t[20]!==O?(ee=[i,O],t[19]=i,t[20]=O,t[21]=ee):ee=t[21],(0,Z.useEffect)(K,ee);let te=L.data?.agents,q=new Set(s.map(Lo)),J;t[22]===u?.installedClis?J=t[23]:(J=u?.installedClis??{},t[22]=u?.installedClis,t[23]=J);let Y=J,ne=x===null?[]:Fa(x),re=ne.find(e=>e.id===A)??null,ie=ne.find(e=>e.id===M)??null,ae;t[24]===i?ae=t[25]:(ae=async function(e){let t=await i(e);return F.current+=1,t.snapshot!==null&&S(t.snapshot),T(!So(t.snapshot)),t.unavailable===!0&&D(!0),t},t[24]=i,t[25]=ae);let oe=ae,se;t[26]===x?se=t[27]:(se=function(e,t){return t===!1?`absent`:t===!0?`present`:e===void 0?`unknown`:Ea(e,x,t)},t[26]=x,t[27]=se);let ce=se,le;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(le=new Set(rt.map(It).filter(Io)),t[28]=le):le=t[28];let ue=le,de;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(de=new Set(nt.map(Fo).filter(Po)),t[29]=de):de=t[29];let fe=de,pe;t[30]!==Y||t[31]!==ce||t[32]!==c?(pe=function(e,t){if(t===`terminal`){let t=yt[e].external?.targetId;return t===void 0?`unknown`:ce(e,c[t]?.installed??null)}let n=rt.find(t=>It(t)===e);return n===void 0?`unknown`:ce(e,Y[n]??null)},t[30]=Y,t[31]=ce,t[32]=c,t[33]=pe):pe=t[33];let me=pe,he=function(e,t,n,r,i,a,o,s){let c=e===void 0?void 0:ne.find(t=>t.id===e);if(c===void 0||e===void 0||x===null||!So(x))return{status:void 0,action:void 0,hintAction:void 0,residualFiles:!1,statusId:void 0};let l={enabled:i,installedCount:ja(Ta(c)),presence:o,configurable:Sa(c),setupDocSlug:c.row.setupDocSlug,installUrl:s===void 0?yt[e].external?.installUrl??null:s},u=uo(l),d=Ca(e)&&me(e,r)!==`absent`,f=fo(l)&&!d,p=Pa({agentId:e,mode:r,snapshot:x,detected:a}),m=p===`connected`||p===`not-connected`&&i,h=m?`${n}-status`:void 0,g=!E||u.kind===`install`||u.kind===`setup-doc`,_=c.cells.projectMcp,v=_===void 0||!Ca(e)||Ma(_.consentClass)===r?lo(ka({agentId:e,mode:r,snapshot:x,detected:a,projectMcp:_})):null;return{status:m?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(vo,{status:p,enabled:i}),v===null?null:(0,$.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground text-xs`,"data-testid":`${n}-followup`,children:v})]}):void 0,action:g?(0,$.jsx)(yo,{action:u,rowLabel:t,describedById:h,onConfigure:()=>j(e),onRemove:()=>N(e)}):void 0,hintAction:f&&!E?(0,$.jsx)(bo,{rowLabel:t,onRemove:()=>N(e)}):void 0,residualFiles:f,statusId:h}},ge;t[34]===a?ge=t[35]:(ge=function(e,t){return a(e===`not-installed`?t?{id:`06Ucfz`}:{id:`5SwVv1`}:t?{id:`V0Jk_K`}:{id:`EDD3UL`})},t[34]=a,t[35]=ge);let _e=ge,ve=function(e,t,n,r,i){if(Ue(e,r),!r||E||t===void 0||x===null)return;let a=ne.find(e=>e.id===t);a===void 0||!Sa(a)||Pa({agentId:t,mode:n,snapshot:x,detected:i})===`not-connected`&&(P.current=e,j(t))},ye;t[36]!==te||t[37]!==o||t[38]!==s?(ye=function(){te!==void 0&&B(Eo(te,o,s))},t[36]=te,t[37]=o,t[38]=s,t[39]=ye):ye=t[39];let be=ye,xe;t[40]!==d||t[41]!==be?(xe=function(e){d.trim()!==``&&e.trim()===``&&be(),f(e)},t[40]=d,t[41]=be,t[42]=xe):xe=t[42];let Se=xe,Ce;t[43]!==be||t[44]!==p?(Ce=function(){p&&be(),m(!p)},t[43]=be,t[44]=p,t[45]=Ce):Ce=t[45];let we=Ce,Te=d.trim().toLowerCase(),Ee=e=>Te===``||e.toLowerCase().includes(Te),De=(te??[]).filter(e=>Ee(e.name)),Oe;t[46]===Y?Oe=t[47]:(Oe=e=>Y[e]!==!1,t[46]=Y,t[47]=Oe);let ke=Oe,Ae;t[48]===ke?Ae=t[49]:(Ae=(e,t)=>Number(ke(t))-Number(ke(e))||xt[e].displayName.localeCompare(xt[t].displayName),t[48]=ke,t[49]=Ae);let je=rt.filter(e=>{let{displayName:t}=xt[e];return Ee(t)||Ee(a({id:`QYfQdv`,values:{displayName:t}}))||Ee(e)}).sort(Ae),Me;t[50]!==ce||t[51]!==c?(Me=e=>ce(mt(e),c[e]?.installed??null),t[50]=ce,t[51]=c,t[52]=Me):Me=t[52];let Ge=Me,Ke;t[53]===Ge?Ke=t[54]:(Ke=(e,t)=>Number(Ge(e.id)===`absent`)-Number(Ge(t.id)===`absent`),t[53]=Ge,t[54]=Ke);let Je=nt.filter(e=>{let{displayName:t}=e;return Ee(a({id:`CZBqrX`,values:{displayName:t}}))||Ee(e.id)}).sort(Ke),Ye=u!==null,Xe;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=new Set([...ue,...fe]),t[55]=Xe):Xe=t[55];let Ze=Xe,Qe=$e.filter(e=>!Ze.has(e)&&Ee(Da(e))),et=Te!==``,tt=!L.isLoading&&!L.isError,it=et&&tt&&De.length===0&&je.length===0&&Je.length===0&&Qe.length===0,at=!et||L.isLoading||L.isError||De.length>0,ot=!et||je.length>0,st=!et||Je.length>0||Qe.length>0,ct=e=>wo(o,q,e),lt=e=>V.primaryKeys.has(Co(e)),ut=e=>V.ranks.get(Co(e))??2**53-1,dt=De.filter(lt),ft=[...et||p?De:dt].sort((e,t)=>ut(e)-ut(t)||e.name.localeCompare(t.name)),pt=et?0:De.length-dt.length,ht=je.filter(ke),gt=ht.length>0&&ht.length<je.length,_t=!gt||et||_?je:ht,vt=gt&&!et?je.length-ht.length:0,bt;t[56]===Ge?bt=t[57]:(bt=e=>Ge(e.id)!==`absent`,t[56]=Ge,t[57]=bt);let St=Je.filter(bt),Ct=Qe.filter(e=>ce(e,ne.find(t=>t.id===e)?.row.detected??null)!==`absent`),wt=St.length+Ct.length,Tt=Je.length+Qe.length,Et=wt>0&&wt<Tt,Dt=!Et||et||y,Ot=Dt?Je:St,kt=Dt?Qe:Ct,At=Et&&!et?Tt-wt:0,jt=!tt||De.some(qe),Mt=Ye&&je.some(ke),Nt;t[58]===c?Nt=t[59]:(Nt=e=>c[e.id]?.installed===!0,t[58]=c,t[59]=Nt);let Pt=Je.some(Nt),Ft=at?(0,$.jsx)(ho,{label:a({id:`RXEbZy`}),labelId:`settings-configure-agents-in-app`,children:L.isLoading?(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-2 px-3 py-6 text-muted-foreground text-sm`,children:[(0,$.jsx)(Lr,{className:`size-4`,"aria-hidden":`true`}),a({id:`ucXZ0k`})]}):L.isError?(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-3 py-6 text-center text-muted-foreground text-sm`,children:[(0,$.jsx)(Ba,{className:`size-5`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:a({id:`FqGWeR`})}),(0,$.jsx)(w,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void L.refetch(),children:a({id:`6gRgw8`})})]}):(te?.length??0)===0?(0,$.jsx)(`p`,{className:`px-3 py-6 text-center text-muted-foreground text-sm`,children:a({id:`QQbwzK`})}):(0,$.jsxs)($.Fragment,{children:[ft.map(e=>{let t=Co(e),n=ct(e),r=e.supported?e.description:a({id:`5jEnaB`});return(0,$.jsx)(po,{icon:(0,$.jsx)(He,{agentId:e.id,iconUrl:e.iconUrl,className:`size-4`}),name:e.name,hint:r===void 0?void 0:{text:r},checked:n,disabled:!e.supported,ariaLabel:a({id:`FZtBeR`,values:{0:e.name}}),testId:`configure-agents-in-app-${t}`,rowTestId:`configure-agents-in-app-row-${t}`,onToggle:n=>{n?(Le({source:e.source,id:e.id,name:e.name,supported:e.supported,featured:e.featured,...e.iconUrl===void 0?{}:{iconUrl:e.iconUrl}},{makeDefault:!1}),Ue(Be(e.source,e.id),!0)):(Ue(Be(e.source,e.id),!1),Re(t,e=>Ne(o,e.source,e.id,!0,e.supported)))}},t)}),(0,$.jsx)(_o,{hiddenCount:pt,expanded:p,onToggle:we,testId:`configure-agents-in-app-show-more`})]})},`in-app`):null,Lt=ot?(0,$.jsxs)(ho,{label:a({id:`ALhMYW`}),labelId:`settings-configure-agents-terminal`,children:[_t.map(e=>{let{displayName:t}=xt[e],n=Y[e]??null,r=ce(It(e),n),i=Ve(o,e,r===`absent`),s=`configure-agents-terminal-row-${e}`,{status:c,action:l,hintAction:u,residualFiles:d,statusId:f}=he(It(e),a({id:`QYfQdv`,values:{displayName:t}}),s,`terminal`,i,n,r,xo(It(e))??xt[e].docsUrl);return(0,$.jsx)(po,{icon:(0,$.jsx)(bn,{id:Pi(e),className:`size-4`,"aria-hidden":`true`}),name:a({id:`QYfQdv`,values:{displayName:t}}),hint:r===`absent`?{text:_e(`not-installed`,d),action:u}:void 0,status:c,action:l,checked:i,disabled:mo(r,i),ariaLabel:a({id:`27TLNq`,values:{displayName:t}}),testId:`configure-agents-terminal-${e}`,rowTestId:s,statusId:f,onToggle:Ye?t=>ve(Fe(e),It(e),`terminal`,t,Y[e]??null):void 0},e)}),(0,$.jsx)(_o,{hiddenCount:vt,expanded:_,onToggle:()=>v(No),testId:`configure-agents-terminal-show-more`})]},`terminal`):null,Rt=st?(0,$.jsxs)(ho,{label:a({id:`BwKH4d`}),labelId:`settings-configure-agents-desktop`,labelIcon:(0,$.jsx)(An,{"aria-hidden":`true`,className:`size-3`}),children:[Ot.map(e=>{let t=c[e.id]?.installed??null,{displayName:n}=e,r=ze(o,e.id,t),i=ce(mt(e.id),t),s=`configure-agents-desktop-row-${e.id}`,{status:l,action:u,hintAction:d,residualFiles:f,statusId:p}=he(mt(e.id),a({id:`CZBqrX`,values:{displayName:n}}),s,`external`,r,t,i);return(0,$.jsx)(po,{icon:(0,$.jsx)(bn,{id:e.id,className:`size-4`,"aria-hidden":`true`}),name:a({id:`CZBqrX`,values:{displayName:n}}),hint:i===`absent`?{text:_e(`not-installed`,f),action:d}:void 0,status:l,action:u,checked:r,disabled:mo(i,r),ariaLabel:a({id:`cdBape`,values:{displayName:n}}),testId:`configure-agents-desktop-${e.id}`,rowTestId:s,statusId:p,onToggle:n=>ve(Pe(e.id),mt(e.id),`external`,n,t)},e.id)}),kt.map(e=>{let t=ne.find(t=>t.id===e)??null,n=t?.row.detected??null,r=Da(e),i=ce(e,n),a=`agent-connection-${e}`,o=he(e,r,a,`external`,t===null||!xa(t),n,i);return(0,$.jsx)(po,{icon:(0,$.jsx)(Aa,{agentId:e,className:`size-4 text-muted-foreground`}),name:r,hint:i===`absent`?{text:_e(`not-detected`,o.residualFiles),action:o.hintAction}:void 0,status:o.status,action:o.action,ariaLabel:r,testId:`configure-agents-unlaunchable-${e}`,rowTestId:a,statusId:o.statusId},e)}),(0,$.jsx)(_o,{hiddenCount:At,expanded:y,onToggle:()=>b(Mo),testId:`configure-agents-desktop-show-more`})]},`desktop`):null,zt=[{node:Ft,hasPresent:jt},{node:Lt,hasPresent:Mt},{node:Rt,hasPresent:Pt}].sort(jo).map(Ao),Bt;t[60]===a?Bt=t[61]:(Bt=a({id:`lBN3T6`}),t[60]=a,t[61]=Bt);let Vt;t[62]===a?Vt=t[63]:(Vt=a({id:`D4I0F9`}),t[62]=a,t[63]=Vt);let Ht;t[64]!==Bt||t[65]!==Vt?(Ht=(0,$.jsx)(Ua,{titleId:`settings-configure-agents-title`,title:Bt,children:Vt}),t[64]=Bt,t[65]=Vt,t[66]=Ht):Ht=t[66];let Ut;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(Ut=(0,$.jsx)(hn,{className:`-translate-y-1/2 absolute top-1/2 start-2.5 size-4 text-muted-foreground`,"aria-hidden":`true`}),t[67]=Ut):Ut=t[67];let Wt;t[68]===Se?Wt=t[69]:(Wt=e=>Se(e.target.value),t[68]=Se,t[69]=Wt);let Gt;t[70]===a?Gt=t[71]:(Gt=a({id:`-7s4fw`}),t[70]=a,t[71]=Gt);let Kt;t[72]===a?Kt=t[73]:(Kt=a({id:`-7s4fw`}),t[72]=a,t[73]=Kt);let qt;t[74]!==d||t[75]!==Wt||t[76]!==Gt||t[77]!==Kt?(qt=(0,$.jsxs)(`div`,{className:`relative`,children:[Ut,(0,$.jsx)(oi,{value:d,onChange:Wt,placeholder:Gt,"aria-label":Kt,className:`ps-8`,"data-testid":`configure-agents-search`})]}),t[74]=d,t[75]=Wt,t[76]=Gt,t[77]=Kt,t[78]=qt):qt=t[78];let Jt;t[79]!==a||t[80]!==E?(Jt=E?(0,$.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2 rounded-md border px-3 py-2.5 text-muted-foreground text-sm`,"data-testid":`configure-agents-read-only`,children:[(0,$.jsx)(Gr,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{children:a({id:`RD8cCw`})})]}):null,t[79]=a,t[80]=E,t[81]=Jt):Jt=t[81];let Yt;t[82]!==a||t[83]!==C?(Yt=C?(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border px-3 py-2.5 text-muted-foreground text-sm`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Ba,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{role:`status`,children:a({id:`4sE6E9`})})]}),(0,$.jsx)(w,{type:`button`,variant:`outline`,size:`sm`,className:`shrink-0`,onClick:()=>k(ko),children:a({id:`6gRgw8`})})]}):null,t[82]=a,t[83]=C,t[84]=Yt):Yt=t[84];let Xt;t[85]!==a||t[86]!==it?(Xt=it?(0,$.jsx)(`p`,{className:`py-6 text-center text-muted-foreground text-sm`,"data-testid":`configure-agents-no-results`,children:a({id:`Nay2Yr`})}):null,t[85]=a,t[86]=it,t[87]=Xt):Xt=t[87];let Zt=`configure:${A??`closed`}`,Qt;t[88]===A?Qt=t[89]:(Qt=A!==null&&Ca(A),t[88]=A,t[89]=Qt);let $t=re!==null,en;t[90]===P?en=t[91]:(en=e=>{e||(P.current!==null&&(Ue(P.current,!1),P.current=null),j(null))},t[90]=P,t[91]=en);let tn;t[92]!==oe||t[93]!==re||t[94]!==P?(tn=(e,t)=>re===null?Promise.resolve({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null}):oe(Oa(re,e,t)).then(e=>(e.ok&&(P.current=null),e)),t[92]=oe,t[93]=re,t[94]=P,t[95]=tn):tn=t[95];let X;t[96]!==re||t[97]!==Zt||t[98]!==Qt||t[99]!==$t||t[100]!==en||t[101]!==tn?(X=(0,$.jsx)(ba,{connection:re,paired:Qt,open:$t,onOpenChange:en,onSave:tn},Zt),t[96]=re,t[97]=Zt,t[98]=Qt,t[99]=$t,t[100]=en,t[101]=tn,t[102]=X):X=t[102];let nn=`remove:${M??`closed`}`,rn;t[103]===M?rn=t[104]:(rn=M!==null&&Ca(M),t[103]=M,t[104]=rn);let an=ie!==null,on;t[105]===Symbol.for(`react.memo_cache_sentinel`)?(on=e=>{e||N(null)},t[105]=on):on=t[105];let sn;t[106]!==oe||t[107]!==ie?(sn=e=>ie===null?Promise.resolve({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null}):oe(wa(ie,e===void 0?[]:e)),t[106]=oe,t[107]=ie,t[108]=sn):sn=t[108];let cn;t[109]!==ie||t[110]!==nn||t[111]!==rn||t[112]!==an||t[113]!==sn?(cn=(0,$.jsx)(Na,{connection:ie,paired:rn,open:an,onOpenChange:on,onRemove:sn},nn),t[109]=ie,t[110]=nn,t[111]=rn,t[112]=an,t[113]=sn,t[114]=cn):cn=t[114];let ln;return t[115]!==zt||t[116]!==Ht||t[117]!==qt||t[118]!==Jt||t[119]!==Yt||t[120]!==Xt||t[121]!==X||t[122]!==cn?(ln=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-configure-agents-title`,className:`space-y-6`,"data-field":`section:agent-connections`,"data-testid":`settings-configure-agents`,children:[Ht,qt,Jt,Yt,Xt,zt,X,cn]}),t[115]=zt,t[116]=Ht,t[117]=qt,t[118]=Jt,t[119]=Yt,t[120]=Xt,t[121]=X,t[122]=cn,t[123]=ln):ln=t[123],ln}function ko(e){return e+1}function Ao(e){return e.node}function jo(e,t){return Number(t.hasPresent)-Number(e.hasPresent)}function Mo(e){return!e}function No(e){return!e}function Po(e){return e!==void 0}function Fo(e){return mt(e.id)}function Io(e){return e!==void 0}function Lo(e){return Co(e)}function Ro(e){let{signal:t}=e;return Ke(t)}var zo=`open-knowledge-app`;function Bo({from:e,to:t}){try{tn.getTracer(zo).startSpan(`ok.language.preferenceChanged`,{attributes:{"ok.language.from":e,"ok.language.to":t}}).end()}catch(e){console.warn(`[language-telemetry] span emit failed:`,e instanceof Error?e:String(e))}}var Vo=`open-knowledge-app`;function Ho(e){let t=e.light.startsWith(`saved-`),n=e.dark.startsWith(`saved-`);return!t||!n?`incomplete`:e.light===e.dark?`same`:`different`}function Uo(e){try{tn.getTracer(Vo).startSpan(`ok.saved_themes.assignment`,{attributes:{"saved_theme.pair":Ho(e)}}).end()}catch(e){console.warn(`[saved-theme-telemetry] assignment span emit failed:`,e instanceof Error?e:String(e))}}var Wo=`system`;function Go(e){return typeof e==`string`&&Mt.includes(e)}function Ko(e){return Go(e)?e:Wo}function qo(e){return new Intl.DisplayNames([e],{type:`language`}).of(e)??e}function Jo(e){let t=(0,Q.c)(6),{choice:n}=e;if(n===Wo){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(m,{id:`D-NlUC`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=qo(n),t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,$.jsx)(`span`,{lang:n,className:`capitalize`,children:r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Yo(e){let t=(0,Q.c)(22),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({value:o,onValueChange:r,onBlur:n,ref:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===o?s=t[7]:(s=Ko(o),t[6]=o,t[7]=s);let c=s,l;t[8]===r?l=t[9]:(l=e=>r(Ko(e)),t[8]=r,t[9]=l);let u;t[10]===c?u=t[11]:(u=(0,$.jsx)(Te,{children:(0,$.jsx)(Jo,{choice:c})}),t[10]=c,t[11]=u);let d;t[12]!==n||t[13]!==i||t[14]!==a||t[15]!==u?(d=(0,$.jsx)(we,{...a,ref:i,onBlur:n,size:`sm`,className:`w-48`,children:u}),t[12]=n,t[13]=i,t[14]=a,t[15]=u,t[16]=d):d=t[16];let f;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(Ce,{children:[(0,$.jsx)(Se,{value:Wo,children:(0,$.jsx)(Jo,{choice:Wo})}),Ye.map(Xo)]}),t[17]=f):f=t[17];let p;return t[18]!==c||t[19]!==l||t[20]!==d?(p=(0,$.jsxs)(Ee,{value:c,onValueChange:l,children:[d,f]}),t[18]=c,t[19]=l,t[20]=d,t[21]=p):p=t[21],p}function Xo(e){return(0,$.jsx)(Se,{value:e,children:(0,$.jsx)(Jo,{choice:e})},e)}function Zo(e){return{chrome:e.sidebar,surface:e.background,bar:e.primary,line:e.border,dots:[e[`syntax-string`],e[`syntax-keyword`],e[`syntax-atom`]]}}function Qo(e,t,n){return e.id===`custom`?Zo(At(bi(t))):e.scheme?Zo(At(e.scheme)):Zo(mi(n))}function $o(e){let t=(0,Q.c)(38),{theme:n,customSeed:r,slotMode:i}=e,a,o,s,c,l,u,d,f,p,m;t[0]!==r||t[1]!==i||t[2]!==n?(a=Qo(n,r,i),u=!0,d=``,f=`aspect-[4/3] w-full overflow-hidden rounded-md border`,p={backgroundColor:a.surface,borderColor:a.line},m=(0,$.jsxs)(`div`,{className:`flex h-1/3 items-center gap-1 px-1.5`,style:{backgroundColor:a.chrome,borderBottom:`1px solid ${a.line}`},children:[(0,$.jsx)(`span`,{className:`h-1.5 w-5 rounded-full`,style:{backgroundColor:a.bar}}),(0,$.jsx)(`span`,{className:`h-1.5 flex-1 rounded-full opacity-50`,style:{backgroundColor:a.line}})]}),l=`flex h-2/3`,o=`flex w-1/4 flex-col items-center justify-center gap-1`,s={backgroundColor:a.chrome,borderRight:`1px solid ${a.line}`},c=a.dots.map(es),t[0]=r,t[1]=i,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m):(a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]);let h;t[13]!==o||t[14]!==s||t[15]!==c?(h=(0,$.jsx)(`div`,{className:o,style:s,children:c}),t[13]=o,t[14]=s,t[15]=c,t[16]=h):h=t[16];let g;t[17]===a.dots[1]?g=t[18]:(g=(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-full`,style:{backgroundColor:a.dots[1]}}),t[17]=a.dots[1],t[18]=g);let _;t[19]===a.line?_=t[20]:(_=(0,$.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-full opacity-60`,style:{backgroundColor:a.line}}),t[19]=a.line,t[20]=_);let v;t[21]===a.dots[0]?v=t[22]:(v=(0,$.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-full`,style:{backgroundColor:a.dots[0]}}),t[21]=a.dots[0],t[22]=v);let y;t[23]!==g||t[24]!==_||t[25]!==v?(y=(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1 px-1.5`,children:[g,_,v]}),t[23]=g,t[24]=_,t[25]=v,t[26]=y):y=t[26];let b;t[27]!==h||t[28]!==y||t[29]!==l?(b=(0,$.jsxs)(`div`,{className:l,children:[h,y]}),t[27]=h,t[28]=y,t[29]=l,t[30]=b):b=t[30];let x;return t[31]!==b||t[32]!==u||t[33]!==d||t[34]!==f||t[35]!==p||t[36]!==m?(x=(0,$.jsxs)(`div`,{"aria-hidden":u,"data-theme-swatch":d,className:f,style:p,children:[m,b]}),t[31]=b,t[32]=u,t[33]=d,t[34]=f,t[35]=p,t[36]=m,t[37]=x):x=t[37],x}function es(e,t){return(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{backgroundColor:e}},t)}function ts(e){return b(`size-6 min-w-6 rounded-md border p-0 transition-colors`,e?`border-primary bg-primary/15 text-primary hover:bg-primary/20 data-[state=on]:bg-primary/15`:`border-border/70 text-muted-foreground/70 hover:text-foreground`)}function ns(e){return b(`size-3.5`,e&&`fill-current`)}function rs(e){let t=(0,Q.c)(33),{selection:n,themes:r,unavailableThemes:i,onAssign:a,editControl:o,deleteControl:s,createControl:c,slotMode:l,customSeed:u,firstItemId:d,"aria-label":f,"aria-describedby":p,"aria-invalid":m}=e,g=r===void 0?Vt:r,_;t[0]===i?_=t[1]:(_=i===void 0?[]:i,t[0]=i,t[1]=_);let v=_,y=l===void 0?`light`:l,{_:x}=h(),S;if(t[2]!==x||t[3]!==u||t[4]!==s||t[5]!==o||t[6]!==d||t[7]!==a||t[8]!==n||t[9]!==y||t[10]!==g){let e;t[12]!==x||t[13]!==u||t[14]!==s||t[15]!==o||t[16]!==d||t[17]!==a||t[18]!==n||t[19]!==y?(e=(e,t)=>{let r=n.light===e.id,i=n.dark===e.id,c=o?.themeIds.includes(e.id)??!1,l=s?.themeIds.includes(e.id)??!1,f=o?.selectedId===e.id,p=x(y===`light`?{id:`hgF0al`,values:{0:e.label}}:{id:`6Nea1q`,values:{0:e.label}});return(0,$.jsxs)(`fieldset`,{"aria-label":e.label,className:b(`relative flex min-w-0 flex-col gap-1.5 rounded-lg border-2 p-1 text-left`,n[y]===e.id?`border-primary`:`border-transparent`),children:[(0,$.jsx)(w,{type:`button`,variant:`ghost`,"aria-label":p,"data-theme-focus-target":``,onClick:()=>a(y,e.id),className:`h-auto w-full cursor-pointer p-0 transition-opacity hover:bg-transparent hover:opacity-90`,children:(0,$.jsx)($o,{theme:e,customSeed:u,slotMode:y})}),l?(0,$.jsx)(w,{type:`button`,variant:`outline`,size:`icon-sm`,title:x({id:`Y2tU6I`,values:{0:e.label}}),"aria-label":x({id:`Y2tU6I`,values:{0:e.label}}),className:`absolute top-2 end-2 z-10 border-border/80 bg-background/85 text-muted-foreground shadow-sm backdrop-blur-sm hover:border-destructive/50 hover:bg-destructive/15 hover:text-destructive focus-visible:border-destructive/50 focus-visible:text-destructive focus-visible:ring-destructive/20 dark:bg-background/80 dark:hover:bg-destructive/20`,onClick:async t=>{let n=t.currentTarget.closest(`fieldset`),r=n?.previousElementSibling?.querySelector(`[data-theme-focus-target]`)??n?.nextElementSibling?.querySelector(`[data-theme-focus-target]`);await s?.onDelete(e.id)!==!1&&r?.focus()},children:(0,$.jsx)(Wr,{"aria-hidden":!0})}):null,(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-1 px-0.5`,children:[(0,$.jsx)(`span`,{className:`truncate text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[c?(0,$.jsx)(je,{className:ts(f),pressed:f,onPressedChange:t=>{o?.onSelect(t?e.id:null)},"aria-label":x(f?{id:`8x6zk9`,values:{0:e.label}}:{id:`N6j2JH`,values:{0:e.label}}),children:(0,$.jsx)(gn,{className:`size-3.5`})}):null,(0,$.jsx)(je,{id:t===0?d:void 0,className:ts(r),pressed:r,onPressedChange:t=>{t&&a(`light`,e.id)},"aria-label":x({id:`sq4WQH`,values:{0:e.label}}),children:(0,$.jsx)(Rr,{className:ns(r)})}),(0,$.jsx)(je,{className:ts(i),pressed:i,onPressedChange:t=>{t&&a(`dark`,e.id)},"aria-label":x({id:`lZvQrY`,values:{0:e.label}}),children:(0,$.jsx)(zr,{className:ns(i)})})]})]})]},e.id)},t[12]=x,t[13]=u,t[14]=s,t[15]=o,t[16]=d,t[17]=a,t[18]=n,t[19]=y,t[20]=e):e=t[20],S=g.map(e),t[2]=x,t[3]=u,t[4]=s,t[5]=o,t[6]=d,t[7]=a,t[8]=n,t[9]=y,t[10]=g,t[11]=S}else S=t[11];let C;t[21]!==x||t[22]!==c?(C=c?(0,$.jsxs)(w,{type:`button`,variant:`ghost`,onClick:c.onCreate,className:`group h-auto min-w-0 flex-col items-stretch gap-1.5 rounded-lg border-2 border-transparent p-1 text-left text-muted-foreground hover:bg-transparent hover:text-foreground`,children:[(0,$.jsx)(`span`,{className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-dashed border-border bg-muted/10 transition-colors group-hover:border-foreground/40`,children:(0,$.jsx)(mn,{"aria-hidden":!0,className:`size-6`})}),(0,$.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium`,children:x({id:`AJ7_B2`})})]}):null,t[21]=x,t[22]=c,t[23]=C):C=t[23];let T;t[24]===v?T=t[25]:(T=v.map(is),t[24]=v,t[25]=T);let E;return t[26]!==p||t[27]!==m||t[28]!==f||t[29]!==S||t[30]!==C||t[31]!==T?(E=(0,$.jsxs)(`fieldset`,{"aria-label":f,"aria-describedby":p,"aria-invalid":m,className:`grid w-full min-w-0 grid-cols-2 gap-2 sm:grid-cols-3`,children:[S,C,T]}),t[26]=p,t[27]=m,t[28]=f,t[29]=S,t[30]=C,t[31]=T,t[32]=E):E=t[32],E}function is(e){return(0,$.jsxs)(`fieldset`,{"aria-label":e.label,className:`flex min-w-0 flex-col gap-1.5 rounded-lg border-2 border-destructive/40 bg-destructive/5 p-1 text-left`,children:[(0,$.jsx)(`div`,{"aria-hidden":!0,className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-destructive/30 bg-muted/40 text-destructive`,children:(0,$.jsx)(Fn,{className:`size-6`})}),(0,$.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`px-0.5 text-xs font-medium text-destructive`,children:e.problem}),(0,$.jsx)(`span`,{className:`px-0.5 pb-0.5 text-xs text-muted-foreground`,children:e.detail})]},e.key)}var as=12e3;function os(e){let t=(0,Q.c)(210),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({appearance:n,onAssign:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{_:a}=h(),{themes:o,warnings:s,truncated:c,loadError:l,refresh:u,deleteTheme:d,restoreTheme:f,editingThemeId:p,themeEditorOpen:m,selectThemeToEdit:g}=Yr(),[_,v]=(0,Z.useState)(!1),[y,b]=(0,Z.useState)(``),[x,S]=(0,Z.useState)(null),[C,T]=(0,Z.useState)(!1),E=(0,Z.useRef)(null),D,O;t[4]===u?(D=t[5],O=t[6]):(D=()=>{u()},O=[u],t[4]=u,t[5]=D,t[6]=O),(0,Z.useEffect)(D,O);let k;t[7]!==n||t[8]!==o?(k=Xe(n,o),t[7]=n,t[8]=o,t[9]=k):k=t[9];let A=k,j,M,N,P,F,I,L,R,z,B,V,H,U,W,G,K,ee,te,q,J,Y;if(t[10]!==a||t[11]!==x||t[12]!==y||t[13]!==_||t[14]!==d||t[15]!==p||t[16]!==C||t[17]!==l||t[18]!==r||t[19]!==i||t[20]!==u||t[21]!==f||t[22]!==g||t[23]!==A||t[24]!==m||t[25]!==o||t[26]!==c||t[27]!==s){let e=Rt(y),n;t[49]===o?n=t[50]:(n=o.filter(ds),t[49]=o,t[50]=n);let h=n,D,O,k,ne,re,ie,ae,oe,se;if(t[51]!==a||t[52]!==y||t[53]!==d||t[54]!==p||t[55]!==h||t[56]!==C||t[57]!==l||t[58]!==r||t[59]!==i||t[60]!==u||t[61]!==f||t[62]!==g||t[63]!==A||t[64]!==m||t[65]!==o||t[66]!==c||t[67]!==s){let e=o.flatMap(us),n;t[80]!==a||t[81]!==u||t[82]!==f?(n=async function(e){let t=await f({id:e.id,name:e.scheme.name,stem:e.stem,scheme:{...e.scheme,palette:{...e.scheme.palette}},extension:e.filename.endsWith(`.yml`)?`.yml`:`.yaml`});if(t.ok){await u(),X.success(a({id:`Kx881F`,values:{0:e.label}}));return}if(t.reason===`name-taken`){X.error(a({id:`oZUYMv`,values:{0:e.label}}));return}X.error(a({id:`7O7REc`,values:{0:e.label}}))},t[80]=a,t[81]=u,t[82]=f,t[83]=n):n=t[83];let _=n;k=async function(t){let n=e.find(e=>e.id===t);if(!n)return X.error(a({id:`ANFxWn`})),!1;let r=await d(n.id);if(!r.ok)return X.error(a({id:`kkux8f`,values:{0:n.label}})),!1;if(p===n.id&&g(null),await u(),!r.existed)return X(a({id:`ekSPiP`,values:{0:n.label}})),!0;let i={...n,filename:r.filename,label:r.scheme.name,scheme:r.scheme};return X(a({id:`YCmS3k`,values:{0:i.label}}),{duration:as,action:{label:a({id:`9uI_rE`}),onClick:()=>_(i)}}),!0};let x;t[84]!==a||t[85]!==y||t[86]!==C||t[87]!==r||t[88]!==i||t[89]!==u||t[90]!==f||t[91]!==g||t[92]!==A||t[93]!==o?(x=async function(e){if(e.preventDefault(),C)return;let t=Rt(y);if(!t.ok){S(a({id:`RG3yW6`})),E.current?.focus();return}let n=i.slotMode??`light`,s=o.find(e=>e.id===A[n])?.scheme??bi(i.customSeed),c={name:t.name,variant:s.variant,palette:{...s.palette}};S(null),T(!0);let l=await f({id:t.id,name:t.name,scheme:c});if(!l.ok){S(l.reason===`name-taken`?a({id:`_IfSZn`}):l.reason===`name-invalid`?a({id:`qtnmEX`}):a({id:`DmkTrb`})),T(!1),E.current?.focus();return}let d={id:l.id,label:c.name,kind:c.variant,scheme:c,toTokens:()=>At(c)};r(n,l.id,A,[...o,d]),await u(),b(``),v(!1),T(!1),g(l.id)},t[84]=a,t[85]=y,t[86]=C,t[87]=r,t[88]=i,t[89]=u,t[90]=f,t[91]=g,t[92]=A,t[93]=o,t[94]=x):x=t[94],O=x;let j;if(t[95]!==a||t[96]!==s){let e;t[98]===a?e=t[99]:(e=e=>{let t;bb90:switch(e.code){case`unparseable`:t=a({id:`g12y1g`});break bb90;case`not-a-scheme`:t=a({id:`p7Utw8`});break bb90;case`missing-slots`:t=a({id:`GUZHkL`});break bb90;case`bad-hex`:t=a({id:`IMLUBh`});break bb90;case`empty`:t=a({id:`k_tFzX`});break bb90;case`too-long`:t=a({id:`FyyIjH`});break bb90;case`invalid-chars`:t=a({id:`JaU1ld`});break bb90;case`unsupported-extension-case`:t=a({id:`R30SFt`});break bb90;case`duplicate-identity`:t=a({id:`DUb7Ax`});break bb90;case`symlink`:t=a({id:`hFmYGU`});break bb90;case`not-regular-file`:t=a({id:`UH0Zqw`});break bb90;case`file-too-large`:t=a({id:`-othoN`});break bb90;case`read-failed`:t=a({id:`cLn264`});break bb90;default:t=a({id:`WBNpt9`,values:{0:e.code}})}return{key:e.filename,label:e.filename,problem:t,detail:e.conflictingFilenames?a({id:`QwG_zJ`,values:{0:e.conflictingFilenames.join(`, `)}}):a({id:`kwNS82`})}},t[98]=a,t[99]=e),j=s.map(e),t[95]=a,t[96]=s,t[97]=j}else j=t[97];let M=j;H=`flex w-full min-w-0 flex-col gap-2`,t[100]!==a||t[101]!==l||t[102]!==u?(U=l?(0,$.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-foreground`,children:[(0,$.jsx)(`span`,{children:a({id:`hVzt9x`})}),(0,$.jsx)(w,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>void u(),children:a({id:`KDw4GX`})})]}):null,t[100]=a,t[101]=l,t[102]=u,t[103]=U):U=t[103];let N;t[104]!==a||t[105]!==c?(N=c?(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-sm text-foreground`,children:[(0,$.jsx)(Gr,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-amber-600`}),(0,$.jsx)(`span`,{children:a({id:`DLIljL`})})]}):null,t[104]=a,t[105]=c,t[106]=N):N=t[106],t[107]===N?W=t[108]:(W=(0,$.jsx)(`div`,{role:`status`,children:N}),t[107]=N,t[108]=W),D=rs,re=i,ie=A,ae=h,oe=M;let P;t[109]===o?P=t[110]:(P=o.filter(ls).map(cs),t[109]=o,t[110]=P);let F=m?p:null;t[111]!==g||t[112]!==P||t[113]!==F?(se={themeIds:P,selectedId:F,onSelect:g},t[111]=g,t[112]=P,t[113]=F,t[114]=se):se=t[114],ne=e.map(ss),t[51]=a,t[52]=y,t[53]=d,t[54]=p,t[55]=h,t[56]=C,t[57]=l,t[58]=r,t[59]=i,t[60]=u,t[61]=f,t[62]=g,t[63]=A,t[64]=m,t[65]=o,t[66]=c,t[67]=s,t[68]=D,t[69]=O,t[70]=k,t[71]=H,t[72]=U,t[73]=W,t[74]=ne,t[75]=re,t[76]=ie,t[77]=ae,t[78]=oe,t[79]=se}else D=t[68],O=t[69],k=t[70],H=t[71],U=t[72],W=t[73],ne=t[74],re=t[75],ie=t[76],ae=t[77],oe=t[78],se=t[79];let ce;t[115]!==k||t[116]!==ne?(ce={themeIds:ne,onDelete:k},t[115]=k,t[116]=ne,t[117]=ce):ce=t[117];let le;t[118]===Symbol.for(`react.memo_cache_sentinel`)?(le={onCreate:()=>v(!0)},t[118]=le):le=t[118];let ue;t[119]!==r||t[120]!==A||t[121]!==o?(ue=(e,t)=>r(e,t,A,o),t[119]=r,t[120]=A,t[121]=o,t[122]=ue):ue=t[122],t[123]!==D||t[124]!==re||t[125]!==ie||t[126]!==ae||t[127]!==oe||t[128]!==se||t[129]!==ce||t[130]!==ue?(G=(0,$.jsx)(D,{...re,selection:ie,themes:ae,unavailableThemes:oe,editControl:se,deleteControl:ce,createControl:le,onAssign:ue}),t[123]=D,t[124]=re,t[125]=ie,t[126]=ae,t[127]=oe,t[128]=se,t[129]=ce,t[130]=ue,t[131]=G):G=t[131],F=ii,B=_,t[132]===C?V=t[133]:(V=e=>{C||v(e)},t[132]=C,t[133]=V),P=$r;let de;t[134]===a?de=t[135]:(de=a({id:`Z_nNa2`}),t[134]=a,t[135]=de);let fe;t[136]===de?fe=t[137]:(fe=(0,$.jsx)(Qr,{children:de}),t[136]=de,t[137]=fe);let pe;t[138]===a?pe=t[139]:(pe=a({id:`nTM8ab`}),t[138]=a,t[139]=pe);let me;t[140]===pe?me=t[141]:(me=(0,$.jsx)(Zr,{children:pe}),t[140]=pe,t[141]=me),t[142]!==fe||t[143]!==me?(z=(0,$.jsxs)(ri,{className:`gap-2`,children:[fe,me]}),t[142]=fe,t[143]=me,t[144]=z):z=t[144],N=ei,I=`create-saved-theme-form`,L=!0,R=O,M=Oi,q=x!==null;let he;t[145]===a?he=t[146]:(he=a({id:`HZ7fEu`}),t[145]=a,t[146]=he),t[147]===he?J=t[148]:(J=(0,$.jsx)(Ei,{htmlFor:`create-saved-theme-name`,children:he}),t[147]=he,t[148]=J);let ge=x!==null,_e=x?`create-saved-theme-help create-saved-theme-error`:`create-saved-theme-help`,ve;t[149]===x?ve=t[150]:(ve=e=>{b(e.target.value),x&&S(null)},t[149]=x,t[150]=ve),t[151]!==y||t[152]!==C||t[153]!==ge||t[154]!==_e||t[155]!==ve?(Y=(0,$.jsx)(oi,{ref:E,id:`create-saved-theme-name`,value:y,autoFocus:!0,autoComplete:`off`,required:!0,readOnly:C,"aria-invalid":ge,"aria-describedby":_e,onChange:ve}),t[151]=y,t[152]=C,t[153]=ge,t[154]=_e,t[155]=ve,t[156]=Y):Y=t[156],j=Di,K=`create-saved-theme-help`,ee=`font-mono`,te=e.ok?a({id:`Yb82LN`,values:{0:e.stem}}):a({id:`4d0VYJ`}),t[10]=a,t[11]=x,t[12]=y,t[13]=_,t[14]=d,t[15]=p,t[16]=C,t[17]=l,t[18]=r,t[19]=i,t[20]=u,t[21]=f,t[22]=g,t[23]=A,t[24]=m,t[25]=o,t[26]=c,t[27]=s,t[28]=j,t[29]=M,t[30]=N,t[31]=P,t[32]=F,t[33]=I,t[34]=L,t[35]=R,t[36]=z,t[37]=B,t[38]=V,t[39]=H,t[40]=U,t[41]=W,t[42]=G,t[43]=K,t[44]=ee,t[45]=te,t[46]=q,t[47]=J,t[48]=Y}else j=t[28],M=t[29],N=t[30],P=t[31],F=t[32],I=t[33],L=t[34],R=t[35],z=t[36],B=t[37],V=t[38],H=t[39],U=t[40],W=t[41],G=t[42],K=t[43],ee=t[44],te=t[45],q=t[46],J=t[47],Y=t[48];let ne;t[157]!==j||t[158]!==K||t[159]!==ee||t[160]!==te?(ne=(0,$.jsx)(j,{id:K,className:ee,children:te}),t[157]=j,t[158]=K,t[159]=ee,t[160]=te,t[161]=ne):ne=t[161];let re;t[162]===x?re=t[163]:(re=x?(0,$.jsx)(Ti,{id:`create-saved-theme-error`,children:x}):null,t[162]=x,t[163]=re);let ie;t[164]!==M||t[165]!==ne||t[166]!==re||t[167]!==q||t[168]!==J||t[169]!==Y?(ie=(0,$.jsxs)(M,{"data-invalid":q,children:[J,Y,ne,re]}),t[164]=M,t[165]=ne,t[166]=re,t[167]=q,t[168]=J,t[169]=Y,t[170]=ie):ie=t[170];let ae;t[171]!==I||t[172]!==L||t[173]!==R||t[174]!==ie?(ae=(0,$.jsx)(`form`,{id:I,noValidate:L,onSubmit:R,children:ie}),t[171]=I,t[172]=L,t[173]=R,t[174]=ie,t[175]=ae):ae=t[175];let oe;t[176]!==N||t[177]!==ae?(oe=(0,$.jsx)(N,{children:ae}),t[176]=N,t[177]=ae,t[178]=oe):oe=t[178];let se;t[179]===Symbol.for(`react.memo_cache_sentinel`)?(se=()=>v(!1),t[179]=se):se=t[179];let ce;t[180]===a?ce=t[181]:(ce=a({id:`dEgA5A`}),t[180]=a,t[181]=ce);let le;t[182]!==C||t[183]!==ce?(le=(0,$.jsx)(w,{type:`button`,variant:`outline`,disabled:C,onClick:se,children:ce}),t[182]=C,t[183]=ce,t[184]=le):le=t[184];let ue;t[185]!==a||t[186]!==C?(ue=a(C?{id:`_DwR-n`}:{id:`cuHhjo`}),t[185]=a,t[186]=C,t[187]=ue):ue=t[187];let de;t[188]!==C||t[189]!==ue?(de=(0,$.jsx)(w,{type:`submit`,form:`create-saved-theme-form`,disabled:C,children:ue}),t[188]=C,t[189]=ue,t[190]=de):de=t[190];let fe;t[191]!==le||t[192]!==de?(fe=(0,$.jsxs)(ti,{children:[le,de]}),t[191]=le,t[192]=de,t[193]=fe):fe=t[193];let pe;t[194]!==P||t[195]!==z||t[196]!==oe||t[197]!==fe?(pe=(0,$.jsxs)(P,{children:[z,oe,fe]}),t[194]=P,t[195]=z,t[196]=oe,t[197]=fe,t[198]=pe):pe=t[198];let me;t[199]!==F||t[200]!==B||t[201]!==V||t[202]!==pe?(me=(0,$.jsx)(F,{open:B,onOpenChange:V,children:pe}),t[199]=F,t[200]=B,t[201]=V,t[202]=pe,t[203]=me):me=t[203];let he;return t[204]!==H||t[205]!==U||t[206]!==W||t[207]!==G||t[208]!==me?(he=(0,$.jsxs)(`div`,{className:H,children:[U,W,G,me]}),t[204]=H,t[205]=U,t[206]=W,t[207]=G,t[208]=me,t[209]=he):he=t[209],he}function ss(e){return e.id}function cs(e){return e.id}function ls(e){return e.id.startsWith(`saved-`)}function us(e){let t=it(e.id);return!t.ok||!e.scheme?[]:[{id:e.id,stem:t.stem,label:e.label,scheme:e.scheme}]}function ds(e){return e.id!==`custom`}function fs(e,t){if(e.length===0)throw Error(`buildPatch: path must be non-empty`);let[n,...r]=e;return r.length===0?{[String(n)]:t}:{[String(n)]:fs(r,t)}}function ps(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(e?.type===`default`){let t=e.defaultValue;return typeof t==`function`?t():t}let n=t?._zod?.def?.innerType;if(n===void 0)return;t=n}}function ms(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`default`||e.type===`optional`||e.type===`nullable`){t=e.innerType;continue}return e.type}}function hs(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`enum`)return e.entries?Object.values(e.entries):void 0;if(e.innerType!==void 0){t=e.innerType;continue}return}}function gs(e){let t=(0,Q.c)(14),n;t[0]===e?n=t[1]:(n=e.current(),t[0]=e,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i={defaultValues:r,mode:`onBlur`},t[2]=r,t[3]=i);let a=ia(i),o,s;t[4]!==e||t[5]!==a?(o=()=>e.subscribe(e=>{_s(a,e)}),s=[e,a],t[4]=e,t[5]=a,t[6]=o,t[7]=s):(o=t[6],s=t[7]),(0,Z.useEffect)(o,s);let c;t[8]!==e||t[9]!==a?(c=t=>vs(a,e,t),t[8]=e,t[9]=a,t[10]=c):c=t[10];let l=c,u;return t[11]!==l||t[12]!==a?(u={form:a,commitField:l},t[11]=l,t[12]=a,t[13]=u):u=t[13],u}function _s(e,t){e.reset(t,{keepDirtyValues:!0,keepDirty:!0,keepTouched:!0})}function vs(e,t,n){let r=e.getValues(n),i=fs(xs(n),r),a=t.patch(i);if(a.ok)return e.clearErrors(n),e.resetField(n,{defaultValue:r,keepError:!1}),!0;if(Nt(a.error)&&a.error.code===`SCHEMA_INVALID`&&a.error.issues.length>0){e.clearErrors(n);for(let t of a.error.issues){let r=t.path.length>0?t.path.map(String).join(`.`):n;e.setError(r,{type:`config-binding`,message:t.message})}}else e.setError(n,{type:`config-binding`,message:ys(a.error,n)});return!1}function ys(e,t){if(Nt(e)&&e.code===`SCHEMA_INVALID`){let n=e.issues.find(e=>bs(e,t));if(n)return n.message}return jt(e)}function bs(e,t){return e.path.map(String).join(`.`)===t}function xs(e){return e.split(`.`)}function Ss(e){if(!Nt(e)||e.code!==`SCHEMA_INVALID`)return null;let t=e.issues[0];return!t||t.path.length===0?null:t.path.map(String).join(`.`)}function Cs(){let e=(0,Q.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Ii,{className:`h-5 w-32`}),n=(0,$.jsx)(Ii,{className:`h-4 w-64`}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[t,n,(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(Ii,{className:`h-9 w-full`}),(0,$.jsx)(Ii,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function ws({field:e,scope:t,commitField:n,isFlashed:r}){"use no memo";let{_:i}=h(),a=ca(),{setTheme:o}=_(),s=_n(),c=Ft(vt,e.path),l=c?ms(c):void 0,u=c?ps(c):void 0,d=c?hs(c):void 0,f=c?Jt(c):void 0,p=f?.scope===`project`&&t!==`project`||f?.scope===`user`&&t!==`user`,g=e.path.join(`.`),v=i(e.label),[y,x]=(0,Z.useState)(!1),S=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>{S.current&&clearTimeout(S.current)},[]);let C=()=>{x(!0),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>x(!1),1200)},D=()=>{let e=n(g);return e&&C(),e},k=()=>a.getFieldState(g).isDirty?D():!0,A=()=>{if(e.control===`theme-tiles`){let e=s?.userBinding;if(!e)return;let t=e.patch({appearance:pi()});t.ok?C():a.setError(g,{type:`manual`,message:ys(t.error,g)});return}let t=u===void 0?null:u;a.setValue(g,t,{shouldDirty:!1}),e.control===`theme-cards`&&o(yn(t)),D()},j=b(`relative`,r&&`animate-settings-flash`);return(0,$.jsx)(aa,{control:a.control,name:g,render:({field:n})=>{let r=!p&&(u!==void 0||n.value!==void 0);return(0,$.jsxs)(ra,{className:j,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(sa,{className:`text-sm font-medium`,children:v}),r?(0,$.jsxs)(O,{children:[(0,$.jsx)(T,{asChild:!0,children:(0,$.jsx)(w,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:A,"aria-label":i({id:`lhjq3G`,values:{labelText:v}}),children:(0,$.jsx)(Vr,{className:`size-3.5`})})}),(0,$.jsx)(E,{children:(0,$.jsx)(m,{id:`L-rMC9`})})]}):null]}),e.description?(0,$.jsx)(la,{className:`text-muted-foreground text-1sm`,children:i(e.description)}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(oa,{children:(0,$.jsx)(Es,{field:e,ctl:n,typeTag:l,enumOptions:d,onCommit:k,onRevertToBaseline:()=>a.resetField(g,{keepError:!0}),onSavedOutsideForm:C,onWriteRejected:e=>{a.setError(g,{type:`manual`,message:ys(e,g)})}})}),(0,$.jsx)(As,{visible:y,srOnly:Ts(e.control)})]}),(0,$.jsx)(ua,{"data-field-error":e.path.join(`.`)})]})}})}function Ts(e){return e===`theme-tiles`||e===`theme-cards`}function Es({field:e,ctl:t,typeTag:n,enumOptions:r,onCommit:i,onRevertToBaseline:a,onSavedOutsideForm:o,onWriteRejected:s,...c}){"use no memo";let{_:l}=h(),{setTheme:u,systemTheme:d}=_(),f=_n(),p=f?.merged??null;if(e.control===`language-select`)return(0,$.jsx)(Yo,{...c,value:t.value,ref:t.ref,onBlur:t.onBlur,onValueChange:e=>{let n=xi(t.value)??`system`;n!==e&&Bo({from:n,to:e}),t.onChange(e),i()}});if(e.control===`theme-cards`){let{id:n,...r}=c;return(0,$.jsx)(Br,{...r,firstItemId:n,value:yn(t.value),"aria-label":l(e.label),onValueChange:e=>{let n=yn(t.value);u(e),t.onChange(e),!i()&&(u(n),a())}})}if(e.control===`theme-tiles`){let{id:t,...n}=c,r=p?.appearance?.customTheme,i=p?.appearance?.theme,a=pt(i,d===`dark`);return(0,$.jsx)(os,{...n,firstItemId:t,appearance:p?.appearance,customSeed:r,slotMode:a,"aria-label":l(e.label),onAssign:(e,t,n,c)=>{let l=f?.userBinding;if(!l)return;let d={...n,[e]:t},p=e=>{let t=e[a];return t===`custom`?gi(bi(r)):fi(t,c)};di({selection:d,modePreference:i,slotMode:a,customSeed:r,themes:c}),u(p(d)??i??`system`);let m=l.patch({appearance:_i(d)});if(m.ok){Uo(d),o();return}di({selection:n,modePreference:i,slotMode:a,customSeed:r,themes:c}),u(p(n)??i??`system`),s(m.error)}})}if(n===`boolean`)return(0,$.jsx)(ke,{...c,checked:!!t.value,ref:t.ref,onCheckedChange:e=>{t.onChange(e),i()},onBlur:t.onBlur});if(n===`enum`&&r&&r.length>0&&(e.control===`enum-toggle`||r.length<=4)){let{id:n,...a}=c;return(0,$.jsx)(Me,{...a,type:`single`,value:typeof t.value==`string`?t.value:``,ref:t.ref,onValueChange:e=>{e&&(t.onChange(e),i())},onBlur:t.onBlur,variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-lg`,"aria-label":l(e.label),children:r.map((e,t)=>(0,$.jsx)(Ae,{value:e,id:t===0?n:void 0,className:`text-1sm capitalize`,children:e},e))})}return n===`number`||n===`int`?(0,$.jsx)(Os,{ctl:t,onCommit:i,...c}):n===`array`?(0,$.jsx)(ks,{ctl:t,onCommit:i,...c}):(0,$.jsx)(Ds,{ctl:t,onCommit:i,...c})}function Ds({ctl:e,onCommit:t,...n}){"use no memo";return(0,$.jsx)(oi,{...n,value:typeof e.value==`string`?e.value:``,ref:e.ref,onChange:t=>e.onChange(t.target.value),onBlur:()=>{e.onBlur(),t()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),t())},className:`h-8 text-sm`})}function Os({ctl:e,onCommit:t,...n}){"use no memo";let[r,i]=(0,Z.useState)(e.value===void 0?``:String(e.value)),a=(0,Z.useRef)(e.value);(0,Z.useEffect)(()=>{a.current!==e.value&&(i(e.value===void 0?``:String(e.value)),a.current=e.value)},[e.value]);let o=()=>{let n=Number(r);if(!Number.isFinite(n)){e.onChange(r),t();return}e.onChange(n),t(),a.current=n};return(0,$.jsx)(oi,{...n,type:`number`,value:r,ref:e.ref,onChange:e=>i(e.target.value),onBlur:()=>{e.onBlur(),o()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())},className:`h-8 w-28 text-sm tabular-nums`})}function ks({ctl:e,onCommit:t,...n}){"use no memo";let r=Array.isArray(e.value)?e.value.join(`
|
|
2
2
|
`):``,[i,a]=(0,Z.useState)(r),o=(0,Z.useRef)(r);(0,Z.useEffect)(()=>{let t=Array.isArray(e.value)?e.value.join(`
|
|
3
3
|
`):``;t!==o.current&&(a(t),o.current=t)},[e.value]);let s=()=>{let n=i.split(`
|
|
4
4
|
`).map(e=>e.trim()).filter(e=>e.length>0);e.onChange(n),t(),o.current=n.join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./AgentIconCluster-D5LuHNJO.js";import{t as s}from"./button-BeFNZANd.js";import{i as c,n as l,t as u}from"./tooltip-DVBVVaAs.js";import"./RegisteredAgentIcon-COLTpZlS.js";import{$c as d,Si as f,en as p,nn as m,wc as h}from"./dist-BS18tPvg.js";import{n as g}from"./dist-CJhtNlOm2.js";import{c as _}from"./documents-events-CJhE88yE.js";import{t as v}from"./createLucideIcon-B6ULg5PN.js";import{a as y,f as b,i as x,m as S,n as C,o as w,p as T,u as E}from"./dropdown-menu-raSZ06x1.js";import{t as ee}from"./folder-C4F4ia-z.js";import{i as te,l as D,n as ne,r as O}from"./skill-scope-BkSXs9Lm.js";import{F as k,S as re,j as A,x as j}from"./skills-api-Cvk5ZT2-.js";import{t as M}from"./use-skills--ee80y05.js";import{a as N,c as P,d as F,f as I,l as L,p as R,s as z,u as B}from"./DeleteConfirmationDialog-DQ_i0S6n.js";var V=v(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),ie=v(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),H=v(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),U=e(n(),1),W=a(),G=[...new Set(h.flatMap(e=>e.schemes))];function ae(e,t){let n=t.now?.()??Date.now(),r={};for(let t of h){let i=t.schemes[0],a=i===void 0?void 0:e[i];if(!a){r[t.id]={installed:null};continue}r[t.id]={installed:a.installed,...a.displayName===void 0?{}:{displayName:a.displayName},lastChecked:n}}return r}function K(e){return ae({},e)}async function q(e){let t=e.schemes??G,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var J=Object.fromEntries(G.map(e=>[e,{installed:!1}]));async function oe(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return J}if(!t.ok)return J;let n;try{n=await t.json()}catch{return J}if(typeof n!=`object`||!n||Array.isArray(n))return J;let r=n,i={};for(let e of G)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Y(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function X(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=K({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=ae(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!Y(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function se(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function ce(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>q({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>oe({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function le(){let e=(0,W.c)(5),[t,n]=(0,U.useState)(ue),r=(0,U.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=X(ce());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,U.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function ue(){return K({isElectronHost:se(),now:Date.now})}var Z=t(),de=(0,U.createContext)(null);function fe(e){let t=(0,W.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,Z.jsx)(de,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function pe(){return(0,U.use)(de)}function me(e){let t=(0,W.c)(6),{testId:n,title:i}=e,a;t[0]===i?a=t[1]:(a=i===void 0?{}:{title:i},t[0]=i,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(r,{id:`YjiZAs`}),t[2]=o):o=t[2];let s;return t[3]!==a||t[4]!==n?(s=(0,Z.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide`,"data-testid":n,...a,children:o}),t[3]=a,t[4]=n,t[5]=s):s=t[5],s}function he(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Z.jsx)(z,{...r}):(0,Z.jsx)(x,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ge(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Z.jsx)(P,{...r}):(0,Z.jsx)(y,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function _e(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Z.jsx)(N,{...r}):(0,Z.jsx)(C,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ve(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Z.jsx)(L,{...r}):(0,Z.jsx)(w,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ye(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Z.jsx)(B,{...r}):(0,Z.jsx)(E,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function be(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Z.jsx)(F,{...r}):(0,Z.jsx)(b,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function xe(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Z.jsx)(I,{...r}):(0,Z.jsx)(T,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Se(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Z.jsx)(R,{...r}):(0,Z.jsx)(S,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var Ce=Object.freeze({hosts:null,source:null}),we=new Map,Te=new Map;function Ee(e,t){return`${e}:${t}`}function De(e){return we.get(e)??Ce}function Oe(e,t){let n=Te.get(e)??new Set;return Te.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&Te.delete(e)}}function Q(e,t){let n=De(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?we.delete(e):we.set(e,r);for(let t of Te.get(e)??[])t()}}var ke=p.options,Ae=m.options,je=`.agents/`;function Me({skill:e,allSkills:t,hostSet:n,sourceHostOverlay:r,linkMode:i}){let a=t=>e?`${D(t,e.scope)}/${e.name}`:null,o=e?.hubOffered??(e&&t!==null?t.find(t=>t.scope===e.scope)?.hubOffered:void 0),s=e!==void 0&&(o===!0||(e.hosts??[]).includes(`agents`)||t?.some(t=>t.scope===e.scope&&(t.hosts.includes(`agents`)||t.path.startsWith(je)))),c=e?.hostAliases??(e&&t!==null?Object.assign({},...t.filter(t=>t.scope===e.scope).map(e=>e.hostAliases??{})):{}),l=e?.installableEditors??(e&&t!==null?t.find(t=>t.scope===e.scope)?.installableEditors:void 0),u=l?new Set(l):null,d=e?.scope===`global`?Ae:ke,f=(s?[...d,`agents`]:d).filter(e=>!(e in c)).filter(e=>e===`agents`||u===null||u.has(e)||n.has(e)),p=new Set(f.map(e=>a(e))),m=e?.scope===`global`?`~/`:``,h=e?.path?.includes(`/`)?`${m}${e.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,g=h!==null&&!p.has(h)?h:null,_=g===null?r??e?.hosts?.[0]:void 0,v=new Set(e?.conflictHosts??[]),y=new Set(e?.driftPaths??[]),b=new Set(e?.symlinkedHosts??[]),x=[...[...n].filter(e=>e!==_&&!(e in c)&&!v.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:a(e)??e,mode:b.has(e)?`link`:`copy`})),...(e?.customPlacements??[]).map(e=>({target:O(e),display:`${m}${e.path}`,mode:e.mode}))],S=x.map(e=>e.mode),C=S.filter(e=>e===`link`).length,w=S.length===0?i?`link`:`copy`:C*2>=S.length?`link`:`copy`,T=new Map((e?.customPlacements??[]).map(e=>[O(e),e])),E=new Set(T.keys());if(t!==null&&e){for(let n of t)if(n.scope===e.scope)for(let e of n.customPlacements??[]){let t=O(e);t!==``&&E.add(t)}}return{pathFor:a,aliases:c,rows:f,sourceRow:g,sourceHost:_,conflicted:v,drifted:y,linked:b,expectedMode:w,convertible:x,customRootRows:e===void 0?[]:[...E].sort().map(t=>({root:t,display:`${m}${t}/${e.name}`,placed:T.get(t)??null})).filter(e=>!p.has(e.display)&&e.display!==h&&!(e.root in c))}}var Ne=`min-w-[24rem]`;function Pe(e,t){let n=(0,W.c)(45),r=t.installingName===e.name,i=(0,U.useRef)(e),[a,o]=(0,U.useState)(!1),s=(0,U.useRef)(!1),c,l;n[0]===r?(c=n[1],l=n[2]):(c=()=>{s.current&&!r&&o(!0),s.current=r},l=[r],n[0]=r,n[1]=c,n[2]=l),(0,U.useEffect)(c,l);let u,d;n[3]===e?(u=n[4],d=n[5]):(u=()=>{e!==i.current&&(i.current=e,o(!1))},d=[e],n[3]=e,n[4]=u,n[5]=d),(0,U.useEffect)(u,d);let p=r||a,m;n[6]!==e.name||n[7]!==e.scope?(m=Ee(e.scope,e.name),n[6]=e.name,n[7]=e.scope,n[8]=m):m=n[8];let h=m,_,v;n[9]===h?(_=n[10],v=n[11]):(_=e=>Oe(h,e),v=()=>De(h),n[9]=h,n[10]=_,n[11]=v);let y=(0,U.useSyncExternalStore)(_,v),b=y.hosts,x=y.source,S,C;n[12]!==x||n[13]!==h||n[14]!==e.hosts?(S=()=>{x!==null&&e.hosts[0]===x&&Q(h,{source:null})},C=[e.hosts,x,h],n[12]=x,n[13]=h,n[14]=e.hosts,n[15]=S,n[16]=C):(S=n[15],C=n[16]),(0,U.useEffect)(S,C);let w=e.linkMode===!0,T=b??e.hosts,E;n[17]===T?E=n[18]:(E=new Set(T),n[17]=T,n[18]=E);let ee=E,te=b?b.length>0:e.installed,D=(0,U.useRef)(e.hosts),ne,O;n[19]!==b||n[20]!==e.hosts?(ne=()=>{b===null&&(D.current=e.hosts)},O=[b,e.hosts],n[19]=b,n[20]=e.hosts,n[21]=ne,n[22]=O):(ne=n[21],O=n[22]),(0,U.useEffect)(ne,O);let re;n[23]===e.hosts?re=n[24]:(re=[...e.hosts].sort().join(`,`),n[23]=e.hosts,n[24]=re);let M=re,N,P;n[25]!==h||n[26]!==M?(N=()=>{let e=De(h).hosts;e&&[...e].sort().join(`,`)===M&&Q(h,{hosts:null})},P=[M,h],n[25]=h,n[26]=M,n[27]=N,n[28]=P):(N=n[27],P=n[28]),(0,U.useEffect)(N,P);let F=(0,U.useRef)(null),I=(0,U.useRef)(null),L,R;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>()=>{F.current&&clearTimeout(F.current),I.current?.(),I.current=null},R=[],n[29]=L,n[30]=R):(L=n[29],R=n[30]),(0,U.useEffect)(L,R);let z;n[31]!==t||n[32]!==h||n[33]!==e?(z=function(n,r){D.current=n,Q(h,{hosts:n}),F.current&&clearTimeout(F.current);let i=async()=>{I.current=null,F.current=null;let r=await t.install(e,n.filter(f));if(!r.ok){Q(h,{hosts:null});return}D.current=[...r.hosts],Q(h,{hosts:[...r.hosts]})};r?(I.current=()=>void i(),F.current=setTimeout(()=>void i(),350)):(I.current=null,i())},n[31]=t,n[32]=h,n[33]=e,n[34]=z):z=n[34];let B=z,V;return n[35]!==t||n[36]!==B||n[37]!==ee||n[38]!==te||n[39]!==p||n[40]!==x||n[41]!==h||n[42]!==w||n[43]!==e?(V={hostSet:ee,installed:te,installing:p,toggleEditor(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),B([...n],!0)},installAll(){let t=e.scope===`global`?Ae:ke,n=D.current.filter(e=>!t.includes(e)),r=e.installableEditors??t,i=t.filter(e=>r.includes(e)||D.current.includes(e));B([...n,...i],!1)},linkMode:w,sourceHost:x??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>j({scope:e.scope,name:e.name,dir:n,mode:r})).then(Ie)},unplaceAt(n){t.runLocationWrite(e,()=>k({scope:e.scope,name:e.name,path:n})).then(Fe)},setSource(n){Q(h,{source:n}),t.runLocationWrite(e,()=>A({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(Q(h,{source:null}),g.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=B,n[37]=ee,n[38]=te,n[39]=p,n[40]=x,n[41]=h,n[42]=w,n[43]=e,n[44]=V):V=n[44],V}function Fe(e){e.ok||g.error(e.error)}function Ie(e){e.ok||g.error(e.error)}function $(e){let t=(0,W.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,Z.jsx)(c,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,Z.jsx)(l,{side:`right`,className:`max-w-xs`,children:n}),t[2]=n,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Z.jsxs)(u,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Le(e){let t=(0,W.c)(77),{toggles:n,skill:a,onResolveFork:c,onRunStart:l,menuKind:u}=e,f=u===void 0?`dropdown`:u,{_:p}=i(),{hostSet:m,toggleEditor:h,installAll:v}=n,y=M(),b,x,S,C,w,T,E,O,k,A;if(t[0]!==p||t[1]!==y.data||t[2]!==y.status||t[3]!==m||t[4]!==v||t[5]!==f||t[6]!==c||t[7]!==l||t[8]!==a||t[9]!==h||t[10]!==n){let{pathFor:e,aliases:i,rows:u,sourceRow:j,sourceHost:M,conflicted:N,drifted:P,linked:F,expectedMode:I,convertible:L,customRootRows:R}=Me({skill:a,allSkills:y.status===`ready`?y.data:null,hostSet:m,sourceHostOverlay:n.sourceHost,linkMode:n.linkMode});w=u,T=j,C=I,x=L,S=R;let z=e=>ne(i,e),B=We,V=e=>{let t=z(e);return t.length===0?!0:window.confirm(p({id:`Uobeu9`,values:{0:t.map(B).join(`, `),rootRel:e}}))},ie;t[21]!==p||t[22]!==a?(ie=(e,t)=>{let n=e.includes(`/`)?e:D(e,a?.scope??`project`);return(0,Z.jsx)($,{hint:p({id:`0dslv8`,values:{0:B(e),1:B(e),2:a?.name??``,poolRootRel:t,subRoot:n}}),children:(0,Z.jsx)(s,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":p({id:`G6Lrs_`,values:{0:B(e)}}),onClick:r=>{r.preventDefault(),r.stopPropagation(),window.confirm(p({id:`iiqOKM`,values:{0:B(e),1:a.name,2:B(e),subRoot:n,poolRootRel:t}}))&&re({scope:a.scope,root:n,action:`unlink`,exclude:[a.name]}).then(e=>{e.ok?_():g.error(p({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,Z.jsx)(o,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[21]=p,t[22]=a,t[23]=ie):ie=t[23];let H=ie;b=n.installing;let U=te(a),W=Ue,G;t[24]!==p||t[25]!==l||t[26]!==n?(G=(e,t,i)=>{let a=i===`link`?`copy`:`link`;return(0,Z.jsx)($,{hint:p(i===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,Z.jsx)(s,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 font-normal text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:r=>{r.preventDefault(),r.stopPropagation(),window.confirm(p(a===`link`?{id:`m0eHej`,values:{display:t}}:{id:`HbcQYf`,values:{display:t}}))&&(l?.(),n.convertLocation?.(e,a))},"data-testid":`skill-convert-${e}`,children:i===`link`?(0,Z.jsx)(r,{id:`uUCrBv`}):(0,Z.jsx)(r,{id:`iaPtht`})})})},t[24]=p,t[25]=l,t[26]=n,t[27]=G):G=t[27];let ae=G,K;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Z.jsx)(r,{id:`npcziF`}),t[28]=K):K=t[28];let q;t[29]===p?q=t[30]:(q=p({id:`6f_UX4`}),t[29]=p,t[30]=q);let J;t[31]===v?J=t[32]:(J=()=>v(),t[31]=v,t[32]=J);let oe;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,Z.jsx)(r,{id:`N40H-G`}),t[33]=oe):oe=t[33];let Y;t[34]!==b||t[35]!==J?(Y=(0,Z.jsx)(s,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:b,onClick:J,"data-testid":`skill-install-all`,children:oe}),t[34]=b,t[35]=J,t[36]=Y):Y=t[36];let X;t[37]!==q||t[38]!==Y?(X=(0,Z.jsx)($,{hint:q,children:Y}),t[37]=q,t[38]=Y,t[39]=X):X=t[39],t[40]!==f||t[41]!==X?(E=(0,Z.jsxs)(ve,{menuKind:f,className:`flex items-center justify-between gap-2`,children:[K,X]}),t[40]=f,t[41]=X,t[42]=E):E=t[42],O=T===null?null:(0,Z.jsx)($,{hint:p({id:`pXB6SL`}),children:(0,Z.jsxs)(_e,{menuKind:f,disabled:b,checked:!0,onSelect:He,"data-testid":`skill-source-row`,children:[(0,Z.jsx)(ee,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:T}),(()=>{let e=W(T).split(`/`).slice(0,-1).join(`/`),t=z(e);return t.length>0?(0,Z.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>H(t,e))}):null})(),(0,Z.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,Z.jsx)(r,{id:`tiFPjk`})})]})]})}),k=w.map(t=>{let i=e(t),l=t===`agents`?`.agents`:d[t],u=W(i).split(`/`).slice(0,-1).join(`/`),g=z(u);return(0,Z.jsx)($,{hint:N.has(t)?p({id:`8HvJlU`,values:{0:i??l}}):t===M?i?p({id:`ssk6rl`,values:{path:i}}):l:m.has(t)?p(i?{id:`9ieZhu`,values:{path:i}}:{id:`n3T3EE`,values:{label:l}}):U?.editor===t?p({id:`_3S4Ql`,values:{0:a?.name??``,1:U.plugin,2:i??l,label:l}}):p(i?M===void 0?{id:`xk133d`,values:{path:i}}:C===`link`?{id:`1LtA5r`,values:{path:i}}:{id:`opPbzN`,values:{path:i}}:{id:`Pp0Vgd`,values:{label:l}}),children:(0,Z.jsxs)(_e,{menuKind:f,disabled:b,checked:m.has(t),onCheckedChange:e=>{N.has(t)||e===!0&&!V(u)||h(t,e===!0)},onSelect:Ve,className:`group`,"data-testid":`skill-install-editor-${t}`,children:[(0,Z.jsx)(o,{host:t,"aria-hidden":!0,className:`size-4`}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:i??l}),g.length>0?(0,Z.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${t}`,children:g.map(e=>H(e,u))}):null,U?.editor===t&&!m.has(t)?(0,Z.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,"data-testid":`skill-row-plugin-covered-${t}`,children:(0,Z.jsx)(r,{id:`scRzTw`})}):null,N.has(t)?(0,Z.jsx)($,{hint:p({id:`_O7dJS`}),children:(0,Z.jsx)(s,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:e=>{e.preventDefault(),c?.(t)},"data-testid":`skill-fork-chip-${t}`,children:(0,Z.jsx)(r,{id:`jng7Ko`})})}):t===M?(0,Z.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,Z.jsx)(r,{id:`tiFPjk`})}):m.has(t)&&a?.hosts?(0,Z.jsxs)(Z.Fragment,{children:[!b&&(F.has(t)?`link`:`copy`)!==C?ae(t,i??l,F.has(t)?`link`:`copy`):null,(0,Z.jsx)($,{hint:p({id:`nBgzKO`}),children:(0,Z.jsx)(s,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:e=>{e.preventDefault(),e.stopPropagation(),n.setSource?.(t)},"data-testid":`skill-set-source-${t}`,children:(0,Z.jsx)(r,{id:`VNNRfN`})})})]}):null,!b&&P.has(W(i))?(0,Z.jsx)($,{hint:p({id:`iz1LdD`}),children:(0,Z.jsx)(me,{testId:`skill-drift-${t}`})}):null]})]})},t)}),A=S.map(e=>{let t=e.display;return(0,Z.jsx)($,{hint:e.placed===null?p(M===void 0?{id:`xk133d`,values:{path:t}}:C===`link`?{id:`1LtA5r`,values:{path:t}}:{id:`opPbzN`,values:{path:t}}):p({id:`9ieZhu`,values:{path:t}}),children:(0,Z.jsxs)(_e,{menuKind:f,disabled:b,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!V(e.root))return;n.placeAt(e.root,C)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:Be,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,Z.jsx)(o,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,Z.jsx)(ee,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),z(e.root).length>0?(0,Z.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:z(e.root).map(t=>H(t,e.root))}):null,!b&&e.placed!==null&&P.has(e.placed.path)?(0,Z.jsx)($,{hint:p({id:`iz1LdD`}),children:(0,Z.jsx)(me,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,Z.jsxs)(Z.Fragment,{children:[!b&&e.placed.mode!==C?ae(e.root,e.display,e.placed.mode):null,(0,Z.jsx)($,{hint:p({id:`nBgzKO`}),children:(0,Z.jsx)(s,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setSource?.(e.root)},"data-testid":`skill-set-source-custom-${e.root}`,children:(0,Z.jsx)(r,{id:`VNNRfN`})})})]})]})]})},e.root)}),t[0]=p,t[1]=y.data,t[2]=y.status,t[3]=m,t[4]=v,t[5]=f,t[6]=c,t[7]=l,t[8]=a,t[9]=h,t[10]=n,t[11]=b,t[12]=x,t[13]=S,t[14]=C,t[15]=w,t[16]=T,t[17]=E,t[18]=O,t[19]=k,t[20]=A}else b=t[11],x=t[12],S=t[13],C=t[14],w=t[15],T=t[16],E=t[17],O=t[18],k=t[19],A=t[20];let j;t[43]!==S||t[44]!==w.length||t[45]!==T?(j=w.length===0&&S.length===0&&T===null?(0,Z.jsx)(`div`,{className:`px-2 py-1.5 text-[11px] text-muted-foreground leading-snug`,"data-testid":`skill-install-no-destinations`,children:(0,Z.jsx)(r,{id:`MOAoFO`})}):null,t[43]=S,t[44]=w.length,t[45]=T,t[46]=j):j=t[46];let N;t[47]!==p||t[48]!==b||t[49]!==x||t[50]!==C||t[51]!==l||t[52]!==n?(N=x.length>0&&n.convertLocations?(0,Z.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,Z.jsx)(s,{variant:`ghost`,size:`sm`,className:`h-auto whitespace-normal p-0 text-left font-normal text-[11px] text-muted-foreground leading-snug hover:bg-transparent hover:text-foreground`,onClick:e=>{e.preventDefault();let t=C===`link`?`copy`:`link`,r=x.filter(e=>e.mode!==t);if(r.length===0)return;let i=p(t===`copy`?{id:`iOAsF1`}:{id:`MS8lMS`}),a=p(t===`copy`?{id:`gZiT5e`}:{id:`PhIa-X`}),o=r.map(ze).join(`
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./AgentIconCluster-HlKRqN5I.js";import{t as s}from"./button-BeFNZANd.js";import{i as c,n as l,t as u}from"./tooltip-DVBVVaAs.js";import"./RegisteredAgentIcon-COLTpZlS.js";import{$c as d,Si as f,en as p,nn as m,wc as h}from"./dist-BS18tPvg.js";import{n as g}from"./dist-CJhtNlOm2.js";import{c as _}from"./documents-events-CJhE88yE.js";import{t as v}from"./createLucideIcon-B6ULg5PN.js";import{a as y,f as b,i as x,m as S,n as C,o as w,p as T,u as E}from"./dropdown-menu-BEhl0wvu.js";import{t as ee}from"./folder-C4F4ia-z.js";import{i as te,l as D,n as ne,r as O}from"./skill-scope-BkSXs9Lm.js";import{F as k,S as re,j as A,x as j}from"./skills-api-Cvk5ZT2-.js";import{t as M}from"./use-skills--ee80y05.js";import{a as N,c as P,d as F,f as I,l as L,p as R,s as z,u as B}from"./DeleteConfirmationDialog-DQ_i0S6n.js";var V=v(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),ie=v(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),H=v(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),U=e(n(),1),W=a(),G=[...new Set(h.flatMap(e=>e.schemes))];function ae(e,t){let n=t.now?.()??Date.now(),r={};for(let t of h){let i=t.schemes[0],a=i===void 0?void 0:e[i];if(!a){r[t.id]={installed:null};continue}r[t.id]={installed:a.installed,...a.displayName===void 0?{}:{displayName:a.displayName},lastChecked:n}}return r}function K(e){return ae({},e)}async function q(e){let t=e.schemes??G,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var J=Object.fromEntries(G.map(e=>[e,{installed:!1}]));async function oe(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return J}if(!t.ok)return J;let n;try{n=await t.json()}catch{return J}if(typeof n!=`object`||!n||Array.isArray(n))return J;let r=n,i={};for(let e of G)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Y(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function X(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=K({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=ae(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!Y(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function se(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function ce(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>q({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>oe({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function le(){let e=(0,W.c)(5),[t,n]=(0,U.useState)(ue),r=(0,U.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=X(ce());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,U.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function ue(){return K({isElectronHost:se(),now:Date.now})}var Z=t(),de=(0,U.createContext)(null);function fe(e){let t=(0,W.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,Z.jsx)(de,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function pe(){return(0,U.use)(de)}function me(e){let t=(0,W.c)(6),{testId:n,title:i}=e,a;t[0]===i?a=t[1]:(a=i===void 0?{}:{title:i},t[0]=i,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(r,{id:`YjiZAs`}),t[2]=o):o=t[2];let s;return t[3]!==a||t[4]!==n?(s=(0,Z.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide`,"data-testid":n,...a,children:o}),t[3]=a,t[4]=n,t[5]=s):s=t[5],s}function he(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Z.jsx)(z,{...r}):(0,Z.jsx)(x,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ge(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Z.jsx)(P,{...r}):(0,Z.jsx)(y,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function _e(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Z.jsx)(N,{...r}):(0,Z.jsx)(C,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ve(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Z.jsx)(L,{...r}):(0,Z.jsx)(w,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ye(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Z.jsx)(B,{...r}):(0,Z.jsx)(E,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function be(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Z.jsx)(F,{...r}):(0,Z.jsx)(b,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function xe(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Z.jsx)(I,{...r}):(0,Z.jsx)(T,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Se(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Z.jsx)(R,{...r}):(0,Z.jsx)(S,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var Ce=Object.freeze({hosts:null,source:null}),we=new Map,Te=new Map;function Ee(e,t){return`${e}:${t}`}function De(e){return we.get(e)??Ce}function Oe(e,t){let n=Te.get(e)??new Set;return Te.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&Te.delete(e)}}function Q(e,t){let n=De(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?we.delete(e):we.set(e,r);for(let t of Te.get(e)??[])t()}}var ke=p.options,Ae=m.options,je=`.agents/`;function Me({skill:e,allSkills:t,hostSet:n,sourceHostOverlay:r,linkMode:i}){let a=t=>e?`${D(t,e.scope)}/${e.name}`:null,o=e?.hubOffered??(e&&t!==null?t.find(t=>t.scope===e.scope)?.hubOffered:void 0),s=e!==void 0&&(o===!0||(e.hosts??[]).includes(`agents`)||t?.some(t=>t.scope===e.scope&&(t.hosts.includes(`agents`)||t.path.startsWith(je)))),c=e?.hostAliases??(e&&t!==null?Object.assign({},...t.filter(t=>t.scope===e.scope).map(e=>e.hostAliases??{})):{}),l=e?.installableEditors??(e&&t!==null?t.find(t=>t.scope===e.scope)?.installableEditors:void 0),u=l?new Set(l):null,d=e?.scope===`global`?Ae:ke,f=(s?[...d,`agents`]:d).filter(e=>!(e in c)).filter(e=>e===`agents`||u===null||u.has(e)||n.has(e)),p=new Set(f.map(e=>a(e))),m=e?.scope===`global`?`~/`:``,h=e?.path?.includes(`/`)?`${m}${e.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,g=h!==null&&!p.has(h)?h:null,_=g===null?r??e?.hosts?.[0]:void 0,v=new Set(e?.conflictHosts??[]),y=new Set(e?.driftPaths??[]),b=new Set(e?.symlinkedHosts??[]),x=[...[...n].filter(e=>e!==_&&!(e in c)&&!v.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:a(e)??e,mode:b.has(e)?`link`:`copy`})),...(e?.customPlacements??[]).map(e=>({target:O(e),display:`${m}${e.path}`,mode:e.mode}))],S=x.map(e=>e.mode),C=S.filter(e=>e===`link`).length,w=S.length===0?i?`link`:`copy`:C*2>=S.length?`link`:`copy`,T=new Map((e?.customPlacements??[]).map(e=>[O(e),e])),E=new Set(T.keys());if(t!==null&&e){for(let n of t)if(n.scope===e.scope)for(let e of n.customPlacements??[]){let t=O(e);t!==``&&E.add(t)}}return{pathFor:a,aliases:c,rows:f,sourceRow:g,sourceHost:_,conflicted:v,drifted:y,linked:b,expectedMode:w,convertible:x,customRootRows:e===void 0?[]:[...E].sort().map(t=>({root:t,display:`${m}${t}/${e.name}`,placed:T.get(t)??null})).filter(e=>!p.has(e.display)&&e.display!==h&&!(e.root in c))}}var Ne=`min-w-[24rem]`;function Pe(e,t){let n=(0,W.c)(45),r=t.installingName===e.name,i=(0,U.useRef)(e),[a,o]=(0,U.useState)(!1),s=(0,U.useRef)(!1),c,l;n[0]===r?(c=n[1],l=n[2]):(c=()=>{s.current&&!r&&o(!0),s.current=r},l=[r],n[0]=r,n[1]=c,n[2]=l),(0,U.useEffect)(c,l);let u,d;n[3]===e?(u=n[4],d=n[5]):(u=()=>{e!==i.current&&(i.current=e,o(!1))},d=[e],n[3]=e,n[4]=u,n[5]=d),(0,U.useEffect)(u,d);let p=r||a,m;n[6]!==e.name||n[7]!==e.scope?(m=Ee(e.scope,e.name),n[6]=e.name,n[7]=e.scope,n[8]=m):m=n[8];let h=m,_,v;n[9]===h?(_=n[10],v=n[11]):(_=e=>Oe(h,e),v=()=>De(h),n[9]=h,n[10]=_,n[11]=v);let y=(0,U.useSyncExternalStore)(_,v),b=y.hosts,x=y.source,S,C;n[12]!==x||n[13]!==h||n[14]!==e.hosts?(S=()=>{x!==null&&e.hosts[0]===x&&Q(h,{source:null})},C=[e.hosts,x,h],n[12]=x,n[13]=h,n[14]=e.hosts,n[15]=S,n[16]=C):(S=n[15],C=n[16]),(0,U.useEffect)(S,C);let w=e.linkMode===!0,T=b??e.hosts,E;n[17]===T?E=n[18]:(E=new Set(T),n[17]=T,n[18]=E);let ee=E,te=b?b.length>0:e.installed,D=(0,U.useRef)(e.hosts),ne,O;n[19]!==b||n[20]!==e.hosts?(ne=()=>{b===null&&(D.current=e.hosts)},O=[b,e.hosts],n[19]=b,n[20]=e.hosts,n[21]=ne,n[22]=O):(ne=n[21],O=n[22]),(0,U.useEffect)(ne,O);let re;n[23]===e.hosts?re=n[24]:(re=[...e.hosts].sort().join(`,`),n[23]=e.hosts,n[24]=re);let M=re,N,P;n[25]!==h||n[26]!==M?(N=()=>{let e=De(h).hosts;e&&[...e].sort().join(`,`)===M&&Q(h,{hosts:null})},P=[M,h],n[25]=h,n[26]=M,n[27]=N,n[28]=P):(N=n[27],P=n[28]),(0,U.useEffect)(N,P);let F=(0,U.useRef)(null),I=(0,U.useRef)(null),L,R;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>()=>{F.current&&clearTimeout(F.current),I.current?.(),I.current=null},R=[],n[29]=L,n[30]=R):(L=n[29],R=n[30]),(0,U.useEffect)(L,R);let z;n[31]!==t||n[32]!==h||n[33]!==e?(z=function(n,r){D.current=n,Q(h,{hosts:n}),F.current&&clearTimeout(F.current);let i=async()=>{I.current=null,F.current=null;let r=await t.install(e,n.filter(f));if(!r.ok){Q(h,{hosts:null});return}D.current=[...r.hosts],Q(h,{hosts:[...r.hosts]})};r?(I.current=()=>void i(),F.current=setTimeout(()=>void i(),350)):(I.current=null,i())},n[31]=t,n[32]=h,n[33]=e,n[34]=z):z=n[34];let B=z,V;return n[35]!==t||n[36]!==B||n[37]!==ee||n[38]!==te||n[39]!==p||n[40]!==x||n[41]!==h||n[42]!==w||n[43]!==e?(V={hostSet:ee,installed:te,installing:p,toggleEditor(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),B([...n],!0)},installAll(){let t=e.scope===`global`?Ae:ke,n=D.current.filter(e=>!t.includes(e)),r=e.installableEditors??t,i=t.filter(e=>r.includes(e)||D.current.includes(e));B([...n,...i],!1)},linkMode:w,sourceHost:x??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>j({scope:e.scope,name:e.name,dir:n,mode:r})).then(Ie)},unplaceAt(n){t.runLocationWrite(e,()=>k({scope:e.scope,name:e.name,path:n})).then(Fe)},setSource(n){Q(h,{source:n}),t.runLocationWrite(e,()=>A({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(Q(h,{source:null}),g.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=B,n[37]=ee,n[38]=te,n[39]=p,n[40]=x,n[41]=h,n[42]=w,n[43]=e,n[44]=V):V=n[44],V}function Fe(e){e.ok||g.error(e.error)}function Ie(e){e.ok||g.error(e.error)}function $(e){let t=(0,W.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,Z.jsx)(c,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,Z.jsx)(l,{side:`right`,className:`max-w-xs`,children:n}),t[2]=n,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Z.jsxs)(u,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Le(e){let t=(0,W.c)(77),{toggles:n,skill:a,onResolveFork:c,onRunStart:l,menuKind:u}=e,f=u===void 0?`dropdown`:u,{_:p}=i(),{hostSet:m,toggleEditor:h,installAll:v}=n,y=M(),b,x,S,C,w,T,E,O,k,A;if(t[0]!==p||t[1]!==y.data||t[2]!==y.status||t[3]!==m||t[4]!==v||t[5]!==f||t[6]!==c||t[7]!==l||t[8]!==a||t[9]!==h||t[10]!==n){let{pathFor:e,aliases:i,rows:u,sourceRow:j,sourceHost:M,conflicted:N,drifted:P,linked:F,expectedMode:I,convertible:L,customRootRows:R}=Me({skill:a,allSkills:y.status===`ready`?y.data:null,hostSet:m,sourceHostOverlay:n.sourceHost,linkMode:n.linkMode});w=u,T=j,C=I,x=L,S=R;let z=e=>ne(i,e),B=We,V=e=>{let t=z(e);return t.length===0?!0:window.confirm(p({id:`Uobeu9`,values:{0:t.map(B).join(`, `),rootRel:e}}))},ie;t[21]!==p||t[22]!==a?(ie=(e,t)=>{let n=e.includes(`/`)?e:D(e,a?.scope??`project`);return(0,Z.jsx)($,{hint:p({id:`0dslv8`,values:{0:B(e),1:B(e),2:a?.name??``,poolRootRel:t,subRoot:n}}),children:(0,Z.jsx)(s,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":p({id:`G6Lrs_`,values:{0:B(e)}}),onClick:r=>{r.preventDefault(),r.stopPropagation(),window.confirm(p({id:`iiqOKM`,values:{0:B(e),1:a.name,2:B(e),subRoot:n,poolRootRel:t}}))&&re({scope:a.scope,root:n,action:`unlink`,exclude:[a.name]}).then(e=>{e.ok?_():g.error(p({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,Z.jsx)(o,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[21]=p,t[22]=a,t[23]=ie):ie=t[23];let H=ie;b=n.installing;let U=te(a),W=Ue,G;t[24]!==p||t[25]!==l||t[26]!==n?(G=(e,t,i)=>{let a=i===`link`?`copy`:`link`;return(0,Z.jsx)($,{hint:p(i===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,Z.jsx)(s,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 font-normal text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:r=>{r.preventDefault(),r.stopPropagation(),window.confirm(p(a===`link`?{id:`m0eHej`,values:{display:t}}:{id:`HbcQYf`,values:{display:t}}))&&(l?.(),n.convertLocation?.(e,a))},"data-testid":`skill-convert-${e}`,children:i===`link`?(0,Z.jsx)(r,{id:`uUCrBv`}):(0,Z.jsx)(r,{id:`iaPtht`})})})},t[24]=p,t[25]=l,t[26]=n,t[27]=G):G=t[27];let ae=G,K;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Z.jsx)(r,{id:`npcziF`}),t[28]=K):K=t[28];let q;t[29]===p?q=t[30]:(q=p({id:`6f_UX4`}),t[29]=p,t[30]=q);let J;t[31]===v?J=t[32]:(J=()=>v(),t[31]=v,t[32]=J);let oe;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,Z.jsx)(r,{id:`N40H-G`}),t[33]=oe):oe=t[33];let Y;t[34]!==b||t[35]!==J?(Y=(0,Z.jsx)(s,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:b,onClick:J,"data-testid":`skill-install-all`,children:oe}),t[34]=b,t[35]=J,t[36]=Y):Y=t[36];let X;t[37]!==q||t[38]!==Y?(X=(0,Z.jsx)($,{hint:q,children:Y}),t[37]=q,t[38]=Y,t[39]=X):X=t[39],t[40]!==f||t[41]!==X?(E=(0,Z.jsxs)(ve,{menuKind:f,className:`flex items-center justify-between gap-2`,children:[K,X]}),t[40]=f,t[41]=X,t[42]=E):E=t[42],O=T===null?null:(0,Z.jsx)($,{hint:p({id:`pXB6SL`}),children:(0,Z.jsxs)(_e,{menuKind:f,disabled:b,checked:!0,onSelect:He,"data-testid":`skill-source-row`,children:[(0,Z.jsx)(ee,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:T}),(()=>{let e=W(T).split(`/`).slice(0,-1).join(`/`),t=z(e);return t.length>0?(0,Z.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>H(t,e))}):null})(),(0,Z.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,Z.jsx)(r,{id:`tiFPjk`})})]})]})}),k=w.map(t=>{let i=e(t),l=t===`agents`?`.agents`:d[t],u=W(i).split(`/`).slice(0,-1).join(`/`),g=z(u);return(0,Z.jsx)($,{hint:N.has(t)?p({id:`8HvJlU`,values:{0:i??l}}):t===M?i?p({id:`ssk6rl`,values:{path:i}}):l:m.has(t)?p(i?{id:`9ieZhu`,values:{path:i}}:{id:`n3T3EE`,values:{label:l}}):U?.editor===t?p({id:`_3S4Ql`,values:{0:a?.name??``,1:U.plugin,2:i??l,label:l}}):p(i?M===void 0?{id:`xk133d`,values:{path:i}}:C===`link`?{id:`1LtA5r`,values:{path:i}}:{id:`opPbzN`,values:{path:i}}:{id:`Pp0Vgd`,values:{label:l}}),children:(0,Z.jsxs)(_e,{menuKind:f,disabled:b,checked:m.has(t),onCheckedChange:e=>{N.has(t)||e===!0&&!V(u)||h(t,e===!0)},onSelect:Ve,className:`group`,"data-testid":`skill-install-editor-${t}`,children:[(0,Z.jsx)(o,{host:t,"aria-hidden":!0,className:`size-4`}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:i??l}),g.length>0?(0,Z.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${t}`,children:g.map(e=>H(e,u))}):null,U?.editor===t&&!m.has(t)?(0,Z.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,"data-testid":`skill-row-plugin-covered-${t}`,children:(0,Z.jsx)(r,{id:`scRzTw`})}):null,N.has(t)?(0,Z.jsx)($,{hint:p({id:`_O7dJS`}),children:(0,Z.jsx)(s,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:e=>{e.preventDefault(),c?.(t)},"data-testid":`skill-fork-chip-${t}`,children:(0,Z.jsx)(r,{id:`jng7Ko`})})}):t===M?(0,Z.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,Z.jsx)(r,{id:`tiFPjk`})}):m.has(t)&&a?.hosts?(0,Z.jsxs)(Z.Fragment,{children:[!b&&(F.has(t)?`link`:`copy`)!==C?ae(t,i??l,F.has(t)?`link`:`copy`):null,(0,Z.jsx)($,{hint:p({id:`nBgzKO`}),children:(0,Z.jsx)(s,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:e=>{e.preventDefault(),e.stopPropagation(),n.setSource?.(t)},"data-testid":`skill-set-source-${t}`,children:(0,Z.jsx)(r,{id:`VNNRfN`})})})]}):null,!b&&P.has(W(i))?(0,Z.jsx)($,{hint:p({id:`iz1LdD`}),children:(0,Z.jsx)(me,{testId:`skill-drift-${t}`})}):null]})]})},t)}),A=S.map(e=>{let t=e.display;return(0,Z.jsx)($,{hint:e.placed===null?p(M===void 0?{id:`xk133d`,values:{path:t}}:C===`link`?{id:`1LtA5r`,values:{path:t}}:{id:`opPbzN`,values:{path:t}}):p({id:`9ieZhu`,values:{path:t}}),children:(0,Z.jsxs)(_e,{menuKind:f,disabled:b,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!V(e.root))return;n.placeAt(e.root,C)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:Be,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,Z.jsx)(o,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,Z.jsx)(ee,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),z(e.root).length>0?(0,Z.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:z(e.root).map(t=>H(t,e.root))}):null,!b&&e.placed!==null&&P.has(e.placed.path)?(0,Z.jsx)($,{hint:p({id:`iz1LdD`}),children:(0,Z.jsx)(me,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,Z.jsxs)(Z.Fragment,{children:[!b&&e.placed.mode!==C?ae(e.root,e.display,e.placed.mode):null,(0,Z.jsx)($,{hint:p({id:`nBgzKO`}),children:(0,Z.jsx)(s,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setSource?.(e.root)},"data-testid":`skill-set-source-custom-${e.root}`,children:(0,Z.jsx)(r,{id:`VNNRfN`})})})]})]})]})},e.root)}),t[0]=p,t[1]=y.data,t[2]=y.status,t[3]=m,t[4]=v,t[5]=f,t[6]=c,t[7]=l,t[8]=a,t[9]=h,t[10]=n,t[11]=b,t[12]=x,t[13]=S,t[14]=C,t[15]=w,t[16]=T,t[17]=E,t[18]=O,t[19]=k,t[20]=A}else b=t[11],x=t[12],S=t[13],C=t[14],w=t[15],T=t[16],E=t[17],O=t[18],k=t[19],A=t[20];let j;t[43]!==S||t[44]!==w.length||t[45]!==T?(j=w.length===0&&S.length===0&&T===null?(0,Z.jsx)(`div`,{className:`px-2 py-1.5 text-[11px] text-muted-foreground leading-snug`,"data-testid":`skill-install-no-destinations`,children:(0,Z.jsx)(r,{id:`MOAoFO`})}):null,t[43]=S,t[44]=w.length,t[45]=T,t[46]=j):j=t[46];let N;t[47]!==p||t[48]!==b||t[49]!==x||t[50]!==C||t[51]!==l||t[52]!==n?(N=x.length>0&&n.convertLocations?(0,Z.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,Z.jsx)(s,{variant:`ghost`,size:`sm`,className:`h-auto whitespace-normal p-0 text-left font-normal text-[11px] text-muted-foreground leading-snug hover:bg-transparent hover:text-foreground`,onClick:e=>{e.preventDefault();let t=C===`link`?`copy`:`link`,r=x.filter(e=>e.mode!==t);if(r.length===0)return;let i=p(t===`copy`?{id:`iOAsF1`}:{id:`MS8lMS`}),a=p(t===`copy`?{id:`gZiT5e`}:{id:`PhIa-X`}),o=r.map(ze).join(`
|
|
2
2
|
`);window.confirm(`${i}\n\n${a}\n\n${o}\n\n${p({id:`Cu6GXQ`})}`)&&(l?.(),n.convertLocations?.(r.map(e=>({target:e.target,mode:t}))))},disabled:b,"data-testid":`skill-convert-all`,children:C===`link`?(0,Z.jsx)(r,{id:`rcJmK8`}):(0,Z.jsx)(r,{id:`LBv_TR`})}),(0,Z.jsx)($,{hint:p({id:`0J6nhG`}),children:(0,Z.jsx)(s,{variant:`ghost`,size:`sm`,"aria-label":p({id:`qJSo0_`}),className:`size-4 shrink-0 rounded-full border border-border/60 p-0 font-normal text-[9px] text-muted-foreground hover:border-foreground/40 hover:bg-transparent hover:text-foreground`,onClick:Re,"data-testid":`skill-convert-all-help`,children:`?`})})]}):null,t[47]=p,t[48]=b,t[49]=x,t[50]=C,t[51]=l,t[52]=n,t[53]=N):N=t[53];let P;t[54]===f?P=t[55]:(P=(0,Z.jsx)(ye,{menuKind:f}),t[54]=f,t[55]=P);let F;t[56]===p?F=t[57]:(F=p({id:`5ymuTA`}),t[56]=p,t[57]=F);let I;t[58]===a?.scope?I=t[59]:(I=()=>{window.location.hash=a?.scope===`global`?`#settings/user-skills`:`#settings/skills`},t[58]=a?.scope,t[59]=I);let L,R;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(H,{"aria-hidden":!0}),R=(0,Z.jsx)(r,{id:`ZBF9fn`}),t[60]=L,t[61]=R):(L=t[60],R=t[61]);let z;t[62]!==f||t[63]!==I?(z=(0,Z.jsxs)(ge,{menuKind:f,onSelect:I,children:[L,R]}),t[62]=f,t[63]=I,t[64]=z):z=t[64];let B;t[65]!==z||t[66]!==F?(B=(0,Z.jsx)($,{hint:F,children:z}),t[65]=z,t[66]=F,t[67]=B):B=t[67];let V;return t[68]!==B||t[69]!==E||t[70]!==O||t[71]!==k||t[72]!==A||t[73]!==j||t[74]!==N||t[75]!==P?(V=(0,Z.jsxs)(Z.Fragment,{children:[E,O,k,A,j,N,P,B]}),t[68]=B,t[69]=E,t[70]=O,t[71]=k,t[72]=A,t[73]=j,t[74]=N,t[75]=P,t[76]=V):V=t[76],V}function Re(e){return e.preventDefault()}function ze(e){return e.display}function Be(e){return e.preventDefault()}function Ve(e){return e.preventDefault()}function He(e){return e.preventDefault()}function Ue(e){return(e??``).replace(/^~\//,``)}function We(e){return e===`agents`?`.agents`:d[e]??e}export{H as _,ke as a,ve as c,xe as d,Se as f,le as g,pe as h,Ae as i,ye as l,fe as m,Le as n,he as o,me as p,Pe as r,ge as s,Ne as t,be as u,ie as v,V as y};
|
package/dist/public/assets/{SkillToolbarControls-DFtsQTPD.js → SkillToolbarControls-Dj7R3GkY.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{t as s}from"./button-BeFNZANd.js";import{a as c,i as l,n as u,o as d,r as f,s as p,t as m}from"./select-D_BhUvh8.js";import{l as h,n as g,r as _,t as v}from"./AddPropertiesButton-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{t as s}from"./button-BeFNZANd.js";import{a as c,i as l,n as u,o as d,r as f,s as p,t as m}from"./select-D_BhUvh8.js";import{l as h,n as g,r as _,t as v}from"./AddPropertiesButton-DzZJSDcj.js";import{a as y,h as b,r as x,t as S,u as C}from"./dropdown-menu-BEhl0wvu.js";import{y as w}from"./SkillInstallMenu-CkOeQ2Ai.js";import{t as T}from"./list-plus-M50FahtU.js";import{p as E,t as D}from"./skill-scope-BkSXs9Lm.js";var O=a(),k=t();function A(e){let t=(0,O.c)(21),{value:n,onRequestMove:a,disabled:s,triggerClassName:h}=e,{_:g}=i(),_=E(),v;t[0]===a?v=t[1]:(v=e=>a(e),t[0]=a,t[1]=v);let y;t[2]===g?y=t[3]:(y=g({id:`oCHfGC`}),t[2]=g,t[3]=y);let b;t[4]===h?b=t[5]:(b=o(`w-auto gap-1 text-xs font-mono uppercase`,h),t[4]=h,t[5]=b);let x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,k.jsx)(p,{}),t[6]=x):x=t[6];let S;t[7]!==y||t[8]!==b?(S=(0,k.jsx)(d,{size:`sm`,"aria-label":y,"data-testid":`skill-level-select`,className:b,children:x}),t[7]=y,t[8]=b,t[9]=S):S=t[9];let C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,k.jsx)(c,{children:(0,k.jsx)(r,{id:`oCHfGC`})}),t[10]=C):C=t[10];let w;t[11]===_?w=t[12]:(w=D.map(e=>(0,k.jsx)(l,{value:e,children:_[e]},e)),t[11]=_,t[12]=w);let T;t[13]===w?T=t[14]:(T=(0,k.jsx)(u,{align:`end`,children:(0,k.jsxs)(f,{children:[C,w]})}),t[13]=w,t[14]=T);let A;return t[15]!==s||t[16]!==v||t[17]!==S||t[18]!==T||t[19]!==n?(A=(0,k.jsxs)(m,{value:n,onValueChange:v,disabled:s,children:[S,T]}),t[15]=s,t[16]=v,t[17]=S,t[18]=T,t[19]=n,t[20]=A):A=t[20],A}var j=e(n(),1);function M(e){let t=(0,O.c)(12),{scope:n,name:r}=e,[i,a]=(0,j.useState)(null),o;t[0]===n?o=t[1]:(o=e=>{e!==n&&a(e)},t[0]=n,t[1]=o);let s;t[2]!==r||t[3]!==i||t[4]!==n?(s=i?{scope:n,name:r,toScope:i}:null,t[2]=r,t[3]=i,t[4]=n,t[5]=s):s=t[5];let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>!e&&a(null),t[6]=c):c=t[6];let l;t[7]===s?l=t[8]:(l=(0,k.jsx)(h,{target:s,onOpenChange:c}),t[7]=s,t[8]=l);let u;return t[9]!==o||t[10]!==l?(u={requestMove:o,dialog:l},t[9]=o,t[10]=l,t[11]=u):u=t[11],u}function N(e){let t=(0,O.c)(41),{scope:n,name:a,showAddPropertyButton:o,onAddProperty:c,problemCount:l,problemMessages:u}=e,{_:d}=i(),f;t[0]!==a||t[1]!==n?(f={scope:n,name:a},t[0]=a,t[1]=n,t[2]=f):f=t[2];let p=M(f),m;t[3]!==p.requestMove||t[4]!==n?(m=(0,k.jsx)(A,{value:n,onRequestMove:p.requestMove,triggerClassName:`hidden @xl/toolbar:flex`}),t[3]=p.requestMove,t[4]=n,t[5]=m):m=t[5];let h;t[6]!==a||t[7]!==n?(h=(0,k.jsx)(_,{scope:n,name:a}),t[6]=a,t[7]=n,t[8]=h):h=t[8];let E;t[9]!==m||t[10]!==h?(E=(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[m,h]}),t[9]=m,t[10]=h,t[11]=E):E=t[11];let D;t[12]!==c||t[13]!==l||t[14]!==u||t[15]!==o?(D=o?(0,k.jsx)(v,{onAddProperty:c,problemCount:l,problemMessages:u,className:`hidden @xl/toolbar:inline-flex`}):null,t[12]=c,t[13]=l,t[14]=u,t[15]=o,t[16]=D):D=t[16];let j;t[17]===d?j=t[18]:(j=d({id:`Yzs3QX`}),t[17]=d,t[18]=j);let N;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,k.jsx)(w,{className:`size-4`,"aria-hidden":!0}),t[19]=N):N=t[19];let P;t[20]===j?P=t[21]:(P=(0,k.jsx)(b,{asChild:!0,children:(0,k.jsx)(s,{variant:`ghost`,size:`icon`,"aria-label":j,"data-testid":`skill-toolbar-overflow`,className:`@xl/toolbar:hidden`,children:N})}),t[20]=j,t[21]=P);let F;t[22]===p?F=t[23]:(F=e=>p.requestMove(e),t[22]=p,t[23]=F);let I;t[24]!==n||t[25]!==F?(I=(0,k.jsx)(g,{value:n,onSelect:F}),t[24]=n,t[25]=F,t[26]=I):I=t[26];let L;t[27]!==c||t[28]!==o?(L=o?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(C,{}),(0,k.jsxs)(y,{onSelect:c,children:[(0,k.jsx)(T,{}),(0,k.jsx)(r,{id:`81H_23`})]})]}):null,t[27]=c,t[28]=o,t[29]=L):L=t[29];let R;t[30]!==I||t[31]!==L?(R=(0,k.jsxs)(x,{align:`end`,className:`min-w-44`,children:[I,L]}),t[30]=I,t[31]=L,t[32]=R):R=t[32];let z;t[33]!==R||t[34]!==P?(z=(0,k.jsxs)(S,{children:[P,R]}),t[33]=R,t[34]=P,t[35]=z):z=t[35];let B;return t[36]!==p.dialog||t[37]!==z||t[38]!==E||t[39]!==D?(B=(0,k.jsxs)(k.Fragment,{children:[E,D,z,p.dialog]}),t[36]=p.dialog,t[37]=z,t[38]=E,t[39]=D,t[40]=B):B=t[40],B}export{N as SkillToolbarControls};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{t as s}from"./button-BeFNZANd.js";import{Ac as c,Fc as l,Ic as u,Lc as d,Mc as f,Nc as p,Tc as m,jc as h,kc as g}from"./dist-BS18tPvg.js";import{r as _}from"./use-apply-config-theme-B5w38X1P.js";import{t as v}from"./triangle-alert--Fl5KoVX.js";import{t as y}from"./x-BcfoD9-8.js";import{f as b,p as ee,u as te}from"./doc-paths-wf1Zwihi.js";import{n as ne}from"./page-list-cache-3qGG2z03.js";import{f as x,h as S}from"./file-tree-adapter-DEH021-T.js";import{t as re}from"./use-live-xterm-theme-X4_1Rmea.js";import{i as C,r as w}from"./terminal-command-events-LkibGwt_.js";import{t as T}from"./TerminalStartingNotice-BbwsOE78.js";import{a as E,f as ie,m as ae,t as D,u as O,v as k,y as oe}from"./agent-connection-status-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{t as s}from"./button-BeFNZANd.js";import{Ac as c,Fc as l,Ic as u,Lc as d,Mc as f,Nc as p,Tc as m,jc as h,kc as g}from"./dist-BS18tPvg.js";import{r as _}from"./use-apply-config-theme-B5w38X1P.js";import{t as v}from"./triangle-alert--Fl5KoVX.js";import{t as y}from"./x-BcfoD9-8.js";import{f as b,p as ee,u as te}from"./doc-paths-wf1Zwihi.js";import{n as ne}from"./page-list-cache-3qGG2z03.js";import{f as x,h as S}from"./file-tree-adapter-DEH021-T.js";import{t as re}from"./use-live-xterm-theme-X4_1Rmea.js";import{i as C,r as w}from"./terminal-command-events-LkibGwt_.js";import{t as T}from"./TerminalStartingNotice-BbwsOE78.js";import{a as E,f as ie,m as ae,t as D,u as O,v as k,y as oe}from"./agent-connection-status-Bbe4NIF_.js";var se=a();function ce(e){throw Error(`unhandled pty create reason: ${String(e)}`)}function le(e){throw Error(`unhandled pty adopt reason: ${String(e)}`)}var ue=2,de=1,fe=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(ue,Math.floor(u/e.css.cell.width)),rows:Math.max(de,Math.floor(l/e.css.cell.height))}}},pe=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],me=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],A;function j(e,t){let n=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var he=class{constructor(){if(this.version=`6`,!A){A=new Uint8Array(65536),A.fill(1),A[0]=0,A.fill(0,1,32),A.fill(0,127,160),A.fill(2,4352,4448),A[9001]=2,A[9002]=2,A.fill(2,11904,42192),A[12351]=1,A.fill(2,44032,55204),A.fill(2,63744,64256),A.fill(2,65040,65050),A.fill(2,65072,65136),A.fill(2,65280,65377),A.fill(2,65504,65511);for(let e=0;e<pe.length;++e)A.fill(0,pe[e][0],pe[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?A[e]:j(e,me)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let e=pt.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return pt.createPropertyValue(0,n,r)}},M=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?be.isErrorNoTelemetry(e)?new be(e.message+`
|
|
2
2
|
|
|
3
3
|
`+e.stack):Error(e.message+`
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r}from"./dist-PQ5KMVDh.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{t as a}from"./use-installed-clis-CuUx3tVA.js";import{t as o}from"./config-provider-B75KsU34.js";import{t as s}from"./use-live-xterm-theme-X4_1Rmea.js";import{t as c}from"./ReportBugMenuTrigger-DtEHTCER.js";import{SessionsHost as l}from"./SessionsHost-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r}from"./dist-PQ5KMVDh.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{t as a}from"./use-installed-clis-CuUx3tVA.js";import{t as o}from"./config-provider-B75KsU34.js";import{t as s}from"./use-live-xterm-theme-X4_1Rmea.js";import{t as c}from"./ReportBugMenuTrigger-DtEHTCER.js";import{SessionsHost as l}from"./SessionsHost-BhvuDK9n.js";var u=i(),d=e(n(),1),f=t();function p(e){let t=(0,u.c)(9),{bridge:n}=e,r=n.config.collabUrl?n.config.collabUrl:null,i=r===null,a;t[0]===n?a=t[1]:(a=(0,f.jsx)(m,{bridge:n}),t[0]=n,t[1]=a);let s=r===null,l;t[2]===s?l=t[3]:(l=(0,f.jsx)(c,{systemWide:s}),t[2]=s,t[3]=l);let d;return t[4]!==r||t[5]!==i||t[6]!==a||t[7]!==l?(d=(0,f.jsxs)(o,{collabUrl:r,collabTerminal:i,children:[a,l]}),t[4]=r,t[5]=i,t[6]=a,t[7]=l,t[8]=d):d=t[8],d}function m(e){let t=(0,u.c)(9),{bridge:n}=e,{resolvedTheme:i}=r(),o=s(i),c=a(),[p,m]=(0,d.useState)(null),_;t[0]===o.background?_=t[1]:(_=(0,f.jsx)(`div`,{ref:m,className:`flex h-screen min-h-0 flex-col`,style:{backgroundColor:o.background}}),t[0]=o.background,t[1]=_);let v;t[2]!==n||t[3]!==p||t[4]!==c?(v=(0,f.jsx)(l,{bridge:n,surface:`terminal-window`,terminalCapable:!0,visible:!0,onVisibleChange:g,installedClis:c,container:p,isShowing:!0,onRequestEditorFocus:h}),t[2]=n,t[3]=p,t[4]=c,t[5]=v):v=t[5];let y;return t[6]!==_||t[7]!==v?(y=(0,f.jsxs)(f.Fragment,{children:[_,v]}),t[6]=_,t[7]=v,t[8]=y):y=t[8],y}function h(){}function g(e){e||window.close()}export{p as TerminalWindowApp};
|