@inkeep/open-knowledge 0.62.0-beta.10 → 0.62.0-beta.11
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-B-KPua43.mjs → acp-harness-probe-BhBv2I5I.mjs} +2 -2
- package/dist/cli.mjs +6 -6
- package/dist/constants-CQmuuU-2.mjs +2 -0
- package/dist/index.mjs +1 -1
- package/dist/{init-BLNT_tUm.mjs → init-DDMrt019.mjs} +3 -3
- package/dist/init-DgLscL5n.mjs +1 -0
- package/dist/{launch-json-removal-CK5UoheA.mjs → launch-json-removal-D5Qx5tK9.mjs} +2 -2
- package/dist/loader-BcDsgIb_.mjs +1 -0
- package/dist/{loader-BLPuFtTx.mjs → loader-Bp3t-1ep.mjs} +2 -2
- package/dist/{preview-DgSwvawF.mjs → preview-BUxiHnBN.mjs} +2 -2
- package/dist/preview-kUODq7b6.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-OAVcuB8h.js → ActivityModeContent-C0vSZKA8.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-B4uvW19a.js → AgentDiffPane-DSIR5DZH.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-1jJf6SqH.js → BugReportHistoryDialog-CaS4r08X.js} +1 -1
- package/dist/public/assets/{ConsentDialogBody-BI66aSep.js → ConsentDialogBody-DHPaGsIM.js} +1 -1
- package/dist/public/assets/DocumentContext-SgRdJdQj.js +38 -0
- package/dist/public/assets/{EnableSyncConfirmDialog-BQjjO14o.js → EnableSyncConfirmDialog-Bn2PIF0e.js} +1 -1
- package/dist/public/assets/FeedbackForm-Dq0yDG0L.js +1 -0
- package/dist/public/assets/{ImportSkillDialog-Cp8jVRXD.js → ImportSkillDialog-D_zt4Yd8.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-D4wZf-NJ.js → ManagedArtifactProperties-C2ot8GUt.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-hfDevVG2.js +1 -0
- package/dist/public/assets/{McpConsentDialogBody-Br5W9Pss.js → McpConsentDialogBody-Dv0o4Jcn.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-CWAjrwHJ.js → PropertyDisplayRow-okgj9NBh.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-BCldEkeI.js → ReportBugDialogBody-BF6dmXOQ.js} +1 -1
- package/dist/public/assets/{SessionsHost-z5e_OzZt.js → SessionsHost-D0oLEpCC.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-Duayhq2D.js → SettingsDialogBody-CRVJaQ02.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-D3iwikBy.js → ShareBranchSwitchDialog-8vXFhoKJ.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-BPmOaV0V.js → ShareReceiveDialog-Ij_cn0JP.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-BkNaJK2L.js → ShareReceiveMissDialog-BPHUyIAU.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-8srxkF5p.js → SkillInstallMenu-BbNRMx0S.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-CZey0-WI.js → SkillOriginInline-CK5GExw_.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-Kk8iuvo-.js → SkillToolbarControls-DCAp7sEQ.js} +1 -1
- package/dist/public/assets/{SourceEditor-dYRnKyOo.js → SourceEditor-4PSUJ0CR.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-B3BAbYPP.js → TerminalWindowApp-C_Iom0hq.js} +1 -1
- package/dist/public/assets/{ThreadView-Ye0BBerQ.js → ThreadView-DodvaO-h.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-Caishp2t.js → TimelineDiffPane-BAxbdmHb.js} +1 -1
- package/dist/public/assets/{agent-diff-store-BEzbyBeo.js → agent-diff-store-BUyhEbvM.js} +1 -1
- package/dist/public/assets/alert-dialog-C8E8SkhJ.js +7 -0
- package/dist/public/assets/{auth-state-cache-DikHvr1X.js → auth-state-cache-BMpPx-mB.js} +1 -1
- package/dist/public/assets/{comment-chips-CuO6aNxi.js → comment-chips-04_tRrqZ.js} +1 -1
- package/dist/public/assets/dialog-BH80AfFt.js +5 -0
- package/dist/public/assets/globals-C5EyCd0I.css +1 -0
- package/dist/public/assets/{index-CKM71qaO.js → index-COKeO6TE.js} +114 -114
- package/dist/public/assets/{pending-receive-nav-store-CHfDzhYj.js → pending-receive-nav-store-B1zDK_B7.js} +1 -1
- package/dist/public/assets/{progress-UAyq_1UZ.js → progress-SsgWN0bn.js} +1 -1
- package/dist/public/assets/{selection-context-CHhI9zIt.js → selection-context-VLeOXNRS.js} +1 -1
- package/dist/public/assets/{skill-actions-BBmZJVgM.js → skill-actions-DV-FbPko.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-Deo91XZ0.js → typing-burst-detector-7BGw52s2.js} +1 -1
- package/dist/public/assets/{uninstall-BaRSYXMj.js → uninstall-DKYevSDB.js} +1 -1
- package/dist/public/assets/{use-activity-panel-BvLxzrmK.js → use-activity-panel-qKH-8Oye.js} +1 -1
- package/dist/public/assets/{use-open-skill-BHbzl4G7.js → use-open-skill-B3nDVVAN.js} +1 -1
- package/dist/public/assets/{use-popular-skills-BWJI2QDi.js → use-popular-skills-prFbaA0s.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-X5fkFj61.js → use-timeline-entry-diff-Cm7Mhw3v.js} +1 -1
- package/dist/public/index.html +20 -20
- package/dist/public/uninstall.html +3 -3
- package/dist/{repair-launch-json-CSZR1JGN.mjs → repair-launch-json-Tot33ErF.mjs} +2 -2
- package/dist/{repair-mcp-configs-hLR2ZzZo.mjs → repair-mcp-configs-CA6Zr2GA.mjs} +2 -2
- package/dist/{src-BbSa-WXS.mjs → src-C2AZR3Jq.mjs} +2 -2
- package/dist/src-CvZpLQhW.mjs +1 -0
- package/dist/start-BZqCNROw.mjs +1 -0
- package/dist/{start-CJew9wC7.mjs → start-CPjL7ygl.mjs} +2 -2
- package/package.json +5 -5
- package/dist/constants-qcWib3zT.mjs +0 -2
- package/dist/init-Cxn9ppmu.mjs +0 -1
- package/dist/loader-BXwBKN65.mjs +0 -1
- package/dist/preview-a5lzfdkv.mjs +0 -1
- package/dist/public/assets/DocumentContext-BBmaT-1y.js +0 -38
- package/dist/public/assets/FeedbackForm-CTgfcdTP.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-DEWzuoa-.js +0 -1
- package/dist/public/assets/alert-dialog-Cx4P6Ih4.js +0 -7
- package/dist/public/assets/dialog-CNGLHo4Y.js +0 -5
- package/dist/public/assets/globals-Bg7TE4FR.css +0 -1
- package/dist/src-Bt2COS3U.mjs +0 -1
- package/dist/start-PUXER2RK.mjs +0 -1
- /package/dist/public/assets/{globals-Dad_9qHk.js → globals-BRu8eHw9.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Lr as e,Pr as t}from"./src-32lVY8sD.mjs";import{F as n}from"./fs-traced-2B_-YK-g.mjs";import{D as r,T as i}from"./init-
|
|
2
|
-
//# sourceMappingURL=launch-json-removal-
|
|
1
|
+
import{Lr as e,Pr as t}from"./src-32lVY8sD.mjs";import{F as n}from"./fs-traced-2B_-YK-g.mjs";import{D as r,T as i}from"./init-DDMrt019.mjs";import{t as a}from"./is-object-Bw0-z8qH.mjs";import{join as o}from"node:path";import{existsSync as s,readFileSync as c}from"node:fs";const l={allowTrailingComma:!0,disallowComments:!1};function u(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function d(a){let d=o(a,`.claude`,`launch.json`);if(!s(d))return{kind:`not-present`};let p;try{p=c(d,`utf-8`)}catch{return{kind:`declined`}}let m=[],h=e(p,m,l)??void 0;if(m.some(e=>!u(e,p))||!h||h.type!==`object`)return{kind:`declined`};let g=t(h).configurations;if(!Array.isArray(g))return{kind:`not-present`};let _=g.findIndex(f);if(_===-1)return{kind:`not-present`};let{text:v,changed:y}=r(p,[`configurations`,_]);return y?(n(d,v,{mode:i(d)}),{kind:`removed`}):{kind:`not-present`}}function f(e){if(!a(e))return!1;let t=e;if(t.name!==`open-knowledge-ui`||!Array.isArray(t.runtimeArgs))return!1;let n=t.runtimeArgs;return t.runtimeExecutable===`/bin/sh`?n.length===3&&n[0]===`-l`&&n[1]===`-c`&&typeof n[2]==`string`&&/^# ok-ui-v[1-9]\d*$/.test(n[2].split(/\r?\n/,1)[0]??``):t.runtimeExecutable===`npx`?p.some(e=>m(n,e)):t.runtimeExecutable===`powershell`&&n.length===4&&n[0]===`-NoProfile`&&n[1]===`-NonInteractive`&&n[2]===`-Command`&&typeof n[3]==`string`&&/^# ok-ui-win-v[1-9]\d*$/.test(n[3].split(/\r?\n/,1)[0]??``)}const p=[[`@inkeep/open-knowledge`,`ui`],[`-y`,`@inkeep/open-knowledge`,`ui`],[`-y`,`@inkeep/open-knowledge@latest`,`ui`]];function m(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}export{d as t};
|
|
2
|
+
//# sourceMappingURL=launch-json-removal-D5Qx5tK9.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./loader-Bp3t-1ep.mjs";export{e as loadConfig};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{h as e,l as t,p as n,pt as r,u as i}from"./sleep-DhRrtbfG.mjs";import{_c as a,gc as o}from"./src-tR2kRwXj.mjs";import{y as s}from"./src-32lVY8sD.mjs";import{I as c,k as l}from"./fs-traced-2B_-YK-g.mjs";import{t as u}from"./constants-
|
|
2
|
-
//# sourceMappingURL=loader-
|
|
1
|
+
import{h as e,l as t,p as n,pt as r,u as i}from"./sleep-DhRrtbfG.mjs";import{_c as a,gc as o}from"./src-tR2kRwXj.mjs";import{y as s}from"./src-32lVY8sD.mjs";import{I as c,k as l}from"./fs-traced-2B_-YK-g.mjs";import{t as u}from"./constants-CQmuuU-2.mjs";import{t as d}from"./is-object-Bw0-z8qH.mjs";import{resolve as f}from"node:path";import{existsSync as p,readFileSync as m}from"node:fs";import{realpath as h}from"node:fs/promises";var g=r();async function _(e){let t=f(e);try{return await h(t)}catch(e){if(e.code!==`ENOENT`){let n=e instanceof Error?e.message:String(e);console.warn(`[normalize-cwd] realpath failed for ${t}: ${n}`)}return t}}function v(e){if(!p(e))return{value:null,path:e,source:null,doc:null};let t;try{t=m(e,`utf-8`)}catch(t){let n=t instanceof Error?t.message:String(t);return console.warn(`[config] Failed to read ${e}: ${n}`),{value:null,path:e,source:null,doc:null,diagnostic:{code:`UNREADABLE`,detail:`${e}: ${n}`}}}let n=(0,g.parseDocument)(t);if(n.errors.length>0){let r=n.errors.map(e=>e.message).join(`; `);return console.warn(`[config] Failed to parse ${e}: ${r}`),{value:null,path:e,source:t,doc:null,diagnostic:{code:`YAML_PARSE`,detail:`${e}: ${r}`}}}let r=n.toJSON();return d(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function y(t,n){return t.map(t=>{let r=t.path.map(e=>typeof e==`symbol`?String(e):e),i={path:r,message:t.message,issueCode:t.code};if(n.doc!==null&&n.source!==null){let t=e({file:n.path,source:n.source,doc:n.doc,path:r});if(t!==void 0)return{...i,source:t}}return i})}function b(e){let r=e??process.cwd(),d=[],p=[],m=[],h=[],g=l(`user`,r),_=c({absPath:g});p.push(..._.diagnostics),!_.valid&&_.sidelinedTo!==void 0&&m.push({from:g,to:_.sidelinedTo}),_.valid&&_.source!==void 0&&d.push(g);let b=(e,n=!1)=>{let r=v(e);if(r.diagnostic!==void 0&&p.push(r.diagnostic),r.value===null)return{};let o=t({value:r.value,file:r.path,source:r.source,doc:r.doc});p.push(...o),d.push(e);let s=o.length>0?i(r.value):r.value;return n&&h.push(...a({value:s,file:r.path,source:r.source,doc:r.doc})),s},x=f(r,`.ok`,u),S=b(x,!0),C=b(l(`project-local`,r)),w=o(_.value,S,C),T=s.safeParse(w);if(!T.success){let e=v(x),t={code:`SCHEMA_INVALID`,issues:y(T.error.issues,e)};throw Error(n(t))}return{config:T.data,sources:d,diagnostics:p,sidelined:m,ignoredCommittedKeys:h}}function x(e){let t=e.cacheMs??1e3,n=e.loadConfigFn??b,r=new Map,i=new Map,a=_(e.startupCwd);return async o=>{let s=await _(o??e.startupCwd),c=Date.now(),l=r.get(s);if(l&&l.expiresAt>c)return l.config;let u=i.get(s);if(u)return await u;let d=(async()=>{if(s===await a)return r.set(s,{config:e.startupConfig,expiresAt:Date.now()+t}),e.startupConfig;let i=n(s).config;return r.set(s,{config:i,expiresAt:Date.now()+t}),i})();i.set(s,d);try{return await d}finally{i.delete(s)}}}export{b as n,x as t};
|
|
2
|
+
//# sourceMappingURL=loader-Bp3t-1ep.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Rr as e}from"./src-32lVY8sD.mjs";import"./constants-
|
|
1
|
+
import{Rr as e}from"./src-32lVY8sD.mjs";import"./constants-CQmuuU-2.mjs";import{join as t,relative as n}from"node:path";import{existsSync as r,lstatSync as i,readdirSync as a,realpathSync as o,statSync as s}from"node:fs";function c(r){let{projectDir:c,contentDir:l,sampleCap:u=5}=r,d=[],f=[];try{i(l)}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[`cannot access content directory ${l}: ${e instanceof Error?e.message:String(e)}`]}}let p;try{p=e({projectDir:c,contentDir:l})}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[e instanceof Error?e.message:String(e)]}}function m(e){let r;try{r=a(e,{withFileTypes:!0})}catch(t){let r=t instanceof Error?t.message:String(t);d.push(`could not read directory ${n(l,e)||`.`}: ${r}`);return}for(let i of r){let r=t(e,i.name);if(i.isSymbolicLink()){let e;try{e=o(r)}catch(e){let t=e.code;t===`ENOENT`||t===`ELOOP`?d.push(`broken or cyclic symlink: ${n(l,r)}`):d.push(`cannot resolve symlink ${n(l,r)}: ${t??`unknown error`}`);continue}let t;try{t=s(e)}catch{continue}if(t.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(t.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}else if(i.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(i.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}}return m(l),{totalCount:f.length,sample:f.slice(0,u),contentDir:l,warnings:d}}function l(e,i){let a=[],o=n(i,e.contentDir),s=o===``?`./`:`./${o}`;if(a.push(`Content:`),a.push(` Found ${e.totalCount} markdown files in ${s}`),e.sample.length>0){let t=e.sample.join(`, `),n=e.totalCount>e.sample.length?`, …`:``;a.push(` Sample: ${t}${n}`)}if(e.warnings.length>0)for(let t of e.warnings)a.push(` Warning: ${t}`);return a.push(``),r(t(i,`.ok`,`config.yml`))?(a.push(` To adjust scope, add patterns to .okignore at the project root.`),a.push(` To change the content root, edit .ok/config.yml → content.dir.`)):a.push(" Run `open-knowledge init` to scaffold config + .okignore."),a.push(``),a.push(` Re-check anytime: open-knowledge preview`),a.join(`
|
|
2
2
|
`)}export{c as n,l as t};
|
|
3
|
-
//# sourceMappingURL=preview-
|
|
3
|
+
//# sourceMappingURL=preview-BUxiHnBN.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./preview-BUxiHnBN.mjs";export{t as formatPreviewBlock,e as previewContent};
|
package/dist/public/assets/{ActivityModeContent-OAVcuB8h.js → ActivityModeContent-C0vSZKA8.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{a as n,o as r}from"./DocumentContext-BBmaT-1y.js";import{t as i}from"./react-f2sANaYj.js";import{n as a,r as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./button-CA0dewJJ.js";import{i as l,n as u,t as d}from"./tooltip-DPvMEqsq.js";import{a as f,c as p,i as m,o as h,s as g,t as _}from"./dialog-CNGLHo4Y.js";import{n as v}from"./dist-CuH7ikCn.js";import{t as y}from"./dist-BIGNzOeF2.js";import{l as b}from"./Mermaid-ImTX2BxI.js";import{t as x}from"./circle-alert-CKGYtHdt.js";import{i as S}from"./prop-types-Dw4i5Pzf.js";import{t as C}from"./spinner-DmibE6UV.js";import{t as w}from"./undo-2-CXHp9Ngg.js";import{c as T}from"./navigation-targets-CMeQ2nTj.js";import{a as E,i as D,n as O,o as k,t as A}from"./agent-diff-store-BEzbyBeo.js";import{t as j}from"./timeline-diff-store-ym5Oz1UF.js";import{n as M}from"./use-activity-panel-BvLxzrmK.js";var N=s(),P=e(i(),1),F=t();function I(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return y._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return y._({id:`_rP3HI`,values:{minutes:e}})}return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function ee(e){let t=(0,N.c)(86),{burst:n,docName:r,editCount:i,sessionAlive:s,inFlight:v,onOpenDiff:y,onRestore:b}=e,{_:x}=o(),[S,T]=(0,P.useState)(te),D,O;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>{let e=setInterval(()=>T(Date.now()),3e4);return()=>clearInterval(e)},O=[],t[0]=D,t[1]=O):(D=t[0],O=t[1]),(0,P.useEffect)(D,O);let[k,A]=(0,P.useState)(!1),j=E(),M=n.stackIndex+1,ee=j?.docName===r&&j.keptCount===M,L=i-M,ne=!s||v||L<=0,re;t[2]!==L||t[3]!==b?(re=function(){A(!1),b(L)},t[2]=L,t[3]=b,t[4]=re):re=t[4];let ie=re,R;t[5]!==n||t[6]!==y?(R=()=>y(n),t[5]=n,t[6]=y,t[7]=R):R=t[7];let z;t[8]!==x||t[9]!==M||t[10]!==r?(z=x({id:`Z79bnE`,values:{burstNumber:M,docName:r}}),t[8]=x,t[9]=M,t[10]=r,t[11]=z):z=t[11];let ae=ee?`bg-muted`:`hover:bg-muted/40`,oe;t[12]===ae?oe=t[13]:(oe=[`flex min-w-0 flex-1 items-center gap-2 px-4 py-1.5 text-xs text-muted-foreground transition-colors`,ae],t[12]=ae,t[13]=oe);let se=oe.join(` `),B;t[14]!==n.ts||t[15]!==S?(B=I(n.ts,S),t[14]=n.ts,t[15]=S,t[16]=B):B=t[16];let V;t[17]===B?V=t[18]:(V=(0,F.jsx)(`span`,{className:`font-mono`,children:B}),t[17]=B,t[18]=V);let H;t[19]===n.additions?H=t[20]:(H=(0,F.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additions]}),t[19]=n.additions,t[20]=H);let U;t[21]===n.deletions?U=t[22]:(U=(0,F.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletions]}),t[21]=n.deletions,t[22]=U);let W;t[23]!==H||t[24]!==U?(W=(0,F.jsxs)(`span`,{className:`ml-auto font-mono`,children:[H,` `,U]}),t[23]=H,t[24]=U,t[25]=W):W=t[25];let G;t[26]!==ee||t[27]!==V||t[28]!==W||t[29]!==R||t[30]!==z||t[31]!==se?(G=(0,F.jsxs)(`button`,{type:`button`,onClick:R,"aria-pressed":ee,"aria-label":z,"data-testid":`activity-panel-burst-open`,className:se,children:[V,W]}),t[26]=ee,t[27]=V,t[28]=W,t[29]=R,t[30]=z,t[31]=se,t[32]=G):G=t[32];let ce;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1.5 h-3 w-px shrink-0 bg-border`}),t[33]=ce):ce=t[33];let K;t[34]!==x||t[35]!==M||t[36]!==r?(K=x({id:`Zhe80e`,values:{burstNumber:M,docName:r}}),t[34]=x,t[35]=M,t[36]=r,t[37]=K):K=t[37];let le;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(le=()=>A(!0),t[38]=le):le=t[38];let q;t[39]===v?q=t[40]:(q=v?(0,F.jsx)(C,{className:`size-3`,"aria-hidden":`true`}):(0,F.jsx)(w,{className:`size-3`,"aria-hidden":`true`}),t[39]=v,t[40]=q);let J;t[41]!==ne||t[42]!==K||t[43]!==q?(J=(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`activity-panel-burst-restore`,"aria-label":K,disabled:ne,onClick:le,children:q})}),t[41]=ne,t[42]=K,t[43]=q,t[44]=J):J=t[44];let Y;t[45]!==x||t[46]!==L||t[47]!==s?(Y=x(s?L>0?{id:`SOPwPh`}:{id:`62bOuM`}:{id:`NzFvyK`}),t[45]=x,t[46]=L,t[47]=s,t[48]=Y):Y=t[48];let X;t[49]===Y?X=t[50]:(X=(0,F.jsx)(u,{side:`left`,children:Y}),t[49]=Y,t[50]=X);let Z;t[51]!==J||t[52]!==X?(Z=(0,F.jsxs)(d,{children:[J,X]}),t[51]=J,t[52]=X,t[53]=Z):Z=t[53];let Q;t[54]!==G||t[55]!==Z?(Q=(0,F.jsxs)(`div`,{className:`flex items-center border-t border-border/50 pr-3`,children:[G,ce,Z]}),t[54]=G,t[55]=Z,t[56]=Q):Q=t[56];let ue;t[57]===v?ue=t[58]:(ue=e=>{!e&&!v?A(!1):e&&A(!0)},t[57]=v,t[58]=ue);let de;t[59]===x?de=t[60]:(de=x({id:`a4FRQv`}),t[59]=x,t[60]=de);let fe;t[61]===de?fe=t[62]:(fe=(0,F.jsx)(p,{children:de}),t[61]=de,t[62]=fe);let pe;t[63]===L?pe=t[64]:(pe=(0,F.jsx)(f,{children:(0,F.jsx)(a,{id:`LKIPzv`,values:{laterEdits:L}})}),t[63]=L,t[64]=pe);let $;t[65]!==fe||t[66]!==pe?($=(0,F.jsxs)(g,{children:[fe,pe]}),t[65]=fe,t[66]=pe,t[67]=$):$=t[67];let me;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,F.jsx)(c,{variant:`outline`,"data-testid":`activity-panel-burst-restore-cancel`,onClick:()=>A(!1),children:(0,F.jsx)(a,{id:`dEgA5A`})}),t[68]=me):me=t[68];let he;t[69]===v?he=t[70]:(he=v?(0,F.jsx)(C,{className:`mr-2 size-4`,"aria-hidden":`true`}):null,t[69]=v,t[70]=he);let ge;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,F.jsx)(a,{id:`9uI_rE`}),t[71]=ge):ge=t[71];let _e;t[72]!==ie||t[73]!==v||t[74]!==he?(_e=(0,F.jsxs)(h,{children:[me,(0,F.jsxs)(c,{variant:`destructive`,"data-testid":`activity-panel-burst-restore-confirm`,disabled:v,onClick:ie,children:[he,ge]})]}),t[72]=ie,t[73]=v,t[74]=he,t[75]=_e):_e=t[75];let ve;t[76]!==$||t[77]!==_e?(ve=(0,F.jsxs)(m,{children:[$,_e]}),t[76]=$,t[77]=_e,t[78]=ve):ve=t[78];let ye;t[79]!==k||t[80]!==ue||t[81]!==ve?(ye=(0,F.jsx)(_,{open:k,onOpenChange:ue,children:ve}),t[79]=k,t[80]=ue,t[81]=ve,t[82]=ye):ye=t[82];let be;return t[83]!==Q||t[84]!==ye?(be=(0,F.jsxs)(F.Fragment,{children:[Q,ye]}),t[83]=Q,t[84]=ye,t[85]=be):be=t[85],be}function te(){return Date.now()}function L(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return y._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return y._({id:`_rP3HI`,values:{minutes:e}})}let r=Math.round(n/36e5);return y._({id:`nYeBmY`,values:{hours:r}})}function ne(e){let t=(0,N.c)(56),{file:n,sessionAlive:r,isWriting:i,onNavigate:s,onUndoDrop:c,onSetVersion:l}=e,{_:u}=o(),{docName:d}=n,[f,p]=(0,P.useState)(!1),[m,h]=(0,P.useState)(re),g,_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=setInterval(()=>h(Date.now()),3e4);return()=>clearInterval(e)},_=[],t[0]=g,t[1]=_):(g=t[0],_=t[1]),(0,P.useEffect)(g,_);let v=n.bursts.length,y;t[2]!==n.docName||t[3]!==c||t[4]!==r||t[5]!==f?(y=e=>{e<=0||!r||f||(p(!0),Promise.resolve(c(n.docName,e)).finally(()=>{p(!1),A()}))},t[2]=n.docName,t[3]=c,t[4]=r,t[5]=f,t[6]=y):y=t[6];let b=y;if(n.bursts.length===0)return null;let x;t[7]!==n.docName||t[8]!==s?(x=()=>s(n.docName),t[7]=n.docName,t[8]=s,t[9]=x):x=t[9];let S;t[10]!==u||t[11]!==d?(S=u({id:`QcpeeE`,values:{docName:d}}),t[10]=u,t[11]=d,t[12]=S):S=t[12];let C;t[13]!==n.docName||t[14]!==x||t[15]!==S?(C=(0,F.jsx)(`button`,{type:`button`,onClick:x,className:`min-w-0 flex-1 truncate text-left text-foreground hover:underline focus-visible:outline-ring`,"aria-label":S,"data-testid":`activity-panel-file-row-filename`,title:n.docName,children:n.docName}),t[13]=n.docName,t[14]=x,t[15]=S,t[16]=C):C=t[16];let w;t[17]===n.additionsTotal?w=t[18]:(w=(0,F.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additionsTotal]}),t[17]=n.additionsTotal,t[18]=w);let T;t[19]===n.deletionsTotal?T=t[20]:(T=(0,F.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletionsTotal]}),t[19]=n.deletionsTotal,t[20]=T);let E;t[21]!==w||t[22]!==T?(E=(0,F.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[w,` `,T]}),t[21]=w,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==n.lastTs||t[25]!==m?(D=L(n.lastTs,m),t[24]=n.lastTs,t[25]=m,t[26]=D):D=t[26];let O;t[27]===D?O=t[28]:(O=(0,F.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:D}),t[27]=D,t[28]=O);let k;t[29]===i?k=t[30]:(k=i?(0,F.jsx)(`span`,{className:`shrink-0 text-[11px] text-primary animate-pulse`,role:`status`,children:(0,F.jsx)(a,{id:`6q0rnH`})}):null,t[29]=i,t[30]=k);let j;t[31]!==O||t[32]!==k||t[33]!==C||t[34]!==E?(j=(0,F.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-sm`,children:[C,E,O,k]}),t[31]=O,t[32]=k,t[33]=C,t[34]=E,t[35]=j):j=t[35];let M;if(t[36]!==b||t[37]!==v||t[38]!==n.bursts||t[39]!==n.docName||t[40]!==l||t[41]!==r||t[42]!==f){let e;t[44]!==b||t[45]!==v||t[46]!==n.docName||t[47]!==l||t[48]!==r||t[49]!==f?(e=e=>(0,F.jsx)(ee,{burst:e,docName:n.docName,editCount:v,sessionAlive:r,inFlight:f,onOpenDiff:e=>l(e.stackIndex+1),onRestore:b},`${n.docName}:${e.stackIndex}`),t[44]=b,t[45]=v,t[46]=n.docName,t[47]=l,t[48]=r,t[49]=f,t[50]=e):e=t[50],M=n.bursts.map(e),t[36]=b,t[37]=v,t[38]=n.bursts,t[39]=n.docName,t[40]=l,t[41]=r,t[42]=f,t[43]=M}else M=t[43];let I;t[51]===M?I=t[52]:(I=(0,F.jsx)(`div`,{children:M}),t[51]=M,t[52]=I);let te;return t[53]!==j||t[54]!==I?(te=(0,F.jsxs)(`div`,{className:`border-b border-border`,"data-testid":`activity-panel-file-row`,children:[j,I]}),t[53]=j,t[54]=I,t[55]=te):te=t[55],te}function re(){return Date.now()}async function ie(e){let t=await fetch(`/api/agent-undo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...e,agentId:e.connectionId})});if(!t.ok)throw Error(`agent-undo failed: HTTP ${t.status}`)}function R(e){return`#/${e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`}function z(e){typeof window>`u`||(window.location.hash=R(e))}function ae(){let e=(0,N.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(C,{className:`mr-2 size-4`,"aria-hidden":`true`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsxs)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,role:`status`,"aria-busy":`true`,children:[t,(0,F.jsx)(`span`,{className:`text-sm`,children:(0,F.jsx)(a,{id:`ONPvOb`})})]}),e[1]=n):n=e[1],n}function oe(e){let t=(0,N.c)(10),{error:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,F.jsx)(x,{className:`size-6 text-destructive`,"aria-hidden":`true`}),t[0]=i):i=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,F.jsx)(`p`,{className:`text-sm font-medium`,children:(0,F.jsx)(a,{id:`DhLHEb`})}),t[1]=o):o=t[1];let s;t[2]===n?s=t[3]:(s=(0,F.jsxs)(`div`,{className:`space-y-1`,children:[o,(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n})]}),t[2]=n,t[3]=s);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(a,{id:`6gRgw8`}),t[4]=l):l=t[4];let u;t[5]===r?u=t[6]:(u=(0,F.jsx)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:l}),t[5]=r,t[6]=u);let d;return t[7]!==s||t[8]!==u?(d=(0,F.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center`,role:`alert`,"data-testid":`activity-panel-error`,children:[i,s,u]}),t[7]=s,t[8]=u,t[9]=d):d=t[9],d}function se(){let e=(0,N.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,"data-testid":`activity-panel-empty`,children:(0,F.jsx)(`p`,{className:`text-sm italic`,children:(0,F.jsx)(a,{id:`iuTKci`})})}),e[0]=t):t=e[0],t}function B(e){let t=(0,N.c)(12),{onExit:n,showBackButton:r}=e,{_:i}=o(),s;t[0]===i?s=t[1]:(s=i({id:`kYL1lH`}),t[0]=i,t[1]=s);let c;t[2]!==n||t[3]!==r?(c=r?(0,F.jsx)(V,{onClick:n}):null,t[2]=n,t[3]=r,t[4]=c):c=t[4];let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,F.jsx)(a,{id:`kYL1lH`})}),t[5]=l):l=t[5];let u;t[6]===c?u=t[7]:(u=(0,F.jsxs)(`div`,{className:`flex shrink-0 flex-row items-center gap-2 border-b border-border px-3 py-2`,children:[c,l]}),t[6]=c,t[7]=u);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,F.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6 text-muted-foreground`,children:(0,F.jsx)(`p`,{className:`text-center text-sm italic`,children:(0,F.jsx)(a,{id:`D_WKe_`})})}),t[8]=d):d=t[8];let f;return t[9]!==s||t[10]!==u?(f=(0,F.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel-no-agent`,"aria-label":s,children:[u,d]}),t[9]=s,t[10]=u,t[11]=f):f=t[11],f}function V(e){let t=(0,N.c)(9),{onClick:n}=e,{_:r}=o(),i;t[0]===r?i=t[1]:(i=r({id:`ogAuyr`}),t[0]=r,t[1]=i);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(b,{}),t[2]=s):s=t[2];let f;t[3]!==n||t[4]!==i?(f=(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:n,"aria-label":i,"data-testid":`docpanel-exit-agent-mode`,children:s})}),t[3]=n,t[4]=i,t[5]=f):f=t[5];let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,F.jsx)(u,{side:`bottom`,children:(0,F.jsx)(a,{id:`ogAuyr`})}),t[6]=p):p=t[6];let m;return t[7]===f?m=t[8]:(m=(0,F.jsxs)(d,{children:[f,p]}),t[7]=f,t[8]=m),m}function H(e){let t=(0,N.c)(9),{lastTs:n}=e,[r]=(0,P.useState)(U),i;t[0]!==n||t[1]!==r?(i=n?W(r-n):null,t[0]=n,t[1]=r,t[2]=i):i=t[2];let o=i,s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(`span`,{className:`font-medium`,children:(0,F.jsx)(a,{id:`LCUy_N`})}),t[3]=s):s=t[3];let c;t[4]===o?c=t[5]:(c=o?(0,F.jsxs)(`span`,{children:[` · `,o]}):null,t[4]=o,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(`div`,{className:`mt-1 opacity-80`,children:(0,F.jsx)(a,{id:`GK-IRZ`})}),t[6]=l):l=t[6];let u;return t[7]===c?u=t[8]:(u=(0,F.jsxs)(`div`,{className:`border-b border-border bg-muted/40 px-4 py-3 text-xs text-muted-foreground`,"data-testid":`activity-panel-session-ended`,children:[s,c,l]}),t[7]=c,t[8]=u),u}function U(){return Date.now()}function W(e){let t=Math.max(0,e);if(t<6e4){let e=Math.round(t/1e3);return y._({id:`pbwTg6`,values:{seconds:e}})}if(t<36e5){let e=Math.round(t/6e4);return y._({id:`_rP3HI`,values:{minutes:e}})}let n=Math.round(t/36e5);return y._({id:`nYeBmY`,values:{hours:n}})}function G(e){let t=(0,N.c)(10),{agent:n,size:r}=e,i=r===void 0?28:r,a;t[0]!==n.color||t[1]!==i?(a={backgroundColor:n.color,width:i,height:i},t[0]=n.color,t[1]=i,t[2]=a):a=t[2];let o=i*.57,s=i*.57,c;t[3]!==n.icon||t[4]!==o||t[5]!==s?(c=(0,F.jsx)(k,{icon:n.icon,width:o,height:s}),t[3]=n.icon,t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;return t[7]!==a||t[8]!==c?(l=(0,F.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center rounded-full text-white ring-2 ring-background`,style:a,"aria-hidden":`true`,children:c}),t[7]=a,t[8]=c,t[9]=l):l=t[9],l}function ce(e){let t=(0,N.c)(25),{data:n,status:r,error:i,reload:s,onExit:c,onNavigate:l,onUndoDrop:u,onSetVersion:d,showBackButton:f}=e,{_:p}=o(),m=n?.files?.[0]?.lastTs??null,h=n?.files?.length??0,g;t[0]===p?g=t[1]:(g=p({id:`kYL1lH`}),t[0]=p,t[1]=g);let _;t[2]!==c||t[3]!==f?(_=f?(0,F.jsx)(V,{onClick:c}):null,t[2]=c,t[3]=f,t[4]=_):_=t[4];let v;t[5]!==n||t[6]!==h||t[7]!==m?(v=n?.agent?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(G,{agent:n.agent}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:n.agent.displayName}),(0,F.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[n.sessionAlive?(0,F.jsx)(a,{id:`F6pfE9`}):m===null?(0,F.jsx)(a,{id:`PMyJ9C`}):(0,F.jsx)(a,{id:`237hSL`}),n.files.length>0?(0,F.jsxs)(F.Fragment,{children:[` · `,(0,F.jsx)(a,{id:`u3BOHd`,values:{fileCount:h}})]}):null]})]})]}):(0,F.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,F.jsx)(a,{id:`kYL1lH`})})}),t[5]=n,t[6]=h,t[7]=m,t[8]=v):v=t[8];let y;t[9]!==_||t[10]!==v?(y=(0,F.jsxs)(`div`,{className:`flex flex-row items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[_,v]}),t[9]=_,t[10]=v,t[11]=y):y=t[11];let b;t[12]!==n||t[13]!==i||t[14]!==m||t[15]!==l||t[16]!==d||t[17]!==u||t[18]!==s||t[19]!==r?(b=(0,F.jsx)(`div`,{className:`flex-1 overflow-y-auto`,"data-testid":`activity-panel-body`,children:r===`loading`&&n===null?(0,F.jsx)(ae,{}):r===`error`&&i?(0,F.jsx)(oe,{error:i,onRetry:s}):n===null?(0,F.jsx)(se,{}):(0,F.jsxs)(F.Fragment,{children:[!n.sessionAlive&&m!==null?(0,F.jsx)(H,{lastTs:m}):null,n.files.length===0?(0,F.jsx)(se,{}):n.files.map(e=>(0,F.jsx)(ne,{file:e,sessionAlive:n.sessionAlive,isWriting:n.writingDocs.has(e.docName),onNavigate:l,onUndoDrop:u,onSetVersion:t=>d(e,t)},e.docName))]})}),t[12]=n,t[13]=i,t[14]=m,t[15]=l,t[16]=d,t[17]=u,t[18]=s,t[19]=r,t[20]=b):b=t[20];let x;return t[21]!==g||t[22]!==y||t[23]!==b?(x=(0,F.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel`,"aria-label":g,children:[y,b]}),t[21]=g,t[22]=y,t[23]=b,t[24]=x):x=t[24],x}function K(e){let t=(0,N.c)(30),i;t[0]===e?i=t[1]:(i=e===void 0?{}:e,t[0]=e,t[1]=i);let{showBackButton:a}=i,s=a===void 0?!0:a,{_:c}=o(),{docPanelAgentId:l,closeActivityPanel:u}=n(),{openTargetTransition:d}=r(),{pageMeta:f}=S(),{data:p,status:m,error:h,reload:g}=M(l),_,y;if(t[2]!==p||t[3]!==l?(_=()=>{if(!(!p||l===null))for(let e of p.files)D(l,e.docName,e.bursts.length)},y=[p,l],t[2]=p,t[3]=l,t[4]=_,t[5]=y):(_=t[4],y=t[5]),(0,P.useEffect)(_,y),l===null){let e;return t[6]!==u||t[7]!==s?(e=(0,F.jsx)(B,{onExit:u,showBackButton:s}),t[6]=u,t[7]=s,t[8]=e):e=t[8],e}let b;t[9]!==d||t[10]!==f?(b=e=>{d(T({kind:`doc`,target:e,docName:e},f),{disposition:`permanent`,consumeActiveNewTab:!0}),z(e)},t[9]=d,t[10]=f,t[11]=b):b=t[11];let x=b,C;t[12]!==p||t[13]!==l?(C=(e,t)=>{if(!p?.agent||l===null)return;j();let n=e.bursts.length;O({agentId:l,agentName:p.agent.displayName,agentColor:p.agent.color,agentIcon:p.agent.icon,docName:e.docName,keptCount:Math.max(0,Math.min(t,n)),maxVersions:n})},t[12]=p,t[13]=l,t[14]=C):C=t[14];let w=C,E;t[15]!==c||t[16]!==p||t[17]!==l||t[18]!==g?(E=async(e,t)=>{if(!(t<=0))try{await ie({connectionId:l,docName:e,scope:`count`,count:t,agentName:p?.agent?.displayName}),v.success(c(t===1?{id:`-dNlfM`,values:{docName:e}}:{id:`ApeA0n`,values:{dropCount:t,docName:e}})),g()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);v.error(c({id:`EqrC_R`,values:{message:n}})),g()}},t[15]=c,t[16]=p,t[17]=l,t[18]=g,t[19]=E):E=t[19];let k=E,A;return t[20]!==u||t[21]!==p||t[22]!==h||t[23]!==x||t[24]!==w||t[25]!==k||t[26]!==g||t[27]!==s||t[28]!==m?(A=(0,F.jsx)(ce,{data:p,status:m,error:h,reload:g,onExit:u,onNavigate:x,onUndoDrop:k,onSetVersion:w,showBackButton:s}),t[20]=u,t[21]=p,t[22]=h,t[23]=x,t[24]=w,t[25]=k,t[26]=g,t[27]=s,t[28]=m,t[29]=A):A=t[29],A}export{K as ActivityModeContent};
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{a as n,o as r}from"./DocumentContext-SgRdJdQj.js";import{t as i}from"./react-f2sANaYj.js";import{n as a,r as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./button-CA0dewJJ.js";import{i as l,n as u,t as d}from"./tooltip-DPvMEqsq.js";import{a as f,c as p,i as m,o as h,s as g,t as _}from"./dialog-BH80AfFt.js";import{n as v}from"./dist-CuH7ikCn.js";import{t as y}from"./dist-BIGNzOeF2.js";import{l as b}from"./Mermaid-ImTX2BxI.js";import{t as x}from"./circle-alert-CKGYtHdt.js";import{i as S}from"./prop-types-Dw4i5Pzf.js";import{t as C}from"./spinner-DmibE6UV.js";import{t as w}from"./undo-2-CXHp9Ngg.js";import{c as T}from"./navigation-targets-CMeQ2nTj.js";import{a as E,i as D,n as O,o as k,t as A}from"./agent-diff-store-BUyhEbvM.js";import{t as j}from"./timeline-diff-store-ym5Oz1UF.js";import{n as M}from"./use-activity-panel-qKH-8Oye.js";var N=s(),P=e(i(),1),F=t();function I(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return y._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return y._({id:`_rP3HI`,values:{minutes:e}})}return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function ee(e){let t=(0,N.c)(86),{burst:n,docName:r,editCount:i,sessionAlive:s,inFlight:v,onOpenDiff:y,onRestore:b}=e,{_:x}=o(),[S,T]=(0,P.useState)(te),D,O;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>{let e=setInterval(()=>T(Date.now()),3e4);return()=>clearInterval(e)},O=[],t[0]=D,t[1]=O):(D=t[0],O=t[1]),(0,P.useEffect)(D,O);let[k,A]=(0,P.useState)(!1),j=E(),M=n.stackIndex+1,ee=j?.docName===r&&j.keptCount===M,L=i-M,ne=!s||v||L<=0,re;t[2]!==L||t[3]!==b?(re=function(){A(!1),b(L)},t[2]=L,t[3]=b,t[4]=re):re=t[4];let ie=re,R;t[5]!==n||t[6]!==y?(R=()=>y(n),t[5]=n,t[6]=y,t[7]=R):R=t[7];let z;t[8]!==x||t[9]!==M||t[10]!==r?(z=x({id:`Z79bnE`,values:{burstNumber:M,docName:r}}),t[8]=x,t[9]=M,t[10]=r,t[11]=z):z=t[11];let ae=ee?`bg-muted`:`hover:bg-muted/40`,oe;t[12]===ae?oe=t[13]:(oe=[`flex min-w-0 flex-1 items-center gap-2 px-4 py-1.5 text-xs text-muted-foreground transition-colors`,ae],t[12]=ae,t[13]=oe);let se=oe.join(` `),B;t[14]!==n.ts||t[15]!==S?(B=I(n.ts,S),t[14]=n.ts,t[15]=S,t[16]=B):B=t[16];let V;t[17]===B?V=t[18]:(V=(0,F.jsx)(`span`,{className:`font-mono`,children:B}),t[17]=B,t[18]=V);let H;t[19]===n.additions?H=t[20]:(H=(0,F.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additions]}),t[19]=n.additions,t[20]=H);let U;t[21]===n.deletions?U=t[22]:(U=(0,F.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletions]}),t[21]=n.deletions,t[22]=U);let W;t[23]!==H||t[24]!==U?(W=(0,F.jsxs)(`span`,{className:`ml-auto font-mono`,children:[H,` `,U]}),t[23]=H,t[24]=U,t[25]=W):W=t[25];let G;t[26]!==ee||t[27]!==V||t[28]!==W||t[29]!==R||t[30]!==z||t[31]!==se?(G=(0,F.jsxs)(`button`,{type:`button`,onClick:R,"aria-pressed":ee,"aria-label":z,"data-testid":`activity-panel-burst-open`,className:se,children:[V,W]}),t[26]=ee,t[27]=V,t[28]=W,t[29]=R,t[30]=z,t[31]=se,t[32]=G):G=t[32];let ce;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1.5 h-3 w-px shrink-0 bg-border`}),t[33]=ce):ce=t[33];let K;t[34]!==x||t[35]!==M||t[36]!==r?(K=x({id:`Zhe80e`,values:{burstNumber:M,docName:r}}),t[34]=x,t[35]=M,t[36]=r,t[37]=K):K=t[37];let le;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(le=()=>A(!0),t[38]=le):le=t[38];let q;t[39]===v?q=t[40]:(q=v?(0,F.jsx)(C,{className:`size-3`,"aria-hidden":`true`}):(0,F.jsx)(w,{className:`size-3`,"aria-hidden":`true`}),t[39]=v,t[40]=q);let J;t[41]!==ne||t[42]!==K||t[43]!==q?(J=(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`activity-panel-burst-restore`,"aria-label":K,disabled:ne,onClick:le,children:q})}),t[41]=ne,t[42]=K,t[43]=q,t[44]=J):J=t[44];let Y;t[45]!==x||t[46]!==L||t[47]!==s?(Y=x(s?L>0?{id:`SOPwPh`}:{id:`62bOuM`}:{id:`NzFvyK`}),t[45]=x,t[46]=L,t[47]=s,t[48]=Y):Y=t[48];let X;t[49]===Y?X=t[50]:(X=(0,F.jsx)(u,{side:`left`,children:Y}),t[49]=Y,t[50]=X);let Z;t[51]!==J||t[52]!==X?(Z=(0,F.jsxs)(d,{children:[J,X]}),t[51]=J,t[52]=X,t[53]=Z):Z=t[53];let Q;t[54]!==G||t[55]!==Z?(Q=(0,F.jsxs)(`div`,{className:`flex items-center border-t border-border/50 pr-3`,children:[G,ce,Z]}),t[54]=G,t[55]=Z,t[56]=Q):Q=t[56];let ue;t[57]===v?ue=t[58]:(ue=e=>{!e&&!v?A(!1):e&&A(!0)},t[57]=v,t[58]=ue);let de;t[59]===x?de=t[60]:(de=x({id:`a4FRQv`}),t[59]=x,t[60]=de);let fe;t[61]===de?fe=t[62]:(fe=(0,F.jsx)(p,{children:de}),t[61]=de,t[62]=fe);let pe;t[63]===L?pe=t[64]:(pe=(0,F.jsx)(f,{children:(0,F.jsx)(a,{id:`LKIPzv`,values:{laterEdits:L}})}),t[63]=L,t[64]=pe);let $;t[65]!==fe||t[66]!==pe?($=(0,F.jsxs)(g,{children:[fe,pe]}),t[65]=fe,t[66]=pe,t[67]=$):$=t[67];let me;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,F.jsx)(c,{variant:`outline`,"data-testid":`activity-panel-burst-restore-cancel`,onClick:()=>A(!1),children:(0,F.jsx)(a,{id:`dEgA5A`})}),t[68]=me):me=t[68];let he;t[69]===v?he=t[70]:(he=v?(0,F.jsx)(C,{className:`mr-2 size-4`,"aria-hidden":`true`}):null,t[69]=v,t[70]=he);let ge;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,F.jsx)(a,{id:`9uI_rE`}),t[71]=ge):ge=t[71];let _e;t[72]!==ie||t[73]!==v||t[74]!==he?(_e=(0,F.jsxs)(h,{children:[me,(0,F.jsxs)(c,{variant:`destructive`,"data-testid":`activity-panel-burst-restore-confirm`,disabled:v,onClick:ie,children:[he,ge]})]}),t[72]=ie,t[73]=v,t[74]=he,t[75]=_e):_e=t[75];let ve;t[76]!==$||t[77]!==_e?(ve=(0,F.jsxs)(m,{children:[$,_e]}),t[76]=$,t[77]=_e,t[78]=ve):ve=t[78];let ye;t[79]!==k||t[80]!==ue||t[81]!==ve?(ye=(0,F.jsx)(_,{open:k,onOpenChange:ue,children:ve}),t[79]=k,t[80]=ue,t[81]=ve,t[82]=ye):ye=t[82];let be;return t[83]!==Q||t[84]!==ye?(be=(0,F.jsxs)(F.Fragment,{children:[Q,ye]}),t[83]=Q,t[84]=ye,t[85]=be):be=t[85],be}function te(){return Date.now()}function L(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return y._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return y._({id:`_rP3HI`,values:{minutes:e}})}let r=Math.round(n/36e5);return y._({id:`nYeBmY`,values:{hours:r}})}function ne(e){let t=(0,N.c)(56),{file:n,sessionAlive:r,isWriting:i,onNavigate:s,onUndoDrop:c,onSetVersion:l}=e,{_:u}=o(),{docName:d}=n,[f,p]=(0,P.useState)(!1),[m,h]=(0,P.useState)(re),g,_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=setInterval(()=>h(Date.now()),3e4);return()=>clearInterval(e)},_=[],t[0]=g,t[1]=_):(g=t[0],_=t[1]),(0,P.useEffect)(g,_);let v=n.bursts.length,y;t[2]!==n.docName||t[3]!==c||t[4]!==r||t[5]!==f?(y=e=>{e<=0||!r||f||(p(!0),Promise.resolve(c(n.docName,e)).finally(()=>{p(!1),A()}))},t[2]=n.docName,t[3]=c,t[4]=r,t[5]=f,t[6]=y):y=t[6];let b=y;if(n.bursts.length===0)return null;let x;t[7]!==n.docName||t[8]!==s?(x=()=>s(n.docName),t[7]=n.docName,t[8]=s,t[9]=x):x=t[9];let S;t[10]!==u||t[11]!==d?(S=u({id:`QcpeeE`,values:{docName:d}}),t[10]=u,t[11]=d,t[12]=S):S=t[12];let C;t[13]!==n.docName||t[14]!==x||t[15]!==S?(C=(0,F.jsx)(`button`,{type:`button`,onClick:x,className:`min-w-0 flex-1 truncate text-left text-foreground hover:underline focus-visible:outline-ring`,"aria-label":S,"data-testid":`activity-panel-file-row-filename`,title:n.docName,children:n.docName}),t[13]=n.docName,t[14]=x,t[15]=S,t[16]=C):C=t[16];let w;t[17]===n.additionsTotal?w=t[18]:(w=(0,F.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additionsTotal]}),t[17]=n.additionsTotal,t[18]=w);let T;t[19]===n.deletionsTotal?T=t[20]:(T=(0,F.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletionsTotal]}),t[19]=n.deletionsTotal,t[20]=T);let E;t[21]!==w||t[22]!==T?(E=(0,F.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[w,` `,T]}),t[21]=w,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==n.lastTs||t[25]!==m?(D=L(n.lastTs,m),t[24]=n.lastTs,t[25]=m,t[26]=D):D=t[26];let O;t[27]===D?O=t[28]:(O=(0,F.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:D}),t[27]=D,t[28]=O);let k;t[29]===i?k=t[30]:(k=i?(0,F.jsx)(`span`,{className:`shrink-0 text-[11px] text-primary animate-pulse`,role:`status`,children:(0,F.jsx)(a,{id:`6q0rnH`})}):null,t[29]=i,t[30]=k);let j;t[31]!==O||t[32]!==k||t[33]!==C||t[34]!==E?(j=(0,F.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-sm`,children:[C,E,O,k]}),t[31]=O,t[32]=k,t[33]=C,t[34]=E,t[35]=j):j=t[35];let M;if(t[36]!==b||t[37]!==v||t[38]!==n.bursts||t[39]!==n.docName||t[40]!==l||t[41]!==r||t[42]!==f){let e;t[44]!==b||t[45]!==v||t[46]!==n.docName||t[47]!==l||t[48]!==r||t[49]!==f?(e=e=>(0,F.jsx)(ee,{burst:e,docName:n.docName,editCount:v,sessionAlive:r,inFlight:f,onOpenDiff:e=>l(e.stackIndex+1),onRestore:b},`${n.docName}:${e.stackIndex}`),t[44]=b,t[45]=v,t[46]=n.docName,t[47]=l,t[48]=r,t[49]=f,t[50]=e):e=t[50],M=n.bursts.map(e),t[36]=b,t[37]=v,t[38]=n.bursts,t[39]=n.docName,t[40]=l,t[41]=r,t[42]=f,t[43]=M}else M=t[43];let I;t[51]===M?I=t[52]:(I=(0,F.jsx)(`div`,{children:M}),t[51]=M,t[52]=I);let te;return t[53]!==j||t[54]!==I?(te=(0,F.jsxs)(`div`,{className:`border-b border-border`,"data-testid":`activity-panel-file-row`,children:[j,I]}),t[53]=j,t[54]=I,t[55]=te):te=t[55],te}function re(){return Date.now()}async function ie(e){let t=await fetch(`/api/agent-undo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...e,agentId:e.connectionId})});if(!t.ok)throw Error(`agent-undo failed: HTTP ${t.status}`)}function R(e){return`#/${e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`}function z(e){typeof window>`u`||(window.location.hash=R(e))}function ae(){let e=(0,N.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(C,{className:`mr-2 size-4`,"aria-hidden":`true`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsxs)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,role:`status`,"aria-busy":`true`,children:[t,(0,F.jsx)(`span`,{className:`text-sm`,children:(0,F.jsx)(a,{id:`ONPvOb`})})]}),e[1]=n):n=e[1],n}function oe(e){let t=(0,N.c)(10),{error:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,F.jsx)(x,{className:`size-6 text-destructive`,"aria-hidden":`true`}),t[0]=i):i=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,F.jsx)(`p`,{className:`text-sm font-medium`,children:(0,F.jsx)(a,{id:`DhLHEb`})}),t[1]=o):o=t[1];let s;t[2]===n?s=t[3]:(s=(0,F.jsxs)(`div`,{className:`space-y-1`,children:[o,(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n})]}),t[2]=n,t[3]=s);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(a,{id:`6gRgw8`}),t[4]=l):l=t[4];let u;t[5]===r?u=t[6]:(u=(0,F.jsx)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:l}),t[5]=r,t[6]=u);let d;return t[7]!==s||t[8]!==u?(d=(0,F.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center`,role:`alert`,"data-testid":`activity-panel-error`,children:[i,s,u]}),t[7]=s,t[8]=u,t[9]=d):d=t[9],d}function se(){let e=(0,N.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,"data-testid":`activity-panel-empty`,children:(0,F.jsx)(`p`,{className:`text-sm italic`,children:(0,F.jsx)(a,{id:`iuTKci`})})}),e[0]=t):t=e[0],t}function B(e){let t=(0,N.c)(12),{onExit:n,showBackButton:r}=e,{_:i}=o(),s;t[0]===i?s=t[1]:(s=i({id:`kYL1lH`}),t[0]=i,t[1]=s);let c;t[2]!==n||t[3]!==r?(c=r?(0,F.jsx)(V,{onClick:n}):null,t[2]=n,t[3]=r,t[4]=c):c=t[4];let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,F.jsx)(a,{id:`kYL1lH`})}),t[5]=l):l=t[5];let u;t[6]===c?u=t[7]:(u=(0,F.jsxs)(`div`,{className:`flex shrink-0 flex-row items-center gap-2 border-b border-border px-3 py-2`,children:[c,l]}),t[6]=c,t[7]=u);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,F.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6 text-muted-foreground`,children:(0,F.jsx)(`p`,{className:`text-center text-sm italic`,children:(0,F.jsx)(a,{id:`D_WKe_`})})}),t[8]=d):d=t[8];let f;return t[9]!==s||t[10]!==u?(f=(0,F.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel-no-agent`,"aria-label":s,children:[u,d]}),t[9]=s,t[10]=u,t[11]=f):f=t[11],f}function V(e){let t=(0,N.c)(9),{onClick:n}=e,{_:r}=o(),i;t[0]===r?i=t[1]:(i=r({id:`ogAuyr`}),t[0]=r,t[1]=i);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(b,{}),t[2]=s):s=t[2];let f;t[3]!==n||t[4]!==i?(f=(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:n,"aria-label":i,"data-testid":`docpanel-exit-agent-mode`,children:s})}),t[3]=n,t[4]=i,t[5]=f):f=t[5];let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,F.jsx)(u,{side:`bottom`,children:(0,F.jsx)(a,{id:`ogAuyr`})}),t[6]=p):p=t[6];let m;return t[7]===f?m=t[8]:(m=(0,F.jsxs)(d,{children:[f,p]}),t[7]=f,t[8]=m),m}function H(e){let t=(0,N.c)(9),{lastTs:n}=e,[r]=(0,P.useState)(U),i;t[0]!==n||t[1]!==r?(i=n?W(r-n):null,t[0]=n,t[1]=r,t[2]=i):i=t[2];let o=i,s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(`span`,{className:`font-medium`,children:(0,F.jsx)(a,{id:`LCUy_N`})}),t[3]=s):s=t[3];let c;t[4]===o?c=t[5]:(c=o?(0,F.jsxs)(`span`,{children:[` · `,o]}):null,t[4]=o,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(`div`,{className:`mt-1 opacity-80`,children:(0,F.jsx)(a,{id:`GK-IRZ`})}),t[6]=l):l=t[6];let u;return t[7]===c?u=t[8]:(u=(0,F.jsxs)(`div`,{className:`border-b border-border bg-muted/40 px-4 py-3 text-xs text-muted-foreground`,"data-testid":`activity-panel-session-ended`,children:[s,c,l]}),t[7]=c,t[8]=u),u}function U(){return Date.now()}function W(e){let t=Math.max(0,e);if(t<6e4){let e=Math.round(t/1e3);return y._({id:`pbwTg6`,values:{seconds:e}})}if(t<36e5){let e=Math.round(t/6e4);return y._({id:`_rP3HI`,values:{minutes:e}})}let n=Math.round(t/36e5);return y._({id:`nYeBmY`,values:{hours:n}})}function G(e){let t=(0,N.c)(10),{agent:n,size:r}=e,i=r===void 0?28:r,a;t[0]!==n.color||t[1]!==i?(a={backgroundColor:n.color,width:i,height:i},t[0]=n.color,t[1]=i,t[2]=a):a=t[2];let o=i*.57,s=i*.57,c;t[3]!==n.icon||t[4]!==o||t[5]!==s?(c=(0,F.jsx)(k,{icon:n.icon,width:o,height:s}),t[3]=n.icon,t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;return t[7]!==a||t[8]!==c?(l=(0,F.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center rounded-full text-white ring-2 ring-background`,style:a,"aria-hidden":`true`,children:c}),t[7]=a,t[8]=c,t[9]=l):l=t[9],l}function ce(e){let t=(0,N.c)(25),{data:n,status:r,error:i,reload:s,onExit:c,onNavigate:l,onUndoDrop:u,onSetVersion:d,showBackButton:f}=e,{_:p}=o(),m=n?.files?.[0]?.lastTs??null,h=n?.files?.length??0,g;t[0]===p?g=t[1]:(g=p({id:`kYL1lH`}),t[0]=p,t[1]=g);let _;t[2]!==c||t[3]!==f?(_=f?(0,F.jsx)(V,{onClick:c}):null,t[2]=c,t[3]=f,t[4]=_):_=t[4];let v;t[5]!==n||t[6]!==h||t[7]!==m?(v=n?.agent?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(G,{agent:n.agent}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:n.agent.displayName}),(0,F.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[n.sessionAlive?(0,F.jsx)(a,{id:`F6pfE9`}):m===null?(0,F.jsx)(a,{id:`PMyJ9C`}):(0,F.jsx)(a,{id:`237hSL`}),n.files.length>0?(0,F.jsxs)(F.Fragment,{children:[` · `,(0,F.jsx)(a,{id:`u3BOHd`,values:{fileCount:h}})]}):null]})]})]}):(0,F.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,F.jsx)(a,{id:`kYL1lH`})})}),t[5]=n,t[6]=h,t[7]=m,t[8]=v):v=t[8];let y;t[9]!==_||t[10]!==v?(y=(0,F.jsxs)(`div`,{className:`flex flex-row items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[_,v]}),t[9]=_,t[10]=v,t[11]=y):y=t[11];let b;t[12]!==n||t[13]!==i||t[14]!==m||t[15]!==l||t[16]!==d||t[17]!==u||t[18]!==s||t[19]!==r?(b=(0,F.jsx)(`div`,{className:`flex-1 overflow-y-auto`,"data-testid":`activity-panel-body`,children:r===`loading`&&n===null?(0,F.jsx)(ae,{}):r===`error`&&i?(0,F.jsx)(oe,{error:i,onRetry:s}):n===null?(0,F.jsx)(se,{}):(0,F.jsxs)(F.Fragment,{children:[!n.sessionAlive&&m!==null?(0,F.jsx)(H,{lastTs:m}):null,n.files.length===0?(0,F.jsx)(se,{}):n.files.map(e=>(0,F.jsx)(ne,{file:e,sessionAlive:n.sessionAlive,isWriting:n.writingDocs.has(e.docName),onNavigate:l,onUndoDrop:u,onSetVersion:t=>d(e,t)},e.docName))]})}),t[12]=n,t[13]=i,t[14]=m,t[15]=l,t[16]=d,t[17]=u,t[18]=s,t[19]=r,t[20]=b):b=t[20];let x;return t[21]!==g||t[22]!==y||t[23]!==b?(x=(0,F.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel`,"aria-label":g,children:[y,b]}),t[21]=g,t[22]=y,t[23]=b,t[24]=x):x=t[24],x}function K(e){let t=(0,N.c)(30),i;t[0]===e?i=t[1]:(i=e===void 0?{}:e,t[0]=e,t[1]=i);let{showBackButton:a}=i,s=a===void 0?!0:a,{_:c}=o(),{docPanelAgentId:l,closeActivityPanel:u}=n(),{openTargetTransition:d}=r(),{pageMeta:f}=S(),{data:p,status:m,error:h,reload:g}=M(l),_,y;if(t[2]!==p||t[3]!==l?(_=()=>{if(!(!p||l===null))for(let e of p.files)D(l,e.docName,e.bursts.length)},y=[p,l],t[2]=p,t[3]=l,t[4]=_,t[5]=y):(_=t[4],y=t[5]),(0,P.useEffect)(_,y),l===null){let e;return t[6]!==u||t[7]!==s?(e=(0,F.jsx)(B,{onExit:u,showBackButton:s}),t[6]=u,t[7]=s,t[8]=e):e=t[8],e}let b;t[9]!==d||t[10]!==f?(b=e=>{d(T({kind:`doc`,target:e,docName:e},f),{disposition:`permanent`,consumeActiveNewTab:!0}),z(e)},t[9]=d,t[10]=f,t[11]=b):b=t[11];let x=b,C;t[12]!==p||t[13]!==l?(C=(e,t)=>{if(!p?.agent||l===null)return;j();let n=e.bursts.length;O({agentId:l,agentName:p.agent.displayName,agentColor:p.agent.color,agentIcon:p.agent.icon,docName:e.docName,keptCount:Math.max(0,Math.min(t,n)),maxVersions:n})},t[12]=p,t[13]=l,t[14]=C):C=t[14];let w=C,E;t[15]!==c||t[16]!==p||t[17]!==l||t[18]!==g?(E=async(e,t)=>{if(!(t<=0))try{await ie({connectionId:l,docName:e,scope:`count`,count:t,agentName:p?.agent?.displayName}),v.success(c(t===1?{id:`-dNlfM`,values:{docName:e}}:{id:`ApeA0n`,values:{dropCount:t,docName:e}})),g()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);v.error(c({id:`EqrC_R`,values:{message:n}})),g()}},t[15]=c,t[16]=p,t[17]=l,t[18]=g,t[19]=E):E=t[19];let k=E,A;return t[20]!==u||t[21]!==p||t[22]!==h||t[23]!==x||t[24]!==w||t[25]!==k||t[26]!==g||t[27]!==s||t[28]!==m?(A=(0,F.jsx)(ce,{data:p,status:m,error:h,reload:g,onExit:u,onNavigate:x,onUndoDrop:k,onSetVersion:w,showBackButton:s}),t[20]=u,t[21]=p,t[22]=h,t[23]=x,t[24]=w,t[25]=k,t[26]=g,t[27]=s,t[28]=m,t[29]=A):A=t[29],A}export{K as ActivityModeContent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ActivityPanelDiffView-CgaFZtD7.js","./chunk-CYidjpOJ.js","./dist-Nvb76hAm.js","./jsx-runtime-BUgB2tll.js","./react-f2sANaYj.js","./compiler-runtime-BfE3aGVn.js","./ActivityPanelDiffView-legcy4jI.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./overlay-layers-Bj-TVfKw.js";import{t as ee}from"./button-CA0dewJJ.js";import{i as te,n as ne,t as re}from"./tooltip-DPvMEqsq.js";import{n as c,t as l}from"./toggle-group-BlEg4yJE.js";import{t as u}from"./spinner-DmibE6UV.js";import{n as d,t as f}from"./panel-right-open-BXE3r3dB.js";import{t as ie}from"./x-wQUDJS55.js";import{o as ae,r as p,t as oe}from"./agent-diff-store-BEzbyBeo.js";import{t as m}from"./lru-string-cache-Cc7rikda.js";import{t as se}from"./use-activity-panel-BvLxzrmK.js";import{i as ce,o as le,s as ue,t as de,u as fe}from"./use-timeline-entry-diff-X5fkFj61.js";var pe=o(),h=e(r(),1),g=n(),me=(0,h.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-CgaFZtD7.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)).ActivityPanelDiffView})),_=64,he={changes:[],unparseable:null};function v(e){let t=(0,pe.c)(127),{view:n,isPanelCollapsed:r,onTogglePanel:o}=e,{_:m}=a(),{agentId:_,agentName:v,agentColor:y,agentIcon:b,docName:x,keptCount:S}=n,[C]=(0,h.useState)(_e),ve=(0,h.useRef)(null),[w,ye]=(0,h.useState)(`rendered`),be;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(be={status:`loading`,diff:``,before:``,after:``,properties:he},t[0]=be):be=t[0];let[T,xe]=(0,h.useState)(be),Se,Ce;t[1]!==_||t[2]!==C||t[3]!==x||t[4]!==S?(Se=()=>{let e=!1;xe({status:`loading`,diff:``,before:``,after:``,properties:he});let t=`${x}\0${S}`,n=C.get(t);if(n!==void 0){xe({status:`ready`,...JSON.parse(n)});return}return se(_,x,S).then(n=>{e||(C.set(t,JSON.stringify(n)),xe({status:`ready`,...n}))}).catch(t=>{e||(console.error(`[agent-diff] failed to load burst diff`,{agentId:_,docName:x,keptCount:S,err:t}),xe({status:`error`,diff:``,before:``,after:``,properties:he}))}),()=>{e=!0}},Ce=[_,x,S,C],t[1]=_,t[2]=C,t[3]=x,t[4]=S,t[5]=Se,t[6]=Ce):(Se=t[5],Ce=t[6]),(0,h.useEffect)(Se,Ce);let we;t[7]!==T.after||t[8]!==T.before||t[9]!==T.status?(we=T.status===`ready`?ue(T.before,T.after):null,t[7]=T.after,t[8]=T.before,t[9]=T.status,t[10]=we):we=t[10];let Te=we,Ee=T.status===`ready`?`${w}:${S}:${T.diff}`:``,E,D;t[11]===Ee?(E=t[12],D=t[13]):(E=()=>{let e=ve.current;if(Ee===``||!e)return;let t=!1,n=null,r,i,a=()=>{if(t)return;let r=e.querySelector(`[data-property-change]`)??e.querySelector(`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`)??ce(e)[0];if(!r)return;t=!0,n?.disconnect();let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;r.scrollIntoView({block:`center`,behavior:i?`auto`:`smooth`})},o=()=>{t||(r!==void 0&&clearTimeout(r),r=setTimeout(()=>{i!==void 0&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=requestAnimationFrame(a)})},120))};n=new MutationObserver(o),n.observe(e,{childList:!0,subtree:!0}),o();let s=setTimeout(()=>n?.disconnect(),5e3);return()=>{n?.disconnect(),r!==void 0&&clearTimeout(r),i!==void 0&&cancelAnimationFrame(i),clearTimeout(s)}},D=[Ee],t[11]=Ee,t[12]=E,t[13]=D),(0,h.useEffect)(E,D);let O,De;t[14]===S?(O=t[15],De=t[16]):(O=()=>{let e=e=>{if(e.key===`Escape`&&e.defaultPrevented||s())return;let t=e.target;t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)||(e.key===`Escape`?oe():e.key===`j`||e.key===`ArrowRight`?(e.preventDefault(),p(S+1)):(e.key===`k`||e.key===`ArrowLeft`)&&(e.preventDefault(),p(S-1)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},De=[S],t[14]=S,t[15]=O,t[16]=De),(0,h.useEffect)(O,De);let k,A,j,M,N,P,F,I,L,R;if(t[17]!==m||t[18]!==y||t[19]!==b||t[20]!==v||t[21]!==x||t[22]!==T.diff||t[23]!==T.properties.changes.length||t[24]!==T.properties.unparseable||t[25]!==T.status){let e=T.status===`ready`?de(T.diff):{additions:0,deletions:0},n=e.additions>0||e.deletions>0,r=T.properties.changes.length;k=T.properties.changes.length>0||T.properties.unparseable!==null,I=`absolute inset-0 z-20 flex flex-col bg-background`,L=`agent-diff-pane`,M=`flex flex-wrap items-center gap-x-2 gap-y-1.5 border-b border-border px-3 py-2`;let a;t[36]===m?a=t[37]:(a=m({id:`b18t0_`}),t[36]=m,t[37]=a);let o;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,g.jsx)(ie,{className:`size-4`}),t[38]=o):o=t[38];let s;t[39]===a?s=t[40]:(s=(0,g.jsx)(te,{asChild:!0,children:(0,g.jsx)(ee,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-close`,"aria-label":a,onClick:ge,children:o})}),t[39]=a,t[40]=s);let c;t[41]===m?c=t[42]:(c=m({id:`b18t0_`}),t[41]=m,t[42]=c);let l;t[43]===c?l=t[44]:(l=(0,g.jsx)(ne,{side:`bottom`,children:c}),t[43]=c,t[44]=l),t[45]!==s||t[46]!==l?(N=(0,g.jsxs)(re,{children:[s,l]}),t[45]=s,t[46]=l,t[47]=N):N=t[47];let u;t[48]===y?u=t[49]:(u={backgroundColor:y},t[48]=y,t[49]=u);let d;t[50]===b?d=t[51]:(d=(0,g.jsx)(ae,{icon:b,width:13,height:13}),t[50]=b,t[51]=d),t[52]!==u||t[53]!==d?(P=(0,g.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full text-white`,style:u,children:d}),t[52]=u,t[53]=d,t[54]=P):P=t[54];let f;t[55]===x?f=t[56]:(f=(0,g.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:x}),t[55]=x,t[56]=f);let p;t[57]===v?p=t[58]:(p=(0,g.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:v}),t[57]=v,t[58]=p),t[59]!==f||t[60]!==p?(F=(0,g.jsxs)(`div`,{className:`min-w-0 max-w-[14rem] shrink`,children:[f,p]}),t[59]=f,t[60]=p,t[61]=F):F=t[61],R=`ml-auto flex flex-wrap items-center justify-end gap-2`,t[62]===r?A=t[63]:(A=r>0&&(0,g.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,"data-testid":`agent-diff-property-stat`,children:(0,g.jsx)(i,{id:`UI0WPT`,values:{propertyCount:r}})}),t[62]=r,t[63]=A),j=n&&(0,g.jsxs)(`span`,{role:`img`,className:`shrink-0 text-xs tabular-nums`,"data-testid":`agent-diff-stat`,"aria-label":m({id:`8lwQlE`,values:{0:e.additions,1:e.deletions}}),children:[(0,g.jsxs)(`span`,{"aria-hidden":`true`,className:`text-emerald-600 dark:text-emerald-500`,children:[`+`,e.additions]}),` `,(0,g.jsxs)(`span`,{"aria-hidden":`true`,className:`text-red-600 dark:text-red-500`,children:[`−`,e.deletions]})]}),t[17]=m,t[18]=y,t[19]=b,t[20]=v,t[21]=x,t[22]=T.diff,t[23]=T.properties.changes.length,t[24]=T.properties.unparseable,t[25]=T.status,t[26]=k,t[27]=A,t[28]=j,t[29]=M,t[30]=N,t[31]=P,t[32]=F,t[33]=I,t[34]=L,t[35]=R}else k=t[26],A=t[27],j=t[28],M=t[29],N=t[30],P=t[31],F=t[32],I=t[33],L=t[34],R=t[35];let Oe;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=e=>{(e===`rendered`||e===`source`)&&ye(e)},t[64]=Oe):Oe=t[64];let z;t[65]===m?z=t[66]:(z=m({id:`ZW3mlR`}),t[65]=m,t[66]=z);let ke;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,g.jsx)(c,{value:`rendered`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-rendered`,children:(0,g.jsx)(i,{id:`4z_1j2`})}),t[67]=ke):ke=t[67];let Ae;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,g.jsx)(c,{value:`source`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-source`,children:(0,g.jsx)(i,{id:`wdxz7K`})}),t[68]=Ae):Ae=t[68];let B;t[69]!==w||t[70]!==z?(B=(0,g.jsxs)(l,{type:`single`,value:w,onValueChange:Oe,"aria-label":z,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 rounded-md bg-muted p-0.5 dark:bg-background`,children:[ke,Ae]}),t[69]=w,t[70]=z,t[71]=B):B=t[71];let V;t[72]!==m||t[73]!==r?(V=m(r?{id:`6iDEWA`}:{id:`170Js2`}),t[72]=m,t[73]=r,t[74]=V):V=t[74];let je=!r,H;t[75]===r?H=t[76]:(H=r?(0,g.jsx)(f,{className:`size-4`}):(0,g.jsx)(d,{className:`size-4`}),t[75]=r,t[76]=H);let U;t[77]!==o||t[78]!==V||t[79]!==je||t[80]!==H?(U=(0,g.jsx)(te,{asChild:!0,children:(0,g.jsx)(ee,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-toggle-panel`,"aria-label":V,"aria-expanded":je,onClick:o,children:H})}),t[77]=o,t[78]=V,t[79]=je,t[80]=H,t[81]=U):U=t[81];let W;t[82]!==m||t[83]!==r?(W=m(r?{id:`6iDEWA`}:{id:`170Js2`}),t[82]=m,t[83]=r,t[84]=W):W=t[84];let G;t[85]===W?G=t[86]:(G=(0,g.jsx)(ne,{side:`bottom`,children:W}),t[85]=W,t[86]=G);let K;t[87]!==U||t[88]!==G?(K=(0,g.jsxs)(re,{children:[U,G]}),t[87]=U,t[88]=G,t[89]=K):K=t[89];let q;t[90]!==A||t[91]!==j||t[92]!==B||t[93]!==K||t[94]!==R?(q=(0,g.jsxs)(`div`,{className:R,children:[A,j,B,K]}),t[90]=A,t[91]=j,t[92]=B,t[93]=K,t[94]=R,t[95]=q):q=t[95];let J;t[96]!==M||t[97]!==N||t[98]!==P||t[99]!==F||t[100]!==q?(J=(0,g.jsxs)(`div`,{className:M,children:[N,P,F,q]}),t[96]=M,t[97]=N,t[98]=P,t[99]=F,t[100]=q,t[101]=J):J=t[101];let Y;t[102]===T.status?Y=t[103]:(Y=T.status===`loading`&&(0,g.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,g.jsx)(u,{"aria-hidden":`true`,className:`size-3`}),(0,g.jsx)(i,{id:`38foVZ`})]}),t[102]=T.status,t[103]=Y);let X;t[104]===T.status?X=t[105]:(X=T.status===`error`&&(0,g.jsx)(`p`,{className:`px-4 py-3 text-xs text-destructive`,children:(0,g.jsx)(i,{id:`vvWZnu`})}),t[104]=T.status,t[105]=X);let Z;t[106]!==T.properties||t[107]!==T.status?(Z=T.status===`ready`&&(0,g.jsx)(fe,{delta:T.properties}),t[106]=T.properties,t[107]=T.status,t[108]=Z):Z=t[108];let Q;t[109]!==k||t[110]!==S||t[111]!==w||t[112]!==Te||t[113]!==T.after||t[114]!==T.diff||t[115]!==T.status?(Q=T.status===`ready`&&(w===`rendered`&&Te?.ok?(0,g.jsx)(le,{diff:Te}):T.diff===``?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`p`,{className:`border-b border-border px-4 py-2 text-xs text-muted-foreground italic`,children:S===0?(0,g.jsx)(i,{id:`klPS-L`}):k?(0,g.jsx)(i,{id:`15ZHCt`}):(0,g.jsx)(i,{id:`k7Hoig`})}),(0,g.jsx)(`pre`,{className:`whitespace-pre-wrap px-4 py-3 font-mono text-xs text-foreground/90`,children:T.after})]}):(0,g.jsx)(h.Suspense,{fallback:(0,g.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,g.jsx)(u,{"aria-hidden":`true`,className:`size-3`}),(0,g.jsx)(i,{id:`EDm3wJ`})]}),children:(0,g.jsx)(me,{diff:T.diff,viewType:`unified`})})),t[109]=k,t[110]=S,t[111]=w,t[112]=Te,t[113]=T.after,t[114]=T.diff,t[115]=T.status,t[116]=Q):Q=t[116];let $;t[117]!==Y||t[118]!==X||t[119]!==Z||t[120]!==Q?($=(0,g.jsxs)(`div`,{ref:ve,className:`min-h-0 flex-1 overflow-auto subtle-scrollbar`,children:[Y,X,Z,Q]}),t[117]=Y,t[118]=X,t[119]=Z,t[120]=Q,t[121]=$):$=t[121];let Me;return t[122]!==I||t[123]!==L||t[124]!==J||t[125]!==$?(Me=(0,g.jsxs)(`div`,{className:I,"data-testid":L,children:[J,$]}),t[122]=I,t[123]=L,t[124]=J,t[125]=$,t[126]=Me):Me=t[126],Me}function ge(){return oe()}function _e(){return new m(_)}export{v as AgentDiffPane};
|
|
2
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./overlay-layers-Bj-TVfKw.js";import{t as ee}from"./button-CA0dewJJ.js";import{i as te,n as ne,t as re}from"./tooltip-DPvMEqsq.js";import{n as c,t as l}from"./toggle-group-BlEg4yJE.js";import{t as u}from"./spinner-DmibE6UV.js";import{n as d,t as f}from"./panel-right-open-BXE3r3dB.js";import{t as ie}from"./x-wQUDJS55.js";import{o as ae,r as p,t as oe}from"./agent-diff-store-BUyhEbvM.js";import{t as m}from"./lru-string-cache-Cc7rikda.js";import{t as se}from"./use-activity-panel-qKH-8Oye.js";import{i as ce,o as le,s as ue,t as de,u as fe}from"./use-timeline-entry-diff-Cm7Mhw3v.js";var pe=o(),h=e(r(),1),g=n(),me=(0,h.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-CgaFZtD7.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)).ActivityPanelDiffView})),_=64,he={changes:[],unparseable:null};function v(e){let t=(0,pe.c)(127),{view:n,isPanelCollapsed:r,onTogglePanel:o}=e,{_:m}=a(),{agentId:_,agentName:v,agentColor:y,agentIcon:b,docName:x,keptCount:S}=n,[C]=(0,h.useState)(_e),ve=(0,h.useRef)(null),[w,ye]=(0,h.useState)(`rendered`),be;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(be={status:`loading`,diff:``,before:``,after:``,properties:he},t[0]=be):be=t[0];let[T,xe]=(0,h.useState)(be),Se,Ce;t[1]!==_||t[2]!==C||t[3]!==x||t[4]!==S?(Se=()=>{let e=!1;xe({status:`loading`,diff:``,before:``,after:``,properties:he});let t=`${x}\0${S}`,n=C.get(t);if(n!==void 0){xe({status:`ready`,...JSON.parse(n)});return}return se(_,x,S).then(n=>{e||(C.set(t,JSON.stringify(n)),xe({status:`ready`,...n}))}).catch(t=>{e||(console.error(`[agent-diff] failed to load burst diff`,{agentId:_,docName:x,keptCount:S,err:t}),xe({status:`error`,diff:``,before:``,after:``,properties:he}))}),()=>{e=!0}},Ce=[_,x,S,C],t[1]=_,t[2]=C,t[3]=x,t[4]=S,t[5]=Se,t[6]=Ce):(Se=t[5],Ce=t[6]),(0,h.useEffect)(Se,Ce);let we;t[7]!==T.after||t[8]!==T.before||t[9]!==T.status?(we=T.status===`ready`?ue(T.before,T.after):null,t[7]=T.after,t[8]=T.before,t[9]=T.status,t[10]=we):we=t[10];let Te=we,Ee=T.status===`ready`?`${w}:${S}:${T.diff}`:``,E,D;t[11]===Ee?(E=t[12],D=t[13]):(E=()=>{let e=ve.current;if(Ee===``||!e)return;let t=!1,n=null,r,i,a=()=>{if(t)return;let r=e.querySelector(`[data-property-change]`)??e.querySelector(`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`)??ce(e)[0];if(!r)return;t=!0,n?.disconnect();let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;r.scrollIntoView({block:`center`,behavior:i?`auto`:`smooth`})},o=()=>{t||(r!==void 0&&clearTimeout(r),r=setTimeout(()=>{i!==void 0&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=requestAnimationFrame(a)})},120))};n=new MutationObserver(o),n.observe(e,{childList:!0,subtree:!0}),o();let s=setTimeout(()=>n?.disconnect(),5e3);return()=>{n?.disconnect(),r!==void 0&&clearTimeout(r),i!==void 0&&cancelAnimationFrame(i),clearTimeout(s)}},D=[Ee],t[11]=Ee,t[12]=E,t[13]=D),(0,h.useEffect)(E,D);let O,De;t[14]===S?(O=t[15],De=t[16]):(O=()=>{let e=e=>{if(e.key===`Escape`&&e.defaultPrevented||s())return;let t=e.target;t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)||(e.key===`Escape`?oe():e.key===`j`||e.key===`ArrowRight`?(e.preventDefault(),p(S+1)):(e.key===`k`||e.key===`ArrowLeft`)&&(e.preventDefault(),p(S-1)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},De=[S],t[14]=S,t[15]=O,t[16]=De),(0,h.useEffect)(O,De);let k,A,j,M,N,P,F,I,L,R;if(t[17]!==m||t[18]!==y||t[19]!==b||t[20]!==v||t[21]!==x||t[22]!==T.diff||t[23]!==T.properties.changes.length||t[24]!==T.properties.unparseable||t[25]!==T.status){let e=T.status===`ready`?de(T.diff):{additions:0,deletions:0},n=e.additions>0||e.deletions>0,r=T.properties.changes.length;k=T.properties.changes.length>0||T.properties.unparseable!==null,I=`absolute inset-0 z-20 flex flex-col bg-background`,L=`agent-diff-pane`,M=`flex flex-wrap items-center gap-x-2 gap-y-1.5 border-b border-border px-3 py-2`;let a;t[36]===m?a=t[37]:(a=m({id:`b18t0_`}),t[36]=m,t[37]=a);let o;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,g.jsx)(ie,{className:`size-4`}),t[38]=o):o=t[38];let s;t[39]===a?s=t[40]:(s=(0,g.jsx)(te,{asChild:!0,children:(0,g.jsx)(ee,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-close`,"aria-label":a,onClick:ge,children:o})}),t[39]=a,t[40]=s);let c;t[41]===m?c=t[42]:(c=m({id:`b18t0_`}),t[41]=m,t[42]=c);let l;t[43]===c?l=t[44]:(l=(0,g.jsx)(ne,{side:`bottom`,children:c}),t[43]=c,t[44]=l),t[45]!==s||t[46]!==l?(N=(0,g.jsxs)(re,{children:[s,l]}),t[45]=s,t[46]=l,t[47]=N):N=t[47];let u;t[48]===y?u=t[49]:(u={backgroundColor:y},t[48]=y,t[49]=u);let d;t[50]===b?d=t[51]:(d=(0,g.jsx)(ae,{icon:b,width:13,height:13}),t[50]=b,t[51]=d),t[52]!==u||t[53]!==d?(P=(0,g.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full text-white`,style:u,children:d}),t[52]=u,t[53]=d,t[54]=P):P=t[54];let f;t[55]===x?f=t[56]:(f=(0,g.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:x}),t[55]=x,t[56]=f);let p;t[57]===v?p=t[58]:(p=(0,g.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:v}),t[57]=v,t[58]=p),t[59]!==f||t[60]!==p?(F=(0,g.jsxs)(`div`,{className:`min-w-0 max-w-[14rem] shrink`,children:[f,p]}),t[59]=f,t[60]=p,t[61]=F):F=t[61],R=`ml-auto flex flex-wrap items-center justify-end gap-2`,t[62]===r?A=t[63]:(A=r>0&&(0,g.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,"data-testid":`agent-diff-property-stat`,children:(0,g.jsx)(i,{id:`UI0WPT`,values:{propertyCount:r}})}),t[62]=r,t[63]=A),j=n&&(0,g.jsxs)(`span`,{role:`img`,className:`shrink-0 text-xs tabular-nums`,"data-testid":`agent-diff-stat`,"aria-label":m({id:`8lwQlE`,values:{0:e.additions,1:e.deletions}}),children:[(0,g.jsxs)(`span`,{"aria-hidden":`true`,className:`text-emerald-600 dark:text-emerald-500`,children:[`+`,e.additions]}),` `,(0,g.jsxs)(`span`,{"aria-hidden":`true`,className:`text-red-600 dark:text-red-500`,children:[`−`,e.deletions]})]}),t[17]=m,t[18]=y,t[19]=b,t[20]=v,t[21]=x,t[22]=T.diff,t[23]=T.properties.changes.length,t[24]=T.properties.unparseable,t[25]=T.status,t[26]=k,t[27]=A,t[28]=j,t[29]=M,t[30]=N,t[31]=P,t[32]=F,t[33]=I,t[34]=L,t[35]=R}else k=t[26],A=t[27],j=t[28],M=t[29],N=t[30],P=t[31],F=t[32],I=t[33],L=t[34],R=t[35];let Oe;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=e=>{(e===`rendered`||e===`source`)&&ye(e)},t[64]=Oe):Oe=t[64];let z;t[65]===m?z=t[66]:(z=m({id:`ZW3mlR`}),t[65]=m,t[66]=z);let ke;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,g.jsx)(c,{value:`rendered`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-rendered`,children:(0,g.jsx)(i,{id:`4z_1j2`})}),t[67]=ke):ke=t[67];let Ae;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,g.jsx)(c,{value:`source`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-source`,children:(0,g.jsx)(i,{id:`wdxz7K`})}),t[68]=Ae):Ae=t[68];let B;t[69]!==w||t[70]!==z?(B=(0,g.jsxs)(l,{type:`single`,value:w,onValueChange:Oe,"aria-label":z,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 rounded-md bg-muted p-0.5 dark:bg-background`,children:[ke,Ae]}),t[69]=w,t[70]=z,t[71]=B):B=t[71];let V;t[72]!==m||t[73]!==r?(V=m(r?{id:`6iDEWA`}:{id:`170Js2`}),t[72]=m,t[73]=r,t[74]=V):V=t[74];let je=!r,H;t[75]===r?H=t[76]:(H=r?(0,g.jsx)(f,{className:`size-4`}):(0,g.jsx)(d,{className:`size-4`}),t[75]=r,t[76]=H);let U;t[77]!==o||t[78]!==V||t[79]!==je||t[80]!==H?(U=(0,g.jsx)(te,{asChild:!0,children:(0,g.jsx)(ee,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-toggle-panel`,"aria-label":V,"aria-expanded":je,onClick:o,children:H})}),t[77]=o,t[78]=V,t[79]=je,t[80]=H,t[81]=U):U=t[81];let W;t[82]!==m||t[83]!==r?(W=m(r?{id:`6iDEWA`}:{id:`170Js2`}),t[82]=m,t[83]=r,t[84]=W):W=t[84];let G;t[85]===W?G=t[86]:(G=(0,g.jsx)(ne,{side:`bottom`,children:W}),t[85]=W,t[86]=G);let K;t[87]!==U||t[88]!==G?(K=(0,g.jsxs)(re,{children:[U,G]}),t[87]=U,t[88]=G,t[89]=K):K=t[89];let q;t[90]!==A||t[91]!==j||t[92]!==B||t[93]!==K||t[94]!==R?(q=(0,g.jsxs)(`div`,{className:R,children:[A,j,B,K]}),t[90]=A,t[91]=j,t[92]=B,t[93]=K,t[94]=R,t[95]=q):q=t[95];let J;t[96]!==M||t[97]!==N||t[98]!==P||t[99]!==F||t[100]!==q?(J=(0,g.jsxs)(`div`,{className:M,children:[N,P,F,q]}),t[96]=M,t[97]=N,t[98]=P,t[99]=F,t[100]=q,t[101]=J):J=t[101];let Y;t[102]===T.status?Y=t[103]:(Y=T.status===`loading`&&(0,g.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,g.jsx)(u,{"aria-hidden":`true`,className:`size-3`}),(0,g.jsx)(i,{id:`38foVZ`})]}),t[102]=T.status,t[103]=Y);let X;t[104]===T.status?X=t[105]:(X=T.status===`error`&&(0,g.jsx)(`p`,{className:`px-4 py-3 text-xs text-destructive`,children:(0,g.jsx)(i,{id:`vvWZnu`})}),t[104]=T.status,t[105]=X);let Z;t[106]!==T.properties||t[107]!==T.status?(Z=T.status===`ready`&&(0,g.jsx)(fe,{delta:T.properties}),t[106]=T.properties,t[107]=T.status,t[108]=Z):Z=t[108];let Q;t[109]!==k||t[110]!==S||t[111]!==w||t[112]!==Te||t[113]!==T.after||t[114]!==T.diff||t[115]!==T.status?(Q=T.status===`ready`&&(w===`rendered`&&Te?.ok?(0,g.jsx)(le,{diff:Te}):T.diff===``?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`p`,{className:`border-b border-border px-4 py-2 text-xs text-muted-foreground italic`,children:S===0?(0,g.jsx)(i,{id:`klPS-L`}):k?(0,g.jsx)(i,{id:`15ZHCt`}):(0,g.jsx)(i,{id:`k7Hoig`})}),(0,g.jsx)(`pre`,{className:`whitespace-pre-wrap px-4 py-3 font-mono text-xs text-foreground/90`,children:T.after})]}):(0,g.jsx)(h.Suspense,{fallback:(0,g.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,g.jsx)(u,{"aria-hidden":`true`,className:`size-3`}),(0,g.jsx)(i,{id:`EDm3wJ`})]}),children:(0,g.jsx)(me,{diff:T.diff,viewType:`unified`})})),t[109]=k,t[110]=S,t[111]=w,t[112]=Te,t[113]=T.after,t[114]=T.diff,t[115]=T.status,t[116]=Q):Q=t[116];let $;t[117]!==Y||t[118]!==X||t[119]!==Z||t[120]!==Q?($=(0,g.jsxs)(`div`,{ref:ve,className:`min-h-0 flex-1 overflow-auto subtle-scrollbar`,children:[Y,X,Z,Q]}),t[117]=Y,t[118]=X,t[119]=Z,t[120]=Q,t[121]=$):$=t[121];let Me;return t[122]!==I||t[123]!==L||t[124]!==J||t[125]!==$?(Me=(0,g.jsxs)(`div`,{className:I,"data-testid":L,children:[J,$]}),t[122]=I,t[123]=L,t[124]=J,t[125]=$,t[126]=Me):Me=t[126],Me}function ge(){return oe()}function _e(){return new m(_)}export{v as AgentDiffPane};
|
package/dist/public/assets/{BugReportHistoryDialog-1jJf6SqH.js → BugReportHistoryDialog-CaS4r08X.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-BUgB2tll.js";import{n as t}from"./dist-Nvb76hAm.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{a as r,c as i,i as a,n as o,s,t as c}from"./dialog-
|
|
1
|
+
import{t as e}from"./jsx-runtime-BUgB2tll.js";import{n as t}from"./dist-Nvb76hAm.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{a as r,c as i,i as a,n as o,s,t as c}from"./dialog-BH80AfFt.js";import{t as l}from"./BugReportHistory-BpVVcA5z.js";var u=n(),d=e();function f(e){let n=(0,u.c)(11),{open:f,onOpenChange:p,onReportABug:m}=e,h;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,d.jsx)(i,{children:(0,d.jsx)(t,{id:`QHCx0c`})}),n[0]=h):h=n[0];let g;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,d.jsxs)(s,{children:[h,(0,d.jsx)(r,{children:(0,d.jsx)(t,{id:`5ss1kT`})})]}),n[1]=g):g=n[1];let _;n[2]!==m||n[3]!==f?(_=f?(0,d.jsx)(l,{onReportABug:m}):null,n[2]=m,n[3]=f,n[4]=_):_=n[4];let v;n[5]===_?v=n[6]:(v=(0,d.jsxs)(a,{className:`sm:max-w-md`,children:[g,(0,d.jsx)(o,{className:`max-h-[60vh] overflow-y-auto`,children:_})]}),n[5]=_,n[6]=v);let y;return n[7]!==p||n[8]!==f||n[9]!==v?(y=(0,d.jsx)(c,{open:f,onOpenChange:p,children:v}),n[7]=p,n[8]=f,n[9]=v,n[10]=y):y=n[10],y}export{f as default};
|
|
@@ -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"./button-CA0dewJJ.js";import{n as s,r as c,t as l}from"./collapsible-COrqeoHr.js";import{a as u,c as d,i as f,n as ee,o as p,s as m,t as h}from"./dialog-
|
|
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-CA0dewJJ.js";import{n as s,r as c,t as l}from"./collapsible-COrqeoHr.js";import{a as u,c as d,i as f,n as ee,o as p,s as m,t as h}from"./dialog-BH80AfFt.js";import{t as g}from"./checkbox-Bi7zk4c5.js";import{n as _}from"./dist-CuH7ikCn.js";import{t as te}from"./chevron-right-BVvjaUfh.js";import{t as ne}from"./input-a0WHtxX3.js";import{a as re,n as ie,o as ae,r as v,t as oe}from"./project-paths-DQt8hUFo.js";import{t as se}from"./textarea-BoMa_3jF.js";var ce=a(),y=e(n(),1),b=t(),le=750,ue={root:{id:`ZWolSV`},home:{id:`_RcqUM`},"home-documents":{id:`of3tF-`},"home-desktop":{id:`vfWA_g`},"home-downloads":{id:`wlwXUk`},"volumes-mount":{id:`nMSYz5`},"drive-root":{id:`M3ytY_`}},x={error:e=>_.error(e)};function S(e){let t=(0,ce.c)(9),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{store:r,toast:i,payload:a}=n,o=r===void 0?v:r,s=i===void 0?x:i,c;t[2]!==a||t[3]!==o?(c=a??o.getSnapshot(),t[2]=a,t[3]=o,t[4]=c):c=t[4];let l=c;if(!l)return null;let u;return t[5]!==l||t[6]!==o||t[7]!==s?(u=(0,b.jsx)(de,{payload:l,store:o,toast:s}),t[5]=l,t[6]=o,t[7]=s,t[8]=u):u=t[8],u}function de(e){let t=(0,ce.c)(125),{payload:n,store:a,toast:_}=e,{_:v}=i(),x=(0,y.useId)(),[S,de]=(0,y.useState)(n.defaultContentDir),[C,he]=(0,y.useState)(``),ge;t[0]===n.editorOptions?ge=t[1]:(ge=()=>new Set(n.editorOptions.map(pe)),t[0]=n.editorOptions,t[1]=ge);let[w,_e]=(0,y.useState)(ge),[T,ve]=(0,y.useState)(re),[ye,be]=(0,y.useState)(null),[E,xe]=(0,y.useState)(!1),[D,Se]=(0,y.useState)(null),[Ce,we]=(0,y.useState)(!1),Te,Ee;t[2]!==v||t[3]!==S?(Te=()=>{if(!oe(S)){be(null);return}let e=!1,t=setTimeout(()=>{let t=window.okDesktop;t&&t.onboarding.probeContent({contentDir:S}).then(t=>{e||be(t)}).catch(t=>{e||be({ok:!1,error:t instanceof Error?t.message:v({id:`snrVQ7`})})})},le);return()=>{e=!0,clearTimeout(t)}},Ee=[S,v],t[2]=v,t[3]=S,t[4]=Te,t[5]=Ee):(Te=t[4],Ee=t[5]),(0,y.useEffect)(Te,Ee);let De;t[6]===S?De=t[7]:(De=oe(S),t[6]=S,t[7]=De);let O=De,k=E||!O,Oe=Ce||!O,ke=n.projectDir,Ae;t[8]!==n.pickedPath||t[9]!==n.projectDir?(Ae=ie(n.projectDir,n.pickedPath)??n.pickedPath,t[8]=n.pickedPath,t[9]=n.projectDir,t[10]=Ae):Ae=t[10];let je=Ae,Me;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(Me=function(e){_e(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[11]=Me):Me=t[11];let Ne=Me,Pe;t[12]!==v||t[13]!==n.projectDir?(Pe=async function(){let e=window.okDesktop;if(!e)return;let t;try{t=await e.dialog.openFolder({defaultPath:n.projectDir})}catch(e){let t=e;Se(t instanceof Error?t.message:v({id:`P-ye9o`}));return}if(t===null)return;let r=ie(n.projectDir,t);if(r===null){Se(v({id:`UTZ97u`}));return}Se(null),de(r)},t[12]=v,t[13]=n.projectDir,t[14]=Pe):Pe=t[14];let Fe=Pe,Ie;t[15]!==C||t[16]!==S||t[17]!==w||t[18]!==T||t[19]!==a||t[20]!==_?(Ie=async function(){xe(!0);let e=await a.confirm({initGit:!0,contentDir:S,additionalIgnores:C,editorIds:Array.from(w),sharing:T});e.ok||(_.error(e.error),xe(!1))},t[15]=C,t[16]=S,t[17]=w,t[18]=T,t[19]=a,t[20]=_,t[21]=Ie):Ie=t[21];let Le=Ie,Re;t[22]!==Le||t[23]!==k?(Re=function(e){e.preventDefault(),!k&&Le()},t[22]=Le,t[23]=k,t[24]=Re):Re=t[24];let ze=Re,Be;t[25]!==a||t[26]!==_?(Be=async function(){xe(!0);let e=await a.cancel();e.ok||(_.error(e.error),xe(!1))},t[25]=a,t[26]=_,t[27]=Be):Be=t[27];let A=Be,Ve;t[28]!==E||t[29]!==A?(Ve=function(e){!e&&!E&&A()},t[28]=E,t[29]=A,t[30]=Ve):Ve=t[30];let He=Ve,Ue;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=(0,b.jsx)(d,{children:(0,b.jsx)(r,{id:`seeS6l`})}),t[31]=Ue):Ue=t[31];let We;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(We=(0,b.jsxs)(m,{children:[Ue,(0,b.jsx)(u,{children:(0,b.jsx)(r,{id:`HqiZvw`,components:{0:(0,b.jsx)(`code`,{})}})})]}),t[32]=We):We=t[32];let j;t[33]!==n.gitRootPromoted||t[34]!==je||t[35]!==ke?(j=n.gitRootPromoted?(0,b.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,b.jsx)(r,{id:`Y1kX2z`,values:{projectDir:ke,pickedRelative:je},components:{0:(0,b.jsx)(`code`,{}),1:(0,b.jsx)(`code`,{}),2:(0,b.jsx)(`code`,{}),3:(0,b.jsx)(`code`,{}),4:(0,b.jsx)(`code`,{})}})}):null,t[33]=n.gitRootPromoted,t[34]=je,t[35]=ke,t[36]=j):j=t[36];let M;t[37]!==v||t[38]!==n.warnings?(M=n.warnings.length>0?(0,b.jsx)(`div`,{role:`alert`,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`,children:n.warnings.map(e=>(0,b.jsx)(`p`,{className:`mb-1 last:mb-0`,children:v(ue[e.kind])},e.kind))}):null,t[37]=v,t[38]=n.warnings,t[39]=M):M=t[39];let N;t[40]!==O||t[41]!==ye?(N=O?(0,b.jsx)(me,{probe:ye}):null,t[40]=O,t[41]=ye,t[42]=N):N=t[42];let P;t[43]!==E||t[44]!==x||t[45]!==T?(P=(0,b.jsx)(ae,{idPrefix:x,testIdPrefix:`consent-sharing`,value:T,onValueChange:ve,disabled:E}),t[43]=E,t[44]=x,t[45]=T,t[46]=P):P=t[46];let Ge;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,b.jsxs)(c,{className:`group flex w-full items-center justify-between gap-2 px-3 py-2 text-sm font-medium hover:bg-muted/50`,"data-testid":`consent-advanced-trigger`,children:[(0,b.jsx)(r,{id:`VNgKZz`}),(0,b.jsx)(te,{className:`size-4 transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`,"aria-hidden":!0})]}),t[47]=Ge):Ge=t[47];let Ke;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=(0,b.jsx)(`label`,{htmlFor:`consent-content-dir`,className:`text-sm font-medium`,children:(0,b.jsx)(r,{id:`ll2yNl`})}),t[48]=Ke):Ke=t[48];let qe;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(qe=e=>{de(e.target.value),Se(null)},t[49]=qe):qe=t[49];let Je=!O,Ye=D===null?O?void 0:`consent-content-dir-error`:`consent-content-dir-browse-error`,F;t[50]!==E||t[51]!==S||t[52]!==Je||t[53]!==Ye?(F=(0,b.jsx)(ne,{id:`consent-content-dir`,value:S,onChange:qe,disabled:E,"aria-invalid":Je,"aria-describedby":Ye,"data-testid":`consent-content-dir`,className:`flex-1`}),t[50]=E,t[51]=S,t[52]=Je,t[53]=Ye,t[54]=F):F=t[54];let I;t[55]===Fe?I=t[56]:(I=()=>void Fe(),t[55]=Fe,t[56]=I);let Xe;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=(0,b.jsx)(r,{id:`O2UpM1`}),t[57]=Xe):Xe=t[57];let L;t[58]!==E||t[59]!==I?(L=(0,b.jsx)(o,{type:`button`,variant:`outline`,disabled:E,onClick:I,"data-testid":`consent-content-dir-browse`,children:Xe}),t[58]=E,t[59]=I,t[60]=L):L=t[60];let R;t[61]!==F||t[62]!==L?(R=(0,b.jsxs)(`div`,{className:`flex items-stretch gap-2`,children:[F,L]}),t[61]=F,t[62]=L,t[63]=R):R=t[63];let z;t[64]!==D||t[65]!==O?(z=D===null?O?null:(0,b.jsx)(`p`,{id:`consent-content-dir-error`,className:`text-1sm text-destructive`,"data-testid":`consent-content-dir-error`,children:(0,b.jsx)(r,{id:`U5Spo9`})}):(0,b.jsx)(`p`,{id:`consent-content-dir-browse-error`,className:`text-1sm text-destructive`,"data-testid":`consent-content-dir-browse-error`,children:D}),t[64]=D,t[65]=O,t[66]=z):z=t[66];let B;t[67]!==R||t[68]!==z?(B=(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[Ke,R,z]}),t[67]=R,t[68]=z,t[69]=B):B=t[69];let Ze;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,b.jsx)(`label`,{htmlFor:`consent-additional-ignores`,className:`text-sm font-medium`,children:(0,b.jsx)(r,{id:`3zyg_A`})}),t[70]=Ze):Ze=t[70];let Qe;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=e=>he(e.target.value),t[71]=Qe):Qe=t[71];let V;t[72]!==C||t[73]!==E?(V=(0,b.jsx)(se,{id:`consent-additional-ignores`,value:C,onChange:Qe,disabled:E,placeholder:`tmp/
|
|
2
2
|
*.draft.md`,rows:3,"data-testid":`consent-additional-ignores`}),t[72]=C,t[73]=E,t[74]=V):V=t[74];let $e;t[75]===Symbol.for(`react.memo_cache_sentinel`)?($e=(0,b.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,b.jsx)(r,{id:`aE2_XM`,components:{0:(0,b.jsx)(`code`,{})}})}),t[75]=$e):$e=t[75];let H;t[76]===V?H=t[77]:(H=(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[Ze,V,$e]}),t[76]=V,t[77]=H);let et;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(et=(0,b.jsx)(`legend`,{className:`text-sm font-medium`,children:(0,b.jsx)(r,{id:`0YEbfk`})}),t[78]=et):et=t[78];let tt;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,b.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,b.jsx)(r,{id:`SfxQX8`})}),t[79]=tt):tt=t[79];let U;if(t[80]!==E||t[81]!==w||t[82]!==n.editorOptions){let e;t[84]!==E||t[85]!==w?(e=e=>{let t=`consent-editor-${e.id}-cb`;return(0,b.jsxs)(`label`,{htmlFor:t,className:`flex items-center gap-2 text-sm`,children:[(0,b.jsx)(g,{id:t,checked:w.has(e.id),onCheckedChange:()=>Ne(e.id),disabled:E,"data-testid":`consent-editor-${e.id}`}),(0,b.jsx)(`span`,{children:e.label}),(0,b.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`consent-editor-${e.id}-scope`,children:e.hasProjectConfig?e.hasUserConfig??!0?(0,b.jsx)(r,{id:`cKjLuT`}):(0,b.jsx)(r,{id:`fR-Kdc`}):(0,b.jsx)(r,{id:`nYKerc`})})]},e.id)},t[84]=E,t[85]=w,t[86]=e):e=t[86],U=n.editorOptions.map(e),t[80]=E,t[81]=w,t[82]=n.editorOptions,t[83]=U}else U=t[83];let W;t[87]===U?W=t[88]:(W=(0,b.jsxs)(`fieldset`,{className:`flex flex-col space-y-2 pb-2`,children:[et,tt,U]}),t[87]=U,t[88]=W);let G;t[89]!==B||t[90]!==H||t[91]!==W?(G=(0,b.jsxs)(s,{className:`space-y-6 border-t border-border px-3 py-4`,children:[B,H,W]}),t[89]=B,t[90]=H,t[91]=W,t[92]=G):G=t[92];let K;t[93]!==Oe||t[94]!==G?(K=(0,b.jsxs)(l,{open:Oe,onOpenChange:we,className:`rounded-md border border-border`,"data-testid":`consent-advanced`,children:[Ge,G]}),t[93]=Oe,t[94]=G,t[95]=K):K=t[95];let q;t[96]!==x||t[97]!==ze||t[98]!==N||t[99]!==P||t[100]!==K?(q=(0,b.jsxs)(`form`,{id:x,onSubmit:ze,"data-testid":`consent-form`,className:`space-y-6`,children:[N,P,K]}),t[96]=x,t[97]=ze,t[98]=N,t[99]=P,t[100]=K,t[101]=q):q=t[101];let J;t[102]!==j||t[103]!==M||t[104]!==q?(J=(0,b.jsxs)(ee,{className:`space-y-6`,children:[j,M,q]}),t[102]=j,t[103]=M,t[104]=q,t[105]=J):J=t[105];let Y;t[106]===A?Y=t[107]:(Y=()=>void A(),t[106]=A,t[107]=Y);let nt;t[108]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,b.jsx)(r,{id:`dEgA5A`}),t[108]=nt):nt=t[108];let X;t[109]!==E||t[110]!==Y?(X=(0,b.jsx)(o,{type:`button`,variant:`outline`,className:`font-mono uppercase`,onClick:Y,disabled:E,"data-testid":`consent-cancel`,children:nt}),t[109]=E,t[110]=Y,t[111]=X):X=t[111];let rt;t[112]===Symbol.for(`react.memo_cache_sentinel`)?(rt=(0,b.jsx)(r,{id:`RDjuBN`}),t[112]=rt):rt=t[112];let Z;t[113]!==x||t[114]!==k?(Z=(0,b.jsx)(o,{type:`submit`,form:x,disabled:k,"data-testid":`consent-start`,children:rt}),t[113]=x,t[114]=k,t[115]=Z):Z=t[115];let Q;t[116]!==X||t[117]!==Z?(Q=(0,b.jsxs)(p,{children:[X,Z]}),t[116]=X,t[117]=Z,t[118]=Q):Q=t[118];let $;t[119]!==J||t[120]!==Q?($=(0,b.jsxs)(f,{className:`sm:max-w-lg`,onOpenAutoFocus:fe,children:[We,J,Q]}),t[119]=J,t[120]=Q,t[121]=$):$=t[121];let it;return t[122]!==He||t[123]!==$?(it=(0,b.jsx)(h,{open:!0,onOpenChange:He,children:$}),t[122]=He,t[123]=$,t[124]=it):it=t[124],it}function fe(e){e.preventDefault(),e.currentTarget.querySelector(`[role="radio"]`)?.focus()}function pe(e){return e.id}function me(e){let t=(0,ce.c)(24),{probe:n}=e,{_:a}=i();if(n===null){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`consent-preview`,children:(0,b.jsx)(r,{id:`DiFKSL`})}),t[0]=e):e=t[0],e}if(!n.ok){let e=n.error,i;return t[1]===e?i=t[2]:(i=(0,b.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`consent-preview`,children:(0,b.jsx)(r,{id:`9fvog2`,values:{errorDetail:e}})}),t[1]=e,t[2]=i),i}let o=n.truncated?`≥ 50,000`:String(n.count),u;t[3]!==a||t[4]!==o?(u=a({id:`MV-Dkb`,values:{countDisplay:o}}),t[3]=a,t[4]=o,t[5]=u):u=t[5];let d=u;if(n.sample.length===0){let e;return t[6]===d?e=t[7]:(e=(0,b.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`consent-preview`,children:d}),t[6]=d,t[7]=e),e}let f=n.truncated?null:n.count-n.sample.length,ee;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,b.jsx)(te,{className:`size-3 transition-transform motion-reduce:transition-none`,"aria-hidden":!0}),t[8]=ee):ee=t[8];let p;t[9]===d?p=t[10]:(p=(0,b.jsxs)(c,{className:`flex items-center gap-1 text-1sm text-muted-foreground hover:text-foreground [&[data-state=open]>svg]:rotate-90`,children:[ee,(0,b.jsx)(`span`,{children:d})]}),t[9]=d,t[10]=p);let m;t[11]===n.sample?m=t[12]:(m=n.sample.map(C),t[11]=n.sample,t[12]=m);let h;t[13]===m?h=t[14]:(h=(0,b.jsx)(`ul`,{className:`space-y-1.5 font-mono`,children:m}),t[13]=m,t[14]=h);let g;t[15]!==n.truncated||t[16]!==f?(g=n.truncated||f!==null&&f>0?(0,b.jsx)(`p`,{className:`mt-1 italic`,children:n.truncated?(0,b.jsx)(r,{id:`5wV2qQ`}):(0,b.jsx)(r,{id:`nNYV3Y`,values:{remaining:f}})}):null,t[15]=n.truncated,t[16]=f,t[17]=g):g=t[17];let _;t[18]!==h||t[19]!==g?(_=(0,b.jsxs)(s,{className:`pt-1 pl-4 text-1sm text-muted-foreground`,children:[h,g]}),t[18]=h,t[19]=g,t[20]=_):_=t[20];let ne;return t[21]!==p||t[22]!==_?(ne=(0,b.jsxs)(l,{"data-testid":`consent-preview`,children:[p,_]}),t[21]=p,t[22]=_,t[23]=ne):ne=t[23],ne}function C(e){return(0,b.jsx)(`li`,{children:e},e)}export{S as default};
|