@inkeep/open-knowledge 0.42.0-beta.9 → 0.42.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acp-harness-probe-DOzi_1ED.mjs → acp-harness-probe-BC8-tjIs.mjs} +2 -2
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/assets/skills/write-skill/SKILL.md +1 -1
- package/dist/cli.mjs +50 -50
- package/dist/constants-DafFdWJR.mjs +2 -0
- package/dist/{git-handle-B1TJqyoh.mjs → git-handle-BFhoHYr0.mjs} +2 -2
- package/dist/git-handle-CRnnMEIm.mjs +1 -0
- package/dist/index.mjs +1 -1
- package/dist/init-CY3jgzP0.mjs +1 -0
- package/dist/{init-CJBY0h7f.mjs → init-D7cD6zok.mjs} +4 -4
- package/dist/{launch-json-removal-CFvmMnMo.mjs → launch-json-removal-CTJjliTF.mjs} +2 -2
- package/dist/loader-BjQNNJAX.mjs +1 -0
- package/dist/{loader-CvlOZSkR.mjs → loader-CiE2EBJO.mjs} +2 -2
- package/dist/md-manager-CAqfesEA.mjs +2 -0
- package/dist/{open-browser-CXby8R3t.mjs → open-browser-Be1y1t9d.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/preview-BMVXzzrS.mjs +1 -0
- package/dist/{preview-AkwIJF-W.mjs → preview-DXg4YbDp.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-BYOU34x5.js → ActivityModeContent-CnhDNi-c.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-CnYpYKgw.js → AgentDiffPane-BKvov9S5.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-aNRlyBpl.js → AgentThreadClientBinder-MaSL3zla.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-8sqIlsVF.js → CodeMirrorPropInput-ZGACWLSy.js} +1 -1
- package/dist/public/assets/{DocumentContext-D5LU2-RZ.js → DocumentContext-DDkluS7D.js} +20 -20
- package/dist/public/assets/{EditorModeToggle-D64ZxCxZ.js → EditorModeToggle-D0Db8Ydu.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-BeUuMUfa.js → EnableSyncConfirmDialog-B2sHRtLY.js} +1 -1
- package/dist/public/assets/FeedbackForm-DuEQbMOb.js +1 -0
- package/dist/public/assets/{GraphPanel-C_ZvUO1o.js → GraphPanel-1CKwHElx.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-CmWBO8eN.js → LintConfigEditor-DKgxJcvl.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-hL8Gk4O1.js → ManagedArtifactProperties-9e_jj3hZ.js} +1 -1
- package/dist/public/assets/{McpConsentDialogBody-BqvQlEmy.js → McpConsentDialogBody-CYOKF_sf.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-C4nx_bCP.js → MermaidDocEditor-BNURUYJE.js} +1 -1
- package/dist/public/assets/{PropertyPanel-DlcDB4qF.js → PropertyPanel-BMIcO_AS.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-Cz6r8X4G.js → ReportBugDialogBody-ByMe7BRT.js} +2 -2
- package/dist/public/assets/{SchemaConfigEditor-CRmLZgz9.js → SchemaConfigEditor-D7xbhgl6.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-DqSzMMsr.js → SettingsDialogBody-Bkz3Bpgp.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-CIds8xzv.js → ShareBranchSwitchDialog-C6G5A_aK.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-BAEP9cfe.js → ShareReceiveDialog-DLEkjmkI.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-DgHALd8T.js → ShareReceiveMissDialog-Ls1ECEge.js} +1 -1
- package/dist/public/assets/{SkillEditorActions-CJRnDLA3.js → SkillEditorActions-AGeWFFyT.js} +1 -1
- package/dist/public/assets/{SourceEditor-DBo24Kh4.js → SourceEditor-DI6JkRTr.js} +1 -1
- package/dist/public/assets/{TerminalPanel-DyeEsFY8.js → TerminalPanel-Bf_h8SIB.js} +1 -1
- package/dist/public/assets/{TerminalSessionsHost-C_Kpm1av.js → TerminalSessionsHost-B2cWbpj-.js} +2 -2
- package/dist/public/assets/{TerminalWindowApp-B2Q31qSO.js → TerminalWindowApp-2yCXBcQc.js} +1 -1
- package/dist/public/assets/ThreadView-D2BFrI_O.js +6 -0
- package/dist/public/assets/{TimelineDiffPane-94ZlUQPR.js → TimelineDiffPane-B9KqEt7q.js} +1 -1
- package/dist/public/assets/{agent-diff-store-Nx0XQusg.js → agent-diff-store-Bi0IQPgd.js} +1 -1
- package/dist/public/assets/{agent-visibility-CnzdlhVC.js → agent-visibility-HpfSUFqP.js} +1 -1
- package/dist/public/assets/{auth-state-cache-D-o9mDQf.js → auth-state-cache-BUVYaS5m.js} +1 -1
- package/dist/public/assets/client-version-FVbajnsJ.js +1 -0
- package/dist/public/assets/{config-provider-CGoD2yzK.js → config-provider-DIuwNlqX.js} +1 -1
- package/dist/public/assets/{dist-Dxs5l5f3.js → dist-Cal4LUep.js} +1 -1
- package/dist/public/assets/{doc-hash-BmhDnlQv.js → doc-hash-BSK-KaTu.js} +1 -1
- package/dist/public/assets/{documents-events-CnYTr2EX.js → documents-events-1HWCdfoh.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-CqsJyRKs.js → file-tree-adapter-Dw7Dgyj1.js} +1 -1
- package/dist/public/assets/{file-tree-utils-DT-xGfQd.js → file-tree-utils-DiUPuK3N.js} +1 -1
- package/dist/public/assets/{globals-C6WpSvCs.js → globals-CXEWtNVL.js} +1 -1
- package/dist/public/assets/globals-GYHxaktb.css +1 -0
- package/dist/public/assets/index-Bh6-_Nba.js +2014 -0
- package/dist/public/assets/{lint-config-client-DWwcbNDR.js → lint-config-client-G_mrikOJ.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-FIuqfE86.js → markdownlint-rule-browser-rS3aDGOb.js} +1 -1
- package/dist/public/assets/{navigation-targets-WiJR7LAU.js → navigation-targets-Ci2h-vaL.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-epta6SQV.js → open-managed-artifact-tab-DfGutPkc.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-DEu4B-Yy.js → pending-receive-nav-store-BuGLGemz.js} +1 -1
- package/dist/public/assets/{prop-types-Dq1Y_y68.js → prop-types-B-N3_i3c.js} +1 -1
- package/dist/public/assets/{receive-store-iF35zQOA.js → receive-store-CL0RH8Oa.js} +1 -1
- package/dist/public/assets/{selection-context-ES61tXh3.js → selection-context-zsjvL-8N.js} +1 -1
- package/dist/public/assets/{skill-actions-CnQNy6QY.js → skill-actions-C_5-d4BC.js} +1 -1
- package/dist/public/assets/{skills-api-D3bQVQ4F.js → skills-api-ChYiP1Zv.js} +1 -1
- package/dist/public/assets/{src-DL0JxhQ2.js → src-D8jPu2QV.js} +1 -1
- package/dist/public/assets/{tag-pill-input-DC-n23FS.js → tag-pill-input-B27HgfRy.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-B61RCsTX.js → target-navigation-intent-ClG4AlV8.js} +1 -1
- package/dist/public/assets/{telemetry-impl-B0xfYfCD.js → telemetry-impl-DXiL3sBk.js} +1 -1
- package/dist/public/assets/{telemetry-startup-BYP0kNl2.js → telemetry-startup-Db44p95P.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-CY0gttpS.js → terminal-launch-events-N4CMVbPT.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-BO22BE3r.js → terminal-telemetry-DxTZB2oZ.js} +1 -1
- package/dist/public/assets/thread-client-CurKSSA8.js +1 -0
- package/dist/public/assets/{typing-burst-detector-CqVsFepb.js → typing-burst-detector-BP7d86JP.js} +1 -1
- package/dist/public/assets/{uninstall-CU9G6dEv.js → uninstall-DHjtqCbn.js} +1 -1
- package/dist/public/assets/{use-activity-panel-AnCM2KLb.js → use-activity-panel-35_3901z.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-r5IzVx3u.js → use-apply-config-color-theme-CK97Jvup.js} +1 -1
- package/dist/public/assets/{use-collab-url-C1DXOS9I.js → use-collab-url-D0INpn_f.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-rgABb9gP.js → use-live-xterm-theme-C-fHLeXw.js} +1 -1
- package/dist/public/assets/{use-settings-route-B-L25JMs.js → use-settings-route-CXFzIfYo.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-8hGsIhI1.js → use-terminal-enabled-fhwpyN81.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-BigQON95.js → use-timeline-entry-diff-CHWJnnz2.js} +1 -1
- package/dist/public/assets/{use-workspace-NdYT_dp2.js → use-workspace-3T40FR83.js} +1 -1
- package/dist/public/assets/{workspace-paths-ai6F0DQ3.js → workspace-paths-B-NChZS2.js} +1 -1
- package/dist/public/index.html +37 -37
- package/dist/public/uninstall.html +4 -4
- package/dist/{repair-launch-json-CAdtcpGt.mjs → repair-launch-json-CyiLC6sz.mjs} +2 -2
- package/dist/{repair-mcp-configs-BlUiHB3J.mjs → repair-mcp-configs-MZhuDeWK.mjs} +2 -2
- package/dist/repair-skills-B1Zc-g_X.mjs +1 -0
- package/dist/{repair-skills-DllMOsvZ.mjs → repair-skills-CBmnNSO7.mjs} +2 -2
- package/dist/server-lock-DKRUWCqU.mjs +1 -0
- package/dist/{server-lock-Cr23NqXF.mjs → server-lock-vdpThyb4.mjs} +2 -2
- package/dist/{src-C4H4J7S8.mjs → src--Oy-0xgD.mjs} +2 -2
- package/dist/{src-CJ8mKCzo.mjs → src-DtcKZLt0.mjs} +87 -87
- package/dist/{src-CIFd3tOE.mjs → src-mOlBaMpr.mjs} +320 -320
- package/dist/{src-DHVO9P4d.mjs → src-o9XsfdYT.mjs} +1 -1
- package/dist/{start-DsU4nHte.mjs → start-BRjY-38U.mjs} +2 -2
- package/dist/start-BnM87E8e.mjs +1 -0
- package/dist/{write-project-skill-CeYehb7h.mjs → write-project-skill-B_HecSEZ.mjs} +4 -4
- package/package.json +4 -4
- package/dist/constants-BU4A6vbq.mjs +0 -2
- package/dist/git-handle-Dqp-QyuN.mjs +0 -1
- package/dist/init-Byoir7UR.mjs +0 -1
- package/dist/loader-BlJfxAty.mjs +0 -1
- package/dist/md-manager-B4llsKsm.mjs +0 -2
- package/dist/preview-ChQ6Nj5u.mjs +0 -1
- package/dist/public/assets/FeedbackForm-3Fe-DlHM.js +0 -1
- package/dist/public/assets/ThreadView-_sgiyOMC.js +0 -6
- package/dist/public/assets/client-version-CaNXATg1.js +0 -1
- package/dist/public/assets/globals-DF_8aGgC.css +0 -1
- package/dist/public/assets/index-e9suledE.js +0 -2014
- package/dist/public/assets/thread-client-CXDtD9Ce.js +0 -1
- package/dist/repair-skills-Buq5QlSJ.mjs +0 -1
- package/dist/server-lock-D335a5oG.mjs +0 -1
- package/dist/start-BcW2zDmT.mjs +0 -1
package/dist/public/assets/{ReportBugDialogBody-Cz6r8X4G.js → ReportBugDialogBody-ByMe7BRT.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./createLucideIcon-DAkhoPjT.js";import{t as s}from"./button-Gol9BgNB.js";import{a as c,c as l,i as u,n as d,o as f,s as p,t as m}from"./dialog-TkFkuYVg.js";import{t as h}from"./checkbox-DY-vIhnZ.js";import{o as g}from"./dist-
|
|
2
|
-
`);return n===``?r:`${n}\n\n${r}`}function fe(e){let t=[`Crash source: ${e.source}`];return e.docName!==void 0&&t.push(`Document: ${e.docName}`),e.errorMessage!==void 0&&t.push(`Error: ${e.errorMessage}`),t}function pe(e){return[`Crash source: ${e.kind===`render-process-gone`?`renderer process crash (reason: ${e.context.reason})`:e.kind===`child-process-gone`?`${e.context.processType} process crash (reason: ${e.context.reason})`:e.context.dirtyShutdown?`previous session ended without a clean quit`:`new crash dump found from the previous session`}`,`Crash event: ${e.eventId}`]}var me={step:`compose`,creating:!1,createError:null};function he(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.max(1,Math.round(e/1024))} KB`:`${e} B`}function T(e){return e.split(/[\\/]/).pop()??e}function ge(e){return e.summary.files.some(e=>e.startsWith(`extra/`)&&e!==g)}function E(e){let t=(0,ce.c)(93),{open:n,onOpenChange:a,systemWide:o,crashContext:g,crashInvite:x,screenshot:oe}=e,w=o===void 0?!1:o,T=oe===void 0?null:oe,{_:E}=i(),[D,O]=(0,S.useState)(me),[k,be]=(0,S.useState)(``),[A,xe]=(0,S.useState)(g!==void 0||x!==void 0),j=x?.minidumpAvailable===!0,[M,Se]=(0,S.useState)(j),[N,Ce]=(0,S.useState)(!0),[we,Te]=(0,S.useState)(0),P=(0,S.useRef)(0),Ee=(0,S.useId)(),De=(0,S.useId)(),Oe=(0,S.useId)(),F=(0,S.useId)(),I=(0,S.useId)(),L=(0,S.useId)(),R=(0,S.useId)(),z=(0,S.useId)(),B=(0,S.useId)(),V=(0,S.useId)(),H=(0,S.useId)(),U=D.step===`sending`,ke;t[0]!==g||t[1]!==x?(ke=g===void 0?x===void 0?void 0:pe(x):fe(g),t[0]=g,t[1]=x,t[2]=ke):ke=t[2];let W=ke,Ae,je;t[3]===U?(Ae=t[4],je=t[5]):(Ae=()=>{if(!U)return;Te(0);let e=Date.now(),t=setInterval(()=>{let t=(Date.now()-e)/1e3;Te(Math.min(.9,1-Math.exp(-t/3)))},200);return()=>{clearInterval(t)}},je=[U],t[3]=U,t[4]=Ae,t[5]=je),(0,S.useEffect)(Ae,je);let Me;t[6]!==g||t[7]!==j||t[8]!==x||t[9]!==a||t[10]!==D.step?(Me=function(e){!e&&D.step===`sending`||(e||(P.current+=1,(D.step===`success`||D.step===`email`||D.step===`failure`)&&(be(``),xe(g!==void 0||x!==void 0),Se(j),Ce(!0)),O(me)),a(e))},t[6]=g,t[7]=j,t[8]=x,t[9]=a,t[10]=D.step,t[11]=Me):Me=t[11];let G=Me,Ne;t[12]!==E||t[13]!==j||t[14]!==A||t[15]!==M||t[16]!==N||t[17]!==k||t[18]!==W||t[19]!==T?(Ne=async function(){let e=window.okDesktop?.bugReport;if(!e){O({step:`compose`,creating:!1,createError:E({id:`_0JUKX`})});return}let t=P.current+=1;O({step:`compose`,creating:!0,createError:null});let n=await e.create({level:A?`full`:`standard`,note:de(k,W),...j?{includeCrashDump:M}:{},...T===null?{}:{includeScreenshot:N}});P.current===t&&(n.ok?O({step:`review`,report:{zipPath:n.zipPath,zipSizeBytes:n.zipSizeBytes,summary:n.summary}}):O({step:`compose`,creating:!1,createError:n.error}))},t[12]=E,t[13]=j,t[14]=A,t[15]=M,t[16]=N,t[17]=k,t[18]=W,t[19]=T,t[20]=Ne):Ne=t[20];let Pe=Ne,Fe;t[21]!==k||t[22]!==W?(Fe=async function(e){let t=window.okDesktop?.bugReport;if(!t)return;let n=P.current+=1;O({step:`sending`,report:e});let r=await t.send({zipPath:e.zipPath,metadata:{level:e.summary.level,systemWide:e.summary.systemWide,projectSlug:e.summary.projectSlug,note:de(k,W)}});P.current===n&&(r.ok?O({step:`success`,report:e,reference:r.reference}):r.reason===`email-draft`?O({step:`email`,report:e,mailtoUrl:r.fallback.mailtoUrl}):O({step:`failure`,report:e,mailtoUrl:r.fallback.mailtoUrl}))},t[21]=k,t[22]=W,t[23]=Fe):Fe=t[23];let K=Fe,Ie;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=function(e){P.current+=1,O({step:`review`,report:e})},t[24]=Ie):Ie=t[24];let Le=Ie,Re;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(Re=function(e){window.okDesktop?.shell.showItemInFolder(e)},t[25]=Re):Re=t[25];let ze=Re,Be;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(Be=function(e){window.okDesktop?.shell.openExternal(e)},t[26]=Be):Be=t[26];let Ve=Be,He;t[27]===we?He=t[28]:(He=Math.round(we*100),t[27]=we,t[28]=He);let Ue=He,We=!U,q;t[29]!==E||t[30]!==g||t[31]!==j||t[32]!==x||t[33]!==A||t[34]!==I||t[35]!==F||t[36]!==R||t[37]!==L||t[38]!==Pe||t[39]!==G||t[40]!==M||t[41]!==N||t[42]!==Oe||t[43]!==De||t[44]!==k||t[45]!==Ee||t[46]!==D.createError||t[47]!==D.creating||t[48]!==D.step||t[49]!==T||t[50]!==B||t[51]!==z||t[52]!==w||t[53]!==H?(q=D.step===`compose`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(p,{children:[(0,C.jsx)(l,{children:(0,C.jsx)(r,{id:`cd5EXh`})}),x===void 0&&(0,C.jsx)(c,{children:(0,C.jsx)(r,{id:`rD-woT`})})]}),(0,C.jsxs)(d,{className:`flex flex-col gap-5`,children:[x!==void 0&&(0,C.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-md border border-chart-3/35 bg-chart-3/10 px-3 py-2.5 text-sm`,children:[(0,C.jsx)(te,{className:`mt-0.5 size-4 shrink-0 text-chart-3`,"aria-hidden":`true`}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`font-medium`,children:(0,C.jsx)(r,{id:`_IGfXZ`})}),(0,C.jsx)(c,{className:`mt-0.5 text-xs`,children:(0,C.jsx)(r,{id:`03wKPg`})})]})]}),D.createError!==null&&(0,C.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-2.5 rounded-md border border-destructive/35 bg-destructive/10 px-3 py-2.5 text-sm`,children:[(0,C.jsx)(v,{className:`mt-0.5 size-4 shrink-0 text-destructive`,"aria-hidden":`true`}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`font-medium`,children:(0,C.jsx)(r,{id:`wVa83H`})}),(0,C.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:D.createError}),(0,C.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:(0,C.jsx)(r,{id:`5PHgV2`,components:{0:(0,C.jsx)(`code`,{className:`font-mono`})}})})]})]}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,C.jsxs)(`label`,{htmlFor:Ee,className:`text-sm font-medium`,children:[x===void 0?(0,C.jsx)(r,{id:`y_K0Dz`}):(0,C.jsx)(r,{id:`60vpJN`}),` `,(0,C.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:(0,C.jsx)(r,{id:`NzluOx`})})]}),(0,C.jsx)(ae,{id:Ee,value:k,onChange:e=>be(e.target.value),placeholder:E(x===void 0?{id:`YLMBSd`}:{id:`T3j-7o`}),rows:3,className:`resize-none`,disabled:D.creating})]}),(0,C.jsxs)(`div`,{role:`group`,"aria-labelledby":H,className:`flex flex-col gap-3.5`,children:[(0,C.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,C.jsx)(`p`,{id:H,className:`text-sm font-medium`,children:(0,C.jsx)(r,{id:`WJjviG`})}),x===void 0&&(0,C.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:g===void 0?(0,C.jsx)(r,{id:`2H43L8`}):(0,C.jsx)(r,{id:`GZzDqc`})})]}),(0,C.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,C.jsx)(h,{id:De,checked:!0,disabled:!0,"aria-describedby":Oe,className:`mt-0.5`}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,C.jsxs)(`label`,{htmlFor:De,className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,C.jsx)(r,{id:`FgRAvd`}),(0,C.jsx)(re,{variant:`primary`,className:`text-2xs`,children:(0,C.jsx)(r,{id:`C0hoX6`})})]}),(0,C.jsx)(`p`,{id:Oe,className:`text-1sm text-muted-foreground`,children:w?(0,C.jsx)(r,{id:`ZoOlzR`}):(0,C.jsx)(r,{id:`2FnYUD`})})]})]}),(0,C.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,C.jsx)(h,{id:F,checked:A,onCheckedChange:e=>xe(e===!0),"aria-describedby":I,disabled:D.creating,className:`mt-0.5`}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,C.jsx)(`label`,{htmlFor:F,className:`text-sm font-medium`,children:(0,C.jsx)(r,{id:`zvjCD4`})}),(0,C.jsx)(`p`,{id:I,className:`text-1sm text-muted-foreground`,children:(0,C.jsx)(r,{id:`ULRb5t`})})]})]}),T!==null&&(0,C.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,C.jsx)(h,{id:z,checked:N,onCheckedChange:e=>Ce(e===!0),"aria-describedby":B,disabled:D.creating,className:`mt-0.5`}),(0,C.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,C.jsx)(`label`,{htmlFor:z,className:`text-sm font-medium`,children:(0,C.jsx)(r,{id:`IxyZXD`})}),(0,C.jsx)(`p`,{id:B,className:`text-1sm text-muted-foreground`,children:(0,C.jsx)(r,{id:`yzYE4B`})}),(0,C.jsx)(`div`,{className:`mt-2 overflow-hidden rounded-md border bg-muted/40`,children:(0,C.jsx)(`img`,{src:T.dataUrl,alt:E({id:`WuntOK`}),className:`block max-h-44 w-full object-contain transition-opacity motion-reduce:transition-none ${N?`opacity-100`:`opacity-40`}`})})]})]}),j&&(0,C.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,C.jsx)(h,{id:L,checked:M,onCheckedChange:e=>Se(e===!0),"aria-describedby":R,disabled:D.creating,className:`mt-0.5`}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,C.jsx)(`label`,{htmlFor:L,className:`text-sm font-medium`,children:(0,C.jsx)(r,{id:`8TvlHF`})}),(0,C.jsx)(`p`,{id:R,className:`text-1sm text-muted-foreground`,children:(0,C.jsx)(r,{id:`jnCROW`})})]})]})]}),x===void 0&&g===void 0?(0,C.jsx)(ee,{}):null]}),(0,C.jsxs)(f,{children:[(0,C.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>G(!1),children:x===void 0?(0,C.jsx)(r,{id:`dEgA5A`}):(0,C.jsx)(r,{id:`PBxg_E`})}),(0,C.jsxs)(s,{onClick:()=>void Pe(),disabled:D.creating,children:[D.creating&&(0,C.jsx)(b,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":`true`}),(0,C.jsx)(r,{id:`Si7mIR`})]})]})]}),t[29]=E,t[30]=g,t[31]=j,t[32]=x,t[33]=A,t[34]=I,t[35]=F,t[36]=R,t[37]=L,t[38]=Pe,t[39]=G,t[40]=M,t[41]=N,t[42]=Oe,t[43]=De,t[44]=k,t[45]=Ee,t[46]=D.createError,t[47]=D.creating,t[48]=D.step,t[49]=T,t[50]=B,t[51]=z,t[52]=w,t[53]=H,t[54]=q):q=t[54];let J;t[55]!==K||t[56]!==D.report||t[57]!==D.step?(J=D.step===`review`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(p,{children:[(0,C.jsx)(l,{children:(0,C.jsx)(r,{id:`2AIVbm`})}),(0,C.jsx)(c,{children:(0,C.jsx)(r,{id:`3l_cXP`})})]}),(0,C.jsxs)(d,{className:`flex flex-col gap-4`,children:[(0,C.jsx)(ye,{zipPath:D.report.zipPath,zipSizeBytes:D.report.zipSizeBytes,fileCount:D.report.summary.files.length,rawDumpIncluded:ge(D.report),onReveal:ze}),(0,C.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border bg-muted/50 px-3 py-2.5 text-xs text-muted-foreground`,children:[(0,C.jsx)(se,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,C.jsx)(`span`,{children:(0,C.jsx)(r,{id:`-o5XAG`})})]})]}),(0,C.jsxs)(f,{className:`sm:justify-between`,children:[(0,C.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>O(me),children:(0,C.jsx)(r,{id:`iH8pgl`})}),(0,C.jsx)(s,{onClick:()=>void K(D.report),children:(0,C.jsx)(r,{id:`O9oQJS`})})]})]}),t[55]=K,t[56]=D.report,t[57]=D.step,t[58]=J):J=t[58];let Y;t[59]!==E||t[60]!==D.report||t[61]!==D.step||t[62]!==Ue?(Y=D.step===`sending`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(p,{children:[(0,C.jsx)(l,{children:(0,C.jsx)(r,{id:`M5_9s2`})}),(0,C.jsx)(c,{className:`sr-only`,children:(0,C.jsx)(r,{id:`MJqRO6`})})]}),(0,C.jsxs)(d,{className:`flex flex-col gap-3`,children:[(0,C.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2.5 text-sm`,children:[(0,C.jsx)(b,{className:`size-4 shrink-0 animate-spin text-primary motion-reduce:animate-none`,"aria-hidden":`true`}),(0,C.jsx)(r,{id:`qmL1UG`}),(0,C.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:(0,C.jsx)(r,{id:`JJcBCm`,values:{0:he(D.report.zipSizeBytes)}})})]}),(0,C.jsx)(`div`,{role:`progressbar`,"aria-label":E({id:`M5_9s2`}),className:`h-1.5 overflow-hidden rounded-full bg-secondary`,children:(0,C.jsx)(`div`,{className:`h-full rounded-full bg-primary`,style:{width:`${Ue}%`}})})]}),(0,C.jsxs)(f,{className:`sm:justify-between`,children:[(0,C.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>Le(D.report),children:(0,C.jsx)(r,{id:`dEgA5A`})}),(0,C.jsx)(s,{disabled:!0,children:(0,C.jsx)(r,{id:`O9oQJS`})})]})]}),t[59]=E,t[60]=D.report,t[61]=D.step,t[62]=Ue,t[63]=Y):Y=t[63];let X;t[64]!==E||t[65]!==G||t[66]!==D.reference||t[67]!==D.step||t[68]!==V?(X=D.step===`success`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(d,{children:(0,C.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,C.jsxs)(`div`,{role:`status`,className:`flex flex-col gap-3`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(_,{className:`size-5 shrink-0 text-primary`,"aria-hidden":`true`}),(0,C.jsx)(l,{children:(0,C.jsx)(r,{id:`IYciRC`})})]}),(0,C.jsx)(c,{children:(0,C.jsx)(r,{id:`2myNzt`})})]}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,C.jsx)(`label`,{htmlFor:V,className:`text-sm font-medium`,children:(0,C.jsx)(r,{id:`M-IF14`})}),(0,C.jsxs)(`div`,{className:`relative`,children:[(0,C.jsx)(ne,{id:V,readOnly:!0,value:D.reference,onFocus:ve,onClick:_e,className:`select-all bg-muted pr-9 font-mono text-sm font-medium tracking-wide`}),(0,C.jsx)(`div`,{className:`absolute inset-y-0 right-1 flex items-center`,children:(0,C.jsx)(y,{copyContent:D.reference,clipboardWrite:ie})})]})]}),(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,C.jsx)(r,{id:`fxJk_6`,components:{0:(0,C.jsx)(`span`,{className:`font-medium text-foreground`}),1:(0,C.jsx)(ue,{href:le(E({id:`qEEfPk`,values:{0:D.reference}}))})}})})]})}),(0,C.jsx)(f,{children:(0,C.jsx)(s,{onClick:()=>G(!1),children:(0,C.jsx)(r,{id:`DPfwMq`})})})]}),t[64]=E,t[65]=G,t[66]=D.reference,t[67]=D.step,t[68]=V,t[69]=X):X=t[69];let Z;t[70]!==G||t[71]!==D.mailtoUrl||t[72]!==D.report||t[73]!==D.step?(Z=D.step===`email`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(p,{children:[(0,C.jsx)(l,{children:(0,C.jsx)(r,{id:`6zzhQL`})}),(0,C.jsx)(c,{children:(0,C.jsx)(r,{id:`UTgWxm`})})]}),(0,C.jsxs)(d,{className:`flex flex-col gap-4`,children:[(0,C.jsx)(ye,{zipPath:D.report.zipPath,zipSizeBytes:D.report.zipSizeBytes,fileCount:D.report.summary.files.length,rawDumpIncluded:ge(D.report),onReveal:ze}),(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,C.jsx)(r,{id:`9XIEYq`,components:{0:(0,C.jsx)(ue,{href:D.mailtoUrl})}})})]}),(0,C.jsxs)(f,{className:`sm:justify-between`,children:[(0,C.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>G(!1),children:(0,C.jsx)(r,{id:`yz7wBu`})}),(0,C.jsx)(s,{onClick:()=>Ve(D.mailtoUrl),children:(0,C.jsx)(r,{id:`GuaJb-`})})]})]}),t[70]=G,t[71]=D.mailtoUrl,t[72]=D.report,t[73]=D.step,t[74]=Z):Z=t[74];let Q;t[75]!==G||t[76]!==K||t[77]!==D.mailtoUrl||t[78]!==D.report||t[79]!==D.step?(Q=D.step===`failure`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(p,{children:[(0,C.jsx)(l,{children:(0,C.jsx)(r,{id:`Wi-VWy`})}),(0,C.jsx)(c,{className:`sr-only`,children:(0,C.jsx)(r,{id:`1OKzC_`})})]}),(0,C.jsxs)(d,{className:`flex flex-col gap-4`,children:[(0,C.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-2.5 rounded-md border border-destructive/35 bg-destructive/10 px-3 py-2.5 text-sm`,children:[(0,C.jsx)(v,{className:`mt-0.5 size-4 shrink-0 text-destructive`,"aria-hidden":`true`}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`font-medium`,children:(0,C.jsx)(r,{id:`Oawo4U`})}),(0,C.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:(0,C.jsx)(r,{id:`2-CeZn`})})]})]}),(0,C.jsx)(ye,{zipPath:D.report.zipPath,zipSizeBytes:D.report.zipSizeBytes,fileCount:null,rawDumpIncluded:ge(D.report),onReveal:ze}),(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,C.jsx)(r,{id:`9XIEYq`,components:{0:(0,C.jsx)(ue,{href:D.mailtoUrl})}})})]}),(0,C.jsxs)(f,{className:`sm:justify-between`,children:[(0,C.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>G(!1),children:(0,C.jsx)(r,{id:`yz7wBu`})}),(0,C.jsxs)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row`,children:[(0,C.jsx)(s,{variant:`outline`,className:`font-mono uppercase`,onClick:()=>void K(D.report),children:(0,C.jsx)(r,{id:`KDw4GX`})}),(0,C.jsx)(s,{onClick:()=>Ve(D.mailtoUrl),children:(0,C.jsx)(r,{id:`GuaJb-`})})]})]})]}),t[75]=G,t[76]=K,t[77]=D.mailtoUrl,t[78]=D.report,t[79]=D.step,t[80]=Q):Q=t[80];let $;t[81]!==We||t[82]!==q||t[83]!==J||t[84]!==Y||t[85]!==X||t[86]!==Z||t[87]!==Q?($=(0,C.jsxs)(u,{className:`sm:max-w-xl`,showCloseButton:We,children:[q,J,Y,X,Z,Q]}),t[81]=We,t[82]=q,t[83]=J,t[84]=Y,t[85]=X,t[86]=Z,t[87]=Q,t[88]=$):$=t[88];let Ge;return t[89]!==G||t[90]!==n||t[91]!==$?(Ge=(0,C.jsx)(m,{open:n,onOpenChange:G,children:$}),t[89]=G,t[90]=n,t[91]=$,t[92]=Ge):Ge=t[92],Ge}function _e(e){return e.currentTarget.select()}function ve(e){return e.currentTarget.select()}function ye(e){let t=(0,ce.c)(23),{zipPath:n,zipSizeBytes:i,fileCount:a,rawDumpIncluded:o,onReveal:c}=e,l;t[0]===n?l=t[1]:(l=T(n),t[0]=n,t[1]=l);let u=l,d;t[2]===i?d=t[3]:(d=he(i),t[2]=i,t[3]=d);let f=d,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,C.jsx)(`div`,{className:`flex items-center justify-center size-8 rounded-md bg-muted`,children:(0,C.jsx)(oe,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`})}),t[4]=p):p=t[4];let m;t[5]===u?m=t[6]:(m=(0,C.jsx)(`p`,{className:`truncate text-1sm`,title:u,children:u}),t[5]=u,t[6]=m);let h;t[7]!==a||t[8]!==o||t[9]!==f?(h=(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a===null?o?(0,C.jsx)(r,{id:`_FLBbi`,values:{sizeText:f}}):(0,C.jsx)(r,{id:`89y7ar`,values:{sizeText:f}}):o?(0,C.jsx)(r,{id:`sn5BEU`,values:{sizeText:f,fileCount:a}}):(0,C.jsx)(r,{id:`3DJEEt`,values:{sizeText:f,fileCount:a}})}),t[7]=a,t[8]=o,t[9]=f,t[10]=h):h=t[10];let g;t[11]!==m||t[12]!==h?(g=(0,C.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[m,h]}),t[11]=m,t[12]=h,t[13]=g):g=t[13];let _;t[14]!==c||t[15]!==n?(_=()=>c(n),t[14]=c,t[15]=n,t[16]=_):_=t[16];let v;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,C.jsx)(r,{id:`LtSYdi`}),t[17]=v):v=t[17];let y;t[18]===_?y=t[19]:(y=(0,C.jsx)(s,{variant:`link`,className:`h-auto shrink-0 p-0 text-xs`,onClick:_,children:v}),t[18]=_,t[19]=y);let b;return t[20]!==g||t[21]!==y?(b=(0,C.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md border px-3 py-2.5`,children:[p,g,y]}),t[20]=g,t[21]=y,t[22]=b):b=t[22],b}export{E as default};
|
|
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"./createLucideIcon-DAkhoPjT.js";import{t as s}from"./button-Gol9BgNB.js";import{a as c,c as l,i as u,n as d,o as f,s as p,t as m}from"./dialog-TkFkuYVg.js";import{t as h}from"./checkbox-DY-vIhnZ.js";import{o as g}from"./dist-Cal4LUep.js";import{t as _}from"./check-GqWaoTdV.js";import{n as v,t as y}from"./CopyButton-1Q6Wnnjb.js";import{t as b}from"./loader-circle-Cg5SU7AZ.js";import{n as ee}from"./BugReportHistory-B0qbbAw0.js";import{t as te}from"./triangle-alert-Clgvyc7B.js";import{t as ne}from"./input-D0ZW0Opq.js";import{t as re}from"./badge-Dba4cvJR.js";import{t as x}from"./external-link-T4Nj1gcG.js";import{n as ie}from"./clipboard-adapter--Ja4oXEM.js";import{t as ae}from"./textarea-RSYJwPz9.js";var oe=o(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),se=o(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),ce=a(),S=e(n(),1),C=t(),w=`support@inkeep.com`;function le(e){return`mailto:${w}?subject=${encodeURIComponent(e)}`}function ue(e){let t=(0,ce.c)(7),{href:n}=e,r,i;t[0]===n?(r=t[1],i=t[2]):(r=e=>x(e,n),i=e=>x(e,n),t[0]=n,t[1]=r,t[2]=i);let a;return t[3]!==n||t[4]!==r||t[5]!==i?(a=(0,C.jsx)(`a`,{href:n,onClick:r,onAuxClick:i,className:`text-primary hover:underline`,children:w}),t[3]=n,t[4]=r,t[5]=i,t[6]=a):a=t[6],a}function de(e,t){let n=e.trim();if(t===void 0)return n===``?void 0:n;let r=t.join(`
|
|
2
|
+
`);return n===``?r:`${n}\n\n${r}`}function fe(e){let t=[`Crash source: ${e.source}`];return e.docName!==void 0&&t.push(`Document: ${e.docName}`),e.errorMessage!==void 0&&t.push(`Error: ${e.errorMessage}`),t}function pe(e){return[`Crash source: ${e.kind===`render-process-gone`?`renderer process crash (reason: ${e.context.reason})`:e.kind===`child-process-gone`?`${e.context.processType} process crash (reason: ${e.context.reason})`:e.context.dirtyShutdown?`previous session ended without a clean quit`:`new crash dump found from the previous session`}`,`Crash event: ${e.eventId}`]}var me={step:`compose`,creating:!1,createError:null};function he(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.max(1,Math.round(e/1024))} KB`:`${e} B`}function T(e){return e.split(/[\\/]/).pop()??e}function ge(e){return e.summary.files.some(e=>e.startsWith(`extra/`)&&e!==g)}function E(e){let t=(0,ce.c)(93),{open:n,onOpenChange:a,systemWide:o,crashContext:g,crashInvite:x,screenshot:oe}=e,w=o===void 0?!1:o,T=oe===void 0?null:oe,{_:E}=i(),[D,O]=(0,S.useState)(me),[k,be]=(0,S.useState)(``),[A,xe]=(0,S.useState)(g!==void 0||x!==void 0),j=x?.minidumpAvailable===!0,[M,Se]=(0,S.useState)(j),[N,Ce]=(0,S.useState)(!0),[we,Te]=(0,S.useState)(0),P=(0,S.useRef)(0),Ee=(0,S.useId)(),De=(0,S.useId)(),Oe=(0,S.useId)(),F=(0,S.useId)(),I=(0,S.useId)(),L=(0,S.useId)(),R=(0,S.useId)(),z=(0,S.useId)(),B=(0,S.useId)(),V=(0,S.useId)(),H=(0,S.useId)(),U=D.step===`sending`,ke;t[0]!==g||t[1]!==x?(ke=g===void 0?x===void 0?void 0:pe(x):fe(g),t[0]=g,t[1]=x,t[2]=ke):ke=t[2];let W=ke,Ae,je;t[3]===U?(Ae=t[4],je=t[5]):(Ae=()=>{if(!U)return;Te(0);let e=Date.now(),t=setInterval(()=>{let t=(Date.now()-e)/1e3;Te(Math.min(.9,1-Math.exp(-t/3)))},200);return()=>{clearInterval(t)}},je=[U],t[3]=U,t[4]=Ae,t[5]=je),(0,S.useEffect)(Ae,je);let Me;t[6]!==g||t[7]!==j||t[8]!==x||t[9]!==a||t[10]!==D.step?(Me=function(e){!e&&D.step===`sending`||(e||(P.current+=1,(D.step===`success`||D.step===`email`||D.step===`failure`)&&(be(``),xe(g!==void 0||x!==void 0),Se(j),Ce(!0)),O(me)),a(e))},t[6]=g,t[7]=j,t[8]=x,t[9]=a,t[10]=D.step,t[11]=Me):Me=t[11];let G=Me,Ne;t[12]!==E||t[13]!==j||t[14]!==A||t[15]!==M||t[16]!==N||t[17]!==k||t[18]!==W||t[19]!==T?(Ne=async function(){let e=window.okDesktop?.bugReport;if(!e){O({step:`compose`,creating:!1,createError:E({id:`_0JUKX`})});return}let t=P.current+=1;O({step:`compose`,creating:!0,createError:null});let n=await e.create({level:A?`full`:`standard`,note:de(k,W),...j?{includeCrashDump:M}:{},...T===null?{}:{includeScreenshot:N}});P.current===t&&(n.ok?O({step:`review`,report:{zipPath:n.zipPath,zipSizeBytes:n.zipSizeBytes,summary:n.summary}}):O({step:`compose`,creating:!1,createError:n.error}))},t[12]=E,t[13]=j,t[14]=A,t[15]=M,t[16]=N,t[17]=k,t[18]=W,t[19]=T,t[20]=Ne):Ne=t[20];let Pe=Ne,Fe;t[21]!==k||t[22]!==W?(Fe=async function(e){let t=window.okDesktop?.bugReport;if(!t)return;let n=P.current+=1;O({step:`sending`,report:e});let r=await t.send({zipPath:e.zipPath,metadata:{level:e.summary.level,systemWide:e.summary.systemWide,projectSlug:e.summary.projectSlug,note:de(k,W)}});P.current===n&&(r.ok?O({step:`success`,report:e,reference:r.reference}):r.reason===`email-draft`?O({step:`email`,report:e,mailtoUrl:r.fallback.mailtoUrl}):O({step:`failure`,report:e,mailtoUrl:r.fallback.mailtoUrl}))},t[21]=k,t[22]=W,t[23]=Fe):Fe=t[23];let K=Fe,Ie;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=function(e){P.current+=1,O({step:`review`,report:e})},t[24]=Ie):Ie=t[24];let Le=Ie,Re;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(Re=function(e){window.okDesktop?.shell.showItemInFolder(e)},t[25]=Re):Re=t[25];let ze=Re,Be;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(Be=function(e){window.okDesktop?.shell.openExternal(e)},t[26]=Be):Be=t[26];let Ve=Be,He;t[27]===we?He=t[28]:(He=Math.round(we*100),t[27]=we,t[28]=He);let Ue=He,We=!U,q;t[29]!==E||t[30]!==g||t[31]!==j||t[32]!==x||t[33]!==A||t[34]!==I||t[35]!==F||t[36]!==R||t[37]!==L||t[38]!==Pe||t[39]!==G||t[40]!==M||t[41]!==N||t[42]!==Oe||t[43]!==De||t[44]!==k||t[45]!==Ee||t[46]!==D.createError||t[47]!==D.creating||t[48]!==D.step||t[49]!==T||t[50]!==B||t[51]!==z||t[52]!==w||t[53]!==H?(q=D.step===`compose`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(p,{children:[(0,C.jsx)(l,{children:(0,C.jsx)(r,{id:`cd5EXh`})}),x===void 0&&(0,C.jsx)(c,{children:(0,C.jsx)(r,{id:`rD-woT`})})]}),(0,C.jsxs)(d,{className:`flex flex-col gap-5`,children:[x!==void 0&&(0,C.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-md border border-chart-3/35 bg-chart-3/10 px-3 py-2.5 text-sm`,children:[(0,C.jsx)(te,{className:`mt-0.5 size-4 shrink-0 text-chart-3`,"aria-hidden":`true`}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`font-medium`,children:(0,C.jsx)(r,{id:`_IGfXZ`})}),(0,C.jsx)(c,{className:`mt-0.5 text-xs`,children:(0,C.jsx)(r,{id:`03wKPg`})})]})]}),D.createError!==null&&(0,C.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-2.5 rounded-md border border-destructive/35 bg-destructive/10 px-3 py-2.5 text-sm`,children:[(0,C.jsx)(v,{className:`mt-0.5 size-4 shrink-0 text-destructive`,"aria-hidden":`true`}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`font-medium`,children:(0,C.jsx)(r,{id:`wVa83H`})}),(0,C.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:D.createError}),(0,C.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:(0,C.jsx)(r,{id:`5PHgV2`,components:{0:(0,C.jsx)(`code`,{className:`font-mono`})}})})]})]}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,C.jsxs)(`label`,{htmlFor:Ee,className:`text-sm font-medium`,children:[x===void 0?(0,C.jsx)(r,{id:`y_K0Dz`}):(0,C.jsx)(r,{id:`60vpJN`}),` `,(0,C.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:(0,C.jsx)(r,{id:`NzluOx`})})]}),(0,C.jsx)(ae,{id:Ee,value:k,onChange:e=>be(e.target.value),placeholder:E(x===void 0?{id:`YLMBSd`}:{id:`T3j-7o`}),rows:3,className:`resize-none`,disabled:D.creating})]}),(0,C.jsxs)(`div`,{role:`group`,"aria-labelledby":H,className:`flex flex-col gap-3.5`,children:[(0,C.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,C.jsx)(`p`,{id:H,className:`text-sm font-medium`,children:(0,C.jsx)(r,{id:`WJjviG`})}),x===void 0&&(0,C.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:g===void 0?(0,C.jsx)(r,{id:`2H43L8`}):(0,C.jsx)(r,{id:`GZzDqc`})})]}),(0,C.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,C.jsx)(h,{id:De,checked:!0,disabled:!0,"aria-describedby":Oe,className:`mt-0.5`}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,C.jsxs)(`label`,{htmlFor:De,className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,C.jsx)(r,{id:`FgRAvd`}),(0,C.jsx)(re,{variant:`primary`,className:`text-2xs`,children:(0,C.jsx)(r,{id:`C0hoX6`})})]}),(0,C.jsx)(`p`,{id:Oe,className:`text-1sm text-muted-foreground`,children:w?(0,C.jsx)(r,{id:`ZoOlzR`}):(0,C.jsx)(r,{id:`2FnYUD`})})]})]}),(0,C.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,C.jsx)(h,{id:F,checked:A,onCheckedChange:e=>xe(e===!0),"aria-describedby":I,disabled:D.creating,className:`mt-0.5`}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,C.jsx)(`label`,{htmlFor:F,className:`text-sm font-medium`,children:(0,C.jsx)(r,{id:`zvjCD4`})}),(0,C.jsx)(`p`,{id:I,className:`text-1sm text-muted-foreground`,children:(0,C.jsx)(r,{id:`ULRb5t`})})]})]}),T!==null&&(0,C.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,C.jsx)(h,{id:z,checked:N,onCheckedChange:e=>Ce(e===!0),"aria-describedby":B,disabled:D.creating,className:`mt-0.5`}),(0,C.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,C.jsx)(`label`,{htmlFor:z,className:`text-sm font-medium`,children:(0,C.jsx)(r,{id:`IxyZXD`})}),(0,C.jsx)(`p`,{id:B,className:`text-1sm text-muted-foreground`,children:(0,C.jsx)(r,{id:`yzYE4B`})}),(0,C.jsx)(`div`,{className:`mt-2 overflow-hidden rounded-md border bg-muted/40`,children:(0,C.jsx)(`img`,{src:T.dataUrl,alt:E({id:`WuntOK`}),className:`block max-h-44 w-full object-contain transition-opacity motion-reduce:transition-none ${N?`opacity-100`:`opacity-40`}`})})]})]}),j&&(0,C.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,C.jsx)(h,{id:L,checked:M,onCheckedChange:e=>Se(e===!0),"aria-describedby":R,disabled:D.creating,className:`mt-0.5`}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,C.jsx)(`label`,{htmlFor:L,className:`text-sm font-medium`,children:(0,C.jsx)(r,{id:`8TvlHF`})}),(0,C.jsx)(`p`,{id:R,className:`text-1sm text-muted-foreground`,children:(0,C.jsx)(r,{id:`jnCROW`})})]})]})]}),x===void 0&&g===void 0?(0,C.jsx)(ee,{}):null]}),(0,C.jsxs)(f,{children:[(0,C.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>G(!1),children:x===void 0?(0,C.jsx)(r,{id:`dEgA5A`}):(0,C.jsx)(r,{id:`PBxg_E`})}),(0,C.jsxs)(s,{onClick:()=>void Pe(),disabled:D.creating,children:[D.creating&&(0,C.jsx)(b,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":`true`}),(0,C.jsx)(r,{id:`Si7mIR`})]})]})]}),t[29]=E,t[30]=g,t[31]=j,t[32]=x,t[33]=A,t[34]=I,t[35]=F,t[36]=R,t[37]=L,t[38]=Pe,t[39]=G,t[40]=M,t[41]=N,t[42]=Oe,t[43]=De,t[44]=k,t[45]=Ee,t[46]=D.createError,t[47]=D.creating,t[48]=D.step,t[49]=T,t[50]=B,t[51]=z,t[52]=w,t[53]=H,t[54]=q):q=t[54];let J;t[55]!==K||t[56]!==D.report||t[57]!==D.step?(J=D.step===`review`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(p,{children:[(0,C.jsx)(l,{children:(0,C.jsx)(r,{id:`2AIVbm`})}),(0,C.jsx)(c,{children:(0,C.jsx)(r,{id:`3l_cXP`})})]}),(0,C.jsxs)(d,{className:`flex flex-col gap-4`,children:[(0,C.jsx)(ye,{zipPath:D.report.zipPath,zipSizeBytes:D.report.zipSizeBytes,fileCount:D.report.summary.files.length,rawDumpIncluded:ge(D.report),onReveal:ze}),(0,C.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border bg-muted/50 px-3 py-2.5 text-xs text-muted-foreground`,children:[(0,C.jsx)(se,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,C.jsx)(`span`,{children:(0,C.jsx)(r,{id:`-o5XAG`})})]})]}),(0,C.jsxs)(f,{className:`sm:justify-between`,children:[(0,C.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>O(me),children:(0,C.jsx)(r,{id:`iH8pgl`})}),(0,C.jsx)(s,{onClick:()=>void K(D.report),children:(0,C.jsx)(r,{id:`O9oQJS`})})]})]}),t[55]=K,t[56]=D.report,t[57]=D.step,t[58]=J):J=t[58];let Y;t[59]!==E||t[60]!==D.report||t[61]!==D.step||t[62]!==Ue?(Y=D.step===`sending`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(p,{children:[(0,C.jsx)(l,{children:(0,C.jsx)(r,{id:`M5_9s2`})}),(0,C.jsx)(c,{className:`sr-only`,children:(0,C.jsx)(r,{id:`MJqRO6`})})]}),(0,C.jsxs)(d,{className:`flex flex-col gap-3`,children:[(0,C.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2.5 text-sm`,children:[(0,C.jsx)(b,{className:`size-4 shrink-0 animate-spin text-primary motion-reduce:animate-none`,"aria-hidden":`true`}),(0,C.jsx)(r,{id:`qmL1UG`}),(0,C.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:(0,C.jsx)(r,{id:`JJcBCm`,values:{0:he(D.report.zipSizeBytes)}})})]}),(0,C.jsx)(`div`,{role:`progressbar`,"aria-label":E({id:`M5_9s2`}),className:`h-1.5 overflow-hidden rounded-full bg-secondary`,children:(0,C.jsx)(`div`,{className:`h-full rounded-full bg-primary`,style:{width:`${Ue}%`}})})]}),(0,C.jsxs)(f,{className:`sm:justify-between`,children:[(0,C.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>Le(D.report),children:(0,C.jsx)(r,{id:`dEgA5A`})}),(0,C.jsx)(s,{disabled:!0,children:(0,C.jsx)(r,{id:`O9oQJS`})})]})]}),t[59]=E,t[60]=D.report,t[61]=D.step,t[62]=Ue,t[63]=Y):Y=t[63];let X;t[64]!==E||t[65]!==G||t[66]!==D.reference||t[67]!==D.step||t[68]!==V?(X=D.step===`success`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(d,{children:(0,C.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,C.jsxs)(`div`,{role:`status`,className:`flex flex-col gap-3`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(_,{className:`size-5 shrink-0 text-primary`,"aria-hidden":`true`}),(0,C.jsx)(l,{children:(0,C.jsx)(r,{id:`IYciRC`})})]}),(0,C.jsx)(c,{children:(0,C.jsx)(r,{id:`2myNzt`})})]}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,C.jsx)(`label`,{htmlFor:V,className:`text-sm font-medium`,children:(0,C.jsx)(r,{id:`M-IF14`})}),(0,C.jsxs)(`div`,{className:`relative`,children:[(0,C.jsx)(ne,{id:V,readOnly:!0,value:D.reference,onFocus:ve,onClick:_e,className:`select-all bg-muted pr-9 font-mono text-sm font-medium tracking-wide`}),(0,C.jsx)(`div`,{className:`absolute inset-y-0 right-1 flex items-center`,children:(0,C.jsx)(y,{copyContent:D.reference,clipboardWrite:ie})})]})]}),(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,C.jsx)(r,{id:`fxJk_6`,components:{0:(0,C.jsx)(`span`,{className:`font-medium text-foreground`}),1:(0,C.jsx)(ue,{href:le(E({id:`qEEfPk`,values:{0:D.reference}}))})}})})]})}),(0,C.jsx)(f,{children:(0,C.jsx)(s,{onClick:()=>G(!1),children:(0,C.jsx)(r,{id:`DPfwMq`})})})]}),t[64]=E,t[65]=G,t[66]=D.reference,t[67]=D.step,t[68]=V,t[69]=X):X=t[69];let Z;t[70]!==G||t[71]!==D.mailtoUrl||t[72]!==D.report||t[73]!==D.step?(Z=D.step===`email`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(p,{children:[(0,C.jsx)(l,{children:(0,C.jsx)(r,{id:`6zzhQL`})}),(0,C.jsx)(c,{children:(0,C.jsx)(r,{id:`UTgWxm`})})]}),(0,C.jsxs)(d,{className:`flex flex-col gap-4`,children:[(0,C.jsx)(ye,{zipPath:D.report.zipPath,zipSizeBytes:D.report.zipSizeBytes,fileCount:D.report.summary.files.length,rawDumpIncluded:ge(D.report),onReveal:ze}),(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,C.jsx)(r,{id:`9XIEYq`,components:{0:(0,C.jsx)(ue,{href:D.mailtoUrl})}})})]}),(0,C.jsxs)(f,{className:`sm:justify-between`,children:[(0,C.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>G(!1),children:(0,C.jsx)(r,{id:`yz7wBu`})}),(0,C.jsx)(s,{onClick:()=>Ve(D.mailtoUrl),children:(0,C.jsx)(r,{id:`GuaJb-`})})]})]}),t[70]=G,t[71]=D.mailtoUrl,t[72]=D.report,t[73]=D.step,t[74]=Z):Z=t[74];let Q;t[75]!==G||t[76]!==K||t[77]!==D.mailtoUrl||t[78]!==D.report||t[79]!==D.step?(Q=D.step===`failure`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(p,{children:[(0,C.jsx)(l,{children:(0,C.jsx)(r,{id:`Wi-VWy`})}),(0,C.jsx)(c,{className:`sr-only`,children:(0,C.jsx)(r,{id:`1OKzC_`})})]}),(0,C.jsxs)(d,{className:`flex flex-col gap-4`,children:[(0,C.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-2.5 rounded-md border border-destructive/35 bg-destructive/10 px-3 py-2.5 text-sm`,children:[(0,C.jsx)(v,{className:`mt-0.5 size-4 shrink-0 text-destructive`,"aria-hidden":`true`}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`font-medium`,children:(0,C.jsx)(r,{id:`Oawo4U`})}),(0,C.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:(0,C.jsx)(r,{id:`2-CeZn`})})]})]}),(0,C.jsx)(ye,{zipPath:D.report.zipPath,zipSizeBytes:D.report.zipSizeBytes,fileCount:null,rawDumpIncluded:ge(D.report),onReveal:ze}),(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,C.jsx)(r,{id:`9XIEYq`,components:{0:(0,C.jsx)(ue,{href:D.mailtoUrl})}})})]}),(0,C.jsxs)(f,{className:`sm:justify-between`,children:[(0,C.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>G(!1),children:(0,C.jsx)(r,{id:`yz7wBu`})}),(0,C.jsxs)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row`,children:[(0,C.jsx)(s,{variant:`outline`,className:`font-mono uppercase`,onClick:()=>void K(D.report),children:(0,C.jsx)(r,{id:`KDw4GX`})}),(0,C.jsx)(s,{onClick:()=>Ve(D.mailtoUrl),children:(0,C.jsx)(r,{id:`GuaJb-`})})]})]})]}),t[75]=G,t[76]=K,t[77]=D.mailtoUrl,t[78]=D.report,t[79]=D.step,t[80]=Q):Q=t[80];let $;t[81]!==We||t[82]!==q||t[83]!==J||t[84]!==Y||t[85]!==X||t[86]!==Z||t[87]!==Q?($=(0,C.jsxs)(u,{className:`sm:max-w-md`,showCloseButton:We,children:[q,J,Y,X,Z,Q]}),t[81]=We,t[82]=q,t[83]=J,t[84]=Y,t[85]=X,t[86]=Z,t[87]=Q,t[88]=$):$=t[88];let Ge;return t[89]!==G||t[90]!==n||t[91]!==$?(Ge=(0,C.jsx)(m,{open:n,onOpenChange:G,children:$}),t[89]=G,t[90]=n,t[91]=$,t[92]=Ge):Ge=t[92],Ge}function _e(e){return e.currentTarget.select()}function ve(e){return e.currentTarget.select()}function ye(e){let t=(0,ce.c)(23),{zipPath:n,zipSizeBytes:i,fileCount:a,rawDumpIncluded:o,onReveal:c}=e,l;t[0]===n?l=t[1]:(l=T(n),t[0]=n,t[1]=l);let u=l,d;t[2]===i?d=t[3]:(d=he(i),t[2]=i,t[3]=d);let f=d,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,C.jsx)(`div`,{className:`flex items-center justify-center size-8 rounded-md bg-muted`,children:(0,C.jsx)(oe,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`})}),t[4]=p):p=t[4];let m;t[5]===u?m=t[6]:(m=(0,C.jsx)(`p`,{className:`truncate text-1sm`,title:u,children:u}),t[5]=u,t[6]=m);let h;t[7]!==a||t[8]!==o||t[9]!==f?(h=(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a===null?o?(0,C.jsx)(r,{id:`_FLBbi`,values:{sizeText:f}}):(0,C.jsx)(r,{id:`89y7ar`,values:{sizeText:f}}):o?(0,C.jsx)(r,{id:`sn5BEU`,values:{sizeText:f,fileCount:a}}):(0,C.jsx)(r,{id:`3DJEEt`,values:{sizeText:f,fileCount:a}})}),t[7]=a,t[8]=o,t[9]=f,t[10]=h):h=t[10];let g;t[11]!==m||t[12]!==h?(g=(0,C.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[m,h]}),t[11]=m,t[12]=h,t[13]=g):g=t[13];let _;t[14]!==c||t[15]!==n?(_=()=>c(n),t[14]=c,t[15]=n,t[16]=_):_=t[16];let v;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,C.jsx)(r,{id:`LtSYdi`}),t[17]=v):v=t[17];let y;t[18]===_?y=t[19]:(y=(0,C.jsx)(s,{variant:`link`,className:`h-auto shrink-0 p-0 text-xs`,onClick:_,children:v}),t[18]=_,t[19]=y);let b;return t[20]!==g||t[21]!==y?(b=(0,C.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md border px-3 py-2.5`,children:[p,g,y]}),t[20]=g,t[21]=y,t[22]=b):b=t[22],b}export{E as default};
|
package/dist/public/assets/{SchemaConfigEditor-CRmLZgz9.js → SchemaConfigEditor-D7xbhgl6.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{s as o,t as s}from"./createLucideIcon-DAkhoPjT.js";import{t as c}from"./button-Gol9BgNB.js";import{t as l}from"./label-DyipnO5I.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./switch-DYic2V-1.js";import{t as g}from"./braces-DwnwFx_V.js";import{t as _}from"./case-sensitive-nl0tWMnZ.js";import{t as v}from"./hash-DNKDqZ18.js";import{t as y}from"./trash-2-BUuL4OCw.js";import{n as b}from"./dist-BLAMau9Z.js";import{t as x}from"./input-D0ZW0Opq.js";import{d as S,f as C,o as w,r as T,s as E}from"./lint-config-client-DWwcbNDR.js";import{n as D,r as ee,t as O}from"./EditorModeToggle-D64ZxCxZ.js";import{t as k}from"./tag-pill-input-DC-n23FS.js";import{t as te}from"./useLintConfigViewMode-BYm6FwC5.js";import{r as A,t as ne}from"./schema-fields-view-intent-Dz1ZzVCe.js";var j=s(`brackets`,[[`path`,{d:`M16 3h3a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-3`,key:`1kt8lf`}],[`path`,{d:`M8 21H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h3`,key:`gduv9`}]]),M=s(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),N=s(`toggle-left`,[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]),P=a(),re=e(n(),1),F=t(),I=[`string`,`number`,`boolean`,`array`,`object`],L=[`string`,`number`,`boolean`,`enum`,`array`,`object`],ie=[`string`,`number`,`boolean`,`enum`,`object`],R={string:{Icon:_,className:`text-green-500`},number:{Icon:v,className:`text-blue-500`},boolean:{Icon:N,className:`text-orange-500`},enum:{Icon:M,className:`text-yellow-500`},array:{Icon:j,className:`text-pink-500`},object:{Icon:g,className:`text-purple-500`}};function ae(e){let t=(0,P.c)(8),{option:n}=e,{Icon:r,className:i}=R[n],a;t[0]===i?a=t[1]:(a=o(`size-3.5 shrink-0`,i),t[0]=i,t[1]=a);let s;t[2]!==r||t[3]!==a?(s=(0,F.jsx)(r,{"aria-hidden":!0,className:a}),t[2]=r,t[3]=a,t[4]=s):s=t[4];let c;return t[5]!==n||t[6]!==s?(c=(0,F.jsxs)(`span`,{className:`flex items-center gap-2`,children:[s,n]}),t[5]=n,t[6]=s,t[7]=c):c=t[7],c}function oe(e){let t=(0,P.c)(5),{option:n}=e,{Icon:r,className:i}=R[n],a;t[0]===i?a=t[1]:(a=o(`size-4 shrink-0`,i),t[0]=i,t[1]=a);let s;return t[2]!==r||t[3]!==a?(s=(0,F.jsx)(r,{"aria-hidden":!0,className:a}),t[2]=r,t[3]=a,t[4]=s):s=t[4],s}var se=4,ce=new Set([`$schema`,`type`,`properties`,`required`]),z=new Set([`type`,`enum`,`pattern`,`format`,`items`,`description`,`properties`,`required`]);function B(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function le(e){return e===void 0?[]:Array.isArray(e)&&e.every(e=>typeof e==`string`)?e:null}function ue(e){if(Object.keys(e).some(e=>!z.has(e)))return!0;let t=e.items;if(t!==void 0){if(!B(t))return!0;let e=new Set([`enum`,`type`,`properties`,`required`,`description`]);if(Object.keys(t).some(t=>!e.has(t)))return!0}return!1}function de(e,t){return[...e.map(e=>typeof e==`string`?e:`[]`),t].join(`.`)}function fe(e){let t=(0,P.c)(28),{file:n}=e,{_:a}=i(),{data:o}=S(),s,c,l,u,d,f,p;if(t[0]!==a||t[1]!==o?.effective.plugins.frontmatter.schemas||t[2]!==n){let e=o?.effective.plugins.frontmatter.schemas.find(e=>e.file===n)?.schema,i=B(e)?Object.keys(e).filter(pe):[],m;t[10]!==a||t[11]!==n?(m={save:(e,t,r)=>{(async()=>{let i=await C(n,e,t,r);i.ok?T():b.error(i.errorDetail??a({id:`IQgeSn`}))})()},rename:(e,t,r)=>{(async()=>{let i=await E(n,e,t,r);i.ok?T():b.error(i.errorDetail??a({id:`kooyLJ`}))})()},remove:(e,t)=>{(async()=>{let r=await w(n,e,t);r.ok?T():b.error(r.errorDetail??a({id:`qC7PwZ`}))})()}},t[10]=a,t[11]=n,t[12]=m):m=t[12],c=m,u=`space-y-3`,d=`frontmatter-field-editor-${n}`,f=e===void 0&&(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,F.jsx)(r,{id:`ri6zS-`})}),t[13]!==n||t[14]!==i?(p=i.length>0&&(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`frontmatter-schema-root-preserved-${n}`,children:(0,F.jsx)(r,{id:`98FP1E`,values:{0:i.join(`, `)}})}),t[13]=n,t[14]=i,t[15]=p):p=t[15],s=me,l=B(e)?e:{},t[0]=a,t[1]=o?.effective.plugins.frontmatter.schemas,t[2]=n,t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=p}else s=t[3],c=t[4],l=t[5],u=t[6],d=t[7],f=t[8],p=t[9];let m;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(m=[],t[16]=m):m=t[16];let h=`frontmatter-add-field-${n}`,g;t[17]!==s||t[18]!==c||t[19]!==l||t[20]!==h?(g=(0,F.jsx)(s,{node:l,parentPath:m,depth:0,addInputId:h,ops:c}),t[17]=s,t[18]=c,t[19]=l,t[20]=h,t[21]=g):g=t[21];let _;return t[22]!==u||t[23]!==d||t[24]!==f||t[25]!==p||t[26]!==g?(_=(0,F.jsxs)(`div`,{className:u,"data-testid":d,children:[f,p,g]}),t[22]=u,t[23]=d,t[24]=f,t[25]=p,t[26]=g,t[27]=_):_=t[27],_}function pe(e){return!ce.has(e)}function me(e){let t=(0,P.c)(19),{node:n,parentPath:r,depth:i,addInputId:a,ops:o}=e,s;t[0]===n.properties?s=t[1]:(s=B(n.properties)?n.properties:{},t[0]=n.properties,t[1]=s);let c=s,l,u;if(t[2]!==i||t[3]!==n.required||t[4]!==o||t[5]!==r||t[6]!==c){let e=Array.isArray(n.required)?n.required.filter(he):[];l=`space-y-2`,u=Object.entries(c).map(t=>{let[n,a]=t;return(0,F.jsx)(V,{field:n,property:B(a)?a:{},isRequired:e.includes(n),parentPath:r,depth:i,ops:o},n)}),t[2]=i,t[3]=n.required,t[4]=o,t[5]=r,t[6]=c,t[7]=l,t[8]=u}else l=t[7],u=t[8];let d;t[9]!==o||t[10]!==r?(d=e=>o.save(e,{type:`string`},r),t[9]=o,t[10]=r,t[11]=d):d=t[11];let f;t[12]!==a||t[13]!==d?(f=(0,F.jsx)(ve,{inputId:a,onAdd:d}),t[12]=a,t[13]=d,t[14]=f):f=t[14];let p;return t[15]!==l||t[16]!==u||t[17]!==f?(p=(0,F.jsxs)(`div`,{className:l,children:[u,f]}),t[15]=l,t[16]=u,t[17]=f,t[18]=p):p=t[18],p}function he(e){return typeof e==`string`}function V(e){let t=(0,P.c)(172),{field:n,property:a,isRequired:o,parentPath:s,depth:d,ops:g}=e,{_}=i(),[v,b]=(0,re.useState)(!1),[x,S]=(0,re.useState)(!1),C;t[0]!==n||t[1]!==s?(C=de(s,n),t[0]=n,t[1]=s,t[2]=C):C=t[2];let w=C,T=typeof a.type==`string`&&I.includes(a.type)?a.type:void 0,E;t[3]===a.enum?E=t[4]:(E=le(a.enum),t[3]=a.enum,t[4]=E);let D=E,ee;t[5]===a.items?ee=t[6]:(ee=B(a.items)?a.items:{},t[5]=a.items,t[6]=ee);let O=ee,te;t[7]===O.enum?te=t[8]:(te=le(O.enum),t[7]=O.enum,t[8]=te);let A=te,ne=typeof a.pattern==`string`?a.pattern:``,j=typeof a.description==`string`?a.description:``,M;t[9]===a?M=t[10]:(M=ue(a),t[9]=a,t[10]=M);let N=M,R=T!==`array`&&D!==null&&(D.length>0||v),ae=T===`object`&&d<se,ce;t[11]===O.type?ce=t[12]:(ce=typeof O.type==`string`&&ie.includes(O.type)?O.type:void 0,t[11]=O.type,t[12]=ce);let z=ce,fe=z!==`object`&&A!==null&&(A.length>0||x),pe=T===`array`&&z===`object`&&d<se,he=`frontmatter-field-row-${w}`,V;t[13]!==R||t[14]!==T?(V=(R||T!==void 0)&&(0,F.jsx)(oe,{option:R?`enum`:T}),t[13]=R,t[14]=T,t[15]=V):V=t[15];let ve=`frontmatter-field-name-${w}`,H;t[16]===_?H=t[17]:(H=_({id:`nrXDdR`}),t[16]=_,t[17]=H);let U;t[18]!==n||t[19]!==g||t[20]!==s?(U=e=>{e!==``&&e!==n&&g.rename(n,e,s)},t[18]=n,t[19]=g,t[20]=s,t[21]=U):U=t[21];let W;t[22]!==n||t[23]!==H||t[24]!==U||t[25]!==ve?(W=(0,F.jsx)(ye,{id:ve,initial:n,ariaLabel:H,className:`h-7 w-36 shrink-0 font-mono text-sm font-medium`,onCommit:U}),t[22]=n,t[23]=H,t[24]=U,t[25]=ve,t[26]=W):W=t[26];let be=`frontmatter-field-description-${w}`,G;t[27]===_?G=t[28]:(G=_({id:`PGPGsL`}),t[27]=_,t[28]=G);let K;t[29]!==_||t[30]!==n?(K=_({id:`IFALcX`,values:{field:n}}),t[29]=_,t[30]=n,t[31]=K):K=t[31];let q;t[32]!==n||t[33]!==g||t[34]!==s?(q=e=>g.save(n,{description:e===``?null:e},s),t[32]=n,t[33]=g,t[34]=s,t[35]=q):q=t[35];let J;t[36]!==j||t[37]!==be||t[38]!==G||t[39]!==K||t[40]!==q?(J=(0,F.jsx)(ye,{id:be,initial:j,placeholder:G,ariaLabel:K,className:`h-7 min-w-0 flex-1`,onCommit:q}),t[36]=j,t[37]=be,t[38]=G,t[39]=K,t[40]=q,t[41]=J):J=t[41];let xe=`frontmatter-field-required-${w}`,Se;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,F.jsx)(r,{id:`TMLAx2`}),t[42]=Se):Se=t[42];let Y;t[43]===xe?Y=t[44]:(Y=(0,F.jsx)(l,{htmlFor:xe,className:`shrink-0 text-xs text-muted-foreground`,children:Se}),t[43]=xe,t[44]=Y);let Ce=`frontmatter-field-required-${w}`,X;t[45]!==n||t[46]!==g||t[47]!==s?(X=e=>g.save(n,{required:e},s),t[45]=n,t[46]=g,t[47]=s,t[48]=X):X=t[48];let we=`frontmatter-field-required-${w}`,Z;t[49]!==o||t[50]!==Ce||t[51]!==X||t[52]!==we?(Z=(0,F.jsx)(h,{id:Ce,checked:o,onCheckedChange:X,"data-testid":we}),t[49]=o,t[50]=Ce,t[51]=X,t[52]=we,t[53]=Z):Z=t[53];let Te;t[54]!==n||t[55]!==g||t[56]!==s?(Te=()=>g.remove(n,s),t[54]=n,t[55]=g,t[56]=s,t[57]=Te):Te=t[57];let Ee;t[58]!==_||t[59]!==n?(Ee=_({id:`bF22t6`,values:{field:n}}),t[58]=_,t[59]=n,t[60]=Ee):Ee=t[60];let De=`frontmatter-field-remove-${w}`,Oe;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,F.jsx)(y,{"aria-hidden":!0,className:`size-4`}),t[61]=Oe):Oe=t[61];let ke;t[62]!==Te||t[63]!==Ee||t[64]!==De?(ke=(0,F.jsx)(c,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:Te,"aria-label":Ee,"data-testid":De,children:Oe}),t[62]=Te,t[63]=Ee,t[64]=De,t[65]=ke):ke=t[65];let Ae;t[66]!==W||t[67]!==J||t[68]!==Y||t[69]!==Z||t[70]!==ke||t[71]!==V?(Ae=(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[V,W,J,Y,Z,ke]}),t[66]=W,t[67]=J,t[68]=Y,t[69]=Z,t[70]=ke,t[71]=V,t[72]=Ae):Ae=t[72];let je;t[73]!==w||t[74]!==N?(je=N&&(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`frontmatter-field-preserved-${w}`,children:(0,F.jsx)(r,{id:`TdlVEN`})}),t[73]=w,t[74]=N,t[75]=je):je=t[75];let Me=`frontmatter-field-type-${w}`,Ne;t[76]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,F.jsx)(r,{id:`-zy2Nq`}),t[76]=Ne):Ne=t[76];let Pe;t[77]===Me?Pe=t[78]:(Pe=(0,F.jsx)(l,{className:`text-xs`,htmlFor:Me,children:Ne}),t[77]=Me,t[78]=Pe);let Fe=R?`enum`:T??``,Ie;t[79]!==D?.length||t[80]!==n||t[81]!==g||t[82]!==s||t[83]!==R||t[84]!==T?(Ie=e=>{if(e===`enum`){b(!0),T===void 0&&g.save(n,{type:`string`},s);return}b(!1);let t=R&&(D?.length??0)>0?{type:e,enum:null}:{type:e};g.save(n,t,s)},t[79]=D?.length,t[80]=n,t[81]=g,t[82]=s,t[83]=R,t[84]=T,t[85]=Ie):Ie=t[85];let Le=`frontmatter-field-type-${w}`,Re=`frontmatter-field-type-${w}`,Q;t[86]===_?Q=t[87]:(Q=_({id:`EkUnmS`}),t[86]=_,t[87]=Q);let ze;t[88]===Q?ze=t[89]:(ze=(0,F.jsx)(p,{placeholder:Q}),t[88]=Q,t[89]=ze);let Be;t[90]!==Le||t[91]!==Re||t[92]!==ze?(Be=(0,F.jsx)(u,{id:Le,"data-testid":Re,children:ze}),t[90]=Le,t[91]=Re,t[92]=ze,t[93]=Be):Be=t[93];let Ve;t[94]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,F.jsx)(m,{children:L.map(_e)}),t[94]=Ve):Ve=t[94];let He;t[95]!==Fe||t[96]!==Ie||t[97]!==Be?(He=(0,F.jsxs)(f,{value:Fe,onValueChange:Ie,children:[Be,Ve]}),t[95]=Fe,t[96]=Ie,t[97]=Be,t[98]=He):He=t[98];let Ue;t[99]!==Pe||t[100]!==He?(Ue=(0,F.jsxs)(`div`,{className:`space-y-1`,children:[Pe,He]}),t[99]=Pe,t[100]=He,t[101]=Ue):Ue=t[101];let We=`frontmatter-field-pattern-${w}`,Ge;t[102]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,F.jsx)(r,{id:`cstC0z`}),t[102]=Ge):Ge=t[102];let Ke;t[103]===We?Ke=t[104]:(Ke=(0,F.jsx)(l,{className:`text-xs`,htmlFor:We,children:Ge}),t[103]=We,t[104]=Ke);let qe=`frontmatter-field-pattern-${w}`,Je;t[105]!==n||t[106]!==g||t[107]!==s?(Je=e=>g.save(n,{pattern:e===``?null:e},s),t[105]=n,t[106]=g,t[107]=s,t[108]=Je):Je=t[108];let Ye;t[109]!==ne||t[110]!==qe||t[111]!==Je?(Ye=(0,F.jsx)(ye,{id:qe,initial:ne,onCommit:Je}),t[109]=ne,t[110]=qe,t[111]=Je,t[112]=Ye):Ye=t[112];let Xe;t[113]!==Ke||t[114]!==Ye?(Xe=(0,F.jsxs)(`div`,{className:`space-y-1`,children:[Ke,Ye]}),t[113]=Ke,t[114]=Ye,t[115]=Xe):Xe=t[115];let Ze;t[116]!==Ue||t[117]!==Xe?(Ze=(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[Ue,Xe]}),t[116]=Ue,t[117]=Xe,t[118]=Ze):Ze=t[118];let Qe;t[119]!==_||t[120]!==D||t[121]!==n||t[122]!==g||t[123]!==s||t[124]!==w||t[125]!==T?(Qe=T!==`array`&&T!==`object`&&D!==null&&(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsx)(l,{className:`text-xs`,htmlFor:`frontmatter-field-enum-${w}`,children:(0,F.jsx)(r,{id:`UGeJuP`})}),(0,F.jsx)(k,{id:`frontmatter-field-enum-${w}`,value:D,grammar:`free-text`,onChange:e=>g.save(n,{enum:e.length===0?null:e},s),placeholder:_({id:`5tcmwY`}),"aria-label":_({id:`5qQr1u`,values:{field:n}})})]}),t[119]=_,t[120]=D,t[121]=n,t[122]=g,t[123]=s,t[124]=w,t[125]=T,t[126]=Qe):Qe=t[126];let $e;t[127]!==_||t[128]!==n||t[129]!==A?.length||t[130]!==z||t[131]!==g||t[132]!==s||t[133]!==w||t[134]!==fe||t[135]!==T?($e=T===`array`&&(0,F.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsx)(l,{className:`text-xs`,htmlFor:`frontmatter-field-items-type-${w}`,children:(0,F.jsx)(r,{id:`6pe_G5`})}),(0,F.jsxs)(f,{value:fe?`enum`:z??``,onValueChange:e=>{if(e===`enum`){S(!0),z===void 0&&g.save(n,{itemsType:`string`},s);return}S(!1);let t=fe&&(A?.length??0)>0?{itemsType:e,itemsEnum:null}:{itemsType:e};g.save(n,t,s)},children:[(0,F.jsx)(u,{id:`frontmatter-field-items-type-${w}`,"data-testid":`frontmatter-field-items-type-${w}`,children:(0,F.jsx)(p,{placeholder:_({id:`EkUnmS`})})}),(0,F.jsx)(m,{children:ie.map(ge)})]})]})}),t[127]=_,t[128]=n,t[129]=A?.length,t[130]=z,t[131]=g,t[132]=s,t[133]=w,t[134]=fe,t[135]=T,t[136]=$e):$e=t[136];let et;t[137]!==_||t[138]!==n||t[139]!==A||t[140]!==z||t[141]!==g||t[142]!==s||t[143]!==w||t[144]!==T?(et=T===`array`&&z!==`object`&&A!==null&&(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsx)(l,{className:`text-xs`,htmlFor:`frontmatter-field-items-enum-${w}`,children:(0,F.jsx)(r,{id:`ezUmoU`})}),(0,F.jsx)(k,{id:`frontmatter-field-items-enum-${w}`,value:A,grammar:`free-text`,onChange:e=>g.save(n,{itemsEnum:e.length===0?null:e},s),placeholder:_({id:`5tcmwY`}),"aria-label":_({id:`e60wew`,values:{field:n}})})]}),t[137]=_,t[138]=n,t[139]=A,t[140]=z,t[141]=g,t[142]=s,t[143]=w,t[144]=T,t[145]=et):et=t[145];let tt;t[146]!==d||t[147]!==n||t[148]!==O||t[149]!==g||t[150]!==s||t[151]!==w||t[152]!==pe?(tt=pe&&(0,F.jsxs)(`div`,{className:`ml-2 space-y-1 border-l pl-3 pt-1`,"data-testid":`frontmatter-field-item-children-${w}`,children:[(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,F.jsx)(r,{id:`wU8WyK`})}),(0,F.jsx)(me,{node:O,parentPath:[...s,n,{items:!0}],depth:d+1,addInputId:`frontmatter-add-field-${w}.[]`,ops:g})]}),t[146]=d,t[147]=n,t[148]=O,t[149]=g,t[150]=s,t[151]=w,t[152]=pe,t[153]=tt):tt=t[153];let $;t[154]!==d||t[155]!==n||t[156]!==g||t[157]!==s||t[158]!==w||t[159]!==a||t[160]!==ae?($=ae&&(0,F.jsxs)(`div`,{className:`ml-2 space-y-1 border-l pl-3 pt-1`,"data-testid":`frontmatter-field-children-${w}`,children:[(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,F.jsx)(r,{id:`9nIrRp`})}),(0,F.jsx)(me,{node:a,parentPath:[...s,n],depth:d+1,addInputId:`frontmatter-add-field-${w}`,ops:g})]}),t[154]=d,t[155]=n,t[156]=g,t[157]=s,t[158]=w,t[159]=a,t[160]=ae,t[161]=$):$=t[161];let nt;return t[162]!==Ae||t[163]!==je||t[164]!==Ze||t[165]!==Qe||t[166]!==$e||t[167]!==et||t[168]!==tt||t[169]!==$||t[170]!==he?(nt=(0,F.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":he,children:[Ae,je,Ze,Qe,$e,et,tt,$]}),t[162]=Ae,t[163]=je,t[164]=Ze,t[165]=Qe,t[166]=$e,t[167]=et,t[168]=tt,t[169]=$,t[170]=he,t[171]=nt):nt=t[171],nt}function ge(e){return(0,F.jsx)(d,{value:e,children:(0,F.jsx)(ae,{option:e})},e)}function _e(e){return(0,F.jsx)(d,{value:e,children:(0,F.jsx)(ae,{option:e})},e)}function ve(e){let t=(0,P.c)(24),{inputId:n,onAdd:i}=e,[a,o]=(0,re.useState)(``),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(r,{id:`Va3xJe`}),t[0]=s):s=t[0];let u;t[1]===n?u=t[2]:(u=(0,F.jsx)(l,{htmlFor:n,className:`text-xs`,children:s}),t[1]=n,t[2]=u);let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>o(e.target.value),t[3]=d):d=t[3];let f=`${n}-input`,p;t[4]!==n||t[5]!==a||t[6]!==f?(p=(0,F.jsx)(x,{id:n,value:a,onChange:d,placeholder:`owner`,"data-testid":f}),t[4]=n,t[5]=a,t[6]=f,t[7]=p):p=t[7];let m;t[8]!==u||t[9]!==p?(m=(0,F.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[u,p]}),t[8]=u,t[9]=p,t[10]=m):m=t[10];let h;t[11]===a?h=t[12]:(h=a.trim(),t[11]=a,t[12]=h);let g=h===``,_;t[13]!==a||t[14]!==i?(_=()=>{i(a.trim()),o(``)},t[13]=a,t[14]=i,t[15]=_):_=t[15];let v=`${n}-save`,y;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,F.jsx)(r,{id:`m16xKo`}),t[16]=y):y=t[16];let b;t[17]!==v||t[18]!==g||t[19]!==_?(b=(0,F.jsx)(c,{size:`sm`,variant:`outline`,disabled:g,onClick:_,"data-testid":v,children:y}),t[17]=v,t[18]=g,t[19]=_,t[20]=b):b=t[20];let S;return t[21]!==b||t[22]!==m?(S=(0,F.jsxs)(`div`,{className:`flex items-end gap-2`,children:[m,b]}),t[21]=b,t[22]=m,t[23]=S):S=t[23],S}function ye(e){let t=(0,P.c)(15),{id:n,initial:r,onCommit:i,placeholder:a,ariaLabel:o,className:s}=e,[c,l]=(0,re.useState)(r),u;t[0]!==c||t[1]!==r||t[2]!==i?(u=()=>{c.trim()!==r&&i(c.trim())},t[0]=c,t[1]=r,t[2]=i,t[3]=u):u=t[3];let d=u,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>l(e.target.value),t[4]=f):f=t[4];let p;t[5]===d?p=t[6]:(p=e=>{e.key===`Enter`&&d()},t[5]=d,t[6]=p);let m;return t[7]!==o||t[8]!==s||t[9]!==d||t[10]!==c||t[11]!==n||t[12]!==a||t[13]!==p?(m=(0,F.jsx)(x,{id:n,value:c,onChange:f,onBlur:d,onKeyDown:p,placeholder:a,"aria-label":o,className:s,"data-testid":n}),t[7]=o,t[8]=s,t[9]=d,t[10]=c,t[11]=n,t[12]=a,t[13]=p,t[14]=m):m=t[14],m}function H(e){return`/api/asset-text?path=${encodeURIComponent(e)}`}function U(e){let t=(0,P.c)(44),{assetPath:n}=e,{_:r}=i(),[a,o]=te(),s;t[0]===n?s=t[1]:(s=()=>ne(n)?`rules`:null,t[0]=n,t[1]=s);let[c,l]=(0,re.useState)(s),u=c??a,d;t[2]===o?d=t[3]:(d=e=>{l(e),o(e)},t[2]=o,t[3]=d);let f=d,{data:p}=S(),m;t[4]===p?.effective.plugins.frontmatter.schemas?m=t[5]:(m=p?.effective.plugins.frontmatter.schemas??[],t[4]=p?.effective.plugins.frontmatter.schemas,t[5]=m);let h;if(t[6]!==n||t[7]!==m){let e;t[9]===n?e=t[10]:(e=e=>e.file===n,t[9]=n,t[10]=e),h=m.some(e),t[6]=n,t[7]=m,t[8]=h}else h=t[8];let g=h,_=!g||u===`source`,v;t[11]===n?v=t[12]:(v=n.split(`/`).pop()??n,t[11]=n,t[12]=v);let y=v,b;t[13]===y?b=t[14]:(b=y.includes(`.`)?(y.split(`.`).pop()??``).toLowerCase():``,t[13]=y,t[14]=b);let x=b,C;t[15]===n?C=t[16]:(C=(0,F.jsx)(D,{entry:{kind:`asset`,path:n},className:`shrink-0 border-b bg-background px-3 py-1.5`}),t[15]=n,t[16]=C);let w;t[17]===f?w=t[18]:(w=e=>f(e===`source`?`source`:`rules`),t[17]=f,t[18]=w);let T=!g,E;t[19]===r?E=t[20]:(E=r({id:`vF68cg`}),t[19]=r,t[20]=E);let k;t[21]===r?k=t[22]:(k=r({id:`wdxz7K`}),t[21]=r,t[22]=k);let j;t[23]===r?j=t[24]:(j=r({id:`nc-ipN`}),t[23]=r,t[24]=j);let M;t[25]!==_||t[26]!==E||t[27]!==k||t[28]!==j||t[29]!==w||t[30]!==T?(M=(0,F.jsx)(O,{isSourceMode:_,onModeChange:w,wysiwygDisabled:T,wysiwygLabel:E,sourceLabel:k,wysiwygDisabledReason:j}),t[25]=_,t[26]=E,t[27]=k,t[28]=j,t[29]=w,t[30]=T,t[31]=M):M=t[31];let N;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,F.jsx)(A,{className:`absolute left-3 top-1/2 -translate-y-1/2`}),t[32]=N):N=t[32];let I;t[33]===M?I=t[34]:(I=(0,F.jsxs)(`div`,{className:`relative flex shrink-0 items-center justify-center border-b bg-background py-2`,children:[M,N]}),t[33]=M,t[34]=I);let L;t[35]!==n||t[36]!==x||t[37]!==y||t[38]!==_?(L=_?(0,F.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,F.jsx)(ee,{src:H(n),fileName:y,extension:x},n)}):(0,F.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-6`,children:(0,F.jsx)(`div`,{className:`mx-auto w-full max-w-3xl`,children:(0,F.jsx)(fe,{file:n})})}),t[35]=n,t[36]=x,t[37]=y,t[38]=_,t[39]=L):L=t[39];let ie;return t[40]!==I||t[41]!==L||t[42]!==C?(ie=(0,F.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-background`,"data-schema-config-editor":``,children:[C,I,L]}),t[40]=I,t[41]=L,t[42]=C,t[43]=ie):ie=t[43],ie}export{U as SchemaConfigEditor};
|
|
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{s as o,t as s}from"./createLucideIcon-DAkhoPjT.js";import{t as c}from"./button-Gol9BgNB.js";import{t as l}from"./label-DyipnO5I.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./switch-DYic2V-1.js";import{t as g}from"./braces-DwnwFx_V.js";import{t as _}from"./case-sensitive-nl0tWMnZ.js";import{t as v}from"./hash-DNKDqZ18.js";import{t as y}from"./trash-2-BUuL4OCw.js";import{n as b}from"./dist-BLAMau9Z.js";import{t as x}from"./input-D0ZW0Opq.js";import{d as S,f as C,o as w,r as T,s as E}from"./lint-config-client-G_mrikOJ.js";import{n as D,r as ee,t as O}from"./EditorModeToggle-D0Db8Ydu.js";import{t as k}from"./tag-pill-input-B27HgfRy.js";import{t as te}from"./useLintConfigViewMode-BYm6FwC5.js";import{r as A,t as ne}from"./schema-fields-view-intent-Dz1ZzVCe.js";var j=s(`brackets`,[[`path`,{d:`M16 3h3a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-3`,key:`1kt8lf`}],[`path`,{d:`M8 21H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h3`,key:`gduv9`}]]),M=s(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),N=s(`toggle-left`,[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]),P=a(),re=e(n(),1),F=t(),I=[`string`,`number`,`boolean`,`array`,`object`],L=[`string`,`number`,`boolean`,`enum`,`array`,`object`],ie=[`string`,`number`,`boolean`,`enum`,`object`],R={string:{Icon:_,className:`text-green-500`},number:{Icon:v,className:`text-blue-500`},boolean:{Icon:N,className:`text-orange-500`},enum:{Icon:M,className:`text-yellow-500`},array:{Icon:j,className:`text-pink-500`},object:{Icon:g,className:`text-purple-500`}};function ae(e){let t=(0,P.c)(8),{option:n}=e,{Icon:r,className:i}=R[n],a;t[0]===i?a=t[1]:(a=o(`size-3.5 shrink-0`,i),t[0]=i,t[1]=a);let s;t[2]!==r||t[3]!==a?(s=(0,F.jsx)(r,{"aria-hidden":!0,className:a}),t[2]=r,t[3]=a,t[4]=s):s=t[4];let c;return t[5]!==n||t[6]!==s?(c=(0,F.jsxs)(`span`,{className:`flex items-center gap-2`,children:[s,n]}),t[5]=n,t[6]=s,t[7]=c):c=t[7],c}function oe(e){let t=(0,P.c)(5),{option:n}=e,{Icon:r,className:i}=R[n],a;t[0]===i?a=t[1]:(a=o(`size-4 shrink-0`,i),t[0]=i,t[1]=a);let s;return t[2]!==r||t[3]!==a?(s=(0,F.jsx)(r,{"aria-hidden":!0,className:a}),t[2]=r,t[3]=a,t[4]=s):s=t[4],s}var se=4,ce=new Set([`$schema`,`type`,`properties`,`required`]),z=new Set([`type`,`enum`,`pattern`,`format`,`items`,`description`,`properties`,`required`]);function B(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function le(e){return e===void 0?[]:Array.isArray(e)&&e.every(e=>typeof e==`string`)?e:null}function ue(e){if(Object.keys(e).some(e=>!z.has(e)))return!0;let t=e.items;if(t!==void 0){if(!B(t))return!0;let e=new Set([`enum`,`type`,`properties`,`required`,`description`]);if(Object.keys(t).some(t=>!e.has(t)))return!0}return!1}function de(e,t){return[...e.map(e=>typeof e==`string`?e:`[]`),t].join(`.`)}function fe(e){let t=(0,P.c)(28),{file:n}=e,{_:a}=i(),{data:o}=S(),s,c,l,u,d,f,p;if(t[0]!==a||t[1]!==o?.effective.plugins.frontmatter.schemas||t[2]!==n){let e=o?.effective.plugins.frontmatter.schemas.find(e=>e.file===n)?.schema,i=B(e)?Object.keys(e).filter(pe):[],m;t[10]!==a||t[11]!==n?(m={save:(e,t,r)=>{(async()=>{let i=await C(n,e,t,r);i.ok?T():b.error(i.errorDetail??a({id:`IQgeSn`}))})()},rename:(e,t,r)=>{(async()=>{let i=await E(n,e,t,r);i.ok?T():b.error(i.errorDetail??a({id:`kooyLJ`}))})()},remove:(e,t)=>{(async()=>{let r=await w(n,e,t);r.ok?T():b.error(r.errorDetail??a({id:`qC7PwZ`}))})()}},t[10]=a,t[11]=n,t[12]=m):m=t[12],c=m,u=`space-y-3`,d=`frontmatter-field-editor-${n}`,f=e===void 0&&(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,F.jsx)(r,{id:`ri6zS-`})}),t[13]!==n||t[14]!==i?(p=i.length>0&&(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`frontmatter-schema-root-preserved-${n}`,children:(0,F.jsx)(r,{id:`98FP1E`,values:{0:i.join(`, `)}})}),t[13]=n,t[14]=i,t[15]=p):p=t[15],s=me,l=B(e)?e:{},t[0]=a,t[1]=o?.effective.plugins.frontmatter.schemas,t[2]=n,t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=p}else s=t[3],c=t[4],l=t[5],u=t[6],d=t[7],f=t[8],p=t[9];let m;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(m=[],t[16]=m):m=t[16];let h=`frontmatter-add-field-${n}`,g;t[17]!==s||t[18]!==c||t[19]!==l||t[20]!==h?(g=(0,F.jsx)(s,{node:l,parentPath:m,depth:0,addInputId:h,ops:c}),t[17]=s,t[18]=c,t[19]=l,t[20]=h,t[21]=g):g=t[21];let _;return t[22]!==u||t[23]!==d||t[24]!==f||t[25]!==p||t[26]!==g?(_=(0,F.jsxs)(`div`,{className:u,"data-testid":d,children:[f,p,g]}),t[22]=u,t[23]=d,t[24]=f,t[25]=p,t[26]=g,t[27]=_):_=t[27],_}function pe(e){return!ce.has(e)}function me(e){let t=(0,P.c)(19),{node:n,parentPath:r,depth:i,addInputId:a,ops:o}=e,s;t[0]===n.properties?s=t[1]:(s=B(n.properties)?n.properties:{},t[0]=n.properties,t[1]=s);let c=s,l,u;if(t[2]!==i||t[3]!==n.required||t[4]!==o||t[5]!==r||t[6]!==c){let e=Array.isArray(n.required)?n.required.filter(he):[];l=`space-y-2`,u=Object.entries(c).map(t=>{let[n,a]=t;return(0,F.jsx)(V,{field:n,property:B(a)?a:{},isRequired:e.includes(n),parentPath:r,depth:i,ops:o},n)}),t[2]=i,t[3]=n.required,t[4]=o,t[5]=r,t[6]=c,t[7]=l,t[8]=u}else l=t[7],u=t[8];let d;t[9]!==o||t[10]!==r?(d=e=>o.save(e,{type:`string`},r),t[9]=o,t[10]=r,t[11]=d):d=t[11];let f;t[12]!==a||t[13]!==d?(f=(0,F.jsx)(ve,{inputId:a,onAdd:d}),t[12]=a,t[13]=d,t[14]=f):f=t[14];let p;return t[15]!==l||t[16]!==u||t[17]!==f?(p=(0,F.jsxs)(`div`,{className:l,children:[u,f]}),t[15]=l,t[16]=u,t[17]=f,t[18]=p):p=t[18],p}function he(e){return typeof e==`string`}function V(e){let t=(0,P.c)(172),{field:n,property:a,isRequired:o,parentPath:s,depth:d,ops:g}=e,{_}=i(),[v,b]=(0,re.useState)(!1),[x,S]=(0,re.useState)(!1),C;t[0]!==n||t[1]!==s?(C=de(s,n),t[0]=n,t[1]=s,t[2]=C):C=t[2];let w=C,T=typeof a.type==`string`&&I.includes(a.type)?a.type:void 0,E;t[3]===a.enum?E=t[4]:(E=le(a.enum),t[3]=a.enum,t[4]=E);let D=E,ee;t[5]===a.items?ee=t[6]:(ee=B(a.items)?a.items:{},t[5]=a.items,t[6]=ee);let O=ee,te;t[7]===O.enum?te=t[8]:(te=le(O.enum),t[7]=O.enum,t[8]=te);let A=te,ne=typeof a.pattern==`string`?a.pattern:``,j=typeof a.description==`string`?a.description:``,M;t[9]===a?M=t[10]:(M=ue(a),t[9]=a,t[10]=M);let N=M,R=T!==`array`&&D!==null&&(D.length>0||v),ae=T===`object`&&d<se,ce;t[11]===O.type?ce=t[12]:(ce=typeof O.type==`string`&&ie.includes(O.type)?O.type:void 0,t[11]=O.type,t[12]=ce);let z=ce,fe=z!==`object`&&A!==null&&(A.length>0||x),pe=T===`array`&&z===`object`&&d<se,he=`frontmatter-field-row-${w}`,V;t[13]!==R||t[14]!==T?(V=(R||T!==void 0)&&(0,F.jsx)(oe,{option:R?`enum`:T}),t[13]=R,t[14]=T,t[15]=V):V=t[15];let ve=`frontmatter-field-name-${w}`,H;t[16]===_?H=t[17]:(H=_({id:`nrXDdR`}),t[16]=_,t[17]=H);let U;t[18]!==n||t[19]!==g||t[20]!==s?(U=e=>{e!==``&&e!==n&&g.rename(n,e,s)},t[18]=n,t[19]=g,t[20]=s,t[21]=U):U=t[21];let W;t[22]!==n||t[23]!==H||t[24]!==U||t[25]!==ve?(W=(0,F.jsx)(ye,{id:ve,initial:n,ariaLabel:H,className:`h-7 w-36 shrink-0 font-mono text-sm font-medium`,onCommit:U}),t[22]=n,t[23]=H,t[24]=U,t[25]=ve,t[26]=W):W=t[26];let be=`frontmatter-field-description-${w}`,G;t[27]===_?G=t[28]:(G=_({id:`PGPGsL`}),t[27]=_,t[28]=G);let K;t[29]!==_||t[30]!==n?(K=_({id:`IFALcX`,values:{field:n}}),t[29]=_,t[30]=n,t[31]=K):K=t[31];let q;t[32]!==n||t[33]!==g||t[34]!==s?(q=e=>g.save(n,{description:e===``?null:e},s),t[32]=n,t[33]=g,t[34]=s,t[35]=q):q=t[35];let J;t[36]!==j||t[37]!==be||t[38]!==G||t[39]!==K||t[40]!==q?(J=(0,F.jsx)(ye,{id:be,initial:j,placeholder:G,ariaLabel:K,className:`h-7 min-w-0 flex-1`,onCommit:q}),t[36]=j,t[37]=be,t[38]=G,t[39]=K,t[40]=q,t[41]=J):J=t[41];let xe=`frontmatter-field-required-${w}`,Se;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,F.jsx)(r,{id:`TMLAx2`}),t[42]=Se):Se=t[42];let Y;t[43]===xe?Y=t[44]:(Y=(0,F.jsx)(l,{htmlFor:xe,className:`shrink-0 text-xs text-muted-foreground`,children:Se}),t[43]=xe,t[44]=Y);let Ce=`frontmatter-field-required-${w}`,X;t[45]!==n||t[46]!==g||t[47]!==s?(X=e=>g.save(n,{required:e},s),t[45]=n,t[46]=g,t[47]=s,t[48]=X):X=t[48];let we=`frontmatter-field-required-${w}`,Z;t[49]!==o||t[50]!==Ce||t[51]!==X||t[52]!==we?(Z=(0,F.jsx)(h,{id:Ce,checked:o,onCheckedChange:X,"data-testid":we}),t[49]=o,t[50]=Ce,t[51]=X,t[52]=we,t[53]=Z):Z=t[53];let Te;t[54]!==n||t[55]!==g||t[56]!==s?(Te=()=>g.remove(n,s),t[54]=n,t[55]=g,t[56]=s,t[57]=Te):Te=t[57];let Ee;t[58]!==_||t[59]!==n?(Ee=_({id:`bF22t6`,values:{field:n}}),t[58]=_,t[59]=n,t[60]=Ee):Ee=t[60];let De=`frontmatter-field-remove-${w}`,Oe;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,F.jsx)(y,{"aria-hidden":!0,className:`size-4`}),t[61]=Oe):Oe=t[61];let ke;t[62]!==Te||t[63]!==Ee||t[64]!==De?(ke=(0,F.jsx)(c,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:Te,"aria-label":Ee,"data-testid":De,children:Oe}),t[62]=Te,t[63]=Ee,t[64]=De,t[65]=ke):ke=t[65];let Ae;t[66]!==W||t[67]!==J||t[68]!==Y||t[69]!==Z||t[70]!==ke||t[71]!==V?(Ae=(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[V,W,J,Y,Z,ke]}),t[66]=W,t[67]=J,t[68]=Y,t[69]=Z,t[70]=ke,t[71]=V,t[72]=Ae):Ae=t[72];let je;t[73]!==w||t[74]!==N?(je=N&&(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`frontmatter-field-preserved-${w}`,children:(0,F.jsx)(r,{id:`TdlVEN`})}),t[73]=w,t[74]=N,t[75]=je):je=t[75];let Me=`frontmatter-field-type-${w}`,Ne;t[76]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,F.jsx)(r,{id:`-zy2Nq`}),t[76]=Ne):Ne=t[76];let Pe;t[77]===Me?Pe=t[78]:(Pe=(0,F.jsx)(l,{className:`text-xs`,htmlFor:Me,children:Ne}),t[77]=Me,t[78]=Pe);let Fe=R?`enum`:T??``,Ie;t[79]!==D?.length||t[80]!==n||t[81]!==g||t[82]!==s||t[83]!==R||t[84]!==T?(Ie=e=>{if(e===`enum`){b(!0),T===void 0&&g.save(n,{type:`string`},s);return}b(!1);let t=R&&(D?.length??0)>0?{type:e,enum:null}:{type:e};g.save(n,t,s)},t[79]=D?.length,t[80]=n,t[81]=g,t[82]=s,t[83]=R,t[84]=T,t[85]=Ie):Ie=t[85];let Le=`frontmatter-field-type-${w}`,Re=`frontmatter-field-type-${w}`,Q;t[86]===_?Q=t[87]:(Q=_({id:`EkUnmS`}),t[86]=_,t[87]=Q);let ze;t[88]===Q?ze=t[89]:(ze=(0,F.jsx)(p,{placeholder:Q}),t[88]=Q,t[89]=ze);let Be;t[90]!==Le||t[91]!==Re||t[92]!==ze?(Be=(0,F.jsx)(u,{id:Le,"data-testid":Re,children:ze}),t[90]=Le,t[91]=Re,t[92]=ze,t[93]=Be):Be=t[93];let Ve;t[94]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,F.jsx)(m,{children:L.map(_e)}),t[94]=Ve):Ve=t[94];let He;t[95]!==Fe||t[96]!==Ie||t[97]!==Be?(He=(0,F.jsxs)(f,{value:Fe,onValueChange:Ie,children:[Be,Ve]}),t[95]=Fe,t[96]=Ie,t[97]=Be,t[98]=He):He=t[98];let Ue;t[99]!==Pe||t[100]!==He?(Ue=(0,F.jsxs)(`div`,{className:`space-y-1`,children:[Pe,He]}),t[99]=Pe,t[100]=He,t[101]=Ue):Ue=t[101];let We=`frontmatter-field-pattern-${w}`,Ge;t[102]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,F.jsx)(r,{id:`cstC0z`}),t[102]=Ge):Ge=t[102];let Ke;t[103]===We?Ke=t[104]:(Ke=(0,F.jsx)(l,{className:`text-xs`,htmlFor:We,children:Ge}),t[103]=We,t[104]=Ke);let qe=`frontmatter-field-pattern-${w}`,Je;t[105]!==n||t[106]!==g||t[107]!==s?(Je=e=>g.save(n,{pattern:e===``?null:e},s),t[105]=n,t[106]=g,t[107]=s,t[108]=Je):Je=t[108];let Ye;t[109]!==ne||t[110]!==qe||t[111]!==Je?(Ye=(0,F.jsx)(ye,{id:qe,initial:ne,onCommit:Je}),t[109]=ne,t[110]=qe,t[111]=Je,t[112]=Ye):Ye=t[112];let Xe;t[113]!==Ke||t[114]!==Ye?(Xe=(0,F.jsxs)(`div`,{className:`space-y-1`,children:[Ke,Ye]}),t[113]=Ke,t[114]=Ye,t[115]=Xe):Xe=t[115];let Ze;t[116]!==Ue||t[117]!==Xe?(Ze=(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[Ue,Xe]}),t[116]=Ue,t[117]=Xe,t[118]=Ze):Ze=t[118];let Qe;t[119]!==_||t[120]!==D||t[121]!==n||t[122]!==g||t[123]!==s||t[124]!==w||t[125]!==T?(Qe=T!==`array`&&T!==`object`&&D!==null&&(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsx)(l,{className:`text-xs`,htmlFor:`frontmatter-field-enum-${w}`,children:(0,F.jsx)(r,{id:`UGeJuP`})}),(0,F.jsx)(k,{id:`frontmatter-field-enum-${w}`,value:D,grammar:`free-text`,onChange:e=>g.save(n,{enum:e.length===0?null:e},s),placeholder:_({id:`5tcmwY`}),"aria-label":_({id:`5qQr1u`,values:{field:n}})})]}),t[119]=_,t[120]=D,t[121]=n,t[122]=g,t[123]=s,t[124]=w,t[125]=T,t[126]=Qe):Qe=t[126];let $e;t[127]!==_||t[128]!==n||t[129]!==A?.length||t[130]!==z||t[131]!==g||t[132]!==s||t[133]!==w||t[134]!==fe||t[135]!==T?($e=T===`array`&&(0,F.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsx)(l,{className:`text-xs`,htmlFor:`frontmatter-field-items-type-${w}`,children:(0,F.jsx)(r,{id:`6pe_G5`})}),(0,F.jsxs)(f,{value:fe?`enum`:z??``,onValueChange:e=>{if(e===`enum`){S(!0),z===void 0&&g.save(n,{itemsType:`string`},s);return}S(!1);let t=fe&&(A?.length??0)>0?{itemsType:e,itemsEnum:null}:{itemsType:e};g.save(n,t,s)},children:[(0,F.jsx)(u,{id:`frontmatter-field-items-type-${w}`,"data-testid":`frontmatter-field-items-type-${w}`,children:(0,F.jsx)(p,{placeholder:_({id:`EkUnmS`})})}),(0,F.jsx)(m,{children:ie.map(ge)})]})]})}),t[127]=_,t[128]=n,t[129]=A?.length,t[130]=z,t[131]=g,t[132]=s,t[133]=w,t[134]=fe,t[135]=T,t[136]=$e):$e=t[136];let et;t[137]!==_||t[138]!==n||t[139]!==A||t[140]!==z||t[141]!==g||t[142]!==s||t[143]!==w||t[144]!==T?(et=T===`array`&&z!==`object`&&A!==null&&(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsx)(l,{className:`text-xs`,htmlFor:`frontmatter-field-items-enum-${w}`,children:(0,F.jsx)(r,{id:`ezUmoU`})}),(0,F.jsx)(k,{id:`frontmatter-field-items-enum-${w}`,value:A,grammar:`free-text`,onChange:e=>g.save(n,{itemsEnum:e.length===0?null:e},s),placeholder:_({id:`5tcmwY`}),"aria-label":_({id:`e60wew`,values:{field:n}})})]}),t[137]=_,t[138]=n,t[139]=A,t[140]=z,t[141]=g,t[142]=s,t[143]=w,t[144]=T,t[145]=et):et=t[145];let tt;t[146]!==d||t[147]!==n||t[148]!==O||t[149]!==g||t[150]!==s||t[151]!==w||t[152]!==pe?(tt=pe&&(0,F.jsxs)(`div`,{className:`ml-2 space-y-1 border-l pl-3 pt-1`,"data-testid":`frontmatter-field-item-children-${w}`,children:[(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,F.jsx)(r,{id:`wU8WyK`})}),(0,F.jsx)(me,{node:O,parentPath:[...s,n,{items:!0}],depth:d+1,addInputId:`frontmatter-add-field-${w}.[]`,ops:g})]}),t[146]=d,t[147]=n,t[148]=O,t[149]=g,t[150]=s,t[151]=w,t[152]=pe,t[153]=tt):tt=t[153];let $;t[154]!==d||t[155]!==n||t[156]!==g||t[157]!==s||t[158]!==w||t[159]!==a||t[160]!==ae?($=ae&&(0,F.jsxs)(`div`,{className:`ml-2 space-y-1 border-l pl-3 pt-1`,"data-testid":`frontmatter-field-children-${w}`,children:[(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,F.jsx)(r,{id:`9nIrRp`})}),(0,F.jsx)(me,{node:a,parentPath:[...s,n],depth:d+1,addInputId:`frontmatter-add-field-${w}`,ops:g})]}),t[154]=d,t[155]=n,t[156]=g,t[157]=s,t[158]=w,t[159]=a,t[160]=ae,t[161]=$):$=t[161];let nt;return t[162]!==Ae||t[163]!==je||t[164]!==Ze||t[165]!==Qe||t[166]!==$e||t[167]!==et||t[168]!==tt||t[169]!==$||t[170]!==he?(nt=(0,F.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":he,children:[Ae,je,Ze,Qe,$e,et,tt,$]}),t[162]=Ae,t[163]=je,t[164]=Ze,t[165]=Qe,t[166]=$e,t[167]=et,t[168]=tt,t[169]=$,t[170]=he,t[171]=nt):nt=t[171],nt}function ge(e){return(0,F.jsx)(d,{value:e,children:(0,F.jsx)(ae,{option:e})},e)}function _e(e){return(0,F.jsx)(d,{value:e,children:(0,F.jsx)(ae,{option:e})},e)}function ve(e){let t=(0,P.c)(24),{inputId:n,onAdd:i}=e,[a,o]=(0,re.useState)(``),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(r,{id:`Va3xJe`}),t[0]=s):s=t[0];let u;t[1]===n?u=t[2]:(u=(0,F.jsx)(l,{htmlFor:n,className:`text-xs`,children:s}),t[1]=n,t[2]=u);let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>o(e.target.value),t[3]=d):d=t[3];let f=`${n}-input`,p;t[4]!==n||t[5]!==a||t[6]!==f?(p=(0,F.jsx)(x,{id:n,value:a,onChange:d,placeholder:`owner`,"data-testid":f}),t[4]=n,t[5]=a,t[6]=f,t[7]=p):p=t[7];let m;t[8]!==u||t[9]!==p?(m=(0,F.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[u,p]}),t[8]=u,t[9]=p,t[10]=m):m=t[10];let h;t[11]===a?h=t[12]:(h=a.trim(),t[11]=a,t[12]=h);let g=h===``,_;t[13]!==a||t[14]!==i?(_=()=>{i(a.trim()),o(``)},t[13]=a,t[14]=i,t[15]=_):_=t[15];let v=`${n}-save`,y;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,F.jsx)(r,{id:`m16xKo`}),t[16]=y):y=t[16];let b;t[17]!==v||t[18]!==g||t[19]!==_?(b=(0,F.jsx)(c,{size:`sm`,variant:`outline`,disabled:g,onClick:_,"data-testid":v,children:y}),t[17]=v,t[18]=g,t[19]=_,t[20]=b):b=t[20];let S;return t[21]!==b||t[22]!==m?(S=(0,F.jsxs)(`div`,{className:`flex items-end gap-2`,children:[m,b]}),t[21]=b,t[22]=m,t[23]=S):S=t[23],S}function ye(e){let t=(0,P.c)(15),{id:n,initial:r,onCommit:i,placeholder:a,ariaLabel:o,className:s}=e,[c,l]=(0,re.useState)(r),u;t[0]!==c||t[1]!==r||t[2]!==i?(u=()=>{c.trim()!==r&&i(c.trim())},t[0]=c,t[1]=r,t[2]=i,t[3]=u):u=t[3];let d=u,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>l(e.target.value),t[4]=f):f=t[4];let p;t[5]===d?p=t[6]:(p=e=>{e.key===`Enter`&&d()},t[5]=d,t[6]=p);let m;return t[7]!==o||t[8]!==s||t[9]!==d||t[10]!==c||t[11]!==n||t[12]!==a||t[13]!==p?(m=(0,F.jsx)(x,{id:n,value:c,onChange:f,onBlur:d,onKeyDown:p,placeholder:a,"aria-label":o,className:s,"data-testid":n}),t[7]=o,t[8]=s,t[9]=d,t[10]=c,t[11]=n,t[12]=a,t[13]=p,t[14]=m):m=t[14],m}function H(e){return`/api/asset-text?path=${encodeURIComponent(e)}`}function U(e){let t=(0,P.c)(44),{assetPath:n}=e,{_:r}=i(),[a,o]=te(),s;t[0]===n?s=t[1]:(s=()=>ne(n)?`rules`:null,t[0]=n,t[1]=s);let[c,l]=(0,re.useState)(s),u=c??a,d;t[2]===o?d=t[3]:(d=e=>{l(e),o(e)},t[2]=o,t[3]=d);let f=d,{data:p}=S(),m;t[4]===p?.effective.plugins.frontmatter.schemas?m=t[5]:(m=p?.effective.plugins.frontmatter.schemas??[],t[4]=p?.effective.plugins.frontmatter.schemas,t[5]=m);let h;if(t[6]!==n||t[7]!==m){let e;t[9]===n?e=t[10]:(e=e=>e.file===n,t[9]=n,t[10]=e),h=m.some(e),t[6]=n,t[7]=m,t[8]=h}else h=t[8];let g=h,_=!g||u===`source`,v;t[11]===n?v=t[12]:(v=n.split(`/`).pop()??n,t[11]=n,t[12]=v);let y=v,b;t[13]===y?b=t[14]:(b=y.includes(`.`)?(y.split(`.`).pop()??``).toLowerCase():``,t[13]=y,t[14]=b);let x=b,C;t[15]===n?C=t[16]:(C=(0,F.jsx)(D,{entry:{kind:`asset`,path:n},className:`shrink-0 border-b bg-background px-3 py-1.5`}),t[15]=n,t[16]=C);let w;t[17]===f?w=t[18]:(w=e=>f(e===`source`?`source`:`rules`),t[17]=f,t[18]=w);let T=!g,E;t[19]===r?E=t[20]:(E=r({id:`vF68cg`}),t[19]=r,t[20]=E);let k;t[21]===r?k=t[22]:(k=r({id:`wdxz7K`}),t[21]=r,t[22]=k);let j;t[23]===r?j=t[24]:(j=r({id:`nc-ipN`}),t[23]=r,t[24]=j);let M;t[25]!==_||t[26]!==E||t[27]!==k||t[28]!==j||t[29]!==w||t[30]!==T?(M=(0,F.jsx)(O,{isSourceMode:_,onModeChange:w,wysiwygDisabled:T,wysiwygLabel:E,sourceLabel:k,wysiwygDisabledReason:j}),t[25]=_,t[26]=E,t[27]=k,t[28]=j,t[29]=w,t[30]=T,t[31]=M):M=t[31];let N;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,F.jsx)(A,{className:`absolute left-3 top-1/2 -translate-y-1/2`}),t[32]=N):N=t[32];let I;t[33]===M?I=t[34]:(I=(0,F.jsxs)(`div`,{className:`relative flex shrink-0 items-center justify-center border-b bg-background py-2`,children:[M,N]}),t[33]=M,t[34]=I);let L;t[35]!==n||t[36]!==x||t[37]!==y||t[38]!==_?(L=_?(0,F.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,F.jsx)(ee,{src:H(n),fileName:y,extension:x},n)}):(0,F.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-6`,children:(0,F.jsx)(`div`,{className:`mx-auto w-full max-w-3xl`,children:(0,F.jsx)(fe,{file:n})})}),t[35]=n,t[36]=x,t[37]=y,t[38]=_,t[39]=L):L=t[39];let ie;return t[40]!==I||t[41]!==L||t[42]!==C?(ie=(0,F.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-background`,"data-schema-config-editor":``,children:[C,I,L]}),t[40]=I,t[41]=L,t[42]=C,t[43]=ie):ie=t[43],ie}export{U as SchemaConfigEditor};
|
package/dist/public/assets/{SettingsDialogBody-DqSzMMsr.js → SettingsDialogBody-Bkz3Bpgp.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{Tt as r,et as i,qt as a}from"./DocumentContext-D5LU2-RZ.js";import{t as o}from"./react-f2sANaYj.js";import{n as s,r as c}from"./dist-Nvb76hAm.js";import{t as l}from"./useQuery-ZeEDLtxh.js";import{n as u}from"./dist-PQ5KMVDh.js";import{t as d}from"./compiler-runtime-BfE3aGVn.js";import{a as f,c as p,l as m,s as h}from"./terminal-input-events-C5UuEsAB.js";import{s as g,t as _}from"./createLucideIcon-DAkhoPjT.js";import{t as v}from"./button-Gol9BgNB.js";import{i as y,n as b,t as x}from"./tooltip-B4J7VHmA.js";import{n as S,r as C,t as w}from"./collapsible-B1mS1n9y.js";import{a as T,c as E,i as D,n as O,o as k,r as A,s as j,t as M}from"./dialog-TkFkuYVg.js";import{t as N}from"./checkbox-DY-vIhnZ.js";import{m as P,r as F,t as I}from"./dropdown-menu-xw8WTdb-.js";import{t as L}from"./label-DyipnO5I.js";import{a as R,i as z,n as B,o as V,r as H,t as U}from"./switch-DYic2V-1.js";import{i as W,n as G,r as K,t as ee}from"./radio-group-CGEdWasQ.js";import{t as q}from"./separator-DExEeoYE.js";import{n as te,t as ne}from"./toggle-group-CjXmmTGy.js";import{C as J,a as Y,b as re,c as ie,d as ae,f as oe,h as se,l as ce,n as le,o as ue,r as de,s as fe,t as pe,u as me,y as he}from"./agent-visibility-CnzdlhVC.js";import{i as ge}from"./terminal-telemetry-BO22BE3r.js";import{Aa as _e,F as ve,Fa as ye,Ft as be,Ga as xe,Ha as Se,Ia as Ce,Ma as we,Na as Te,Oa as Ee,P as De,Rt as Oe,Ta as ke,Ua as Ae,Wa as je,_a as Me,_t as Ne,b as Pe,ba as Fe,ei as Ie,et as Le,ii as Re,pr as ze,pt as Be,v as Ve,ya as He,za as Ue,zt as We}from"./dist-Dxs5l5f3.js";import{a as Ge,c as Ke,d as qe,s as Je,t as Ye}from"./EnableSyncConfirmDialog-BeUuMUfa.js";import{t as Xe}from"./arrow-up-right-obRIg3Sv.js";import{t as Ze}from"./RegisteredAgentIcon-8Tcfr3WP.js";import{t as Qe}from"./check-GqWaoTdV.js";import{t as $e}from"./chevron-right-C8oTR6gu.js";import{i as et}from"./prop-types-Dq1Y_y68.js";import{C as tt,S as nt,b as rt,c as it,h as at,i as ot,l as st,o as ct,r as lt,t as ut,v as dt,y as ft}from"./skill-actions-CnQNy6QY.js";import{A as pt,F as mt,G as ht,I as gt,M as _t,N as vt,P as yt,S as bt,U as xt,V as St,_ as Ct,b as wt,c as Tt,d as Et,f as Dt,g as Ot,h as kt,i as At,k as jt,l as Mt,m as Nt,n as Pt,o as Ft,p as It,u as Lt,x as Rt,y as zt,z as Bt}from"./auth-state-cache-D-o9mDQf.js";import{i as Vt,l as Ht,r as Ut,s as Wt}from"./workspace-paths-ai6F0DQ3.js";import{t as Gt}from"./square-pen-C1vIlMAW.js";import{c as Kt,n as qt,t as Jt}from"./open-managed-artifact-tab-epta6SQV.js";import{t as Yt}from"./info-yKMseklR.js";import{t as Xt}from"./loader-circle-Cg5SU7AZ.js";import{c as Zt,i as Qt}from"./field-DVIFAnvR.js";import{t as $t}from"./sliders-horizontal-34K0eDW2.js";import{t as en}from"./trash-2-BUuL4OCw.js";import{t as tn}from"./triangle-alert-Clgvyc7B.js";import{t as nn}from"./x-DVkpYo5d.js";import{n as X}from"./dist-BLAMau9Z.js";import{t as rn}from"./ConfigSharingInfoTooltip-DMbsfWD9.js";import{t as an}from"./input-D0ZW0Opq.js";import{c as on,d as sn,i as cn,l as ln,m as un,o as dn,s as fn}from"./use-settings-route-B-L25JMs.js";import{t as pn}from"./parse-api-error-C_gwkKmG.js";import{i as mn}from"./documents-events-CnYTr2EX.js";import{o as hn}from"./doc-hash-BmhDnlQv.js";import{t as gn}from"./badge-Dba4cvJR.js";import"./config-provider-CGoD2yzK.js";import{a as _n,c as vn,i as yn,n as bn,o as xn,s as Sn}from"./use-apply-config-color-theme-r5IzVx3u.js";import{n as Cn,r as wn}from"./config-context-gd3BC-iY.js";import{t as Tn}from"./external-link-T4Nj1gcG.js";import{t as En}from"./use-workspace-NdYT_dp2.js";import{t as Dn}from"./lint-plugin-meta-B3N1DKgL.js";import{t as On}from"./skeleton-HLkcMp95.js";import{d as kn,n as An,r as jn,t as Mn,u as Nn}from"./lint-config-client-DWwcbNDR.js";import{a as Pn,d as Fn,f as In,i as Ln,l as Rn,m as zn,o as Bn,p as Vn,s as Hn,t as Un,u as Wn}from"./sortable.esm-B6whf_t-.js";import{t as Gn}from"./textarea-RSYJwPz9.js";import{a as Kn,f as qn,i as Jn,n as Yn,o as Xn,p as Zn,r as Qn,s as $n,t as er}from"./form-D-z6QdLf.js";import{t as tr}from"./tag-pill-input-DC-n23FS.js";import{t as nr}from"./markdownlint-rule-browser-FIuqfE86.js";import{n as rr,r as ir}from"./schema-fields-view-intent-Dz1ZzVCe.js";import{n as ar,t as or}from"./use-terminal-enabled-8hGsIhI1.js";var sr=_(`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=d(),Q=e(o(),1),$=n(),cr=`settings-sharing-title`;function lr(){let e=(0,Z.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)(ur,{}):(0,$.jsx)(dr,{}),e[0]=n):n=e[0],n}function ur(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`h3`,{id:cr,className:`text-base font-semibold`,children:(0,$.jsx)(s,{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":cr,className:`space-y-3`,children:(0,$.jsxs)(`div`,{className:`space-y-1`,children:[t,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`7YRrJ9`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{})}})})]})}),e[1]=n):n=e[1],n}function dr(){let e=(0,Z.c)(39),{_:t}=c(),[n,r]=(0,Q.useState)(null),[i,a]=(0,Q.useState)(!1),[o,l]=(0,Q.useState)(null),u;e[0]===t?u=e[1]:(u=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(pr)}},e[0]=t,e[1]=u);let d=u,f;e[2]===d?f=e[3]:(f=()=>{d()},e[2]=d,e[3]=f);let p;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],e[4]=p):p=e[4],(0,Q.useEffect)(f,p);let m;e[5]!==t||e[6]!==i||e[7]!==d||e[8]!==n?(m=async function(e){let r=window.okDesktop?.sharing;if(!r||n===null||i||n.mode===e)return;a(!0),l(null);let o=null,s=null;try{o=await r.setMode(e)}catch(e){s=e}if(a(!1),s!==null){X.error(s instanceof Error?s.message:t({id:`qZv5ZR`}));return}o!==null&&(o.kind===`refused-tracked`?(l({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:`VvS_k_`}:{id:`k_pade`})),await d())},e[5]=t,e[6]=i,e[7]=d,e[8]=n,e[9]=m):m=e[9];let h=m,g;e[10]!==t||e[11]!==i||e[12]!==d||e[13]!==n?(g=async function(){let e=window.okDesktop?.sharing;if(!e||n===null||i)return;a(!0);let r=null,o=null;try{r=await e.setSkillsShared(!1)}catch(e){o=e}if(a(!1),o!==null){X.error(o instanceof Error?o.message:t({id:`onTlRk`}));return}if(r!==null){if(r.kind===`no-exclude`){let e=r.reason===`no-git`?t({id:`Xwump4`}):r.reason===`inaccessible`?t({id:`PlGC6r`}):t({id:`zcmYx4`});X.warning(t({id:`4h3e0H`,values:{detail:e}}));return}X.success(t({id:`pQf2Ux`})),await d()}},e[10]=t,e[11]=i,e[12]=d,e[13]=n,e[14]=g):g=e[14];let _=g;if(n===null){let t;return e[15]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":cr,className:`space-y-3`,children:[(0,$.jsx)(`h3`,{id:cr,className:`text-base font-semibold`,children:(0,$.jsx)(s,{id:`cs4mps`})}),(0,$.jsx)(On,{className:`h-24`})]}),e[15]=t):t=e[15],t}let y=n.mode===`no-git`,b;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`h3`,{id:cr,className:`text-base font-semibold`,children:(0,$.jsx)(s,{id:`cs4mps`})}),(0,$.jsx)(rn,{})]}),e[16]=b):b=e[16];let x;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[b,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`N55YNr`})})]}),e[17]=x):x=e[17];let S;e[18]!==i||e[19]!==y||e[20]!==h||e[21]!==n.mode?(S=y?(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)(s,{id:`ju38ms`})}):(0,$.jsxs)(ee,{value:n.mode,onValueChange:e=>void h(e),disabled:i,className:`gap-2`,"aria-labelledby":cr,"data-testid":`settings-sharing-radiogroup`,children:[(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-shared`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(G,{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)(s,{id:`0Gd0NU`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`dJw2_7`})})]})]}),(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-local-only`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(G,{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)(s,{id:`OgyJSr`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`cZ_8zB`})})]})]})]}),e[18]=i,e[19]=y,e[20]=h,e[21]=n.mode,e[22]=S):S=e[22];let C;e[23]!==i||e[24]!==_||e[25]!==n.mode||e[26]!==n.skillsShared?(C=n.mode===`local-only`&&n.skillsShared?(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-skills-exception`,children:[(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(s,{id:`Kiytqd`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`K0FgsP`})})]}),(0,$.jsx)(v,{variant:`outline`,size:`sm`,disabled:i,onClick:()=>void _(),children:(0,$.jsx)(s,{id:`9uI_rE`})})]}):null,e[23]=i,e[24]=_,e[25]=n.mode,e[26]=n.skillsShared,e[27]=C):C=e[27];let w;e[28]===o?w=e[29]:(w=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)(s,{id:`Kgdbkt`})}),(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-relaxed`,children:o.remediation}),(0,$.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>l(null),children:(0,$.jsx)(s,{id:`1QfxQT`})})]}),e[28]=o,e[29]=w);let T;e[30]!==o||e[31]!==n.mode||e[32]!==n.trackedUpstream?(T=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)(s,{id:`LhWYpm`})}),(0,$.jsx)(`ul`,{className:`list-disc pl-5 font-mono text-xs text-muted-foreground`,children:n.trackedUpstream.map(fr)}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`1XSMhZ`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]}):null,e[30]=o,e[31]=n.mode,e[32]=n.trackedUpstream,e[33]=T):T=e[33];let E;return e[34]!==T||e[35]!==S||e[36]!==C||e[37]!==w?(E=(0,$.jsxs)(`section`,{"aria-labelledby":cr,className:`space-y-4`,"data-testid":`settings-sharing`,children:[x,S,C,w,T]}),e[34]=T,e[35]=S,e[36]=C,e[37]=w,e[38]=E):E=e[38],E}function fr(e){return(0,$.jsx)(`li`,{children:e},e)}function pr(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[],skillsShared:!1}}function mr(e){let t=(0,Z.c)(35),{authQueryTransport:n,authTransport:r}=e,{_:i}=c(),a;t[0]===n?a=t[1]:(a=n??Bt(),t[0]=n,t[1]=a);let o=a,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l={phase:`loading`},t[2]=l):l=t[2];let[u,d]=(0,Q.useState)(l),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(null),y=(0,Q.useRef)(!1),b;t[3]===o?b=t[4]:(b=async function(){d({phase:`loading`});try{let e=await o.status();d({phase:`loaded`,result:e}),Pt(e.authenticated)}catch(e){console.warn(`[AccountSection] GitHub status check failed`,e),d({phase:`check-failed`})}},t[3]=o,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,Q.useEffect)(S,C);let w;t[8]!==i||t[9]!==x||t[10]!==o?(w=async function(){if(y.current)return;y.current=!0,p(!1),h(!0),_(null);let e=null;try{let t=o.signout?await o.signout():{ok:!1,error:i({id:`8cpOa8`})};t.ok||(e=t.error??i({id:`8cpOa8`}))}catch(t){console.warn(`[AccountSection] GitHub disconnect failed`,t),e=i({id:`8cpOa8`})}await x(),e&&_(e),h(!1),y.current=!1},t[8]=i,t[9]=x,t[10]=o,t[11]=w):w=t[11];let T=w,E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(`h3`,{id:`settings-account-title`,className:`text-base font-semibold`,children:(0,$.jsx)(s,{id:`AeXO77`})}),t[12]=E):E=t[12];let D;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[E,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`E6lrpp`})})]}),t[13]=D):D=t[13];let O;t[14]!==g||t[15]!==m||t[16]!==T||t[17]!==x||t[18]!==u.phase||t[19]!==u.result?(O=u.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)(s,{id:`IWGfGF`})}),(0,$.jsx)(On,{className:`h-4 w-40`}),(0,$.jsx)(On,{className:`h-8 w-32`})]}):u.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)(s,{id:`T_wG4n`})}),(0,$.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>void x(),children:(0,$.jsx)(s,{id:`KDw4GX`})})]}):u.result.authenticated?u.result.tier===`A`?(0,$.jsx)(gr,{login:u.result.login}):(0,$.jsx)(hr,{login:u.result.login,disconnecting:m,error:g,onDisconnect:()=>void T()}):(0,$.jsx)(_r,{onConnect:()=>p(!0)}),t[14]=g,t[15]=m,t[16]=T,t[17]=x,t[18]=u.phase,t[19]=u.result,t[20]=O):O=t[20];let k;t[21]===x?k=t[22]:(k=e=>{p(e),e||x()},t[21]=x,t[22]=k);let A=u.phase===`loaded`?u.result.host:void 0,j=u.phase===`loaded`?u.result.ghAvailable:void 0,M;t[23]===x?M=t[24]:(M=()=>{x()},t[23]=x,t[24]=M);let N;t[25]!==f||t[26]!==r||t[27]!==k||t[28]!==A||t[29]!==j||t[30]!==M?(N=(0,$.jsx)(gt,{open:f,onOpenChange:k,transport:r,host:A,ghAvailable:j,onSuccess:M}),t[25]=f,t[26]=r,t[27]=k,t[28]=A,t[29]=j,t[30]=M,t[31]=N):N=t[31];let P;return t[32]!==N||t[33]!==O?(P=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-3`,"data-testid":`settings-account`,children:[D,O,N]}),t[32]=N,t[33]=O,t[34]=P):P=t[34],P}function hr(e){let t=(0,Z.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)(s,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=o);let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(s,{id:`nxlOpL`})}),t[2]=c):c=t[2];let l;t[3]===o?l=t[4]:(l=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[o,c]}),t[3]=o,t[4]=l);let u;t[5]===r?u=t[6]:(u=r?(0,$.jsx)(s,{id:`rppgXF`}):(0,$.jsx)(s,{id:`-K0AvT`}),t[5]=r,t[6]=u);let d;t[7]!==r||t[8]!==a||t[9]!==u?(d=(0,$.jsx)(v,{variant:`outline`,onClick:a,disabled:r,"aria-describedby":`settings-account-disconnect-caveat`,"data-testid":`settings-account-disconnect`,children:u}),t[7]=r,t[8]=a,t[9]=u,t[10]=d):d=t[10];let f;t[11]!==l||t[12]!==d?(f=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[l,d]}),t[11]=l,t[12]=d,t[13]=f):f=t[13];let p;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`p`,{id:`settings-account-disconnect-caveat`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-account-disconnect-caveat`,children:(0,$.jsx)(s,{id:`msOK6I`})}),t[14]=p):p=t[14];let m;t[15]===i?m=t[16]:(m=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]=m);let h;return t[17]!==f||t[18]!==m?(h=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-connected`,children:[f,p,m]}),t[17]=f,t[18]=m,t[19]=h):h=t[19],h}function gr(e){let t=(0,Z.c)(5),{login:n}=e,r;t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(s,{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)(s,{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 _r(e){let t=(0,Z.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)(s,{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)(s,{id:`EJuO7B`})})]}),t[1]=i):i=t[1];let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(s,{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)(v,{onClick:n,"data-testid":`settings-account-connect`,children:a})]})}),t[3]=n,t[4]=o),o}function vr(e){return e.kind===`editor`?`editor:${e.id}`:e.kind===`skill`?`skill:${e.id}`:`path`}function yr(e){let t=(0,Z.c)(11),{testId:n,children:r}=e,{_:i}=c(),a;t[0]===i?a=t[1]:(a=i({id:`2B6eYX`}),t[0]=i,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Yt,{className:`size-3.5`}),t[2]=o):o=t[2];let s;t[3]!==a||t[4]!==n?(s=(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(v,{variant:`ghost`,size:`icon`,className:`mt-1.5 mr-1.5 h-6 w-6 shrink-0 text-muted-foreground opacity-60 hover:opacity-100`,"aria-label":a,"data-testid":n,children:o})}),t[3]=a,t[4]=n,t[5]=s):s=t[5];let l;t[6]===r?l=t[7]:(l=(0,$.jsx)(b,{side:`left`,className:`max-w-sm text-left`,children:(0,$.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:r})}),t[6]=r,t[7]=l);let u;return t[8]!==s||t[9]!==l?(u=(0,$.jsxs)(x,{children:[s,l]}),t[8]=s,t[9]=l,t[10]=u):u=t[10],u}function br(){let e=(0,Z.c)(38),{_:t}=c(),n=typeof window<`u`?window.okDesktop??null:null,[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(null),d,f;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{if(!n)return;let e=!1;return n.integrations.status().then(t=>{e||i(t)}).catch(()=>{e||o(!0)}),()=>{e=!0}},f=[n],e[0]=d,e[1]=f):(d=e[0],f=e[1]),(0,Q.useEffect)(d,f);let p;e[2]===t?p=e[3]:(p=async function(e,r){if(n){u(vr(e));try{let t=await n.integrations.setComponent({component:e,enabled:r});i(t.status),t.ok||X.error(t.error)}catch(e){let n=e;X.error(t({id:`gfdqcY`,values:{0:n instanceof Error?n.message:String(n)}}))}u(null)}},e[2]=t,e[3]=p);let m=p,h;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(`h3`,{id:`settings-ai-tools-title`,className:`text-base font-semibold`,children:(0,$.jsx)(s,{id:`_5qBNl`})}),e[4]=h):h=e[4];let g;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[h,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`mLAjyL`})})]}),e[5]=g):g=e[5];let _=g;if(!n||a){let t;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`ai-tools-unavailable`,children:(0,$.jsx)(s,{id:`O4PnDd`})})]}),e[6]=t):t=e[6],t}if(r===null){let t;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsxs)(`div`,{className:`space-y-2`,"data-testid":`ai-tools-loading`,children:[(0,$.jsx)(On,{className:`h-10 w-full`}),(0,$.jsx)(On,{className:`h-10 w-full`}),(0,$.jsx)(On,{className:`h-10 w-full`})]})]}),e[7]=t):t=e[7],t}let v=l!==null||!r.available,y=r.path.shellDetected||r.path.installed,b;e[8]===r.available?b=e[9]:(b=!r.available&&(0,$.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,"data-testid":`ai-tools-read-only`,children:(0,$.jsx)(s,{id:`OplnBG`})}),e[8]=r.available,e[9]=b);let x;e[10]!==t||e[11]!==m||e[12]!==v||e[13]!==y||e[14]!==r.path.installed||e[15]!==r.path.rcFilesToTouch?(x=y&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(s,{id:`ALhMYW`})}),(0,$.jsxs)(`div`,{className:`flex items-start overflow-hidden rounded-md border border-border bg-card/50 hover:bg-accent`,children:[(0,$.jsxs)(L,{htmlFor:`ai-tools-path`,className:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(N,{id:`ai-tools-path`,checked:r.path.installed,disabled:v,onCheckedChange:()=>void m({kind:`path`},!r.path.installed),className:`mt-0.5`,"data-testid":`ai-tools-path-checkbox`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(s,{id:`Fsx78O`,components:{0:(0,$.jsx)(`code`,{className:`inline-code`})}})}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`ai-tools-path-status`,children:r.path.installed?t({id:`yhdqox`}):t({id:`04XyCH`,values:{0:r.path.rcFilesToTouch.join(`, `)}})})]})]}),(0,$.jsxs)(yr,{testId:`ai-tools-path-info`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(s,{id:`f9lQNJ`})}),r.path.rcFilesToTouch.map(Sr),(0,$.jsx)(`p`,{className:`pt-1`,children:(0,$.jsx)(s,{id:`CWzc2T`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]})]})]}),e[10]=t,e[11]=m,e[12]=v,e[13]=y,e[14]=r.path.installed,e[15]=r.path.rcFilesToTouch,e[16]=x):x=e[16];let S;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(s,{id:`psfGPX`})}),e[17]=S):S=e[17];let C;if(e[18]!==t||e[19]!==m||e[20]!==v||e[21]!==r.editors){let n;e[23]!==t||e[24]!==m||e[25]!==v?(n=e=>{let n=e.state===`installed`||e.state===`foreign`,r=v||e.state===`unmanageable`,i=e.state===`not-installed`&&!e.detected,a=`https://openknowledge.ai/docs/integrations/${ve[e.id]}`,o=e.state===`installed`?t({id:`eQkgKV`}):e.state===`foreign`?t({id:`AczYxH`}):e.state===`unmanageable`?t({id:`LbmLyU`}):e.detected?t({id:`bBE5tC`}):null,c=e.state===`foreign`||e.state===`unmanageable`?`text-xs text-amber-600 dark:text-amber-400`:`text-xs text-muted-foreground`;return(0,$.jsxs)(`li`,{className:r?`flex items-start`:`flex items-start hover:bg-accent`,children:[(0,$.jsxs)(L,{htmlFor:`ai-tools-editor-${e.id}`,className:r?`flex flex-1 items-start gap-2.5 px-3 py-2.5 font-normal`:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(N,{id:`ai-tools-editor-${e.id}`,checked:n,disabled:r,onCheckedChange:()=>void m({kind:`editor`,id:e.id},!n),className:`mt-0.5`,"data-testid":`ai-tools-editor-checkbox-${e.id}`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.label}),o!==null&&(0,$.jsx)(`span`,{className:c,"data-testid":`ai-tools-editor-status-${e.id}`,children:o})]})]}),i&&(0,$.jsxs)(`a`,{href:a,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>Tn(e,a),onAuxClick:e=>Tn(e,a),"aria-label":t({id:`D-Oh1s`,values:{0:e.label}}),className:`flex shrink-0 items-center gap-0.5 px-2 py-2.5 text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,"data-testid":`ai-tools-editor-status-${e.id}`,children:[(0,$.jsx)(s,{id:`P_bX4O`}),(0,$.jsx)(Xe,{className:`size-3`,"aria-hidden":!0})]}),(0,$.jsxs)(yr,{testId:`ai-tools-editor-info-${e.id}`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(s,{id:`J2eKUI`})}),(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e.configPath??t({id:`ndwmea`})})}),(0,$.jsx)(`p`,{className:`pt-1 opacity-70`,children:(0,$.jsx)(s,{id:`VIwCaD`})}),(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e.entryLocator})})]})]},e.id)},e[23]=t,e[24]=m,e[25]=v,e[26]=n):n=e[26],C=r.editors.map(n),e[18]=t,e[19]=m,e[20]=v,e[21]=r.editors,e[22]=C}else C=e[22];let w;e[27]===C?w=e[28]:(w=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[S,(0,$.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:C})]}),e[27]=C,e[28]=w);let T;e[29]!==m||e[30]!==v||e[31]!==r.skills?(T=r.skills.length>0&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(s,{id:`28B21t`})}),(0,$.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:r.skills.map(e=>(0,$.jsxs)(`li`,{className:`flex items-start hover:bg-accent`,children:[(0,$.jsxs)(L,{htmlFor:`ai-tools-skill-${e.id}`,className:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(N,{id:`ai-tools-skill-${e.id}`,checked:e.installed,disabled:v,onCheckedChange:()=>void m({kind:`skill`,id:e.id},!e.installed),className:`mt-0.5`,"data-testid":`ai-tools-skill-checkbox-${e.id}`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(`code`,{children:e.name})}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`ai-tools-skill-status-${e.id}`,children:e.id===`discovery`?(0,$.jsx)(s,{id:`0inVGS`}):(0,$.jsx)(s,{id:`FXk_zY`})})]})]}),(0,$.jsxs)(yr,{testId:`ai-tools-skill-info-${e.id}`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(s,{id:`HSh8u_`})}),e.paths.map(xr)]})]},e.id))})]}),e[29]=m,e[30]=v,e[31]=r.skills,e[32]=T):T=e[32];let E;return e[33]!==T||e[34]!==b||e[35]!==x||e[36]!==w?(E=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,b,x,w,T]}),e[33]=T,e[34]=b,e[35]=x,e[36]=w,e[37]=E):E=e[37],E}function xr(e){return(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e})},e)}function Sr(e){return(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e})},e)}function Cr(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 wr(e,t){return e.id===`custom`?Cr(we(xn(vn(t)))):e.base?Cr(we(e.base)):{chrome:`var(--sidebar)`,surface:`var(--background)`,bar:`var(--primary)`,line:`var(--border)`,dots:[`var(--chart-2)`,`var(--chart-4)`,`var(--chart-3)`]}}function Tr(e){let t=(0,Z.c)(35),{theme:n,customSeed:r}=e,i,a,o,s,c,l,u,d,f;t[0]!==r||t[1]!==n?(i=wr(n,r),l=!0,u=`aspect-[4/3] w-full overflow-hidden rounded-md border`,d={backgroundColor:i.surface,borderColor:i.line},f=(0,$.jsxs)(`div`,{className:`flex h-1/3 items-center gap-1 px-1.5`,style:{backgroundColor:i.chrome,borderBottom:`1px solid ${i.line}`},children:[(0,$.jsx)(`span`,{className:`h-1.5 w-5 rounded-full`,style:{backgroundColor:i.bar}}),(0,$.jsx)(`span`,{className:`h-1.5 flex-1 rounded-full opacity-50`,style:{backgroundColor:i.line}})]}),c=`flex h-2/3`,a=`flex w-1/4 flex-col items-center justify-center gap-1`,o={backgroundColor:i.chrome,borderRight:`1px solid ${i.line}`},s=i.dots.map(Er),t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f):(i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10]);let p;t[11]!==a||t[12]!==o||t[13]!==s?(p=(0,$.jsx)(`div`,{className:a,style:o,children:s}),t[11]=a,t[12]=o,t[13]=s,t[14]=p):p=t[14];let m;t[15]===i.dots[1]?m=t[16]:(m=(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-full`,style:{backgroundColor:i.dots[1]}}),t[15]=i.dots[1],t[16]=m);let h;t[17]===i.line?h=t[18]:(h=(0,$.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-full opacity-60`,style:{backgroundColor:i.line}}),t[17]=i.line,t[18]=h);let g;t[19]===i.dots[0]?g=t[20]:(g=(0,$.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-full`,style:{backgroundColor:i.dots[0]}}),t[19]=i.dots[0],t[20]=g);let _;t[21]!==m||t[22]!==h||t[23]!==g?(_=(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1 px-1.5`,children:[m,h,g]}),t[21]=m,t[22]=h,t[23]=g,t[24]=_):_=t[24];let v;t[25]!==_||t[26]!==c||t[27]!==p?(v=(0,$.jsxs)(`div`,{className:c,children:[p,_]}),t[25]=_,t[26]=c,t[27]=p,t[28]=v):v=t[28];let y;return t[29]!==v||t[30]!==l||t[31]!==u||t[32]!==d||t[33]!==f?(y=(0,$.jsxs)(`div`,{"aria-hidden":l,className:u,style:d,children:[f,v]}),t[29]=v,t[30]=l,t[31]=u,t[32]=d,t[33]=f,t[34]=y):y=t[34],y}function Er(e,t){return(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{backgroundColor:e}},t)}function Dr(e){let t=(0,Z.c)(10),{value:n,onSelect:r,customSeed:i,id:a,"aria-label":o,"aria-describedby":s}=e,{_:l}=c(),u=ke.some(e=>e.id===n)?n:`default`,d;t[0]!==l||t[1]!==i?(d=ke.map(e=>(0,$.jsxs)(K,{value:e.id,className:g(`group/tile flex flex-col gap-1.5 rounded-lg border-2 border-transparent p-1 text-left outline-none`,`hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40`,`data-checked:border-primary`),children:[(0,$.jsx)(Tr,{theme:e,customSeed:i}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between px-0.5`,children:[(0,$.jsx)(`span`,{className:`text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:e.id===`custom`?_n(vn(i))===`dark`?l({id:`pvnfJD`}):l({id:`1njn7W`}):e.kind===`system`?l({id:`R9Khdg`}):e.kind===`light`?l({id:`1njn7W`}):l({id:`pvnfJD`})})]})]},e.id)),t[0]=l,t[1]=i,t[2]=d):d=t[2];let f;return t[3]!==s||t[4]!==o||t[5]!==a||t[6]!==r||t[7]!==u||t[8]!==d?(f=(0,$.jsx)(W,{id:a,"aria-label":o,"aria-describedby":s,value:u,onValueChange:r,className:`grid w-full grid-cols-2 gap-2 sm:grid-cols-3`,children:d}),t[3]=s,t[4]=o,t[5]=a,t[6]=r,t[7]=u,t[8]=d,t[9]=f):f=t[9],f}function Or(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)]:Or(r,t)}}function kr(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 Ar(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 jr(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 Mr(e){if(!Ce(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 Nr(){let e=(0,Z.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(On,{className:`h-5 w-32`}),n=(0,$.jsx)(On,{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)(On,{className:`h-9 w-full`}),(0,$.jsx)(On,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function Pr({field:e,scope:t,commitField:n,isFlashed:r}){"use no memo";let{_:i}=c(),a=Zn(),o=je(Me,e.path),l=o?Ar(o):void 0,u=o?kr(o):void 0,d=o?jr(o):void 0,f=o?Te(o):void 0,p=f?.scope===`project`&&t!==`project`||f?.scope===`user`&&t!==`user`,m=e.path.join(`.`),h=i(e.label),[_,S]=(0,Q.useState)(!1),C=(0,Q.useRef)(null);(0,Q.useEffect)(()=>()=>{C.current&&clearTimeout(C.current)},[]);let w=()=>{S(!0),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>S(!1),1200)},T=()=>{let e=n(m);return e&&w(),e},E=()=>a.getFieldState(m).isDirty?T():!0,D=()=>{let e=u===void 0?null:u;a.setValue(m,e,{shouldDirty:!1}),T()},O=g(`relative`,r&&`animate-settings-flash`);return(0,$.jsx)(Jn,{control:a.control,name:m,render:({field:n})=>{let r=!p&&(u!==void 0||n.value!==void 0);return(0,$.jsxs)(Kn,{className:O,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(Xn,{className:`text-sm font-medium`,children:h}),r?(0,$.jsxs)(x,{children:[(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(v,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:D,"aria-label":i({id:`lhjq3G`,values:{labelText:h}}),children:(0,$.jsx)(Zt,{className:`size-3.5`})})}),(0,$.jsx)(b,{children:(0,$.jsx)(s,{id:`L-rMC9`})})]}):null]}),e.description?(0,$.jsx)(Qn,{className:`text-muted-foreground text-1sm`,children:i(e.description)}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Yn,{children:(0,$.jsx)(Fr,{field:e,ctl:n,typeTag:l,enumOptions:d,onCommit:E})}),(0,$.jsx)(zr,{visible:_,srOnly:e.control===`theme-tiles`})]}),(0,$.jsx)($n,{"data-field-error":e.path.join(`.`)})]})}})}function Fr({field:e,ctl:t,typeTag:n,enumOptions:r,onCommit:i,...a}){"use no memo";let{_:o}=c(),{setTheme:s}=u(),l=wn()?.merged??null;if(e.control===`theme-tiles`){let{id:n,...r}=a,c=l?.appearance?.customTheme;return(0,$.jsx)(Dr,{...r,id:n,value:typeof t.value==`string`?t.value:`default`,customSeed:c,"aria-label":o(e.label),onSelect:e=>{if(bn(e,c),e===`custom`)s(_n(vn(c))===`dark`?`dark`:`light`);else{let t=_e(e);t&&s(t)}t.onChange(e),i()}})}if(n===`boolean`)return(0,$.jsx)(U,{...a,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,...c}=a,l=e.path[0]===`appearance`&&e.path[1]===`theme`;return(0,$.jsx)(ne,{...c,type:`single`,value:typeof t.value==`string`?t.value:``,ref:t.ref,onValueChange:e=>{e&&(l&&s(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":o(e.label),children:r.map((e,t)=>(0,$.jsx)(te,{value:e,id:t===0?n:void 0,className:`text-1sm capitalize`,children:e},e))})}return n===`number`||n===`int`?(0,$.jsx)(Lr,{ctl:t,onCommit:i,...a}):n===`array`?(0,$.jsx)(Rr,{ctl:t,onCommit:i,...a}):(0,$.jsx)(Ir,{ctl:t,onCommit:i,...a})}function Ir({ctl:e,onCommit:t,...n}){"use no memo";return(0,$.jsx)(an,{...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 Lr({ctl:e,onCommit:t,...n}){"use no memo";let[r,i]=(0,Q.useState)(e.value===void 0?``:String(e.value)),a=(0,Q.useRef)(e.value);(0,Q.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)(an,{...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 Rr({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{Tt as r,et as i,qt as a}from"./DocumentContext-DDkluS7D.js";import{t as o}from"./react-f2sANaYj.js";import{n as s,r as c}from"./dist-Nvb76hAm.js";import{t as l}from"./useQuery-ZeEDLtxh.js";import{n as u}from"./dist-PQ5KMVDh.js";import{t as d}from"./compiler-runtime-BfE3aGVn.js";import{a as f,c as p,l as m,s as h}from"./terminal-input-events-C5UuEsAB.js";import{s as g,t as _}from"./createLucideIcon-DAkhoPjT.js";import{t as v}from"./button-Gol9BgNB.js";import{i as y,n as b,t as x}from"./tooltip-B4J7VHmA.js";import{n as S,r as C,t as w}from"./collapsible-B1mS1n9y.js";import{a as T,c as E,i as D,n as O,o as k,r as A,s as j,t as M}from"./dialog-TkFkuYVg.js";import{t as N}from"./checkbox-DY-vIhnZ.js";import{m as P,r as F,t as I}from"./dropdown-menu-xw8WTdb-.js";import{t as L}from"./label-DyipnO5I.js";import{a as R,i as z,n as B,o as V,r as H,t as U}from"./switch-DYic2V-1.js";import{i as W,n as G,r as K,t as ee}from"./radio-group-CGEdWasQ.js";import{t as q}from"./separator-DExEeoYE.js";import{n as te,t as ne}from"./toggle-group-CjXmmTGy.js";import{C as J,a as Y,b as re,c as ie,d as ae,f as oe,h as se,l as ce,n as le,o as ue,r as de,s as fe,t as pe,u as me,y as he}from"./agent-visibility-HpfSUFqP.js";import{i as ge}from"./terminal-telemetry-DxTZB2oZ.js";import{Aa as _e,F as ve,Fa as ye,Ft as be,Ga as xe,Ha as Se,Ia as Ce,Ma as we,Na as Te,Oa as Ee,P as De,Rt as Oe,Ta as ke,Ua as Ae,Wa as je,_a as Me,_t as Ne,b as Pe,ba as Fe,ei as Ie,et as Le,ii as Re,pr as ze,pt as Be,v as Ve,ya as He,za as Ue,zt as We}from"./dist-Cal4LUep.js";import{a as Ge,c as Ke,d as qe,s as Je,t as Ye}from"./EnableSyncConfirmDialog-B2sHRtLY.js";import{t as Xe}from"./arrow-up-right-obRIg3Sv.js";import{t as Ze}from"./RegisteredAgentIcon-8Tcfr3WP.js";import{t as Qe}from"./check-GqWaoTdV.js";import{t as $e}from"./chevron-right-C8oTR6gu.js";import{i as et}from"./prop-types-B-N3_i3c.js";import{C as tt,S as nt,b as rt,c as it,h as at,i as ot,l as st,o as ct,r as lt,t as ut,v as dt,y as ft}from"./skill-actions-C_5-d4BC.js";import{A as pt,F as mt,G as ht,I as gt,M as _t,N as vt,P as yt,S as bt,U as xt,V as St,_ as Ct,b as wt,c as Tt,d as Et,f as Dt,g as Ot,h as kt,i as At,k as jt,l as Mt,m as Nt,n as Pt,o as Ft,p as It,u as Lt,x as Rt,y as zt,z as Bt}from"./auth-state-cache-BUVYaS5m.js";import{i as Vt,l as Ht,r as Ut,s as Wt}from"./workspace-paths-B-NChZS2.js";import{t as Gt}from"./square-pen-C1vIlMAW.js";import{c as Kt,n as qt,t as Jt}from"./open-managed-artifact-tab-DfGutPkc.js";import{t as Yt}from"./info-yKMseklR.js";import{t as Xt}from"./loader-circle-Cg5SU7AZ.js";import{c as Zt,i as Qt}from"./field-DVIFAnvR.js";import{t as $t}from"./sliders-horizontal-34K0eDW2.js";import{t as en}from"./trash-2-BUuL4OCw.js";import{t as tn}from"./triangle-alert-Clgvyc7B.js";import{t as nn}from"./x-DVkpYo5d.js";import{n as X}from"./dist-BLAMau9Z.js";import{t as rn}from"./ConfigSharingInfoTooltip-DMbsfWD9.js";import{t as an}from"./input-D0ZW0Opq.js";import{c as on,d as sn,i as cn,l as ln,m as un,o as dn,s as fn}from"./use-settings-route-CXFzIfYo.js";import{t as pn}from"./parse-api-error-C_gwkKmG.js";import{i as mn}from"./documents-events-1HWCdfoh.js";import{o as hn}from"./doc-hash-BSK-KaTu.js";import{t as gn}from"./badge-Dba4cvJR.js";import"./config-provider-DIuwNlqX.js";import{a as _n,c as vn,i as yn,n as bn,o as xn,s as Sn}from"./use-apply-config-color-theme-CK97Jvup.js";import{n as Cn,r as wn}from"./config-context-gd3BC-iY.js";import{t as Tn}from"./external-link-T4Nj1gcG.js";import{t as En}from"./use-workspace-3T40FR83.js";import{t as Dn}from"./lint-plugin-meta-B3N1DKgL.js";import{t as On}from"./skeleton-HLkcMp95.js";import{d as kn,n as An,r as jn,t as Mn,u as Nn}from"./lint-config-client-G_mrikOJ.js";import{a as Pn,d as Fn,f as In,i as Ln,l as Rn,m as zn,o as Bn,p as Vn,s as Hn,t as Un,u as Wn}from"./sortable.esm-B6whf_t-.js";import{t as Gn}from"./textarea-RSYJwPz9.js";import{a as Kn,f as qn,i as Jn,n as Yn,o as Xn,p as Zn,r as Qn,s as $n,t as er}from"./form-D-z6QdLf.js";import{t as tr}from"./tag-pill-input-B27HgfRy.js";import{t as nr}from"./markdownlint-rule-browser-rS3aDGOb.js";import{n as rr,r as ir}from"./schema-fields-view-intent-Dz1ZzVCe.js";import{n as ar,t as or}from"./use-terminal-enabled-fhwpyN81.js";var sr=_(`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=d(),Q=e(o(),1),$=n(),cr=`settings-sharing-title`;function lr(){let e=(0,Z.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)(ur,{}):(0,$.jsx)(dr,{}),e[0]=n):n=e[0],n}function ur(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`h3`,{id:cr,className:`text-base font-semibold`,children:(0,$.jsx)(s,{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":cr,className:`space-y-3`,children:(0,$.jsxs)(`div`,{className:`space-y-1`,children:[t,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`7YRrJ9`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{})}})})]})}),e[1]=n):n=e[1],n}function dr(){let e=(0,Z.c)(39),{_:t}=c(),[n,r]=(0,Q.useState)(null),[i,a]=(0,Q.useState)(!1),[o,l]=(0,Q.useState)(null),u;e[0]===t?u=e[1]:(u=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(pr)}},e[0]=t,e[1]=u);let d=u,f;e[2]===d?f=e[3]:(f=()=>{d()},e[2]=d,e[3]=f);let p;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],e[4]=p):p=e[4],(0,Q.useEffect)(f,p);let m;e[5]!==t||e[6]!==i||e[7]!==d||e[8]!==n?(m=async function(e){let r=window.okDesktop?.sharing;if(!r||n===null||i||n.mode===e)return;a(!0),l(null);let o=null,s=null;try{o=await r.setMode(e)}catch(e){s=e}if(a(!1),s!==null){X.error(s instanceof Error?s.message:t({id:`qZv5ZR`}));return}o!==null&&(o.kind===`refused-tracked`?(l({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:`VvS_k_`}:{id:`k_pade`})),await d())},e[5]=t,e[6]=i,e[7]=d,e[8]=n,e[9]=m):m=e[9];let h=m,g;e[10]!==t||e[11]!==i||e[12]!==d||e[13]!==n?(g=async function(){let e=window.okDesktop?.sharing;if(!e||n===null||i)return;a(!0);let r=null,o=null;try{r=await e.setSkillsShared(!1)}catch(e){o=e}if(a(!1),o!==null){X.error(o instanceof Error?o.message:t({id:`onTlRk`}));return}if(r!==null){if(r.kind===`no-exclude`){let e=r.reason===`no-git`?t({id:`Xwump4`}):r.reason===`inaccessible`?t({id:`PlGC6r`}):t({id:`zcmYx4`});X.warning(t({id:`4h3e0H`,values:{detail:e}}));return}X.success(t({id:`pQf2Ux`})),await d()}},e[10]=t,e[11]=i,e[12]=d,e[13]=n,e[14]=g):g=e[14];let _=g;if(n===null){let t;return e[15]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":cr,className:`space-y-3`,children:[(0,$.jsx)(`h3`,{id:cr,className:`text-base font-semibold`,children:(0,$.jsx)(s,{id:`cs4mps`})}),(0,$.jsx)(On,{className:`h-24`})]}),e[15]=t):t=e[15],t}let y=n.mode===`no-git`,b;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`h3`,{id:cr,className:`text-base font-semibold`,children:(0,$.jsx)(s,{id:`cs4mps`})}),(0,$.jsx)(rn,{})]}),e[16]=b):b=e[16];let x;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[b,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`N55YNr`})})]}),e[17]=x):x=e[17];let S;e[18]!==i||e[19]!==y||e[20]!==h||e[21]!==n.mode?(S=y?(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)(s,{id:`ju38ms`})}):(0,$.jsxs)(ee,{value:n.mode,onValueChange:e=>void h(e),disabled:i,className:`gap-2`,"aria-labelledby":cr,"data-testid":`settings-sharing-radiogroup`,children:[(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-shared`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(G,{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)(s,{id:`0Gd0NU`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`dJw2_7`})})]})]}),(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-local-only`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(G,{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)(s,{id:`OgyJSr`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`cZ_8zB`})})]})]})]}),e[18]=i,e[19]=y,e[20]=h,e[21]=n.mode,e[22]=S):S=e[22];let C;e[23]!==i||e[24]!==_||e[25]!==n.mode||e[26]!==n.skillsShared?(C=n.mode===`local-only`&&n.skillsShared?(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-skills-exception`,children:[(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(s,{id:`Kiytqd`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`K0FgsP`})})]}),(0,$.jsx)(v,{variant:`outline`,size:`sm`,disabled:i,onClick:()=>void _(),children:(0,$.jsx)(s,{id:`9uI_rE`})})]}):null,e[23]=i,e[24]=_,e[25]=n.mode,e[26]=n.skillsShared,e[27]=C):C=e[27];let w;e[28]===o?w=e[29]:(w=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)(s,{id:`Kgdbkt`})}),(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-relaxed`,children:o.remediation}),(0,$.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>l(null),children:(0,$.jsx)(s,{id:`1QfxQT`})})]}),e[28]=o,e[29]=w);let T;e[30]!==o||e[31]!==n.mode||e[32]!==n.trackedUpstream?(T=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)(s,{id:`LhWYpm`})}),(0,$.jsx)(`ul`,{className:`list-disc pl-5 font-mono text-xs text-muted-foreground`,children:n.trackedUpstream.map(fr)}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`1XSMhZ`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]}):null,e[30]=o,e[31]=n.mode,e[32]=n.trackedUpstream,e[33]=T):T=e[33];let E;return e[34]!==T||e[35]!==S||e[36]!==C||e[37]!==w?(E=(0,$.jsxs)(`section`,{"aria-labelledby":cr,className:`space-y-4`,"data-testid":`settings-sharing`,children:[x,S,C,w,T]}),e[34]=T,e[35]=S,e[36]=C,e[37]=w,e[38]=E):E=e[38],E}function fr(e){return(0,$.jsx)(`li`,{children:e},e)}function pr(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[],skillsShared:!1}}function mr(e){let t=(0,Z.c)(35),{authQueryTransport:n,authTransport:r}=e,{_:i}=c(),a;t[0]===n?a=t[1]:(a=n??Bt(),t[0]=n,t[1]=a);let o=a,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l={phase:`loading`},t[2]=l):l=t[2];let[u,d]=(0,Q.useState)(l),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(null),y=(0,Q.useRef)(!1),b;t[3]===o?b=t[4]:(b=async function(){d({phase:`loading`});try{let e=await o.status();d({phase:`loaded`,result:e}),Pt(e.authenticated)}catch(e){console.warn(`[AccountSection] GitHub status check failed`,e),d({phase:`check-failed`})}},t[3]=o,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,Q.useEffect)(S,C);let w;t[8]!==i||t[9]!==x||t[10]!==o?(w=async function(){if(y.current)return;y.current=!0,p(!1),h(!0),_(null);let e=null;try{let t=o.signout?await o.signout():{ok:!1,error:i({id:`8cpOa8`})};t.ok||(e=t.error??i({id:`8cpOa8`}))}catch(t){console.warn(`[AccountSection] GitHub disconnect failed`,t),e=i({id:`8cpOa8`})}await x(),e&&_(e),h(!1),y.current=!1},t[8]=i,t[9]=x,t[10]=o,t[11]=w):w=t[11];let T=w,E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(`h3`,{id:`settings-account-title`,className:`text-base font-semibold`,children:(0,$.jsx)(s,{id:`AeXO77`})}),t[12]=E):E=t[12];let D;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[E,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`E6lrpp`})})]}),t[13]=D):D=t[13];let O;t[14]!==g||t[15]!==m||t[16]!==T||t[17]!==x||t[18]!==u.phase||t[19]!==u.result?(O=u.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)(s,{id:`IWGfGF`})}),(0,$.jsx)(On,{className:`h-4 w-40`}),(0,$.jsx)(On,{className:`h-8 w-32`})]}):u.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)(s,{id:`T_wG4n`})}),(0,$.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>void x(),children:(0,$.jsx)(s,{id:`KDw4GX`})})]}):u.result.authenticated?u.result.tier===`A`?(0,$.jsx)(gr,{login:u.result.login}):(0,$.jsx)(hr,{login:u.result.login,disconnecting:m,error:g,onDisconnect:()=>void T()}):(0,$.jsx)(_r,{onConnect:()=>p(!0)}),t[14]=g,t[15]=m,t[16]=T,t[17]=x,t[18]=u.phase,t[19]=u.result,t[20]=O):O=t[20];let k;t[21]===x?k=t[22]:(k=e=>{p(e),e||x()},t[21]=x,t[22]=k);let A=u.phase===`loaded`?u.result.host:void 0,j=u.phase===`loaded`?u.result.ghAvailable:void 0,M;t[23]===x?M=t[24]:(M=()=>{x()},t[23]=x,t[24]=M);let N;t[25]!==f||t[26]!==r||t[27]!==k||t[28]!==A||t[29]!==j||t[30]!==M?(N=(0,$.jsx)(gt,{open:f,onOpenChange:k,transport:r,host:A,ghAvailable:j,onSuccess:M}),t[25]=f,t[26]=r,t[27]=k,t[28]=A,t[29]=j,t[30]=M,t[31]=N):N=t[31];let P;return t[32]!==N||t[33]!==O?(P=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-3`,"data-testid":`settings-account`,children:[D,O,N]}),t[32]=N,t[33]=O,t[34]=P):P=t[34],P}function hr(e){let t=(0,Z.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)(s,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=o);let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(s,{id:`nxlOpL`})}),t[2]=c):c=t[2];let l;t[3]===o?l=t[4]:(l=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[o,c]}),t[3]=o,t[4]=l);let u;t[5]===r?u=t[6]:(u=r?(0,$.jsx)(s,{id:`rppgXF`}):(0,$.jsx)(s,{id:`-K0AvT`}),t[5]=r,t[6]=u);let d;t[7]!==r||t[8]!==a||t[9]!==u?(d=(0,$.jsx)(v,{variant:`outline`,onClick:a,disabled:r,"aria-describedby":`settings-account-disconnect-caveat`,"data-testid":`settings-account-disconnect`,children:u}),t[7]=r,t[8]=a,t[9]=u,t[10]=d):d=t[10];let f;t[11]!==l||t[12]!==d?(f=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[l,d]}),t[11]=l,t[12]=d,t[13]=f):f=t[13];let p;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`p`,{id:`settings-account-disconnect-caveat`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-account-disconnect-caveat`,children:(0,$.jsx)(s,{id:`msOK6I`})}),t[14]=p):p=t[14];let m;t[15]===i?m=t[16]:(m=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]=m);let h;return t[17]!==f||t[18]!==m?(h=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-connected`,children:[f,p,m]}),t[17]=f,t[18]=m,t[19]=h):h=t[19],h}function gr(e){let t=(0,Z.c)(5),{login:n}=e,r;t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(s,{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)(s,{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 _r(e){let t=(0,Z.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)(s,{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)(s,{id:`EJuO7B`})})]}),t[1]=i):i=t[1];let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(s,{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)(v,{onClick:n,"data-testid":`settings-account-connect`,children:a})]})}),t[3]=n,t[4]=o),o}function vr(e){return e.kind===`editor`?`editor:${e.id}`:e.kind===`skill`?`skill:${e.id}`:`path`}function yr(e){let t=(0,Z.c)(11),{testId:n,children:r}=e,{_:i}=c(),a;t[0]===i?a=t[1]:(a=i({id:`2B6eYX`}),t[0]=i,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Yt,{className:`size-3.5`}),t[2]=o):o=t[2];let s;t[3]!==a||t[4]!==n?(s=(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(v,{variant:`ghost`,size:`icon`,className:`mt-1.5 mr-1.5 h-6 w-6 shrink-0 text-muted-foreground opacity-60 hover:opacity-100`,"aria-label":a,"data-testid":n,children:o})}),t[3]=a,t[4]=n,t[5]=s):s=t[5];let l;t[6]===r?l=t[7]:(l=(0,$.jsx)(b,{side:`left`,className:`max-w-sm text-left`,children:(0,$.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:r})}),t[6]=r,t[7]=l);let u;return t[8]!==s||t[9]!==l?(u=(0,$.jsxs)(x,{children:[s,l]}),t[8]=s,t[9]=l,t[10]=u):u=t[10],u}function br(){let e=(0,Z.c)(38),{_:t}=c(),n=typeof window<`u`?window.okDesktop??null:null,[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(null),d,f;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{if(!n)return;let e=!1;return n.integrations.status().then(t=>{e||i(t)}).catch(()=>{e||o(!0)}),()=>{e=!0}},f=[n],e[0]=d,e[1]=f):(d=e[0],f=e[1]),(0,Q.useEffect)(d,f);let p;e[2]===t?p=e[3]:(p=async function(e,r){if(n){u(vr(e));try{let t=await n.integrations.setComponent({component:e,enabled:r});i(t.status),t.ok||X.error(t.error)}catch(e){let n=e;X.error(t({id:`gfdqcY`,values:{0:n instanceof Error?n.message:String(n)}}))}u(null)}},e[2]=t,e[3]=p);let m=p,h;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(`h3`,{id:`settings-ai-tools-title`,className:`text-base font-semibold`,children:(0,$.jsx)(s,{id:`_5qBNl`})}),e[4]=h):h=e[4];let g;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[h,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`mLAjyL`})})]}),e[5]=g):g=e[5];let _=g;if(!n||a){let t;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`ai-tools-unavailable`,children:(0,$.jsx)(s,{id:`O4PnDd`})})]}),e[6]=t):t=e[6],t}if(r===null){let t;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsxs)(`div`,{className:`space-y-2`,"data-testid":`ai-tools-loading`,children:[(0,$.jsx)(On,{className:`h-10 w-full`}),(0,$.jsx)(On,{className:`h-10 w-full`}),(0,$.jsx)(On,{className:`h-10 w-full`})]})]}),e[7]=t):t=e[7],t}let v=l!==null||!r.available,y=r.path.shellDetected||r.path.installed,b;e[8]===r.available?b=e[9]:(b=!r.available&&(0,$.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,"data-testid":`ai-tools-read-only`,children:(0,$.jsx)(s,{id:`OplnBG`})}),e[8]=r.available,e[9]=b);let x;e[10]!==t||e[11]!==m||e[12]!==v||e[13]!==y||e[14]!==r.path.installed||e[15]!==r.path.rcFilesToTouch?(x=y&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(s,{id:`ALhMYW`})}),(0,$.jsxs)(`div`,{className:`flex items-start overflow-hidden rounded-md border border-border bg-card/50 hover:bg-accent`,children:[(0,$.jsxs)(L,{htmlFor:`ai-tools-path`,className:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(N,{id:`ai-tools-path`,checked:r.path.installed,disabled:v,onCheckedChange:()=>void m({kind:`path`},!r.path.installed),className:`mt-0.5`,"data-testid":`ai-tools-path-checkbox`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(s,{id:`Fsx78O`,components:{0:(0,$.jsx)(`code`,{className:`inline-code`})}})}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`ai-tools-path-status`,children:r.path.installed?t({id:`yhdqox`}):t({id:`04XyCH`,values:{0:r.path.rcFilesToTouch.join(`, `)}})})]})]}),(0,$.jsxs)(yr,{testId:`ai-tools-path-info`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(s,{id:`f9lQNJ`})}),r.path.rcFilesToTouch.map(Sr),(0,$.jsx)(`p`,{className:`pt-1`,children:(0,$.jsx)(s,{id:`CWzc2T`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]})]})]}),e[10]=t,e[11]=m,e[12]=v,e[13]=y,e[14]=r.path.installed,e[15]=r.path.rcFilesToTouch,e[16]=x):x=e[16];let S;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(s,{id:`psfGPX`})}),e[17]=S):S=e[17];let C;if(e[18]!==t||e[19]!==m||e[20]!==v||e[21]!==r.editors){let n;e[23]!==t||e[24]!==m||e[25]!==v?(n=e=>{let n=e.state===`installed`||e.state===`foreign`,r=v||e.state===`unmanageable`,i=e.state===`not-installed`&&!e.detected,a=`https://openknowledge.ai/docs/integrations/${ve[e.id]}`,o=e.state===`installed`?t({id:`eQkgKV`}):e.state===`foreign`?t({id:`AczYxH`}):e.state===`unmanageable`?t({id:`LbmLyU`}):e.detected?t({id:`bBE5tC`}):null,c=e.state===`foreign`||e.state===`unmanageable`?`text-xs text-amber-600 dark:text-amber-400`:`text-xs text-muted-foreground`;return(0,$.jsxs)(`li`,{className:r?`flex items-start`:`flex items-start hover:bg-accent`,children:[(0,$.jsxs)(L,{htmlFor:`ai-tools-editor-${e.id}`,className:r?`flex flex-1 items-start gap-2.5 px-3 py-2.5 font-normal`:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(N,{id:`ai-tools-editor-${e.id}`,checked:n,disabled:r,onCheckedChange:()=>void m({kind:`editor`,id:e.id},!n),className:`mt-0.5`,"data-testid":`ai-tools-editor-checkbox-${e.id}`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.label}),o!==null&&(0,$.jsx)(`span`,{className:c,"data-testid":`ai-tools-editor-status-${e.id}`,children:o})]})]}),i&&(0,$.jsxs)(`a`,{href:a,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>Tn(e,a),onAuxClick:e=>Tn(e,a),"aria-label":t({id:`D-Oh1s`,values:{0:e.label}}),className:`flex shrink-0 items-center gap-0.5 px-2 py-2.5 text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,"data-testid":`ai-tools-editor-status-${e.id}`,children:[(0,$.jsx)(s,{id:`P_bX4O`}),(0,$.jsx)(Xe,{className:`size-3`,"aria-hidden":!0})]}),(0,$.jsxs)(yr,{testId:`ai-tools-editor-info-${e.id}`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(s,{id:`J2eKUI`})}),(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e.configPath??t({id:`ndwmea`})})}),(0,$.jsx)(`p`,{className:`pt-1 opacity-70`,children:(0,$.jsx)(s,{id:`VIwCaD`})}),(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e.entryLocator})})]})]},e.id)},e[23]=t,e[24]=m,e[25]=v,e[26]=n):n=e[26],C=r.editors.map(n),e[18]=t,e[19]=m,e[20]=v,e[21]=r.editors,e[22]=C}else C=e[22];let w;e[27]===C?w=e[28]:(w=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[S,(0,$.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:C})]}),e[27]=C,e[28]=w);let T;e[29]!==m||e[30]!==v||e[31]!==r.skills?(T=r.skills.length>0&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(s,{id:`28B21t`})}),(0,$.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:r.skills.map(e=>(0,$.jsxs)(`li`,{className:`flex items-start hover:bg-accent`,children:[(0,$.jsxs)(L,{htmlFor:`ai-tools-skill-${e.id}`,className:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(N,{id:`ai-tools-skill-${e.id}`,checked:e.installed,disabled:v,onCheckedChange:()=>void m({kind:`skill`,id:e.id},!e.installed),className:`mt-0.5`,"data-testid":`ai-tools-skill-checkbox-${e.id}`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(`code`,{children:e.name})}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`ai-tools-skill-status-${e.id}`,children:e.id===`discovery`?(0,$.jsx)(s,{id:`0inVGS`}):(0,$.jsx)(s,{id:`FXk_zY`})})]})]}),(0,$.jsxs)(yr,{testId:`ai-tools-skill-info-${e.id}`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(s,{id:`HSh8u_`})}),e.paths.map(xr)]})]},e.id))})]}),e[29]=m,e[30]=v,e[31]=r.skills,e[32]=T):T=e[32];let E;return e[33]!==T||e[34]!==b||e[35]!==x||e[36]!==w?(E=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,b,x,w,T]}),e[33]=T,e[34]=b,e[35]=x,e[36]=w,e[37]=E):E=e[37],E}function xr(e){return(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e})},e)}function Sr(e){return(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e})},e)}function Cr(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 wr(e,t){return e.id===`custom`?Cr(we(xn(vn(t)))):e.base?Cr(we(e.base)):{chrome:`var(--sidebar)`,surface:`var(--background)`,bar:`var(--primary)`,line:`var(--border)`,dots:[`var(--chart-2)`,`var(--chart-4)`,`var(--chart-3)`]}}function Tr(e){let t=(0,Z.c)(35),{theme:n,customSeed:r}=e,i,a,o,s,c,l,u,d,f;t[0]!==r||t[1]!==n?(i=wr(n,r),l=!0,u=`aspect-[4/3] w-full overflow-hidden rounded-md border`,d={backgroundColor:i.surface,borderColor:i.line},f=(0,$.jsxs)(`div`,{className:`flex h-1/3 items-center gap-1 px-1.5`,style:{backgroundColor:i.chrome,borderBottom:`1px solid ${i.line}`},children:[(0,$.jsx)(`span`,{className:`h-1.5 w-5 rounded-full`,style:{backgroundColor:i.bar}}),(0,$.jsx)(`span`,{className:`h-1.5 flex-1 rounded-full opacity-50`,style:{backgroundColor:i.line}})]}),c=`flex h-2/3`,a=`flex w-1/4 flex-col items-center justify-center gap-1`,o={backgroundColor:i.chrome,borderRight:`1px solid ${i.line}`},s=i.dots.map(Er),t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f):(i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10]);let p;t[11]!==a||t[12]!==o||t[13]!==s?(p=(0,$.jsx)(`div`,{className:a,style:o,children:s}),t[11]=a,t[12]=o,t[13]=s,t[14]=p):p=t[14];let m;t[15]===i.dots[1]?m=t[16]:(m=(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-full`,style:{backgroundColor:i.dots[1]}}),t[15]=i.dots[1],t[16]=m);let h;t[17]===i.line?h=t[18]:(h=(0,$.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-full opacity-60`,style:{backgroundColor:i.line}}),t[17]=i.line,t[18]=h);let g;t[19]===i.dots[0]?g=t[20]:(g=(0,$.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-full`,style:{backgroundColor:i.dots[0]}}),t[19]=i.dots[0],t[20]=g);let _;t[21]!==m||t[22]!==h||t[23]!==g?(_=(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1 px-1.5`,children:[m,h,g]}),t[21]=m,t[22]=h,t[23]=g,t[24]=_):_=t[24];let v;t[25]!==_||t[26]!==c||t[27]!==p?(v=(0,$.jsxs)(`div`,{className:c,children:[p,_]}),t[25]=_,t[26]=c,t[27]=p,t[28]=v):v=t[28];let y;return t[29]!==v||t[30]!==l||t[31]!==u||t[32]!==d||t[33]!==f?(y=(0,$.jsxs)(`div`,{"aria-hidden":l,className:u,style:d,children:[f,v]}),t[29]=v,t[30]=l,t[31]=u,t[32]=d,t[33]=f,t[34]=y):y=t[34],y}function Er(e,t){return(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{backgroundColor:e}},t)}function Dr(e){let t=(0,Z.c)(10),{value:n,onSelect:r,customSeed:i,id:a,"aria-label":o,"aria-describedby":s}=e,{_:l}=c(),u=ke.some(e=>e.id===n)?n:`default`,d;t[0]!==l||t[1]!==i?(d=ke.map(e=>(0,$.jsxs)(K,{value:e.id,className:g(`group/tile flex flex-col gap-1.5 rounded-lg border-2 border-transparent p-1 text-left outline-none`,`hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40`,`data-checked:border-primary`),children:[(0,$.jsx)(Tr,{theme:e,customSeed:i}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between px-0.5`,children:[(0,$.jsx)(`span`,{className:`text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:e.id===`custom`?_n(vn(i))===`dark`?l({id:`pvnfJD`}):l({id:`1njn7W`}):e.kind===`system`?l({id:`R9Khdg`}):e.kind===`light`?l({id:`1njn7W`}):l({id:`pvnfJD`})})]})]},e.id)),t[0]=l,t[1]=i,t[2]=d):d=t[2];let f;return t[3]!==s||t[4]!==o||t[5]!==a||t[6]!==r||t[7]!==u||t[8]!==d?(f=(0,$.jsx)(W,{id:a,"aria-label":o,"aria-describedby":s,value:u,onValueChange:r,className:`grid w-full grid-cols-2 gap-2 sm:grid-cols-3`,children:d}),t[3]=s,t[4]=o,t[5]=a,t[6]=r,t[7]=u,t[8]=d,t[9]=f):f=t[9],f}function Or(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)]:Or(r,t)}}function kr(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 Ar(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 jr(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 Mr(e){if(!Ce(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 Nr(){let e=(0,Z.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(On,{className:`h-5 w-32`}),n=(0,$.jsx)(On,{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)(On,{className:`h-9 w-full`}),(0,$.jsx)(On,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function Pr({field:e,scope:t,commitField:n,isFlashed:r}){"use no memo";let{_:i}=c(),a=Zn(),o=je(Me,e.path),l=o?Ar(o):void 0,u=o?kr(o):void 0,d=o?jr(o):void 0,f=o?Te(o):void 0,p=f?.scope===`project`&&t!==`project`||f?.scope===`user`&&t!==`user`,m=e.path.join(`.`),h=i(e.label),[_,S]=(0,Q.useState)(!1),C=(0,Q.useRef)(null);(0,Q.useEffect)(()=>()=>{C.current&&clearTimeout(C.current)},[]);let w=()=>{S(!0),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>S(!1),1200)},T=()=>{let e=n(m);return e&&w(),e},E=()=>a.getFieldState(m).isDirty?T():!0,D=()=>{let e=u===void 0?null:u;a.setValue(m,e,{shouldDirty:!1}),T()},O=g(`relative`,r&&`animate-settings-flash`);return(0,$.jsx)(Jn,{control:a.control,name:m,render:({field:n})=>{let r=!p&&(u!==void 0||n.value!==void 0);return(0,$.jsxs)(Kn,{className:O,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(Xn,{className:`text-sm font-medium`,children:h}),r?(0,$.jsxs)(x,{children:[(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(v,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:D,"aria-label":i({id:`lhjq3G`,values:{labelText:h}}),children:(0,$.jsx)(Zt,{className:`size-3.5`})})}),(0,$.jsx)(b,{children:(0,$.jsx)(s,{id:`L-rMC9`})})]}):null]}),e.description?(0,$.jsx)(Qn,{className:`text-muted-foreground text-1sm`,children:i(e.description)}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Yn,{children:(0,$.jsx)(Fr,{field:e,ctl:n,typeTag:l,enumOptions:d,onCommit:E})}),(0,$.jsx)(zr,{visible:_,srOnly:e.control===`theme-tiles`})]}),(0,$.jsx)($n,{"data-field-error":e.path.join(`.`)})]})}})}function Fr({field:e,ctl:t,typeTag:n,enumOptions:r,onCommit:i,...a}){"use no memo";let{_:o}=c(),{setTheme:s}=u(),l=wn()?.merged??null;if(e.control===`theme-tiles`){let{id:n,...r}=a,c=l?.appearance?.customTheme;return(0,$.jsx)(Dr,{...r,id:n,value:typeof t.value==`string`?t.value:`default`,customSeed:c,"aria-label":o(e.label),onSelect:e=>{if(bn(e,c),e===`custom`)s(_n(vn(c))===`dark`?`dark`:`light`);else{let t=_e(e);t&&s(t)}t.onChange(e),i()}})}if(n===`boolean`)return(0,$.jsx)(U,{...a,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,...c}=a,l=e.path[0]===`appearance`&&e.path[1]===`theme`;return(0,$.jsx)(ne,{...c,type:`single`,value:typeof t.value==`string`?t.value:``,ref:t.ref,onValueChange:e=>{e&&(l&&s(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":o(e.label),children:r.map((e,t)=>(0,$.jsx)(te,{value:e,id:t===0?n:void 0,className:`text-1sm capitalize`,children:e},e))})}return n===`number`||n===`int`?(0,$.jsx)(Lr,{ctl:t,onCommit:i,...a}):n===`array`?(0,$.jsx)(Rr,{ctl:t,onCommit:i,...a}):(0,$.jsx)(Ir,{ctl:t,onCommit:i,...a})}function Ir({ctl:e,onCommit:t,...n}){"use no memo";return(0,$.jsx)(an,{...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 Lr({ctl:e,onCommit:t,...n}){"use no memo";let[r,i]=(0,Q.useState)(e.value===void 0?``:String(e.value)),a=(0,Q.useRef)(e.value);(0,Q.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)(an,{...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 Rr({ctl:e,onCommit:t,...n}){"use no memo";let r=Array.isArray(e.value)?e.value.join(`
|
|
2
2
|
`):``,[i,a]=(0,Q.useState)(r),o=(0,Q.useRef)(r);(0,Q.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-Gol9BgNB.js";import{a as ee,c as te,i as ne,n as re,o as ie,s as ae,t as oe}from"./dialog-TkFkuYVg.js";import{n as se,t as s}from"./git-branch-CMJAiYLz.js";import{t as c}from"./loader-circle-Cg5SU7AZ.js";import{n as ce,t as le}from"./miss-dialog-store-Bx4JLuKB.js";import{n as l}from"./dist-BLAMau9Z.js";import{t as u}from"./desktop-bridge-types--ZPzhkC9.js";import{n as d}from"./worktree-store-LSx9q9Ga.js";import{a as f,n as ue}from"./receive-store-iF35zQOA.js";import{t as de}from"./share-metadata-rows-BlaR96La.js";var p=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 m(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=m(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`}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:t.reason,helper:t.helper}}:{state:e}}var h=t();function we(e){return e!==null&&e.kind===`project-branch-switch`}function g(e){let t=(0,fe.c)(217),{bridge:n,store:a}=e,m=a===void 0?ue:a,{_:g}=i(),_=(0,p.useSyncExternalStore)(m.subscribe,m.getSnapshot,je),[v,y]=(0,p.useState)(he),Me=(0,p.useRef)(!1),Ne=(0,p.useRef)(!1),Pe=(0,p.useRef)(!1),Fe=(0,p.useRef)(null),Ie;t[0]===_?Ie=t[1]:(Ie=we(_)?_:null,t[0]=_,t[1]=Ie);let b=Ie,Le;t[2]!==g||t[3]!==b?.share.target.kind?(Le=b?.share.target.kind===`folder`?g({id:`ugoTXs`}):g({id:`XH30C4`}),t[2]=g,t[3]=b?.share.target.kind,t[4]=Le):Le=t[4];let x=Le,Re;t[5]===b?Re=t[6]:(Re=()=>{y(he),Me.current=!1,Ne.current=!1,Pe.current=!1,Fe.current=b},t[5]=b,t[6]=Re);let ze;t[7]===_?ze=t[8]:(ze=[_],t[7]=_,t[8]=ze),(0,p.useEffect)(Re,ze);let Be;t[9]!==b||t[10]!==n?(Be=()=>{if(!b||Me.current)return;Me.current=!0;let e=!1;return n.project.fetchBranchInfo({projectPath:b.projectPath,branch:b.share.branch,kind:b.share.target.kind,path:u(b.share.target)}).then(t=>{e||y(e=>ge(e,t))}).catch(t=>{e||(console.warn(`[receive] branch-info-fetch-failed`,t instanceof Error?t.message:t),y(Ae))}),()=>{e=!0}},t[9]=b,t[10]=n,t[11]=Be):Be=t[11];let Ve;t[12]===b?Ve=t[13]:(Ve=[b],t[12]=b,t[13]=Ve),(0,p.useEffect)(Be,Ve);let He;t[14]!==b||t[15]!==v.info||t[16]!==v.phase||t[17]!==n?(He=()=>{if(!b||v.phase!==`ready`||Pe.current||!ye(v.info))return;Pe.current=!0,y(be);let e=b;n.project.fetchTargetStatus({projectPath:b.projectPath,branch:b.share.branch,kind:b.share.target.kind,path:u(b.share.target)}).then(t=>{Fe.current===e&&y(e=>xe(e,t))}).catch(t=>{Fe.current===e&&(console.warn(`[receive] target-status-fetch-failed`,t instanceof Error?t.message:t),y(ke))})},t[14]=b,t[15]=v.info,t[16]=v.phase,t[17]=n,t[18]=He):He=t[18];let Ue;t[19]!==b||t[20]!==v.phase?(Ue=[v.phase,b],t[19]=b,t[20]=v.phase,t[21]=Ue):Ue=t[21],(0,p.useEffect)(He,Ue);let We;t[22]!==b||t[23]!==v.phase||t[24]!==v.resolution||t[25]!==m?(We=()=>{if(v.phase!==`verdict`)return;let{kind:e}=v.resolution;e!==`deleted`&&e!==`never-on-branch`||b&&(le.arm({kind:b.share.target.kind,path:u(b.share.target),branch:b.share.branch}),m.dismiss())},t[22]=b,t[23]=v.phase,t[24]=v.resolution,t[25]=m,t[26]=We):We=t[26];let Ge;t[27]!==b||t[28]!==v||t[29]!==m?(Ge=[v,b,m],t[27]=b,t[28]=v,t[29]=m,t[30]=Ge):Ge=t[30],(0,p.useEffect)(We,Ge);let Ke;t[31]!==v.phase||t[32]!==v.resolution?(Ke=()=>{v.phase===`verdict`&&console.log(f({verdict_cell:v.resolution.kind}))},t[31]=v.phase,t[32]=v.resolution,t[33]=Ke):Ke=t[33];let qe;t[34]===v?qe=t[35]:(qe=[v],t[34]=v,t[35]=qe),(0,p.useEffect)(Ke,qe);let Je;t[36]!==g||t[37]!==b||t[38]!==v.pendingDoc||t[39]!==v.phase||t[40]!==n||t[41]!==m||t[42]!==x?(Je=()=>{if(v.phase!==`awaiting-cc1-recycle`||!b)return;let e=b.share.branch,t=v.pendingDoc;if(!e){m.dismiss();return}if(Ne.current)return;Ne.current=!0;let r=!1;return n.project.awaitBranchSwitched({projectPath:b.projectPath,branch:e,timeoutMs:3e4}).then(i=>{if(!r){if(i.ok){console.log(f({branch_dialog_action:`branch-switch-complete`,branch:e})),n.project.open({path:b.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:b.share.target.kind,path:t},pendingBranch:e}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=switch`,e instanceof Error?e.message:e),l.error(g({id:`gQV-9w`,values:{targetNoun:x}}))}),m.dismiss();return}console.log(f({branch_dialog_action:`branch-switch-timeout`,branch:e})),l.error(g({id:`LBwUR6`,values:{targetNoun:x}})),m.dismiss()}}).catch(e=>{r||(console.warn(`[receive] awaitBranchSwitched rejected`,e instanceof Error?e.message:e),l.error(g({id:`Jw6EC4`,values:{targetNoun:x}})),m.dismiss())}),()=>{r=!0}},t[36]=g,t[37]=b,t[38]=v.pendingDoc,t[39]=v.phase,t[40]=n,t[41]=m,t[42]=x,t[43]=Je):Je=t[43];let Ye;if(t[44]!==b||t[45]!==v.phase?(Ye=[v.phase,b],t[44]=b,t[45]=v.phase,t[46]=Ye):Ye=t[46],(0,p.useEffect)(Je,Ye),!b)return null;let{share:S,projectPath:C,currentBranch:w}=b,T=S.branch,Xe;t[47]!==g||t[48]!==n.project||t[49]!==C||t[50]!==T||t[51]!==m?(Xe=function(e,t,r){console.log(f({branch_dialog_action:`switch`,branch_action:`switch`,branch:T,verdict_cell:r})),y(t=>_e(t,e)),n.project.runCheckout(t?{projectPath:C,branch:T,fastForward:!0}:{projectPath:C,branch:T}).then(e=>{let t=null,n=!1;y(r=>{let{state:i,sideEffect:a}=Se(r,e);return a&&(t=a.reason,n=i.phase===`dismissed`),i}),t===`branch-not-found`?l.error(g({id:`NJyQi_`,values:{shareBranch:T}})):t===`fetch-failed`?l.error(g({id:`bWLmRK`})):(t===`checkout-failed`||t===`proxy-null`)&&l.error(g({id:`c863eW`,values:{shareBranch:T}})),n&&m.dismiss()}).catch(e=>{console.warn(`[receive] runCheckout rejected branch_action=switch`,e instanceof Error?e.message:e),y(Oe),l.error(g({id:`c863eW`,values:{shareBranch:T}}))})},t[47]=g,t[48]=n.project,t[49]=C,t[50]=T,t[51]=m,t[52]=Xe):Xe=t[52];let E=Xe,Ze;t[53]!==v.info||t[54]!==v.phase||t[55]!==E||t[56]!==S.target?(Ze=function(){v.phase===`ready`&&pe(v.info).switchEnabled&&E(u(S.target),!1)},t[53]=v.info,t[54]=v.phase,t[55]=E,t[56]=S.target,t[57]=Ze):Ze=t[57];let Qe=Ze,$e;t[58]!==v.phase||t[59]!==v.resolution||t[60]!==E||t[61]!==S.target?($e=function(){v.phase===`verdict`&&E(u(S.target),!0,v.resolution.kind)},t[58]=v.phase,t[59]=v.resolution,t[60]=E,t[61]=S.target,t[62]=$e):$e=t[62];let et=$e,tt;t[63]!==v.phase||t[64]!==v.resolution||t[65]!==E?(tt=function(){v.phase===`verdict`&&v.resolution.kind===`renamed`&&E(v.resolution.renamedTo,!0,v.resolution.kind)},t[63]=v.phase,t[64]=v.resolution,t[65]=E,t[66]=tt):tt=t[66];let nt=tt,rt;t[67]!==v.phase||t[68]!==v.resolution||t[69]!==E||t[70]!==S.target?(rt=function(){v.phase===`verdict`&&E(u(S.target),!1,v.resolution.kind)},t[67]=v.phase,t[68]=v.resolution,t[69]=E,t[70]=S.target,t[71]=rt):rt=t[71];let it=rt,at;t[72]!==g||t[73]!==n.project||t[74]!==C||t[75]!==S.target||t[76]!==T||t[77]!==m||t[78]!==x?(at=function(){console.log(f({branch_dialog_action:`open-current`,branch:T})),n.project.open({path:C,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:S.target.kind,path:u(S.target)}}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=open-current`,e instanceof Error?e.message:e),l.error(g({id:`b5aNbi`,values:{targetNoun:x}}))}),m.dismiss()},t[72]=g,t[73]=n.project,t[74]=C,t[75]=S.target,t[76]=T,t[77]=m,t[78]=x,t[79]=at):at=t[79];let ot=at,st;t[80]!==g||t[81]!==T?(st=function(e,t){switch(e){case`helper-not-found`:{let e=t??g({id:`cHhH3i`});l.error(g({id:`Z7x_Zh`,values:{tool:e}}));return}case`branch-not-found`:l.error(g({id:`NJyQi_`,values:{shareBranch:T}}));return;case`fetch-failed`:l.error(g({id:`bWLmRK`}));return;case`already-checked-out`:l.error(g({id:`ljHjfg`}));return;case`branch-exists`:l.error(g({id:`h3QZcB`,values:{shareBranch:T}}));return;case`path-exists`:l.error(g({id:`cN1Gcp`,values:{shareBranch:T}}));return;case`no-git`:l.error(g({id:`CFnavk`}));return;case`invalid-branch`:l.error(g({id:`JfPuv7`,values:{shareBranch:T}}));return;case`proxy-null`:case`error`:l.error(g({id:`e8zYa8`,values:{shareBranch:T}}));return;default:throw Error(`Unhandled worktree failure reason: ${String(e)}`)}},t[80]=g,t[81]=T,t[82]=st):st=t[82];let ct=st,lt;t[83]!==g||t[84]!==n.project||t[85]!==S.target||t[86]!==T||t[87]!==ct||t[88]!==m?(lt=function(e){let t=null,r,i=!1,a=null;if(y(n=>{let{state:o,sideEffect:ee}=Ce(n,e);return ee&&(t=ee.reason,r=ee.helper,i=o.phase===`dismissed`),o.phase===`opening-worktree`&&(a=o.path),o}),t!==null&&(console.log(f({branch_dialog_action:`open-worktree-failed:${t}`,branch:T})),ct(t,r)),a!==null){d();let e=a;n.project.open({path:e,target:`new-window`,entryPoint:`worktree`,pendingDeepLinkTarget:{kind:S.target.kind,path:u(S.target)},pendingBranch:T}).catch(t=>{console.warn(`[receive] worktree-open-failed branch_dialog_action=open-worktree`,t instanceof Error?t.message:t),l.error(g({id:`LdABLa`,values:{target:e}}))}),m.dismiss()}i&&m.dismiss()},t[83]=g,t[84]=n.project,t[85]=S.target,t[86]=T,t[87]=ct,t[88]=m,t[89]=lt):lt=t[89];let ut=lt,dt;t[90]!==ut||t[91]!==v.phase||t[92]!==n.worktree||t[93]!==T?(dt=function(){v.phase===`ready`&&(console.log(f({branch_dialog_action:`open-worktree`,branch:T})),y(ve),n.worktree.checkout({branch:T}).then(e=>{ut(e)}).catch(e=>{console.warn(`[receive] worktree-checkout rejected branch_dialog_action=open-worktree`,e instanceof Error?e.message:e),ut(null)}))},t[90]=ut,t[91]=v.phase,t[92]=n.worktree,t[93]=T,t[94]=dt):dt=t[94];let ft=dt,pt;t[95]!==g||t[96]!==v.otherWorktreePath||t[97]!==v.phase||t[98]!==n.project||t[99]!==S.target||t[100]!==T||t[101]!==m?(pt=function(){if(v.phase!==`branch-in-other-worktree`)return;let e=v.otherWorktreePath;console.log(f({branch_dialog_action:`pivot-to-other-worktree`,branch:T})),n.project.open({path:e,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:S.target.kind,path:u(S.target)},pendingBranch:T}).catch(t=>{console.warn(`[receive] pivot-open-failed branch_action=pivot-to-other-worktree`,t instanceof Error?t.message:t),l.error(g({id:`LdABLa`,values:{target:e}}))}),m.dismiss()},t[95]=g,t[96]=v.otherWorktreePath,t[97]=v.phase,t[98]=n.project,t[99]=S.target,t[100]=T,t[101]=m,t[102]=pt):pt=t[102];let mt=pt,ht;t[103]!==v.phase||t[104]!==v.resolution||t[105]!==m?(ht=function(){console.log(f({branch_dialog_action:`cancel`,verdict_cell:v.phase===`verdict`?v.resolution.kind:void 0})),m.dismiss()},t[103]=v.phase,t[104]=v.resolution,t[105]=m,t[106]=ht):ht=t[106];let D=ht,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]!==v.info||t[109]!==v.otherWorktreePath||t[110]!==v.phase||t[111]!==v.resolution||t[112]!==D||t[113]!==w||t[114]!==S.branch||t[115]!==S.owner||t[116]!==S.repo||t[117]!==S.target||t[118]!==T||t[119]!==x){G=v.phase===`ready`||v.phase===`switching`||v.phase===`creating-worktree`?pe(v.info):null;let e;t[139]!==v.info||t[140]!==v.phase||t[141]!==w?(e=v.phase===`ready`||v.phase===`switching`||v.phase===`creating-worktree`?me(v.info):w??`HEAD`,t[139]=v.info,t[140]=v.phase,t[141]=w,t[142]=e):e=t[142];let n=e;P=v.phase===`switching`||v.phase===`awaiting-cc1-recycle`,j=v.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 ie=v.phase===`loading`,se=v.phase===`error`;A=oe,U=!0,t[149]===D?W=t[150]:(W=e=>{e||D()},t[149]=D,t[150]=W),k=ne,R=`sm:max-w-xl`,z=`share-branch-switch-dialog`,B=De,V=Ee;let s;t[151]===x?s=t[152]:(s=(0,h.jsx)(te,{children:(0,h.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:x}})}),t[151]=x,t[152]=s);let ce=S.owner,le=S.repo,l;t[153]===S.target?l=t[154]:(l=u(S.target),t[153]=S.target,t[154]=l);let d;t[155]!==S.owner||t[156]!==S.repo||t[157]!==l?(d=(0,h.jsx)(ee,{className:`sr-only`,children:(0,h.jsx)(r,{id:`f8jU-L`,values:{0:ce,1:le,2:l}})}),t[155]=S.owner,t[156]=S.repo,t[157]=l,t[158]=d):d=t[158],t[159]!==s||t[160]!==d?(H=(0,h.jsxs)(ae,{children:[s,d]}),t[159]=s,t[160]=d,t[161]=H):H=t[161],O=re;let f=S.owner,ue=S.repo,p;t[162]===S.target?p=t[163]:(p=u(S.target),t[162]=S.target,t[163]=p),t[164]!==S.branch||t[165]!==S.owner||t[166]!==S.repo||t[167]!==S.target.kind||t[168]!==p?(F=(0,h.jsx)(`div`,{className:`mb-4`,children:(0,h.jsx)(de,{owner:f,repo:ue,path:p,kind:S.target.kind,branch:S.branch,testId:`share-branch-switch-metadata`,branchTestId:`share-branch-switch-metadata-branch`})}),t[164]=S.branch,t[165]=S.owner,t[166]=S.repo,t[167]=S.target.kind,t[168]=p,t[169]=F):F=t[169],I=v.phase===`branch-in-other-worktree`?(0,h.jsxs)(`div`,{className:`text-sm text-muted-foreground`,"data-testid":`share-branch-switch-in-other-worktree`,children:[(0,h.jsx)(`p`,{className:`leading-6`,children:(0,h.jsx)(r,{id:`yjExfe`,values:{shareBranch:T},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),(0,h.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:v.otherWorktreePath})]}):v.phase===`verdict-pending`?(0,h.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,h.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,h.jsx)(r,{id:`c8jBgX`})]}):v.phase===`verdict`?v.resolution.kind===`on-origin`?(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-on-origin`,children:(0,h.jsx)(r,{id:`Uay5NL`,values:{targetNoun:x,shareBranch:T},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):v.resolution.kind===`renamed`?(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-renamed`,children:(0,h.jsx)(r,{id:`P0HC30`,values:{0:v.resolution.renamedTo,targetNoun:x},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):v.resolution.kind===`diverged`?(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-diverged`,children:(0,h.jsx)(r,{id:`kLv8d3`,values:{shareBranch:T,targetNoun:x},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,h.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,h.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,h.jsx)(r,{id:`c8jBgX`})]}):ie?(0,h.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,h.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,h.jsx)(r,{id:`jerqF0`})]}):se?(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,h.jsx)(r,{id:`w4hMYl`})}):G?.kind===`D`?(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,h.jsx)(r,{id:`DTI-fp`,values:{targetNoun:x,shareBranch:T},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):G?.kind===`B`?(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,h.jsx)(r,{id:`sZ2IOu`,values:{targetNoun:x,shareBranch:T,currentLabel:n},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,h.jsx)(r,{id:`_902BE`,values:{targetNoun:x,shareBranch:T,currentLabel:n},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),L=G&&!G.switchEnabled&&G.conflictingFiles.length>0?(0,h.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,h.jsx)(`p`,{className:`font-medium text-foreground/90`,children:(0,h.jsx)(r,{id:`n2lRue`})}),(0,h.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(Te)})]}):null,t[107]=g,t[108]=v.info,t[109]=v.otherWorktreePath,t[110]=v.phase,t[111]=v.resolution,t[112]=D,t[113]=w,t[114]=S.branch,t[115]=S.owner,t[116]=S.repo,t[117]=S.target,t[118]=T,t[119]=x,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,h.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,h.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,h.jsx)(r,{id:`CU3AiE`})]}):null,t[170]=P,t[171]=q);let J;t[172]===j?J=t[173]:(J=j?(0,h.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,h.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,h.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,h.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 gt;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(gt=(0,h.jsx)(r,{id:`dEgA5A`}),t[181]=gt):gt=t[181];let X;t[182]===D?X=t[183]:(X=(0,h.jsx)(o,{variant:`ghost`,className:`font-mono uppercase`,onClick:D,"data-testid":`share-branch-switch-cancel`,children:gt}),t[182]=D,t[183]=X);let Z;t[184]!==v.phase||t[185]!==v.resolution||t[186]!==j||t[187]!==ot||t[188]!==nt||t[189]!==ft||t[190]!==mt||t[191]!==it||t[192]!==Qe||t[193]!==et||t[194]!==M||t[195]!==N||t[196]!==P||t[197]!==G||t[198]!==K?(Z=v.phase===`branch-in-other-worktree`?(0,h.jsx)(o,{onClick:mt,"data-testid":`share-branch-switch-in-other-worktree-pivot`,children:(0,h.jsx)(r,{id:`hyCxJY`})}):v.phase===`verdict`?v.resolution.kind===`on-origin`?(0,h.jsxs)(o,{onClick:et,"data-testid":`share-branch-switch-verdict-switch-update`,children:[(0,h.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),(0,h.jsx)(r,{id:`uA_jXp`})]}):v.resolution.kind===`renamed`?(0,h.jsxs)(o,{onClick:nt,"data-testid":`share-branch-switch-verdict-open-renamed`,children:[(0,h.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),(0,h.jsx)(r,{id:`AItsE5`})]}):v.resolution.kind===`diverged`?(0,h.jsxs)(o,{onClick:it,"data-testid":`share-branch-switch-verdict-plain-switch`,children:[(0,h.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),N]}):null:(0,h.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,h.jsxs)(o,{variant:`outline`,className:`font-mono uppercase`,onClick:ot,disabled:P||j,"data-testid":`share-branch-switch-open-current`,children:[(0,h.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),M]}):null,(0,h.jsx)(o,{variant:`outline`,onClick:Qe,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,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(c,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}),N]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),N]})}),(0,h.jsx)(o,{onClick:ft,disabled:!G||P||j,"data-testid":`share-branch-switch-worktree`,children:j?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(c,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}),K]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(se,{className:`size-3.5`,"aria-hidden":!0}),K]})})]}),t[184]=v.phase,t[185]=v.resolution,t[186]=j,t[187]=ot,t[188]=nt,t[189]=ft,t[190]=mt,t[191]=it,t[192]=Qe,t[193]=et,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,h.jsxs)(ie,{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,h.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 _t;return t[212]!==A||t[213]!==U||t[214]!==W||t[215]!==$?(_t=(0,h.jsx)(A,{open:U,onOpenChange:W,children:$}),t[212]=A,t[213]=U,t[214]=W,t[215]=$,t[216]=_t):_t=t[216],_t}function Te(e){return(0,h.jsx)(`li`,{children:(0,h.jsx)(`code`,{className:`text-foreground/80`,children:e})},e)}function Ee(e){e.preventDefault()}function De(e){e.preventDefault()}function Oe(e){return Se(e,null).state}function ke(e){return xe(e,null)}function Ae(e){return ge(e,null)}function je(){return null}export{g 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-Gol9BgNB.js";import{a as ee,c as te,i as ne,n as re,o as ie,s as ae,t as oe}from"./dialog-TkFkuYVg.js";import{n as se,t as s}from"./git-branch-CMJAiYLz.js";import{t as c}from"./loader-circle-Cg5SU7AZ.js";import{n as ce,t as le}from"./miss-dialog-store-Bx4JLuKB.js";import{n as l}from"./dist-BLAMau9Z.js";import{t as u}from"./desktop-bridge-types--ZPzhkC9.js";import{n as d}from"./worktree-store-LSx9q9Ga.js";import{a as f,n as ue}from"./receive-store-CL0RH8Oa.js";import{t as de}from"./share-metadata-rows-BlaR96La.js";var p=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 m(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=m(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`}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:t.reason,helper:t.helper}}:{state:e}}var h=t();function we(e){return e!==null&&e.kind===`project-branch-switch`}function g(e){let t=(0,fe.c)(217),{bridge:n,store:a}=e,m=a===void 0?ue:a,{_:g}=i(),_=(0,p.useSyncExternalStore)(m.subscribe,m.getSnapshot,je),[v,y]=(0,p.useState)(he),Me=(0,p.useRef)(!1),Ne=(0,p.useRef)(!1),Pe=(0,p.useRef)(!1),Fe=(0,p.useRef)(null),Ie;t[0]===_?Ie=t[1]:(Ie=we(_)?_:null,t[0]=_,t[1]=Ie);let b=Ie,Le;t[2]!==g||t[3]!==b?.share.target.kind?(Le=b?.share.target.kind===`folder`?g({id:`ugoTXs`}):g({id:`XH30C4`}),t[2]=g,t[3]=b?.share.target.kind,t[4]=Le):Le=t[4];let x=Le,Re;t[5]===b?Re=t[6]:(Re=()=>{y(he),Me.current=!1,Ne.current=!1,Pe.current=!1,Fe.current=b},t[5]=b,t[6]=Re);let ze;t[7]===_?ze=t[8]:(ze=[_],t[7]=_,t[8]=ze),(0,p.useEffect)(Re,ze);let Be;t[9]!==b||t[10]!==n?(Be=()=>{if(!b||Me.current)return;Me.current=!0;let e=!1;return n.project.fetchBranchInfo({projectPath:b.projectPath,branch:b.share.branch,kind:b.share.target.kind,path:u(b.share.target)}).then(t=>{e||y(e=>ge(e,t))}).catch(t=>{e||(console.warn(`[receive] branch-info-fetch-failed`,t instanceof Error?t.message:t),y(Ae))}),()=>{e=!0}},t[9]=b,t[10]=n,t[11]=Be):Be=t[11];let Ve;t[12]===b?Ve=t[13]:(Ve=[b],t[12]=b,t[13]=Ve),(0,p.useEffect)(Be,Ve);let He;t[14]!==b||t[15]!==v.info||t[16]!==v.phase||t[17]!==n?(He=()=>{if(!b||v.phase!==`ready`||Pe.current||!ye(v.info))return;Pe.current=!0,y(be);let e=b;n.project.fetchTargetStatus({projectPath:b.projectPath,branch:b.share.branch,kind:b.share.target.kind,path:u(b.share.target)}).then(t=>{Fe.current===e&&y(e=>xe(e,t))}).catch(t=>{Fe.current===e&&(console.warn(`[receive] target-status-fetch-failed`,t instanceof Error?t.message:t),y(ke))})},t[14]=b,t[15]=v.info,t[16]=v.phase,t[17]=n,t[18]=He):He=t[18];let Ue;t[19]!==b||t[20]!==v.phase?(Ue=[v.phase,b],t[19]=b,t[20]=v.phase,t[21]=Ue):Ue=t[21],(0,p.useEffect)(He,Ue);let We;t[22]!==b||t[23]!==v.phase||t[24]!==v.resolution||t[25]!==m?(We=()=>{if(v.phase!==`verdict`)return;let{kind:e}=v.resolution;e!==`deleted`&&e!==`never-on-branch`||b&&(le.arm({kind:b.share.target.kind,path:u(b.share.target),branch:b.share.branch}),m.dismiss())},t[22]=b,t[23]=v.phase,t[24]=v.resolution,t[25]=m,t[26]=We):We=t[26];let Ge;t[27]!==b||t[28]!==v||t[29]!==m?(Ge=[v,b,m],t[27]=b,t[28]=v,t[29]=m,t[30]=Ge):Ge=t[30],(0,p.useEffect)(We,Ge);let Ke;t[31]!==v.phase||t[32]!==v.resolution?(Ke=()=>{v.phase===`verdict`&&console.log(f({verdict_cell:v.resolution.kind}))},t[31]=v.phase,t[32]=v.resolution,t[33]=Ke):Ke=t[33];let qe;t[34]===v?qe=t[35]:(qe=[v],t[34]=v,t[35]=qe),(0,p.useEffect)(Ke,qe);let Je;t[36]!==g||t[37]!==b||t[38]!==v.pendingDoc||t[39]!==v.phase||t[40]!==n||t[41]!==m||t[42]!==x?(Je=()=>{if(v.phase!==`awaiting-cc1-recycle`||!b)return;let e=b.share.branch,t=v.pendingDoc;if(!e){m.dismiss();return}if(Ne.current)return;Ne.current=!0;let r=!1;return n.project.awaitBranchSwitched({projectPath:b.projectPath,branch:e,timeoutMs:3e4}).then(i=>{if(!r){if(i.ok){console.log(f({branch_dialog_action:`branch-switch-complete`,branch:e})),n.project.open({path:b.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:b.share.target.kind,path:t},pendingBranch:e}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=switch`,e instanceof Error?e.message:e),l.error(g({id:`gQV-9w`,values:{targetNoun:x}}))}),m.dismiss();return}console.log(f({branch_dialog_action:`branch-switch-timeout`,branch:e})),l.error(g({id:`LBwUR6`,values:{targetNoun:x}})),m.dismiss()}}).catch(e=>{r||(console.warn(`[receive] awaitBranchSwitched rejected`,e instanceof Error?e.message:e),l.error(g({id:`Jw6EC4`,values:{targetNoun:x}})),m.dismiss())}),()=>{r=!0}},t[36]=g,t[37]=b,t[38]=v.pendingDoc,t[39]=v.phase,t[40]=n,t[41]=m,t[42]=x,t[43]=Je):Je=t[43];let Ye;if(t[44]!==b||t[45]!==v.phase?(Ye=[v.phase,b],t[44]=b,t[45]=v.phase,t[46]=Ye):Ye=t[46],(0,p.useEffect)(Je,Ye),!b)return null;let{share:S,projectPath:C,currentBranch:w}=b,T=S.branch,Xe;t[47]!==g||t[48]!==n.project||t[49]!==C||t[50]!==T||t[51]!==m?(Xe=function(e,t,r){console.log(f({branch_dialog_action:`switch`,branch_action:`switch`,branch:T,verdict_cell:r})),y(t=>_e(t,e)),n.project.runCheckout(t?{projectPath:C,branch:T,fastForward:!0}:{projectPath:C,branch:T}).then(e=>{let t=null,n=!1;y(r=>{let{state:i,sideEffect:a}=Se(r,e);return a&&(t=a.reason,n=i.phase===`dismissed`),i}),t===`branch-not-found`?l.error(g({id:`NJyQi_`,values:{shareBranch:T}})):t===`fetch-failed`?l.error(g({id:`bWLmRK`})):(t===`checkout-failed`||t===`proxy-null`)&&l.error(g({id:`c863eW`,values:{shareBranch:T}})),n&&m.dismiss()}).catch(e=>{console.warn(`[receive] runCheckout rejected branch_action=switch`,e instanceof Error?e.message:e),y(Oe),l.error(g({id:`c863eW`,values:{shareBranch:T}}))})},t[47]=g,t[48]=n.project,t[49]=C,t[50]=T,t[51]=m,t[52]=Xe):Xe=t[52];let E=Xe,Ze;t[53]!==v.info||t[54]!==v.phase||t[55]!==E||t[56]!==S.target?(Ze=function(){v.phase===`ready`&&pe(v.info).switchEnabled&&E(u(S.target),!1)},t[53]=v.info,t[54]=v.phase,t[55]=E,t[56]=S.target,t[57]=Ze):Ze=t[57];let Qe=Ze,$e;t[58]!==v.phase||t[59]!==v.resolution||t[60]!==E||t[61]!==S.target?($e=function(){v.phase===`verdict`&&E(u(S.target),!0,v.resolution.kind)},t[58]=v.phase,t[59]=v.resolution,t[60]=E,t[61]=S.target,t[62]=$e):$e=t[62];let et=$e,tt;t[63]!==v.phase||t[64]!==v.resolution||t[65]!==E?(tt=function(){v.phase===`verdict`&&v.resolution.kind===`renamed`&&E(v.resolution.renamedTo,!0,v.resolution.kind)},t[63]=v.phase,t[64]=v.resolution,t[65]=E,t[66]=tt):tt=t[66];let nt=tt,rt;t[67]!==v.phase||t[68]!==v.resolution||t[69]!==E||t[70]!==S.target?(rt=function(){v.phase===`verdict`&&E(u(S.target),!1,v.resolution.kind)},t[67]=v.phase,t[68]=v.resolution,t[69]=E,t[70]=S.target,t[71]=rt):rt=t[71];let it=rt,at;t[72]!==g||t[73]!==n.project||t[74]!==C||t[75]!==S.target||t[76]!==T||t[77]!==m||t[78]!==x?(at=function(){console.log(f({branch_dialog_action:`open-current`,branch:T})),n.project.open({path:C,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:S.target.kind,path:u(S.target)}}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=open-current`,e instanceof Error?e.message:e),l.error(g({id:`b5aNbi`,values:{targetNoun:x}}))}),m.dismiss()},t[72]=g,t[73]=n.project,t[74]=C,t[75]=S.target,t[76]=T,t[77]=m,t[78]=x,t[79]=at):at=t[79];let ot=at,st;t[80]!==g||t[81]!==T?(st=function(e,t){switch(e){case`helper-not-found`:{let e=t??g({id:`cHhH3i`});l.error(g({id:`Z7x_Zh`,values:{tool:e}}));return}case`branch-not-found`:l.error(g({id:`NJyQi_`,values:{shareBranch:T}}));return;case`fetch-failed`:l.error(g({id:`bWLmRK`}));return;case`already-checked-out`:l.error(g({id:`ljHjfg`}));return;case`branch-exists`:l.error(g({id:`h3QZcB`,values:{shareBranch:T}}));return;case`path-exists`:l.error(g({id:`cN1Gcp`,values:{shareBranch:T}}));return;case`no-git`:l.error(g({id:`CFnavk`}));return;case`invalid-branch`:l.error(g({id:`JfPuv7`,values:{shareBranch:T}}));return;case`proxy-null`:case`error`:l.error(g({id:`e8zYa8`,values:{shareBranch:T}}));return;default:throw Error(`Unhandled worktree failure reason: ${String(e)}`)}},t[80]=g,t[81]=T,t[82]=st):st=t[82];let ct=st,lt;t[83]!==g||t[84]!==n.project||t[85]!==S.target||t[86]!==T||t[87]!==ct||t[88]!==m?(lt=function(e){let t=null,r,i=!1,a=null;if(y(n=>{let{state:o,sideEffect:ee}=Ce(n,e);return ee&&(t=ee.reason,r=ee.helper,i=o.phase===`dismissed`),o.phase===`opening-worktree`&&(a=o.path),o}),t!==null&&(console.log(f({branch_dialog_action:`open-worktree-failed:${t}`,branch:T})),ct(t,r)),a!==null){d();let e=a;n.project.open({path:e,target:`new-window`,entryPoint:`worktree`,pendingDeepLinkTarget:{kind:S.target.kind,path:u(S.target)},pendingBranch:T}).catch(t=>{console.warn(`[receive] worktree-open-failed branch_dialog_action=open-worktree`,t instanceof Error?t.message:t),l.error(g({id:`LdABLa`,values:{target:e}}))}),m.dismiss()}i&&m.dismiss()},t[83]=g,t[84]=n.project,t[85]=S.target,t[86]=T,t[87]=ct,t[88]=m,t[89]=lt):lt=t[89];let ut=lt,dt;t[90]!==ut||t[91]!==v.phase||t[92]!==n.worktree||t[93]!==T?(dt=function(){v.phase===`ready`&&(console.log(f({branch_dialog_action:`open-worktree`,branch:T})),y(ve),n.worktree.checkout({branch:T}).then(e=>{ut(e)}).catch(e=>{console.warn(`[receive] worktree-checkout rejected branch_dialog_action=open-worktree`,e instanceof Error?e.message:e),ut(null)}))},t[90]=ut,t[91]=v.phase,t[92]=n.worktree,t[93]=T,t[94]=dt):dt=t[94];let ft=dt,pt;t[95]!==g||t[96]!==v.otherWorktreePath||t[97]!==v.phase||t[98]!==n.project||t[99]!==S.target||t[100]!==T||t[101]!==m?(pt=function(){if(v.phase!==`branch-in-other-worktree`)return;let e=v.otherWorktreePath;console.log(f({branch_dialog_action:`pivot-to-other-worktree`,branch:T})),n.project.open({path:e,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:S.target.kind,path:u(S.target)},pendingBranch:T}).catch(t=>{console.warn(`[receive] pivot-open-failed branch_action=pivot-to-other-worktree`,t instanceof Error?t.message:t),l.error(g({id:`LdABLa`,values:{target:e}}))}),m.dismiss()},t[95]=g,t[96]=v.otherWorktreePath,t[97]=v.phase,t[98]=n.project,t[99]=S.target,t[100]=T,t[101]=m,t[102]=pt):pt=t[102];let mt=pt,ht;t[103]!==v.phase||t[104]!==v.resolution||t[105]!==m?(ht=function(){console.log(f({branch_dialog_action:`cancel`,verdict_cell:v.phase===`verdict`?v.resolution.kind:void 0})),m.dismiss()},t[103]=v.phase,t[104]=v.resolution,t[105]=m,t[106]=ht):ht=t[106];let D=ht,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]!==v.info||t[109]!==v.otherWorktreePath||t[110]!==v.phase||t[111]!==v.resolution||t[112]!==D||t[113]!==w||t[114]!==S.branch||t[115]!==S.owner||t[116]!==S.repo||t[117]!==S.target||t[118]!==T||t[119]!==x){G=v.phase===`ready`||v.phase===`switching`||v.phase===`creating-worktree`?pe(v.info):null;let e;t[139]!==v.info||t[140]!==v.phase||t[141]!==w?(e=v.phase===`ready`||v.phase===`switching`||v.phase===`creating-worktree`?me(v.info):w??`HEAD`,t[139]=v.info,t[140]=v.phase,t[141]=w,t[142]=e):e=t[142];let n=e;P=v.phase===`switching`||v.phase===`awaiting-cc1-recycle`,j=v.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 ie=v.phase===`loading`,se=v.phase===`error`;A=oe,U=!0,t[149]===D?W=t[150]:(W=e=>{e||D()},t[149]=D,t[150]=W),k=ne,R=`sm:max-w-xl`,z=`share-branch-switch-dialog`,B=De,V=Ee;let s;t[151]===x?s=t[152]:(s=(0,h.jsx)(te,{children:(0,h.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:x}})}),t[151]=x,t[152]=s);let ce=S.owner,le=S.repo,l;t[153]===S.target?l=t[154]:(l=u(S.target),t[153]=S.target,t[154]=l);let d;t[155]!==S.owner||t[156]!==S.repo||t[157]!==l?(d=(0,h.jsx)(ee,{className:`sr-only`,children:(0,h.jsx)(r,{id:`f8jU-L`,values:{0:ce,1:le,2:l}})}),t[155]=S.owner,t[156]=S.repo,t[157]=l,t[158]=d):d=t[158],t[159]!==s||t[160]!==d?(H=(0,h.jsxs)(ae,{children:[s,d]}),t[159]=s,t[160]=d,t[161]=H):H=t[161],O=re;let f=S.owner,ue=S.repo,p;t[162]===S.target?p=t[163]:(p=u(S.target),t[162]=S.target,t[163]=p),t[164]!==S.branch||t[165]!==S.owner||t[166]!==S.repo||t[167]!==S.target.kind||t[168]!==p?(F=(0,h.jsx)(`div`,{className:`mb-4`,children:(0,h.jsx)(de,{owner:f,repo:ue,path:p,kind:S.target.kind,branch:S.branch,testId:`share-branch-switch-metadata`,branchTestId:`share-branch-switch-metadata-branch`})}),t[164]=S.branch,t[165]=S.owner,t[166]=S.repo,t[167]=S.target.kind,t[168]=p,t[169]=F):F=t[169],I=v.phase===`branch-in-other-worktree`?(0,h.jsxs)(`div`,{className:`text-sm text-muted-foreground`,"data-testid":`share-branch-switch-in-other-worktree`,children:[(0,h.jsx)(`p`,{className:`leading-6`,children:(0,h.jsx)(r,{id:`yjExfe`,values:{shareBranch:T},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),(0,h.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:v.otherWorktreePath})]}):v.phase===`verdict-pending`?(0,h.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,h.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,h.jsx)(r,{id:`c8jBgX`})]}):v.phase===`verdict`?v.resolution.kind===`on-origin`?(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-on-origin`,children:(0,h.jsx)(r,{id:`Uay5NL`,values:{targetNoun:x,shareBranch:T},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):v.resolution.kind===`renamed`?(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-renamed`,children:(0,h.jsx)(r,{id:`P0HC30`,values:{0:v.resolution.renamedTo,targetNoun:x},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):v.resolution.kind===`diverged`?(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-diverged`,children:(0,h.jsx)(r,{id:`kLv8d3`,values:{shareBranch:T,targetNoun:x},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,h.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,h.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,h.jsx)(r,{id:`c8jBgX`})]}):ie?(0,h.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,h.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,h.jsx)(r,{id:`jerqF0`})]}):se?(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,h.jsx)(r,{id:`w4hMYl`})}):G?.kind===`D`?(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,h.jsx)(r,{id:`DTI-fp`,values:{targetNoun:x,shareBranch:T},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):G?.kind===`B`?(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,h.jsx)(r,{id:`sZ2IOu`,values:{targetNoun:x,shareBranch:T,currentLabel:n},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,h.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,h.jsx)(r,{id:`_902BE`,values:{targetNoun:x,shareBranch:T,currentLabel:n},components:{0:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,h.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),L=G&&!G.switchEnabled&&G.conflictingFiles.length>0?(0,h.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,h.jsx)(`p`,{className:`font-medium text-foreground/90`,children:(0,h.jsx)(r,{id:`n2lRue`})}),(0,h.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(Te)})]}):null,t[107]=g,t[108]=v.info,t[109]=v.otherWorktreePath,t[110]=v.phase,t[111]=v.resolution,t[112]=D,t[113]=w,t[114]=S.branch,t[115]=S.owner,t[116]=S.repo,t[117]=S.target,t[118]=T,t[119]=x,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,h.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,h.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,h.jsx)(r,{id:`CU3AiE`})]}):null,t[170]=P,t[171]=q);let J;t[172]===j?J=t[173]:(J=j?(0,h.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,h.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,h.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,h.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 gt;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(gt=(0,h.jsx)(r,{id:`dEgA5A`}),t[181]=gt):gt=t[181];let X;t[182]===D?X=t[183]:(X=(0,h.jsx)(o,{variant:`ghost`,className:`font-mono uppercase`,onClick:D,"data-testid":`share-branch-switch-cancel`,children:gt}),t[182]=D,t[183]=X);let Z;t[184]!==v.phase||t[185]!==v.resolution||t[186]!==j||t[187]!==ot||t[188]!==nt||t[189]!==ft||t[190]!==mt||t[191]!==it||t[192]!==Qe||t[193]!==et||t[194]!==M||t[195]!==N||t[196]!==P||t[197]!==G||t[198]!==K?(Z=v.phase===`branch-in-other-worktree`?(0,h.jsx)(o,{onClick:mt,"data-testid":`share-branch-switch-in-other-worktree-pivot`,children:(0,h.jsx)(r,{id:`hyCxJY`})}):v.phase===`verdict`?v.resolution.kind===`on-origin`?(0,h.jsxs)(o,{onClick:et,"data-testid":`share-branch-switch-verdict-switch-update`,children:[(0,h.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),(0,h.jsx)(r,{id:`uA_jXp`})]}):v.resolution.kind===`renamed`?(0,h.jsxs)(o,{onClick:nt,"data-testid":`share-branch-switch-verdict-open-renamed`,children:[(0,h.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),(0,h.jsx)(r,{id:`AItsE5`})]}):v.resolution.kind===`diverged`?(0,h.jsxs)(o,{onClick:it,"data-testid":`share-branch-switch-verdict-plain-switch`,children:[(0,h.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),N]}):null:(0,h.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,h.jsxs)(o,{variant:`outline`,className:`font-mono uppercase`,onClick:ot,disabled:P||j,"data-testid":`share-branch-switch-open-current`,children:[(0,h.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),M]}):null,(0,h.jsx)(o,{variant:`outline`,onClick:Qe,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,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(c,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}),N]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),N]})}),(0,h.jsx)(o,{onClick:ft,disabled:!G||P||j,"data-testid":`share-branch-switch-worktree`,children:j?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(c,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}),K]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(se,{className:`size-3.5`,"aria-hidden":!0}),K]})})]}),t[184]=v.phase,t[185]=v.resolution,t[186]=j,t[187]=ot,t[188]=nt,t[189]=ft,t[190]=mt,t[191]=it,t[192]=Qe,t[193]=et,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,h.jsxs)(ie,{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,h.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 _t;return t[212]!==A||t[213]!==U||t[214]!==W||t[215]!==$?(_t=(0,h.jsx)(A,{open:U,onOpenChange:W,children:$}),t[212]=A,t[213]=U,t[214]=W,t[215]=$,t[216]=_t):_t=t[216],_t}function Te(e){return(0,h.jsx)(`li`,{children:(0,h.jsx)(`code`,{className:`text-foreground/80`,children:e})},e)}function Ee(e){e.preventDefault()}function De(e){e.preventDefault()}function Oe(e){return Se(e,null).state}function ke(e){return xe(e,null)}function Ae(e){return ge(e,null)}function je(){return null}export{g as ShareBranchSwitchDialog};
|
package/dist/public/assets/{ShareReceiveDialog-BAEP9cfe.js → ShareReceiveDialog-DLEkjmkI.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-Gol9BgNB.js";import{a as ee,c as te,i as ne,n as re,o as s,s as c,t as l}from"./dialog-TkFkuYVg.js";import{ln as u,sn as d}from"./dist-Dxs5l5f3.js";import{t as ie}from"./loader-circle-Cg5SU7AZ.js";import{n as f}from"./dist-BLAMau9Z.js";import{t as p}from"./desktop-bridge-types--ZPzhkC9.js";import{a as ae,i as m,n as h,o as g,r as oe,s as _}from"./receive-store-iF35zQOA.js";import{t as se}from"./share-metadata-rows-BlaR96La.js";var v=e(n(),1),y=a(),b=e=>({phase:`ready`,seed:e});function x(e){return e.phase===`ready`?{phase:`initializing`,seed:e.seed}:e}function S(e,t){return e.phase===`initializing`?t.ok?{phase:`opening`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:t.reason,message:t.message}:e}function C(e,t){return e.phase===`opening`?t.ok?{phase:`done`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:`network-error`,message:t.message}:e}function w(e){return e.phase===`done`||e.phase===`cancelled`||e.phase===`error`?e:{phase:`cancelled`,seed:e.seed}}var T=t();function E(e){return e!==null&&e.kind===`launcher-consent`}function D(e){return e!==null&&e.kind===`launcher-miss`}function O(e){let t=(0,y.c)(14),{bridge:n,cloneController:r,store:i}=e,a=i===void 0?h:i,o=(0,v.useSyncExternalStore)(a.subscribe,a.getSnapshot,A),[ee,te]=(0,v.useState)(0),[ne,re]=(0,v.useState)(o);o!==ne&&(re(o),te(k));let s,c;t[0]!==o||t[1]!==a?(s=()=>{if(!o)return;let e=_(o);e&&(f.error(e.message),a.dismiss())},c=[o,a],t[0]=o,t[1]=a,t[2]=s,t[3]=c):(s=t[2],c=t[3]),(0,v.useEffect)(s,c);let l;t[4]===o?l=t[5]:(l=D(o)?o:null,t[4]=o,t[5]=l);let u=l,d;t[6]===o?d=t[7]:(d=E(o)?o:null,t[6]=o,t[7]=d);let ie=d??u;if(!ie)return null;let p;return t[8]!==ie||t[9]!==n||t[10]!==r||t[11]!==ee||t[12]!==a?(p=(0,T.jsx)(j,{payload:ie,bridge:n,cloneController:r,store:a},ee),t[8]=ie,t[9]=n,t[10]=r,t[11]=ee,t[12]=a,t[13]=p):p=t[13],p}function k(e){return e+1}function A(){return null}function j(e){let t=(0,y.c)(165),{payload:n,bridge:a,cloneController:h,store:_}=e,{_:x}=i(),[w,O]=(0,v.useState)(!1),[k,A]=(0,v.useState)(null),[j,fe]=(0,v.useState)(!1),[N,pe]=(0,v.useState)(!1),[P,me]=(0,v.useState)(null),[F,I]=(0,v.useState)(null),he=(0,v.useRef)(!1),ge=(0,v.useRef)(null),_e,ve;t[0]===P?(_e=t[1],ve=t[2]):(_e=()=>{P&&ge.current?.focus()},ve=[P],t[0]=P,t[1]=_e,t[2]=ve),(0,v.useEffect)(_e,ve);let ye;t[3]!==F||t[4]!==n?(ye=()=>{E(n)&&F===null&&(console.warn(`[receive] q1_hit=true selection=branch_match_non_ok candidate=${n.candidatePath}`),I(b({candidatePath:n.candidatePath,branch:n.share.branch,targetPath:p(n.share.target),targetKind:n.share.target.kind,parentProjectName:n.parentProjectName})))},t[3]=F,t[4]=n,t[5]=ye):ye=t[5];let be;t[6]===n?be=t[7]:(be=[n],t[6]=n,t[7]=be),(0,v.useEffect)(ye,be);let xe;t[8]!==k||t[9]!==h||t[10]!==n?(xe=()=>{if(!h||!D(n)||k!==null||he.current)return;he.current=!0,fe(!0);let e=n.share.host;h.getAuthStatus(e).then(e=>{A(e)}).catch(t=>{console.warn(`[receive] auth pre-flight probe failed`,t instanceof Error?t.message:t),A({authenticated:!1,host:e})}).finally(()=>{fe(!1)})},t[8]=k,t[9]=h,t[10]=n,t[11]=xe):xe=t[11];let Se;t[12]!==k||t[13]!==n?(Se=[n,k],t[12]=k,t[13]=n,t[14]=Se):Se=t[14],(0,v.useEffect)(xe,Se);let L=D(n)?n:null,Ce=E(n)?n:null,R=L?.share??Ce?.share??null,z,B,V,H,U,we,W,G;if(t[15]!==x||t[16]!==j||t[17]!==a||t[18]!==h||t[19]!==N||t[20]!==F||t[21]!==L||t[22]!==w||t[23]!==R||t[24]!==_){W=Symbol.for(`react.early_return_sentinel`);bb0:{let e=R?{host:R.host,owner:R.owner,repo:R.repo}:null,n;t[33]!==x||t[34]!==R?.target.kind?(n=R?.target.kind===`folder`?x({id:`ugoTXs`}):x({id:`XH30C4`}),t[33]=x,t[34]=R?.target.kind,t[35]=n):n=t[35],G=n,V=async function(){if(!L||!e)return;if(console.log(ae({q2_path:`clone`})),!h){f.info(x({id:`27XW26`}),{action:{label:x({id:`B3NAZC`}),onClick:()=>{a.navigator.open()}},duration:8e3});return}if(N)return;me(null),pe(!0);let t=oe(e),n;try{n=await h.runClone({url:t,branch:L.share.branch})}catch(e){let t=e;console.warn(`[receive] runClone threw unexpectedly`,t),pe(!1),me({detail:t instanceof Error?t.message:String(t)});return}if(pe(!1),n.kind===`error`){me({detail:n.detail??null});return}if(n.kind===`ok`){try{await a.project.open({path:n.dir,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:L.share.target.kind,path:p(L.share.target)}}),_.dismiss()}catch(e){let t=e;console.warn(`[receive] project open after clone failed`,t instanceof Error?t.message:t),f.error(x({id:`438Fca`}))}return}};let i;t[36]!==x||t[37]!==j||t[38]!==h?(i=async function(){if(!(!h||j)){fe(!0);try{let e=await h.startSignIn();fe(!1),e!==null&&A(e)}catch(e){let t=e;fe(!1),console.warn(`[receive] startSignIn failed`,t instanceof Error?t.message:t),f.error(x({id:`lzwo7p`}))}}},t[36]=x,t[37]=j,t[38]=h,t[39]=i):i=t[39],U=i,H=async function(){if(!(!L||!e||w)){me(null),O(!0),console.log(ae({q2_path:`local`}));try{for(;;){let t=await a.dialog.openFolder();if(!t)break;let n=await a.share.validateLocalFolder({folderPath:t,host:e.host,owner:e.owner,repo:e.repo});if(console.log(ae({folder_validate:n.kind})),n.kind===`ok`){let e=L.share.branch,n={currentBranch:null,headSha:null,detached:!1};try{n=await a.project.readHeadBranch(t)}catch(e){let t=e;console.warn(`[receive] local-folder readHeadBranch failed`,t instanceof Error?t.message:t)}let r=u(e,n)!==`true`;try{await a.project.open({path:t,target:`new-window`,entryPoint:`share-receive`,...r?{pendingShareBranchSwitch:{share:L.share,projectPath:t,currentBranch:n.currentBranch}}:{pendingDeepLinkTarget:{kind:L.share.target.kind,path:p(L.share.target)}}}),_.dismiss()}catch(e){let t=e;console.warn(`[receive] local-folder-open failed`,t instanceof Error?t.message:t),f.error(x({id:`phM8Kh`}))}break}let r=g(n,e);r&&f.error(r)}}catch(e){let t=e;console.warn(`[receive] local-folder-validate failed`,t instanceof Error?t.message:t),f.error(x({id:`rlUzXK`}))}O(!1)}};let m;t[40]!==x||t[41]!==a||t[42]!==F||t[43]!==_?(m=function(){if(F===null||F.phase!==`ready`)return;let e=F.seed;console.warn(`[receive] consent_dialog action=initialize worktree=${e.candidatePath}`),I(de),a.project.okInit({projectPath:e.candidatePath}).then(async t=>{if(t.ok===!0){I(e=>e===null?e:S(e,{ok:!0,projectPath:t.projectPath}));try{await a.project.open({path:t.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:e.targetKind,path:e.targetPath},pendingBranch:e.branch}),I(ue),_.dismiss()}catch(t){let n=t,r=n instanceof Error?n.message:String(n);I(e=>e===null?e:C(e,{ok:!1,message:r})),f.error(x({id:`nDT8qt`,values:{0:e.candidatePath}}))}return}let n=t.reason,r=t.message||`Initialization failed.`;I(e=>e===null?e:S(e,{ok:!1,reason:n,message:r})),f.error(r)}).catch(t=>{let n=t instanceof Error?t.message:String(t);I(e=>e===null?e:S(e,{ok:!1,reason:`network-error`,message:n})),f.error(x({id:`3Mwaly`,values:{0:e.candidatePath}}))})},t[40]=x,t[41]=a,t[42]=F,t[43]=_,t[44]=m):m=t[44];let v=m,y;t[45]!==F||t[46]!==_?(y=function(){F!==null&&console.warn(`[receive] consent_dialog action=cancel worktree=${F.seed.candidatePath}`),I(M),_.dismiss()},t[45]=F,t[46]=_,t[47]=y):y=t[47];let b=y;if(F!==null&&F.phase!==`cancelled`&&F.phase!==`done`&&R!==null){let e=F.seed,n=F.phase===`initializing`||F.phase===`opening`,i;t[48]===b?i=t[49]:(i=e=>{e||b()},t[48]=b,t[49]=i);let a;t[50]===G?a=t[51]:(a=(0,T.jsx)(te,{children:(0,T.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:G}})}),t[50]=G,t[51]=a);let u;t[52]===R.target?u=t[53]:(u=p(R.target)?`— ${p(R.target)}`:``,t[52]=R.target,t[53]=u);let d;t[54]!==R.owner||t[55]!==R.repo||t[56]!==u?(d=(0,T.jsx)(ee,{className:`sr-only`,children:(0,T.jsx)(r,{id:`pgq_xf`,values:{0:R.owner,1:R.repo,2:u}})}),t[54]=R.owner,t[55]=R.repo,t[56]=u,t[57]=d):d=t[57];let f=R.owner,ae=R.repo,m;t[58]===R.target?m=t[59]:(m=p(R.target),t[58]=R.target,t[59]=m);let h;t[60]!==R.branch||t[61]!==R.owner||t[62]!==R.repo||t[63]!==R.target.kind||t[64]!==m?(h=(0,T.jsx)(se,{owner:f,repo:ae,path:m,kind:R.target.kind,branch:R.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[60]=R.branch,t[61]=R.owner,t[62]=R.repo,t[63]=R.target.kind,t[64]=m,t[65]=h):h=t[65];let g;t[66]!==a||t[67]!==d||t[68]!==h?(g=(0,T.jsxs)(c,{children:[a,d,h]}),t[66]=a,t[67]=d,t[68]=h,t[69]=g):g=t[69];let oe;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`KsAPaB`})}),t[70]=oe):oe=t[70];let _;t[71]===e.candidatePath?_=t[72]:(_=(0,T.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-receive-consent-path`,children:e.candidatePath}),t[71]=e.candidatePath,t[72]=_);let y;t[73]===e.parentProjectName?y=t[74]:(y=e.parentProjectName===null?null:(0,T.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,"data-testid":`share-receive-consent-parent`,children:(0,T.jsx)(r,{id:`JmfgFc`,values:{0:e.parentProjectName}})}),t[73]=e.parentProjectName,t[74]=y);let x;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,T.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`w7SsvI`})}),t[75]=x):x=t[75];let S;t[76]!==F.message||t[77]!==F.phase?(S=F.phase===`error`?(0,T.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,"data-testid":`share-receive-consent-error`,role:`alert`,children:F.message}):null,t[76]=F.message,t[77]=F.phase,t[78]=S):S=t[78];let C;t[79]!==_||t[80]!==y||t[81]!==S?(C=(0,T.jsxs)(re,{children:[oe,_,y,x,S]}),t[79]=_,t[80]=y,t[81]=S,t[82]=C):C=t[82];let w;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,T.jsx)(r,{id:`dEgA5A`}),t[83]=w):w=t[83];let E;t[84]===b?E=t[85]:(E=(0,T.jsx)(o,{variant:`ghost`,onClick:b,"data-testid":`share-receive-consent-cancel`,children:w}),t[84]=b,t[85]=E);let D=n||F.phase===`error`,O=n||F.phase===`error`,k;t[86]===n?k=t[87]:(k=n?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(ie,{className:`mr-2 h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,T.jsx)(r,{id:`NKkZXl`})]}):(0,T.jsx)(r,{id:`NKkZXl`}),t[86]=n,t[87]=k);let A;t[88]!==v||t[89]!==D||t[90]!==O||t[91]!==k?(A=(0,T.jsx)(o,{onClick:v,disabled:D,"aria-disabled":O,"data-testid":`share-receive-consent-initialize`,children:k}),t[88]=v,t[89]=D,t[90]=O,t[91]=k,t[92]=A):A=t[92];let j;t[93]!==E||t[94]!==A?(j=(0,T.jsxs)(s,{children:[E,A]}),t[93]=E,t[94]=A,t[95]=j):j=t[95];let M;t[96]!==g||t[97]!==C||t[98]!==j?(M=(0,T.jsxs)(ne,{className:`sm:max-w-xl`,"data-testid":`share-receive-consent-dialog`,onInteractOutside:le,onPointerDownOutside:ce,children:[g,C,j]}),t[96]=g,t[97]=C,t[98]=j,t[99]=M):M=t[99];let ue;t[100]!==i||t[101]!==M?(ue=(0,T.jsx)(l,{open:!0,onOpenChange:i,children:M}),t[100]=i,t[101]=M,t[102]=ue):ue=t[102],W=ue;break bb0}if(!L||!R||!e){W=null;break bb0}z=h!==void 0&&!N;let E;t[103]!==x||t[104]!==N?(E=x(N?{id:`YjhKI5`}:{id:`LE7t79`}),t[103]=x,t[104]=N,t[105]=E):E=t[105],B=E,we=d(e)}t[15]=x,t[16]=j,t[17]=a,t[18]=h,t[19]=N,t[20]=F,t[21]=L,t[22]=w,t[23]=R,t[24]=_,t[25]=z,t[26]=B,t[27]=V,t[28]=H,t[29]=U,t[30]=we,t[31]=W,t[32]=G}else z=t[25],B=t[26],V=t[27],H=t[28],U=t[29],we=t[30],W=t[31],G=t[32];if(W!==Symbol.for(`react.early_return_sentinel`))return W;let Te=we,Ee=k?.authenticated?k.login:void 0,De;t[106]===P?De=t[107]:(De=P?.detail?m(P.detail):``,t[106]=P,t[107]=De);let Oe=De,K;t[108]===_?K=t[109]:(K=e=>{e||_.dismiss()},t[108]=_,t[109]=K);let q;t[110]===G?q=t[111]:(q=(0,T.jsx)(te,{children:(0,T.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:G}})}),t[110]=G,t[111]=q);let J;t[112]===R.target?J=t[113]:(J=p(R.target)?` — ${p(R.target)}`:null,t[112]=R.target,t[113]=J);let Y;t[114]!==R.owner||t[115]!==R.repo||t[116]!==J?(Y=(0,T.jsxs)(ee,{className:`sr-only`,children:[R.owner,`/`,R.repo,J]}),t[114]=R.owner,t[115]=R.repo,t[116]=J,t[117]=Y):Y=t[117];let ke=R.owner,Ae=R.repo,X;t[118]===R.target?X=t[119]:(X=p(R.target),t[118]=R.target,t[119]=X);let Z;t[120]!==R.branch||t[121]!==R.owner||t[122]!==R.repo||t[123]!==R.target.kind||t[124]!==X?(Z=(0,T.jsx)(se,{owner:ke,repo:Ae,path:X,kind:R.target.kind,branch:R.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[120]=R.branch,t[121]=R.owner,t[122]=R.repo,t[123]=R.target.kind,t[124]=X,t[125]=Z):Z=t[125];let Q;t[126]!==q||t[127]!==Y||t[128]!==Z?(Q=(0,T.jsxs)(c,{children:[q,Y,Z]}),t[126]=q,t[127]=Y,t[128]=Z,t[129]=Q):Q=t[129];let $;t[130]!==h||t[131]!==z||t[132]!==P||t[133]!==Oe||t[134]!==B||t[135]!==N||t[136]!==V||t[137]!==H||t[138]!==w?($=P?(0,T.jsxs)(`div`,{ref:ge,tabIndex:-1,className:`rounded-lg border border-destructive/40 bg-destructive/5 p-4 outline-none`,"data-testid":`share-receive-clone-error`,children:[(0,T.jsx)(`p`,{className:`text-sm font-semibold text-foreground`,role:`alert`,children:(0,T.jsx)(r,{id:`aiArms`})}),Oe?(0,T.jsxs)(`p`,{className:`mt-2 break-words text-xs text-destructive`,"data-testid":`share-receive-clone-error-message`,children:[(0,T.jsx)(r,{id:`4BITzH`}),` `,(0,T.jsxs)(`span`,{className:`font-mono text-foreground/80`,children:[`"`,Oe,`"`]})]}):null,(0,T.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`Llyqvo`})}),(0,T.jsxs)(`ul`,{className:`mt-1 list-disc space-y-1 pl-5 text-sm text-muted-foreground`,"data-testid":`share-receive-clone-error-reasons`,children:[(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`6LbUG7`})}),(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`_pY_Vq`})}),(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`J6mxC1`})})]}),(0,T.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,T.jsx)(o,{onClick:()=>{V()},"data-testid":`share-receive-clone-retry`,children:(0,T.jsx)(r,{id:`KDw4GX`})}),(0,T.jsx)(o,{variant:`outline`,onClick:()=>{H()},disabled:w||N,"data-testid":`share-receive-error-local`,children:(0,T.jsx)(r,{id:`xFQRu4`})})]})]}):(0,T.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,T.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-clone`,className:`flex flex-col items-start gap-2 rounded-lg border border-primary/50 bg-primary/5 p-4 text-left transition hover:border-primary hover:bg-primary/10 focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-primary/50 disabled:hover:bg-primary/5`,onClick:()=>{V()},disabled:h!==void 0&&!z,"aria-disabled":h!==void 0&&!z,children:[(0,T.jsx)(`span`,{className:`text-sm font-semibold`,children:B}),(0,T.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`fj5YiP`})})]}),(0,T.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-local`,className:`flex flex-col items-start gap-2 rounded-lg border border-border bg-card p-4 text-left transition hover:border-foreground/50 hover:bg-accent focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,onClick:()=>{H()},disabled:w||N,children:[(0,T.jsx)(`span`,{className:`text-sm font-semibold`,children:(0,T.jsx)(r,{id:`HfI1dR`})}),(0,T.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`_qD6mn`})})]})]}),t[130]=h,t[131]=z,t[132]=P,t[133]=Oe,t[134]=B,t[135]=N,t[136]=V,t[137]=H,t[138]=w,t[139]=$):$=t[139];let je;t[140]!==j||t[141]!==k||t[142]!==h||t[143]!==U||t[144]!==Ee?(je=h?(0,T.jsx)(`div`,{className:`mt-3 flex items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-xs`,"data-testid":`share-receive-auth-banner`,role:`status`,"aria-live":`polite`,children:k===null?(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`UDFrWm`})}):k.authenticated?(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`VAHWL_`,values:{signedInLogin:Ee},components:{0:(0,T.jsx)(`span`,{className:`font-medium text-foreground/90`})}})}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`SgKLfA`})}),(0,T.jsx)(`button`,{type:`button`,"data-testid":`share-receive-signin`,className:`font-medium text-primary underline-offset-2 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded`,onClick:()=>{U()},disabled:j,children:j?(0,T.jsx)(r,{id:`PKLY-1`}):(0,T.jsx)(r,{id:`3jod3l`})})]})}):null,t[140]=j,t[141]=k,t[142]=h,t[143]=U,t[144]=Ee,t[145]=je):je=t[145];let Me;t[146]!==P||t[147]!==Te?(Me=P?null:(0,T.jsx)(`p`,{className:`mt-3 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`RJ3a8Z`,values:{lookingForUrl:Te},components:{0:(0,T.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),t[146]=P,t[147]=Te,t[148]=Me):Me=t[148];let Ne;t[149]!==$||t[150]!==je||t[151]!==Me?(Ne=(0,T.jsxs)(re,{children:[$,je,Me]}),t[149]=$,t[150]=je,t[151]=Me,t[152]=Ne):Ne=t[152];let Pe;t[153]===_?Pe=t[154]:(Pe=()=>_.dismiss(),t[153]=_,t[154]=Pe);let Fe;t[155]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=(0,T.jsx)(r,{id:`dEgA5A`}),t[155]=Fe):Fe=t[155];let Ie;t[156]===Pe?Ie=t[157]:(Ie=(0,T.jsx)(s,{children:(0,T.jsx)(o,{variant:`outline`,className:`font-mono uppercase`,onClick:Pe,children:Fe})}),t[156]=Pe,t[157]=Ie);let Le;t[158]!==Q||t[159]!==Ne||t[160]!==Ie?(Le=(0,T.jsxs)(ne,{className:`sm:max-w-xl`,"data-testid":`share-receive-dialog`,children:[Q,Ne,Ie]}),t[158]=Q,t[159]=Ne,t[160]=Ie,t[161]=Le):Le=t[161];let Re;return t[162]!==K||t[163]!==Le?(Re=(0,T.jsx)(l,{open:!0,onOpenChange:K,children:Le}),t[162]=K,t[163]=Le,t[164]=Re):Re=t[164],Re}function ce(e){return e.preventDefault()}function le(e){return e.preventDefault()}function M(e){return e===null?e:w(e)}function ue(e){return e===null?e:C(e,{ok:!0})}function de(e){return e===null?e:x(e)}export{O as ShareReceiveDialog};
|
|
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-Gol9BgNB.js";import{a as ee,c as te,i as ne,n as re,o as s,s as c,t as l}from"./dialog-TkFkuYVg.js";import{ln as u,sn as d}from"./dist-Cal4LUep.js";import{t as ie}from"./loader-circle-Cg5SU7AZ.js";import{n as f}from"./dist-BLAMau9Z.js";import{t as p}from"./desktop-bridge-types--ZPzhkC9.js";import{a as ae,i as m,n as h,o as g,r as oe,s as _}from"./receive-store-CL0RH8Oa.js";import{t as se}from"./share-metadata-rows-BlaR96La.js";var v=e(n(),1),y=a(),b=e=>({phase:`ready`,seed:e});function x(e){return e.phase===`ready`?{phase:`initializing`,seed:e.seed}:e}function S(e,t){return e.phase===`initializing`?t.ok?{phase:`opening`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:t.reason,message:t.message}:e}function C(e,t){return e.phase===`opening`?t.ok?{phase:`done`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:`network-error`,message:t.message}:e}function w(e){return e.phase===`done`||e.phase===`cancelled`||e.phase===`error`?e:{phase:`cancelled`,seed:e.seed}}var T=t();function E(e){return e!==null&&e.kind===`launcher-consent`}function D(e){return e!==null&&e.kind===`launcher-miss`}function O(e){let t=(0,y.c)(14),{bridge:n,cloneController:r,store:i}=e,a=i===void 0?h:i,o=(0,v.useSyncExternalStore)(a.subscribe,a.getSnapshot,A),[ee,te]=(0,v.useState)(0),[ne,re]=(0,v.useState)(o);o!==ne&&(re(o),te(k));let s,c;t[0]!==o||t[1]!==a?(s=()=>{if(!o)return;let e=_(o);e&&(f.error(e.message),a.dismiss())},c=[o,a],t[0]=o,t[1]=a,t[2]=s,t[3]=c):(s=t[2],c=t[3]),(0,v.useEffect)(s,c);let l;t[4]===o?l=t[5]:(l=D(o)?o:null,t[4]=o,t[5]=l);let u=l,d;t[6]===o?d=t[7]:(d=E(o)?o:null,t[6]=o,t[7]=d);let ie=d??u;if(!ie)return null;let p;return t[8]!==ie||t[9]!==n||t[10]!==r||t[11]!==ee||t[12]!==a?(p=(0,T.jsx)(j,{payload:ie,bridge:n,cloneController:r,store:a},ee),t[8]=ie,t[9]=n,t[10]=r,t[11]=ee,t[12]=a,t[13]=p):p=t[13],p}function k(e){return e+1}function A(){return null}function j(e){let t=(0,y.c)(165),{payload:n,bridge:a,cloneController:h,store:_}=e,{_:x}=i(),[w,O]=(0,v.useState)(!1),[k,A]=(0,v.useState)(null),[j,fe]=(0,v.useState)(!1),[N,pe]=(0,v.useState)(!1),[P,me]=(0,v.useState)(null),[F,I]=(0,v.useState)(null),he=(0,v.useRef)(!1),ge=(0,v.useRef)(null),_e,ve;t[0]===P?(_e=t[1],ve=t[2]):(_e=()=>{P&&ge.current?.focus()},ve=[P],t[0]=P,t[1]=_e,t[2]=ve),(0,v.useEffect)(_e,ve);let ye;t[3]!==F||t[4]!==n?(ye=()=>{E(n)&&F===null&&(console.warn(`[receive] q1_hit=true selection=branch_match_non_ok candidate=${n.candidatePath}`),I(b({candidatePath:n.candidatePath,branch:n.share.branch,targetPath:p(n.share.target),targetKind:n.share.target.kind,parentProjectName:n.parentProjectName})))},t[3]=F,t[4]=n,t[5]=ye):ye=t[5];let be;t[6]===n?be=t[7]:(be=[n],t[6]=n,t[7]=be),(0,v.useEffect)(ye,be);let xe;t[8]!==k||t[9]!==h||t[10]!==n?(xe=()=>{if(!h||!D(n)||k!==null||he.current)return;he.current=!0,fe(!0);let e=n.share.host;h.getAuthStatus(e).then(e=>{A(e)}).catch(t=>{console.warn(`[receive] auth pre-flight probe failed`,t instanceof Error?t.message:t),A({authenticated:!1,host:e})}).finally(()=>{fe(!1)})},t[8]=k,t[9]=h,t[10]=n,t[11]=xe):xe=t[11];let Se;t[12]!==k||t[13]!==n?(Se=[n,k],t[12]=k,t[13]=n,t[14]=Se):Se=t[14],(0,v.useEffect)(xe,Se);let L=D(n)?n:null,Ce=E(n)?n:null,R=L?.share??Ce?.share??null,z,B,V,H,U,we,W,G;if(t[15]!==x||t[16]!==j||t[17]!==a||t[18]!==h||t[19]!==N||t[20]!==F||t[21]!==L||t[22]!==w||t[23]!==R||t[24]!==_){W=Symbol.for(`react.early_return_sentinel`);bb0:{let e=R?{host:R.host,owner:R.owner,repo:R.repo}:null,n;t[33]!==x||t[34]!==R?.target.kind?(n=R?.target.kind===`folder`?x({id:`ugoTXs`}):x({id:`XH30C4`}),t[33]=x,t[34]=R?.target.kind,t[35]=n):n=t[35],G=n,V=async function(){if(!L||!e)return;if(console.log(ae({q2_path:`clone`})),!h){f.info(x({id:`27XW26`}),{action:{label:x({id:`B3NAZC`}),onClick:()=>{a.navigator.open()}},duration:8e3});return}if(N)return;me(null),pe(!0);let t=oe(e),n;try{n=await h.runClone({url:t,branch:L.share.branch})}catch(e){let t=e;console.warn(`[receive] runClone threw unexpectedly`,t),pe(!1),me({detail:t instanceof Error?t.message:String(t)});return}if(pe(!1),n.kind===`error`){me({detail:n.detail??null});return}if(n.kind===`ok`){try{await a.project.open({path:n.dir,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:L.share.target.kind,path:p(L.share.target)}}),_.dismiss()}catch(e){let t=e;console.warn(`[receive] project open after clone failed`,t instanceof Error?t.message:t),f.error(x({id:`438Fca`}))}return}};let i;t[36]!==x||t[37]!==j||t[38]!==h?(i=async function(){if(!(!h||j)){fe(!0);try{let e=await h.startSignIn();fe(!1),e!==null&&A(e)}catch(e){let t=e;fe(!1),console.warn(`[receive] startSignIn failed`,t instanceof Error?t.message:t),f.error(x({id:`lzwo7p`}))}}},t[36]=x,t[37]=j,t[38]=h,t[39]=i):i=t[39],U=i,H=async function(){if(!(!L||!e||w)){me(null),O(!0),console.log(ae({q2_path:`local`}));try{for(;;){let t=await a.dialog.openFolder();if(!t)break;let n=await a.share.validateLocalFolder({folderPath:t,host:e.host,owner:e.owner,repo:e.repo});if(console.log(ae({folder_validate:n.kind})),n.kind===`ok`){let e=L.share.branch,n={currentBranch:null,headSha:null,detached:!1};try{n=await a.project.readHeadBranch(t)}catch(e){let t=e;console.warn(`[receive] local-folder readHeadBranch failed`,t instanceof Error?t.message:t)}let r=u(e,n)!==`true`;try{await a.project.open({path:t,target:`new-window`,entryPoint:`share-receive`,...r?{pendingShareBranchSwitch:{share:L.share,projectPath:t,currentBranch:n.currentBranch}}:{pendingDeepLinkTarget:{kind:L.share.target.kind,path:p(L.share.target)}}}),_.dismiss()}catch(e){let t=e;console.warn(`[receive] local-folder-open failed`,t instanceof Error?t.message:t),f.error(x({id:`phM8Kh`}))}break}let r=g(n,e);r&&f.error(r)}}catch(e){let t=e;console.warn(`[receive] local-folder-validate failed`,t instanceof Error?t.message:t),f.error(x({id:`rlUzXK`}))}O(!1)}};let m;t[40]!==x||t[41]!==a||t[42]!==F||t[43]!==_?(m=function(){if(F===null||F.phase!==`ready`)return;let e=F.seed;console.warn(`[receive] consent_dialog action=initialize worktree=${e.candidatePath}`),I(de),a.project.okInit({projectPath:e.candidatePath}).then(async t=>{if(t.ok===!0){I(e=>e===null?e:S(e,{ok:!0,projectPath:t.projectPath}));try{await a.project.open({path:t.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:e.targetKind,path:e.targetPath},pendingBranch:e.branch}),I(ue),_.dismiss()}catch(t){let n=t,r=n instanceof Error?n.message:String(n);I(e=>e===null?e:C(e,{ok:!1,message:r})),f.error(x({id:`nDT8qt`,values:{0:e.candidatePath}}))}return}let n=t.reason,r=t.message||`Initialization failed.`;I(e=>e===null?e:S(e,{ok:!1,reason:n,message:r})),f.error(r)}).catch(t=>{let n=t instanceof Error?t.message:String(t);I(e=>e===null?e:S(e,{ok:!1,reason:`network-error`,message:n})),f.error(x({id:`3Mwaly`,values:{0:e.candidatePath}}))})},t[40]=x,t[41]=a,t[42]=F,t[43]=_,t[44]=m):m=t[44];let v=m,y;t[45]!==F||t[46]!==_?(y=function(){F!==null&&console.warn(`[receive] consent_dialog action=cancel worktree=${F.seed.candidatePath}`),I(M),_.dismiss()},t[45]=F,t[46]=_,t[47]=y):y=t[47];let b=y;if(F!==null&&F.phase!==`cancelled`&&F.phase!==`done`&&R!==null){let e=F.seed,n=F.phase===`initializing`||F.phase===`opening`,i;t[48]===b?i=t[49]:(i=e=>{e||b()},t[48]=b,t[49]=i);let a;t[50]===G?a=t[51]:(a=(0,T.jsx)(te,{children:(0,T.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:G}})}),t[50]=G,t[51]=a);let u;t[52]===R.target?u=t[53]:(u=p(R.target)?`— ${p(R.target)}`:``,t[52]=R.target,t[53]=u);let d;t[54]!==R.owner||t[55]!==R.repo||t[56]!==u?(d=(0,T.jsx)(ee,{className:`sr-only`,children:(0,T.jsx)(r,{id:`pgq_xf`,values:{0:R.owner,1:R.repo,2:u}})}),t[54]=R.owner,t[55]=R.repo,t[56]=u,t[57]=d):d=t[57];let f=R.owner,ae=R.repo,m;t[58]===R.target?m=t[59]:(m=p(R.target),t[58]=R.target,t[59]=m);let h;t[60]!==R.branch||t[61]!==R.owner||t[62]!==R.repo||t[63]!==R.target.kind||t[64]!==m?(h=(0,T.jsx)(se,{owner:f,repo:ae,path:m,kind:R.target.kind,branch:R.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[60]=R.branch,t[61]=R.owner,t[62]=R.repo,t[63]=R.target.kind,t[64]=m,t[65]=h):h=t[65];let g;t[66]!==a||t[67]!==d||t[68]!==h?(g=(0,T.jsxs)(c,{children:[a,d,h]}),t[66]=a,t[67]=d,t[68]=h,t[69]=g):g=t[69];let oe;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`KsAPaB`})}),t[70]=oe):oe=t[70];let _;t[71]===e.candidatePath?_=t[72]:(_=(0,T.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-receive-consent-path`,children:e.candidatePath}),t[71]=e.candidatePath,t[72]=_);let y;t[73]===e.parentProjectName?y=t[74]:(y=e.parentProjectName===null?null:(0,T.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,"data-testid":`share-receive-consent-parent`,children:(0,T.jsx)(r,{id:`JmfgFc`,values:{0:e.parentProjectName}})}),t[73]=e.parentProjectName,t[74]=y);let x;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,T.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`w7SsvI`})}),t[75]=x):x=t[75];let S;t[76]!==F.message||t[77]!==F.phase?(S=F.phase===`error`?(0,T.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,"data-testid":`share-receive-consent-error`,role:`alert`,children:F.message}):null,t[76]=F.message,t[77]=F.phase,t[78]=S):S=t[78];let C;t[79]!==_||t[80]!==y||t[81]!==S?(C=(0,T.jsxs)(re,{children:[oe,_,y,x,S]}),t[79]=_,t[80]=y,t[81]=S,t[82]=C):C=t[82];let w;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,T.jsx)(r,{id:`dEgA5A`}),t[83]=w):w=t[83];let E;t[84]===b?E=t[85]:(E=(0,T.jsx)(o,{variant:`ghost`,onClick:b,"data-testid":`share-receive-consent-cancel`,children:w}),t[84]=b,t[85]=E);let D=n||F.phase===`error`,O=n||F.phase===`error`,k;t[86]===n?k=t[87]:(k=n?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(ie,{className:`mr-2 h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,T.jsx)(r,{id:`NKkZXl`})]}):(0,T.jsx)(r,{id:`NKkZXl`}),t[86]=n,t[87]=k);let A;t[88]!==v||t[89]!==D||t[90]!==O||t[91]!==k?(A=(0,T.jsx)(o,{onClick:v,disabled:D,"aria-disabled":O,"data-testid":`share-receive-consent-initialize`,children:k}),t[88]=v,t[89]=D,t[90]=O,t[91]=k,t[92]=A):A=t[92];let j;t[93]!==E||t[94]!==A?(j=(0,T.jsxs)(s,{children:[E,A]}),t[93]=E,t[94]=A,t[95]=j):j=t[95];let M;t[96]!==g||t[97]!==C||t[98]!==j?(M=(0,T.jsxs)(ne,{className:`sm:max-w-xl`,"data-testid":`share-receive-consent-dialog`,onInteractOutside:le,onPointerDownOutside:ce,children:[g,C,j]}),t[96]=g,t[97]=C,t[98]=j,t[99]=M):M=t[99];let ue;t[100]!==i||t[101]!==M?(ue=(0,T.jsx)(l,{open:!0,onOpenChange:i,children:M}),t[100]=i,t[101]=M,t[102]=ue):ue=t[102],W=ue;break bb0}if(!L||!R||!e){W=null;break bb0}z=h!==void 0&&!N;let E;t[103]!==x||t[104]!==N?(E=x(N?{id:`YjhKI5`}:{id:`LE7t79`}),t[103]=x,t[104]=N,t[105]=E):E=t[105],B=E,we=d(e)}t[15]=x,t[16]=j,t[17]=a,t[18]=h,t[19]=N,t[20]=F,t[21]=L,t[22]=w,t[23]=R,t[24]=_,t[25]=z,t[26]=B,t[27]=V,t[28]=H,t[29]=U,t[30]=we,t[31]=W,t[32]=G}else z=t[25],B=t[26],V=t[27],H=t[28],U=t[29],we=t[30],W=t[31],G=t[32];if(W!==Symbol.for(`react.early_return_sentinel`))return W;let Te=we,Ee=k?.authenticated?k.login:void 0,De;t[106]===P?De=t[107]:(De=P?.detail?m(P.detail):``,t[106]=P,t[107]=De);let Oe=De,K;t[108]===_?K=t[109]:(K=e=>{e||_.dismiss()},t[108]=_,t[109]=K);let q;t[110]===G?q=t[111]:(q=(0,T.jsx)(te,{children:(0,T.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:G}})}),t[110]=G,t[111]=q);let J;t[112]===R.target?J=t[113]:(J=p(R.target)?` — ${p(R.target)}`:null,t[112]=R.target,t[113]=J);let Y;t[114]!==R.owner||t[115]!==R.repo||t[116]!==J?(Y=(0,T.jsxs)(ee,{className:`sr-only`,children:[R.owner,`/`,R.repo,J]}),t[114]=R.owner,t[115]=R.repo,t[116]=J,t[117]=Y):Y=t[117];let ke=R.owner,Ae=R.repo,X;t[118]===R.target?X=t[119]:(X=p(R.target),t[118]=R.target,t[119]=X);let Z;t[120]!==R.branch||t[121]!==R.owner||t[122]!==R.repo||t[123]!==R.target.kind||t[124]!==X?(Z=(0,T.jsx)(se,{owner:ke,repo:Ae,path:X,kind:R.target.kind,branch:R.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[120]=R.branch,t[121]=R.owner,t[122]=R.repo,t[123]=R.target.kind,t[124]=X,t[125]=Z):Z=t[125];let Q;t[126]!==q||t[127]!==Y||t[128]!==Z?(Q=(0,T.jsxs)(c,{children:[q,Y,Z]}),t[126]=q,t[127]=Y,t[128]=Z,t[129]=Q):Q=t[129];let $;t[130]!==h||t[131]!==z||t[132]!==P||t[133]!==Oe||t[134]!==B||t[135]!==N||t[136]!==V||t[137]!==H||t[138]!==w?($=P?(0,T.jsxs)(`div`,{ref:ge,tabIndex:-1,className:`rounded-lg border border-destructive/40 bg-destructive/5 p-4 outline-none`,"data-testid":`share-receive-clone-error`,children:[(0,T.jsx)(`p`,{className:`text-sm font-semibold text-foreground`,role:`alert`,children:(0,T.jsx)(r,{id:`aiArms`})}),Oe?(0,T.jsxs)(`p`,{className:`mt-2 break-words text-xs text-destructive`,"data-testid":`share-receive-clone-error-message`,children:[(0,T.jsx)(r,{id:`4BITzH`}),` `,(0,T.jsxs)(`span`,{className:`font-mono text-foreground/80`,children:[`"`,Oe,`"`]})]}):null,(0,T.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`Llyqvo`})}),(0,T.jsxs)(`ul`,{className:`mt-1 list-disc space-y-1 pl-5 text-sm text-muted-foreground`,"data-testid":`share-receive-clone-error-reasons`,children:[(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`6LbUG7`})}),(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`_pY_Vq`})}),(0,T.jsx)(`li`,{children:(0,T.jsx)(r,{id:`J6mxC1`})})]}),(0,T.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,T.jsx)(o,{onClick:()=>{V()},"data-testid":`share-receive-clone-retry`,children:(0,T.jsx)(r,{id:`KDw4GX`})}),(0,T.jsx)(o,{variant:`outline`,onClick:()=>{H()},disabled:w||N,"data-testid":`share-receive-error-local`,children:(0,T.jsx)(r,{id:`xFQRu4`})})]})]}):(0,T.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,T.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-clone`,className:`flex flex-col items-start gap-2 rounded-lg border border-primary/50 bg-primary/5 p-4 text-left transition hover:border-primary hover:bg-primary/10 focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-primary/50 disabled:hover:bg-primary/5`,onClick:()=>{V()},disabled:h!==void 0&&!z,"aria-disabled":h!==void 0&&!z,children:[(0,T.jsx)(`span`,{className:`text-sm font-semibold`,children:B}),(0,T.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`fj5YiP`})})]}),(0,T.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-local`,className:`flex flex-col items-start gap-2 rounded-lg border border-border bg-card p-4 text-left transition hover:border-foreground/50 hover:bg-accent focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,onClick:()=>{H()},disabled:w||N,children:[(0,T.jsx)(`span`,{className:`text-sm font-semibold`,children:(0,T.jsx)(r,{id:`HfI1dR`})}),(0,T.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`_qD6mn`})})]})]}),t[130]=h,t[131]=z,t[132]=P,t[133]=Oe,t[134]=B,t[135]=N,t[136]=V,t[137]=H,t[138]=w,t[139]=$):$=t[139];let je;t[140]!==j||t[141]!==k||t[142]!==h||t[143]!==U||t[144]!==Ee?(je=h?(0,T.jsx)(`div`,{className:`mt-3 flex items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-xs`,"data-testid":`share-receive-auth-banner`,role:`status`,"aria-live":`polite`,children:k===null?(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`UDFrWm`})}):k.authenticated?(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`VAHWL_`,values:{signedInLogin:Ee},components:{0:(0,T.jsx)(`span`,{className:`font-medium text-foreground/90`})}})}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:(0,T.jsx)(r,{id:`SgKLfA`})}),(0,T.jsx)(`button`,{type:`button`,"data-testid":`share-receive-signin`,className:`font-medium text-primary underline-offset-2 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded`,onClick:()=>{U()},disabled:j,children:j?(0,T.jsx)(r,{id:`PKLY-1`}):(0,T.jsx)(r,{id:`3jod3l`})})]})}):null,t[140]=j,t[141]=k,t[142]=h,t[143]=U,t[144]=Ee,t[145]=je):je=t[145];let Me;t[146]!==P||t[147]!==Te?(Me=P?null:(0,T.jsx)(`p`,{className:`mt-3 text-1sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`RJ3a8Z`,values:{lookingForUrl:Te},components:{0:(0,T.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),t[146]=P,t[147]=Te,t[148]=Me):Me=t[148];let Ne;t[149]!==$||t[150]!==je||t[151]!==Me?(Ne=(0,T.jsxs)(re,{children:[$,je,Me]}),t[149]=$,t[150]=je,t[151]=Me,t[152]=Ne):Ne=t[152];let Pe;t[153]===_?Pe=t[154]:(Pe=()=>_.dismiss(),t[153]=_,t[154]=Pe);let Fe;t[155]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=(0,T.jsx)(r,{id:`dEgA5A`}),t[155]=Fe):Fe=t[155];let Ie;t[156]===Pe?Ie=t[157]:(Ie=(0,T.jsx)(s,{children:(0,T.jsx)(o,{variant:`outline`,className:`font-mono uppercase`,onClick:Pe,children:Fe})}),t[156]=Pe,t[157]=Ie);let Le;t[158]!==Q||t[159]!==Ne||t[160]!==Ie?(Le=(0,T.jsxs)(ne,{className:`sm:max-w-xl`,"data-testid":`share-receive-dialog`,children:[Q,Ne,Ie]}),t[158]=Q,t[159]=Ne,t[160]=Ie,t[161]=Le):Le=t[161];let Re;return t[162]!==K||t[163]!==Le?(Re=(0,T.jsx)(l,{open:!0,onOpenChange:K,children:Le}),t[162]=K,t[163]=Le,t[164]=Re):Re=t[164],Re}function ce(e){return e.preventDefault()}function le(e){return e.preventDefault()}function M(e){return e===null?e:w(e)}function ue(e){return e===null?e:C(e,{ok:!0})}function de(e){return e===null?e:x(e)}export{O as ShareReceiveDialog};
|