@intent-hq/web 2.342.5 → 2.342.7
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/{BU-iKTox.js → -uz97i1u.js} +1 -1
- package/web/app/immutable/chunks/{D1NmEmqB.js → 0__pctoR.js} +4 -4
- package/web/app/immutable/chunks/{xWqZTTcb.js → 0uQlOtUt.js} +1 -1
- package/web/app/immutable/chunks/{D-ZUE96G.js → 2bL-DWF8.js} +1 -1
- package/web/app/immutable/chunks/{CIvLO5u3.js → 3-IHKjlM.js} +1 -1
- package/web/app/immutable/chunks/{Dav9TY89.js → 5BF5QoAt.js} +2 -2
- package/web/app/immutable/chunks/{xqTOvfYK.js → 7fhht5I8.js} +1 -1
- package/web/app/immutable/chunks/{zhV4pxah.js → 81Mgflg6.js} +2 -2
- package/web/app/immutable/chunks/{BSdbHZ8z.js → B-tJCxfF.js} +1 -1
- package/web/app/immutable/chunks/{DJpCOlC8.js → B1tryRmt.js} +1 -1
- package/web/app/immutable/chunks/{CgrygJV3.js → B2EoBFvF.js} +1 -1
- package/web/app/immutable/chunks/{DYWAzny3.js → B43n18i9.js} +2 -2
- package/web/app/immutable/chunks/{D96ib-I5.js → B4bu8I3l.js} +1 -1
- package/web/app/immutable/chunks/{uX_fRBME.js → B6M0mzGV.js} +1 -1
- package/web/app/immutable/chunks/{C-6qbf4N.js → B7E7WOal.js} +1 -1
- package/web/app/immutable/chunks/{D77Zy4An.js → B9fp6kqr.js} +1 -1
- package/web/app/immutable/chunks/{Be1jptX6.js → BFKxmV8S.js} +2 -2
- package/web/app/immutable/chunks/{Djv-oe2E.js → BK4fUwIg.js} +1 -1
- package/web/app/immutable/chunks/{CySMzPv8.js → BKpOvX9G.js} +1 -1
- package/web/app/immutable/chunks/{DFmEtG_9.js → BN8k_LN_.js} +1 -1
- package/web/app/immutable/chunks/{C7EyPIPK.js → BOu-FYZd.js} +1 -1
- package/web/app/immutable/chunks/{VU_dEs1O.js → BOzoiihY.js} +1 -1
- package/web/app/immutable/chunks/{VemCiT-h.js → BQHdX7oS.js} +1 -1
- package/web/app/immutable/chunks/{Cj5DhOJq.js → BRv1ZXfD.js} +1 -1
- package/web/app/immutable/chunks/{DMKEf35d.js → BRvExEEH.js} +1 -1
- package/web/app/immutable/chunks/{Blf45GFr.js → BU93jIdu.js} +1 -1
- package/web/app/immutable/chunks/{DSCfIpEg.js → BUBF8pb7.js} +1 -1
- package/web/app/immutable/chunks/{CQLWXrdV.js → BVqUxKN1.js} +1 -1
- package/web/app/immutable/chunks/{DisP4tLe.js → BYAu4CZw.js} +2 -2
- package/web/app/immutable/chunks/{BO1j1ixt.js → Bfo8_CU3.js} +1 -1
- package/web/app/immutable/chunks/{B0_qkqY_.js → BfzEsPph.js} +1 -1
- package/web/app/immutable/chunks/{Cj4_fE_Z.js → Bg8qfflO.js} +1 -1
- package/web/app/immutable/chunks/{C2EFFsXa.js → Bj0GWDrC.js} +1 -1
- package/web/app/immutable/chunks/{DhMpGM70.js → BjGjodbN.js} +1 -1
- package/web/app/immutable/chunks/{DzXMRkfF.js → BnitCeat.js} +1 -1
- package/web/app/immutable/chunks/{DtCouCNA.js → BrFp3_k_.js} +1 -1
- package/web/app/immutable/chunks/{lik_9VSn.js → BrVbupVh.js} +1 -1
- package/web/app/immutable/chunks/{CcPtU8UW.js → BsTn55iz.js} +1 -1
- package/web/app/immutable/chunks/{qT0nknp5.js → BsZkUggd.js} +1 -1
- package/web/app/immutable/chunks/{TjCk4I06.js → Bs_ptKn3.js} +1 -1
- package/web/app/immutable/chunks/{CBlkSpHT.js → BtMkC507.js} +1 -1
- package/web/app/immutable/chunks/{LaNiSp-z.js → Bv3dwTkC.js} +3 -3
- package/web/app/immutable/chunks/{CYi-3y1a.js → BvUkJ09o.js} +1 -1
- package/web/app/immutable/chunks/{Ab20mLmH.js → BvjuBRrU.js} +1 -1
- package/web/app/immutable/chunks/{DX1PnF-2.js → Byoirc2y.js} +1 -1
- package/web/app/immutable/chunks/{BVhqJMlz.js → C-XuUNtI.js} +1 -1
- package/web/app/immutable/chunks/{CnsfGu51.js → C-YuekNV.js} +1 -1
- package/web/app/immutable/chunks/{fv5BUC0x.js → C1gsmzFP.js} +1 -1
- package/web/app/immutable/chunks/{DP7f3kY3.js → CA9igU-5.js} +1 -1
- package/web/app/immutable/chunks/{CigGYFQE.js → CC5PGmW5.js} +6 -6
- package/web/app/immutable/chunks/{BtwTtkFh.js → CFA_J9HH.js} +1 -1
- package/web/app/immutable/chunks/{BO7wBdO6.js → CFGZklSa.js} +1 -1
- package/web/app/immutable/chunks/{9I9M5TBJ.js → CNcAWnlk.js} +1 -1
- package/web/app/immutable/chunks/{fWUdssGw.js → CO6o0ow_.js} +1 -1
- package/web/app/immutable/chunks/CVGihEeT.js +4 -0
- package/web/app/immutable/chunks/{BCnX9t4a.js → CXcj874Z.js} +1 -1
- package/web/app/immutable/chunks/{DDFZpvPx.js → Cb_UaPU9.js} +1 -1
- package/web/app/immutable/chunks/{DUs9bSzD.js → CdfzwZnI.js} +1 -1
- package/web/app/immutable/chunks/{eHDwA5XP.js → CdzjY4ym.js} +1 -1
- package/web/app/immutable/chunks/{DkjCEo5b.js → Cf1dxYi1.js} +1 -1
- package/web/app/immutable/chunks/{CtkAQ7oC.js → ChXvE919.js} +1 -1
- package/web/app/immutable/chunks/{DnSVyFe6.js → CkE1XUst.js} +1 -1
- package/web/app/immutable/chunks/{B9ZSdq0q.js → CpSD2n1c.js} +1 -1
- package/web/app/immutable/chunks/{gobvQJh-.js → CqVlcKvY.js} +1 -1
- package/web/app/immutable/chunks/{DKenUM6A.js → CtuToPdI.js} +1 -1
- package/web/app/immutable/chunks/{jW3hslOU.js → Cw81XEbl.js} +1 -1
- package/web/app/immutable/chunks/{C2_NbCok.js → CxXJfgTo.js} +2 -2
- package/web/app/immutable/chunks/{BNH24FIO.js → Cy81Kj9q.js} +1 -1
- package/web/app/immutable/chunks/{DNJxn0wo.js → CyCduoBz.js} +1 -1
- package/web/app/immutable/chunks/{CVAh3mzO.js → D-bwIL9J.js} +1 -1
- package/web/app/immutable/chunks/{uytaZeoE.js → D2iF6A-U.js} +1 -1
- package/web/app/immutable/chunks/{VD7jBGIa.js → D4bct-7B.js} +1 -1
- package/web/app/immutable/chunks/{CePSYC9W.js → D6x_Ypsw.js} +1 -1
- package/web/app/immutable/chunks/{BEwb8M62.js → DDH0zMMC.js} +1 -1
- package/web/app/immutable/chunks/{BmbBYGbu.js → DGtUk2rN.js} +1 -1
- package/web/app/immutable/chunks/{DPYAIBdn.js → DICqSOP4.js} +1 -1
- package/web/app/immutable/chunks/{D85uTUYL.js → DLbna4Xr.js} +1 -1
- package/web/app/immutable/chunks/{Cz-8OuDt.js → DMKQGy8l.js} +1 -1
- package/web/app/immutable/chunks/{D51Ok7Sl.js → DSEUYTjc.js} +1 -1
- package/web/app/immutable/chunks/{CW8eu9Fc.js → DStb0AX2.js} +1 -1
- package/web/app/immutable/chunks/DYoD7wrn.js +175 -0
- package/web/app/immutable/chunks/{jvcXRR0d.js → DZ1h_h8F.js} +1 -1
- package/web/app/immutable/chunks/{BX3J6LtW.js → D_m2fm5D.js} +1 -1
- package/web/app/immutable/chunks/{BeIjMbrN.js → DaWaPdpr.js} +1 -1
- package/web/app/immutable/chunks/{CEi628Ly.js → Dc6iElDg.js} +1 -1
- package/web/app/immutable/chunks/{tjMxf7Rt.js → DeK9Yn3O.js} +1 -1
- package/web/app/immutable/chunks/{aCgYXkiq.js → DlyBQNia.js} +1 -1
- package/web/app/immutable/chunks/{B0ssL2xu.js → Dm2ss5_c.js} +1 -1
- package/web/app/immutable/chunks/{BA2lJblc.js → DnST-fUG.js} +1 -1
- package/web/app/immutable/chunks/{DvLU4NvH.js → DndetRc8.js} +1 -1
- package/web/app/immutable/chunks/{BEbaPOYh.js → DrZKgclg.js} +1 -1
- package/web/app/immutable/chunks/{CFd_BR6h.js → Dwp3tM-t.js} +1 -1
- package/web/app/immutable/chunks/{wN7G2Ia4.js → DzOaHgXZ.js} +1 -1
- package/web/app/immutable/chunks/{BD-KZLHv.js → DzVW75sP.js} +2 -2
- package/web/app/immutable/chunks/{NbtAw81Q.js → DztaK47x.js} +3 -3
- package/web/app/immutable/chunks/{BH4ln8o3.js → EHIIQoaI.js} +1 -1
- package/web/app/immutable/chunks/{CYd9CxM2.js → GMPlwEyF.js} +1 -1
- package/web/app/immutable/chunks/{BXF4phu3.js → IvT7mBeW.js} +1 -1
- package/web/app/immutable/chunks/{u4y-pfzC.js → KJKVPohZ.js} +1 -1
- package/web/app/immutable/chunks/{BHuMIaB-.js → KTGIW7-i.js} +1 -1
- package/web/app/immutable/chunks/{B2V9AEgR.js → Pm0lnWkx.js} +1 -1
- package/web/app/immutable/chunks/{B-UTQE9n.js → RwDyEmMe.js} +1 -1
- package/web/app/immutable/chunks/{BD82W8Bt.js → XLnbre-3.js} +3 -3
- package/web/app/immutable/chunks/{C0KM0FtB.js → XOWNhrWJ.js} +3 -3
- package/web/app/immutable/chunks/{DPprzF9n.js → ZuMFBEjQ.js} +1 -1
- package/web/app/immutable/chunks/{O5l0RJYc.js → aC4tGXL1.js} +1 -1
- package/web/app/immutable/chunks/{BgCuVUEx.js → dbcXdsxE.js} +1 -1
- package/web/app/immutable/chunks/{BXAV7QDz.js → dyXuuMGX.js} +1 -1
- package/web/app/immutable/chunks/{Buz03DoT.js → jKsfsjyZ.js} +4 -4
- package/web/app/immutable/chunks/{BlY9wYzn.js → jNO-OB34.js} +12 -12
- package/web/app/immutable/chunks/{BYQopcl_.js → lEJsx3hZ.js} +1 -1
- package/web/app/immutable/chunks/{B9MR2qKJ.js → mczrSehj.js} +1 -1
- package/web/app/immutable/chunks/{DtVHsKFz.js → nwXxUBuS.js} +1 -1
- package/web/app/immutable/chunks/{CJBdHKP3.js → ph8Nd_I4.js} +1 -1
- package/web/app/immutable/chunks/{C8HFCtQc.js → sCpE28HM.js} +4 -4
- package/web/app/immutable/chunks/{bRNHBr3p.js → uKWO-p3P.js} +1 -1
- package/web/app/immutable/chunks/{CovxsylF.js → uRAjPX0f.js} +1 -1
- package/web/app/immutable/chunks/{Y1stQAOD.js → vmBlHv-D.js} +1 -1
- package/web/app/immutable/chunks/{CmOh1j88.js → wdhpIuGJ.js} +1 -1
- package/web/app/immutable/chunks/{C2SncAbm.js → weVd7rrQ.js} +3 -3
- package/web/app/immutable/chunks/{CKhvCB1c.js → wiJ30FmU.js} +1 -1
- package/web/app/immutable/chunks/{DiEYOblK.js → x3Z0Jdd-.js} +1 -1
- package/web/app/immutable/chunks/{B5BS4m6v.js → yOUGavVw.js} +1 -1
- package/web/app/immutable/chunks/{BLwzhvkL.js → yoNS8YEK.js} +1 -1
- package/web/app/immutable/entry/{app.Cm8DHtWj.js → app.R58o80xF.js} +2 -2
- package/web/app/immutable/entry/start.CE-s8jdK.js +1 -0
- package/web/app/immutable/nodes/{0.pEooyJKH.js → 0.ZRuBCk9D.js} +1 -1
- package/web/app/immutable/nodes/{1.CbjXsHd9.js → 1.Dbrbs161.js} +1 -1
- package/web/app/immutable/nodes/{10.Q77UiFRH.js → 10.LXIiQtGr.js} +1 -1
- package/web/app/immutable/nodes/{14.C-qEjPAS.js → 14.BWSpr9xw.js} +1 -1
- package/web/app/immutable/nodes/{17.caLOiGPT.js → 17.CxskJc_c.js} +2 -2
- package/web/app/immutable/nodes/{2.PREGdjWy.js → 2.Cq-DTeBS.js} +4 -4
- package/web/app/immutable/nodes/{3.DF3rA8tZ.js → 3.-sm_jIPB.js} +1 -1
- package/web/app/immutable/nodes/{4.BFLefrw4.js → 4.Ckk9ehoz.js} +1 -1
- package/web/app/immutable/nodes/{5.B7tCZt0m.js → 5.DMX5buaT.js} +1 -1
- package/web/app/immutable/nodes/{6.B4T5XCJq.js → 6.Bn75feRA.js} +1 -1
- package/web/app/immutable/nodes/{7.mplXPh2f.js → 7.DXLw3Vcp.js} +1 -1
- package/web/app/immutable/nodes/{8.jv6gXmsb.js → 8.Co83gfVy.js} +4 -4
- package/web/app/immutable/nodes/{9.CCQEjL0t.js → 9.BkOJTqq8.js} +4 -4
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/chunks/CtN89xMf.js +0 -4
- package/web/app/immutable/chunks/XL6L6bac.js +0 -175
- package/web/app/immutable/entry/start.DYkk2YwH.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/
|
|
2
|
-
var Ct=Object.defineProperty;var Dt=(e,t,n)=>t in e?Ct(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pe=(e,t,n)=>Dt(e,typeof t!="symbol"?t+"":t,n);import{B as xt,O as Rt,dG as Be,cG as pe,dr as Pt,al as Bt,b1 as Ge,z as Ot,dS as $t}from"./D3QcPFoL.js";import{Iy as A,g as be,nx as x,vN as Ut,By as Ye,vP as Lt,CL as Je,cx as Nt,cy as Ht,ny as Qe,nk as Ft,c as ke,fF as Kt,lN as Wt,cF as jt}from"./D5ej8a-y.js";import{e as qt,b as ae,F as Vt,y as re,_ as ve,G as zt,C as Gt,W as Xe,v as Yt,u as Jt,M as Qt}from"./ppRpwazH.js";import{D as Oe,a as Xt,d as Zt}from"./CQcEqK4G.js";import{l as en,o as tn,g as Ze,r as nn,m as an,D as rn}from"./DhdZyawh.js";import{a as et,e as sn}from"./RD9QY1Yc.js";import{f as on}from"./D83cNVE7.js";import{bp as b,_ as fe}from"./DXyyWeag.js";import{a9 as tt,aA as se,J as he,a as nt,n as at,cQ as rt,e as st,aH as it,M as cn,ab as ln,aT as $e,d as le,C as dn,cR as un,U as mn,a6 as pn,aI as fn,bY as hn}from"./Blf45GFr.js";import{bD as gn,bq as yn,aX as wn,by as bn,bs as kn,ax as vn}from"./Bfr1QjPr.js";import{O as _n,z as Sn}from"./DyvrH0mm.js";import{t as q,q as Mn,v as An}from"./BboIV5H5.js";import{x as In,J as Tn,ai as En,ar as Cn}from"./C2SncAbm.js";import{a as Ue,b as Dn,g as xn}from"./DypB-Dwi.js";import{z as Rn}from"./CRsmjbca.js";import{C as Pn}from"./BvFAWM27.js";import{i as Bn}from"./BP-Q7b0i.js";import{o as $,e as On,l as V,s as E,n as ce,b as $n,d as Un,c as Ln}from"./CIyUrgF0.js";function Cr(e,t){if(e)return e.model}function Nn({messages:e,pendingInitialPrompt:t,pendingContextReferenceCount:n=0}){return e.length>0||!!t||n>0}function Dr({session:e,messages:t,pendingInitialPrompt:n,pendingContextReferenceCount:a=0}){return!(e?xt(e):!1)&&!Nn({messages:t,pendingInitialPrompt:n,pendingContextReferenceCount:a})}function xr(e){return Rt(e.messageMetadata)}function Hn(e){return{id:e.id,appMessageId:e.appMessageId,role:"user",timestamp:new Date(e.createdAt??0).toISOString(),contentBlocks:[...e.content?[{type:"text",text:e.content}]:[],...e.imageBlocks??[],...e.fileBlocks??[]],metadata:e.messageMetadata,...e.author!==void 0?{author:e.author}:{}}}function Rr(e){return Hn({...e,createdAt:Date.parse(e.queuedAt)})}const Fn=8*1024*1024,Kn=3*1024*1024;function Wn(e){return Math.ceil(Math.max(0,e)/3)*4}function jn(e){const t=e.promptBase64Bytes;return e.mimeType==="image/jpeg"&&Number.isSafeInteger(e.size)&&e.size>0&&e.size<=Kn&&typeof t=="number"&&t===Wn(e.size)?t:null}async function ot(e,t,n,a,r=()=>{}){const s=()=>{if(!a())throw new Error("media-send-retired")};if(s(),r("overlay-render"),!n.exportMedia)throw new Error("media-export-unavailable");const i=en(e.source,e.saved);if(i.length>1e4)throw new Error("media-animation-layer-limit");const o=[];for(const c of i)s(),o.push({...c,png:await tn(e.source,e.saved,c.atMs)});s(),r("export");const l=await n.exportMedia({outputVersion:qt,jobId:t,media:e,layers:o});if(s(),!l.ok)throw new Error(["media-export-failed",l.error].filter(Boolean).join(":"));return{jobId:t,value:l.value}}const _e={CLIPBOARD_WRITE:"dock-media:clipboard-write",CLIPBOARD_READ:"dock-media:clipboard-read",MENU:"dock-media:menu"};function Le(e,t){return Math.max(0,(e.pausedAt??t)-e.startedAt-(e.pausedMs??0))}function ge(e,t){if(!t?.startsWith(".intent/attachments/"))return;const n=t.split("/").map(encodeURIComponent).join("/"),a=tt(`intent://local/file/${n}`,e);return a?.kind==="video"?a.url:void 0}function qn(e){const t=e.video==="full"?b.dock_captureEditor_videoFull_label():b.dock_captureEditor_videoHighlights_label(),n=e.voice==="audio"?b.dock_captureEditor_voiceAudio_label():e.voice==="transcript"?b.dock_captureEditor_voiceTranscript_label():b.dock_captureEditor_voiceOff_summary();return`${t} · ${n}`}function Vn(e,t,n,a){if(a?.error==="permission")return a.kind==="pick"?"accessibility":"screen";if(e==="permission"||t==="permission")return"screen";if(n?.startsWith("microphone-permission"))return"microphone";if(n?.startsWith("speech-permission"))return"speech"}const j=on;function Pr(e){const{view:t,items:n,local:a,labels:r,copy:s}=e,i=t.speech.error??t.speech.capability?.reason??null,o=Vn(t.captureError,t.clips.find(g=>g.status==="failed"&&g.error==="permission")?.error??null,i,t.annotationIssue),l=t.annotationIssue?.error==="unavailable"?s?.annotationUnavailable:void 0,c=t.annotationIssue,d=t.captureError==="permission",u=c?.error==="permission"&&c.kind!=="pick",h=c?.error==="permission"&&c.kind==="pick",p=i?.startsWith("speech-permission")?"speech":i?.startsWith("microphone-permission")||i==="permission"?"microphone":void 0,m={},y={},f=(g,D,L)=>{m[g]=D,L&&(y[g]=L)};s&&(d&&(f("capture",s.permission,"screen"),t.recording||f("record",s.permission,"screen")),u&&!t.annotating&&f("annotate",s.permission,"screen"),h&&(f("pick",s.accessibilityPermission,"accessibility"),t.tool==="pick"&&!t.annotating&&f("annotate",s.accessibilityPermission,"accessibility")),p&&!t.dictation&&f("mic",(i&&r.speechError?.(i))??s.speechPermission,p));const k=g=>{const D=y[g];D&&e.actions.onOpenSettings(D)},v=new Set(t.evidenceOwnedItemIds),I=t.clips.find(g=>g.status==="recording"),S=t.clips.length>=ae.clips,_=t.capabilities,B=t.speech.available,C=new Set(t.clips.filter(g=>g.status==="recording"||g.status==="placing"||!!g.media).flatMap(g=>g.captureHistory?.map(D=>D.image.id)??[])),P=[...t.tiles.filter(({image:g,marks:D})=>!!g.media||g.source!=="annotate"||!C.has(g.id)||D.some(({mark:L})=>!L.clipId)).map(({image:g,marks:D})=>({kind:"image",id:g.contextItemId,url:a.previews[g.id]??"",markCount:D.length,owner:"evidence",...a.previews[g.id]?{}:{status:"placing"}})),...t.clips.filter(g=>!g.discarding).map(g=>({kind:"clip",id:g.contextItemId??g.id,duration:j(g.status==="recording"?Le(g,a.now):g.durationMs),recording:g.status==="recording",...g.media?.saved?{summary:qn(g.media.saved)}:{},...g.status==="ready"&&ge(e.workspaceId,g.path)?{url:ge(e.workspaceId,g.path)}:{},owner:"evidence",...g.status==="placing"?{status:"placing"}:{},...g.status==="failed"?{status:"failed",...g.error==="limit"?{error:b.dock_composer_clipTooLarge_error()}:{}}:{}})),...n.filter(g=>!v.has(g.id)).map(g=>({...g.imageData&&g.imageMimeType?{kind:"image",id:g.id,url:`data:${g.imageMimeType};base64,${g.imageData}`,markCount:0,file:{name:g.label,imageData:g.imageData,imageMimeType:g.imageMimeType}}:{kind:"file",id:g.id,name:g.label},owner:"attachment",...g.placementStatus==="placing"?{status:"placing"}:{},...g.placementStatus==="failed"?{status:"failed",error:g.placementError}:{}}))];return{mediaStatus:t.recording?{kind:"recording",label:r.recording}:t.dictation?{kind:"listening",label:r.listening}:t.annotating?{kind:"annotating",label:r.annotating}:void 0,...o?{settingsPane:o}:{},...l?{annotationNotice:l}:{},labels:r,attachments:P,...s?{placeholder:t.dictation?"":s.idle}:{},state:{captureRevision:t.captureAccepted,capturePending:t.capturePending,captureDisabled:!_.capture||t.captureDisabled,...t.captureDisabled?{captureTooltip:r.captureLimit}:{},captureMode:t.evidence?.annotation?"fullscreen":t.captureMode,captureModesAvailable:!!_.captureModes&&!t.evidence?.annotation,annotationActive:t.annotating,tool:t.tool,toolUsed:t.toolUsed,annotationDisabled:!_.annotate,recording:t.recording&&!I?.discarding,recordingDisabled:!!I?.discarding||!t.recording&&(!_.record||S),...S&&!t.recording?{recordingTooltip:r.clipLimit}:{},recordingTime:j(I?Le(I,a.now):0),dictating:!!t.dictation,dictationPending:t.speech.pending||t.dictation?.status==="transcribing",dictationDisabled:!B&&!t.dictation&&!m.mic,...t.speech.error&&r.speechError?{dictationTooltip:r.speechError(t.speech.error)}:{},dictationTime:t.dictation?j(a.now-t.dictation.startedAt):j(0),inputLevels:t.speech.levels,...Object.keys(m).length?{alerts:m}:{}},...e.actions,...t.fileAttachmentsEnabled===!1?{onEdit:void 0}:{},onAlert:k,beforeSubmit:e.beforeSubmit}}const Se=()=>globalThis.electronAPI,zn=["image/png","image/jpeg","image/webp"],Ne=e=>zn.includes(e??"")?e:null;function He(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a+=1)n[a]=t.charCodeAt(a);return n}async function Br(e,t){const{view:n,items:a,previews:r}=t,s=n.tiles.find(({image:c})=>c.id===e||c.contextItemId===e);if(s){const c=a.find(p=>p.id===s.image.contextItemId),d=s.image.media;if(s.image.mediaError)return null;if(d?.saved){if(!t.createSavedPreviewUrl||!t.revokeUrl)return null;const p={...d,saved:d.saved},m=await t.createSavedPreviewUrl(t.workspaceId,p);try{const y=await t.fetchBytes(m),f=p.saved.crop;return{kind:"image",name:c?.label||"screenshot.png",mimeType:"image/png",bytes:y,intent:{pixels:{mimeType:"image/png",width:Math.max(1,Math.round(f?.w??p.source.width)),height:Math.max(1,Math.round(f?.h??p.source.height)),displayScale:s.image.displayScale,capturedAt:s.image.capturedAt},raw:y,marks:[]}}}finally{t.revokeUrl(m)}}const u=Ne(c?.imageMimeType),h=r[s.image.id];return!c?.imageData||!u||!h?null:{kind:"image",name:c.label||"screenshot.png",mimeType:"image/png",bytes:await t.fetchBytes(h),intent:{pixels:{mimeType:u,width:s.image.width,height:s.image.height,displayScale:s.image.displayScale,capturedAt:s.image.capturedAt,...s.image.hash?{hash:s.image.hash}:{}},raw:He(c.imageData),marks:s.marks.map(({mark:p})=>({tool:p.tool,geometry:p.geometry,bounds:p.bounds,element:p.element}))}}}const i=n.clips.find(c=>c.id===e||c.contextItemId===e);if(i){const c=i.status==="ready"?ge(t.workspaceId,i.path):null;if(!c)return null;const d=a.find(h=>h.id===i.contextItemId),u=await t.fetchBytes(c);if(!Yn(u))throw new Error("Not a recording file");return{kind:"clip",name:d?.label||`recording-${i.id.slice(0,8)}.mp4`,mimeType:d?.attachmentMimeType||"video/mp4",bytes:u,durationMs:i.durationMs,hasMicAudio:i.hasMicAudio}}const o=a.find(c=>c.id===e),l=Ne(o?.imageMimeType);return o?.imageData&&l?{kind:"image",name:o.label||"image",mimeType:l,bytes:He(o.imageData)}:null}async function Gn(e){const t=await fetch(e);if(!t.ok)throw new Error(`Media request failed (${t.status})`);const n=new Uint8Array(await t.arrayBuffer()),a=Number(t.headers.get("content-length")??Number.NaN);if(n.byteLength===0||Number.isFinite(a)&&a!==n.byteLength)throw new Error("Media response was incomplete");return n}function Yn(e){return e.byteLength>8&&String.fromCharCode(...e.subarray(4,8))==="ftyp"}async function Or(e){try{return(await Se()?.invoke(_e.CLIPBOARD_WRITE,e))?.ok===!0}catch{return!1}}async function Jn(){try{return await Se()?.invoke(_e.CLIPBOARD_READ,{})??null}catch{return null}}async function $r(e){try{const t=await Se()?.invoke(_e.MENU,{canCut:e});return t?.action==="copy"||t?.action==="cut"?t.action:null}catch{return null}}const Fe=new WeakSet;async function Qn(e,t){const[n]=e;if(e.length!==1||!n||n.size!==t.size)return!1;try{const a=await crypto.subtle.digest("SHA-256",await n.arrayBuffer());return Array.from(new Uint8Array(a),s=>s.toString(16).padStart(2,"0")).join("")===t.sha256}catch{return!1}}function Ur(e,{onIntentMedia:t,isCurrent:n,read:a=Jn}){const r=e.clipboardData;if(Fe.has(e)||!r||r.files.length===0)return!1;const s=e.target,i=Array.from(r.files),o=r.types.filter(l=>l!=="Files").map(l=>[l,r.getData(l)]);return e.preventDefault(),e.stopImmediatePropagation(),a().catch(()=>null).then(async l=>{if(!n())return;if(l&&await Qn(i,l)){n()&&t(l);return}if(!n()||!(s instanceof Node)||!s.isConnected)return;const c=new DataTransfer;for(const u of i)c.items.add(u);for(const[u,h]of o)c.setData(u,h);const d=new ClipboardEvent("paste",{clipboardData:c,bubbles:!0,cancelable:!0});Fe.add(d),s.dispatchEvent(d)}),!0}function Xn(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a++)n[a]=t.charCodeAt(a);return n}function Zn(e){let t="";for(let a=0;a<e.length;a+=32768)t+=String.fromCharCode(...e.subarray(a,a+32768));return btoa(t)}function ct(e){let t=0;return e.endsWith("==")?t=2:e.endsWith("=")&&(t=1),Math.floor(e.length*3/4)-t}async function ea(e){const t=await crypto.subtle.digest("SHA-256",e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength));return Array.from(new Uint8Array(t)).map(n=>n.toString(16).padStart(2,"0")).join("")}const lt={placeAttachment:it,beginAttachmentUpload:st,sendAttachmentUploadChunk:rt,commitAttachmentUpload:at,abortAttachmentUpload:nt,getAttachmentInfo:he,mintIdempotencyKey:se};async function Me(e,t,n,a=lt){const{idempotencyKey:r}=n,s={...r!==void 0?{idempotencyKey:r}:{},...n.rawScreenshot!==void 0?{rawScreenshot:n.rawScreenshot}:{}},i=async m=>un(m,r)?$e(e,r,a.getAttachmentInfo):void 0;if(ct(n.data)<=cn)try{return await a.placeAttachment(e,t,{data:n.data,mimeType:n.mimeType,...s})}catch(m){const y=await i(m);if(y)return y;throw m}const o=Xn(n.data),l=await ea(o);let c,d;try{({uploadId:c,maxChunkBytes:d}=await a.beginAttachmentUpload(e,t,o.byteLength,l,{mimeType:n.mimeType,...s}))}catch(m){if(r!==void 0&&ln(m)){const y=await $e(e,r,a.getAttachmentInfo);if(y)return y}throw m}const u=Math.min(mn,d),h=Math.ceil(o.byteLength/u);let p=!1;try{for(let m=0;m<h;m++){const y=o.subarray(m*u,(m+1)*u);await a.sendAttachmentUploadChunk(c,m,Zn(y),e)}return p=!0,await a.commitAttachmentUpload(c,e)}catch(m){const y=p?await i(m):void 0;if(y)return y;throw await a.abortAttachmentUpload(c,e).catch(()=>{}),m}}function ta(e,t){return pn(e,`image-${Date.now()}-${t+1}`)}class Ae extends Error{constructor(n,a){super(n);Pe(this,"retryBlocks");this.name="ImagePlacementError",this.retryBlocks=a}}function na(e,t){return e instanceof Ae?e.retryBlocks:t}async function aa(e,t,n=lt,a=()=>!0){const r=l=>(...c)=>(le(a),l(...c));n={placeAttachment:r(n.placeAttachment),beginAttachmentUpload:r(n.beginAttachmentUpload),sendAttachmentUploadChunk:r(n.sendAttachmentUploadChunk),commitAttachmentUpload:r(n.commitAttachmentUpload),abortAttachmentUpload:r(n.abortAttachmentUpload),getAttachmentInfo:r(n.getAttachmentInfo),mintIdempotencyKey:r(n.mintIdempotencyKey)};const s=[],i=[],o=[];for(let l=0;l<t.length;l++){le(a);const c=t[l];if("attachmentId"in c&&c.attachmentId){const p={type:"image",attachmentId:c.attachmentId,...c.mimeType?{mimeType:c.mimeType}:{}};s.push(p),i.push(p);continue}const d=c,u=d.placementFileName??ta(d.mimeType,l),h=n.mintIdempotencyKey(d.placementIdempotencyKey);try{const p=await Me(e,u,{data:d.data,mimeType:d.mimeType,...h!==void 0?{idempotencyKey:h}:{}},n),m={type:"image",attachmentId:p.attachmentId,...p.mimeType??d.mimeType?{mimeType:p.mimeType??d.mimeType}:{}};s.push(m),i.push(m)}catch(p){const m=dn(p);o.push(m?`${u} (${m})`:u),i.push(h!==void 0?{...d,placementIdempotencyKey:h,placementFileName:u}:d)}}if(o.length>0)throw new Ae(b.chat_imagePlacement_failed_error({names:o.join(", ")}),i);return le(a),s}const Lr=Object.freeze(Object.defineProperty({__proto__:null,ImagePlacementError:Ae,base64DecodedBytes:ct,imageRetryBlocks:na,placeImageAttachment:Me,toImageReferenceBlocks:aa},Symbol.toStringTag,{value:"Module"}));function dt(){try{return gn()}catch{return null}}function ra(){return{backendId:A.state.connections.windowBackendId??null,generation:A.state.daemonHealth.connectionGeneration,transport:dt()}}class Ie extends Error{constructor(){super("dock-evidence-backend-changed")}}function N(e,t){return async(...n)=>{e();const a=await t(...n);return e(),a}}const H={current:e=>dt()===e.transport&&A.state.daemonHealth.connectionGeneration===e.generation&&(A.state.connections.windowBackendId??null)===e.backendId,capabilities:()=>yn(),placeImage:(e,t,n,a)=>Me(e,t,n,{placeAttachment:N(a,it),beginAttachmentUpload:N(a,st),sendAttachmentUploadChunk:N(a,rt),commitAttachmentUpload:N(a,at),abortAttachmentUpload:N(a,nt),getAttachmentInfo:N(a,he),mintIdempotencyKey:se}),lookup:(e,t)=>he({workspaceId:e,idempotencyKey:t}),mintKey:se};function G(e){return H.current(e)}function sa(e,t){const n=A.state.dockConversation;return{generation:n.generation,authority:n.authority,clearRevision:x(n.drafts,Vt(e,t))?.clearRevision??0,binding:ra()}}function Nr(e,t,n){const a=sa(e,t);return a.generation===n.generation&&a.authority===n.authority&&a.clearRevision===n.clearRevision&&G(n.binding)}function ut(e,t){return()=>{if(!e.current(t))throw new Ie}}const mt=Object.freeze({rawRetention:!1,chiefAttachments:!1});function Hr(e){return e!==mt}const de=new Map;function pt(e,t=H){const n=`${e.backendId}:${e.generation}`;let a=de.get(n);if(!a){const r=ut(t,e);a=(async()=>{r();const i=await t.capabilities();r();const o=i?.server?.capabilities;if(!o||typeof o!="object")throw new Error("unobserved");return{rawRetention:o.rawScreenshotRetention===1,chiefAttachments:o.chiefAttachments===1}})().catch(()=>(de.delete(n),mt)),de.set(n,a)}return a}class Z extends Error{constructor(t){super(`dock-raw-retention-contract:${t}`),this.reason=t}}function ft(e){const{rpcCode:t,code:n}=e??{};return t===-32602||n==="INVALID_PARAMS"}function ia(e){const t=String(e?.message??"");return ft(e)&&(t.includes("rawScreenshotExpired:")||/expired at .*not renewable/i.test(t))}function oa(e,t,n){const a=e.rawScreenshot;if(!a||a.compositeAttachmentId!==t)return null;const r=Date.parse(a.expiresAt);return Number.isFinite(r)?a.expired||r<=n?"expired":{attachmentId:e.attachmentId,expiresAt:a.expiresAt}:null}function Ke(e){return{ok:!0,path:e.path,fileName:e.fileName,size:e.size,attachmentId:e.attachmentId,...e.mimeType?{mimeType:e.mimeType}:{},uploadedAt:e.uploadedAt,replayed:!0,...e.rawScreenshot?{rawScreenshot:e.rawScreenshot}:{}}}class ca extends Error{constructor(t,n){super("dock-evidence-placement-failed"),this.imageId=t,this.failure=n}}const We=e=>e.split("/")[1]?.replace("jpeg","jpg")||"png";async function la(e){const t=e.api??H,n=e.now??Date.now,a=ut(t,e.binding);a();const r=await pt(e.binding,t);a();const s=r.rawRetention&&(e.workspaceId!==be||r.chiefAttachments),i=[];for(const o of e.images){const l=e.records[o.image.id];let c=l&&l.signature===o.signature&&l.workspaceId===e.workspaceId&&l.backendId===e.binding.backendId?l:{imageId:o.image.id,signature:o.signature,workspaceId:e.workspaceId,backendId:e.binding.backendId,compositeKey:null,rawKey:null,composite:null,raw:null,rawSettled:!1};const d=u=>{c=u,e.onRecord(u)};try{if(!c.composite){const h=c.compositeKey,p=t.mintKey(h??void 0)??null;p!==c.compositeKey&&d({...c,compositeKey:p});let m;h&&p===h&&(a(),m=await t.lookup(e.workspaceId,p).then(Ke).catch(()=>{}),a()),m||(a(),m=await t.placeImage(e.workspaceId,`screenshot-${o.image.id.slice(0,8)}.${We(o.composite.mimeType)}`,{data:o.composite.base64,mimeType:o.composite.mimeType,...p?{idempotencyKey:p}:{}},a),a()),d({...c,composite:{attachmentId:m.attachmentId,mimeType:m.mimeType??o.composite.mimeType}})}const u=c.composite.attachmentId;if(s&&o.raw&&!c.raw&&!c.rawSettled){const h=c.rawKey,p=t.mintKey(h??void 0);if(p){p!==c.rawKey&&d({...c,rawKey:p});let m;h&&p===h&&(a(),m=await t.lookup(e.workspaceId,p).then(Ke).catch(()=>{}),a());try{m||(a(),m=await t.placeImage(e.workspaceId,`screenshot-${o.image.id.slice(0,8)}-original.${We(o.raw.mimeType)}`,{data:o.raw.base64,mimeType:o.raw.mimeType,idempotencyKey:p,rawScreenshot:{compositeAttachmentId:u}},a),a());const y=oa(m,u,n());if(y==="expired")d({...c,rawSettled:!0});else if(y)d({...c,raw:y});else throw new Z("echo")}catch(y){if(ia(y))d({...c,rawSettled:!0});else throw y instanceof Z?y:ft(y)?new Z("refused"):y}}else throw new Z("unkeyed")}}catch(u){throw u instanceof Ie?u:new ca(o.image.id,u)}i.push(c)}return i}async function Fr(e,t,n,a){const r=()=>{if(!H.current(a))throw new Ie};r();const s=await H.placeImage(e,t,{...n,idempotencyKey:H.mintKey()},r);return r(),s}const da=new Set(["invalid-saved-edit","media-send-retired","transcript-unavailable","transcript-pending","invalid-edit","stale-source","legacy-baked-marks","timing-unavailable","audio-unavailable","media-source-unavailable","media-export-unavailable","media-animation-layer-limit","media-export-failed","legacy-original-unavailable","capture-render-unavailable","capture-blur-unavailable","stale-source-pixels","not-a-screenshot","not-admitted","unavailable","dock-evidence-missing-pixels","draft-restore-failed","image-budget-exceeded"]),ua=new Set(["unavailable","permission","failed","busy","cancelled","limit"]);class O extends Error{constructor(t,n){super(n),this.stage=t,this.code=n,this.name="DockSendError"}}function ie(e){const t=e instanceof Error?e.message:typeof e=="string"?e:"";if(t.length>64)return"unclassified";const[n,...a]=t.split(":");return!da.has(n)||a.length>2?"unclassified":n!=="media-export-failed"?a.length?"unclassified":n:[n,...a.map(r=>ua.has(r)?r:"other")].join(":")}function Kr(e,t){return e instanceof O?{stage:e.stage,code:ie(e.code)}:{stage:t,code:ie(e)}}function F(e){if(!e||e.source.kind!=="recording")return!1;const t=e.source,n=e.saved??re(t,t.capturedMarks??[],e.transcript);if(n.video!=="full"||n.voice!=="audio"||n.crop||n.blurRegions.length||n.blurStrokes?.length)return!1;const a=ve(n,t,e.transcript);return t.visuals==="clean"?!a.errors.length&&!a.muted&&n.cuts.length===0&&!n.marks.some(r=>r.included)&&a.marks.length===0&&a.transcript===null&&a.kept.length===1&&a.kept[0].startMs===0&&a.kept[0].endMs===t.durationMs&&a.clips.length===1&&a.clips[0].startMs===0&&a.clips[0].endMs===t.durationMs:!a.errors.length&&!a.muted&&a.clips.length===1&&a.clips[0].startMs===0&&a.clips[0].endMs>=t.durationMs}async function ma(e,t,n,a,r,s){const i={images:{},files:[],frames:[],framePromptBytes:[],metadata:[]};let o="validate";try{const l=()=>{if(!r()||!G(n))throw new Error("media-send-retired")};for(const c of[...t.images,...t.clips]){if(o="validate",s?.stage(o),c.mediaError)throw new Error("invalid-saved-edit");if(!c.media||F(c.media))continue;l();const d=structuredClone(c.media),u=d.source;let h=d.saved??re(u,u.capturedMarks??[],d.transcript),p=crypto.randomUUID();try{if(u.kind==="recording"&&h.voice==="transcript"&&d.transcript?.status!=="ready"){if(o="transcribe",s?.stage(o),!a?.transcribeMedia)throw new Error("transcript-unavailable");const f=await a.transcribeMedia({jobId:p,media:d});if(l(),!f.ok)throw new Error("transcript-unavailable");d.transcript=f.value,d.saved||(h=re(u,u.capturedMarks??[],d.transcript))}o="plan",s?.stage(o);const m=ve(h,u,d.transcript);if(m.errors.length)throw new Error(m.errors[0]);const y={id:c.id,kind:u.kind,video:h.video,voice:h.voice,transcript:m.transcript,batches:u.batches,marks:m.marks.map(({n:f,mark:k,frameAtMs:v})=>({n:f,id:k.id,at_ms:v,kind:k.kind,label:k.label,note:k.note,context:k.context,geometry:k.geometry}))};if(u.kind==="screenshot"){o="screenshot-source",s?.stage(o);const f=u.path.split("/").map(encodeURIComponent).join("/"),k=tt(`intent://local/file/${f}`,e);if(!k||k.kind!=="image")throw new Error("media-source-unavailable");const v=await Gn(k.url);l();const I={base64:Ze(v.buffer.slice(v.byteOffset,v.byteOffset+v.byteLength)),mimeType:/\.jpe?g$/i.test(u.path)?"image/jpeg":/\.webp$/i.test(u.path)?"image/webp":"image/png"};o="screenshot-render",s?.stage(o),i.images[c.id]=await nn(u,h,I),l()}else{if(!m.clips.length){y.video_attachment_id=null,y.frames=[],y.kept_ms=[],i.metadata.push(y);continue}const f={...d,saved:h};let k=await a?.takePreparedRecording?.(f);if(k&&(p=k.jobId),l(),!k){if(!a)throw new Error("media-export-unavailable");k=await ot(f,p,a,()=>r()&&G(n),S=>{o=S,s?.stage(S),S==="export"&&s?.exportAttempt(p)})}p=k.jobId,o="placement",s?.stage(o);const v=[k.value.video,...k.value.frames],I=[];for(let S=0;S<v.length;S++){l();const _=v[S],B=`capture-${c.id.slice(0,12)}-${S}.${S===0?"mp4":_.mimeType==="image/jpeg"?"jpg":"png"}`,C=await fn(e,B,{sourcePath:_.sourcePath,mimeType:_.mimeType,idempotencyKey:se()},void 0,void 0,()=>r()&&G(n));l(),S===0?i.files.push({type:"file",attachmentId:C.attachmentId,fileName:B,mimeType:C.mimeType??_.mimeType,size:C.size}):(i.frames.push({type:"image",attachmentId:C.attachmentId,mimeType:_.mimeType==="image/jpeg"?"image/jpeg":"image/png"}),i.framePromptBytes.push(jn(_))),I.push(C.attachmentId)}y.video_attachment_id=I[0],y.frames=k.value.frames.map((S,_)=>({mark_id:S.markId,attachment_id:I[_+1]})),y.kept_ms=m.clips}i.metadata.push(y)}finally{s?.stage("release"),await a?.releaseMediaJob?.(p).catch(()=>{})}}return i}catch(l){throw l instanceof O?l:new O(o,ie(l))}}const ue=1568,pa=.85;async function fa(e,t){const n=Math.round(e.length*3/4/1024),a=await ha(e,t),{width:r,height:s}=a,i=r>ue||s>ue;let o=r,l=s;if(i){const f=ue/Math.max(r,s);o=Math.round(r*f),l=Math.round(s*f)}const c=new OffscreenCanvas(o,l),d=c.getContext("2d");if(!d)throw new Error("Failed to get 2D canvas context for image resize");d.drawImage(a,0,0,o,l);let u=t;ga(d,o,l)||(u="image/jpeg");const h=await c.convertToBlob({type:u,quality:u==="image/jpeg"?pa:void 0}),p=h.type||u,m=await ya(h),y=Math.round(m.length*3/4/1024);return console.debug(`[image-resize] ${r}×${s} → ${o}×${l} | ${t} → ${p} | ${n} KB → ${y} KB`),{base64:m,mimeType:p}}async function ha(e,t){const n=atob(e),a=new Uint8Array(n.length);for(let s=0;s<n.length;s++)a[s]=n.charCodeAt(s);const r=new Blob([a],{type:t});return createImageBitmap(r)}function ga(e,t,n){const r=e.getImageData(0,0,t,n).data;for(let s=3;s<r.length;s+=4)if(r[s]<255)return!0;return!1}async function ya(e){const t=await e.arrayBuffer(),n=new Uint8Array(t);let a="";for(let r=0;r<n.length;r++)a+=String.fromCharCode(n[r]);return btoa(a)}const T={...Oe,badge:Oe.badgeRadius*2};function wa(e,t,n=1,a=0){const r=Math.max(1,e.displayScale)*n,s=[],i=o=>o*n;for(const{n:o,mark:l}of t){const c=l.geometry;if(c.kind==="rect")s.push({kind:"rect",x:i(c.x),y:i(c.y),w:i(c.w),h:i(c.h),width:T.stroke*r});else if(c.kind==="path")s.push({kind:"path",points:c.points.map(m=>({x:i(m.x),y:i(m.y)})),width:T.pen*r});else{const m={x:i(c.from.x),y:i(c.from.y)},y={x:i(c.to.x),y:i(c.to.y)};s.push({kind:"arrow",from:m,to:y,head:Sa(m,y,T.arrowHead*r),width:T.stroke*r})}if(!T.showNumbers)continue;const d=Math.max(a,T.badge/2*r),u=i(l.bounds.x+l.bounds.w),h=i(l.bounds.y),p=Zt({x:i(l.bounds.x),y:h,w:u-i(l.bounds.x),h:i(l.bounds.h)},{x:0,y:0,w:i(e.width),h:i(e.height)},r,d);s.push({kind:"badge",...p,radius:d,label:String(o),font:d*T.badgeTextScale})}return s}function ba(e,t){"letterSpacing"in e&&(e.letterSpacing="0px"),"wordSpacing"in e&&(e.wordSpacing="0px");const n=(a,r,s)=>{e.strokeStyle=T.halo,e.lineWidth=a+T.haloWidth*r,s(),e.strokeStyle=T.accent,e.lineWidth=a,s()};e.strokeStyle=T.accent,e.lineCap="round",e.lineJoin="round";for(const a of t)if(a.kind==="rect")n(a.width,a.width/T.stroke,()=>e.strokeRect(a.x,a.y,a.w,a.h));else if(a.kind==="path"||a.kind==="arrow"){e.lineWidth=a.width,e.beginPath();const r=a.kind==="path"?a.points:[a.from,a.to];a.kind==="arrow"&&r.forEach((i,o)=>o?e.lineTo(i.x,i.y):e.moveTo(i.x,i.y)),a.kind==="arrow"&&(e.moveTo(a.head.left.x,a.head.left.y),e.lineTo(a.to.x,a.to.y),e.lineTo(a.head.right.x,a.head.right.y));const s=a.kind==="path"?new Path2D(Xt(a.points)):null;n(a.width,a.width/(a.kind==="path"?T.pen:T.stroke),()=>s?e.stroke(s):e.stroke())}else e.fillStyle=T.paper,e.beginPath(),e.arc(a.x,a.y,a.radius,0,Math.PI*2),e.closePath(),e.fill(),e.strokeStyle=T.accent,e.lineWidth=T.badgeOutline*a.radius/T.badgeRadius,e.stroke(),e.fillStyle=T.ink,e.font=`600 ${a.font}px ${T.badgeFontFamily}`,e.textAlign="center",e.textBaseline="middle",e.fillText(a.label,a.x,a.y)}async function ka(e,t){const n=Uint8Array.from(atob(e),a=>a.charCodeAt(0));return createImageBitmap(new Blob([n],{type:t}))}async function va(e){const t=await e.convertToBlob({type:"image/png"});return Ze(await t.arrayBuffer())}async function ht(e,t,n,a,r=0){await an();const s=await ka(e.base64,e.mimeType);try{const i=Math.min(1,a/Math.max(t.width,t.height)),o=new OffscreenCanvas(Math.max(1,Math.round(t.width*i)),Math.max(1,Math.round(t.height*i))),l=o.getContext("2d");if(!l)throw new Error("dock-evidence-canvas-unavailable");return l.drawImage(s,0,0,o.width,o.height),ba(l,wa(t,n,i,r)),o}finally{s.close()}}async function _a(e,t,n){const a=await ht(e,t,n,Math.max(t.width,t.height));return fa(await va(a),"image/png")}async function Wr(e,t,n,a=384){const r=await ht(e,t,n,a,a/32);return URL.createObjectURL(await r.convertToBlob({type:"image/png"}))}function Sa(e,t,n=T.arrowHead){const a=Math.atan2(t.y-e.y,t.x-e.x),r=T.arrowSpread;return{left:{x:t.x-n*Math.cos(a-r),y:t.y-n*Math.sin(a-r)},right:{x:t.x-n*Math.cos(a+r),y:t.y-n*Math.sin(a+r)}}}function jr(e,t){const n=zt(t??void 0),a=new Set(t?.clips.filter(r=>!!r.media&&!F(r.media)).map(r=>r.contextItemId));return e.filter(r=>!n.has(r.id)&&!a.has(r.id))}async function qr({workspaceId:e,agentId:t,evidence:n,clickedItems:a,sendItems:r,clickedPayload:s,binding:i,service:o,current:l,onRecord:c,timing:d}){const u=()=>{if(!l()||!G(i))throw new O("validate","media-send-retired")};if(u(),n?.images.some(w=>w.mediaError)||n?.clips.some(w=>w.mediaError))throw new O("validate","invalid-saved-edit");const h=w=>!!w.media&&!F(w.media),p=n?{workspaceId:e,agentId:t,appUrl:`intent://local/workspace/${encodeURIComponent(e)}`,clipAttachmentIds:Object.fromEntries(n.clips.map(w=>[w.id,a.find(M=>M.id===w.contextItemId)?.attachmentId??null]))}:null;for(const w of n?.clips??[]){if(!w.media||!F(w.media))continue;const M=a.find(Q=>Q.id===w.contextItemId);if(!M||M.attachmentId!==w.media.source.attachmentId||M.path!==w.media.source.path||M.placementStatus!==void 0&&M.placementStatus!=="placed")throw new O("validate","legacy-original-unavailable")}const m=n?await ma(e,n,i,o,l,d):{images:{},files:[],frames:[],framePromptBytes:[],metadata:[]},y=new Set(n?.clips.filter(w=>h(w)||!!w.media&&F(w.media)).map(w=>w.id)),f=new Set(n?.clips.filter(w=>y.has(w.id)).flatMap(w=>(w.captureHistory??[]).map(M=>M.image.id))),k=(n?.images??[]).filter(w=>w.source!=="annotate"||!!w.media||!f.has(w.id)||n.marks.some(M=>M.imageId===w.id&&!(M.clipId&&y.has(M.clipId))));d?.stage("burn");let v=[];try{v=n?await Ma({...n,images:k},a,m.images):[]}catch(w){throw new O("burn",ie(w))}if(m.framePromptBytes.reduce((w,M)=>w+(M??0),0)>Fn)throw new O("validate","image-budget-exceeded");const S=new Set(n?.images.filter(w=>w.media).map(w=>w.id)),_=n?{...n,images:k.map(w=>m.images[w.id]?{...w,width:m.images[w.id].width,height:m.images[w.id].height}:w),clips:n.clips.filter(w=>!h(w)),marks:n.marks.filter(w=>!S.has(w.imageId)&&!n.clips.some(M=>h(M)&&M.id===w.clipId))}:null;u();const B=m.metadata.some(w=>typeof w.transcript=="string"&&w.transcript.trim());if(!s.text.trim()&&!r.length&&!s.workspaceContextStr?.trim()&&!v.length&&!m.files.length&&!m.frames.length&&!s.imageBlocks?.length&&!s.fileBlocks?.length&&!B)return null;let C=v,P=null;d?.stage("placement");const Re=n?await pt(i):null;if(u(),n&&(e!==be||Re?.chiefAttachments)){const w=await la({workspaceId:e,binding:i,images:k.map((M,Q)=>{const X=a.find(Et=>Et.id===M.contextItemId);return{image:M,signature:Gt(n,M.id),composite:{base64:v[Q].data,mimeType:v[Q].mimeType},raw:!M.media&&X?.imageData&&X.imageMimeType?{base64:X.imageData,mimeType:X.imageMimeType}:null}}),records:n?.placements??{},onRecord:c});u(),C=w.map(M=>({type:"image",attachmentId:M.composite.attachmentId,mimeType:M.composite.mimeType})),P=Object.fromEntries(w.map(M=>[M.imageId,{attachmentId:M.composite.attachmentId,raw:M.raw}]))}const g=new Map(n?Xe(n).map(({n:w,mark:M})=>[M.id,w]):[]),D=p&&P?{...p,imageAttachments:P,markNumbers:g}:p&&{...p,markNumbers:g},L=n&&D?{...s,imageBlocks:[...C,...m.frames,...s.imageBlocks??[]],fileBlocks:[...s.fileBlocks??[],...m.files],workspaceContextStr:[Jt(_,D),m.metadata.length?`[Edited capture outputs]
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/B9fp6kqr.js","/app/immutable/chunks/DT4bpJWb.js","/app/immutable/chunks/DyvrH0mm.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/DXyyWeag.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CjaOLL1c.js","/app/immutable/chunks/Cuqq8bL5.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/Bfr1QjPr.js","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/CnVt0JNG.js","/app/immutable/chunks/BybfkKTj.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BboIV5H5.js","/app/immutable/chunks/DJkHth-B.js","/app/immutable/chunks/D5ej8a-y.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/ppRpwazH.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/BTdkHPOB.js","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/D3QcPFoL.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/DEYvT_CO.js","/app/immutable/chunks/RD9QY1Yc.js","/app/immutable/chunks/DogedYC1.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/CRsmjbca.js","/app/immutable/chunks/DHQOuksI.js","/app/immutable/chunks/DNBv5HWD.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/81Mgflg6.js","/app/immutable/chunks/q36554_4.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/D32PJnzX.js","/app/immutable/chunks/ChkzKl5W.js","/app/immutable/chunks/pKvpKpo4.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Ct=Object.defineProperty;var Dt=(e,t,n)=>t in e?Ct(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pe=(e,t,n)=>Dt(e,typeof t!="symbol"?t+"":t,n);import{B as xt,O as Rt,dG as Be,cG as pe,dr as Pt,al as Bt,b1 as Ge,z as Ot,dS as $t}from"./D3QcPFoL.js";import{Iy as A,g as be,nx as x,vN as Ut,By as Ye,vP as Lt,CL as Je,cx as Nt,cy as Ht,ny as Qe,nk as Ft,c as ke,fF as Kt,lN as Wt,cF as jt}from"./D5ej8a-y.js";import{e as qt,b as ae,F as Vt,y as re,_ as ve,G as zt,C as Gt,W as Xe,v as Yt,u as Jt,M as Qt}from"./ppRpwazH.js";import{D as Oe,a as Xt,d as Zt}from"./CQcEqK4G.js";import{l as en,o as tn,g as Ze,r as nn,m as an,D as rn}from"./DhdZyawh.js";import{a as et,e as sn}from"./RD9QY1Yc.js";import{f as on}from"./D83cNVE7.js";import{bp as b,_ as fe}from"./DXyyWeag.js";import{a9 as tt,aA as se,J as he,a as nt,n as at,cQ as rt,e as st,aH as it,M as cn,ab as ln,aT as $e,d as le,C as dn,cR as un,U as mn,a6 as pn,aI as fn,bY as hn}from"./BU93jIdu.js";import{bD as gn,bq as yn,aX as wn,by as bn,bs as kn,ax as vn}from"./Bfr1QjPr.js";import{O as _n,z as Sn}from"./DyvrH0mm.js";import{t as q,q as Mn,v as An}from"./BboIV5H5.js";import{x as In,J as Tn,ai as En,ar as Cn}from"./weVd7rrQ.js";import{a as Ue,b as Dn,g as xn}from"./DypB-Dwi.js";import{z as Rn}from"./CRsmjbca.js";import{C as Pn}from"./BvFAWM27.js";import{i as Bn}from"./BP-Q7b0i.js";import{o as $,e as On,l as V,s as E,n as ce,b as $n,d as Un,c as Ln}from"./CIyUrgF0.js";function Cr(e,t){if(e)return e.model}function Nn({messages:e,pendingInitialPrompt:t,pendingContextReferenceCount:n=0}){return e.length>0||!!t||n>0}function Dr({session:e,messages:t,pendingInitialPrompt:n,pendingContextReferenceCount:a=0}){return!(e?xt(e):!1)&&!Nn({messages:t,pendingInitialPrompt:n,pendingContextReferenceCount:a})}function xr(e){return Rt(e.messageMetadata)}function Hn(e){return{id:e.id,appMessageId:e.appMessageId,role:"user",timestamp:new Date(e.createdAt??0).toISOString(),contentBlocks:[...e.content?[{type:"text",text:e.content}]:[],...e.imageBlocks??[],...e.fileBlocks??[]],metadata:e.messageMetadata,...e.author!==void 0?{author:e.author}:{}}}function Rr(e){return Hn({...e,createdAt:Date.parse(e.queuedAt)})}const Fn=8*1024*1024,Kn=3*1024*1024;function Wn(e){return Math.ceil(Math.max(0,e)/3)*4}function jn(e){const t=e.promptBase64Bytes;return e.mimeType==="image/jpeg"&&Number.isSafeInteger(e.size)&&e.size>0&&e.size<=Kn&&typeof t=="number"&&t===Wn(e.size)?t:null}async function ot(e,t,n,a,r=()=>{}){const s=()=>{if(!a())throw new Error("media-send-retired")};if(s(),r("overlay-render"),!n.exportMedia)throw new Error("media-export-unavailable");const i=en(e.source,e.saved);if(i.length>1e4)throw new Error("media-animation-layer-limit");const o=[];for(const c of i)s(),o.push({...c,png:await tn(e.source,e.saved,c.atMs)});s(),r("export");const l=await n.exportMedia({outputVersion:qt,jobId:t,media:e,layers:o});if(s(),!l.ok)throw new Error(["media-export-failed",l.error].filter(Boolean).join(":"));return{jobId:t,value:l.value}}const _e={CLIPBOARD_WRITE:"dock-media:clipboard-write",CLIPBOARD_READ:"dock-media:clipboard-read",MENU:"dock-media:menu"};function Le(e,t){return Math.max(0,(e.pausedAt??t)-e.startedAt-(e.pausedMs??0))}function ge(e,t){if(!t?.startsWith(".intent/attachments/"))return;const n=t.split("/").map(encodeURIComponent).join("/"),a=tt(`intent://local/file/${n}`,e);return a?.kind==="video"?a.url:void 0}function qn(e){const t=e.video==="full"?b.dock_captureEditor_videoFull_label():b.dock_captureEditor_videoHighlights_label(),n=e.voice==="audio"?b.dock_captureEditor_voiceAudio_label():e.voice==="transcript"?b.dock_captureEditor_voiceTranscript_label():b.dock_captureEditor_voiceOff_summary();return`${t} · ${n}`}function Vn(e,t,n,a){if(a?.error==="permission")return a.kind==="pick"?"accessibility":"screen";if(e==="permission"||t==="permission")return"screen";if(n?.startsWith("microphone-permission"))return"microphone";if(n?.startsWith("speech-permission"))return"speech"}const j=on;function Pr(e){const{view:t,items:n,local:a,labels:r,copy:s}=e,i=t.speech.error??t.speech.capability?.reason??null,o=Vn(t.captureError,t.clips.find(g=>g.status==="failed"&&g.error==="permission")?.error??null,i,t.annotationIssue),l=t.annotationIssue?.error==="unavailable"?s?.annotationUnavailable:void 0,c=t.annotationIssue,d=t.captureError==="permission",u=c?.error==="permission"&&c.kind!=="pick",h=c?.error==="permission"&&c.kind==="pick",p=i?.startsWith("speech-permission")?"speech":i?.startsWith("microphone-permission")||i==="permission"?"microphone":void 0,m={},y={},f=(g,D,L)=>{m[g]=D,L&&(y[g]=L)};s&&(d&&(f("capture",s.permission,"screen"),t.recording||f("record",s.permission,"screen")),u&&!t.annotating&&f("annotate",s.permission,"screen"),h&&(f("pick",s.accessibilityPermission,"accessibility"),t.tool==="pick"&&!t.annotating&&f("annotate",s.accessibilityPermission,"accessibility")),p&&!t.dictation&&f("mic",(i&&r.speechError?.(i))??s.speechPermission,p));const k=g=>{const D=y[g];D&&e.actions.onOpenSettings(D)},v=new Set(t.evidenceOwnedItemIds),I=t.clips.find(g=>g.status==="recording"),S=t.clips.length>=ae.clips,_=t.capabilities,B=t.speech.available,C=new Set(t.clips.filter(g=>g.status==="recording"||g.status==="placing"||!!g.media).flatMap(g=>g.captureHistory?.map(D=>D.image.id)??[])),P=[...t.tiles.filter(({image:g,marks:D})=>!!g.media||g.source!=="annotate"||!C.has(g.id)||D.some(({mark:L})=>!L.clipId)).map(({image:g,marks:D})=>({kind:"image",id:g.contextItemId,url:a.previews[g.id]??"",markCount:D.length,owner:"evidence",...a.previews[g.id]?{}:{status:"placing"}})),...t.clips.filter(g=>!g.discarding).map(g=>({kind:"clip",id:g.contextItemId??g.id,duration:j(g.status==="recording"?Le(g,a.now):g.durationMs),recording:g.status==="recording",...g.media?.saved?{summary:qn(g.media.saved)}:{},...g.status==="ready"&&ge(e.workspaceId,g.path)?{url:ge(e.workspaceId,g.path)}:{},owner:"evidence",...g.status==="placing"?{status:"placing"}:{},...g.status==="failed"?{status:"failed",...g.error==="limit"?{error:b.dock_composer_clipTooLarge_error()}:{}}:{}})),...n.filter(g=>!v.has(g.id)).map(g=>({...g.imageData&&g.imageMimeType?{kind:"image",id:g.id,url:`data:${g.imageMimeType};base64,${g.imageData}`,markCount:0,file:{name:g.label,imageData:g.imageData,imageMimeType:g.imageMimeType}}:{kind:"file",id:g.id,name:g.label},owner:"attachment",...g.placementStatus==="placing"?{status:"placing"}:{},...g.placementStatus==="failed"?{status:"failed",error:g.placementError}:{}}))];return{mediaStatus:t.recording?{kind:"recording",label:r.recording}:t.dictation?{kind:"listening",label:r.listening}:t.annotating?{kind:"annotating",label:r.annotating}:void 0,...o?{settingsPane:o}:{},...l?{annotationNotice:l}:{},labels:r,attachments:P,...s?{placeholder:t.dictation?"":s.idle}:{},state:{captureRevision:t.captureAccepted,capturePending:t.capturePending,captureDisabled:!_.capture||t.captureDisabled,...t.captureDisabled?{captureTooltip:r.captureLimit}:{},captureMode:t.evidence?.annotation?"fullscreen":t.captureMode,captureModesAvailable:!!_.captureModes&&!t.evidence?.annotation,annotationActive:t.annotating,tool:t.tool,toolUsed:t.toolUsed,annotationDisabled:!_.annotate,recording:t.recording&&!I?.discarding,recordingDisabled:!!I?.discarding||!t.recording&&(!_.record||S),...S&&!t.recording?{recordingTooltip:r.clipLimit}:{},recordingTime:j(I?Le(I,a.now):0),dictating:!!t.dictation,dictationPending:t.speech.pending||t.dictation?.status==="transcribing",dictationDisabled:!B&&!t.dictation&&!m.mic,...t.speech.error&&r.speechError?{dictationTooltip:r.speechError(t.speech.error)}:{},dictationTime:t.dictation?j(a.now-t.dictation.startedAt):j(0),inputLevels:t.speech.levels,...Object.keys(m).length?{alerts:m}:{}},...e.actions,...t.fileAttachmentsEnabled===!1?{onEdit:void 0}:{},onAlert:k,beforeSubmit:e.beforeSubmit}}const Se=()=>globalThis.electronAPI,zn=["image/png","image/jpeg","image/webp"],Ne=e=>zn.includes(e??"")?e:null;function He(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a+=1)n[a]=t.charCodeAt(a);return n}async function Br(e,t){const{view:n,items:a,previews:r}=t,s=n.tiles.find(({image:c})=>c.id===e||c.contextItemId===e);if(s){const c=a.find(p=>p.id===s.image.contextItemId),d=s.image.media;if(s.image.mediaError)return null;if(d?.saved){if(!t.createSavedPreviewUrl||!t.revokeUrl)return null;const p={...d,saved:d.saved},m=await t.createSavedPreviewUrl(t.workspaceId,p);try{const y=await t.fetchBytes(m),f=p.saved.crop;return{kind:"image",name:c?.label||"screenshot.png",mimeType:"image/png",bytes:y,intent:{pixels:{mimeType:"image/png",width:Math.max(1,Math.round(f?.w??p.source.width)),height:Math.max(1,Math.round(f?.h??p.source.height)),displayScale:s.image.displayScale,capturedAt:s.image.capturedAt},raw:y,marks:[]}}}finally{t.revokeUrl(m)}}const u=Ne(c?.imageMimeType),h=r[s.image.id];return!c?.imageData||!u||!h?null:{kind:"image",name:c.label||"screenshot.png",mimeType:"image/png",bytes:await t.fetchBytes(h),intent:{pixels:{mimeType:u,width:s.image.width,height:s.image.height,displayScale:s.image.displayScale,capturedAt:s.image.capturedAt,...s.image.hash?{hash:s.image.hash}:{}},raw:He(c.imageData),marks:s.marks.map(({mark:p})=>({tool:p.tool,geometry:p.geometry,bounds:p.bounds,element:p.element}))}}}const i=n.clips.find(c=>c.id===e||c.contextItemId===e);if(i){const c=i.status==="ready"?ge(t.workspaceId,i.path):null;if(!c)return null;const d=a.find(h=>h.id===i.contextItemId),u=await t.fetchBytes(c);if(!Yn(u))throw new Error("Not a recording file");return{kind:"clip",name:d?.label||`recording-${i.id.slice(0,8)}.mp4`,mimeType:d?.attachmentMimeType||"video/mp4",bytes:u,durationMs:i.durationMs,hasMicAudio:i.hasMicAudio}}const o=a.find(c=>c.id===e),l=Ne(o?.imageMimeType);return o?.imageData&&l?{kind:"image",name:o.label||"image",mimeType:l,bytes:He(o.imageData)}:null}async function Gn(e){const t=await fetch(e);if(!t.ok)throw new Error(`Media request failed (${t.status})`);const n=new Uint8Array(await t.arrayBuffer()),a=Number(t.headers.get("content-length")??Number.NaN);if(n.byteLength===0||Number.isFinite(a)&&a!==n.byteLength)throw new Error("Media response was incomplete");return n}function Yn(e){return e.byteLength>8&&String.fromCharCode(...e.subarray(4,8))==="ftyp"}async function Or(e){try{return(await Se()?.invoke(_e.CLIPBOARD_WRITE,e))?.ok===!0}catch{return!1}}async function Jn(){try{return await Se()?.invoke(_e.CLIPBOARD_READ,{})??null}catch{return null}}async function $r(e){try{const t=await Se()?.invoke(_e.MENU,{canCut:e});return t?.action==="copy"||t?.action==="cut"?t.action:null}catch{return null}}const Fe=new WeakSet;async function Qn(e,t){const[n]=e;if(e.length!==1||!n||n.size!==t.size)return!1;try{const a=await crypto.subtle.digest("SHA-256",await n.arrayBuffer());return Array.from(new Uint8Array(a),s=>s.toString(16).padStart(2,"0")).join("")===t.sha256}catch{return!1}}function Ur(e,{onIntentMedia:t,isCurrent:n,read:a=Jn}){const r=e.clipboardData;if(Fe.has(e)||!r||r.files.length===0)return!1;const s=e.target,i=Array.from(r.files),o=r.types.filter(l=>l!=="Files").map(l=>[l,r.getData(l)]);return e.preventDefault(),e.stopImmediatePropagation(),a().catch(()=>null).then(async l=>{if(!n())return;if(l&&await Qn(i,l)){n()&&t(l);return}if(!n()||!(s instanceof Node)||!s.isConnected)return;const c=new DataTransfer;for(const u of i)c.items.add(u);for(const[u,h]of o)c.setData(u,h);const d=new ClipboardEvent("paste",{clipboardData:c,bubbles:!0,cancelable:!0});Fe.add(d),s.dispatchEvent(d)}),!0}function Xn(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a++)n[a]=t.charCodeAt(a);return n}function Zn(e){let t="";for(let a=0;a<e.length;a+=32768)t+=String.fromCharCode(...e.subarray(a,a+32768));return btoa(t)}function ct(e){let t=0;return e.endsWith("==")?t=2:e.endsWith("=")&&(t=1),Math.floor(e.length*3/4)-t}async function ea(e){const t=await crypto.subtle.digest("SHA-256",e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength));return Array.from(new Uint8Array(t)).map(n=>n.toString(16).padStart(2,"0")).join("")}const lt={placeAttachment:it,beginAttachmentUpload:st,sendAttachmentUploadChunk:rt,commitAttachmentUpload:at,abortAttachmentUpload:nt,getAttachmentInfo:he,mintIdempotencyKey:se};async function Me(e,t,n,a=lt){const{idempotencyKey:r}=n,s={...r!==void 0?{idempotencyKey:r}:{},...n.rawScreenshot!==void 0?{rawScreenshot:n.rawScreenshot}:{}},i=async m=>un(m,r)?$e(e,r,a.getAttachmentInfo):void 0;if(ct(n.data)<=cn)try{return await a.placeAttachment(e,t,{data:n.data,mimeType:n.mimeType,...s})}catch(m){const y=await i(m);if(y)return y;throw m}const o=Xn(n.data),l=await ea(o);let c,d;try{({uploadId:c,maxChunkBytes:d}=await a.beginAttachmentUpload(e,t,o.byteLength,l,{mimeType:n.mimeType,...s}))}catch(m){if(r!==void 0&&ln(m)){const y=await $e(e,r,a.getAttachmentInfo);if(y)return y}throw m}const u=Math.min(mn,d),h=Math.ceil(o.byteLength/u);let p=!1;try{for(let m=0;m<h;m++){const y=o.subarray(m*u,(m+1)*u);await a.sendAttachmentUploadChunk(c,m,Zn(y),e)}return p=!0,await a.commitAttachmentUpload(c,e)}catch(m){const y=p?await i(m):void 0;if(y)return y;throw await a.abortAttachmentUpload(c,e).catch(()=>{}),m}}function ta(e,t){return pn(e,`image-${Date.now()}-${t+1}`)}class Ae extends Error{constructor(n,a){super(n);Pe(this,"retryBlocks");this.name="ImagePlacementError",this.retryBlocks=a}}function na(e,t){return e instanceof Ae?e.retryBlocks:t}async function aa(e,t,n=lt,a=()=>!0){const r=l=>(...c)=>(le(a),l(...c));n={placeAttachment:r(n.placeAttachment),beginAttachmentUpload:r(n.beginAttachmentUpload),sendAttachmentUploadChunk:r(n.sendAttachmentUploadChunk),commitAttachmentUpload:r(n.commitAttachmentUpload),abortAttachmentUpload:r(n.abortAttachmentUpload),getAttachmentInfo:r(n.getAttachmentInfo),mintIdempotencyKey:r(n.mintIdempotencyKey)};const s=[],i=[],o=[];for(let l=0;l<t.length;l++){le(a);const c=t[l];if("attachmentId"in c&&c.attachmentId){const p={type:"image",attachmentId:c.attachmentId,...c.mimeType?{mimeType:c.mimeType}:{}};s.push(p),i.push(p);continue}const d=c,u=d.placementFileName??ta(d.mimeType,l),h=n.mintIdempotencyKey(d.placementIdempotencyKey);try{const p=await Me(e,u,{data:d.data,mimeType:d.mimeType,...h!==void 0?{idempotencyKey:h}:{}},n),m={type:"image",attachmentId:p.attachmentId,...p.mimeType??d.mimeType?{mimeType:p.mimeType??d.mimeType}:{}};s.push(m),i.push(m)}catch(p){const m=dn(p);o.push(m?`${u} (${m})`:u),i.push(h!==void 0?{...d,placementIdempotencyKey:h,placementFileName:u}:d)}}if(o.length>0)throw new Ae(b.chat_imagePlacement_failed_error({names:o.join(", ")}),i);return le(a),s}const Lr=Object.freeze(Object.defineProperty({__proto__:null,ImagePlacementError:Ae,base64DecodedBytes:ct,imageRetryBlocks:na,placeImageAttachment:Me,toImageReferenceBlocks:aa},Symbol.toStringTag,{value:"Module"}));function dt(){try{return gn()}catch{return null}}function ra(){return{backendId:A.state.connections.windowBackendId??null,generation:A.state.daemonHealth.connectionGeneration,transport:dt()}}class Ie extends Error{constructor(){super("dock-evidence-backend-changed")}}function N(e,t){return async(...n)=>{e();const a=await t(...n);return e(),a}}const H={current:e=>dt()===e.transport&&A.state.daemonHealth.connectionGeneration===e.generation&&(A.state.connections.windowBackendId??null)===e.backendId,capabilities:()=>yn(),placeImage:(e,t,n,a)=>Me(e,t,n,{placeAttachment:N(a,it),beginAttachmentUpload:N(a,st),sendAttachmentUploadChunk:N(a,rt),commitAttachmentUpload:N(a,at),abortAttachmentUpload:N(a,nt),getAttachmentInfo:N(a,he),mintIdempotencyKey:se}),lookup:(e,t)=>he({workspaceId:e,idempotencyKey:t}),mintKey:se};function G(e){return H.current(e)}function sa(e,t){const n=A.state.dockConversation;return{generation:n.generation,authority:n.authority,clearRevision:x(n.drafts,Vt(e,t))?.clearRevision??0,binding:ra()}}function Nr(e,t,n){const a=sa(e,t);return a.generation===n.generation&&a.authority===n.authority&&a.clearRevision===n.clearRevision&&G(n.binding)}function ut(e,t){return()=>{if(!e.current(t))throw new Ie}}const mt=Object.freeze({rawRetention:!1,chiefAttachments:!1});function Hr(e){return e!==mt}const de=new Map;function pt(e,t=H){const n=`${e.backendId}:${e.generation}`;let a=de.get(n);if(!a){const r=ut(t,e);a=(async()=>{r();const i=await t.capabilities();r();const o=i?.server?.capabilities;if(!o||typeof o!="object")throw new Error("unobserved");return{rawRetention:o.rawScreenshotRetention===1,chiefAttachments:o.chiefAttachments===1}})().catch(()=>(de.delete(n),mt)),de.set(n,a)}return a}class Z extends Error{constructor(t){super(`dock-raw-retention-contract:${t}`),this.reason=t}}function ft(e){const{rpcCode:t,code:n}=e??{};return t===-32602||n==="INVALID_PARAMS"}function ia(e){const t=String(e?.message??"");return ft(e)&&(t.includes("rawScreenshotExpired:")||/expired at .*not renewable/i.test(t))}function oa(e,t,n){const a=e.rawScreenshot;if(!a||a.compositeAttachmentId!==t)return null;const r=Date.parse(a.expiresAt);return Number.isFinite(r)?a.expired||r<=n?"expired":{attachmentId:e.attachmentId,expiresAt:a.expiresAt}:null}function Ke(e){return{ok:!0,path:e.path,fileName:e.fileName,size:e.size,attachmentId:e.attachmentId,...e.mimeType?{mimeType:e.mimeType}:{},uploadedAt:e.uploadedAt,replayed:!0,...e.rawScreenshot?{rawScreenshot:e.rawScreenshot}:{}}}class ca extends Error{constructor(t,n){super("dock-evidence-placement-failed"),this.imageId=t,this.failure=n}}const We=e=>e.split("/")[1]?.replace("jpeg","jpg")||"png";async function la(e){const t=e.api??H,n=e.now??Date.now,a=ut(t,e.binding);a();const r=await pt(e.binding,t);a();const s=r.rawRetention&&(e.workspaceId!==be||r.chiefAttachments),i=[];for(const o of e.images){const l=e.records[o.image.id];let c=l&&l.signature===o.signature&&l.workspaceId===e.workspaceId&&l.backendId===e.binding.backendId?l:{imageId:o.image.id,signature:o.signature,workspaceId:e.workspaceId,backendId:e.binding.backendId,compositeKey:null,rawKey:null,composite:null,raw:null,rawSettled:!1};const d=u=>{c=u,e.onRecord(u)};try{if(!c.composite){const h=c.compositeKey,p=t.mintKey(h??void 0)??null;p!==c.compositeKey&&d({...c,compositeKey:p});let m;h&&p===h&&(a(),m=await t.lookup(e.workspaceId,p).then(Ke).catch(()=>{}),a()),m||(a(),m=await t.placeImage(e.workspaceId,`screenshot-${o.image.id.slice(0,8)}.${We(o.composite.mimeType)}`,{data:o.composite.base64,mimeType:o.composite.mimeType,...p?{idempotencyKey:p}:{}},a),a()),d({...c,composite:{attachmentId:m.attachmentId,mimeType:m.mimeType??o.composite.mimeType}})}const u=c.composite.attachmentId;if(s&&o.raw&&!c.raw&&!c.rawSettled){const h=c.rawKey,p=t.mintKey(h??void 0);if(p){p!==c.rawKey&&d({...c,rawKey:p});let m;h&&p===h&&(a(),m=await t.lookup(e.workspaceId,p).then(Ke).catch(()=>{}),a());try{m||(a(),m=await t.placeImage(e.workspaceId,`screenshot-${o.image.id.slice(0,8)}-original.${We(o.raw.mimeType)}`,{data:o.raw.base64,mimeType:o.raw.mimeType,idempotencyKey:p,rawScreenshot:{compositeAttachmentId:u}},a),a());const y=oa(m,u,n());if(y==="expired")d({...c,rawSettled:!0});else if(y)d({...c,raw:y});else throw new Z("echo")}catch(y){if(ia(y))d({...c,rawSettled:!0});else throw y instanceof Z?y:ft(y)?new Z("refused"):y}}else throw new Z("unkeyed")}}catch(u){throw u instanceof Ie?u:new ca(o.image.id,u)}i.push(c)}return i}async function Fr(e,t,n,a){const r=()=>{if(!H.current(a))throw new Ie};r();const s=await H.placeImage(e,t,{...n,idempotencyKey:H.mintKey()},r);return r(),s}const da=new Set(["invalid-saved-edit","media-send-retired","transcript-unavailable","transcript-pending","invalid-edit","stale-source","legacy-baked-marks","timing-unavailable","audio-unavailable","media-source-unavailable","media-export-unavailable","media-animation-layer-limit","media-export-failed","legacy-original-unavailable","capture-render-unavailable","capture-blur-unavailable","stale-source-pixels","not-a-screenshot","not-admitted","unavailable","dock-evidence-missing-pixels","draft-restore-failed","image-budget-exceeded"]),ua=new Set(["unavailable","permission","failed","busy","cancelled","limit"]);class O extends Error{constructor(t,n){super(n),this.stage=t,this.code=n,this.name="DockSendError"}}function ie(e){const t=e instanceof Error?e.message:typeof e=="string"?e:"";if(t.length>64)return"unclassified";const[n,...a]=t.split(":");return!da.has(n)||a.length>2?"unclassified":n!=="media-export-failed"?a.length?"unclassified":n:[n,...a.map(r=>ua.has(r)?r:"other")].join(":")}function Kr(e,t){return e instanceof O?{stage:e.stage,code:ie(e.code)}:{stage:t,code:ie(e)}}function F(e){if(!e||e.source.kind!=="recording")return!1;const t=e.source,n=e.saved??re(t,t.capturedMarks??[],e.transcript);if(n.video!=="full"||n.voice!=="audio"||n.crop||n.blurRegions.length||n.blurStrokes?.length)return!1;const a=ve(n,t,e.transcript);return t.visuals==="clean"?!a.errors.length&&!a.muted&&n.cuts.length===0&&!n.marks.some(r=>r.included)&&a.marks.length===0&&a.transcript===null&&a.kept.length===1&&a.kept[0].startMs===0&&a.kept[0].endMs===t.durationMs&&a.clips.length===1&&a.clips[0].startMs===0&&a.clips[0].endMs===t.durationMs:!a.errors.length&&!a.muted&&a.clips.length===1&&a.clips[0].startMs===0&&a.clips[0].endMs>=t.durationMs}async function ma(e,t,n,a,r,s){const i={images:{},files:[],frames:[],framePromptBytes:[],metadata:[]};let o="validate";try{const l=()=>{if(!r()||!G(n))throw new Error("media-send-retired")};for(const c of[...t.images,...t.clips]){if(o="validate",s?.stage(o),c.mediaError)throw new Error("invalid-saved-edit");if(!c.media||F(c.media))continue;l();const d=structuredClone(c.media),u=d.source;let h=d.saved??re(u,u.capturedMarks??[],d.transcript),p=crypto.randomUUID();try{if(u.kind==="recording"&&h.voice==="transcript"&&d.transcript?.status!=="ready"){if(o="transcribe",s?.stage(o),!a?.transcribeMedia)throw new Error("transcript-unavailable");const f=await a.transcribeMedia({jobId:p,media:d});if(l(),!f.ok)throw new Error("transcript-unavailable");d.transcript=f.value,d.saved||(h=re(u,u.capturedMarks??[],d.transcript))}o="plan",s?.stage(o);const m=ve(h,u,d.transcript);if(m.errors.length)throw new Error(m.errors[0]);const y={id:c.id,kind:u.kind,video:h.video,voice:h.voice,transcript:m.transcript,batches:u.batches,marks:m.marks.map(({n:f,mark:k,frameAtMs:v})=>({n:f,id:k.id,at_ms:v,kind:k.kind,label:k.label,note:k.note,context:k.context,geometry:k.geometry}))};if(u.kind==="screenshot"){o="screenshot-source",s?.stage(o);const f=u.path.split("/").map(encodeURIComponent).join("/"),k=tt(`intent://local/file/${f}`,e);if(!k||k.kind!=="image")throw new Error("media-source-unavailable");const v=await Gn(k.url);l();const I={base64:Ze(v.buffer.slice(v.byteOffset,v.byteOffset+v.byteLength)),mimeType:/\.jpe?g$/i.test(u.path)?"image/jpeg":/\.webp$/i.test(u.path)?"image/webp":"image/png"};o="screenshot-render",s?.stage(o),i.images[c.id]=await nn(u,h,I),l()}else{if(!m.clips.length){y.video_attachment_id=null,y.frames=[],y.kept_ms=[],i.metadata.push(y);continue}const f={...d,saved:h};let k=await a?.takePreparedRecording?.(f);if(k&&(p=k.jobId),l(),!k){if(!a)throw new Error("media-export-unavailable");k=await ot(f,p,a,()=>r()&&G(n),S=>{o=S,s?.stage(S),S==="export"&&s?.exportAttempt(p)})}p=k.jobId,o="placement",s?.stage(o);const v=[k.value.video,...k.value.frames],I=[];for(let S=0;S<v.length;S++){l();const _=v[S],B=`capture-${c.id.slice(0,12)}-${S}.${S===0?"mp4":_.mimeType==="image/jpeg"?"jpg":"png"}`,C=await fn(e,B,{sourcePath:_.sourcePath,mimeType:_.mimeType,idempotencyKey:se()},void 0,void 0,()=>r()&&G(n));l(),S===0?i.files.push({type:"file",attachmentId:C.attachmentId,fileName:B,mimeType:C.mimeType??_.mimeType,size:C.size}):(i.frames.push({type:"image",attachmentId:C.attachmentId,mimeType:_.mimeType==="image/jpeg"?"image/jpeg":"image/png"}),i.framePromptBytes.push(jn(_))),I.push(C.attachmentId)}y.video_attachment_id=I[0],y.frames=k.value.frames.map((S,_)=>({mark_id:S.markId,attachment_id:I[_+1]})),y.kept_ms=m.clips}i.metadata.push(y)}finally{s?.stage("release"),await a?.releaseMediaJob?.(p).catch(()=>{})}}return i}catch(l){throw l instanceof O?l:new O(o,ie(l))}}const ue=1568,pa=.85;async function fa(e,t){const n=Math.round(e.length*3/4/1024),a=await ha(e,t),{width:r,height:s}=a,i=r>ue||s>ue;let o=r,l=s;if(i){const f=ue/Math.max(r,s);o=Math.round(r*f),l=Math.round(s*f)}const c=new OffscreenCanvas(o,l),d=c.getContext("2d");if(!d)throw new Error("Failed to get 2D canvas context for image resize");d.drawImage(a,0,0,o,l);let u=t;ga(d,o,l)||(u="image/jpeg");const h=await c.convertToBlob({type:u,quality:u==="image/jpeg"?pa:void 0}),p=h.type||u,m=await ya(h),y=Math.round(m.length*3/4/1024);return console.debug(`[image-resize] ${r}×${s} → ${o}×${l} | ${t} → ${p} | ${n} KB → ${y} KB`),{base64:m,mimeType:p}}async function ha(e,t){const n=atob(e),a=new Uint8Array(n.length);for(let s=0;s<n.length;s++)a[s]=n.charCodeAt(s);const r=new Blob([a],{type:t});return createImageBitmap(r)}function ga(e,t,n){const r=e.getImageData(0,0,t,n).data;for(let s=3;s<r.length;s+=4)if(r[s]<255)return!0;return!1}async function ya(e){const t=await e.arrayBuffer(),n=new Uint8Array(t);let a="";for(let r=0;r<n.length;r++)a+=String.fromCharCode(n[r]);return btoa(a)}const T={...Oe,badge:Oe.badgeRadius*2};function wa(e,t,n=1,a=0){const r=Math.max(1,e.displayScale)*n,s=[],i=o=>o*n;for(const{n:o,mark:l}of t){const c=l.geometry;if(c.kind==="rect")s.push({kind:"rect",x:i(c.x),y:i(c.y),w:i(c.w),h:i(c.h),width:T.stroke*r});else if(c.kind==="path")s.push({kind:"path",points:c.points.map(m=>({x:i(m.x),y:i(m.y)})),width:T.pen*r});else{const m={x:i(c.from.x),y:i(c.from.y)},y={x:i(c.to.x),y:i(c.to.y)};s.push({kind:"arrow",from:m,to:y,head:Sa(m,y,T.arrowHead*r),width:T.stroke*r})}if(!T.showNumbers)continue;const d=Math.max(a,T.badge/2*r),u=i(l.bounds.x+l.bounds.w),h=i(l.bounds.y),p=Zt({x:i(l.bounds.x),y:h,w:u-i(l.bounds.x),h:i(l.bounds.h)},{x:0,y:0,w:i(e.width),h:i(e.height)},r,d);s.push({kind:"badge",...p,radius:d,label:String(o),font:d*T.badgeTextScale})}return s}function ba(e,t){"letterSpacing"in e&&(e.letterSpacing="0px"),"wordSpacing"in e&&(e.wordSpacing="0px");const n=(a,r,s)=>{e.strokeStyle=T.halo,e.lineWidth=a+T.haloWidth*r,s(),e.strokeStyle=T.accent,e.lineWidth=a,s()};e.strokeStyle=T.accent,e.lineCap="round",e.lineJoin="round";for(const a of t)if(a.kind==="rect")n(a.width,a.width/T.stroke,()=>e.strokeRect(a.x,a.y,a.w,a.h));else if(a.kind==="path"||a.kind==="arrow"){e.lineWidth=a.width,e.beginPath();const r=a.kind==="path"?a.points:[a.from,a.to];a.kind==="arrow"&&r.forEach((i,o)=>o?e.lineTo(i.x,i.y):e.moveTo(i.x,i.y)),a.kind==="arrow"&&(e.moveTo(a.head.left.x,a.head.left.y),e.lineTo(a.to.x,a.to.y),e.lineTo(a.head.right.x,a.head.right.y));const s=a.kind==="path"?new Path2D(Xt(a.points)):null;n(a.width,a.width/(a.kind==="path"?T.pen:T.stroke),()=>s?e.stroke(s):e.stroke())}else e.fillStyle=T.paper,e.beginPath(),e.arc(a.x,a.y,a.radius,0,Math.PI*2),e.closePath(),e.fill(),e.strokeStyle=T.accent,e.lineWidth=T.badgeOutline*a.radius/T.badgeRadius,e.stroke(),e.fillStyle=T.ink,e.font=`600 ${a.font}px ${T.badgeFontFamily}`,e.textAlign="center",e.textBaseline="middle",e.fillText(a.label,a.x,a.y)}async function ka(e,t){const n=Uint8Array.from(atob(e),a=>a.charCodeAt(0));return createImageBitmap(new Blob([n],{type:t}))}async function va(e){const t=await e.convertToBlob({type:"image/png"});return Ze(await t.arrayBuffer())}async function ht(e,t,n,a,r=0){await an();const s=await ka(e.base64,e.mimeType);try{const i=Math.min(1,a/Math.max(t.width,t.height)),o=new OffscreenCanvas(Math.max(1,Math.round(t.width*i)),Math.max(1,Math.round(t.height*i))),l=o.getContext("2d");if(!l)throw new Error("dock-evidence-canvas-unavailable");return l.drawImage(s,0,0,o.width,o.height),ba(l,wa(t,n,i,r)),o}finally{s.close()}}async function _a(e,t,n){const a=await ht(e,t,n,Math.max(t.width,t.height));return fa(await va(a),"image/png")}async function Wr(e,t,n,a=384){const r=await ht(e,t,n,a,a/32);return URL.createObjectURL(await r.convertToBlob({type:"image/png"}))}function Sa(e,t,n=T.arrowHead){const a=Math.atan2(t.y-e.y,t.x-e.x),r=T.arrowSpread;return{left:{x:t.x-n*Math.cos(a-r),y:t.y-n*Math.sin(a-r)},right:{x:t.x-n*Math.cos(a+r),y:t.y-n*Math.sin(a+r)}}}function jr(e,t){const n=zt(t??void 0),a=new Set(t?.clips.filter(r=>!!r.media&&!F(r.media)).map(r=>r.contextItemId));return e.filter(r=>!n.has(r.id)&&!a.has(r.id))}async function qr({workspaceId:e,agentId:t,evidence:n,clickedItems:a,sendItems:r,clickedPayload:s,binding:i,service:o,current:l,onRecord:c,timing:d}){const u=()=>{if(!l()||!G(i))throw new O("validate","media-send-retired")};if(u(),n?.images.some(w=>w.mediaError)||n?.clips.some(w=>w.mediaError))throw new O("validate","invalid-saved-edit");const h=w=>!!w.media&&!F(w.media),p=n?{workspaceId:e,agentId:t,appUrl:`intent://local/workspace/${encodeURIComponent(e)}`,clipAttachmentIds:Object.fromEntries(n.clips.map(w=>[w.id,a.find(M=>M.id===w.contextItemId)?.attachmentId??null]))}:null;for(const w of n?.clips??[]){if(!w.media||!F(w.media))continue;const M=a.find(Q=>Q.id===w.contextItemId);if(!M||M.attachmentId!==w.media.source.attachmentId||M.path!==w.media.source.path||M.placementStatus!==void 0&&M.placementStatus!=="placed")throw new O("validate","legacy-original-unavailable")}const m=n?await ma(e,n,i,o,l,d):{images:{},files:[],frames:[],framePromptBytes:[],metadata:[]},y=new Set(n?.clips.filter(w=>h(w)||!!w.media&&F(w.media)).map(w=>w.id)),f=new Set(n?.clips.filter(w=>y.has(w.id)).flatMap(w=>(w.captureHistory??[]).map(M=>M.image.id))),k=(n?.images??[]).filter(w=>w.source!=="annotate"||!!w.media||!f.has(w.id)||n.marks.some(M=>M.imageId===w.id&&!(M.clipId&&y.has(M.clipId))));d?.stage("burn");let v=[];try{v=n?await Ma({...n,images:k},a,m.images):[]}catch(w){throw new O("burn",ie(w))}if(m.framePromptBytes.reduce((w,M)=>w+(M??0),0)>Fn)throw new O("validate","image-budget-exceeded");const S=new Set(n?.images.filter(w=>w.media).map(w=>w.id)),_=n?{...n,images:k.map(w=>m.images[w.id]?{...w,width:m.images[w.id].width,height:m.images[w.id].height}:w),clips:n.clips.filter(w=>!h(w)),marks:n.marks.filter(w=>!S.has(w.imageId)&&!n.clips.some(M=>h(M)&&M.id===w.clipId))}:null;u();const B=m.metadata.some(w=>typeof w.transcript=="string"&&w.transcript.trim());if(!s.text.trim()&&!r.length&&!s.workspaceContextStr?.trim()&&!v.length&&!m.files.length&&!m.frames.length&&!s.imageBlocks?.length&&!s.fileBlocks?.length&&!B)return null;let C=v,P=null;d?.stage("placement");const Re=n?await pt(i):null;if(u(),n&&(e!==be||Re?.chiefAttachments)){const w=await la({workspaceId:e,binding:i,images:k.map((M,Q)=>{const X=a.find(Et=>Et.id===M.contextItemId);return{image:M,signature:Gt(n,M.id),composite:{base64:v[Q].data,mimeType:v[Q].mimeType},raw:!M.media&&X?.imageData&&X.imageMimeType?{base64:X.imageData,mimeType:X.imageMimeType}:null}}),records:n?.placements??{},onRecord:c});u(),C=w.map(M=>({type:"image",attachmentId:M.composite.attachmentId,mimeType:M.composite.mimeType})),P=Object.fromEntries(w.map(M=>[M.imageId,{attachmentId:M.composite.attachmentId,raw:M.raw}]))}const g=new Map(n?Xe(n).map(({n:w,mark:M})=>[M.id,w]):[]),D=p&&P?{...p,imageAttachments:P,markNumbers:g}:p&&{...p,markNumbers:g},L=n&&D?{...s,imageBlocks:[...C,...m.frames,...s.imageBlocks??[]],fileBlocks:[...s.fileBlocks??[],...m.files],workspaceContextStr:[Jt(_,D),m.metadata.length?`[Edited capture outputs]
|
|
3
3
|
${JSON.stringify(m.metadata)}`:"",s.workspaceContextStr].filter(Boolean).join(`
|
|
4
4
|
|
|
5
5
|
`),messageMetadata:{...s.messageMetadata,...Yt(_,D),edited_captures:m.metadata}}:s;return u(),L}async function Ma(e,t,n={}){const a=Xe(e);return Promise.all(e.images.map(async r=>{if(n[r.id])return{type:"image",...n[r.id]};const s=t.find(o=>o.id===r.contextItemId);if(!s?.imageData||!s.imageMimeType)throw new Error("dock-evidence-missing-pixels");const i=await _a({base64:s.imageData,mimeType:s.imageMimeType},r,a.filter(({mark:o})=>o.imageId===r.id));return{type:"image",data:i.base64,mimeType:i.mimeType}}))}const Aa="intent.dock.captureEditorPreview";function Vr(){try{return et()&&localStorage.getItem(Aa)==="1"}catch{return!1}}function zr(e){const{clip:t}=e;if(t.status!=="ready"||!t.path)return null;const n=e.marks.filter(s=>s.clipId===t.id&&typeof s.clipMs=="number").sort((s,i)=>s.clipMs-i.clipMs).map(s=>({id:s.id,tool:s.tool,atMs:s.clipMs,...s.element?.name?{label:s.element.name.slice(0,200)}:{}})),a=Qt(e.evidence??void 0,t.id),r=a?t.media:void 0;return{kind:"recording",workspaceId:e.workspaceId,agentId:e.agentId,attachmentId:a?.attachmentId??t.id,sourceRevision:a?`${a.id}:${a.revision}`:t.path,attachmentPath:t.path,title:"",durationMs:t.durationMs,marks:n,provenance:a?{...a.audio==="unknown"?{}:{hasMicAudio:a.audio==="available"},visuals:a.visuals}:{hasMicAudio:t.hasMicAudio,visuals:n.length>0?"baked-marks":"clean"},...a&&r?{source:a,saved:r.saved??null,transcript:r.transcript??null}:{}}}async function Gr(e){if(!et())return{ok:!1,error:"unavailable"};try{return await sn().invoke(rn.OPEN,e)??{ok:!1,error:"unavailable"}}catch{return{ok:!1,error:"transport"}}}function Yr(e){let t=null,n=null;const a=o=>e.releaseMediaJob?.(o).catch(()=>{});function r(){const o=t;t=null,!(!o||o.taken||o.stopped)&&(o.stopped=!0,clearTimeout(o.timer),a(o.id))}function s(o,l,c){if(t?.key===o||n===o||(r(),n=null,!e.adoptMediaJob||!e.exportMedia||!c()||F(l)))return;const d=structuredClone(l),u=d.saved??re(d.source,d.source.capturedMarks??[],d.transcript),h=ve(u,d.source,d.transcript);if(d.source.kind!=="recording"||d.source.visuals!=="clean"||h.errors.length||!h.clips.length||u.voice==="transcript"&&d.transcript?.status!=="ready")return;const p={...d,saved:u},m=crypto.randomUUID(),y={key:o,mediaKey:JSON.stringify(p),id:m,current:c,taken:!1,stopped:!1,settled:!1,failed:!1,timer:setTimeout(()=>{t===y&&(n=o,r())},3e4),result:Promise.resolve({error:new Error("not-started")})};t=y,y.result=ot(p,m,e,()=>!y.stopped&&y.current()).then(async f=>y.stopped||!y.current()?(await a(m),{error:new Error("media-send-retired")}):{value:f},async f=>(y.failed=!0,t===y&&(n=o),await a(m),{error:f})).finally(()=>{y.settled=!0})}async function i(o,l,c){const d=t;if(!d||d.key!==o||d.mediaKey!==JSON.stringify(l)||d.stopped||d.taken||!c())return null;if(d.failed&&d.settled)return r(),null;d.taken=!0,d.current=c,clearTimeout(d.timer),t=null;const u=await d.result;if("error"in u)throw u.error;try{if(!c())throw new Error("media-send-retired");const h=await e.adoptMediaJob?.(d.id);if(!c())throw new Error("media-send-retired");return!h?.ok||!h.value?(await a(d.id),null):u.value}catch(h){throw await a(d.id),h}}return{warm:s,take:i,cancel:r}}function Jr(e={}){const t=a=>_n(a,typeof e=="function"?e():e),n=a=>wn(t(a));return{actionHints:{get capture(){return{label:b.dock_composer_screenshotAction_label(),shortcut:t("dock.capture")}},get record(){return{label:b.ui_shortcuts_dockRecord_label(),shortcut:t("dock.record")}},get dictate(){return{label:b.dock_shortcut_dictate_label()}}},get capture(){return b.dock_composer_capture_tooltip({shortcut:n("dock.capture")})},captureMode:{get window(){return b.dock_composer_captureWindow_tooltip({shortcut:n("dock.capture")})},get region(){return b.dock_composer_captureRegion_tooltip({shortcut:n("dock.capture")})}},captureModes:{fullscreen:b.dock_composer_captureFullscreen_label(),window:b.dock_composer_captureWindow_label(),region:b.dock_composer_captureRegion_label()},captureOptions:b.dock_composer_captureModes_ariaLabel(),captureLimit:b.dock_composer_captureLimit_tooltip(),clipLimit:b.dock_composer_clipLimit_tooltip({limit:q(ae.clips)}),get record(){return b.dock_composer_record_tooltip({shortcut:n("dock.record")})},stopRecording:b.dock_composer_stopRecording_tooltip(),annotationTools:b.annotation_toolbar_ariaLabel(),annotateCurrent:a=>b.dock_composer_annotate_ariaLabel({tool:a}),tools:{pick:b.dock_composer_pick_label(),box:b.dock_composer_box_label(),pen:b.dock_composer_pen_label(),arrow:b.annotation_arrow_label()},get dictate(){return b.dock_shortcut_dictate_label()},stopDictating:b.dock_composer_stopDictating_tooltip(),annotating:b.dock_composer_annotating_status(),listening:b.dock_composer_listening_status(),recording:b.dock_composer_recording_status(),markUp:b.dock_composer_markUp_label(),remove:b.chat_contextChip_remove_label(),play:b.dock_composer_play_label(),edit:b.dock_composer_edit_label(),done:b.dock_composer_done_label(),attachments:b.context_attachments_title_label(),retry:b.chat_shared_retry_label(),attachmentPending:b.dock_composer_attachmentPending_status(),attachmentFailed:b.dock_composer_attachmentFailed_error(),image:a=>b.dock_composer_image_ariaLabel({n:q(a)}),clip:a=>b.dock_composer_clip_ariaLabel({duration:a}),recordingReference:(a,r)=>r?b.dock_composer_recordingEnd_chip({n:q(a)}):b.dock_composer_recordingStart_chip({n:q(a)}),speechError:a=>a.includes("permission")?b.dock_composer_speechPermission_error():["unsupported-platform","helper-missing","recognizer-unavailable","locale-unsupported","assets-unavailable","unavailable"].includes(a)?b.dock_composer_speechUnavailable_error():b.dock_composer_speechFailed_error()}}function Qr(e,t){return{enabled:e,limit:ae.files,excludedIds:t,unavailableMessage:b.dock_composer_filesUnavailable_error(),limitMessage:b.dock_composer_fileLimit_error({limit:q(ae.files)})}}function Ia(e){try{return new URL(e.pageUrl).hostname||e.pageUrl}catch{return e.pageUrl}}function Xr(e,t){return e.targetAgentId===t}function Zr(e){const t=e.element,n=e.viewport,a=Ia(e),r=t?`<${t.tagName.toLowerCase()}> · ${a}`:e.title||a,s=["<browser-element-capture>",`Page URL: ${e.pageUrl}`,`Page title: ${e.title}`,...t?[`DOM path: ${t.domPath}`,`CSS selector: ${t.selector}`,`Text snippet: ${t.textSnippet}`,...t.sourceRef?[`Source ref: ${t.sourceRef}`]:[],...n?[`Viewport: ${n.width}×${n.height}`]:[],`Element bounds: ${t.rect.width}×${t.rect.height} at (${t.rect.x}, ${t.rect.y})`]:[],"</browser-element-capture>"].join(`
|
|
@@ -8,4 +8,4 @@ ${JSON.stringify(m.metadata)}`:"",s.workspaceContextStr].filter(Boolean).join(`
|
|
|
8
8
|
\`\`\`
|
|
9
9
|
${i}
|
|
10
10
|
\`\`\`]`)}return Ta(a.join(`
|
|
11
|
-
`),e)}function es(e,t,n){if(e==="suggested-prompt")return{fields:{},hasAttachments:!1,cleanup:{clearInput:!1,followBottom:!0,historyText:null}};const a=n(),{imageBlocks:r,fileBlocks:s}=Ea(a.contextItems);return{fields:{contextItems:a.contextItems,workspaceContextStr:Ca(a.contextItems,a.checkedPanels,a.checkedSelections),noteIds:a.noteIds,...r.length>0?{imageBlocks:r}:{},...s.length>0?{fileBlocks:s}:{},...a.pickedMentions?{messageMetadata:a.pickedMentions}:{}},hasAttachments:r.length>0||s.length>0,cleanup:{clearInput:!0,followBottom:!0,historyText:t}}}const Da="chat-read:",K=new Map,ye=new Set;function ts(e,t){let n=K.get(e);n||(n=new Set,K.set(e,n)),n.add(t)}function ns(e,t){const n=K.get(e);if(!(!n||!n.delete(t))&&n.size===0){K.delete(e);for(const a of[...ye])a(e)}}function as(e){return ye.add(e),()=>ye.delete(e)}function rs(e){return K.has(e)}function ss(e){const t=K.get(e);if(!t)return!1;for(const n of t)if(!n.startsWith(Da))return!0;return!1}function xa(e,t,n){const a=e.state.pendingSubmissions.byAgentId[t.agentId];if(!a||!Ye(a.scope,t))return null;const r={...structuredClone(n),id:crypto.randomUUID(),createdAt:Date.now()};e.dispatch(Lt(t,r));const s=e.state.pendingSubmissions.byAgentId[t.agentId];return s&&x(s.submissions,r.id)?r:null}function Ra(e,t,n,a,r){const s=Be.select(e.state,n),i=pe.select(e.state)?.principal.id,o=Ue(e.state);if(!s||!i||!o)return null;const l=In(t,n),c={agentId:t,workspaceId:n,principalId:i,participation:s,authority:o,owner:l.key,lifetime:e.state.pendingSubmissions.byAgentId[t]?.scope.lifetime??crypto.randomUUID()},d=()=>l.isCurrent(e.state.agentSessions?.byAgentId[t]?.workspaceId)&&Be.select(e.state,n)===s&&pe.select(e.state)?.principal.id===i&&Ue(e.state)===o;if(!d())return null;e.dispatch(Ut(c,a,Pt.select(e.state,n)));const u=xa(e,c,r);return u?{scope:c,submission:u,isCurrent:()=>{const h=e.state.pendingSubmissions.byAgentId[t];return d()&&!!h&&Ye(h.scope,c)&&(!!x(h.operations,u.id)||!!x(h.submissions,u.id))}}:null}function we(e,t,n){if(!n.text.trim()&&!n.imageBlocks?.length&&!n.fileBlocks?.length)return null;const a=n.userAppMessageId??Tn();return Ra(e,t,n.wsId,pe.select(e.state)?.capabilities.submissionCorrelation,{content:n.text.trim(),appMessageId:a,destination:!n.forceSubmit&&Bt.select(e.state,t)?"queue":"conversation",contextItems:n.contextItems,imageBlocks:n.imageBlocks,fileBlocks:n.fileBlocks,messageMetadata:n.messageMetadata})}function Pa(e,t,n){const a=we(e,t,n);return a?(e.dispatch(Je(t,{...n,userAppMessageId:a.submission.appMessageId,submission:{scope:a.scope,id:a.submission.id}})),!0):!1}async function Ba(e,t,n,a){const r=n.submission;if(!r)return"legacy";const s=r.reference,i=()=>s.scope.agentId===e&&s.scope.workspaceId===t&&Ge.select(A.state,e)===n?hn.select(A.state,s.scope):void 0,o=i();if(!o)return null;if(!o.supported)return"legacy";const l={wsId:t,text:n.text,imageBlocks:n.options?.imageBlocks,fileBlocks:n.options?.fileBlocks,noteIds:n.options?.noteIds,messageMetadata:n.options?.messageMetadata,model:a??n.options?.model};if(r.outcome==="rejected"){const p=x(o.tombstones,s.id);return x(o.submissions,s.id)||p&&p.reason!=="rejected"?null:we(A,e,l)}if(r.outcome==="accepted")return we(A,e,l);await Promise.all([En(e,t).catch(()=>{}),Cn(e,t).catch(()=>{})]);const c=i();if(!c||x(c.submissions,s.id)?.status!=="uncertain")return null;const{notify:d}=await fe(async()=>{const{notify:p}=await import("./D77Zy4An.js").then(m=>m.C);return{notify:p}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37]),import.meta.url);if(i()!==c)return null;let u=!1;const h=()=>{u=!0};return d.warning(b.agent_chatSend_uncertainRetry_description(),{key:`submission-retry:${t}:${e}:${s.id}`,duration:Number.POSITIVE_INFINITY,action:{label:b.agent_chatSend_resend_label(),onClick:()=>{if(u)return;u=!0;const p=i();!p||p.generation!==c.generation||p.submissions!==c.submissions||p.observationVersion!==c.observationVersion||x(p.submissions,s.id)?.status!=="uncertain"||Pa(A,e,l)}},cancel:{label:b.chat_richInput_cancel_label(),onClick:h},onDismiss:h}),null}async function is(e,t,n){const a=Ge.select(A.state,e),r=a?.submission?await Ba(e,t,a,n):"legacy";if(r){if(r==="legacy"){await A.dispatch(n===void 0?Nt(e,t):Ht(e,t,n));return}!r.isCurrent()||!a||A.dispatch(Je(e,{wsId:t,text:a.text,imageBlocks:a.options?.imageBlocks,fileBlocks:a.options?.fileBlocks,noteIds:a.options?.noteIds,messageMetadata:a.options?.messageMetadata,model:n??a.options?.model,userAppMessageId:r.submission.appMessageId,submission:{scope:r.scope,id:r.submission.id}}))}}const os=A.createSelector((e,t)=>{const n=x(e.chatDrafts.owners,t);return n?{restore:n.restore,saves:Qe(n.saves),shared:n.restore?e.chatDrafts.shared[JSON.stringify([n.restore.workspaceId,n.restore.agentId])]:void 0}:void 0});function Oa(e,t){return t.workspaceId===e&&!t.retiredAt&&!t.pendingDeleteAt&&t.status!==ke.Deleted&&!t.notificationsMuted&&Kt(t)==="topLevel"}function $a(e){const t=e.metadata?.pendingQuestionsMessageId;return typeof t=="string"&&t.length>0&&!Rn(e.metadata,t)?t:null}function Ua(e){return e.status===ke.Error&&!Ot($t(e))}function cs(e,t){return t.filter(n=>Oa(e,n)).flatMap(n=>{const a=Ft(n),r=$a(n),s=n.status===ke.Error;if(!a&&!r&&!s)return[];const i=a?.timestamp??(s?n.stopReasonTimestamp:void 0);return[{agentId:n.id,agentName:n.name,kind:a?.kind??(s?"failed":"question"),reason:a?.reason,timestamp:i&&Number.isFinite(Date.parse(i))?i:void 0,questionMessageId:r,canRetry:Ua(n)}]})}function ls(e){return e.displayStatus==="failed"?"failed":e.displayStatus==="blocked"?"blocked":e.attention==="review_required"?"review":e.displayStatus==="needs_attention"?"question":e.activity==="agent_running"||e.displayStatus==="in_progress"?"running":e.scriptsRunning===!0?"scripts_running":e.backgroundTasksRunning===!0?"background_tasks_running":e.displayStatus==="pr_ready"?"pr_ready":e.displayStatus==="pr_merged"?"merged":e.displayStatus==="complete"?"complete":e.attention==="unread"?"unread":e.displayStatus==="pr_open"||e.displayStatus==="pr_queued"?e.displayStatus:"idle"}function ds(e){const t=e.kind==="prs"?e.organization?.trim().toLowerCase():void 0;return{key:JSON.stringify([e.kind,e.workspaceId,t||null,[...new Set((t?[]:e.repositories).map(n=>JSON.stringify([n.key,n.owner,n.name])))].sort()]),hasGitHubRepositories:!!t||e.repositories.some(n=>!!n.owner),hasLocalRepositories:!t&&e.repositories.some(n=>!n.owner)}}function Te(e){const t=bn(e);if(t?.kind!=="pr"||!Number.isSafeInteger(t.number)||t.number<=0)return null;const n=t.owner.toLowerCase(),a=t.repo.toLowerCase();return{owner:n,repo:a,number:t.number,id:`${n}/${a}#${t.number}`,url:`https://github.com/${n}/${a}/pull/${t.number}`}}function us(e,t,n,a){const r=e.filter(s=>a?a.includes(s.id):n?s.repositoryOwner?.toLowerCase()===n.toLowerCase():t.some(i=>i.owner?.toLowerCase()===s.repositoryOwner?.toLowerCase()&&i.name.toLowerCase()===s.repositoryName?.toLowerCase()));return[...new Map(r.flatMap(s=>[...(s.pullRequests??[]).map(i=>i.url),s.activePullRequest?.url,s.prUrl]).flatMap(s=>{const i=s?Te(s):null;return i?[[i.id,{owner:i.owner,repo:i.repo,number:i.number}]]:[]})).values()].sort((s,i)=>`${s.owner}/${s.repo}#${s.number}`.localeCompare(`${i.owner}/${i.repo}#${i.number}`))}function ms(e,t){const[n]=t;return t.length!==1||e.owner?.toLowerCase()!==n?.owner?.toLowerCase()||e.repo?.toLowerCase()!==n?.name.toLowerCase()}const ps=A.createSelector(e=>e.homeIntegrations),fs=A.createSelector(e=>{const t=e.homeIntegrations;return!t.linkedItems||!Object.keys(t.linkedItems).length?t:{...t,items:[...new Map([...Object.values(t.linkedItems),...t.items].map(n=>[n.id,n])).values()].sort((n,a)=>(a.updatedAt??"").localeCompare(n.updatedAt??""))}}),gt=A.createSelector(e=>Qe(e.workspace.workspaces).flatMap(t=>[...(t.pullRequests??[]).map(n=>n.url),t.activePullRequest?.url,t.prUrl].filter(n=>!!n).map(n=>({url:Te(n)?.url??n.replace(/\/$/,"").toLowerCase(),workspaceId:t.id,name:t.title||t.id})))),hs=A.createSelector(e=>{const t=e.homeIntegrations.detail?.url,n=t?Te(t)?.url??t.replace(/\/$/,"").toLowerCase():void 0;return gt.select(e).find(a=>a.url===n)??null}),gs=A.createSelector(e=>gt.select(e).map(t=>t.url));let ee=null;function ys(e){return ee=e,()=>{ee===e&&(ee=null)}}function ws(){return ee}function bs(e){return[...e.groups.length>0?e.groups.filter(n=>n.expanded).flatMap(n=>n.items):e.workspaces,...e.asideExpanded?e.aside:[]].map(n=>n.id)}function ks(e,t,n){if(e.length===0)return null;const a=t===null?-1:e.indexOf(t);return a===-1?e[0]:e[a+(n==="clockwise"?1:-1)]??null}let te=null;function vs(e){return te=e,()=>{te===e&&(te=null)}}function _s(){return te}function Ss(e){return An(e)}function La(e){return Mn(e)}function Na(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function me(e){if(e.length===0)return[];const t=[];let n=null;for(const a of e){const r=a.timestamp?typeof a.timestamp=="string"?new Date(a.timestamp):a.timestamp:new Date;(!n||!Na(n.date,r))&&(n={date:r,label:La(r),messages:[]},t.push(n)),n.messages.push(a)}return t}function Ms(e){const t=new Map;return e.map(({date:n})=>{const a=`${n.getFullYear()}-${n.getMonth()+1}-${n.getDate()}`,r=t.get(a)??0;return t.set(a,r+1),r===0?a:`${a}#${r}`})}function As(e,t){const n=new Map;let a=t?null:void 0;for(const r of e.groups)for(const s of r.messages)a!==void 0&&n.set(s.id,a),s.role==="user"&&!Bn(s)&&(a=s);return n}function Ha(e){return`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`}function je(e,t){const n=new Map;return e.map(a=>{const r=`${t}-${Ha(a.date)}`,s=(n.get(r)??0)+1;return n.set(r,s),{...a,groupKey:s===1?r:`${r}-${s}`}})}function Fa(e,t){if(e.length===0||t.length===0)return e;const n=new Set(t.map(s=>s.id)),a=new Set(t.map(s=>s.appMessageId).filter(s=>typeof s=="string"&&s.length>0)),r=e.filter(s=>!n.has(s.id)&&!(typeof s.appMessageId=="string"&&s.appMessageId.length>0&&a.has(s.appMessageId)));return r.length===e.length?e:r}function Is(e,t,n){return e=Fa(e,t),e.length===0?{groups:me(t),detached:!1,hiddenTail:[]}:n?{groups:je(me(e),"h"),detached:!0,hiddenTail:t}:{groups:je(me([...e,...t]),"d"),detached:!1,hiddenTail:[]}}function Ts(e){const{scrollTop:t,threshold:n,fetching:a,exhausted:r,historyCount:s,tailCount:i,tailTruncated:o,totalMessages:l,spacerAbove:c=0}=e;return t>n+c||a||r?!1:s>0||o||l>i+s}const Es=300;function Cs(e){const{fetching:t,chainEvaluationPending:n,visible:a,hideArmed:r}=e;return t||n?a&&!r?"none":"show":a&&!r?"arm-hide":"none"}const qe=24,Ka=320;function Ee(e){return Number.isFinite(e)?Math.min(Ka,Math.max(qe,e)):qe}const Wa=.2,ja=.12;function qa(e,t,n=Wa){const a=Ee(t);return e===null||!Number.isFinite(e)?a:e+n*(a-e)}function Ds(e,t){const n=Ee(t??Number.NaN);return{above:Math.round(Math.max(0,e.above)*n),below:Math.round(Math.max(0,e.below)*n)}}function xs(e){const{totalMessages:t,residentCount:n,exhausted:a,residentContentHeight:r,currentSpacerHeight:s,viewportHeight:i}=e;let o=e.rowHeightEma;n>0&&r>0&&(o=qa(o,r/n));const l=e.unloadedRows??t-n,d=a||t<=0||n<=0||l<=0||o===null?0:Math.round(l*o),u=Math.abs(d-s);return u===0?{spacerHeight:s,rowHeightEma:o,applied:!1,scrollTopDelta:0}:d===0||s===0||u>s*ja||i>0&&u>i?{spacerHeight:d,rowHeightEma:o,applied:!0,scrollTopDelta:d-s}:{spacerHeight:s,rowHeightEma:o,applied:!1,scrollTopDelta:0}}const Va=Pn,za=2;function Rs(e){const{scrollTop:t,spacerAboveHeight:n,rowHeightEstimate:a,pageSize:r=Va,nearPages:s=za}=e;if(n<=0||t>=n)return"serial";const i=Ee(a??Number.NaN);return(n-Math.max(0,t))/i>s*r?"seek":"serial"}const yt=200,Ga=1;function Ps(e,t,n=yt){const a=t.timestamp-n;return[...e.filter(r=>r.timestamp>=a),t]}function Bs(e){const{samples:t,viewportHeight:n,windowMs:a=yt,viewportFactor:r=Ga}=e;if(n<=0||t.length<2)return"gentle";const s=t[t.length-1].timestamp-a,i=t.filter(l=>l.timestamp>=s);if(i.length<2)return"gentle";let o=0;for(let l=1;l<i.length;l+=1)o+=Math.abs(i[l].scrollTop-i[l-1].scrollTop);return o>n*r?"rapid":"gentle"}function Os(e){const{scrollTop:t,spacerAboveHeight:n,unloadedRowsAbove:a}=e;if(a<=0||n<=0)return 0;const r=Math.min(1,Math.max(0,t/n));return Math.min(a-1,Math.max(0,Math.floor(r*a)))}function $s(e){const{totalMessages:t,residentCount:n,exhausted:a,startOrdinalEstimate:r,detachedFromTail:s}=e,i=Math.max(0,t-n);if(!s)return{above:a?0:i,below:0};const o=Math.max(0,e.hiddenTailCount??0);if(a)return{above:0,below:i+o};if(r!==null){const c=Math.min(i,Math.max(0,Math.round(r)));return{above:c,below:i-c+o}}const l=Math.min(i,Math.max(0,Math.round(e.holeRowsEstimate??0)));return{above:i-l,below:l+o}}function Us(e){const{exhausted:t,historyCount:n,tailCount:a,tailTruncated:r,totalMessages:s}=e;return t?!0:n>0?!1:!r&&s<=a}const Ya="intent.drafts.sync",Ja="intent.drafts.changed",Qa=$({id:E(),type:E(),label:E(),description:E().optional(),content:E().optional(),path:E().optional(),imageData:E().optional(),imageMimeType:E().optional(),attachmentId:E().optional(),attachmentMimeType:E().optional(),attachmentSize:ce().optional(),sourcePath:E().optional(),placementStatus:V("failed").optional(),screen:On().optional()}),wt=$({text:E(),attachments:$n(Qa)}),z={provenance:E().min(1),workspaceId:E().min(1),agentId:E().min(1)},ne={lifetime:E(),revision:ce().int().nonnegative()};Un("kind",[$({...z,kind:V("read")}),$({...z,...ne,kind:V("edit"),origin:E().min(1),sequence:ce().int().positive(),snapshot:wt}),$({...z,...ne,kind:V("flush")}),$({...z,...ne,kind:V("clear"),origin:E().min(1)})]);const bt=$({...z,...ne,origin:E(),sequence:ce().int().nonnegative(),snapshot:wt}),Xa=$({accepted:Ln(),draft:bt});function Za(e,t,n=t){const a=new Map,r=new Set,s=crypto.randomUUID();let i=0,o=!1;const l=()=>{const f=t();if(o||!f)throw new Error("draft-authority-unavailable");return f},c=()=>{const f=n();if(!f||o)throw new Error("draft-authority-unavailable");return()=>{if(o||n()!==f)throw new Error("draft-authority-changed")}},d=(f,k,v)=>{const I=JSON.stringify([f,k,v]);let S=a.get(I);return S||(S={dirty:0},a.set(I,S)),S},u=(f,k)=>{if(o||f.provenance!==t())return;const v=d(f.provenance,f.workspaceId,f.agentId);if(!(v.value?.lifetime===f.lifetime&&v.value.revision>f.revision)&&(v.value=f,k&&v.dirty===0))for(const I of r)I(f)},h=e.subscribe(f=>{const k=bt.safeParse(f);k.success&&u(k.data,!0)}),p=async(f,k)=>{k();const v=Xa.parse(await e.request(f));if(k(),f.provenance!==l()||v.draft.provenance!==f.provenance)throw new Error("draft-authority-changed");if(!v.accepted)throw u(v.draft,!1),new Error("draft-changed-in-another-editor");return v.draft},m=async(f,k)=>{const v=l(),I=c(),S=d(v,f,k);S.tail&&await S.tail;const _=await p({kind:"read",provenance:v,workspaceId:f,agentId:k},I);return u(_,!1),_},y=(f,k,v)=>{const I=l(),S=c(),_=d(I,f,k),B=_.tail??(_.value?Promise.resolve(_.value):p({kind:"read",provenance:I,workspaceId:f,agentId:k},S));_.dirty+=1;const C=B.then(P=>p(v(P),S));return _.tail=C,C.then(P=>{_.dirty-=1,_.tail===C&&(_.tail=void 0),u(P,!0)},()=>{_.dirty-=1,_.tail===C&&(_.tail=void 0)}),C};return{authority:()=>o?null:n(),read:m,async edit(f,k,v,I){const S=++i;return y(k,v,_=>({kind:"edit",provenance:_.provenance,workspaceId:k,agentId:v,lifetime:_.lifetime,revision:_.revision,origin:f,sequence:S,snapshot:I}))},async flush(f,k){const v=l(),I=c(),S=d(v,f,k),_=await(S.tail??(S.value?Promise.resolve(S.value):m(f,k)));await p({kind:"flush",provenance:v,workspaceId:f,agentId:k,lifetime:_.lifetime,revision:_.revision},I)},async clear(f,k){await y(f,k,v=>({kind:"clear",provenance:v.provenance,workspaceId:f,agentId:k,lifetime:v.lifetime,revision:v.revision,origin:s}))},subscribe(f){return r.add(f),()=>{r.delete(f)}},dispose(){o=!0,h(),r.clear(),a.clear()}}}let U=null;async function Ls(e,t,n,a,r){const s=U;if(!s)throw new Error("draft-shared-transport-unavailable");const i=()=>{if(U!==s||s.authority()!==r)throw new Error("draft-authority-changed")};i(),await s.edit(e,t,n,a),i(),await s.flush(t,n),i()}async function Ns(e,t){await Promise.resolve(),U&&await U.flush(e,t)}function Hs(){if(!Sn())return null;const e=Za({request:n=>vn(Ya,n),subscribe:n=>kn(a=>{a.method===Ja&&n(a.params)})},()=>Dn(A.state),()=>xn(A.state));U=e;const t=e.dispose;return e.dispose=()=>{U===e&&(U=null),t()},e}const kt=new Map;function vt(e,t){return`${e}\0${t}`}function Fs(e,t){return kt.get(vt(e,t))}function Ks(e,t,n){kt.set(vt(e,t),n)}const Ws=A.createSelector((e,t,n)=>{const a=e.chatPanelUi.byWorkspaceId[t];return a?x(a.userMessageIndexes,n):void 0}),js=A.createSelector((e,t,n)=>{const a=e.chatPanelUi.byWorkspaceId[t];return a?x(a.retryAgents,n):void 0});function er(e){e=Math.max(0,e);const t=Math.floor(e/1e3);if(t<10){const s=e/1e3,i=s.toFixed(1);return i.endsWith(".0")?`${Math.round(s)}s`:`${i}s`}if(t<60)return`${t}s`;const n=Math.floor(t/3600),a=Math.floor(t%3600/60),r=t%60;return n>0?`${n}h ${a}m ${r}s`:`${a}m ${r}s`}function qs(e){return er(Math.max(1e3,Math.round(e/1e3)*1e3))}const tr=new Set(["launch","init","session-create","session-load","prompt"]),nr=new Set(["tool-call","tool-waiting"]);function ar(e){let t=null;for(const n of e)(!t||n.timestamp>=t.timestamp)&&(t=n);return t}function Vs(e){return e&&tr.has(e)?"pulse":e&&nr.has(e)?"twist":"bloom"}const _t="stalled";function zs(e,t){const n=ar(e);return!n||n.phase!==_t||typeof t=="number"&&t>n.timestamp?null:n}function Gs(e){let t=null;for(const n of e)n.phase!==_t&&(!t||n.timestamp>=t.timestamp)&&(t=n);return t}const Ve={get title(){return b.chat_streamingStatus_sessionCorrupted_title()},get message(){return b.chat_streamingStatus_sessionCorrupted_message()}};function Ys(e,t){return e?t===!0?{corrupted:!0,title:Ve.title,message:Ve.message,detail:e}:{corrupted:!1,title:b.chat_streamingStatus_responseFailed_label(),message:e,detail:null}:null}const Js=A.createSelector((e,t)=>e.unreadTracking.dividerSessionByAgentId[t]??null),Qs=A.createSelector(e=>e.unreadTracking.currentlyViewedAgentId),Xs=A.createSelector(e=>{const t=[];for(const s of Object.values(e.panelLayout.byWorkspaceId))for(const i of Object.values(s.panels))for(const o of i.tabs)o.type==="agent"&&o.agentId&&t.push(o.agentId);const n=Object.keys(e.unreadTracking.dividerSessionByAgentId),a=new Set(e.agentSessions.agentIdsByWorkspace[be]??[]);return{chiefCardVisible:e.sidebarNav.panelItem==="chief",chiefSessionAgentIds:n.filter(s=>a.has(s)),dividerSessionAgentIds:n,openAgentTabIds:t}}),Zs=A.createSelector((e,t)=>x(e.questionUi.consumers,t)),rr=3e4,Y=new Map;function ei(e,t){const n=Y.get(e);n&&clearTimeout(n.timer);const a=setTimeout(()=>Y.delete(e),rr);Y.set(e,{value:t,timer:a})}function ti(e){const t=Y.get(e);if(t)return clearTimeout(t.timer),Y.delete(e),t.value}const St=A.createSelector((e,t,n)=>e.agentWorkers?.byKey[jt(t,n)]??Wt),sr=A.createSelector((e,t,n)=>{const a=St.select(e,t,n);return a.status==="unsupported"?[]:(a.snapshot?.workers??[]).filter(r=>r.status==="running"||r.status==="unknown")}),ni=A.createSelector((e,t,n)=>{const a=St.select(e,t,n);return a.status==="failed"?!0:a.status!=="ready"||!a.snapshot?!1:a.snapshot.truncated?!0:a.snapshot.support.status!=="supported"&&sr.select(e,t,n).length>0}),ir=1e3,Mt={requireViewedAndFocused:!0,requireAssistantTail:!0},J=new Map,R=new Map;let W=null;function Ce(e){(e===void 0||W===e)&&(W=null)}const or=200;function cr(e,t){if(R.delete(e),R.set(e,t),R.size>or){const n=R.keys().next().value;n!==void 0&&R.delete(n)}}function At(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(!n.isStreaming&&typeof n.id=="string"&&n.id.length>0)return n}return null}function ai(e){return At(e)?.id??null}function ri(e){De(e,{requireViewedAndFocused:!0})}function si(e){De(e,{requireViewedAndFocused:!1})}function ii(e){Ce(),De(e,Mt)}function oi(e){W===e&&(J.has(e)||(W=null,xe(e,Mt)))}function ci(e){for(const t of e)typeof t!="string"||t.length===0||(It(t),Ce(t),xe(t,{requireViewedAndFocused:!1}))}function It(e){const t=J.get(e);t&&(clearTimeout(t.timer),J.delete(e))}function De(e,t){It(e),Ce(e);const n=setTimeout(()=>{J.delete(e),xe(e,t)},ir);J.set(e,{timer:n,gates:t})}let ze=null;function lr(){return ze??=Promise.all([fe(()=>import("./q36554_4.js"),__vite__mapDeps([38,17,18,3,19,20,5,7,4,21,13,2,39,40]),import.meta.url),fe(()=>import("./ChkzKl5W.js").then(e=>e.p),__vite__mapDeps([41,36,4,3,17,18,19,20,5,7,21,13,2,9,6,8,10,11,12,14,32,31,42,28,35]),import.meta.url)]).then(([e,t])=>({appStore:e.store,appClient:t.appClient})),ze}async function xe(e,t){let n=null;try{const{appStore:a,appClient:r}=await lr(),s=a.state;if(t.requireViewedAndFocused&&(s.unreadTracking?.currentlyViewedAgentId!==e||typeof document<"u"&&!document.hasFocus()))return;const i=s.agentSessions?.byAgentId[e];if(!i)return;const o=typeof i.workspaceId=="string"?i.workspaceId:"";if(o.length===0)return;if(t.requireAssistantTail&&s.chatState?.byAgentId[e]?.initialHistoryPending){W=e;return}const l=At(i.messages??[]);if(!l){t.requireAssistantTail&&(W=e);return}if(t.requireAssistantTail&&l.role!=="assistant")return;const c=l.id;if(R.get(e)===c)return;cr(e,c),n=c,!(await r.agents.markSeen({workspaceId:o,agentId:e,messageId:c})).success&&R.get(e)===n&&R.delete(e)}catch{n!==null&&R.get(e)===n&&R.delete(e)}}const oe=new Map;function Tt(e,t){return`${e}\0${t}`}function li(e,t){return oe.get(Tt(e,t))}function di(e,t,n){oe.set(Tt(e,t),n)}function ui(e){if(e.length===0)return;const t=new Set(e);for(const n of[...oe.keys()]){const a=n.slice(n.indexOf("\0")+1);t.has(a)&&oe.delete(n)}}export{bs as $,Br as A,zr as B,Kr as C,O as D,Fa as E,jr as F,Ea as G,Da as H,Gn as I,Ns as J,qs as K,Ss as L,ir as M,zs as N,Es as O,li as P,Fs as Q,yt as R,_s as S,cs as T,ws as U,qe as V,ls as W,Gs as X,Vs as Y,rs as Z,ss as _,ts as a,Lr as a0,na as a1,As as a2,Ur as a3,Us as a4,G as a5,Hr as a6,Nr as a7,xr as a8,Os as a9,St as aA,ni as aB,os as aC,Qs as aD,Xs as aE,Js as aF,ps as aG,hs as aH,fs as aI,gs as aJ,gt as aK,Zs as aL,js as aM,Ws as aN,di as aO,Ks as aP,Ts as aQ,$r as aR,ms as aS,$s as aT,ei as aU,ks as aV,Pa as aW,ti as aX,aa as aY,Or as aZ,ci as aa,oi as ab,ri as ac,si as ad,ii as ae,ai as af,Cs as ag,as as ah,Gr as ai,Hn as aj,Ls as ak,Fr as al,es as am,qr as an,Ba as ao,pt as ap,Rr as aq,vs as ar,xs as as,ys as at,ns as au,Ce as av,is as aw,Cr as ax,Ds as ay,sr as az,we as b,Ps as c,Xr as d,Zr as e,Ms as f,Pr as g,Ca as h,Dr as i,sa as j,ra as k,Bs as l,Rs as m,ui as n,us as o,Is as p,Qr as q,Jr as r,Wr as s,Hs as t,Yr as u,Ys as v,ds as w,Vr as x,ge as y,qn as z};
|
|
11
|
+
`),e)}function es(e,t,n){if(e==="suggested-prompt")return{fields:{},hasAttachments:!1,cleanup:{clearInput:!1,followBottom:!0,historyText:null}};const a=n(),{imageBlocks:r,fileBlocks:s}=Ea(a.contextItems);return{fields:{contextItems:a.contextItems,workspaceContextStr:Ca(a.contextItems,a.checkedPanels,a.checkedSelections),noteIds:a.noteIds,...r.length>0?{imageBlocks:r}:{},...s.length>0?{fileBlocks:s}:{},...a.pickedMentions?{messageMetadata:a.pickedMentions}:{}},hasAttachments:r.length>0||s.length>0,cleanup:{clearInput:!0,followBottom:!0,historyText:t}}}const Da="chat-read:",K=new Map,ye=new Set;function ts(e,t){let n=K.get(e);n||(n=new Set,K.set(e,n)),n.add(t)}function ns(e,t){const n=K.get(e);if(!(!n||!n.delete(t))&&n.size===0){K.delete(e);for(const a of[...ye])a(e)}}function as(e){return ye.add(e),()=>ye.delete(e)}function rs(e){return K.has(e)}function ss(e){const t=K.get(e);if(!t)return!1;for(const n of t)if(!n.startsWith(Da))return!0;return!1}function xa(e,t,n){const a=e.state.pendingSubmissions.byAgentId[t.agentId];if(!a||!Ye(a.scope,t))return null;const r={...structuredClone(n),id:crypto.randomUUID(),createdAt:Date.now()};e.dispatch(Lt(t,r));const s=e.state.pendingSubmissions.byAgentId[t.agentId];return s&&x(s.submissions,r.id)?r:null}function Ra(e,t,n,a,r){const s=Be.select(e.state,n),i=pe.select(e.state)?.principal.id,o=Ue(e.state);if(!s||!i||!o)return null;const l=In(t,n),c={agentId:t,workspaceId:n,principalId:i,participation:s,authority:o,owner:l.key,lifetime:e.state.pendingSubmissions.byAgentId[t]?.scope.lifetime??crypto.randomUUID()},d=()=>l.isCurrent(e.state.agentSessions?.byAgentId[t]?.workspaceId)&&Be.select(e.state,n)===s&&pe.select(e.state)?.principal.id===i&&Ue(e.state)===o;if(!d())return null;e.dispatch(Ut(c,a,Pt.select(e.state,n)));const u=xa(e,c,r);return u?{scope:c,submission:u,isCurrent:()=>{const h=e.state.pendingSubmissions.byAgentId[t];return d()&&!!h&&Ye(h.scope,c)&&(!!x(h.operations,u.id)||!!x(h.submissions,u.id))}}:null}function we(e,t,n){if(!n.text.trim()&&!n.imageBlocks?.length&&!n.fileBlocks?.length)return null;const a=n.userAppMessageId??Tn();return Ra(e,t,n.wsId,pe.select(e.state)?.capabilities.submissionCorrelation,{content:n.text.trim(),appMessageId:a,destination:!n.forceSubmit&&Bt.select(e.state,t)?"queue":"conversation",contextItems:n.contextItems,imageBlocks:n.imageBlocks,fileBlocks:n.fileBlocks,messageMetadata:n.messageMetadata})}function Pa(e,t,n){const a=we(e,t,n);return a?(e.dispatch(Je(t,{...n,userAppMessageId:a.submission.appMessageId,submission:{scope:a.scope,id:a.submission.id}})),!0):!1}async function Ba(e,t,n,a){const r=n.submission;if(!r)return"legacy";const s=r.reference,i=()=>s.scope.agentId===e&&s.scope.workspaceId===t&&Ge.select(A.state,e)===n?hn.select(A.state,s.scope):void 0,o=i();if(!o)return null;if(!o.supported)return"legacy";const l={wsId:t,text:n.text,imageBlocks:n.options?.imageBlocks,fileBlocks:n.options?.fileBlocks,noteIds:n.options?.noteIds,messageMetadata:n.options?.messageMetadata,model:a??n.options?.model};if(r.outcome==="rejected"){const p=x(o.tombstones,s.id);return x(o.submissions,s.id)||p&&p.reason!=="rejected"?null:we(A,e,l)}if(r.outcome==="accepted")return we(A,e,l);await Promise.all([En(e,t).catch(()=>{}),Cn(e,t).catch(()=>{})]);const c=i();if(!c||x(c.submissions,s.id)?.status!=="uncertain")return null;const{notify:d}=await fe(async()=>{const{notify:p}=await import("./B9fp6kqr.js").then(m=>m.C);return{notify:p}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37]),import.meta.url);if(i()!==c)return null;let u=!1;const h=()=>{u=!0};return d.warning(b.agent_chatSend_uncertainRetry_description(),{key:`submission-retry:${t}:${e}:${s.id}`,duration:Number.POSITIVE_INFINITY,action:{label:b.agent_chatSend_resend_label(),onClick:()=>{if(u)return;u=!0;const p=i();!p||p.generation!==c.generation||p.submissions!==c.submissions||p.observationVersion!==c.observationVersion||x(p.submissions,s.id)?.status!=="uncertain"||Pa(A,e,l)}},cancel:{label:b.chat_richInput_cancel_label(),onClick:h},onDismiss:h}),null}async function is(e,t,n){const a=Ge.select(A.state,e),r=a?.submission?await Ba(e,t,a,n):"legacy";if(r){if(r==="legacy"){await A.dispatch(n===void 0?Nt(e,t):Ht(e,t,n));return}!r.isCurrent()||!a||A.dispatch(Je(e,{wsId:t,text:a.text,imageBlocks:a.options?.imageBlocks,fileBlocks:a.options?.fileBlocks,noteIds:a.options?.noteIds,messageMetadata:a.options?.messageMetadata,model:n??a.options?.model,userAppMessageId:r.submission.appMessageId,submission:{scope:r.scope,id:r.submission.id}}))}}const os=A.createSelector((e,t)=>{const n=x(e.chatDrafts.owners,t);return n?{restore:n.restore,saves:Qe(n.saves),shared:n.restore?e.chatDrafts.shared[JSON.stringify([n.restore.workspaceId,n.restore.agentId])]:void 0}:void 0});function Oa(e,t){return t.workspaceId===e&&!t.retiredAt&&!t.pendingDeleteAt&&t.status!==ke.Deleted&&!t.notificationsMuted&&Kt(t)==="topLevel"}function $a(e){const t=e.metadata?.pendingQuestionsMessageId;return typeof t=="string"&&t.length>0&&!Rn(e.metadata,t)?t:null}function Ua(e){return e.status===ke.Error&&!Ot($t(e))}function cs(e,t){return t.filter(n=>Oa(e,n)).flatMap(n=>{const a=Ft(n),r=$a(n),s=n.status===ke.Error;if(!a&&!r&&!s)return[];const i=a?.timestamp??(s?n.stopReasonTimestamp:void 0);return[{agentId:n.id,agentName:n.name,kind:a?.kind??(s?"failed":"question"),reason:a?.reason,timestamp:i&&Number.isFinite(Date.parse(i))?i:void 0,questionMessageId:r,canRetry:Ua(n)}]})}function ls(e){return e.displayStatus==="failed"?"failed":e.displayStatus==="blocked"?"blocked":e.attention==="review_required"?"review":e.displayStatus==="needs_attention"?"question":e.activity==="agent_running"||e.displayStatus==="in_progress"?"running":e.scriptsRunning===!0?"scripts_running":e.backgroundTasksRunning===!0?"background_tasks_running":e.displayStatus==="pr_ready"?"pr_ready":e.displayStatus==="pr_merged"?"merged":e.displayStatus==="complete"?"complete":e.attention==="unread"?"unread":e.displayStatus==="pr_open"||e.displayStatus==="pr_queued"?e.displayStatus:"idle"}function ds(e){const t=e.kind==="prs"?e.organization?.trim().toLowerCase():void 0;return{key:JSON.stringify([e.kind,e.workspaceId,t||null,[...new Set((t?[]:e.repositories).map(n=>JSON.stringify([n.key,n.owner,n.name])))].sort()]),hasGitHubRepositories:!!t||e.repositories.some(n=>!!n.owner),hasLocalRepositories:!t&&e.repositories.some(n=>!n.owner)}}function Te(e){const t=bn(e);if(t?.kind!=="pr"||!Number.isSafeInteger(t.number)||t.number<=0)return null;const n=t.owner.toLowerCase(),a=t.repo.toLowerCase();return{owner:n,repo:a,number:t.number,id:`${n}/${a}#${t.number}`,url:`https://github.com/${n}/${a}/pull/${t.number}`}}function us(e,t,n,a){const r=e.filter(s=>a?a.includes(s.id):n?s.repositoryOwner?.toLowerCase()===n.toLowerCase():t.some(i=>i.owner?.toLowerCase()===s.repositoryOwner?.toLowerCase()&&i.name.toLowerCase()===s.repositoryName?.toLowerCase()));return[...new Map(r.flatMap(s=>[...(s.pullRequests??[]).map(i=>i.url),s.activePullRequest?.url,s.prUrl]).flatMap(s=>{const i=s?Te(s):null;return i?[[i.id,{owner:i.owner,repo:i.repo,number:i.number}]]:[]})).values()].sort((s,i)=>`${s.owner}/${s.repo}#${s.number}`.localeCompare(`${i.owner}/${i.repo}#${i.number}`))}function ms(e,t){const[n]=t;return t.length!==1||e.owner?.toLowerCase()!==n?.owner?.toLowerCase()||e.repo?.toLowerCase()!==n?.name.toLowerCase()}const ps=A.createSelector(e=>e.homeIntegrations),fs=A.createSelector(e=>{const t=e.homeIntegrations;return!t.linkedItems||!Object.keys(t.linkedItems).length?t:{...t,items:[...new Map([...Object.values(t.linkedItems),...t.items].map(n=>[n.id,n])).values()].sort((n,a)=>(a.updatedAt??"").localeCompare(n.updatedAt??""))}}),gt=A.createSelector(e=>Qe(e.workspace.workspaces).flatMap(t=>[...(t.pullRequests??[]).map(n=>n.url),t.activePullRequest?.url,t.prUrl].filter(n=>!!n).map(n=>({url:Te(n)?.url??n.replace(/\/$/,"").toLowerCase(),workspaceId:t.id,name:t.title||t.id})))),hs=A.createSelector(e=>{const t=e.homeIntegrations.detail?.url,n=t?Te(t)?.url??t.replace(/\/$/,"").toLowerCase():void 0;return gt.select(e).find(a=>a.url===n)??null}),gs=A.createSelector(e=>gt.select(e).map(t=>t.url));let ee=null;function ys(e){return ee=e,()=>{ee===e&&(ee=null)}}function ws(){return ee}function bs(e){return[...e.groups.length>0?e.groups.filter(n=>n.expanded).flatMap(n=>n.items):e.workspaces,...e.asideExpanded?e.aside:[]].map(n=>n.id)}function ks(e,t,n){if(e.length===0)return null;const a=t===null?-1:e.indexOf(t);return a===-1?e[0]:e[a+(n==="clockwise"?1:-1)]??null}let te=null;function vs(e){return te=e,()=>{te===e&&(te=null)}}function _s(){return te}function Ss(e){return An(e)}function La(e){return Mn(e)}function Na(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function me(e){if(e.length===0)return[];const t=[];let n=null;for(const a of e){const r=a.timestamp?typeof a.timestamp=="string"?new Date(a.timestamp):a.timestamp:new Date;(!n||!Na(n.date,r))&&(n={date:r,label:La(r),messages:[]},t.push(n)),n.messages.push(a)}return t}function Ms(e){const t=new Map;return e.map(({date:n})=>{const a=`${n.getFullYear()}-${n.getMonth()+1}-${n.getDate()}`,r=t.get(a)??0;return t.set(a,r+1),r===0?a:`${a}#${r}`})}function As(e,t){const n=new Map;let a=t?null:void 0;for(const r of e.groups)for(const s of r.messages)a!==void 0&&n.set(s.id,a),s.role==="user"&&!Bn(s)&&(a=s);return n}function Ha(e){return`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`}function je(e,t){const n=new Map;return e.map(a=>{const r=`${t}-${Ha(a.date)}`,s=(n.get(r)??0)+1;return n.set(r,s),{...a,groupKey:s===1?r:`${r}-${s}`}})}function Fa(e,t){if(e.length===0||t.length===0)return e;const n=new Set(t.map(s=>s.id)),a=new Set(t.map(s=>s.appMessageId).filter(s=>typeof s=="string"&&s.length>0)),r=e.filter(s=>!n.has(s.id)&&!(typeof s.appMessageId=="string"&&s.appMessageId.length>0&&a.has(s.appMessageId)));return r.length===e.length?e:r}function Is(e,t,n){return e=Fa(e,t),e.length===0?{groups:me(t),detached:!1,hiddenTail:[]}:n?{groups:je(me(e),"h"),detached:!0,hiddenTail:t}:{groups:je(me([...e,...t]),"d"),detached:!1,hiddenTail:[]}}function Ts(e){const{scrollTop:t,threshold:n,fetching:a,exhausted:r,historyCount:s,tailCount:i,tailTruncated:o,totalMessages:l,spacerAbove:c=0}=e;return t>n+c||a||r?!1:s>0||o||l>i+s}const Es=300;function Cs(e){const{fetching:t,chainEvaluationPending:n,visible:a,hideArmed:r}=e;return t||n?a&&!r?"none":"show":a&&!r?"arm-hide":"none"}const qe=24,Ka=320;function Ee(e){return Number.isFinite(e)?Math.min(Ka,Math.max(qe,e)):qe}const Wa=.2,ja=.12;function qa(e,t,n=Wa){const a=Ee(t);return e===null||!Number.isFinite(e)?a:e+n*(a-e)}function Ds(e,t){const n=Ee(t??Number.NaN);return{above:Math.round(Math.max(0,e.above)*n),below:Math.round(Math.max(0,e.below)*n)}}function xs(e){const{totalMessages:t,residentCount:n,exhausted:a,residentContentHeight:r,currentSpacerHeight:s,viewportHeight:i}=e;let o=e.rowHeightEma;n>0&&r>0&&(o=qa(o,r/n));const l=e.unloadedRows??t-n,d=a||t<=0||n<=0||l<=0||o===null?0:Math.round(l*o),u=Math.abs(d-s);return u===0?{spacerHeight:s,rowHeightEma:o,applied:!1,scrollTopDelta:0}:d===0||s===0||u>s*ja||i>0&&u>i?{spacerHeight:d,rowHeightEma:o,applied:!0,scrollTopDelta:d-s}:{spacerHeight:s,rowHeightEma:o,applied:!1,scrollTopDelta:0}}const Va=Pn,za=2;function Rs(e){const{scrollTop:t,spacerAboveHeight:n,rowHeightEstimate:a,pageSize:r=Va,nearPages:s=za}=e;if(n<=0||t>=n)return"serial";const i=Ee(a??Number.NaN);return(n-Math.max(0,t))/i>s*r?"seek":"serial"}const yt=200,Ga=1;function Ps(e,t,n=yt){const a=t.timestamp-n;return[...e.filter(r=>r.timestamp>=a),t]}function Bs(e){const{samples:t,viewportHeight:n,windowMs:a=yt,viewportFactor:r=Ga}=e;if(n<=0||t.length<2)return"gentle";const s=t[t.length-1].timestamp-a,i=t.filter(l=>l.timestamp>=s);if(i.length<2)return"gentle";let o=0;for(let l=1;l<i.length;l+=1)o+=Math.abs(i[l].scrollTop-i[l-1].scrollTop);return o>n*r?"rapid":"gentle"}function Os(e){const{scrollTop:t,spacerAboveHeight:n,unloadedRowsAbove:a}=e;if(a<=0||n<=0)return 0;const r=Math.min(1,Math.max(0,t/n));return Math.min(a-1,Math.max(0,Math.floor(r*a)))}function $s(e){const{totalMessages:t,residentCount:n,exhausted:a,startOrdinalEstimate:r,detachedFromTail:s}=e,i=Math.max(0,t-n);if(!s)return{above:a?0:i,below:0};const o=Math.max(0,e.hiddenTailCount??0);if(a)return{above:0,below:i+o};if(r!==null){const c=Math.min(i,Math.max(0,Math.round(r)));return{above:c,below:i-c+o}}const l=Math.min(i,Math.max(0,Math.round(e.holeRowsEstimate??0)));return{above:i-l,below:l+o}}function Us(e){const{exhausted:t,historyCount:n,tailCount:a,tailTruncated:r,totalMessages:s}=e;return t?!0:n>0?!1:!r&&s<=a}const Ya="intent.drafts.sync",Ja="intent.drafts.changed",Qa=$({id:E(),type:E(),label:E(),description:E().optional(),content:E().optional(),path:E().optional(),imageData:E().optional(),imageMimeType:E().optional(),attachmentId:E().optional(),attachmentMimeType:E().optional(),attachmentSize:ce().optional(),sourcePath:E().optional(),placementStatus:V("failed").optional(),screen:On().optional()}),wt=$({text:E(),attachments:$n(Qa)}),z={provenance:E().min(1),workspaceId:E().min(1),agentId:E().min(1)},ne={lifetime:E(),revision:ce().int().nonnegative()};Un("kind",[$({...z,kind:V("read")}),$({...z,...ne,kind:V("edit"),origin:E().min(1),sequence:ce().int().positive(),snapshot:wt}),$({...z,...ne,kind:V("flush")}),$({...z,...ne,kind:V("clear"),origin:E().min(1)})]);const bt=$({...z,...ne,origin:E(),sequence:ce().int().nonnegative(),snapshot:wt}),Xa=$({accepted:Ln(),draft:bt});function Za(e,t,n=t){const a=new Map,r=new Set,s=crypto.randomUUID();let i=0,o=!1;const l=()=>{const f=t();if(o||!f)throw new Error("draft-authority-unavailable");return f},c=()=>{const f=n();if(!f||o)throw new Error("draft-authority-unavailable");return()=>{if(o||n()!==f)throw new Error("draft-authority-changed")}},d=(f,k,v)=>{const I=JSON.stringify([f,k,v]);let S=a.get(I);return S||(S={dirty:0},a.set(I,S)),S},u=(f,k)=>{if(o||f.provenance!==t())return;const v=d(f.provenance,f.workspaceId,f.agentId);if(!(v.value?.lifetime===f.lifetime&&v.value.revision>f.revision)&&(v.value=f,k&&v.dirty===0))for(const I of r)I(f)},h=e.subscribe(f=>{const k=bt.safeParse(f);k.success&&u(k.data,!0)}),p=async(f,k)=>{k();const v=Xa.parse(await e.request(f));if(k(),f.provenance!==l()||v.draft.provenance!==f.provenance)throw new Error("draft-authority-changed");if(!v.accepted)throw u(v.draft,!1),new Error("draft-changed-in-another-editor");return v.draft},m=async(f,k)=>{const v=l(),I=c(),S=d(v,f,k);S.tail&&await S.tail;const _=await p({kind:"read",provenance:v,workspaceId:f,agentId:k},I);return u(_,!1),_},y=(f,k,v)=>{const I=l(),S=c(),_=d(I,f,k),B=_.tail??(_.value?Promise.resolve(_.value):p({kind:"read",provenance:I,workspaceId:f,agentId:k},S));_.dirty+=1;const C=B.then(P=>p(v(P),S));return _.tail=C,C.then(P=>{_.dirty-=1,_.tail===C&&(_.tail=void 0),u(P,!0)},()=>{_.dirty-=1,_.tail===C&&(_.tail=void 0)}),C};return{authority:()=>o?null:n(),read:m,async edit(f,k,v,I){const S=++i;return y(k,v,_=>({kind:"edit",provenance:_.provenance,workspaceId:k,agentId:v,lifetime:_.lifetime,revision:_.revision,origin:f,sequence:S,snapshot:I}))},async flush(f,k){const v=l(),I=c(),S=d(v,f,k),_=await(S.tail??(S.value?Promise.resolve(S.value):m(f,k)));await p({kind:"flush",provenance:v,workspaceId:f,agentId:k,lifetime:_.lifetime,revision:_.revision},I)},async clear(f,k){await y(f,k,v=>({kind:"clear",provenance:v.provenance,workspaceId:f,agentId:k,lifetime:v.lifetime,revision:v.revision,origin:s}))},subscribe(f){return r.add(f),()=>{r.delete(f)}},dispose(){o=!0,h(),r.clear(),a.clear()}}}let U=null;async function Ls(e,t,n,a,r){const s=U;if(!s)throw new Error("draft-shared-transport-unavailable");const i=()=>{if(U!==s||s.authority()!==r)throw new Error("draft-authority-changed")};i(),await s.edit(e,t,n,a),i(),await s.flush(t,n),i()}async function Ns(e,t){await Promise.resolve(),U&&await U.flush(e,t)}function Hs(){if(!Sn())return null;const e=Za({request:n=>vn(Ya,n),subscribe:n=>kn(a=>{a.method===Ja&&n(a.params)})},()=>Dn(A.state),()=>xn(A.state));U=e;const t=e.dispose;return e.dispose=()=>{U===e&&(U=null),t()},e}const kt=new Map;function vt(e,t){return`${e}\0${t}`}function Fs(e,t){return kt.get(vt(e,t))}function Ks(e,t,n){kt.set(vt(e,t),n)}const Ws=A.createSelector((e,t,n)=>{const a=e.chatPanelUi.byWorkspaceId[t];return a?x(a.userMessageIndexes,n):void 0}),js=A.createSelector((e,t,n)=>{const a=e.chatPanelUi.byWorkspaceId[t];return a?x(a.retryAgents,n):void 0});function er(e){e=Math.max(0,e);const t=Math.floor(e/1e3);if(t<10){const s=e/1e3,i=s.toFixed(1);return i.endsWith(".0")?`${Math.round(s)}s`:`${i}s`}if(t<60)return`${t}s`;const n=Math.floor(t/3600),a=Math.floor(t%3600/60),r=t%60;return n>0?`${n}h ${a}m ${r}s`:`${a}m ${r}s`}function qs(e){return er(Math.max(1e3,Math.round(e/1e3)*1e3))}const tr=new Set(["launch","init","session-create","session-load","prompt"]),nr=new Set(["tool-call","tool-waiting"]);function ar(e){let t=null;for(const n of e)(!t||n.timestamp>=t.timestamp)&&(t=n);return t}function Vs(e){return e&&tr.has(e)?"pulse":e&&nr.has(e)?"twist":"bloom"}const _t="stalled";function zs(e,t){const n=ar(e);return!n||n.phase!==_t||typeof t=="number"&&t>n.timestamp?null:n}function Gs(e){let t=null;for(const n of e)n.phase!==_t&&(!t||n.timestamp>=t.timestamp)&&(t=n);return t}const Ve={get title(){return b.chat_streamingStatus_sessionCorrupted_title()},get message(){return b.chat_streamingStatus_sessionCorrupted_message()}};function Ys(e,t){return e?t===!0?{corrupted:!0,title:Ve.title,message:Ve.message,detail:e}:{corrupted:!1,title:b.chat_streamingStatus_responseFailed_label(),message:e,detail:null}:null}const Js=A.createSelector((e,t)=>e.unreadTracking.dividerSessionByAgentId[t]??null),Qs=A.createSelector(e=>e.unreadTracking.currentlyViewedAgentId),Xs=A.createSelector(e=>{const t=[];for(const s of Object.values(e.panelLayout.byWorkspaceId))for(const i of Object.values(s.panels))for(const o of i.tabs)o.type==="agent"&&o.agentId&&t.push(o.agentId);const n=Object.keys(e.unreadTracking.dividerSessionByAgentId),a=new Set(e.agentSessions.agentIdsByWorkspace[be]??[]);return{chiefCardVisible:e.sidebarNav.panelItem==="chief",chiefSessionAgentIds:n.filter(s=>a.has(s)),dividerSessionAgentIds:n,openAgentTabIds:t}}),Zs=A.createSelector((e,t)=>x(e.questionUi.consumers,t)),rr=3e4,Y=new Map;function ei(e,t){const n=Y.get(e);n&&clearTimeout(n.timer);const a=setTimeout(()=>Y.delete(e),rr);Y.set(e,{value:t,timer:a})}function ti(e){const t=Y.get(e);if(t)return clearTimeout(t.timer),Y.delete(e),t.value}const St=A.createSelector((e,t,n)=>e.agentWorkers?.byKey[jt(t,n)]??Wt),sr=A.createSelector((e,t,n)=>{const a=St.select(e,t,n);return a.status==="unsupported"?[]:(a.snapshot?.workers??[]).filter(r=>r.status==="running"||r.status==="unknown")}),ni=A.createSelector((e,t,n)=>{const a=St.select(e,t,n);return a.status==="failed"?!0:a.status!=="ready"||!a.snapshot?!1:a.snapshot.truncated?!0:a.snapshot.support.status!=="supported"&&sr.select(e,t,n).length>0}),ir=1e3,Mt={requireViewedAndFocused:!0,requireAssistantTail:!0},J=new Map,R=new Map;let W=null;function Ce(e){(e===void 0||W===e)&&(W=null)}const or=200;function cr(e,t){if(R.delete(e),R.set(e,t),R.size>or){const n=R.keys().next().value;n!==void 0&&R.delete(n)}}function At(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(!n.isStreaming&&typeof n.id=="string"&&n.id.length>0)return n}return null}function ai(e){return At(e)?.id??null}function ri(e){De(e,{requireViewedAndFocused:!0})}function si(e){De(e,{requireViewedAndFocused:!1})}function ii(e){Ce(),De(e,Mt)}function oi(e){W===e&&(J.has(e)||(W=null,xe(e,Mt)))}function ci(e){for(const t of e)typeof t!="string"||t.length===0||(It(t),Ce(t),xe(t,{requireViewedAndFocused:!1}))}function It(e){const t=J.get(e);t&&(clearTimeout(t.timer),J.delete(e))}function De(e,t){It(e),Ce(e);const n=setTimeout(()=>{J.delete(e),xe(e,t)},ir);J.set(e,{timer:n,gates:t})}let ze=null;function lr(){return ze??=Promise.all([fe(()=>import("./q36554_4.js"),__vite__mapDeps([38,17,18,3,19,20,5,7,4,21,13,2,39,40]),import.meta.url),fe(()=>import("./ChkzKl5W.js").then(e=>e.p),__vite__mapDeps([41,36,4,3,17,18,19,20,5,7,21,13,2,9,6,8,10,11,12,14,32,31,42,28,35]),import.meta.url)]).then(([e,t])=>({appStore:e.store,appClient:t.appClient})),ze}async function xe(e,t){let n=null;try{const{appStore:a,appClient:r}=await lr(),s=a.state;if(t.requireViewedAndFocused&&(s.unreadTracking?.currentlyViewedAgentId!==e||typeof document<"u"&&!document.hasFocus()))return;const i=s.agentSessions?.byAgentId[e];if(!i)return;const o=typeof i.workspaceId=="string"?i.workspaceId:"";if(o.length===0)return;if(t.requireAssistantTail&&s.chatState?.byAgentId[e]?.initialHistoryPending){W=e;return}const l=At(i.messages??[]);if(!l){t.requireAssistantTail&&(W=e);return}if(t.requireAssistantTail&&l.role!=="assistant")return;const c=l.id;if(R.get(e)===c)return;cr(e,c),n=c,!(await r.agents.markSeen({workspaceId:o,agentId:e,messageId:c})).success&&R.get(e)===n&&R.delete(e)}catch{n!==null&&R.get(e)===n&&R.delete(e)}}const oe=new Map;function Tt(e,t){return`${e}\0${t}`}function li(e,t){return oe.get(Tt(e,t))}function di(e,t,n){oe.set(Tt(e,t),n)}function ui(e){if(e.length===0)return;const t=new Set(e);for(const n of[...oe.keys()]){const a=n.slice(n.indexOf("\0")+1);t.has(a)&&oe.delete(n)}}export{bs as $,Br as A,zr as B,Kr as C,O as D,Fa as E,jr as F,Ea as G,Da as H,Gn as I,Ns as J,qs as K,Ss as L,ir as M,zs as N,Es as O,li as P,Fs as Q,yt as R,_s as S,cs as T,ws as U,qe as V,ls as W,Gs as X,Vs as Y,rs as Z,ss as _,ts as a,Lr as a0,na as a1,As as a2,Ur as a3,Us as a4,G as a5,Hr as a6,Nr as a7,xr as a8,Os as a9,St as aA,ni as aB,os as aC,Qs as aD,Xs as aE,Js as aF,ps as aG,hs as aH,fs as aI,gs as aJ,gt as aK,Zs as aL,js as aM,Ws as aN,di as aO,Ks as aP,Ts as aQ,$r as aR,ms as aS,$s as aT,ei as aU,ks as aV,Pa as aW,ti as aX,aa as aY,Or as aZ,ci as aa,oi as ab,ri as ac,si as ad,ii as ae,ai as af,Cs as ag,as as ah,Gr as ai,Hn as aj,Ls as ak,Fr as al,es as am,qr as an,Ba as ao,pt as ap,Rr as aq,vs as ar,xs as as,ys as at,ns as au,Ce as av,is as aw,Cr as ax,Ds as ay,sr as az,we as b,Ps as c,Xr as d,Zr as e,Ms as f,Pr as g,Ca as h,Dr as i,sa as j,ra as k,Bs as l,Rs as m,ui as n,us as o,Is as p,Qr as q,Jr as r,Wr as s,Hs as t,Yr as u,Ys as v,ds as w,Vr as x,ge as y,qn as z};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/
|
|
2
|
-
import{bp as v,t as Bt,br as y,a_ as D,bz as Ft,b as zt,bs as Qf,bv as bt,bt as ga,bu as el,b7 as Nl,bm as $f,ba as ep,bl as tp,bb as rp,bn as np,a$ as ap,b9 as sp,b8 as op,b2 as ip,bf as lp,bg as cp,bk as dp,be as up,bo as fp,b0 as pp,b4 as gp,bi as vp,bh as mp,b6 as hp,b5 as bp,b3 as yp,bd as _p,bc as xp,bj as wp,b1 as kp,_ as Ip}from"./DXyyWeag.js";import{bI as Sp,bj as eo,aG as Cp,bs as Ht,aD as e,a5 as S,bS as m,bA as w,W as u,bn as jt,c9 as d,aA as _,a7 as kt,ay as je,be as tr,b$ as Tt,aC as Ha,bl as M,b_ as k,bO as x,aB as I,bo as Rs,ca as wt,bH as A,bV as ye,br as Gr,bk as to,c0 as ca,ai as es,cd as Is,aw as Rn,a as Ep,aj as Rr,c7 as Pp,c6 as Ll,c5 as Mn,bf as So,bz as Id}from"./DYhIMPy1.js";import{G as Es,I as Ap,z as Tp}from"./DyvrH0mm.js";import{o as Rp,i as Mp,u as re,g as Un,w as Nn,l as In,j as ir,v as gt,I as ro,n as Rt,p as Tr,q as Np,s as Lp,m as Op,x as Dp}from"./CjaOLL1c.js";import{s as un}from"./Cuqq8bL5.js";import{c as Qr}from"./CnVt0JNG.js";import{I as Si,t as nr,n as Bp,i as Ol,u as Dl}from"./BboIV5H5.js";import{b as pr}from"./BaIAhI85.js";import{i as Sd,bv as Cd,cM as Ed,dG as Fp,ds as zp,ax as Hp,cv as jp,a2 as Wp,cS as Up,dr as qs,aC as Bo,c3 as qp,I as Vp,a as Kp,a0 as Bl,cY as Gp,bT as Jp,M as Yp,dm as Xp,W as Zp,dx as Qp,af as $p,cP as eg,at as tg,g as rg,u as ng}from"./D3QcPFoL.js";import{c as ag}from"./D-62MVd3.js";import{k as da,w as sg,C as Pd,c as og,R as ig}from"./DT4bpJWb.js";import{f as yt,ap as ws,ai as lg,am as Ci,bc as cg}from"./Bfr1QjPr.js";import{ar as dg,ae as Fl,a0 as ug,aI as fg,af as pg,h as gg,ag as vg,a$ as mg,I as hg,R as bg,ax as yg,ak as _g,a1 as xg,a as zl,az as wg,s as kg,n as Ig,b5 as Sg,m as Cg,b7 as Ei,A as Hl,aj as Eg,b6 as Pg,at as Ad,T as Td,a9 as Ag,a7 as jl,W as Tg,V as Rg,ad as Mg,a8 as Ng,L as Wl,ay as Lg}from"./
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/CVGihEeT.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/DXyyWeag.js","/app/immutable/chunks/Cuqq8bL5.js","/app/immutable/chunks/B5m4HK_m.js","/app/immutable/chunks/BboIV5H5.js","/app/immutable/chunks/CjaOLL1c.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/D5ej8a-y.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/ppRpwazH.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/DyvrH0mm.js","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/Bfr1QjPr.js","/app/immutable/chunks/CnVt0JNG.js","/app/immutable/chunks/BybfkKTj.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/ChOlbK8y.js","/app/immutable/chunks/Co9PgWQA.js","/app/immutable/chunks/CX_KiszT.js","/app/immutable/chunks/4NMrKcis.js","/app/immutable/chunks/BTdkHPOB.js","/app/immutable/chunks/D6bHtnlF.js","/app/immutable/assets/menu-footer.Ck5GCpgU.css","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/Dwmx7Nbz.js","/app/immutable/assets/dialog.BtQTVchw.css","/app/immutable/chunks/BsieX9dN.js","/app/immutable/assets/observe-overflow.CbDLK6fN.css","/app/immutable/chunks/BtId34lw.js","/app/immutable/chunks/C5oPUaEZ.js","/app/immutable/chunks/BKnW-cqy.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/confirm.UE5obH5A.css","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/chunks/BeP4UORy.js","/app/immutable/chunks/B0gQeWRk.js","/app/immutable/chunks/DJkHth-B.js","/app/immutable/assets/SettingsPage.D8u26cHZ.css","/app/immutable/chunks/D-hrwg9Y.js","/app/immutable/chunks/2YGlULfT.js","/app/immutable/chunks/CC7to1B5.js","/app/immutable/chunks/DT4bpJWb.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/B9fp6kqr.js","/app/immutable/chunks/D3QcPFoL.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/DEYvT_CO.js","/app/immutable/chunks/RD9QY1Yc.js","/app/immutable/chunks/DogedYC1.js","/app/immutable/chunks/CRsmjbca.js","/app/immutable/chunks/DHQOuksI.js","/app/immutable/chunks/DNBv5HWD.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/81Mgflg6.js","/app/immutable/chunks/BrVbupVh.js","/app/immutable/chunks/CC5PGmW5.js","/app/immutable/chunks/DzOaHgXZ.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/BjGjodbN.js","/app/immutable/assets/directory-picker-service.CzNEA6Ot.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{bp as v,t as Bt,br as y,a_ as D,bz as Ft,b as zt,bs as Qf,bv as bt,bt as ga,bu as el,b7 as Nl,bm as $f,ba as ep,bl as tp,bb as rp,bn as np,a$ as ap,b9 as sp,b8 as op,b2 as ip,bf as lp,bg as cp,bk as dp,be as up,bo as fp,b0 as pp,b4 as gp,bi as vp,bh as mp,b6 as hp,b5 as bp,b3 as yp,bd as _p,bc as xp,bj as wp,b1 as kp,_ as Ip}from"./DXyyWeag.js";import{bI as Sp,bj as eo,aG as Cp,bs as Ht,aD as e,a5 as S,bS as m,bA as w,W as u,bn as jt,c9 as d,aA as _,a7 as kt,ay as je,be as tr,b$ as Tt,aC as Ha,bl as M,b_ as k,bO as x,aB as I,bo as Rs,ca as wt,bH as A,bV as ye,br as Gr,bk as to,c0 as ca,ai as es,cd as Is,aw as Rn,a as Ep,aj as Rr,c7 as Pp,c6 as Ll,c5 as Mn,bf as So,bz as Id}from"./DYhIMPy1.js";import{G as Es,I as Ap,z as Tp}from"./DyvrH0mm.js";import{o as Rp,i as Mp,u as re,g as Un,w as Nn,l as In,j as ir,v as gt,I as ro,n as Rt,p as Tr,q as Np,s as Lp,m as Op,x as Dp}from"./CjaOLL1c.js";import{s as un}from"./Cuqq8bL5.js";import{c as Qr}from"./CnVt0JNG.js";import{I as Si,t as nr,n as Bp,i as Ol,u as Dl}from"./BboIV5H5.js";import{b as pr}from"./BaIAhI85.js";import{i as Sd,bv as Cd,cM as Ed,dG as Fp,ds as zp,ax as Hp,cv as jp,a2 as Wp,cS as Up,dr as qs,aC as Bo,c3 as qp,I as Vp,a as Kp,a0 as Bl,cY as Gp,bT as Jp,M as Yp,dm as Xp,W as Zp,dx as Qp,af as $p,cP as eg,at as tg,g as rg,u as ng}from"./D3QcPFoL.js";import{c as ag}from"./D-62MVd3.js";import{k as da,w as sg,C as Pd,c as og,R as ig}from"./DT4bpJWb.js";import{f as yt,ap as ws,ai as lg,am as Ci,bc as cg}from"./Bfr1QjPr.js";import{ar as dg,ae as Fl,a0 as ug,aI as fg,af as pg,h as gg,ag as vg,a$ as mg,I as hg,R as bg,ax as yg,ak as _g,a1 as xg,a as zl,az as wg,s as kg,n as Ig,b5 as Sg,m as Cg,b7 as Ei,A as Hl,aj as Eg,b6 as Pg,at as Ad,T as Td,a9 as Ag,a7 as jl,W as Tg,V as Rg,ad as Mg,a8 as Ng,L as Wl,ay as Lg}from"./DYoD7wrn.js";import{F as At,bf as Pi,bK as Og,am as Dg,aO as Bg,cL as Fg,bj as tl,bA as zg,aE as Rd,aJ as rl,c_ as Co,a9 as Ai,cn as Hg,cc as jg,ci as nl,cF as Md,br as Wg,e as Ug,b_ as Ul,c8 as qg,cl as Vg,cW as Nd,bU as ql,b6 as ai,bc as Hs,aD as Kg,ax as Ti,as as Ld,ba as Od,bB as Gg,B as Jg,bu as Yg,a4 as Dd,cg as Xg,aj as Bd,cN as Fd,cJ as Vl,aq as zd,aI as Kl,_ as Zg,cv as Qg,cU as $g,cO as ev,aH as tv,aZ as rv,bN as Hd,bl as nv,al,c4 as Gl,aw as av,a7 as sv,a5 as ov}from"./BTdkHPOB.js";import{c as jd}from"./ChTqQfQN.js";import{g as iv}from"./DJkHth-B.js";import{Iy as Nt,bM as lv,rV as Jl,sv as cv,Jn as dv,Jt as uv,g as Wd,Ib as Ud,nw as qd,nM as Vd,nL as Kd,np as Fo,q2 as sl,x_ as fv,v2 as yo,ul as Ri,v4 as pv,ne as Gd,ID as gv,ta as vv,oA as Jd,rf as ol,lX as Yl,a2 as Xl,qL as mv,qH as hv,qM as bv,qD as yv,qJ as _v,uU as xv,Ax as Yd,AB as Xd,nN as Zl,be as Mi,GW as wv,I7 as kv,h9 as Iv,h8 as Sv,nH as Cv,w3 as Ev,w4 as Pv,w2 as Ql,Bx as ia,cr as Av,cf as Tv,d0 as Rv,d7 as Mv,AH as Nv}from"./D5ej8a-y.js";import{bH as Lv,bQ as Ov,i as Dv,B as Bv,bT as Fv,ah as zv,aj as Hv,al as jv,a5 as Wv,a4 as Uv,an as qv,V as Vv,bk as Kv,bM as Gv,bm as Jv}from"./CRsmjbca.js";import{n as Yv,m as Xv,v as Ni,ck as Zv,M as Qv,ci as $v,cb as em,aD as $l,cd as tm,bM as Li,aN as rm,s as nm,c as Vs,d as Oi,cf as Zd,cg as Di,bB as am,b6 as sm,bQ as om,bO as im,E as lm,ce as ec,bv as cm,y as tc,ch as dm}from"./B9fp6kqr.js";import{ci as um,ck as fm,cj as pm,b1 as gm,a$ as vm,b0 as mm,a4 as hm,al as go,ak as bm,aA as rc,aI as ym,aj as _m,C as xm,i as wm,E as _o,cT as km,aW as nc,cY as Im,ag as Sm,a8 as Cm,r as Em,p as Pm,aF as Am,c$ as Tm,cK as Rm,cD as Mm,R as Nm,cu as Lm,bS as Om}from"./BU93jIdu.js";import{i as Dm,I as Ss,c as ac}from"./ChOlbK8y.js";import"./Co9PgWQA.js";import{f as sc,y as oc,M as Qd,n as Bm,m as Fm,z as $d,x as Bi,e as Ks,E as Fi,W as us,h as zm}from"./CVGihEeT.js";import"./BKnW-cqy.js";import{b as eu}from"./2YGlULfT.js";import"./Dwmx7Nbz.js";import{z as il,P as Hm,p as jm,h as Wm,G as Um,l as qm,i as Vm,M as Km,H as Gm,t as _s,a as Jm,K as Ym,k as Xm,R as Zm}from"./CX_KiszT.js";import{t as Gs,O as Qm,M as $m,S as Fa}from"./4NMrKcis.js";import{a as eh}from"./D6bHtnlF.js";import{C as zi}from"./CshdgsKR.js";import{aQ as th,aY as rh,aB as nh,b0 as ah,aO as sh,aU as oh,a7 as Ps,b3 as ic,aK as ih,aR as lh,aX as ll,aS as cl,W as si,aq as ch,X as dh,a_ as uh,aJ as fh,aT as ph,aW as gh,b6 as vh,b4 as mh,ay as tu,p as hh,n as bh,aV as yh,_ as _h,ao as xh,aD as wh,z as kh,aC as Ih,a8 as Sh}from"./weVd7rrQ.js";import{s as Hi}from"./B7E7WOal.js";import{M as Ch}from"./CGnwT0iY.js";import{s as Eh,a as Ph}from"./BsieX9dN.js";import{u as dl,w as Ah,v as zo,I as Th,A as lc,e as Js,d as za,J as cc,c as Rh,f as Mh,g as dc,i as Nh,b as Lh,o as ru,j as Oh,O as Dh,x as Bh,k as nu,S as Fh,N as zh,q as uc,p as Hh,n as fc,z as jh,s as Wh}from"./DaWaPdpr.js";import{o as pc,a as gc,T as oi,b as Uh}from"./DzVW75sP.js";import{P as qh,y as Vh,j as Kh,h as Gh,V as Jh}from"./ChkzKl5W.js";import{D as Ys}from"./BOzoiihY.js";import"./DlErnbqC.js";import{C as ua}from"./BvjuBRrU.js";import{M as Yh}from"./0__pctoR.js";import{g as ul}from"./B5m4HK_m.js";import{f as vc,d as Xh}from"./BrVbupVh.js";import{c as xo}from"./SYPnLWme.js";import{handleIntentLink as Zh}from"./5BF5QoAt.js";import{s as Qh,a as $h,f as eb,d as tb,r as rb,h as nb,w as js,g as ab,W as sb,H as ob,c as ib,M as au}from"./jKsfsjyZ.js";import{e as lb,q as cb}from"./DHQOuksI.js";import{showAssistantContent as db}from"./BFKxmV8S.js";import{o as Eo,c as ub,n as fb}from"./BjGjodbN.js";import{p as pb}from"./ChXvE919.js";import{m as gb}from"./-DqWFMjY.js";import{h as vo}from"./bVXl7xNp.js";import{i as su}from"./RD9QY1Yc.js";import{g as vb,e as mb,f as hb,h as bb}from"./BvFAWM27.js";import{T as ii}from"./BqxV3q0f.js";import"./C5oPUaEZ.js";import{i as yb,r as mc}from"./DndetRc8.js";import{a as _b}from"./D-hrwg9Y.js";import{a as xb}from"./BdWqymET.js";import{p as wb}from"./vmBlHv-D.js";const kb="intent:inline-visual-draft";function MC(r,t){const n=t.title.replace(/\s+/g," ").trim(),a=JSON.stringify({inputs:t.inputs,results:t.results},null,2),s=(a.match(/`+/g)??[]).reduce((c,l)=>Math.max(c,l.length),0),o="`".repeat(Math.max(3,s+1));return`${r}${r?`
|
|
3
3
|
|
|
4
4
|
`:""}${n}
|
|
5
5
|
|
|
@@ -260,7 +260,7 @@ ${r.content}`:a.content=r.content,a):r.old_text!==void 0&&r.new_text!==void 0?(a
|
|
|
260
260
|
`,L0=["background","foreground","card","card-foreground","primary","primary-ink","primary-foreground","secondary","secondary-foreground","muted","muted-foreground","border","input","ring","danger","danger-background","info","info-foreground","success","success-foreground","warning","warning-foreground","font-ui","font-code","text-body-size","text-body-line-height","text-body-weight","text-body-tracking","radius-small","radius-medium","radius-large","app-background","sidebar","sidebar-accent","agent-avatar-surface-active","agent-avatar-foreground","diagram-host-surface","diagram-canvas","diagram-label-surface","diagram-node-surface","diagram-node-hover-surface","diagram-node-outline","diagram-node-title","diagram-metadata","diagram-group-outline","diagram-connector","diagram-connector-hover","diagram-connector-muted","diagram-connector-inactive","diagram-connector-danger","diagram-connector-success","diagram-connector-warning","diagram-connector-active","diagram-accent","diagram-accent-foreground","diagram-node-radius","diagram-group-radius","diagram-connector-width","text-caption-size","text-caption-line-height","text-caption-weight","text-caption-tracking","text-body-strong-size","text-body-strong-line-height","text-body-strong-weight","text-body-strong-tracking","space-1","space-2","space-3","space-4","space-5","space-6","space-7","control-height-compact","control-height-small","control-height-medium","control-height-large","radius-full","spring-fast","spring-fast-exit","spring-fast-ease","spring-moderate","spring-moderate-exit","spring-moderate-ease","spring-slow","spring-slow-exit","spring-slow-ease","spring-exit-ease","motion-fast","motion-standard","motion-slow","ease-standard","ease-emphasized-out","motion-reduced"],_i=96,sd=2e4,O0=480,pf=512,D0=["default-src 'none'","script-src 'unsafe-inline'","style-src 'unsafe-inline'","img-src data:","connect-src 'none'","font-src data:","media-src 'none'","object-src 'none'","frame-src 'none'","child-src 'none'","worker-src 'none'","manifest-src 'none'","base-uri 'none'","form-action 'none'"].join("; ");function B0(r,t,n,a,s,o){const c=new MessageChannel,l=MessagePort.prototype.postMessage.bind(c.port1);window.parent.postMessage({channel:r,type:"scroll-port"},"*",[c.port2]);const f=(E,z={})=>{window.parent.postMessage({channel:r,type:E,...z},"*")};let i=s?.state??null,p=null,g=!1;Object.defineProperty(window,"intentVisual",{configurable:!1,writable:!1,value:Object.freeze({get state(){return i},publish(E){try{if(!o(E))return!1;const z=JSON.parse(JSON.stringify(E));return i=z.state,p=z,g||(g=!0,requestAnimationFrame(()=>{g=!1,p&&f("snapshot",{snapshot:p}),p=null})),!0}catch{return!1}}})});let O=!1,b=-1,h=innerHeight,P=Number.NaN,R=0,B=0;const F=()=>{if(O=!1,!document.body)return;let E=Math.ceil(Math.max(document.body.scrollHeight,document.body.getBoundingClientRect().height));const z=innerHeight,J=E-z;if(z>h+1&&J>1&&Math.abs(J-P)<=1?R+=1:(z!==h||J<=1)&&(R=0),h=z,P=J,!B&&R>=3){B=Math.max(a,z);const Y="Page height follows the frame (vh units or height: 100%); frame height held.";console.warn(Y),f("layout",{message:Y})}B&&(E=Math.min(E,B)),E!==b&&(b=E,f("resize",{height:E}))},T=()=>{O||(O=!0,requestAnimationFrame(F))},L=E=>{if(!E||typeof E.dark!="boolean"||!E.variables)return;const z=document.documentElement;z.classList.toggle("dark",E.dark),z.style.colorScheme=E.dark?"dark":"light";const J=E.variables["--inline-html-root-font-size"];"--inline-html-root-font-size"in t.variables&&typeof J=="string"&&J.length<512&&z.style.setProperty("--inline-html-root-font-size",J);for(const Y of Object.keys(t.variables)){if(Y==="--inline-html-root-font-size")continue;const Q=E.variables[Y];typeof Q=="string"&&Q.length<512&&z.style.setProperty(Y,Q)}T()};window.addEventListener("message",E=>{E.source!==window.parent||!E.data||E.data.channel!==r||E.data.type==="theme"&&L(E.data.theme)});const U=E=>{if(E.defaultPrevented||!E.isTrusted||E.ctrlKey||E.metaKey||E.shiftKey||!E.deltaY||Math.abs(E.deltaX)>Math.abs(E.deltaY))return;const z=Q=>{const Ie=getComputedStyle(Q);if(Q!==document.scrollingElement&&!/^(auto|scroll|overlay)$/.test(Ie.overflowY)||/^(hidden|clip)$/.test(Ie.overflowY))return!1;const le=Q.scrollHeight-Q.clientHeight;return le>1&&(E.deltaY<0?Q.scrollTop>1:Q.scrollTop<le-1)};if(E.composedPath().some(Q=>Q instanceof Element&&z(Q))||document.scrollingElement&&z(document.scrollingElement))return;const J=E.deltaMode===WheelEvent.DOM_DELTA_LINE?parseFloat(getComputedStyle(document.body).lineHeight)||16:E.deltaMode===WheelEvent.DOM_DELTA_PAGE?innerHeight:1,Y=Math.max(-n,Math.min(n,E.deltaY*J));Number.isFinite(Y)&&(E.preventDefault(),l({deltaY:Y}))};window.addEventListener("wheel",()=>{window.removeEventListener("wheel",U),window.addEventListener("wheel",U,{passive:!1})},{capture:!0,passive:!1}),window.addEventListener("error",E=>{E.message&&f("error",{message:E.message.slice(0,300)})}),window.addEventListener("unhandledrejection",E=>{const z=E.reason;f("error",{message:String(z instanceof Error?z.message:z).slice(0,300)})}),window.addEventListener("click",E=>{const z=E.target instanceof Element?E.target.closest("a, area"):null;if(!z)return;(z.getAttribute("href")??z.getAttribute("xlink:href"))?.startsWith("#")||E.preventDefault()},!0),window.addEventListener("submit",E=>E.preventDefault(),!0),L(t),window.addEventListener("DOMContentLoaded",()=>{new ResizeObserver(T).observe(document.body),new MutationObserver(T).observe(document.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),window.addEventListener("resize",T),document.addEventListener("load",T,!0),document.fonts.ready.then(T),f("ready"),T()},{once:!0})}function F0(r,t,n,a,s){const o=document.createElement("iframe");o.setAttribute("sandbox","allow-scripts"),o.setAttribute("referrerpolicy","no-referrer"),o.title=n,o.style.cssText="display:block;width:100%;height:100%;border:0;";let c;const l=f=>{const i=f.data?.deltaY;typeof i=="number"&&Number.isFinite(i)&&i!==0&&Math.abs(i)<=a&&window.parent.postMessage({channel:r,type:"wheel",deltaY:i},"*")};window.addEventListener("message",f=>{const i=f.data;if(!(!i||typeof i!="object"||i.channel!==r)){if(f.source===window.parent&&i.type==="theme"){o.contentWindow?.postMessage({channel:r,type:"theme",theme:i.theme},"*");return}if(!(f.source!==o.contentWindow||f.origin!=="null")){if(i.type==="scroll-port"&&!c&&f.ports.length===1){c=f.ports[0],c.onmessage=l;return}i.type==="resize"&&typeof i.height=="number"&&Number.isFinite(i.height)&&i.height>=0?window.parent.postMessage({channel:r,type:"resize",height:i.height},"*"):i.type==="ready"?window.parent.postMessage({channel:r,type:"ready"},"*"):(i.type==="error"||i.type==="layout")&&typeof i.message=="string"?window.parent.postMessage({channel:r,type:i.type,message:i.message.slice(0,300)},"*"):i.type==="snapshot"&&s(i.snapshot)&&window.parent.postMessage({channel:r,type:"snapshot",snapshot:i.snapshot},"*")}}}),window.addEventListener("DOMContentLoaded",()=>{o.srcdoc=t,document.body.append(o)},{once:!0})}function z0(r,t,n,a,s,o,c,l){const f=document.implementation.createHTMLDocument(""),i=f.createElement("template");i.innerHTML=n,f.body.append(i.content);const p=Y=>{Y.querySelectorAll("meta, base, link, iframe, frame, frameset, object, embed").forEach(Q=>Q.remove()),Y.querySelectorAll("template").forEach(Q=>p(Q.content)),Y.querySelectorAll("a, area").forEach(Q=>{for(const Ie of["href","xlink:href"])Q.getAttribute(Ie)?.startsWith("#")||Q.removeAttribute(Ie);Q.removeAttribute("target"),Q.removeAttribute("ping"),Q.removeAttribute("download")})};p(f);const g=Y=>JSON.stringify(Y).replace(/</g,"\\u003c"),O=f.createElement("meta");O.httpEquiv="Content-Security-Policy",O.content=r.csp;const b=f.createElement("meta");b.setAttribute("charset","utf-8");const h=f.createElement("style"),P=/^data:[\w.+/-]+;base64,[A-Za-z0-9+/=]+$/.test(l)?`@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900;
|
|
261
261
|
font-display: swap; src: url('${l}') format('woff2'); }`:"";h.textContent=`${P}${r.styles}`;const R=f.createElement("script"),B=g([a,s,r.maxScrollDelta,r.lockHeight,t(c)?c:null]);R.textContent=`(${r.bridge})(...${B}, (${r.validate}));`,f.head.prepend(O,b,h,R);const F=`<!doctype html>${f.documentElement.outerHTML}`,T=document.implementation.createHTMLDocument(""),L=T.createElement("meta");L.httpEquiv="Content-Security-Policy",L.content=r.csp.replace("frame-src 'none'","frame-src about:");const U=T.createElement("meta");U.setAttribute("charset","utf-8");const E=T.createElement("style");E.textContent="html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }";const z=T.createElement("script"),J=g([a,F,o,r.maxScrollDelta]);return z.textContent=`(${r.shell})(...${J}, (${r.validate}));`,T.head.prepend(L,U,E,z),`<!doctype html>${T.documentElement.outerHTML}`}const H0=()=>({csp:D0,styles:N0,maxScrollDelta:pf,lockHeight:O0,bridge:B0.toString(),shell:F0.toString(),validate:ol.toString()});function j0(r,t,n,a,s=null,o=""){return z0(H0(),ol,r,t,n,a,s,o)}function od(r){const t=getComputedStyle(r);return{dark:document.documentElement.classList.contains("dark"),variables:{...Object.fromEntries(L0.map(n=>[`--${n}`,t.getPropertyValue(`--${n}`).trim()])),"--inline-html-root-font-size":getComputedStyle(document.documentElement).fontSize}}}function W0(r,t,n,a,s=null){return j0(r,t,n,a,s,M0)}var U0=I('<p class="type-caption m-0 break-words px-4 pb-2 text-muted-foreground"> </p>'),q0=I('<div class="type-body flex items-center justify-between gap-3 px-4 py-2" role="status"><span class="text-danger"> </span> <!></div> <!>',1),V0=I('<p class="sr-only" role="status"> </p>'),K0=I('<p class="type-body m-0 px-4 py-3 text-muted-foreground" role="status"> </p>'),G0=I('<div class="type-body px-4 py-2 text-danger" role="status"><p class="m-0"> </p> <p class="type-code m-0 break-words"> </p></div>'),J0=I('<iframe sandbox="allow-scripts" referrerpolicy="no-referrer"></iframe>'),Y0=I('<div class="space-y-4 p-4" aria-hidden="true"><div class="space-y-2"><!> <!></div> <!> <div class="flex items-center gap-4"><!> <!> <!></div></div>'),X0=I('<span class="type-caption ml-auto text-muted-foreground" role="status"> </span>'),Z0=I('<p class="type-caption m-0 break-words px-4 pb-2 text-muted-foreground" role="status"> <!></p>'),Q0=I('<th class="min-w-40 px-2 pb-3 align-top font-normal"><!> <div class="mt-1 flex gap-1"><!> <!></div></th>'),$0=I('<td class="max-w-56 px-2 py-2 align-top break-words tabular-nums"> </td>'),ek=I('<tr><th class="max-w-48 py-2 pr-4 align-top font-normal break-words text-muted-foreground"> </th><!></tr>'),tk=I('<div class="overflow-x-auto px-4 pb-4" data-inline-visual-comparison=""><table class="type-body w-full border-separate border-spacing-0 text-left"><thead><tr><th class="min-w-28 pr-4 pb-3 font-normal text-muted-foreground"> </th><th class="min-w-32 px-2 pb-3 align-top font-medium"> </th><!></tr></thead><tbody></tbody></table></div>'),rk=I('<div class="flex flex-wrap items-center gap-1 px-4 py-2" data-inline-visual-actions=""><!> <!> <!> <!> <!></div> <!> <!>',1),nk=I('<div data-inline-html="" class="my-3 min-w-0 overflow-hidden rounded-lg bg-background text-foreground"><div class="flex min-w-0 items-center justify-end gap-1 p-1"><!> <!></div> <!> <!> <div class="relative min-w-0"><!> <!></div> <!></div>');function gf(r,t){if(new.target)return Bt({component:gf,...r});Ht(t,!0);const n=720,a=1e4;let s=y(t,"source",7),o=y(t,"isStreaming",7,!1),c=y(t,"isComplete",7,!0),l=y(t,"record",7),f=y(t,"storageStatus",7,"ready"),i=y(t,"onRecordChange",7),p=y(t,"onUseConfiguration",7),g=y(t,"onExport",7),O=y(t,"onRetry",7),b=y(t,"storageError",7),h=y(t,"exportStatus",7),P=y(t,"exportPath",7),R=y(t,"exportError",7),B,F=ye(void 0),T=ye(!1),L=ye(!1),U=ye(0),E=ye(""),z=ye(""),J=ye(!1),Y=ye(""),Q=ye(Gr(_i)),Ie=ye(n),le=ye(""),fe=ye(Yl()),ce=ye(void 0),Le,G=ye(void 0),we=ye(!1);const $=d(()=>l()??e(fe)),We=d(()=>f()!=="loading"&&(f()!=="error"||!!e($).current)),Ee=d(()=>!o()&&c()&&!!s().trim()&&e(We)),Se=d(()=>Math.min(sd,Math.max(_i,e(Q)))),ke=d(()=>o()||f()==="loading"?"loading":c()?s().trim()?e(Y)?"error":e(J)?"ready":"loading":"empty":"incomplete"),Be=d(()=>o()||f()==="loading"||e(Ee)&&!e(J)&&!e(Y));function Xe(se){const ze={...se,current:e(ce)??se.current};A(fe,ze),i()?.(ze)}function ae(){const se=e(ce);!se||e($).scenarios.length>=Xl||(Xe({...e($),scenarios:[...e($).scenarios,{id:crypto.randomUUID(),name:dp({number:Dl(e($).scenarios.length+1)}),snapshot:structuredClone(se)}]}),A(we,!0))}function Z(se,ze){const nt=ze.trim().slice(0,120);nt&&Xe({...e($),scenarios:e($).scenarios.map(dt=>dt.id===se?{...dt,name:nt}:dt)})}function Je(se){const ze=structuredClone(se);A(ce,ze),A(G,ze),Xe({...e($),current:ze}),A(U,e(U)+1)}function K(se){return typeof se=="number"?Dl(se):typeof se=="string"?se:JSON.stringify(se)}function V(){!e(F)?.contentWindow||!e(z)||e(F).contentWindow.postMessage({channel:e(z),type:"theme",theme:od(B)},"*")}function W(se){let ze=B.parentElement;for(;ze;){const nt=getComputedStyle(ze),dt=ze.scrollHeight-ze.clientHeight;if(/^(auto|scroll|overlay)$/.test(nt.overflowY)&&dt>1){if(se<0?ze.scrollTop>0:ze.scrollTop<dt){ze.dispatchEvent(new WheelEvent("wheel",{deltaY:se,bubbles:!0})),ze.scrollTop+=se;return}if(/^(contain|none)$/.test(nt.overscrollBehaviorY))return}ze=ze.parentElement}window.scrollBy({top:se,behavior:"instant"})}wt(()=>{if(!e(T))return;const se=s(),ze=e(Ee);e(U),Mn(()=>{Le!==se&&(A(fe,Yl()),A(ce,void 0),A(we,!1),A(G,void 0),Le=se),A(J,!1),A(Y,""),A(le,""),A(Q,_i,!0),A(z,crypto.randomUUID(),!0),A(E,ze?W0(se,e(z),od(B),Nl(),e(G)??e(ce)??e($).current):"",!0),A(G,void 0)})}),wt(()=>{if(!e(E)||e(J)||e(Y))return;const se=setTimeout(()=>{A(Y,$f(),!0)},a);return()=>clearTimeout(se)}),to(()=>{A(T,!0);const se=Ke=>{if(Ke.source!==e(F)?.contentWindow||Ke.origin!=="null")return;const tt=Ke.data;if(!(!tt||typeof tt!="object"||tt.channel!==e(z))){if(tt.type==="bootstrap"){e(F)?.contentWindow?.postMessage({channel:e(z),type:"initialize",documentHtml:e(E)},"*");return}if(tt.type==="resize"&&typeof tt.height=="number"&&Number.isFinite(tt.height)&&tt.height>=0)A(Q,Math.min(sd,Math.ceil(tt.height)),!0);else if(tt.type==="ready")A(J,!0),V();else if(tt.type==="error"&&typeof tt.message=="string")A(Y,tt.message.slice(0,300),!0);else if(tt.type==="layout"&&typeof tt.message=="string")A(le,tt.message.slice(0,300),!0);else if(tt.type==="snapshot"&&e(Ee)&&ol(tt.snapshot)){const st=tt.snapshot;A(ce,st),Xe({...e($),current:st})}else tt.type==="wheel"&&e(J)&&e(Ee)&&!e(L)&&!e(Be)&&typeof tt.deltaY=="number"&&Number.isFinite(tt.deltaY)&&tt.deltaY!==0&&Math.abs(tt.deltaY)<=pf&&W(tt.deltaY)}},ze=()=>{A(Ie,Math.min(n,Math.max(160,Math.floor(window.innerHeight*.8))),!0)},nt=new MutationObserver(V);nt.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme"]});const dt=window.matchMedia("(prefers-color-scheme: dark)");return dt.addEventListener("change",V),window.addEventListener("message",se),window.addEventListener("resize",ze),ze(),()=>{nt.disconnect(),dt.removeEventListener("change",V),window.removeEventListener("message",se),window.removeEventListener("resize",ze)}});var ie={get source(){return s()},set source(se){s(se),_()},get isStreaming(){return o()},set isStreaming(se=!1){o(se),_()},get isComplete(){return c()},set isComplete(se=!0){c(se),_()},get record(){return l()},set record(se){l(se),_()},get storageStatus(){return f()},set storageStatus(se="ready"){f(se),_()},get onRecordChange(){return i()},set onRecordChange(se){i(se),_()},get onUseConfiguration(){return p()},set onUseConfiguration(se){p(se),_()},get onExport(){return g()},set onExport(se){g(se),_()},get onRetry(){return O()},set onRetry(se){O(se),_()},get storageError(){return b()},set storageError(se){b(se),_()},get exportStatus(){return h()},set exportStatus(se){h(se),_()},get exportPath(){return P()},set exportPath(se){P(se),_()},get exportError(){return R()},set exportError(se){R(se),_()},$set:Ft,$on:(se,ze)=>zt(t,se,ze)},ge=nk(),X=S(ge),de=S(X);yt(de,{variant:"ghost",size:"sm",get active(){return e(L)},get"aria-pressed"(){return e(L)},onclick:()=>{A(L,!e(L))},children:(se,ze)=>{tr();var nt=Tt();k(dt=>x(nt,dt),[()=>e(L)?ep():tp()]),u(se,nt)},$$slots:{default:!0}});var Ne=m(de,2);{let se=d(()=>!e(Ee));yt(Ne,{variant:"ghost",size:"sm",get disabled(){return e(se)},onclick:()=>{A(U,e(U)+1)},children:(ze,nt)=>{tr();var dt=Tt();k(Ke=>x(dt,Ke),[()=>rp()]),u(ze,dt)},$$slots:{default:!0}})}w(X);var Ce=m(X,2);{var rt=se=>{var ze=q0(),nt=je(ze),dt=S(nt),Ke=M(dt,!0),tt=m(dt,2);{var st=Ot=>{yt(Ot,{variant:"ghost",size:"sm",get onclick(){return O()},children:(Dt,Yt)=>{tr();var Et=Tt();k(Wt=>x(Et,Wt),[()=>up()]),u(Dt,Et)},$$slots:{default:!0}})};D(tt,Ot=>{O()&&Ot(st)})}w(nt);var vt=m(nt,2);{var _t=Ot=>{var Dt=U0(),Yt=M(Dt,!0);k(()=>x(Yt,b())),u(Ot,Dt)};D(vt,Ot=>{b()&&Ot(_t)})}k(Ot=>x(Ke,Ot),[()=>np()]),u(se,ze)};D(Ce,se=>{f()==="error"&&se(rt)})}var me=m(Ce,2);{var Re=se=>{var ze=V0(),nt=M(ze,!0);k(dt=>x(nt,dt),[()=>o()?ap():sp()]),u(se,ze)},q=se=>{var ze=K0(),nt=M(ze,!0);k(dt=>x(nt,dt),[()=>c()?ip():op()]),u(se,ze)},Pe=se=>{var ze=G0(),nt=S(ze),dt=M(nt,!0),Ke=m(nt,2),tt=M(Ke,!0);w(ze),k(st=>{x(dt,st),x(tt,e(Y))},[()=>lp()]),u(se,ze)};D(me,se=>{e(Be)?se(Re):e(Ee)?e(Y)&&se(Pe,2):se(q,1)})}var ue=m(me,2),N=S(ue);{var H=se=>{var ze=kt(),nt=je(ze);Es(nt,()=>e(z),dt=>{var Ke=J0();let tt,st;pr(Ke,vt=>A(F,vt),()=>e(F)),k(vt=>{re(Ke,"title",vt),re(Ke,"src",`/inline-html-sandbox.html#${e(z)}`),tt=gt(Ke,1,"block w-full border-0 svelte-1kkow1d",null,tt,{"preview-hidden":e(L)||!e(J)}),re(Ke,"aria-hidden",e(L)||!e(J)),st=Nn(Ke,"",st,{height:`${e(Se)}px`})},[()=>Nl()]),u(dt,Ke)}),u(se,ze)};D(N,se=>{e(Ee)&&e(E)&&se(H)})}var pe=m(N,2);{var Qe=se=>{ua(se,{get code(){return s()},language:"html",noBorder:!0,noMargin:!0,get maxHeight(){return e(Ie)}})},Te=se=>{var ze=Y0(),nt=S(ze),dt=S(nt);_s(dt,{class:"h-4 w-32 max-w-1/2"});var Ke=m(dt,2);_s(Ke,{class:"h-3 w-2/3"}),w(nt);var tt=m(nt,2);_s(tt,{class:"aspect-video max-h-60 w-full rounded-lg"});var st=m(tt,2),vt=S(st);_s(vt,{class:"h-3 w-16"});var _t=m(vt,2);_s(_t,{class:"h-2 min-w-0 flex-1"});var Ot=m(_t,2);_s(Ot,{class:"h-3 w-10"}),w(st),w(ze),u(se,ze)};D(pe,se=>{e(L)?se(Qe):e(Be)&&se(Te,1)})}w(ue);var Fe=m(ue,2);{var et=se=>{var ze=rk(),nt=je(ze),dt=S(nt);{var Ke=Mt=>{{let St=d(()=>!e(J)||!!e(Y));yt(Mt,{size:"sm",get disabled(){return e(St)},onclick:()=>e(ce)&&p()(e(ce)),children:(_e,ee)=>{tr();var Ue=Tt();k(at=>x(Ue,at),[()=>fp()]),u(_e,Ue)},$$slots:{default:!0}})}};D(dt,Mt=>{p()&&Mt(Ke)})}var tt=m(dt,2);{let Mt=d(()=>!e(J)||!!e(Y)||e($).scenarios.length>=Xl);yt(tt,{variant:"ghost",size:"sm",get disabled(){return e(Mt)},onclick:ae,children:(St,_e)=>{tr();var ee=Tt();k(Ue=>x(ee,Ue),[()=>cp()]),u(St,ee)},$$slots:{default:!0}})}var st=m(tt,2);{var vt=Mt=>{yt(Mt,{variant:"ghost",size:"sm",get active(){return e(we)},get"aria-expanded"(){return e(we)},onclick:()=>A(we,!e(we)),children:(St,_e)=>{tr();var ee=Tt();k(Ue=>x(ee,Ue),[()=>pp()]),u(St,ee)},$$slots:{default:!0}})};D(st,Mt=>{e($).scenarios.length&&Mt(vt)})}var _t=m(st,2);{var Ot=Mt=>{{let St=d(()=>!e(J)||h()==="saving");yt(Mt,{variant:"ghost",size:"sm",get disabled(){return e(St)},onclick:()=>g()({...e($),current:e(ce)??null}),children:(_e,ee)=>{tr();var Ue=Tt();k(at=>x(Ue,at),[()=>gp()]),u(_e,Ue)},$$slots:{default:!0}})}};D(_t,Mt=>{g()&&Mt(Ot)})}var Dt=m(_t,2);{var Yt=Mt=>{var St=X0(),_e=M(St,!0);k(ee=>x(_e,ee),[()=>f()==="saving"?vp():f()==="ready"?mp():""]),u(Mt,St)};D(Dt,Mt=>{i()&&Mt(Yt)})}w(nt);var Et=m(nt,2);{var Wt=Mt=>{var St=Z0(),_e=S(St),ee=m(_e);{var Ue=at=>{var ot=Tt();k(()=>x(ot,R())),u(at,ot)};D(ee,at=>{h()==="error"&&R()&&at(Ue)})}w(St),k(at=>x(_e,`${at??""} `),[()=>h()==="saving"?hp():h()==="saved"?bp({path:P()??""}):yp()]),u(Mt,St)};D(Et,Mt=>{h()&&Mt(Wt)})}var Qt=m(Et,2);{var lr=Mt=>{var St=tk(),_e=S(St),ee=S(_e),Ue=S(ee),at=S(Ue),ot=M(at,!0),De=m(at),oe=M(De,!0),ve=m(De);Rt(ve,17,()=>e($).scenarios,Me=>Me.id,(Me,he)=>{var He=Q0(),Ve=S(He);{let Ye=d(()=>wp());Ss(Ve,{get value(){return e(he).name},get"aria-label"(){return e(Ye)},maxlength:120,onblur:xe=>{xe.currentTarget.value.trim()||(xe.currentTarget.value=e(he).name),Z(e(he).id,xe.currentTarget.value)},onkeydown:xe=>{xe.key==="Enter"&&xe.currentTarget.blur(),xe.key==="Escape"&&(xe.currentTarget.value=e(he).name,xe.currentTarget.blur())}})}var qe=m(Ve,2),$e=S(qe);yt($e,{variant:"ghost",size:"sm",onclick:()=>Je(e(he).snapshot),children:(Ye,xe)=>{tr();var Ze=Tt();k(ft=>x(Ze,ft),[()=>_p()]),u(Ye,Ze)},$$slots:{default:!0}});var Oe=m($e,2);yt(Oe,{variant:"ghost",size:"sm",onclick:()=>Xe({...e($),scenarios:e($).scenarios.filter(Ye=>Ye.id!==e(he).id)}),children:(Ye,xe)=>{tr();var Ze=Tt();k(ft=>x(Ze,ft),[()=>xp()]),u(Ye,Ze)},$$slots:{default:!0}}),w(qe),w(He),u(Me,He)}),w(Ue),w(ee);var ne=m(ee);Rt(ne,20,()=>["inputs","results"],Tr,(Me,he)=>{const He=d(()=>he),Ve=d(()=>Array.from(new Set([...Object.keys(e(ce)[e(He)]),...e($).scenarios.flatMap(Oe=>Object.keys(Oe.snapshot[e(He)]))])));var qe=kt(),$e=je(qe);Rt($e,16,()=>e(Ve),Oe=>Oe,(Oe,Ye)=>{var xe=ek(),Ze=S(xe),ft=M(Ze,!0),ct=m(Ze);Rt(ct,17,()=>[e(ce),...e($).scenarios.map(it=>it.snapshot)],Tr,(it,Ct)=>{var mt=$0(),Lt=M(mt,!0);k(Kt=>x(Lt,Kt),[()=>Object.hasOwn(e(Ct)[e(He)],Ye)?K(e(Ct)[e(He)][Ye]):"—"]),u(it,mt)}),w(xe),k(()=>x(ft,Ye)),u(Oe,xe)}),u(Me,qe)}),w(ne),w(_e),w(St),k(Me=>{x(ot,e(ce).title),x(oe,Me)},[()=>kp()]),u(Mt,St)};D(Qt,Mt=>{e(we)&&e($).scenarios.length&&Mt(lr)})}u(se,ze)};D(Fe,se=>{e(ce)&&e(Ee)&&se(et)})}return w(ge),pr(ge,se=>B=se,()=>B),k(()=>{re(ge,"data-inline-html-status",e(ke)),re(ge,"data-inline-html-layout",e(le)?"viewport-locked":void 0),re(ge,"aria-busy",e(Be))}),u(r,ge),jt(ie)}var ak=I('<div class="w-full min-w-0"><!></div>');function sk(r,t){if(new.target)return Bt({component:sk,...r});Ht(t,!0);const n=()=>bt(e(b),"$agent$",s),a=()=>bt(e(B),"$entry$",s),[s,o]=ga();let c=y(t,"block",7),l=y(t,"role",7),f=y(t,"workspaceId",7),i=y(t,"agentId",7),p=y(t,"messageId",7),g=y(t,"contentBlockKey",7,""),O=ye(void 0);const b=d(()=>Bo(i()??"")),h=d(()=>l()==="assistant"&&f()&&i()&&p()&&c().metadata?.fenceClosed&&!c().metadata?.isStreaming&&n()&&!Jd(n())?{workspaceId:f(),agentId:i(),messageId:p(),blockKey:JSON.stringify([g(),c().metadata?.fenceStart??0]),source:c().content}:void 0),P=d(()=>!!(f()&&i()&&p()&&c().metadata?.fenceClosed&&!n())),R=d(()=>e(h)?_v(e(h)):""),B=d(()=>sh(e(R)));wt(()=>{e(h)&&Nt.dispatch(mv(e(h)))});function F(Y){!f()||!i()||n()?.retiredAt||e(O)?.dispatchEvent(new CustomEvent(kb,{bubbles:!0,detail:{workspaceId:f(),agentId:i(),snapshot:Y}}))}var T={get block(){return c()},set block(Y){c(Y),_()},get role(){return l()},set role(Y){l(Y),_()},get workspaceId(){return f()},set workspaceId(Y){f(Y),_()},get agentId(){return i()},set agentId(Y){i(Y),_()},get messageId(){return p()},set messageId(Y){p(Y),_()},get contentBlockKey(){return g()},set contentBlockKey(Y=""){g(Y),_()},$set:Ft,$on:(Y,Q)=>zt(t,Y,Q)},L=kt(),U=je(L);{var E=Y=>{var Q=ak(),Ie=S(Q);{let le=d(()=>c().metadata?.isStreaming??!1),fe=d(()=>c().metadata?.fenceClosed??!1),ce=d(()=>a()?.record),Le=d(()=>e(h)?a()?.status??"loading":e(P)?"loading":"ready"),G=d(()=>a()?.error),we=d(()=>e(h)?Xe=>Nt.dispatch(yv(e(R),Xe)):void 0),$=d(()=>f()&&i()&&n()&&!n().retiredAt?F:void 0),We=d(()=>e(h)?()=>Nt.dispatch(bv(e(R))):void 0),Ee=d(()=>e(h)?Xe=>Nt.dispatch(hv(e(R),crypto.randomUUID(),Xe)):void 0),Se=d(()=>a()?.export?.status),ke=d(()=>a()?.export?.path),Be=d(()=>a()?.export?.error);gf(Ie,{get source(){return c().content},get isStreaming(){return e(le)},get isComplete(){return e(fe)},get record(){return e(ce)},get storageStatus(){return e(Le)},get storageError(){return e(G)},get onRecordChange(){return e(we)},get onUseConfiguration(){return e($)},get onRetry(){return e(We)},get onExport(){return e(Ee)},get exportStatus(){return e(Se)},get exportPath(){return e(ke)},get exportError(){return e(Be)}})}w(Q),pr(Q,le=>A(O,le),()=>e(O)),u(Y,Q)},z=Y=>{ua(Y,{get code(){return c().content},language:"html"})};D(U,Y=>{l()==="assistant"?Y(E):Y(z,-1)})}u(r,L);var J=jt(T);return o(),J}var ok=I('<div class="digest-card flex items-start gap-2.5 py-5 px-6 my-4 shadow-xs text-base leading-normal border border-border"> </div>');function ik(r,t){if(new.target)return Bt({component:ik,...r});Ht(t,!0);let n=y(t,"digest",7);var a={get digest(){return n()},set digest(c){n(c),_()},$set:Ft,$on:(c,l)=>zt(t,c,l)},s=ok(),o=M(s,!0);return k(()=>x(o,n())),u(r,s),jt(a)}var lk=I('<span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-blue-500/15 text-blue-600 dark:text-blue-400"> </span>'),ck=I('<span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-muted text-muted-foreground"> </span>'),dk=I('<span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-primary/10 text-primary/80"> </span>'),uk=I('<div class="flex items-start gap-3 px-4 py-2.5"><div class="flex-1 min-w-0"><div class="flex items-center gap-2 flex-wrap"><span class="text-sm font-semibold text-foreground"> </span> <!> <!></div> <div class="mt-0.5 text-xs font-mono text-muted-foreground truncate"> </div></div></div>'),fk=I('<div class="detected-scripts-card my-3 rounded-lg border border-border bg-muted/30 overflow-hidden"><div class="flex items-center gap-2 px-4 py-2.5 border-b border-border bg-muted/40"><!> <span class="text-sm font-semibold text-foreground"> </span></div> <div class="divide-y divide-border"></div> <div class="px-4 py-2 border-t border-border bg-muted/20"><span class="text-xs text-muted-foreground"> </span></div></div>');function pk(r,t){if(new.target)return Bt({component:pk,...r});Ht(t,!0);let n=y(t,"scripts",7);var a={get scripts(){return n()},set scripts(b){n(b),_()},$set:Ft,$on:(b,h)=>zt(t,b,h)},s=fk(),o=S(s),c=S(o);At(c,{get icon(){return Nd},size:"sm",class:"text-primary-ink/70"});var l=m(c,2),f=M(l,!0);w(o);var i=m(o,2);Rt(i,21,n,b=>b.name+b.command,(b,h)=>{var P=uk(),R=S(P),B=S(R),F=S(B),T=M(F,!0),L=m(F,2);{var U=Ie=>{var le=lk(),fe=M(le,!0);k(ce=>x(fe,ce),[()=>v.chat_detectedScripts_service_badge()]),u(Ie,le)},E=Ie=>{var le=ck(),fe=M(le,!0);k(ce=>x(fe,ce),[()=>v.chat_detectedScripts_command_badge()]),u(Ie,le)};D(L,Ie=>{e(h).mode==="service"?Ie(U):Ie(E,-1)})}var z=m(L,2);{var J=Ie=>{var le=dk(),fe=M(le,!0);k(()=>x(fe,e(h).category)),u(Ie,le)};D(z,Ie=>{e(h).category&&e(h).category!=="other"&&Ie(J)})}w(B);var Y=m(B,2),Q=M(Y,!0);w(R),w(P),k(()=>{x(T,e(h).name),x(Q,e(h).command)}),u(b,P)}),w(i);var p=m(i,2),g=S(p),O=M(g,!0);return w(p),w(s),k((b,h)=>{x(f,b),x(O,h)},[()=>v.chat_detectedScripts_title(),()=>n().length===1?v.chat_detectedScripts_count_one({count:nr(n().length)}):v.chat_detectedScripts_count_many({count:nr(n().length)})]),u(r,s),jt(a)}function gk(r,t){if(new.target)return Bt({component:gk,...r});Ht(t,!0);let n=y(t,"diff",7),a=y(t,"filePath",7),s=y(t,"language",7),o=y(t,"onApply",7),c=y(t,"onReject",7);function l(){o()?.(),da.success(v.chat_diffViewer_applied_toast())}function f(){c()?.(),da.info(v.chat_diffViewer_rejected_toast())}const i=d(()=>{const g=[];return o()&&g.push({label:v.chat_diffViewer_apply_label(),variant:"success",onClick:l}),c()&&g.push({label:v.chat_diffViewer_reject_label(),variant:"danger",onClick:f}),g});var p={get diff(){return n()},set diff(g){n(g),_()},get filePath(){return a()},set filePath(g){a(g),_()},get language(){return s()},set language(g){s(g),_()},get onApply(){return o()},set onApply(g){o(g),_()},get onReject(){return c()},set onReject(g){c(g),_()},$set:Ft,$on:(g,O)=>zt(t,g,O)};{let g=d(()=>a()||v.chat_diffViewer_suggestedChanges_fallback());Ys(r,{get patch(){return n()},get fileName(){return e(g)},get language(){return s()},get actions(){return e(i)},collapsible:!0,initialCollapsed:!1,maxHeight:"500px"})}return jt(p)}var vk=Ha('<circle fill="none" style="transition: stroke-dasharray 0.3s ease-out"></circle>'),id=Ha("<circle></circle>"),mk=Ha('<svg class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 fill-background" viewBox="0 0 8 6"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.69471 1.69471C7.87687 1.50611 7.97766 1.25351 7.97539 0.991311C7.97311 0.729114 7.86794 0.478302 7.68253 0.292894C7.49712 0.107485 7.24631 0.00231622 6.98411 3.78025e-05C6.72192 -0.00224062 6.46931 0.0985542 6.28071 0.280712L2.98771 3.57371L1.69471 2.28071C1.50611 2.09855 1.25351 1.99776 0.991311 2.00004C0.729114 2.00232 0.478302 2.10749 0.292894 2.29289C0.107485 2.4783 0.00231622 2.72911 3.78025e-05 2.99131C-0.00224062 3.25351 0.0985542 3.50611 0.280712 3.69471L2.28071 5.69471C2.46824 5.88218 2.72255 5.9875 2.98771 5.9875C3.25288 5.9875 3.50718 5.88218 3.69471 5.69471L7.69471 1.69471Z"></path></svg>'),hk=I('<div class="relative"><svg fill="none" xmlns="http://www.w3.org/2000/svg"><circle fill="none"></circle><!></svg> <!></div>');function Io(r,t){if(new.target)return Bt({component:Io,...r});Ht(t,!0);let n=y(t,"phase",7),a=y(t,"progress",7,0),s=y(t,"size",7,16),o=y(t,"class",7,""),c=d(()=>s()/2),l=d(()=>e(c)),f=d(()=>e(c)),i=d(()=>s()*.12),p=d(()=>e(c)-e(i)/2),g=d(()=>e(c)*.35),O=d(()=>2*Math.PI*e(g)),b=d(()=>Math.max(0,Math.min(1,a()))*e(O));const h={planning:"#99999999",building:"#54B1F3",reviewing:"#6D7FF5",shipped:"var(--color-foreground)"};let P=d(()=>h[n()]||"currentColor");var R={get phase(){return n()},set phase(le){n(le),_()},get progress(){return a()},set progress(le=0){a(le),_()},get size(){return s()},set size(le=16){s(le),_()},get class(){return o()},set class(le=""){o(le),_()},$set:Ft,$on:(le,fe)=>zt(t,le,fe)},B=hk(),F=S(B),T=S(F),L=m(T);{var U=le=>{},E=le=>{var fe=vk();k(()=>{re(fe,"cx",e(l)),re(fe,"cy",e(f)),re(fe,"r",e(g)*.8),re(fe,"stroke",e(P)),re(fe,"stroke-width",e(g)*1.5),re(fe,"stroke-dasharray",`${e(b)??""} ${e(O)??""}`),re(fe,"stroke-dashoffset",e(O)*.25),re(fe,"transform",`rotate(-90 ${e(l)??""} ${e(f)??""})`)}),u(le,fe)},z=le=>{var fe=id();k(()=>{re(fe,"cx",e(l)),re(fe,"cy",e(f)),re(fe,"r",e(p)*.6),re(fe,"fill",e(P))}),u(le,fe)},J=le=>{var fe=id();k(()=>{re(fe,"cx",e(l)),re(fe,"cy",e(f)),re(fe,"r",e(p)),re(fe,"fill",e(P))}),u(le,fe)};D(L,le=>{n()==="planning"?le(U):n()==="building"?le(E,1):n()==="reviewing"?le(z,2):n()==="shipped"&&le(J,3)})}w(F);var Y=m(F,2);{var Q=le=>{},Ie=le=>{var fe=mk();k(()=>re(fe,"width",s()*.5)),u(le,fe)};D(Y,le=>{n()==="reviewing"?le(Q):n()==="shipped"&&le(Ie,1)})}return w(B),k(()=>{re(F,"width",s()),re(F,"height",s()),re(F,"viewBox",`0 0 ${s()??""} ${s()??""}`),gt(F,0,ir(o())),re(T,"cx",e(l)),re(T,"cy",e(f)),re(T,"r",e(p)),re(T,"stroke",e(P)),re(T,"stroke-width",e(i))}),u(r,B),jt(R)}var ld=I('<span class="flex items-center gap-1"><span class="size-1.5 rounded-full"></span> </span>'),bk=I('<span class="flex items-center gap-1"><span class="size-1.5 rounded-full bg-border"></span> </span>'),cd=I('<span class="text-ui text-subtle truncate"> </span>'),dd=I('<div class="flex items-center gap-1 mt-0.5"><!> <!></div>'),ud=I('<div class="flex items-start gap-2"><div class="shrink-0 mt-0.5"><!></div> <div class="flex-1 min-w-0"><div class="text-xs leading-snug truncate"> </div> <!></div></div>'),yk=I('<div class="flex items-center gap-2"><div class="shrink-0"><!></div> <span class="text-ui text-subtle truncate line-through"> </span></div>'),_k=I('<span class="text-ui text-subtle pl-4"> </span>'),xk=I('<div class="flex flex-col gap-0.5 pt-1 border-t border-border"><!> <!></div>'),wk=I('<div class="text-ui text-subtle"> </div>'),kk=I("<!> <!> <!> <!>",1),Ik=I('<div class="flex flex-col py-2 px-3 gap-2 max-h-80 overflow-y-auto"><div class="flex items-center justify-between gap-3"><span class="text-xs font-semibold text-foreground"> </span> <div class="flex items-center gap-3 text-ui text-subtle"><!> <!> <!></div></div> <!></div>'),Sk=I('<div class="rounded-[0.5px]"></div>');function vf(r,t){if(new.target)return Bt({component:vf,...r});Ht(t,!0);let n=y(t,"stats",7),a=y(t,"tasks",23,()=>[]),s=y(t,"maxBars",7,20),o=y(t,"barWidth",7,"1px"),c=y(t,"barHeight",7,"16px"),l=y(t,"gap",7,"1px"),f=y(t,"class",7);const i={completed:"#22c55e",inProgress:"#4F7BF7",notStarted:"var(--border)"};let p=d(()=>{const{completed:L,inProgress:U,notStarted:E,total:z}=n();if(z===0)return[];const J=[...Array(L).fill("completed"),...Array(U).fill("inProgress"),...Array(Math.max(0,E)).fill("notStarted")];return J.length<=s()?J:J.slice(J.length-s())}),g=d(()=>a().filter(L=>L.status==="complete")),O=d(()=>a().filter(L=>L.status==="in_progress"||L.status==="review_required")),b=d(()=>a().filter(L=>L.status!=="complete"&&L.status!=="in_progress"&&L.status!=="review_required"&&L.status!=="cancelled")),h=d(()=>a().filter(L=>L.status==="cancelled")),P=d(()=>a().length>0);var R={get stats(){return n()},set stats(L){n(L),_()},get tasks(){return a()},set tasks(L=[]){a(L),_()},get maxBars(){return s()},set maxBars(L=20){s(L),_()},get barWidth(){return o()},set barWidth(L="1px"){o(L),_()},get barHeight(){return c()},set barHeight(L="16px"){c(L),_()},get gap(){return l()},set gap(L="1px"){l(L),_()},get class(){return f()},set class(L){f(L),_()},$set:Ft,$on:(L,U)=>zt(t,L,U)},B=kt(),F=je(B);{var T=L=>{Ci(L,{side:"top",align:"start",sideOffset:6,contentClass:"max-w-xs p-0",delayDuration:200,disableHoverableContent:!1,content:E=>{var z=Ik(),J=S(z),Y=S(J),Q=M(Y,!0),Ie=m(Y,2),le=S(Ie);{var fe=Ee=>{var Se=ld(),ke=S(Se);Nn(ke,"",{},{"background-color":"#22c55e"});var Be=m(ke);w(Se),k(()=>x(Be,` ${n().completed??""}`)),u(Ee,Se)};D(le,Ee=>{n().completed>0&&Ee(fe)})}var ce=m(le,2);{var Le=Ee=>{var Se=ld(),ke=S(Se);Nn(ke,"",{},{"background-color":"#4F7BF7"});var Be=m(ke);w(Se),k(()=>x(Be,` ${n().inProgress??""}`)),u(Ee,Se)};D(ce,Ee=>{n().inProgress>0&&Ee(Le)})}var G=m(ce,2);{var we=Ee=>{var Se=bk(),ke=m(S(Se));w(Se),k(()=>x(ke,` ${n().notStarted??""}`)),u(Ee,Se)};D(G,Ee=>{n().notStarted>0&&Ee(we)})}w(Ie),w(J);var $=m(J,2);{var We=Ee=>{var Se=kk(),ke=je(Se);Rt(ke,17,()=>e(O),Tr,(K,V)=>{var W=ud(),ie=S(W),ge=S(ie);oi(ge,{get status(){return e(V).status},size:14}),w(ie);var X=m(ie,2),de=S(X),Ne=M(de,!0),Ce=m(de,2);{var rt=me=>{var Re=dd(),q=S(Re);{let N=d(()=>e(V).agentState||"idle");Hl(q,{get agentId(){return e(V).agentId},get state(){return e(N)},size:12,get specialist(){return e(V).agentSpecialist}})}var Pe=m(q,2);{var ue=N=>{var H=cd(),pe=M(H,!0);k(()=>x(pe,e(V).agentName)),u(N,H)};D(Pe,N=>{e(V).agentName&&N(ue)})}w(Re),u(me,Re)};D(Ce,me=>{e(V).agentId&&me(rt)})}w(X),w(W),k(()=>x(Ne,e(V).title)),u(K,W)});var Be=m(ke,2);Rt(Be,17,()=>e(b),Tr,(K,V)=>{var W=ud(),ie=S(W),ge=S(ie);oi(ge,{get status(){return e(V).status},size:14}),w(ie);var X=m(ie,2),de=S(X),Ne=M(de,!0),Ce=m(de,2);{var rt=me=>{var Re=dd(),q=S(Re);{let N=d(()=>e(V).agentState||"idle");Hl(q,{get agentId(){return e(V).agentId},get state(){return e(N)},size:12,get specialist(){return e(V).agentSpecialist}})}var Pe=m(q,2);{var ue=N=>{var H=cd(),pe=M(H,!0);k(()=>x(pe,e(V).agentName)),u(N,H)};D(Pe,N=>{e(V).agentName&&N(ue)})}w(Re),u(me,Re)};D(Ce,me=>{e(V).agentId&&me(rt)})}w(X),w(W),k(()=>x(Ne,e(V).title)),u(K,W)});var Xe=m(Be,2);{var ae=K=>{var V=xk(),W=S(V);Rt(W,17,()=>e(g).slice(0,3),Tr,(X,de)=>{var Ne=yk(),Ce=S(Ne),rt=S(Ce);oi(rt,{status:"complete",size:12}),w(Ce);var me=m(Ce,2),Re=M(me,!0);w(Ne),k(()=>x(Re,e(de).title)),u(X,Ne)});var ie=m(W,2);{var ge=X=>{var de=_k(),Ne=M(de,!0);k(Ce=>x(Ne,Ce),[()=>v.workspace_taskProgressBar_moreCompleted_label({count:nr(e(g).length-3)})]),u(X,de)};D(ie,X=>{e(g).length>3&&X(ge)})}w(V),u(K,V)};D(Xe,K=>{e(g).length>0&&K(ae)})}var Z=m(Xe,2);{var Je=K=>{var V=wk(),W=M(V,!0);k(ie=>x(W,ie),[()=>v.workspace_taskProgressBar_cancelled_label({count:nr(e(h).length)})]),u(K,V)};D(Z,K=>{e(h).length>0&&K(Je)})}u(Ee,Se)};D($,Ee=>{e(P)&&Ee(We)})}w(z),k(Ee=>x(Q,Ee),[()=>v.workspace_taskProgressBar_tasksRatio_label({completed:nr(n().completed),total:nr(n().total)})]),u(E,z)},children:(E,z)=>{{let J=d(()=>In("flex h-auto min-w-0 shrink items-end justify-start cursor-default rounded-none border-0",f())),Y=d(()=>`gap: ${l()}`),Q=d(()=>v.workspace_taskProgressBar_tasksRatio_label({completed:nr(n().completed),total:nr(n().total)}));yt(E,{variant:"plain",type:"button",wrapContent:!1,get class(){return e(J)},get style(){return e(Y)},get"aria-label"(){return e(Q)},"data-task-progress-trigger":!0,children:(Ie,le)=>{var fe=kt(),ce=je(fe);Rt(ce,17,()=>e(p),Tr,(Le,G)=>{var we=Sk();let $;k(()=>$=Nn(we,"",$,{width:o(),height:c(),"background-color":i[e(G)]})),u(Le,we)}),u(Ie,fe)},$$slots:{default:!0}})}},$$slots:{content:!0,default:!0}})};D(F,L=>{n().total>0&&L(T)})}return u(r,B),jt(R)}function Il(r,t){if(new.target)return Bt({component:Il,...r});Ht(t,!0);let n=y(t,"items",7),a=y(t,"ariaLabel",7),s=y(t,"open",15,!1),o=y(t,"orientation",7,"vertical"),c=y(t,"selection",7),l=y(t,"class",7,"");const f=d(()=>Pg(n(),c(),a()));var i={get items(){return n()},set items(p){n(p),_()},get ariaLabel(){return a()},set ariaLabel(p){a(p),_()},get open(){return s()},set open(p=!1){s(p),_()},get orientation(){return o()},set orientation(p="vertical"){o(p),_()},get selection(){return c()},set selection(p){c(p),_()},get class(){return l()},set class(p=""){l(p),_()},$set:Ft,$on:(p,g)=>zt(t,p,g)};return Jm(r,{get actions(){return e(f)},align:"end",get ariaLabel(){return a()},onAction:g=>Eg(n(),g)?.onClick(),get open(){return s()},set open(g){s(g)},trigger:(g,O)=>{let b=()=>(O?.()).props;yt(g,el(b,{variant:"plain",size:"icon-compact",iconOnly:!0,type:"button",get class(){return l()},get"aria-label"(){return a()},onclick:h=>{h.stopPropagation(),b().onclick?.(h)},oncontextmenu:h=>{h.preventDefault(),h.stopPropagation()},children:(h,P)=>{Ym(h,{get orientation(){return o()},class:"size-3.5"})},$$slots:{default:!0}}))},$$slots:{trigger:!0}}),jt(i)}var Ck=I('<span class="contents"><!></span>'),Ek=I("<!> <!>",1);function mf(r,t){if(new.target)return Bt({component:mf,...r});Ht(t,!0);let n=y(t,"workspaceId",7),a=y(t,"slot",7);const s=d(()=>iv(a()));let o=ye(null);wt(()=>{e(o)&&e(o).workspaceId!==n()&&A(o,null)});function c(h){const P=Ad(h);P&&A(o,{...P,workspaceId:n()},!0)}function l(h){h.preventDefault(),h.stopPropagation();const P=h.currentTarget.getBoundingClientRect();A(o,{x:P.left,y:P.bottom+2,returnFocus:h.currentTarget,workspaceId:n()},!0)}function f(){A(o,null)}var i={get workspaceId(){return n()},set workspaceId(h){n(h),_()},get slot(){return a()},set slot(h){a(h),_()},$set:Ft,$on:(h,P)=>zt(t,h,P)},p=Ek(),g=je(p);{let h=d(()=>v.workspace_microKeyBadge_ariaLabel({number:nr(a()+1)})),P=d(()=>v.workspace_microKeyBadge_tooltip({number:nr(a()+1)})),R=d(()=>e(o)!==null);yt(g,{variant:"ghost",size:"icon",type:"button",class:"micro-key-slot-badge size-4 min-w-0 shrink-0 cursor-pointer rounded-[3px] p-0 a11y-ignore",get"aria-label"(){return e(h)},get title(){return e(P)},onclick:l,oncontextmenu:c,onkeydown:c,"aria-haspopup":"menu",get"aria-expanded"(){return e(R)},children:(B,F)=>{var T=Ck(),L=S(T);og(L,{get slot(){return a()},get class(){return`transition-colors ${e(s)??""}`}}),w(T),u(B,T)},$$slots:{default:!0}})}var O=m(g,2);{var b=h=>{{let P=d(()=>e(o)?.x??0),R=d(()=>e(o)?.y??0),B=d(()=>e(o)?.returnFocus),F=d(()=>v.workspace_card_assignMicroKey_label()),T=d(()=>eb(n(),f));Td(h,{get x(){return e(P)},get y(){return e(R)},get returnFocus(){return e(B)},selection:"single",get ariaLabel(){return e(F)},get items(){return e(T)},onClickOutside:f})}};D(O,h=>{e(o)&&h(b)})}return u(r,p),jt(i)}var Pk=I('<span class="flex size-4 shrink-0 items-center justify-center"><!></span>'),Ak=I('<span data-workspace-card-pin-indicator="" aria-hidden="true"><!></span> <span class="sr-only"> </span>',1),Tk=I('<span class="type-caption shrink-0 rounded-sm bg-muted-foreground/10 px-1.5 font-normal text-muted-foreground" data-workspace-card-trailing-label=""> </span>'),Rk=I('<span data-workspace-card-pr-item=""><!></span>'),Mk=I('<span class="flex shrink-0 items-center" data-workspace-card-pr-list=""><!></span>'),Nk=I('<span data-workspace-card-time=""><!></span>'),Lk=I('<span aria-hidden="true"><!></span>'),Ok=I("<div><!> <!> <!> <!></div>"),Dk=I('<div data-workspace-card-hover-surface=""><!></div>'),Bk=I('<div role="group" data-workspace-card-row=""><!> <div class="relative z-10 flex shrink-0 items-center gap-1.5"><!> <!> <span class="sr-only"> </span></div> <div class="relative z-10 flex min-w-0 flex-1 items-center gap-2"><span class="flex min-w-0 flex-1 items-center gap-1" data-workspace-card-title-group=""><span dir="ltr" data-workspace-card-title=""><span class="wc-title-text svelte-1ct56pd"> </span></span> <!></span> <!> <!> <!></div> <!></div> <!> <!>',1),Fk=I('<div class="relative z-10 flex shrink-0 items-center"><!></div>'),zk=I('<div><!> <!> <span class="font-medium truncate"> </span> <span class="shrink-0 text-muted-foreground">·</span> <span class="truncate text-xs text-muted-foreground"> </span> <!></div>'),Hk=I('<div class="text-sm font-semibold truncate"> </div>'),fd=I('<span class="truncate"> </span>'),jk=I('<span class="text-muted-foreground">·</span>'),Wk=I('<div class="flex items-center gap-1 truncate text-xs text-muted-foreground"><!> <!> <!></div>'),Uk=I('<div><!> <!> <div class="flex items-center gap-2 text-xs"><!> <span class="truncate text-muted-foreground"> </span> <span> </span></div> <!></div>'),qk=I('<div class="flex items-center gap-2"><!> <span class="text-ui shrink-0 tabular-nums text-muted-foreground"> </span></div>'),Vk=I('<div class="flex items-center justify-between text-ui"><span class="text-muted-foreground"> </span> <span class="tabular-nums"><span class="text-success"> </span> <span class="ml-1 text-danger"> </span></span></div>'),Kk=I('<div class="flex items-center justify-between text-ui"><span class="text-muted-foreground"> </span></div>'),Gk=I('<div class="flex items-center text-ui"><span> </span></div>'),Jk=I('<div class="flex flex-col gap-1 px-3 pb-2.5"><!> <!> <!> <!></div>'),Yk=I('<div class="relative z-10 flex items-center gap-1.5 px-2 pb-2"><!></div>'),Xk=I('<div class="relative z-10 flex items-center gap-1.5 px-2 pb-2"><!> <!></div>'),Zk=I('<div role="group"><!> <div class="flex items-start gap-2.5 px-3 pt-3 pb-2"><!> <div class="flex-1 min-w-0"><div class="text-sm font-medium"> </div> <div class="mt-0.5 line-clamp-2 text-xs leading-snug text-muted-foreground"> </div></div></div> <!> <!></div>');function hf(r,t){if(new.target)return Bt({component:hf,...r});Ht(t,!0);const n=()=>bt(Be,"$prMonitors$",c),a=()=>bt(Xe,"$microConnected$",c),s=()=>bt(Z,"$hidesOwnerActions$",c),o=()=>bt(ae,"$workspaceKeySlot$",c),[c,l]=ga();let f=y(t,"workspace",7),i=y(t,"phase",7),p=y(t,"stats",7),g=y(t,"variant",7,"compact"),O=y(t,"showTime",7,!0),b=y(t,"isRunning",7,!1),h=y(t,"isUnread",7,!1),P=y(t,"isWaiting",7),R=y(t,"isPinned",7,!1),B=y(t,"streamingAgentIds",23,()=>[]),F=y(t,"hasSpec",7,!1),T=y(t,"isAgentRunning",7,!1),L=y(t,"agentDigest",7),U=y(t,"trailingLabel",7),E=y(t,"title",7),z=y(t,"repoName",7),J=y(t,"branch",7),Y=y(t,"onClick",7),Q=y(t,"onAction",7),Ie=y(t,"onTogglePin",7),le=y(t,"onMarkAsRead",7),fe=y(t,"onOpenInNewWindow",7),ce=y(t,"onHover",7),Le=y(t,"highlighted",7,!1),G=y(t,"selected",7,!1),we=y(t,"highlightId",7),$=y(t,"suppressHover",7,!1),We=y(t,"isolateHoverReveal",7,!1),Ee=y(t,"class",7),Se=y(t,"actions",7);const ke=Is("");wt(()=>{ke.set(f()?.id??"")});const Be=Gp(ke),Xe=gb(),ae=Fv(ke),Z=Jp(ke),Je=d(()=>rb(f()??{})),K=d(()=>nb(e(Je)));let V=d(()=>f()?pb.url.pathname===`/workspace/${f().id}`:!1),W=d(()=>f()?`workspace-hover-card-${f().id}`:void 0),ie=ye(!1),ge=ye(null),X=ye(null);wt(()=>{if(!e(X))return;const te=vo(e(X),{id:we()});return()=>te.destroy()});let de=ye(null),Ne=ye(null),Ce=ye(null),rt=ye(0),me=ye(0),Re=d(()=>e(rt)+(e(me)>0?e(me)+4:0));function q(){const te=e(de),pt=e(Ce);A(rt,te?Math.max(0,te.scrollWidth-te.clientWidth):0,!0),A(me,te&&pt&&pt.getClientRects().length>0?Math.max(0,te.getBoundingClientRect().right-pt.getBoundingClientRect().left):0,!0)}wt(()=>{const te=e(de),pt=e(Ne),qt=e(Ce);if(!te||!pt||(q(),typeof ResizeObserver>"u"))return;const Jt=new ResizeObserver(q);return Jt.observe(te),Jt.observe(pt),qt&&Jt.observe(qt),()=>Jt.disconnect()});let Pe=null,ue=null,N=!1,H=!1,pe=!1,Qe=!1,Te=!1,Fe=!1,et=ye(!1),se=!1,ze=null,nt=ye(null),dt=null,Ke;function tt(){Pe!==null&&(clearTimeout(Pe),Pe=null)}function st(){ue!==null&&(clearTimeout(ue),ue=null),dt?.(),dt=null}function vt(){st(),A(et,!0),A(ie,!0),!Te&&(Te=!0,js.notifyOpened())}function _t(){st(),clearTimeout(Ke),A(et,!1),A(ie,!1),H=!1,Qe=!1,Te&&(Te=!1,js.notifyClosed())}function Ot(){return N||H||pe||Qe}function Dt(){if(!e(ie)){_t();return}st(),ue=setTimeout(()=>{ue=null,Ot()||_t()},sb),dt=js.deferClose(_t)}function Yt(){H=!0,st()}function Et(){H=!1,!pe&&!Qe&&Dt()}function Wt(){Qe=!0,clearTimeout(Ke),st()}function Qt(te){const pt=te.relatedTarget instanceof Node?te.relatedTarget:null;if(pt&&ve()?.contains(pt)||(Qe=!1,pt&&e(ge)?.contains(pt)))return;if(pt){!N&&!H&&_t();return}const qt=te.target;clearTimeout(Ke),Ke=setTimeout(()=>{const Jt=document.activeElement,_r=ve()?.contains(Jt)||e(ge)?.contains(Jt);Jt&&Jt!==qt&&_r||!N&&!H&&_t()},0)}function lr(){ze!==null&&clearTimeout(ze),se=!0,ze=setTimeout(()=>{se=!1,ze=null},0)}function Mt(te){const pt=te.target,qt=ve();pt instanceof Node&&qt?.contains(pt)||te.type==="scroll"&&e(ge)&&pt instanceof Node&&!pt.contains(e(ge))||(te.type==="pointerdown"&&lr(),tt(),_t())}wt(()=>{if(e(et))return window.addEventListener("pointerdown",Mt,!0),window.addEventListener("scroll",Mt,!0),()=>{window.removeEventListener("pointerdown",Mt,!0),window.removeEventListener("scroll",Mt,!0)}});function St(te){if(te.key!=="Escape")return;const pt=te.target;pt instanceof Node&&ve()?.contains(pt)||(te.preventDefault(),te.stopPropagation(),Fe=pe,tt(),_t())}wt(()=>{if(e(ie))return window.addEventListener("keydown",St,!0),()=>window.removeEventListener("keydown",St,!0)});const _e=d(()=>f()?Xp.select(Nt.state,f().id):null),ee=d(()=>e(_e)?e(_e):f()?.activePullRequest?f().activePullRequest:!f()?.prStatus||f().prNumber==null?null:{id:`legacy-pr-${f().prNumber}`,number:f().prNumber,url:f().prUrl??"",title:v.workspace_hoverCard_pullRequest_label(),status:f().prStatus,createdAt:f().updatedAt,updatedAt:f().updatedAt}),Ue=d(()=>Yp(f())),at=d(()=>{if(!f()||e(Ue))return[];const te=f(),pt=te.repositoryOwner&&te.repositoryName?`${te.repositoryOwner}/${te.repositoryName}`:void 0;return Ag({workspacePRs:te.pullRequests,activePR:e(ee),monitors:n(),workspaceRepo:pt,buildPrUrl:(qt,Jt)=>Pm(qt,te.repositoryOwner,te.repositoryName,Jt),getDisplayTitle:qt=>qt.title})}),ot=d(()=>e(at)[0]);function De(te){const pt=te.resource?.repository.provider==="gitlab"?`${te.repo} !${te.number}`:te.repo?v.workspace_card_prBadge_repoLine_tooltip({repo:te.repo,number:te.number}):v.workspace_card_prBadge_label({number:` #${te.number}`});return[Zp(pt,te),te.title,te.details].filter(Boolean).join(`
|
|
262
262
|
`)}function oe(te){te.key==="Enter"&&Y()?.(te)}function ve(){return e(W)?document.getElementById(e(W)):null}function ne(){return Array.from(ve()?.querySelectorAll("button:not(:disabled), a[href]")??[])}function Me(){const te=e(ge)?.querySelector("[data-workspace-card-trigger]"),pt=ve();if(!te||!pt)return null;const qt=Array.from(document.querySelectorAll('button:not(:disabled), a[href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])')).filter(_r=>_r.tabIndex>=0&&!pt.contains(_r)),Jt=qt.indexOf(te);return Jt>=0?qt[Jt+1]:null}function he(te){Fe=!!e(ge)?.contains(te),_t(),te.focus({preventScroll:!0})}function He(){const te=e(ge)?.querySelector("[data-workspace-card-trigger]");te&&he(te)}async function Ve(te){if(te.key==="Escape"&&e(ie)){te.preventDefault(),te.stopPropagation(),_t();return}te.key!=="ArrowDown"||$()||!f()||(te.preventDefault(),te.stopPropagation(),A(et,!0),A(ie,!0),await ca(),ne()[0]?.focus({preventScroll:!0}))}function qe(te){const pt=ne(),qt=te.key==="Tab"&&te.shiftKey&&te.currentTarget===pt[0],_r=te.key==="Tab"&&!te.shiftKey&&te.currentTarget===pt.at(-1)?Me():null;te.key!=="Escape"&&!qt&&!_r||(te.preventDefault(),te.stopPropagation(),_r?he(_r):He())}function $e(){N=!0,st(),js.settleDeferredCloses(),q(),ce()?.(),f()&&!$()&&!pe&&(tt(),A(et,!0),Pe=setTimeout(()=>{Pe=null,vt()},js.currentOpenDelay))}function Oe(){N=!1,tt(),!pe&&!Qe&&Dt()}function Ye(){pe=!0,tt(),st(),!Fe&&(se||f()&&!$()&&(A(et,!0),A(ie,!0)))}function xe(te){const pt=te.relatedTarget instanceof Node?te.relatedTarget:null;pt&&e(ge)?.contains(pt)||(Fe=!1,pe=!1,!(pt&&ve()?.contains(pt))&&!N&&!H&&_t())}wt(()=>{$()&&(tt(),st(),_t())});let Ze=ye(null),ft=ye(!1),ct;wt(()=>{const te=f()?.id;ct!==te&&(ct=te,A(ft,!1)),e(Ze)&&e(Ze).workspaceId!==f()?.id&&Ct()});function it(te){if(!f())return;const pt=Ad(te);if(pt){if(A(ft,!1),mt().length===0){A(Ze,null);return}A(Ze,{...pt,returnFocus:te.target instanceof HTMLElement?te.target.closest("button")??e(ge)?.querySelector("button")??null:null,workspaceId:f().id},!0)}}function Ct(){A(Ze,null),A(ft,!1)}wt(()=>{e(ft)&&A(Ze,null)}),eo(()=>{tt(),st(),ze!==null&&(clearTimeout(ze),ze=null),_t()});function mt(){if(!f())return[];const te=[];return fe()&&te.push({id:"open-new-window",label:v.workspace_card_openNewWindow_label(),icon:Dd,onClick:()=>{fe()?.(),Ct()}}),te.push(...ab(f().id,{connected:a(),onClose:Ct})),s()||(e(Ue)||te.push({id:"transfer",label:v.workspace_card_transfer_label(),icon:Xg,onClick:()=>{Nt.dispatch(xv({workspaceId:f().id,workspaceTitle:f().title})),Ct()}}),te.push({id:"archive",label:v.workspace_card_archive_label(),icon:Bd,onClick:()=>{Nt.dispatch(Yd(f().id)),Ct()}}),te.push({id:"delete",label:v.workspace_card_deleteSpace_label(),icon:Fd,destructive:!0,onClick:()=>{Nt.dispatch(Xd(f().id)),Ct()}})),te}let Lt=d(()=>T()&&L()?L():i()?.subtitle??""),Kt=d(()=>p()&&p().tasks.total>0?p().tasks.completed/p().tasks.total:0),Zt=d(()=>!!p()&&(p().tasks.total>0||p().files.changed>0||p().commits.total>0||p().pr.hasOpen||p().pr.hasMerged)),cr=d(()=>e(Ue)?void 0:J()),Hr=d(()=>!p()||e(Ue)?"":p().pr.hasMerged?v.workspace_card_prMerged_label({number:p().pr.number??""}):p().pr.hasOpen?v.workspace_card_prOpen_label({number:p().pr.number?`#${p().pr.number}`:""}):""),ln=d(()=>i()?.phase==="planning"?T()?{primary:{label:v.workspace_card_showCoordinator_label(),action:"show-coordinator"},secondary:{label:v.workspace_card_pause_label(),action:"pause"}}:F()||(p()?.tasks.total??0)>0?{primary:{label:v.workspace_card_approveStart_label(),action:"approve"},secondary:{label:v.workspace_card_viewSpec_label(),action:"view-spec"}}:{primary:{label:v.workspace_card_showCoordinator_label(),action:"show-coordinator"},secondary:{label:v.workspace_card_viewSpec_label(),action:"view-spec"}}:i()?.phase==="building"?{primary:{label:v.workspace_card_showCoordinator_label(),action:"show-coordinator"},secondary:{label:v.workspace_card_pause_label(),action:"pause"}}:i()?.phase==="reviewing"?{primary:{label:v.workspace_card_createPr_label(),action:"create-pr"},secondary:{label:v.workspace_card_showChanges_label(),action:"show-changes"}}:{primary:{label:v.workspace_card_archive_label(),action:"archive"},secondary:{label:v.workspace_card_showChanges_label(),action:"show-changes"}});const $r={planning:"bg-muted/20 text-muted-foreground",building:"bg-info/15 text-info",reviewing:"bg-primary/15 text-primary",shipped:"bg-foreground/10 text-foreground"};var mr={get workspace(){return f()},set workspace(te){f(te),_()},get phase(){return i()},set phase(te){i(te),_()},get stats(){return p()},set stats(te){p(te),_()},get variant(){return g()},set variant(te="compact"){g(te),_()},get showTime(){return O()},set showTime(te=!0){O(te),_()},get isRunning(){return b()},set isRunning(te=!1){b(te),_()},get isUnread(){return h()},set isUnread(te=!1){h(te),_()},get isWaiting(){return P()},set isWaiting(te){P(te),_()},get isPinned(){return R()},set isPinned(te=!1){R(te),_()},get streamingAgentIds(){return B()},set streamingAgentIds(te=[]){B(te),_()},get hasSpec(){return F()},set hasSpec(te=!1){F(te),_()},get isAgentRunning(){return T()},set isAgentRunning(te=!1){T(te),_()},get agentDigest(){return L()},set agentDigest(te){L(te),_()},get trailingLabel(){return U()},set trailingLabel(te){U(te),_()},get title(){return E()},set title(te){E(te),_()},get repoName(){return z()},set repoName(te){z(te),_()},get branch(){return J()},set branch(te){J(te),_()},get onClick(){return Y()},set onClick(te){Y(te),_()},get onAction(){return Q()},set onAction(te){Q(te),_()},get onTogglePin(){return Ie()},set onTogglePin(te){Ie(te),_()},get onMarkAsRead(){return le()},set onMarkAsRead(te){le(te),_()},get onOpenInNewWindow(){return fe()},set onOpenInNewWindow(te){fe(te),_()},get onHover(){return ce()},set onHover(te){ce(te),_()},get highlighted(){return Le()},set highlighted(te=!1){Le(te),_()},get selected(){return G()},set selected(te=!1){G(te),_()},get highlightId(){return we()},set highlightId(te){we(te),_()},get suppressHover(){return $()},set suppressHover(te=!1){$(te),_()},get isolateHoverReveal(){return We()},set isolateHoverReveal(te=!1){We(te),_()},get class(){return Ee()},set class(te){Ee(te),_()},get actions(){return Se()},set actions(te){Se(te),_()},$set:Ft,$on:(te,pt)=>zt(t,te,pt)},qn=kt(),ea=je(qn);{var Vn=te=>{var pt=Bk(),qt=je(pt);let Jt;var _r=S(qt);{let ht=d(()=>f().title||v.workspace_links_untitled_label()),Pt=d(()=>`workspace-status-state-${f().id}${R()?` workspace-pinned-state-${f().id}`:""}${e(ie)?` ${e(W)}`:""}`),ar=d(()=>e(V)?"page":void 0);yt(_r,{variant:"plain",class:"absolute inset-0 z-0 h-auto w-auto rounded-md focus-visible:border-transparent focus-visible:bg-background/50 focus-visible:ring-0",get"aria-label"(){return e(ht)},get"aria-describedby"(){return e(Pt)},get"aria-current"(){return e(ar)},"data-workspace-card-trigger":!0,onkeydown:Ve,onclick:hr=>{hr.stopPropagation(),Y()?.(hr)}})}var Kn=m(_r,2),Jr=S(Kn);{var Gn=ht=>{var Pt=Pk(),ar=S(Pt);{var hr=wr=>{mf(wr,{get workspaceId(){return f().id},get slot(){return o()}})};D(ar,wr=>{o()!==null&&wr(hr)})}w(Pt),u(ht,Pt)};D(Jr,ht=>{a()&&ht(Gn)})}var fn=m(Jr,2);Ci(fn,{get content(){return e(K).tooltip},side:"bottom",sideOffset:4,children:(ht,Pt)=>{tb(ht,{get status(){return e(Je)},size:14,decorative:!0,class:"justify-start"})},$$slots:{default:!0}});var Jn=m(fn,2),ta=M(Jn,!0);w(Kn);var jr=m(Kn,2),en=S(jr),rr=S(en),Wr=S(rr),pn=M(Wr,!0);pr(Wr,ht=>A(Ne,ht),()=>e(Ne)),w(rr),pr(rr,ht=>A(de,ht),()=>e(de));var xr=m(rr,2);{var Or=ht=>{var Pt=Ak(),ar=je(Pt),hr=S(ar);At(hr,{get icon(){return Vl},size:"xs"}),w(ar);var wr=m(ar,2),Dr=M(wr,!0);k(yn=>{gt(ar,1,`wc-pin-indicator inline-flex shrink-0 items-center text-muted-foreground transition-opacity
|
|
263
|
-
${Ie()?Le()?"opacity-0":$()?"":We()?"group-hover/wc:opacity-0 group-focus-within/wc:opacity-0":"group-hover:opacity-0 group-focus-within:opacity-0":""}`,"svelte-1ct56pd"),re(wr,"id",`workspace-pinned-state-${f().id??""}`),x(Dr,yn)},[()=>v.layout_activeCard_pinned_header()]),u(ht,Pt)};D(xr,ht=>{R()&&ht(Or)})}w(en);var gn=m(en,2);{var va=ht=>{var Pt=Tk(),ar=M(Pt,!0);k(()=>x(ar,U())),u(ht,Pt)};D(gn,ht=>{U()&&ht(va)})}var tn=m(gn,2);{var Yr=ht=>{const Pt=d(()=>e(ot));var ar=Mk(),hr=S(ar);{let wr=d(()=>De(e(Pt)));Ci(hr,{get content(){return e(wr)},side:"bottom",sideOffset:4,children:(Dr,yn)=>{var ra=kt(),Dn=je(ra);{var Cr=cn=>{{let Er=d(()=>De(e(Pt)));yt(cn,{variant:"plain",size:"icon-compact",iconOnly:!0,get class(){return`size-5 shrink-0 rounded-sm ${e(Pt).foregroundClass??""}`},get"aria-label"(){return e(Er)},"data-workspace-card-pr-item":!0,get"data-pr-identity"(){return e(Pt).identity},get"data-pr-status"(){return e(Pt).status},onclick:nn=>{nn.stopPropagation();const Ta=f().id;Ip(async()=>{const{handleLink:Yn}=await import("./
|
|
263
|
+
${Ie()?Le()?"opacity-0":$()?"":We()?"group-hover/wc:opacity-0 group-focus-within/wc:opacity-0":"group-hover:opacity-0 group-focus-within:opacity-0":""}`,"svelte-1ct56pd"),re(wr,"id",`workspace-pinned-state-${f().id??""}`),x(Dr,yn)},[()=>v.layout_activeCard_pinned_header()]),u(ht,Pt)};D(xr,ht=>{R()&&ht(Or)})}w(en);var gn=m(en,2);{var va=ht=>{var Pt=Tk(),ar=M(Pt,!0);k(()=>x(ar,U())),u(ht,Pt)};D(gn,ht=>{U()&&ht(va)})}var tn=m(gn,2);{var Yr=ht=>{const Pt=d(()=>e(ot));var ar=Mk(),hr=S(ar);{let wr=d(()=>De(e(Pt)));Ci(hr,{get content(){return e(wr)},side:"bottom",sideOffset:4,children:(Dr,yn)=>{var ra=kt(),Dn=je(ra);{var Cr=cn=>{{let Er=d(()=>De(e(Pt)));yt(cn,{variant:"plain",size:"icon-compact",iconOnly:!0,get class(){return`size-5 shrink-0 rounded-sm ${e(Pt).foregroundClass??""}`},get"aria-label"(){return e(Er)},"data-workspace-card-pr-item":!0,get"data-pr-identity"(){return e(Pt).identity},get"data-pr-status"(){return e(Pt).status},onclick:nn=>{nn.stopPropagation();const Ta=f().id;Ip(async()=>{const{handleLink:Yn}=await import("./CVGihEeT.js").then(vn=>vn.H);return{handleLink:Yn}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65]),import.meta.url).then(({handleLink:Yn})=>Yn(e(Pt).url,{workspaceId:Ta,event:nn}))},children:(nn,Ta)=>{At(nn,{get icon(){return e(Pt).statusIcon},size:14})},$$slots:{default:!0}})}},Cn=cn=>{var Er=Rk(),nn=S(Er);At(nn,{get icon(){return e(Pt).statusIcon},size:14}),w(Er),k(Ta=>{gt(Er,1,`inline-flex size-5 shrink-0 items-center justify-center rounded-sm ${e(Pt).foregroundClass??""}`,"svelte-1ct56pd"),re(Er,"aria-label",Ta),re(Er,"data-pr-identity",e(Pt).identity),re(Er,"data-pr-status",e(Pt).status)},[()=>De(e(Pt))]),u(cn,Er)};D(Dn,cn=>{e(Pt).url?cn(Cr):cn(Cn,-1)})}u(Dr,ra)},$$slots:{default:!0}})}w(ar),k(wr=>re(ar,"aria-label",wr),[()=>e(Pt).resource?.repository.provider==="gitlab"?v.workspace_hoverCard_mergeRequest_label():v.workspace_hoverCard_pullRequest_label()]),u(ht,ar)};D(tn,ht=>{e(ot)&&ht(Yr)})}var Mr=m(tn,2);{var xa=ht=>{var Pt=Nk(),ar=S(Pt);{var hr=Dr=>{{let yn=d(()=>Zl(f()));ig(Dr,{get date(){return e(yn)},class:"type-caption whitespace-nowrap tabular-nums text-muted-foreground",compact:!0})}},wr=d(()=>Zl(f())>0);D(ar,Dr=>{e(wr)&&Dr(hr)})}w(Pt),k(()=>gt(Pt,1,`wc-secondary shrink-0 ${Se()||Ie()||h()&&le()?Le()?"opacity-0":$()?"":We()?"group-hover/wc:opacity-0 group-hover/message:opacity-0":"group-hover:opacity-0 group-hover/message:opacity-0":""}`,"svelte-1ct56pd")),u(ht,Pt)};D(Mr,ht=>{O()&&ht(xa)})}w(jr);var rs=m(jr,2);{var ns=ht=>{var Pt=Ok(),ar=S(Pt);{var hr=Cr=>{{let Cn=d(()=>R()?"text-primary-ink":"text-muted-foreground"),cn=d(()=>R()?v.workspace_card_unpin_ariaLabel():v.workspace_card_pin_ariaLabel()),Er=d(()=>R()?v.workspace_card_unpin_tooltip():v.workspace_card_pin_tooltip());yt(Cr,{variant:"plain",size:"icon-xs",iconOnly:!0,get class(){return`transition-all hover:bg-muted/50 hover:text-foreground focus-visible:border-transparent focus-visible:bg-muted/50 focus-visible:text-foreground focus-visible:ring-0
|
|
264
264
|
${e(Cn)??""}`},onclick:nn=>{nn.stopPropagation(),Ie()?.(nn)},get"aria-label"(){return e(cn)},get title(){return e(Er)},children:(nn,Ta)=>{var Yn=Lk(),vn=S(Yn);At(vn,{get icon(){return Vl},size:"xs"}),w(Yn),u(nn,Yn)},$$slots:{default:!0}})}};D(ar,Cr=>{Ie()&&Cr(hr)})}var wr=m(ar,2);{var Dr=Cr=>{{let Cn=d(()=>v.workspace_card_markAsRead_label()),cn=d(()=>v.workspace_card_markAsRead_label());yt(Cr,{variant:"plain",size:"icon-xs",iconOnly:!0,class:"text-muted-foreground hover:bg-muted/50 hover:text-foreground focus-visible:border-transparent focus-visible:bg-muted/50 focus-visible:text-foreground focus-visible:ring-0",onclick:Er=>{Er.stopPropagation(),le()?.(Er)},get"aria-label"(){return e(Cn)},get title(){return e(cn)},children:(Er,nn)=>{At(Er,{get icon(){return zd},size:"xs"})},$$slots:{default:!0}})}};D(wr,Cr=>{h()&&le()&&Cr(Dr)})}var yn=m(wr,2);un(yn,()=>Se()??So);var ra=m(yn,2);{var Dn=Cr=>{{let Cn=d(mt),cn=d(()=>v.workspace_progressCard_actions_ariaLabel());Il(Cr,{get items(){return e(Cn)},get ariaLabel(){return e(cn)},class:"flex size-5 cursor-pointer items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground focus-visible:bg-muted/50 focus-visible:text-foreground focus-visible:outline-none",get open(){return e(ft)},set open(Er){A(ft,Er,!0)}})}};D(ra,Cr=>{fe()&&Cr(Dn)})}w(Pt),pr(Pt,Cr=>A(Ce,Cr),()=>e(Ce)),k(()=>gt(Pt,1,`wc-actions absolute right-1 top-1/2 z-20 flex -translate-y-1/2 items-center gap-0.5 rounded-md bg-accent/95 px-0.5 focus-within:opacity-100
|
|
265
265
|
${We()?"group-focus-within/wc:opacity-100":"group-focus-within:opacity-100"}
|
|
266
266
|
${Le()?"opacity-100":$()?"opacity-0":We()?"opacity-0 group-hover/wc:opacity-100":"opacity-0 group-hover:opacity-100"}`,"svelte-1ct56pd")),u(ht,Pt)};D(rs,ht=>{(Se()||fe()||Ie()||h()&&le())&&ht(ns)})}w(qt),pr(qt,ht=>A(ge,ht),()=>e(ge)),Un(qt,(ht,Pt)=>vo?.(ht,Pt),()=>({id:we()}));var Xr=m(qt,2);{var rn=ht=>{ob(ht,{get id(){return e(W)},get anchor(){return`--workspace-list-${f().id??""}`},position:"right",get anchorElement(){return e(ge)},class:"w-auto overflow-visible! rounded-lg border-0! bg-background! shadow-none!",onmouseenter:Yt,onmouseleave:Et,onfocusin:Wt,onfocusout:Qt,children:(Pt,ar)=>{var hr=Dk(),wr=S(hr);ib(wr,{get workspace(){return f()},get activeAgentIds(){return B()},onkeydown:qe}),w(hr),pr(hr,Dr=>A(nt,Dr),()=>e(nt)),Rn("pointerenter",hr,Yt),Rn("pointerleave",hr,Et),Rr("focusin",hr,Wt),Rr("focusout",hr,Qt),u(Pt,hr)},$$slots:{default:!0}})};D(Xr,ht=>{e(ie)&&!$()&&ht(rn)})}var On=m(Xr,2);{var kr=ht=>{const Pt=d(mt);var ar=kt(),hr=je(ar);{var wr=Dr=>{{let yn=d(()=>e(Ze)?.x??0),ra=d(()=>e(Ze)?.y??0),Dn=d(()=>e(Ze)?.returnFocus),Cr=d(()=>v.workspace_progressCard_actions_ariaLabel());Td(Dr,{get x(){return e(yn)},get y(){return e(ra)},get returnFocus(){return e(Dn)},get ariaLabel(){return e(Cr)},get items(){return e(Pt)},onClickOutside:Ct})}};D(hr,Dr=>{e(Pt).length>0&&Dr(wr)})}u(ht,ar)};D(On,ht=>{e(Ze)&&ht(kr)})}k((ht,Pt,ar)=>{gt(qt,1,ht,"svelte-1ct56pd"),re(qt,"data-pinned",R()),re(qt,"data-highlight-id",we()),Jt=Nn(qt,"",Jt,{"anchor-name":`--workspace-list-${f().id??""}`}),re(Jn,"id",`workspace-status-state-${f().id??""}`),x(ta,e(K).accessibleName),gt(rr,1,`wc-title type-body min-w-0 truncate font-normal!
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as p,r as u,d as n}from"./
|
|
1
|
+
import{g as p,r as u,d as n}from"./BRvExEEH.js";import{p as f}from"./Bfo8_CU3.js";import{b as a,ay as o}from"./0__pctoR.js";import{M as c,c as d}from"./2gme4FSl.js";var v=d().RailroadAbnf.parser.LangiumParser,i=a(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=a(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=a(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=a(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=a(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=a(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=a(e=>{f(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(P(r)))},"populateDb"),R={parse:a(e=>{n.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:n}},w={parser:R,db:n,renderer:u,styles:p};export{w as diagram};
|