@intent-hq/web 2.313.0 → 2.313.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/package.json +1 -1
- package/web/app/immutable/chunks/{B-agcRbG.js → 1wCbR4ud.js} +1 -1
- package/web/app/immutable/chunks/{CNMS2KOf.js → 4wFlAApS.js} +1 -1
- package/web/app/immutable/chunks/{BNHRvqeQ.js → 6rzwTXJx.js} +1 -1
- package/web/app/immutable/chunks/{Bops7MsY.js → A3beYjJS.js} +4 -4
- package/web/app/immutable/chunks/{hcpthRFf.js → AF5xKPfV.js} +1 -1
- package/web/app/immutable/chunks/{V553m0MO.js → AHQMxoVk.js} +1 -1
- package/web/app/immutable/chunks/{tuNJ429u.js → B1YnvfKo.js} +1 -1
- package/web/app/immutable/chunks/{C5c-LdLT.js → B2st7VbN.js} +1 -1
- package/web/app/immutable/chunks/{Cw6SlTJ6.js → B3W2oJ3u.js} +1 -1
- package/web/app/immutable/chunks/{BFETMHTz.js → B6Eksue8.js} +2 -2
- package/web/app/immutable/chunks/{BEVpCf6b.js → B6QJA3k0.js} +1 -1
- package/web/app/immutable/chunks/{CxPdVa60.js → B88eFHaH.js} +1 -1
- package/web/app/immutable/chunks/{h4HcKsDl.js → BAssmU5H.js} +1 -1
- package/web/app/immutable/chunks/{n2a_8s79.js → BESrHe_0.js} +1 -1
- package/web/app/immutable/chunks/{C5EEwI0-.js → BIZcuYRW.js} +2 -2
- package/web/app/immutable/chunks/{C2L4VLjE.js → BOQCK4ni.js} +1 -1
- package/web/app/immutable/chunks/{CYtxGPAf.js → BRIkzo-E.js} +1 -1
- package/web/app/immutable/chunks/{B_ifqSee.js → BW6fyv0T.js} +6 -6
- package/web/app/immutable/chunks/{C3X16aYc.js → B_-1t0b5.js} +1 -1
- package/web/app/immutable/chunks/{BfxxnTgV.js → Bc3_ahSr.js} +1 -1
- package/web/app/immutable/chunks/{04XFWhBd.js → Bfc094Ub.js} +1 -1
- package/web/app/immutable/chunks/{28aV1Wzl.js → BjqGlL_Y.js} +1 -1
- package/web/app/immutable/chunks/{DhXr1ZqD.js → BssmMBl2.js} +1 -1
- package/web/app/immutable/chunks/{CHtSQ3Rg.js → Bu6sHonm.js} +1 -1
- package/web/app/immutable/chunks/{CnfYogWn.js → By8e6LYt.js} +1 -1
- package/web/app/immutable/chunks/{DuRHazc8.js → C-fnz5X4.js} +1 -1
- package/web/app/immutable/chunks/{CPzgXxXu.js → C-li4cfO.js} +1 -1
- package/web/app/immutable/chunks/{Cnihm-Nc.js → C2Cq4c9l.js} +1 -1
- package/web/app/immutable/chunks/{jvw1Fn3k.js → C2m8Iivv.js} +1 -1
- package/web/app/immutable/chunks/{CAK2j9T_.js → C6XSZJri.js} +1 -1
- package/web/app/immutable/chunks/{2bp47GFs.js → C6aPQebU.js} +1 -1
- package/web/app/immutable/chunks/{DBfJXlLJ.js → C6gBBEr6.js} +1 -1
- package/web/app/immutable/chunks/{DwdStl3H.js → C6krgOsR.js} +4 -4
- package/web/app/immutable/chunks/{BiMGZT5w.js → C80u9j_3.js} +1 -1
- package/web/app/immutable/chunks/{B9F8nd-t.js → C8PuI333.js} +1 -1
- package/web/app/immutable/chunks/{BwK5Bace.js → CA7UZgrf.js} +1 -1
- package/web/app/immutable/chunks/{DvExZ34Y.js → CAn8DYJP.js} +1 -1
- package/web/app/immutable/chunks/{B1Rrvp0b.js → CBTot2K1.js} +1 -1
- package/web/app/immutable/chunks/{i92hRJko.js → CCCBFmfe.js} +3 -3
- package/web/app/immutable/chunks/{CM7ZaQP_.js → CE8vXfAM.js} +1 -1
- package/web/app/immutable/chunks/{CJCZCJxO.js → CG-371Y6.js} +1 -1
- package/web/app/immutable/chunks/{okmbexJZ.js → CICEz2Qq.js} +1 -1
- package/web/app/immutable/chunks/{DeBw56y4.js → CJtH5G9P.js} +1 -1
- package/web/app/immutable/chunks/{DZuInc-o.js → CKH-l4ig.js} +1 -1
- package/web/app/immutable/chunks/{sLnx1Tu5.js → CKWaKOqs.js} +1 -1
- package/web/app/immutable/chunks/{CPfTSiRI.js → CMvHzajx.js} +1 -1
- package/web/app/immutable/chunks/{Dt9TrzFG.js → CN_VK1iL.js} +1 -1
- package/web/app/immutable/chunks/{B3nB6DWs.js → COpjcilg.js} +1 -1
- package/web/app/immutable/chunks/{6uLD17LP.js → CP06IBS7.js} +1 -1
- package/web/app/immutable/chunks/{LoSFphII.js → CQMd4GmI.js} +1 -1
- package/web/app/immutable/chunks/{X-W6j8OD.js → CQbq623l.js} +1 -1
- package/web/app/immutable/chunks/{B721JIop.js → CTX5Fuc9.js} +2 -2
- package/web/app/immutable/chunks/{DaWdrOD0.js → CTfHCA2Y.js} +1 -1
- package/web/app/immutable/chunks/{CgAzfuNr.js → CUPAS0zd.js} +1 -1
- package/web/app/immutable/chunks/{DKhv0I45.js → CW1tBVLY.js} +1 -1
- package/web/app/immutable/chunks/{C_73TJPq.js → CWaCCzEn.js} +1 -1
- package/web/app/immutable/chunks/{C8reKsm7.js → CXNySl0c.js} +1 -1
- package/web/app/immutable/chunks/{DPcbMgdd.js → CYmZhCDN.js} +1 -1
- package/web/app/immutable/chunks/{DEfnfMIS.js → C_KYY7ZK.js} +1 -1
- package/web/app/immutable/chunks/{DgJXm20t.js → Cb6WrSKY.js} +1 -1
- package/web/app/immutable/chunks/{DiVHUgRZ.js → Cbh1BCiS.js} +2 -2
- package/web/app/immutable/chunks/{DZ64qqlL.js → CbpiaYyP.js} +1 -1
- package/web/app/immutable/chunks/{BXMFG8vW.js → CcGPnEzl.js} +1 -1
- package/web/app/immutable/chunks/{B6oQfzis.js → CelhKzDn.js} +1 -1
- package/web/app/immutable/chunks/{BDICjj7k.js → ClfTOQ5L.js} +1 -1
- package/web/app/immutable/chunks/{CVvtz86e.js → CsTPrgDm.js} +3 -3
- package/web/app/immutable/chunks/{DJCJ21BX.js → Ctl9Ux7T.js} +1 -1
- package/web/app/immutable/chunks/{B7-651e2.js → CxO_9nE4.js} +1 -1
- package/web/app/immutable/chunks/{BCDWZbwh.js → CzrG_lpv.js} +1 -1
- package/web/app/immutable/chunks/{CDE88Tgk.js → D-8WC0DU.js} +1 -1
- package/web/app/immutable/chunks/{B-rSL5ZP.js → D2uybU7F.js} +2 -2
- package/web/app/immutable/chunks/{OS5fDMId.js → D47PZJI_.js} +1 -1
- package/web/app/immutable/chunks/{D_uOXHFE.js → D4qqUzAr.js} +1 -1
- package/web/app/immutable/chunks/{kRmfkT9J.js → D5XH3yqM.js} +1 -1
- package/web/app/immutable/chunks/{77JHYRqp.js → D62gE1G0.js} +1 -1
- package/web/app/immutable/chunks/{D0NG9Gzz.js → D84mJH5u.js} +1 -1
- package/web/app/immutable/chunks/{BGYaMCAp.js → DAtBKOQq.js} +1 -1
- package/web/app/immutable/chunks/{ldCNaZ5F.js → DBUJXdXR.js} +1 -1
- package/web/app/immutable/chunks/{2g3BKwo_.js → DChetNRi.js} +2 -2
- package/web/app/immutable/chunks/{BN6Sv1MY.js → DESxr5Rj.js} +1 -1
- package/web/app/immutable/chunks/{Cpw4G06I.js → DL9BUVq-.js} +1 -1
- package/web/app/immutable/chunks/{xlntbOPQ.js → DNYGh_FV.js} +1 -1
- package/web/app/immutable/chunks/{CKJYXvLT.js → DOnT_3WY.js} +1 -1
- package/web/app/immutable/chunks/{C4XQStEU.js → DPG0D59v.js} +1 -1
- package/web/app/immutable/chunks/{D0tEEJ7X.js → DQNmQX9F.js} +1 -1
- package/web/app/immutable/chunks/{B9pAuhbK.js → DSOeLuN2.js} +1 -1
- package/web/app/immutable/chunks/{BKTydVIY.js → DUdpP1ED.js} +1 -1
- package/web/app/immutable/chunks/{YH3VI7O_.js → DUrqH6OL.js} +1 -1
- package/web/app/immutable/chunks/{BgUzpkp7.js → DWccAyE3.js} +1 -1
- package/web/app/immutable/chunks/{DPiGMYKs.js → DYrH45vr.js} +1 -1
- package/web/app/immutable/chunks/{Dxpr5NqS.js → DgfdSIWo.js} +1 -1
- package/web/app/immutable/chunks/{DqTygHNa.js → DkI_jPOw.js} +4 -4
- package/web/app/immutable/chunks/{DqLOhjhM.js → DlKVdWHt.js} +1 -1
- package/web/app/immutable/chunks/{gqVNwlAV.js → DulsjrO4.js} +1 -1
- package/web/app/immutable/chunks/{DfTvRpFp.js → Dvil1FCS.js} +1 -1
- package/web/app/immutable/chunks/{DuVelotc.js → DwPGocEY.js} +2 -2
- package/web/app/immutable/chunks/{BM7ZHc1t.js → DwgP_YcK.js} +1 -1
- package/web/app/immutable/chunks/{BAQDI3wv.js → DxZSyekB.js} +1 -1
- package/web/app/immutable/chunks/{BLDT4lze.js → Dz6YK0K2.js} +1 -1
- package/web/app/immutable/chunks/{BBRz8JFJ.js → HWP1BG2L.js} +1 -1
- package/web/app/immutable/chunks/{C58wlt4Q.js → LSDVwgG8.js} +2 -2
- package/web/app/immutable/chunks/{BZ90Gl9e.js → MED7rLah.js} +1 -1
- package/web/app/immutable/chunks/{BlfjnWuH.js → MgJqQwQp.js} +1 -1
- package/web/app/immutable/chunks/{DCcgbj-g.js → NYwlcfYt.js} +1 -1
- package/web/app/immutable/chunks/{CRgLy9Dv.js → OpYhygEs.js} +1 -1
- package/web/app/immutable/chunks/{BFpzDysH.js → TP4sXUzS.js} +1 -1
- package/web/app/immutable/chunks/{IB-HmS7d.js → ZUZF8K3P.js} +1 -1
- package/web/app/immutable/chunks/{BR8jrnEs.js → _bllxFVr.js} +1 -1
- package/web/app/immutable/chunks/{KFwqetYG.js → a6K5_NPk.js} +1 -1
- package/web/app/immutable/chunks/{P4NanOkc.js → dX_oN6Xt.js} +1 -1
- package/web/app/immutable/chunks/{cUCU_6OD.js → gsqPz4Y0.js} +1 -1
- package/web/app/immutable/chunks/{CCIxcA5l.js → jnmyog2T.js} +1 -1
- package/web/app/immutable/chunks/{BkKnMUvE.js → jq7ACadW.js} +1 -1
- package/web/app/immutable/chunks/{um4u3A9l.js → kdf0l6Z-.js} +1 -1
- package/web/app/immutable/chunks/{CEWfqweJ.js → nHQ6ExVj.js} +1 -1
- package/web/app/immutable/chunks/{Bpy6Muvw.js → q4Mp6azq.js} +4 -4
- package/web/app/immutable/chunks/{CatH1hIe.js → qIh42_HI.js} +1 -1
- package/web/app/immutable/chunks/{D6DsI_Sr.js → qcgLBz2O.js} +1 -1
- package/web/app/immutable/chunks/{DE32xZOO.js → qr2Z9jBR.js} +1 -1
- package/web/app/immutable/chunks/{DFzMoFQx.js → sg8Cer3T.js} +3 -3
- package/web/app/immutable/chunks/{BdetxH0g.js → tSV1knJu.js} +1 -1
- package/web/app/immutable/chunks/{PTzYQcOR.js → usUeYWMe.js} +1 -1
- package/web/app/immutable/chunks/{CYlqp1HL.js → x8WBzABF.js} +6 -6
- package/web/app/immutable/chunks/{DKPwGUzq.js → xfGEIVf6.js} +1 -1
- package/web/app/immutable/chunks/{CCxcLQdk.js → y_yPvfwh.js} +1 -1
- package/web/app/immutable/entry/{app.Co8E4L03.js → app.BlqNT7Cr.js} +2 -2
- package/web/app/immutable/entry/start.DaNUqzZq.js +1 -0
- package/web/app/immutable/nodes/{0.BucKx3Zo.js → 0.ShO9PneW.js} +1 -1
- package/web/app/immutable/nodes/{1.-v_Vj9ip.js → 1.CWY9gUhn.js} +1 -1
- package/web/app/immutable/nodes/{10.BnlxMSMI.js → 10.BPcvGGhE.js} +1 -1
- package/web/app/immutable/nodes/{14.Ca9GXwJ0.js → 14.C46jjudj.js} +1 -1
- package/web/app/immutable/nodes/{16.Dk1EKS3B.js → 16.DxDrMp3A.js} +2 -2
- package/web/app/immutable/nodes/{2.Bazc0fR2.js → 2.BY4xMtJS.js} +3 -3
- package/web/app/immutable/nodes/{3.CCsh91Fv.js → 3.RPzUk4Sw.js} +1 -1
- package/web/app/immutable/nodes/{4.C_FHoeDU.js → 4.ZFgOw7Ux.js} +1 -1
- package/web/app/immutable/nodes/{5.DegIKxsI.js → 5.BKaPpN7j.js} +1 -1
- package/web/app/immutable/nodes/{6.F6OlLFwi.js → 6.BqCf3vb3.js} +1 -1
- package/web/app/immutable/nodes/{7.quuP6x8b.js → 7.CJYSYpjI.js} +1 -1
- package/web/app/immutable/nodes/{8.xtRgDwRj.js → 8.B_FmoLB7.js} +2 -2
- package/web/app/immutable/nodes/{9.DFsNNJdd.js → 9.p1SC8ote.js} +1 -1
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/entry/start.CBL0QUZV.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as o}from"./
|
|
1
|
+
import{b as o}from"./q4Mp6azq.js";var c=1;function i(){if(!(typeof globalThis>"u"))return globalThis}o(i,"getCaptureGlobal");function p(){return!!i()?.mermaidCaptureSizes}o(p,"shouldCaptureSizes");function u(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}o(u,"capturedFromLocation");function d(n,r){const t=i();if(!t)return;const e=r.node(),s=((e&&"ownerSVGElement"in e?e.ownerSVGElement:null)??e)?.id??"(unknown)";t.mermaidCapturedSizes??=[];const a={svgId:s,sizes:n};t.mermaidCapturedSizes.push(a),t.mermaidLastCapturedSizes=a}o(d,"emitCapturedSizes");function m(n,r){const t=[];for(const e of r.nodes)e.isGroup||t.push({id:e.id,width:e.width??0,height:e.height??0});t.length!==0&&d({metadata:{captureVersion:c,capturedAt:new Date().toISOString(),capturedFrom:u()},nodes:t},n)}o(m,"captureNodeSizes");export{m as captureNodeSizes,p as shouldCaptureSizes};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{I as le}from"./28aV1Wzl.js";import{p as he}from"./CM7ZaQP_.js";import{Y as $e,b0 as fe,aZ as ge,U as ue,V as ye,a_ as xe,b as h,W as J,ay as w,aW as me,X as P,bh as pe,b4 as be,r as we,z as B,q as ke,O as ve,aM as Ce}from"./Bpy6Muvw.js";import{p as Ee}from"./BxiJOwnz.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),We=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),De=h(function(){return d.records.currBranch},"getCurrentBranch"),qe=h(function(){return d.records.direction},"getDirection"),Pe=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:We,getCommitsArray:ne,getCurrentBranch:De,getDirection:qe,getHead:Pe,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,D=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),D.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=P(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",`
|
|
1
|
+
import{I as le}from"./BjqGlL_Y.js";import{p as he}from"./CE8vXfAM.js";import{Y as $e,b0 as fe,aZ as ge,U as ue,V as ye,a_ as xe,b as h,W as J,ay as w,aW as me,X as P,bh as pe,b4 as be,r as we,z as B,q as ke,O as ve,aM as Ce}from"./q4Mp6azq.js";import{p as Ee}from"./BxiJOwnz.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),We=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),De=h(function(){return d.records.currBranch},"getCurrentBranch"),qe=h(function(){return d.records.direction},"getDirection"),Pe=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:We,getCommitsArray:ne,getCurrentBranch:De,getDirection:qe,getHead:Pe,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,D=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),D.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=P(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",`
|
|
2
2
|
${s-i/2-L/2},${x+R}
|
|
3
3
|
${s-i/2-L/2},${x-R}
|
|
4
4
|
${t.posWithOffset-i/2-L},${x-c-R}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/
|
|
2
|
-
var za=Object.defineProperty;var Ba=(a,t,r)=>t in a?za(a,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[t]=r;var lt=(a,t,r)=>Ba(a,typeof t!="symbol"?t+"":t,r);import{bo as A,t as tt,bq as I,a_ as ie,by as at,b as rt,bs as Va,bu as Xt,_ as ka}from"./BAqR9jtB.js";import{bs as nt,a5 as N,aD as e,bA as L,b_ as Z,W as H,bn as st,c9 as E,aA as M,aB as z,ca as kt,bk as ya,c6 as Ka,cd as Wt,bV as ne,bS as O,ay as Fe,bl as me,bO as ge,ai as xa,a7 as Ut,c0 as ja,bf as Nt,bH as q,aw as He,aj as Ae,be as Ga,c3 as ut,bb as Mt,aF as Ya,br as Qa,bj as Xa}from"./DYhIMPy1.js";import{d as $a,f as Ja,k as qe,l as Ct,s as $,a as Ze,h as zt,i as Za}from"./BPk16bSc.js";import{aN as er,cU as tr,L as ar,av as rr,di as nr,V as sr,dl as Aa,B as or,$ as ir}from"./DY6JypjK.js";import{t as Bt}from"./7IyNIHph.js";import{a6 as cr,aj as lr,A as dr,o as ur,a3 as Ia,s as Vt,a2 as Kt,aA as yt,aX as Ma,n as fr,aC as pr,aW as mr}from"./Bops7MsY.js";import{l as $t}from"./i92hRJko.js";import{bI as gr,bF as vr,bG as Jt,ap as hr}from"./-URcs0EB.js";import{w as dt,P as br}from"./DO2cS8JO.js";import{f as jt,bc as Ht}from"./C9gP-gRX.js";import{t as Oe,v as wr,H as It,E as Zt,c as ea}from"./Bl_iEh1f.js";import{qW as Ca,Hp as ve,lY as _r,fA as kr,mT as yr,ts as xr,a as Ar,v3 as Ir,sc as Mr,qE as Cr,g as Sr,bi as ta,u8 as Rr,s0 as Er,ua as Pr}from"./BSwWMzab.js";import{c as Tr,l as ht}from"./ChTqQfQN.js";import{o as Fr}from"./B7-651e2.js";import{aP as Lr,aQ as aa,bz as Wr,aA as Nr,by as Hr,aE as qr,c_ as Or,cO as Dr,F as bt,ax as ra,bH as Ur,bC as zr}from"./DKXEy5Lq.js";import{l as Br}from"./C0VJEx2v.js";import{p as Vr,cV as wt,cU as na,an as Kr,cX as Sa,a7 as St,aD as Ra,aU as jr,av as Gr,a6 as sa,r as Yr,aL as Qr,aQ as Xr,F as $r}from"./BCDWZbwh.js";import{s as qt}from"./DiCMHWTR.js";import{b as et}from"./BaIAhI85.js";import{s as Jr}from"./XzWc0fs1.js";import{c as Zr,u as en,s as tn,a as an}from"./DfxQWSVU.js";import{N as oa,J as ia}from"./BFETMHTz.js";import{g as ca}from"./Cop9b2dY.js";import{X as la}from"./C8_w7W1W.js";const rn=new Set(["failed","blocked","needs_attention","in_progress"]),nn={failed:{visual:"icon",icon:Dr,className:"text-foreground"},blocked:{visual:"icon",icon:Or,className:"text-danger"},needs_attention:{visual:"icon",icon:qr,className:"text-warning-ink"},in_progress:{visual:"dot",icon:null,className:"workspace-status-color-active"},waiting:{visual:"icon",icon:Hr,className:"text-muted-foreground"},unread:{visual:"dot",icon:null,className:"workspace-status-color-unread"},not_started:{visual:"dot",icon:null,className:"text-muted-foreground/35"},idle:{visual:"dot",icon:null,className:"text-muted-foreground/35"},complete:{visual:"icon",icon:Nr,className:"text-success"},pr_queued:{visual:"icon",icon:Wr,className:"text-info"},pr_ready:{visual:"icon",icon:aa,className:"text-success"},pr_open:{visual:"icon",icon:aa,className:"text-info"},pr_merged:{visual:"icon",icon:Lr,className:"text-purple-500"}};function sn(a){switch(a){case"failed":return A.workspace_statusIcon_failed_label();case"blocked":return A.workspace_statusIcon_blocked_label();case"needs_attention":return A.workspace_statusIcon_needsAttention_label();case"in_progress":return A.workspace_statusIcon_inProgress_label();case"waiting":return A.workspace_taskStatus_waiting_label();case"unread":return A.layout_activeCard_unread_header();case"not_started":return A.workspace_statusIcon_notStarted_label();case"idle":return A.workspace_statusIcon_idle_label();case"complete":return A.workspace_statusIcon_complete_label();case"pr_queued":return A.workspace_statusIcon_prQueued_label();case"pr_ready":return A.workspace_statusIcon_prReady_label();case"pr_open":return A.workspace_statusIcon_prOpen_label();case"pr_merged":return A.workspace_statusIcon_prMerged_label()}}function on(a){const t=Ca(a.displayStatus)?a.displayStatus:"not_started";return rn.has(t)?t:a.attention==="unread"?"unread":a.waiting===!0?"waiting":t}function Ea(a){const t=a==="waiting"||a==="unread"||Ca(a)?a:"not_started",r=sn(t);return{state:t,...nn[t],label:r,tooltip:r,accessibleName:r}}var cn=z('<span class="workspace-status-dot svelte-14zk5l0" data-workspace-status-dot=""></span>'),ln=z("<span><!></span>");function Pa(a,t){if(new.target)return tt({component:Pa,...a});nt(t,!0);let r=I(t,"status",7),l=I(t,"size",7,14),c=I(t,"decorative",7,!1),u=I(t,"class",7);const s=E(()=>Ea(r()));var o={get status(){return r()},set status(m){r(m),M()},get size(){return l()},set size(m=14){l(m),M()},get decorative(){return c()},set decorative(m=!1){c(m),M()},get class(){return u()},set class(m){u(m),M()},$set:at,$on:(m,k)=>rt(t,m,k)},g=ln(),x=N(g);{var b=m=>{var k=cn();H(m,k)},w=m=>{bt(m,{get icon(){return e(s).icon},class:"size-full!"})};ie(x,m=>{e(s).visual==="dot"?m(b):e(s).icon&&m(w,1)})}return L(g),Z(m=>{qe(g,1,m,"svelte-14zk5l0"),Ct(g,`width: ${l()??""}px; height: ${l()??""}px;`),$(g,"role",c()?void 0:"img"),$(g,"aria-label",c()?void 0:e(s).accessibleName),$(g,"aria-hidden",c()?"true":void 0),$(g,"title",c()?void 0:e(s).tooltip),$(g,"data-workspace-status",e(s).state),$(g,"data-workspace-status-visual",e(s).visual),$(g,"data-workspace-status-icon",e(s).icon?.iconName)},[()=>$a(Ja("workspace-status-icon inline-flex shrink-0 items-center justify-center forced-colors:text-[CanvasText]",e(s).className,u()))]),H(a,g),st(o)}const Gt=6e4,Yt=60*Gt,Qt=24*Yt,da=30*Qt;function dn(a,t=new Date){if(a==null)return null;const r=a instanceof Date?a:new Date(a),l=r.getTime(),c=t.getTime();if(!Number.isFinite(l)||!Number.isFinite(c))return null;const u=Math.max(0,c-l);let s;u<Gt?s="<1m":u<Yt?s=`${Oe(Math.floor(u/Gt))}m`:u<Qt?s=`${Oe(Math.floor(u/Yt))}h`:u<da?s=`${Oe(Math.floor(u/Qt))}d`:s=`${Oe(Math.floor(u/da))}mo`;const o=l>c?t:r,g=wr(o,{now:t});return g?{compact:s,accessible:g,dateTime:r.toISOString()}:null}var un=z('<div><div class="grid gap-0.5 px-5 pt-4"><div class="flex min-w-0 items-center justify-between gap-3"><!> <!></div> <!> <!></div> <div class="my-3 border-t border-border" data-workspace-hover-card-divider=""></div> <div class="body-grid grid min-w-0 grid-cols-1 items-stretch gap-3 px-5 pb-4" data-workspace-hover-card-columns=""><div class="grid" data-workspace-hover-card-activity=""><!></div> <div class="pull-requests grid" data-workspace-hover-card-pr-column=""><!></div></div></div>'),fn=z('<p class="type-caption mt-1 min-w-0 line-clamp-3 text-muted-foreground" data-workspace-hover-card-summary=""> </p>'),pn=z('<span class="shrink-0 text-muted-foreground" data-workspace-hover-card-question-meta=""><span aria-hidden="true"> </span></span>'),mn=z('<span class="row-span-2 flex h-(--text-caption-line-height) items-center" aria-hidden="true"><!></span><span class="type-caption min-w-0 truncate text-foreground" data-workspace-hover-card-agent-name=""> </span><time class="type-caption whitespace-nowrap text-muted-foreground" data-workspace-hover-card-agent-time=""> </time> <span class="agent-detail type-caption flex min-w-0 items-start gap-1.5 text-muted-foreground svelte-1vax087" data-workspace-hover-card-agent-detail=""><span class="min-w-0 truncate" data-workspace-hover-card-agent-context=""> </span><!></span>',1),ua=z('<div role="listitem"><!></div>'),gn=z('<div class="type-caption mt-3 flex items-center justify-between text-muted-foreground" data-workspace-hover-card-overflow=""><span> </span> <!></div>'),vn=z('<section class="activity min-w-0" data-workspace-hover-card-activity="" data-workspace-hover-card-agent-table=""><div class="-mx-2 grid gap-2" role="list"></div> <!></section>'),hn=z('<!> <span class="type-caption min-w-0 truncate text-foreground" data-workspace-hover-card-pr-title=""> </span> <span class="type-caption shrink-0 text-muted-foreground" data-workspace-hover-card-pr-status=""> </span> <span class="type-caption shrink-0 text-muted-foreground" data-workspace-hover-card-pr-number=""> </span>',1),bn=z('<div class="grid w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)_auto_auto] items-center gap-x-2 rounded-sm px-2 py-0 text-left" data-workspace-hover-card-pr-row=""><!></div>'),wn=z('<div class="type-caption mt-3 flex items-center justify-between text-muted-foreground" data-workspace-hover-card-pr-overflow=""><span> </span> <!></div>'),_n=z('<section class="pull-requests min-w-0" data-workspace-hover-card-pr-column=""><div class="-mx-2 grid min-w-0 gap-2" role="list" data-workspace-hover-card-pr-list=""></div> <!></section>'),kn=z('<div class="my-3 border-t border-border" data-workspace-hover-card-divider=""></div> <div class="body-grid grid min-w-0 grid-cols-1 items-stretch gap-3 px-5 pb-4" data-workspace-hover-card-columns=""><!> <!></div>',1),yn=z('<header data-workspace-hover-card-header=""><div class="min-w-0" data-workspace-hover-card-identity=""><div class="flex min-w-0 items-center justify-between gap-3"><h2 class="type-body min-w-0 truncate font-medium text-foreground" data-workspace-hover-card-title=""> </h2> <span class="type-caption flex shrink-0 items-center gap-1.5 text-muted-foreground" data-workspace-hover-card-status=""><span class="truncate" data-workspace-hover-card-status-label=""> </span><!></span></div> <div class="type-caption mt-0.5 min-w-0 truncate text-muted-foreground" data-workspace-hover-card-repo=""> </div> <!></div></header> <!>',1),xn=z('<section class="workspace-hover-card shrink-0 overflow-hidden rounded-md bg-background text-left text-foreground shadow-(--elevation-overlay) ring-1 ring-border svelte-1vax087" data-workspace-hover-card="" data-workspace-hover-card-layout="landscape"><!></section>');function An(a,t){if(new.target)return tt({component:An,...a});nt(t,!0);const r=()=>Xt(T,"$workspaceAgents$",c),l=()=>Xt(i,"$prMonitors$",c),[c,u]=Va(),s=Tr("WorkspaceHoverCard");let o=I(t,"workspace",7),g=I(t,"isLoading",7,!1),x=I(t,"activeAgentIds",23,()=>[]),b=I(t,"loadAgentSessions",7,!0),w=I(t,"onkeydown",7),m=I(t,"staticData",7,!1);const k=Wt("");function U(){return m()?Wt([]):er(k)}function B(){return m()?Wt([]):tr(k)}const T=U(),i=B();kt(()=>k.set(o()?.id??""));let p=ne(0);ya(()=>$t.subscribe(()=>Ka(p)));let _=E(()=>o()?.agentSummary?.agentIds??[]),P=E(()=>(e(p),o()?$t.getStreamingAgentIdsForWorkspace(o().id):[])),D=null,Y=new Set;kt(()=>{if(!o()||!b())return;const d=String(o().id);D!==d&&(D=d,Y=new Set);for(const C of new Set([...e(_).slice(0,6),...x(),...e(P)]))Y.has(C)||(ve.dispatch(_r(d,C)),Y.add(C))});function se(d){return[d.name,d.context,d.questionMeta?.accessible,d.updated.accessible].filter(Boolean).join(". ")}function Ce(d){return d?d.kind==="attention"?d.attention.reason?.trim()||null:"text"in d&&d.text.trim()||null:null}function le(d){return dn(d.lastActivity||d.updatedAt||d.createdAt)??{compact:"—",accessible:A.workspace_hoverCard_noRecentActivity_label()}}function y(d){const C=String(d.status).toLowerCase(),F=yr(d),X=lr(d),be=X==="question"?gr(d):null,pe=Ce(rr.select(ve.state,String(d.id)));let we,Ee,_e,n,f,W,S=!1;if(X==="question"){we="attention",Ee="question",_e=be?.questions[0]?.question.trim()||pe||A.workspace_hoverCard_question_label(),n="question",f=1;const K=be?.questions.length??0;K>1&&(W={compact:`${Oe(1)}/${Oe(K)}`,accessible:A.chat_questionWizard_stepCounter_label({current:1,total:K})})}else if(X==="attention-discussion")we="attention",Ee="discussion",_e=F?.reason?.trim()||A.chat_agentCard_attentionDiscussion_label(),n="attention-discussion",f=1;else if(X==="attention-blocker"||C==="blocked")we="attention",Ee="blocker",_e=F?.reason?.trim()||A.chat_agentCard_attentionBlocker_label(),n="attention-blocker",f=0;else if(d.hasUnread)we="attention",Ee="unread",_e=pe||A.chat_newMessagesDivider_label(),S=!!pe,n="unread",f=2;else if(d.isStreaming||d.isProcessing||x().includes(String(d.id))||e(P).includes(String(d.id))||["active","busy","processing","responding","running","streaming","in_progress"].includes(C))we="active",_e=pe||A.workspace_devScripts_running_label(),S=!!pe,n=d.isProcessing?"responding":"running",f=3;else if(["waiting","pending","queued","starting"].includes(C))we="waiting",_e=pe||A.workspace_taskStatus_waiting_label(),S=!!pe,n="waiting",f=4;else return null;const j=d.agentMetadata??d.metadata;return{id:String(d.id),name:d.name?.trim()||A.workspace_fileChanges_agent_label(),group:we,attentionKind:Ee,avatarState:n,specialist:j?.specialist,context:_e,questionMeta:W,contextIsPreview:S,updated:le(d),priority:f}}let Q=E(()=>{const d=o()?.agentSummary,C=new Map;if(Array.isArray(d?.agents))for(const F of d.agents)F&&typeof F=="object"&&typeof F.id=="string"&&C.set(F.id,F.parentAgentId);return r().filter(F=>{const X=C.get(String(F.id));return!(kr(F)!=="topLevel"||typeof X=="string"&&X||F.pendingDeleteAt||F.retiredAt||String(F.status).toLowerCase()==="deleted")})}),oe=E(()=>e(Q).map(y).filter(d=>d!==null).sort((d,C)=>d.priority-C.priority)),Le=E(()=>e(oe).slice(0,6)),Me=E(()=>Math.max(0,e(oe).length-6)),fe=E(()=>o()?.repositoryName?o().repositoryOwner?`${o().repositoryOwner} / ${o().repositoryName}`:o().repositoryName:A.workspace_hoverCard_localRepository_label()),Ve=E(()=>on(o()??{})),ke=E(()=>Ea(e(Ve))),ee=E(()=>o()?.statusMessage?.trim()||"");function Se(d){if(!d)return null;const C=d.activePullRequest??d.pullRequests?.[0]??null;return C||(d.prStatus?{id:`legacy-pr-${d.prNumber??"workspace"}`,number:d.prNumber??0,url:d.prUrl??"",title:A.workspace_hoverCard_pullRequest_label(),status:d.prStatus,createdAt:d.updatedAt,updatedAt:d.updatedAt}:null)}let ft=E(()=>o()?m()?Se(o()):nr.select(ve.state,o().id)??Se(o()):null),Ie=E(()=>{if(!o()||ar(o()))return[];const d=o().repositoryOwner&&o().repositoryName?`${o().repositoryOwner}/${o().repositoryName}`:void 0;return cr({workspacePRs:o().pullRequests,activePR:e(ft),monitors:l(),workspaceRepo:d,buildPrUrl:(C,F)=>Vr(C,o().repositoryOwner,o().repositoryName,F),getDisplayTitle:C=>C.title})}),ot=E(()=>e(Ie).slice(0,3)),De=E(()=>Math.max(0,e(Ie).length-3)),ce=E(()=>e(oe).length>0),Ke=E(()=>e(Ie).length>0),v=E(()=>e(ce)||e(Ke));function h(d){const C=d.resource?.repository.provider==="gitlab"?`${d.repo} !${d.number}`:d.repo?A.workspace_card_prBadge_repoLine_tooltip({repo:d.repo,number:d.number}):A.workspace_card_prBadge_label({number:` #${d.number}`});return[sr(C,d),d.title,d.details].filter(Boolean).join(`
|
|
3
|
-
`)}function ae(d,C){if(d.stopPropagation(),!o()||!b())return;const F=o().id;Br.select(ve.state)!==F&&Fr(F).catch(X=>{s.warn("Failed to switch workspace for hover-card agent",{agentId:C,error:X})}),ve.dispatch(xr(F,{agentId:C}))}function V(d,C){if(d.stopPropagation(),!o()||!C.url)return;const F=o().id;ka(async()=>{const{handleLink:X}=await import("./BFETMHTz.js").then(be=>be.Q);return{handleLink:X}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56]),import.meta.url).then(({handleLink:X})=>X(C.url,{workspaceId:F,event:d}))}var te={get workspace(){return o()},set workspace(d){o(d),M()},get isLoading(){return g()},set isLoading(d=!1){g(d),M()},get activeAgentIds(){return x()},set activeAgentIds(d=[]){x(d),M()},get loadAgentSessions(){return b()},set loadAgentSessions(d=!0){b(d),M()},get onkeydown(){return w()},set onkeydown(d){w(d),M()},get staticData(){return m()},set staticData(d=!1){m(d),M()},$set:at,$on:(d,C)=>rt(t,d,C)},he=xn(),re=N(he);{var Re=d=>{var C=un(),F=N(C),X=N(F),be=N(X);dt(be,{class:"h-7 min-w-0 max-w-64 flex-1"});var pe=O(be,2);dt(pe,{class:"h-5 w-20 shrink-0"}),L(X);var we=O(X,2);dt(we,{class:"h-4 w-40"});var Ee=O(we,2);dt(Ee,{class:"mt-2 h-10 w-full"}),L(F);var _e=O(F,4),n=N(_e),f=N(n);dt(f,{class:"h-10 w-full"}),L(n);var W=O(n,2),S=N(W);dt(S,{class:"h-10 w-full"}),L(W),L(_e),L(C),H(d,C)},Ue=d=>{var C=yn(),F=Fe(C);let X;var be=N(F),pe=N(be),we=N(pe),Ee=me(we,!0),_e=O(we,2),n=N(_e),f=me(n,!0),W=O(n);Pa(W,{get status(){return e(Ve)},size:16,decorative:!0}),L(_e),L(pe);var S=O(pe,2),j=me(S,!0),K=O(S,2);{var J=ue=>{var We=fn(),xt=me(We,!0);Ze(We,(At,Rt)=>Bt?.(At,Rt),()=>e(ee)),Z(()=>ge(xt,e(ee))),H(ue,We)};ie(K,ue=>{e(ee)&&ue(J)})}L(be),L(F);var Pe=O(F,2);{var de=ue=>{var We=kn(),xt=O(Fe(We),2),At=N(xt);{var Rt=Ye=>{var ze=vn(),Ge=N(ze);zt(Ge,21,()=>e(Le),G=>G.id,(G,R)=>{var ye=ua(),Qe=N(ye);{let Xe=E(()=>se(e(R)));jt(Qe,{variant:"plain",wrapContent:!1,class:"grid h-auto! min-h-8 w-full min-w-0 cursor-pointer grid-cols-[1rem_minmax(0,1fr)_auto] items-start justify-normal gap-x-2 gap-y-0 whitespace-normal rounded-sm border-0! px-2! py-0! text-left font-normal transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",get"aria-label"(){return e(Xe)},"data-workspace-hover-card-agent-row":!0,get"data-agent-group-row"(){return e(R).group},get"data-attention-kind"(){return e(R).attentionKind},get onkeydown(){return w()},onclick:Be=>ae(Be,e(R).id),children:(Be,pt)=>{var Te=mn(),xe=Fe(Te),Ne=N(xe);{let Je=E(()=>e(R).specialist??null);dr(Ne,{get agentId(){return e(R).id},variant:"compact",get state(){return e(R).avatarState},get specialist(){return e(Je)}})}L(xe);var it=O(xe),Tt=me(it,!0),$e=O(it),Ft=me($e,!0),mt=O($e,2),gt=N(mt),Lt=me(gt,!0);Ze(gt,(Je,ct)=>Bt?.(Je,ct),()=>e(R).context);var qa=O(gt);{var Oa=Je=>{var ct=pn(),Da=N(ct),Ua=me(Da,!0);L(ct),Z(()=>{$(ct,"aria-label",e(R).questionMeta.accessible),ge(Ua,e(R).questionMeta.compact)}),H(Je,ct)};ie(qa,Je=>{e(R).questionMeta&&Je(Oa)})}L(mt),Z(()=>{ge(Tt,e(R).name),$($e,"datetime",e(R).updated.dateTime),$($e,"aria-label",e(R).updated.accessible),ge(Ft,e(R).updated.compact),$(mt,"data-workspace-hover-card-agent-preview",e(R).contextIsPreview||void 0),ge(Lt,e(R).context)}),H(Be,Te)},$$slots:{default:!0}})}L(ye),H(G,ye)}),L(Ge);var Et=O(Ge,2);{var Pt=G=>{var R=gn(),ye=N(R),Qe=me(ye,!0),Xe=O(ye,2);bt(Xe,{get icon(){return ra},size:10}),L(R),Z(Be=>ge(Qe,Be),[()=>A.workspace_hoverCard_moreAgents_label({count:Oe(e(Me))})]),H(G,R)};ie(Et,G=>{e(Me)&&G(Pt)})}L(ze),Z(G=>$(ze,"aria-label",G),[()=>A.workspace_multiSelectSidebar_agentsTab_label()]),H(Ye,ze)};ie(At,Ye=>{e(ce)&&Ye(Rt)})}var Na=O(At,2);{var Ha=Ye=>{var ze=_n(),Ge=N(ze);zt(Ge,21,()=>e(ot),G=>G.identity,(G,R)=>{var ye=ua();{const pt=Te=>{var xe=hn(),Ne=Fe(xe);bt(Ne,{get icon(){return e(R).statusIcon},size:16,get class(){return`shrink-0 justify-self-start ${e(R).foregroundClass??""}`}});var it=O(Ne,2),Tt=me(it,!0),$e=O(it,2),Ft=me($e,!0),mt=O($e,2),gt=me(mt,!0);Z(Lt=>{ge(Tt,Lt),ge(Ft,e(R).accessibleStateLabel),ge(gt,e(R).numberLabel??`#${e(R).number}`)},[()=>e(R).title||(e(R).resource?.repository.provider==="gitlab"?A.workspace_hoverCard_mergeRequest_label():A.workspace_hoverCard_pullRequest_label())]),H(Te,xe)};var Qe=N(ye);{var Xe=Te=>{{let xe=E(()=>h(e(R)));jt(Te,{variant:"plain",wrapContent:!1,class:"grid h-auto! w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)_auto_auto] items-center justify-normal gap-x-2 whitespace-normal rounded-sm border-0! px-2! py-0! text-left font-normal transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",get"aria-label"(){return e(xe)},"data-workspace-hover-card-pr-row":!0,get"data-pr-identity"(){return e(R).identity},get"data-pr-status"(){return e(R).status},get onkeydown(){return w()},onclick:Ne=>V(Ne,e(R)),children:(Ne,it)=>{pt(Ne)},$$slots:{default:!0}})}},Be=Te=>{var xe=bn(),Ne=N(xe);pt(Ne),L(xe),Z(()=>{$(xe,"data-pr-identity",e(R).identity),$(xe,"data-pr-status",e(R).status)}),H(Te,xe)};ie(Qe,Te=>{e(R).url?Te(Xe):Te(Be,-1)})}L(ye)}Z(pt=>$(ye,"aria-label",pt),[()=>e(R).url?void 0:h(e(R))]),H(G,ye)}),L(Ge);var Et=O(Ge,2);{var Pt=G=>{var R=wn(),ye=N(R),Qe=me(ye,!0),Xe=O(ye,2);bt(Xe,{get icon(){return ra},size:10}),L(R),Z(Be=>ge(Qe,Be),[()=>A.workspace_hoverCard_moreItems_label({count:Oe(e(De))})]),H(G,R)};ie(Et,G=>{e(De)&&G(Pt)})}L(ze),Z((G,R)=>{$(ze,"aria-label",G),$(Ge,"aria-label",R)},[()=>e(Ie).every(G=>G.resource?.repository.provider==="gitlab")?A.workspace_hoverCard_mergeRequests_label():e(Ie).some(G=>G.resource?.repository.provider==="gitlab")?A.workspace_hoverCard_reviews_label():A.workspace_hoverCard_pullRequests_label(),()=>e(Ie).every(G=>G.resource?.repository.provider==="gitlab")?A.workspace_hoverCard_mergeRequests_label():e(Ie).some(G=>G.resource?.repository.provider==="gitlab")?A.workspace_hoverCard_reviews_label():A.workspace_hoverCard_pullRequests_label()]),H(Ye,ze)};ie(Na,Ye=>{e(Ke)&&Ye(Ha)})}L(xt),H(ue,We)};ie(Pe,ue=>{e(v)&&ue(de)})}Z(ue=>{X=qe(F,1,"min-w-0 px-5 pt-4",null,X,{"pb-4":!e(v)}),ge(Ee,ue),ge(f,e(ke).label),ge(j,e(fe))},[()=>o().title||A.workspace_links_untitled_label()]),H(d,C)};ie(re,d=>{g()||!o()?d(Re):d(Ue,-1)})}L(he),H(a,he);var je=st(te);return u(),je}const fa=800,Ss=175,In=300;function Mn(){let a=0,t=null;const r=new Set,l=new Set;function c(){return a>0||t!==null?0:fa}function u(){const o=c();r.forEach(g=>g(o))}function s(){t!==null&&(clearTimeout(t),t=null)}return{get currentOpenDelay(){return c()},subscribe(o){return r.add(o),o(c()),()=>r.delete(o)},notifyOpened(){const o=a===0&&t===null;s(),a+=1,o&&u()},notifyClosed(){a!==0&&(a-=1,!(a>0)&&(s(),t=setTimeout(()=>{t=null,u()},In)))},deferClose(o){return l.add(o),()=>l.delete(o)},settleDeferredCloses(){const o=[...l];l.clear(),o.forEach(g=>g())},reset(){const o=c()!==fa;s(),a=0,l.clear(),o&&u()}}}const Rs=Mn();function Ot(a){const t=Aa.select(ve.state,a);return t!==void 0&&Cr(t)}function Cn(a,t){if(!Ot(a))return[];const r=vr.select(ve.state,a),l=Jt.select(ve.state,a),c=hr.select(ve.state),u=[];for(let s=0;s<Ar;s+=1){const o=c[s],g=o&&o!==a?Aa.select(ve.state,o):void 0;u.push({id:`assign-micro-key-${s+1}`,label:g?A.workspace_card_assignOccupiedMicroKey_label({number:Oe(s+1),title:g.title}):A.workspace_card_assignMicroKeyNumber_label({number:Oe(s+1)}),checked:r===s,closeOnSelect:!0,onClick:()=>{Ot(a)&&ve.dispatch(Ir(s,a)),t()}})}return l!==null&&(u.push({type:"separator"}),u.push({id:"unassign-micro-key",label:A.workspace_card_unassignMicroKey_label(),onClick:()=>{Ot(a)&&Jt.select(ve.state,a)===l&&ve.dispatch(Mr(l)),t()}})),u}function Es(a,{connected:t,onClose:r}){if(!t)return[];const l=Cn(a,r);if(l.length===0)return[];const c=l.filter(s=>"id"in s&&s.id!=="unassign-micro-key"),u=l.find(s=>"id"in s&&s.id==="unassign-micro-key");return[{id:"assign-micro-key",label:A.workspace_card_assignMicroKey_label(),icon:Ur,onClick:()=>{},selection:"single",submenu:c},...u?[u]:[]]}var Sn=z('<div data-static-position="" role="tooltip"><!></div>'),pa=z('<div role="tooltip"><!></div>');function Rn(a,t){if(new.target)return tt({component:Rn,...a});nt(t,!0);let r=I(t,"id",7),l=I(t,"anchor",7),c=I(t,"position",7,"right"),u=I(t,"absolute",7,!1),s=I(t,"anchorElement",7,null),o=I(t,"staticPosition",7,!1),g=I(t,"class",7,""),x=I(t,"children",7),b=I(t,"onmouseenter",7),w=I(t,"onmouseleave",7),m=I(t,"onfocusin",7),k=I(t,"onfocusout",7);const U=Zr(en()+2);tn(U);const B=an(U),T=8,i=4;let p=ne(null),_=ne(""),P=ne(void 0);const D=E(()=>c()==="bottom-right"||c()==="bottom-left"),Y=E(()=>c()==="top"),se=E(()=>o()?"relative":u()?"absolute":"fixed"),Ce=E(()=>c()==="right"?{x:-4,y:0}:c()==="bottom"?{x:4,y:0}:e(Y)?{x:0,y:4}:{x:0,y:-4});function le(v,h,ae){return Math.max(h,Math.min(ae,v))}let y=null,Q=null;function oe(){return!y?.isConnected||Q!==l()?!1:y.style.getPropertyValue("anchor-name").includes(l())||getComputedStyle(y).getPropertyValue("anchor-name").includes(l())}function Le(){return s()?s():(oe()||(y=Array.from(document.querySelectorAll('[style*="anchor-name"]')).find(v=>{const h=v.style.getPropertyValue("anchor-name"),ae=getComputedStyle(v).getPropertyValue("anchor-name");return h.includes(l())||ae.includes(l())})??null,Q=y?l():null),y)}function Me(){if(o()||u()||!e(p))return;const v=Le();if(!v)return;const h=v.getBoundingClientRect(),ae=e(p).getBoundingClientRect(),V=window.innerWidth||document.documentElement.clientWidth,te=window.innerHeight||document.documentElement.clientHeight,he=ae.width||e(p).offsetWidth,re=ae.height||e(p).offsetHeight,Re=Math.max(0,h.top-i-T),Ue=Math.max(0,te-h.bottom-i-T),je=e(Y)?!(Re<re&&Ue>Re):e(D)&&Ue<re&&Re>Ue;let d=h.left,C=h.bottom+i,F=je?Re:Ue;if(c()==="right"){const X=h.left-i-T,be=V-h.right-i-T;d=be>=he||be>=X?h.right+i:h.left-he-i,C=h.top,F=Math.max(0,te-T*2)}else c()==="bottom"?(d=h.left-he-i,C=h.bottom-re):(e(Y)||e(D))&&(c()==="bottom-left"?d=h.right-he:e(Y)&&(d=h.left+h.width/2-he/2),C=je?h.top-Math.min(re,F)-i:h.bottom+i);d=le(d,T,Math.max(T,V-he-T)),C=le(C,T,Math.max(T,te-Math.min(re,F)-T)),q(P,`${F}px`),q(_,`left: ${d}px; top: ${C}px;`)}let fe=!1;async function Ve(){fe||(fe=!0,await ja(),fe=!1,Me())}let ke=null;function ee(){ke||(ke=Jr(()=>{ke=null,Me()}))}function Se(v){const h=s()??(oe()?y:null);h&&v.target instanceof Node&&!v.target.contains(h)||ee()}kt(()=>{const v=e(p),h=s();o()||u()||!v||!h||Ve()}),ya(()=>{if(o())return;let v=null;return Ve().then(()=>{if(!u()&&typeof ResizeObserver<"u"){v=new ResizeObserver(ee),e(p)&&v.observe(e(p));const h=Le();h&&v.observe(h)}}),window.addEventListener("resize",ee),window.addEventListener("scroll",Se,!0),()=>{v?.disconnect(),window.removeEventListener("resize",ee),window.removeEventListener("scroll",Se,!0),ke?.(),ke=null}});var ft={get id(){return r()},set id(v){r(v),M()},get anchor(){return l()},set anchor(v){l(v),M()},get position(){return c()},set position(v="right"){c(v),M()},get absolute(){return u()},set absolute(v=!1){u(v),M()},get anchorElement(){return s()},set anchorElement(v=null){s(v),M()},get staticPosition(){return o()},set staticPosition(v=!1){o(v),M()},get class(){return g()},set class(v=""){g(v),M()},get children(){return x()},set children(v){x(v),M()},get onmouseenter(){return b()},set onmouseenter(v){b(v),M()},get onmouseleave(){return w()},set onmouseleave(v){w(v),M()},get onfocusin(){return m()},set onfocusin(v){m(v),M()},get onfocusout(){return k()},set onfocusout(v){k(v),M()},$set:at,$on:(v,h)=>rt(t,v,h)},Ie=Ut(),ot=Fe(Ie);{var De=v=>{var h=Sn(),ae=N(h);qt(ae,()=>x()??Nt),L(h),et(h,V=>q(p,V),()=>e(p)),Z(()=>{$(h,"id",r()),qe(h,1,e(se)+` z-50 w-64 flex flex-col overflow-y-auto border border-border pointer-events-auto ${B} `+g()),$(h,"data-surface-level",U)}),H(v,h)},ce=v=>{var h=pa();let ae;var V=N(h);qt(V,()=>x()??Nt),L(h),et(h,te=>q(p,te),()=>e(p)),Z(()=>{$(h,"id",r()),qe(h,1,e(se)+` z-50 w-64 flex flex-col border border-border pointer-events-none ${B} `+g()),$(h,"data-surface-level",U),ae=Ct(h,"",ae,{"position-anchor":l(),right:c()==="bottom"?"anchor(left)":void 0,left:c()==="right"?"anchor(right)":e(D)?"anchor(left)":e(Y)?"anchor(center)":void 0,top:c()==="right"?"anchor(top)":e(D)?"anchor(bottom)":void 0,bottom:c()==="bottom"?"anchor(bottom)":e(Y)?"anchor(top)":void 0,"margin-right":c()==="bottom"?"8px":void 0,"margin-left":c()==="right"?"8px":void 0,"margin-top":e(D)?"4px":void 0,"margin-bottom":e(Y)?"4px":void 0,translate:e(Y)?"-50% 0":void 0})}),He("mouseenter",h,function(...te){b()?.apply(this,te)}),He("mouseleave",h,function(...te){w()?.apply(this,te)}),Ae("focusin",h,function(...te){m()?.apply(this,te)}),Ae("focusout",h,function(...te){k()?.apply(this,te)}),It(1,h,()=>Zt,()=>({tier:"fast",...e(Ce),scale:.96})),It(2,h,()=>ea,()=>({tier:"fast"})),H(v,h)},Ke=v=>{br(v,{zIndex:50,children:(h,ae)=>{var V=pa();let te;var he=N(V);qt(he,()=>x()??Nt),L(V),et(V,re=>q(p,re),()=>e(p)),Z(()=>{$(V,"id",r()),qe(V,1,e(se)+` z-50 w-64 flex flex-col overflow-y-auto border border-border pointer-events-auto ${B} `+g()),$(V,"data-surface-level",U),te=Ct(V,e(_),te,{"max-height":e(P)})}),He("mouseenter",V,function(...re){b()?.apply(this,re)}),He("mouseleave",V,function(...re){w()?.apply(this,re)}),Ae("focusin",V,function(...re){m()?.apply(this,re)}),Ae("focusout",V,function(...re){k()?.apply(this,re)}),It(1,V,()=>Zt,()=>({tier:"fast",...e(Ce),scale:.96})),It(2,V,()=>ea,()=>({tier:"fast"})),H(h,V)},$$slots:{default:!0}})};ie(ot,v=>{o()?v(De):u()?v(ce,1):v(Ke,-1)})}return H(a,Ie),st(ft)}xa(["focusin","focusout"]);function _t(a,t){return t||/^(?:https?:|data:|blob:|workspace-asset:)/i.test(a.trim())}function En(a,t){if(t||!a)return a;const r=document.createElement("template");r.innerHTML=a;for(const l of r.content.querySelectorAll("img, video")){const c=l.getAttribute("src")||l.getAttribute("data-media-src")||"",u=[...l.querySelectorAll("source")];if(!_t(c,!1)||u.some(o=>!_t(o.getAttribute("src")||"",!1))){const o=document.createElement("img");o.setAttribute("alt",l.getAttribute("alt")||l.getAttribute("data-name")||""),o.setAttribute("data-media-unavailable","node-owned"),l.replaceWith(o);continue}l.removeAttribute("srcset");const s=l.getAttribute("poster");s&&!_t(s,!1)&&l.removeAttribute("poster")}return r.innerHTML}const Pn=[/(^|[^\\])\$(?!\$)(?=\S)(?:\\.|[^\\$\n])+?\$(?!\$)/,/(^|[^\\])\\\((?:\\.|[^\\\n])*?\\\)/,/^(?: {0,3})(?:\$\$|\\\[)/m,/^\s*[-*]\s*\[[ x]\]/m,/```/,/`[^`]+`/,/\|.*\|/,/\[.*\]\(.*\)/,/!\[.*\]\(.*\)/,/<[a-z][\s\S]*>/i,/^#{1,6}\s/m,/^\s*>\s/m,/\*\*[^*]+\*\*/,/\*[^*]+\*/,/_[^_]+_/,/~~[^~]+~~/,/^[-*_]{3,}\s*$/m,/^\s*[-*+]\s/m,/^\s*\d+\.\s/m];function Tn(a){return a&&(Pn.some(t=>t.test(a))||or(a,"markdown"))?"static":"simple"}var Fn=z("<!> <!>",1);function Ta(a,t){if(new.target)return tt({component:Ta,...a});nt(t,!0);let r=I(t,"workspaceId",7),l=I(t,"canUseMedia",7),c=ne(null),u=ne(null),s=ne(!1),o=ne(!1);function g(_){q(c,{url:_.getAttribute("src")||"",name:_.getAttribute("alt")||void 0,opener:_},!0),q(s,!0)}function x(_){const P=na(_.getAttribute("href")||"",r());return P&&l()(P)?(q(c,{url:P,name:_.textContent?.trim()||void 0,opener:_,assetLink:!0},!0),q(s,!0),!0):b(_)}function b(_){const P=wt(_.getAttribute("href")||"",r());return!P||!l()(P.url)?!1:(q(u,{url:P.url,mimeType:P.mimeType,name:_.textContent?.trim()||void 0,opener:_},!0),q(o,!0),!0)}kt(()=>{e(u)&&!wt(e(u).url,r())&&(q(o,!1),q(u,null)),e(c)?.assetLink&&!na(e(c).url,r())&&(q(s,!1),q(c,null))});var w={openImage:g,openAsset:x,get workspaceId(){return r()},set workspaceId(_){r(_),M()},get canUseMedia(){return l()},set canUseMedia(_){l(_),M()},$set:at,$on:(_,P)=>rt(t,_,P)},m=Fn(),k=Fe(m);{var U=_=>{ur(_,{get imageUrl(){return e(c).url},get imageName(){return e(c).name},get openerElement(){return e(c).opener},showActionsMenu:!0,get open(){return e(s)},set open(P){q(s,P,!0)}})},B=E(()=>e(c)&&l()(e(c).url));ie(k,_=>{e(B)&&_(U)})}var T=O(k,2);{var i=_=>{Ia(_,{get videoUrl(){return e(u).url},get videoName(){return e(u).name},get mimeType(){return e(u).mimeType},sourceKind:"workspace",get openerElement(){return e(u).opener},get open(){return e(o)},set open(P){q(o,P,!0)}})},p=E(()=>e(u)&&wt(e(u).url,r())&&l()(e(u).url));ie(T,_=>{e(p)&&_(i)})}return H(a,m),st(w)}var Ln=z('<div class="flex items-center gap-2"><!> <!></div>'),Wn=z('<div class="absolute inset-0 flex items-center justify-center bg-muted text-muted-foreground" aria-hidden="true"><svg viewBox="0 0 24 24" class="size-10" fill="none"><rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor"></rect><path d="m10 9 5 3-5 3V9Z" fill="currentColor"></path></svg></div> <video preload="metadata" playsinline="" tabindex="-1" aria-hidden="true"></video> <span class="absolute inset-0 flex items-center justify-center bg-black/10 transition-colors group-hover:bg-black/20 motion-reduce:transition-none forced-colors:bg-transparent" aria-hidden="true"><span class="flex size-11 items-center justify-center rounded-full border border-white/70 bg-black/60 text-white shadow-(--elevation-raised) forced-colors:border forced-colors:bg-[Canvas] forced-colors:text-[CanvasText]"><svg viewBox="0 0 20 20" class="ml-0.5 size-5" fill="currentColor"><path d="m7 5 7 5-7 5V5Z"></path></svg></span></span>',3),Nn=z('<div class="group relative aspect-video w-full max-h-40 max-w-2xl" style="width: min(100%, calc(10rem * 16 / 9));"><!> <!></div>'),Hn=z('<div class="my-2 min-w-0 max-w-2xl" data-chat-video=""><!></div> <!>',1);function Fa(a,t){if(new.target)return tt({component:Fa,...a});nt(t,!0);let r=I(t,"source",7),l=I(t,"name",23,()=>A.chat_videoBlock_fromAgent_label()),c=I(t,"poster",7),u=I(t,"allowFileMedia",7,!0),s=I(t,"canOpenFile",7),o=ne(!1),g=ne(!1),x=ne(!1),b=ne(null);const w=E(()=>r().kind==="inline"?`data:${r().mimeType};base64,${r().data}`:r().url);function m(y){return _t(y,u()&&s()?.()!==!1)}const k=E(()=>!m(e(w))),U=E(()=>yt(e(w))),B=E(()=>{if(!(!c()||!m(c()))){if(/^data:image\/(?:gif|jpeg|png|webp);base64,[a-z0-9+/=]+$/i.test(c()))return c();try{const y=new URL(c());return(y.protocol==="https:"||y.protocol==="workspace-file:")&&!y.username&&!y.password?c():void 0}catch{return}}});function T(){q(g,!0),q(x,!1)}var i={get source(){return r()},set source(y){r(y),M()},get name(){return l()},set name(y=A.chat_videoBlock_fromAgent_label()){l(y),M()},get poster(){return c()},set poster(y){c(y),M()},get allowFileMedia(){return u()},set allowFileMedia(y=!0){u(y),M()},get canOpenFile(){return s()},set canOpenFile(y){s(y),M()},$set:at,$on:(y,Q)=>rt(t,y,Q)},p=Hn(),_=Fe(p),P=N(_);{var D=y=>{Vt(y,{get name(){return l()},reason:"load-failed"})},Y=y=>{var Q=Ln(),oe=N(Q);{let Me=E(()=>e(U)?.path),fe=E(()=>e(U)?.workspaceId);Vt(oe,{get name(){return l()},reason:"load-failed",get path(){return e(Me)},get workspaceId(){return e(fe)}})}var Le=O(oe,2);Kt(Le,{get videoUrl(){return e(w)},get videoName(){return l()},get sourceKind(){return r().kind},get mimeType(){return r().mimeType}}),L(Q),H(y,Q)},se=y=>{var Q=Nn(),oe=N(Q);{let Me=E(()=>A.chat_videoBlock_play_ariaLabel({name:l()}));jt(oe,{type:"button",variant:"ghost",size:"default",class:"relative block size-full cursor-pointer overflow-hidden rounded-lg border border-border bg-muted/40 p-0 shadow-(--elevation-raised) focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 forced-colors:border",get"aria-label"(){return e(Me)},"data-testid":"chat-video-snapshot",onclick:()=>{m(e(w))&&q(o,!0)},get ref(){return e(b)},set ref(fe){q(b,fe,!0)},children:(fe,Ve)=>{var ke=Wn(),ee=O(Fe(ke),2);ee.muted=!0,Ga(2),Z(()=>{$(ee,"src",e(w)),$(ee,"poster",e(B)),qe(ee,1,`pointer-events-none absolute inset-0 size-full object-contain transition-opacity motion-reduce:transition-none ${e(B)||e(g)&&!e(x)?"opacity-100":"opacity-0"}`)}),He("loadeddata",ee,T),He("error",ee,()=>q(x,!0)),H(fe,ke)},$$slots:{default:!0}})}var Le=O(oe,2);Kt(Le,{get videoUrl(){return e(w)},get videoName(){return l()},get sourceKind(){return r().kind},get mimeType(){return r().mimeType},triggerClass:"absolute right-1.5 top-1.5 opacity-0 transition-opacity focus-visible:opacity-100 group-focus-within:opacity-100 group-hover:opacity-100 data-[state=open]:opacity-100"}),L(Q),H(y,Q)};ie(P,y=>{e(k)?y(D):e(x)?y(Y,1):y(se,-1)})}L(_);var Ce=O(_,2);{var le=y=>{Ia(y,{get videoUrl(){return e(w)},get videoName(){return l()},get poster(){return e(B)},get sourceKind(){return r().kind},get mimeType(){return r().mimeType},get openerElement(){return e(b)},get open(){return e(o)},set open(Q){q(o,Q,!0)}})};ie(Ce,y=>{!e(x)&&!e(k)&&y(le)})}return H(a,p),st(i)}const qn=/^\s*!\[([^\]\n]*)\]\((?:<)?((?:intent:\/\/local\/|workspace-file:\/\/|workspace-asset:\/\/)[^)\s>]+)(?:>)?\)\s*$/,On=/^ {0,3}(`{3,}|~{3,})(.*)$/;function ma(a,t){if(typeof a!="string"||!a||a!==a.trim())return null;if(a.startsWith("workspace-asset://"))return wt(a,t);if(a.startsWith("workspace-file://")){const l=yt(a);if(!l||l.workspaceId!==t)return null;const c=Sa(a);return c?la(c,t):null}const r=a.startsWith("intent://")?a:`intent://local/file/${a}`;return la(r,t)}function Dn(a,t){if(a.startsWith("workspace-file://")){const r=yt(a);if(!r||r.workspaceId!==t)return!1;const l=Sa(a);return!!l&&!!St(l,t)}return!!St(a,t,{readOnly:!0})}function Un(a,t){return(t===0||!a[t-1].trim())&&(t===a.length-1||!a[t+1].trim())}function zn(a,t,r){const l=r[0];return a.findIndex((c,u)=>{if(u<=t)return!1;const s=c.trim();return s.length>=r.length&&s.split("").every(o=>o===l)})}function Bn(a,t){const r=a.split(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/B6Eksue8.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/BAqR9jtB.js","/app/immutable/chunks/DiCMHWTR.js","/app/immutable/chunks/Cop9b2dY.js","/app/immutable/chunks/Bl_iEh1f.js","/app/immutable/chunks/BPk16bSc.js","/app/immutable/chunks/UyBYtOpv.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/C9gP-gRX.js","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/B2RRuLl5.js","/app/immutable/chunks/UuiGcpAE.js","/app/immutable/chunks/C11wqToa.js","/app/immutable/chunks/BlOn95cv.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/XzWc0fs1.js","/app/immutable/chunks/BRNfUSNR.js","/app/immutable/chunks/BSwWMzab.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/D5B1sycf.js","/app/immutable/chunks/DO2cS8JO.js","/app/immutable/chunks/7IyNIHph.js","/app/immutable/chunks/DKXEy5Lq.js","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/DH9gMPGd.js","/app/immutable/assets/dialog.BtQTVchw.css","/app/immutable/assets/observe-overflow.CJJmE3_P.css","/app/immutable/chunks/-URcs0EB.js","/app/immutable/chunks/C0VJEx2v.js","/app/immutable/chunks/BtAYzBSd.js","/app/immutable/chunks/DY6JypjK.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/Ccf4dYFA.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/7ZJvg7ev.js","/app/immutable/assets/pending-agent-deletions.UE5obH5A.css","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/chunks/BeP4UORy.js","/app/immutable/chunks/C5Nz-crT.js","/app/immutable/assets/SettingsPage.D8u26cHZ.css","/app/immutable/chunks/BgyuoEGq.js","/app/immutable/chunks/Bc-8qHYh.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/BMkc6ng0.js","/app/immutable/chunks/BJzHxIyr.js","/app/immutable/chunks/C80u9j_3.js","/app/immutable/chunks/BHqHNrOT.js","/app/immutable/chunks/CzRl1R1n.js","/app/immutable/chunks/D2uybU7F.js","/app/immutable/chunks/BOQCK4ni.js","/app/immutable/chunks/BW6fyv0T.js","/app/immutable/chunks/CJtH5G9P.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/CxO_9nE4.js","/app/immutable/assets/directory-picker-service.CzNEA6Ot.css","/app/immutable/chunks/B3W2oJ3u.js","/app/immutable/chunks/q4Mp6azq.js","/app/immutable/chunks/CzrG_lpv.js","/app/immutable/chunks/C8_w7W1W.js","/app/immutable/chunks/A3beYjJS.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/BGGxKX5q.js","/app/immutable/chunks/lkH5RFQO.js","/app/immutable/assets/AttachmentPreview.BCSCCZGm.css","/app/immutable/assets/DiagramPresentation.Bfi3xHm0.css","/app/immutable/chunks/CA7UZgrf.js","/app/immutable/assets/StreamingDiagramRenderer.BShsSvPz.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var za=Object.defineProperty;var Ba=(a,t,r)=>t in a?za(a,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[t]=r;var lt=(a,t,r)=>Ba(a,typeof t!="symbol"?t+"":t,r);import{bo as A,t as tt,bq as I,a_ as ie,by as at,b as rt,bs as Va,bu as Xt,_ as ka}from"./BAqR9jtB.js";import{bs as nt,a5 as N,aD as e,bA as L,b_ as Z,W as H,bn as st,c9 as E,aA as M,aB as z,ca as kt,bk as ya,c6 as Ka,cd as Wt,bV as ne,bS as O,ay as Fe,bl as me,bO as ge,ai as xa,a7 as Ut,c0 as ja,bf as Nt,bH as q,aw as He,aj as Ae,be as Ga,c3 as ut,bb as Mt,aF as Ya,br as Qa,bj as Xa}from"./DYhIMPy1.js";import{d as $a,f as Ja,k as qe,l as Ct,s as $,a as Ze,h as zt,i as Za}from"./BPk16bSc.js";import{aN as er,cU as tr,L as ar,av as rr,di as nr,V as sr,dl as Aa,B as or,$ as ir}from"./DY6JypjK.js";import{t as Bt}from"./7IyNIHph.js";import{a6 as cr,aj as lr,A as dr,o as ur,a3 as Ia,s as Vt,a2 as Kt,aA as yt,aX as Ma,n as fr,aC as pr,aW as mr}from"./A3beYjJS.js";import{l as $t}from"./CCCBFmfe.js";import{bI as gr,bF as vr,bG as Jt,ap as hr}from"./-URcs0EB.js";import{w as dt,P as br}from"./DO2cS8JO.js";import{f as jt,bc as Ht}from"./C9gP-gRX.js";import{t as Oe,v as wr,H as It,E as Zt,c as ea}from"./Bl_iEh1f.js";import{qW as Ca,Hp as ve,lY as _r,fA as kr,mT as yr,ts as xr,a as Ar,v3 as Ir,sc as Mr,qE as Cr,g as Sr,bi as ta,u8 as Rr,s0 as Er,ua as Pr}from"./BSwWMzab.js";import{c as Tr,l as ht}from"./ChTqQfQN.js";import{o as Fr}from"./CxO_9nE4.js";import{aP as Lr,aQ as aa,bz as Wr,aA as Nr,by as Hr,aE as qr,c_ as Or,cO as Dr,F as bt,ax as ra,bH as Ur,bC as zr}from"./DKXEy5Lq.js";import{l as Br}from"./C0VJEx2v.js";import{p as Vr,cV as wt,cU as na,an as Kr,cX as Sa,a7 as St,aD as Ra,aU as jr,av as Gr,a6 as sa,r as Yr,aL as Qr,aQ as Xr,F as $r}from"./CzrG_lpv.js";import{s as qt}from"./DiCMHWTR.js";import{b as et}from"./BaIAhI85.js";import{s as Jr}from"./XzWc0fs1.js";import{c as Zr,u as en,s as tn,a as an}from"./DfxQWSVU.js";import{N as oa,J as ia}from"./B6Eksue8.js";import{g as ca}from"./Cop9b2dY.js";import{X as la}from"./C8_w7W1W.js";const rn=new Set(["failed","blocked","needs_attention","in_progress"]),nn={failed:{visual:"icon",icon:Dr,className:"text-foreground"},blocked:{visual:"icon",icon:Or,className:"text-danger"},needs_attention:{visual:"icon",icon:qr,className:"text-warning-ink"},in_progress:{visual:"dot",icon:null,className:"workspace-status-color-active"},waiting:{visual:"icon",icon:Hr,className:"text-muted-foreground"},unread:{visual:"dot",icon:null,className:"workspace-status-color-unread"},not_started:{visual:"dot",icon:null,className:"text-muted-foreground/35"},idle:{visual:"dot",icon:null,className:"text-muted-foreground/35"},complete:{visual:"icon",icon:Nr,className:"text-success"},pr_queued:{visual:"icon",icon:Wr,className:"text-info"},pr_ready:{visual:"icon",icon:aa,className:"text-success"},pr_open:{visual:"icon",icon:aa,className:"text-info"},pr_merged:{visual:"icon",icon:Lr,className:"text-purple-500"}};function sn(a){switch(a){case"failed":return A.workspace_statusIcon_failed_label();case"blocked":return A.workspace_statusIcon_blocked_label();case"needs_attention":return A.workspace_statusIcon_needsAttention_label();case"in_progress":return A.workspace_statusIcon_inProgress_label();case"waiting":return A.workspace_taskStatus_waiting_label();case"unread":return A.layout_activeCard_unread_header();case"not_started":return A.workspace_statusIcon_notStarted_label();case"idle":return A.workspace_statusIcon_idle_label();case"complete":return A.workspace_statusIcon_complete_label();case"pr_queued":return A.workspace_statusIcon_prQueued_label();case"pr_ready":return A.workspace_statusIcon_prReady_label();case"pr_open":return A.workspace_statusIcon_prOpen_label();case"pr_merged":return A.workspace_statusIcon_prMerged_label()}}function on(a){const t=Ca(a.displayStatus)?a.displayStatus:"not_started";return rn.has(t)?t:a.attention==="unread"?"unread":a.waiting===!0?"waiting":t}function Ea(a){const t=a==="waiting"||a==="unread"||Ca(a)?a:"not_started",r=sn(t);return{state:t,...nn[t],label:r,tooltip:r,accessibleName:r}}var cn=z('<span class="workspace-status-dot svelte-14zk5l0" data-workspace-status-dot=""></span>'),ln=z("<span><!></span>");function Pa(a,t){if(new.target)return tt({component:Pa,...a});nt(t,!0);let r=I(t,"status",7),l=I(t,"size",7,14),c=I(t,"decorative",7,!1),u=I(t,"class",7);const s=E(()=>Ea(r()));var o={get status(){return r()},set status(m){r(m),M()},get size(){return l()},set size(m=14){l(m),M()},get decorative(){return c()},set decorative(m=!1){c(m),M()},get class(){return u()},set class(m){u(m),M()},$set:at,$on:(m,k)=>rt(t,m,k)},g=ln(),x=N(g);{var b=m=>{var k=cn();H(m,k)},w=m=>{bt(m,{get icon(){return e(s).icon},class:"size-full!"})};ie(x,m=>{e(s).visual==="dot"?m(b):e(s).icon&&m(w,1)})}return L(g),Z(m=>{qe(g,1,m,"svelte-14zk5l0"),Ct(g,`width: ${l()??""}px; height: ${l()??""}px;`),$(g,"role",c()?void 0:"img"),$(g,"aria-label",c()?void 0:e(s).accessibleName),$(g,"aria-hidden",c()?"true":void 0),$(g,"title",c()?void 0:e(s).tooltip),$(g,"data-workspace-status",e(s).state),$(g,"data-workspace-status-visual",e(s).visual),$(g,"data-workspace-status-icon",e(s).icon?.iconName)},[()=>$a(Ja("workspace-status-icon inline-flex shrink-0 items-center justify-center forced-colors:text-[CanvasText]",e(s).className,u()))]),H(a,g),st(o)}const Gt=6e4,Yt=60*Gt,Qt=24*Yt,da=30*Qt;function dn(a,t=new Date){if(a==null)return null;const r=a instanceof Date?a:new Date(a),l=r.getTime(),c=t.getTime();if(!Number.isFinite(l)||!Number.isFinite(c))return null;const u=Math.max(0,c-l);let s;u<Gt?s="<1m":u<Yt?s=`${Oe(Math.floor(u/Gt))}m`:u<Qt?s=`${Oe(Math.floor(u/Yt))}h`:u<da?s=`${Oe(Math.floor(u/Qt))}d`:s=`${Oe(Math.floor(u/da))}mo`;const o=l>c?t:r,g=wr(o,{now:t});return g?{compact:s,accessible:g,dateTime:r.toISOString()}:null}var un=z('<div><div class="grid gap-0.5 px-5 pt-4"><div class="flex min-w-0 items-center justify-between gap-3"><!> <!></div> <!> <!></div> <div class="my-3 border-t border-border" data-workspace-hover-card-divider=""></div> <div class="body-grid grid min-w-0 grid-cols-1 items-stretch gap-3 px-5 pb-4" data-workspace-hover-card-columns=""><div class="grid" data-workspace-hover-card-activity=""><!></div> <div class="pull-requests grid" data-workspace-hover-card-pr-column=""><!></div></div></div>'),fn=z('<p class="type-caption mt-1 min-w-0 line-clamp-3 text-muted-foreground" data-workspace-hover-card-summary=""> </p>'),pn=z('<span class="shrink-0 text-muted-foreground" data-workspace-hover-card-question-meta=""><span aria-hidden="true"> </span></span>'),mn=z('<span class="row-span-2 flex h-(--text-caption-line-height) items-center" aria-hidden="true"><!></span><span class="type-caption min-w-0 truncate text-foreground" data-workspace-hover-card-agent-name=""> </span><time class="type-caption whitespace-nowrap text-muted-foreground" data-workspace-hover-card-agent-time=""> </time> <span class="agent-detail type-caption flex min-w-0 items-start gap-1.5 text-muted-foreground svelte-1vax087" data-workspace-hover-card-agent-detail=""><span class="min-w-0 truncate" data-workspace-hover-card-agent-context=""> </span><!></span>',1),ua=z('<div role="listitem"><!></div>'),gn=z('<div class="type-caption mt-3 flex items-center justify-between text-muted-foreground" data-workspace-hover-card-overflow=""><span> </span> <!></div>'),vn=z('<section class="activity min-w-0" data-workspace-hover-card-activity="" data-workspace-hover-card-agent-table=""><div class="-mx-2 grid gap-2" role="list"></div> <!></section>'),hn=z('<!> <span class="type-caption min-w-0 truncate text-foreground" data-workspace-hover-card-pr-title=""> </span> <span class="type-caption shrink-0 text-muted-foreground" data-workspace-hover-card-pr-status=""> </span> <span class="type-caption shrink-0 text-muted-foreground" data-workspace-hover-card-pr-number=""> </span>',1),bn=z('<div class="grid w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)_auto_auto] items-center gap-x-2 rounded-sm px-2 py-0 text-left" data-workspace-hover-card-pr-row=""><!></div>'),wn=z('<div class="type-caption mt-3 flex items-center justify-between text-muted-foreground" data-workspace-hover-card-pr-overflow=""><span> </span> <!></div>'),_n=z('<section class="pull-requests min-w-0" data-workspace-hover-card-pr-column=""><div class="-mx-2 grid min-w-0 gap-2" role="list" data-workspace-hover-card-pr-list=""></div> <!></section>'),kn=z('<div class="my-3 border-t border-border" data-workspace-hover-card-divider=""></div> <div class="body-grid grid min-w-0 grid-cols-1 items-stretch gap-3 px-5 pb-4" data-workspace-hover-card-columns=""><!> <!></div>',1),yn=z('<header data-workspace-hover-card-header=""><div class="min-w-0" data-workspace-hover-card-identity=""><div class="flex min-w-0 items-center justify-between gap-3"><h2 class="type-body min-w-0 truncate font-medium text-foreground" data-workspace-hover-card-title=""> </h2> <span class="type-caption flex shrink-0 items-center gap-1.5 text-muted-foreground" data-workspace-hover-card-status=""><span class="truncate" data-workspace-hover-card-status-label=""> </span><!></span></div> <div class="type-caption mt-0.5 min-w-0 truncate text-muted-foreground" data-workspace-hover-card-repo=""> </div> <!></div></header> <!>',1),xn=z('<section class="workspace-hover-card shrink-0 overflow-hidden rounded-md bg-background text-left text-foreground shadow-(--elevation-overlay) ring-1 ring-border svelte-1vax087" data-workspace-hover-card="" data-workspace-hover-card-layout="landscape"><!></section>');function An(a,t){if(new.target)return tt({component:An,...a});nt(t,!0);const r=()=>Xt(T,"$workspaceAgents$",c),l=()=>Xt(i,"$prMonitors$",c),[c,u]=Va(),s=Tr("WorkspaceHoverCard");let o=I(t,"workspace",7),g=I(t,"isLoading",7,!1),x=I(t,"activeAgentIds",23,()=>[]),b=I(t,"loadAgentSessions",7,!0),w=I(t,"onkeydown",7),m=I(t,"staticData",7,!1);const k=Wt("");function U(){return m()?Wt([]):er(k)}function B(){return m()?Wt([]):tr(k)}const T=U(),i=B();kt(()=>k.set(o()?.id??""));let p=ne(0);ya(()=>$t.subscribe(()=>Ka(p)));let _=E(()=>o()?.agentSummary?.agentIds??[]),P=E(()=>(e(p),o()?$t.getStreamingAgentIdsForWorkspace(o().id):[])),D=null,Y=new Set;kt(()=>{if(!o()||!b())return;const d=String(o().id);D!==d&&(D=d,Y=new Set);for(const C of new Set([...e(_).slice(0,6),...x(),...e(P)]))Y.has(C)||(ve.dispatch(_r(d,C)),Y.add(C))});function se(d){return[d.name,d.context,d.questionMeta?.accessible,d.updated.accessible].filter(Boolean).join(". ")}function Ce(d){return d?d.kind==="attention"?d.attention.reason?.trim()||null:"text"in d&&d.text.trim()||null:null}function le(d){return dn(d.lastActivity||d.updatedAt||d.createdAt)??{compact:"—",accessible:A.workspace_hoverCard_noRecentActivity_label()}}function y(d){const C=String(d.status).toLowerCase(),F=yr(d),X=lr(d),be=X==="question"?gr(d):null,pe=Ce(rr.select(ve.state,String(d.id)));let we,Ee,_e,n,f,W,S=!1;if(X==="question"){we="attention",Ee="question",_e=be?.questions[0]?.question.trim()||pe||A.workspace_hoverCard_question_label(),n="question",f=1;const K=be?.questions.length??0;K>1&&(W={compact:`${Oe(1)}/${Oe(K)}`,accessible:A.chat_questionWizard_stepCounter_label({current:1,total:K})})}else if(X==="attention-discussion")we="attention",Ee="discussion",_e=F?.reason?.trim()||A.chat_agentCard_attentionDiscussion_label(),n="attention-discussion",f=1;else if(X==="attention-blocker"||C==="blocked")we="attention",Ee="blocker",_e=F?.reason?.trim()||A.chat_agentCard_attentionBlocker_label(),n="attention-blocker",f=0;else if(d.hasUnread)we="attention",Ee="unread",_e=pe||A.chat_newMessagesDivider_label(),S=!!pe,n="unread",f=2;else if(d.isStreaming||d.isProcessing||x().includes(String(d.id))||e(P).includes(String(d.id))||["active","busy","processing","responding","running","streaming","in_progress"].includes(C))we="active",_e=pe||A.workspace_devScripts_running_label(),S=!!pe,n=d.isProcessing?"responding":"running",f=3;else if(["waiting","pending","queued","starting"].includes(C))we="waiting",_e=pe||A.workspace_taskStatus_waiting_label(),S=!!pe,n="waiting",f=4;else return null;const j=d.agentMetadata??d.metadata;return{id:String(d.id),name:d.name?.trim()||A.workspace_fileChanges_agent_label(),group:we,attentionKind:Ee,avatarState:n,specialist:j?.specialist,context:_e,questionMeta:W,contextIsPreview:S,updated:le(d),priority:f}}let Q=E(()=>{const d=o()?.agentSummary,C=new Map;if(Array.isArray(d?.agents))for(const F of d.agents)F&&typeof F=="object"&&typeof F.id=="string"&&C.set(F.id,F.parentAgentId);return r().filter(F=>{const X=C.get(String(F.id));return!(kr(F)!=="topLevel"||typeof X=="string"&&X||F.pendingDeleteAt||F.retiredAt||String(F.status).toLowerCase()==="deleted")})}),oe=E(()=>e(Q).map(y).filter(d=>d!==null).sort((d,C)=>d.priority-C.priority)),Le=E(()=>e(oe).slice(0,6)),Me=E(()=>Math.max(0,e(oe).length-6)),fe=E(()=>o()?.repositoryName?o().repositoryOwner?`${o().repositoryOwner} / ${o().repositoryName}`:o().repositoryName:A.workspace_hoverCard_localRepository_label()),Ve=E(()=>on(o()??{})),ke=E(()=>Ea(e(Ve))),ee=E(()=>o()?.statusMessage?.trim()||"");function Se(d){if(!d)return null;const C=d.activePullRequest??d.pullRequests?.[0]??null;return C||(d.prStatus?{id:`legacy-pr-${d.prNumber??"workspace"}`,number:d.prNumber??0,url:d.prUrl??"",title:A.workspace_hoverCard_pullRequest_label(),status:d.prStatus,createdAt:d.updatedAt,updatedAt:d.updatedAt}:null)}let ft=E(()=>o()?m()?Se(o()):nr.select(ve.state,o().id)??Se(o()):null),Ie=E(()=>{if(!o()||ar(o()))return[];const d=o().repositoryOwner&&o().repositoryName?`${o().repositoryOwner}/${o().repositoryName}`:void 0;return cr({workspacePRs:o().pullRequests,activePR:e(ft),monitors:l(),workspaceRepo:d,buildPrUrl:(C,F)=>Vr(C,o().repositoryOwner,o().repositoryName,F),getDisplayTitle:C=>C.title})}),ot=E(()=>e(Ie).slice(0,3)),De=E(()=>Math.max(0,e(Ie).length-3)),ce=E(()=>e(oe).length>0),Ke=E(()=>e(Ie).length>0),v=E(()=>e(ce)||e(Ke));function h(d){const C=d.resource?.repository.provider==="gitlab"?`${d.repo} !${d.number}`:d.repo?A.workspace_card_prBadge_repoLine_tooltip({repo:d.repo,number:d.number}):A.workspace_card_prBadge_label({number:` #${d.number}`});return[sr(C,d),d.title,d.details].filter(Boolean).join(`
|
|
3
|
+
`)}function ae(d,C){if(d.stopPropagation(),!o()||!b())return;const F=o().id;Br.select(ve.state)!==F&&Fr(F).catch(X=>{s.warn("Failed to switch workspace for hover-card agent",{agentId:C,error:X})}),ve.dispatch(xr(F,{agentId:C}))}function V(d,C){if(d.stopPropagation(),!o()||!C.url)return;const F=o().id;ka(async()=>{const{handleLink:X}=await import("./B6Eksue8.js").then(be=>be.Q);return{handleLink:X}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56]),import.meta.url).then(({handleLink:X})=>X(C.url,{workspaceId:F,event:d}))}var te={get workspace(){return o()},set workspace(d){o(d),M()},get isLoading(){return g()},set isLoading(d=!1){g(d),M()},get activeAgentIds(){return x()},set activeAgentIds(d=[]){x(d),M()},get loadAgentSessions(){return b()},set loadAgentSessions(d=!0){b(d),M()},get onkeydown(){return w()},set onkeydown(d){w(d),M()},get staticData(){return m()},set staticData(d=!1){m(d),M()},$set:at,$on:(d,C)=>rt(t,d,C)},he=xn(),re=N(he);{var Re=d=>{var C=un(),F=N(C),X=N(F),be=N(X);dt(be,{class:"h-7 min-w-0 max-w-64 flex-1"});var pe=O(be,2);dt(pe,{class:"h-5 w-20 shrink-0"}),L(X);var we=O(X,2);dt(we,{class:"h-4 w-40"});var Ee=O(we,2);dt(Ee,{class:"mt-2 h-10 w-full"}),L(F);var _e=O(F,4),n=N(_e),f=N(n);dt(f,{class:"h-10 w-full"}),L(n);var W=O(n,2),S=N(W);dt(S,{class:"h-10 w-full"}),L(W),L(_e),L(C),H(d,C)},Ue=d=>{var C=yn(),F=Fe(C);let X;var be=N(F),pe=N(be),we=N(pe),Ee=me(we,!0),_e=O(we,2),n=N(_e),f=me(n,!0),W=O(n);Pa(W,{get status(){return e(Ve)},size:16,decorative:!0}),L(_e),L(pe);var S=O(pe,2),j=me(S,!0),K=O(S,2);{var J=ue=>{var We=fn(),xt=me(We,!0);Ze(We,(At,Rt)=>Bt?.(At,Rt),()=>e(ee)),Z(()=>ge(xt,e(ee))),H(ue,We)};ie(K,ue=>{e(ee)&&ue(J)})}L(be),L(F);var Pe=O(F,2);{var de=ue=>{var We=kn(),xt=O(Fe(We),2),At=N(xt);{var Rt=Ye=>{var ze=vn(),Ge=N(ze);zt(Ge,21,()=>e(Le),G=>G.id,(G,R)=>{var ye=ua(),Qe=N(ye);{let Xe=E(()=>se(e(R)));jt(Qe,{variant:"plain",wrapContent:!1,class:"grid h-auto! min-h-8 w-full min-w-0 cursor-pointer grid-cols-[1rem_minmax(0,1fr)_auto] items-start justify-normal gap-x-2 gap-y-0 whitespace-normal rounded-sm border-0! px-2! py-0! text-left font-normal transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",get"aria-label"(){return e(Xe)},"data-workspace-hover-card-agent-row":!0,get"data-agent-group-row"(){return e(R).group},get"data-attention-kind"(){return e(R).attentionKind},get onkeydown(){return w()},onclick:Be=>ae(Be,e(R).id),children:(Be,pt)=>{var Te=mn(),xe=Fe(Te),Ne=N(xe);{let Je=E(()=>e(R).specialist??null);dr(Ne,{get agentId(){return e(R).id},variant:"compact",get state(){return e(R).avatarState},get specialist(){return e(Je)}})}L(xe);var it=O(xe),Tt=me(it,!0),$e=O(it),Ft=me($e,!0),mt=O($e,2),gt=N(mt),Lt=me(gt,!0);Ze(gt,(Je,ct)=>Bt?.(Je,ct),()=>e(R).context);var qa=O(gt);{var Oa=Je=>{var ct=pn(),Da=N(ct),Ua=me(Da,!0);L(ct),Z(()=>{$(ct,"aria-label",e(R).questionMeta.accessible),ge(Ua,e(R).questionMeta.compact)}),H(Je,ct)};ie(qa,Je=>{e(R).questionMeta&&Je(Oa)})}L(mt),Z(()=>{ge(Tt,e(R).name),$($e,"datetime",e(R).updated.dateTime),$($e,"aria-label",e(R).updated.accessible),ge(Ft,e(R).updated.compact),$(mt,"data-workspace-hover-card-agent-preview",e(R).contextIsPreview||void 0),ge(Lt,e(R).context)}),H(Be,Te)},$$slots:{default:!0}})}L(ye),H(G,ye)}),L(Ge);var Et=O(Ge,2);{var Pt=G=>{var R=gn(),ye=N(R),Qe=me(ye,!0),Xe=O(ye,2);bt(Xe,{get icon(){return ra},size:10}),L(R),Z(Be=>ge(Qe,Be),[()=>A.workspace_hoverCard_moreAgents_label({count:Oe(e(Me))})]),H(G,R)};ie(Et,G=>{e(Me)&&G(Pt)})}L(ze),Z(G=>$(ze,"aria-label",G),[()=>A.workspace_multiSelectSidebar_agentsTab_label()]),H(Ye,ze)};ie(At,Ye=>{e(ce)&&Ye(Rt)})}var Na=O(At,2);{var Ha=Ye=>{var ze=_n(),Ge=N(ze);zt(Ge,21,()=>e(ot),G=>G.identity,(G,R)=>{var ye=ua();{const pt=Te=>{var xe=hn(),Ne=Fe(xe);bt(Ne,{get icon(){return e(R).statusIcon},size:16,get class(){return`shrink-0 justify-self-start ${e(R).foregroundClass??""}`}});var it=O(Ne,2),Tt=me(it,!0),$e=O(it,2),Ft=me($e,!0),mt=O($e,2),gt=me(mt,!0);Z(Lt=>{ge(Tt,Lt),ge(Ft,e(R).accessibleStateLabel),ge(gt,e(R).numberLabel??`#${e(R).number}`)},[()=>e(R).title||(e(R).resource?.repository.provider==="gitlab"?A.workspace_hoverCard_mergeRequest_label():A.workspace_hoverCard_pullRequest_label())]),H(Te,xe)};var Qe=N(ye);{var Xe=Te=>{{let xe=E(()=>h(e(R)));jt(Te,{variant:"plain",wrapContent:!1,class:"grid h-auto! w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)_auto_auto] items-center justify-normal gap-x-2 whitespace-normal rounded-sm border-0! px-2! py-0! text-left font-normal transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",get"aria-label"(){return e(xe)},"data-workspace-hover-card-pr-row":!0,get"data-pr-identity"(){return e(R).identity},get"data-pr-status"(){return e(R).status},get onkeydown(){return w()},onclick:Ne=>V(Ne,e(R)),children:(Ne,it)=>{pt(Ne)},$$slots:{default:!0}})}},Be=Te=>{var xe=bn(),Ne=N(xe);pt(Ne),L(xe),Z(()=>{$(xe,"data-pr-identity",e(R).identity),$(xe,"data-pr-status",e(R).status)}),H(Te,xe)};ie(Qe,Te=>{e(R).url?Te(Xe):Te(Be,-1)})}L(ye)}Z(pt=>$(ye,"aria-label",pt),[()=>e(R).url?void 0:h(e(R))]),H(G,ye)}),L(Ge);var Et=O(Ge,2);{var Pt=G=>{var R=wn(),ye=N(R),Qe=me(ye,!0),Xe=O(ye,2);bt(Xe,{get icon(){return ra},size:10}),L(R),Z(Be=>ge(Qe,Be),[()=>A.workspace_hoverCard_moreItems_label({count:Oe(e(De))})]),H(G,R)};ie(Et,G=>{e(De)&&G(Pt)})}L(ze),Z((G,R)=>{$(ze,"aria-label",G),$(Ge,"aria-label",R)},[()=>e(Ie).every(G=>G.resource?.repository.provider==="gitlab")?A.workspace_hoverCard_mergeRequests_label():e(Ie).some(G=>G.resource?.repository.provider==="gitlab")?A.workspace_hoverCard_reviews_label():A.workspace_hoverCard_pullRequests_label(),()=>e(Ie).every(G=>G.resource?.repository.provider==="gitlab")?A.workspace_hoverCard_mergeRequests_label():e(Ie).some(G=>G.resource?.repository.provider==="gitlab")?A.workspace_hoverCard_reviews_label():A.workspace_hoverCard_pullRequests_label()]),H(Ye,ze)};ie(Na,Ye=>{e(Ke)&&Ye(Ha)})}L(xt),H(ue,We)};ie(Pe,ue=>{e(v)&&ue(de)})}Z(ue=>{X=qe(F,1,"min-w-0 px-5 pt-4",null,X,{"pb-4":!e(v)}),ge(Ee,ue),ge(f,e(ke).label),ge(j,e(fe))},[()=>o().title||A.workspace_links_untitled_label()]),H(d,C)};ie(re,d=>{g()||!o()?d(Re):d(Ue,-1)})}L(he),H(a,he);var je=st(te);return u(),je}const fa=800,Ss=175,In=300;function Mn(){let a=0,t=null;const r=new Set,l=new Set;function c(){return a>0||t!==null?0:fa}function u(){const o=c();r.forEach(g=>g(o))}function s(){t!==null&&(clearTimeout(t),t=null)}return{get currentOpenDelay(){return c()},subscribe(o){return r.add(o),o(c()),()=>r.delete(o)},notifyOpened(){const o=a===0&&t===null;s(),a+=1,o&&u()},notifyClosed(){a!==0&&(a-=1,!(a>0)&&(s(),t=setTimeout(()=>{t=null,u()},In)))},deferClose(o){return l.add(o),()=>l.delete(o)},settleDeferredCloses(){const o=[...l];l.clear(),o.forEach(g=>g())},reset(){const o=c()!==fa;s(),a=0,l.clear(),o&&u()}}}const Rs=Mn();function Ot(a){const t=Aa.select(ve.state,a);return t!==void 0&&Cr(t)}function Cn(a,t){if(!Ot(a))return[];const r=vr.select(ve.state,a),l=Jt.select(ve.state,a),c=hr.select(ve.state),u=[];for(let s=0;s<Ar;s+=1){const o=c[s],g=o&&o!==a?Aa.select(ve.state,o):void 0;u.push({id:`assign-micro-key-${s+1}`,label:g?A.workspace_card_assignOccupiedMicroKey_label({number:Oe(s+1),title:g.title}):A.workspace_card_assignMicroKeyNumber_label({number:Oe(s+1)}),checked:r===s,closeOnSelect:!0,onClick:()=>{Ot(a)&&ve.dispatch(Ir(s,a)),t()}})}return l!==null&&(u.push({type:"separator"}),u.push({id:"unassign-micro-key",label:A.workspace_card_unassignMicroKey_label(),onClick:()=>{Ot(a)&&Jt.select(ve.state,a)===l&&ve.dispatch(Mr(l)),t()}})),u}function Es(a,{connected:t,onClose:r}){if(!t)return[];const l=Cn(a,r);if(l.length===0)return[];const c=l.filter(s=>"id"in s&&s.id!=="unassign-micro-key"),u=l.find(s=>"id"in s&&s.id==="unassign-micro-key");return[{id:"assign-micro-key",label:A.workspace_card_assignMicroKey_label(),icon:Ur,onClick:()=>{},selection:"single",submenu:c},...u?[u]:[]]}var Sn=z('<div data-static-position="" role="tooltip"><!></div>'),pa=z('<div role="tooltip"><!></div>');function Rn(a,t){if(new.target)return tt({component:Rn,...a});nt(t,!0);let r=I(t,"id",7),l=I(t,"anchor",7),c=I(t,"position",7,"right"),u=I(t,"absolute",7,!1),s=I(t,"anchorElement",7,null),o=I(t,"staticPosition",7,!1),g=I(t,"class",7,""),x=I(t,"children",7),b=I(t,"onmouseenter",7),w=I(t,"onmouseleave",7),m=I(t,"onfocusin",7),k=I(t,"onfocusout",7);const U=Zr(en()+2);tn(U);const B=an(U),T=8,i=4;let p=ne(null),_=ne(""),P=ne(void 0);const D=E(()=>c()==="bottom-right"||c()==="bottom-left"),Y=E(()=>c()==="top"),se=E(()=>o()?"relative":u()?"absolute":"fixed"),Ce=E(()=>c()==="right"?{x:-4,y:0}:c()==="bottom"?{x:4,y:0}:e(Y)?{x:0,y:4}:{x:0,y:-4});function le(v,h,ae){return Math.max(h,Math.min(ae,v))}let y=null,Q=null;function oe(){return!y?.isConnected||Q!==l()?!1:y.style.getPropertyValue("anchor-name").includes(l())||getComputedStyle(y).getPropertyValue("anchor-name").includes(l())}function Le(){return s()?s():(oe()||(y=Array.from(document.querySelectorAll('[style*="anchor-name"]')).find(v=>{const h=v.style.getPropertyValue("anchor-name"),ae=getComputedStyle(v).getPropertyValue("anchor-name");return h.includes(l())||ae.includes(l())})??null,Q=y?l():null),y)}function Me(){if(o()||u()||!e(p))return;const v=Le();if(!v)return;const h=v.getBoundingClientRect(),ae=e(p).getBoundingClientRect(),V=window.innerWidth||document.documentElement.clientWidth,te=window.innerHeight||document.documentElement.clientHeight,he=ae.width||e(p).offsetWidth,re=ae.height||e(p).offsetHeight,Re=Math.max(0,h.top-i-T),Ue=Math.max(0,te-h.bottom-i-T),je=e(Y)?!(Re<re&&Ue>Re):e(D)&&Ue<re&&Re>Ue;let d=h.left,C=h.bottom+i,F=je?Re:Ue;if(c()==="right"){const X=h.left-i-T,be=V-h.right-i-T;d=be>=he||be>=X?h.right+i:h.left-he-i,C=h.top,F=Math.max(0,te-T*2)}else c()==="bottom"?(d=h.left-he-i,C=h.bottom-re):(e(Y)||e(D))&&(c()==="bottom-left"?d=h.right-he:e(Y)&&(d=h.left+h.width/2-he/2),C=je?h.top-Math.min(re,F)-i:h.bottom+i);d=le(d,T,Math.max(T,V-he-T)),C=le(C,T,Math.max(T,te-Math.min(re,F)-T)),q(P,`${F}px`),q(_,`left: ${d}px; top: ${C}px;`)}let fe=!1;async function Ve(){fe||(fe=!0,await ja(),fe=!1,Me())}let ke=null;function ee(){ke||(ke=Jr(()=>{ke=null,Me()}))}function Se(v){const h=s()??(oe()?y:null);h&&v.target instanceof Node&&!v.target.contains(h)||ee()}kt(()=>{const v=e(p),h=s();o()||u()||!v||!h||Ve()}),ya(()=>{if(o())return;let v=null;return Ve().then(()=>{if(!u()&&typeof ResizeObserver<"u"){v=new ResizeObserver(ee),e(p)&&v.observe(e(p));const h=Le();h&&v.observe(h)}}),window.addEventListener("resize",ee),window.addEventListener("scroll",Se,!0),()=>{v?.disconnect(),window.removeEventListener("resize",ee),window.removeEventListener("scroll",Se,!0),ke?.(),ke=null}});var ft={get id(){return r()},set id(v){r(v),M()},get anchor(){return l()},set anchor(v){l(v),M()},get position(){return c()},set position(v="right"){c(v),M()},get absolute(){return u()},set absolute(v=!1){u(v),M()},get anchorElement(){return s()},set anchorElement(v=null){s(v),M()},get staticPosition(){return o()},set staticPosition(v=!1){o(v),M()},get class(){return g()},set class(v=""){g(v),M()},get children(){return x()},set children(v){x(v),M()},get onmouseenter(){return b()},set onmouseenter(v){b(v),M()},get onmouseleave(){return w()},set onmouseleave(v){w(v),M()},get onfocusin(){return m()},set onfocusin(v){m(v),M()},get onfocusout(){return k()},set onfocusout(v){k(v),M()},$set:at,$on:(v,h)=>rt(t,v,h)},Ie=Ut(),ot=Fe(Ie);{var De=v=>{var h=Sn(),ae=N(h);qt(ae,()=>x()??Nt),L(h),et(h,V=>q(p,V),()=>e(p)),Z(()=>{$(h,"id",r()),qe(h,1,e(se)+` z-50 w-64 flex flex-col overflow-y-auto border border-border pointer-events-auto ${B} `+g()),$(h,"data-surface-level",U)}),H(v,h)},ce=v=>{var h=pa();let ae;var V=N(h);qt(V,()=>x()??Nt),L(h),et(h,te=>q(p,te),()=>e(p)),Z(()=>{$(h,"id",r()),qe(h,1,e(se)+` z-50 w-64 flex flex-col border border-border pointer-events-none ${B} `+g()),$(h,"data-surface-level",U),ae=Ct(h,"",ae,{"position-anchor":l(),right:c()==="bottom"?"anchor(left)":void 0,left:c()==="right"?"anchor(right)":e(D)?"anchor(left)":e(Y)?"anchor(center)":void 0,top:c()==="right"?"anchor(top)":e(D)?"anchor(bottom)":void 0,bottom:c()==="bottom"?"anchor(bottom)":e(Y)?"anchor(top)":void 0,"margin-right":c()==="bottom"?"8px":void 0,"margin-left":c()==="right"?"8px":void 0,"margin-top":e(D)?"4px":void 0,"margin-bottom":e(Y)?"4px":void 0,translate:e(Y)?"-50% 0":void 0})}),He("mouseenter",h,function(...te){b()?.apply(this,te)}),He("mouseleave",h,function(...te){w()?.apply(this,te)}),Ae("focusin",h,function(...te){m()?.apply(this,te)}),Ae("focusout",h,function(...te){k()?.apply(this,te)}),It(1,h,()=>Zt,()=>({tier:"fast",...e(Ce),scale:.96})),It(2,h,()=>ea,()=>({tier:"fast"})),H(v,h)},Ke=v=>{br(v,{zIndex:50,children:(h,ae)=>{var V=pa();let te;var he=N(V);qt(he,()=>x()??Nt),L(V),et(V,re=>q(p,re),()=>e(p)),Z(()=>{$(V,"id",r()),qe(V,1,e(se)+` z-50 w-64 flex flex-col overflow-y-auto border border-border pointer-events-auto ${B} `+g()),$(V,"data-surface-level",U),te=Ct(V,e(_),te,{"max-height":e(P)})}),He("mouseenter",V,function(...re){b()?.apply(this,re)}),He("mouseleave",V,function(...re){w()?.apply(this,re)}),Ae("focusin",V,function(...re){m()?.apply(this,re)}),Ae("focusout",V,function(...re){k()?.apply(this,re)}),It(1,V,()=>Zt,()=>({tier:"fast",...e(Ce),scale:.96})),It(2,V,()=>ea,()=>({tier:"fast"})),H(h,V)},$$slots:{default:!0}})};ie(ot,v=>{o()?v(De):u()?v(ce,1):v(Ke,-1)})}return H(a,Ie),st(ft)}xa(["focusin","focusout"]);function _t(a,t){return t||/^(?:https?:|data:|blob:|workspace-asset:)/i.test(a.trim())}function En(a,t){if(t||!a)return a;const r=document.createElement("template");r.innerHTML=a;for(const l of r.content.querySelectorAll("img, video")){const c=l.getAttribute("src")||l.getAttribute("data-media-src")||"",u=[...l.querySelectorAll("source")];if(!_t(c,!1)||u.some(o=>!_t(o.getAttribute("src")||"",!1))){const o=document.createElement("img");o.setAttribute("alt",l.getAttribute("alt")||l.getAttribute("data-name")||""),o.setAttribute("data-media-unavailable","node-owned"),l.replaceWith(o);continue}l.removeAttribute("srcset");const s=l.getAttribute("poster");s&&!_t(s,!1)&&l.removeAttribute("poster")}return r.innerHTML}const Pn=[/(^|[^\\])\$(?!\$)(?=\S)(?:\\.|[^\\$\n])+?\$(?!\$)/,/(^|[^\\])\\\((?:\\.|[^\\\n])*?\\\)/,/^(?: {0,3})(?:\$\$|\\\[)/m,/^\s*[-*]\s*\[[ x]\]/m,/```/,/`[^`]+`/,/\|.*\|/,/\[.*\]\(.*\)/,/!\[.*\]\(.*\)/,/<[a-z][\s\S]*>/i,/^#{1,6}\s/m,/^\s*>\s/m,/\*\*[^*]+\*\*/,/\*[^*]+\*/,/_[^_]+_/,/~~[^~]+~~/,/^[-*_]{3,}\s*$/m,/^\s*[-*+]\s/m,/^\s*\d+\.\s/m];function Tn(a){return a&&(Pn.some(t=>t.test(a))||or(a,"markdown"))?"static":"simple"}var Fn=z("<!> <!>",1);function Ta(a,t){if(new.target)return tt({component:Ta,...a});nt(t,!0);let r=I(t,"workspaceId",7),l=I(t,"canUseMedia",7),c=ne(null),u=ne(null),s=ne(!1),o=ne(!1);function g(_){q(c,{url:_.getAttribute("src")||"",name:_.getAttribute("alt")||void 0,opener:_},!0),q(s,!0)}function x(_){const P=na(_.getAttribute("href")||"",r());return P&&l()(P)?(q(c,{url:P,name:_.textContent?.trim()||void 0,opener:_,assetLink:!0},!0),q(s,!0),!0):b(_)}function b(_){const P=wt(_.getAttribute("href")||"",r());return!P||!l()(P.url)?!1:(q(u,{url:P.url,mimeType:P.mimeType,name:_.textContent?.trim()||void 0,opener:_},!0),q(o,!0),!0)}kt(()=>{e(u)&&!wt(e(u).url,r())&&(q(o,!1),q(u,null)),e(c)?.assetLink&&!na(e(c).url,r())&&(q(s,!1),q(c,null))});var w={openImage:g,openAsset:x,get workspaceId(){return r()},set workspaceId(_){r(_),M()},get canUseMedia(){return l()},set canUseMedia(_){l(_),M()},$set:at,$on:(_,P)=>rt(t,_,P)},m=Fn(),k=Fe(m);{var U=_=>{ur(_,{get imageUrl(){return e(c).url},get imageName(){return e(c).name},get openerElement(){return e(c).opener},showActionsMenu:!0,get open(){return e(s)},set open(P){q(s,P,!0)}})},B=E(()=>e(c)&&l()(e(c).url));ie(k,_=>{e(B)&&_(U)})}var T=O(k,2);{var i=_=>{Ia(_,{get videoUrl(){return e(u).url},get videoName(){return e(u).name},get mimeType(){return e(u).mimeType},sourceKind:"workspace",get openerElement(){return e(u).opener},get open(){return e(o)},set open(P){q(o,P,!0)}})},p=E(()=>e(u)&&wt(e(u).url,r())&&l()(e(u).url));ie(T,_=>{e(p)&&_(i)})}return H(a,m),st(w)}var Ln=z('<div class="flex items-center gap-2"><!> <!></div>'),Wn=z('<div class="absolute inset-0 flex items-center justify-center bg-muted text-muted-foreground" aria-hidden="true"><svg viewBox="0 0 24 24" class="size-10" fill="none"><rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor"></rect><path d="m10 9 5 3-5 3V9Z" fill="currentColor"></path></svg></div> <video preload="metadata" playsinline="" tabindex="-1" aria-hidden="true"></video> <span class="absolute inset-0 flex items-center justify-center bg-black/10 transition-colors group-hover:bg-black/20 motion-reduce:transition-none forced-colors:bg-transparent" aria-hidden="true"><span class="flex size-11 items-center justify-center rounded-full border border-white/70 bg-black/60 text-white shadow-(--elevation-raised) forced-colors:border forced-colors:bg-[Canvas] forced-colors:text-[CanvasText]"><svg viewBox="0 0 20 20" class="ml-0.5 size-5" fill="currentColor"><path d="m7 5 7 5-7 5V5Z"></path></svg></span></span>',3),Nn=z('<div class="group relative aspect-video w-full max-h-40 max-w-2xl" style="width: min(100%, calc(10rem * 16 / 9));"><!> <!></div>'),Hn=z('<div class="my-2 min-w-0 max-w-2xl" data-chat-video=""><!></div> <!>',1);function Fa(a,t){if(new.target)return tt({component:Fa,...a});nt(t,!0);let r=I(t,"source",7),l=I(t,"name",23,()=>A.chat_videoBlock_fromAgent_label()),c=I(t,"poster",7),u=I(t,"allowFileMedia",7,!0),s=I(t,"canOpenFile",7),o=ne(!1),g=ne(!1),x=ne(!1),b=ne(null);const w=E(()=>r().kind==="inline"?`data:${r().mimeType};base64,${r().data}`:r().url);function m(y){return _t(y,u()&&s()?.()!==!1)}const k=E(()=>!m(e(w))),U=E(()=>yt(e(w))),B=E(()=>{if(!(!c()||!m(c()))){if(/^data:image\/(?:gif|jpeg|png|webp);base64,[a-z0-9+/=]+$/i.test(c()))return c();try{const y=new URL(c());return(y.protocol==="https:"||y.protocol==="workspace-file:")&&!y.username&&!y.password?c():void 0}catch{return}}});function T(){q(g,!0),q(x,!1)}var i={get source(){return r()},set source(y){r(y),M()},get name(){return l()},set name(y=A.chat_videoBlock_fromAgent_label()){l(y),M()},get poster(){return c()},set poster(y){c(y),M()},get allowFileMedia(){return u()},set allowFileMedia(y=!0){u(y),M()},get canOpenFile(){return s()},set canOpenFile(y){s(y),M()},$set:at,$on:(y,Q)=>rt(t,y,Q)},p=Hn(),_=Fe(p),P=N(_);{var D=y=>{Vt(y,{get name(){return l()},reason:"load-failed"})},Y=y=>{var Q=Ln(),oe=N(Q);{let Me=E(()=>e(U)?.path),fe=E(()=>e(U)?.workspaceId);Vt(oe,{get name(){return l()},reason:"load-failed",get path(){return e(Me)},get workspaceId(){return e(fe)}})}var Le=O(oe,2);Kt(Le,{get videoUrl(){return e(w)},get videoName(){return l()},get sourceKind(){return r().kind},get mimeType(){return r().mimeType}}),L(Q),H(y,Q)},se=y=>{var Q=Nn(),oe=N(Q);{let Me=E(()=>A.chat_videoBlock_play_ariaLabel({name:l()}));jt(oe,{type:"button",variant:"ghost",size:"default",class:"relative block size-full cursor-pointer overflow-hidden rounded-lg border border-border bg-muted/40 p-0 shadow-(--elevation-raised) focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 forced-colors:border",get"aria-label"(){return e(Me)},"data-testid":"chat-video-snapshot",onclick:()=>{m(e(w))&&q(o,!0)},get ref(){return e(b)},set ref(fe){q(b,fe,!0)},children:(fe,Ve)=>{var ke=Wn(),ee=O(Fe(ke),2);ee.muted=!0,Ga(2),Z(()=>{$(ee,"src",e(w)),$(ee,"poster",e(B)),qe(ee,1,`pointer-events-none absolute inset-0 size-full object-contain transition-opacity motion-reduce:transition-none ${e(B)||e(g)&&!e(x)?"opacity-100":"opacity-0"}`)}),He("loadeddata",ee,T),He("error",ee,()=>q(x,!0)),H(fe,ke)},$$slots:{default:!0}})}var Le=O(oe,2);Kt(Le,{get videoUrl(){return e(w)},get videoName(){return l()},get sourceKind(){return r().kind},get mimeType(){return r().mimeType},triggerClass:"absolute right-1.5 top-1.5 opacity-0 transition-opacity focus-visible:opacity-100 group-focus-within:opacity-100 group-hover:opacity-100 data-[state=open]:opacity-100"}),L(Q),H(y,Q)};ie(P,y=>{e(k)?y(D):e(x)?y(Y,1):y(se,-1)})}L(_);var Ce=O(_,2);{var le=y=>{Ia(y,{get videoUrl(){return e(w)},get videoName(){return l()},get poster(){return e(B)},get sourceKind(){return r().kind},get mimeType(){return r().mimeType},get openerElement(){return e(b)},get open(){return e(o)},set open(Q){q(o,Q,!0)}})};ie(Ce,y=>{!e(x)&&!e(k)&&y(le)})}return H(a,p),st(i)}const qn=/^\s*!\[([^\]\n]*)\]\((?:<)?((?:intent:\/\/local\/|workspace-file:\/\/|workspace-asset:\/\/)[^)\s>]+)(?:>)?\)\s*$/,On=/^ {0,3}(`{3,}|~{3,})(.*)$/;function ma(a,t){if(typeof a!="string"||!a||a!==a.trim())return null;if(a.startsWith("workspace-asset://"))return wt(a,t);if(a.startsWith("workspace-file://")){const l=yt(a);if(!l||l.workspaceId!==t)return null;const c=Sa(a);return c?la(c,t):null}const r=a.startsWith("intent://")?a:`intent://local/file/${a}`;return la(r,t)}function Dn(a,t){if(a.startsWith("workspace-file://")){const r=yt(a);if(!r||r.workspaceId!==t)return!1;const l=Sa(a);return!!l&&!!St(l,t)}return!!St(a,t,{readOnly:!0})}function Un(a,t){return(t===0||!a[t-1].trim())&&(t===a.length-1||!a[t+1].trim())}function zn(a,t,r){const l=r[0];return a.findIndex((c,u)=>{if(u<=t)return!1;const s=c.trim();return s.length>=r.length&&s.split("").every(o=>o===l)})}function Bn(a,t){const r=a.split(`
|
|
4
4
|
`),l=[];let c=[];const u=()=>{const s=c.join(`
|
|
5
5
|
`);s.trim()&&l.push({type:"markdown",content:s}),c=[]};for(let s=0;s<r.length;s+=1){const o=r[s].match(On);if(o){const k=zn(r,s,o[1]);if(k>s){const U=r.slice(s,k+1);if(o[2].trim()==="ws-block:video")try{const B=JSON.parse(r.slice(s+1,k).join(`
|
|
6
|
-
`)),T=ma(B?.path,t);if(T){u(),l.push({type:"video",source:T,name:typeof B.path=="string"?B.path:void 0,poster:typeof B.poster=="string"?B.poster:void 0}),s=k;continue}}catch{}c.push(...U),s=k;continue}c.push(...r.slice(s));break}const x=!/^(?: {4}|\t)/.test(r[s])&&Un(r,s)?r[s].match(qn):null;if(!x){c.push(r[s]);continue}const[,b,w]=x,m=ma(w,t);m?(u(),l.push({type:"video",source:m,name:b||void 0})):w.startsWith("workspace-asset://")&&!Kr(w)||Dn(w,t)?c.push(r[s]):c.push(`[${b}](${w})`)}return u(),l}function vt(a){return Ma(a.getAttribute("src")||"")}function Dt(a){return a instanceof HTMLImageElement?a:a instanceof HTMLAnchorElement?a.querySelector("img"):null}function Vn(a,t){const r=a.getBoundingClientRect(),l=t.getBoundingClientRect();return{top:r.top-l.top+6,right:l.right-r.right+6}}function ga(a,t){const r=document.activeElement;return!!(r&&(r===a||r===a?.closest("a")||t?.contains(r)))}function Kn(a,t){const r=a.getAttribute("src")||"",l=yt(r)?.path??Ra(r,t)?.path;if(l)return l;if(r.startsWith("workspace-asset://")){const c=r.split(/[?#]/)[0].split("/").pop();if(c)return c}if(r&&!/^[a-z][a-z0-9+.-]*:/i.test(r)&&!r.startsWith("//"))try{return decodeURI(r)}catch{return r}return a.getAttribute("alt")||void 0}const La="data-image-sized",va=a=>typeof a=="number"&&Number.isInteger(a)&&a>0;function jn(a){try{return encodeURI(a).replace(/%25/g,"%")}catch{return null}}function Gn(a){return a.startsWith("workspace-file://")?a.split(/[?#]/)[0]:a}function Yn(a,t,r){const l=new Map;for(const[c,u]of Object.entries(a)){if(!u||!va(u.width)||!va(u.height))continue;const s={width:u.width,height:u.height},o=new Set([c]),g=jn(c);g&&o.add(g);for(const x of[...o]){const b=St(x,t);if(b&&o.add(b),r!==void 0){const w=jr(x,r);if(w){const m=St(`intent://local/file/${w.split("/").map(encodeURIComponent).join("/")}`,t);m&&o.add(m)}}}for(const x of o)l.has(x)||l.set(x,s)}return l}function Qn(a,t,r,l){if(!t||!a.includes("<img"))return a;const c=Yn(t,r,l);return c.size===0?a:a.replace(/<img\b(?:[^>"']|"[^"]*"|'[^']*')*>/gi,u=>{if(/\s(?:width|height)="/i.test(u))return u;const s=/\ssrc="([^"]*)"/i.exec(u);if(!s)return u;const o=Gn(s[1].replace(/&/g,"&")),g=c.get(o);return g?u.replace(/\s*\/?>$/,` width="${g.width}" height="${g.height}" ${La}="">`):u})}function ha(a,t){let r=t,l,c=!1,u=!1;const s=new Map;function o(){for(const[b,{component:w,source:m}]of s)ut(w),a.contains(b)&&b.replaceWith(m);s.clear()}function g(){if(!u){for(const[b,{component:w}]of s)a.contains(b)||(ut(w),s.delete(b));if(r.enabled)for(const b of a.querySelectorAll("pre > code")){if(b.closest("[data-markdown-diagram]"))continue;const w=[...b.classList].find(T=>T.startsWith("language-"))?.slice(9);let m;if(w==="mermaid")m="mermaid";else if(w==="diagram"||w==="ws-block:diagram")m="diagram";else if(w==="ws-block")try{if(JSON.parse(b.textContent??"").type!=="diagram")continue;m="diagram"}catch{continue}else continue;const k=b.parentElement;if(!k)continue;if(!l){c||(c=!0,ka(()=>import("./Cw6SlTJ6.js"),__vite__mapDeps([57,2,1,58,46,59,32,14,7,18,19,20,21,3,12,24,11,6,8,33,9,10,13,15,34,5,47,48,49,50,29,30,31,35,36,37,60,0,4,16,17,22,23,25,26,27,28,38,39,40,41,42,43,44,45,51,52,53,54,55,56,61,62,63,64,65,66,67,68]),import.meta.url).then(T=>{l=T.default,c=!1,g()}).catch(T=>{c=!1,ht.error("Failed to load the Markdown diagram renderer",{error:T})}));return}const U=document.createElement("div");U.dataset.markdownDiagram=m,k.replaceWith(U);const B=Mt(l,{target:U,context:r.context,props:{kind:m,source:b.textContent??"",workspaceId:r.workspaceId}});s.set(U,{component:B,source:k})}}}const x=new MutationObserver(g);return x.observe(a,{childList:!0,subtree:!0}),queueMicrotask(g),{update(b){(r.enabled!==b.enabled||r.workspaceId!==b.workspaceId)&&o(),r=b,g()},destroy(){u=!0,x.disconnect(),o()}}}var Xn=z('<span class="min-w-0 max-w-full truncate"> </span>'),$n=z('<span class="type-caption flex min-w-0 max-w-full items-start gap-2 whitespace-normal py-1 text-muted-foreground" role="status" data-testid="media-loading-placeholder"><span class="first-line-icon" aria-hidden="true"><!></span> <span class="flex min-w-0 flex-wrap items-baseline gap-x-1.5"><span> </span> <!></span></span>');function Wa(a,t){if(new.target)return tt({component:Wa,...a});nt(t,!0);let r=I(t,"name",7);var l={get name(){return r()},set name(m){r(m),M()},$set:at,$on:(m,k)=>rt(t,m,k)},c=$n(),u=N(c),s=N(u);bt(s,{get icon(){return zr},class:"size-3.5"}),L(u);var o=O(u,2),g=N(o),x=me(g,!0),b=O(g,2);{var w=m=>{var k=Xn(),U=me(k,!0);Ze(k,(B,T)=>Bt?.(B,T),r),Z(()=>ge(U,r())),H(m,k)};ie(b,m=>{r()&&m(w)})}return L(o),L(c),Z(m=>ge(x,m),[()=>A.ui_mediaLoadingPlaceholder_title_label()]),H(a,c),st(l)}const ba="markdown-image-frame";function Jn(a,t){const r=new Map,l=new Map,c=new Map,u=[300,1e3];let s=!1;function o(i){let p=l.get(i);return p||(p={source:i.getAttribute("src")||"",workspaceId:t.getWorkspaceId(),retries:0,failureHandled:!1},l.set(i,p)),p}function g(i){const p=o(i);return!s&&a.contains(p.fallbackHost??i)&&p.workspaceId===t.getWorkspaceId()&&t.canUseMedia(p.source)&&!i.hasAttribute("data-media-unavailable")&&!i.hasAttribute("data-media-unsupported")&&sa(p.source)!==null}function x(i,p=!1){if(!g(i))return;const _=o(i),P=sa(_.source);if(!P)return;const D=_.fallbackHost,Y=D?.contains(document.activeElement)??!1;if(_.failureHandled=!1,_.fallbackHost=void 0,p&&(_.retries=0),i.removeAttribute("src"),i.setAttribute("src",P),D){const se=r.get(D);se&&ut(se),r.delete(D),D.replaceWith(i),U(),Y&&a.contains(i)&&i.focus()}}function b(i){const p=o(i);s||!a.contains(i)||p.failureHandled||(p.failureHandled=!0,g(i)&&p.retries<u.length?p.timer=setTimeout(()=>{p.timer=void 0,x(i)},u[p.retries++]):k(i,"load-failed"))}function w(i){const p=i.parentElement;return p?.classList.contains(ba)?p:null}function m(i){const p=Number(i.getAttribute("width")),_=Number(i.getAttribute("height"));if(!(p>0&&_>0))return;const P=document.createElement("span");P.className=ba,P.style.aspectRatio=`${p} / ${_}`,P.style.setProperty("--image-aspect-ratio",`${p} / ${_}`),P.style.width=`min(${p}px, 100%)`,P.dataset.loaded="false",i.replaceWith(P),P.appendChild(i);const D=P.appendChild(document.createElement("span"));D.className="markdown-image-frame-placeholder",r.set(D,Mt(Wa,{target:D,props:{name:Kn(i,t.getWorkspaceId())}}));const Y=()=>{if(c.delete(i),s||!a.contains(P))return;P.dataset.loaded="true";const se=r.get(D);se&&(ut(se),r.delete(D)),D.remove()};i.complete&&i.naturalWidth>0?Y():(c.set(i,Y),i.addEventListener("load",Y,{once:!0}))}function k(i,p){const _=i.getAttribute("src")||i.getAttribute("data-media-src")||"",P=yt(_),D=Ra(_,t.getWorkspaceId()),Y=P?.path??D?.path,se=P?.workspaceId??D?.workspaceId,Ce=i.getAttribute("data-name")||i.getAttribute("alt")||Y?.split("/").pop()||void 0,le=document.createElement(i instanceof HTMLVideoElement?"div":"span");le.className="media-unavailable-host",(w(i)??i).replaceWith(le),t.onMediaRemoved(i);let y;if(i instanceof HTMLImageElement&&p==="load-failed"){const oe=o(i);oe.fallbackHost=le,g(i)&&(y=()=>x(i,!0))}const Q=Mt(Vt,{target:le,props:{name:Ce,reason:p,path:Y,workspaceId:se,onRetry:y}});if(r.set(le,Q),i instanceof HTMLVideoElement){le.classList.add("flex","items-center","gap-2");const oe=le.appendChild(document.createElement("span"));r.set(oe,Mt(Kt,{target:oe,props:{videoUrl:_,videoName:Ce,sourceKind:"workspace",mimeType:wt(_,t.getWorkspaceId())?.mimeType}}))}}function U(){if(!s){for(const i of a.querySelectorAll("img"))vt(i)&&!i.closest("a")&&(i.tabIndex=0,i.setAttribute("role","button")),!(i.hasAttribute("data-media-unsupported")||i.hasAttribute("data-media-unavailable"))&&(o(i),i.hasAttribute(La)&&!w(i)&&m(i),i.getAttribute("src")&&i.complete&&i.naturalWidth===0&&b(i));for(const i of a.querySelectorAll("[data-media-unsupported]"))k(i,"unsupported");for(const i of a.querySelectorAll("[data-media-unavailable]"))k(i,Gr(i));for(const[i,p]of l)a.contains(p.fallbackHost??i)||(p.timer!==void 0&&clearTimeout(p.timer),l.delete(i));for(const[i,p]of c)a.contains(i)||(i.removeEventListener("load",p),c.delete(i));for(const[i,p]of r)a.contains(i)||(ut(p),r.delete(i))}}function B(i){const p=i.target;(p instanceof HTMLImageElement||p instanceof HTMLVideoElement)&&(p instanceof HTMLImageElement?b(p):k(p,"load-failed"))}const T=new MutationObserver(U);return T.observe(a,{childList:!0,subtree:!0}),a.addEventListener("error",B,!0),queueMicrotask(U),{destroy(){s=!0,T.disconnect();for(const i of l.values())i.timer!==void 0&&clearTimeout(i.timer);l.clear();for(const[i,p]of c)i.removeEventListener("load",p);c.clear(),a.removeEventListener("error",B,!0);for(const i of r.values())ut(i);r.clear()}}}var Zn=z('<div class="image-actions-overlay absolute z-10 svelte-nzvuq5" data-testid="markdown-image-actions-overlay"><!></div>'),es=z("<div></div>"),wa=z('<div role="group"><!> <!></div>'),ts=z('<div><p class="whitespace-pre-wrap svelte-nzvuq5"> </p></div>'),as=z("<!> <!>",1);function _a(a,t){if(new.target)return tt({component:_a,...a});nt(t,!0);const r=n=>{var f=Ut(),W=Fe(f);{var S=K=>{var J=Zn(),Pe=N(J);{let de=E(()=>e(ce).getAttribute("src")||""),ue=E(()=>e(ce).getAttribute("alt")||void 0);et(fr(Pe,{get imageUrl(){return e(de)},get imageName(){return e(ue)},get open(){return e(v)},set open(We){q(v,We,!0)}}),We=>q(h,We,!0),()=>e(h))}L(J),et(J,de=>q(ae,de),()=>e(ae)),Z(()=>Ct(J,`top: ${e(Ke).top??""}px; right: ${e(Ke).right??""}px;`)),H(K,J)},j=E(()=>e(ce)&&Q(e(ce).getAttribute("src")||""));ie(W,K=>{e(j)&&K(S)})}H(n,f)};let l=I(t,"content",7),c=I(t,"isStreaming",7,!1),u=I(t,"className",7,""),s=I(t,"workspaceId",23,()=>ca()?.workspaceId??void 0),o=I(t,"relativeMediaBase",7),g=I(t,"onCodeBlockAction",7),x=I(t,"onFileClick",7),b=I(t,"canOpenFile",7),w=I(t,"allowFileMedia",7,!0),m=I(t,"taskBlockRenderMode",7,"placeholder"),k=I(t,"chatImageThumbnails",7,!1),U=I(t,"forceExternalLinks",7,!1),B=I(t,"renderRichFencesAsCode",7,!1),T=I(t,"renderDiagrams",7,!1),i=I(t,"allowSanitizedHtml",7,!1),p=I(t,"media",7);const _=Yr(),P=Ya(),D=E(()=>Bn(l(),s())),Y=E(()=>e(D).some(n=>n.type==="video")),se=E(()=>!e(Y)&&e(D).length===1&&e(D)[0].type==="markdown"?e(D)[0].content:l()),Ce=E(()=>Tn(e(se)));let le=ne(null),y=ne("");function Q(n){return _t(n,w()&&b()?.()!==!1)}const oe=E(()=>En(e(y),w()&&b()?.()!==!1)),Le=E(()=>pr(e(oe),s(),mr)),Me=E(()=>`<div class="markdown-content">${e(Le)}</div>`);let fe=0;const Ve=150;let ke=-1/0,ee=null,Se=null;async function ft(n,f,W,S){try{const j=await Qr(n,{...f,readOnly:!0});if(S!==fe)return;q(y,Qn(j,W,f?.workspaceId,f?.relativeMediaBase),!0)}catch(j){if(S!==fe)return;ht.error("Failed to process markdown:",j);const K=n.replace(/[&<>"']/g,J=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[J]||J);q(y,`<p>${K}</p>`)}}function Ie(){if(!Se)return;const n=Ve-(performance.now()-ke);if(n>0){ee=setTimeout(()=>{ee=null,Ie()},n);return}const f=Se;Se=null,ke=performance.now(),f()}function ot(){ee!==null&&(clearTimeout(ee),ee=null),Se=null,ke=-1/0}kt(()=>{const n=e(se),f={allowEmpty:!0,skipIfHTML:!1,preserveAnchors:!0,taskBlockRenderMode:m(),workspaceId:s(),relativeMediaBase:o()??(s()&&s()!==Sr?"":void 0),renderRichFencesAsCode:B()||T(),processPrimitives:!T(),allowSanitizedHtml:i(),renderMath:!c(),workspaceFileVersion:_},W=p(),S=++fe,j=()=>void ft(n,f,W,S);c()?(Se=j,ee===null&&Ie()):(ot(),j())});let De=ne(void 0),ce=ne(null),Ke=ne(Qa({top:0,right:0})),v=ne(!1),h=ne(void 0),ae=ne(null);function V(n){if(n.type==="mouseover"&&ga(e(ce),e(ae)))return;const f=n.target,W=Dt(f);if(W&&vt(W)&&Q(W.getAttribute("src")||"")){if(e(ce)===W)return;q(ce,W,!0),q(Ke,Vn(W,n.currentTarget),!0)}else if(e(ce)&&!e(v)){if(f instanceof Node&&e(ae)?.contains(f))return;q(ce,null)}}function te(){!e(v)&&!ga(e(ce),e(ae))&&q(ce,null)}function he(n){const f=Dt(n.target);!f||!vt(f)||!Q(f.getAttribute("src")||"")||(n.preventDefault(),n.stopPropagation(),V(n),q(v,!0))}function re(n){return Jn(n,{getWorkspaceId:()=>s(),canUseMedia:Q,onMediaRemoved:f=>{e(ce)===f&&q(ce,null)}})}function Re(n){const f=n.target,W=f.closest("a");if(!W&&f instanceof HTMLImageElement){const j=f.getAttribute("src")||"";if(Ma(j)&&Q(j)){n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),e(De)?.openImage(f);return}}if(W?.href){if(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),e(De)?.openAsset(W))return;const j=d(n),K=s()?ta(s()):void 0;ia(W.href,{workspaceId:K,canOpenFile:b(),sourcePanelId:j,event:n,rawHref:W.getAttribute("href")??void 0,...U()?{forceExternal:!0}:{}});return}const S=Xr(f.closest("[data-mention]"));if(S){const{type:j,meta:K}=S;if(j==="file"&&S.filePath){if(b()?.()===!1)return;n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation();const J=S.filePath;ht.debug("[MarkdownViewer] File mention clicked",{filePath:J,meta:K});const Pe=d(n),de=Ht({event:n});if(x())x()(J,{line:S.line,openInAdjacentPanel:de,sourcePanelId:Pe});else{const ue=s();ue&&ve.dispatch(Rr(ue,J,{line:S.line,openInAdjacentPanel:de,sourcePanelId:Pe}))}}else if(S.folderPath!==void 0){if(b()?.()===!1||!s())return;n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),ve.dispatch(Er(s(),$r(S.folderPath)))}else if(j==="note"&&S.note){n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation();const J=S.note.id;ht.debug("[MarkdownViewer] Note mention clicked",{noteId:J,meta:K});const Pe=d(n),de=Ht({event:n});if(S.note.workspaceId&&S.note.workspaceId!==s()){ia(ir(J,S.note.workspaceId),{workspaceId:s()?ta(s()):void 0,sourcePanelId:Pe,event:n});return}const ue=s();ue&&ve.dispatch(Pr(ue,J,{openInAdjacentPanel:de,sourcePanelId:Pe}))}}}function Ue(n){if(je(n),!n.defaultPrevented){if(n.target instanceof HTMLImageElement&&vt(n.target)&&(n.key==="Enter"||n.key===" ")){Re(n);return}n.key!=="Enter"||!Ht({event:n})||Re(n)}}function je(n){const f=Dt(n.target);!f||!vt(f)||!Q(f.getAttribute("src")||"")||e(h)?.handleCopy(n,f.getAttribute("src")||"")}function d(n){const f=n.target;if(f instanceof HTMLElement)return f.closest("[data-panel-id]")?.dataset.panelId}Xa(()=>{fe+=1,ot()});var C={get content(){return l()},set content(n){l(n),M()},get isStreaming(){return c()},set isStreaming(n=!1){c(n),M()},get className(){return u()},set className(n=""){u(n),M()},get workspaceId(){return s()},set workspaceId(n=ca()?.workspaceId??void 0){s(n),M()},get relativeMediaBase(){return o()},set relativeMediaBase(n){o(n),M()},get onCodeBlockAction(){return g()},set onCodeBlockAction(n){g(n),M()},get onFileClick(){return x()},set onFileClick(n){x(n),M()},get canOpenFile(){return b()},set canOpenFile(n){b(n),M()},get allowFileMedia(){return w()},set allowFileMedia(n=!0){w(n),M()},get taskBlockRenderMode(){return m()},set taskBlockRenderMode(n="placeholder"){m(n),M()},get chatImageThumbnails(){return k()},set chatImageThumbnails(n=!1){k(n),M()},get forceExternalLinks(){return U()},set forceExternalLinks(n=!1){U(n),M()},get renderRichFencesAsCode(){return B()},set renderRichFencesAsCode(n=!1){B(n),M()},get renderDiagrams(){return T()},set renderDiagrams(n=!1){T(n),M()},get allowSanitizedHtml(){return i()},set allowSanitizedHtml(n=!1){i(n),M()},get media(){return p()},set media(n){p(n),M()},$set:at,$on:(n,f)=>rt(t,n,f)},F=as(),X=Fe(F);{var be=n=>{var f=es();zt(f,21,()=>e(D),Za,(W,S)=>{var j=Ut(),K=Fe(j);{var J=de=>{Fa(de,{get allowFileMedia(){return w()},get canOpenFile(){return b()},get source(){return e(S).source},get name(){return e(S).name},get poster(){return e(S).poster}})},Pe=de=>{_a(de,{get content(){return e(S).content},get isStreaming(){return c()},get workspaceId(){return s()},get relativeMediaBase(){return o()},get onCodeBlockAction(){return g()},get onFileClick(){return x()},get canOpenFile(){return b()},get allowFileMedia(){return w()},get taskBlockRenderMode(){return m()},get chatImageThumbnails(){return k()},get forceExternalLinks(){return U()},get renderRichFencesAsCode(){return B()},get renderDiagrams(){return T()},get allowSanitizedHtml(){return i()},get media(){return p()}})};ie(K,de=>{e(S).type==="video"?de(J):de(Pe,-1)})}H(W,j)}),L(f),Z(()=>qe(f,1,`markdown-video-segments ${u()??""}`,"svelte-nzvuq5")),H(n,f)},pe=n=>{var f=wa();let W;var S=N(f);oa(S,()=>e(Me));var j=O(S,2);r(j),L(f),Ze(f,K=>re?.(K)),Ze(f,(K,J)=>ha?.(K,J),()=>({enabled:T(),workspaceId:s(),context:P})),Z(()=>W=qe(f,1,`markdown-viewer streaming-content ${u()??""}`,"svelte-nzvuq5",W,{"chat-image-thumbnails":k()})),Ae("click",f,Re),Ae("keydown",f,Ue),He("copy",f,je),Ae("contextmenu",f,he),Ae("mouseover",f,V),Ae("focusin",f,V),He("mouseleave",f,te),H(n,f)},we=n=>{var f=ts(),W=N(f),S=me(W,!0);L(f),Z(()=>{qe(f,1,`markdown-viewer simple-content ${u()??""}`,"svelte-nzvuq5"),ge(S,e(se))}),H(n,f)},Ee=n=>{var f=wa();let W;var S=N(f);oa(S,()=>e(Me));var j=O(S,2);r(j),L(f),et(f,K=>q(le,K),()=>e(le)),Ze(f,K=>re?.(K)),Ze(f,(K,J)=>ha?.(K,J),()=>({enabled:T(),workspaceId:s(),context:P})),Z(()=>W=qe(f,1,`markdown-viewer static-content ${u()??""}`,"svelte-nzvuq5",W,{"chat-image-thumbnails":k()})),Ae("click",f,Re),Ae("keydown",f,Ue),He("copy",f,je),Ae("contextmenu",f,he),Ae("mouseover",f,V),Ae("focusin",f,V),He("mouseleave",f,te),H(n,f)};ie(X,n=>{e(Y)?n(be):c()?n(pe,1):e(Ce)==="simple"&&!i()?n(we,2):n(Ee,-1)})}var _e=O(X,2);return et(Ta(_e,{get workspaceId(){return s()},canUseMedia:Q}),n=>q(De,n,!0),()=>e(De)),H(a,F),st(C)}xa(["click","keydown","contextmenu","mouseover","focusin"]);class Ps{constructor(t){lt(this,"container");lt(this,"previousFocus",null);lt(this,"firstFocusable",null);lt(this,"lastFocusable",null);lt(this,"handleKeyDown");this.container=t,this.handleKeyDown=this.onKeyDown.bind(this)}activate(){this.previousFocus=document.activeElement;const t=this.container.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])');t.length>0&&(this.firstFocusable=t[0],this.lastFocusable=t[t.length-1],this.firstFocusable.focus()),document.addEventListener("keydown",this.handleKeyDown)}deactivate(){document.removeEventListener("keydown",this.handleKeyDown),this.previousFocus&&this.previousFocus.focus()}onKeyDown(t){t.key==="Tab"&&(!this.firstFocusable||!this.lastFocusable||(t.shiftKey?document.activeElement===this.firstFocusable&&(t.preventDefault(),this.lastFocusable.focus()):document.activeElement===this.lastFocusable&&(t.preventDefault(),this.firstFocusable.focus())))}}function Ts(a,t){const r=x=>{const b=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(x);return b?{r:parseInt(b[1],16),g:parseInt(b[2],16),b:parseInt(b[3],16)}:null},l=x=>{const[b,w,m]=[x.r,x.g,x.b].map(k=>(k=k/255,k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4)));return .2126*b+.7152*w+.0722*m},c=r(a),u=r(t);if(!c||!u)return ht.warn("Invalid color values for contrast check",{foreground:a,background:t}),{ratio:0,passes:{aa:!1,aaa:!1}};const s=l(c),o=l(u),g=(Math.max(s,o)+.05)/(Math.min(s,o)+.05);return{ratio:g,passes:{aa:g>=4.5,aaa:g>=7}}}export{Fa as C,Ps as F,Rn as H,_a as M,Ss as W,Wa as a,fa as b,An as c,Pa as d,Ts as e,Cn as f,Es as g,Ea as h,on as r,Bn as s,Rs as w};
|
|
6
|
+
`)),T=ma(B?.path,t);if(T){u(),l.push({type:"video",source:T,name:typeof B.path=="string"?B.path:void 0,poster:typeof B.poster=="string"?B.poster:void 0}),s=k;continue}}catch{}c.push(...U),s=k;continue}c.push(...r.slice(s));break}const x=!/^(?: {4}|\t)/.test(r[s])&&Un(r,s)?r[s].match(qn):null;if(!x){c.push(r[s]);continue}const[,b,w]=x,m=ma(w,t);m?(u(),l.push({type:"video",source:m,name:b||void 0})):w.startsWith("workspace-asset://")&&!Kr(w)||Dn(w,t)?c.push(r[s]):c.push(`[${b}](${w})`)}return u(),l}function vt(a){return Ma(a.getAttribute("src")||"")}function Dt(a){return a instanceof HTMLImageElement?a:a instanceof HTMLAnchorElement?a.querySelector("img"):null}function Vn(a,t){const r=a.getBoundingClientRect(),l=t.getBoundingClientRect();return{top:r.top-l.top+6,right:l.right-r.right+6}}function ga(a,t){const r=document.activeElement;return!!(r&&(r===a||r===a?.closest("a")||t?.contains(r)))}function Kn(a,t){const r=a.getAttribute("src")||"",l=yt(r)?.path??Ra(r,t)?.path;if(l)return l;if(r.startsWith("workspace-asset://")){const c=r.split(/[?#]/)[0].split("/").pop();if(c)return c}if(r&&!/^[a-z][a-z0-9+.-]*:/i.test(r)&&!r.startsWith("//"))try{return decodeURI(r)}catch{return r}return a.getAttribute("alt")||void 0}const La="data-image-sized",va=a=>typeof a=="number"&&Number.isInteger(a)&&a>0;function jn(a){try{return encodeURI(a).replace(/%25/g,"%")}catch{return null}}function Gn(a){return a.startsWith("workspace-file://")?a.split(/[?#]/)[0]:a}function Yn(a,t,r){const l=new Map;for(const[c,u]of Object.entries(a)){if(!u||!va(u.width)||!va(u.height))continue;const s={width:u.width,height:u.height},o=new Set([c]),g=jn(c);g&&o.add(g);for(const x of[...o]){const b=St(x,t);if(b&&o.add(b),r!==void 0){const w=jr(x,r);if(w){const m=St(`intent://local/file/${w.split("/").map(encodeURIComponent).join("/")}`,t);m&&o.add(m)}}}for(const x of o)l.has(x)||l.set(x,s)}return l}function Qn(a,t,r,l){if(!t||!a.includes("<img"))return a;const c=Yn(t,r,l);return c.size===0?a:a.replace(/<img\b(?:[^>"']|"[^"]*"|'[^']*')*>/gi,u=>{if(/\s(?:width|height)="/i.test(u))return u;const s=/\ssrc="([^"]*)"/i.exec(u);if(!s)return u;const o=Gn(s[1].replace(/&/g,"&")),g=c.get(o);return g?u.replace(/\s*\/?>$/,` width="${g.width}" height="${g.height}" ${La}="">`):u})}function ha(a,t){let r=t,l,c=!1,u=!1;const s=new Map;function o(){for(const[b,{component:w,source:m}]of s)ut(w),a.contains(b)&&b.replaceWith(m);s.clear()}function g(){if(!u){for(const[b,{component:w}]of s)a.contains(b)||(ut(w),s.delete(b));if(r.enabled)for(const b of a.querySelectorAll("pre > code")){if(b.closest("[data-markdown-diagram]"))continue;const w=[...b.classList].find(T=>T.startsWith("language-"))?.slice(9);let m;if(w==="mermaid")m="mermaid";else if(w==="diagram"||w==="ws-block:diagram")m="diagram";else if(w==="ws-block")try{if(JSON.parse(b.textContent??"").type!=="diagram")continue;m="diagram"}catch{continue}else continue;const k=b.parentElement;if(!k)continue;if(!l){c||(c=!0,ka(()=>import("./B3W2oJ3u.js"),__vite__mapDeps([57,2,1,58,46,59,32,14,7,18,19,20,21,3,12,24,11,6,8,33,9,10,13,15,34,5,47,48,49,50,29,30,31,35,36,37,60,0,4,16,17,22,23,25,26,27,28,38,39,40,41,42,43,44,45,51,52,53,54,55,56,61,62,63,64,65,66,67,68]),import.meta.url).then(T=>{l=T.default,c=!1,g()}).catch(T=>{c=!1,ht.error("Failed to load the Markdown diagram renderer",{error:T})}));return}const U=document.createElement("div");U.dataset.markdownDiagram=m,k.replaceWith(U);const B=Mt(l,{target:U,context:r.context,props:{kind:m,source:b.textContent??"",workspaceId:r.workspaceId}});s.set(U,{component:B,source:k})}}}const x=new MutationObserver(g);return x.observe(a,{childList:!0,subtree:!0}),queueMicrotask(g),{update(b){(r.enabled!==b.enabled||r.workspaceId!==b.workspaceId)&&o(),r=b,g()},destroy(){u=!0,x.disconnect(),o()}}}var Xn=z('<span class="min-w-0 max-w-full truncate"> </span>'),$n=z('<span class="type-caption flex min-w-0 max-w-full items-start gap-2 whitespace-normal py-1 text-muted-foreground" role="status" data-testid="media-loading-placeholder"><span class="first-line-icon" aria-hidden="true"><!></span> <span class="flex min-w-0 flex-wrap items-baseline gap-x-1.5"><span> </span> <!></span></span>');function Wa(a,t){if(new.target)return tt({component:Wa,...a});nt(t,!0);let r=I(t,"name",7);var l={get name(){return r()},set name(m){r(m),M()},$set:at,$on:(m,k)=>rt(t,m,k)},c=$n(),u=N(c),s=N(u);bt(s,{get icon(){return zr},class:"size-3.5"}),L(u);var o=O(u,2),g=N(o),x=me(g,!0),b=O(g,2);{var w=m=>{var k=Xn(),U=me(k,!0);Ze(k,(B,T)=>Bt?.(B,T),r),Z(()=>ge(U,r())),H(m,k)};ie(b,m=>{r()&&m(w)})}return L(o),L(c),Z(m=>ge(x,m),[()=>A.ui_mediaLoadingPlaceholder_title_label()]),H(a,c),st(l)}const ba="markdown-image-frame";function Jn(a,t){const r=new Map,l=new Map,c=new Map,u=[300,1e3];let s=!1;function o(i){let p=l.get(i);return p||(p={source:i.getAttribute("src")||"",workspaceId:t.getWorkspaceId(),retries:0,failureHandled:!1},l.set(i,p)),p}function g(i){const p=o(i);return!s&&a.contains(p.fallbackHost??i)&&p.workspaceId===t.getWorkspaceId()&&t.canUseMedia(p.source)&&!i.hasAttribute("data-media-unavailable")&&!i.hasAttribute("data-media-unsupported")&&sa(p.source)!==null}function x(i,p=!1){if(!g(i))return;const _=o(i),P=sa(_.source);if(!P)return;const D=_.fallbackHost,Y=D?.contains(document.activeElement)??!1;if(_.failureHandled=!1,_.fallbackHost=void 0,p&&(_.retries=0),i.removeAttribute("src"),i.setAttribute("src",P),D){const se=r.get(D);se&&ut(se),r.delete(D),D.replaceWith(i),U(),Y&&a.contains(i)&&i.focus()}}function b(i){const p=o(i);s||!a.contains(i)||p.failureHandled||(p.failureHandled=!0,g(i)&&p.retries<u.length?p.timer=setTimeout(()=>{p.timer=void 0,x(i)},u[p.retries++]):k(i,"load-failed"))}function w(i){const p=i.parentElement;return p?.classList.contains(ba)?p:null}function m(i){const p=Number(i.getAttribute("width")),_=Number(i.getAttribute("height"));if(!(p>0&&_>0))return;const P=document.createElement("span");P.className=ba,P.style.aspectRatio=`${p} / ${_}`,P.style.setProperty("--image-aspect-ratio",`${p} / ${_}`),P.style.width=`min(${p}px, 100%)`,P.dataset.loaded="false",i.replaceWith(P),P.appendChild(i);const D=P.appendChild(document.createElement("span"));D.className="markdown-image-frame-placeholder",r.set(D,Mt(Wa,{target:D,props:{name:Kn(i,t.getWorkspaceId())}}));const Y=()=>{if(c.delete(i),s||!a.contains(P))return;P.dataset.loaded="true";const se=r.get(D);se&&(ut(se),r.delete(D)),D.remove()};i.complete&&i.naturalWidth>0?Y():(c.set(i,Y),i.addEventListener("load",Y,{once:!0}))}function k(i,p){const _=i.getAttribute("src")||i.getAttribute("data-media-src")||"",P=yt(_),D=Ra(_,t.getWorkspaceId()),Y=P?.path??D?.path,se=P?.workspaceId??D?.workspaceId,Ce=i.getAttribute("data-name")||i.getAttribute("alt")||Y?.split("/").pop()||void 0,le=document.createElement(i instanceof HTMLVideoElement?"div":"span");le.className="media-unavailable-host",(w(i)??i).replaceWith(le),t.onMediaRemoved(i);let y;if(i instanceof HTMLImageElement&&p==="load-failed"){const oe=o(i);oe.fallbackHost=le,g(i)&&(y=()=>x(i,!0))}const Q=Mt(Vt,{target:le,props:{name:Ce,reason:p,path:Y,workspaceId:se,onRetry:y}});if(r.set(le,Q),i instanceof HTMLVideoElement){le.classList.add("flex","items-center","gap-2");const oe=le.appendChild(document.createElement("span"));r.set(oe,Mt(Kt,{target:oe,props:{videoUrl:_,videoName:Ce,sourceKind:"workspace",mimeType:wt(_,t.getWorkspaceId())?.mimeType}}))}}function U(){if(!s){for(const i of a.querySelectorAll("img"))vt(i)&&!i.closest("a")&&(i.tabIndex=0,i.setAttribute("role","button")),!(i.hasAttribute("data-media-unsupported")||i.hasAttribute("data-media-unavailable"))&&(o(i),i.hasAttribute(La)&&!w(i)&&m(i),i.getAttribute("src")&&i.complete&&i.naturalWidth===0&&b(i));for(const i of a.querySelectorAll("[data-media-unsupported]"))k(i,"unsupported");for(const i of a.querySelectorAll("[data-media-unavailable]"))k(i,Gr(i));for(const[i,p]of l)a.contains(p.fallbackHost??i)||(p.timer!==void 0&&clearTimeout(p.timer),l.delete(i));for(const[i,p]of c)a.contains(i)||(i.removeEventListener("load",p),c.delete(i));for(const[i,p]of r)a.contains(i)||(ut(p),r.delete(i))}}function B(i){const p=i.target;(p instanceof HTMLImageElement||p instanceof HTMLVideoElement)&&(p instanceof HTMLImageElement?b(p):k(p,"load-failed"))}const T=new MutationObserver(U);return T.observe(a,{childList:!0,subtree:!0}),a.addEventListener("error",B,!0),queueMicrotask(U),{destroy(){s=!0,T.disconnect();for(const i of l.values())i.timer!==void 0&&clearTimeout(i.timer);l.clear();for(const[i,p]of c)i.removeEventListener("load",p);c.clear(),a.removeEventListener("error",B,!0);for(const i of r.values())ut(i);r.clear()}}}var Zn=z('<div class="image-actions-overlay absolute z-10 svelte-nzvuq5" data-testid="markdown-image-actions-overlay"><!></div>'),es=z("<div></div>"),wa=z('<div role="group"><!> <!></div>'),ts=z('<div><p class="whitespace-pre-wrap svelte-nzvuq5"> </p></div>'),as=z("<!> <!>",1);function _a(a,t){if(new.target)return tt({component:_a,...a});nt(t,!0);const r=n=>{var f=Ut(),W=Fe(f);{var S=K=>{var J=Zn(),Pe=N(J);{let de=E(()=>e(ce).getAttribute("src")||""),ue=E(()=>e(ce).getAttribute("alt")||void 0);et(fr(Pe,{get imageUrl(){return e(de)},get imageName(){return e(ue)},get open(){return e(v)},set open(We){q(v,We,!0)}}),We=>q(h,We,!0),()=>e(h))}L(J),et(J,de=>q(ae,de),()=>e(ae)),Z(()=>Ct(J,`top: ${e(Ke).top??""}px; right: ${e(Ke).right??""}px;`)),H(K,J)},j=E(()=>e(ce)&&Q(e(ce).getAttribute("src")||""));ie(W,K=>{e(j)&&K(S)})}H(n,f)};let l=I(t,"content",7),c=I(t,"isStreaming",7,!1),u=I(t,"className",7,""),s=I(t,"workspaceId",23,()=>ca()?.workspaceId??void 0),o=I(t,"relativeMediaBase",7),g=I(t,"onCodeBlockAction",7),x=I(t,"onFileClick",7),b=I(t,"canOpenFile",7),w=I(t,"allowFileMedia",7,!0),m=I(t,"taskBlockRenderMode",7,"placeholder"),k=I(t,"chatImageThumbnails",7,!1),U=I(t,"forceExternalLinks",7,!1),B=I(t,"renderRichFencesAsCode",7,!1),T=I(t,"renderDiagrams",7,!1),i=I(t,"allowSanitizedHtml",7,!1),p=I(t,"media",7);const _=Yr(),P=Ya(),D=E(()=>Bn(l(),s())),Y=E(()=>e(D).some(n=>n.type==="video")),se=E(()=>!e(Y)&&e(D).length===1&&e(D)[0].type==="markdown"?e(D)[0].content:l()),Ce=E(()=>Tn(e(se)));let le=ne(null),y=ne("");function Q(n){return _t(n,w()&&b()?.()!==!1)}const oe=E(()=>En(e(y),w()&&b()?.()!==!1)),Le=E(()=>pr(e(oe),s(),mr)),Me=E(()=>`<div class="markdown-content">${e(Le)}</div>`);let fe=0;const Ve=150;let ke=-1/0,ee=null,Se=null;async function ft(n,f,W,S){try{const j=await Qr(n,{...f,readOnly:!0});if(S!==fe)return;q(y,Qn(j,W,f?.workspaceId,f?.relativeMediaBase),!0)}catch(j){if(S!==fe)return;ht.error("Failed to process markdown:",j);const K=n.replace(/[&<>"']/g,J=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[J]||J);q(y,`<p>${K}</p>`)}}function Ie(){if(!Se)return;const n=Ve-(performance.now()-ke);if(n>0){ee=setTimeout(()=>{ee=null,Ie()},n);return}const f=Se;Se=null,ke=performance.now(),f()}function ot(){ee!==null&&(clearTimeout(ee),ee=null),Se=null,ke=-1/0}kt(()=>{const n=e(se),f={allowEmpty:!0,skipIfHTML:!1,preserveAnchors:!0,taskBlockRenderMode:m(),workspaceId:s(),relativeMediaBase:o()??(s()&&s()!==Sr?"":void 0),renderRichFencesAsCode:B()||T(),processPrimitives:!T(),allowSanitizedHtml:i(),renderMath:!c(),workspaceFileVersion:_},W=p(),S=++fe,j=()=>void ft(n,f,W,S);c()?(Se=j,ee===null&&Ie()):(ot(),j())});let De=ne(void 0),ce=ne(null),Ke=ne(Qa({top:0,right:0})),v=ne(!1),h=ne(void 0),ae=ne(null);function V(n){if(n.type==="mouseover"&&ga(e(ce),e(ae)))return;const f=n.target,W=Dt(f);if(W&&vt(W)&&Q(W.getAttribute("src")||"")){if(e(ce)===W)return;q(ce,W,!0),q(Ke,Vn(W,n.currentTarget),!0)}else if(e(ce)&&!e(v)){if(f instanceof Node&&e(ae)?.contains(f))return;q(ce,null)}}function te(){!e(v)&&!ga(e(ce),e(ae))&&q(ce,null)}function he(n){const f=Dt(n.target);!f||!vt(f)||!Q(f.getAttribute("src")||"")||(n.preventDefault(),n.stopPropagation(),V(n),q(v,!0))}function re(n){return Jn(n,{getWorkspaceId:()=>s(),canUseMedia:Q,onMediaRemoved:f=>{e(ce)===f&&q(ce,null)}})}function Re(n){const f=n.target,W=f.closest("a");if(!W&&f instanceof HTMLImageElement){const j=f.getAttribute("src")||"";if(Ma(j)&&Q(j)){n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),e(De)?.openImage(f);return}}if(W?.href){if(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),e(De)?.openAsset(W))return;const j=d(n),K=s()?ta(s()):void 0;ia(W.href,{workspaceId:K,canOpenFile:b(),sourcePanelId:j,event:n,rawHref:W.getAttribute("href")??void 0,...U()?{forceExternal:!0}:{}});return}const S=Xr(f.closest("[data-mention]"));if(S){const{type:j,meta:K}=S;if(j==="file"&&S.filePath){if(b()?.()===!1)return;n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation();const J=S.filePath;ht.debug("[MarkdownViewer] File mention clicked",{filePath:J,meta:K});const Pe=d(n),de=Ht({event:n});if(x())x()(J,{line:S.line,openInAdjacentPanel:de,sourcePanelId:Pe});else{const ue=s();ue&&ve.dispatch(Rr(ue,J,{line:S.line,openInAdjacentPanel:de,sourcePanelId:Pe}))}}else if(S.folderPath!==void 0){if(b()?.()===!1||!s())return;n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),ve.dispatch(Er(s(),$r(S.folderPath)))}else if(j==="note"&&S.note){n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation();const J=S.note.id;ht.debug("[MarkdownViewer] Note mention clicked",{noteId:J,meta:K});const Pe=d(n),de=Ht({event:n});if(S.note.workspaceId&&S.note.workspaceId!==s()){ia(ir(J,S.note.workspaceId),{workspaceId:s()?ta(s()):void 0,sourcePanelId:Pe,event:n});return}const ue=s();ue&&ve.dispatch(Pr(ue,J,{openInAdjacentPanel:de,sourcePanelId:Pe}))}}}function Ue(n){if(je(n),!n.defaultPrevented){if(n.target instanceof HTMLImageElement&&vt(n.target)&&(n.key==="Enter"||n.key===" ")){Re(n);return}n.key!=="Enter"||!Ht({event:n})||Re(n)}}function je(n){const f=Dt(n.target);!f||!vt(f)||!Q(f.getAttribute("src")||"")||e(h)?.handleCopy(n,f.getAttribute("src")||"")}function d(n){const f=n.target;if(f instanceof HTMLElement)return f.closest("[data-panel-id]")?.dataset.panelId}Xa(()=>{fe+=1,ot()});var C={get content(){return l()},set content(n){l(n),M()},get isStreaming(){return c()},set isStreaming(n=!1){c(n),M()},get className(){return u()},set className(n=""){u(n),M()},get workspaceId(){return s()},set workspaceId(n=ca()?.workspaceId??void 0){s(n),M()},get relativeMediaBase(){return o()},set relativeMediaBase(n){o(n),M()},get onCodeBlockAction(){return g()},set onCodeBlockAction(n){g(n),M()},get onFileClick(){return x()},set onFileClick(n){x(n),M()},get canOpenFile(){return b()},set canOpenFile(n){b(n),M()},get allowFileMedia(){return w()},set allowFileMedia(n=!0){w(n),M()},get taskBlockRenderMode(){return m()},set taskBlockRenderMode(n="placeholder"){m(n),M()},get chatImageThumbnails(){return k()},set chatImageThumbnails(n=!1){k(n),M()},get forceExternalLinks(){return U()},set forceExternalLinks(n=!1){U(n),M()},get renderRichFencesAsCode(){return B()},set renderRichFencesAsCode(n=!1){B(n),M()},get renderDiagrams(){return T()},set renderDiagrams(n=!1){T(n),M()},get allowSanitizedHtml(){return i()},set allowSanitizedHtml(n=!1){i(n),M()},get media(){return p()},set media(n){p(n),M()},$set:at,$on:(n,f)=>rt(t,n,f)},F=as(),X=Fe(F);{var be=n=>{var f=es();zt(f,21,()=>e(D),Za,(W,S)=>{var j=Ut(),K=Fe(j);{var J=de=>{Fa(de,{get allowFileMedia(){return w()},get canOpenFile(){return b()},get source(){return e(S).source},get name(){return e(S).name},get poster(){return e(S).poster}})},Pe=de=>{_a(de,{get content(){return e(S).content},get isStreaming(){return c()},get workspaceId(){return s()},get relativeMediaBase(){return o()},get onCodeBlockAction(){return g()},get onFileClick(){return x()},get canOpenFile(){return b()},get allowFileMedia(){return w()},get taskBlockRenderMode(){return m()},get chatImageThumbnails(){return k()},get forceExternalLinks(){return U()},get renderRichFencesAsCode(){return B()},get renderDiagrams(){return T()},get allowSanitizedHtml(){return i()},get media(){return p()}})};ie(K,de=>{e(S).type==="video"?de(J):de(Pe,-1)})}H(W,j)}),L(f),Z(()=>qe(f,1,`markdown-video-segments ${u()??""}`,"svelte-nzvuq5")),H(n,f)},pe=n=>{var f=wa();let W;var S=N(f);oa(S,()=>e(Me));var j=O(S,2);r(j),L(f),Ze(f,K=>re?.(K)),Ze(f,(K,J)=>ha?.(K,J),()=>({enabled:T(),workspaceId:s(),context:P})),Z(()=>W=qe(f,1,`markdown-viewer streaming-content ${u()??""}`,"svelte-nzvuq5",W,{"chat-image-thumbnails":k()})),Ae("click",f,Re),Ae("keydown",f,Ue),He("copy",f,je),Ae("contextmenu",f,he),Ae("mouseover",f,V),Ae("focusin",f,V),He("mouseleave",f,te),H(n,f)},we=n=>{var f=ts(),W=N(f),S=me(W,!0);L(f),Z(()=>{qe(f,1,`markdown-viewer simple-content ${u()??""}`,"svelte-nzvuq5"),ge(S,e(se))}),H(n,f)},Ee=n=>{var f=wa();let W;var S=N(f);oa(S,()=>e(Me));var j=O(S,2);r(j),L(f),et(f,K=>q(le,K),()=>e(le)),Ze(f,K=>re?.(K)),Ze(f,(K,J)=>ha?.(K,J),()=>({enabled:T(),workspaceId:s(),context:P})),Z(()=>W=qe(f,1,`markdown-viewer static-content ${u()??""}`,"svelte-nzvuq5",W,{"chat-image-thumbnails":k()})),Ae("click",f,Re),Ae("keydown",f,Ue),He("copy",f,je),Ae("contextmenu",f,he),Ae("mouseover",f,V),Ae("focusin",f,V),He("mouseleave",f,te),H(n,f)};ie(X,n=>{e(Y)?n(be):c()?n(pe,1):e(Ce)==="simple"&&!i()?n(we,2):n(Ee,-1)})}var _e=O(X,2);return et(Ta(_e,{get workspaceId(){return s()},canUseMedia:Q}),n=>q(De,n,!0),()=>e(De)),H(a,F),st(C)}xa(["click","keydown","contextmenu","mouseover","focusin"]);class Ps{constructor(t){lt(this,"container");lt(this,"previousFocus",null);lt(this,"firstFocusable",null);lt(this,"lastFocusable",null);lt(this,"handleKeyDown");this.container=t,this.handleKeyDown=this.onKeyDown.bind(this)}activate(){this.previousFocus=document.activeElement;const t=this.container.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])');t.length>0&&(this.firstFocusable=t[0],this.lastFocusable=t[t.length-1],this.firstFocusable.focus()),document.addEventListener("keydown",this.handleKeyDown)}deactivate(){document.removeEventListener("keydown",this.handleKeyDown),this.previousFocus&&this.previousFocus.focus()}onKeyDown(t){t.key==="Tab"&&(!this.firstFocusable||!this.lastFocusable||(t.shiftKey?document.activeElement===this.firstFocusable&&(t.preventDefault(),this.lastFocusable.focus()):document.activeElement===this.lastFocusable&&(t.preventDefault(),this.firstFocusable.focus())))}}function Ts(a,t){const r=x=>{const b=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(x);return b?{r:parseInt(b[1],16),g:parseInt(b[2],16),b:parseInt(b[3],16)}:null},l=x=>{const[b,w,m]=[x.r,x.g,x.b].map(k=>(k=k/255,k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4)));return .2126*b+.7152*w+.0722*m},c=r(a),u=r(t);if(!c||!u)return ht.warn("Invalid color values for contrast check",{foreground:a,background:t}),{ratio:0,passes:{aa:!1,aaa:!1}};const s=l(c),o=l(u),g=(Math.max(s,o)+.05)/(Math.min(s,o)+.05);return{ratio:g,passes:{aa:g>=4.5,aaa:g>=7}}}export{Fa as C,Ps as F,Rn as H,_a as M,Ss as W,Wa as a,fa as b,An as c,Pa as d,Ts as e,Cn as f,Es as g,Ea as h,on as r,Bn as s,Rs as w};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var il=Object.defineProperty;var ll=(r,t,n)=>t in r?il(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n;var _n=(r,t,n)=>ll(r,typeof t!="symbol"?t+"":t,n);import{t as bt,bq as m,bo as g,a_ as z,by as wt,b as xt,bs as Dn,bu as lr,bt as dl,br as aa}from"./BAqR9jtB.js";import{bs as kt,a5 as D,bA as E,bS as P,bl as oe,ay as we,aD as e,b_ as F,bO as X,W as f,c9 as a,bn as It,bV as fe,bH as H,aA as p,be as xr,b$ as Vr,aB as A,bj as On,c0 as In,c6 as cl,bo as xa,br as Yr,ca as tr,bf as ir,a7 as Et,am as Pn,ax as Rn,bk as Wa,ai as sa,aj as jr,aw as za,bz as Vo,cb as Ya,c5 as Sa,aC as _r,cd as Js,bv as ul}from"./DYhIMPy1.js";import{k as Ne,s as re,a as un,j as Xa,l as oa,h as Br,d as gt,f as Zt,i as Wn,I as fl,c as ia,p as gl,o as ml,S as pl,C as vl}from"./BPk16bSc.js";import{H as Yt,j as hl,s as Ko,p as qs,y as _l,u as yl,t as Pr,g as Kn,c as ra,E as Is,A as ss,D as Ha,S as bl}from"./Bl_iEh1f.js";import{b as fn}from"./BaIAhI85.js";import{bT as Go,j as Ra,a5 as Ss,ak as Ua,F as wl,at as Na,aM as xl,aP as eo}from"./
|
|
1
|
+
var il=Object.defineProperty;var ll=(r,t,n)=>t in r?il(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n;var _n=(r,t,n)=>ll(r,typeof t!="symbol"?t+"":t,n);import{t as bt,bq as m,bo as g,a_ as z,by as wt,b as xt,bs as Dn,bu as lr,bt as dl,br as aa}from"./BAqR9jtB.js";import{bs as kt,a5 as D,bA as E,bS as P,bl as oe,ay as we,aD as e,b_ as F,bO as X,W as f,c9 as a,bn as It,bV as fe,bH as H,aA as p,be as xr,b$ as Vr,aB as A,bj as On,c0 as In,c6 as cl,bo as xa,br as Yr,ca as tr,bf as ir,a7 as Et,am as Pn,ax as Rn,bk as Wa,ai as sa,aj as jr,aw as za,bz as Vo,cb as Ya,c5 as Sa,aC as _r,cd as Js,bv as ul}from"./DYhIMPy1.js";import{k as Ne,s as re,a as un,j as Xa,l as oa,h as Br,d as gt,f as Zt,i as Wn,I as fl,c as ia,p as gl,o as ml,S as pl,C as vl}from"./BPk16bSc.js";import{H as Yt,j as hl,s as Ko,p as qs,y as _l,u as yl,t as Pr,g as Kn,c as ra,E as Is,A as ss,D as Ha,S as bl}from"./Bl_iEh1f.js";import{b as fn}from"./BaIAhI85.js";import{bT as Go,j as Ra,a5 as Ss,ak as Ua,F as wl,at as Na,aM as xl,aP as eo}from"./CzrG_lpv.js";import{t as Gn,r as kl,P as Il}from"./7IyNIHph.js";import{F as Vt,cF as Ds,at as Qo,aX as Zo,aI as Sl,c5 as Al,a3 as Tl,a5 as ja,aL as Cl,cI as Ml,cH as Pl,a2 as Ja,av as Bs,ai as Rl,br as Nl,aQ as El,aV as Ll,bG as $l,an as Ol,cx as ql,aB as to,be as kn,aN as ro,bY as os,aG as Aa,cR as Dl,c7 as Bl,bl as Fl,b as Wl,ck as zl,af as Hl,b8 as is,cm as la,cA as Ul,c$ as Fs,X as Yo,a as jl}from"./DKXEy5Lq.js";import{c1 as Ea,aB as ba,cM as Xo,cO as qn,bS as es,i as Vl,cG as Jo,cL as ts,cK as ei,cI as ti,f as Tn,a9 as Kl,aa as Gl,aw as Ql,r as Zl,J as Yl,V as no,u as ri,dJ as Xl,as as Jl,j as ed,t as ls,m as td,N as rd,n as nd,p as ni,q as ai,a5 as ad,R as sd,Q as od,$ as id,k as ld,cP as dd,a3 as cd,C as ud,w as fd,U as ao}from"./DY6JypjK.js";import{Hp as lt,o7 as gd,sm as La,mY as so,u8 as si,ua as oi,qM as md,x4 as Va,R as pd,ts as ii,mT as li,bi as $a,x5 as vd,pz as hd,s0 as _d,u1 as di,mR as yd,lY as bd,g as wd,xx as xd,xu as kd,xw as Id}from"./BSwWMzab.js";import{f as pt,am as Ws,bt as Sd,bx as ds,bL as Ad}from"./C9gP-gRX.js";import{a2 as Td,x as cs,a0 as Cd,O as us,V as Md,_ as Pd,j as Rd,o as da,M as ea,p as Nd,F as Ed,u as Ld,s as $d,L as fs,J as Od,y as qd,K as Dd,Z as ma,Q as Ta,N as oo,m as io,E as Bd,c as gs,B as lo,z as Fd,v as co,H as pa,P as Wd,G as zd,i as Hd,R as Ud,T as jd,A as Vd,g as Kd,b as Gd,D as Qd,f as Zd,e as Yd,a as Xd,C as Jd,h as ec,U as ci,a3 as tc,t as rc,k as nc,d as uo}from"./CsTPrgDm.js";import{i as ac,e as sc}from"./Ccf4dYFA.js";import{g as ms}from"./BvFAWM27.js";import{M as ca,C as Ca}from"./DkI_jPOw.js";import{C as fo}from"./6rzwTXJx.js";import"./C-fnz5X4.js";import{P as oc}from"./DNYGh_FV.js";import"./3V4Tx4nH.js";import{c as ui}from"./ChTqQfQN.js";import{s as Cn}from"./DiCMHWTR.js";import{S as ic}from"./CA7UZgrf.js";import{D as go,M as lc}from"./q4Mp6azq.js";import{b as dc,s as Un,c as Ka}from"./C6XSZJri.js";import{O as Oa,y as ps,E as vs,B as hs,N as cc,m as uc,l as fc,d as Ga,C as mo,f as gc,e as mc,g as pc}from"./C_KYY7ZK.js";import{j as fi,g as vc,s as po}from"./XzWc0fs1.js";import{f as hc}from"./BJzHxIyr.js";import{c as an}from"./CZI4_vlI.js";import{A as _c,B as yc,c as bc}from"./DO2cS8JO.js";import{o as _s,n as ys,v as vo,h as wc}from"./D84mJH5u.js";import"./BRNfUSNR.js";import{aK as $n,w as xc}from"./-URcs0EB.js";import"./DH9gMPGd.js";import{R as As,C as rs,n as kc,e as Ic,d as Sc,f as ho,P as Ac}from"./Bc-8qHYh.js";import"./7ZJvg7ev.js";import{aZ as Sr,A as qa,aj as gi,o as mi,e as Tc,I as Cc,R as Mc,ar as Pc,b as Rc,_ as Nc}from"./A3beYjJS.js";import{Z as _o,J as ha,s as pi,k as Ec}from"./B6Eksue8.js";import{B as Lc}from"./DSOeLuN2.js";import{r as $c,e as Oc,o as qc}from"./Bfc094Ub.js";import{o as vi}from"./LSDVwgG8.js";import{g as zs}from"./Cop9b2dY.js";import{a as Dc,M as Bc}from"./C11wqToa.js";import{c as ua}from"./B2RRuLl5.js";import{A as Fc}from"./CcGPnEzl.js";import{f as Wc,d as zc}from"./BOQCK4ni.js";import{I as Hc,t as Uc,B as jc,r as yo,A as Vc,n as Kc}from"./kdf0l6Z-.js";import{b as Gc}from"./BgyuoEGq.js";import{E as Qc}from"./UuiGcpAE.js";import{S as Zc}from"./hacdNVQl.js";import{u as Yc,a as Xc,c as bo,S as Jc}from"./DfxQWSVU.js";import{T as Ts}from"./BDXCy3lH.js";import{a as eu}from"./BMkc6ng0.js";import{b as wo}from"./p7znhYIU.js";import{a6 as tu}from"./C8_w7W1W.js";import{c as ru}from"./BW6fyv0T.js";function nu(r){if(!r||typeof r!="object")return null;const t=r;if(t.type!=="script_monitor_wake"||t.source!=="system")return null;const{scriptName:n,scriptId:s,runId:i,monitorId:o,workspaceId:d,reason:c}=t;if(typeof n!="string"||typeof s!="string"||!s||typeof i!="string"||!i||typeof o!="string"||!o||typeof d!="string"||!d||c!=="finished"&&c!=="ttl-expired"&&c!=="output-match"&&c!=="line-count")return null;const y=t.trigger;return{scriptName:n,scriptId:s,runId:i,monitorId:o,workspaceId:d,reason:c,...c==="output-match"&&typeof y?.matchedLine=="string"?{matchedLine:y.matchedLine}:{}}}function au(r){return r?.type==="script_monitor_wake"&&!("remoteAgentId"in r)}function su(r,t,n,s=!1){if(!r||!t)return{edit:!1,remove:!1,sendNow:!1};const i=r.messageMetadata?.fromPrincipalId??r.author?.principalId,o=Hc(r)&&r.author?.principalId!==null&&i===t;return{edit:o,remove:o||t===n||s,sendNow:(o||s)&&!hi(r)}}function fa(r,t){if(t)return r.find(n=>n.editing&&n.editingMessageId?n.editingMessageId===t:n.id===t)}function hi(r){return au(r.messageMetadata)&&typeof r.messageMetadata?.monitorId=="string"}function xo(r,t=Date.now()){const n=r.messageMetadata,s=n?.fromPrincipalId,i=n&&Object.hasOwn(n,"humanAuthor")&&!(typeof s=="string"&&s.length>0),o=r.holdKind!==void 0&&Date.parse(r.holdUntil??"")>t;return!r.editing&&!o&&!i&&!hi(r)}const Th="pl-3.5! pr-2!";var ou=A("<!> ",1),iu=A('<div class="flex flex-col gap-2 px-4 py-3 bg-muted/30 border border-border rounded-lg my-4"><div class="flex items-center justify-between gap-2"><div class="flex items-center gap-2"><div class="shrink-0 text-subtle"><!></div> <div class="font-medium text-sm"> </div></div> <div class="flex items-center gap-1"><!> <!></div></div> <div class="text-xs text-subtle"> </div> <pre class="text-xs bg-background/50 rounded p-2 overflow-x-auto max-h-40 overflow-y-auto font-mono"> </pre></div>');function _i(r,t){if(new.target)return bt({component:_i,...r});kt(t,!0);let n=m(t,"name",7),s=m(t,"description",7),i=m(t,"content",7),o=m(t,"onUseScript",7),d=fe(!1);function c(){navigator.clipboard.writeText(i()),H(d,!0),setTimeout(()=>{H(d,!1)},2e3)}function y(){o()?.({name:n(),description:s(),content:i()})}var _={get name(){return n()},set name(V){n(V),p()},get description(){return s()},set description(V){s(V),p()},get content(){return i()},set content(V){i(V),p()},get onUseScript(){return o()},set onUseScript(V){o(V),p()},$set:wt,$on:(V,ne)=>xt(t,V,ne)},b=iu(),I=D(b),M=D(I),Z=D(M),w=D(Z);Vt(w,{get icon(){return Ds},size:"sm"}),E(Z);var L=P(Z,2),Q=oe(L,!0);E(M);var j=P(M,2),R=D(j);pt(R,{variant:"ghost-light",size:"sm",onclick:c,class:"h-7 px-2",children:(V,ne)=>{var pe=ou(),be=we(pe);{let qe=a(()=>e(d)?Qo:Zo);Vt(be,{get icon(){return e(qe)},class:"mr-1"})}var ge=P(be);F(qe=>X(ge,` ${qe??""}`),[()=>e(d)?g.chat_shared_copied_label():g.chat_shared_copy_label()]),f(V,pe)},$$slots:{default:!0}});var N=P(R,2);{var x=V=>{pt(V,{variant:"ghost-light",size:"sm",onclick:y,class:"h-7 px-2",children:(ne,pe)=>{xr();var be=Vr();F(ge=>X(be,ge),[()=>g.chat_setupScriptCard_useScript_label()]),f(ne,be)},$$slots:{default:!0}})};z(N,V=>{o()&&V(x)})}E(j),E(I);var ee=P(I,2),S=oe(ee,!0),T=P(ee,2),Me=oe(T,!0);return E(b),F(()=>{X(Q,n()),X(S,s()),X(Me,i())}),f(r,b),It(_)}const hr={toolStart:/(?:\x1B\[\d+m)?🔧\s+(?:Tool call:\s+)?(.+?)(?:\x1B\[0m)?$/,toolDetail:/(?:[└├]─\s+(.+)$|^\s{3,}(.+)$)/,toolResult:/(?:\x1B\[\d+m)?📋\s+Tool result:\s+(.+?)(?:\x1B\[0m)?$/,toolSuccess:/[✓✔✅]\s+(.+)$/,toolError:/[❌✗❎]\s+(.+)$/,sessionInfo:/[Ss]ession:\s*([a-f0-9-]+)/,resumedSession:/📂?\s*Resumed session/i,assistantMarker:/🤖/,systemMarker:/💻/,userMarker:/👤/,thinkingMarker:/🤔\s*Thinking/i,waitingMarker:/^⏳\s+Running/i,indexingProgress:/^Indexing:\s*\[.*\]\s*\d+%/,agentDigest:/<agent_digest>([\s\S]*?)<\/agent_digest>/,setupScript:/<setup_script\s+name="([^"]+)"\s+description="([^"]+)">([\s\S]*?)<\/setup_script>/};class lu{constructor(){_n(this,"buffer","");_n(this,"currentToolName",null);_n(this,"currentToolId",null);_n(this,"lastToolId",null);_n(this,"currentToolParams",[]);_n(this,"currentToolResultContent",[]);_n(this,"inToolResult",!1);_n(this,"inCodeBlock",!1);_n(this,"codeBlockLanguage","");_n(this,"codeBlockContent","");_n(this,"characterBuffer","");_n(this,"inCharacterMode",!1);_n(this,"emittedToolIds",new Set)}parseChunk(t){if(this.isMarkerLine(t.trim())){const i=[];if(this.inToolResult&&this.currentToolResultContent.length>0){const c=this.currentToolResultContent.some(_=>_.startsWith("❌")||_.startsWith("Error:")),y=this.currentToolResultContent.map(_=>_.replace(/^❌\s*/,"").replace(/^Error:\s*/,"")).join(`
|
|
2
2
|
`);i.push({type:"tool_result",content:y,metadata:{toolId:this.currentToolId,isError:c}}),this.lastToolId=this.currentToolId,this.currentToolId=null,this.inToolResult=!1,this.currentToolResultContent=[]}const o=t.indexOf("🤖"),d=t.substring(o+2);if(this.inCharacterMode=!0,this.characterBuffer="",d&&d.trim()&&d!==`
|
|
3
3
|
`){const c=d.replace(/^\n/,"");c&&(this.characterBuffer=c)}return i}if(this.inCharacterMode){if(t.trim()===""&&this.characterBuffer==="")return[];if(t.includes(`
|
|
4
4
|
`)&&this.characterBuffer.length>0){const i=t.substring(0,t.indexOf(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as xt}from"./
|
|
1
|
+
import{p as xt}from"./CE8vXfAM.js";import{aZ as gt,U as $t,Y as bt,b0 as wt,V as Ct,a_ as vt,b as s,ay as O,aX as Dt,B as kt,r as Tt,q as U,W as Z,O as At,a6 as ot}from"./q4Mp6azq.js";import{p as Bt}from"./BxiJOwnz.js";var rt=s(()=>({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...At.cynefin,...Z().cynefin}),"getConfig"),Pt=s(()=>{Tt(),H=rt()},"clear"),G={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},Wt=s(t=>{xt(t,G),G.setDomains(t.domains),G.setTransitions(t.transitions)},"populate"),It={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),Wt(e)},"parse")};function E(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(E,"seededRandom");function st(t){let e=0;for(let n=0;n<t.length;n++){const a=t.charCodeAt(n);e=(e<<5)-e+a,e|=0}return e}s(st,"hashString");function it(t,e){return typeof t=="number"&&Number.isFinite(t)&&t!==0?t:st(e)}s(it,"resolveSeed");function ct(t,e,n,a){const c=t/2,m=a??t*.015,v=7,I=e/v,d=[];for(let o=0;o<=v;o++){const p=E(n+o*17)*m*2-m;d.push({x:c+p,y:o*I})}let D=`M${d[0].x},${d[0].y}`;for(let o=0;o<d.length-1;o++){const p=d[o],i=d[o+1],f=(p.y+i.y)/2,b=o%2===0?1:-1,h=m*1.5*b*E(n+o*31+7),R=p.x+h,V=f,_=i.x-h;D+=` C${R},${V} ${_},${f} ${i.x},${i.y}`}return D}s(ct,"generateFoldPath");function lt(t,e,n,a){const c=e/2,m=a??e*.015,v=7,I=t/v,d=[];for(let o=0;o<=v;o++){const p=E(n+o*23)*m*2-m;d.push({x:o*I,y:c+p})}let D=`M${d[0].x},${d[0].y}`;for(let o=0;o<d.length-1;o++){const p=d[o],i=d[o+1],f=(p.x+i.x)/2,b=o%2===0?1:-1,h=m*1.5*b*E(n+o*37+11),R=f,V=p.y+h,_=f,z=i.y-h;D+=` C${R},${V} ${_},${z} ${i.x},${i.y}`}return D}s(lt,"generateHorizontalBoundary");function dt(t,e){const n=t/2,a=e*.5,c=e,m=t*.03;return[`M${n},${a}`,`C${n+m},${a+(c-a)*.2}`,`${n-m*1.5},${a+(c-a)*.55}`,`${n+m*.5},${a+(c-a)*.75}`,`C${n-m},${a+(c-a)*.85}`,`${n+m*.3},${a+(c-a)*.95}`,`${n},${c}`].join(" ")}s(dt,"generateCliffPath");function ft(t,e,n,a){return[`M${t-n},${e}`,`A${n},${a} 0 1,1 ${t+n},${e}`,`A${n},${a} 0 1,1 ${t-n},${e}`,"Z"].join(" ")}s(ft,"generateConfusionPath");var at={complex:{model:"Probe → Sense → Respond",practice:"Emergent Practices"},complicated:{model:"Sense → Analyse → Respond",practice:"Good Practices"},clear:{model:"Sense → Categorise → Respond",practice:"Best Practices"},chaotic:{model:"Act → Sense → Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}},Rt=s((t,e)=>{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),Vt=s(()=>{const t=ot(),e=Z();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,_t=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),I=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=Vt();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,V=i+b*2,_=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,_,V,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${V} ${_}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const T=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Q=it(o.seed,e),mt=T.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=T.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Q,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Q+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;T.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=T.append("g").attr("class","cynefin-labels");for(const l of X){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=T.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=T.append("g").attr("class","cynefin-items"),A=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(A+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const Y=x.getBBox();Y.width>0&&($=Y.width)}const C=$+tt*2,W=u.cx-C/2;M.attr("transform",`translate(${W}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",A/2)}),N>0){const g=B+L.length*(A+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const W=$.getBBox();W.width>0&&(P=W.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",A/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=T.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),W=C*.15,Y=-x/C,ht=$/C,et=M+Y*W,nt=P+ht*W;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}I&&T.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(I)},"draw"),Ft={draw:_t},Et=s(()=>{const t=ot(),e=Z();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Et();return`
|
|
2
2
|
.cynefinDomain {
|
|
3
3
|
stroke: none;
|
|
4
4
|
}
|