@intent-hq/web 2.383.7 → 2.383.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/web/app/immutable/chunks/{51Rp6_AF.js → 1pggOq7Y.js} +1 -1
- package/web/app/immutable/chunks/{BgjaD_Yy.js → 3Ldfn3Hk.js} +1 -1
- package/web/app/immutable/chunks/{B0SuIES7.js → 7gWOOPbU.js} +1 -1
- package/web/app/immutable/chunks/{CLUxyZqF.js → 7xJIif_I.js} +1 -1
- package/web/app/immutable/chunks/{lzc_ALaY.js → B-GeM0hN.js} +1 -1
- package/web/app/immutable/chunks/{C8ZC1xrW.js → B1xhmeEH.js} +1 -1
- package/web/app/immutable/chunks/{B6q3uVQG.js → B76xmWcE.js} +1 -1
- package/web/app/immutable/chunks/{DQZ6hbu0.js → B9nR8abu.js} +1 -1
- package/web/app/immutable/chunks/{BUDFO3oC.js → BAlOCGA0.js} +1 -1
- package/web/app/immutable/chunks/{DqH-hVUa.js → BJJHfc9t.js} +1 -1
- package/web/app/immutable/chunks/{BBrT6DIB.js → BK9M_z99.js} +1 -1
- package/web/app/immutable/chunks/{BXMl8g0k.js → BKS-pxip.js} +1 -1
- package/web/app/immutable/chunks/{lQcc1B6x.js → BLUz30qV.js} +1 -1
- package/web/app/immutable/chunks/{C5H3ErAr.js → BPXHGMqU.js} +1 -1
- package/web/app/immutable/chunks/{Dl2c_Q4j.js → BQDKcjOE.js} +1 -1
- package/web/app/immutable/chunks/{CqEyPGwj.js → BSVf-Bjr.js} +1 -1
- package/web/app/immutable/chunks/{C1IZMhCT.js → BTKxt0G5.js} +1 -1
- package/web/app/immutable/chunks/{Dqhi5681.js → BTQPEfI4.js} +1 -1
- package/web/app/immutable/chunks/{Dl4B5sLX.js → BURetyvc.js} +1 -1
- package/web/app/immutable/chunks/{DbD3dAy_.js → BUtc5GRR.js} +1 -1
- package/web/app/immutable/chunks/{C1dPOfxb.js → BVAdLfsa.js} +4 -4
- package/web/app/immutable/chunks/{9KbPq6ne.js → BYFX8NvB.js} +1 -1
- package/web/app/immutable/chunks/{DtekCANZ.js → BbV6sku_.js} +1 -1
- package/web/app/immutable/chunks/{lFCyJLs0.js → BbbgNz0Q.js} +1 -1
- package/web/app/immutable/chunks/{1VDAs3Ud.js → BdTfZwM8.js} +1 -1
- package/web/app/immutable/chunks/{BIsdYrnK.js → BhqgbIQr.js} +1 -1
- package/web/app/immutable/chunks/{96gE90DS.js → Bjm5XArF.js} +1 -1
- package/web/app/immutable/chunks/{BtI19qHa.js → BkfS5KoW.js} +13 -13
- package/web/app/immutable/chunks/{Q16zd2xh.js → BmlblCgy.js} +1 -1
- package/web/app/immutable/chunks/{8MucyzZK.js → BnbH2DvO.js} +1 -1
- package/web/app/immutable/chunks/{BZ1Q38PM.js → Bo1VuU-H.js} +1 -1
- package/web/app/immutable/chunks/{Dc0NoKVI.js → Bo7KS63f.js} +1 -1
- package/web/app/immutable/chunks/{C91EC830.js → BpfNraM2.js} +1 -1
- package/web/app/immutable/chunks/{CE-gn8fg.js → Brm4kmEq.js} +1 -1
- package/web/app/immutable/chunks/{CKjysSbd.js → BtxkToW7.js} +1 -1
- package/web/app/immutable/chunks/{D1Kvaw2U.js → Buso8jHT.js} +1 -1
- package/web/app/immutable/chunks/{DCzWLn9w.js → ByDL4Wt0.js} +1 -1
- package/web/app/immutable/chunks/{DLS35Cs2.js → C2o4LFKC.js} +2 -2
- package/web/app/immutable/chunks/{BUchcLc3.js → C6AhVpEM.js} +3 -3
- package/web/app/immutable/chunks/{Cpw-AI-k.js → C89-HR3N.js} +4 -4
- package/web/app/immutable/chunks/{ZtnoAnS2.js → C8za2RwY.js} +1 -1
- package/web/app/immutable/chunks/{SnC5sLK-.js → CC1pNuhl.js} +1 -1
- package/web/app/immutable/chunks/{38BB0grB.js → CDaqERFv.js} +1 -1
- package/web/app/immutable/chunks/{CzRvdM50.js → CE0T7dwE.js} +3 -3
- package/web/app/immutable/chunks/{Dj8digI5.js → CGOaYbWk.js} +1 -1
- package/web/app/immutable/chunks/{DOAyQZ8n.js → CGnOIrwW.js} +1 -1
- package/web/app/immutable/chunks/{B7ZVMWBx.js → CJL0nxkZ.js} +1 -1
- package/web/app/immutable/chunks/{C3KL0Dob.js → CKyxiFOy.js} +2 -2
- package/web/app/immutable/chunks/{DnNC4gf3.js → COBU-CLw.js} +3 -3
- package/web/app/immutable/chunks/{B3WV7a-V.js → COW99wsu.js} +1 -1
- package/web/app/immutable/chunks/{B9bXgFyu.js → CRR7Y95m.js} +2 -2
- package/web/app/immutable/chunks/{BgZpMc5-.js → CRfEdILh.js} +1 -1
- package/web/app/immutable/chunks/{C4ItHUxb.js → CS4mJHYc.js} +1 -1
- package/web/app/immutable/chunks/{Cxb8aRlA.js → CSRKWN2m.js} +2 -2
- package/web/app/immutable/chunks/{CS3H-hA4.js → CShcKF5d.js} +1 -1
- package/web/app/immutable/chunks/{5moVT_HQ.js → CUfjsZQQ.js} +1 -1
- package/web/app/immutable/chunks/{BB2DpGJV.js → CZsHRLvg.js} +1 -1
- package/web/app/immutable/chunks/{CtCH4W1N.js → C_zDgOHy.js} +1 -1
- package/web/app/immutable/chunks/{BfSTFUKA.js → CaiHVgqy.js} +1 -1
- package/web/app/immutable/chunks/{D_Fe9jJy.js → Cb9Smg8Z.js} +1 -1
- package/web/app/immutable/chunks/{Cb9atCGq.js → CbT0r42d.js} +1 -1
- package/web/app/immutable/chunks/{7da8sugr.js → Cc4N9YOF.js} +2 -2
- package/web/app/immutable/chunks/{DhQSNgxc.js → Cg61PLZh.js} +1 -1
- package/web/app/immutable/chunks/{DsCz_Hld.js → CjpmxxIF.js} +1 -1
- package/web/app/immutable/chunks/{SwH0lZVC.js → Cka0AqTN.js} +1 -1
- package/web/app/immutable/chunks/{C9fVl7VH.js → CkvXIU5f.js} +1 -1
- package/web/app/immutable/chunks/{BbHdeR3v.js → ClZz0jys.js} +1 -1
- package/web/app/immutable/chunks/{Cxs-r6qH.js → ClfSST38.js} +1 -1
- package/web/app/immutable/chunks/{NaXnyxXD.js → CmQgxntP.js} +1 -1
- package/web/app/immutable/chunks/{C56HY_cI.js → CmoThujO.js} +1 -1
- package/web/app/immutable/chunks/{i2uLOz57.js → CpwGgnWV.js} +1 -1
- package/web/app/immutable/chunks/{DaLNZosE.js → CqjTdgdP.js} +1 -1
- package/web/app/immutable/chunks/{DBOkAv2-.js → CzAdFBS-.js} +1 -1
- package/web/app/immutable/chunks/{B6ERx__s.js → D0DWZnGH.js} +2 -2
- package/web/app/immutable/chunks/{DqMZWY-u.js → D0i8GwSa.js} +2 -2
- package/web/app/immutable/chunks/{DITUyjV2.js → D0n-4lqf.js} +3 -3
- package/web/app/immutable/chunks/{DGSdOlov.js → D2EoEx7R.js} +1 -1
- package/web/app/immutable/chunks/{DyIsX23v.js → D2Y3lcdt.js} +4 -4
- package/web/app/immutable/chunks/{CzMfcD76.js → D3qmsAQt.js} +2 -2
- package/web/app/immutable/chunks/{DggzSry-.js → D5EQeUyi.js} +1 -1
- package/web/app/immutable/chunks/{DT_iJHxn.js → DAreoJms.js} +1 -1
- package/web/app/immutable/chunks/{cWnGUUZk.js → DBD3Fgdf.js} +1 -1
- package/web/app/immutable/chunks/{CEl8yEuC.js → DBvm0g7B.js} +1 -1
- package/web/app/immutable/chunks/{3FaPVDTk.js → DDYaIqxc.js} +1 -1
- package/web/app/immutable/chunks/{tV0w-z-Q.js → DTDpxeis.js} +1 -1
- package/web/app/immutable/chunks/{CQvGDYQV.js → DU7k8Meq.js} +1 -1
- package/web/app/immutable/chunks/{Bf16PEz1.js → DUUjp9sb.js} +1 -1
- package/web/app/immutable/chunks/{CaVcxIX_.js → DaNZLNee.js} +1 -1
- package/web/app/immutable/chunks/{SSdhXyvx.js → DaVnXn1w.js} +1 -1
- package/web/app/immutable/chunks/{FoSxZj2s.js → Dbkui2NJ.js} +1 -1
- package/web/app/immutable/chunks/{amTgh_yM.js → Dea7iEsq.js} +1 -1
- package/web/app/immutable/chunks/{Bwa_PJLB.js → Df8HaglQ.js} +1 -1
- package/web/app/immutable/chunks/{CmbyIv2W.js → DgSmYey_.js} +1 -1
- package/web/app/immutable/chunks/{C2BnXWav.js → DhBr4igy.js} +1 -1
- package/web/app/immutable/chunks/{DgiZ-0Sp.js → DiKXd1w8.js} +2 -2
- package/web/app/immutable/chunks/{NqwdDVdt.js → DqkmESML.js} +1 -1
- package/web/app/immutable/chunks/{xGj0i83D.js → DrG_DaSS.js} +6 -6
- package/web/app/immutable/chunks/{BGm3f58g.js → DrOujub9.js} +1 -1
- package/web/app/immutable/chunks/{DMVD9ZWm.js → DsKSelM2.js} +1 -1
- package/web/app/immutable/chunks/{Y3x17kvu.js → DtAW1k1y.js} +1 -1
- package/web/app/immutable/chunks/{CIeXUP7u.js → DtKxKldd.js} +1 -1
- package/web/app/immutable/chunks/{Byb6yuNY.js → Dua5IJ1m.js} +1 -1
- package/web/app/immutable/chunks/{aoCeefP4.js → DxM5221X.js} +1 -1
- package/web/app/immutable/chunks/{9p0DyBPU.js → DyLYpcbU.js} +1 -1
- package/web/app/immutable/chunks/{DwDabzpx.js → DyU1d4KO.js} +1 -1
- package/web/app/immutable/chunks/{D8bef7T8.js → K0UaKTlA.js} +1 -1
- package/web/app/immutable/chunks/{CQlHJWbs.js → M1pm4Ylz.js} +3 -3
- package/web/app/immutable/chunks/{m2kIPDiE.js → M4SSivqw.js} +1 -1
- package/web/app/immutable/chunks/{CqhHB0m1.js → Ok-Tb49z.js} +3 -3
- package/web/app/immutable/chunks/{BhcBqtJg.js → PWCv1nwS.js} +1 -1
- package/web/app/immutable/chunks/{DGP-y2GB.js → TwgPo_u9.js} +3 -3
- package/web/app/immutable/chunks/{CdDve0EN.js → a-NM4LeO.js} +1 -1
- package/web/app/immutable/chunks/{BcUHkjB6.js → c1qYicwM.js} +1 -1
- package/web/app/immutable/chunks/{CTYV2WCR.js → e_FRlhPf.js} +1 -1
- package/web/app/immutable/chunks/{D14F6Zen.js → fKj7i94n.js} +1 -1
- package/web/app/immutable/chunks/{veocPVpA.js → hoVWzIJA.js} +1 -1
- package/web/app/immutable/chunks/{B91a7NqB.js → ijAQGDk2.js} +1 -1
- package/web/app/immutable/chunks/{CteMcmUe.js → j9JAHeUU.js} +2 -2
- package/web/app/immutable/chunks/{B3zWdyp-.js → jVKXeiL6.js} +1 -1
- package/web/app/immutable/chunks/{BcQ6Rg0V.js → jbr21ium.js} +1 -1
- package/web/app/immutable/chunks/{CaCH7xka.js → m6pGB8MK.js} +1 -1
- package/web/app/immutable/chunks/{SDBQMo24.js → pxZ1G7sU.js} +1 -1
- package/web/app/immutable/chunks/{Dd6jkKNK.js → rotY2sdQ.js} +1 -1
- package/web/app/immutable/chunks/{CPIZev3Z.js → tDrnMawv.js} +1 -1
- package/web/app/immutable/chunks/{C_1zy40-.js → vjpfI6xX.js} +1 -1
- package/web/app/immutable/chunks/{BM2XSA6g.js → xG-zLBf8.js} +1 -1
- package/web/app/immutable/chunks/{CEOk8g-Q.js → yDR0_Br6.js} +3 -3
- package/web/app/immutable/entry/{app.oKB02DpO.js → app.PgiJw0D4.js} +2 -2
- package/web/app/immutable/entry/start.C2TmF15J.js +1 -0
- package/web/app/immutable/nodes/{0.Cj75U9Pb.js → 0.cff5OhJc.js} +1 -1
- package/web/app/immutable/nodes/{1.COmRB5Gs.js → 1.D2tI4cty.js} +1 -1
- package/web/app/immutable/nodes/{10.B-EGmrBP.js → 10.BnJGsWqJ.js} +4 -4
- package/web/app/immutable/nodes/{11.CHJVqhXh.js → 11.D8yEv7E-.js} +1 -1
- package/web/app/immutable/nodes/{15.DvvqcqqW.js → 15.CozJxxNW.js} +1 -1
- package/web/app/immutable/nodes/{19.CFGkesVY.js → 19.DH3ipUNG.js} +2 -2
- package/web/app/immutable/nodes/{2.BSKohF8j.js → 2.DX0DfJJh.js} +4 -4
- package/web/app/immutable/nodes/{3.CgM283V9.js → 3.Bxlo4Xts.js} +1 -1
- package/web/app/immutable/nodes/{4.pSSQL5ZR.js → 4.BJEI4s-5.js} +1 -1
- package/web/app/immutable/nodes/{5.gjcZy0Yo.js → 5.CLAljKic.js} +1 -1
- package/web/app/immutable/nodes/{6.mfPH3Xl6.js → 6.DDVeuDZh.js} +1 -1
- package/web/app/immutable/nodes/{7.hkLeTg6x.js → 7.w-I6a2X1.js} +1 -1
- package/web/app/immutable/nodes/{8.CwwxHkuu.js → 8.BBjC7avZ.js} +1 -1
- package/web/app/immutable/nodes/{9.VYVO4dZo.js → 9.ByPAfGSa.js} +13 -13
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/entry/start.MWx9NKvl.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var z_=Object.defineProperty;var Dg=n=>{throw TypeError(n)};var j_=(n,r,a)=>r in n?z_(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a;var Js=(n,r,a)=>j_(n,typeof r!="symbol"?r+"":r,a),G_=(n,r,a)=>r.has(n)||Dg("Cannot "+a);var Ao=(n,r,a)=>(G_(n,r,"read from private field"),a?a.call(n):r.get(n)),Ng=(n,r,a)=>r.has(n)?Dg("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,a);import{t as un,bo as X,bw as gn,bp as gf,b as pn,bm as u,bq as Ur,bs as ge,br as qi}from"./C0QTy0Sy.js";import{bs as fn,a5 as I,bf as fs,bA as y,W as p,bn as vn,aA as Z,aB as E,ca as ae,a7 as Wt,ay as ye,aD as e,cd as Bn,c9 as o,bS as _,bl as de,be as dn,b_ as L,bO as j,c5 as it,bH as b,bV as me,bj as Es,bk as ro,b$ as ln,ai as Wd,aj as ps,bo as jl,br as Mr,c0 as Dt,ak as V_,cb as sd,aw as wi,a as K_}from"./3SdAC2_C.js";import{i as N}from"./bhKPSdq4.js";import{k as xi}from"./-K3ARgq0.js";import{g as Dn,i as Q_,I as eo,p as Lo,e as Eo}from"./B6S6VNu7.js";import{n as Nt,l as ma,c as to,j as Bg,k as Fo,h as J_}from"./DLwWVKiF.js";import{b as pf,e as Ud,f as xe,s as ze,c as zt,g as gs}from"./7UPrdiE9.js";import{b as Y_}from"./goTpbPhD.js";import{b as wr}from"./Dn334wJv.js";import{m as X_,U as Z_,Z as ew,X as tw,Y as nw,I as Wg,o as rw,l as aw,a2 as sw,x as Ug,$ as ow,a0 as zg,r as iw,s as lw}from"./DGP-y2GB.js";import{Jv as D,fo as cw,eW as dw,f3 as uw,eX as gw,f1 as pw,f0 as fw,eZ as vw,e$ as hw,eY as mw,ru as _w,c6 as ww,i as $i,J4 as bw,Dc as ff,Dh as yw,Dj as jg,Dg as Iw,Di as Sw,vD as $w,vF as kw,Cp as vf,cp as xw,cn as Cw,By as Pw,bE as Rw,A3 as Aw,Ce as od,u$ as Tw,cq as Gg,dB as Mw,dC as Ew,Co as qw,el as Lw,CI as Hw,CH as Ow,CM as Fw,CL as Dw,cQ as Nw,cT as Bw,nC as Ww,er as Uw,wR as zw,CN as jw,wT as Gw,CO as Vw,cU as Kw,cV as Qw,nK as Jw,Ah as Yw,Iq as Xw,Ag as Zw,Dt as eb,wm as tb,wn as nb,y$ as rb,z3 as id,wi as ab,wj as sb,rS as ob,rf as ib,rd as lb,f_ as cb,HO as db,Lj as ub,GM as gb,gn as pb,p2 as fb,Jj as vb,oj as hb,A2 as mb,ft as Vg,r2 as Kg,fm as _b,fl as wb,tB as bb,g3 as Qg,re as yb,fe as Ib,C9 as Sb,m as $b,nL as kb,zH as xb,yZ as Cb,Ez as Pb,Eo as Jg,xh as Rb,xi as Yg,u_ as Xg,p3 as Ab,DF as Tb,gj as Mb,g1 as Eb,eU as qb,cM as Lb,A6 as Hb,Lo as Ob,Cu as Fb,LG as Db,y2 as Nb,ga as Bb,fd as Wb,cL as Ub,cI as zb,cH as jb,vr as Gb,xo as Vb,xm as Kb,cF as Qb,cE as Jb,z5 as Yb,z0 as Xb,xn as Zb}from"./_LtUY0jS.js";import{a as zd}from"./CC7to1B5.js";import{aM as ey,aL as ty,bg as ny,a7 as ry,aD as ay,aO as sy,M as hf,a0 as mf,b8 as oy,b2 as iy,as as Zg,P as bl,b0 as ep,a$ as tp,a_ as np}from"./C1dPOfxb.js";import{l as _f,G as ly,I as Pd,at as cy,b1 as El,a9 as wf,S as dy,aW as ld,aq as uy,aJ as gy,C as py,z as bf,s as fy,A as vy,v as hy,a$ as my,aH as yf,aG as If,aI as _y,j as rp,aM as cd,aT as ap,aS as yl,aU as sp,Q as op,d as wy,e as by,ax as yy,V as ip,aE as Iy,c as Sy,m as $y,aV as lp,ap as ky,aw as cp,a as xy,aA as Cy,ad as dp,aD as Py,aX as up,a_ as gp,n as pp,ae as Ry,R as Ay,ay as fp,am as Ty,O as My,as as Ey,h as qy,q as Ly,$ as dd,_ as Hy,aC as vp,a8 as Oy,f as Fy,i as Dy,a6 as Ny,ac as By}from"./CzRvdM50.js";import{f as Wy,o as Uy,E as zy,C as jy,m as Gy,a2 as hp,aa as Vy,K as Ky,e as Qy,y as Jy}from"./B50rrLDJ.js";import{g as Pi}from"./DypB-Dwi.js";import{dW as Dl,cU as Sf,O as $f,W as Yy,bv as Xy,aF as kf,dH as xf,aU as qo,e8 as Zy,dw as Cf,aw as jd,dV as Gd,aN as Pf,cP as eI,V as ha,a3 as Xs,B as tI,a7 as nI,a4 as rI,M as aI,a6 as sI,ar as oI,aG as Rf,aO as ql,b6 as iI,ay as Af,r as lI,n as Rd,H as cI,dY as dI,aQ as uI,aK as gI,c9 as pI,aW as fI,bM as vI,bK as hI,bL as mI,c8 as _I,c7 as wI,cN as bI,cM as yI,aS as II,bb as SI,bd as $I,bg as kI,bc as xI,bl as CI,bf as PI,be as RI,bh as AI,bi as TI,bk as MI,bj as EI,ax as qI,cj as LI,ck as HI,dv as OI,du as FI,a$ as DI,G as NI,b3 as BI,cf as WI,C as mp,d0 as UI,ba as ds,b$ as zI,X as jI,bq as GI,E as VI,ad as KI,t as QI,cW as JI,d3 as _p,Q as wp,dt as YI,cQ as ud}from"./Cppy6ZYG.js";import{u as Tf,a as Il,ag as XI,x as ZI,ad as Mf,af as eS,ac as Ef,a4 as tS,F as bp,D as nS,e as rS,n as aS,s as sS,m as oS,Y as iS,k as lS}from"./Bwa_PJLB.js";import{a2 as cS,b5 as dS,cM as uS,a_ as gS,b4 as pS,c2 as fS,c9 as vS,w as hS,x as mS,cd as _S}from"./BfSTFUKA.js";import{n as wS,P as qf,F as bS,ai as yS,r as IS,ac as SS}from"./DX-Wrapd.js";import{I as $S,s as kS,H as yp}from"./Bqd7fdCF.js";import{e as xS}from"./CL3a4Hm1.js";import{e as CS,f as PS}from"./haN7a3Sc.js";import{s as RS,o as Zs,b as AS,g as Nl,d as TS,l as bi}from"./CIyUrgF0.js";import{a5 as MS,a7 as ES,D as qS,N as LS,ac as Ip,X as Lf,i as HS,r as dr,v as Ri,u as na,p as ki,x as br,S as Vd,m as Gl,s as Ho,y as Ai,o as ao,n as so,t as Sp,aa as oo,w as io,a9 as Kd,q as _a,z as Oo,J as Ad,_ as $p,g as OS,F as FS,U as Hf,I as Of,a8 as Ff,a6 as Ll,O as DS,E as Df,V as NS,A as BS,b as WS,ab as US,ad as Sl,G as zS,e as gd,l as jS,C as GS,f as Ys,j as kp,H as us,Q as VS,d as $l,c as KS,a as xp,h as QS,L as JS,Y as Cp,a4 as pd,a1 as Pp,a0 as YS,a3 as Rp,$ as Ap,T as XS,B as ZS,k as e$,a2 as t$,K as n$,R as r$,P as a$,W as s$}from"./SnC5sLK-.js";import{m as o$}from"./Dms_DO28.js";import{g as Nf}from"./BPjvgJzJ.js";import{b as i$}from"./BsOWc0fD.js";import{g as l$}from"./_Z48PZPG.js";import{a as c$}from"./C429ViPJ.js";import{q as Bf,d as ur,r as d$,e as Bl,j as u$,g as Td,i as g$,f as Md,c as p$,A as f$,O as Tp,k as v$}from"./CE-gn8fg.js";import{P as h$}from"./D5TRf27k.js";import{e as m$}from"./DB7RVYiL.js";import{b as _$,a as w$,g as b$,c as y$,i as I$}from"./DsffLoT8.js";import{R as S$,g as $$,W as kl,c as k$}from"./SDBQMo24.js";import"./A9niI_uA.js";import"./CJ4Z96pe.js";import{t as Ti}from"./CrD0jtXE.js";import{F as x$,h as C$}from"./C2jYl_tm.js";import"./lJeex2Gh.js";import{C as P$,e as Br,L as R$,l as Vl,d as Kl,K as Ql,h as Qd,M as Jl,S as Da}from"./DCL0Px6m.js";import{D as A$}from"./C3kvbgti.js";import{f as Mp}from"./chjnSxvZ.js";import"./DU3vNstz.js";import{i as Wf}from"./BjLb7AHW.js";import{h as Ep,i as qp,g as Lp,P as Hp,C as T$,m as Hl,R as M$}from"./DlUZpQ7U.js";import{f as bt,ae as E$}from"./CttA-M7l.js";import{F as ct,bs as q$,cd as L$,aw as Na,a2 as Uf,c9 as H$,bf as O$,be as F$,bg as D$,aO as Op,aj as fd,aB as vd,bB as zf,d3 as Wl,cF as N$,aM as Fp,cb as Dp,cK as Ul,bu as B$,aS as W$,d0 as U$,a8 as jf,ac as z$,ag as j$,cr as G$,ba as V$,aC as Gf,cT as Np,cz as K$,ax as Q$,cD as J$,c3 as Y$}from"./U9jJmfYa.js";import{c as Vf}from"./ChTqQfQN.js";import"./DI_O2uCQ.js";import{c as Et}from"./CUkDMZwP.js";import{a5 as Kf,bg as X$,ar as Z$,k as ek,Y as tk,W as nk,a2 as rk,Z as ak,bw as sk,V as ok,a1 as ik,ah as lk}from"./C91EC830.js";import{d as zl,f as ck,e as dk}from"./BhcBqtJg.js";import{A as uk}from"./wl2qP2wF.js";import{D as gk}from"./DrWDRmYR.js";import"./Dhy-QJgd.js";import{a as pk,C as fk}from"./rpEVAvPW.js";import"./Bsh6nUhU.js";import{C as vk}from"./B9qXV8kb.js";import{h as Ed,r as hk,a as mk}from"./C3KL0Dob.js";import{s as _k}from"./ceYukiuF.js";import{I as wk,a as Qf}from"./B2w13ngc.js";import{L as bk}from"./CQwOMyxz.js";import{g as yk,f as Ik,b as Sk}from"./CTP1vzdq.js";import{s as Mi,g as Yn,i as $k,j as kk,e as Bp,r as Wp,f as xk,d as Ck,a as hd,h as Pk}from"./1VDAs3Ud.js";import{i as Up,a as Rk}from"./Bu13V5mO.js";import{seekConversationToMessage as zp}from"./C4ItHUxb.js";import{l as Jt,o as md,h as Jd,n as qd,q as Ak}from"./CE7dsja4.js";import{o as Tk}from"./DgiZ-0Sp.js";import{A as Jf}from"./DiNBgjb1.js";import{b as Yf}from"./CENp25rd.js";import{g as Mk,e as Xf,v as Ek,f as qk,N as Lk,M as Hk,K as Ok,k as Zf,l as Fk,H as ev,s as tv}from"./pQ6IdBCz.js";import{selectCurrentWorkspaceTabId as _d}from"./VxaCN40t.js";import{o as Dk}from"./BGm3f58g.js";import{d as Nk}from"./B0Z-1lwJ.js";import{P as Bk}from"./DJcj8WvN.js";import{g as Wk}from"./DOAyQZ8n.js";import{H as nv,M as Uk,y as zk,J as jk,g as Gk,i as Vk,u as Kk,e as rv,c as av,d as Qk}from"./DZ84MPQO.js";import{c as Jk,h as Yd,f as sv,Q as Yk}from"./DkME16PR.js";import{t as Xk}from"./DAsc1V4f.js";import{s as Zk}from"./BsieX9dN.js";import{i as ov}from"./FITmaVUJ.js";import{d as ex,i as tx,r as nx}from"./B9ZFoPLo.js";import{g as rx}from"./CRdOY_2z.js";var ax=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),sx=E("<div><!></div>");function iv(n,r){if(new.target)return un({component:iv,...n});fn(r,!0);let a=X(r,"ref",15,null),i=X(r,"class",7),c=X(r,"children",7),l=gf(r,ax);var h={get ref(){return a()},set ref(f=null){a(f),Z()},get class(){return i()},set class(f){i(f),Z()},get children(){return c()},set children(f){c(f),Z()},$set:gn,$on:(f,C)=>pn(r,f,C)},g=sx();pf(g,f=>({"data-slot":"card-header",class:f,...l}),[()=>Ud("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-x-4 gap-y-1.5 pt-4 pb-2 has-data-[slot=card-action]:grid-cols-[minmax(0,1fr)_auto]",vk,i())]);var w=I(g);return Ti(w,()=>c()??fs),y(g),wr(g,f=>a(f),()=>a()),p(n,g),vn(h)}var ox=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),ix=E("<div><!></div>");function lv(n,r){if(new.target)return un({component:lv,...n});fn(r,!0);let a=X(r,"ref",15,null),i=X(r,"class",7),c=X(r,"children",7),l=gf(r,ox);var h={get ref(){return a()},set ref(f=null){a(f),Z()},get class(){return i()},set class(f){i(f),Z()},get children(){return c()},set children(f){c(f),Z()},$set:gn,$on:(f,C)=>pn(r,f,C)},g=ix();pf(g,f=>({"data-slot":"card-title",class:f,...l}),[()=>Ud("type-title min-w-0 break-words font-semibold leading-tight text-foreground",i())]);var w=I(g);return Ti(w,()=>c()??fs),y(g),wr(g,f=>a(f),()=>a()),p(n,g),vn(h)}const xl=$S.CHAT_MEDIA,wd=RS().min(1).max(512);Zs({workspaceId:wd,agentId:wd,draftId:Nl(),principalId:wd,media:AS(wS).min(1).max(20)}).strict();const lx=Zs({sessionId:Nl()}).strict();lx.extend({control:TS("action",[Zs({action:bi("readiness")}).strict(),Zs({action:bi("export"),request:CS}).strict(),Zs({action:bi("transcribe"),request:PS}).strict(),Zs({action:bi("release"),jobId:Nl()}).strict(),Zs({action:bi("adopt"),jobId:Nl()}).strict()])}).strict();function Xd(n,r,a,i=async(c,l)=>typeof window>"u"||kS(window)!=="electron"?{ok:!1,error:"unavailable"}:xS().invoke(c,l)){let c=null,l=null,h=!1;async function g(){h=!0,a.removeEventListener("abort",w);const k=c;c=null,k&&await i(xl.CLOSE,{sessionId:k}).catch(()=>{})}const w=()=>{g()};a.addEventListener("abort",w,{once:!0});const f=()=>{if(h||a.aborted||!r())throw new Error("media-send-retired")};async function C(){if(f(),c)return c;if(l)return l;l=(async()=>{const k=await i(xl.BEGIN,n);if(!k.ok)throw new Error("media-export-unavailable");c=k.value.sessionId;try{return f(),c}catch(B){throw await g(),B}})();try{return await l}finally{l=null}}async function S(k){const B=await C();f();const O=await i(xl.CONTROL,{sessionId:B,control:k});return f(),O}return{service:{exportMedia:k=>S({action:"export",request:k}),adoptMediaJob:k=>S({action:"adopt",jobId:k}),transcribeMedia:k=>S({action:"transcribe",request:k}),releaseMediaJob:async k=>c?await i(xl.CONTROL,{sessionId:c,control:{action:"release",jobId:k}}):{ok:!0,value:void 0}},dispose:g,readiness:()=>S({action:"readiness"})}}const bd=new Set;async function cx(n){const{drafts:r,signal:a}=n,i=structuredClone(n.capture),c=structuredClone(n.items),l=structuredClone(n.payload),{workspaceId:h,agentId:g}=i,w=Pi(D.state),f=Dl.select(D.state,h),C=Sf.select(D.state),S=_f(),q=JSON.stringify([w,h,g]);if(!w||!f||!C||l.wsId!==h||bd.has(q))return!1;bd.add(q);const k=new AbortController,B=()=>k.abort();a.addEventListener("abort",B,{once:!0});const O=()=>!a.aborted&&!k.signal.aborted&&Pi(D.state)===w&&Dl.select(D.state,h)===f&&wf(S)&&r.isCurrentDraft(i),T=D.getReadableState().subscribe(()=>{O()||k.abort()});let F=null;try{if(!O()||cS(c))return!1;const K=Tf(i.attachments),se=qf(bS(h,g),K,c.map(fe=>({contextItemId:fe.id,attachmentId:fe.attachmentId,path:fe.path}))),P=new Set([...se.images,...se.clips].map(fe=>fe.contextItemId));if(K.some(([fe])=>!P.has(fe))||se.images.some(fe=>fe.mediaError)||se.clips.some(fe=>fe.mediaError)||!yS(l.text,se))throw new Error("invalid-evidence");if(F=n.warm?.take(i,k.signal)??null,!await r.flushDraft(i)||!O())return!1;const x=await Wy.agents.get(g,h);if(!O())return!1;if(!x||x.workspaceId!==h||x.retiredAt||x.pendingDeleteAt||x.status==="deleted")throw new Error("unavailable");const Q=se.clips.flatMap(fe=>fe.media?[fe.media]:[]);Q.length&&!F&&(F=Xd({workspaceId:h,agentId:g,draftId:crypto.randomUUID(),principalId:C.principal.id,media:Q},O,k.signal));const pe=ly(c,se),Ae=Pd(pe),he=await cy({workspaceId:h,agentId:g,evidence:se,clickedItems:c,sendItems:pe,clickedPayload:{...l,contextItems:pe,imageBlocks:Ae.imageBlocks,fileBlocks:Ae.fileBlocks},binding:S,service:F?.service??null,current:O,onRecord:()=>{}});return!he||!O()?!1:El(D,g,he)}catch{return O()&&D.dispatch(cw(g,u.dock_conversation_sendFailed_error())),!1}finally{T(),a.removeEventListener("abort",B),await F?.dispose(),bd.delete(q)}}const cv=1e4,jp={wasBusy:!1,busySince:null,preempted:!1,prediction:null};function Gp(n){return MS(n.messageMetadata)}function dx(n,r){if(n.some(Gp)){const a=n[0];return a&&!Gp(a)&&Vp(a,r)?[a.id]:[]}return n.filter(a=>Vp(a,r)).map(a=>a.id)}function ux(n){let r=null;for(const a of n)(a.status==="preparing"||a.status==="sending")&&a.createdAt>(r??-1/0)&&(r=a.createdAt);return r}function Vp(n,r){return!n.requeuedAfterFailure&&ES(n,r)}function gx(n,r){const{busy:a,queue:i,delivered:c,now:l}=r,h=r.blocked||r.interrupted,g=r.timeoutMs??cv;let w=n.prediction;if(w){const k=new Set(i.map(F=>F.id)),B=w.ids.filter(F=>k.has(F)&&!c.has(F)),O=l-w.startedAt>=g,T=n.wasBusy&&!a;!B.length||O||h&&!a||T?w=null:B.length!==w.ids.length&&(w={...w,ids:B})}const f=n.wasBusy&&!a,C=n.wasBusy?n.busySince:a?l:null,S=n.wasBusy&&n.preempted||C!==null&&r.directSendAt!==null&&r.directSendAt>C;if(!w&&f&&!h&&!S){const k=dx(i,l).filter(B=>!c.has(B));k.length&&(w={ids:k,startedAt:l})}const q={wasBusy:a,busySince:a?C:null,preempted:a&&S,prediction:w};return n.wasBusy===q.wasBusy&&n.busySince===q.busySince&&n.preempted===q.preempted&&n.prediction===q.prediction?n:q}class px{constructor(){Js(this,"previousWorkspaceId",null);Js(this,"_isRebinding",!1);Js(this,"_generation",0);Js(this,"_rebindPromise",null);Js(this,"_rebindResolve",null)}recordMount(r){return this.previousWorkspaceId=r,r}wasWorkspaceChangedDuringMount(r){return this.previousWorkspaceId!==r}shouldRebind(r){return!r||this.previousWorkspaceId===null?!1:r!==this.previousWorkspaceId}recordRebind(r){this.previousWorkspaceId=r}hasWorkspaceChanged(r){return r!==this.previousWorkspaceId}get trackedWorkspaceId(){return this.previousWorkspaceId}get isRebinding(){return this._isRebinding}startRebind(){return this._generation++,this._isRebinding=!0,this._rebindResolve?.(),this._rebindPromise=new Promise(r=>{this._rebindResolve=r}),this._generation}endRebind(r){r!==void 0&&r!==this._generation||(this._isRebinding=!1,this._rebindResolve?.(),this._rebindPromise=null,this._rebindResolve=null)}async waitForRebind(r=5e3){if(!this._isRebinding||!this._rebindPromise)return!1;const a=Date.now()+r;for(;this._isRebinding&&this._rebindPromise;){const i=a-Date.now();if(i<=0)return!1;let c;const l=await Promise.race([this._rebindPromise.then(()=>!1),new Promise(h=>{c=setTimeout(()=>h(!0),i)})]);if(clearTimeout(c),l)return!1}return!0}}function fx(n,r){return!(n?.tabType!=="agent"||n.agentId!==r.agentId||!r.isActive||n.workspaceId&&n.workspaceId!==r.workspaceId||r.panelId&&(n.source!=="dictation"&&!r.isPanelFocused||n.panelId&&n.panelId!==r.panelId))}function Kp(n){const r=typeof n=="string"?n:n&&typeof n=="object"&&typeof n.script=="string"?n.script:void 0;return r||void 0}var vx=E('<div role="status" aria-live="polite" data-presence-typing-indicator=""><span class="inline-flex min-w-[var(--operational-leading-slot-size)] shrink-0 items-center justify-center svelte-lm4khl"><!></span> <span class="min-w-0 truncate svelte-lm4khl"> </span> <span class="inline-flex shrink-0 items-center gap-0.5 svelte-lm4khl" aria-hidden="true"><span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.2s"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.4s"></span></span></div>');function dv(n,r){if(new.target)return un({component:dv,...n});fn(r,!0);const a=()=>ge(C,"$typing$",i),[i,c]=Ur();let l=X(r,"workspaceId",7),h=X(r,"agentId",7),g=X(r,"class",7,"");const w=Bn(""),f=Bn("");ae(()=>{w.set(l())}),ae(()=>{f.set(h())});const C=dS(w,f),S=o(()=>m$(a()));var q={get workspaceId(){return l()},set workspaceId(F){l(F),Z()},get agentId(){return h()},set agentId(F){h(F),Z()},get class(){return g()},set class(F=""){g(F),Z()},$set:gn,$on:(F,K)=>pn(r,F,K)},k=Wt(),B=ye(k);{var O=F=>{var K=vx(),se=I(K),P=I(se);h$(P,{get people(){return a()},size:12,decorative:!0}),y(se);var x=_(se,2),Q=de(x,!0);dn(2),y(K),L(()=>{xe(K,1,`${Bf} flex h-4 min-w-0 items-center gap-[var(--operational-leading-gap)] px-[var(--operational-row-inline-padding)] font-family-child font-normal text-muted-foreground text-[11px] leading-4 ${g()??""} /* a11y-ignore: user-requested compact typing status in the composer gap */`,"svelte-lm4khl"),j(Q,e(S))}),p(F,K)};N(B,F=>{e(S)&&F(O)})}p(n,k);var T=vn(q);return c(),T}const hx=50,mx=5e3,_x=500,wx=()=>({authority:()=>Pi(D.state),persistSnapshot:uy,dispatch:n=>D.dispatch(n),ownerView:n=>gy.withStore(D)(n)});function bx(n){const r=n.store??wx(),a=crypto.randomUUID();let i=me(!1),c=me(!1),l=me(!1),h=null,g=null,w=0,f=!1,C=null,S=null,q=null,k=0,B=null,O=null;const T={};let F,K=me([]),se=null,P=0,x="",Q=0,pe="";const Ae=()=>{const W=n.workspaceId(),R=n.agentId();if(!W||!R||!(n.active?.()??!0))return null;const re=r.authority?.();if(!re||f)return null;const Me=n.inputValue(),H=fe(),Y=F?.shared,J=Y?.workspaceId===W&&Y.agentId===R?Y.lifetime:null,$e=JSON.stringify([re,W,R,k,J,H.map(z=>[z.id,z.attachmentId,z.path])]);$e!==pe&&(pe=$e,Q+=1);const Oe=JSON.stringify([re,W,R,Me,H,k]);return Oe!==x&&(x=Oe,P+=1),{authority:re,ownerId:a,workspaceId:W,agentId:R,text:Me,attachments:JSON.parse(JSON.stringify(H)),generation:P,attachmentEpoch:Q}};let he=null;const fe=()=>XI(n.contextItems(),ZI(n.contextItems(),e(K))),He=W=>{if(F=W,!W||f)return;const R=W.restore;if(O&&R?.requestId===O.requestId&&R.status!=="pending"){const{apply:H}=O;O=null,b(c,!1),R.status==="restored"&&b(K,R.draft?.attachments??[]),H(R)}const re=W.shared;if(re&&!e(c)&&g===`${re.workspaceId}\0${re.agentId}`){const H=JSON.stringify([re.provenance,re.workspaceId,re.agentId,re.lifetime,re.revision]);if(se!==H){se=H;const Y=he??h,J=Y&&n.inputValue()===Y.text&&JSON.stringify(fe())===Y.attachmentsJson;re.origin===a?he={text:re.snapshot.text,attachmentsJson:JSON.stringify(re.snapshot.attachments)}:J&&(w+=1,q&&clearTimeout(q),b(K,re.snapshot.attachments),he=h={text:re.snapshot.text,attachmentsJson:JSON.stringify(e(K))},n.setInputValue(re.snapshot.text),n.setContextItems(Il(e(K))),n.applyEditorContent(re.snapshot.text))}}it(Ae);const Me=[];for(const H of W.saves){if(H.status==="pending")continue;Me.push(H.id);const Y=T[H.id];delete T[H.id],Y?.(H)}Me.length>0&&queueMicrotask(()=>r.dispatch(pw(a,Me)))},ue=(W,R,re)=>{const Me=crypto.randomUUID();O={requestId:Me,apply:re},b(c,!0),r.dispatch(vw(a,Me,W,R))},oe=()=>{O&&(O=null,b(c,!1),r.dispatch(mw(a)))},Te=()=>{const W=B;W&&(B=null,r.dispatch(hw(a)),F?.saves.some(R=>R.id===W)||delete T[W])};r.dispatch(dw(a));const le=r.ownerView(a).subscribe(W=>it(()=>He(W))),ee=()=>{S&&(clearTimeout(S),S=null),b(l,!1)},Se=()=>{B&&(B=null,r.dispatch(fw(a)))};ae(()=>{const W=n.active?.()??!0,R=n.workspaceId(),re=n.agentId();if(!W){it(()=>{w+=1,g=null,oe(),C&&clearTimeout(C),C=null,ee(),q&&clearTimeout(q),q=null,b(i,!1),Se()});return}if(!R||!re)return;const Me=`${R}\0${re}`;if(g===Me)return;const H=g!==null;g=Me;const Y=++w;it(()=>{h=null,he=null,se=null,b(K,[]),C&&clearTimeout(C),ee(),q&&(clearTimeout(q),q=null),H&&(Se(),n.setInputValue(""),n.contextItemsAreScoped||n.setContextItems([]),n.applyEditorContent(""));const J=dy(R,re);if(J){b(K,J.attachments),b(i,!1);const Oe=n.contextItems().length>0,z=J.text,Ie=JSON.stringify(J.attachments);n.setInputValue(J.text),Oe||n.setContextItems(Il(J.attachments)),n.applyEditorContent(J.text),h={text:J.text,attachmentsJson:Ie},ue(R,re,Ce=>{if(Ce.status!=="restored")return;const Ne=Ce.draft;if(f||!(n.active?.()??!0)||g!==Me||w!==Y)return;const at=Ne?.text??"",Xe=Ne?.attachments??[],De=JSON.stringify(Xe);ld(R,re,{text:at,attachments:Xe});const Re=n.inputValue()===z&&JSON.stringify(fe())===Ie;Oe||!Re||(at!==z&&(n.setInputValue(at),n.applyEditorContent(at)),De!==Ie&&n.setContextItems(Il(Xe)),h={text:at,attachmentsJson:De})});return}b(i,!0),S=setTimeout(()=>{S=null,(n.active?.()??!0)&&b(l,!0)},_x),C=setTimeout(()=>{(n.active?.()??!0)&&(b(i,!1),ee())},mx);const $e=()=>{!(n.active?.()??!0)||g!==Me||w!==Y||(C&&clearTimeout(C),b(i,!1),ee())};ue(R,re,Oe=>{if(Oe.status!=="restored"){$e();return}const z=Oe.draft;if(f||!(n.active?.()??!0)||g!==Me||w!==Y)return;const Ie=!!n.inputValue();if(!Ie&&z?.attachments?.length&&n.contextItems().length===0&&n.setContextItems(Il(z.attachments)),!Ie&&z?.text&&(n.setInputValue(z.text),q=setTimeout(()=>{(n.active?.()??!0)&&n.inputValue()===z.text&&n.applyEditorContent(z.text)},hx)),h===null){const Ce=z?.text??"",Ne=z?.attachments??[];h={text:Ce,attachmentsJson:JSON.stringify(Ne)},ld(R,re,{text:Ce,attachments:Ne})}$e()})})}),ae(()=>{const W=n.active?.()??!0,R=n.workspaceId(),re=n.agentId(),Me=e(i);if(!W){it(Te);return}if(!R||!re)return;const H=n.inputValue(),Y=fe();if(it(Ae),it(Te),Me||h===null&&!H&&Y.length===0)return;const J=JSON.stringify(Y);if(h!==null&&h.text===H&&h.attachmentsJson===J)return;JSON.stringify(e(K))!==J&&b(K,Y);const $e=`${R}\0${re}`,Oe=k,z=crypto.randomUUID();T[z]=Ie=>{if(n.active?.()??!0){if(Ie.status==="saved"){g===$e&&k===Oe&&(h={text:H,attachmentsJson:J});return}n.onSaveError?.(new Error(Ie.error))}},it(()=>{B=z,r.dispatch(uw(a,z,{authority:r.authority?.()??void 0,workspaceId:R,agentId:re,text:H,attachments:Y,rollback:h?{text:h.text,attachments:JSON.parse(h.attachmentsJson)}:null}))})}),ae(()=>()=>{f=!0,C&&clearTimeout(C),S&&clearTimeout(S),q&&clearTimeout(q),Se(),le(),r.dispatch(gw(a))});const Ee=W=>{const R=Ae();return R!==null&&R.authority===W.authority&&R.ownerId===W.ownerId&&R.workspaceId===W.workspaceId&&R.agentId===W.agentId&&R.generation===W.generation&&R.text===W.text&&JSON.stringify(R.attachments)===JSON.stringify(W.attachments)};return{captureDraft:Ae,isCurrentDraft:Ee,updateAttachmentScreen(W,R,re){return!Ee(W)||!W.attachments.some(Me=>Me.id===R)?null:(b(K,W.attachments.map(Me=>Me.id===R?{...Me,screen:structuredClone(re)}:Me)),Ae())},async flushDraft(W){if(!Ee(W))return!1;if(!r.persistSnapshot)throw new Error("draft-shared-transport-unavailable");return await r.persistSnapshot(a,W.workspaceId,W.agentId,W,W.authority),Ee(W)},get restorePending(){return e(c)},get gateActive(){return e(i)},get gateVisible(){return e(l)},invalidatePendingRestore(){if(w+=1,k+=1,oe(),C&&(clearTimeout(C),C=null),q&&(clearTimeout(q),q=null),b(i,!1),ee(),Te(),g!==null){const[W,R]=g.split("\0");ld(W,R,{text:"",attachments:[]}),he=null,b(K,[]),h={text:"",attachmentsJson:"[]"}}}}}function Ei(n){if(!n)return null;const r=qf(JSON.stringify([n.workspaceId,n.agentId]),Tf(n.attachments),n.attachments.map(a=>({contextItemId:a.id,attachmentId:a.attachmentId,path:a.path})));return{...r,clips:r.clips.filter(a=>{const i=n.attachments.find(c=>c.id===a.contextItemId);return!!a.media&&!a.mediaError&&!!i&&a.path===i.path})}}async function yx(n,r,a){const i=D.state.principal.snapshot,c=()=>Pi(D.state)===n.authority&&a.isCurrentDraft(n);if(!i||!c()||!await a.flushDraft(n)||!c())return{ready:!1};const l=new AbortController,h=Xd({workspaceId:n.workspaceId,agentId:n.agentId,principalId:i.principal.id,draftId:crypto.randomUUID(),media:[r]},c,l.signal);try{const g=await h.readiness();return!c()||!g.ok?{ready:!1}:g.value.find(w=>w.sourceId===r.source.id)??{ready:!1}}finally{await h.dispose()}}function Qp(n){let r=me(null),a=me(!1),i=me(!1),c=null,l=!0,h=0,g=null;Es(()=>{l=!1,h++}),ae(()=>{const S=n.capture();e(r)&&(!S||S.authority!==e(r).capture.authority||S.ownerId!==e(r).capture.ownerId||S.workspaceId!==e(r).capture.workspaceId||S.agentId!==e(r).capture.agentId||S.attachmentEpoch!==e(r).capture.attachmentEpoch)&&b(r,null)});async function w(S){if(n.disabled()||e(a))return;const q=n.drafts.captureDraft(),k=Ei(q),B=k?.clips.find(K=>K.contextItemId===S);if(!q||!B?.media||!k)return;const O=py({workspaceId:q.workspaceId,agentId:q.agentId,clip:B,evidence:k,marks:k.marks}),T=bf(q.workspaceId,B.path);if(!O||!T)return;const F=++h;c=document.activeElement instanceof HTMLElement?document.activeElement:null,b(a,!0),b(i,!1);try{if(await n.beforeOpen?.(),!l||h!==F||!n.drafts.isCurrentDraft(q))return;const K=await(n.prepareOutput??yx)(q,B.media,n.drafts);if(!l||h!==F||!n.drafts.isCurrentDraft(q))return;const{attachmentPath:se,...P}=O;b(r,{capture:q,contextItemId:S,snapshot:{...P,openId:crypto.randomUUID(),mediaUrl:T,output:K,deleteReady:!0}})}catch{l&&h===F&&b(i,!0)}finally{l&&h===F&&b(a,!1)}}async function f(S){const q=crypto.randomUUID(),k=e(r),B=n.drafts.captureDraft();if(!k||!B||B.authority!==k.capture.authority||B.ownerId!==k.capture.ownerId||B.workspaceId!==k.capture.workspaceId||B.agentId!==k.capture.agentId||B.attachmentEpoch!==k.capture.attachmentEpoch)return{requestId:q,result:"stale-source"};const O=Ei(B),T=O?.clips.find(Q=>Q.contextItemId===k.contextItemId);if(!O||!T?.media)return{requestId:q,result:"stale-source"};const K=g?.openId===k.snapshot.openId&&g.inputRevision===S.revision&&JSON.stringify(g.media)===JSON.stringify(T.media)?{...S,revision:T.media.saved?.revision??0}:S,se=IS(T.media,{openId:k.snapshot.openId,...k.snapshot.output?.version===2?{outputVersion:2}:{},pair:{workspaceId:B.workspaceId,agentId:B.agentId},sourceId:S.sourceId,sourceRevision:S.sourceRevision,expectedEditRevision:K.revision,edit:K});if(se.status!=="saved")return{requestId:q,result:se.status==="invalid-edit"?"failed":se.status};const P=SS({...O,clips:O.clips.map(Q=>Q.id===T.id?{...Q,media:se.media}:Q)})[k.contextItemId],x=n.drafts.updateAttachmentScreen(B,k.contextItemId,P);if(!x)return{requestId:q,result:"stale-source"};g={openId:k.snapshot.openId,media:se.media,inputRevision:S.revision};try{if(!n.drafts.isCurrentDraft(x))return{requestId:q,result:"stale-source"};await n.drafts.flushDraft(x);const Q=n.drafts.captureDraft();return!l||e(r)?.snapshot.openId!==k.snapshot.openId||!Q||Q.attachmentEpoch!==k.capture.attachmentEpoch||Q.authority!==x.authority||Q.ownerId!==x.ownerId||Q.workspaceId!==x.workspaceId||Q.agentId!==x.agentId||JSON.stringify(Q.attachments.find(pe=>pe.id===k.contextItemId)?.screen)!==JSON.stringify(P)?{requestId:q,result:"stale-source"}:(g=null,{requestId:q,result:"saved",saved:se.media.saved??void 0})}catch{return{requestId:q,result:"failed"}}}function C(S){return n.disabled()||!n.onRemove(S)?!1:(e(r)?.contextItemId===S&&b(r,null),!0)}return{get session(){return e(r)},get opening(){return e(a)},get problem(){return e(i)},open:w,save:f,remove:C,close(){b(r,null)},restoreFocus(){c?.isConnected&&c.focus()}}}var Ix=E('<p role="alert"> </p>'),Sx=E('<div class="recording-editor-surface svelte-cdb16"><!></div>'),$x=E("<!> <!> <!>",1);function uv(n,r){if(new.target)return un({component:uv,...n});fn(r,!0);let a=X(r,"capture",7),i=X(r,"drafts",7),c=X(r,"disabled",7,!1),l=X(r,"onRemove",7),h=X(r,"controllerFactory",7,Qp),g=X(r,"beforeOpen",7),w=X(r,"onReviewChange",7);const f=it(()=>h()({drafts:i(),capture:()=>a(),disabled:()=>c(),onRemove:P=>l()(P),beforeOpen:()=>g()?.()??Promise.resolve()}));ae(()=>{const P=f.opening,x=f.session;it(()=>w()?.(P,x?.snapshot.output?.ready?{openId:x.snapshot.openId,capture:x.capture}:null))});const C=o(fy),S=o(()=>Ei(a())),q=o(()=>e(S)?.clips.map(P=>({id:P.contextItemId,kind:"clip",owner:"evidence",duration:Mp(P.durationMs),recording:!1,url:a()?bf(a().workspaceId,P.path):void 0,...P.media?.saved?{summary:vy(P.media.saved)}:{}}))??[]);let k=me(null);var B={get capture(){return a()},set capture(P){a(P),Z()},get drafts(){return i()},set drafts(P){i(P),Z()},get disabled(){return c()},set disabled(P=!1){c(P),Z()},get onRemove(){return l()},set onRemove(P){l(P),Z()},get controllerFactory(){return h()},set controllerFactory(P=Qp){h(P),Z()},get beforeOpen(){return g()},set beforeOpen(P){g(P),Z()},get onReviewChange(){return w()},set onReviewChange(P){w(P),Z()},$set:gn,$on:(P,x)=>pn(r,P,x)},O=$x(),T=ye(O);{let P=o(()=>c()||f.opening);qS(T,{get items(){return e(q)},get labels(){return e(C)},get disabled(){return e(P)},onEdit:x=>void f.open(x),onMarkUp:x=>void f.open(x),get onRemove(){return f.remove}})}var F=_(T,2);{var K=P=>{var x=Ix(),Q=de(x,!0);L(pe=>j(Q,pe),[()=>u.dock_captureEditor_saveFailed_label()]),p(P,x)};N(F,P=>{f.problem&&P(K)})}var se=_(F,2);{let P=o(()=>!!f.session),x=o(()=>u.dock_captureEditor_recording_title({duration:f.session?Mp(f.session.snapshot.durationMs??0):""}));P$(se,{get open(){return e(P)},size:"editor",showCloseButton:!1,get title(){return e(x)},escapeKeydownBehavior:"ignore",dismissOnInteractOutside:!1,onClose:()=>f.close(),onCloseAutoFocus:Q=>{Q.preventDefault(),f.restoreFocus()},get contentRef(){return e(k)},set contentRef(Q){b(k,Q,!0)},children:(Q,pe)=>{var Ae=Wt(),he=ye(Ae);{var fe=He=>{var ue=Wt(),oe=ye(ue);xi(oe,()=>f.session.snapshot.openId,Te=>{var le=Sx(),ee=I(le);A$(ee,{get snapshot(){return f.session.snapshot},get shortcutDialog(){return e(k)},onClose:()=>f.close(),get onSave(){return f.save},onDelete:async()=>!!f.session&&f.remove(f.session.contextItemId)}),y(le),p(Te,le)}),p(He,ue)};N(he,He=>{f.session&&He(fe)})}p(Q,Ae)},$$slots:{default:!0}})}return p(n,O),vn(B)}const Cl=n=>JSON.stringify([n.authority,n.ownerId,n.workspaceId,n.agentId,n.attachmentEpoch,n.attachments]);function kx(n){let r=me(!1),a=me(!1),i=me(null),c=!1,l=0,h=null,g=null;async function w(S){S.abort.abort(),S.slot?.cancel(),await S.native?.dispose()}async function f(){l++;const S=g;g=null,S&&await w(S)}ro(()=>{const S=()=>{b(r,document.hasFocus(),!0)};return S(),window.addEventListener("focus",S),window.addEventListener("blur",S),()=>{window.removeEventListener("focus",S),window.removeEventListener("blur",S)}});const C=D.getReadableState().subscribe(()=>{g&&!g.current()&&f()});return Es(()=>{c=!0,C(),f()}),ae(()=>{const S=n.capture(),q=S?Cl(S):"",k=e(r)&&!e(a)&&(n.active()||e(i)?.key===q);it(()=>{if(!k||!S){f();return}if(g?.key===q)return;if(h===q){f();return}f();const O=Ei(S)?.clips.flatMap(Ae=>!Ae.mediaError&&Ae.media?[Ae.media]:[])??[],T=O[0],F=D.state.principal.snapshot,K=Dl.select(D.state,S.workspaceId);if(!T||!F||!K||n.drafts.gateActive)return;const se=_f(),P=new AbortController,x=()=>!c&&!P.signal.aborted&&Pi(D.state)===S.authority&&Dl.select(D.state,S.workspaceId)===K&&wf(se)&&!!n.capture()&&Cl(n.capture())===q,Q={key:q,capture:S,abort:P,native:null,slot:null,current:x};g=Q;const pe=l;n.drafts.flushDraft(S).then(async Ae=>{if(!(g!==Q||pe!==l||!x())){if(!Ae){h=q,await f();return}Q.native=Xd({workspaceId:S.workspaceId,agentId:S.agentId,draftId:crypto.randomUUID(),principalId:F.principal.id,media:structuredClone(O)},x,P.signal),Q.slot=hy(Q.native.service),h=q,Q.slot.warm(q,T,x)}}).catch(()=>{g===Q&&f()})})}),{cancel:f,async beforeEditorOpen(){b(a,!0),h=null,await f()},editorState(S,q){b(a,S,!0);const k=q?Cl(q.capture):null;q&&e(i)?.openId!==q.openId&&(h=null),b(i,q&&k?{openId:q.openId,key:k}:null)},take(S,q){const k=g;if(!k?.native||!k.slot||k.key!==Cl(S)||!k.current())return f(),null;g=null,l++;const B=k.native,O=k.slot,T=()=>k.abort.abort();return q.addEventListener("abort",T,{once:!0}),q.aborted&&T(),{service:{...B.service,takePreparedRecording:F=>O.take(k.key,F,()=>!q.aborted&&k.current())},async dispose(){q.removeEventListener("abort",T),await w(k)}}}}}var xx=E('<div role="status" class="px-3 py-1.5 text-xs text-muted-foreground" data-testid="chat-draft-loading-gate"><span> </span></div>');function gv(n,r){if(new.target)return un({component:gv,...n});fn(r,!1);var a={$set:gn,$on:(h,g)=>pn(r,h,g)};Wf();var i=xx(),c=I(i),l=de(c,!0);return y(i),L(h=>j(l,h),[()=>u.chat_draftGate_loading_label()]),p(n,i),vn(a)}var Cx=E('<div data-new-messages-divider="" class="type-caption font-family-child my-6 flex items-center gap-2 px-2" role="separator"><div class="h-px flex-1 bg-border"></div> <span class="whitespace-nowrap px-1 font-medium text-foreground"> </span> <div class="h-px flex-1 bg-border"></div></div>');function Ld(n,r){if(new.target)return un({component:Ld,...n});fn(r,!1);var a={$set:gn,$on:(h,g)=>pn(r,h,g)};Wf();var i=Cx(),c=_(I(i),2),l=de(c,!0);return dn(2),y(i),L((h,g)=>{ze(i,"aria-label",h),j(l,g)},[()=>u.chat_newMessagesDivider_label(),()=>u.chat_newMessagesDivider_label()]),p(n,i),vn(a)}function Px(n,r){if(!r||n.length===0)return null;const a=n.indexOf(r);return a===-1||a===n.length-1?null:r}function Rx(n,r,a){if(!r||n.length===0)return"none";const i=n.indexOf(r);return i===n.length-1?"none":i!==-1?"marker-loaded":a.complete?a.truncated?"marker-beyond-window":"none":"marker-pending"}function Ax(n,r){return r&&n.includes(r)?r:null}function Jp(n,r,a){return r-n<=a}const Tx=.2;function Yp(n,r,a){const i=Math.max(0,a-r),c=n-Tx*r;return Math.min(Math.max(0,c),i)}function Mx(n,r,a){return n!==null&&a&&n===r}function Ex(n){return n?_w(n)&&ww(n)!==null&&typeof n.metadata?.taskNoteId=="string":!1}function qx(n){const r=[],a=new Set;let i,c;for(const F of n.messages){if(F.agentId&&F.agentId!==n.agentId){i=void 0,c=void 0;continue}if(a.has(F.id))continue;a.add(F.id),n.breakBeforeMessageIds?.has(F.id)&&(i=void 0,c=void 0);const K=LS(F);if(K?.kind!=="turn-failure")c=void 0;else{const se=i?.seq!==void 0&&F.seq!==void 0&&Number.isSafeInteger(i.seq)&&Number.isSafeInteger(F.seq)&&F.seq===i.seq+1;(!c||!se)&&(c={key:JSON.stringify([n.agentId,"notice",F.id]),anchorMessageId:F.id,correlation:"unavailable",records:[],recordedFailureCount:0},r.push(c)),c.records.push({messageId:F.id,reason:K.reason,timestamp:F.timestamp}),c.recordedFailureCount+=1}i=F}const l=new Map;for(const F of n.queue){if(!F.requeuedAfterFailure)continue;const K=F.turnId||void 0,se=JSON.stringify([n.agentId,K?"turn":"queue",K??F.id]);let P=l.get(se);P||(P={key:se,correlation:K?"turn":"queue-entry",turnId:K,queueIds:[],state:"queued"},l.set(se,P)),P.queueIds.includes(F.id)||P.queueIds.push(F.id)}const h=[...l.values()],g=n.session?.id===n.agentId?n.session:void 0,w=g?.status===$i.Error,f=n.transientError||w&&g.stopReason||null,C=w&&!f,S=w&&(!n.transientError||n.transientError===g.stopReason)?g.stopReasonTimestamp:void 0,q=S?Ip(S):null,k=q&&f&&f===g?.stopReason?r.flatMap(F=>F.records).filter(F=>F.reason===f&&Ip(F.timestamp)===q):[],B=k.length===1?k[0].messageId:void 0,T=(g?$f(g):!1)?"attempting":h.length?"queued":f||C?"action-needed":"inactive";return{history:r,queueRecovery:h,current:{state:T,error:f,needsFallbackReason:C,timestamp:S,noticeId:B}}}function Lx(n,r){const a=n.hiddenTail[0]?.id,i=qx({...r,messages:[...n.groups.flatMap(g=>g.messages),...n.hiddenTail],breakBeforeMessageIds:new Set(a?[a]:[])}),c=i.current.noticeId,l=i.history.map(g=>({...g,records:g.records.filter(w=>w.messageId!==c)})).filter(g=>g.records.length>0),h=new Set(l.map(g=>g.records[0].messageId));return{...i,runsByAnchor:new Map(l.map(g=>[g.records[0].messageId,g])),collapsedMessageIds:new Set(i.history.flatMap(g=>g.records.map(w=>w.messageId).filter(w=>!h.has(w))))}}var Hx=E('<div class="flex size-10 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <div class="min-w-0 flex-1"><div class="type-body truncate font-medium text-foreground"> </div> <div class="type-caption mt-0.5 line-clamp-2 text-muted-foreground"> </div></div> <div class="flex size-7 shrink-0 items-center justify-center rounded-md bg-muted/50 text-muted-foreground transition-colors group-hover:bg-muted"><!></div>',1),Ox=E('<div class="flex size-9 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <span class="type-body font-medium"> </span>',1),Fx=E('<div><div class="border-b border-border bg-muted/20 px-4 py-3"><p class="type-body font-medium text-foreground"> </p> <p class="type-caption mt-0.5 text-muted-foreground"> </p></div> <div class="max-h-[21rem] overflow-y-auto p-2"><!></div> <div class="border-t border-border bg-popover p-2"><!></div></div>'),Dx=E('<div class="mb-5"><!></div>'),Nx=E('<p data-testid="agent-welcome-description"> </p> <!>',1),Bx=E("<!> <!>",1),Wx=E('<p class="mb-3 px-4 text-sm text-subtle leading-relaxed whitespace-pre-wrap" data-testid="agent-welcome-description"> </p>'),Ux=E("<!> <span> </span>",1),zx=E('<div class="mx-auto flex w-full max-w-[40rem] flex-1 flex-col px-4 pb-6 pt-4 text-subtle"><!> <!> <!></div>');function pv(n,r){if(new.target)return un({component:pv,...n});fn(r,!0);const a=()=>ge(k,"$userOverrides$",h),i=()=>ge(q,"$specialists$",h),c=()=>ge(F,"$isGitHubAuth$",h),l=()=>ge(K,"$recentSpecialistIds$",h),[h,g]=Ur();let w=X(r,"onSpecialistChange",7),f=X(r,"session",7),C=X(r,"workspaceId",7);const S=Bn(C()??"");ae(()=>S.set(C()??""));const q=Kf(S),k=X$();ae(()=>{a()});const B=o(()=>{if(!f()||Yy(f()))return null;const W=f().metadata?.specialist||f().agentMetadata?.specialist;return W&&i().find(R=>R.id===W)||null});async function O(W){W?await zl({specialist:W,hash:"specialists"}):await zl({view:"create-specialist"})}let T=me(!1);const F=Z$(),K=uS(),se=o(()=>bw(ek(i(),c()),l()));let P=me(!1);const x=o(()=>u.chat_regularAgentWelcome_generalDescription_label()),Q=o(()=>e(B)?.name??u.chat_shared_general_fallback()),pe=o(()=>e(B)?.description??u.chat_shared_noSpecializedBehavior_label()),Ae=o(()=>e(B)?e(B).defaultBehaviorPrompt||"":e(x));var he={get onSpecialistChange(){return w()},set onSpecialistChange(W){w(W),Z()},get session(){return f()},set session(W){f(W),Z()},get workspaceId(){return C()},set workspaceId(W){C(W),Z()},$set:gn,$on:(W,R)=>pn(r,W,R)},fe=zx(),He=I(fe);{var ue=W=>{var R=Dx(),re=I(R);gk(re,{class:"block w-full",align:"start",side:"bottom",contentClass:"w-[min(28rem,calc(100vw-2rem))]",get open(){return e(P)},set open(Y){b(P,Y,!0)},trigger:(Y,J)=>{let $e=()=>(J?.()).props;{let Oe=o(()=>Ud("group flex h-auto min-h-(--control-height-medium) w-full cursor-pointer items-center gap-3 whitespace-normal rounded-lg border border-border bg-card px-4 py-3 text-left shadow-xs transition-colors","hover:border-input hover:bg-accent/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"));bt(Y,qi($e,{type:"button",variant:"plain",wrapContent:!1,get class(){return e(Oe)},"data-testid":"specialist-picker-trigger",children:(z,Ie)=>{var Ce=Hx(),Ne=ye(Ce),at=I(Ne);{let Ge=o(()=>e(B)?.id??null),Qe=o(()=>e(B)?.icon??null);uk(at,{agentId:"blank",variant:"emphasized",get specialist(){return e(Ge)},get icon(){return e(Qe)}})}y(Ne);var Xe=_(Ne,2),De=I(Xe),Re=de(De,!0),G=_(De,2),te=de(G,!0);y(Xe);var Fe=_(Xe,2),we=I(Fe);ct(we,{get icon(){return Na},size:10}),y(Fe),L(()=>{j(Re,e(Q)),j(te,e(pe))}),p(z,Ce)},$$slots:{default:!0}}))}},content:Y=>{var J=Fx(),$e=I(J),Oe=I($e),z=de(Oe,!0),Ie=_(Oe,2),Ce=de(Ie,!0);y($e);var Ne=_($e,2),at=I(Ne);{let Re=o(()=>e(B)?.id??null);X_(at,{get specialists(){return e(se)},get value(){return e(Re)},onchange:G=>{b(P,!1),w()?.(G)}})}y(Ne);var Xe=_(Ne,2),De=I(Xe);Et(De,()=>Br,(Re,G)=>{G(Re,{class:"flex h-auto w-full cursor-pointer items-center gap-3 whitespace-normal rounded-md px-3 py-2 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onSelect:()=>{b(P,!1),O()},children:(te,Fe)=>{var we=Ox(),Ge=ye(we),Qe=I(Ge);ct(Qe,{get icon(){return L$},size:12}),y(Ge);var dt=_(Ge,2),ft=de(dt,!0);L(lt=>j(ft,lt),[()=>u.chat_regularAgentWelcome_createSpecialist_label()]),p(te,we)},$$slots:{default:!0}})}),y(Xe),y(J),L((Re,G)=>{j(z,Re),j(Ce,G)},[()=>u.workspace_createAgentSection_specialists_label(),()=>u.workspace_createAgentSection_specialists_description()]),p(Y,J)},$$slots:{trigger:!0,content:!0}}),y(R),p(W,R)};N(He,W=>{w()&&W(ue)})}var oe=_(He,2);{var Te=W=>{var R=Wt(),re=ye(R);{let Me=o(()=>u.chat_specialistSelector_prompt_label());Et(re,()=>fk,(H,Y)=>{Y(H,{class:"mb-3",role:"region",get"aria-label"(){return e(Me)},children:(J,$e)=>{var Oe=Bx(),z=ye(Oe);Et(z,()=>iv,(Ce,Ne)=>{Ne(Ce,{children:(at,Xe)=>{var De=Wt(),Re=ye(De);Et(Re,()=>lv,(G,te)=>{te(G,{class:"type-caption font-medium",children:(Fe,we)=>{dn();var Ge=ln();L(Qe=>j(Ge,Qe),[()=>u.chat_specialistSelector_prompt_label()]),p(Fe,Ge)},$$slots:{default:!0}})}),p(at,De)},$$slots:{default:!0}})});var Ie=_(z,2);Et(Ie,()=>pk,(Ce,Ne)=>{Ne(Ce,{children:(at,Xe)=>{var De=Nx(),Re=ye(De),G=de(Re,!0),te=_(Re,2);bt(te,{type:"button",variant:"link",get"aria-expanded"(){return e(T)},onclick:()=>b(T,!e(T)),class:"text-xs text-muted-foreground hover:text-foreground transition-colors mt-2 cursor-pointer",children:(Fe,we)=>{dn();var Ge=ln();L(Qe=>j(Ge,Qe),[()=>e(T)?u.chat_regularAgentWelcome_showLess_label():u.chat_regularAgentWelcome_showMore_label()]),p(Fe,Ge)},$$slots:{default:!0}}),L(()=>{xe(Re,1,`text-sm text-subtle leading-relaxed whitespace-pre-wrap break-words ${e(T)?"":"line-clamp-6"}`),j(G,e(Ae))}),p(at,De)},$$slots:{default:!0}})}),p(J,Oe)},$$slots:{default:!0}})})}p(W,R)},le=W=>{var R=Wx(),re=de(R,!0);L(()=>j(re,e(Ae))),p(W,R)};N(oe,W=>{e(B)?W(Te):W(le,-1)})}var ee=_(oe,2);{var Se=W=>{bt(W,{variant:"ghost-light",size:"sm",onclick:()=>O(e(B).id),class:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors cursor-pointer pl-1.5 mr-auto",children:(R,re)=>{var Me=Ux(),H=ye(Me);ct(H,{get icon(){return q$},size:12,class:"opacity-60"});var Y=_(H,2),J=de(Y,!0);L($e=>j(J,$e),[()=>u.chat_regularAgentWelcome_customize_label()]),p(R,Me)},$$slots:{default:!0}})};N(ee,W=>{e(B)&&W(Se)})}y(fe),p(n,fe);var Ee=vn(he);return g(),Ee}var jx=E('<a class="cursor-pointer underline underline-offset-2 hover:opacity-80" data-suggested-prompt-link=""> </a>'),Gx=E('<kbd data-suggested-prompt-hint=""> </kbd>'),Vx=E('<span class="type-caption"> </span>'),Kx=E('<div role="presentation" data-typography-role="body" data-suggested-prompt-row=""><span data-suggested-prompt-icon=""><!></span> <span class="min-w-0 flex-1 text-pretty" data-suggested-prompt-label=""><span role="button" tabindex="0" class="focus-visible:outline-none" data-suggested-prompt-text=""> </span><!></span> <!> <!></div>'),Qx=E('<div class="flex flex-col" data-testid="suggested-prompts-surface"><!></div>');function Zd(n,r){if(new.target)return un({component:Zd,...n});fn(r,!0);let a=X(r,"prompts",7),i=X(r,"onSelect",7),c=X(r,"onEdit",7),l=X(r,"compact",7,!1),h=X(r,"showShortcutHints",7,!1),g=X(r,"reserveShortcutHintSpace",7,!1),w=X(r,"workspaceId",7);const C=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC")?"⌃":"Alt+",S=u$.replace("text-ui","type-caption");function q(x){i()(x)}function k(x,Q){x.key!=="Enter"&&x.key!==" "||(x.preventDefault(),q(Q))}function B(x,Q){x.preventDefault(),x.stopPropagation(),Ed(Q,{workspaceId:w(),event:x})}function O(x,Q){(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),x.stopPropagation(),Ed(Q,{workspaceId:w(),event:x}))}function T(x){return x<3}var F={get prompts(){return a()},set prompts(x){a(x),Z()},get onSelect(){return i()},set onSelect(x){i(x),Z()},get onEdit(){return c()},set onEdit(x){c(x),Z()},get compact(){return l()},set compact(x=!1){l(x),Z()},get showShortcutHints(){return h()},set showShortcutHints(x=!1){h(x),Z()},get reserveShortcutHintSpace(){return g()},set reserveShortcutHintSpace(x=!1){g(x),Z()},get workspaceId(){return w()},set workspaceId(x){w(x),Z()},$set:gn,$on:(x,Q)=>pn(r,x,Q)},K=Wt(),se=ye(K);{var P=x=>{var Q=Qx(),pe=I(Q);{const Ae=(fe,He)=>{let ue=()=>(He?.()).item,oe=()=>(He?.()).index;const Te=o(()=>ny(ue())),le=o(()=>e(Te)[0]?.type==="text"?e(Te)[0].content:"");var ee=Kx(),Se=I(ee),Ee=I(Se);ct(Ee,{get icon(){return Uf},size:16,get class(){return ur}}),y(Se);var W=_(Se,2),R=I(W),re=de(R,!0),Me=_(R);Dn(Me,17,()=>e(Te).slice(e(le)?1:0),Q_,(z,Ie)=>{var Ce=Wt(),Ne=ye(Ce);{var at=De=>{const Re=o(()=>ty(e(Ie).url));var G=jx(),te=de(G,!0);L(()=>{ze(G,"href",e(Re)),ze(G,"title",e(Re)),j(te,e(Ie).label)}),ps("click",G,Fe=>B(Fe,e(Re))),ps("keydown",G,Fe=>O(Fe,e(Re))),p(De,G)},Xe=De=>{var Re=ln();L(()=>j(Re,e(Ie).content)),p(De,Re)};N(Ne,De=>{e(Ie).type==="link"?De(at):De(Xe,-1)})}p(z,Ce)}),y(W);var H=_(W,2);{var Y=z=>{var Ie=Gx();let Ce;var Ne=de(Ie);L(()=>{Ce=xe(Ie,1,`${S??""} mt-px inline-flex h-5 items-center self-start border-0 bg-transparent p-0 font-sans font-normal text-muted-foreground! opacity-100`,null,Ce,{invisible:!h()}),ze(Ie,"aria-hidden",h()?void 0:"true"),ze(Ie,"data-hint-visible",h()),j(Ne,`${C}${oe()+1}`)}),p(z,Ie)},J=o(()=>T(oe())&&(h()||g()));N(H,z=>{e(J)&&z(Y)})}var $e=_(H,2);{var Oe=z=>{E$(z,{side:"top",delayDuration:300,trigger:Ne=>{{let at=o(()=>u.chat_suggestedPrompts_editInInput_ariaLabel());bt(Ne,{type:"button",variant:"ghost-light",size:"icon-xs",iconOnly:!0,class:"absolute right-0.5 top-[calc(var(--operational-leading-half-slot-size)+var(--space-1)*0.5+1px)] shrink-0 -translate-y-1/2 rounded opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100",onclick:Xe=>{Xe.stopPropagation(),c()(ue())},get"aria-label"(){return e(at)},children:(Xe,De)=>{ct(Xe,{get icon(){return H$},size:"xs"})},$$slots:{default:!0}})}},content:Ne=>{var at=Vx(),Xe=de(at,!0);L(De=>j(Xe,De),[()=>u.chat_suggestedPrompts_edit_tooltip()]),p(Ne,at)},$$slots:{trigger:!0,content:!0}})};N($e,z=>{c()&&z(Oe)})}y(ee),L(z=>{xe(ee,1,`${Bf} ${d$} group relative flex cursor-pointer items-center gap-[var(--operational-leading-gap)] rounded-sm border border-transparent bg-transparent px-1.5 py-0.5 text-left opacity-100 pr-9 transition-colors hover:text-foreground has-[[data-suggested-prompt-text]:focus-visible]:outline-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-offset-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-ring`),xe(Se,1,`${Bl??""} mt-px self-start`),ze(R,"aria-label",z),j(re,e(le))},[()=>ey(ue())]),ps("click",R,z=>{z.stopPropagation(),q(ue())}),ps("keydown",R,z=>k(z,ue())),p(fe,ee)};let he=o(()=>l()?"[&>div>div:last-child]:gap-0":"[&>div>div:last-child]:gap-0.5");R$(pe,{get items(){return a()},virtualize:!1,onActivate:q,get class(){return`overflow-visible! [&>div>div:last-child]:flex [&>div>div:last-child]:flex-col ${e(he)??""}`},"data-testid":"suggested-prompts-list",get"data-compact"(){return l()},row:Ae,$$slots:{row:!0}})}y(Q),Nt(1,Q,()=>ma,()=>({tier:"fast",y:0,scale:1})),Nt(2,Q,()=>to,()=>({tier:"fast"})),p(x,Q)};N(se,x=>{a().length>0&&x(P)})}return p(n,K),vn(F)}Wd(["click","keydown"]);var Jx=E('<section class="pb-6 pt-6"><p class="type-body mb-5 max-w-[36rem] px-1.5 text-pretty text-muted-foreground"> </p> <!></section>');function fv(n,r){if(new.target)return un({component:fv,...n});fn(r,!0);let a=X(r,"onSelect",7),i=X(r,"compact",7,!1);const c=o(()=>[{label:u.chat_chiefEmptyState_assignedPrs_label(),prompt:u.chat_chiefEmptyState_assignedPrs_prompt()},{label:u.chat_chiefEmptyState_staleWorkspaces_label(),prompt:u.chat_chiefEmptyState_staleWorkspaces_prompt()},{label:u.chat_chiefEmptyState_agentPerformance_label(),prompt:u.chat_chiefEmptyState_agentPerformance_prompt()},{label:u.chat_chiefEmptyState_morningBrief_label(),prompt:u.chat_chiefEmptyState_morningBrief_prompt()},{label:u.chat_chiefEmptyState_randomTheme_label(),prompt:u.chat_chiefEmptyState_randomTheme_prompt()}]),l=o(()=>e(c).map(q=>q.label));function h(q){const k=e(c).find(B=>B.label===q);k&&a()(k.prompt)}var g={get onSelect(){return a()},set onSelect(q){a(q),Z()},get compact(){return i()},set compact(q=!1){i(q),Z()},$set:gn,$on:(q,k)=>pn(r,q,k)},w=Jx(),f=I(w),C=de(f,!0),S=_(f,2);return Zd(S,{get prompts(){return e(l)},onSelect:h,get compact(){return i()}}),y(w),L(q=>j(C,q),[()=>u.chat_chiefEmptyState_intro_label()]),p(n,w),vn(g)}const eu=2e3,Yx=4e3,Xx=Yx-eu-2;function Zx(n,r=eu){const a=[];let i=0;for(let c=n.length-1;c>=0&&i<r;c-=1){const l=n[c];if(l.role!=="user"&&l.role!=="assistant")continue;const h=(l.contentBlocks??[]).filter(w=>w.type==="text").map(w=>w.text||w.content||"").join(""),g=(l.role==="assistant"?Z_(h).cleanedContent:h).trim();g&&(a.unshift({role:l.role,text:g}),i+=g.length)}return a}function e1(n,r){const a=n.map(l=>`${l.role==="user"?"User":"Assistant"}: ${l.text}`).join(`
|
|
1
|
+
var z_=Object.defineProperty;var Dg=n=>{throw TypeError(n)};var j_=(n,r,a)=>r in n?z_(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a;var Js=(n,r,a)=>j_(n,typeof r!="symbol"?r+"":r,a),G_=(n,r,a)=>r.has(n)||Dg("Cannot "+a);var Ao=(n,r,a)=>(G_(n,r,"read from private field"),a?a.call(n):r.get(n)),Ng=(n,r,a)=>r.has(n)?Dg("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,a);import{t as un,bo as X,bw as gn,bp as gf,b as pn,bm as u,bq as Ur,bs as ge,br as qi}from"./C0QTy0Sy.js";import{bs as fn,a5 as I,bf as fs,bA as y,W as p,bn as vn,aA as Z,aB as E,ca as ae,a7 as Wt,ay as ye,aD as e,cd as Bn,c9 as o,bS as _,bl as de,be as dn,b_ as L,bO as j,c5 as it,bH as b,bV as me,bj as Es,bk as ro,b$ as ln,ai as Wd,aj as ps,bo as jl,br as Mr,c0 as Dt,ak as V_,cb as sd,aw as wi,a as K_}from"./3SdAC2_C.js";import{i as N}from"./bhKPSdq4.js";import{k as xi}from"./-K3ARgq0.js";import{g as Dn,i as Q_,I as eo,p as Lo,e as Eo}from"./B6S6VNu7.js";import{n as Nt,l as ma,c as to,j as Bg,k as Fo,h as J_}from"./DLwWVKiF.js";import{b as pf,e as Ud,f as xe,s as ze,c as zt,g as gs}from"./7UPrdiE9.js";import{b as Y_}from"./goTpbPhD.js";import{b as wr}from"./Dn334wJv.js";import{m as X_,U as Z_,Z as ew,X as tw,Y as nw,I as Wg,o as rw,l as aw,a2 as sw,x as Ug,$ as ow,a0 as zg,r as iw,s as lw}from"./TwgPo_u9.js";import{Jv as D,fo as cw,eW as dw,f3 as uw,eX as gw,f1 as pw,f0 as fw,eZ as vw,e$ as hw,eY as mw,ru as _w,c6 as ww,i as $i,J4 as bw,Dc as ff,Dh as yw,Dj as jg,Dg as Iw,Di as Sw,vD as $w,vF as kw,Cp as vf,cp as xw,cn as Cw,By as Pw,bE as Rw,A3 as Aw,Ce as od,u$ as Tw,cq as Gg,dB as Mw,dC as Ew,Co as qw,el as Lw,CI as Hw,CH as Ow,CM as Fw,CL as Dw,cQ as Nw,cT as Bw,nC as Ww,er as Uw,wR as zw,CN as jw,wT as Gw,CO as Vw,cU as Kw,cV as Qw,nK as Jw,Ah as Yw,Iq as Xw,Ag as Zw,Dt as eb,wm as tb,wn as nb,y$ as rb,z3 as id,wi as ab,wj as sb,rS as ob,rf as ib,rd as lb,f_ as cb,HO as db,Lj as ub,GM as gb,gn as pb,p2 as fb,Jj as vb,oj as hb,A2 as mb,ft as Vg,r2 as Kg,fm as _b,fl as wb,tB as bb,g3 as Qg,re as yb,fe as Ib,C9 as Sb,m as $b,nL as kb,zH as xb,yZ as Cb,Ez as Pb,Eo as Jg,xh as Rb,xi as Yg,u_ as Xg,p3 as Ab,DF as Tb,gj as Mb,g1 as Eb,eU as qb,cM as Lb,A6 as Hb,Lo as Ob,Cu as Fb,LG as Db,y2 as Nb,ga as Bb,fd as Wb,cL as Ub,cI as zb,cH as jb,vr as Gb,xo as Vb,xm as Kb,cF as Qb,cE as Jb,z5 as Yb,z0 as Xb,xn as Zb}from"./_LtUY0jS.js";import{a as zd}from"./CC7to1B5.js";import{aM as ey,aL as ty,bg as ny,a7 as ry,aD as ay,aO as sy,M as hf,a0 as mf,b8 as oy,b2 as iy,as as Zg,P as bl,b0 as ep,a$ as tp,a_ as np}from"./BVAdLfsa.js";import{l as _f,G as ly,I as Pd,at as cy,b1 as El,a9 as wf,S as dy,aW as ld,aq as uy,aJ as gy,C as py,z as bf,s as fy,A as vy,v as hy,a$ as my,aH as yf,aG as If,aI as _y,j as rp,aM as cd,aT as ap,aS as yl,aU as sp,Q as op,d as wy,e as by,ax as yy,V as ip,aE as Iy,c as Sy,m as $y,aV as lp,ap as ky,aw as cp,a as xy,aA as Cy,ad as dp,aD as Py,aX as up,a_ as gp,n as pp,ae as Ry,R as Ay,ay as fp,am as Ty,O as My,as as Ey,h as qy,q as Ly,$ as dd,_ as Hy,aC as vp,a8 as Oy,f as Fy,i as Dy,a6 as Ny,ac as By}from"./CE0T7dwE.js";import{f as Wy,o as Uy,E as zy,C as jy,m as Gy,a2 as hp,aa as Vy,K as Ky,e as Qy,y as Jy}from"./B50rrLDJ.js";import{g as Pi}from"./DypB-Dwi.js";import{dW as Dl,cU as Sf,O as $f,W as Yy,bv as Xy,aF as kf,dH as xf,aU as qo,e8 as Zy,dw as Cf,aw as jd,dV as Gd,aN as Pf,cP as eI,V as ha,a3 as Xs,B as tI,a7 as nI,a4 as rI,M as aI,a6 as sI,ar as oI,aG as Rf,aO as ql,b6 as iI,ay as Af,r as lI,n as Rd,H as cI,dY as dI,aQ as uI,aK as gI,c9 as pI,aW as fI,bM as vI,bK as hI,bL as mI,c8 as _I,c7 as wI,cN as bI,cM as yI,aS as II,bb as SI,bd as $I,bg as kI,bc as xI,bl as CI,bf as PI,be as RI,bh as AI,bi as TI,bk as MI,bj as EI,ax as qI,cj as LI,ck as HI,dv as OI,du as FI,a$ as DI,G as NI,b3 as BI,cf as WI,C as mp,d0 as UI,ba as ds,b$ as zI,X as jI,bq as GI,E as VI,ad as KI,t as QI,cW as JI,d3 as _p,Q as wp,dt as YI,cQ as ud}from"./Cppy6ZYG.js";import{u as Tf,a as Il,ag as XI,x as ZI,ad as Mf,af as eS,ac as Ef,a4 as tS,F as bp,D as nS,e as rS,n as aS,s as sS,m as oS,Y as iS,k as lS}from"./Df8HaglQ.js";import{a2 as cS,b5 as dS,cM as uS,a_ as gS,b4 as pS,c2 as fS,c9 as vS,w as hS,x as mS,cd as _S}from"./CaiHVgqy.js";import{n as wS,P as qf,F as bS,ai as yS,r as IS,ac as SS}from"./DX-Wrapd.js";import{I as $S,s as kS,H as yp}from"./Bqd7fdCF.js";import{e as xS}from"./CL3a4Hm1.js";import{e as CS,f as PS}from"./haN7a3Sc.js";import{s as RS,o as Zs,b as AS,g as Nl,d as TS,l as bi}from"./CIyUrgF0.js";import{a5 as MS,a7 as ES,D as qS,N as LS,ac as Ip,X as Lf,i as HS,r as dr,v as Ri,u as na,p as ki,x as br,S as Vd,m as Gl,s as Ho,y as Ai,o as ao,n as so,t as Sp,aa as oo,w as io,a9 as Kd,q as _a,z as Oo,J as Ad,_ as $p,g as OS,F as FS,U as Hf,I as Of,a8 as Ff,a6 as Ll,O as DS,E as Df,V as NS,A as BS,b as WS,ab as US,ad as Sl,G as zS,e as gd,l as jS,C as GS,f as Ys,j as kp,H as us,Q as VS,d as $l,c as KS,a as xp,h as QS,L as JS,Y as Cp,a4 as pd,a1 as Pp,a0 as YS,a3 as Rp,$ as Ap,T as XS,B as ZS,k as e$,a2 as t$,K as n$,R as r$,P as a$,W as s$}from"./CC1pNuhl.js";import{m as o$}from"./Dms_DO28.js";import{g as Nf}from"./BPjvgJzJ.js";import{b as i$}from"./BsOWc0fD.js";import{g as l$}from"./_Z48PZPG.js";import{a as c$}from"./C429ViPJ.js";import{q as Bf,d as ur,r as d$,e as Bl,j as u$,g as Td,i as g$,f as Md,c as p$,A as f$,O as Tp,k as v$}from"./Brm4kmEq.js";import{P as h$}from"./D5TRf27k.js";import{e as m$}from"./DB7RVYiL.js";import{b as _$,a as w$,g as b$,c as y$,i as I$}from"./DsffLoT8.js";import{R as S$,g as $$,W as kl,c as k$}from"./pxZ1G7sU.js";import"./A9niI_uA.js";import"./CJ4Z96pe.js";import{t as Ti}from"./CrD0jtXE.js";import{F as x$,h as C$}from"./C2jYl_tm.js";import"./lJeex2Gh.js";import{C as P$,e as Br,L as R$,l as Vl,d as Kl,K as Ql,h as Qd,M as Jl,S as Da}from"./DCL0Px6m.js";import{D as A$}from"./C3kvbgti.js";import{f as Mp}from"./chjnSxvZ.js";import"./DU3vNstz.js";import{i as Wf}from"./BjLb7AHW.js";import{h as Ep,i as qp,g as Lp,P as Hp,C as T$,m as Hl,R as M$}from"./DlUZpQ7U.js";import{f as bt,ae as E$}from"./CttA-M7l.js";import{F as ct,bs as q$,cd as L$,aw as Na,a2 as Uf,c9 as H$,bf as O$,be as F$,bg as D$,aO as Op,aj as fd,aB as vd,bB as zf,d3 as Wl,cF as N$,aM as Fp,cb as Dp,cK as Ul,bu as B$,aS as W$,d0 as U$,a8 as jf,ac as z$,ag as j$,cr as G$,ba as V$,aC as Gf,cT as Np,cz as K$,ax as Q$,cD as J$,c3 as Y$}from"./U9jJmfYa.js";import{c as Vf}from"./ChTqQfQN.js";import"./DI_O2uCQ.js";import{c as Et}from"./CUkDMZwP.js";import{a5 as Kf,bg as X$,ar as Z$,k as ek,Y as tk,W as nk,a2 as rk,Z as ak,bw as sk,V as ok,a1 as ik,ah as lk}from"./BpfNraM2.js";import{d as zl,f as ck,e as dk}from"./PWCv1nwS.js";import{A as uk}from"./wl2qP2wF.js";import{D as gk}from"./DrWDRmYR.js";import"./Dhy-QJgd.js";import{a as pk,C as fk}from"./rpEVAvPW.js";import"./Bsh6nUhU.js";import{C as vk}from"./B9qXV8kb.js";import{h as Ed,r as hk,a as mk}from"./CKyxiFOy.js";import{s as _k}from"./ceYukiuF.js";import{I as wk,a as Qf}from"./B2w13ngc.js";import{L as bk}from"./CQwOMyxz.js";import{g as yk,f as Ik,b as Sk}from"./CTP1vzdq.js";import{s as Mi,g as Yn,i as $k,j as kk,e as Bp,r as Wp,f as xk,d as Ck,a as hd,h as Pk}from"./BdTfZwM8.js";import{i as Up,a as Rk}from"./Bu13V5mO.js";import{seekConversationToMessage as zp}from"./CS4mJHYc.js";import{l as Jt,o as md,h as Jd,n as qd,q as Ak}from"./CE7dsja4.js";import{o as Tk}from"./DiKXd1w8.js";import{A as Jf}from"./DiNBgjb1.js";import{b as Yf}from"./CENp25rd.js";import{g as Mk,e as Xf,v as Ek,f as qk,N as Lk,M as Hk,K as Ok,k as Zf,l as Fk,H as ev,s as tv}from"./pQ6IdBCz.js";import{selectCurrentWorkspaceTabId as _d}from"./VxaCN40t.js";import{o as Dk}from"./DrOujub9.js";import{d as Nk}from"./B0Z-1lwJ.js";import{P as Bk}from"./DJcj8WvN.js";import{g as Wk}from"./CGnOIrwW.js";import{H as nv,M as Uk,y as zk,J as jk,g as Gk,i as Vk,u as Kk,e as rv,c as av,d as Qk}from"./DZ84MPQO.js";import{c as Jk,h as Yd,f as sv,Q as Yk}from"./DkME16PR.js";import{t as Xk}from"./DAsc1V4f.js";import{s as Zk}from"./BsieX9dN.js";import{i as ov}from"./FITmaVUJ.js";import{d as ex,i as tx,r as nx}from"./B9ZFoPLo.js";import{g as rx}from"./CRdOY_2z.js";var ax=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),sx=E("<div><!></div>");function iv(n,r){if(new.target)return un({component:iv,...n});fn(r,!0);let a=X(r,"ref",15,null),i=X(r,"class",7),c=X(r,"children",7),l=gf(r,ax);var h={get ref(){return a()},set ref(f=null){a(f),Z()},get class(){return i()},set class(f){i(f),Z()},get children(){return c()},set children(f){c(f),Z()},$set:gn,$on:(f,C)=>pn(r,f,C)},g=sx();pf(g,f=>({"data-slot":"card-header",class:f,...l}),[()=>Ud("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-x-4 gap-y-1.5 pt-4 pb-2 has-data-[slot=card-action]:grid-cols-[minmax(0,1fr)_auto]",vk,i())]);var w=I(g);return Ti(w,()=>c()??fs),y(g),wr(g,f=>a(f),()=>a()),p(n,g),vn(h)}var ox=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),ix=E("<div><!></div>");function lv(n,r){if(new.target)return un({component:lv,...n});fn(r,!0);let a=X(r,"ref",15,null),i=X(r,"class",7),c=X(r,"children",7),l=gf(r,ox);var h={get ref(){return a()},set ref(f=null){a(f),Z()},get class(){return i()},set class(f){i(f),Z()},get children(){return c()},set children(f){c(f),Z()},$set:gn,$on:(f,C)=>pn(r,f,C)},g=ix();pf(g,f=>({"data-slot":"card-title",class:f,...l}),[()=>Ud("type-title min-w-0 break-words font-semibold leading-tight text-foreground",i())]);var w=I(g);return Ti(w,()=>c()??fs),y(g),wr(g,f=>a(f),()=>a()),p(n,g),vn(h)}const xl=$S.CHAT_MEDIA,wd=RS().min(1).max(512);Zs({workspaceId:wd,agentId:wd,draftId:Nl(),principalId:wd,media:AS(wS).min(1).max(20)}).strict();const lx=Zs({sessionId:Nl()}).strict();lx.extend({control:TS("action",[Zs({action:bi("readiness")}).strict(),Zs({action:bi("export"),request:CS}).strict(),Zs({action:bi("transcribe"),request:PS}).strict(),Zs({action:bi("release"),jobId:Nl()}).strict(),Zs({action:bi("adopt"),jobId:Nl()}).strict()])}).strict();function Xd(n,r,a,i=async(c,l)=>typeof window>"u"||kS(window)!=="electron"?{ok:!1,error:"unavailable"}:xS().invoke(c,l)){let c=null,l=null,h=!1;async function g(){h=!0,a.removeEventListener("abort",w);const k=c;c=null,k&&await i(xl.CLOSE,{sessionId:k}).catch(()=>{})}const w=()=>{g()};a.addEventListener("abort",w,{once:!0});const f=()=>{if(h||a.aborted||!r())throw new Error("media-send-retired")};async function C(){if(f(),c)return c;if(l)return l;l=(async()=>{const k=await i(xl.BEGIN,n);if(!k.ok)throw new Error("media-export-unavailable");c=k.value.sessionId;try{return f(),c}catch(B){throw await g(),B}})();try{return await l}finally{l=null}}async function S(k){const B=await C();f();const O=await i(xl.CONTROL,{sessionId:B,control:k});return f(),O}return{service:{exportMedia:k=>S({action:"export",request:k}),adoptMediaJob:k=>S({action:"adopt",jobId:k}),transcribeMedia:k=>S({action:"transcribe",request:k}),releaseMediaJob:async k=>c?await i(xl.CONTROL,{sessionId:c,control:{action:"release",jobId:k}}):{ok:!0,value:void 0}},dispose:g,readiness:()=>S({action:"readiness"})}}const bd=new Set;async function cx(n){const{drafts:r,signal:a}=n,i=structuredClone(n.capture),c=structuredClone(n.items),l=structuredClone(n.payload),{workspaceId:h,agentId:g}=i,w=Pi(D.state),f=Dl.select(D.state,h),C=Sf.select(D.state),S=_f(),q=JSON.stringify([w,h,g]);if(!w||!f||!C||l.wsId!==h||bd.has(q))return!1;bd.add(q);const k=new AbortController,B=()=>k.abort();a.addEventListener("abort",B,{once:!0});const O=()=>!a.aborted&&!k.signal.aborted&&Pi(D.state)===w&&Dl.select(D.state,h)===f&&wf(S)&&r.isCurrentDraft(i),T=D.getReadableState().subscribe(()=>{O()||k.abort()});let F=null;try{if(!O()||cS(c))return!1;const K=Tf(i.attachments),se=qf(bS(h,g),K,c.map(fe=>({contextItemId:fe.id,attachmentId:fe.attachmentId,path:fe.path}))),P=new Set([...se.images,...se.clips].map(fe=>fe.contextItemId));if(K.some(([fe])=>!P.has(fe))||se.images.some(fe=>fe.mediaError)||se.clips.some(fe=>fe.mediaError)||!yS(l.text,se))throw new Error("invalid-evidence");if(F=n.warm?.take(i,k.signal)??null,!await r.flushDraft(i)||!O())return!1;const x=await Wy.agents.get(g,h);if(!O())return!1;if(!x||x.workspaceId!==h||x.retiredAt||x.pendingDeleteAt||x.status==="deleted")throw new Error("unavailable");const Q=se.clips.flatMap(fe=>fe.media?[fe.media]:[]);Q.length&&!F&&(F=Xd({workspaceId:h,agentId:g,draftId:crypto.randomUUID(),principalId:C.principal.id,media:Q},O,k.signal));const pe=ly(c,se),Ae=Pd(pe),he=await cy({workspaceId:h,agentId:g,evidence:se,clickedItems:c,sendItems:pe,clickedPayload:{...l,contextItems:pe,imageBlocks:Ae.imageBlocks,fileBlocks:Ae.fileBlocks},binding:S,service:F?.service??null,current:O,onRecord:()=>{}});return!he||!O()?!1:El(D,g,he)}catch{return O()&&D.dispatch(cw(g,u.dock_conversation_sendFailed_error())),!1}finally{T(),a.removeEventListener("abort",B),await F?.dispose(),bd.delete(q)}}const cv=1e4,jp={wasBusy:!1,busySince:null,preempted:!1,prediction:null};function Gp(n){return MS(n.messageMetadata)}function dx(n,r){if(n.some(Gp)){const a=n[0];return a&&!Gp(a)&&Vp(a,r)?[a.id]:[]}return n.filter(a=>Vp(a,r)).map(a=>a.id)}function ux(n){let r=null;for(const a of n)(a.status==="preparing"||a.status==="sending")&&a.createdAt>(r??-1/0)&&(r=a.createdAt);return r}function Vp(n,r){return!n.requeuedAfterFailure&&ES(n,r)}function gx(n,r){const{busy:a,queue:i,delivered:c,now:l}=r,h=r.blocked||r.interrupted,g=r.timeoutMs??cv;let w=n.prediction;if(w){const k=new Set(i.map(F=>F.id)),B=w.ids.filter(F=>k.has(F)&&!c.has(F)),O=l-w.startedAt>=g,T=n.wasBusy&&!a;!B.length||O||h&&!a||T?w=null:B.length!==w.ids.length&&(w={...w,ids:B})}const f=n.wasBusy&&!a,C=n.wasBusy?n.busySince:a?l:null,S=n.wasBusy&&n.preempted||C!==null&&r.directSendAt!==null&&r.directSendAt>C;if(!w&&f&&!h&&!S){const k=dx(i,l).filter(B=>!c.has(B));k.length&&(w={ids:k,startedAt:l})}const q={wasBusy:a,busySince:a?C:null,preempted:a&&S,prediction:w};return n.wasBusy===q.wasBusy&&n.busySince===q.busySince&&n.preempted===q.preempted&&n.prediction===q.prediction?n:q}class px{constructor(){Js(this,"previousWorkspaceId",null);Js(this,"_isRebinding",!1);Js(this,"_generation",0);Js(this,"_rebindPromise",null);Js(this,"_rebindResolve",null)}recordMount(r){return this.previousWorkspaceId=r,r}wasWorkspaceChangedDuringMount(r){return this.previousWorkspaceId!==r}shouldRebind(r){return!r||this.previousWorkspaceId===null?!1:r!==this.previousWorkspaceId}recordRebind(r){this.previousWorkspaceId=r}hasWorkspaceChanged(r){return r!==this.previousWorkspaceId}get trackedWorkspaceId(){return this.previousWorkspaceId}get isRebinding(){return this._isRebinding}startRebind(){return this._generation++,this._isRebinding=!0,this._rebindResolve?.(),this._rebindPromise=new Promise(r=>{this._rebindResolve=r}),this._generation}endRebind(r){r!==void 0&&r!==this._generation||(this._isRebinding=!1,this._rebindResolve?.(),this._rebindPromise=null,this._rebindResolve=null)}async waitForRebind(r=5e3){if(!this._isRebinding||!this._rebindPromise)return!1;const a=Date.now()+r;for(;this._isRebinding&&this._rebindPromise;){const i=a-Date.now();if(i<=0)return!1;let c;const l=await Promise.race([this._rebindPromise.then(()=>!1),new Promise(h=>{c=setTimeout(()=>h(!0),i)})]);if(clearTimeout(c),l)return!1}return!0}}function fx(n,r){return!(n?.tabType!=="agent"||n.agentId!==r.agentId||!r.isActive||n.workspaceId&&n.workspaceId!==r.workspaceId||r.panelId&&(n.source!=="dictation"&&!r.isPanelFocused||n.panelId&&n.panelId!==r.panelId))}function Kp(n){const r=typeof n=="string"?n:n&&typeof n=="object"&&typeof n.script=="string"?n.script:void 0;return r||void 0}var vx=E('<div role="status" aria-live="polite" data-presence-typing-indicator=""><span class="inline-flex min-w-[var(--operational-leading-slot-size)] shrink-0 items-center justify-center svelte-lm4khl"><!></span> <span class="min-w-0 truncate svelte-lm4khl"> </span> <span class="inline-flex shrink-0 items-center gap-0.5 svelte-lm4khl" aria-hidden="true"><span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.2s"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.4s"></span></span></div>');function dv(n,r){if(new.target)return un({component:dv,...n});fn(r,!0);const a=()=>ge(C,"$typing$",i),[i,c]=Ur();let l=X(r,"workspaceId",7),h=X(r,"agentId",7),g=X(r,"class",7,"");const w=Bn(""),f=Bn("");ae(()=>{w.set(l())}),ae(()=>{f.set(h())});const C=dS(w,f),S=o(()=>m$(a()));var q={get workspaceId(){return l()},set workspaceId(F){l(F),Z()},get agentId(){return h()},set agentId(F){h(F),Z()},get class(){return g()},set class(F=""){g(F),Z()},$set:gn,$on:(F,K)=>pn(r,F,K)},k=Wt(),B=ye(k);{var O=F=>{var K=vx(),se=I(K),P=I(se);h$(P,{get people(){return a()},size:12,decorative:!0}),y(se);var x=_(se,2),Q=de(x,!0);dn(2),y(K),L(()=>{xe(K,1,`${Bf} flex h-4 min-w-0 items-center gap-[var(--operational-leading-gap)] px-[var(--operational-row-inline-padding)] font-family-child font-normal text-muted-foreground text-[11px] leading-4 ${g()??""} /* a11y-ignore: user-requested compact typing status in the composer gap */`,"svelte-lm4khl"),j(Q,e(S))}),p(F,K)};N(B,F=>{e(S)&&F(O)})}p(n,k);var T=vn(q);return c(),T}const hx=50,mx=5e3,_x=500,wx=()=>({authority:()=>Pi(D.state),persistSnapshot:uy,dispatch:n=>D.dispatch(n),ownerView:n=>gy.withStore(D)(n)});function bx(n){const r=n.store??wx(),a=crypto.randomUUID();let i=me(!1),c=me(!1),l=me(!1),h=null,g=null,w=0,f=!1,C=null,S=null,q=null,k=0,B=null,O=null;const T={};let F,K=me([]),se=null,P=0,x="",Q=0,pe="";const Ae=()=>{const W=n.workspaceId(),R=n.agentId();if(!W||!R||!(n.active?.()??!0))return null;const re=r.authority?.();if(!re||f)return null;const Me=n.inputValue(),H=fe(),Y=F?.shared,J=Y?.workspaceId===W&&Y.agentId===R?Y.lifetime:null,$e=JSON.stringify([re,W,R,k,J,H.map(z=>[z.id,z.attachmentId,z.path])]);$e!==pe&&(pe=$e,Q+=1);const Oe=JSON.stringify([re,W,R,Me,H,k]);return Oe!==x&&(x=Oe,P+=1),{authority:re,ownerId:a,workspaceId:W,agentId:R,text:Me,attachments:JSON.parse(JSON.stringify(H)),generation:P,attachmentEpoch:Q}};let he=null;const fe=()=>XI(n.contextItems(),ZI(n.contextItems(),e(K))),He=W=>{if(F=W,!W||f)return;const R=W.restore;if(O&&R?.requestId===O.requestId&&R.status!=="pending"){const{apply:H}=O;O=null,b(c,!1),R.status==="restored"&&b(K,R.draft?.attachments??[]),H(R)}const re=W.shared;if(re&&!e(c)&&g===`${re.workspaceId}\0${re.agentId}`){const H=JSON.stringify([re.provenance,re.workspaceId,re.agentId,re.lifetime,re.revision]);if(se!==H){se=H;const Y=he??h,J=Y&&n.inputValue()===Y.text&&JSON.stringify(fe())===Y.attachmentsJson;re.origin===a?he={text:re.snapshot.text,attachmentsJson:JSON.stringify(re.snapshot.attachments)}:J&&(w+=1,q&&clearTimeout(q),b(K,re.snapshot.attachments),he=h={text:re.snapshot.text,attachmentsJson:JSON.stringify(e(K))},n.setInputValue(re.snapshot.text),n.setContextItems(Il(e(K))),n.applyEditorContent(re.snapshot.text))}}it(Ae);const Me=[];for(const H of W.saves){if(H.status==="pending")continue;Me.push(H.id);const Y=T[H.id];delete T[H.id],Y?.(H)}Me.length>0&&queueMicrotask(()=>r.dispatch(pw(a,Me)))},ue=(W,R,re)=>{const Me=crypto.randomUUID();O={requestId:Me,apply:re},b(c,!0),r.dispatch(vw(a,Me,W,R))},oe=()=>{O&&(O=null,b(c,!1),r.dispatch(mw(a)))},Te=()=>{const W=B;W&&(B=null,r.dispatch(hw(a)),F?.saves.some(R=>R.id===W)||delete T[W])};r.dispatch(dw(a));const le=r.ownerView(a).subscribe(W=>it(()=>He(W))),ee=()=>{S&&(clearTimeout(S),S=null),b(l,!1)},Se=()=>{B&&(B=null,r.dispatch(fw(a)))};ae(()=>{const W=n.active?.()??!0,R=n.workspaceId(),re=n.agentId();if(!W){it(()=>{w+=1,g=null,oe(),C&&clearTimeout(C),C=null,ee(),q&&clearTimeout(q),q=null,b(i,!1),Se()});return}if(!R||!re)return;const Me=`${R}\0${re}`;if(g===Me)return;const H=g!==null;g=Me;const Y=++w;it(()=>{h=null,he=null,se=null,b(K,[]),C&&clearTimeout(C),ee(),q&&(clearTimeout(q),q=null),H&&(Se(),n.setInputValue(""),n.contextItemsAreScoped||n.setContextItems([]),n.applyEditorContent(""));const J=dy(R,re);if(J){b(K,J.attachments),b(i,!1);const Oe=n.contextItems().length>0,z=J.text,Ie=JSON.stringify(J.attachments);n.setInputValue(J.text),Oe||n.setContextItems(Il(J.attachments)),n.applyEditorContent(J.text),h={text:J.text,attachmentsJson:Ie},ue(R,re,Ce=>{if(Ce.status!=="restored")return;const Ne=Ce.draft;if(f||!(n.active?.()??!0)||g!==Me||w!==Y)return;const at=Ne?.text??"",Xe=Ne?.attachments??[],De=JSON.stringify(Xe);ld(R,re,{text:at,attachments:Xe});const Re=n.inputValue()===z&&JSON.stringify(fe())===Ie;Oe||!Re||(at!==z&&(n.setInputValue(at),n.applyEditorContent(at)),De!==Ie&&n.setContextItems(Il(Xe)),h={text:at,attachmentsJson:De})});return}b(i,!0),S=setTimeout(()=>{S=null,(n.active?.()??!0)&&b(l,!0)},_x),C=setTimeout(()=>{(n.active?.()??!0)&&(b(i,!1),ee())},mx);const $e=()=>{!(n.active?.()??!0)||g!==Me||w!==Y||(C&&clearTimeout(C),b(i,!1),ee())};ue(R,re,Oe=>{if(Oe.status!=="restored"){$e();return}const z=Oe.draft;if(f||!(n.active?.()??!0)||g!==Me||w!==Y)return;const Ie=!!n.inputValue();if(!Ie&&z?.attachments?.length&&n.contextItems().length===0&&n.setContextItems(Il(z.attachments)),!Ie&&z?.text&&(n.setInputValue(z.text),q=setTimeout(()=>{(n.active?.()??!0)&&n.inputValue()===z.text&&n.applyEditorContent(z.text)},hx)),h===null){const Ce=z?.text??"",Ne=z?.attachments??[];h={text:Ce,attachmentsJson:JSON.stringify(Ne)},ld(R,re,{text:Ce,attachments:Ne})}$e()})})}),ae(()=>{const W=n.active?.()??!0,R=n.workspaceId(),re=n.agentId(),Me=e(i);if(!W){it(Te);return}if(!R||!re)return;const H=n.inputValue(),Y=fe();if(it(Ae),it(Te),Me||h===null&&!H&&Y.length===0)return;const J=JSON.stringify(Y);if(h!==null&&h.text===H&&h.attachmentsJson===J)return;JSON.stringify(e(K))!==J&&b(K,Y);const $e=`${R}\0${re}`,Oe=k,z=crypto.randomUUID();T[z]=Ie=>{if(n.active?.()??!0){if(Ie.status==="saved"){g===$e&&k===Oe&&(h={text:H,attachmentsJson:J});return}n.onSaveError?.(new Error(Ie.error))}},it(()=>{B=z,r.dispatch(uw(a,z,{authority:r.authority?.()??void 0,workspaceId:R,agentId:re,text:H,attachments:Y,rollback:h?{text:h.text,attachments:JSON.parse(h.attachmentsJson)}:null}))})}),ae(()=>()=>{f=!0,C&&clearTimeout(C),S&&clearTimeout(S),q&&clearTimeout(q),Se(),le(),r.dispatch(gw(a))});const Ee=W=>{const R=Ae();return R!==null&&R.authority===W.authority&&R.ownerId===W.ownerId&&R.workspaceId===W.workspaceId&&R.agentId===W.agentId&&R.generation===W.generation&&R.text===W.text&&JSON.stringify(R.attachments)===JSON.stringify(W.attachments)};return{captureDraft:Ae,isCurrentDraft:Ee,updateAttachmentScreen(W,R,re){return!Ee(W)||!W.attachments.some(Me=>Me.id===R)?null:(b(K,W.attachments.map(Me=>Me.id===R?{...Me,screen:structuredClone(re)}:Me)),Ae())},async flushDraft(W){if(!Ee(W))return!1;if(!r.persistSnapshot)throw new Error("draft-shared-transport-unavailable");return await r.persistSnapshot(a,W.workspaceId,W.agentId,W,W.authority),Ee(W)},get restorePending(){return e(c)},get gateActive(){return e(i)},get gateVisible(){return e(l)},invalidatePendingRestore(){if(w+=1,k+=1,oe(),C&&(clearTimeout(C),C=null),q&&(clearTimeout(q),q=null),b(i,!1),ee(),Te(),g!==null){const[W,R]=g.split("\0");ld(W,R,{text:"",attachments:[]}),he=null,b(K,[]),h={text:"",attachmentsJson:"[]"}}}}}function Ei(n){if(!n)return null;const r=qf(JSON.stringify([n.workspaceId,n.agentId]),Tf(n.attachments),n.attachments.map(a=>({contextItemId:a.id,attachmentId:a.attachmentId,path:a.path})));return{...r,clips:r.clips.filter(a=>{const i=n.attachments.find(c=>c.id===a.contextItemId);return!!a.media&&!a.mediaError&&!!i&&a.path===i.path})}}async function yx(n,r,a){const i=D.state.principal.snapshot,c=()=>Pi(D.state)===n.authority&&a.isCurrentDraft(n);if(!i||!c()||!await a.flushDraft(n)||!c())return{ready:!1};const l=new AbortController,h=Xd({workspaceId:n.workspaceId,agentId:n.agentId,principalId:i.principal.id,draftId:crypto.randomUUID(),media:[r]},c,l.signal);try{const g=await h.readiness();return!c()||!g.ok?{ready:!1}:g.value.find(w=>w.sourceId===r.source.id)??{ready:!1}}finally{await h.dispose()}}function Qp(n){let r=me(null),a=me(!1),i=me(!1),c=null,l=!0,h=0,g=null;Es(()=>{l=!1,h++}),ae(()=>{const S=n.capture();e(r)&&(!S||S.authority!==e(r).capture.authority||S.ownerId!==e(r).capture.ownerId||S.workspaceId!==e(r).capture.workspaceId||S.agentId!==e(r).capture.agentId||S.attachmentEpoch!==e(r).capture.attachmentEpoch)&&b(r,null)});async function w(S){if(n.disabled()||e(a))return;const q=n.drafts.captureDraft(),k=Ei(q),B=k?.clips.find(K=>K.contextItemId===S);if(!q||!B?.media||!k)return;const O=py({workspaceId:q.workspaceId,agentId:q.agentId,clip:B,evidence:k,marks:k.marks}),T=bf(q.workspaceId,B.path);if(!O||!T)return;const F=++h;c=document.activeElement instanceof HTMLElement?document.activeElement:null,b(a,!0),b(i,!1);try{if(await n.beforeOpen?.(),!l||h!==F||!n.drafts.isCurrentDraft(q))return;const K=await(n.prepareOutput??yx)(q,B.media,n.drafts);if(!l||h!==F||!n.drafts.isCurrentDraft(q))return;const{attachmentPath:se,...P}=O;b(r,{capture:q,contextItemId:S,snapshot:{...P,openId:crypto.randomUUID(),mediaUrl:T,output:K,deleteReady:!0}})}catch{l&&h===F&&b(i,!0)}finally{l&&h===F&&b(a,!1)}}async function f(S){const q=crypto.randomUUID(),k=e(r),B=n.drafts.captureDraft();if(!k||!B||B.authority!==k.capture.authority||B.ownerId!==k.capture.ownerId||B.workspaceId!==k.capture.workspaceId||B.agentId!==k.capture.agentId||B.attachmentEpoch!==k.capture.attachmentEpoch)return{requestId:q,result:"stale-source"};const O=Ei(B),T=O?.clips.find(Q=>Q.contextItemId===k.contextItemId);if(!O||!T?.media)return{requestId:q,result:"stale-source"};const K=g?.openId===k.snapshot.openId&&g.inputRevision===S.revision&&JSON.stringify(g.media)===JSON.stringify(T.media)?{...S,revision:T.media.saved?.revision??0}:S,se=IS(T.media,{openId:k.snapshot.openId,...k.snapshot.output?.version===2?{outputVersion:2}:{},pair:{workspaceId:B.workspaceId,agentId:B.agentId},sourceId:S.sourceId,sourceRevision:S.sourceRevision,expectedEditRevision:K.revision,edit:K});if(se.status!=="saved")return{requestId:q,result:se.status==="invalid-edit"?"failed":se.status};const P=SS({...O,clips:O.clips.map(Q=>Q.id===T.id?{...Q,media:se.media}:Q)})[k.contextItemId],x=n.drafts.updateAttachmentScreen(B,k.contextItemId,P);if(!x)return{requestId:q,result:"stale-source"};g={openId:k.snapshot.openId,media:se.media,inputRevision:S.revision};try{if(!n.drafts.isCurrentDraft(x))return{requestId:q,result:"stale-source"};await n.drafts.flushDraft(x);const Q=n.drafts.captureDraft();return!l||e(r)?.snapshot.openId!==k.snapshot.openId||!Q||Q.attachmentEpoch!==k.capture.attachmentEpoch||Q.authority!==x.authority||Q.ownerId!==x.ownerId||Q.workspaceId!==x.workspaceId||Q.agentId!==x.agentId||JSON.stringify(Q.attachments.find(pe=>pe.id===k.contextItemId)?.screen)!==JSON.stringify(P)?{requestId:q,result:"stale-source"}:(g=null,{requestId:q,result:"saved",saved:se.media.saved??void 0})}catch{return{requestId:q,result:"failed"}}}function C(S){return n.disabled()||!n.onRemove(S)?!1:(e(r)?.contextItemId===S&&b(r,null),!0)}return{get session(){return e(r)},get opening(){return e(a)},get problem(){return e(i)},open:w,save:f,remove:C,close(){b(r,null)},restoreFocus(){c?.isConnected&&c.focus()}}}var Ix=E('<p role="alert"> </p>'),Sx=E('<div class="recording-editor-surface svelte-cdb16"><!></div>'),$x=E("<!> <!> <!>",1);function uv(n,r){if(new.target)return un({component:uv,...n});fn(r,!0);let a=X(r,"capture",7),i=X(r,"drafts",7),c=X(r,"disabled",7,!1),l=X(r,"onRemove",7),h=X(r,"controllerFactory",7,Qp),g=X(r,"beforeOpen",7),w=X(r,"onReviewChange",7);const f=it(()=>h()({drafts:i(),capture:()=>a(),disabled:()=>c(),onRemove:P=>l()(P),beforeOpen:()=>g()?.()??Promise.resolve()}));ae(()=>{const P=f.opening,x=f.session;it(()=>w()?.(P,x?.snapshot.output?.ready?{openId:x.snapshot.openId,capture:x.capture}:null))});const C=o(fy),S=o(()=>Ei(a())),q=o(()=>e(S)?.clips.map(P=>({id:P.contextItemId,kind:"clip",owner:"evidence",duration:Mp(P.durationMs),recording:!1,url:a()?bf(a().workspaceId,P.path):void 0,...P.media?.saved?{summary:vy(P.media.saved)}:{}}))??[]);let k=me(null);var B={get capture(){return a()},set capture(P){a(P),Z()},get drafts(){return i()},set drafts(P){i(P),Z()},get disabled(){return c()},set disabled(P=!1){c(P),Z()},get onRemove(){return l()},set onRemove(P){l(P),Z()},get controllerFactory(){return h()},set controllerFactory(P=Qp){h(P),Z()},get beforeOpen(){return g()},set beforeOpen(P){g(P),Z()},get onReviewChange(){return w()},set onReviewChange(P){w(P),Z()},$set:gn,$on:(P,x)=>pn(r,P,x)},O=$x(),T=ye(O);{let P=o(()=>c()||f.opening);qS(T,{get items(){return e(q)},get labels(){return e(C)},get disabled(){return e(P)},onEdit:x=>void f.open(x),onMarkUp:x=>void f.open(x),get onRemove(){return f.remove}})}var F=_(T,2);{var K=P=>{var x=Ix(),Q=de(x,!0);L(pe=>j(Q,pe),[()=>u.dock_captureEditor_saveFailed_label()]),p(P,x)};N(F,P=>{f.problem&&P(K)})}var se=_(F,2);{let P=o(()=>!!f.session),x=o(()=>u.dock_captureEditor_recording_title({duration:f.session?Mp(f.session.snapshot.durationMs??0):""}));P$(se,{get open(){return e(P)},size:"editor",showCloseButton:!1,get title(){return e(x)},escapeKeydownBehavior:"ignore",dismissOnInteractOutside:!1,onClose:()=>f.close(),onCloseAutoFocus:Q=>{Q.preventDefault(),f.restoreFocus()},get contentRef(){return e(k)},set contentRef(Q){b(k,Q,!0)},children:(Q,pe)=>{var Ae=Wt(),he=ye(Ae);{var fe=He=>{var ue=Wt(),oe=ye(ue);xi(oe,()=>f.session.snapshot.openId,Te=>{var le=Sx(),ee=I(le);A$(ee,{get snapshot(){return f.session.snapshot},get shortcutDialog(){return e(k)},onClose:()=>f.close(),get onSave(){return f.save},onDelete:async()=>!!f.session&&f.remove(f.session.contextItemId)}),y(le),p(Te,le)}),p(He,ue)};N(he,He=>{f.session&&He(fe)})}p(Q,Ae)},$$slots:{default:!0}})}return p(n,O),vn(B)}const Cl=n=>JSON.stringify([n.authority,n.ownerId,n.workspaceId,n.agentId,n.attachmentEpoch,n.attachments]);function kx(n){let r=me(!1),a=me(!1),i=me(null),c=!1,l=0,h=null,g=null;async function w(S){S.abort.abort(),S.slot?.cancel(),await S.native?.dispose()}async function f(){l++;const S=g;g=null,S&&await w(S)}ro(()=>{const S=()=>{b(r,document.hasFocus(),!0)};return S(),window.addEventListener("focus",S),window.addEventListener("blur",S),()=>{window.removeEventListener("focus",S),window.removeEventListener("blur",S)}});const C=D.getReadableState().subscribe(()=>{g&&!g.current()&&f()});return Es(()=>{c=!0,C(),f()}),ae(()=>{const S=n.capture(),q=S?Cl(S):"",k=e(r)&&!e(a)&&(n.active()||e(i)?.key===q);it(()=>{if(!k||!S){f();return}if(g?.key===q)return;if(h===q){f();return}f();const O=Ei(S)?.clips.flatMap(Ae=>!Ae.mediaError&&Ae.media?[Ae.media]:[])??[],T=O[0],F=D.state.principal.snapshot,K=Dl.select(D.state,S.workspaceId);if(!T||!F||!K||n.drafts.gateActive)return;const se=_f(),P=new AbortController,x=()=>!c&&!P.signal.aborted&&Pi(D.state)===S.authority&&Dl.select(D.state,S.workspaceId)===K&&wf(se)&&!!n.capture()&&Cl(n.capture())===q,Q={key:q,capture:S,abort:P,native:null,slot:null,current:x};g=Q;const pe=l;n.drafts.flushDraft(S).then(async Ae=>{if(!(g!==Q||pe!==l||!x())){if(!Ae){h=q,await f();return}Q.native=Xd({workspaceId:S.workspaceId,agentId:S.agentId,draftId:crypto.randomUUID(),principalId:F.principal.id,media:structuredClone(O)},x,P.signal),Q.slot=hy(Q.native.service),h=q,Q.slot.warm(q,T,x)}}).catch(()=>{g===Q&&f()})})}),{cancel:f,async beforeEditorOpen(){b(a,!0),h=null,await f()},editorState(S,q){b(a,S,!0);const k=q?Cl(q.capture):null;q&&e(i)?.openId!==q.openId&&(h=null),b(i,q&&k?{openId:q.openId,key:k}:null)},take(S,q){const k=g;if(!k?.native||!k.slot||k.key!==Cl(S)||!k.current())return f(),null;g=null,l++;const B=k.native,O=k.slot,T=()=>k.abort.abort();return q.addEventListener("abort",T,{once:!0}),q.aborted&&T(),{service:{...B.service,takePreparedRecording:F=>O.take(k.key,F,()=>!q.aborted&&k.current())},async dispose(){q.removeEventListener("abort",T),await w(k)}}}}}var xx=E('<div role="status" class="px-3 py-1.5 text-xs text-muted-foreground" data-testid="chat-draft-loading-gate"><span> </span></div>');function gv(n,r){if(new.target)return un({component:gv,...n});fn(r,!1);var a={$set:gn,$on:(h,g)=>pn(r,h,g)};Wf();var i=xx(),c=I(i),l=de(c,!0);return y(i),L(h=>j(l,h),[()=>u.chat_draftGate_loading_label()]),p(n,i),vn(a)}var Cx=E('<div data-new-messages-divider="" class="type-caption font-family-child my-6 flex items-center gap-2 px-2" role="separator"><div class="h-px flex-1 bg-border"></div> <span class="whitespace-nowrap px-1 font-medium text-foreground"> </span> <div class="h-px flex-1 bg-border"></div></div>');function Ld(n,r){if(new.target)return un({component:Ld,...n});fn(r,!1);var a={$set:gn,$on:(h,g)=>pn(r,h,g)};Wf();var i=Cx(),c=_(I(i),2),l=de(c,!0);return dn(2),y(i),L((h,g)=>{ze(i,"aria-label",h),j(l,g)},[()=>u.chat_newMessagesDivider_label(),()=>u.chat_newMessagesDivider_label()]),p(n,i),vn(a)}function Px(n,r){if(!r||n.length===0)return null;const a=n.indexOf(r);return a===-1||a===n.length-1?null:r}function Rx(n,r,a){if(!r||n.length===0)return"none";const i=n.indexOf(r);return i===n.length-1?"none":i!==-1?"marker-loaded":a.complete?a.truncated?"marker-beyond-window":"none":"marker-pending"}function Ax(n,r){return r&&n.includes(r)?r:null}function Jp(n,r,a){return r-n<=a}const Tx=.2;function Yp(n,r,a){const i=Math.max(0,a-r),c=n-Tx*r;return Math.min(Math.max(0,c),i)}function Mx(n,r,a){return n!==null&&a&&n===r}function Ex(n){return n?_w(n)&&ww(n)!==null&&typeof n.metadata?.taskNoteId=="string":!1}function qx(n){const r=[],a=new Set;let i,c;for(const F of n.messages){if(F.agentId&&F.agentId!==n.agentId){i=void 0,c=void 0;continue}if(a.has(F.id))continue;a.add(F.id),n.breakBeforeMessageIds?.has(F.id)&&(i=void 0,c=void 0);const K=LS(F);if(K?.kind!=="turn-failure")c=void 0;else{const se=i?.seq!==void 0&&F.seq!==void 0&&Number.isSafeInteger(i.seq)&&Number.isSafeInteger(F.seq)&&F.seq===i.seq+1;(!c||!se)&&(c={key:JSON.stringify([n.agentId,"notice",F.id]),anchorMessageId:F.id,correlation:"unavailable",records:[],recordedFailureCount:0},r.push(c)),c.records.push({messageId:F.id,reason:K.reason,timestamp:F.timestamp}),c.recordedFailureCount+=1}i=F}const l=new Map;for(const F of n.queue){if(!F.requeuedAfterFailure)continue;const K=F.turnId||void 0,se=JSON.stringify([n.agentId,K?"turn":"queue",K??F.id]);let P=l.get(se);P||(P={key:se,correlation:K?"turn":"queue-entry",turnId:K,queueIds:[],state:"queued"},l.set(se,P)),P.queueIds.includes(F.id)||P.queueIds.push(F.id)}const h=[...l.values()],g=n.session?.id===n.agentId?n.session:void 0,w=g?.status===$i.Error,f=n.transientError||w&&g.stopReason||null,C=w&&!f,S=w&&(!n.transientError||n.transientError===g.stopReason)?g.stopReasonTimestamp:void 0,q=S?Ip(S):null,k=q&&f&&f===g?.stopReason?r.flatMap(F=>F.records).filter(F=>F.reason===f&&Ip(F.timestamp)===q):[],B=k.length===1?k[0].messageId:void 0,T=(g?$f(g):!1)?"attempting":h.length?"queued":f||C?"action-needed":"inactive";return{history:r,queueRecovery:h,current:{state:T,error:f,needsFallbackReason:C,timestamp:S,noticeId:B}}}function Lx(n,r){const a=n.hiddenTail[0]?.id,i=qx({...r,messages:[...n.groups.flatMap(g=>g.messages),...n.hiddenTail],breakBeforeMessageIds:new Set(a?[a]:[])}),c=i.current.noticeId,l=i.history.map(g=>({...g,records:g.records.filter(w=>w.messageId!==c)})).filter(g=>g.records.length>0),h=new Set(l.map(g=>g.records[0].messageId));return{...i,runsByAnchor:new Map(l.map(g=>[g.records[0].messageId,g])),collapsedMessageIds:new Set(i.history.flatMap(g=>g.records.map(w=>w.messageId).filter(w=>!h.has(w))))}}var Hx=E('<div class="flex size-10 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <div class="min-w-0 flex-1"><div class="type-body truncate font-medium text-foreground"> </div> <div class="type-caption mt-0.5 line-clamp-2 text-muted-foreground"> </div></div> <div class="flex size-7 shrink-0 items-center justify-center rounded-md bg-muted/50 text-muted-foreground transition-colors group-hover:bg-muted"><!></div>',1),Ox=E('<div class="flex size-9 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <span class="type-body font-medium"> </span>',1),Fx=E('<div><div class="border-b border-border bg-muted/20 px-4 py-3"><p class="type-body font-medium text-foreground"> </p> <p class="type-caption mt-0.5 text-muted-foreground"> </p></div> <div class="max-h-[21rem] overflow-y-auto p-2"><!></div> <div class="border-t border-border bg-popover p-2"><!></div></div>'),Dx=E('<div class="mb-5"><!></div>'),Nx=E('<p data-testid="agent-welcome-description"> </p> <!>',1),Bx=E("<!> <!>",1),Wx=E('<p class="mb-3 px-4 text-sm text-subtle leading-relaxed whitespace-pre-wrap" data-testid="agent-welcome-description"> </p>'),Ux=E("<!> <span> </span>",1),zx=E('<div class="mx-auto flex w-full max-w-[40rem] flex-1 flex-col px-4 pb-6 pt-4 text-subtle"><!> <!> <!></div>');function pv(n,r){if(new.target)return un({component:pv,...n});fn(r,!0);const a=()=>ge(k,"$userOverrides$",h),i=()=>ge(q,"$specialists$",h),c=()=>ge(F,"$isGitHubAuth$",h),l=()=>ge(K,"$recentSpecialistIds$",h),[h,g]=Ur();let w=X(r,"onSpecialistChange",7),f=X(r,"session",7),C=X(r,"workspaceId",7);const S=Bn(C()??"");ae(()=>S.set(C()??""));const q=Kf(S),k=X$();ae(()=>{a()});const B=o(()=>{if(!f()||Yy(f()))return null;const W=f().metadata?.specialist||f().agentMetadata?.specialist;return W&&i().find(R=>R.id===W)||null});async function O(W){W?await zl({specialist:W,hash:"specialists"}):await zl({view:"create-specialist"})}let T=me(!1);const F=Z$(),K=uS(),se=o(()=>bw(ek(i(),c()),l()));let P=me(!1);const x=o(()=>u.chat_regularAgentWelcome_generalDescription_label()),Q=o(()=>e(B)?.name??u.chat_shared_general_fallback()),pe=o(()=>e(B)?.description??u.chat_shared_noSpecializedBehavior_label()),Ae=o(()=>e(B)?e(B).defaultBehaviorPrompt||"":e(x));var he={get onSpecialistChange(){return w()},set onSpecialistChange(W){w(W),Z()},get session(){return f()},set session(W){f(W),Z()},get workspaceId(){return C()},set workspaceId(W){C(W),Z()},$set:gn,$on:(W,R)=>pn(r,W,R)},fe=zx(),He=I(fe);{var ue=W=>{var R=Dx(),re=I(R);gk(re,{class:"block w-full",align:"start",side:"bottom",contentClass:"w-[min(28rem,calc(100vw-2rem))]",get open(){return e(P)},set open(Y){b(P,Y,!0)},trigger:(Y,J)=>{let $e=()=>(J?.()).props;{let Oe=o(()=>Ud("group flex h-auto min-h-(--control-height-medium) w-full cursor-pointer items-center gap-3 whitespace-normal rounded-lg border border-border bg-card px-4 py-3 text-left shadow-xs transition-colors","hover:border-input hover:bg-accent/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"));bt(Y,qi($e,{type:"button",variant:"plain",wrapContent:!1,get class(){return e(Oe)},"data-testid":"specialist-picker-trigger",children:(z,Ie)=>{var Ce=Hx(),Ne=ye(Ce),at=I(Ne);{let Ge=o(()=>e(B)?.id??null),Qe=o(()=>e(B)?.icon??null);uk(at,{agentId:"blank",variant:"emphasized",get specialist(){return e(Ge)},get icon(){return e(Qe)}})}y(Ne);var Xe=_(Ne,2),De=I(Xe),Re=de(De,!0),G=_(De,2),te=de(G,!0);y(Xe);var Fe=_(Xe,2),we=I(Fe);ct(we,{get icon(){return Na},size:10}),y(Fe),L(()=>{j(Re,e(Q)),j(te,e(pe))}),p(z,Ce)},$$slots:{default:!0}}))}},content:Y=>{var J=Fx(),$e=I(J),Oe=I($e),z=de(Oe,!0),Ie=_(Oe,2),Ce=de(Ie,!0);y($e);var Ne=_($e,2),at=I(Ne);{let Re=o(()=>e(B)?.id??null);X_(at,{get specialists(){return e(se)},get value(){return e(Re)},onchange:G=>{b(P,!1),w()?.(G)}})}y(Ne);var Xe=_(Ne,2),De=I(Xe);Et(De,()=>Br,(Re,G)=>{G(Re,{class:"flex h-auto w-full cursor-pointer items-center gap-3 whitespace-normal rounded-md px-3 py-2 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onSelect:()=>{b(P,!1),O()},children:(te,Fe)=>{var we=Ox(),Ge=ye(we),Qe=I(Ge);ct(Qe,{get icon(){return L$},size:12}),y(Ge);var dt=_(Ge,2),ft=de(dt,!0);L(lt=>j(ft,lt),[()=>u.chat_regularAgentWelcome_createSpecialist_label()]),p(te,we)},$$slots:{default:!0}})}),y(Xe),y(J),L((Re,G)=>{j(z,Re),j(Ce,G)},[()=>u.workspace_createAgentSection_specialists_label(),()=>u.workspace_createAgentSection_specialists_description()]),p(Y,J)},$$slots:{trigger:!0,content:!0}}),y(R),p(W,R)};N(He,W=>{w()&&W(ue)})}var oe=_(He,2);{var Te=W=>{var R=Wt(),re=ye(R);{let Me=o(()=>u.chat_specialistSelector_prompt_label());Et(re,()=>fk,(H,Y)=>{Y(H,{class:"mb-3",role:"region",get"aria-label"(){return e(Me)},children:(J,$e)=>{var Oe=Bx(),z=ye(Oe);Et(z,()=>iv,(Ce,Ne)=>{Ne(Ce,{children:(at,Xe)=>{var De=Wt(),Re=ye(De);Et(Re,()=>lv,(G,te)=>{te(G,{class:"type-caption font-medium",children:(Fe,we)=>{dn();var Ge=ln();L(Qe=>j(Ge,Qe),[()=>u.chat_specialistSelector_prompt_label()]),p(Fe,Ge)},$$slots:{default:!0}})}),p(at,De)},$$slots:{default:!0}})});var Ie=_(z,2);Et(Ie,()=>pk,(Ce,Ne)=>{Ne(Ce,{children:(at,Xe)=>{var De=Nx(),Re=ye(De),G=de(Re,!0),te=_(Re,2);bt(te,{type:"button",variant:"link",get"aria-expanded"(){return e(T)},onclick:()=>b(T,!e(T)),class:"text-xs text-muted-foreground hover:text-foreground transition-colors mt-2 cursor-pointer",children:(Fe,we)=>{dn();var Ge=ln();L(Qe=>j(Ge,Qe),[()=>e(T)?u.chat_regularAgentWelcome_showLess_label():u.chat_regularAgentWelcome_showMore_label()]),p(Fe,Ge)},$$slots:{default:!0}}),L(()=>{xe(Re,1,`text-sm text-subtle leading-relaxed whitespace-pre-wrap break-words ${e(T)?"":"line-clamp-6"}`),j(G,e(Ae))}),p(at,De)},$$slots:{default:!0}})}),p(J,Oe)},$$slots:{default:!0}})})}p(W,R)},le=W=>{var R=Wx(),re=de(R,!0);L(()=>j(re,e(Ae))),p(W,R)};N(oe,W=>{e(B)?W(Te):W(le,-1)})}var ee=_(oe,2);{var Se=W=>{bt(W,{variant:"ghost-light",size:"sm",onclick:()=>O(e(B).id),class:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors cursor-pointer pl-1.5 mr-auto",children:(R,re)=>{var Me=Ux(),H=ye(Me);ct(H,{get icon(){return q$},size:12,class:"opacity-60"});var Y=_(H,2),J=de(Y,!0);L($e=>j(J,$e),[()=>u.chat_regularAgentWelcome_customize_label()]),p(R,Me)},$$slots:{default:!0}})};N(ee,W=>{e(B)&&W(Se)})}y(fe),p(n,fe);var Ee=vn(he);return g(),Ee}var jx=E('<a class="cursor-pointer underline underline-offset-2 hover:opacity-80" data-suggested-prompt-link=""> </a>'),Gx=E('<kbd data-suggested-prompt-hint=""> </kbd>'),Vx=E('<span class="type-caption"> </span>'),Kx=E('<div role="presentation" data-typography-role="body" data-suggested-prompt-row=""><span data-suggested-prompt-icon=""><!></span> <span class="min-w-0 flex-1 text-pretty" data-suggested-prompt-label=""><span role="button" tabindex="0" class="focus-visible:outline-none" data-suggested-prompt-text=""> </span><!></span> <!> <!></div>'),Qx=E('<div class="flex flex-col" data-testid="suggested-prompts-surface"><!></div>');function Zd(n,r){if(new.target)return un({component:Zd,...n});fn(r,!0);let a=X(r,"prompts",7),i=X(r,"onSelect",7),c=X(r,"onEdit",7),l=X(r,"compact",7,!1),h=X(r,"showShortcutHints",7,!1),g=X(r,"reserveShortcutHintSpace",7,!1),w=X(r,"workspaceId",7);const C=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC")?"⌃":"Alt+",S=u$.replace("text-ui","type-caption");function q(x){i()(x)}function k(x,Q){x.key!=="Enter"&&x.key!==" "||(x.preventDefault(),q(Q))}function B(x,Q){x.preventDefault(),x.stopPropagation(),Ed(Q,{workspaceId:w(),event:x})}function O(x,Q){(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),x.stopPropagation(),Ed(Q,{workspaceId:w(),event:x}))}function T(x){return x<3}var F={get prompts(){return a()},set prompts(x){a(x),Z()},get onSelect(){return i()},set onSelect(x){i(x),Z()},get onEdit(){return c()},set onEdit(x){c(x),Z()},get compact(){return l()},set compact(x=!1){l(x),Z()},get showShortcutHints(){return h()},set showShortcutHints(x=!1){h(x),Z()},get reserveShortcutHintSpace(){return g()},set reserveShortcutHintSpace(x=!1){g(x),Z()},get workspaceId(){return w()},set workspaceId(x){w(x),Z()},$set:gn,$on:(x,Q)=>pn(r,x,Q)},K=Wt(),se=ye(K);{var P=x=>{var Q=Qx(),pe=I(Q);{const Ae=(fe,He)=>{let ue=()=>(He?.()).item,oe=()=>(He?.()).index;const Te=o(()=>ny(ue())),le=o(()=>e(Te)[0]?.type==="text"?e(Te)[0].content:"");var ee=Kx(),Se=I(ee),Ee=I(Se);ct(Ee,{get icon(){return Uf},size:16,get class(){return ur}}),y(Se);var W=_(Se,2),R=I(W),re=de(R,!0),Me=_(R);Dn(Me,17,()=>e(Te).slice(e(le)?1:0),Q_,(z,Ie)=>{var Ce=Wt(),Ne=ye(Ce);{var at=De=>{const Re=o(()=>ty(e(Ie).url));var G=jx(),te=de(G,!0);L(()=>{ze(G,"href",e(Re)),ze(G,"title",e(Re)),j(te,e(Ie).label)}),ps("click",G,Fe=>B(Fe,e(Re))),ps("keydown",G,Fe=>O(Fe,e(Re))),p(De,G)},Xe=De=>{var Re=ln();L(()=>j(Re,e(Ie).content)),p(De,Re)};N(Ne,De=>{e(Ie).type==="link"?De(at):De(Xe,-1)})}p(z,Ce)}),y(W);var H=_(W,2);{var Y=z=>{var Ie=Gx();let Ce;var Ne=de(Ie);L(()=>{Ce=xe(Ie,1,`${S??""} mt-px inline-flex h-5 items-center self-start border-0 bg-transparent p-0 font-sans font-normal text-muted-foreground! opacity-100`,null,Ce,{invisible:!h()}),ze(Ie,"aria-hidden",h()?void 0:"true"),ze(Ie,"data-hint-visible",h()),j(Ne,`${C}${oe()+1}`)}),p(z,Ie)},J=o(()=>T(oe())&&(h()||g()));N(H,z=>{e(J)&&z(Y)})}var $e=_(H,2);{var Oe=z=>{E$(z,{side:"top",delayDuration:300,trigger:Ne=>{{let at=o(()=>u.chat_suggestedPrompts_editInInput_ariaLabel());bt(Ne,{type:"button",variant:"ghost-light",size:"icon-xs",iconOnly:!0,class:"absolute right-0.5 top-[calc(var(--operational-leading-half-slot-size)+var(--space-1)*0.5+1px)] shrink-0 -translate-y-1/2 rounded opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100",onclick:Xe=>{Xe.stopPropagation(),c()(ue())},get"aria-label"(){return e(at)},children:(Xe,De)=>{ct(Xe,{get icon(){return H$},size:"xs"})},$$slots:{default:!0}})}},content:Ne=>{var at=Vx(),Xe=de(at,!0);L(De=>j(Xe,De),[()=>u.chat_suggestedPrompts_edit_tooltip()]),p(Ne,at)},$$slots:{trigger:!0,content:!0}})};N($e,z=>{c()&&z(Oe)})}y(ee),L(z=>{xe(ee,1,`${Bf} ${d$} group relative flex cursor-pointer items-center gap-[var(--operational-leading-gap)] rounded-sm border border-transparent bg-transparent px-1.5 py-0.5 text-left opacity-100 pr-9 transition-colors hover:text-foreground has-[[data-suggested-prompt-text]:focus-visible]:outline-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-offset-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-ring`),xe(Se,1,`${Bl??""} mt-px self-start`),ze(R,"aria-label",z),j(re,e(le))},[()=>ey(ue())]),ps("click",R,z=>{z.stopPropagation(),q(ue())}),ps("keydown",R,z=>k(z,ue())),p(fe,ee)};let he=o(()=>l()?"[&>div>div:last-child]:gap-0":"[&>div>div:last-child]:gap-0.5");R$(pe,{get items(){return a()},virtualize:!1,onActivate:q,get class(){return`overflow-visible! [&>div>div:last-child]:flex [&>div>div:last-child]:flex-col ${e(he)??""}`},"data-testid":"suggested-prompts-list",get"data-compact"(){return l()},row:Ae,$$slots:{row:!0}})}y(Q),Nt(1,Q,()=>ma,()=>({tier:"fast",y:0,scale:1})),Nt(2,Q,()=>to,()=>({tier:"fast"})),p(x,Q)};N(se,x=>{a().length>0&&x(P)})}return p(n,K),vn(F)}Wd(["click","keydown"]);var Jx=E('<section class="pb-6 pt-6"><p class="type-body mb-5 max-w-[36rem] px-1.5 text-pretty text-muted-foreground"> </p> <!></section>');function fv(n,r){if(new.target)return un({component:fv,...n});fn(r,!0);let a=X(r,"onSelect",7),i=X(r,"compact",7,!1);const c=o(()=>[{label:u.chat_chiefEmptyState_assignedPrs_label(),prompt:u.chat_chiefEmptyState_assignedPrs_prompt()},{label:u.chat_chiefEmptyState_staleWorkspaces_label(),prompt:u.chat_chiefEmptyState_staleWorkspaces_prompt()},{label:u.chat_chiefEmptyState_agentPerformance_label(),prompt:u.chat_chiefEmptyState_agentPerformance_prompt()},{label:u.chat_chiefEmptyState_morningBrief_label(),prompt:u.chat_chiefEmptyState_morningBrief_prompt()},{label:u.chat_chiefEmptyState_randomTheme_label(),prompt:u.chat_chiefEmptyState_randomTheme_prompt()}]),l=o(()=>e(c).map(q=>q.label));function h(q){const k=e(c).find(B=>B.label===q);k&&a()(k.prompt)}var g={get onSelect(){return a()},set onSelect(q){a(q),Z()},get compact(){return i()},set compact(q=!1){i(q),Z()},$set:gn,$on:(q,k)=>pn(r,q,k)},w=Jx(),f=I(w),C=de(f,!0),S=_(f,2);return Zd(S,{get prompts(){return e(l)},onSelect:h,get compact(){return i()}}),y(w),L(q=>j(C,q),[()=>u.chat_chiefEmptyState_intro_label()]),p(n,w),vn(g)}const eu=2e3,Yx=4e3,Xx=Yx-eu-2;function Zx(n,r=eu){const a=[];let i=0;for(let c=n.length-1;c>=0&&i<r;c-=1){const l=n[c];if(l.role!=="user"&&l.role!=="assistant")continue;const h=(l.contentBlocks??[]).filter(w=>w.type==="text").map(w=>w.text||w.content||"").join(""),g=(l.role==="assistant"?Z_(h).cleanedContent:h).trim();g&&(a.unshift({role:l.role,text:g}),i+=g.length)}return a}function e1(n,r){const a=n.map(l=>`${l.role==="user"?"User":"Assistant"}: ${l.text}`).join(`
|
|
2
2
|
|
|
3
3
|
`).slice(-eu),i=r.map(l=>l.trim()).filter(Boolean);if(i.length===0)return a;const c=`Suggested prompts:
|
|
4
4
|
${i.map(l=>`- ${l}`).join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a,aW as o}from"./
|
|
1
|
+
import{b as a,aW as o}from"./C89-HR3N.js";var g=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{K as jt}from"./
|
|
1
|
+
import{K as jt}from"./M1pm4Ylz.js";import{U as Ut}from"./COBU-CLw.js";import{bI as Mt,aD as s,aG as zt,bH as Ie,bV as Me,bs as dt,ca as _t,c0 as Ht,a5 as j,bS as u,bl as F,bA as U,b_ as v,bO as l,aw as Kt,W as n,bn as pt,c9 as y,aA as T,aB as N,b$ as L,bf as ee,a7 as V,ay as w,be as De,am as Fe,ax as Ee}from"./3SdAC2_C.js";import{t as vt,bo as O,bm as _,bw as ut,b as ct,bs as Ze,bq as qt}from"./C0QTy0Sy.js";import{i as I}from"./bhKPSdq4.js";import{s as je,f as Ue,g as Be}from"./7UPrdiE9.js";import{b as Yt}from"./Dn334wJv.js";import{A as Gt,c as $t}from"./Df8HaglQ.js";import{k as et}from"./-K3ARgq0.js";import{t as tt}from"./CrD0jtXE.js";import{n as se,b as at,j as ge}from"./DLwWVKiF.js";import{F as Vt,bo as Xt,aN as Jt,cK as Qt,cn as Zt}from"./U9jJmfYa.js";import{m as ea}from"./DlUZpQ7U.js";import{f as Le}from"./CttA-M7l.js";import"./C2jYl_tm.js";import{T as rt}from"./iDB1itc7.js";import"./ChTqQfQN.js";import"./DI_O2uCQ.js";import"./_LtUY0jS.js";import{q as ta,h as aa,S as ra}from"./Brm4kmEq.js";import{O as We}from"./DAreoJms.js";import{be as na,D as sa,q as oa}from"./BpfNraM2.js";import{d as ia}from"./PWCv1nwS.js";import{s as la,f as da,c as nt}from"./CCjzzCpy.js";function ar(M){let b=0,E=!1;function Q(x){E!==x&&(E=x,M.onDragChange(x))}function Z(){b=0,Q(!1)}function X(x){return M.isEnabled&&!M.isEnabled()?!1:jt(x)}return{handleDragEnter(x){X(x)&&(x.preventDefault(),b++,Q(!0))},handleDragLeave(x){X(x)&&(x.preventDefault(),b=Math.max(0,b-1),b===0&&Q(!1))},handleDragOver(x){X(x)&&x.preventDefault()},handleDrop(x){if(!X(x))return;x.preventDefault(),Z();const G=Ut(x.dataTransfer);(G.files.length>0||G.folderFiles.length>0)&&M.onDrop(G)},reset:Z}}const gt=Symbol("panel-file-drop-context");function rr(){let M=Me(null);const b={register(E){Ie(M,E)},unregister(E){s(M)===E&&Ie(M,null)}};return Mt(gt,b),{context:b,handler:{get current(){return s(M)}}}}function nr(){return zt(gt)??null}var _a=N('<p class="type-caption text-subtle"> </p>'),pa=N('<div class="space-y-1" data-remote-setup-log=""><!> <pre role="log" tabindex="0"> </pre></div>');function va(M,b){if(new.target)return vt({component:va,...M});dt(b,!0);let E=O(b,"machine",7),Q=O(b,"output",7),Z=O(b,"truncated",7,!1);const X=y(()=>Gt({chunks:[{text:Q()??"",timestamp:""}]}).join(`
|
|
2
2
|
`));let x=Me(null),G=!0;function $(){s(x)&&(G=s(x).scrollHeight-s(x).scrollTop-s(x).clientHeight<8)}_t(()=>{s(X),!(!s(x)||!G)&&Ht().then(()=>{s(x)&&(s(x).scrollTop=s(x).scrollHeight)})});var oe={get machine(){return E()},set machine(R){E(R),T()},get output(){return Q()},set output(R){Q(R),T()},get truncated(){return Z()},set truncated(R=!1){Z(R),T()},$set:ut,$on:(R,J)=>ct(b,R,J)},H=pa(),te=j(H);{var ae=R=>{var J=_a(),W=F(J,!0);v(re=>l(W,re),[()=>_.remoteAgent_setup_outputTruncated()]),n(R,J)};I(te,R=>{Z()&&R(ae)})}var q=u(te,2),pe=F(q,!0);return Yt(q,R=>Ie(x,R),()=>s(x)),U(H),v((R,J)=>{je(q,"aria-label",R),Ue(q,1,`max-h-60 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/60 px-3 py-2 font-mono text-xs ${s(X)?"text-foreground":"text-subtle"} focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`),l(pe,J)},[()=>_.remoteAgent_setup_outputLabel({machine:E()}),()=>s(X)||_.remoteAgent_setup_noOutput()]),Kt("scroll",q,$),n(M,H),pt(oe)}var ua=N('<span class="inline-flex items-center gap-1.5 svelte-enden2"> </span>'),ca=N('<h3 class="text-lg font-semibold tracking-[-0.016em] transition-colors duration-spring-slow ease-spring-slow motion-reduce:transition-none svelte-enden2"><!></h3>'),ga=N('<span class="inline-block col-span-1 row-span-1 svelte-enden2"> </span>'),fa=N('<span class="text-sm font-mono text-muted-foreground tabular-nums svelte-enden2"><span class="inline-grid *:[grid-area:1/1] svelte-enden2"><!></span> </span>'),ma=N('<div class="absolute inset-0 left-5 svelte-enden2"><!></div>'),st=N('<div class="svelte-enden2"><!></div>'),ba=N('<div class="relative flex items-start overflow-hidden rounded-md py-0.75 text-base leading-relaxed svelte-enden2"><!> <span data-testid="workspace-setup-step-icon"><!></span> <div class="setup-step-content min-w-0 text-muted-foreground font-normal leading-snug relative z-10 svelte-enden2" data-testid="workspace-setup-step-content"><!></div></div>'),xa=N('<div class="mt-1 text-xs tabular-nums svelte-enden2" data-testid="setup-card-progress-transfer"> </div>'),ha=N('<span data-testid="setup-card-progress-label" class="svelte-enden2"> </span> <div class="mt-1 h-[2px] w-full max-w-64 rounded-full bg-secondary overflow-hidden svelte-enden2"><div class="h-full bg-foreground/60 transition-[width] duration-spring-slow ease-spring-slow motion-reduce:transition-none svelte-enden2" role="progressbar" aria-valuemin="0" aria-valuemax="100" data-testid="setup-card-progress-bar"></div></div> <!>',1),fe=N(" <!>",1),Ca=N('<span data-testid="setup-card-plain-folder" class="svelte-enden2"> <!> </span>'),wa=N(' <code class="text-sm bg-secondary py-1 px-1.5 svelte-enden2"> </code> <!>',1),ot=N(" <!> <!>",1),Sa=N(' <span class="svelte-enden2"> </span> ',1),ya=N(' <span class="svelte-enden2"> </span> <!>',1),ka=N('<span class="underline underline-offset-2 svelte-enden2"> </span><span class="whitespace-nowrap svelte-enden2"><span class="underline underline-offset-2 svelte-enden2"> </span><span class="setup-reference-punctuation svelte-enden2" aria-hidden="true"> </span></span>',1),Pa=N("<!> ",1),it=N('<span class="svelte-enden2"> </span>'),_e=N(" <!> ",1),Da=N('<pre class="text-xs text-muted-foreground font-mono leading-snug line-clamp-2 whitespace-pre-wrap svelte-enden2"> </pre>'),lt=N('<span class="text-xs text-muted-foreground opacity-50 svelte-enden2"> </span>'),Ia=N(" <!> <!> ",1),Na=N('<p class="text-xs text-muted-foreground leading-snug svelte-enden2"> </p>'),Ta=N('<div><div class="flex items-baseline gap-2.5 pt-3 pb-2 svelte-enden2"><div class="inline-grid *:[grid-area:1/1] svelte-enden2"><!></div> <!></div> <div class="space-y-0.5 pb-4 svelte-enden2"><!> <!> <!> <!></div></div>');function Oa(M,b){if(new.target)return vt({component:Oa,...M});dt(b,!0);const E=()=>Ze(ft,"$progressEntry$",Z),Q=()=>Ze(mt,"$specialists$",Z),[Z,X]=qt();let x=O(b,"repoName",7),G=O(b,"repoPath",7),$=O(b,"worktreePath",7),oe=O(b,"workspaceId",7),H=O(b,"branch",7),te=O(b,"baseRef",7,"origin/main"),ae=O(b,"projectType",7),q=O(b,"setupScriptStatus",7),pe=O(b,"setupScriptContent",7),R=O(b,"onFocusSetupTerminal",7),J=O(b,"specialistName",7),W=O(b,"specialistId",7),re=O(b,"hasPrompt",7,!0),ve=O(b,"repoStatus",7,"pending"),me=O(b,"branchStatus",7,"pending"),be=O(b,"agentStatus",7,"pending"),ie=O(b,"skipIsolation",7,!1),ue=O(b,"plainFolder",7,!1),Ne=O(b,"progressId",7);const ft=la(Ne()??""),mt=na();let xe=Me(0);_t(()=>{const d=Math.min(E()?.percent??0,100);d>s(xe)&&Ie(xe,d,!0)});const bt=y(()=>E()?.sawFrame===!0),ze=y(()=>E()?.transfer?$t(E().transfer):null),xt=y(()=>te().replace(/^[^/]+\//,"")),Te=y(()=>W()?oa(W()):void 0),ht=y(()=>W()?Q().find(d=>d.id===W()):void 0),Ct=y(()=>s(ht)?.name||s(Te)?.name||J()),He=y(()=>W()==="spec-writer"||W()===sa),Ke=y(()=>{const d=ue()?[ve()]:[ve(),me()];return q()&&d.push(q()),d.push(be()),d}),Oe=y(()=>s(Ke).length),qe=y(()=>s(Ke).filter(d=>d==="done").length),Ye=y(()=>Math.min(s(qe)+1,s(Oe))),ye=y(()=>s(qe)===s(Oe)),Ge=y(()=>s(ye)?_.onboarding_setupCard_ready_title():_.onboarding_setupCard_settingUp_title());function wt(d,B){navigator.clipboard.writeText(d),ea.success(_.onboarding_setupCard_copied_label({label:B}))}function Ae(d){return d.replace(/^\/Users\/[^/]+/,"~")}function St(){W()&&ia({specialist:W(),hash:"specialists"})}var yt={get repoName(){return x()},set repoName(d){x(d),T()},get repoPath(){return G()},set repoPath(d){G(d),T()},get worktreePath(){return $()},set worktreePath(d){$(d),T()},get workspaceId(){return oe()},set workspaceId(d){oe(d),T()},get branch(){return H()},set branch(d){H(d),T()},get baseRef(){return te()},set baseRef(d="origin/main"){te(d),T()},get projectType(){return ae()},set projectType(d){ae(d),T()},get setupScriptStatus(){return q()},set setupScriptStatus(d){q(d),T()},get setupScriptContent(){return pe()},set setupScriptContent(d){pe(d),T()},get onFocusSetupTerminal(){return R()},set onFocusSetupTerminal(d){R(d),T()},get specialistName(){return J()},set specialistName(d){J(d),T()},get specialistId(){return W()},set specialistId(d){W(d),T()},get hasPrompt(){return re()},set hasPrompt(d=!0){re(d),T()},get repoStatus(){return ve()},set repoStatus(d="pending"){ve(d),T()},get branchStatus(){return me()},set branchStatus(d="pending"){me(d),T()},get agentStatus(){return be()},set agentStatus(d="pending"){be(d),T()},get skipIsolation(){return ie()},set skipIsolation(d=!1){ie(d),T()},get plainFolder(){return ue()},set plainFolder(d=!1){ue(d),T()},get progressId(){return Ne()},set progressId(d){Ne(d),T()},$set:ut,$on:(d,B)=>ct(b,d,B)},ke=Ta(),Pe=j(ke);Be(Pe,"",{},{"padding-inline":"var(--operational-row-inline-padding)"});var Re=j(Pe),kt=j(Re);et(kt,()=>s(ye),d=>{var B=ca(),le=j(B);{var he=Y=>{var z=ua(),we=F(z,!0);v(()=>l(we,s(Ge))),n(Y,z)},Ce=Y=>{var z=L();v(()=>l(z,s(Ge))),n(Y,z)};I(le,Y=>{s(ye)?Y(he):Y(Ce,-1)})}U(B),se(1,B,()=>at,()=>({tier:"slow",distance:3})),se(2,B,()=>at,()=>({tier:"slow",distance:3})),n(d,B)}),U(Re);var Pt=u(Re,2);{var Dt=d=>{var B=fa(),le=j(B),he=j(le);et(he,()=>s(Ye),Y=>{var z=ga(),we=F(z,!0);v(()=>l(we,s(Ye))),se(1,z,()=>ge,()=>({axis:"y",tier:"slow"})),n(Y,z)}),U(le);var Ce=u(le);U(B),v(()=>l(Ce,`/${s(Oe)??""}`)),n(d,B)};I(Pt,d=>{s(ye)||d(Dt)})}U(Pe);var $e=u(Pe,2);{const d=(f,h=ee,P=ee,D=ee,S=ee,C=ee)=>{var o=ba();Be(o,"",{},{gap:"0.25rem","padding-inline":"var(--operational-row-inline-padding)"});var t=j(o);{var e=m=>{var k=ma(),A=j(k);ra(A,{}),U(k),n(m,k)};I(t,m=>{h()==="active"&&m(e)})}var a=u(t,2),r=j(a);Vt(r,{get icon(){return P()},size:14,get class(){return D()}}),U(a);var i=u(a,2),c=j(i);{var g=m=>{var k=st(),A=j(k);tt(A,S),U(k),se(1,k,()=>ge,()=>({axis:"y",tier:"moderate"})),se(2,k,()=>ge,()=>({axis:"y",tier:"moderate"})),n(m,k)},p=m=>{var k=st(),A=j(k);tt(A,C),U(k),se(1,k,()=>ge,()=>({axis:"y",tier:"moderate"})),se(2,k,()=>ge,()=>({axis:"y",tier:"moderate"})),n(m,k)};I(c,m=>{h()==="active"?m(g):m(p,-1)})}U(i),U(o),v(()=>Ue(a,1,`${aa} relative z-10 mt-1 flex size-4 shrink-0 items-center justify-start`,"svelte-enden2")),se(3,o,()=>ge,()=>({tier:"slow"})),n(f,o)},B=(f,h)=>{let P=Fe(()=>Ee(h?.(),""));var D=V(),S=w(D);{var C=t=>{{let e=y(()=>_.onboarding_setupCard_originalFolder_label());z(t,x,()=>s(e),G,()=>s(P))}},o=t=>{var e=L();v(()=>l(e,`${x()??""}${s(P)??""}`)),n(t,e)};I(S,t=>{G()?t(C):t(o,-1)})}n(f,D)},le=f=>{var h=V(),P=w(h);{var D=o=>{var t=ha(),e=w(t),a=F(e,!0),r=u(e,2),i=F(r),c=u(r,2);{var g=p=>{var m=xa(),k=F(m,!0);v(()=>l(k,s(ze))),n(p,m)};I(c,p=>{s(ze)&&p(g)})}v((p,m)=>{l(a,p),Be(i,`width: ${s(xe)??""}%`),je(i,"aria-label",m),je(i,"aria-valuenow",s(xe))},[()=>_.workspace_compactInitializer_progressWithPercent_label({label:nt(E()),percent:da(s(xe))}),()=>nt(E())]),n(o,t)},S=o=>{var t=fe(),e=w(t),a=u(e);{let r=y(()=>_.onboarding_setupCard_opening_after());B(a,()=>s(r))}v(r=>l(e,`${r??""} `),[()=>_.onboarding_setupCard_opening_before()]),n(o,t)},C=o=>{var t=fe(),e=w(t),a=u(e);B(a),v(r=>l(e,`${r??""} `),[()=>_.onboarding_setupCard_creatingIsolatedCopy_before()]),n(o,t)};I(P,o=>{s(bt)&&E()?o(D):ie()||ue()?o(S,1):o(C,-1)})}n(f,h)},he=f=>{var h=V(),P=w(h);{var D=o=>{const t=y(()=>$()||G());var e=Ca(),a=j(e),r=u(a);{var i=p=>{We(p,{get filePath(){return s(t)},get workspaceId(){return oe()},isDirectory:!0,variant:"sidebar",compact:!0,inline:!0,class:"setup-path",children:(m,k)=>{{let A=y(()=>Ae(s(t)));Y(m,()=>s(A),()=>".")}},$$slots:{default:!0}})},c=p=>{var m=L();v(()=>l(m,`${x()??""}.`)),n(p,m)};I(r,p=>{s(t)?p(i):p(c,-1)})}var g=u(r);U(e),v((p,m)=>{l(a,`${p??""} `),l(g,` ${m??""}`)},[()=>_.onboarding_setupCard_workingInFolder_before(),()=>_.onboarding_setupCard_plainFolderInPlace_label()]),n(o,e)},S=o=>{var t=wa(),e=w(t),a=u(e),r=F(a,!0),i=u(a,2);{var c=p=>{var m=fe(),k=w(m),A=u(k);We(A,{get filePath(){return $()},get workspaceId(){return oe()},isDirectory:!0,variant:"sidebar",compact:!0,inline:!0,class:"setup-path",children:(K,de)=>{{let ne=y(()=>Ae($()));Y(K,()=>s(ne),()=>".")}},$$slots:{default:!0}}),v(K=>l(k,` ${K??""} `),[()=>_.onboarding_setupCard_at_label()]),n(p,m)},g=p=>{var m=L(".");n(p,m)};I(i,p=>{$()?p(c):p(g,-1)})}v(p=>{l(e,`${p??""} `),l(r,s(xt))},[()=>_.onboarding_setupCard_workingDirectlyOn_before()]),n(o,t)},C=o=>{var t=ot(),e=w(t),a=u(e);B(a);var r=u(a,2);{var i=g=>{var p=fe(),m=w(p),k=u(m);We(k,{get filePath(){return $()},get workspaceId(){return oe()},isDirectory:!0,variant:"sidebar",compact:!0,inline:!0,class:"setup-path",children:(A,K)=>{{let de=y(()=>Ae($()));Y(A,()=>s(de),()=>".")}},$$slots:{default:!0}}),v(A=>l(m,` ${A??""} `),[()=>_.onboarding_setupCard_at_label()]),n(g,p)},c=g=>{var p=L(".");n(g,p)};I(r,g=>{$()?g(i):g(c,-1)})}v(g=>l(e,`${g??""} `),[()=>_.onboarding_setupCard_createdIsolatedCopy_before()]),n(o,t)};I(P,o=>{ue()?o(D):ie()?o(S,1):o(C,-1)})}n(f,h)},Ce=f=>{var h=V(),P=w(h);{var D=o=>{var t=V(),e=w(t);{var a=i=>{var c=Sa(),g=w(c),p=u(g),m=F(p,!0),k=u(p,1,!0);v((A,K)=>{l(g,`${A??""} `),l(m,H()),l(k,K)},[()=>_.onboarding_setupCard_workingOnBranchNamed_before(),()=>_.onboarding_setupCard_workingOnBranchActive_after()]),n(i,c)},r=i=>{var c=L();v(g=>l(c,g),[()=>_.onboarding_setupCard_workingOnBranch_label()]),n(i,c)};I(e,i=>{H()?i(a):i(r,-1)})}n(o,t)},S=o=>{var t=ya(),e=w(t),a=u(e),r=F(a,!0),i=u(a),c=u(i);{let g=y(()=>_.onboarding_setupCard_baseRef_label()),p=y(()=>_.onboarding_setupCard_creatingBranch_after());z(c,te,()=>s(g),()=>{},()=>s(p))}v((g,p)=>{l(e,`${g??""} `),l(r,H()),l(i,` ${p??""} `)},[()=>_.onboarding_setupCard_creatingBranch_before(),()=>_.onboarding_setupCard_creatingBranch_middle()]),n(o,t)},C=o=>{var t=L();v(e=>l(t,e),[()=>_.onboarding_setupCard_creatingBranchNoName_label()]),n(o,t)};I(P,o=>{ie()?o(D):H()?o(S,1):o(C,-1)})}n(f,h)},Y=(f,h=ee,P)=>{let D=Fe(()=>Ee(P?.(),""));const S=y(()=>Array.from(h()));var C=ka(),o=w(C),t=F(o,!0),e=u(o),a=j(e),r=F(a,!0),i=u(a),c=F(i,!0);U(e),v((g,p)=>{l(t,g),l(r,p),l(c,s(D))},[()=>s(S).slice(0,-1).join(""),()=>s(S).at(-1)??""]),n(f,C)},z=(f,h=ee,P=ee,D=ee,S)=>{let C=Fe(()=>Ee(S?.(),""));const o=y(()=>s(C).match(/^\p{P}+/u)?.[0]??"");var t=Pa(),e=w(t);Le(e,{variant:"plain",wrapContent:!1,class:"setup-inline-link cursor-pointer hover:text-foreground transition-colors",onclick:()=>wt(D()??h(),P()),children:(r,i)=>{Y(r,h,()=>s(o))},$$slots:{default:!0}});var a=u(e,1,!0);v(r=>l(a,r),[()=>s(C).slice(s(o).length)]),n(f,t)},we=f=>{var h=V(),P=w(h);{var D=o=>{var t=V(),e=w(t);{var a=i=>{var c=fe(),g=w(c),p=u(g);{let m=y(()=>_.onboarding_setupCard_branchName_label()),k=y(()=>_.onboarding_setupCard_workingOnBranchDone_after());z(p,H,()=>s(m),()=>{},()=>s(k))}v(m=>l(g,`${m??""} `),[()=>_.onboarding_setupCard_workingOnBranchNamed_before()]),n(i,c)},r=i=>{var c=L();v(g=>l(c,g),[()=>_.onboarding_setupCard_workingDirectlyOnBranch_label()]),n(i,c)};I(e,i=>{H()?i(a):i(r,-1)})}n(o,t)},S=o=>{var t=ot(),e=w(t),a=u(e);{let i=y(()=>_.onboarding_setupCard_branchName_label()),c=y(()=>_.onboarding_setupCard_workingInNewBranch_middle());z(a,H,()=>s(i),()=>{},()=>s(c))}var r=u(a,2);{let i=y(()=>_.onboarding_setupCard_baseRef_label()),c=y(()=>_.onboarding_setupCard_workingInNewBranch_after());z(r,te,()=>s(i),()=>{},()=>s(c))}v(i=>l(e,`${i??""} `),[()=>_.onboarding_setupCard_workingInNewBranch_before()]),n(o,t)},C=o=>{var t=L();v(e=>l(t,e),[()=>_.onboarding_setupCard_branchCreated_label()]),n(o,t)};I(P,o=>{ie()?o(D):H()?o(S,1):o(C,-1)})}n(f,h)},Ft=f=>{De();var h=_e(),P=w(h),D=u(P);{var S=t=>{var e=it(),a=F(e,!0);v(()=>l(a,ae())),n(t,e)},C=t=>{var e=L();v(a=>l(e,a),[()=>_.onboarding_setupCard_project_label()]),n(t,e)};I(D,t=>{ae()?t(S):t(C,-1)})}var o=u(D);v((t,e)=>{l(P,`${t??""} `),l(o,` ${e??""}`)},[()=>_.onboarding_setupCard_runningSetup_before(),()=>_.onboarding_setupCard_runningSetup_after()]),n(f,h)},Et=f=>{De();var h=Ia(),P=w(h),D=u(P);{var S=r=>{var i=it(),c=F(i,!0);v(()=>l(c,ae())),n(r,i)},C=r=>{var i=L();v(c=>l(i,c),[()=>_.onboarding_setupCard_project_label()]),n(r,i)};I(D,r=>{ae()?r(S):r(C,-1)})}var o=u(D),t=u(o);{var e=r=>{var i=fe(),c=w(i),g=u(c);rt(g,{class:"inline",side:"bottom",align:"start",interactive:!0,maxWidth:"22rem",delayDuration:300,trigger:A=>{Le(A,{variant:"plain",wrapContent:!1,class:"setup-inline-link underline underline-offset-2 cursor-pointer hover:text-foreground transition-colors",get onclick(){return R()},children:(K,de)=>{De();var ne=L();v(Se=>l(ne,Se),[()=>_.onboarding_setupCard_terminalTab_label()]),n(K,ne)},$$slots:{default:!0}})},content:A=>{var K=V(),de=w(K);{var ne=Se=>{var Qe=Da(),Wt=F(Qe,!0);v(()=>l(Wt,pe())),n(Se,Qe)};I(de,Se=>{pe()&&Se(ne)})}n(A,K)},footer:A=>{var K=lt(),de=F(K,!0);v(ne=>l(de,ne),[()=>_.onboarding_setupCard_openTerminal_footer()]),n(A,K)},$$slots:{trigger:!0,content:!0,footer:!0}}),v(p=>l(c,` ${p??""} `),[()=>_.onboarding_setupCard_ranSetupIn_middle()]),n(r,i)};I(t,r=>{R()&&r(e)})}var a=u(t,1,!0);v((r,i,c)=>{l(P,`${r??""} `),l(o,` ${i??""}`),l(a,c)},[()=>_.onboarding_setupCard_ranSetup_before(),()=>_.onboarding_setupCard_ranSetup_middle(),()=>_.onboarding_setupCard_ranSetup_after()]),n(f,h)},ce=f=>{rt(f,{class:"inline",side:"bottom",align:"start",interactive:!0,maxWidth:"22rem",delayDuration:300,trigger:S=>{Le(S,{variant:"plain",wrapContent:!1,class:"setup-inline-link underline underline-offset-2 cursor-pointer hover:text-foreground transition-colors",onclick:St,children:(C,o)=>{De();var t=L();v(()=>l(t,s(Ct))),n(C,t)},$$slots:{default:!0}})},content:S=>{var C=V(),o=w(C);{var t=e=>{var a=Na(),r=F(a,!0);v(()=>l(r,s(Te).description)),n(e,a)};I(o,e=>{s(Te)&&e(t)})}n(S,C)},footer:S=>{var C=lt(),o=F(C,!0);v(t=>l(o,t),[()=>_.onboarding_setupCard_editInSettings_footer()]),n(S,C)},$$slots:{trigger:!0,content:!0,footer:!0}})},Bt=f=>{var h=V(),P=w(h);{var D=e=>{var a=_e(),r=w(a),i=u(r);ce(i);var c=u(i);v((g,p)=>{l(r,`${g??""} `),l(c,` ${p??""}`)},[()=>_.onboarding_setupCard_agentReadyNamed_before(),()=>_.onboarding_setupCard_agentReadyNamed_after()]),n(e,a)},S=e=>{var a=L();v(r=>l(a,r),[()=>_.onboarding_setupCard_agentReady_label()]),n(e,a)},C=e=>{var a=_e(),r=w(a),i=u(r);ce(i);var c=u(i);v((g,p)=>{l(r,`${g??""} `),l(c,` ${p??""}`)},[()=>_.onboarding_setupCard_specStartingUp_before(),()=>_.onboarding_setupCard_specStartingUp_after()]),n(e,a)},o=e=>{var a=_e(),r=w(a),i=u(r);ce(i);var c=u(i);v((g,p)=>{l(r,`${g??""} `),l(c,` ${p??""}`)},[()=>_.onboarding_setupCard_startingUpNamed_before(),()=>_.onboarding_setupCard_startingUpNamed_after()]),n(e,a)},t=e=>{var a=L();v(r=>l(a,r),[()=>_.onboarding_setupCard_startingUp_label()]),n(e,a)};I(P,e=>{!re()&&W()?e(D):re()?s(He)?e(C,2):W()?e(o,3):e(t,-1):e(S,1)})}n(f,h)},Lt=f=>{var h=V(),P=w(h);{var D=e=>{var a=_e(),r=w(a),i=u(r);ce(i);var c=u(i);v((g,p)=>{l(r,`${g??""} `),l(c,` ${p??""}`)},[()=>_.onboarding_setupCard_agentReadyNamed_before(),()=>_.onboarding_setupCard_agentReadyNamed_after()]),n(e,a)},S=e=>{var a=L();v(r=>l(a,r),[()=>_.onboarding_setupCard_agentReady_label()]),n(e,a)},C=e=>{var a=_e(),r=w(a),i=u(r);ce(i);var c=u(i);v((g,p)=>{l(r,`${g??""} `),l(c,` ${p??""}`)},[()=>_.onboarding_setupCard_specDone_before(),()=>_.onboarding_setupCard_specDone_after()]),n(e,a)},o=e=>{var a=_e(),r=w(a),i=u(r);ce(i);var c=u(i);v((g,p)=>{l(r,`${g??""} `),l(c,` ${p??""}`)},[()=>_.onboarding_setupCard_agentDoneNamed_before(),()=>_.onboarding_setupCard_agentDoneNamed_after()]),n(e,a)},t=e=>{var a=L();v(r=>l(a,r),[()=>_.onboarding_setupCard_agentOrienting_label()]),n(e,a)};I(P,e=>{!re()&&W()?e(D):re()?s(He)?e(C,2):W()?e(o,3):e(t,-1):e(S,1)})}n(f,h)};var Ve=j($e);{var It=f=>{d(f,ve,()=>Xt,()=>"-ml-px transform scale-[0.98]",()=>le,()=>he)};I(Ve,f=>{ve()!=="pending"&&f(It)})}var Xe=u(Ve,2);{var Nt=f=>{d(f,me,()=>Jt,()=>"",()=>Ce,()=>we)};I(Xe,f=>{me()!=="pending"&&!ie()&&!ue()&&f(Nt)})}var Je=u(Xe,2);{var Tt=f=>{d(f,q,()=>Qt,()=>"ml-[0.5px]",()=>Ft,()=>Et)};I(Je,f=>{q()&&q()!=="pending"&&f(Tt)})}var Ot=u(Je,2);{var At=f=>{d(f,be,()=>Zt,()=>"ml-[-0.5px]",()=>Bt,()=>Lt)};I(Ot,f=>{be()!=="pending"&&f(At)})}U($e)}U(ke),v(()=>Ue(ke,1,`${ta} w-full overflow-hidden transition-all duration-spring-slow ease-spring-slow motion-reduce:transition-none`,"svelte-enden2")),n(M,ke);var Rt=pt(yt);return X(),Rt}export{va as R,Oa as W,rr as a,ar as c,nr as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/BPjvgJzJ.js","/app/immutable/chunks/_LtUY0jS.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/DX-Wrapd.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CrD0jtXE.js","/app/immutable/chunks/C0QTy0Sy.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/BsOWc0fD.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as Yt,bo as J,bw as te,bs as M,bq as ee,b as re,bm as n,_ as se}from"./C0QTy0Sy.js";import{bo as ae,bs as ne,ca as C,bH as N,c5 as yt,aD as F,bj as ie,a5 as O,bS as p,bA as D,b_ as x,W as f,bn as oe,cd as lt,bV as kt,c9 as Z,aA as G,bl as R,bO as h,ay as wt,aB as y}from"./3SdAC2_C.js";import{i as I}from"./bhKPSdq4.js";import{f as St,g as le,s as ce}from"./7UPrdiE9.js";import{b as ue}from"./Dn334wJv.js";import{b as de}from"./D3yXvqwY.js";import{Jv as m,D1 as pe,CT as me,CS as fe,Jp as _e,CE as ve,iz as be,iZ as ge}from"./_LtUY0jS.js";import{d as xe,T as he,D as ye,L as ke,o as we}from"./DkDSK_05.js";import{F as ct,d3 as Se,cb as $e,c$ as Ae}from"./U9jJmfYa.js";import{f as $t}from"./CttA-M7l.js";import{m as rt}from"./DlUZpQ7U.js";import"./C2jYl_tm.js";import"./CrD0jtXE.js";import"./ChTqQfQN.js";import"./DI_O2uCQ.js";import{r as Ce}from"./C1JG3JxG.js";import{selectScriptById as ut,selectScriptRuntime as Fe,selectScriptOutput as At,selectScriptRetainedOutput as Oe,selectCanDeleteScript as Ct}from"./
|
|
2
|
+
import{t as Yt,bo as J,bw as te,bs as M,bq as ee,b as re,bm as n,_ as se}from"./C0QTy0Sy.js";import{bo as ae,bs as ne,ca as C,bH as N,c5 as yt,aD as F,bj as ie,a5 as O,bS as p,bA as D,b_ as x,W as f,bn as oe,cd as lt,bV as kt,c9 as Z,aA as G,bl as R,bO as h,ay as wt,aB as y}from"./3SdAC2_C.js";import{i as I}from"./bhKPSdq4.js";import{f as St,g as le,s as ce}from"./7UPrdiE9.js";import{b as ue}from"./Dn334wJv.js";import{b as de}from"./D3yXvqwY.js";import{Jv as m,D1 as pe,CT as me,CS as fe,Jp as _e,CE as ve,iz as be,iZ as ge}from"./_LtUY0jS.js";import{d as xe,T as he,D as ye,L as ke,o as we}from"./DkDSK_05.js";import{F as ct,d3 as Se,cb as $e,c$ as Ae}from"./U9jJmfYa.js";import{f as $t}from"./CttA-M7l.js";import{m as rt}from"./DlUZpQ7U.js";import"./C2jYl_tm.js";import"./CrD0jtXE.js";import"./ChTqQfQN.js";import"./DI_O2uCQ.js";import{r as Ce}from"./C1JG3JxG.js";import{selectScriptById as ut,selectScriptRuntime as Fe,selectScriptOutput as At,selectScriptRetainedOutput as Oe,selectCanDeleteScript as Ct}from"./ijAQGDk2.js";import{g as De}from"./B9ZFoPLo.js";import{c4 as Re,d$ as Ie,dC as Ft}from"./Cppy6ZYG.js";import"./A9niI_uA.js";import"./CJ4Z96pe.js";import"./lJeex2Gh.js";import{e as Le}from"./90dwRRI_.js";import{v as Ot}from"./BpfNraM2.js";var Dt=y("<!> ",1),Te=y('<div class="bg-danger-background/20 border-y border-danger/20 px-3 py-1.5 flex items-center justify-between"><div class="flex items-center gap-2 text-sm text-danger font-medium"><div class="w-4 h-4 rounded-full bg-danger-background flex items-center justify-center"><!></div> <span> </span></div> <!></div>'),Ee=y('<pre class="retained-text px-3 pb-3 text-xs svelte-115p4sl"> </pre>'),qe=y('<p class="px-3 pb-3 text-xs text-muted-foreground" role="status"> </p>'),Be=y('<details class="retained-output border-b border-border svelte-115p4sl"><summary class="cursor-pointer px-3 py-2 text-xs text-muted-foreground"> </summary> <p class="px-3 pb-2 text-xs text-muted-foreground"> </p> <!></details>'),Pe=y('<div class="px-3 py-1 text-xs text-muted-foreground"> </div>'),ze=y('<code class="text-muted-foreground font-mono text-xs"> </code>'),Me=y('<span class="sr-only"> </span>'),We=y('<div class="flex-1 flex items-center justify-center px-4 py-8"><div class="flex items-center gap-3 text-sm"><span class="text-subtle font-mono">$</span> <!> <!> <!></div></div>'),je=y('<div><!> <!> <!> <!> <div><div class="xterm-output svelte-115p4sl"></div></div></div>');function Ue(_,c){const j=ae();if(new.target)return Yt({component:Ue,..._});ne(c,!0);const L=()=>M(zt,"$outputAuthority",T),u=()=>M(Tt,"$runtime$",T),v=()=>M(Et,"$output$",T),S=()=>M(Pt,"$codeFontFamilyCSS",T),W=()=>M(qt,"$retainedOutput$",T),Rt=()=>M(Bt,"$hidesAgentLifecycleActions$",T),dt=()=>M(Lt,"$script$",T),[T,It]=ee();let $=J(c,"scriptId",7),b=J(c,"workspaceId",7),st=J(c,"class",7,""),at=J(c,"runDisabled",7,!1),E=J(c,"runDisabledReason",7,null);const pt=Z(()=>at()||E()!==null),q=lt(""),U=lt(""),mt=lt("");let nt=kt(!1);C(()=>q.set(b())),C(()=>U.set($()));let B,i=null,H=null,Q=null,V=null,P=null,X=null;const Lt=ut(q,U),Tt=Fe(q,U),Et=At(q,U),qt=Oe(q,U,mt),Bt=Re(q),Pt=De(),zt=Ie(q),ft=crypto.randomUUID();C(()=>{const t=b();return $(),()=>{t&&m.dispatch(pe(t,ft))}}),C(()=>{const t=b(),e=$(),a=L(),s=u();if(!a||!t||!e)return;s.status,s.startedAt;const l=crypto.randomUUID();return mt.set(l),N(nt,yt(()=>v().chunks.length===0),!0),m.dispatch(me(t,e,l)),()=>m.dispatch(fe(t,e,l))});let Y=kt(0);const Mt=Z(()=>u().status==="exited"&&u().exitCode!=null&&u().exitCode!==0&&u().exitCode<128);function Wt(){if(!B||i)return;V=new he(B);const t=V.getCurrentTheme();i=new ye({allowProposedApi:!0,fontFamily:S(),fontSize:13,lineHeight:1.2,letterSpacing:0,cursorBlink:!1,cursorStyle:"underline",cursorWidth:1,scrollback:1e4,allowTransparency:!0,convertEol:!0,disableStdin:!0,drawBoldTextInBrightColors:!0,theme:t}),i.attachCustomKeyEventHandler(a=>{const s=a.metaKey||a.ctrlKey;return!(s&&a.key==="`"||s&&a.key==="j"||s&&a.key==="k")}),H=new we,i.loadAddon(H);const e=new ke((a,s)=>{try{const l=new URL(s);l.hostname==="localhost"||l.hostname==="127.0.0.1"?Ce(s).then(g=>{se(async()=>{const{getPanelLayoutManager:k}=await import("./BPjvgJzJ.js").then(A=>A.p);return{getPanelLayoutManager:k}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url).then(({getPanelLayoutManager:k})=>{k(b()).openBrowserPanel(g.url,void 0,void 0,g.requestedUrl)}).catch(()=>{window.open(g.url,"_blank")})}):window.open(s,"_blank")}catch{window.open(s,"_blank")}});i.loadAddon(e),i.open(B),V.applyTheme(i),X=requestAnimationFrame(()=>{X=null,H?.fit()}),Q=new ResizeObserver(()=>{H?.fit()}),Q.observe(B),jt()}function jt(){if(!i)return;const t=At.select(m.state,b(),$());t.chunks.length>0&&i.write(t.chunks.map(e=>e.text).join("")),N(Y,t.dropped+t.chunks.length)}function _t(){P!==null&&(cancelAnimationFrame(P),P=null),X!==null&&(cancelAnimationFrame(X),X=null),Q?.disconnect(),Q=null,V?.dispose(),V=null;const t=i;i=null,H=null,N(Y,0),t&&xe(t)}C(()=>{const t=v(),e=yt(()=>F(Y)),a=t.dropped+t.chunks.length;if(!i||a<=e)return;const s=Math.max(e-t.dropped,0);i.write(t.chunks.slice(s).map(l=>l.text).join("")),N(Y,a)}),C(()=>{const t=S();i&&i.options.fontFamily!==t&&(i.options.fontFamily=t)});function Ut(){F(pt)||m.dispatch(_e(b(),$()))}function Ht(){if(!b()){rt.error(n.terminal_scriptOutput_noWorkspace_error());return}m.dispatch(be(b(),$(),W()?.text,ft))}C(()=>{u().status==="idle"&&v().chunks.length===0&&_t()}),C(()=>{!(u().status==="idle"&&v().chunks.length===0)&&B&&!i&&(P!==null&&cancelAnimationFrame(P),P=requestAnimationFrame(()=>{P=null,Wt()}))}),ie(()=>{_t()});var Vt={get scriptId(){return $()},set scriptId(t){$(t),G()},get workspaceId(){return b()},set workspaceId(t){b(t),G()},get class(){return st()},set class(t=""){st(t),G()},get runDisabled(){return at()},set runDisabled(t=!1){at(t),G()},get runDisabledReason(){return E()},set runDisabledReason(t=null){E(t),G()},$set:te,$on:(t,e)=>re(c,t,e)},tt=je(),vt=O(tt);{var Xt=t=>{var e=Te(),a=O(e),s=O(a),l=O(s);ct(l,{get icon(){return Se},size:"xs"}),D(s);var g=p(s,2),k=R(g,!0);D(a);var A=p(a,2);{var d=r=>{$t(r,{variant:"outline",size:"sm",class:"h-7 text-xs bg-background border border-border text-danger",onclick:Ht,children:(o,w)=>{var z=Dt(),K=wt(z);ct(K,{get icon(){return Ae},size:"sm",class:"mr-1.5"});var et=p(K);x(ot=>h(et,` ${ot??""}`),[()=>n.terminal_scriptOutput_askAiToFix_label()]),f(o,z)},$$slots:{default:!0}})};I(A,r=>{Rt()||r(d)})}D(e),x(r=>h(k,r),[()=>n.terminal_scriptOutput_buildFailed_label({exitCode:u().exitCode??0})]),f(t,e)};I(vt,t=>{F(Mt)&&t(Xt)})}var bt=p(vt,2);{var Kt=t=>{var e=Be(),a=O(e),s=R(a,!0),l=p(a,2),g=R(l,!0),k=p(l,2);{var A=r=>{var o=Ee();let w;var z=R(o,!0);x(()=>{w=le(o,"",w,{"font-family":S()}),h(z,W().text)}),f(r,o)},d=r=>{var o=qe(),w=R(o,!0);x(z=>h(w,z),[()=>W().status==="loading"?n.terminal_scriptOutput_retainedLoading_label():n.terminal_scriptOutput_retainedUnavailable_label()]),f(r,o)};I(k,r=>{W().status==="available"?r(A):r(d,-1)})}D(e),x((r,o)=>{h(s,r),h(g,o)},[()=>n.terminal_scriptOutput_retained_label(),()=>n.terminal_scriptOutput_retained_description()]),de("open","toggle",e,r=>N(nt,r),()=>F(nt)),f(t,e)};I(bt,t=>{W()&&t(Kt)})}var gt=p(bt,2);{var Jt=t=>{var e=Pe(),a=R(e,!0);x(s=>h(a,s),[()=>n.terminal_scriptOutput_live_label()]),f(t,e)};I(gt,t=>{v().chunks.length>0&&W()&&t(Jt)})}var xt=p(gt,2);{var Nt=t=>{var e=We(),a=O(e),s=p(O(a),2);{var l=d=>{var r=ze(),o=R(r,!0);x(w=>h(o,w),[()=>ve(dt())]),f(d,r)};I(s,d=>{dt()&&d(l)})}var g=p(s,2);{let d=Z(()=>E()??void 0),r=Z(()=>n.terminal_scriptOutput_run_label()),o=Z(()=>E()?j:void 0);$t(g,{variant:"ghost",size:"xs",get disabled(){return F(pt)},get tooltip(){return F(d)},get"aria-label"(){return F(r)},get"aria-describedby"(){return F(o)},onclick:Ut,class:"text-muted-foreground hover:text-foreground",children:(w,z)=>{var K=Dt(),et=wt(K);ct(et,{get icon(){return $e},class:"h-3 w-3 mr-1"});var ot=p(et);x(Qt=>h(ot,` ${Qt??""}`),[()=>n.terminal_scriptOutput_run_label()]),f(w,K)},$$slots:{default:!0}})}var k=p(g,2);{var A=d=>{var r=Me(),o=R(r,!0);x(()=>{ce(r,"id",j),h(o,E())}),f(d,r)};I(k,d=>{E()&&d(A)})}D(a),D(e),f(t,e)};I(xt,t=>{u().status==="idle"&&v().chunks.length===0&&t(Nt)})}var it=p(xt,2);let ht;var Zt=O(it);ue(Zt,t=>B=t,()=>B),D(it),D(tt),x(()=>{St(tt,1,`script-output-viewer ${st()??""}`,"svelte-115p4sl"),ht=St(it,1,"flex-1 relative overflow-hidden",null,ht,{hidden:u().status==="idle"&&v().chunks.length===0})}),f(_,tt);var Gt=oe(Vt);return It(),Gt}async function fr(_,c,j){const L=ut.select(m.state,_,c);if(!L||!j()||!Ct.select(m.state,_,c))return;const u=Ot(L.runtime?.status),v=Ft.select(m.state,_);if(!v){rt.error(n.workspace_client_accessChanged_error());return}if(!await Le({title:n.scripts_delete_title({name:L.name}),description:u?n.scripts_delete_running_description():n.scripts_delete_description(),confirmLabel:n.scripts_delete_label(),destructive:!0}))return;if(v!==Ft.select(m.state,_)){rt.error(n.workspace_client_accessChanged_error());return}const S=ut.select(m.state,_,c);if(!j()||!S||S.createdAt!==L.createdAt||S.name!==L.name||!u&&Ot(S.runtime?.status)||!Ct.select(m.state,_,c)){rt.error(n.scripts_delete_changed_error());return}m.dispatch(ge(_,c,n.terminal_quakeOverlay_deleteScriptFailed_error()))}export{Ue as S,fr as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var Vt=Object.defineProperty;var yt=e=>{throw TypeError(e)};var jt=(e,i,s)=>i in e?Vt(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s;var J=(e,i,s)=>jt(e,typeof i!="symbol"?i+"":i,s),bt=(e,i,s)=>i.has(e)||yt("Cannot "+s);var t=(e,i,s)=>(bt(e,i,"read from private field"),s?s.call(e):i.get(e)),g=(e,i,s)=>i.has(e)?yt("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,s),a=(e,i,s,n)=>(bt(e,i,"write to private field"),n?n.call(e,s):i.set(e,s),s),o=(e,i,s)=>(bt(e,i,"access private method"),s);var vt=(e,i,s,n)=>({set _(r){a(e,i,r,s)},get _(){return t(e,i,n)}});import{_ as wt}from"./C0QTy0Sy.js";import{m as xt,A as qt,r as Ht,Q as Nt,aX as Gt,R as Jt}from"./C1dPOfxb.js";import{B as Ft,D as Kt}from"./DaLNZosE.js";import{I as F,E as Ct,b as Qt,a as Ut}from"./DICr2Lvd.js";function Xt(e,i){for(const s of Array.isArray(e)?e:[e]){let n=xt.get(s.name);n==null&&(n=s,xt.set(s.name,n)),i.attachLanguages([n]),qt.add(n.name)}}function Zt(e,i){let s;return function(...n){clearTimeout(s),s=setTimeout(()=>e.apply(this,n),i)}}const Dt=0;let Wt=0;var H,T,P,Q,L,st,it,C,U,nt,u,D,_,A,O,b,v,z,dt,E,B,X,N,R,Z,Tt,ft,h,K,ut,zt,Et,Y,pt,It,ct,tt,Ot,gt,et,Bt,Pt,At,Yt=(At=class{constructor(e,i,s){g(this,h);J(this,"backend");g(this,H);g(this,T);g(this,P);g(this,Q);g(this,L);g(this,st);g(this,it);g(this,C);g(this,U);g(this,nt,!1);g(this,u,[F]);g(this,D,[]);g(this,_,0);g(this,A,[]);g(this,O,-1);g(this,b,!0);g(this,v,!1);g(this,z,0);g(this,dt,++Wt);g(this,E,-1);g(this,B,-1);g(this,X);g(this,N,0);g(this,R,[]);g(this,Z,!1);g(this,Tt,Zt(async e=>{if(t(this,nt))return;const{startingLine:i=0,totalLines:s=1/0}=e??{},n=Math.min(s===1/0?1/0:i+s,t(this,L).lineCount);if(t(this,T)==null&&!Lt(t(this,L).languageId)){if(await this.backend?.loadLanguages([t(this,L).languageId]),t(this,nt))return;a(this,T,t(this,H).getLanguage(t(this,L).languageId))}o(this,h,K).call(this),o(this,h,It).call(this,n)},500));g(this,ft,({data:e})=>{if(typeof e!="object"||e===null)return;const{type:i,tokenizerId:s,jobId:n}=e;i==="tokenize"&&s===t(this,dt)&&typeof n=="number"&&n===t(this,z)&&(t(this,E)>=0?o(this,h,Bt).call(this,n):o(this,h,Pt).call(this,n))});this.backend=s,a(this,H,e),a(this,L,i.textDocument),a(this,P,i.theme),a(this,Q,[]),a(this,st,i.tokenizeMaxLineLength??1e3),a(this,it,i.onDeferTokenize),a(this,C,i.matchBrackets!==!1),a(this,U,i.__debug??!1),o(this,h,ut).call(this),o(this,h,K).call(this)}getStringCommentRegexpRangesInLine(e){if(!t(this,C)||e<0||e>=t(this,L).lineCount||(o(this,h,ut).call(this),t(this,T)==null))return null;if(t(this,R)[e]===void 0){o(this,h,et).call(this,e);const i=t(this,u)[e]??F,s=o(this,h,ct).call(this,e,i);t(this,u)[e+1]=s.state}return t(this,R)[e]??null}setTheme(e){t(this,P)!==e&&(a(this,P,e),o(this,h,K).call(this),this.stopBackgroundTokenize(),a(this,u,[F]),a(this,D,[]),a(this,_,0),a(this,A,[]),t(this,T)!=null&&t(this,L).lineCount>0&&o(this,h,pt).call(this,0))}dispose(){a(this,nt,!0),this.stopBackgroundTokenize(),o(this,h,Et).call(this)}tokenize(e,i,s=!1){if(o(this,h,ut).call(this),o(this,h,K).call(this),t(this,T)==null&&!Lt(t(this,L).languageId))throw new Error(`Grammar for language "${t(this,L).languageId}" not loaded`);const{lineCount:n}=t(this,L),{startingLine:r=0,totalLines:l=1/0}=i??{},d=l===1/0?n:Math.min(r+l,n),c=e.startLine,f=Math.max(r,c),I=i!=null&&l!==1/0&&e.lineDelta>0&&c<d&&e.endLine>=d,m=e.lineDelta===0&&(e.changedLineChanges?.every(([,,p])=>p===0)??!0);t(this,C)&&!m&&(t(this,R).length=Math.min(t(this,R).length,e.startLine));const M=s&&e.lineDelta!==0&&c>=r,S=m||i==null||c>=f,y=e.changedLineRanges??[[c,e.endLine]];a(this,D,[]),a(this,_,0),a(this,A,[]);let V=-1;if(c<f)for(const[p,w]of y)p<f&&(V=Math.max(V,Math.min(w,f-1)));const mt=V>=c&&(m||e.lineDelta<0);m?o(this,h,et).call(this,c):(o(this,h,Ot).call(this,e),(i==null||c>=f)&&o(this,h,et).call(this,f));let j=0,St=y[j][1],ht,Rt=0,k=m?y[j][0]:f,rt=!1;const Mt=new Map,W=mt?new Map:void 0;if(W!=null&&!m){const p=Math.min(V+1,f,d);if(p>c){o(this,h,et).call(this,p);let w=c,ot=t(this,u)[w]??F;for(;w<p;w++){const x=o(this,h,ct).call(this,w,ot);ot=x.state,W.set(w,x.resolvedTokens)}t(this,u)[p]=ot}}let q=t(this,u)[k]??F;for(;k<d;){const p=m?t(this,u)[k+1]:M?o(this,h,gt).call(this,k+1):void 0;S&&(t(this,u)[k]=q);const{resolvedTokens:w,state:ot}=o(this,h,ct).call(this,k,q);if(q=ot,k>=f?Mt.set(k,w):W?.set(k,w),S&&(t(this,u)[k+1]=q),rt=k>=St&&(m||M)&&p!=null&&q.equals(p),rt){j++;const x=y[j];if(x==null)break;if(x[0]>=d){ht=x[0],Rt=j;break}let lt=t(this,u)[x[0]];if(M)for(let kt=k+2;kt<=x[0]&&(lt=o(this,h,gt).call(this,kt),lt!=null);kt++)t(this,u)[kt]=lt;lt==null?(St=x[1],k++):(k=x[0],q=lt,St=x[1]),rt=!1;continue}k++}if(S&&(k<d?t(this,u)[k+1]=q:t(this,u)[k]=q),rt&&M&&ht==null){for(let p=k+2;p<=n;p++){const w=o(this,h,gt).call(this,p);if(w==null)break;t(this,u)[p]=w}a(this,D,[]),a(this,_,0),a(this,A,[])}if(W!=null&&W.size>0&&t(this,it).call(this,W),ht!=null)t(this,C)&&m&&(t(this,R).length=Math.min(t(this,R).length,ht)),o(this,h,pt).call(this,ht,y,Rt);else if(!rt&&k<n){const p=I&&c>=f?d:c<f&&!m?c:k;t(this,C)&&m&&(t(this,R).length=Math.min(t(this,R).length,p)),o(this,h,pt).call(this,p,y,j)}return Mt}prebuildStateStack(e){o(this,h,ut).call(this),t(this,Tt).call(this,e)}stopBackgroundTokenize(){a(this,B,-1),!t(this,b)&&(a(this,b,!0),a(this,v,!1),a(this,O,-1),a(this,E,-1),a(this,X,void 0),a(this,N,0),a(this,D,[]),a(this,_,0),a(this,A,[]),o(this,h,Et).call(this))}pauseBackgroundTokenize(){t(this,b)||t(this,v)||(t(this,U)&&console.log("[diffs/editor] background tokenization paused",{jobId:t(this,z)}),a(this,v,!0))}resumeBackgroundTokenize(){t(this,b)||!t(this,v)||t(this,T)==null||t(this,O)<0||(t(this,U)&&console.log("[diffs/editor] background tokenization resumed",{jobId:t(this,z)}),a(this,v,!1),o(this,h,Y).call(this,t(this,z)))}},H=new WeakMap,T=new WeakMap,P=new WeakMap,Q=new WeakMap,L=new WeakMap,st=new WeakMap,it=new WeakMap,C=new WeakMap,U=new WeakMap,nt=new WeakMap,u=new WeakMap,D=new WeakMap,_=new WeakMap,A=new WeakMap,O=new WeakMap,b=new WeakMap,v=new WeakMap,z=new WeakMap,dt=new WeakMap,E=new WeakMap,B=new WeakMap,X=new WeakMap,N=new WeakMap,R=new WeakMap,Z=new WeakMap,Tt=new WeakMap,ft=new WeakMap,h=new WeakSet,K=function(){if(t(this,P)==="")return;this.backend?.getTheme(t(this,P));const{colorMap:e}=t(this,H).setTheme(t(this,P));a(this,Q,e)},ut=function(){t(this,T)==null&&!Lt(t(this,L).languageId)&&t(this,H).getLoadedLanguages().includes(t(this,L).languageId)&&a(this,T,t(this,H).getLanguage(t(this,L).languageId))},zt=function(){t(this,Z)||(globalThis.addEventListener("message",t(this,ft)),a(this,Z,!0))},Et=function(){t(this,Z)&&(globalThis.removeEventListener("message",t(this,ft)),a(this,Z,!1))},Y=function(e){globalThis.postMessage({type:"tokenize",tokenizerId:t(this,dt),jobId:e})},pt=function(e,i,s=0){if(Lt(t(this,L).languageId))return;const n=++vt(this,z)._;t(this,U)&&console.log("[diffs/editor] background tokenization scheduled",{jobId:n,startLine:e,changedLineRanges:i,changedRangeIndex:s}),a(this,b,!1),a(this,v,!1),a(this,O,e),t(this,E)>=0&&a(this,B,Math.max(t(this,B),t(this,E))),a(this,E,-1),a(this,X,i),a(this,N,s),o(this,h,zt).call(this),o(this,h,Y).call(this,n)},It=function(e){if(t(this,T)==null||t(this,u).length>e)return;if(!t(this,b)){t(this,E)>=0?a(this,E,Math.max(t(this,E),e)):a(this,B,Math.max(t(this,B),e));return}const i=++vt(this,z)._;a(this,b,!1),a(this,v,!1),a(this,O,t(this,u).length-1),a(this,E,e),a(this,B,-1),a(this,X,void 0),a(this,N,0),o(this,h,zt).call(this),o(this,h,Y).call(this,i)},ct=function(e,i){const s=t(this,L).getLineText(e);if(s.length>=t(this,st))return console.warn(`[diffs] Line(${e}) too long to tokenize: ${s.length}`),o(this,h,tt).call(this,e,null),{resolvedTokens:[[0,"",s]],state:i};if(t(this,T)==null||s===""||s.trim()==="")return o(this,h,tt).call(this,e,null),{resolvedTokens:[[0,"",s]],state:i};const n=_t(t(this,T),t(this,Q),s,i,Dt,t(this,C));return o(this,h,tt).call(this,e,n.bracketIgnoredRanges),{resolvedTokens:n.resolvedTokens,state:n.ruleStack}},tt=function(e,i){t(this,C)&&(t(this,R)[e]=i)},Ot=function(e){const i=e.changedLineChanges??[[e.startLine,e.endLine,e.lineDelta]],s=e.startLine+1;s<=t(this,u).length-s?(a(this,D,t(this,u)),a(this,_,0),a(this,u,t(this,u).slice(0,s))):(a(this,_,s),a(this,D,t(this,u).slice(s)),t(this,u).length=Math.min(t(this,u).length,s)),a(this,A,i)},gt=function(e){let i=e;for(let s=t(this,A).length-1;s>=0;s--){const[n,r,l]=t(this,A)[s];if(l!==0){if(i>r)i-=l;else if(i>n)return t(this,u)[e]}}return t(this,D)[i-t(this,_)]??t(this,u)[e]},et=function(e,i){const s=Math.min(Math.max(0,e),t(this,L).lineCount);if(t(this,u).length>s||t(this,T)==null)return!0;const n=i==null?0:performance.now();let r=t(this,u).length-1,l=t(this,u)[r]??F;for(;r<s;){t(this,u)[r]=l;const d=t(this,L).getLineText(r);if(d.length<t(this,st)&&d!==""&&d.trim()!==""){const c=_t(t(this,T),t(this,Q),d,l,Dt,t(this,C),!1);o(this,h,tt).call(this,r,c.bracketIgnoredRanges),l=c.ruleStack}else o(this,h,tt).call(this,r,null);if(r++,t(this,u)[r]=l,i!=null&&performance.now()-n>i)break}return r>=s},Bt=function(e){if(t(this,b)||t(this,v)||t(this,T)==null||e!==t(this,z))return;o(this,h,K).call(this);const i=o(this,h,et).call(this,t(this,E),1);if(!(t(this,b)||t(this,v)||e!==t(this,z))){if(i){this.stopBackgroundTokenize();return}a(this,O,t(this,u).length-1),o(this,h,Y).call(this,e)}},Pt=function(e){if(t(this,b)||t(this,v)||t(this,T)==null||e!==t(this,z))return;o(this,h,K).call(this);const i=performance.now(),s=new Map,n=t(this,L).lineCount,r=t(this,X);let l=t(this,O),d=t(this,u)[l]??F,c=!1,f=t(this,N),I=r?.[f]?.[1];for(;l<n;){t(this,u)[l]=d;const m=I!=null?o(this,h,gt).call(this,l+1):void 0,M=o(this,h,ct).call(this,l,d);if(s.set(l,M.resolvedTokens),d=M.state,t(this,u)[l+1]=d,c=I!=null&&l>=I&&m!=null&&d.equals(m),l++,c){f++;const S=r?.[f];if(S==null)break;if(I=S[1],t(this,u)[S[0]]==null)c=!1;else{l=S[0],d=t(this,u)[l]??d,c=!1;continue}}if(performance.now()-i>1)break}if(t(this,it).call(this,s),!(t(this,b)||t(this,v)||e!==t(this,z))){if(c||l>=n){const m=t(this,B);this.stopBackgroundTokenize(),m>=0&&o(this,h,It).call(this,m);return}a(this,O,l),a(this,N,f),o(this,h,Y).call(this,e)}},At);function _t(e,i,s,n,r,l=!0,d=!0){const c=e.tokenizeLine2(s,n,r);c.stoppedEarly&&console.warn(`[diffs] Time limit reached when tokenizing line: ${s.substring(0,100)}`);const f=c.tokens,I=f.length/2,m=[],M=[];if(!d&&!l)return{ruleStack:c.ruleStack,resolvedTokens:m,bracketIgnoredRanges:M};for(let S=0;S<I;S++){const y=f[2*S],V=S+1<I?f[2*S+2]:s.length;if(y===V)continue;const mt=f[2*S+1];if(d){const j=Ct.getForeground(mt);m.push([y,i[j],s.slice(y,V)])}l&&Ct.getTokenType(mt)>0&&M.push([y,V])}return{ruleStack:c.ruleStack,resolvedTokens:m,bracketIgnoredRanges:M}}function Lt(e){return e==="text"||e==="ansi"}var $,G,at,te=(at=class extends Ft{constructor(s,n){super();J(this,"highlighter");J(this,"options");g(this,$,"");g(this,G);this.highlighter=s,this.options=n}tokenizeChunk(s,n){const r=(t(this,$)+s).split(/(\r\n|\r|\n)/);let l=[];for(let d=0;d<r.length;d+=2){const c=r[d],f=this.highlighter.codeToTokens(c,{...this.options,grammarState:t(this,G)}),I=f.tokens[0].map(m=>({...m,offset:m.offset+this.stableOffset}));d+1<r.length?(Ht(n,I),this.pushLineBreak(n,c.length,r[d+1]),a(this,G,f.grammarState)):(l=I,a(this,$,c))}return{unstable:l,tailLength:t(this,$).length}}clone(){this.assertActive();const s=new at(this.highlighter,this.options);return this.copyStateTo(s),a(s,$,t(this,$)),a(s,G,t(this,G)),s}resetSource(){a(this,$,""),a(this,G,void 0)}releaseSource(){this.resetSource()}},$=new WeakMap,G=new WeakMap,at),he=class $t extends Kt{constructor(s,n){super(s,Nt(s));J(this,"raw");J(this,"loadedThemes",new Map);J(this,"attachedLanguages",new Set(["text","ansi"]));this.raw=n}static async create(s){const n=s==="shiki-wasm"?(await wt(async()=>{const{createOnigurumaEngine:l}=await import("./fp9mRO0R.js");return{createOnigurumaEngine:l}},[],import.meta.url)).createOnigurumaEngine(wt(()=>import("./Cey7Y6ql.js"),[],import.meta.url)):(await wt(async()=>{const{createJavaScriptRegexEngine:l}=await import("./LU5PuYrD.js");return{createJavaScriptRegexEngine:l}},[],import.meta.url)).createJavaScriptRegexEngine(),r=await Qt({themes:[],langs:[],engine:n});return new $t(s,r)}getTheme(s){this.assertNotDisposed();const n=this.loadedThemes.get(s),r=this.themeResolver.getResolvedTheme(s)??n;if(r==null)throw new Error(`Theme "${s}" has not been resolved`);if(n!==r){const l=r.textmate??(r.cssVariables!=null?Ut(r.cssVariables):void 0);if(l==null)throw new Error(`Theme "${s}" does not support Shiki`);this.raw.setTheme({...l,name:s}),this.loadedThemes.set(s,r)}return r}codeToTokens(s,n){return this.raw.codeToTokens(s,this.resolveOptions(n))}createEditorTokenizer(s){return new Yt(this.raw,s,this)}createStreamTokenizer(s){return new te(this.raw,this.resolveOptions(s))}async loadLanguages(s){this.assertNotDisposed();const n=s.filter(r=>!this.attachedLanguages.has(r));Xt(await Gt(n),this)}hasLoadedLanguages(s){if(this.disposed)return!1;let n;return s.every(r=>this.attachedLanguages.has(r)?!0:Jt.has(r)?!1:(n??=this.raw.getLoadedLanguages(),n.includes(r)))}attachLanguages(s){this.assertNotDisposed();for(const n of s){if(this.attachedLanguages.has(n.name))continue;const r=n.data.find(l=>l.name===n.name||l.aliases?.includes(n.name)===!0);if(r==null)throw new Error(`attachResolvedLanguages: No returned grammar declares "${n.name}" as its name or an alias.`);this.raw.loadLanguageSync(n.data);try{this.raw.getLanguage(n.name)}catch{throw new Error(`attachResolvedLanguages: "${r.name}" is already loaded without alias "${n.name}". Load the alias first or give the grammar a unique name.`)}this.attachedLanguages.add(n.name)}}releaseResources(){this.loadedThemes.clear(),this.attachedLanguages.clear(),this.raw.dispose()}resolveOptions({theme:s,themes:n,...r}){if(this.assertNotDisposed(),s!=null)return this.getTheme(s),{...r,theme:s};if(n==null)throw new Error("A theme or themes option is required");for(const l of Object.values(n))this.getTheme(l);return{...r,themes:n}}};export{he as ShikiHighlighter};
|
|
1
|
+
var Vt=Object.defineProperty;var yt=e=>{throw TypeError(e)};var jt=(e,i,s)=>i in e?Vt(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s;var J=(e,i,s)=>jt(e,typeof i!="symbol"?i+"":i,s),bt=(e,i,s)=>i.has(e)||yt("Cannot "+s);var t=(e,i,s)=>(bt(e,i,"read from private field"),s?s.call(e):i.get(e)),g=(e,i,s)=>i.has(e)?yt("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,s),a=(e,i,s,n)=>(bt(e,i,"write to private field"),n?n.call(e,s):i.set(e,s),s),o=(e,i,s)=>(bt(e,i,"access private method"),s);var vt=(e,i,s,n)=>({set _(r){a(e,i,r,s)},get _(){return t(e,i,n)}});import{_ as wt}from"./C0QTy0Sy.js";import{m as xt,A as qt,r as Ht,Q as Nt,aX as Gt,R as Jt}from"./BVAdLfsa.js";import{B as Ft,D as Kt}from"./CqjTdgdP.js";import{I as F,E as Ct,b as Qt,a as Ut}from"./DICr2Lvd.js";function Xt(e,i){for(const s of Array.isArray(e)?e:[e]){let n=xt.get(s.name);n==null&&(n=s,xt.set(s.name,n)),i.attachLanguages([n]),qt.add(n.name)}}function Zt(e,i){let s;return function(...n){clearTimeout(s),s=setTimeout(()=>e.apply(this,n),i)}}const Dt=0;let Wt=0;var H,T,P,Q,L,st,it,C,U,nt,u,D,_,A,O,b,v,z,dt,E,B,X,N,R,Z,Tt,ft,h,K,ut,zt,Et,Y,pt,It,ct,tt,Ot,gt,et,Bt,Pt,At,Yt=(At=class{constructor(e,i,s){g(this,h);J(this,"backend");g(this,H);g(this,T);g(this,P);g(this,Q);g(this,L);g(this,st);g(this,it);g(this,C);g(this,U);g(this,nt,!1);g(this,u,[F]);g(this,D,[]);g(this,_,0);g(this,A,[]);g(this,O,-1);g(this,b,!0);g(this,v,!1);g(this,z,0);g(this,dt,++Wt);g(this,E,-1);g(this,B,-1);g(this,X);g(this,N,0);g(this,R,[]);g(this,Z,!1);g(this,Tt,Zt(async e=>{if(t(this,nt))return;const{startingLine:i=0,totalLines:s=1/0}=e??{},n=Math.min(s===1/0?1/0:i+s,t(this,L).lineCount);if(t(this,T)==null&&!Lt(t(this,L).languageId)){if(await this.backend?.loadLanguages([t(this,L).languageId]),t(this,nt))return;a(this,T,t(this,H).getLanguage(t(this,L).languageId))}o(this,h,K).call(this),o(this,h,It).call(this,n)},500));g(this,ft,({data:e})=>{if(typeof e!="object"||e===null)return;const{type:i,tokenizerId:s,jobId:n}=e;i==="tokenize"&&s===t(this,dt)&&typeof n=="number"&&n===t(this,z)&&(t(this,E)>=0?o(this,h,Bt).call(this,n):o(this,h,Pt).call(this,n))});this.backend=s,a(this,H,e),a(this,L,i.textDocument),a(this,P,i.theme),a(this,Q,[]),a(this,st,i.tokenizeMaxLineLength??1e3),a(this,it,i.onDeferTokenize),a(this,C,i.matchBrackets!==!1),a(this,U,i.__debug??!1),o(this,h,ut).call(this),o(this,h,K).call(this)}getStringCommentRegexpRangesInLine(e){if(!t(this,C)||e<0||e>=t(this,L).lineCount||(o(this,h,ut).call(this),t(this,T)==null))return null;if(t(this,R)[e]===void 0){o(this,h,et).call(this,e);const i=t(this,u)[e]??F,s=o(this,h,ct).call(this,e,i);t(this,u)[e+1]=s.state}return t(this,R)[e]??null}setTheme(e){t(this,P)!==e&&(a(this,P,e),o(this,h,K).call(this),this.stopBackgroundTokenize(),a(this,u,[F]),a(this,D,[]),a(this,_,0),a(this,A,[]),t(this,T)!=null&&t(this,L).lineCount>0&&o(this,h,pt).call(this,0))}dispose(){a(this,nt,!0),this.stopBackgroundTokenize(),o(this,h,Et).call(this)}tokenize(e,i,s=!1){if(o(this,h,ut).call(this),o(this,h,K).call(this),t(this,T)==null&&!Lt(t(this,L).languageId))throw new Error(`Grammar for language "${t(this,L).languageId}" not loaded`);const{lineCount:n}=t(this,L),{startingLine:r=0,totalLines:l=1/0}=i??{},d=l===1/0?n:Math.min(r+l,n),c=e.startLine,f=Math.max(r,c),I=i!=null&&l!==1/0&&e.lineDelta>0&&c<d&&e.endLine>=d,m=e.lineDelta===0&&(e.changedLineChanges?.every(([,,p])=>p===0)??!0);t(this,C)&&!m&&(t(this,R).length=Math.min(t(this,R).length,e.startLine));const M=s&&e.lineDelta!==0&&c>=r,S=m||i==null||c>=f,y=e.changedLineRanges??[[c,e.endLine]];a(this,D,[]),a(this,_,0),a(this,A,[]);let V=-1;if(c<f)for(const[p,w]of y)p<f&&(V=Math.max(V,Math.min(w,f-1)));const mt=V>=c&&(m||e.lineDelta<0);m?o(this,h,et).call(this,c):(o(this,h,Ot).call(this,e),(i==null||c>=f)&&o(this,h,et).call(this,f));let j=0,St=y[j][1],ht,Rt=0,k=m?y[j][0]:f,rt=!1;const Mt=new Map,W=mt?new Map:void 0;if(W!=null&&!m){const p=Math.min(V+1,f,d);if(p>c){o(this,h,et).call(this,p);let w=c,ot=t(this,u)[w]??F;for(;w<p;w++){const x=o(this,h,ct).call(this,w,ot);ot=x.state,W.set(w,x.resolvedTokens)}t(this,u)[p]=ot}}let q=t(this,u)[k]??F;for(;k<d;){const p=m?t(this,u)[k+1]:M?o(this,h,gt).call(this,k+1):void 0;S&&(t(this,u)[k]=q);const{resolvedTokens:w,state:ot}=o(this,h,ct).call(this,k,q);if(q=ot,k>=f?Mt.set(k,w):W?.set(k,w),S&&(t(this,u)[k+1]=q),rt=k>=St&&(m||M)&&p!=null&&q.equals(p),rt){j++;const x=y[j];if(x==null)break;if(x[0]>=d){ht=x[0],Rt=j;break}let lt=t(this,u)[x[0]];if(M)for(let kt=k+2;kt<=x[0]&&(lt=o(this,h,gt).call(this,kt),lt!=null);kt++)t(this,u)[kt]=lt;lt==null?(St=x[1],k++):(k=x[0],q=lt,St=x[1]),rt=!1;continue}k++}if(S&&(k<d?t(this,u)[k+1]=q:t(this,u)[k]=q),rt&&M&&ht==null){for(let p=k+2;p<=n;p++){const w=o(this,h,gt).call(this,p);if(w==null)break;t(this,u)[p]=w}a(this,D,[]),a(this,_,0),a(this,A,[])}if(W!=null&&W.size>0&&t(this,it).call(this,W),ht!=null)t(this,C)&&m&&(t(this,R).length=Math.min(t(this,R).length,ht)),o(this,h,pt).call(this,ht,y,Rt);else if(!rt&&k<n){const p=I&&c>=f?d:c<f&&!m?c:k;t(this,C)&&m&&(t(this,R).length=Math.min(t(this,R).length,p)),o(this,h,pt).call(this,p,y,j)}return Mt}prebuildStateStack(e){o(this,h,ut).call(this),t(this,Tt).call(this,e)}stopBackgroundTokenize(){a(this,B,-1),!t(this,b)&&(a(this,b,!0),a(this,v,!1),a(this,O,-1),a(this,E,-1),a(this,X,void 0),a(this,N,0),a(this,D,[]),a(this,_,0),a(this,A,[]),o(this,h,Et).call(this))}pauseBackgroundTokenize(){t(this,b)||t(this,v)||(t(this,U)&&console.log("[diffs/editor] background tokenization paused",{jobId:t(this,z)}),a(this,v,!0))}resumeBackgroundTokenize(){t(this,b)||!t(this,v)||t(this,T)==null||t(this,O)<0||(t(this,U)&&console.log("[diffs/editor] background tokenization resumed",{jobId:t(this,z)}),a(this,v,!1),o(this,h,Y).call(this,t(this,z)))}},H=new WeakMap,T=new WeakMap,P=new WeakMap,Q=new WeakMap,L=new WeakMap,st=new WeakMap,it=new WeakMap,C=new WeakMap,U=new WeakMap,nt=new WeakMap,u=new WeakMap,D=new WeakMap,_=new WeakMap,A=new WeakMap,O=new WeakMap,b=new WeakMap,v=new WeakMap,z=new WeakMap,dt=new WeakMap,E=new WeakMap,B=new WeakMap,X=new WeakMap,N=new WeakMap,R=new WeakMap,Z=new WeakMap,Tt=new WeakMap,ft=new WeakMap,h=new WeakSet,K=function(){if(t(this,P)==="")return;this.backend?.getTheme(t(this,P));const{colorMap:e}=t(this,H).setTheme(t(this,P));a(this,Q,e)},ut=function(){t(this,T)==null&&!Lt(t(this,L).languageId)&&t(this,H).getLoadedLanguages().includes(t(this,L).languageId)&&a(this,T,t(this,H).getLanguage(t(this,L).languageId))},zt=function(){t(this,Z)||(globalThis.addEventListener("message",t(this,ft)),a(this,Z,!0))},Et=function(){t(this,Z)&&(globalThis.removeEventListener("message",t(this,ft)),a(this,Z,!1))},Y=function(e){globalThis.postMessage({type:"tokenize",tokenizerId:t(this,dt),jobId:e})},pt=function(e,i,s=0){if(Lt(t(this,L).languageId))return;const n=++vt(this,z)._;t(this,U)&&console.log("[diffs/editor] background tokenization scheduled",{jobId:n,startLine:e,changedLineRanges:i,changedRangeIndex:s}),a(this,b,!1),a(this,v,!1),a(this,O,e),t(this,E)>=0&&a(this,B,Math.max(t(this,B),t(this,E))),a(this,E,-1),a(this,X,i),a(this,N,s),o(this,h,zt).call(this),o(this,h,Y).call(this,n)},It=function(e){if(t(this,T)==null||t(this,u).length>e)return;if(!t(this,b)){t(this,E)>=0?a(this,E,Math.max(t(this,E),e)):a(this,B,Math.max(t(this,B),e));return}const i=++vt(this,z)._;a(this,b,!1),a(this,v,!1),a(this,O,t(this,u).length-1),a(this,E,e),a(this,B,-1),a(this,X,void 0),a(this,N,0),o(this,h,zt).call(this),o(this,h,Y).call(this,i)},ct=function(e,i){const s=t(this,L).getLineText(e);if(s.length>=t(this,st))return console.warn(`[diffs] Line(${e}) too long to tokenize: ${s.length}`),o(this,h,tt).call(this,e,null),{resolvedTokens:[[0,"",s]],state:i};if(t(this,T)==null||s===""||s.trim()==="")return o(this,h,tt).call(this,e,null),{resolvedTokens:[[0,"",s]],state:i};const n=_t(t(this,T),t(this,Q),s,i,Dt,t(this,C));return o(this,h,tt).call(this,e,n.bracketIgnoredRanges),{resolvedTokens:n.resolvedTokens,state:n.ruleStack}},tt=function(e,i){t(this,C)&&(t(this,R)[e]=i)},Ot=function(e){const i=e.changedLineChanges??[[e.startLine,e.endLine,e.lineDelta]],s=e.startLine+1;s<=t(this,u).length-s?(a(this,D,t(this,u)),a(this,_,0),a(this,u,t(this,u).slice(0,s))):(a(this,_,s),a(this,D,t(this,u).slice(s)),t(this,u).length=Math.min(t(this,u).length,s)),a(this,A,i)},gt=function(e){let i=e;for(let s=t(this,A).length-1;s>=0;s--){const[n,r,l]=t(this,A)[s];if(l!==0){if(i>r)i-=l;else if(i>n)return t(this,u)[e]}}return t(this,D)[i-t(this,_)]??t(this,u)[e]},et=function(e,i){const s=Math.min(Math.max(0,e),t(this,L).lineCount);if(t(this,u).length>s||t(this,T)==null)return!0;const n=i==null?0:performance.now();let r=t(this,u).length-1,l=t(this,u)[r]??F;for(;r<s;){t(this,u)[r]=l;const d=t(this,L).getLineText(r);if(d.length<t(this,st)&&d!==""&&d.trim()!==""){const c=_t(t(this,T),t(this,Q),d,l,Dt,t(this,C),!1);o(this,h,tt).call(this,r,c.bracketIgnoredRanges),l=c.ruleStack}else o(this,h,tt).call(this,r,null);if(r++,t(this,u)[r]=l,i!=null&&performance.now()-n>i)break}return r>=s},Bt=function(e){if(t(this,b)||t(this,v)||t(this,T)==null||e!==t(this,z))return;o(this,h,K).call(this);const i=o(this,h,et).call(this,t(this,E),1);if(!(t(this,b)||t(this,v)||e!==t(this,z))){if(i){this.stopBackgroundTokenize();return}a(this,O,t(this,u).length-1),o(this,h,Y).call(this,e)}},Pt=function(e){if(t(this,b)||t(this,v)||t(this,T)==null||e!==t(this,z))return;o(this,h,K).call(this);const i=performance.now(),s=new Map,n=t(this,L).lineCount,r=t(this,X);let l=t(this,O),d=t(this,u)[l]??F,c=!1,f=t(this,N),I=r?.[f]?.[1];for(;l<n;){t(this,u)[l]=d;const m=I!=null?o(this,h,gt).call(this,l+1):void 0,M=o(this,h,ct).call(this,l,d);if(s.set(l,M.resolvedTokens),d=M.state,t(this,u)[l+1]=d,c=I!=null&&l>=I&&m!=null&&d.equals(m),l++,c){f++;const S=r?.[f];if(S==null)break;if(I=S[1],t(this,u)[S[0]]==null)c=!1;else{l=S[0],d=t(this,u)[l]??d,c=!1;continue}}if(performance.now()-i>1)break}if(t(this,it).call(this,s),!(t(this,b)||t(this,v)||e!==t(this,z))){if(c||l>=n){const m=t(this,B);this.stopBackgroundTokenize(),m>=0&&o(this,h,It).call(this,m);return}a(this,O,l),a(this,N,f),o(this,h,Y).call(this,e)}},At);function _t(e,i,s,n,r,l=!0,d=!0){const c=e.tokenizeLine2(s,n,r);c.stoppedEarly&&console.warn(`[diffs] Time limit reached when tokenizing line: ${s.substring(0,100)}`);const f=c.tokens,I=f.length/2,m=[],M=[];if(!d&&!l)return{ruleStack:c.ruleStack,resolvedTokens:m,bracketIgnoredRanges:M};for(let S=0;S<I;S++){const y=f[2*S],V=S+1<I?f[2*S+2]:s.length;if(y===V)continue;const mt=f[2*S+1];if(d){const j=Ct.getForeground(mt);m.push([y,i[j],s.slice(y,V)])}l&&Ct.getTokenType(mt)>0&&M.push([y,V])}return{ruleStack:c.ruleStack,resolvedTokens:m,bracketIgnoredRanges:M}}function Lt(e){return e==="text"||e==="ansi"}var $,G,at,te=(at=class extends Ft{constructor(s,n){super();J(this,"highlighter");J(this,"options");g(this,$,"");g(this,G);this.highlighter=s,this.options=n}tokenizeChunk(s,n){const r=(t(this,$)+s).split(/(\r\n|\r|\n)/);let l=[];for(let d=0;d<r.length;d+=2){const c=r[d],f=this.highlighter.codeToTokens(c,{...this.options,grammarState:t(this,G)}),I=f.tokens[0].map(m=>({...m,offset:m.offset+this.stableOffset}));d+1<r.length?(Ht(n,I),this.pushLineBreak(n,c.length,r[d+1]),a(this,G,f.grammarState)):(l=I,a(this,$,c))}return{unstable:l,tailLength:t(this,$).length}}clone(){this.assertActive();const s=new at(this.highlighter,this.options);return this.copyStateTo(s),a(s,$,t(this,$)),a(s,G,t(this,G)),s}resetSource(){a(this,$,""),a(this,G,void 0)}releaseSource(){this.resetSource()}},$=new WeakMap,G=new WeakMap,at),he=class $t extends Kt{constructor(s,n){super(s,Nt(s));J(this,"raw");J(this,"loadedThemes",new Map);J(this,"attachedLanguages",new Set(["text","ansi"]));this.raw=n}static async create(s){const n=s==="shiki-wasm"?(await wt(async()=>{const{createOnigurumaEngine:l}=await import("./fp9mRO0R.js");return{createOnigurumaEngine:l}},[],import.meta.url)).createOnigurumaEngine(wt(()=>import("./Cey7Y6ql.js"),[],import.meta.url)):(await wt(async()=>{const{createJavaScriptRegexEngine:l}=await import("./LU5PuYrD.js");return{createJavaScriptRegexEngine:l}},[],import.meta.url)).createJavaScriptRegexEngine(),r=await Qt({themes:[],langs:[],engine:n});return new $t(s,r)}getTheme(s){this.assertNotDisposed();const n=this.loadedThemes.get(s),r=this.themeResolver.getResolvedTheme(s)??n;if(r==null)throw new Error(`Theme "${s}" has not been resolved`);if(n!==r){const l=r.textmate??(r.cssVariables!=null?Ut(r.cssVariables):void 0);if(l==null)throw new Error(`Theme "${s}" does not support Shiki`);this.raw.setTheme({...l,name:s}),this.loadedThemes.set(s,r)}return r}codeToTokens(s,n){return this.raw.codeToTokens(s,this.resolveOptions(n))}createEditorTokenizer(s){return new Yt(this.raw,s,this)}createStreamTokenizer(s){return new te(this.raw,this.resolveOptions(s))}async loadLanguages(s){this.assertNotDisposed();const n=s.filter(r=>!this.attachedLanguages.has(r));Xt(await Gt(n),this)}hasLoadedLanguages(s){if(this.disposed)return!1;let n;return s.every(r=>this.attachedLanguages.has(r)?!0:Jt.has(r)?!1:(n??=this.raw.getLoadedLanguages(),n.includes(r)))}attachLanguages(s){this.assertNotDisposed();for(const n of s){if(this.attachedLanguages.has(n.name))continue;const r=n.data.find(l=>l.name===n.name||l.aliases?.includes(n.name)===!0);if(r==null)throw new Error(`attachResolvedLanguages: No returned grammar declares "${n.name}" as its name or an alias.`);this.raw.loadLanguageSync(n.data);try{this.raw.getLanguage(n.name)}catch{throw new Error(`attachResolvedLanguages: "${r.name}" is already loaded without alias "${n.name}". Load the alias first or give the grammar a unique name.`)}this.attachedLanguages.add(n.name)}}releaseResources(){this.loadedThemes.clear(),this.attachedLanguages.clear(),this.raw.dispose()}resolveOptions({theme:s,themes:n,...r}){if(this.assertNotDisposed(),s!=null)return this.getTheme(s),{...r,theme:s};if(n==null)throw new Error("A theme or themes option is required");for(const l of Object.values(n))this.getTheme(l);return{...r,themes:n}}};export{he as ShikiHighlighter};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var $s=Object.defineProperty;var Fs=(f,r,l)=>r in f?$s(f,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):f[r]=l;var q=(f,r,l)=>Fs(f,typeof r!="symbol"?r+"":r,l);import{t as dn,bo as x,bm as P,bw as un,bq as On,b as hn,bs as je}from"./C0QTy0Sy.js";import{ai as Cr,bs as gn,ca as Be,aD as e,bH as m,a5 as N,bA as L,b_ as z,aw as sn,aj as ln,W as w,bn as fn,bV as J,aA as C,ay as ne,bS as y,bl as de,bO as K,aB as T,c9 as u,a7 as nt,br as tt,bj as sr,c5 as gt,c0 as Hn,a as Us,be as Tt,b$ as ft,bf as or}from"./3SdAC2_C.js";import{i as M}from"./bhKPSdq4.js";import{g as Pt,i as Ln,I as ir,e as ar}from"./B6S6VNu7.js";import{n as cn,l as Ws,c as Bs}from"./DLwWVKiF.js";import{f as En,s as Ve,g as lr}from"./7UPrdiE9.js";import{b as on}from"./Dn334wJv.js";import{Jv as Me,eS as Vs,eJ as Ks,eK as js,o_ as qs,nO as Vt,nS as cr,nR as In,eM as Gs,vF as Qs,vG as Xs,vI as Js,Hy as Ys,JA as Zs,rX as eo,eR as to}from"./_LtUY0jS.js";import{c as no}from"./BWu0YXkV.js";import{F as Ne,a1 as ro,a8 as An,aw as dr,ax as ur,bS as so,aP as oo,cd as hr,bZ as gr,cq as fr}from"./U9jJmfYa.js";import{dH as io,bs as ao,X as lo,aO as mr,p as co}from"./Cppy6ZYG.js";import{L as pr}from"./L7j-Q29w.js";import{C as an}from"./DypB-Dwi.js";import{b8 as kr,bN as uo,bT as ho}from"./BfSTFUKA.js";import{q as $e,d as go,g as fo}from"./DOAyQZ8n.js";import"./CrD0jtXE.js";import"./C2jYl_tm.js";/* empty css */import{T as Pr}from"./DbD3dAy_.js";import{g as Nn}from"./bq2jN3Y4.js";import{A as mo}from"./wl2qP2wF.js";import{f as ke}from"./CttA-M7l.js";import{C as po}from"./L0wFy8_j.js";import{C as vo}from"./DlUZpQ7U.js";import{s as vr}from"./1VDAs3Ud.js";import{S as Dt}from"./DCL0Px6m.js";import{l as Rt}from"./CE7dsja4.js";import{G as _r}from"./a3TFelkn.js";import{P as _o}from"./DJcj8WvN.js";import{g as wo}from"./BPjvgJzJ.js";import{a8 as bo,Y as So}from"./Bwa_PJLB.js";import{ap as yo}from"./CEOk8g-Q.js";import{N as wr}from"./CzRvdM50.js";import{ae as xo,ad as Co,af as ko}from"./BtI19qHa.js";function br({scrollTop:f,scrollHeight:r,height:l,fitPerfectly:a=!1,fitPerfectlyOverscroll:c=0,overscrollSize:p}){const b=l+p*2,S=a?l+c*2:b;if(r=Math.max(r,S),b>=r||a){const G=Math.max(f-c,0),h=Math.min(f+S,r);return{top:G,bottom:Math.max(h,G)}}let A=f+l/2-b/2,F=A+b;return A<0&&(A=0),F>r&&(F=r),A=Math.floor(Math.max(A,0)),{top:A,bottom:Math.ceil(Math.max(Math.min(F,r),A))}}function Po(f,r){return f==null||r==null?f===r:f.top===r.top&&f.bottom===r.bottom}const Rr=1e3,Ro=Rr*4,Ho=[0,1e-6,.99999,1],Lo={overscrollSize:Rr,intersectionObserverMargin:Ro,resizeDebugging:!1};let rn=0,Io=-1;var Pe,Ao=(Pe=class{constructor(r){q(this,"__id",`virtualizer-${++Io}`);q(this,"config");q(this,"type","simple");q(this,"intersectionObserver");q(this,"scrollTop",0);q(this,"height",0);q(this,"scrollHeight",0);q(this,"windowSpecs",{top:0,bottom:0});q(this,"root");q(this,"contentContainer");q(this,"resizeObserver");q(this,"observers",new Map);q(this,"visibleInstances",new Map);q(this,"visibleInstancesDirty",!1);q(this,"instancesChanged",new Set);q(this,"reconcileQueue",new Set);q(this,"scrollDirty",!0);q(this,"heightDirty",!0);q(this,"scrollHeightDirty",!0);q(this,"renderedObservers",0);q(this,"connectQueue",new Map);q(this,"handleContainerResize",r=>{if(this.root==null)return;let l=!1;for(const a of r){const c=a.borderBoxSize[0].blockSize;this.root instanceof Document?c!==this.scrollHeight&&(this.scrollHeightDirty=!0,l=!0,this.config.resizeDebugging&&(console.log("Virtualizer: content size change",this.__id,{sizeChange:c-rn,newSize:c}),rn=c)):a.target===this.root?c!==this.height&&(this.heightDirty=!0,l=!0):a.target===this.contentContainer&&(this.scrollHeightDirty=!0,l=!0,this.config.resizeDebugging&&(console.log("Virtualizer: scroller size change",this.__id,{sizeChange:c-rn,newSize:c}),rn=c))}l&&$e(this.computeRenderRangeAndEmit)});q(this,"handleWindowResize",()=>{Pe.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"handleWindowScroll",()=>{Pe.__STOP||this.root==null||!(this.root instanceof Document)||(this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"handleElementScroll",()=>{Pe.__STOP||this.root==null||this.root instanceof Document||(this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"computeRenderRangeAndEmit",()=>{if(Pe.__STOP)return;const r=this.heightDirty||this.scrollHeightDirty;let l=this.instancesChanged.size>0;if(this.instancesChanged.size===0){const p=br({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize});if(!r&&Po(this.windowSpecs,p)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.reconcileQueue.size===0)return;this.windowSpecs=p}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;const a=this.getScrollAnchor(this.height),c=new Set;for(const p of r?this.observers.values():this.visibleInstances.values())p.onRender(r)&&c.add(p);for(const p of this.instancesChanged)c.has(p)||p.onRender(r)&&c.add(p);this.scrollFix(a);for(const p of c)this.reconcileQueue.delete(p),p.reconcileHeights();for(const p of this.reconcileQueue)p.reconcileHeights()&&(l=!0);this.reconcileQueue.clear(),l||=this.instancesChanged.size>0,l&&this.markDOMDirty(),(l||r)&&$e(this.computeRenderRangeAndEmit),c.clear(),this.instancesChanged.clear()});q(this,"handleIntersectionChange",r=>{this.scrollDirty=!0;for(const{target:l,isIntersecting:a}of r){if(!(l instanceof HTMLElement))throw new Error("Virtualizer.handleIntersectionChange: target not an HTMLElement");const c=this.observers.get(l);c!=null&&(a&&!this.visibleInstances.has(l)?(c.setVisibility(!0),this.visibleInstances.set(l,c),this.visibleInstancesDirty=!0):!a&&this.visibleInstances.has(l)&&(c.setVisibility(!1),this.visibleInstances.delete(l),this.visibleInstancesDirty=!0))}this.visibleInstancesDirty&&$e(this.computeRenderRangeAndEmit)});this.config={...Lo,...r}}setup(r,l){if(this.root==null){this.root=r,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:Ho,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),r instanceof Document?this.setupWindow():this.setupElement(l),window.__INSTANCE=this,window.__TOGGLE=()=>{Pe.__STOP?(Pe.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:Pe.__lastScrollPosition}),$e(this.computeRenderRangeAndEmit)):(Pe.__lastScrollPosition=this.getScrollTop(),Pe.__STOP=!0)};for(const[a,c]of this.connectQueue.entries())this.connect(a,c);this.connectQueue.clear(),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)}}instanceChanged(r,l){this.instancesChanged.add(r),l&&this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)}requestHeightReconcile(r){this.reconcileQueue.add(r),$e(this.computeRenderRangeAndEmit)}getWindowSpecs(){return this.windowSpecs.top===0&&this.windowSpecs.bottom===0&&(this.windowSpecs=br({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize})),this.windowSpecs}getRoot(){return this.root}isInstanceVisible(r,l){const a=this.getScrollTop(),c=this.getHeight(),p=this.config.intersectionObserverMargin,b=a-p,S=a+c+p;return!(r<b-l||r>S)}setupWindow(){if(this.root==null||!(this.root instanceof Document))throw new Error("Virtualizer.setupWindow: Invalid setup method");window.addEventListener("scroll",this.handleWindowScroll,{passive:!0}),window.addEventListener("resize",this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(r){if(this.root==null||this.root instanceof Document)throw new Error("Virtualizer.setupElement: Invalid setup method");this.root.addEventListener("scroll",this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),r??=this.root.firstElementChild??void 0,r instanceof HTMLElement&&(this.contentContainer=r,this.resizeObserver?.observe(r))}cleanUp(){go(this.computeRenderRangeAndEmit),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener("scroll",this.handleElementScroll),window.removeEventListener("scroll",this.handleWindowScroll),window.removeEventListener("resize",this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.reconcileQueue.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.scrollHeightDirty=!0}getOffsetInScrollContainer(r){return this.getScrollTop()+Kt(r,this.getScrollContainerElement())}connect(r,l){if(this.observers.has(r))throw new Error("Virtualizer.connect: instance is already connected...");return this.intersectionObserver==null?this.connectQueue.set(r,l):(this.intersectionObserver.observe(r),this.observers.set(r,l),this.instancesChanged.add(l),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)),()=>this.disconnect(r)}disconnect(r){const l=this.observers.get(r);this.connectQueue.delete(r),l!=null&&(this.intersectionObserver?.unobserve(r),this.observers.delete(r),this.instancesChanged.delete(l),this.reconcileQueue.delete(l),this.visibleInstances.delete(r)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit))}scrollFix(r){if(r==null)return;const l=this.getScrollContainerElement(),{lineIndex:a,lineOffset:c,fileElement:p,fileOffset:b,fileTypeOffset:S}=r;if(a!=null&&c!=null){const F=p.shadowRoot?.querySelector(`[data-line][data-line-index="${a}"]`);if(F instanceof HTMLElement){const G=Kt(F,l);if(G!==c){const h=G-c;this.applyScrollFix(h)}return}}const A=Kt(p,l);if(S==="top")A!==b&&this.applyScrollFix(A-b);else{const F=A+p.getBoundingClientRect().height;F!==b&&this.applyScrollFix(F-b)}}applyScrollFix(r){this.root==null||this.root instanceof Document?window.scrollTo({top:window.scrollY+r,behavior:"instant"}):this.root.scrollTo({top:this.root.scrollTop+r,behavior:"instant"}),this.markDOMDirty()}getScrollAnchor(r){const l=this.getScrollContainerElement();let a;for(const[c]of this.visibleInstances.entries()){const p=Kt(c,l),b=p+c.offsetHeight;let S,A;b<=0?(S=b,A="bottom"):(S=p,A="top");let F,G;if(b>0&&p<r)for(const oe of c.shadowRoot?.querySelectorAll("[data-line][data-line-index]")??[]){if(!(oe instanceof HTMLElement))continue;const Te=oe.dataset.lineIndex;if(Te==null)continue;const ue=Kt(oe,l);if(!(ue<0)){F=Te,G=ue;break}}if(a?.lineOffset!=null&&G==null)continue;let h=!1;(a==null||G!=null&&(a.lineOffset==null||G<a.lineOffset)||G==null&&a.lineOffset==null&&(S>=0&&(a.fileOffset<0||S<a.fileOffset)||S<0&&a.fileOffset<0&&S>a.fileOffset))&&(h=!0),h&&(a={fileElement:c,fileTypeOffset:A,fileOffset:S,lineIndex:F,lineOffset:G})}return a}getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let r=this.root==null?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return r=this.clampScrollTop(r),this.scrollTop=r,r}scrollTo({top:r,behavior:l="auto"}){const{root:a}=this;if(a==null)return;const c=this.clampScrollTop(r);a instanceof Document?window.scrollTo({top:c,behavior:l}):a.scrollTo({top:c,behavior:l}),this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit)}clampScrollTop(r){return Math.max(0,Math.min(r,this.getScrollHeight()-this.getHeight()))}getScrollHeight(){return this.scrollHeightDirty?(this.scrollHeightDirty=!1,this.scrollHeight=this.root==null?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight,this.scrollHeight):this.scrollHeight}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root==null?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height,this.height):this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return this.root==null||this.root instanceof Document?void 0:this.root}},q(Pe,"__STOP",!1),q(Pe,"__lastScrollPosition",0),Pe);function Kt(f,r){const l=f.getBoundingClientRect(),a=r?.getBoundingClientRect().top??0;return l.top-a}var Eo=T('<div class="absolute inset-0 flex items-center justify-center rounded-lg bg-background/60 backdrop-blur-[2px] transition-opacity duration-spring-moderate ease-spring-moderate motion-reduce:transition-none z-10 pointer-events-none"><div class="flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-xs font-medium text-subtle shadow-lg"><!> </div></div>'),Oo=T("<!> <!>",1),No=T('<div class="flex h-24 items-center justify-start text-left text-subtle"> </div>'),To=T('<div role="region"><!></div>');function Hr(f,r){if(new.target)return dn({component:Hr,...f});gn(r,!0);const l=()=>je(ve,"$sideBySide",a),[a,c]=On(),p=Nn()?.workspaceId??void 0;let b=x(r,"change",7),S=x(r,"foldUnchanged",7,!0),A=x(r,"allowHeadReads",7,!0),F=x(r,"canReadHeadFiles",7),G=x(r,"lineWrapping",7,!1),h=x(r,"scrollToLine",7),oe=x(r,"isAggregate",7,!1),Te=x(r,"showScrollHint",7,!1),ue=x(r,"onStageHunk",7),Q=x(r,"onUnstageHunk",7),at=x(r,"onOpenCommit",7),pt=x(r,"virtualizer",7),vt=x(r,"gitRootId",7,void 0),_t=x(r,"gitRootPath",7,void 0);const ve=kr();let Re=J(!1),Se=J(!1),Fe=J(!1),Ue=J(0),qe=J(void 0);const $=80;function ie(){m(Se,!0)}function De(){m(Se,!1),m(Fe,!1),m(Ue,0)}function He(v){!e(Se)||e(Re)||(m(Ue,e(Ue)+Math.abs(v.deltaY)),e(Ue)>=$&&!e(Fe)&&m(Fe,!0))}function jt(){m(Re,!0),m(Fe,!1),m(Ue,0)}function qt(v){e(qe)&&!e(qe).contains(v.relatedTarget)&&m(Re,!1)}Be(()=>{(e(Re)||!e(Se))&&(m(Fe,!1),m(Ue,0))});let Ht=u(()=>{const{toolCallId:v,filePath:_e,additions:Qe,deletions:St,oldContent:re,newContent:Xe}=b(),rt="staged"in b()&&b().staged===!0,Ke="category"in b()?b().category:void 0,At="commitHash"in b()?b().commitHash:void 0,zt="gitlink"in b()?b().gitlink:void 0,Mt="isFullFileContent"in b()?b().isFullFileContent:!1;let yt;return Ke==="committed"?yt=an.Committed:rt?yt=an.Staged:yt=an.Unstaged,{id:v,file:_e,relativePath:_e,stage:yt,commitHash:At,gitlink:zt,stats:{additions:Qe,deletions:St},attribution:{timestamp:0},content:re!==void 0||Xe!==void 0?{oldContent:re??"",newContent:Xe??"",isFullFileContent:Mt}:void 0}});const D=u(()=>b().isFullFileContent?1:("chunks"in b()?b().chunks?.[0]?.newStart:void 0)??b().startLineNumber??1);var Lt={get change(){return b()},set change(v){b(v),C()},get foldUnchanged(){return S()},set foldUnchanged(v=!0){S(v),C()},get allowHeadReads(){return A()},set allowHeadReads(v=!0){A(v),C()},get canReadHeadFiles(){return F()},set canReadHeadFiles(v){F(v),C()},get lineWrapping(){return G()},set lineWrapping(v=!1){G(v),C()},get scrollToLine(){return h()},set scrollToLine(v){h(v),C()},get isAggregate(){return oe()},set isAggregate(v=!1){oe(v),C()},get showScrollHint(){return Te()},set showScrollHint(v=!1){Te(v),C()},get onStageHunk(){return ue()},set onStageHunk(v){ue(v),C()},get onUnstageHunk(){return Q()},set onUnstageHunk(v){Q(v),C()},get onOpenCommit(){return at()},set onOpenCommit(v){at(v),C()},get virtualizer(){return pt()},set virtualizer(v){pt(v),C()},get gitRootId(){return vt()},set gitRootId(v=void 0){vt(v),C()},get gitRootPath(){return _t()},set gitRootPath(v=void 0){_t(v),C()},$set:un,$on:(v,_e)=>hn(r,v,_e)},Le=To();let wt;var It=N(Le);{var Ge=v=>{var _e=Oo(),Qe=ne(_e);{let Xe=u(()=>l()?"split":"unified");Pr(Qe,{get change(){return e(Ht)},get workspaceId(){return p},get viewMode(){return e(Xe)},get foldUnchanged(){return S()},get lineWrapping(){return G()},get onStageHunk(){return ue()},get onUnstageHunk(){return Q()},useProvidedContent:!0,get allowHeadReads(){return A()},get canReadHeadFiles(){return F()},get lineOffset(){return e(D)},get virtualizer(){return pt()},get gitRootId(){return vt()},get gitRootPath(){return _t()}})}var St=y(Qe,2);{var re=Xe=>{var rt=Eo(),Ke=N(rt),At=N(Ke);Ne(At,{get icon(){return ro},class:"w-3 h-3"});var zt=y(At);L(Ke),L(rt),z(Mt=>K(zt,` ${Mt??""}`),[()=>P.chat_inlineDiffItem_clickToScroll_label()]),cn(1,rt,()=>Ws,()=>({tier:"fast",y:0,scale:1})),cn(2,rt,()=>Bs,()=>({tier:"fast"})),w(Xe,rt)};M(St,Xe=>{Te()&&e(Fe)&&Xe(re)})}w(v,_e)},bt=v=>{var _e=No(),Qe=de(_e,!0);z(St=>K(Qe,St),[()=>P.chat_inlineDiffItem_noWorkspace_label()]),w(v,_e)};M(It,v=>{p?v(Ge):v(bt,-1)})}L(Le),on(Le,v=>m(qe,v),()=>e(qe)),z(v=>{wt=En(Le,1,"inline-diff-container relative",null,wt,{focused:e(Re)}),Ve(Le,"aria-label",v)},[()=>P.chat_inlineDiffItem_viewer_ariaLabel()]),sn("mouseenter",Le,ie),sn("mouseleave",Le,De),sn("wheel",Le,He),ln("focusin",Le,jt),ln("focusout",Le,qt),w(f,Le);var mn=fn(Lt);return c(),mn}Cr(["focusin","focusout"]);function Sr(f){return[f.stage,f.type,f.oldLineNumber??"",f.newLineNumber??"",f.content].join("\0")}function Do(f){let r=f.oldStart,l=f.newStart;return f.lines.map(a=>{const c={...a,oldLineNumber:a.oldLineNumber??a.oldNumber,newLineNumber:a.newLineNumber??a.newNumber};return c.oldLineNumber===void 0&&c.newLineNumber===void 0?a.type==="Context"?(c.oldLineNumber=r++,c.newLineNumber=l++):a.type==="Deletion"?c.oldLineNumber=r++:a.type==="Addition"&&(c.newLineNumber=l++):a.type==="Context"?(r=(c.oldLineNumber??r)+1,l=(c.newLineNumber??l)+1):a.type==="Deletion"?r=(c.oldLineNumber??r)+1:a.type==="Addition"&&(l=(c.newLineNumber??l)+1),c})}function zo(f,r){const l=f?f.split(`
|
|
1
|
+
var $s=Object.defineProperty;var Fs=(f,r,l)=>r in f?$s(f,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):f[r]=l;var q=(f,r,l)=>Fs(f,typeof r!="symbol"?r+"":r,l);import{t as dn,bo as x,bm as P,bw as un,bq as On,b as hn,bs as je}from"./C0QTy0Sy.js";import{ai as Cr,bs as gn,ca as Be,aD as e,bH as m,a5 as N,bA as L,b_ as z,aw as sn,aj as ln,W as w,bn as fn,bV as J,aA as C,ay as ne,bS as y,bl as de,bO as K,aB as T,c9 as u,a7 as nt,br as tt,bj as sr,c5 as gt,c0 as Hn,a as Us,be as Tt,b$ as ft,bf as or}from"./3SdAC2_C.js";import{i as M}from"./bhKPSdq4.js";import{g as Pt,i as Ln,I as ir,e as ar}from"./B6S6VNu7.js";import{n as cn,l as Ws,c as Bs}from"./DLwWVKiF.js";import{f as En,s as Ve,g as lr}from"./7UPrdiE9.js";import{b as on}from"./Dn334wJv.js";import{Jv as Me,eS as Vs,eJ as Ks,eK as js,o_ as qs,nO as Vt,nS as cr,nR as In,eM as Gs,vF as Qs,vG as Xs,vI as Js,Hy as Ys,JA as Zs,rX as eo,eR as to}from"./_LtUY0jS.js";import{c as no}from"./BWu0YXkV.js";import{F as Ne,a1 as ro,a8 as An,aw as dr,ax as ur,bS as so,aP as oo,cd as hr,bZ as gr,cq as fr}from"./U9jJmfYa.js";import{dH as io,bs as ao,X as lo,aO as mr,p as co}from"./Cppy6ZYG.js";import{L as pr}from"./L7j-Q29w.js";import{C as an}from"./DypB-Dwi.js";import{b8 as kr,bN as uo,bT as ho}from"./CaiHVgqy.js";import{q as $e,d as go,g as fo}from"./CGnOIrwW.js";import"./CrD0jtXE.js";import"./C2jYl_tm.js";/* empty css */import{T as Pr}from"./BUtc5GRR.js";import{g as Nn}from"./bq2jN3Y4.js";import{A as mo}from"./wl2qP2wF.js";import{f as ke}from"./CttA-M7l.js";import{C as po}from"./L0wFy8_j.js";import{C as vo}from"./DlUZpQ7U.js";import{s as vr}from"./BdTfZwM8.js";import{S as Dt}from"./DCL0Px6m.js";import{l as Rt}from"./CE7dsja4.js";import{G as _r}from"./a3TFelkn.js";import{P as _o}from"./DJcj8WvN.js";import{g as wo}from"./BPjvgJzJ.js";import{a8 as bo,Y as So}from"./Df8HaglQ.js";import{ap as yo}from"./yDR0_Br6.js";import{N as wr}from"./CE0T7dwE.js";import{ae as xo,ad as Co,af as ko}from"./BkfS5KoW.js";function br({scrollTop:f,scrollHeight:r,height:l,fitPerfectly:a=!1,fitPerfectlyOverscroll:c=0,overscrollSize:p}){const b=l+p*2,S=a?l+c*2:b;if(r=Math.max(r,S),b>=r||a){const G=Math.max(f-c,0),h=Math.min(f+S,r);return{top:G,bottom:Math.max(h,G)}}let A=f+l/2-b/2,F=A+b;return A<0&&(A=0),F>r&&(F=r),A=Math.floor(Math.max(A,0)),{top:A,bottom:Math.ceil(Math.max(Math.min(F,r),A))}}function Po(f,r){return f==null||r==null?f===r:f.top===r.top&&f.bottom===r.bottom}const Rr=1e3,Ro=Rr*4,Ho=[0,1e-6,.99999,1],Lo={overscrollSize:Rr,intersectionObserverMargin:Ro,resizeDebugging:!1};let rn=0,Io=-1;var Pe,Ao=(Pe=class{constructor(r){q(this,"__id",`virtualizer-${++Io}`);q(this,"config");q(this,"type","simple");q(this,"intersectionObserver");q(this,"scrollTop",0);q(this,"height",0);q(this,"scrollHeight",0);q(this,"windowSpecs",{top:0,bottom:0});q(this,"root");q(this,"contentContainer");q(this,"resizeObserver");q(this,"observers",new Map);q(this,"visibleInstances",new Map);q(this,"visibleInstancesDirty",!1);q(this,"instancesChanged",new Set);q(this,"reconcileQueue",new Set);q(this,"scrollDirty",!0);q(this,"heightDirty",!0);q(this,"scrollHeightDirty",!0);q(this,"renderedObservers",0);q(this,"connectQueue",new Map);q(this,"handleContainerResize",r=>{if(this.root==null)return;let l=!1;for(const a of r){const c=a.borderBoxSize[0].blockSize;this.root instanceof Document?c!==this.scrollHeight&&(this.scrollHeightDirty=!0,l=!0,this.config.resizeDebugging&&(console.log("Virtualizer: content size change",this.__id,{sizeChange:c-rn,newSize:c}),rn=c)):a.target===this.root?c!==this.height&&(this.heightDirty=!0,l=!0):a.target===this.contentContainer&&(this.scrollHeightDirty=!0,l=!0,this.config.resizeDebugging&&(console.log("Virtualizer: scroller size change",this.__id,{sizeChange:c-rn,newSize:c}),rn=c))}l&&$e(this.computeRenderRangeAndEmit)});q(this,"handleWindowResize",()=>{Pe.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"handleWindowScroll",()=>{Pe.__STOP||this.root==null||!(this.root instanceof Document)||(this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"handleElementScroll",()=>{Pe.__STOP||this.root==null||this.root instanceof Document||(this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"computeRenderRangeAndEmit",()=>{if(Pe.__STOP)return;const r=this.heightDirty||this.scrollHeightDirty;let l=this.instancesChanged.size>0;if(this.instancesChanged.size===0){const p=br({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize});if(!r&&Po(this.windowSpecs,p)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.reconcileQueue.size===0)return;this.windowSpecs=p}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;const a=this.getScrollAnchor(this.height),c=new Set;for(const p of r?this.observers.values():this.visibleInstances.values())p.onRender(r)&&c.add(p);for(const p of this.instancesChanged)c.has(p)||p.onRender(r)&&c.add(p);this.scrollFix(a);for(const p of c)this.reconcileQueue.delete(p),p.reconcileHeights();for(const p of this.reconcileQueue)p.reconcileHeights()&&(l=!0);this.reconcileQueue.clear(),l||=this.instancesChanged.size>0,l&&this.markDOMDirty(),(l||r)&&$e(this.computeRenderRangeAndEmit),c.clear(),this.instancesChanged.clear()});q(this,"handleIntersectionChange",r=>{this.scrollDirty=!0;for(const{target:l,isIntersecting:a}of r){if(!(l instanceof HTMLElement))throw new Error("Virtualizer.handleIntersectionChange: target not an HTMLElement");const c=this.observers.get(l);c!=null&&(a&&!this.visibleInstances.has(l)?(c.setVisibility(!0),this.visibleInstances.set(l,c),this.visibleInstancesDirty=!0):!a&&this.visibleInstances.has(l)&&(c.setVisibility(!1),this.visibleInstances.delete(l),this.visibleInstancesDirty=!0))}this.visibleInstancesDirty&&$e(this.computeRenderRangeAndEmit)});this.config={...Lo,...r}}setup(r,l){if(this.root==null){this.root=r,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:Ho,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),r instanceof Document?this.setupWindow():this.setupElement(l),window.__INSTANCE=this,window.__TOGGLE=()=>{Pe.__STOP?(Pe.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:Pe.__lastScrollPosition}),$e(this.computeRenderRangeAndEmit)):(Pe.__lastScrollPosition=this.getScrollTop(),Pe.__STOP=!0)};for(const[a,c]of this.connectQueue.entries())this.connect(a,c);this.connectQueue.clear(),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)}}instanceChanged(r,l){this.instancesChanged.add(r),l&&this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)}requestHeightReconcile(r){this.reconcileQueue.add(r),$e(this.computeRenderRangeAndEmit)}getWindowSpecs(){return this.windowSpecs.top===0&&this.windowSpecs.bottom===0&&(this.windowSpecs=br({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize})),this.windowSpecs}getRoot(){return this.root}isInstanceVisible(r,l){const a=this.getScrollTop(),c=this.getHeight(),p=this.config.intersectionObserverMargin,b=a-p,S=a+c+p;return!(r<b-l||r>S)}setupWindow(){if(this.root==null||!(this.root instanceof Document))throw new Error("Virtualizer.setupWindow: Invalid setup method");window.addEventListener("scroll",this.handleWindowScroll,{passive:!0}),window.addEventListener("resize",this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(r){if(this.root==null||this.root instanceof Document)throw new Error("Virtualizer.setupElement: Invalid setup method");this.root.addEventListener("scroll",this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),r??=this.root.firstElementChild??void 0,r instanceof HTMLElement&&(this.contentContainer=r,this.resizeObserver?.observe(r))}cleanUp(){go(this.computeRenderRangeAndEmit),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener("scroll",this.handleElementScroll),window.removeEventListener("scroll",this.handleWindowScroll),window.removeEventListener("resize",this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.reconcileQueue.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.scrollHeightDirty=!0}getOffsetInScrollContainer(r){return this.getScrollTop()+Kt(r,this.getScrollContainerElement())}connect(r,l){if(this.observers.has(r))throw new Error("Virtualizer.connect: instance is already connected...");return this.intersectionObserver==null?this.connectQueue.set(r,l):(this.intersectionObserver.observe(r),this.observers.set(r,l),this.instancesChanged.add(l),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)),()=>this.disconnect(r)}disconnect(r){const l=this.observers.get(r);this.connectQueue.delete(r),l!=null&&(this.intersectionObserver?.unobserve(r),this.observers.delete(r),this.instancesChanged.delete(l),this.reconcileQueue.delete(l),this.visibleInstances.delete(r)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit))}scrollFix(r){if(r==null)return;const l=this.getScrollContainerElement(),{lineIndex:a,lineOffset:c,fileElement:p,fileOffset:b,fileTypeOffset:S}=r;if(a!=null&&c!=null){const F=p.shadowRoot?.querySelector(`[data-line][data-line-index="${a}"]`);if(F instanceof HTMLElement){const G=Kt(F,l);if(G!==c){const h=G-c;this.applyScrollFix(h)}return}}const A=Kt(p,l);if(S==="top")A!==b&&this.applyScrollFix(A-b);else{const F=A+p.getBoundingClientRect().height;F!==b&&this.applyScrollFix(F-b)}}applyScrollFix(r){this.root==null||this.root instanceof Document?window.scrollTo({top:window.scrollY+r,behavior:"instant"}):this.root.scrollTo({top:this.root.scrollTop+r,behavior:"instant"}),this.markDOMDirty()}getScrollAnchor(r){const l=this.getScrollContainerElement();let a;for(const[c]of this.visibleInstances.entries()){const p=Kt(c,l),b=p+c.offsetHeight;let S,A;b<=0?(S=b,A="bottom"):(S=p,A="top");let F,G;if(b>0&&p<r)for(const oe of c.shadowRoot?.querySelectorAll("[data-line][data-line-index]")??[]){if(!(oe instanceof HTMLElement))continue;const Te=oe.dataset.lineIndex;if(Te==null)continue;const ue=Kt(oe,l);if(!(ue<0)){F=Te,G=ue;break}}if(a?.lineOffset!=null&&G==null)continue;let h=!1;(a==null||G!=null&&(a.lineOffset==null||G<a.lineOffset)||G==null&&a.lineOffset==null&&(S>=0&&(a.fileOffset<0||S<a.fileOffset)||S<0&&a.fileOffset<0&&S>a.fileOffset))&&(h=!0),h&&(a={fileElement:c,fileTypeOffset:A,fileOffset:S,lineIndex:F,lineOffset:G})}return a}getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let r=this.root==null?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return r=this.clampScrollTop(r),this.scrollTop=r,r}scrollTo({top:r,behavior:l="auto"}){const{root:a}=this;if(a==null)return;const c=this.clampScrollTop(r);a instanceof Document?window.scrollTo({top:c,behavior:l}):a.scrollTo({top:c,behavior:l}),this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit)}clampScrollTop(r){return Math.max(0,Math.min(r,this.getScrollHeight()-this.getHeight()))}getScrollHeight(){return this.scrollHeightDirty?(this.scrollHeightDirty=!1,this.scrollHeight=this.root==null?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight,this.scrollHeight):this.scrollHeight}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root==null?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height,this.height):this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return this.root==null||this.root instanceof Document?void 0:this.root}},q(Pe,"__STOP",!1),q(Pe,"__lastScrollPosition",0),Pe);function Kt(f,r){const l=f.getBoundingClientRect(),a=r?.getBoundingClientRect().top??0;return l.top-a}var Eo=T('<div class="absolute inset-0 flex items-center justify-center rounded-lg bg-background/60 backdrop-blur-[2px] transition-opacity duration-spring-moderate ease-spring-moderate motion-reduce:transition-none z-10 pointer-events-none"><div class="flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-xs font-medium text-subtle shadow-lg"><!> </div></div>'),Oo=T("<!> <!>",1),No=T('<div class="flex h-24 items-center justify-start text-left text-subtle"> </div>'),To=T('<div role="region"><!></div>');function Hr(f,r){if(new.target)return dn({component:Hr,...f});gn(r,!0);const l=()=>je(ve,"$sideBySide",a),[a,c]=On(),p=Nn()?.workspaceId??void 0;let b=x(r,"change",7),S=x(r,"foldUnchanged",7,!0),A=x(r,"allowHeadReads",7,!0),F=x(r,"canReadHeadFiles",7),G=x(r,"lineWrapping",7,!1),h=x(r,"scrollToLine",7),oe=x(r,"isAggregate",7,!1),Te=x(r,"showScrollHint",7,!1),ue=x(r,"onStageHunk",7),Q=x(r,"onUnstageHunk",7),at=x(r,"onOpenCommit",7),pt=x(r,"virtualizer",7),vt=x(r,"gitRootId",7,void 0),_t=x(r,"gitRootPath",7,void 0);const ve=kr();let Re=J(!1),Se=J(!1),Fe=J(!1),Ue=J(0),qe=J(void 0);const $=80;function ie(){m(Se,!0)}function De(){m(Se,!1),m(Fe,!1),m(Ue,0)}function He(v){!e(Se)||e(Re)||(m(Ue,e(Ue)+Math.abs(v.deltaY)),e(Ue)>=$&&!e(Fe)&&m(Fe,!0))}function jt(){m(Re,!0),m(Fe,!1),m(Ue,0)}function qt(v){e(qe)&&!e(qe).contains(v.relatedTarget)&&m(Re,!1)}Be(()=>{(e(Re)||!e(Se))&&(m(Fe,!1),m(Ue,0))});let Ht=u(()=>{const{toolCallId:v,filePath:_e,additions:Qe,deletions:St,oldContent:re,newContent:Xe}=b(),rt="staged"in b()&&b().staged===!0,Ke="category"in b()?b().category:void 0,At="commitHash"in b()?b().commitHash:void 0,zt="gitlink"in b()?b().gitlink:void 0,Mt="isFullFileContent"in b()?b().isFullFileContent:!1;let yt;return Ke==="committed"?yt=an.Committed:rt?yt=an.Staged:yt=an.Unstaged,{id:v,file:_e,relativePath:_e,stage:yt,commitHash:At,gitlink:zt,stats:{additions:Qe,deletions:St},attribution:{timestamp:0},content:re!==void 0||Xe!==void 0?{oldContent:re??"",newContent:Xe??"",isFullFileContent:Mt}:void 0}});const D=u(()=>b().isFullFileContent?1:("chunks"in b()?b().chunks?.[0]?.newStart:void 0)??b().startLineNumber??1);var Lt={get change(){return b()},set change(v){b(v),C()},get foldUnchanged(){return S()},set foldUnchanged(v=!0){S(v),C()},get allowHeadReads(){return A()},set allowHeadReads(v=!0){A(v),C()},get canReadHeadFiles(){return F()},set canReadHeadFiles(v){F(v),C()},get lineWrapping(){return G()},set lineWrapping(v=!1){G(v),C()},get scrollToLine(){return h()},set scrollToLine(v){h(v),C()},get isAggregate(){return oe()},set isAggregate(v=!1){oe(v),C()},get showScrollHint(){return Te()},set showScrollHint(v=!1){Te(v),C()},get onStageHunk(){return ue()},set onStageHunk(v){ue(v),C()},get onUnstageHunk(){return Q()},set onUnstageHunk(v){Q(v),C()},get onOpenCommit(){return at()},set onOpenCommit(v){at(v),C()},get virtualizer(){return pt()},set virtualizer(v){pt(v),C()},get gitRootId(){return vt()},set gitRootId(v=void 0){vt(v),C()},get gitRootPath(){return _t()},set gitRootPath(v=void 0){_t(v),C()},$set:un,$on:(v,_e)=>hn(r,v,_e)},Le=To();let wt;var It=N(Le);{var Ge=v=>{var _e=Oo(),Qe=ne(_e);{let Xe=u(()=>l()?"split":"unified");Pr(Qe,{get change(){return e(Ht)},get workspaceId(){return p},get viewMode(){return e(Xe)},get foldUnchanged(){return S()},get lineWrapping(){return G()},get onStageHunk(){return ue()},get onUnstageHunk(){return Q()},useProvidedContent:!0,get allowHeadReads(){return A()},get canReadHeadFiles(){return F()},get lineOffset(){return e(D)},get virtualizer(){return pt()},get gitRootId(){return vt()},get gitRootPath(){return _t()}})}var St=y(Qe,2);{var re=Xe=>{var rt=Eo(),Ke=N(rt),At=N(Ke);Ne(At,{get icon(){return ro},class:"w-3 h-3"});var zt=y(At);L(Ke),L(rt),z(Mt=>K(zt,` ${Mt??""}`),[()=>P.chat_inlineDiffItem_clickToScroll_label()]),cn(1,rt,()=>Ws,()=>({tier:"fast",y:0,scale:1})),cn(2,rt,()=>Bs,()=>({tier:"fast"})),w(Xe,rt)};M(St,Xe=>{Te()&&e(Fe)&&Xe(re)})}w(v,_e)},bt=v=>{var _e=No(),Qe=de(_e,!0);z(St=>K(Qe,St),[()=>P.chat_inlineDiffItem_noWorkspace_label()]),w(v,_e)};M(It,v=>{p?v(Ge):v(bt,-1)})}L(Le),on(Le,v=>m(qe,v),()=>e(qe)),z(v=>{wt=En(Le,1,"inline-diff-container relative",null,wt,{focused:e(Re)}),Ve(Le,"aria-label",v)},[()=>P.chat_inlineDiffItem_viewer_ariaLabel()]),sn("mouseenter",Le,ie),sn("mouseleave",Le,De),sn("wheel",Le,He),ln("focusin",Le,jt),ln("focusout",Le,qt),w(f,Le);var mn=fn(Lt);return c(),mn}Cr(["focusin","focusout"]);function Sr(f){return[f.stage,f.type,f.oldLineNumber??"",f.newLineNumber??"",f.content].join("\0")}function Do(f){let r=f.oldStart,l=f.newStart;return f.lines.map(a=>{const c={...a,oldLineNumber:a.oldLineNumber??a.oldNumber,newLineNumber:a.newLineNumber??a.newNumber};return c.oldLineNumber===void 0&&c.newLineNumber===void 0?a.type==="Context"?(c.oldLineNumber=r++,c.newLineNumber=l++):a.type==="Deletion"?c.oldLineNumber=r++:a.type==="Addition"&&(c.newLineNumber=l++):a.type==="Context"?(r=(c.oldLineNumber??r)+1,l=(c.newLineNumber??l)+1):a.type==="Deletion"?r=(c.oldLineNumber??r)+1:a.type==="Addition"&&(l=(c.newLineNumber??l)+1),c})}function zo(f,r){const l=f?f.split(`
|
|
2
2
|
`):[],a=r?r.split(`
|
|
3
3
|
`):[];if(l.length===0&&a.length===0)return[];const c=[];for(const p of l)c.push({type:"Deletion",content:p});for(const p of a)c.push({type:"Addition",content:p});return[{oldStart:1,oldLines:l.length,newStart:1,newLines:a.length,lines:c}]}function Mo(f){if(!f||f.length===0)return[];const r=[];for(const a of f){let c=a.change.chunks||[];c.length===0&&(a.change.oldContent!=null||a.change.newContent!=null)&&(c=zo(a.change.oldContent??"",a.change.newContent??"")),c.forEach((p,b)=>{r.push({hunk:p,stage:a.category,part:a,hunkIndex:b})})}if(r.length===0)return[];r.sort((a,c)=>a.hunk.newStart-c.hunk.newStart);const l=[];for(const{hunk:a,stage:c,hunkIndex:p}of r){const S=Do(a).map(A=>({type:A.type,content:A.content,oldLineNumber:A.oldLineNumber,newLineNumber:A.newLineNumber,stage:c,hunkIndex:p}));l.push({headStart:a.oldStart,headLines:a.oldLines,wtStart:a.newStart,wtLines:a.newLines,lines:S,stages:new Set([c])})}return $o(l)}function $o(f){if(f.length<=1)return f;const r=[];let l=f[0];for(let a=1;a<f.length;a++){const c=f[a],p=l.wtStart+l.wtLines;c.wtStart<=p+3?l=Fo(l,c):(r.push(l),l=c)}return r.push(l),r}function Fo(f,r){const l=new Map,a=new Map,c=new Set;for(const h of f.lines)c.add(Sr(h)),h.newLineNumber!==void 0&&l.set(h.newLineNumber,h),h.oldLineNumber!==void 0&&h.type!=="Addition"&&a.set(h.oldLineNumber,h);const p=[...f.lines];for(const h of r.lines){const oe=Sr(h);if(!c.has(oe)){if(h.type==="Context"){const Te=h.newLineNumber!==void 0?l.get(h.newLineNumber):void 0,ue=h.oldLineNumber!==void 0?a.get(h.oldLineNumber):void 0;if(Te?.type==="Context"||ue?.type==="Context"){c.add(oe);continue}}p.push(h),c.add(oe),h.newLineNumber!==void 0&&l.set(h.newLineNumber,h),h.oldLineNumber!==void 0&&h.type!=="Addition"&&a.set(h.oldLineNumber,h)}}p.sort((h,oe)=>{const Te=h.newLineNumber??h.oldLineNumber??0,ue=oe.newLineNumber??oe.oldLineNumber??0;return Te-ue});const b=new Set([...f.stages,...r.stages]),S=Math.min(f.headStart,r.headStart),A=Math.min(f.wtStart,r.wtStart),F=Math.max(f.headStart+f.headLines,r.headStart+r.headLines),G=Math.max(f.wtStart+f.wtLines,r.wtStart+r.wtLines);return{headStart:S,headLines:F-S,wtStart:A,wtLines:G-A,lines:p,stages:b}}function Uo(f){const r=[],l=[];let a=f[0]?.headStart??1,c=f[0]?.wtStart??1;const p=(b,S,A)=>{let F=S;for(;F<A;)b.push(""),F++;return F};for(const b of f){a=p(r,a,b.headStart),c=p(l,c,b.wtStart);for(const S of b.lines)S.type==="Context"?(S.oldLineNumber!==void 0&&(a=p(r,a,S.oldLineNumber)),S.newLineNumber!==void 0&&(c=p(l,c,S.newLineNumber)),r.push(S.content),l.push(S.content),a++,c++):S.type==="Deletion"?(S.oldLineNumber!==void 0&&(a=p(r,a,S.oldLineNumber)),r.push(S.content),a++):S.type==="Addition"&&(S.newLineNumber!==void 0&&(c=p(l,c,S.newLineNumber)),l.push(S.content),c++)}return{oldContent:r.join(`
|
|
4
4
|
`),newContent:l.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ao as s}from"./3SdAC2_C.js";import{d as r}from"./
|
|
1
|
+
import{ao as s}from"./3SdAC2_C.js";import{d as r}from"./DrG_DaSS.js";const t=()=>{const e=r;return{page:{subscribe:e.page.subscribe},navigating:{subscribe:e.navigating.subscribe},updated:e.updated}},c={subscribe(e){return(s?o("page"):t().page).subscribe(e)}};function o(e){try{return t()[e]}catch{throw new Error(`Cannot subscribe to '${e}' store on the server outside of a Svelte component, as it is bound to the current request via component context. This prevents state from leaking between users.For more information, see https://svelte.dev/docs/kit/state-management#avoid-shared-state-on-the-server`)}}export{c as p};
|