@inkeep/open-knowledge 0.79.2 → 0.79.3-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +70 -68
- package/dist/constants-wVFbQ-W8.mjs +1 -0
- package/dist/{dist-Cmgb0r3p.mjs → dist-Bt-cb2ik.mjs} +472 -472
- package/dist/dist-CZBCHPnO.mjs +1 -0
- package/dist/index.mjs +188 -188
- package/dist/init-CqGfdMuB.mjs +1 -0
- package/dist/{init-CjbAcLHr.mjs → init-H4L4PCDm.mjs} +14 -14
- package/dist/{launch-json-removal-1V6_UV5_.mjs → launch-json-removal-DAf1fKWA.mjs} +1 -1
- package/dist/loader-BK3wGq2e.mjs +1 -0
- package/dist/{loader-Cmpu_239.mjs → loader-gbJWrT9X.mjs} +1 -1
- package/dist/native/native-config.win32-arm64-msvc.node +0 -0
- package/dist/native/native-config.win32-x64-msvc.node +0 -0
- package/dist/{open-browser-CNVUL-A_.mjs → open-browser-Co1psphf.mjs} +1 -1
- package/dist/{preview-CUsQsBjV.mjs → preview-CMgnC4UA.mjs} +1 -1
- package/dist/preview-DPQ4BPLK.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-CwiUBgGI.js → ActivityModeContent--2lvtA3c.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-B5wgFBcs.js → AddPropertiesButton-C-iLRZ1e.js} +2 -2
- package/dist/public/assets/{AgentDiffPane-DCr3QWvF.js → AgentDiffPane-D6x5wd4h.js} +1 -1
- package/dist/public/assets/{BugReportHistory-BQMbH-qH.js → BugReportHistory-DSKcw3JQ.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-BRdfOcWv.js → BugReportHistoryDialog-N-Ap1hJt.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-CjC1gT00.js → CodeMirrorPropInput-C6PE1vK2.js} +1 -1
- package/dist/public/assets/{ConsentDialogBody-DWjU5hm4.js → ConsentDialogBody-NBiDlYMd.js} +1 -1
- package/dist/public/assets/{DeleteConfirmationDialog-CJJ8Xo5u.js → DeleteConfirmationDialog-DYyGQK4Z.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-BGdnGPRv.js → DiffViewBoundary-_HbzD0gR.js} +1 -1
- package/dist/public/assets/{DocumentContext-Dlldf3A6.js → DocumentContext-DjP4XRJx.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-CUFvhR2v.js → EditorModeToggle-BOmmVDPD.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-DfwumFEb.js → EnableSyncConfirmDialog-C6j7G_kd.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-CylNX2Db.js → ExcalidrawDocEditor-CAYMSmAF.js} +1 -1
- package/dist/public/assets/FeedbackForm-t3IG2SJR.js +1 -0
- package/dist/public/assets/{GraphPanel-BQaGu4a5.js → GraphPanel-BMOYeFVW.js} +1 -1
- package/dist/public/assets/{ImageAttachments-mkcDupGd.js → ImageAttachments-CIgN2ICo.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-DSya0fK3.js → ImportSkillDialog-BXsrd5h-.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-BsTgh8nL.js → LintConfigEditor-D5DY2Ucg.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-BnJzcs6f.js +1 -0
- package/dist/public/assets/ManagedArtifactProperties-sumfs_C-.js +1 -0
- package/dist/public/assets/{McpConsentDialogBody-BGioo7-j.js → McpConsentDialogBody-Dj5qWFur.js} +1 -1
- package/dist/public/assets/{Mermaid-DP2in8wt.js → Mermaid-BG4D_HOk.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-634q13Qg.js → MermaidDocEditor-CWmiEhhJ.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-B_AEbfI7.js → PropertyDisplayRow-CrxEj3M3.js} +2 -2
- package/dist/public/assets/{ReportBugDialogBody-ABNMdMUU.js → ReportBugDialogBody-C-53A-0F.js} +1 -1
- package/dist/public/assets/{ReportBugMenuTrigger-DRki3qOn.js → ReportBugMenuTrigger-29birQ-y.js} +1 -1
- package/dist/public/assets/{RowDisclosure-B78fx5s2.js → RowDisclosure-roWTy1cj.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-D6Ve-pbq.js → SchemaConfigEditor-DbbukpG5.js} +1 -1
- package/dist/public/assets/{SessionsHost-BqU3aWOR.js → SessionsHost-CKvXoA48.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-UKT3bDul.js → SettingsDialogBody-PbyK1LoL.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-DE7uyxww.js → ShareBranchSwitchDialog-KJzH1_kA.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-D8d3_-15.js → ShareReceiveDialog-CLkMfCLe.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-Bx29cMNb.js → ShareReceiveMissDialog-CLVrxv3V.js} +1 -1
- package/dist/public/assets/{SkillForkDialog-ho4FUABV.js → SkillForkDialog-Cg2OBoX4.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-DpmMcdPv.js → SkillInstallMenu-DBCnHXH-.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-DmEjQplu.js → SkillOriginInline-kzOBcIFc.js} +2 -2
- package/dist/public/assets/{SkillToolbarControls-miZURo1o.js → SkillToolbarControls-DltyfwOH.js} +1 -1
- package/dist/public/assets/{SkillUpdateConflictDialog-BTP9zIit.js → SkillUpdateConflictDialog-kz67-4EX.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-CUfeiKej.js → SlidesToolbarControls-CAxEUrS2.js} +1 -1
- package/dist/public/assets/{SourceEditor-DCGr3Oun.js → SourceEditor-DLEw1wic.js} +1 -1
- package/dist/public/assets/{TerminalPanel-DDye0ppp.js → TerminalPanel-Cb8KkKGX.js} +1 -1
- package/dist/public/assets/{TerminalStartingNotice-CANxPK71.js → TerminalStartingNotice-BbwsOE78.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-QDFQJvJI.js → TerminalWindowApp-BXIexfq8.js} +1 -1
- package/dist/public/assets/{TextDocEditor-Dy2g4z9H.js → TextDocEditor-DeqaHCag.js} +1 -1
- package/dist/public/assets/{ThreadView-e6Emlmew.js → ThreadView-D1YayNv3.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-9-8JYbua.js → TimelineDiffPane-BCk40u8c.js} +1 -1
- package/dist/public/assets/{agent-connection-status-BTfitB3U.js → agent-connection-status-BKDHFOP-.js} +1 -1
- package/dist/public/assets/{alert-Cp5DpEia.js → alert-Bqwsa0Kr.js} +1 -1
- package/dist/public/assets/{alert-dialog-BJIyfEVh.js → alert-dialog-CqqfqWNT.js} +1 -1
- package/dist/public/assets/{auth-state-cache-CIg70qGh.js → auth-state-cache-COORa9sc.js} +1 -1
- package/dist/public/assets/{badge-MuddhvBr.js → badge-lmgHBfMn.js} +1 -1
- package/dist/public/assets/button-BeFNZANd.js +1 -0
- package/dist/public/assets/{calendar-DLVK4LG7.js → calendar-BR8UVbAy.js} +1 -1
- package/dist/public/assets/{client-version-DA4kJKPj.js → client-version-yBzdRoMs.js} +1 -1
- package/dist/public/assets/{comment-chips-Cnc9lZ6c.js → comment-chips-BGRnR7X7.js} +1 -1
- package/dist/public/assets/{config-provider-owr5M3NH.js → config-provider-CTHdqAYx.js} +1 -1
- package/dist/public/assets/{dialog-Q2r_wm4I.js → dialog-BfHNtxM9.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-CaLoly49.js → doc-undo-manager-DxMjEKx4.js} +1 -1
- package/dist/public/assets/{field-Cy222HIR.js → field-BLH6hVAa.js} +1 -1
- package/dist/public/assets/globals-Dg-24adS.css +1 -0
- package/dist/public/assets/index-CWenCiFy.js +2205 -0
- package/dist/public/assets/{input-group-D4IQIBdt.js → input-group-Brp49uT-.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-DYxq-YWd.js → markdownlint-rule-browser-D5yxtwtH.js} +1 -1
- package/dist/public/assets/messages-5nYhcGbk.js +1 -0
- package/dist/public/assets/messages-8wkpGWDl.js +1 -0
- package/dist/public/assets/messages-BE3F6wPf.js +1 -0
- package/dist/public/assets/messages-BYW3-b5z.js +1 -0
- package/dist/public/assets/messages-CE30qzpn.js +1 -0
- package/dist/public/assets/messages-CKBxrXnZ.js +1 -0
- package/dist/public/assets/messages-C_LttG3X.js +1 -0
- package/dist/public/assets/messages-Cd3H31Oo.js +1 -0
- package/dist/public/assets/messages-D-bBxZfD.js +1 -0
- package/dist/public/assets/messages-DLuudO75.js +1 -0
- package/dist/public/assets/messages-DoYSqXZ-.js +1 -0
- package/dist/public/assets/messages-nwFoZCFs.js +1 -0
- package/dist/public/assets/{pending-receive-nav-store-ru8vEtq1.js → pending-receive-nav-store-CQL0bv5o.js} +1 -1
- package/dist/public/assets/{preferred-session-events-Dhjm0Z1H.js → preferred-session-events-BEpzXSN8.js} +1 -1
- package/dist/public/assets/{progress-ChqYJ_wo.js → progress-C8ijsHox.js} +1 -1
- package/dist/public/assets/{project-paths-CDhA3hJy.js → project-paths-B-FMrj5U.js} +1 -1
- package/dist/public/assets/{selection-context-4lSNiVN-.js → selection-context-LrE0_TTe.js} +1 -1
- package/dist/public/assets/{src-C5n8TKJq.js → src-BxNPgEkh.js} +1 -1
- package/dist/public/assets/{tabs-BnFGmv6I.js → tabs-C7_T-n4e.js} +1 -1
- package/dist/public/assets/{tag-pill-input-BQX-_Adc.js → tag-pill-input-B28iAFxa.js} +1 -1
- package/dist/public/assets/{telemetry-impl-BjW04TM-.js → telemetry-impl-CDsHOhvm.js} +1 -1
- package/dist/public/assets/{telemetry-startup-BS9CaXrj.js → telemetry-startup-D-KW_NaP.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-Dmdb2rMF.js → terminal-launch-events-E89-i5D1.js} +1 -1
- package/dist/public/assets/{toggle-group-ZKcYQ5bn.js → toggle-group-BxIyZnUJ.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-BEdXQddD.js → typing-burst-detector-BI7H8DPb.js} +2 -2
- package/dist/public/assets/{uninstall-DXJMPkVq.js → uninstall-C5hq5xn8.js} +1 -1
- package/dist/public/assets/{use-activity-panel-CngLVlKx.js → use-activity-panel-D1MJ-kqr.js} +1 -1
- package/dist/public/assets/{use-apply-config-language-DgBG2Y3l.js → use-apply-config-language-DBt73Gpy.js} +2 -2
- package/dist/public/assets/{use-installed-clis-SziirqY4.js → use-installed-clis-F-bc0S3Y.js} +2 -2
- package/dist/public/assets/{use-open-skill-B-WzAe13.js → use-open-skill-BBxnHzMv.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-Dd55GJPP.js → use-terminal-enabled-BePo4VDS.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-D9Fyk7np.js → use-timeline-entry-diff-Cpz7ybaB.js} +1 -1
- package/dist/public/index.html +39 -39
- package/dist/public/uninstall.html +7 -7
- package/dist/registry-probes-DCe3rWZ7.mjs +17 -0
- package/dist/{removal-file-path-4H4PUJxJ.mjs → removal-file-path-DiyOqKix.mjs} +1 -1
- package/dist/{repair-launch-json-DAIGiTv8.mjs → repair-launch-json-CK7gSieg.mjs} +1 -1
- package/dist/{repair-mcp-configs-CO4UASHL.mjs → repair-mcp-configs-B2IwckuL.mjs} +1 -1
- package/dist/{src-CcEkY68s.mjs → src-7sNhM-_B.mjs} +5 -5
- package/dist/src-DZ44CKon.mjs +1 -0
- package/dist/{start-BuIYuZ-E.mjs → start-DYrDwaUD.mjs} +3 -3
- package/dist/start-DaOK3zKh.mjs +1 -0
- package/package.json +4 -4
- package/dist/constants-jpNm5-5s.mjs +0 -1
- package/dist/dist-DzdGKL8W.mjs +0 -1
- package/dist/init-BGM70oJ3.mjs +0 -1
- package/dist/loader-BVs3fR6_.mjs +0 -1
- package/dist/preview-DejneDxR.mjs +0 -1
- package/dist/public/assets/FeedbackForm-B2kRhtsR.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-CVIYFnTZ.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-DCWlX1Qg.js +0 -1
- package/dist/public/assets/button-HKX9wT1K.js +0 -1
- package/dist/public/assets/globals-uZ5VipkR.css +0 -1
- package/dist/public/assets/index-B4DpftwC.js +0 -2205
- package/dist/public/assets/messages-8is2no75.js +0 -1
- package/dist/public/assets/messages-BAuq9QNn.js +0 -1
- package/dist/public/assets/messages-BMB7_c7y.js +0 -1
- package/dist/public/assets/messages-C2mWhO6K.js +0 -1
- package/dist/public/assets/messages-CRnQAmA5.js +0 -1
- package/dist/public/assets/messages-CpKrli-X.js +0 -1
- package/dist/public/assets/messages-CuQCs__I.js +0 -1
- package/dist/public/assets/messages-DUAWetuM.js +0 -1
- package/dist/public/assets/messages-EThDD2lc.js +0 -1
- package/dist/public/assets/messages-JIbrz5bw.js +0 -1
- package/dist/public/assets/messages-eVBmDYMt.js +0 -1
- package/dist/public/assets/messages-tmp_OA3I.js +0 -1
- package/dist/registry-probes-ftrzXHET.mjs +0 -17
- package/dist/src--m06lQMP.mjs +0 -1
- package/dist/start-DqUv0wIj.mjs +0 -1
- /package/dist/public/assets/{globals-DS9_Iy6h.js → globals-BXFJsup3.js} +0 -0
package/dist/public/assets/{SettingsDialogBody-UKT3bDul.js → SettingsDialogBody-PbyK1LoL.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-Dlldf3A6.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-CqUXZZMo.js";import{t as w}from"./button-HKX9wT1K.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-BJIyfEVh.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-ZKcYQ5bn.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-Cg6tPVU5.js";import{a as Ge,i as Ke,o as qe}from"./terminal-telemetry-BA6DIKLO.js";import{$o as Je,As as Ye,Bc as Xe,Bo as Ze,Cn as Qe,Cs as $e,Dc as et,Ec as tt,Fo as nt,Go as rt,Hn as it,Ho as at,Io as ot,Lc as st,Lo as ct,Ms as lt,Oc as ut,Os as dt,Ot as ft,Qc as pt,Qo as mt,Sc as ht,Ss as gt,Tc as _t,Ts as vt,Uc as yt,Vo as bt,Vs as xt,Ws as St,Xo as Ct,Yn as wt,Yo as Tt,Zo as Et,_a as Dt,_c as Ot,as as kt,cs as At,es as jt,hs as Mt,is as Nt,jr as Pt,js as Ft,ks as It,ls as Lt,mi as Rt,mt as zt,os as Bt,ot as Vt,pt as Ht,ts as Ut,ui as Wt,us as Gt,vs as Kt,wc as qt,wn as Jt,ws as Yt,xc as Xt,xi as Zt,xs as Qt,zo as $t,zs as en}from"./dist-bQ5kvrpa.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-C4w2E5xi.js";import{t as fn}from"./dist-Cr4-nBVI.js";import{c as pn}from"./documents-events-j9AAd1Uc.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-D8HsZbz2.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-DfwumFEb.js";import{p as kn}from"./Mermaid-DP2in8wt.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-BWPMh-sI.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-CIg70qGh.js";import{g as kr,h as Ar,p as jr}from"./SkillInstallMenu-DpmMcdPv.js";import{It as Mr}from"./CodeMirrorPropInput-CjC1gT00.js";import{r as Nr,t as Pr}from"./use-git-sync-status-BnU8yWA0.js";import{o as Fr}from"./folder-config-api-DBYtfk4T.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-BKrv1Wyo.js";import{a as Jr}from"./startup-marks-c2tjYHWa.js";import{n as Yr}from"./config-provider-owr5M3NH.js";import{a as Xr}from"./skill-scope-B73Ci61z.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-Q2r_wm4I.js";import{m as ai}from"./skills-api-BazLRy2N.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-B54xiLpY.js";import{n as xi}from"./use-apply-config-language-DgBG2Y3l.js";import{t as Si}from"./external-link-CHXmlzco.js";import{t as Ci}from"./badge-MuddhvBr.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-Cy222HIR.js";import{t as ki}from"./ConfigSharingInfoTooltip-DJhEv6QQ.js";import{t as Ai}from"./use-skills-BZixx2iF.js";import{o as ji,s as Mi,t as Ni}from"./use-open-skill-B-WzAe13.js";import{r as Pi,t as Fi}from"./DeleteConfirmationDialog-CJJ8Xo5u.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-C26s8yTI.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-D4IQIBdt.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-BQFgUjko.js";import{t as ma}from"./tag-pill-input-BQX-_Adc.js";import{t as ha}from"./markdownlint-rule-browser-DYxq-YWd.js";import{n as ga}from"./schema-fields-view-intent-Dwms69SB.js";import{n as _a,t as va}from"./use-terminal-enabled-Dd55GJPP.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-BTfitB3U.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=$e(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(Gt(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(Gt(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 $e(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=pt[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:Xt[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(_t.map(ut).filter(Io)),t[28]=le):le=t[28];let ue=le,de;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(de=new Set(tt.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=Xt[e].external?.targetId;return t===void 0?`unknown`:ce(e,c[t]?.installed??null)}let n=_t.find(t=>ut(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?Xt[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))||qt[e].displayName.localeCompare(qt[t].displayName),t[48]=ke,t[49]=Ae);let je=_t.filter(e=>{let{displayName:t}=qt[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(et(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=tt.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=ht.filter(e=>!Ze.has(e)&&Ee(Da(e))),$e=Te!==``,nt=!L.isLoading&&!L.isError,rt=$e&&nt&&De.length===0&&je.length===0&&Je.length===0&&Qe.length===0,it=!$e||L.isLoading||L.isError||De.length>0,at=!$e||je.length>0,ot=!$e||Je.length>0||Qe.length>0,st=e=>wo(o,q,e),ct=e=>V.primaryKeys.has(Co(e)),lt=e=>V.ranks.get(Co(e))??2**53-1,dt=De.filter(ct),ft=[...$e||p?De:dt].sort((e,t)=>lt(e)-lt(t)||e.name.localeCompare(t.name)),pt=$e?0:De.length-dt.length,mt=je.filter(ke),gt=mt.length>0&&mt.length<je.length,vt=!gt||$e||_?je:mt,yt=gt&&!$e?je.length-mt.length:0,bt;t[56]===Ge?bt=t[57]:(bt=e=>Ge(e.id)!==`absent`,t[56]=Ge,t[57]=bt);let xt=Je.filter(bt),St=Qe.filter(e=>ce(e,ne.find(t=>t.id===e)?.row.detected??null)!==`absent`),Ct=xt.length+St.length,wt=Je.length+Qe.length,Tt=Ct>0&&Ct<wt,Et=!Tt||$e||y,Dt=Et?Je:xt,Ot=Et?Qe:St,kt=Tt&&!$e?wt-Ct:0,At=!nt||De.some(qe),jt=Ye&&je.some(ke),Mt;t[58]===c?Mt=t[59]:(Mt=e=>c[e.id]?.installed===!0,t[58]=c,t[59]=Mt);let Nt=Je.some(Mt),Pt=it?(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=st(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,Ft=at?(0,$.jsxs)(ho,{label:a({id:`ALhMYW`}),labelId:`settings-configure-agents-terminal`,children:[vt.map(e=>{let{displayName:t}=qt[e],n=Y[e]??null,r=ce(ut(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(ut(e),a({id:`QYfQdv`,values:{displayName:t}}),s,`terminal`,i,n,r,xo(ut(e))??qt[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),ut(e),`terminal`,t,Y[e]??null):void 0},e)}),(0,$.jsx)(_o,{hiddenCount:yt,expanded:_,onToggle:()=>v(No),testId:`configure-agents-terminal-show-more`})]},`terminal`):null,It=ot?(0,$.jsxs)(ho,{label:a({id:`BwKH4d`}),labelId:`settings-configure-agents-desktop`,labelIcon:(0,$.jsx)(An,{"aria-hidden":`true`,className:`size-3`}),children:[Dt.map(e=>{let t=c[e.id]?.installed??null,{displayName:n}=e,r=ze(o,e.id,t),i=ce(et(e.id),t),s=`configure-agents-desktop-row-${e.id}`,{status:l,action:u,hintAction:d,residualFiles:f,statusId:p}=he(et(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),et(e.id),`external`,n,t)},e.id)}),Ot.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:kt,expanded:y,onToggle:()=>b(Mo),testId:`configure-agents-desktop-show-more`})]},`desktop`):null,Lt=[{node:Pt,hasPresent:At},{node:Ft,hasPresent:jt},{node:It,hasPresent:Nt}].sort(jo).map(Ao),Rt;t[60]===a?Rt=t[61]:(Rt=a({id:`lBN3T6`}),t[60]=a,t[61]=Rt);let zt;t[62]===a?zt=t[63]:(zt=a({id:`D4I0F9`}),t[62]=a,t[63]=zt);let Bt;t[64]!==Rt||t[65]!==zt?(Bt=(0,$.jsx)(Ua,{titleId:`settings-configure-agents-title`,title:Rt,children:zt}),t[64]=Rt,t[65]=zt,t[66]=Bt):Bt=t[66];let Vt;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(Vt=(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]=Vt):Vt=t[67];let Ht;t[68]===Se?Ht=t[69]:(Ht=e=>Se(e.target.value),t[68]=Se,t[69]=Ht);let Ut;t[70]===a?Ut=t[71]:(Ut=a({id:`-7s4fw`}),t[70]=a,t[71]=Ut);let Wt;t[72]===a?Wt=t[73]:(Wt=a({id:`-7s4fw`}),t[72]=a,t[73]=Wt);let Gt;t[74]!==d||t[75]!==Ht||t[76]!==Ut||t[77]!==Wt?(Gt=(0,$.jsxs)(`div`,{className:`relative`,children:[Vt,(0,$.jsx)(oi,{value:d,onChange:Ht,placeholder:Ut,"aria-label":Wt,className:`ps-8`,"data-testid":`configure-agents-search`})]}),t[74]=d,t[75]=Ht,t[76]=Ut,t[77]=Wt,t[78]=Gt):Gt=t[78];let Kt;t[79]!==a||t[80]!==E?(Kt=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]=Kt):Kt=t[81];let Jt;t[82]!==a||t[83]!==C?(Jt=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]=Jt):Jt=t[84];let Yt;t[85]!==a||t[86]!==rt?(Yt=rt?(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]=rt,t[87]=Yt):Yt=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]!==Lt||t[116]!==Bt||t[117]!==Gt||t[118]!==Kt||t[119]!==Jt||t[120]!==Yt||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:[Bt,Gt,Kt,Jt,Yt,Lt,X,cn]}),t[115]=Lt,t[116]=Bt,t[117]=Gt,t[118]=Kt,t[119]=Jt,t[120]=Yt,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 et(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`&&Je.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})}),mt.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(Nt(bi(t))):e.scheme?Zo(Nt(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?Ut: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=It(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=At(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=At(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:()=>Nt(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=vt(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(Mt(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(Mt(e)&&e.code===`SCHEMA_INVALID`){let n=e.issues.find(e=>bs(e,t));if(n)return n.message}return Gt(e)}function bs(e,t){return e.path.map(String).join(`.`)===t}function xs(e){return e.split(`.`)}function Ss(e){if(!Mt(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=Ye(ct,e.path),l=c?ms(c):void 0,u=c?ps(c):void 0,d=c?hs(c):void 0,f=c?Lt(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=lt(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-DjP4XRJx.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-CqUXZZMo.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-Cg6tPVU5.js";import{a as Ge,i as Ke,o as qe}from"./terminal-telemetry-BA6DIKLO.js";import{$o as Je,As as Ye,Bc as Xe,Bo as Ze,Cn as Qe,Cs as $e,Dc as et,Ec as tt,Fo as nt,Go as rt,Hn as it,Ho as at,Io as ot,Lc as st,Lo as ct,Ms as lt,Oc as ut,Os as dt,Ot as ft,Qc as pt,Qo as mt,Sc as ht,Ss as gt,Tc as _t,Ts as vt,Uc as yt,Vo as bt,Vs as xt,Ws as St,Xo as Ct,Yn as wt,Yo as Tt,Zo as Et,_a as Dt,_c as Ot,as as kt,cs as At,es as jt,hs as Mt,is as Nt,jr as Pt,js as Ft,ks as It,ls as Lt,mi as Rt,mt as zt,os as Bt,ot as Vt,pt as Ht,ts as Ut,ui as Wt,us as Gt,vs as Kt,wc as qt,wn as Jt,ws as Yt,xc as Xt,xi as Zt,xs as Qt,zo as $t,zs as en}from"./dist-bQ5kvrpa.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-C4w2E5xi.js";import{t as fn}from"./dist-Cr4-nBVI.js";import{c as pn}from"./documents-events-j9AAd1Uc.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-D8HsZbz2.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-C6j7G_kd.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-BWPMh-sI.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-COORa9sc.js";import{g as kr,h as Ar,p as jr}from"./SkillInstallMenu-DBCnHXH-.js";import{It as Mr}from"./CodeMirrorPropInput-C6PE1vK2.js";import{r as Nr,t as Pr}from"./use-git-sync-status-BnU8yWA0.js";import{o as Fr}from"./folder-config-api-DBYtfk4T.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-BKrv1Wyo.js";import{a as Jr}from"./startup-marks-c2tjYHWa.js";import{n as Yr}from"./config-provider-CTHdqAYx.js";import{a as Xr}from"./skill-scope-B73Ci61z.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-BazLRy2N.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-B54xiLpY.js";import{n as xi}from"./use-apply-config-language-DBt73Gpy.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-BZixx2iF.js";import{o as ji,s as Mi,t as Ni}from"./use-open-skill-BBxnHzMv.js";import{r as Pi,t as Fi}from"./DeleteConfirmationDialog-DYyGQK4Z.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-C26s8yTI.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-BQFgUjko.js";import{t as ma}from"./tag-pill-input-B28iAFxa.js";import{t as ha}from"./markdownlint-rule-browser-D5yxtwtH.js";import{n as ga}from"./schema-fields-view-intent-Dwms69SB.js";import{n as _a,t as va}from"./use-terminal-enabled-BePo4VDS.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-BKDHFOP-.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=$e(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(Gt(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(Gt(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 $e(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=pt[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:Xt[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(_t.map(ut).filter(Io)),t[28]=le):le=t[28];let ue=le,de;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(de=new Set(tt.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=Xt[e].external?.targetId;return t===void 0?`unknown`:ce(e,c[t]?.installed??null)}let n=_t.find(t=>ut(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?Xt[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))||qt[e].displayName.localeCompare(qt[t].displayName),t[48]=ke,t[49]=Ae);let je=_t.filter(e=>{let{displayName:t}=qt[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(et(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=tt.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=ht.filter(e=>!Ze.has(e)&&Ee(Da(e))),$e=Te!==``,nt=!L.isLoading&&!L.isError,rt=$e&&nt&&De.length===0&&je.length===0&&Je.length===0&&Qe.length===0,it=!$e||L.isLoading||L.isError||De.length>0,at=!$e||je.length>0,ot=!$e||Je.length>0||Qe.length>0,st=e=>wo(o,q,e),ct=e=>V.primaryKeys.has(Co(e)),lt=e=>V.ranks.get(Co(e))??2**53-1,dt=De.filter(ct),ft=[...$e||p?De:dt].sort((e,t)=>lt(e)-lt(t)||e.name.localeCompare(t.name)),pt=$e?0:De.length-dt.length,mt=je.filter(ke),gt=mt.length>0&&mt.length<je.length,vt=!gt||$e||_?je:mt,yt=gt&&!$e?je.length-mt.length:0,bt;t[56]===Ge?bt=t[57]:(bt=e=>Ge(e.id)!==`absent`,t[56]=Ge,t[57]=bt);let xt=Je.filter(bt),St=Qe.filter(e=>ce(e,ne.find(t=>t.id===e)?.row.detected??null)!==`absent`),Ct=xt.length+St.length,wt=Je.length+Qe.length,Tt=Ct>0&&Ct<wt,Et=!Tt||$e||y,Dt=Et?Je:xt,Ot=Et?Qe:St,kt=Tt&&!$e?wt-Ct:0,At=!nt||De.some(qe),jt=Ye&&je.some(ke),Mt;t[58]===c?Mt=t[59]:(Mt=e=>c[e.id]?.installed===!0,t[58]=c,t[59]=Mt);let Nt=Je.some(Mt),Pt=it?(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=st(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,Ft=at?(0,$.jsxs)(ho,{label:a({id:`ALhMYW`}),labelId:`settings-configure-agents-terminal`,children:[vt.map(e=>{let{displayName:t}=qt[e],n=Y[e]??null,r=ce(ut(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(ut(e),a({id:`QYfQdv`,values:{displayName:t}}),s,`terminal`,i,n,r,xo(ut(e))??qt[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),ut(e),`terminal`,t,Y[e]??null):void 0},e)}),(0,$.jsx)(_o,{hiddenCount:yt,expanded:_,onToggle:()=>v(No),testId:`configure-agents-terminal-show-more`})]},`terminal`):null,It=ot?(0,$.jsxs)(ho,{label:a({id:`BwKH4d`}),labelId:`settings-configure-agents-desktop`,labelIcon:(0,$.jsx)(An,{"aria-hidden":`true`,className:`size-3`}),children:[Dt.map(e=>{let t=c[e.id]?.installed??null,{displayName:n}=e,r=ze(o,e.id,t),i=ce(et(e.id),t),s=`configure-agents-desktop-row-${e.id}`,{status:l,action:u,hintAction:d,residualFiles:f,statusId:p}=he(et(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),et(e.id),`external`,n,t)},e.id)}),Ot.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:kt,expanded:y,onToggle:()=>b(Mo),testId:`configure-agents-desktop-show-more`})]},`desktop`):null,Lt=[{node:Pt,hasPresent:At},{node:Ft,hasPresent:jt},{node:It,hasPresent:Nt}].sort(jo).map(Ao),Rt;t[60]===a?Rt=t[61]:(Rt=a({id:`lBN3T6`}),t[60]=a,t[61]=Rt);let zt;t[62]===a?zt=t[63]:(zt=a({id:`D4I0F9`}),t[62]=a,t[63]=zt);let Bt;t[64]!==Rt||t[65]!==zt?(Bt=(0,$.jsx)(Ua,{titleId:`settings-configure-agents-title`,title:Rt,children:zt}),t[64]=Rt,t[65]=zt,t[66]=Bt):Bt=t[66];let Vt;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(Vt=(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]=Vt):Vt=t[67];let Ht;t[68]===Se?Ht=t[69]:(Ht=e=>Se(e.target.value),t[68]=Se,t[69]=Ht);let Ut;t[70]===a?Ut=t[71]:(Ut=a({id:`-7s4fw`}),t[70]=a,t[71]=Ut);let Wt;t[72]===a?Wt=t[73]:(Wt=a({id:`-7s4fw`}),t[72]=a,t[73]=Wt);let Gt;t[74]!==d||t[75]!==Ht||t[76]!==Ut||t[77]!==Wt?(Gt=(0,$.jsxs)(`div`,{className:`relative`,children:[Vt,(0,$.jsx)(oi,{value:d,onChange:Ht,placeholder:Ut,"aria-label":Wt,className:`ps-8`,"data-testid":`configure-agents-search`})]}),t[74]=d,t[75]=Ht,t[76]=Ut,t[77]=Wt,t[78]=Gt):Gt=t[78];let Kt;t[79]!==a||t[80]!==E?(Kt=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]=Kt):Kt=t[81];let Jt;t[82]!==a||t[83]!==C?(Jt=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]=Jt):Jt=t[84];let Yt;t[85]!==a||t[86]!==rt?(Yt=rt?(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]=rt,t[87]=Yt):Yt=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]!==Lt||t[116]!==Bt||t[117]!==Gt||t[118]!==Kt||t[119]!==Jt||t[120]!==Yt||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:[Bt,Gt,Kt,Jt,Yt,Lt,X,cn]}),t[115]=Lt,t[116]=Bt,t[117]=Gt,t[118]=Kt,t[119]=Jt,t[120]=Yt,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 et(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`&&Je.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})}),mt.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(Nt(bi(t))):e.scheme?Zo(Nt(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?Ut: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=It(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=At(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=At(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:()=>Nt(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=vt(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(Mt(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(Mt(e)&&e.code===`SCHEMA_INVALID`){let n=e.issues.find(e=>bs(e,t));if(n)return n.message}return Gt(e)}function bs(e,t){return e.path.map(String).join(`.`)===t}function xs(e){return e.split(`.`)}function Ss(e){if(!Mt(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=Ye(ct,e.path),l=c?ms(c):void 0,u=c?ps(c):void 0,d=c?hs(c):void 0,f=c?Lt(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=lt(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 +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"./button-HKX9wT1K.js";import{n as s}from"./dist-CJhtNlOm2.js";import{t as c}from"./desktop-bridge-types-oYPdTDmz.js";import{n as ee,t as l}from"./git-branch-B_QTfwFA.js";import{t as u}from"./spinner-D7ppCG-D.js";import{n as te,t as ne}from"./miss-dialog-store-CWiUu3y7.js";import{a as re,c as ie,i as ae,n as oe,o as d,s as se,t as ce}from"./dialog-Q2r_wm4I.js";import{i as f,n as le,t as p}from"./auth-prompt-store-5r9jH4ks.js";import{a as m,n as ue}from"./receive-store-CU33mRR1.js";import{t as de}from"./share-metadata-rows-BOIXw_N5.js";var h=e(n(),1),fe=a();function pe(e){let t=e.shareTargetExists,n=e.dirtyConflicts.conflicts,r=e.dirtyConflicts.files;return t&&!n?{kind:`A`,openCurrentEnabled:!0,switchEnabled:!0,conflictingFiles:r}:!t&&!n?{kind:`B`,openCurrentEnabled:!1,switchEnabled:!0,conflictingFiles:r}:t&&n?{kind:`C`,openCurrentEnabled:!0,switchEnabled:!1,conflictingFiles:r}:{kind:`D`,openCurrentEnabled:!1,switchEnabled:!1,conflictingFiles:r}}function me(e){return e.detached?e.currentHeadSha:e.currentBranch??`HEAD`}function g(e){if(e.ok)return{action:`await-cc1`};switch(e.reason){case`dirty-conflict`:return{action:`rerender-conflict`,files:e.files??[]};case`branch-not-found`:return{action:`dismiss-with-toast`,reason:`branch-not-found`};case`fetch-failed`:case`checkout-failed`:return{action:`stay-with-toast`,reason:e.reason};case`branch-in-other-worktree`:{let t=e.otherWorktreePath;return t===void 0||t.length===0?{action:`stay-with-toast`,reason:`checkout-failed`}:{action:`pivot-to-other-worktree`,otherWorktreePath:t}}case`ff-diverged`:return{action:`branch-diverged`};default:{let t=e.reason;throw Error(`Unhandled CheckoutFailureReason: ${String(t)}`)}}}var he={phase:`loading`};function ge(e,t){return e.phase===`loading`?t===null?{phase:`error`}:{phase:`ready`,info:t}:e}function _e(e,t){return e.phase!==`ready`&&e.phase!==`verdict`?e:{phase:`switching`,info:e.info,pendingDoc:t}}function ve(e){return e.phase===`ready`?{phase:`creating-worktree`,info:e.info}:e}function ye(e){return pe(e).kind===`B`&&e.shareTargetOnOriginBranch===!1}function be(e){return e.phase===`ready`?{phase:`verdict-pending`,info:e.info}:e}function xe(e,t){if(e.phase!==`verdict-pending`)return e;if(t===null||t.verdict===`unknown`||t.verdict===`changed-locally`)return{phase:`ready`,info:e.info};let n=t.verdict===`renamed`?{kind:`renamed`,renamedTo:t.renamedTo}:{kind:t.verdict};return{phase:`verdict`,info:e.info,resolution:n}}function Se(e,t){if(e.phase!==`switching`)return{state:e};if(t===null)return{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:`proxy-null`}};let n=g(t);return n.action===`await-cc1`?{state:{phase:`awaiting-cc1-recycle`,pendingDoc:e.pendingDoc}}:n.action===`rerender-conflict`?{state:{phase:`ready`,info:{...e.info,dirtyConflicts:{conflicts:!0,files:n.files.slice()}}}}:n.action===`pivot-to-other-worktree`?{state:{phase:`branch-in-other-worktree`,info:e.info,otherWorktreePath:n.otherWorktreePath,pendingDoc:e.pendingDoc}}:n.action===`dismiss-with-toast`?{state:{phase:`dismissed`,reason:n.reason},sideEffect:{kind:`toast`,reason:n.reason}}:n.action===`branch-diverged`?{state:{phase:`verdict`,info:e.info,resolution:{kind:`diverged`}}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:n.reason}}}function Ce(e,t){return e.phase===`creating-worktree`?t===null?{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:`proxy-null`}}:t.ok?{state:{phase:`opening-worktree`,path:t.path}}:t.reason===`branch-not-found`?{state:{phase:`dismissed`,reason:`branch-not-found`},sideEffect:{kind:`toast`,reason:`branch-not-found`}}:t.reason===`project-scope-unavailable`?{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:t.reason,projectScopeIssue:t.issue}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:t.reason,helper:t.helper,authFailed:t.reason===`fetch-failed`?t.authFailed:void 0,notFoundAsIdentity:t.reason===`fetch-failed`?t.notFoundAsIdentity:void 0}}:{state:e}}var _=t();function we(e){return c(e.repositoryTarget)}function Te(e,t=c(e.target)){let n=e.contentRootDepth===null?t:[...we(e).split(`/`).slice(0,e.contentRootDepth),...t===``?[]:t.split(`/`)].join(`/`);return{kind:e.target.kind,path:t,repositoryPath:n,...e.contentRootDepth===null?{}:{contentRootDepth:e.contentRootDepth}}}function Ee(e){return e!==null&&e.kind===`project-branch-switch`}function v(e){let t=(0,fe.c)(217),{bridge:n,store:a}=e,p=a===void 0?ue:a,{_:g}=i(),v=(0,h.useSyncExternalStore)(p.subscribe,p.getSnapshot,Pe),[y,b]=(0,h.useState)(he),Fe=(0,h.useRef)(!1),Ie=(0,h.useRef)(!1),Le=(0,h.useRef)(!1),Re=(0,h.useRef)(null),ze;t[0]===v?ze=t[1]:(ze=Ee(v)?v:null,t[0]=v,t[1]=ze);let x=ze,Be;t[2]!==g||t[3]!==x?.share.target.kind?(Be=x?.share.target.kind===`folder`?g({id:`ugoTXs`}):g({id:`XH30C4`}),t[2]=g,t[3]=x?.share.target.kind,t[4]=Be):Be=t[4];let S=Be,Ve;t[5]===x?Ve=t[6]:(Ve=()=>{b(he),Fe.current=!1,Ie.current=!1,Le.current=!1,Re.current=x},t[5]=x,t[6]=Ve);let He;t[7]===v?He=t[8]:(He=[v],t[7]=v,t[8]=He),(0,h.useEffect)(Ve,He);let Ue;t[9]!==x||t[10]!==n?(Ue=()=>{if(!x||Fe.current)return;Fe.current=!0;let e=!1;return n.project.fetchBranchInfo({projectPath:x.projectPath,branch:x.share.branch,kind:x.share.repositoryTarget.kind,path:we(x.share)}).then(t=>{e||b(e=>ge(e,t))}).catch(t=>{e||(console.warn(`[receive] branch-info-fetch-failed`,t instanceof Error?t.message:t),b(Ne))}),()=>{e=!0}},t[9]=x,t[10]=n,t[11]=Ue):Ue=t[11];let We;t[12]===x?We=t[13]:(We=[x],t[12]=x,t[13]=We),(0,h.useEffect)(Ue,We);let Ge;t[14]!==x||t[15]!==y.info||t[16]!==y.phase||t[17]!==n?(Ge=()=>{if(!x||y.phase!==`ready`||Le.current||!ye(y.info))return;Le.current=!0,b(be);let e=x;n.project.fetchTargetStatus({projectPath:x.projectPath,branch:x.share.branch,kind:x.share.target.kind,path:we(x.share),...x.share.contentRootDepth===null?{}:{contentRootDepth:x.share.contentRootDepth}}).then(t=>{Re.current===e&&b(e=>xe(e,t))}).catch(t=>{Re.current===e&&(console.warn(`[receive] target-status-fetch-failed`,t instanceof Error?t.message:t),b(Me))})},t[14]=x,t[15]=y.info,t[16]=y.phase,t[17]=n,t[18]=Ge):Ge=t[18];let Ke;t[19]!==x||t[20]!==y.phase?(Ke=[y.phase,x],t[19]=x,t[20]=y.phase,t[21]=Ke):Ke=t[21],(0,h.useEffect)(Ge,Ke);let qe;t[22]!==x||t[23]!==y.phase||t[24]!==y.resolution||t[25]!==p?(qe=()=>{if(y.phase!==`verdict`)return;let{kind:e}=y.resolution;e!==`deleted`&&e!==`never-on-branch`||x&&(ne.arm({kind:x.share.target.kind,path:c(x.share.target),repositoryPath:we(x.share),...x.share.contentRootDepth===null?{}:{contentRootDepth:x.share.contentRootDepth},branch:x.share.branch}),p.dismiss())},t[22]=x,t[23]=y.phase,t[24]=y.resolution,t[25]=p,t[26]=qe):qe=t[26];let Je;t[27]!==x||t[28]!==y||t[29]!==p?(Je=[y,x,p],t[27]=x,t[28]=y,t[29]=p,t[30]=Je):Je=t[30],(0,h.useEffect)(qe,Je);let Ye;t[31]!==y.phase||t[32]!==y.resolution?(Ye=()=>{y.phase===`verdict`&&console.log(m({verdict_cell:y.resolution.kind}))},t[31]=y.phase,t[32]=y.resolution,t[33]=Ye):Ye=t[33];let Xe;t[34]===y?Xe=t[35]:(Xe=[y],t[34]=y,t[35]=Xe),(0,h.useEffect)(Ye,Xe);let Ze;t[36]!==g||t[37]!==x||t[38]!==y.pendingDoc||t[39]!==y.phase||t[40]!==n||t[41]!==p||t[42]!==S?(Ze=()=>{if(y.phase!==`awaiting-cc1-recycle`||!x)return;let e=x.share.branch,t=y.pendingDoc;if(!e){p.dismiss();return}if(Ie.current)return;Ie.current=!0;let r=!1;return n.project.awaitBranchSwitched({projectPath:x.projectPath,branch:e,timeoutMs:3e4}).then(i=>{if(!r){if(i.ok){console.log(m({branch_dialog_action:`branch-switch-complete`,branch:e})),n.project.open({path:x.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:Te(x.share,t),pendingBranch:e}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=switch`,e instanceof Error?e.message:e),s.error(g({id:`gQV-9w`,values:{targetNoun:S}}))}),p.dismiss();return}console.log(m({branch_dialog_action:`branch-switch-timeout`,branch:e})),s.error(g({id:`LBwUR6`,values:{targetNoun:S}})),p.dismiss()}}).catch(e=>{r||(console.warn(`[receive] awaitBranchSwitched rejected`,e instanceof Error?e.message:e),s.error(g({id:`Jw6EC4`,values:{targetNoun:S}})),p.dismiss())}),()=>{r=!0}},t[36]=g,t[37]=x,t[38]=y.pendingDoc,t[39]=y.phase,t[40]=n,t[41]=p,t[42]=S,t[43]=Ze):Ze=t[43];let Qe;if(t[44]!==x||t[45]!==y.phase?(Qe=[y.phase,x],t[44]=x,t[45]=y.phase,t[46]=Qe):Qe=t[46],(0,h.useEffect)(Ze,Qe),!x)return null;let{share:C,projectPath:w,currentBranch:$e}=x,T=C.branch,et;t[47]!==g||t[48]!==n.project||t[49]!==w||t[50]!==T||t[51]!==p?(et=function(e,t,r){console.log(m({branch_dialog_action:`switch`,branch_action:`switch`,branch:T,verdict_cell:r})),b(t=>_e(t,e)),n.project.runCheckout(t?{projectPath:w,branch:T,fastForward:!0}:{projectPath:w,branch:T}).then(e=>{let t=null,n=!1;b(r=>{let{state:i,sideEffect:a}=Se(r,e);return a&&(t=a.reason,n=i.phase===`dismissed`),i}),t===`branch-not-found`?s.error(g({id:`NJyQi_`,values:{shareBranch:T}})):t===`fetch-failed`?s.error(g({id:`bWLmRK`})):(t===`checkout-failed`||t===`proxy-null`)&&s.error(g({id:`c863eW`,values:{shareBranch:T}})),n&&p.dismiss()}).catch(e=>{console.warn(`[receive] runCheckout rejected branch_action=switch`,e instanceof Error?e.message:e),b(je),s.error(g({id:`c863eW`,values:{shareBranch:T}}))})},t[47]=g,t[48]=n.project,t[49]=w,t[50]=T,t[51]=p,t[52]=et):et=t[52];let E=et,tt;t[53]!==y.info||t[54]!==y.phase||t[55]!==E||t[56]!==C.target?(tt=function(){y.phase===`ready`&&pe(y.info).switchEnabled&&E(c(C.target),!1)},t[53]=y.info,t[54]=y.phase,t[55]=E,t[56]=C.target,t[57]=tt):tt=t[57];let nt=tt,rt;t[58]!==y.phase||t[59]!==y.resolution||t[60]!==E||t[61]!==C.target?(rt=function(){y.phase===`verdict`&&E(c(C.target),!0,y.resolution.kind)},t[58]=y.phase,t[59]=y.resolution,t[60]=E,t[61]=C.target,t[62]=rt):rt=t[62];let it=rt,at;t[63]!==y.phase||t[64]!==y.resolution||t[65]!==E?(at=function(){y.phase===`verdict`&&y.resolution.kind===`renamed`&&E(y.resolution.renamedTo,!0,y.resolution.kind)},t[63]=y.phase,t[64]=y.resolution,t[65]=E,t[66]=at):at=t[66];let ot=at,st;t[67]!==y.phase||t[68]!==y.resolution||t[69]!==E||t[70]!==C.target?(st=function(){y.phase===`verdict`&&E(c(C.target),!1,y.resolution.kind)},t[67]=y.phase,t[68]=y.resolution,t[69]=E,t[70]=C.target,t[71]=st):st=t[71];let ct=st,lt;t[72]!==g||t[73]!==n.project||t[74]!==w||t[75]!==C||t[76]!==T||t[77]!==p||t[78]!==S?(lt=function(){console.log(m({branch_dialog_action:`open-current`,branch:T})),n.project.open({path:w,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:Te(C)}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=open-current`,e instanceof Error?e.message:e),s.error(g({id:`b5aNbi`,values:{targetNoun:S}}))}),p.dismiss()},t[72]=g,t[73]=n.project,t[74]=w,t[75]=C,t[76]=T,t[77]=p,t[78]=S,t[79]=lt):lt=t[79];let ut=lt,dt;t[80]!==g||t[81]!==T?(dt=function(e){let{reason:t}=e,n=`helper`in e?e.helper:void 0,r=`authFailed`in e?e.authFailed:void 0,i=`notFoundAsIdentity`in e?e.notFoundAsIdentity:void 0;if(t===`fetch-failed`&&i){s.error(g({id:`jRsjlF`}));return}if(t===`fetch-failed`&&r){s.error(g({id:`gfb-CM`}),{action:{label:g({id:`5lWFkC`}),onClick:Ae}});return}switch(t){case`helper-not-found`:{let e=n??g({id:`cHhH3i`});s.error(g({id:`Z7x_Zh`,values:{tool:e}}));return}case`branch-not-found`:s.error(g({id:`NJyQi_`,values:{shareBranch:T}}));return;case`fetch-failed`:s.error(g({id:`bWLmRK`}));return;case`already-checked-out`:s.error(g({id:`ljHjfg`}));return;case`branch-exists`:s.error(g({id:`h3QZcB`,values:{shareBranch:T}}));return;case`path-exists`:s.error(g({id:`cN1Gcp`,values:{shareBranch:T}}));return;case`no-git`:s.error(g({id:`CFnavk`}));return;case`empty-repo`:s.error(g({id:`5IgYAM`}));return;case`invalid-branch`:s.error(g({id:`JfPuv7`,values:{shareBranch:T}}));return;case`project-scope-unavailable`:s.error(g(le({reason:t,issue:e.projectScopeIssue})));return;case`proxy-null`:case`error`:s.error(g({id:`e8zYa8`,values:{shareBranch:T}}));return;default:throw Error(`Unhandled worktree failure reason: ${String(t)}`)}},t[80]=g,t[81]=T,t[82]=dt):dt=t[82];let ft=dt,pt;t[83]!==g||t[84]!==n.project||t[85]!==C||t[86]!==T||t[87]!==ft||t[88]!==p?(pt=function(e){e?.ok===!1&&e.reason===`project-scope-unavailable`&&f();let t,r=!1,i=null;if(b(n=>{let{state:a,sideEffect:o}=Ce(n,e);return o&&(t=o,r=a.phase===`dismissed`),a.phase===`opening-worktree`&&(i=a.path),a}),t!==void 0&&(console.log(m({branch_dialog_action:`open-worktree-failed:${t.reason}`,branch:T})),ft(t)),i!==null){f();let e=i;n.project.open({path:e,target:`new-window`,entryPoint:`worktree`,pendingDeepLinkTarget:Te(C),pendingBranch:T}).catch(t=>{console.warn(`[receive] worktree-open-failed branch_dialog_action=open-worktree`,t instanceof Error?t.message:t),s.error(g({id:`LdABLa`,values:{target:e}}))}),p.dismiss()}r&&p.dismiss()},t[83]=g,t[84]=n.project,t[85]=C,t[86]=T,t[87]=ft,t[88]=p,t[89]=pt):pt=t[89];let mt=pt,ht;t[90]!==mt||t[91]!==y.phase||t[92]!==n.worktree||t[93]!==T?(ht=function(){y.phase===`ready`&&(console.log(m({branch_dialog_action:`open-worktree`,branch:T})),b(ve),n.worktree.checkout({branch:T}).then(e=>{mt(e)}).catch(e=>{console.warn(`[receive] worktree-checkout rejected branch_dialog_action=open-worktree`,e instanceof Error?e.message:e),mt(null)}))},t[90]=mt,t[91]=y.phase,t[92]=n.worktree,t[93]=T,t[94]=ht):ht=t[94];let gt=ht,_t;t[95]!==g||t[96]!==y.otherWorktreePath||t[97]!==y.phase||t[98]!==n.project||t[99]!==C||t[100]!==T||t[101]!==p?(_t=function(){if(y.phase!==`branch-in-other-worktree`)return;let e=y.otherWorktreePath;console.log(m({branch_dialog_action:`pivot-to-other-worktree`,branch:T})),n.project.open({path:e,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:Te(C),pendingBranch:T}).catch(t=>{console.warn(`[receive] pivot-open-failed branch_action=pivot-to-other-worktree`,t instanceof Error?t.message:t),s.error(g({id:`LdABLa`,values:{target:e}}))}),p.dismiss()},t[95]=g,t[96]=y.otherWorktreePath,t[97]=y.phase,t[98]=n.project,t[99]=C,t[100]=T,t[101]=p,t[102]=_t):_t=t[102];let vt=_t,yt;t[103]!==y.phase||t[104]!==y.resolution||t[105]!==p?(yt=function(){console.log(m({branch_dialog_action:`cancel`,verdict_cell:y.phase===`verdict`?y.resolution.kind:void 0})),p.dismiss()},t[103]=y.phase,t[104]=y.resolution,t[105]=p,t[106]=yt):yt=t[106];let D=yt,O,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U,W,G,K;if(t[107]!==g||t[108]!==y.info||t[109]!==y.otherWorktreePath||t[110]!==y.phase||t[111]!==y.resolution||t[112]!==D||t[113]!==$e||t[114]!==C.branch||t[115]!==C.owner||t[116]!==C.repo||t[117]!==C.target||t[118]!==T||t[119]!==S){G=y.phase===`ready`||y.phase===`switching`||y.phase===`creating-worktree`?pe(y.info):null;let e;t[139]!==y.info||t[140]!==y.phase||t[141]!==$e?(e=y.phase===`ready`||y.phase===`switching`||y.phase===`creating-worktree`?me(y.info):$e??`HEAD`,t[139]=y.info,t[140]=y.phase,t[141]=$e,t[142]=e):e=t[142];let n=e;P=y.phase===`switching`||y.phase===`awaiting-cc1-recycle`,j=y.phase===`creating-worktree`;let i;t[143]===g?i=t[144]:(i=g({id:`OuY8t9`}),t[143]=g,t[144]=i),M=i;let a;t[145]===g?a=t[146]:(a=g({id:`XZkdtg`}),t[145]=g,t[146]=a),N=a;let o;t[147]===g?o=t[148]:(o=g({id:`VTulZj`}),t[147]=g,t[148]=o),K=o;let s=y.phase===`loading`,ee=y.phase===`error`;A=ce,U=!0,t[149]===D?W=t[150]:(W=e=>{e||D()},t[149]=D,t[150]=W),k=ae,R=`sm:max-w-xl`,z=`share-branch-switch-dialog`,B=ke,V=Oe;let l;t[151]===S?l=t[152]:(l=(0,_.jsx)(ie,{children:(0,_.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:S}})}),t[151]=S,t[152]=l);let te=C.owner,ne=C.repo,d;t[153]===C.target?d=t[154]:(d=c(C.target),t[153]=C.target,t[154]=d);let f;t[155]!==C.owner||t[156]!==C.repo||t[157]!==d?(f=(0,_.jsx)(re,{className:`sr-only`,children:(0,_.jsx)(r,{id:`f8jU-L`,values:{0:te,1:ne,2:d}})}),t[155]=C.owner,t[156]=C.repo,t[157]=d,t[158]=f):f=t[158],t[159]!==l||t[160]!==f?(H=(0,_.jsxs)(se,{children:[l,f]}),t[159]=l,t[160]=f,t[161]=H):H=t[161],O=oe;let le=C.owner,p=C.repo,m;t[162]===C.target?m=t[163]:(m=c(C.target),t[162]=C.target,t[163]=m),t[164]!==C.branch||t[165]!==C.owner||t[166]!==C.repo||t[167]!==C.target.kind||t[168]!==m?(F=(0,_.jsx)(`div`,{className:`mb-4`,children:(0,_.jsx)(de,{owner:le,repo:p,path:m,kind:C.target.kind,branch:C.branch,testId:`share-branch-switch-metadata`,branchTestId:`share-branch-switch-metadata-branch`})}),t[164]=C.branch,t[165]=C.owner,t[166]=C.repo,t[167]=C.target.kind,t[168]=m,t[169]=F):F=t[169],I=y.phase===`branch-in-other-worktree`?(0,_.jsxs)(`div`,{className:`text-sm text-muted-foreground`,"data-testid":`share-branch-switch-in-other-worktree`,children:[(0,_.jsx)(`p`,{className:`leading-6`,children:(0,_.jsx)(r,{id:`yjExfe`,values:{shareBranch:T},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),(0,_.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-branch-switch-in-other-worktree-path`,children:y.otherWorktreePath})]}):y.phase===`verdict-pending`?(0,_.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-verdict-pending`,role:`status`,"aria-live":`polite`,children:[(0,_.jsx)(u,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,_.jsx)(r,{id:`c8jBgX`})]}):y.phase===`verdict`?y.resolution.kind===`on-origin`?(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-on-origin`,children:(0,_.jsx)(r,{id:`Uay5NL`,values:{targetNoun:S,shareBranch:T},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):y.resolution.kind===`renamed`?(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-renamed`,children:(0,_.jsx)(r,{id:`P0HC30`,values:{0:y.resolution.renamedTo,targetNoun:S},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):y.resolution.kind===`diverged`?(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-diverged`,children:(0,_.jsx)(r,{id:`kLv8d3`,values:{shareBranch:T,targetNoun:S},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,_.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-verdict-handoff`,role:`status`,"aria-live":`polite`,children:[(0,_.jsx)(u,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,_.jsx)(r,{id:`c8jBgX`})]}):s?(0,_.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-loading`,role:`status`,"aria-live":`polite`,children:[(0,_.jsx)(u,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,_.jsx)(r,{id:`jerqF0`})]}):ee?(0,_.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,_.jsx)(r,{id:`w4hMYl`})}):G?.kind===`D`?(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,_.jsx)(r,{id:`DTI-fp`,values:{targetNoun:S,shareBranch:T},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):G?.kind===`B`?(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,_.jsx)(r,{id:`sZ2IOu`,values:{targetNoun:S,shareBranch:T,currentLabel:n},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,_.jsx)(r,{id:`_902BE`,values:{targetNoun:S,shareBranch:T,currentLabel:n},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),L=G&&!G.switchEnabled&&G.conflictingFiles.length>0?(0,_.jsxs)(`div`,{className:`mt-3 rounded-md border border-border bg-muted/30 p-3 text-1sm`,"data-testid":`share-branch-switch-conflict`,children:[(0,_.jsx)(`p`,{className:`font-medium text-foreground/90`,children:(0,_.jsx)(r,{id:`n2lRue`})}),(0,_.jsx)(`ul`,{id:`share-receive-branch-conflict-files`,className:`mt-1 list-disc space-y-0.5 pl-5 text-muted-foreground`,children:G.conflictingFiles.map(De)})]}):null,t[107]=g,t[108]=y.info,t[109]=y.otherWorktreePath,t[110]=y.phase,t[111]=y.resolution,t[112]=D,t[113]=$e,t[114]=C.branch,t[115]=C.owner,t[116]=C.repo,t[117]=C.target,t[118]=T,t[119]=S,t[120]=O,t[121]=k,t[122]=A,t[123]=j,t[124]=M,t[125]=N,t[126]=P,t[127]=F,t[128]=I,t[129]=L,t[130]=R,t[131]=z,t[132]=B,t[133]=V,t[134]=H,t[135]=U,t[136]=W,t[137]=G,t[138]=K}else O=t[120],k=t[121],A=t[122],j=t[123],M=t[124],N=t[125],P=t[126],F=t[127],I=t[128],L=t[129],R=t[130],z=t[131],B=t[132],V=t[133],H=t[134],U=t[135],W=t[136],G=t[137],K=t[138];let q;t[170]===P?q=t[171]:(q=P?(0,_.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-switching`,role:`status`,"aria-live":`polite`,children:[(0,_.jsx)(u,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,_.jsx)(r,{id:`CU3AiE`})]}):null,t[170]=P,t[171]=q);let J;t[172]===j?J=t[173]:(J=j?(0,_.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-creating-worktree`,role:`status`,"aria-live":`polite`,children:[(0,_.jsx)(u,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,_.jsx)(r,{id:`PZtgO0`})]}):null,t[172]=j,t[173]=J);let Y;t[174]!==O||t[175]!==F||t[176]!==I||t[177]!==L||t[178]!==q||t[179]!==J?(Y=(0,_.jsxs)(O,{children:[F,I,L,q,J]}),t[174]=O,t[175]=F,t[176]=I,t[177]=L,t[178]=q,t[179]=J,t[180]=Y):Y=t[180];let bt;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(bt=(0,_.jsx)(r,{id:`dEgA5A`}),t[181]=bt):bt=t[181];let X;t[182]===D?X=t[183]:(X=(0,_.jsx)(o,{variant:`ghost`,onClick:D,"data-testid":`share-branch-switch-cancel`,children:bt}),t[182]=D,t[183]=X);let Z;t[184]!==y.phase||t[185]!==y.resolution||t[186]!==j||t[187]!==ut||t[188]!==ot||t[189]!==gt||t[190]!==vt||t[191]!==ct||t[192]!==nt||t[193]!==it||t[194]!==M||t[195]!==N||t[196]!==P||t[197]!==G||t[198]!==K?(Z=y.phase===`branch-in-other-worktree`?(0,_.jsx)(o,{onClick:vt,"data-testid":`share-branch-switch-in-other-worktree-pivot`,children:(0,_.jsx)(r,{id:`hyCxJY`})}):y.phase===`verdict`?y.resolution.kind===`on-origin`?(0,_.jsxs)(o,{onClick:it,"data-testid":`share-branch-switch-verdict-switch-update`,children:[(0,_.jsx)(l,{className:`size-3.5`,"aria-hidden":!0}),(0,_.jsx)(r,{id:`uA_jXp`})]}):y.resolution.kind===`renamed`?(0,_.jsxs)(o,{onClick:ot,"data-testid":`share-branch-switch-verdict-open-renamed`,children:[(0,_.jsx)(te,{className:`size-3.5`,"aria-hidden":!0}),(0,_.jsx)(r,{id:`AItsE5`})]}):y.resolution.kind===`diverged`?(0,_.jsxs)(o,{onClick:ct,"data-testid":`share-branch-switch-verdict-plain-switch`,children:[(0,_.jsx)(l,{className:`size-3.5`,"aria-hidden":!0}),N]}):null:(0,_.jsxs)(`div`,{className:`flex min-w-0 flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-end sm:gap-2`,children:[G?.openCurrentEnabled?(0,_.jsxs)(o,{variant:`outline`,onClick:ut,disabled:P||j,"data-testid":`share-branch-switch-open-current`,children:[(0,_.jsx)(te,{className:`size-3.5`,"aria-hidden":!0}),M]}):null,(0,_.jsx)(o,{variant:`outline`,onClick:nt,disabled:!G?.switchEnabled||P||j,"aria-disabled":!G?.switchEnabled||P||j,"aria-describedby":G&&!G.switchEnabled&&G.conflictingFiles.length>0?`share-receive-branch-conflict-files`:void 0,"data-testid":`share-branch-switch-switch`,children:P?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(u,{className:`size-3.5`,"aria-hidden":`true`}),N]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(l,{className:`size-3.5`,"aria-hidden":!0}),N]})}),(0,_.jsx)(o,{onClick:gt,disabled:!G||P||j,"data-testid":`share-branch-switch-worktree`,children:j?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(u,{className:`size-3.5`,"aria-hidden":`true`}),K]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(ee,{className:`size-3.5`,"aria-hidden":!0}),K]})})]}),t[184]=y.phase,t[185]=y.resolution,t[186]=j,t[187]=ut,t[188]=ot,t[189]=gt,t[190]=vt,t[191]=ct,t[192]=nt,t[193]=it,t[194]=M,t[195]=N,t[196]=P,t[197]=G,t[198]=K,t[199]=Z):Z=t[199];let Q;t[200]!==X||t[201]!==Z?(Q=(0,_.jsxs)(d,{className:`sm:justify-between`,children:[X,Z]}),t[200]=X,t[201]=Z,t[202]=Q):Q=t[202];let $;t[203]!==k||t[204]!==R||t[205]!==z||t[206]!==B||t[207]!==V||t[208]!==H||t[209]!==Y||t[210]!==Q?($=(0,_.jsxs)(k,{className:R,"data-testid":z,onInteractOutside:B,onPointerDownOutside:V,children:[H,Y,Q]}),t[203]=k,t[204]=R,t[205]=z,t[206]=B,t[207]=V,t[208]=H,t[209]=Y,t[210]=Q,t[211]=$):$=t[211];let xt;return t[212]!==A||t[213]!==U||t[214]!==W||t[215]!==$?(xt=(0,_.jsx)(A,{open:U,onOpenChange:W,children:$}),t[212]=A,t[213]=U,t[214]=W,t[215]=$,t[216]=xt):xt=t[216],xt}function De(e){return(0,_.jsx)(`li`,{children:(0,_.jsx)(`code`,{className:`text-foreground/80`,children:e})},e)}function Oe(e){e.preventDefault()}function ke(e){e.preventDefault()}function Ae(){return p.request()}function je(e){return Se(e,null).state}function Me(e){return xe(e,null)}function Ne(e){return ge(e,null)}function Pe(){return null}export{v as ShareBranchSwitchDialog};
|
|
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"./button-BeFNZANd.js";import{n as s}from"./dist-CJhtNlOm2.js";import{t as c}from"./desktop-bridge-types-oYPdTDmz.js";import{n as ee,t as l}from"./git-branch-B_QTfwFA.js";import{t as u}from"./spinner-D7ppCG-D.js";import{n as te,t as ne}from"./miss-dialog-store-CWiUu3y7.js";import{a as re,c as ie,i as ae,n as oe,o as d,s as se,t as ce}from"./dialog-BfHNtxM9.js";import{i as f,n as le,t as p}from"./auth-prompt-store-5r9jH4ks.js";import{a as m,n as ue}from"./receive-store-CU33mRR1.js";import{t as de}from"./share-metadata-rows-BOIXw_N5.js";var h=e(n(),1),fe=a();function pe(e){let t=e.shareTargetExists,n=e.dirtyConflicts.conflicts,r=e.dirtyConflicts.files;return t&&!n?{kind:`A`,openCurrentEnabled:!0,switchEnabled:!0,conflictingFiles:r}:!t&&!n?{kind:`B`,openCurrentEnabled:!1,switchEnabled:!0,conflictingFiles:r}:t&&n?{kind:`C`,openCurrentEnabled:!0,switchEnabled:!1,conflictingFiles:r}:{kind:`D`,openCurrentEnabled:!1,switchEnabled:!1,conflictingFiles:r}}function me(e){return e.detached?e.currentHeadSha:e.currentBranch??`HEAD`}function g(e){if(e.ok)return{action:`await-cc1`};switch(e.reason){case`dirty-conflict`:return{action:`rerender-conflict`,files:e.files??[]};case`branch-not-found`:return{action:`dismiss-with-toast`,reason:`branch-not-found`};case`fetch-failed`:case`checkout-failed`:return{action:`stay-with-toast`,reason:e.reason};case`branch-in-other-worktree`:{let t=e.otherWorktreePath;return t===void 0||t.length===0?{action:`stay-with-toast`,reason:`checkout-failed`}:{action:`pivot-to-other-worktree`,otherWorktreePath:t}}case`ff-diverged`:return{action:`branch-diverged`};default:{let t=e.reason;throw Error(`Unhandled CheckoutFailureReason: ${String(t)}`)}}}var he={phase:`loading`};function ge(e,t){return e.phase===`loading`?t===null?{phase:`error`}:{phase:`ready`,info:t}:e}function _e(e,t){return e.phase!==`ready`&&e.phase!==`verdict`?e:{phase:`switching`,info:e.info,pendingDoc:t}}function ve(e){return e.phase===`ready`?{phase:`creating-worktree`,info:e.info}:e}function ye(e){return pe(e).kind===`B`&&e.shareTargetOnOriginBranch===!1}function be(e){return e.phase===`ready`?{phase:`verdict-pending`,info:e.info}:e}function xe(e,t){if(e.phase!==`verdict-pending`)return e;if(t===null||t.verdict===`unknown`||t.verdict===`changed-locally`)return{phase:`ready`,info:e.info};let n=t.verdict===`renamed`?{kind:`renamed`,renamedTo:t.renamedTo}:{kind:t.verdict};return{phase:`verdict`,info:e.info,resolution:n}}function Se(e,t){if(e.phase!==`switching`)return{state:e};if(t===null)return{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:`proxy-null`}};let n=g(t);return n.action===`await-cc1`?{state:{phase:`awaiting-cc1-recycle`,pendingDoc:e.pendingDoc}}:n.action===`rerender-conflict`?{state:{phase:`ready`,info:{...e.info,dirtyConflicts:{conflicts:!0,files:n.files.slice()}}}}:n.action===`pivot-to-other-worktree`?{state:{phase:`branch-in-other-worktree`,info:e.info,otherWorktreePath:n.otherWorktreePath,pendingDoc:e.pendingDoc}}:n.action===`dismiss-with-toast`?{state:{phase:`dismissed`,reason:n.reason},sideEffect:{kind:`toast`,reason:n.reason}}:n.action===`branch-diverged`?{state:{phase:`verdict`,info:e.info,resolution:{kind:`diverged`}}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:n.reason}}}function Ce(e,t){return e.phase===`creating-worktree`?t===null?{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:`proxy-null`}}:t.ok?{state:{phase:`opening-worktree`,path:t.path}}:t.reason===`branch-not-found`?{state:{phase:`dismissed`,reason:`branch-not-found`},sideEffect:{kind:`toast`,reason:`branch-not-found`}}:t.reason===`project-scope-unavailable`?{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:t.reason,projectScopeIssue:t.issue}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:t.reason,helper:t.helper,authFailed:t.reason===`fetch-failed`?t.authFailed:void 0,notFoundAsIdentity:t.reason===`fetch-failed`?t.notFoundAsIdentity:void 0}}:{state:e}}var _=t();function we(e){return c(e.repositoryTarget)}function Te(e,t=c(e.target)){let n=e.contentRootDepth===null?t:[...we(e).split(`/`).slice(0,e.contentRootDepth),...t===``?[]:t.split(`/`)].join(`/`);return{kind:e.target.kind,path:t,repositoryPath:n,...e.contentRootDepth===null?{}:{contentRootDepth:e.contentRootDepth}}}function Ee(e){return e!==null&&e.kind===`project-branch-switch`}function v(e){let t=(0,fe.c)(217),{bridge:n,store:a}=e,p=a===void 0?ue:a,{_:g}=i(),v=(0,h.useSyncExternalStore)(p.subscribe,p.getSnapshot,Pe),[y,b]=(0,h.useState)(he),Fe=(0,h.useRef)(!1),Ie=(0,h.useRef)(!1),Le=(0,h.useRef)(!1),Re=(0,h.useRef)(null),ze;t[0]===v?ze=t[1]:(ze=Ee(v)?v:null,t[0]=v,t[1]=ze);let x=ze,Be;t[2]!==g||t[3]!==x?.share.target.kind?(Be=x?.share.target.kind===`folder`?g({id:`ugoTXs`}):g({id:`XH30C4`}),t[2]=g,t[3]=x?.share.target.kind,t[4]=Be):Be=t[4];let S=Be,Ve;t[5]===x?Ve=t[6]:(Ve=()=>{b(he),Fe.current=!1,Ie.current=!1,Le.current=!1,Re.current=x},t[5]=x,t[6]=Ve);let He;t[7]===v?He=t[8]:(He=[v],t[7]=v,t[8]=He),(0,h.useEffect)(Ve,He);let Ue;t[9]!==x||t[10]!==n?(Ue=()=>{if(!x||Fe.current)return;Fe.current=!0;let e=!1;return n.project.fetchBranchInfo({projectPath:x.projectPath,branch:x.share.branch,kind:x.share.repositoryTarget.kind,path:we(x.share)}).then(t=>{e||b(e=>ge(e,t))}).catch(t=>{e||(console.warn(`[receive] branch-info-fetch-failed`,t instanceof Error?t.message:t),b(Ne))}),()=>{e=!0}},t[9]=x,t[10]=n,t[11]=Ue):Ue=t[11];let We;t[12]===x?We=t[13]:(We=[x],t[12]=x,t[13]=We),(0,h.useEffect)(Ue,We);let Ge;t[14]!==x||t[15]!==y.info||t[16]!==y.phase||t[17]!==n?(Ge=()=>{if(!x||y.phase!==`ready`||Le.current||!ye(y.info))return;Le.current=!0,b(be);let e=x;n.project.fetchTargetStatus({projectPath:x.projectPath,branch:x.share.branch,kind:x.share.target.kind,path:we(x.share),...x.share.contentRootDepth===null?{}:{contentRootDepth:x.share.contentRootDepth}}).then(t=>{Re.current===e&&b(e=>xe(e,t))}).catch(t=>{Re.current===e&&(console.warn(`[receive] target-status-fetch-failed`,t instanceof Error?t.message:t),b(Me))})},t[14]=x,t[15]=y.info,t[16]=y.phase,t[17]=n,t[18]=Ge):Ge=t[18];let Ke;t[19]!==x||t[20]!==y.phase?(Ke=[y.phase,x],t[19]=x,t[20]=y.phase,t[21]=Ke):Ke=t[21],(0,h.useEffect)(Ge,Ke);let qe;t[22]!==x||t[23]!==y.phase||t[24]!==y.resolution||t[25]!==p?(qe=()=>{if(y.phase!==`verdict`)return;let{kind:e}=y.resolution;e!==`deleted`&&e!==`never-on-branch`||x&&(ne.arm({kind:x.share.target.kind,path:c(x.share.target),repositoryPath:we(x.share),...x.share.contentRootDepth===null?{}:{contentRootDepth:x.share.contentRootDepth},branch:x.share.branch}),p.dismiss())},t[22]=x,t[23]=y.phase,t[24]=y.resolution,t[25]=p,t[26]=qe):qe=t[26];let Je;t[27]!==x||t[28]!==y||t[29]!==p?(Je=[y,x,p],t[27]=x,t[28]=y,t[29]=p,t[30]=Je):Je=t[30],(0,h.useEffect)(qe,Je);let Ye;t[31]!==y.phase||t[32]!==y.resolution?(Ye=()=>{y.phase===`verdict`&&console.log(m({verdict_cell:y.resolution.kind}))},t[31]=y.phase,t[32]=y.resolution,t[33]=Ye):Ye=t[33];let Xe;t[34]===y?Xe=t[35]:(Xe=[y],t[34]=y,t[35]=Xe),(0,h.useEffect)(Ye,Xe);let Ze;t[36]!==g||t[37]!==x||t[38]!==y.pendingDoc||t[39]!==y.phase||t[40]!==n||t[41]!==p||t[42]!==S?(Ze=()=>{if(y.phase!==`awaiting-cc1-recycle`||!x)return;let e=x.share.branch,t=y.pendingDoc;if(!e){p.dismiss();return}if(Ie.current)return;Ie.current=!0;let r=!1;return n.project.awaitBranchSwitched({projectPath:x.projectPath,branch:e,timeoutMs:3e4}).then(i=>{if(!r){if(i.ok){console.log(m({branch_dialog_action:`branch-switch-complete`,branch:e})),n.project.open({path:x.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:Te(x.share,t),pendingBranch:e}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=switch`,e instanceof Error?e.message:e),s.error(g({id:`gQV-9w`,values:{targetNoun:S}}))}),p.dismiss();return}console.log(m({branch_dialog_action:`branch-switch-timeout`,branch:e})),s.error(g({id:`LBwUR6`,values:{targetNoun:S}})),p.dismiss()}}).catch(e=>{r||(console.warn(`[receive] awaitBranchSwitched rejected`,e instanceof Error?e.message:e),s.error(g({id:`Jw6EC4`,values:{targetNoun:S}})),p.dismiss())}),()=>{r=!0}},t[36]=g,t[37]=x,t[38]=y.pendingDoc,t[39]=y.phase,t[40]=n,t[41]=p,t[42]=S,t[43]=Ze):Ze=t[43];let Qe;if(t[44]!==x||t[45]!==y.phase?(Qe=[y.phase,x],t[44]=x,t[45]=y.phase,t[46]=Qe):Qe=t[46],(0,h.useEffect)(Ze,Qe),!x)return null;let{share:C,projectPath:w,currentBranch:$e}=x,T=C.branch,et;t[47]!==g||t[48]!==n.project||t[49]!==w||t[50]!==T||t[51]!==p?(et=function(e,t,r){console.log(m({branch_dialog_action:`switch`,branch_action:`switch`,branch:T,verdict_cell:r})),b(t=>_e(t,e)),n.project.runCheckout(t?{projectPath:w,branch:T,fastForward:!0}:{projectPath:w,branch:T}).then(e=>{let t=null,n=!1;b(r=>{let{state:i,sideEffect:a}=Se(r,e);return a&&(t=a.reason,n=i.phase===`dismissed`),i}),t===`branch-not-found`?s.error(g({id:`NJyQi_`,values:{shareBranch:T}})):t===`fetch-failed`?s.error(g({id:`bWLmRK`})):(t===`checkout-failed`||t===`proxy-null`)&&s.error(g({id:`c863eW`,values:{shareBranch:T}})),n&&p.dismiss()}).catch(e=>{console.warn(`[receive] runCheckout rejected branch_action=switch`,e instanceof Error?e.message:e),b(je),s.error(g({id:`c863eW`,values:{shareBranch:T}}))})},t[47]=g,t[48]=n.project,t[49]=w,t[50]=T,t[51]=p,t[52]=et):et=t[52];let E=et,tt;t[53]!==y.info||t[54]!==y.phase||t[55]!==E||t[56]!==C.target?(tt=function(){y.phase===`ready`&&pe(y.info).switchEnabled&&E(c(C.target),!1)},t[53]=y.info,t[54]=y.phase,t[55]=E,t[56]=C.target,t[57]=tt):tt=t[57];let nt=tt,rt;t[58]!==y.phase||t[59]!==y.resolution||t[60]!==E||t[61]!==C.target?(rt=function(){y.phase===`verdict`&&E(c(C.target),!0,y.resolution.kind)},t[58]=y.phase,t[59]=y.resolution,t[60]=E,t[61]=C.target,t[62]=rt):rt=t[62];let it=rt,at;t[63]!==y.phase||t[64]!==y.resolution||t[65]!==E?(at=function(){y.phase===`verdict`&&y.resolution.kind===`renamed`&&E(y.resolution.renamedTo,!0,y.resolution.kind)},t[63]=y.phase,t[64]=y.resolution,t[65]=E,t[66]=at):at=t[66];let ot=at,st;t[67]!==y.phase||t[68]!==y.resolution||t[69]!==E||t[70]!==C.target?(st=function(){y.phase===`verdict`&&E(c(C.target),!1,y.resolution.kind)},t[67]=y.phase,t[68]=y.resolution,t[69]=E,t[70]=C.target,t[71]=st):st=t[71];let ct=st,lt;t[72]!==g||t[73]!==n.project||t[74]!==w||t[75]!==C||t[76]!==T||t[77]!==p||t[78]!==S?(lt=function(){console.log(m({branch_dialog_action:`open-current`,branch:T})),n.project.open({path:w,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:Te(C)}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=open-current`,e instanceof Error?e.message:e),s.error(g({id:`b5aNbi`,values:{targetNoun:S}}))}),p.dismiss()},t[72]=g,t[73]=n.project,t[74]=w,t[75]=C,t[76]=T,t[77]=p,t[78]=S,t[79]=lt):lt=t[79];let ut=lt,dt;t[80]!==g||t[81]!==T?(dt=function(e){let{reason:t}=e,n=`helper`in e?e.helper:void 0,r=`authFailed`in e?e.authFailed:void 0,i=`notFoundAsIdentity`in e?e.notFoundAsIdentity:void 0;if(t===`fetch-failed`&&i){s.error(g({id:`jRsjlF`}));return}if(t===`fetch-failed`&&r){s.error(g({id:`gfb-CM`}),{action:{label:g({id:`5lWFkC`}),onClick:Ae}});return}switch(t){case`helper-not-found`:{let e=n??g({id:`cHhH3i`});s.error(g({id:`Z7x_Zh`,values:{tool:e}}));return}case`branch-not-found`:s.error(g({id:`NJyQi_`,values:{shareBranch:T}}));return;case`fetch-failed`:s.error(g({id:`bWLmRK`}));return;case`already-checked-out`:s.error(g({id:`ljHjfg`}));return;case`branch-exists`:s.error(g({id:`h3QZcB`,values:{shareBranch:T}}));return;case`path-exists`:s.error(g({id:`cN1Gcp`,values:{shareBranch:T}}));return;case`no-git`:s.error(g({id:`CFnavk`}));return;case`empty-repo`:s.error(g({id:`5IgYAM`}));return;case`invalid-branch`:s.error(g({id:`JfPuv7`,values:{shareBranch:T}}));return;case`project-scope-unavailable`:s.error(g(le({reason:t,issue:e.projectScopeIssue})));return;case`proxy-null`:case`error`:s.error(g({id:`e8zYa8`,values:{shareBranch:T}}));return;default:throw Error(`Unhandled worktree failure reason: ${String(t)}`)}},t[80]=g,t[81]=T,t[82]=dt):dt=t[82];let ft=dt,pt;t[83]!==g||t[84]!==n.project||t[85]!==C||t[86]!==T||t[87]!==ft||t[88]!==p?(pt=function(e){e?.ok===!1&&e.reason===`project-scope-unavailable`&&f();let t,r=!1,i=null;if(b(n=>{let{state:a,sideEffect:o}=Ce(n,e);return o&&(t=o,r=a.phase===`dismissed`),a.phase===`opening-worktree`&&(i=a.path),a}),t!==void 0&&(console.log(m({branch_dialog_action:`open-worktree-failed:${t.reason}`,branch:T})),ft(t)),i!==null){f();let e=i;n.project.open({path:e,target:`new-window`,entryPoint:`worktree`,pendingDeepLinkTarget:Te(C),pendingBranch:T}).catch(t=>{console.warn(`[receive] worktree-open-failed branch_dialog_action=open-worktree`,t instanceof Error?t.message:t),s.error(g({id:`LdABLa`,values:{target:e}}))}),p.dismiss()}r&&p.dismiss()},t[83]=g,t[84]=n.project,t[85]=C,t[86]=T,t[87]=ft,t[88]=p,t[89]=pt):pt=t[89];let mt=pt,ht;t[90]!==mt||t[91]!==y.phase||t[92]!==n.worktree||t[93]!==T?(ht=function(){y.phase===`ready`&&(console.log(m({branch_dialog_action:`open-worktree`,branch:T})),b(ve),n.worktree.checkout({branch:T}).then(e=>{mt(e)}).catch(e=>{console.warn(`[receive] worktree-checkout rejected branch_dialog_action=open-worktree`,e instanceof Error?e.message:e),mt(null)}))},t[90]=mt,t[91]=y.phase,t[92]=n.worktree,t[93]=T,t[94]=ht):ht=t[94];let gt=ht,_t;t[95]!==g||t[96]!==y.otherWorktreePath||t[97]!==y.phase||t[98]!==n.project||t[99]!==C||t[100]!==T||t[101]!==p?(_t=function(){if(y.phase!==`branch-in-other-worktree`)return;let e=y.otherWorktreePath;console.log(m({branch_dialog_action:`pivot-to-other-worktree`,branch:T})),n.project.open({path:e,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:Te(C),pendingBranch:T}).catch(t=>{console.warn(`[receive] pivot-open-failed branch_action=pivot-to-other-worktree`,t instanceof Error?t.message:t),s.error(g({id:`LdABLa`,values:{target:e}}))}),p.dismiss()},t[95]=g,t[96]=y.otherWorktreePath,t[97]=y.phase,t[98]=n.project,t[99]=C,t[100]=T,t[101]=p,t[102]=_t):_t=t[102];let vt=_t,yt;t[103]!==y.phase||t[104]!==y.resolution||t[105]!==p?(yt=function(){console.log(m({branch_dialog_action:`cancel`,verdict_cell:y.phase===`verdict`?y.resolution.kind:void 0})),p.dismiss()},t[103]=y.phase,t[104]=y.resolution,t[105]=p,t[106]=yt):yt=t[106];let D=yt,O,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U,W,G,K;if(t[107]!==g||t[108]!==y.info||t[109]!==y.otherWorktreePath||t[110]!==y.phase||t[111]!==y.resolution||t[112]!==D||t[113]!==$e||t[114]!==C.branch||t[115]!==C.owner||t[116]!==C.repo||t[117]!==C.target||t[118]!==T||t[119]!==S){G=y.phase===`ready`||y.phase===`switching`||y.phase===`creating-worktree`?pe(y.info):null;let e;t[139]!==y.info||t[140]!==y.phase||t[141]!==$e?(e=y.phase===`ready`||y.phase===`switching`||y.phase===`creating-worktree`?me(y.info):$e??`HEAD`,t[139]=y.info,t[140]=y.phase,t[141]=$e,t[142]=e):e=t[142];let n=e;P=y.phase===`switching`||y.phase===`awaiting-cc1-recycle`,j=y.phase===`creating-worktree`;let i;t[143]===g?i=t[144]:(i=g({id:`OuY8t9`}),t[143]=g,t[144]=i),M=i;let a;t[145]===g?a=t[146]:(a=g({id:`XZkdtg`}),t[145]=g,t[146]=a),N=a;let o;t[147]===g?o=t[148]:(o=g({id:`VTulZj`}),t[147]=g,t[148]=o),K=o;let s=y.phase===`loading`,ee=y.phase===`error`;A=ce,U=!0,t[149]===D?W=t[150]:(W=e=>{e||D()},t[149]=D,t[150]=W),k=ae,R=`sm:max-w-xl`,z=`share-branch-switch-dialog`,B=ke,V=Oe;let l;t[151]===S?l=t[152]:(l=(0,_.jsx)(ie,{children:(0,_.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:S}})}),t[151]=S,t[152]=l);let te=C.owner,ne=C.repo,d;t[153]===C.target?d=t[154]:(d=c(C.target),t[153]=C.target,t[154]=d);let f;t[155]!==C.owner||t[156]!==C.repo||t[157]!==d?(f=(0,_.jsx)(re,{className:`sr-only`,children:(0,_.jsx)(r,{id:`f8jU-L`,values:{0:te,1:ne,2:d}})}),t[155]=C.owner,t[156]=C.repo,t[157]=d,t[158]=f):f=t[158],t[159]!==l||t[160]!==f?(H=(0,_.jsxs)(se,{children:[l,f]}),t[159]=l,t[160]=f,t[161]=H):H=t[161],O=oe;let le=C.owner,p=C.repo,m;t[162]===C.target?m=t[163]:(m=c(C.target),t[162]=C.target,t[163]=m),t[164]!==C.branch||t[165]!==C.owner||t[166]!==C.repo||t[167]!==C.target.kind||t[168]!==m?(F=(0,_.jsx)(`div`,{className:`mb-4`,children:(0,_.jsx)(de,{owner:le,repo:p,path:m,kind:C.target.kind,branch:C.branch,testId:`share-branch-switch-metadata`,branchTestId:`share-branch-switch-metadata-branch`})}),t[164]=C.branch,t[165]=C.owner,t[166]=C.repo,t[167]=C.target.kind,t[168]=m,t[169]=F):F=t[169],I=y.phase===`branch-in-other-worktree`?(0,_.jsxs)(`div`,{className:`text-sm text-muted-foreground`,"data-testid":`share-branch-switch-in-other-worktree`,children:[(0,_.jsx)(`p`,{className:`leading-6`,children:(0,_.jsx)(r,{id:`yjExfe`,values:{shareBranch:T},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),(0,_.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-branch-switch-in-other-worktree-path`,children:y.otherWorktreePath})]}):y.phase===`verdict-pending`?(0,_.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-verdict-pending`,role:`status`,"aria-live":`polite`,children:[(0,_.jsx)(u,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,_.jsx)(r,{id:`c8jBgX`})]}):y.phase===`verdict`?y.resolution.kind===`on-origin`?(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-on-origin`,children:(0,_.jsx)(r,{id:`Uay5NL`,values:{targetNoun:S,shareBranch:T},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):y.resolution.kind===`renamed`?(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-renamed`,children:(0,_.jsx)(r,{id:`P0HC30`,values:{0:y.resolution.renamedTo,targetNoun:S},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):y.resolution.kind===`diverged`?(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-diverged`,children:(0,_.jsx)(r,{id:`kLv8d3`,values:{shareBranch:T,targetNoun:S},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,_.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-verdict-handoff`,role:`status`,"aria-live":`polite`,children:[(0,_.jsx)(u,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,_.jsx)(r,{id:`c8jBgX`})]}):s?(0,_.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-loading`,role:`status`,"aria-live":`polite`,children:[(0,_.jsx)(u,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,_.jsx)(r,{id:`jerqF0`})]}):ee?(0,_.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,_.jsx)(r,{id:`w4hMYl`})}):G?.kind===`D`?(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,_.jsx)(r,{id:`DTI-fp`,values:{targetNoun:S,shareBranch:T},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):G?.kind===`B`?(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,_.jsx)(r,{id:`sZ2IOu`,values:{targetNoun:S,shareBranch:T,currentLabel:n},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,_.jsx)(r,{id:`_902BE`,values:{targetNoun:S,shareBranch:T,currentLabel:n},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),L=G&&!G.switchEnabled&&G.conflictingFiles.length>0?(0,_.jsxs)(`div`,{className:`mt-3 rounded-md border border-border bg-muted/30 p-3 text-1sm`,"data-testid":`share-branch-switch-conflict`,children:[(0,_.jsx)(`p`,{className:`font-medium text-foreground/90`,children:(0,_.jsx)(r,{id:`n2lRue`})}),(0,_.jsx)(`ul`,{id:`share-receive-branch-conflict-files`,className:`mt-1 list-disc space-y-0.5 pl-5 text-muted-foreground`,children:G.conflictingFiles.map(De)})]}):null,t[107]=g,t[108]=y.info,t[109]=y.otherWorktreePath,t[110]=y.phase,t[111]=y.resolution,t[112]=D,t[113]=$e,t[114]=C.branch,t[115]=C.owner,t[116]=C.repo,t[117]=C.target,t[118]=T,t[119]=S,t[120]=O,t[121]=k,t[122]=A,t[123]=j,t[124]=M,t[125]=N,t[126]=P,t[127]=F,t[128]=I,t[129]=L,t[130]=R,t[131]=z,t[132]=B,t[133]=V,t[134]=H,t[135]=U,t[136]=W,t[137]=G,t[138]=K}else O=t[120],k=t[121],A=t[122],j=t[123],M=t[124],N=t[125],P=t[126],F=t[127],I=t[128],L=t[129],R=t[130],z=t[131],B=t[132],V=t[133],H=t[134],U=t[135],W=t[136],G=t[137],K=t[138];let q;t[170]===P?q=t[171]:(q=P?(0,_.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-switching`,role:`status`,"aria-live":`polite`,children:[(0,_.jsx)(u,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,_.jsx)(r,{id:`CU3AiE`})]}):null,t[170]=P,t[171]=q);let J;t[172]===j?J=t[173]:(J=j?(0,_.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-creating-worktree`,role:`status`,"aria-live":`polite`,children:[(0,_.jsx)(u,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,_.jsx)(r,{id:`PZtgO0`})]}):null,t[172]=j,t[173]=J);let Y;t[174]!==O||t[175]!==F||t[176]!==I||t[177]!==L||t[178]!==q||t[179]!==J?(Y=(0,_.jsxs)(O,{children:[F,I,L,q,J]}),t[174]=O,t[175]=F,t[176]=I,t[177]=L,t[178]=q,t[179]=J,t[180]=Y):Y=t[180];let bt;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(bt=(0,_.jsx)(r,{id:`dEgA5A`}),t[181]=bt):bt=t[181];let X;t[182]===D?X=t[183]:(X=(0,_.jsx)(o,{variant:`ghost`,onClick:D,"data-testid":`share-branch-switch-cancel`,children:bt}),t[182]=D,t[183]=X);let Z;t[184]!==y.phase||t[185]!==y.resolution||t[186]!==j||t[187]!==ut||t[188]!==ot||t[189]!==gt||t[190]!==vt||t[191]!==ct||t[192]!==nt||t[193]!==it||t[194]!==M||t[195]!==N||t[196]!==P||t[197]!==G||t[198]!==K?(Z=y.phase===`branch-in-other-worktree`?(0,_.jsx)(o,{onClick:vt,"data-testid":`share-branch-switch-in-other-worktree-pivot`,children:(0,_.jsx)(r,{id:`hyCxJY`})}):y.phase===`verdict`?y.resolution.kind===`on-origin`?(0,_.jsxs)(o,{onClick:it,"data-testid":`share-branch-switch-verdict-switch-update`,children:[(0,_.jsx)(l,{className:`size-3.5`,"aria-hidden":!0}),(0,_.jsx)(r,{id:`uA_jXp`})]}):y.resolution.kind===`renamed`?(0,_.jsxs)(o,{onClick:ot,"data-testid":`share-branch-switch-verdict-open-renamed`,children:[(0,_.jsx)(te,{className:`size-3.5`,"aria-hidden":!0}),(0,_.jsx)(r,{id:`AItsE5`})]}):y.resolution.kind===`diverged`?(0,_.jsxs)(o,{onClick:ct,"data-testid":`share-branch-switch-verdict-plain-switch`,children:[(0,_.jsx)(l,{className:`size-3.5`,"aria-hidden":!0}),N]}):null:(0,_.jsxs)(`div`,{className:`flex min-w-0 flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-end sm:gap-2`,children:[G?.openCurrentEnabled?(0,_.jsxs)(o,{variant:`outline`,onClick:ut,disabled:P||j,"data-testid":`share-branch-switch-open-current`,children:[(0,_.jsx)(te,{className:`size-3.5`,"aria-hidden":!0}),M]}):null,(0,_.jsx)(o,{variant:`outline`,onClick:nt,disabled:!G?.switchEnabled||P||j,"aria-disabled":!G?.switchEnabled||P||j,"aria-describedby":G&&!G.switchEnabled&&G.conflictingFiles.length>0?`share-receive-branch-conflict-files`:void 0,"data-testid":`share-branch-switch-switch`,children:P?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(u,{className:`size-3.5`,"aria-hidden":`true`}),N]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(l,{className:`size-3.5`,"aria-hidden":!0}),N]})}),(0,_.jsx)(o,{onClick:gt,disabled:!G||P||j,"data-testid":`share-branch-switch-worktree`,children:j?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(u,{className:`size-3.5`,"aria-hidden":`true`}),K]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(ee,{className:`size-3.5`,"aria-hidden":!0}),K]})})]}),t[184]=y.phase,t[185]=y.resolution,t[186]=j,t[187]=ut,t[188]=ot,t[189]=gt,t[190]=vt,t[191]=ct,t[192]=nt,t[193]=it,t[194]=M,t[195]=N,t[196]=P,t[197]=G,t[198]=K,t[199]=Z):Z=t[199];let Q;t[200]!==X||t[201]!==Z?(Q=(0,_.jsxs)(d,{className:`sm:justify-between`,children:[X,Z]}),t[200]=X,t[201]=Z,t[202]=Q):Q=t[202];let $;t[203]!==k||t[204]!==R||t[205]!==z||t[206]!==B||t[207]!==V||t[208]!==H||t[209]!==Y||t[210]!==Q?($=(0,_.jsxs)(k,{className:R,"data-testid":z,onInteractOutside:B,onPointerDownOutside:V,children:[H,Y,Q]}),t[203]=k,t[204]=R,t[205]=z,t[206]=B,t[207]=V,t[208]=H,t[209]=Y,t[210]=Q,t[211]=$):$=t[211];let xt;return t[212]!==A||t[213]!==U||t[214]!==W||t[215]!==$?(xt=(0,_.jsx)(A,{open:U,onOpenChange:W,children:$}),t[212]=A,t[213]=U,t[214]=W,t[215]=$,t[216]=xt):xt=t[216],xt}function De(e){return(0,_.jsx)(`li`,{children:(0,_.jsx)(`code`,{className:`text-foreground/80`,children:e})},e)}function Oe(e){e.preventDefault()}function ke(e){e.preventDefault()}function Ae(){return p.request()}function je(e){return Se(e,null).state}function Me(e){return xe(e,null)}function Ne(e){return ge(e,null)}function Pe(){return null}export{v as ShareBranchSwitchDialog};
|