@inkeep/open-knowledge 0.80.0-beta.7 → 0.80.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +6 -6
- package/dist/config-schema.json +2 -1
- package/dist/config.user.schema.json +2 -1
- package/dist/constants-udCWsXgt.mjs +1 -0
- package/dist/{dist-GcFBLEr5.mjs → dist-BGZB40vV.mjs} +1 -1
- package/dist/{dist-BBi7mVvL.mjs → dist-UU05FlF5.mjs} +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +2 -2
- package/dist/init-CPmsvtQB.mjs +1 -0
- package/dist/{init-DvYKQnB9.mjs → init-DixdtQo4.mjs} +2 -2
- package/dist/{launch-json-removal-7bCaKHP1.mjs → launch-json-removal-DQSVIMKg.mjs} +1 -1
- package/dist/loader-BJdt_Inn.mjs +1 -0
- package/dist/{loader-DrjH_b9L.mjs → loader-OpRlMshE.mjs} +1 -1
- package/dist/{md-manager-BGnqyqi1-DCa5-0ww.mjs → md-manager-BGnqyqi1-CGCojPWP.mjs} +1 -1
- package/dist/{open-browser-CDL2mqCk.mjs → open-browser-xNlcpMgb.mjs} +1 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/preview-CPYHmnfi.mjs +1 -0
- package/dist/{preview-BYnQz9HD.mjs → preview-DDX1gJqb.mjs} +1 -1
- package/dist/public/assets/{ActivityModeContent-BZzgyg-l.js → ActivityModeContent-BRpsMl1W.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-DARtVJlU.js → AddPropertiesButton-BUNE85Al.js} +2 -2
- package/dist/public/assets/{AgentDiffPane-BdSQEzRZ.js → AgentDiffPane-DhX2Q-kq.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-CFgtBbQR.js → AgentThreadClientBinder-oQqS9LMn.js} +1 -1
- package/dist/public/assets/{BugReportHistory-DDQ7rrrr.js → BugReportHistory-BeT4qc8x.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-Bt-xM9-I.js → BugReportHistoryDialog-qOgaU67n.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-Bf645WUa.js → CodeMirrorPropInput-BJDU0-70.js} +1 -1
- package/dist/public/assets/{ConsentDialogBody-RBMJ0gc0.js → ConsentDialogBody-CYQDvrod.js} +1 -1
- package/dist/public/assets/{DeleteConfirmationDialog-n90yA0mh.js → DeleteConfirmationDialog-_4ZcQ_WU.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-DsG9GOLX.js → DiffViewBoundary-WTsOr1JB.js} +1 -1
- package/dist/public/assets/{DocumentContext-D7jvhyCA.js → DocumentContext-CjYhWoGU.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-Blopqyef.js → EditorModeToggle-BJc88vvp.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-B056XoQ0.js → EnableSyncConfirmDialog-bbbliDE7.js} +1 -1
- package/dist/public/assets/ExcalidrawDocEditor-_5TmYiLc.js +1 -0
- package/dist/public/assets/FeedbackForm-Y66w6mKZ.js +1 -0
- package/dist/public/assets/{GraphPanel-CewYgyfZ.js → GraphPanel-DPvwBmDW.js} +1 -1
- package/dist/public/assets/{ImageAttachments-DmjOMNqA.js → ImageAttachments-ChTOkMU5.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-C6LzDIr2.js → ImportSkillDialog-D2cOhqCs.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-BgrTlSeu.js → LintConfigEditor-Bmt7m3WR.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-Cw4XtRx_.js → ManagedArtifactProperties-DQZHPU2z.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-DXuD-PMR.js +1 -0
- package/dist/public/assets/{MermaidDocEditor-C5hGyxfZ.js → MermaidDocEditor-BeFnyZX6.js} +1 -1
- package/dist/public/assets/{OpenInAgentMenuItem-QrteG6Br.js → OpenInAgentMenuItem-D8NEKdSX.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-C8_v-Tu6.js → PropertyDisplayRow-DcTwX5-h.js} +1 -1
- package/dist/public/assets/{RegisteredAgentIcon--fiCkSba.js → RegisteredAgentIcon-CcvblzpC.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-BHJJSRc_.js → ReportBugDialogBody-byNRbXwl.js} +1 -1
- package/dist/public/assets/{ReportBugMenuTrigger-DDbgWwFU.js → ReportBugMenuTrigger-Cnn2Kpoj.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-CkjLP98S.js → SchemaConfigEditor-Ar_uta_g.js} +1 -1
- package/dist/public/assets/{SessionsHost-CGMm3aDb.js → SessionsHost-B8q1kalR.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-k_8sF_t3.js → SettingsDialogBody-DtqaucZk.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-C4Eqwx_r.js → ShareBranchSwitchDialog-BBaO_tr4.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-CNa1HD1Q.js → ShareReceiveDialog-DkvKil4t.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-B-_2h-KD.js → ShareReceiveMissDialog-6Vk1ov6n.js} +1 -1
- package/dist/public/assets/{SkillCostValue-CYw_tCqR.js → SkillCostValue-BKwKtiXH.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-BuW2sJvG.js → SkillEditBanner-C5uTpSKD.js} +1 -1
- package/dist/public/assets/{SkillForkDialog-DAn5-JZV.js → SkillForkDialog-DnmjSB0n.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-BRjVgdkn.js → SkillInstallMenu-sgeehwe1.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-_uPhVG7Y.js → SkillOriginInline-BnMdaW-1.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-OhQrSWSi.js → SkillToolbarControls-DSkcPyE7.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-zHguPndQ.js → SlidesToolbarControls-D6fM1z2O.js} +1 -1
- package/dist/public/assets/{SourceEditor-CgtZzyfW.js → SourceEditor-s6oqUBCs.js} +1 -1
- package/dist/public/assets/{TerminalPanel-BzL8_A5I.js → TerminalPanel-BVWOE3kU.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-CFd6nVNH.js → TerminalWindowApp-BNJ24WKK.js} +1 -1
- package/dist/public/assets/{TextDocEditor-DqBZzHgY.js → TextDocEditor-DfldlAp7.js} +1 -1
- package/dist/public/assets/{ThreadView-DL5_M7LX.js → ThreadView-BJq8AtlR.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-B_27zkg0.js → TimelineDiffPane-CvTyxlJ-.js} +1 -1
- package/dist/public/assets/{agent-connections-BZwWjV-L.js → agent-connections-0X_wM1D5.js} +1 -1
- package/dist/public/assets/{auth-state-cache-B5AZOzS0.js → auth-state-cache-BU4ajCHf.js} +1 -1
- package/dist/public/assets/{bug-report-send-manager-DOLrtOEv.js → bug-report-send-manager-D0ep_Jtf.js} +1 -1
- package/dist/public/assets/{client-version-CDitBjAS.js → client-version-47R1Hqu0.js} +1 -1
- package/dist/public/assets/{comment-chips-DuFqX1af.js → comment-chips-Dl4tR59k.js} +1 -1
- package/dist/public/assets/{config-provider-Ca2HUShB.js → config-provider-D06S8HhQ.js} +1 -1
- package/dist/public/assets/{css-color-to-hex-AUn7eIel.js → css-color-to-hex-X_ubtbg_.js} +1 -1
- package/dist/public/assets/{diagnostic-breadcrumb-g0QEaFL4.js → diagnostic-breadcrumb-rWRd-iGs.js} +1 -1
- package/dist/public/assets/{dist-DILeGueK.js → dist-DTxb76k4.js} +2 -2
- package/dist/public/assets/{doc-paths-BWrKtSx2.js → doc-paths-VPO39t4f.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-DSaQkZ_X.js → doc-undo-manager-D3cMP3Rz.js} +1 -1
- package/dist/public/assets/{documents-events-Do7TM3Hd.js → documents-events-DLvhFUkq.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-C1_qOMsA.js → file-tree-adapter-Sub5h3Aa.js} +1 -1
- package/dist/public/assets/{file-tree-utils-BcIIWtsU.js → file-tree-utils-CIQBSzS9.js} +1 -1
- package/dist/public/assets/{folder-config-api-CDR1eAcz.js → folder-config-api-Cz9BQmTR.js} +1 -1
- package/dist/public/assets/{index-DcJjM2Hn.js → index-BRQoyokT.js} +8 -8
- package/dist/public/assets/{lint-config-client--83L6Vzq.js → lint-config-client-ShgapJqD.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-Dwh97LWk.js → markdownlint-rule-browser-BiJOQswX.js} +1 -1
- package/dist/public/assets/messages-CjdjdvIS.js +1 -0
- package/dist/public/assets/{navigation-targets-CJ9ZxyzV.js → navigation-targets-Cj3FjSHM.js} +1 -1
- package/dist/public/assets/{page-list-cache-C6t_W1Qs.js → page-list-cache-Db-cMXXb.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-CRjoDiuf.js → pending-receive-nav-store-Cvafwk5s.js} +1 -1
- package/dist/public/assets/{preferred-session-events-CwZtdTs7.js → preferred-session-events-D2UgCugO.js} +1 -1
- package/dist/public/assets/{progress-C4SiEBGf.js → progress-DIu1GSm2.js} +1 -1
- package/dist/public/assets/{project-paths-ygpKMwOT.js → project-paths-C8ucGf4F.js} +1 -1
- package/dist/public/assets/{prop-types-CT1xGqpW.js → prop-types-BaGWFLYl.js} +1 -1
- package/dist/public/assets/{receive-store-DutQ_RL1.js → receive-store-DE9tB4jY.js} +1 -1
- package/dist/public/assets/{selection-context-COlhw5nL.js → selection-context-BmxK2cQ1.js} +1 -1
- package/dist/public/assets/{sign-in-terminal-events-BqTVNN-V.js → sign-in-terminal-events-BUwsboGX.js} +1 -1
- package/dist/public/assets/{skill-scope-CUAEKGV-.js → skill-scope-bxDiQshW.js} +1 -1
- package/dist/public/assets/{skills-api-CM8h9xtl.js → skills-api-BaxUiF2f.js} +1 -1
- package/dist/public/assets/{src-U7mQYf3e.js → src-DpN4tqC_.js} +1 -1
- package/dist/public/assets/{startup-marks-vgWlVGPK.js → startup-marks-BxUZHKOy.js} +1 -1
- package/dist/public/assets/{tag-pill-input-BRyN2FKA.js → tag-pill-input-dKjZE88k.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-7jeW8XWM.js → target-navigation-intent-CN-DIwXP.js} +1 -1
- package/dist/public/assets/{telemetry-impl-C6f28Ge5.js → telemetry-impl-CRQnPrM5.js} +2 -2
- package/dist/public/assets/{telemetry-startup-DiFICPCo.js → telemetry-startup-lxSU0usW.js} +1 -1
- package/dist/public/assets/{terminal-command-events-CVCqfbNT.js → terminal-command-events-Orubep-S.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-DuaMfoq_.js → terminal-launch-events-CRAau5xV.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-BHuv7G5q.js → terminal-telemetry-C6TBDBsx.js} +1 -1
- package/dist/public/assets/{thread-client-BZoVbxhe.js → thread-client-C8EMFbCt.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-H1V6TICJ.js → typing-burst-detector-DYWkkyFn.js} +1 -1
- package/dist/public/assets/{uninstall-D2krzbU2.js → uninstall-rTTw6eol.js} +1 -1
- package/dist/public/assets/{use-activity-panel-BP0UGAow.js → use-activity-panel-CFjSB3Ko.js} +1 -1
- package/dist/public/assets/use-apply-config-language-BA8pb8bB.js +2 -0
- package/dist/public/assets/{use-collab-url-JUcW-mVG.js → use-collab-url-i6hEm2eD.js} +1 -1
- package/dist/public/assets/{use-conflicts-yBw-ZjZM.js → use-conflicts-Csl-W9sG.js} +1 -1
- package/dist/public/assets/{use-git-sync-status-CoUdayE7.js → use-git-sync-status-DrkQ-euc.js} +1 -1
- package/dist/public/assets/{use-installed-clis-j9XDtwV2.js → use-installed-clis-CywDYh_S.js} +2 -2
- package/dist/public/assets/{use-live-xterm-theme-DBWjwre6.js → use-live-xterm-theme-D87B7hkL.js} +1 -1
- package/dist/public/assets/{use-open-skill-C7UyAcdd.js → use-open-skill-DcSc5W3j.js} +1 -1
- package/dist/public/assets/{use-settings-route-DHuAch1j.js → use-settings-route-CAshJWbw.js} +1 -1
- package/dist/public/assets/{use-skill-origin-DhcploXf.js → use-skill-origin-kW6ZZcES.js} +1 -1
- package/dist/public/assets/{use-skills-DJX6inxB.js → use-skills-DT7KgjWD.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-Y78SBxmZ.js → use-terminal-enabled-C1s8vXrb.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-DY2_QU4I.js → use-timeline-entry-diff-DHQkGLuD.js} +1 -1
- package/dist/public/assets/{use-workspace-2aIeQVoi.js → use-workspace-ByLGR16G.js} +1 -1
- package/dist/public/index.html +59 -59
- package/dist/public/uninstall.html +3 -3
- package/dist/{registry-probes-p0ZApPjq.mjs → registry-probes-CSVwdlnt.mjs} +1 -1
- package/dist/{removal-file-path-Bx2ZAa33.mjs → removal-file-path-wM2_Gnbs.mjs} +1 -1
- package/dist/{repair-launch-json-Bfv2MHor.mjs → repair-launch-json-Bucu4SKC.mjs} +1 -1
- package/dist/{repair-mcp-configs-Dae5PZa1.mjs → repair-mcp-configs-B5eKvhO7.mjs} +1 -1
- package/dist/schemas/v0/config.user.schema.json +2 -1
- package/dist/src-DfFI0URL.mjs +1 -0
- package/dist/{src-Cy-zDyG6.mjs → src-DocALnhn.mjs} +1 -1
- package/dist/{start-DTpjNc5f.mjs → start-CCqXKb5e.mjs} +3 -3
- package/dist/start-CgB7z6Zm.mjs +1 -0
- package/package.json +5 -5
- package/dist/constants-H8MPNRhO.mjs +0 -1
- package/dist/init-7G_l7gil.mjs +0 -1
- package/dist/loader-BWhgdNl5.mjs +0 -1
- package/dist/preview-CuyQLuj5.mjs +0 -1
- package/dist/public/assets/ExcalidrawDocEditor-C4F3udw2.js +0 -1
- package/dist/public/assets/FeedbackForm-D0MIsMOt.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-Da_vwJzP.js +0 -1
- package/dist/public/assets/use-apply-config-language-BwIOrXvC.js +0 -2
- package/dist/src-BP-PBpUx.mjs +0 -1
- package/dist/start-D6uOZUia.mjs +0 -1
- /package/dist/public/assets/{__vite-browser-external-CfQ5hhbQ.js → __vite-browser-external-pxlgOdf3.js} +0 -0
- /package/dist/public/assets/{messages-C7vX5WHO.js → messages-0wCfOVUP.js} +0 -0
- /package/dist/public/assets/{messages-CdMg2dJ8.js → messages-Bia_CkTU.js} +0 -0
- /package/dist/public/assets/{messages-CiplIvRK.js → messages-BkyQO0O-.js} +0 -0
- /package/dist/public/assets/{messages-gQFOTX2J.js → messages-DbWtr8o5.js} +0 -0
package/dist/public/assets/{SettingsDialogBody-k_8sF_t3.js → SettingsDialogBody-DtqaucZk.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,Sr as a,at as o,dt as s,gi as c,lt as l,st as u,ut as d,z as f}from"./DocumentContext-D7jvhyCA.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{S as x,_ as S,a as C,b as w,c as T,d as E,f as D,g as O,h as k,i as A,l as j,m as M,o as N,p as P,r as F,s as I,t as L,u as R,v as z,x as B,y as V}from"./agent-connections-BZwWjV-L.js";import{t as H}from"./button-BeFNZANd.js";import{i as U,n as W,r as G,t as K}from"./tooltip-DVBVVaAs.js";import{n as ee,r as te,t as q}from"./collapsible-DYySK8La.js";import{a as J,c as ne,i as re,l as ie,n as ae,o as oe,r as se,s as ce,t as le}from"./alert-dialog-CqqfqWNT.js";import{n as ue,t as de}from"./with-selector-PRoyWQiu.js";import{t as fe}from"./checkbox-Crs_F_Np.js";import{A as pe,C as me,D as he,E as ge,O as _e,S as ve,T as ye,_ as be,b as xe,f as Se,g as Ce,h as we,j as Te,k as Ee,m as De,p as Oe,r as ke,v as Ae,w as je,x as Me,y as Ne}from"./floating-ui.dom-CDtYEnEj.js";import{c as Pe,d as Fe,l as Ie,o as Le,s as Re,u as ze}from"./dist-DYso7MCm.js";import{t as Be}from"./label-D-K3fWtj.js";import{i as Ve,n as He,o as Ue,s as We,t as Ge}from"./select-D_BhUvh8.js";import{n as Ke,t as qe}from"./radio-group-npdxiS6E.js";import{t as Je}from"./switch-iwBsEWej.js";import{n as Ye,r as Xe,t as Ze}from"./toggle-group-BxIyZnUJ.js";import{a as Qe,c as $e,g as et,h as tt,l as nt,n as rt,o as it,r as at,s as Y,t as ot,u as st,y as ct}from"./RegisteredAgentIcon--fiCkSba.js";import{a as lt,i as ut,o as dt}from"./terminal-telemetry-BHuv7G5q.js";import{$o as ft,Ac as pt,As as mt,Bs as ht,Ci as gt,Cn as _t,Cs as vt,Es as yt,Fc as bt,Gc as xt,Go as St,Ic as Ct,Is as wt,Jc as Tt,Jo as Et,Ls as Dt,Mc as Ot,Mr as kt,Ms as At,Nc as jt,Ns as Mt,Ot as Nt,Pc as Pt,Qs as Ft,Rs as It,Tc as Lt,Un as Rt,Uo as zt,Wo as Bt,Xn as Vt,Xo as Ht,Yo as Ut,Ys as Wt,Zc as Gt,_s as Kt,as as qt,ba as Jt,cs as Yt,fi as Xt,fs as Zt,gi as Qt,gs as $t,is as en,js as tn,kc as nn,ks as rn,ls as an,ms as on,mt as sn,nl as cn,os as ln,ot as un,ps as dn,pt as fn,qo as pn,qs as mn,rs as hn,ss as gn,vs as _n,wn as vn,zs as yn}from"./dist-DILeGueK.js";import{t as bn}from"./trace-api-BP9dN1Hz.js";import{n as X}from"./dist-CJhtNlOm2.js";import{d as xn,f as Sn,h as Cn,n as wn,o as Tn,p as En,r as Dn,u as On,v as kn}from"./use-settings-route-DHuAch1j.js";import{t as An}from"./dist-Cr4-nBVI.js";import{c as jn}from"./documents-events-Do7TM3Hd.js";import{a as Mn,i as Nn,o as Pn}from"./local-menu-action-bus-DaoT7_kL.js";import{a as Fn,i as In,t as Ln}from"./use-apply-config-theme-B5w38X1P.js";import{t as Rn}from"./OpenInAgentMenuItem-QrteG6Br.js";import{g as zn,h as Bn,p as Vn,v as Hn,y as Un}from"./SkillInstallMenu-BRjVgdkn.js";import{t as Wn}from"./createLucideIcon-B6ULg5PN.js";import{a as Gn,c as Kn,f as qn,l as Jn,p as Yn,s as Xn,t as Zn}from"./EnableSyncConfirmDialog-B056XoQ0.js";import{p as Qn}from"./Mermaid-DZf1Vjbg.js";import{t as $n}from"./arrow-up-right-B3B9a7te.js";import{t as er}from"./check-BzfGb3KU.js";import{t as tr}from"./chevron-right-C-g4JuT4.js";import{n as nr,t as rr}from"./lint-plugin-meta-zA9wHIBR.js";import{t as ir}from"./circle-alert-Czw40trT.js";import{i as ar,r as or}from"./prop-types-CT1xGqpW.js";import{a as sr,h as cr,r as lr,t as ur}from"./dropdown-menu-BEhl0wvu.js";import{A as dr,B as fr,C as pr,F as mr,G as hr,H as gr,J as _r,K as vr,L as yr,M as br,N as xr,O as Sr,P as Cr,Q as wr,R as Tr,S as Er,U as Dr,V as Or,W as kr,Y as Ar,at as jr,b as Mr,c as Nr,d as Pr,et as Fr,f as Ir,h as Lr,i as Rr,j as zr,k as Br,l as Vr,m as Hr,n as Ur,nt as Wr,o as Gr,p as Kr,q as qr,v as Jr,w as Yr,x as Xr,y as Zr}from"./auth-state-cache-B5AZOzS0.js";import{It as Qr}from"./CodeMirrorPropInput-Bf645WUa.js";import{r as $r,t as ei}from"./use-git-sync-status-CoUdayE7.js";import{o as ti}from"./folder-config-api-CDR1eAcz.js";import{t as ni}from"./info-CilGMBpP.js";import{t as ri}from"./spinner-Bp2_BYkl.js";import{n as ii,r as ai,t as oi}from"./ThemePicker-wGe4WU58.js";import{t as si}from"./rotate-ccw-B05K_aam.js";import{t as ci}from"./square-pen-BhqhPrdL.js";import{t as li}from"./terminal-DGmaW797.js";import{t as ui}from"./trash-2-B9Flu-41.js";import{t as di}from"./triangle-alert-CCeXtPLU.js";import{t as fi}from"./x-DIayTyoR.js";import{t as pi}from"./badge-5sA3wpe0.js";import{a as mi,c as hi,i as gi,n as _i,o as vi,r as yi,s as bi,t as xi}from"./dialog-DJkPMmCN.js";import{i as Si,o as Ci,r as wi,t as Ti}from"./field-BmnhqmEH.js";import{t as Ei}from"./tool-list-format-BVkGh5Od.js";import{n as Di}from"./use-workspace-2aIeQVoi.js";import{d as Oi}from"./doc-paths-BWrKtSx2.js";import{a as ki}from"./startup-marks-vgWlVGPK.js";import{n as Ai}from"./config-provider-Ca2HUShB.js";import{a as ji}from"./skill-scope-CUAEKGV-.js";import{m as Mi}from"./skills-api-CM8h9xtl.js";import{t as Ni}from"./input-3o4m6NnP.js";import{a as Pi,i as Fi,t as Ii}from"./popover-DwsSVA7z.js";import{_ as Li,a as Ri,d as zi,f as Bi,g as Vi,h as Hi,m as Ui,p as Wi,u as Gi,v as Ki,y as qi}from"./css-color-to-hex-AUn7eIel.js";import{n as Ji}from"./use-apply-config-language-BwIOrXvC.js";import{t as Yi}from"./external-link-DCF8KwVP.js";import{t as Xi}from"./ConfigSharingInfoTooltip-CF-B970o.js";import{t as Zi}from"./use-skills-DJX6inxB.js";import{o as Qi,s as $i,t as ea}from"./use-open-skill-C7UyAcdd.js";import{r as ta,t as na}from"./DeleteConfirmationDialog-n90yA0mh.js";import{t as ra}from"./skeleton-C6CemrJA.js";import{d as ia,n as aa,r as oa,t as sa,u as ca}from"./lint-config-client--83L6Vzq.js";import{_ as la,a as ua,d as da,f as fa,g as pa,h as ma,i as ha,o as ga,s as _a,t as va,u as ya}from"./sortable.esm-Dd5xvHIC.js";import{t as ba}from"./textarea-CKTD258L.js";import{i as xa,n as Sa,t as Ca}from"./input-group-Bp9yqbay.js";import{a as wa,f as Ta,i as Ea,n as Da,o as Oa,p as ka,r as Aa,s as ja,t as Ma}from"./form-CEg9p5Rf.js";import{r as Na,t as Pa}from"./terminal-command-events-CVCqfbNT.js";import{t as Fa}from"./tag-pill-input-BRyN2FKA.js";import{t as Ia}from"./markdownlint-rule-browser-Dwh97LWk.js";import{n as La}from"./schema-fields-view-intent-BhBMXWR3.js";import{n as Ra,t as za}from"./use-terminal-enabled-Y78SBxmZ.js";var Ba=Wn(`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`}]]),Va=Wn(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Ha=Wn(`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`}]]),Ua=Wn(`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 Wa(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(pi,{variant:`gray`,children:(0,$.jsx)(m,{id:`YBt9YP`})}),e[0]=t):t=e[0],t}function Ga(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)(U,{asChild:!0,children:(0,$.jsx)(pi,{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)(W,{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)(G,{children:(0,$.jsxs)(K,{children:[a,o]})}),t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function Ka(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)(Wa,{}):null,t[7]=o,t[8]=v);let y;t[9]===i?y=t[10]:(y=i?(0,$.jsx)(Ga,{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=>Yi(e,c),onAuxClick:e=>Yi(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)($n,{"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 qa=`settings-sharing-title`;function Ja(){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)(Ya,{}):(0,$.jsx)(Xa,{}),e[0]=n):n=e[0],n}function Ya(){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":qa,className:`space-y-3`,"data-field":`section:sharing`,children:(0,$.jsx)(Ka,{titleId:qa,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 Xa(){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(Qa)}},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)(Ka,{titleId:qa,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":qa,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)(ra,{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)(Ka,{titleId:qa,title:_,scope:`project`,level:`block`,adornment:(0,$.jsx)(Xi,{}),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)(qe,{value:n.mode,onValueChange:e=>void p(e),disabled:i,className:`gap-2`,"aria-labelledby":qa,"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)(Ke,{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)(Ke,{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)(H,{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(Za)}),(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":qa,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 Za(e){return(0,$.jsx)(`li`,{children:e},e)}function Qa(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[]}}var $a=`[a-z0-9](?:[a-z0-9-]*[a-z0-9])?`,eo=RegExp(`^${$a}(?:\\.${$a})*$`),to=/^[a-z][a-z0-9+.-]*:\/\//i;function no(e){if(to.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 ro(e,t){let n=e.trim();if(n===``)return{ok:!1,reason:`empty`};let r=no(n);if(r===null||r===``)return{ok:!1,reason:`invalid`};let i=tn(r);return eo.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 io(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 ao(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=()=>io(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 w,T;t[6]===n?(w=t[7],T=t[8]):(w=()=>n.subscribe(e=>c(io(e))),T=[n],t[6]=n,t[7]=w,t[8]=T),(0,Z.useEffect)(w,T);let E;t[9]===r?E=t[10]:(E=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]=E);let D=E,O;t[11]!==n||t[12]!==l||t[13]!==s||t[14]!==D?(O=function(e){e.preventDefault();let t=ro(l,new Set(s.map(oo)));if(!t.ok){f(D(t.reason));return}let r=n.patch({git:{hosts:{[t.host]:{provider:`github`}}}});if(!r.ok){f(_n(r.error));return}c(io(r.effective)),u(``),f(null),g(!0)},t[11]=n,t[12]=l,t[13]=s,t[14]=D,t[15]=O):O=t[15];let k=O,A;t[16]!==n||t[17]!==s?(A=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(_n(i.error));return}c(io(i.effective)),v({host:r}),f(null),g(!0)},t[16]=n,t[17]=s,t[18]=A):A=t[18];let j=A,M;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(`h4`,{id:`settings-enterprise-hosts-title`,className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`J2-D_a`})}),t[19]=M):M=t[19];let N;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(m,{id:`PgY2nN`}),t[20]=N):N=t[20];let P;t[21]===i?P=t[22]:(P=(0,$.jsxs)(`div`,{children:[M,(0,$.jsx)(`p`,{id:i,className:`text-1sm text-muted-foreground`,children:N})]}),t[21]=i,t[22]=P);let F;t[23]!==r||t[24]!==j||t[25]!==s?(F=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)(H,{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:()=>j(e),children:(0,$.jsx)(ui,{"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]=j,t[25]=s,t[26]=F):F=t[26];let I;t[27]===r?I=t[28]:(I=r({id:`Qbf7Q4`}),t[27]=r,t[28]=I);let L=d!==null,R=d===null?i:`${i} ${a}`,z;t[29]===d?z=t[30]:(z=e=>{u(e.target.value),d!==null&&f(null)},t[29]=d,t[30]=z);let B;t[31]!==l||t[32]!==I||t[33]!==L||t[34]!==R||t[35]!==z?(B=(0,$.jsx)(Ni,{ref:x,value:l,"aria-label":I,placeholder:`github.example.com`,autoComplete:`off`,spellCheck:!1,inputMode:`url`,className:`h-7 flex-1 font-mono text-xs`,"aria-invalid":L,"aria-describedby":R,onChange:z}),t[31]=l,t[32]=I,t[33]=L,t[34]=R,t[35]=z,t[36]=B):B=t[36];let V;t[37]===l?V=t[38]:(V=l.trim(),t[37]=l,t[38]=V);let U=V===``,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)(H,{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]!==k||t[43]!==B||t[44]!==G?(K=(0,$.jsxs)(`form`,{className:`flex items-center gap-2 pt-1`,onSubmit:k,noValidate:!0,children:[B,G]}),t[42]=k,t[43]=B,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]!==F||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:[F,K,ee,te]}),t[51]=F,t[52]=K,t[53]=ee,t[54]=te,t[55]=q):q=t[55];let J;return t[56]!==P||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:[P,q]}),t[56]=P,t[57]=q,t[58]=J):J=t[58],J}function oo(e){return tn(e)}function so(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??wr(),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}),Ur(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 w;t[8]!==a||t[9]!==x||t[10]!==s?(w=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]=w):w=t[11];let T=w,E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(m,{id:`AeXO77`}),t[12]=E):E=t[12];let D;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(Ka,{titleId:`settings-account-title`,title:E,scope:`user`,children:(0,$.jsx)(m,{id:`E6lrpp`})}),t[13]=D):D=t[13];let O;t[14]!==_||t[15]!==p||t[16]!==T||t[17]!==x||t[18]!==l.phase||t[19]!==l.result?(O=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)(ra,{className:`h-4 w-40`}),(0,$.jsx)(ra,{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)(H,{variant:`outline`,size:`sm`,onClick:()=>void x(),children:(0,$.jsx)(m,{id:`KDw4GX`})})]}):l.result.authenticated?l.result.tier===`A`?(0,$.jsx)(lo,{login:l.result.login}):(0,$.jsx)(co,{login:l.result.login,disconnecting:p,error:_,onDisconnect:()=>void T()}):l.result.unsupportedOrigin===void 0?(0,$.jsx)(fo,{onConnect:()=>f(!0)}):(0,$.jsx)(uo,{host:l.result.unsupportedOrigin.host}),t[14]=_,t[15]=p,t[16]=T,t[17]=x,t[18]=l.phase,t[19]=l.result,t[20]=O):O=t[20];let k;t[21]===i?k=t[22]:(k=(0,$.jsx)(ao,{binding:i}),t[21]=i,t[22]=k);let A;t[23]===x?A=t[24]:(A=e=>{f(e),e||x()},t[23]=x,t[24]=A);let j=l.phase===`loaded`?l.result.host:void 0,M=l.phase===`loaded`?l.result.ghAvailable:void 0,N;t[25]===x?N=t[26]:(N=()=>{x()},t[25]=x,t[26]=N);let P;t[27]!==d||t[28]!==r||t[29]!==A||t[30]!==j||t[31]!==M||t[32]!==N?(P=(0,$.jsx)(Ar,{open:d,onOpenChange:A,transport:r,host:j,ghAvailable:M,onSuccess:N}),t[27]=d,t[28]=r,t[29]=A,t[30]=j,t[31]=M,t[32]=N,t[33]=P):P=t[33];let F;return t[34]!==k||t[35]!==P||t[36]!==O?(F=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-3`,"data-testid":`settings-account`,children:[D,O,k,P]}),t[34]=k,t[35]=P,t[36]=O,t[37]=F):F=t[37],F}function co(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)(H,{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 lo(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 uo(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 fo(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)(H,{onClick:n,"data-testid":`settings-account-connect`,children:a})]})}),t[3]=n,t[4]=o),o}function po(e){if(e===void 0)return null;let t=e.params?.agent;if(typeof t!=`string`)return null;let n=cn[t]??t;return e.id===`followup.enable-manually`?An._({id:`followup.enable-manually`,values:{agent:n}}):null}function mo(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 ho(e){return e.presence===`absent`&&e.installedCount>0}function go(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)(Je,{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 _o(e){let t=(0,Q.c)(15),{target:n,projectDir:r,displayName:i}=e,{_:a}=h(),o;t[0]!==r||t[1]!==n?(o=()=>Un(n,r),t[0]=r,t[1]=n,t[2]=o):o=t[2];let[s,c]=(0,Z.useState)(o);if(!s)return null;let l;t[3]!==a||t[4]!==i?(l=a({id:`jIWP0P`,values:{displayName:i}}),t[3]=a,t[4]=i,t[5]=l):l=t[5];let u;t[6]!==r||t[7]!==n?(u=()=>{Hn(n,r,!1),c(Un(n,r))},t[6]=r,t[7]=n,t[8]=u):u=t[8];let d;t[9]===a?d=t[10]:(d=a({id:`LhVIxY`}),t[9]=a,t[10]=d);let f;return t[11]!==l||t[12]!==u||t[13]!==d?(f=(0,$.jsx)(H,{variant:`ghost`,size:`sm`,className:`shrink-0 font-mono uppercase`,"aria-label":l,onClick:u,children:d}),t[11]=l,t[12]=u,t[13]=d,t[14]=f):f=t[14],f}function vo(e,t){return e===`absent`&&!t}function yo(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 bo(e){if(e)return()=>{e.ownerDocument.activeElement===e&&V(e)?.focus()}}function xo(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)(H,{ref:bo,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 So(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)(er,{"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)(di,{"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 Co(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)($n,{"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)(H,{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)($n,{"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)(H,{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)(H,{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)(H,{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)(H,{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 wo(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)(H,{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 To(e){return e===void 0?null:nn[e].external?.installUrl??null}function Eo(e){return e!==null&&Object.values(e.probes.satisfiers).some(e=>e!==void 0&&e.state!==`unprobed`)}function Do(e){return`${e.source}:${e.id}`}function Oo(e,t,n){let r=t.has(Do(n)),i=dt(n);return at(e,n.source,n.id,r||i,n.supported)}function ko(e,t,n){return n.harness!==void 0&<(n)===0||Oo(e,t,n)}function Ao(e,t,n){let r=new Set(n.map(e=>Do(e))),i=e=>ko(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(Do)),ranks:new Map(a.map((e,t)=>[Do(e),t]))}}function jo(e,t,n,r){let i=t.filter(t=>!e.ranks.has(Do(t)));if(i.length===0)return e;let a=new Set(r.map(e=>Do(e))),o=e=>ko(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(Do),...d,...c.map(Do)];return{primaryKeys:new Set([...e.primaryKeys,...s.map(Do)]),ranks:new Map(f.map((e,t)=>[e,t]))}}function Mo(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?L:r,{_:a}=h(),o=st(),s=ct(),{states:c,refresh:l}=zn(),u=Bn(),d=Di(),[f,p]=(0,Z.useState)(``),[m,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(!1),[w,B]=(0,Z.useState)(null),[V,U]=(0,Z.useState)(!1),[W,G]=(0,Z.useState)(!1),[K,ee]=(0,Z.useState)(0),[te,q]=(0,Z.useState)(null),[J,ne]=(0,Z.useState)(null),re=(0,Z.useRef)(null),ie=(0,Z.useRef)(0),ae;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(ae={queryKey:[`acp-catalog`],queryFn:Ho,staleTime:3e5},t[2]=ae):ae=t[2];let oe=g(ae),se;t[3]!==oe.data||t[4]!==o||t[5]!==s?(se=()=>oe.data===void 0?null:Ao(oe.data.agents,o,s),t[3]=oe.data,t[4]=o,t[5]=s,t[6]=se):se=t[6];let[ce,le]=(0,Z.useState)(se),ue=ce??Ao([],o,s);if(oe.data!==void 0){let e;t[7]!==oe.data.agents||t[8]!==ce||t[9]!==o||t[10]!==s?(e=ce===null?Ao(oe.data.agents,o,s):jo(ce,oe.data.agents,o,s),t[7]=oe.data.agents,t[8]=ce,t[9]=o,t[10]=s,t[11]=e):e=t[11];let n=e;n!==ce&&le(n),ue=n}let de;t[12]===l?de=t[13]:(de=()=>{l()},t[12]=l,t[13]=de);let fe=(0,Z.useEffectEvent)(de),pe;t[14]===fe?pe=t[15]:(pe=()=>{fe()},t[14]=fe,t[15]=pe);let me;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(me=[],t[16]=me):me=t[16],(0,Z.useEffect)(pe,me);let he;t[17]===i?he=t[18]:(he=()=>{let e=!0,t=ie.current+=1;return i([]).then(n=>{!e||ie.current!==t||(n.snapshot!==null&&B(n.snapshot),U(!Eo(n.snapshot)),G(n.unavailable===!0))}).catch(()=>{e&&ie.current===t&&U(!0)}),()=>{e=!1}},t[17]=i,t[18]=he);let ge;t[19]!==i||t[20]!==K?(ge=[i,K],t[19]=i,t[20]=K,t[21]=ge):ge=t[21],(0,Z.useEffect)(he,ge);let _e=oe.data?.agents,ve=new Set(s.map(Vo)),ye;t[22]===u?.installedClis?ye=t[23]:(ye=u?.installedClis??{},t[22]=u?.installedClis,t[23]=ye);let be=ye,xe=w===null?[]:D(w),Se=xe.find(e=>e.id===te)??null,Ce=xe.find(e=>e.id===J)??null,we;t[24]===i?we=t[25]:(we=async function(e){let t=await i(e);return ie.current+=1,t.snapshot!==null&&B(t.snapshot),U(!Eo(t.snapshot)),t.unavailable===!0&&G(!0),t},t[24]=i,t[25]=we);let Te=we,Ee;t[26]===w?Ee=t[27]:(Ee=function(e,t){return t===!1?`absent`:t===!0?`present`:e===void 0?`unknown`:N(e,w,t)},t[26]=w,t[27]=Ee);let De=Ee,Oe;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=new Set(jt.map(Ct).filter(Bo)),t[28]=Oe):Oe=t[28];let ke=Oe,Ae;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=new Set(Pt.map(zo).filter(Ro)),t[29]=Ae):Ae=t[29];let je=Ae,Me;t[30]!==be||t[31]!==De||t[32]!==c?(Me=function(e,t){if(t===`terminal`){let t=nn[e].external?.targetId;return t===void 0?`unknown`:De(e,c[t]?.installed??null)}let n=jt.find(t=>Ct(t)===e);return n===void 0?`unknown`:De(e,be[n]??null)},t[30]=be,t[31]=De,t[32]=c,t[33]=Me):Me=t[33];let Ne=Me,Pe=function(e,t,n,r,i,a,o,s){let c=e===void 0?void 0:xe.find(t=>t.id===e);if(c===void 0||e===void 0||w===null||!Eo(w))return{status:void 0,action:void 0,hintAction:void 0,residualFiles:!1,statusId:void 0};let l={enabled:i,installedCount:k(S(c)),presence:o,configurable:P(c),setupDocSlug:c.row.setupDocSlug,installUrl:s===void 0?nn[e].external?.installUrl??null:s},u=mo(l),d=M(e)&&Ne(e,r)!==`absent`,f=ho(l)&&!d,p=F({agentId:e,mode:r,snapshot:w,detected:a}),m=p===`connected`||p===`not-connected`&&i,h=m?`${n}-status`:void 0,g=!W||u.kind===`install`||u.kind===`setup-doc`,_=c.cells.projectMcp,v=_===void 0||!M(e)||C(_.consentClass)===r?po(A({agentId:e,mode:r,snapshot:w,detected:a,projectMcp:_})):null;return{status:m?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(So,{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)(Co,{action:u,rowLabel:t,describedById:h,onConfigure:()=>q(e),onRemove:()=>ne(e)}):void 0,hintAction:f&&!W?(0,$.jsx)(wo,{rowLabel:t,onRemove:()=>ne(e)}):void 0,residualFiles:f,statusId:h}},Fe;t[34]===a?Fe=t[35]:(Fe=function(e,t){return a(e===`not-installed`?t?{id:`06Ucfz`}:{id:`5SwVv1`}:t?{id:`V0Jk_K`}:{id:`EDD3UL`})},t[34]=a,t[35]=Fe);let Ie=Fe,Le=function(e,t,n,r,i){if($e(e,r),!r||W||t===void 0||w===null)return;let a=xe.find(e=>e.id===t);a===void 0||!P(a)||F({agentId:t,mode:n,snapshot:w,detected:i})===`not-connected`&&(re.current=e,q(t))},Re;t[36]!==_e||t[37]!==o||t[38]!==s?(Re=function(){_e!==void 0&&le(Ao(_e,o,s))},t[36]=_e,t[37]=o,t[38]=s,t[39]=Re):Re=t[39];let ze=Re,Be;t[40]!==f||t[41]!==ze?(Be=function(e){f.trim()!==``&&e.trim()===``&&ze(),p(e)},t[40]=f,t[41]=ze,t[42]=Be):Be=t[42];let Ve=Be,He;t[43]!==ze||t[44]!==m?(He=function(){m&&ze(),_(!m)},t[43]=ze,t[44]=m,t[45]=He):He=t[45];let Ue=He,We=f.trim().toLowerCase(),Ge=e=>We===``||e.toLowerCase().includes(We),Ke=(_e??[]).filter(e=>Ge(e.name)),qe;t[46]===be?qe=t[47]:(qe=e=>be[e]!==!1,t[46]=be,t[47]=qe);let Je=qe,Ye;t[48]===Je?Ye=t[49]:(Ye=(e,t)=>Number(Je(t))-Number(Je(e))||Ot[e].displayName.localeCompare(Ot[t].displayName),t[48]=Je,t[49]=Ye);let Xe=jt.filter(e=>{let{displayName:t}=Ot[e];return Ge(t)||Ge(a({id:`QYfQdv`,values:{displayName:t}}))||Ge(e)}).sort(Ye),Ze;t[50]!==De||t[51]!==c?(Ze=e=>De(bt(e),c[e]?.installed??null),t[50]=De,t[51]=c,t[52]=Ze):Ze=t[52];let lt=Ze,ut;t[53]===lt?ut=t[54]:(ut=(e,t)=>Number(lt(e.id)===`absent`)-Number(lt(t.id)===`absent`),t[53]=lt,t[54]=ut);let ft=Pt.filter(e=>{let{displayName:t}=e;return Ge(a({id:`CZBqrX`,values:{displayName:t}}))||Ge(e.id)}).sort(ut),mt=u!==null,ht;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(ht=new Set([...ke,...je]),t[55]=ht):ht=t[55];let gt=ht,_t=pt.filter(e=>!gt.has(e)&&Ge(E(e))),vt=We!==``,yt=!oe.isLoading&&!oe.isError,xt=vt&&yt&&Ke.length===0&&Xe.length===0&&ft.length===0&&_t.length===0,St=!vt||oe.isLoading||oe.isError||Ke.length>0,wt=!vt||Xe.length>0,Tt=!vt||ft.length>0||_t.length>0,Et=e=>Oo(o,ve,e),Dt=e=>ue.primaryKeys.has(Do(e)),kt=e=>ue.ranks.get(Do(e))??2**53-1,At=Ke.filter(Dt),Mt=[...vt||m?Ke:At].sort((e,t)=>kt(e)-kt(t)||e.name.localeCompare(t.name)),Nt=vt?0:Ke.length-At.length,Ft=Xe.filter(Je),It=Ft.length>0&&Ft.length<Xe.length,Lt=!It||vt||v?Xe:Ft,Rt=It&&!vt?Xe.length-Ft.length:0,zt;t[56]===lt?zt=t[57]:(zt=e=>lt(e.id)!==`absent`,t[56]=lt,t[57]=zt);let Bt=ft.filter(zt),Vt=_t.filter(e=>De(e,xe.find(t=>t.id===e)?.row.detected??null)!==`absent`),Ht=Bt.length+Vt.length,Ut=ft.length+_t.length,Wt=Ht>0&&Ht<Ut,Gt=!Wt||vt||b,Kt=Gt?ft:Bt,qt=Gt?_t:Vt,Jt=Wt&&!vt?Ut-Ht:0,Yt=!yt||Ke.some(dt),Xt=mt&&Xe.some(Je),Zt;t[58]===c?Zt=t[59]:(Zt=e=>c[e.id]?.installed===!0,t[58]=c,t[59]=Zt);let Qt=ft.some(Zt),$t=St?(0,$.jsx)(yo,{label:a({id:`RXEbZy`}),labelId:`settings-configure-agents-in-app`,children:oe.isLoading?(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-2 px-3 py-6 text-muted-foreground text-sm`,children:[(0,$.jsx)(ri,{className:`size-4`,"aria-hidden":`true`}),a({id:`ucXZ0k`})]}):oe.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)(Ua,{className:`size-5`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:a({id:`FqGWeR`})}),(0,$.jsx)(H,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void oe.refetch(),children:a({id:`6gRgw8`})})]}):(_e?.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:[Mt.map(e=>{let t=Do(e),n=Et(e),r=e.supported?e.description:a({id:`5jEnaB`});return(0,$.jsx)(go,{icon:(0,$.jsx)(ot,{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?(et({source:e.source,id:e.id,name:e.name,supported:e.supported,featured:e.featured,...e.iconUrl===void 0?{}:{iconUrl:e.iconUrl}},{makeDefault:!1}),$e(Y(e.source,e.id),!0)):($e(Y(e.source,e.id),!1),tt(t,e=>at(o,e.source,e.id,!0,e.supported)))}},t)}),(0,$.jsx)(xo,{hiddenCount:Nt,expanded:m,onToggle:Ue,testId:`configure-agents-in-app-show-more`})]})},`in-app`):null,en=wt?(0,$.jsxs)(yo,{label:a({id:`ALhMYW`}),labelId:`settings-configure-agents-terminal`,children:[Lt.map(e=>{let{displayName:t}=Ot[e],n=be[e]??null,r=De(Ct(e),n),i=Qe(o,e,r===`absent`),s=`configure-agents-terminal-row-${e}`,{status:c,action:l,hintAction:u,residualFiles:d,statusId:f}=Pe(Ct(e),a({id:`QYfQdv`,values:{displayName:t}}),s,`terminal`,i,n,r,To(Ct(e))??Ot[e].docsUrl);return(0,$.jsx)(go,{icon:(0,$.jsx)(Rn,{id:ta(e),className:`size-4`,"aria-hidden":`true`}),name:a({id:`QYfQdv`,values:{displayName:t}}),hint:r===`absent`?{text:Ie(`not-installed`,d),action:u}:void 0,status:c,action:l,checked:i,disabled:vo(r,i),ariaLabel:a({id:`27TLNq`,values:{displayName:t}}),testId:`configure-agents-terminal-${e}`,rowTestId:s,statusId:f,onToggle:mt?t=>Le(nt(e),Ct(e),`terminal`,t,be[e]??null):void 0},e)}),(0,$.jsx)(xo,{hiddenCount:Rt,expanded:v,onToggle:()=>y(Lo),testId:`configure-agents-terminal-show-more`})]},`terminal`):null,tn=Tt?(0,$.jsxs)(yo,{label:a({id:`BwKH4d`}),labelId:`settings-configure-agents-desktop`,labelIcon:(0,$.jsx)($n,{"aria-hidden":`true`,className:`size-3`}),children:[Kt.map(e=>{let t=c[e.id]?.installed??null,{displayName:n}=e,r=rt(o,e.id,t),i=De(bt(e.id),t),s=`configure-agents-desktop-row-${e.id}`,{status:l,action:u,hintAction:f,residualFiles:p,statusId:m}=Pe(bt(e.id),a({id:`CZBqrX`,values:{displayName:n}}),s,`external`,r,t,i);return(0,$.jsx)(go,{icon:(0,$.jsx)(Rn,{id:e.id,className:`size-4`,"aria-hidden":`true`}),name:a({id:`CZBqrX`,values:{displayName:n}}),hint:i===`absent`?{text:Ie(`not-installed`,p),action:f}:void 0,status:l,action:(0,$.jsxs)($.Fragment,{children:[u,d===null?null:(0,$.jsx)(_o,{target:e.id,projectDir:d.contentDir,displayName:n},`${d.contentDir}:${e.id}`)]}),checked:r,disabled:vo(i,r),ariaLabel:a({id:`cdBape`,values:{displayName:n}}),testId:`configure-agents-desktop-${e.id}`,rowTestId:s,statusId:m,onToggle:n=>Le(it(e.id),bt(e.id),`external`,n,t)},e.id)}),qt.map(e=>{let t=xe.find(t=>t.id===e)??null,n=t?.row.detected??null,r=E(e),i=De(e,n),a=`agent-connection-${e}`,o=Pe(e,r,a,`external`,t===null||!R(t),n,i);return(0,$.jsx)(go,{icon:(0,$.jsx)(T,{agentId:e,className:`size-4 text-muted-foreground`}),name:r,hint:i===`absent`?{text:Ie(`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)(xo,{hiddenCount:Jt,expanded:b,onToggle:()=>x(Io),testId:`configure-agents-desktop-show-more`})]},`desktop`):null,rn=[{node:$t,hasPresent:Yt},{node:en,hasPresent:Xt},{node:tn,hasPresent:Qt}].sort(Fo).map(Po),an;t[60]===a?an=t[61]:(an=a({id:`lBN3T6`}),t[60]=a,t[61]=an);let on;t[62]===a?on=t[63]:(on=a({id:`D4I0F9`}),t[62]=a,t[63]=on);let sn;t[64]!==an||t[65]!==on?(sn=(0,$.jsx)(Ka,{titleId:`settings-configure-agents-title`,title:an,children:on}),t[64]=an,t[65]=on,t[66]=sn):sn=t[66];let cn;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(cn=(0,$.jsx)(Nn,{className:`-translate-y-1/2 absolute top-1/2 start-2.5 size-4 text-muted-foreground`,"aria-hidden":`true`}),t[67]=cn):cn=t[67];let ln;t[68]===Ve?ln=t[69]:(ln=e=>Ve(e.target.value),t[68]=Ve,t[69]=ln);let un;t[70]===a?un=t[71]:(un=a({id:`-7s4fw`}),t[70]=a,t[71]=un);let dn;t[72]===a?dn=t[73]:(dn=a({id:`-7s4fw`}),t[72]=a,t[73]=dn);let fn;t[74]!==f||t[75]!==ln||t[76]!==un||t[77]!==dn?(fn=(0,$.jsxs)(`div`,{className:`relative`,children:[cn,(0,$.jsx)(Ni,{value:f,onChange:ln,placeholder:un,"aria-label":dn,className:`ps-8`,"data-testid":`configure-agents-search`})]}),t[74]=f,t[75]=ln,t[76]=un,t[77]=dn,t[78]=fn):fn=t[78];let pn;t[79]!==a||t[80]!==W?(pn=W?(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)(di,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{children:a({id:`RD8cCw`})})]}):null,t[79]=a,t[80]=W,t[81]=pn):pn=t[81];let mn;t[82]!==a||t[83]!==V?(mn=V?(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)(Ua,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{role:`status`,children:a({id:`4sE6E9`})})]}),(0,$.jsx)(H,{type:`button`,variant:`outline`,size:`sm`,className:`shrink-0`,onClick:()=>ee(No),children:a({id:`6gRgw8`})})]}):null,t[82]=a,t[83]=V,t[84]=mn):mn=t[84];let hn;t[85]!==a||t[86]!==xt?(hn=xt?(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]=xt,t[87]=hn):hn=t[87];let gn=`configure:${te??`closed`}`,_n;t[88]===te?_n=t[89]:(_n=te!==null&&M(te),t[88]=te,t[89]=_n);let vn=Se!==null,yn;t[90]===re?yn=t[91]:(yn=e=>{e||(re.current!==null&&($e(re.current,!1),re.current=null),q(null))},t[90]=re,t[91]=yn);let bn;t[92]!==Te||t[93]!==Se||t[94]!==re?(bn=(e,t)=>Se===null?Promise.resolve({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null}):Te(O(Se,e,t)).then(e=>(e.ok&&(re.current=null),e)),t[92]=Te,t[93]=Se,t[94]=re,t[95]=bn):bn=t[95];let X;t[96]!==Se||t[97]!==gn||t[98]!==_n||t[99]!==vn||t[100]!==yn||t[101]!==bn?(X=(0,$.jsx)(I,{connection:Se,paired:_n,open:vn,onOpenChange:yn,onSave:bn},gn),t[96]=Se,t[97]=gn,t[98]=_n,t[99]=vn,t[100]=yn,t[101]=bn,t[102]=X):X=t[102];let xn=`remove:${J??`closed`}`,Sn;t[103]===J?Sn=t[104]:(Sn=J!==null&&M(J),t[103]=J,t[104]=Sn);let Cn=Ce!==null,wn;t[105]===Symbol.for(`react.memo_cache_sentinel`)?(wn=e=>{e||ne(null)},t[105]=wn):wn=t[105];let Tn;t[106]!==Te||t[107]!==Ce?(Tn=e=>Ce===null?Promise.resolve({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null}):Te(z(Ce,e===void 0?[]:e)),t[106]=Te,t[107]=Ce,t[108]=Tn):Tn=t[108];let En;t[109]!==Ce||t[110]!==xn||t[111]!==Sn||t[112]!==Cn||t[113]!==Tn?(En=(0,$.jsx)(j,{connection:Ce,paired:Sn,open:Cn,onOpenChange:wn,onRemove:Tn},xn),t[109]=Ce,t[110]=xn,t[111]=Sn,t[112]=Cn,t[113]=Tn,t[114]=En):En=t[114];let Dn;return t[115]!==rn||t[116]!==sn||t[117]!==fn||t[118]!==pn||t[119]!==mn||t[120]!==hn||t[121]!==X||t[122]!==En?(Dn=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-configure-agents-title`,className:`space-y-6`,"data-field":`section:agent-connections`,"data-testid":`settings-configure-agents`,children:[sn,fn,pn,mn,hn,rn,X,En]}),t[115]=rn,t[116]=sn,t[117]=fn,t[118]=pn,t[119]=mn,t[120]=hn,t[121]=X,t[122]=En,t[123]=Dn):Dn=t[123],Dn}function No(e){return e+1}function Po(e){return e.node}function Fo(e,t){return Number(t.hasPresent)-Number(e.hasPresent)}function Io(e){return!e}function Lo(e){return!e}function Ro(e){return e!==void 0}function zo(e){return bt(e.id)}function Bo(e){return e!==void 0}function Vo(e){return Do(e)}function Ho(e){let{signal:t}=e;return ut(t)}var Uo=`open-knowledge-app`;function Wo({from:e,to:t}){try{bn.getTracer(Uo).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 Go=`open-knowledge-app`;function Ko(e){let t=e.light.startsWith(`saved-`),n=e.dark.startsWith(`saved-`);return!t||!n?`incomplete`:e.light===e.dark?`same`:`different`}function qo(e){try{bn.getTracer(Go).startSpan(`ok.saved_themes.assignment`,{attributes:{"saved_theme.pair":Ko(e)}}).end()}catch(e){console.warn(`[saved-theme-telemetry] assignment span emit failed:`,e instanceof Error?e:String(e))}}var Jo=`system`;function Yo(e){return typeof e==`string`&&gn.includes(e)}function Xo(e){return Yo(e)?e:Jo}function Zo(e){return new Intl.DisplayNames([e],{type:`language`}).of(e)??e}function Qo(e){let t=(0,Q.c)(6),{choice:n}=e;if(n===Jo){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=Zo(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 $o(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=Xo(o),t[6]=o,t[7]=s);let c=s,l;t[8]===r?l=t[9]:(l=e=>r(Xo(e)),t[8]=r,t[9]=l);let u;t[10]===c?u=t[11]:(u=(0,$.jsx)(We,{children:(0,$.jsx)(Qo,{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)(Ue,{...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)(He,{children:[(0,$.jsx)(Ve,{value:Jo,children:(0,$.jsx)(Qo,{choice:Jo})}),ln.map(es)]}),t[17]=f):f=t[17];let p;return t[18]!==c||t[19]!==l||t[20]!==d?(p=(0,$.jsxs)(Ge,{value:c,onValueChange:l,children:[d,f]}),t[18]=c,t[19]=l,t[20]=d,t[21]=p):p=t[21],p}function es(e){return(0,$.jsx)(Ve,{value:e,children:(0,$.jsx)(Qo,{choice:e})},e)}function ts(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 ns(e,t,n){return e.id===`custom`?ts(Zt(qi(t))):e.scheme?ts(Zt(e.scheme)):ts(Vi(n))}function rs(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=ns(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(is),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 is(e,t){return(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{backgroundColor:e}},t)}function as(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 os(e){return b(`size-3.5`,e&&`fill-current`)}function ss(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?an: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)(H,{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)(rs,{theme:e,customSeed:u,slotMode:y})}),l?(0,$.jsx)(H,{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)(ui,{"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)(Xe,{className:as(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)(Pn,{className:`size-3.5`})}):null,(0,$.jsx)(Xe,{id:t===0?d:void 0,className:as(r),pressed:r,onPressedChange:t=>{t&&a(`light`,e.id)},"aria-label":x({id:`sq4WQH`,values:{0:e.label}}),children:(0,$.jsx)(ii,{className:os(r)})}),(0,$.jsx)(Xe,{className:as(i),pressed:i,onPressedChange:t=>{t&&a(`dark`,e.id)},"aria-label":x({id:`lZvQrY`,values:{0:e.label}}),children:(0,$.jsx)(ai,{className:os(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)(H,{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 w;t[24]===v?w=t[25]:(w=v.map(cs),t[24]=v,t[25]=w);let T;return t[26]!==p||t[27]!==m||t[28]!==f||t[29]!==S||t[30]!==C||t[31]!==w?(T=(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,w]}),t[26]=p,t[27]=m,t[28]=f,t[29]=S,t[30]=C,t[31]=w,t[32]=T):T=t[32],T}function cs(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)(ir,{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 ls=12e3;function us(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}=Ai(),[_,v]=(0,Z.useState)(!1),[y,b]=(0,Z.useState)(``),[x,S]=(0,Z.useState)(null),[C,w]=(0,Z.useState)(!1),T=(0,Z.useRef)(null),E,D;t[4]===u?(E=t[5],D=t[6]):(E=()=>{u()},D=[u],t[4]=u,t[5]=E,t[6]=D),(0,Z.useEffect)(E,D);let O;t[7]!==n||t[8]!==o?(O=Dt(n,o),t[7]=n,t[8]=o,t[9]=O):O=t[9];let k=O,A,j,M,N,P,F,I,L,R,z,B,V,U,W,G,K,ee,te,q,J,ne;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]!==k||t[24]!==m||t[25]!==o||t[26]!==c||t[27]!==s){let e=$t(y),n;t[49]===o?n=t[50]:(n=o.filter(hs),t[49]=o,t[50]=n);let h=n,E,D,O,re,ie,ae,oe,se,ce;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]!==k||t[64]!==m||t[65]!==o||t[66]!==c||t[67]!==s){let e=o.flatMap(ms),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;O=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:ls,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]!==k||t[93]!==o?(x=async function(e){if(e.preventDefault(),C)return;let t=$t(y);if(!t.ok){S(a({id:`RG3yW6`})),T.current?.focus();return}let n=i.slotMode??`light`,s=o.find(e=>e.id===k[n])?.scheme??qi(i.customSeed),c={name:t.name,variant:s.variant,palette:{...s.palette}};S(null),w(!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`})),w(!1),T.current?.focus();return}let d={id:l.id,label:c.name,kind:c.variant,scheme:c,toTokens:()=>Zt(c)};r(n,l.id,k,[...o,d]),await u(),b(``),v(!1),w(!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]=k,t[93]=o,t[94]=x):x=t[94],D=x;let A;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),A=s.map(e),t[95]=a,t[96]=s,t[97]=A}else A=t[97];let j=A;V=`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)(H,{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 M;t[104]!==a||t[105]!==c?(M=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)(di,{"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]=M):M=t[106],t[107]===M?W=t[108]:(W=(0,$.jsx)(`div`,{role:`status`,children:M}),t[107]=M,t[108]=W),E=ss,ie=i,ae=k,oe=h,se=j;let N;t[109]===o?N=t[110]:(N=o.filter(ps).map(fs),t[109]=o,t[110]=N);let P=m?p:null;t[111]!==g||t[112]!==N||t[113]!==P?(ce={themeIds:N,selectedId:P,onSelect:g},t[111]=g,t[112]=N,t[113]=P,t[114]=ce):ce=t[114],re=e.map(ds),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]=k,t[64]=m,t[65]=o,t[66]=c,t[67]=s,t[68]=E,t[69]=D,t[70]=O,t[71]=V,t[72]=U,t[73]=W,t[74]=re,t[75]=ie,t[76]=ae,t[77]=oe,t[78]=se,t[79]=ce}else E=t[68],D=t[69],O=t[70],V=t[71],U=t[72],W=t[73],re=t[74],ie=t[75],ae=t[76],oe=t[77],se=t[78],ce=t[79];let le;t[115]!==O||t[116]!==re?(le={themeIds:re,onDelete:O},t[115]=O,t[116]=re,t[117]=le):le=t[117];let ue;t[118]===Symbol.for(`react.memo_cache_sentinel`)?(ue={onCreate:()=>v(!0)},t[118]=ue):ue=t[118];let de;t[119]!==r||t[120]!==k||t[121]!==o?(de=(e,t)=>r(e,t,k,o),t[119]=r,t[120]=k,t[121]=o,t[122]=de):de=t[122],t[123]!==E||t[124]!==ie||t[125]!==ae||t[126]!==oe||t[127]!==se||t[128]!==ce||t[129]!==le||t[130]!==de?(G=(0,$.jsx)(E,{...ie,selection:ae,themes:oe,unavailableThemes:se,editControl:ce,deleteControl:le,createControl:ue,onAssign:de}),t[123]=E,t[124]=ie,t[125]=ae,t[126]=oe,t[127]=se,t[128]=ce,t[129]=le,t[130]=de,t[131]=G):G=t[131],P=xi,z=_,t[132]===C?B=t[133]:(B=e=>{C||v(e)},t[132]=C,t[133]=B),N=gi;let fe;t[134]===a?fe=t[135]:(fe=a({id:`Z_nNa2`}),t[134]=a,t[135]=fe);let pe;t[136]===fe?pe=t[137]:(pe=(0,$.jsx)(hi,{children:fe}),t[136]=fe,t[137]=pe);let me;t[138]===a?me=t[139]:(me=a({id:`nTM8ab`}),t[138]=a,t[139]=me);let he;t[140]===me?he=t[141]:(he=(0,$.jsx)(mi,{children:me}),t[140]=me,t[141]=he),t[142]!==pe||t[143]!==he?(R=(0,$.jsxs)(bi,{className:`gap-2`,children:[pe,he]}),t[142]=pe,t[143]=he,t[144]=R):R=t[144],M=_i,F=`create-saved-theme-form`,I=!0,L=D,j=Ti,q=x!==null;let ge;t[145]===a?ge=t[146]:(ge=a({id:`HZ7fEu`}),t[145]=a,t[146]=ge),t[147]===ge?J=t[148]:(J=(0,$.jsx)(Ci,{htmlFor:`create-saved-theme-name`,children:ge}),t[147]=ge,t[148]=J);let _e=x!==null,ve=x?`create-saved-theme-help create-saved-theme-error`:`create-saved-theme-help`,ye;t[149]===x?ye=t[150]:(ye=e=>{b(e.target.value),x&&S(null)},t[149]=x,t[150]=ye),t[151]!==y||t[152]!==C||t[153]!==_e||t[154]!==ve||t[155]!==ye?(ne=(0,$.jsx)(Ni,{ref:T,id:`create-saved-theme-name`,value:y,autoFocus:!0,autoComplete:`off`,required:!0,readOnly:C,"aria-invalid":_e,"aria-describedby":ve,onChange:ye}),t[151]=y,t[152]=C,t[153]=_e,t[154]=ve,t[155]=ye,t[156]=ne):ne=t[156],A=wi,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]=k,t[24]=m,t[25]=o,t[26]=c,t[27]=s,t[28]=A,t[29]=j,t[30]=M,t[31]=N,t[32]=P,t[33]=F,t[34]=I,t[35]=L,t[36]=R,t[37]=z,t[38]=B,t[39]=V,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]=ne}else A=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],U=t[40],W=t[41],G=t[42],K=t[43],ee=t[44],te=t[45],q=t[46],J=t[47],ne=t[48];let re;t[157]!==A||t[158]!==K||t[159]!==ee||t[160]!==te?(re=(0,$.jsx)(A,{id:K,className:ee,children:te}),t[157]=A,t[158]=K,t[159]=ee,t[160]=te,t[161]=re):re=t[161];let ie;t[162]===x?ie=t[163]:(ie=x?(0,$.jsx)(Si,{id:`create-saved-theme-error`,children:x}):null,t[162]=x,t[163]=ie);let ae;t[164]!==j||t[165]!==re||t[166]!==ie||t[167]!==q||t[168]!==J||t[169]!==ne?(ae=(0,$.jsxs)(j,{"data-invalid":q,children:[J,ne,re,ie]}),t[164]=j,t[165]=re,t[166]=ie,t[167]=q,t[168]=J,t[169]=ne,t[170]=ae):ae=t[170];let oe;t[171]!==F||t[172]!==I||t[173]!==L||t[174]!==ae?(oe=(0,$.jsx)(`form`,{id:F,noValidate:I,onSubmit:L,children:ae}),t[171]=F,t[172]=I,t[173]=L,t[174]=ae,t[175]=oe):oe=t[175];let se;t[176]!==M||t[177]!==oe?(se=(0,$.jsx)(M,{children:oe}),t[176]=M,t[177]=oe,t[178]=se):se=t[178];let ce;t[179]===Symbol.for(`react.memo_cache_sentinel`)?(ce=()=>v(!1),t[179]=ce):ce=t[179];let le;t[180]===a?le=t[181]:(le=a({id:`dEgA5A`}),t[180]=a,t[181]=le);let ue;t[182]!==C||t[183]!==le?(ue=(0,$.jsx)(H,{type:`button`,variant:`outline`,disabled:C,onClick:ce,children:le}),t[182]=C,t[183]=le,t[184]=ue):ue=t[184];let de;t[185]!==a||t[186]!==C?(de=a(C?{id:`_DwR-n`}:{id:`cuHhjo`}),t[185]=a,t[186]=C,t[187]=de):de=t[187];let fe;t[188]!==C||t[189]!==de?(fe=(0,$.jsx)(H,{type:`submit`,form:`create-saved-theme-form`,disabled:C,children:de}),t[188]=C,t[189]=de,t[190]=fe):fe=t[190];let pe;t[191]!==ue||t[192]!==fe?(pe=(0,$.jsxs)(vi,{children:[ue,fe]}),t[191]=ue,t[192]=fe,t[193]=pe):pe=t[193];let me;t[194]!==N||t[195]!==R||t[196]!==se||t[197]!==pe?(me=(0,$.jsxs)(N,{children:[R,se,pe]}),t[194]=N,t[195]=R,t[196]=se,t[197]=pe,t[198]=me):me=t[198];let he;t[199]!==P||t[200]!==z||t[201]!==B||t[202]!==me?(he=(0,$.jsx)(P,{open:z,onOpenChange:B,children:me}),t[199]=P,t[200]=z,t[201]=B,t[202]=me,t[203]=he):he=t[203];let ge;return t[204]!==V||t[205]!==U||t[206]!==W||t[207]!==G||t[208]!==he?(ge=(0,$.jsxs)(`div`,{className:V,children:[U,W,G,he]}),t[204]=V,t[205]=U,t[206]=W,t[207]=G,t[208]=he,t[209]=ge):ge=t[209],ge}function ds(e){return e.id}function fs(e){return e.id}function ps(e){return e.id.startsWith(`saved-`)}function ms(e){let t=Mt(e.id);return!t.ok||!e.scheme?[]:[{id:e.id,stem:t.stem,label:e.label,scheme:e.scheme}]}function hs(e){return e.id!==`custom`}function gs(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)]:gs(r,t)}}function _s(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 vs(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 ys(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 bs(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=Ta(i),o,s;t[4]!==e||t[5]!==a?(o=()=>e.subscribe(e=>{xs(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=>Ss(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 xs(e,t){e.reset(t,{keepDirtyValues:!0,keepDirty:!0,keepTouched:!0})}function Ss(e,t,n){let r=e.getValues(n),i=gs(Ts(n),r),a=t.patch(i);if(a.ok)return e.clearErrors(n),e.resetField(n,{defaultValue:r,keepError:!1}),!0;if(vt(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:Cs(a.error,n)});return!1}function Cs(e,t){if(vt(e)&&e.code===`SCHEMA_INVALID`){let n=e.issues.find(e=>ws(e,t));if(n)return n.message}return _n(e)}function ws(e,t){return e.path.map(String).join(`.`)===t}function Ts(e){return e.split(`.`)}function Es(e){if(!vt(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 Ds(){let e=(0,Q.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(ra,{className:`h-5 w-32`}),n=(0,$.jsx)(ra,{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)(ra,{className:`h-9 w-full`}),(0,$.jsx)(ra,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function Os({field:e,scope:t,commitField:n,isFlashed:r}){"use no memo";let{_:i}=h(),a=ka(),{setTheme:o}=_(),s=Fn(),c=It(St,e.path),l=c?vs(c):void 0,u=c?_s(c):void 0,d=c?ys(c):void 0,f=c?Kt(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)},w=()=>{let e=n(g);return e&&C(),e},T=()=>a.getFieldState(g).isDirty?w():!0,E=()=>{if(e.control===`theme-tiles`){let e=s?.userBinding;if(!e)return;let t=e.patch({appearance:Bi()});t.ok?C():a.setError(g,{type:`manual`,message:Cs(t.error,g)});return}let t=u===void 0?null:u;a.setValue(g,t,{shouldDirty:!1}),e.control===`theme-cards`&&o(Ln(t)),w()},D=b(`relative`,r&&`animate-settings-flash`);return(0,$.jsx)(Ea,{control:a.control,name:g,render:({field:n})=>{let r=!p&&(u!==void 0||n.value!==void 0);return(0,$.jsxs)(wa,{className:D,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(Oa,{className:`text-sm font-medium`,children:v}),r?(0,$.jsxs)(K,{children:[(0,$.jsx)(U,{asChild:!0,children:(0,$.jsx)(H,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:E,"aria-label":i({id:`lhjq3G`,values:{labelText:v}}),children:(0,$.jsx)(si,{className:`size-3.5`})})}),(0,$.jsx)(W,{children:(0,$.jsx)(m,{id:`L-rMC9`})})]}):null]}),e.description?(0,$.jsx)(Aa,{className:`text-muted-foreground text-1sm`,children:i(e.description)}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Da,{children:(0,$.jsx)(As,{field:e,ctl:n,typeTag:l,enumOptions:d,onCommit:T,onRevertToBaseline:()=>a.resetField(g,{keepError:!0}),onSavedOutsideForm:C,onWriteRejected:e=>{a.setError(g,{type:`manual`,message:Cs(e,g)})}})}),(0,$.jsx)(Ps,{visible:y,srOnly:ks(e.control)})]}),(0,$.jsx)(ja,{"data-field-error":e.path.join(`.`)})]})}})}function ks(e){return e===`theme-tiles`||e===`theme-cards`}function As({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=Fn(),p=f?.merged??null;if(e.control===`language-select`)return(0,$.jsx)($o,{...c,value:t.value,ref:t.ref,onBlur:t.onBlur,onValueChange:e=>{let n=Ji(t.value)??`system`;n!==e&&Wo({from:n,to:e}),t.onChange(e),i()}});if(e.control===`theme-cards`){let{id:n,...r}=c;return(0,$.jsx)(oi,{...r,firstItemId:n,value:Ln(t.value),"aria-label":l(e.label),onValueChange:e=>{let n=Ln(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=ht(i,d===`dark`);return(0,$.jsx)(us,{...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`?Ui(qi(r)):zi(t,c)};Ri({selection:d,modePreference:i,slotMode:a,customSeed:r,themes:c}),u(p(d)??i??`system`);let m=l.patch({appearance:Wi(d)});if(m.ok){qo(d),o();return}Ri({selection:n,modePreference:i,slotMode:a,customSeed:r,themes:c}),u(p(n)??i??`system`),s(m.error)}})}if(n===`boolean`)return(0,$.jsx)(Je,{...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)(Ze,{...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)(Ye,{value:e,id:t===0?n:void 0,className:`text-1sm capitalize`,children:e},e))})}return n===`number`||n===`int`?(0,$.jsx)(Ms,{ctl:t,onCommit:i,...c}):n===`array`?(0,$.jsx)(Ns,{ctl:t,onCommit:i,...c}):(0,$.jsx)(js,{ctl:t,onCommit:i,...c})}function js({ctl:e,onCommit:t,...n}){"use no memo";return(0,$.jsx)(Ni,{...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 Ms({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)(Ni,{...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 Ns({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,Sr as a,at as o,dt as s,gi as c,lt as l,st as u,ut as d,z as f}from"./DocumentContext-CjYhWoGU.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{S as x,_ as S,a as C,b as w,c as T,d as E,f as D,g as O,h as k,i as A,l as j,m as M,o as N,p as P,r as F,s as I,t as L,u as R,v as z,x as B,y as V}from"./agent-connections-0X_wM1D5.js";import{t as H}from"./button-BeFNZANd.js";import{i as U,n as W,r as G,t as K}from"./tooltip-DVBVVaAs.js";import{n as ee,r as te,t as q}from"./collapsible-DYySK8La.js";import{a as J,c as ne,i as re,l as ie,n as ae,o as oe,r as se,s as ce,t as le}from"./alert-dialog-CqqfqWNT.js";import{n as ue,t as de}from"./with-selector-PRoyWQiu.js";import{t as fe}from"./checkbox-Crs_F_Np.js";import{A as pe,C as me,D as he,E as ge,O as _e,S as ve,T as ye,_ as be,b as xe,f as Se,g as Ce,h as we,j as Te,k as Ee,m as De,p as Oe,r as ke,v as Ae,w as je,x as Me,y as Ne}from"./floating-ui.dom-CDtYEnEj.js";import{c as Pe,d as Fe,l as Ie,o as Le,s as Re,u as ze}from"./dist-DYso7MCm.js";import{t as Be}from"./label-D-K3fWtj.js";import{i as Ve,n as He,o as Ue,s as We,t as Ge}from"./select-D_BhUvh8.js";import{n as Ke,t as qe}from"./radio-group-npdxiS6E.js";import{t as Je}from"./switch-iwBsEWej.js";import{n as Ye,r as Xe,t as Ze}from"./toggle-group-BxIyZnUJ.js";import{a as Qe,c as $e,g as et,h as tt,l as nt,n as rt,o as it,r as at,s as Y,t as ot,u as st,y as ct}from"./RegisteredAgentIcon-CcvblzpC.js";import{a as lt,i as ut,o as dt}from"./terminal-telemetry-C6TBDBsx.js";import{$o as ft,Ac as pt,As as mt,Bs as ht,Ci as gt,Cn as _t,Cs as vt,Es as yt,Fc as bt,Gc as xt,Go as St,Ic as Ct,Is as wt,Jc as Tt,Jo as Et,Ls as Dt,Mc as Ot,Mr as kt,Ms as At,Nc as jt,Ns as Mt,Ot as Nt,Pc as Pt,Qs as Ft,Rs as It,Tc as Lt,Un as Rt,Uo as zt,Wo as Bt,Xn as Vt,Xo as Ht,Yo as Ut,Ys as Wt,Zc as Gt,_s as Kt,as as qt,ba as Jt,cs as Yt,fi as Xt,fs as Zt,gi as Qt,gs as $t,is as en,js as tn,kc as nn,ks as rn,ls as an,ms as on,mt as sn,nl as cn,os as ln,ot as un,ps as dn,pt as fn,qo as pn,qs as mn,rs as hn,ss as gn,vs as _n,wn as vn,zs as yn}from"./dist-DTxb76k4.js";import{t as bn}from"./trace-api-BP9dN1Hz.js";import{n as X}from"./dist-CJhtNlOm2.js";import{d as xn,f as Sn,h as Cn,n as wn,o as Tn,p as En,r as Dn,u as On,v as kn}from"./use-settings-route-CAshJWbw.js";import{t as An}from"./dist-Cr4-nBVI.js";import{c as jn}from"./documents-events-DLvhFUkq.js";import{a as Mn,i as Nn,o as Pn}from"./local-menu-action-bus-DaoT7_kL.js";import{a as Fn,i as In,t as Ln}from"./use-apply-config-theme-B5w38X1P.js";import{t as Rn}from"./OpenInAgentMenuItem-D8NEKdSX.js";import{g as zn,h as Bn,p as Vn,v as Hn,y as Un}from"./SkillInstallMenu-sgeehwe1.js";import{t as Wn}from"./createLucideIcon-B6ULg5PN.js";import{a as Gn,c as Kn,f as qn,l as Jn,p as Yn,s as Xn,t as Zn}from"./EnableSyncConfirmDialog-bbbliDE7.js";import{p as Qn}from"./Mermaid-DZf1Vjbg.js";import{t as $n}from"./arrow-up-right-B3B9a7te.js";import{t as er}from"./check-BzfGb3KU.js";import{t as tr}from"./chevron-right-C-g4JuT4.js";import{n as nr,t as rr}from"./lint-plugin-meta-zA9wHIBR.js";import{t as ir}from"./circle-alert-Czw40trT.js";import{i as ar,r as or}from"./prop-types-BaGWFLYl.js";import{a as sr,h as cr,r as lr,t as ur}from"./dropdown-menu-BEhl0wvu.js";import{A as dr,B as fr,C as pr,F as mr,G as hr,H as gr,J as _r,K as vr,L as yr,M as br,N as xr,O as Sr,P as Cr,Q as wr,R as Tr,S as Er,U as Dr,V as Or,W as kr,Y as Ar,at as jr,b as Mr,c as Nr,d as Pr,et as Fr,f as Ir,h as Lr,i as Rr,j as zr,k as Br,l as Vr,m as Hr,n as Ur,nt as Wr,o as Gr,p as Kr,q as qr,v as Jr,w as Yr,x as Xr,y as Zr}from"./auth-state-cache-BU4ajCHf.js";import{It as Qr}from"./CodeMirrorPropInput-BJDU0-70.js";import{r as $r,t as ei}from"./use-git-sync-status-DrkQ-euc.js";import{o as ti}from"./folder-config-api-Cz9BQmTR.js";import{t as ni}from"./info-CilGMBpP.js";import{t as ri}from"./spinner-Bp2_BYkl.js";import{n as ii,r as ai,t as oi}from"./ThemePicker-wGe4WU58.js";import{t as si}from"./rotate-ccw-B05K_aam.js";import{t as ci}from"./square-pen-BhqhPrdL.js";import{t as li}from"./terminal-DGmaW797.js";import{t as ui}from"./trash-2-B9Flu-41.js";import{t as di}from"./triangle-alert-CCeXtPLU.js";import{t as fi}from"./x-DIayTyoR.js";import{t as pi}from"./badge-5sA3wpe0.js";import{a as mi,c as hi,i as gi,n as _i,o as vi,r as yi,s as bi,t as xi}from"./dialog-DJkPMmCN.js";import{i as Si,o as Ci,r as wi,t as Ti}from"./field-BmnhqmEH.js";import{t as Ei}from"./tool-list-format-BVkGh5Od.js";import{n as Di}from"./use-workspace-ByLGR16G.js";import{d as Oi}from"./doc-paths-VPO39t4f.js";import{a as ki}from"./startup-marks-BxUZHKOy.js";import{n as Ai}from"./config-provider-D06S8HhQ.js";import{a as ji}from"./skill-scope-bxDiQshW.js";import{m as Mi}from"./skills-api-BaxUiF2f.js";import{t as Ni}from"./input-3o4m6NnP.js";import{a as Pi,i as Fi,t as Ii}from"./popover-DwsSVA7z.js";import{_ as Li,a as Ri,d as zi,f as Bi,g as Vi,h as Hi,m as Ui,p as Wi,u as Gi,v as Ki,y as qi}from"./css-color-to-hex-X_ubtbg_.js";import{n as Ji}from"./use-apply-config-language-BA8pb8bB.js";import{t as Yi}from"./external-link-DCF8KwVP.js";import{t as Xi}from"./ConfigSharingInfoTooltip-CF-B970o.js";import{t as Zi}from"./use-skills-DT7KgjWD.js";import{o as Qi,s as $i,t as ea}from"./use-open-skill-DcSc5W3j.js";import{r as ta,t as na}from"./DeleteConfirmationDialog-_4ZcQ_WU.js";import{t as ra}from"./skeleton-C6CemrJA.js";import{d as ia,n as aa,r as oa,t as sa,u as ca}from"./lint-config-client-ShgapJqD.js";import{_ as la,a as ua,d as da,f as fa,g as pa,h as ma,i as ha,o as ga,s as _a,t as va,u as ya}from"./sortable.esm-Dd5xvHIC.js";import{t as ba}from"./textarea-CKTD258L.js";import{i as xa,n as Sa,t as Ca}from"./input-group-Bp9yqbay.js";import{a as wa,f as Ta,i as Ea,n as Da,o as Oa,p as ka,r as Aa,s as ja,t as Ma}from"./form-CEg9p5Rf.js";import{r as Na,t as Pa}from"./terminal-command-events-Orubep-S.js";import{t as Fa}from"./tag-pill-input-dKjZE88k.js";import{t as Ia}from"./markdownlint-rule-browser-BiJOQswX.js";import{n as La}from"./schema-fields-view-intent-BhBMXWR3.js";import{n as Ra,t as za}from"./use-terminal-enabled-C1s8vXrb.js";var Ba=Wn(`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`}]]),Va=Wn(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Ha=Wn(`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`}]]),Ua=Wn(`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 Wa(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(pi,{variant:`gray`,children:(0,$.jsx)(m,{id:`YBt9YP`})}),e[0]=t):t=e[0],t}function Ga(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)(U,{asChild:!0,children:(0,$.jsx)(pi,{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)(W,{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)(G,{children:(0,$.jsxs)(K,{children:[a,o]})}),t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function Ka(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)(Wa,{}):null,t[7]=o,t[8]=v);let y;t[9]===i?y=t[10]:(y=i?(0,$.jsx)(Ga,{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=>Yi(e,c),onAuxClick:e=>Yi(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)($n,{"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 qa=`settings-sharing-title`;function Ja(){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)(Ya,{}):(0,$.jsx)(Xa,{}),e[0]=n):n=e[0],n}function Ya(){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":qa,className:`space-y-3`,"data-field":`section:sharing`,children:(0,$.jsx)(Ka,{titleId:qa,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 Xa(){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(Qa)}},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)(Ka,{titleId:qa,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":qa,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)(ra,{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)(Ka,{titleId:qa,title:_,scope:`project`,level:`block`,adornment:(0,$.jsx)(Xi,{}),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)(qe,{value:n.mode,onValueChange:e=>void p(e),disabled:i,className:`gap-2`,"aria-labelledby":qa,"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)(Ke,{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)(Ke,{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)(H,{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(Za)}),(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":qa,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 Za(e){return(0,$.jsx)(`li`,{children:e},e)}function Qa(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[]}}var $a=`[a-z0-9](?:[a-z0-9-]*[a-z0-9])?`,eo=RegExp(`^${$a}(?:\\.${$a})*$`),to=/^[a-z][a-z0-9+.-]*:\/\//i;function no(e){if(to.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 ro(e,t){let n=e.trim();if(n===``)return{ok:!1,reason:`empty`};let r=no(n);if(r===null||r===``)return{ok:!1,reason:`invalid`};let i=tn(r);return eo.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 io(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 ao(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=()=>io(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 w,T;t[6]===n?(w=t[7],T=t[8]):(w=()=>n.subscribe(e=>c(io(e))),T=[n],t[6]=n,t[7]=w,t[8]=T),(0,Z.useEffect)(w,T);let E;t[9]===r?E=t[10]:(E=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]=E);let D=E,O;t[11]!==n||t[12]!==l||t[13]!==s||t[14]!==D?(O=function(e){e.preventDefault();let t=ro(l,new Set(s.map(oo)));if(!t.ok){f(D(t.reason));return}let r=n.patch({git:{hosts:{[t.host]:{provider:`github`}}}});if(!r.ok){f(_n(r.error));return}c(io(r.effective)),u(``),f(null),g(!0)},t[11]=n,t[12]=l,t[13]=s,t[14]=D,t[15]=O):O=t[15];let k=O,A;t[16]!==n||t[17]!==s?(A=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(_n(i.error));return}c(io(i.effective)),v({host:r}),f(null),g(!0)},t[16]=n,t[17]=s,t[18]=A):A=t[18];let j=A,M;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(`h4`,{id:`settings-enterprise-hosts-title`,className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`J2-D_a`})}),t[19]=M):M=t[19];let N;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(m,{id:`PgY2nN`}),t[20]=N):N=t[20];let P;t[21]===i?P=t[22]:(P=(0,$.jsxs)(`div`,{children:[M,(0,$.jsx)(`p`,{id:i,className:`text-1sm text-muted-foreground`,children:N})]}),t[21]=i,t[22]=P);let F;t[23]!==r||t[24]!==j||t[25]!==s?(F=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)(H,{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:()=>j(e),children:(0,$.jsx)(ui,{"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]=j,t[25]=s,t[26]=F):F=t[26];let I;t[27]===r?I=t[28]:(I=r({id:`Qbf7Q4`}),t[27]=r,t[28]=I);let L=d!==null,R=d===null?i:`${i} ${a}`,z;t[29]===d?z=t[30]:(z=e=>{u(e.target.value),d!==null&&f(null)},t[29]=d,t[30]=z);let B;t[31]!==l||t[32]!==I||t[33]!==L||t[34]!==R||t[35]!==z?(B=(0,$.jsx)(Ni,{ref:x,value:l,"aria-label":I,placeholder:`github.example.com`,autoComplete:`off`,spellCheck:!1,inputMode:`url`,className:`h-7 flex-1 font-mono text-xs`,"aria-invalid":L,"aria-describedby":R,onChange:z}),t[31]=l,t[32]=I,t[33]=L,t[34]=R,t[35]=z,t[36]=B):B=t[36];let V;t[37]===l?V=t[38]:(V=l.trim(),t[37]=l,t[38]=V);let U=V===``,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)(H,{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]!==k||t[43]!==B||t[44]!==G?(K=(0,$.jsxs)(`form`,{className:`flex items-center gap-2 pt-1`,onSubmit:k,noValidate:!0,children:[B,G]}),t[42]=k,t[43]=B,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]!==F||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:[F,K,ee,te]}),t[51]=F,t[52]=K,t[53]=ee,t[54]=te,t[55]=q):q=t[55];let J;return t[56]!==P||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:[P,q]}),t[56]=P,t[57]=q,t[58]=J):J=t[58],J}function oo(e){return tn(e)}function so(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??wr(),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}),Ur(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 w;t[8]!==a||t[9]!==x||t[10]!==s?(w=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]=w):w=t[11];let T=w,E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(m,{id:`AeXO77`}),t[12]=E):E=t[12];let D;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(Ka,{titleId:`settings-account-title`,title:E,scope:`user`,children:(0,$.jsx)(m,{id:`E6lrpp`})}),t[13]=D):D=t[13];let O;t[14]!==_||t[15]!==p||t[16]!==T||t[17]!==x||t[18]!==l.phase||t[19]!==l.result?(O=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)(ra,{className:`h-4 w-40`}),(0,$.jsx)(ra,{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)(H,{variant:`outline`,size:`sm`,onClick:()=>void x(),children:(0,$.jsx)(m,{id:`KDw4GX`})})]}):l.result.authenticated?l.result.tier===`A`?(0,$.jsx)(lo,{login:l.result.login}):(0,$.jsx)(co,{login:l.result.login,disconnecting:p,error:_,onDisconnect:()=>void T()}):l.result.unsupportedOrigin===void 0?(0,$.jsx)(fo,{onConnect:()=>f(!0)}):(0,$.jsx)(uo,{host:l.result.unsupportedOrigin.host}),t[14]=_,t[15]=p,t[16]=T,t[17]=x,t[18]=l.phase,t[19]=l.result,t[20]=O):O=t[20];let k;t[21]===i?k=t[22]:(k=(0,$.jsx)(ao,{binding:i}),t[21]=i,t[22]=k);let A;t[23]===x?A=t[24]:(A=e=>{f(e),e||x()},t[23]=x,t[24]=A);let j=l.phase===`loaded`?l.result.host:void 0,M=l.phase===`loaded`?l.result.ghAvailable:void 0,N;t[25]===x?N=t[26]:(N=()=>{x()},t[25]=x,t[26]=N);let P;t[27]!==d||t[28]!==r||t[29]!==A||t[30]!==j||t[31]!==M||t[32]!==N?(P=(0,$.jsx)(Ar,{open:d,onOpenChange:A,transport:r,host:j,ghAvailable:M,onSuccess:N}),t[27]=d,t[28]=r,t[29]=A,t[30]=j,t[31]=M,t[32]=N,t[33]=P):P=t[33];let F;return t[34]!==k||t[35]!==P||t[36]!==O?(F=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-3`,"data-testid":`settings-account`,children:[D,O,k,P]}),t[34]=k,t[35]=P,t[36]=O,t[37]=F):F=t[37],F}function co(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)(H,{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 lo(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 uo(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 fo(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)(H,{onClick:n,"data-testid":`settings-account-connect`,children:a})]})}),t[3]=n,t[4]=o),o}function po(e){if(e===void 0)return null;let t=e.params?.agent;if(typeof t!=`string`)return null;let n=cn[t]??t;return e.id===`followup.enable-manually`?An._({id:`followup.enable-manually`,values:{agent:n}}):null}function mo(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 ho(e){return e.presence===`absent`&&e.installedCount>0}function go(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)(Je,{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 _o(e){let t=(0,Q.c)(15),{target:n,projectDir:r,displayName:i}=e,{_:a}=h(),o;t[0]!==r||t[1]!==n?(o=()=>Un(n,r),t[0]=r,t[1]=n,t[2]=o):o=t[2];let[s,c]=(0,Z.useState)(o);if(!s)return null;let l;t[3]!==a||t[4]!==i?(l=a({id:`jIWP0P`,values:{displayName:i}}),t[3]=a,t[4]=i,t[5]=l):l=t[5];let u;t[6]!==r||t[7]!==n?(u=()=>{Hn(n,r,!1),c(Un(n,r))},t[6]=r,t[7]=n,t[8]=u):u=t[8];let d;t[9]===a?d=t[10]:(d=a({id:`LhVIxY`}),t[9]=a,t[10]=d);let f;return t[11]!==l||t[12]!==u||t[13]!==d?(f=(0,$.jsx)(H,{variant:`ghost`,size:`sm`,className:`shrink-0 font-mono uppercase`,"aria-label":l,onClick:u,children:d}),t[11]=l,t[12]=u,t[13]=d,t[14]=f):f=t[14],f}function vo(e,t){return e===`absent`&&!t}function yo(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 bo(e){if(e)return()=>{e.ownerDocument.activeElement===e&&V(e)?.focus()}}function xo(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)(H,{ref:bo,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 So(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)(er,{"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)(di,{"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 Co(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)($n,{"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)(H,{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)($n,{"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)(H,{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)(H,{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)(H,{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)(H,{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 wo(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)(H,{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 To(e){return e===void 0?null:nn[e].external?.installUrl??null}function Eo(e){return e!==null&&Object.values(e.probes.satisfiers).some(e=>e!==void 0&&e.state!==`unprobed`)}function Do(e){return`${e.source}:${e.id}`}function Oo(e,t,n){let r=t.has(Do(n)),i=dt(n);return at(e,n.source,n.id,r||i,n.supported)}function ko(e,t,n){return n.harness!==void 0&<(n)===0||Oo(e,t,n)}function Ao(e,t,n){let r=new Set(n.map(e=>Do(e))),i=e=>ko(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(Do)),ranks:new Map(a.map((e,t)=>[Do(e),t]))}}function jo(e,t,n,r){let i=t.filter(t=>!e.ranks.has(Do(t)));if(i.length===0)return e;let a=new Set(r.map(e=>Do(e))),o=e=>ko(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(Do),...d,...c.map(Do)];return{primaryKeys:new Set([...e.primaryKeys,...s.map(Do)]),ranks:new Map(f.map((e,t)=>[e,t]))}}function Mo(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?L:r,{_:a}=h(),o=st(),s=ct(),{states:c,refresh:l}=zn(),u=Bn(),d=Di(),[f,p]=(0,Z.useState)(``),[m,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(!1),[w,B]=(0,Z.useState)(null),[V,U]=(0,Z.useState)(!1),[W,G]=(0,Z.useState)(!1),[K,ee]=(0,Z.useState)(0),[te,q]=(0,Z.useState)(null),[J,ne]=(0,Z.useState)(null),re=(0,Z.useRef)(null),ie=(0,Z.useRef)(0),ae;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(ae={queryKey:[`acp-catalog`],queryFn:Ho,staleTime:3e5},t[2]=ae):ae=t[2];let oe=g(ae),se;t[3]!==oe.data||t[4]!==o||t[5]!==s?(se=()=>oe.data===void 0?null:Ao(oe.data.agents,o,s),t[3]=oe.data,t[4]=o,t[5]=s,t[6]=se):se=t[6];let[ce,le]=(0,Z.useState)(se),ue=ce??Ao([],o,s);if(oe.data!==void 0){let e;t[7]!==oe.data.agents||t[8]!==ce||t[9]!==o||t[10]!==s?(e=ce===null?Ao(oe.data.agents,o,s):jo(ce,oe.data.agents,o,s),t[7]=oe.data.agents,t[8]=ce,t[9]=o,t[10]=s,t[11]=e):e=t[11];let n=e;n!==ce&&le(n),ue=n}let de;t[12]===l?de=t[13]:(de=()=>{l()},t[12]=l,t[13]=de);let fe=(0,Z.useEffectEvent)(de),pe;t[14]===fe?pe=t[15]:(pe=()=>{fe()},t[14]=fe,t[15]=pe);let me;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(me=[],t[16]=me):me=t[16],(0,Z.useEffect)(pe,me);let he;t[17]===i?he=t[18]:(he=()=>{let e=!0,t=ie.current+=1;return i([]).then(n=>{!e||ie.current!==t||(n.snapshot!==null&&B(n.snapshot),U(!Eo(n.snapshot)),G(n.unavailable===!0))}).catch(()=>{e&&ie.current===t&&U(!0)}),()=>{e=!1}},t[17]=i,t[18]=he);let ge;t[19]!==i||t[20]!==K?(ge=[i,K],t[19]=i,t[20]=K,t[21]=ge):ge=t[21],(0,Z.useEffect)(he,ge);let _e=oe.data?.agents,ve=new Set(s.map(Vo)),ye;t[22]===u?.installedClis?ye=t[23]:(ye=u?.installedClis??{},t[22]=u?.installedClis,t[23]=ye);let be=ye,xe=w===null?[]:D(w),Se=xe.find(e=>e.id===te)??null,Ce=xe.find(e=>e.id===J)??null,we;t[24]===i?we=t[25]:(we=async function(e){let t=await i(e);return ie.current+=1,t.snapshot!==null&&B(t.snapshot),U(!Eo(t.snapshot)),t.unavailable===!0&&G(!0),t},t[24]=i,t[25]=we);let Te=we,Ee;t[26]===w?Ee=t[27]:(Ee=function(e,t){return t===!1?`absent`:t===!0?`present`:e===void 0?`unknown`:N(e,w,t)},t[26]=w,t[27]=Ee);let De=Ee,Oe;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=new Set(jt.map(Ct).filter(Bo)),t[28]=Oe):Oe=t[28];let ke=Oe,Ae;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=new Set(Pt.map(zo).filter(Ro)),t[29]=Ae):Ae=t[29];let je=Ae,Me;t[30]!==be||t[31]!==De||t[32]!==c?(Me=function(e,t){if(t===`terminal`){let t=nn[e].external?.targetId;return t===void 0?`unknown`:De(e,c[t]?.installed??null)}let n=jt.find(t=>Ct(t)===e);return n===void 0?`unknown`:De(e,be[n]??null)},t[30]=be,t[31]=De,t[32]=c,t[33]=Me):Me=t[33];let Ne=Me,Pe=function(e,t,n,r,i,a,o,s){let c=e===void 0?void 0:xe.find(t=>t.id===e);if(c===void 0||e===void 0||w===null||!Eo(w))return{status:void 0,action:void 0,hintAction:void 0,residualFiles:!1,statusId:void 0};let l={enabled:i,installedCount:k(S(c)),presence:o,configurable:P(c),setupDocSlug:c.row.setupDocSlug,installUrl:s===void 0?nn[e].external?.installUrl??null:s},u=mo(l),d=M(e)&&Ne(e,r)!==`absent`,f=ho(l)&&!d,p=F({agentId:e,mode:r,snapshot:w,detected:a}),m=p===`connected`||p===`not-connected`&&i,h=m?`${n}-status`:void 0,g=!W||u.kind===`install`||u.kind===`setup-doc`,_=c.cells.projectMcp,v=_===void 0||!M(e)||C(_.consentClass)===r?po(A({agentId:e,mode:r,snapshot:w,detected:a,projectMcp:_})):null;return{status:m?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(So,{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)(Co,{action:u,rowLabel:t,describedById:h,onConfigure:()=>q(e),onRemove:()=>ne(e)}):void 0,hintAction:f&&!W?(0,$.jsx)(wo,{rowLabel:t,onRemove:()=>ne(e)}):void 0,residualFiles:f,statusId:h}},Fe;t[34]===a?Fe=t[35]:(Fe=function(e,t){return a(e===`not-installed`?t?{id:`06Ucfz`}:{id:`5SwVv1`}:t?{id:`V0Jk_K`}:{id:`EDD3UL`})},t[34]=a,t[35]=Fe);let Ie=Fe,Le=function(e,t,n,r,i){if($e(e,r),!r||W||t===void 0||w===null)return;let a=xe.find(e=>e.id===t);a===void 0||!P(a)||F({agentId:t,mode:n,snapshot:w,detected:i})===`not-connected`&&(re.current=e,q(t))},Re;t[36]!==_e||t[37]!==o||t[38]!==s?(Re=function(){_e!==void 0&&le(Ao(_e,o,s))},t[36]=_e,t[37]=o,t[38]=s,t[39]=Re):Re=t[39];let ze=Re,Be;t[40]!==f||t[41]!==ze?(Be=function(e){f.trim()!==``&&e.trim()===``&&ze(),p(e)},t[40]=f,t[41]=ze,t[42]=Be):Be=t[42];let Ve=Be,He;t[43]!==ze||t[44]!==m?(He=function(){m&&ze(),_(!m)},t[43]=ze,t[44]=m,t[45]=He):He=t[45];let Ue=He,We=f.trim().toLowerCase(),Ge=e=>We===``||e.toLowerCase().includes(We),Ke=(_e??[]).filter(e=>Ge(e.name)),qe;t[46]===be?qe=t[47]:(qe=e=>be[e]!==!1,t[46]=be,t[47]=qe);let Je=qe,Ye;t[48]===Je?Ye=t[49]:(Ye=(e,t)=>Number(Je(t))-Number(Je(e))||Ot[e].displayName.localeCompare(Ot[t].displayName),t[48]=Je,t[49]=Ye);let Xe=jt.filter(e=>{let{displayName:t}=Ot[e];return Ge(t)||Ge(a({id:`QYfQdv`,values:{displayName:t}}))||Ge(e)}).sort(Ye),Ze;t[50]!==De||t[51]!==c?(Ze=e=>De(bt(e),c[e]?.installed??null),t[50]=De,t[51]=c,t[52]=Ze):Ze=t[52];let lt=Ze,ut;t[53]===lt?ut=t[54]:(ut=(e,t)=>Number(lt(e.id)===`absent`)-Number(lt(t.id)===`absent`),t[53]=lt,t[54]=ut);let ft=Pt.filter(e=>{let{displayName:t}=e;return Ge(a({id:`CZBqrX`,values:{displayName:t}}))||Ge(e.id)}).sort(ut),mt=u!==null,ht;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(ht=new Set([...ke,...je]),t[55]=ht):ht=t[55];let gt=ht,_t=pt.filter(e=>!gt.has(e)&&Ge(E(e))),vt=We!==``,yt=!oe.isLoading&&!oe.isError,xt=vt&&yt&&Ke.length===0&&Xe.length===0&&ft.length===0&&_t.length===0,St=!vt||oe.isLoading||oe.isError||Ke.length>0,wt=!vt||Xe.length>0,Tt=!vt||ft.length>0||_t.length>0,Et=e=>Oo(o,ve,e),Dt=e=>ue.primaryKeys.has(Do(e)),kt=e=>ue.ranks.get(Do(e))??2**53-1,At=Ke.filter(Dt),Mt=[...vt||m?Ke:At].sort((e,t)=>kt(e)-kt(t)||e.name.localeCompare(t.name)),Nt=vt?0:Ke.length-At.length,Ft=Xe.filter(Je),It=Ft.length>0&&Ft.length<Xe.length,Lt=!It||vt||v?Xe:Ft,Rt=It&&!vt?Xe.length-Ft.length:0,zt;t[56]===lt?zt=t[57]:(zt=e=>lt(e.id)!==`absent`,t[56]=lt,t[57]=zt);let Bt=ft.filter(zt),Vt=_t.filter(e=>De(e,xe.find(t=>t.id===e)?.row.detected??null)!==`absent`),Ht=Bt.length+Vt.length,Ut=ft.length+_t.length,Wt=Ht>0&&Ht<Ut,Gt=!Wt||vt||b,Kt=Gt?ft:Bt,qt=Gt?_t:Vt,Jt=Wt&&!vt?Ut-Ht:0,Yt=!yt||Ke.some(dt),Xt=mt&&Xe.some(Je),Zt;t[58]===c?Zt=t[59]:(Zt=e=>c[e.id]?.installed===!0,t[58]=c,t[59]=Zt);let Qt=ft.some(Zt),$t=St?(0,$.jsx)(yo,{label:a({id:`RXEbZy`}),labelId:`settings-configure-agents-in-app`,children:oe.isLoading?(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-2 px-3 py-6 text-muted-foreground text-sm`,children:[(0,$.jsx)(ri,{className:`size-4`,"aria-hidden":`true`}),a({id:`ucXZ0k`})]}):oe.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)(Ua,{className:`size-5`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:a({id:`FqGWeR`})}),(0,$.jsx)(H,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void oe.refetch(),children:a({id:`6gRgw8`})})]}):(_e?.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:[Mt.map(e=>{let t=Do(e),n=Et(e),r=e.supported?e.description:a({id:`5jEnaB`});return(0,$.jsx)(go,{icon:(0,$.jsx)(ot,{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?(et({source:e.source,id:e.id,name:e.name,supported:e.supported,featured:e.featured,...e.iconUrl===void 0?{}:{iconUrl:e.iconUrl}},{makeDefault:!1}),$e(Y(e.source,e.id),!0)):($e(Y(e.source,e.id),!1),tt(t,e=>at(o,e.source,e.id,!0,e.supported)))}},t)}),(0,$.jsx)(xo,{hiddenCount:Nt,expanded:m,onToggle:Ue,testId:`configure-agents-in-app-show-more`})]})},`in-app`):null,en=wt?(0,$.jsxs)(yo,{label:a({id:`ALhMYW`}),labelId:`settings-configure-agents-terminal`,children:[Lt.map(e=>{let{displayName:t}=Ot[e],n=be[e]??null,r=De(Ct(e),n),i=Qe(o,e,r===`absent`),s=`configure-agents-terminal-row-${e}`,{status:c,action:l,hintAction:u,residualFiles:d,statusId:f}=Pe(Ct(e),a({id:`QYfQdv`,values:{displayName:t}}),s,`terminal`,i,n,r,To(Ct(e))??Ot[e].docsUrl);return(0,$.jsx)(go,{icon:(0,$.jsx)(Rn,{id:ta(e),className:`size-4`,"aria-hidden":`true`}),name:a({id:`QYfQdv`,values:{displayName:t}}),hint:r===`absent`?{text:Ie(`not-installed`,d),action:u}:void 0,status:c,action:l,checked:i,disabled:vo(r,i),ariaLabel:a({id:`27TLNq`,values:{displayName:t}}),testId:`configure-agents-terminal-${e}`,rowTestId:s,statusId:f,onToggle:mt?t=>Le(nt(e),Ct(e),`terminal`,t,be[e]??null):void 0},e)}),(0,$.jsx)(xo,{hiddenCount:Rt,expanded:v,onToggle:()=>y(Lo),testId:`configure-agents-terminal-show-more`})]},`terminal`):null,tn=Tt?(0,$.jsxs)(yo,{label:a({id:`BwKH4d`}),labelId:`settings-configure-agents-desktop`,labelIcon:(0,$.jsx)($n,{"aria-hidden":`true`,className:`size-3`}),children:[Kt.map(e=>{let t=c[e.id]?.installed??null,{displayName:n}=e,r=rt(o,e.id,t),i=De(bt(e.id),t),s=`configure-agents-desktop-row-${e.id}`,{status:l,action:u,hintAction:f,residualFiles:p,statusId:m}=Pe(bt(e.id),a({id:`CZBqrX`,values:{displayName:n}}),s,`external`,r,t,i);return(0,$.jsx)(go,{icon:(0,$.jsx)(Rn,{id:e.id,className:`size-4`,"aria-hidden":`true`}),name:a({id:`CZBqrX`,values:{displayName:n}}),hint:i===`absent`?{text:Ie(`not-installed`,p),action:f}:void 0,status:l,action:(0,$.jsxs)($.Fragment,{children:[u,d===null?null:(0,$.jsx)(_o,{target:e.id,projectDir:d.contentDir,displayName:n},`${d.contentDir}:${e.id}`)]}),checked:r,disabled:vo(i,r),ariaLabel:a({id:`cdBape`,values:{displayName:n}}),testId:`configure-agents-desktop-${e.id}`,rowTestId:s,statusId:m,onToggle:n=>Le(it(e.id),bt(e.id),`external`,n,t)},e.id)}),qt.map(e=>{let t=xe.find(t=>t.id===e)??null,n=t?.row.detected??null,r=E(e),i=De(e,n),a=`agent-connection-${e}`,o=Pe(e,r,a,`external`,t===null||!R(t),n,i);return(0,$.jsx)(go,{icon:(0,$.jsx)(T,{agentId:e,className:`size-4 text-muted-foreground`}),name:r,hint:i===`absent`?{text:Ie(`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)(xo,{hiddenCount:Jt,expanded:b,onToggle:()=>x(Io),testId:`configure-agents-desktop-show-more`})]},`desktop`):null,rn=[{node:$t,hasPresent:Yt},{node:en,hasPresent:Xt},{node:tn,hasPresent:Qt}].sort(Fo).map(Po),an;t[60]===a?an=t[61]:(an=a({id:`lBN3T6`}),t[60]=a,t[61]=an);let on;t[62]===a?on=t[63]:(on=a({id:`D4I0F9`}),t[62]=a,t[63]=on);let sn;t[64]!==an||t[65]!==on?(sn=(0,$.jsx)(Ka,{titleId:`settings-configure-agents-title`,title:an,children:on}),t[64]=an,t[65]=on,t[66]=sn):sn=t[66];let cn;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(cn=(0,$.jsx)(Nn,{className:`-translate-y-1/2 absolute top-1/2 start-2.5 size-4 text-muted-foreground`,"aria-hidden":`true`}),t[67]=cn):cn=t[67];let ln;t[68]===Ve?ln=t[69]:(ln=e=>Ve(e.target.value),t[68]=Ve,t[69]=ln);let un;t[70]===a?un=t[71]:(un=a({id:`-7s4fw`}),t[70]=a,t[71]=un);let dn;t[72]===a?dn=t[73]:(dn=a({id:`-7s4fw`}),t[72]=a,t[73]=dn);let fn;t[74]!==f||t[75]!==ln||t[76]!==un||t[77]!==dn?(fn=(0,$.jsxs)(`div`,{className:`relative`,children:[cn,(0,$.jsx)(Ni,{value:f,onChange:ln,placeholder:un,"aria-label":dn,className:`ps-8`,"data-testid":`configure-agents-search`})]}),t[74]=f,t[75]=ln,t[76]=un,t[77]=dn,t[78]=fn):fn=t[78];let pn;t[79]!==a||t[80]!==W?(pn=W?(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)(di,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{children:a({id:`RD8cCw`})})]}):null,t[79]=a,t[80]=W,t[81]=pn):pn=t[81];let mn;t[82]!==a||t[83]!==V?(mn=V?(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)(Ua,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{role:`status`,children:a({id:`4sE6E9`})})]}),(0,$.jsx)(H,{type:`button`,variant:`outline`,size:`sm`,className:`shrink-0`,onClick:()=>ee(No),children:a({id:`6gRgw8`})})]}):null,t[82]=a,t[83]=V,t[84]=mn):mn=t[84];let hn;t[85]!==a||t[86]!==xt?(hn=xt?(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]=xt,t[87]=hn):hn=t[87];let gn=`configure:${te??`closed`}`,_n;t[88]===te?_n=t[89]:(_n=te!==null&&M(te),t[88]=te,t[89]=_n);let vn=Se!==null,yn;t[90]===re?yn=t[91]:(yn=e=>{e||(re.current!==null&&($e(re.current,!1),re.current=null),q(null))},t[90]=re,t[91]=yn);let bn;t[92]!==Te||t[93]!==Se||t[94]!==re?(bn=(e,t)=>Se===null?Promise.resolve({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null}):Te(O(Se,e,t)).then(e=>(e.ok&&(re.current=null),e)),t[92]=Te,t[93]=Se,t[94]=re,t[95]=bn):bn=t[95];let X;t[96]!==Se||t[97]!==gn||t[98]!==_n||t[99]!==vn||t[100]!==yn||t[101]!==bn?(X=(0,$.jsx)(I,{connection:Se,paired:_n,open:vn,onOpenChange:yn,onSave:bn},gn),t[96]=Se,t[97]=gn,t[98]=_n,t[99]=vn,t[100]=yn,t[101]=bn,t[102]=X):X=t[102];let xn=`remove:${J??`closed`}`,Sn;t[103]===J?Sn=t[104]:(Sn=J!==null&&M(J),t[103]=J,t[104]=Sn);let Cn=Ce!==null,wn;t[105]===Symbol.for(`react.memo_cache_sentinel`)?(wn=e=>{e||ne(null)},t[105]=wn):wn=t[105];let Tn;t[106]!==Te||t[107]!==Ce?(Tn=e=>Ce===null?Promise.resolve({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null}):Te(z(Ce,e===void 0?[]:e)),t[106]=Te,t[107]=Ce,t[108]=Tn):Tn=t[108];let En;t[109]!==Ce||t[110]!==xn||t[111]!==Sn||t[112]!==Cn||t[113]!==Tn?(En=(0,$.jsx)(j,{connection:Ce,paired:Sn,open:Cn,onOpenChange:wn,onRemove:Tn},xn),t[109]=Ce,t[110]=xn,t[111]=Sn,t[112]=Cn,t[113]=Tn,t[114]=En):En=t[114];let Dn;return t[115]!==rn||t[116]!==sn||t[117]!==fn||t[118]!==pn||t[119]!==mn||t[120]!==hn||t[121]!==X||t[122]!==En?(Dn=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-configure-agents-title`,className:`space-y-6`,"data-field":`section:agent-connections`,"data-testid":`settings-configure-agents`,children:[sn,fn,pn,mn,hn,rn,X,En]}),t[115]=rn,t[116]=sn,t[117]=fn,t[118]=pn,t[119]=mn,t[120]=hn,t[121]=X,t[122]=En,t[123]=Dn):Dn=t[123],Dn}function No(e){return e+1}function Po(e){return e.node}function Fo(e,t){return Number(t.hasPresent)-Number(e.hasPresent)}function Io(e){return!e}function Lo(e){return!e}function Ro(e){return e!==void 0}function zo(e){return bt(e.id)}function Bo(e){return e!==void 0}function Vo(e){return Do(e)}function Ho(e){let{signal:t}=e;return ut(t)}var Uo=`open-knowledge-app`;function Wo({from:e,to:t}){try{bn.getTracer(Uo).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 Go=`open-knowledge-app`;function Ko(e){let t=e.light.startsWith(`saved-`),n=e.dark.startsWith(`saved-`);return!t||!n?`incomplete`:e.light===e.dark?`same`:`different`}function qo(e){try{bn.getTracer(Go).startSpan(`ok.saved_themes.assignment`,{attributes:{"saved_theme.pair":Ko(e)}}).end()}catch(e){console.warn(`[saved-theme-telemetry] assignment span emit failed:`,e instanceof Error?e:String(e))}}var Jo=`system`;function Yo(e){return typeof e==`string`&&gn.includes(e)}function Xo(e){return Yo(e)?e:Jo}function Zo(e){return new Intl.DisplayNames([e],{type:`language`}).of(e)??e}function Qo(e){let t=(0,Q.c)(6),{choice:n}=e;if(n===Jo){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=Zo(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 $o(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=Xo(o),t[6]=o,t[7]=s);let c=s,l;t[8]===r?l=t[9]:(l=e=>r(Xo(e)),t[8]=r,t[9]=l);let u;t[10]===c?u=t[11]:(u=(0,$.jsx)(We,{children:(0,$.jsx)(Qo,{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)(Ue,{...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)(He,{children:[(0,$.jsx)(Ve,{value:Jo,children:(0,$.jsx)(Qo,{choice:Jo})}),ln.map(es)]}),t[17]=f):f=t[17];let p;return t[18]!==c||t[19]!==l||t[20]!==d?(p=(0,$.jsxs)(Ge,{value:c,onValueChange:l,children:[d,f]}),t[18]=c,t[19]=l,t[20]=d,t[21]=p):p=t[21],p}function es(e){return(0,$.jsx)(Ve,{value:e,children:(0,$.jsx)(Qo,{choice:e})},e)}function ts(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 ns(e,t,n){return e.id===`custom`?ts(Zt(qi(t))):e.scheme?ts(Zt(e.scheme)):ts(Vi(n))}function rs(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=ns(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(is),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 is(e,t){return(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{backgroundColor:e}},t)}function as(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 os(e){return b(`size-3.5`,e&&`fill-current`)}function ss(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?an: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)(H,{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)(rs,{theme:e,customSeed:u,slotMode:y})}),l?(0,$.jsx)(H,{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)(ui,{"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)(Xe,{className:as(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)(Pn,{className:`size-3.5`})}):null,(0,$.jsx)(Xe,{id:t===0?d:void 0,className:as(r),pressed:r,onPressedChange:t=>{t&&a(`light`,e.id)},"aria-label":x({id:`sq4WQH`,values:{0:e.label}}),children:(0,$.jsx)(ii,{className:os(r)})}),(0,$.jsx)(Xe,{className:as(i),pressed:i,onPressedChange:t=>{t&&a(`dark`,e.id)},"aria-label":x({id:`lZvQrY`,values:{0:e.label}}),children:(0,$.jsx)(ai,{className:os(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)(H,{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 w;t[24]===v?w=t[25]:(w=v.map(cs),t[24]=v,t[25]=w);let T;return t[26]!==p||t[27]!==m||t[28]!==f||t[29]!==S||t[30]!==C||t[31]!==w?(T=(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,w]}),t[26]=p,t[27]=m,t[28]=f,t[29]=S,t[30]=C,t[31]=w,t[32]=T):T=t[32],T}function cs(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)(ir,{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 ls=12e3;function us(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}=Ai(),[_,v]=(0,Z.useState)(!1),[y,b]=(0,Z.useState)(``),[x,S]=(0,Z.useState)(null),[C,w]=(0,Z.useState)(!1),T=(0,Z.useRef)(null),E,D;t[4]===u?(E=t[5],D=t[6]):(E=()=>{u()},D=[u],t[4]=u,t[5]=E,t[6]=D),(0,Z.useEffect)(E,D);let O;t[7]!==n||t[8]!==o?(O=Dt(n,o),t[7]=n,t[8]=o,t[9]=O):O=t[9];let k=O,A,j,M,N,P,F,I,L,R,z,B,V,U,W,G,K,ee,te,q,J,ne;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]!==k||t[24]!==m||t[25]!==o||t[26]!==c||t[27]!==s){let e=$t(y),n;t[49]===o?n=t[50]:(n=o.filter(hs),t[49]=o,t[50]=n);let h=n,E,D,O,re,ie,ae,oe,se,ce;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]!==k||t[64]!==m||t[65]!==o||t[66]!==c||t[67]!==s){let e=o.flatMap(ms),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;O=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:ls,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]!==k||t[93]!==o?(x=async function(e){if(e.preventDefault(),C)return;let t=$t(y);if(!t.ok){S(a({id:`RG3yW6`})),T.current?.focus();return}let n=i.slotMode??`light`,s=o.find(e=>e.id===k[n])?.scheme??qi(i.customSeed),c={name:t.name,variant:s.variant,palette:{...s.palette}};S(null),w(!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`})),w(!1),T.current?.focus();return}let d={id:l.id,label:c.name,kind:c.variant,scheme:c,toTokens:()=>Zt(c)};r(n,l.id,k,[...o,d]),await u(),b(``),v(!1),w(!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]=k,t[93]=o,t[94]=x):x=t[94],D=x;let A;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),A=s.map(e),t[95]=a,t[96]=s,t[97]=A}else A=t[97];let j=A;V=`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)(H,{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 M;t[104]!==a||t[105]!==c?(M=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)(di,{"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]=M):M=t[106],t[107]===M?W=t[108]:(W=(0,$.jsx)(`div`,{role:`status`,children:M}),t[107]=M,t[108]=W),E=ss,ie=i,ae=k,oe=h,se=j;let N;t[109]===o?N=t[110]:(N=o.filter(ps).map(fs),t[109]=o,t[110]=N);let P=m?p:null;t[111]!==g||t[112]!==N||t[113]!==P?(ce={themeIds:N,selectedId:P,onSelect:g},t[111]=g,t[112]=N,t[113]=P,t[114]=ce):ce=t[114],re=e.map(ds),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]=k,t[64]=m,t[65]=o,t[66]=c,t[67]=s,t[68]=E,t[69]=D,t[70]=O,t[71]=V,t[72]=U,t[73]=W,t[74]=re,t[75]=ie,t[76]=ae,t[77]=oe,t[78]=se,t[79]=ce}else E=t[68],D=t[69],O=t[70],V=t[71],U=t[72],W=t[73],re=t[74],ie=t[75],ae=t[76],oe=t[77],se=t[78],ce=t[79];let le;t[115]!==O||t[116]!==re?(le={themeIds:re,onDelete:O},t[115]=O,t[116]=re,t[117]=le):le=t[117];let ue;t[118]===Symbol.for(`react.memo_cache_sentinel`)?(ue={onCreate:()=>v(!0)},t[118]=ue):ue=t[118];let de;t[119]!==r||t[120]!==k||t[121]!==o?(de=(e,t)=>r(e,t,k,o),t[119]=r,t[120]=k,t[121]=o,t[122]=de):de=t[122],t[123]!==E||t[124]!==ie||t[125]!==ae||t[126]!==oe||t[127]!==se||t[128]!==ce||t[129]!==le||t[130]!==de?(G=(0,$.jsx)(E,{...ie,selection:ae,themes:oe,unavailableThemes:se,editControl:ce,deleteControl:le,createControl:ue,onAssign:de}),t[123]=E,t[124]=ie,t[125]=ae,t[126]=oe,t[127]=se,t[128]=ce,t[129]=le,t[130]=de,t[131]=G):G=t[131],P=xi,z=_,t[132]===C?B=t[133]:(B=e=>{C||v(e)},t[132]=C,t[133]=B),N=gi;let fe;t[134]===a?fe=t[135]:(fe=a({id:`Z_nNa2`}),t[134]=a,t[135]=fe);let pe;t[136]===fe?pe=t[137]:(pe=(0,$.jsx)(hi,{children:fe}),t[136]=fe,t[137]=pe);let me;t[138]===a?me=t[139]:(me=a({id:`nTM8ab`}),t[138]=a,t[139]=me);let he;t[140]===me?he=t[141]:(he=(0,$.jsx)(mi,{children:me}),t[140]=me,t[141]=he),t[142]!==pe||t[143]!==he?(R=(0,$.jsxs)(bi,{className:`gap-2`,children:[pe,he]}),t[142]=pe,t[143]=he,t[144]=R):R=t[144],M=_i,F=`create-saved-theme-form`,I=!0,L=D,j=Ti,q=x!==null;let ge;t[145]===a?ge=t[146]:(ge=a({id:`HZ7fEu`}),t[145]=a,t[146]=ge),t[147]===ge?J=t[148]:(J=(0,$.jsx)(Ci,{htmlFor:`create-saved-theme-name`,children:ge}),t[147]=ge,t[148]=J);let _e=x!==null,ve=x?`create-saved-theme-help create-saved-theme-error`:`create-saved-theme-help`,ye;t[149]===x?ye=t[150]:(ye=e=>{b(e.target.value),x&&S(null)},t[149]=x,t[150]=ye),t[151]!==y||t[152]!==C||t[153]!==_e||t[154]!==ve||t[155]!==ye?(ne=(0,$.jsx)(Ni,{ref:T,id:`create-saved-theme-name`,value:y,autoFocus:!0,autoComplete:`off`,required:!0,readOnly:C,"aria-invalid":_e,"aria-describedby":ve,onChange:ye}),t[151]=y,t[152]=C,t[153]=_e,t[154]=ve,t[155]=ye,t[156]=ne):ne=t[156],A=wi,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]=k,t[24]=m,t[25]=o,t[26]=c,t[27]=s,t[28]=A,t[29]=j,t[30]=M,t[31]=N,t[32]=P,t[33]=F,t[34]=I,t[35]=L,t[36]=R,t[37]=z,t[38]=B,t[39]=V,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]=ne}else A=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],U=t[40],W=t[41],G=t[42],K=t[43],ee=t[44],te=t[45],q=t[46],J=t[47],ne=t[48];let re;t[157]!==A||t[158]!==K||t[159]!==ee||t[160]!==te?(re=(0,$.jsx)(A,{id:K,className:ee,children:te}),t[157]=A,t[158]=K,t[159]=ee,t[160]=te,t[161]=re):re=t[161];let ie;t[162]===x?ie=t[163]:(ie=x?(0,$.jsx)(Si,{id:`create-saved-theme-error`,children:x}):null,t[162]=x,t[163]=ie);let ae;t[164]!==j||t[165]!==re||t[166]!==ie||t[167]!==q||t[168]!==J||t[169]!==ne?(ae=(0,$.jsxs)(j,{"data-invalid":q,children:[J,ne,re,ie]}),t[164]=j,t[165]=re,t[166]=ie,t[167]=q,t[168]=J,t[169]=ne,t[170]=ae):ae=t[170];let oe;t[171]!==F||t[172]!==I||t[173]!==L||t[174]!==ae?(oe=(0,$.jsx)(`form`,{id:F,noValidate:I,onSubmit:L,children:ae}),t[171]=F,t[172]=I,t[173]=L,t[174]=ae,t[175]=oe):oe=t[175];let se;t[176]!==M||t[177]!==oe?(se=(0,$.jsx)(M,{children:oe}),t[176]=M,t[177]=oe,t[178]=se):se=t[178];let ce;t[179]===Symbol.for(`react.memo_cache_sentinel`)?(ce=()=>v(!1),t[179]=ce):ce=t[179];let le;t[180]===a?le=t[181]:(le=a({id:`dEgA5A`}),t[180]=a,t[181]=le);let ue;t[182]!==C||t[183]!==le?(ue=(0,$.jsx)(H,{type:`button`,variant:`outline`,disabled:C,onClick:ce,children:le}),t[182]=C,t[183]=le,t[184]=ue):ue=t[184];let de;t[185]!==a||t[186]!==C?(de=a(C?{id:`_DwR-n`}:{id:`cuHhjo`}),t[185]=a,t[186]=C,t[187]=de):de=t[187];let fe;t[188]!==C||t[189]!==de?(fe=(0,$.jsx)(H,{type:`submit`,form:`create-saved-theme-form`,disabled:C,children:de}),t[188]=C,t[189]=de,t[190]=fe):fe=t[190];let pe;t[191]!==ue||t[192]!==fe?(pe=(0,$.jsxs)(vi,{children:[ue,fe]}),t[191]=ue,t[192]=fe,t[193]=pe):pe=t[193];let me;t[194]!==N||t[195]!==R||t[196]!==se||t[197]!==pe?(me=(0,$.jsxs)(N,{children:[R,se,pe]}),t[194]=N,t[195]=R,t[196]=se,t[197]=pe,t[198]=me):me=t[198];let he;t[199]!==P||t[200]!==z||t[201]!==B||t[202]!==me?(he=(0,$.jsx)(P,{open:z,onOpenChange:B,children:me}),t[199]=P,t[200]=z,t[201]=B,t[202]=me,t[203]=he):he=t[203];let ge;return t[204]!==V||t[205]!==U||t[206]!==W||t[207]!==G||t[208]!==he?(ge=(0,$.jsxs)(`div`,{className:V,children:[U,W,G,he]}),t[204]=V,t[205]=U,t[206]=W,t[207]=G,t[208]=he,t[209]=ge):ge=t[209],ge}function ds(e){return e.id}function fs(e){return e.id}function ps(e){return e.id.startsWith(`saved-`)}function ms(e){let t=Mt(e.id);return!t.ok||!e.scheme?[]:[{id:e.id,stem:t.stem,label:e.label,scheme:e.scheme}]}function hs(e){return e.id!==`custom`}function gs(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)]:gs(r,t)}}function _s(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 vs(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 ys(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 bs(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=Ta(i),o,s;t[4]!==e||t[5]!==a?(o=()=>e.subscribe(e=>{xs(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=>Ss(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 xs(e,t){e.reset(t,{keepDirtyValues:!0,keepDirty:!0,keepTouched:!0})}function Ss(e,t,n){let r=e.getValues(n),i=gs(Ts(n),r),a=t.patch(i);if(a.ok)return e.clearErrors(n),e.resetField(n,{defaultValue:r,keepError:!1}),!0;if(vt(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:Cs(a.error,n)});return!1}function Cs(e,t){if(vt(e)&&e.code===`SCHEMA_INVALID`){let n=e.issues.find(e=>ws(e,t));if(n)return n.message}return _n(e)}function ws(e,t){return e.path.map(String).join(`.`)===t}function Ts(e){return e.split(`.`)}function Es(e){if(!vt(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 Ds(){let e=(0,Q.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(ra,{className:`h-5 w-32`}),n=(0,$.jsx)(ra,{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)(ra,{className:`h-9 w-full`}),(0,$.jsx)(ra,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function Os({field:e,scope:t,commitField:n,isFlashed:r}){"use no memo";let{_:i}=h(),a=ka(),{setTheme:o}=_(),s=Fn(),c=It(St,e.path),l=c?vs(c):void 0,u=c?_s(c):void 0,d=c?ys(c):void 0,f=c?Kt(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)},w=()=>{let e=n(g);return e&&C(),e},T=()=>a.getFieldState(g).isDirty?w():!0,E=()=>{if(e.control===`theme-tiles`){let e=s?.userBinding;if(!e)return;let t=e.patch({appearance:Bi()});t.ok?C():a.setError(g,{type:`manual`,message:Cs(t.error,g)});return}let t=u===void 0?null:u;a.setValue(g,t,{shouldDirty:!1}),e.control===`theme-cards`&&o(Ln(t)),w()},D=b(`relative`,r&&`animate-settings-flash`);return(0,$.jsx)(Ea,{control:a.control,name:g,render:({field:n})=>{let r=!p&&(u!==void 0||n.value!==void 0);return(0,$.jsxs)(wa,{className:D,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(Oa,{className:`text-sm font-medium`,children:v}),r?(0,$.jsxs)(K,{children:[(0,$.jsx)(U,{asChild:!0,children:(0,$.jsx)(H,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:E,"aria-label":i({id:`lhjq3G`,values:{labelText:v}}),children:(0,$.jsx)(si,{className:`size-3.5`})})}),(0,$.jsx)(W,{children:(0,$.jsx)(m,{id:`L-rMC9`})})]}):null]}),e.description?(0,$.jsx)(Aa,{className:`text-muted-foreground text-1sm`,children:i(e.description)}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Da,{children:(0,$.jsx)(As,{field:e,ctl:n,typeTag:l,enumOptions:d,onCommit:T,onRevertToBaseline:()=>a.resetField(g,{keepError:!0}),onSavedOutsideForm:C,onWriteRejected:e=>{a.setError(g,{type:`manual`,message:Cs(e,g)})}})}),(0,$.jsx)(Ps,{visible:y,srOnly:ks(e.control)})]}),(0,$.jsx)(ja,{"data-field-error":e.path.join(`.`)})]})}})}function ks(e){return e===`theme-tiles`||e===`theme-cards`}function As({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=Fn(),p=f?.merged??null;if(e.control===`language-select`)return(0,$.jsx)($o,{...c,value:t.value,ref:t.ref,onBlur:t.onBlur,onValueChange:e=>{let n=Ji(t.value)??`system`;n!==e&&Wo({from:n,to:e}),t.onChange(e),i()}});if(e.control===`theme-cards`){let{id:n,...r}=c;return(0,$.jsx)(oi,{...r,firstItemId:n,value:Ln(t.value),"aria-label":l(e.label),onValueChange:e=>{let n=Ln(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=ht(i,d===`dark`);return(0,$.jsx)(us,{...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`?Ui(qi(r)):zi(t,c)};Ri({selection:d,modePreference:i,slotMode:a,customSeed:r,themes:c}),u(p(d)??i??`system`);let m=l.patch({appearance:Wi(d)});if(m.ok){qo(d),o();return}Ri({selection:n,modePreference:i,slotMode:a,customSeed:r,themes:c}),u(p(n)??i??`system`),s(m.error)}})}if(n===`boolean`)return(0,$.jsx)(Je,{...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)(Ze,{...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)(Ye,{value:e,id:t===0?n:void 0,className:`text-1sm capitalize`,children:e},e))})}return n===`number`||n===`int`?(0,$.jsx)(Ms,{ctl:t,onCommit:i,...c}):n===`array`?(0,$.jsx)(Ns,{ctl:t,onCommit:i,...c}):(0,$.jsx)(js,{ctl:t,onCommit:i,...c})}function js({ctl:e,onCommit:t,...n}){"use no memo";return(0,$.jsx)(Ni,{...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 Ms({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)(Ni,{...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 Ns({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-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-Bp2_BYkl.js";import{n as te,t as ne}from"./miss-dialog-store-CNJRdTPE.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-DJkPMmCN.js";import{i as f,n as le,t as p}from"./auth-prompt-store-D3eTM4hj.js";import{a as m,n as ue}from"./receive-store-DutQ_RL1.js";import{t as de}from"./share-metadata-rows-R5Z0YM14.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-Bp2_BYkl.js";import{n as te,t as ne}from"./miss-dialog-store-CNJRdTPE.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-DJkPMmCN.js";import{i as f,n as le,t as p}from"./auth-prompt-store-D3eTM4hj.js";import{a as m,n as ue}from"./receive-store-DE9tB4jY.js";import{t as de}from"./share-metadata-rows-R5Z0YM14.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};
|