@intent-hq/web 2.392.0 → 2.392.2
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/{i2kR60wc.js → 1_KO_ip3.js} +2 -2
- package/web/app/immutable/chunks/{Qvf67TfJ.js → 6_Ki4zfU.js} +1 -1
- package/web/app/immutable/chunks/{DfyDNbbj.js → 8zgEfd8p.js} +4 -4
- package/web/app/immutable/chunks/{B469nFvV.js → B0S6NxMp.js} +2 -2
- package/web/app/immutable/chunks/{BbK9qDRy.js → B0plrICi.js} +1 -1
- package/web/app/immutable/chunks/{B_DmwFyf.js → B0uzI9A2.js} +3 -3
- package/web/app/immutable/chunks/{CB8FMdnB.js → B1KwWsSa.js} +2 -2
- package/web/app/immutable/chunks/{B_4oJZFT.js → B3z7A_dN.js} +1 -1
- package/web/app/immutable/chunks/{D7VoSTzK.js → B6vwIjYj.js} +1 -1
- package/web/app/immutable/chunks/{DnNE_pmq.js → BBNkFJWF.js} +1 -1
- package/web/app/immutable/chunks/{CqPoxrPz.js → BC5ygYt_.js} +1 -1
- package/web/app/immutable/chunks/{B8pX1T5t.js → BI5Znnvl.js} +1 -1
- package/web/app/immutable/chunks/{7BHYBi88.js → BIBzuMxT.js} +1 -1
- package/web/app/immutable/chunks/{C-BJXKy-.js → BM-e4VeL.js} +1 -1
- package/web/app/immutable/chunks/{mpTxy2jJ.js → BNEmqkUA.js} +1 -1
- package/web/app/immutable/chunks/{m8Q2Rt7R.js → BNSALBsz.js} +2 -2
- package/web/app/immutable/chunks/{CV86ty5-.js → BV3fep4W.js} +1 -1
- package/web/app/immutable/chunks/{DzNzbnYA.js → BVEvAi2Z.js} +1 -1
- package/web/app/immutable/chunks/{BK5l06W2.js → BWtzEUuh.js} +1 -1
- package/web/app/immutable/chunks/{BKxcGjV6.js → BYanH6N9.js} +1 -1
- package/web/app/immutable/chunks/{C7q_UkFQ.js → BaHkhxpe.js} +1 -1
- package/web/app/immutable/chunks/{BRPh2Gky.js → BaKSWwQZ.js} +2 -2
- package/web/app/immutable/chunks/{C0JQvbI4.js → BbBEGYG_.js} +1 -1
- package/web/app/immutable/chunks/{1NvRJVY9.js → Bbz7-Oyr.js} +1 -1
- package/web/app/immutable/chunks/{BjPpzZjk.js → BcwRYKt7.js} +2 -2
- package/web/app/immutable/chunks/{R2QRct6h.js → BeO9oetE.js} +1 -1
- package/web/app/immutable/chunks/BeZe2Rt-.js +4 -0
- package/web/app/immutable/chunks/{CcijsN8m.js → BgThAg3r.js} +1 -1
- package/web/app/immutable/chunks/{D5A4PJDt.js → BheHEhKd.js} +1 -1
- package/web/app/immutable/chunks/{CVZzx9IJ.js → BnsvCrVF.js} +1 -1
- package/web/app/immutable/chunks/{BZnji9hP.js → Bosx7Vx3.js} +4 -4
- package/web/app/immutable/chunks/{BnGY4PVn.js → Bq1RCxZy.js} +1 -1
- package/web/app/immutable/chunks/{CDjbPb5H.js → Bshuzu80.js} +1 -1
- package/web/app/immutable/chunks/{Cv6grH4l.js → Bt2-MCLy.js} +1 -1
- package/web/app/immutable/chunks/{uPtH8pRz.js → Budj_98H.js} +1 -1
- package/web/app/immutable/chunks/{D8CQQUv8.js → Bvre4WDp.js} +1 -1
- package/web/app/immutable/chunks/{B77w2td3.js → BworT-hG.js} +1 -1
- package/web/app/immutable/chunks/{BqF1bVQC.js → C0vmnkBQ.js} +2 -2
- package/web/app/immutable/chunks/{Bk3dX2Ob.js → C4-ezAa_.js} +1 -1
- package/web/app/immutable/chunks/{Cb6ALa0V.js → C4TLfn6n.js} +1 -1
- package/web/app/immutable/chunks/{D7z6HEeo.js → C4pn-RG0.js} +1 -1
- package/web/app/immutable/chunks/{B6SGYvow.js → C5uq1gUG.js} +3 -3
- package/web/app/immutable/chunks/{8ljmIEEj.js → C6U5NTf5.js} +1 -1
- package/web/app/immutable/chunks/{B-mEBo1a.js → C7MxCYGe.js} +1 -1
- package/web/app/immutable/chunks/{mE5-Vs-0.js → C8EJQhtG.js} +1 -1
- package/web/app/immutable/chunks/{Bdh-SKNo.js → CBNc1G45.js} +1 -1
- package/web/app/immutable/chunks/{Fiwts6D3.js → CBttKL23.js} +1 -1
- package/web/app/immutable/chunks/{C-e2e9PC.js → CClkpbU_.js} +1 -1
- package/web/app/immutable/chunks/CDCAMh6o.js +1 -0
- package/web/app/immutable/chunks/{BkxevPaB.js → CEwjIkNX.js} +1 -1
- package/web/app/immutable/chunks/{DQ3EU1b-.js → CJD3ragP.js} +1 -1
- package/web/app/immutable/chunks/{DbSflHPQ.js → CKJ4i51B.js} +1 -1
- package/web/app/immutable/chunks/{Bs5b-3jJ.js → CNP0L-eb.js} +1 -1
- package/web/app/immutable/chunks/{B8RXlIBH.js → COdzefrH.js} +1 -1
- package/web/app/immutable/chunks/{DwJUGAx4.js → COziev1s.js} +3 -3
- package/web/app/immutable/chunks/{BmyNM7bS.js → CQzFriMx.js} +1 -1
- package/web/app/immutable/chunks/{D7rh8Clb.js → CRS_Gu5_.js} +1 -1
- package/web/app/immutable/chunks/{ggRB4LMK.js → CSd3ES0N.js} +1 -1
- package/web/app/immutable/chunks/{w3KJAO4V.js → CTS8A6ux.js} +1 -1
- package/web/app/immutable/chunks/{ynQC8xZQ.js → CU6Gap7x.js} +1 -1
- package/web/app/immutable/chunks/{qqJggbSF.js → CWtOXclJ.js} +1 -1
- package/web/app/immutable/chunks/{CPUJ3EYc.js → CYkK72cK.js} +1 -1
- package/web/app/immutable/chunks/{DwwEvwlj.js → C_GcujO5.js} +1 -1
- package/web/app/immutable/chunks/{DT_a2Oi3.js → C_YUZdUd.js} +1 -1
- package/web/app/immutable/chunks/{CQPid4Qr.js → CaeTGhTg.js} +1 -1
- package/web/app/immutable/chunks/{AVUhaNFO.js → CfTZUiDx.js} +1 -1
- package/web/app/immutable/chunks/{BNNeufNk.js → Cgot5oOf.js} +1 -1
- package/web/app/immutable/chunks/{xK5y1U34.js → Cgtlzlbv.js} +1 -1
- package/web/app/immutable/chunks/{Cx8Rw_sH.js → Chq1aw8Z.js} +3 -3
- package/web/app/immutable/chunks/{BLUGgUG-.js → Cim9mWY1.js} +1 -1
- package/web/app/immutable/chunks/{BPd-Q6x4.js → Cj1pm0MT.js} +1 -1
- package/web/app/immutable/chunks/{DqQWmhFJ.js → CkYbvS58.js} +1 -1
- package/web/app/immutable/chunks/{DtuubiMf.js → Cphslpp1.js} +1 -1
- package/web/app/immutable/chunks/{C3AR_gNB.js → CqrBJHEX.js} +1 -1
- package/web/app/immutable/chunks/{Bg5K6Ci3.js → Cvhr4SQ6.js} +1 -1
- package/web/app/immutable/chunks/{CtcGxSOx.js → CyrdNV-V.js} +1 -1
- package/web/app/immutable/chunks/{IHdKCjQM.js → D20BuQ34.js} +2 -2
- package/web/app/immutable/chunks/{CykElrvo.js → D3TJ4iaY.js} +2 -2
- package/web/app/immutable/chunks/{BJRZEnHw.js → D5areLL_.js} +1 -1
- package/web/app/immutable/chunks/{DQYwt0RJ.js → D8kaRNt1.js} +1 -1
- package/web/app/immutable/chunks/{BCwKGJpG.js → DBmrZ3Yk.js} +1 -1
- package/web/app/immutable/chunks/{wRT2cc73.js → DCWe1Cbq.js} +1 -1
- package/web/app/immutable/chunks/{DeLdUBWT.js → DDKN4vcf.js} +1 -1
- package/web/app/immutable/chunks/{BirGv2ci.js → DDjTC9Ng.js} +1 -1
- package/web/app/immutable/chunks/{zFu37m6L.js → DEOVFEjx.js} +1 -1
- package/web/app/immutable/chunks/{Dv2WcD53.js → DERB0Jdj.js} +1 -1
- package/web/app/immutable/chunks/{BFVncOQi.js → DFh2QzKR.js} +1 -1
- package/web/app/immutable/chunks/{B9-jkWWp.js → DFxTcA3E.js} +1 -1
- package/web/app/immutable/chunks/DG6P2gCG.js +411 -0
- package/web/app/immutable/chunks/{lE7gD_tn.js → DHFudMqw.js} +1 -1
- package/web/app/immutable/chunks/{BnbmXiW4.js → DJFngwyn.js} +1 -1
- package/web/app/immutable/chunks/{DJSAkzw5.js → DLt_ME6N.js} +1 -1
- package/web/app/immutable/chunks/{BN9pl0_x.js → DN4W-w9t.js} +1 -1
- package/web/app/immutable/chunks/{y83c7yRZ.js → DNZ5cdd7.js} +1 -1
- package/web/app/immutable/chunks/DO0aZyxl.js +2 -0
- package/web/app/immutable/chunks/{BCL-o_Md.js → DOSjgvd4.js} +3 -3
- package/web/app/immutable/chunks/{BjEG_fCJ.js → DP6TPKre.js} +1 -1
- package/web/app/immutable/chunks/{D3m2Y1N8.js → DQliWD4b.js} +1 -1
- package/web/app/immutable/chunks/{B_GvRk21.js → DRWBGAqk.js} +1 -1
- package/web/app/immutable/chunks/{Bj58rFtD.js → DRpk7IAR.js} +1 -1
- package/web/app/immutable/chunks/{CxuKWK-9.js → DXUWNyzc.js} +2 -2
- package/web/app/immutable/chunks/{IhhtpC0N.js → DXVUAQyy.js} +1 -1
- package/web/app/immutable/chunks/{C3cVfkio.js → DYCJZbxa.js} +1 -1
- package/web/app/immutable/chunks/{C6DQmPVB.js → D_h5QPHj.js} +1 -1
- package/web/app/immutable/chunks/{CtBzyNOX.js → Da5b0o3C.js} +1 -1
- package/web/app/immutable/chunks/{DPbxpEc3.js → DauNjtnc.js} +4 -4
- package/web/app/immutable/chunks/{CUtsQ_at.js → DceDM5vi.js} +1 -1
- package/web/app/immutable/chunks/{DYrrsQ1p.js → Df7jhhBI.js} +1 -1
- package/web/app/immutable/chunks/Di5jyd6k.js +3 -0
- package/web/app/immutable/chunks/{B76dt5zP.js → DjrhPbR_.js} +1 -1
- package/web/app/immutable/chunks/{B4OBYHli.js → DkDnBUkd.js} +1 -1
- package/web/app/immutable/chunks/{CyHB14hJ.js → Dno6lZ_K.js} +1 -1
- package/web/app/immutable/chunks/{CIqC9ucK.js → DrtzIUiM.js} +1 -1
- package/web/app/immutable/chunks/{BybDBA-a.js → DuuySJmX.js} +1 -1
- package/web/app/immutable/chunks/{CXTQXSCs.js → DzR2lw_C.js} +1 -1
- package/web/app/immutable/chunks/{DITs7RNY.js → KIfAnxvY.js} +1 -1
- package/web/app/immutable/chunks/{DpDGJXfb.js → QvexzmZW.js} +2 -2
- package/web/app/immutable/chunks/{DsDbrkJf.js → RGi81mvu.js} +1 -1
- package/web/app/immutable/chunks/{BxCgCRwx.js → SMQhPblH.js} +1 -1
- package/web/app/immutable/chunks/{CkTAy7fl.js → THKJxtFa.js} +1 -1
- package/web/app/immutable/chunks/{CSbEYhAV.js → VTJ8c5Pi.js} +1 -1
- package/web/app/immutable/chunks/{D42wJcQ3.js → Vh-BjeJL.js} +1 -1
- package/web/app/immutable/chunks/{CDD7ui9Z.js → X4OcqoCu.js} +1 -1
- package/web/app/immutable/chunks/XAL8NtHj.js +1 -0
- package/web/app/immutable/chunks/{qLTVpfPn.js → XO_-t4Ky.js} +1 -1
- package/web/app/immutable/chunks/{wtJmZfcy.js → YeB2MH-S.js} +1 -1
- package/web/app/immutable/chunks/{BnJ52enz.js → ZZl62WTG.js} +1 -1
- package/web/app/immutable/chunks/{CGO_zr9m.js → _4-WGEtP.js} +1 -1
- package/web/app/immutable/chunks/{vpLnaArD.js → d0jTaI_s.js} +1 -1
- package/web/app/immutable/chunks/{BhxHPYvf.js → giPqPYXa.js} +1 -1
- package/web/app/immutable/chunks/{C8TRSNUb.js → iPZ0ylPo.js} +1 -1
- package/web/app/immutable/chunks/{7590d3_e.js → iqPe99td.js} +1 -1
- package/web/app/immutable/chunks/{Ca1iiPGq.js → lwgrrOYd.js} +3 -3
- package/web/app/immutable/chunks/{kSTrWIIB.js → oS1TO8_n.js} +1 -1
- package/web/app/immutable/chunks/{D_-4DIK6.js → osg5eECY.js} +1 -1
- package/web/app/immutable/chunks/{pUywXnJP.js → sChr_bGo.js} +1 -1
- package/web/app/immutable/chunks/{udmuNwTR.js → sO3fM1GP.js} +1 -1
- package/web/app/immutable/chunks/{Z_lXVxA_.js → uri-ziv4.js} +1 -1
- package/web/app/immutable/chunks/{CkyxPppw.js → xPQp-52E.js} +1 -1
- package/web/app/immutable/chunks/{_IIJlCYC.js → xWBeRD3f.js} +1 -1
- package/web/app/immutable/chunks/{Boky5e4-.js → y3KZMSiK.js} +1 -1
- package/web/app/immutable/chunks/zdzlwKoA.js +1 -0
- package/web/app/immutable/entry/{app.aDjWpyk7.js → app.DMjhiR3P.js} +2 -2
- package/web/app/immutable/entry/start.Cj80d4qw.js +1 -0
- package/web/app/immutable/nodes/{0.D_e7AeTl.js → 0.C7i9QD4T.js} +1 -1
- package/web/app/immutable/nodes/{1.DA21OvwY.js → 1.BLAkNjLi.js} +1 -1
- package/web/app/immutable/nodes/{10.CSASJEbg.js → 10.BJQbFAUz.js} +1 -1
- package/web/app/immutable/nodes/{11.DW2JfBsq.js → 11.BUUW97-1.js} +1 -1
- package/web/app/immutable/nodes/{15.DrH3We44.js → 15.Bxp4-WNL.js} +1 -1
- package/web/app/immutable/nodes/{19.DyUaZQFK.js → 19.EqYVVTCt.js} +2 -2
- package/web/app/immutable/nodes/{2.CTOsyef2.js → 2.C1A3hiDj.js} +1 -1
- package/web/app/immutable/nodes/{20.BPfqGZ4o.js → 20.gu-VpWFh.js} +1 -1
- package/web/app/immutable/nodes/{3.xcZps6DB.js → 3.xjaKKItm.js} +1 -1
- package/web/app/immutable/nodes/{4.DaJkDmFI.js → 4.fhY4DLRW.js} +1 -1
- package/web/app/immutable/nodes/{5.7rTxN-4O.js → 5.Gnb7dORS.js} +1 -1
- package/web/app/immutable/nodes/{6.tsWwri9c.js → 6.DYxTUZ3Q.js} +1 -1
- package/web/app/immutable/nodes/{7.CDTojphP.js → 7.SR4e3Tlg.js} +1 -1
- package/web/app/immutable/nodes/{8.BO5ffLDm.js → 8.2WJub-vx.js} +1 -1
- package/web/app/immutable/nodes/{9.D0POivb2.js → 9.DwsKz8rq.js} +2 -2
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/chunks/BzKqzACd.js +0 -1
- package/web/app/immutable/chunks/C4AJzMws.js +0 -411
- package/web/app/immutable/chunks/CDUMf4mn.js +0 -3
- package/web/app/immutable/chunks/DrCYFWYk.js +0 -1
- package/web/app/immutable/chunks/Xk1ND_1x.js +0 -2
- package/web/app/immutable/chunks/k5fprFtz.js +0 -4
- package/web/app/immutable/chunks/vezRCn6E.js +0 -1
- package/web/app/immutable/entry/start.1qdHg029.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as gt}from"./cD292w1o.js";import{nZ as pt,br as vt}from"./D0qhIm1r.js";import{g as ht}from"./CMiilI_P.js";import{t as Te,bo as h,bw as Ue,b as Re,bm as m,br as _t}from"./Fcr7AvC-.js";import{ai as Ve,bs as Se,cb as bt,ca as ye,aD as e,a7 as ke,ay as oe,W as x,bn as Ne,bV as J,aA as _,a5 as ve,bS as O,bH as k,bA as he,b_ as Q,aj as Me,aw as Fe,bl as Ce,bO as ie,aB as X,c9 as E,be as Ie,b$ as ze,br as Qe}from"./3SdAC2_C.js";import{i as te}from"./BhYXv0ZM.js";import{k as wt}from"./Cc0763mU.js";import{s as Le,e as et,f as tt,g as yt}from"./BRCr02in.js";import{b as Ke}from"./Dn334wJv.js";import{c as me}from"./2z64ELW5.js";import{q as Xe,l as nt,d as rt,e as $e,K as at,h as ot,M as it}from"./D7KhILhs.js";import{a as xt}from"./CC7to1B5.js";import{m as we}from"./DkQdSPDN.js";import{f as Ee}from"./Beq_QLuz.js";import"./BAtAwQ72.js";import{l as Be,f as lt,m as kt,a as Ct}from"./C7b3vXLD.js";import"./ChTqQfQN.js";import"./DRMe5Ypb.js";import"./Cz3WzTlQ.js";import{bK as He}from"./Xk1ND_1x.js";import{t as De}from"./CWfjuhY2.js";import{F as Ae,d3 as Lt,bW as Pt,bX as Mt,cq as At,bF as Et,cr as It,aZ as zt,a8 as $t}from"./ChHRVjww.js";import{S as Tt}from"./koUs6Gjt.js";import{n as Ut,g as Rt}from"./CxR-pcVt.js";import{e as We}from"./CA6H1-bp.js";import{i as St,f as Nt}from"./C3KgmGxd.js";import{P as Kt}from"./CVx5OKWy.js";import{h as Ot}from"./B469nFvV.js";import{t as Ft}from"./DAsc1V4f.js";function Bt(a,n){return a?.isExternalLink===!0&&typeof a.workspaceId=="string"&&a.workspaceId?a.workspaceId:n||void 0}function Ht(a,n,o){const u=a.label||a.id||"mention";if(a.type==="member")return gt(u);if(a.type==="note"&&a.id&&o){const s=Bt(a.meta,n),v=s?o(s,a.id)?.trim():void 0;if(v)return v}return u}function Gn(a,n,o){if(typeof document>"u"||!a.includes('data-type="note"'))return a;const u=document.createElement("template");u.innerHTML=a;let s=!1;for(const v of u.content.querySelectorAll('[data-mention][data-type="note"]')){let b=null;try{b=JSON.parse(v.getAttribute("data-meta")||"{}")}catch{b=null}const P=v.textContent??"",M=Ht({type:"note",id:v.getAttribute("data-id"),label:P,meta:b},n,o);M!==P&&(v.textContent=M,s=!0)}return s?u.innerHTML:a}const Jn=(a,n)=>{let o;try{o=ht().state}catch{return}const u=o?.workspaceNotes?.byWorkspaceId?.[a]?.notes;return u?pt(u,n)?.title:void 0};let Oe=null;var jt=X('<p class="mt-2 max-w-[90vw] rounded-md bg-black/60 px-3 py-1.5 text-center text-sm text-white"> </p>'),Dt=X('<div data-media-lightbox-root="" data-image-lightbox-root="" class="fixed inset-0 z-[1000] flex cursor-zoom-out flex-col items-center justify-center bg-black/80 p-4 backdrop-blur-sm" style="pointer-events: auto;" role="dialog" aria-modal="true" tabindex="-1"><div class="absolute right-4 top-4 z-[1002] flex items-center gap-1"><!> <!></div> <div class="flex min-h-0 w-full flex-1 items-center justify-center"><!></div> <!></div>');function Ye(a,n){if(new.target)return Te({component:Ye,...a});Se(n,!0);let o=h(n,"open",15,!1),u=h(n,"ariaLabel",7),s=h(n,"closeLabel",7),v=h(n,"onClose",7),b=h(n,"openerElement",7,null),P=h(n,"children",7),M=h(n,"actions",7),F=h(n,"caption",7),U=h(n,"onKeydown",7),R=h(n,"onCopy",7);const y=St(),f=Nt(()=>N());let A=J(null),S=J(null);const D=Symbol("media-lightbox");let Z=!1;function N({handoff:r=!1}={}){o()&&(Z=r,Oe?.source===D&&(Oe=null),o(!1),v()?.(),!r&&b()?.isConnected&&b().focus({preventScroll:!0}))}function d(r){Oe={source:D,close:()=>N({handoff:!0})},r.scrollIntoView({block:"nearest"}),r.click()}function B(r,p,L){return Z?{duration:0}:Rt(r,{tier:"moderate"},L)}bt(()=>{if(!o())return;const r=Oe;Z=r!==null&&r.source!==D,Z&&r&&(Oe=null,r.close())});function Y(r){(r.target instanceof Element?r.target:null)?.closest('[data-media-lightbox-content], [role="toolbar"], button, input')||N()}function q(r){if(U()?.(r),r.defaultPrevented||r.key!=="Tab"||!e(A))return;const p=Array.from(e(A).querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')),L=p[0],I=p[p.length-1];!L||!I||(r.shiftKey&&document.activeElement===L?(r.preventDefault(),I.focus()):!r.shiftKey&&document.activeElement===I&&(r.preventDefault(),L.focus()))}ye(()=>{if(o())return Xe(()=>N())}),ye(()=>{!o()||!e(S)||requestAnimationFrame(()=>e(S)?.focus())});var g={handOffTo:d,get open(){return o()},set open(r=!1){o(r),_()},get ariaLabel(){return u()},set ariaLabel(r){u(r),_()},get closeLabel(){return s()},set closeLabel(r){s(r),_()},get onClose(){return v()},set onClose(r){v(r),_()},get openerElement(){return b()},set openerElement(r=null){b(r),_()},get children(){return P()},set children(r){P(r),_()},get actions(){return M()},set actions(r){M(r),_()},get caption(){return F()},set caption(r){F(r),_()},get onKeydown(){return U()},set onKeydown(r){U(r),_()},get onCopy(){return R()},set onCopy(r){R(r),_()},$set:Ue,$on:(r,p)=>Re(n,r,p)},i=ke(),w=oe(i);{var l=r=>{{let p=E(()=>y?.target()??"body");Kt(r,{get target(){return e(p)},zIndex:1e3,children:(L,I)=>{var z=Dt(),W=ve(z),ne=ve(W);{var re=C=>{var $=ke(),G=oe($);De(G,M),x(C,$)};te(ne,C=>{M()&&C(re)})}var ue=O(ne,2);Ee(ue,{variant:"ghost",size:"icon",class:"text-white hover:bg-white/20 hover:text-white",onclick:()=>N(),get"aria-label"(){return s()},get ref(){return e(S)},set ref(C){k(S,C,!0)},children:(C,$)=>{Ae(C,{get icon(){return Lt},size:"lg"})},$$slots:{default:!0}}),he(W),We(W,C=>f?.(C));var le=O(W,2),xe=ve(le);De(xe,P),he(le),We(le,C=>f?.(C));var se=O(le,2);{var ge=C=>{var $=jt(),G=Ce($,!0);Q(()=>ie(G,F())),x(C,$)};te(se,C=>{F()&&C(ge)})}he(z),Ke(z,C=>k(A,C),()=>e(A)),Q(()=>Le(z,"aria-label",u())),Me("click",z,Y),Me("keydown",z,q),Fe("copy",z,function(...C){R()?.apply(this,C)}),Ut(3,z,()=>B),x(L,z)},$$slots:{default:!0}})}};te(w,r=>{o()&&r(l)})}return x(a,i),Ne(g)}Ve(["click","keydown"]);function qe(a){if(!a.startsWith("workspace-file://"))return null;const o=a.slice(17).split(/[?#]/)[0].split("/"),u=o[0],s=o.slice(1);if(!u||s.length===0)return null;const v=[];for(const b of s){if(!b)return null;try{v.push(decodeURIComponent(b))}catch{return null}}return{workspaceId:u,path:v.join("/")}}function st(a){try{return new URL(a).protocol==="https:"}catch{return!1}}function Ze(a){const n=/^data:([^;,]+);base64,(.*)$/s.exec(a);return n?{mimeType:n[1],base64:n[2]}:null}function je(a){return st(a)||qe(a)!==null||/^workspace-asset:\/\/[^/?#]+/.test(a)||/^data:image\/[a-z0-9.+-]+(?:;[^,]*)?,/i.test(a)}function ct(a){if(a.length===0)return 0;let n=0;return a.endsWith("==")?n=2:a.endsWith("=")&&(n=1),Math.floor(a.length*3/4)-n}function Wt(a,n){const o=atob(a),u=new Uint8Array(o.length);for(let s=0;s<o.length;s++)u[s]=o.charCodeAt(s);return new Blob([u],{type:n})}const Zt={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/avif":"avif","image/bmp":"bmp"};function Vt(a){if(a.workspacePath){const s=a.workspacePath.split("/").pop();if(s)return s}const n=(a.imageName||"image").replace(/[/\\]/g,"_");if(/\.[A-Za-z0-9]+$/.test(n))return n;const o=a.mimeType?.split(";")[0].trim().toLowerCase(),u=o&&Zt[o]||"png";return`${n}.${u}`}var Xt=X('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="image-info-dimensions"> </div>'),Yt=X('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="image-info-size"> </div>'),qt=X("<!> <!> <!>",1),Gt=X("<!> <!> <!> <!>",1),Jt=X("<!> <!>",1);function ut(a,n){if(new.target)return Te({component:ut,...a});Se(n,!0);let o=h(n,"imageUrl",7),u=h(n,"imageName",7),s=h(n,"open",15,!1),v=h(n,"triggerClass",7),b=h(n,"contentClass",7);const P=E(()=>Ze(o())),M=E(()=>qe(o())),F=E(()=>st(o()));let U=J(null),R=J(null),y=null;function f(){if(y===o())return;const l=y=o();k(U,null),k(R,e(P)?ct(e(P).base64):null,!0);const r=new Image;r.onload=()=>{y===l&&k(U,{width:r.naturalWidth,height:r.naturalHeight},!0)},r.src=o(),e(P)||fetch(o()).then(p=>p.ok?p.blob():null).then(p=>{p&&y===l&&k(R,p.size,!0)}).catch(()=>{})}ye(()=>{s()&&f()}),ye(()=>{if(s())return Xe(()=>{s(!1)})});async function A(l=o()){const r=Ze(l);if(r)return Wt(r.base64,r.mimeType);const p=await fetch(l);if(!p.ok)throw new Error(`Image fetch failed: ${p.status}`);return await p.blob()}async function S(){let l=null;try{let r=o(),p=e(P)?.mimeType;if(!e(P)){const I=await A();p=I.type,l=URL.createObjectURL(I),r=l}const L=document.createElement("a");L.href=r,L.download=Vt({workspacePath:e(M)?.path,imageName:u(),mimeType:p}),document.body.appendChild(L);try{L.click()}finally{L.remove()}}catch{we.error(m.ui_imageActionsMenu_downloadFailed_error())}finally{l&&URL.revokeObjectURL(l)}}async function D(){if(e(M))try{await He(e(M).path),we.success(m.ui_imageActionsMenu_pathCopied_label())}catch{we.error(m.ui_imageActionsMenu_copyFailed_error())}}async function Z(){if(e(F))try{await He(o()),we.success(m.ui_imageActionsMenu_linkCopied_label())}catch{we.error(m.ui_imageActionsMenu_copyFailed_error())}}async function N(l){let r,p;try{let L;if(l.type.split(";")[0].trim()==="image/svg+xml"){p=URL.createObjectURL(l);const W=new Image;W.src=p,await W.decode(),L=W}else L=r=await createImageBitmap(l);const I=document.createElement("canvas");I.width=L instanceof HTMLImageElement?L.naturalWidth:L.width,I.height=L instanceof HTMLImageElement?L.naturalHeight:L.height;const z=I.getContext("2d");if(!z)throw new Error("2d canvas context unavailable");return z.drawImage(L,0,0),await new Promise((W,ne)=>{I.toBlob(re=>re?W(re):ne(new Error("canvas toBlob failed")),"image/png")})}finally{r?.close(),p&&URL.revokeObjectURL(p)}}async function d(l=o()){try{let r=await A(l);r.type!=="image/png"&&(r=await N(r)),await navigator.clipboard.write([new ClipboardItem({"image/png":r})]),we.success(m.ui_imageActionsMenu_imageCopied_label())}catch{we.error(m.ui_imageActionsMenu_copyFailed_error())}}function B(l,r=o()){return l.defaultPrevented||!je(r)||l instanceof KeyboardEvent&&(l.key.toLowerCase()!=="c"||!(l.metaKey||l.ctrlKey)||l.altKey||l.shiftKey||l.isComposing)||xt(l.target)||document.getSelection()?.toString()?!1:(l.preventDefault(),l.stopPropagation(),l instanceof KeyboardEvent&&l.repeat||(d(r),s(!1)),!0)}var Y={handleCopy:B,get imageUrl(){return o()},set imageUrl(l){o(l),_()},get imageName(){return u()},set imageName(l){u(l),_()},get open(){return s()},set open(l=!1){s(l),_()},get triggerClass(){return v()},set triggerClass(l){v(l),_()},get contentClass(){return b()},set contentClass(l){b(l),_()},$set:Ue,$on:(l,r)=>Re(n,l,r)},q=ke(),g=oe(q);{var i=l=>{var r=ke(),p=oe(r);me(p,()=>it,(L,I)=>{I(L,{get open(){return s()},set open(z){s(z)},children:(z,W)=>{var ne=Jt(),re=oe(ne);{const le=(se,ge)=>{let C=()=>(ge?.()).props;{let $=E(()=>m.ui_imageActionsMenu_trigger_ariaLabel());Ee(se,_t(C,{variant:"plain",size:"icon-sm",wrapContent:!1,get active(){return s()},get"aria-label"(){return e($)},children:(G,j)=>{at(G,{class:"size-3.5"})},$$slots:{default:!0}}))}};let xe=E(()=>et("flex h-7 w-7 items-center justify-center rounded-md bg-black/60 text-white","hover:bg-black/75",v()));me(re,()=>nt,(se,ge)=>{ge(se,{get class(){return e(xe)},onclick:C=>C.stopPropagation(),onkeydown:C=>B(C),oncopy:C=>B(C),child:le,$$slots:{child:!0}})})}var ue=O(re,2);me(ue,()=>rt,(le,xe)=>{xe(le,{get class(){return b()},align:"end",onkeydown:se=>B(se),oncopy:se=>B(se),children:(se,ge)=>{var C=Gt(),$=oe(C);me($,()=>$e,(H,ee)=>{ee(H,{onSelect:()=>void S(),children:(K,V)=>{Ie();var ae=ze();Q(ce=>ie(ae,ce),[()=>m.ui_imageActionsMenu_download_label()]),x(K,ae)},$$slots:{default:!0}})});var G=O($,2);me(G,()=>$e,(H,ee)=>{ee(H,{onSelect:()=>void d(),children:(K,V)=>{Ie();var ae=ze();Q(ce=>ie(ae,ce),[()=>m.ui_imageActionsMenu_copyImage_label()]),x(K,ae)},$$slots:{default:!0}})});var j=O(G,2);{var de=H=>{var ee=ke(),K=oe(ee);me(K,()=>$e,(V,ae)=>{ae(V,{onSelect:()=>void D(),children:(ce,t)=>{Ie();var c=ze();Q(T=>ie(c,T),[()=>m.ui_imageActionsMenu_copyPath_label()]),x(ce,c)},$$slots:{default:!0}})}),x(H,ee)},_e=H=>{var ee=ke(),K=oe(ee);me(K,()=>$e,(V,ae)=>{ae(V,{onSelect:()=>void Z(),children:(ce,t)=>{Ie();var c=ze();Q(T=>ie(c,T),[()=>m.ui_imageActionsMenu_copyLink_label()]),x(ce,c)},$$slots:{default:!0}})}),x(H,ee)};te(j,H=>{e(M)?H(de):e(F)&&H(_e,1)})}var fe=O(j,2);{var Pe=H=>{var ee=qt(),K=oe(ee);me(K,()=>ot,(c,T)=>{T(c,{})});var V=O(K,2);{var ae=c=>{var T=Xt(),pe=Ce(T,!0);Q(be=>ie(pe,be),[()=>m.ui_imageActionsMenu_dimensions_label({width:Be(e(U).width),height:Be(e(U).height)})]),x(c,T)};te(V,c=>{e(U)&&c(ae)})}var ce=O(V,2);{var t=c=>{var T=Yt(),pe=Ce(T,!0);Q(be=>ie(pe,be),[()=>lt(e(R))]),x(c,T)};te(ce,c=>{e(R)!==null&&c(t)})}x(H,ee)};te(fe,H=>{(e(U)||e(R)!==null)&&H(Pe)})}x(se,C)},$$slots:{default:!0}})}),x(z,ne)},$$slots:{default:!0}})}),x(l,r)},w=E(()=>je(o()));te(g,l=>{e(w)&&l(i)})}return x(a,q),Ne(Y)}var Qt=X('<div role="application" tabindex="0" data-testid="zoom-pan-viewport"><div class="flex h-full w-full items-center justify-center will-change-transform" data-testid="zoom-pan-content"><!></div> <div class="absolute bottom-4 left-1/2 z-10 flex -translate-x-1/2 cursor-default items-center gap-2 rounded-full bg-black/60 px-3 py-1.5 backdrop-blur-sm" role="toolbar" tabindex="-1" data-testid="zoom-pan-controls"><!> <div class="w-36"><!></div> <!> <span class="min-w-12 text-center text-xs tabular-nums text-white/90" data-testid="zoom-pan-percent"> </span> <!></div></div>');function dt(a,n){if(new.target)return Te({component:dt,...a});Se(n,!0);let o=h(n,"children",7),u=h(n,"minZoom",7,.25),s=h(n,"maxZoom",7,8),v=h(n,"onScaleChange",7),b=h(n,"pannable",15,!1);const P=1.25,M=.0015,F=.01,U=4,R=.5;let y=J(1),f=J(0),A=J(0),S=J(!1),D=J(null),Z=J(null),N=J(Qe({width:0,height:0})),d=J(Qe({width:0,height:0}));const B=E(()=>e(d).width*e(y)>e(N).width+R),Y=E(()=>e(d).height*e(y)>e(N).height+R);ye(()=>{v()?.(e(y))}),ye(()=>{b(e(B)||e(Y))});function q(){e(D)&&k(N,{width:e(D).clientWidth,height:e(D).clientHeight},!0);const t=e(Z)?.firstElementChild;if(t instanceof HTMLElement)k(d,{width:t.offsetWidth,height:t.offsetHeight},!0);else if(t){const c=t.getBoundingClientRect();k(d,{width:c.width/e(y),height:c.height/e(y)},!0)}}function g(t,c,T){const pe=c*(1-e(y))/2,be=T*e(y)-c;return be<=R?pe:Math.min(pe+be/2,Math.max(pe-be/2,t))}function i(){k(f,g(e(f),e(N).width,e(d).width),!0),k(A,g(e(A),e(N).height,e(d).height),!0)}ye(()=>{const t=e(D),c=e(Z);if(!t||!c||typeof ResizeObserver>"u")return;const T=new ResizeObserver(()=>{q(),i()});return T.observe(t),c.firstElementChild&&T.observe(c.firstElementChild),()=>T.disconnect()});let w=null,l=0,r=0,p=0,L=!1;const I=E(()=>kt(e(y),{style:"percent",maximumFractionDigits:0}));function z(t){return Math.min(s(),Math.max(u(),t))}function W(t,c,T){const pe=z(T),be=e(D)?.getBoundingClientRect(),Ge=be?t-be.left:0,Je=be?c-be.top:0;q(),k(f,Ge-(Ge-e(f))/e(y)*pe),k(A,Je-(Je-e(A))/e(y)*pe),k(y,pe,!0),i()}function ne(t){const c=e(D)?.getBoundingClientRect();c?W(c.left+c.width/2,c.top+c.height/2,t):(k(y,z(t),!0),i())}function re(){k(y,1),k(f,0),k(A,0)}function ue(t){t.preventDefault();const c=t.ctrlKey?F:M;W(t.clientX,t.clientY,e(y)*Math.exp(-t.deltaY*c))}ye(()=>{const t=e(D);if(t)return t.addEventListener("wheel",ue,{passive:!1}),()=>t.removeEventListener("wheel",ue)});function le(t){if(t.metaKey||t.ctrlKey||t.altKey)return!1;if(t.key==="+"||t.key==="=")ne(e(y)*P);else if(t.key==="-")ne(e(y)/P);else if(t.key==="0")re();else return!1;return t.preventDefault(),!0}function xe(t){if(t.button>0||(q(),!e(B)&&!e(Y)))return;t.preventDefault(),k(S,!0),w=t.pointerId,l=t.clientX,r=t.clientY,p=0;const c=t.currentTarget;typeof c.setPointerCapture=="function"&&c.setPointerCapture(t.pointerId)}function se(t){if(!e(S)||t.pointerId!==w)return;const c=t.clientX-l,T=t.clientY-r;p+=Math.abs(c)+Math.abs(T),k(f,e(f)+c),k(A,e(A)+T),i(),l=t.clientX,r=t.clientY}function ge(t){if(!e(S)||t.pointerId!==w)return;k(S,!1),w=null,p>U&&(L=!0);const c=t.currentTarget;typeof c.hasPointerCapture=="function"&&typeof c.releasePointerCapture=="function"&&c.hasPointerCapture(t.pointerId)&&c.releasePointerCapture(t.pointerId)}function C(t){L&&(L=!1,t.preventDefault(),t.stopPropagation())}function $(t){const c=Number.parseFloat(t.currentTarget.value);Number.isFinite(c)&&ne(c)}var G={handleKeydown:le,get children(){return o()},set children(t){o(t),_()},get minZoom(){return u()},set minZoom(t=.25){u(t),_()},get maxZoom(){return s()},set maxZoom(t=8){s(t),_()},get onScaleChange(){return v()},set onScaleChange(t){v(t),_()},get pannable(){return b()},set pannable(t=!1){b(t),_()},$set:Ue,$on:(t,c)=>Re(n,t,c)},j=Qt(),de=ve(j),_e=ve(de);De(_e,o),he(de),Ke(de,t=>k(Z,t),()=>e(Z));var fe=O(de,2),Pe=ve(fe);{let t=E(()=>m.ui_zoomPanViewport_zoomOut_ariaLabel()),c=E(()=>m.ui_zoomPanViewport_zoomOut_ariaLabel());Ee(Pe,{variant:"ghost",size:"icon-sm",class:"text-white hover:bg-white/20 hover:text-white",onclick:()=>ne(e(y)/P),get"aria-label"(){return e(t)},get title(){return e(c)},children:(T,pe)=>{Ae(T,{get icon(){return Pt}})},$$slots:{default:!0}})}var H=O(Pe,2),ee=ve(H);{let t=E(()=>m.ui_zoomPanViewport_zoomSlider_ariaLabel()),c=E(()=>m.ui_zoomPanViewport_zoomSlider_ariaLabel());Tt(ee,{class:"accent-white",get min(){return u()},get max(){return s()},step:"0.01",get value(){return e(y)},oninput:$,get"aria-label"(){return e(t)},get title(){return e(c)},"data-testid":"zoom-pan-slider"})}he(H);var K=O(H,2);{let t=E(()=>m.ui_zoomPanViewport_zoomIn_ariaLabel()),c=E(()=>m.ui_zoomPanViewport_zoomIn_ariaLabel());Ee(K,{variant:"ghost",size:"icon-sm",class:"text-white hover:bg-white/20 hover:text-white",onclick:()=>ne(e(y)*P),get"aria-label"(){return e(t)},get title(){return e(c)},children:(T,pe)=>{Ae(T,{get icon(){return Mt}})},$$slots:{default:!0}})}var V=O(K,2),ae=Ce(V,!0),ce=O(V,2);{let t=E(()=>m.ui_zoomPanViewport_resetZoom_ariaLabel()),c=E(()=>m.ui_zoomPanViewport_resetZoom_ariaLabel());Ee(ce,{variant:"ghost",size:"icon-sm",class:"text-white hover:bg-white/20 hover:text-white",onclick:re,get"aria-label"(){return e(t)},get title(){return e(c)},children:(T,pe)=>{Ae(T,{get icon(){return At}})},$$slots:{default:!0}})}return he(fe),he(j),Ke(j,t=>k(D,t),()=>e(D)),Q((t,c)=>{tt(j,1,`relative h-full w-full touch-none select-none overflow-hidden ${e(S)?"cursor-grabbing":b()?"cursor-grab":""}`),Le(j,"aria-label",t),yt(de,`transform: translate(${e(f)??""}px, ${e(A)??""}px) scale(${e(y)??""}); transform-origin: 0 0;`),Le(fe,"aria-label",c),ie(ae,e(I))},[()=>m.ui_zoomPanViewport_viewport_ariaLabel(),()=>m.ui_zoomPanViewport_controls_ariaLabel()]),Me("pointerdown",j,xe),Me("pointermove",j,se),Me("pointerup",j,ge),Fe("pointercancel",j,ge),Fe("click",j,C,!0),Me("keydown",j,le),Me("pointerdown",fe,t=>t.stopPropagation()),x(a,j),Ne(G)}Ve(["pointerdown","pointermove","pointerup","keydown"]);const en="data-lightbox-gallery",ft="data-lightbox-opener",tn=`[${ft}], .markdown-content img`;function nn(a){return a.hasAttribute(ft)?!(a instanceof HTMLButtonElement&&a.disabled):a instanceof HTMLImageElement&&!a.closest("a")&&je(a.getAttribute("src")||"")}function rn(a,n){const o=a?.closest(`[${en}]`);if(!a||!o)return null;const u=Array.from(o.querySelectorAll(tn)).filter(nn),s=u.findIndex(v=>v===a||v.contains(a));return s<0?null:u[s+n]??null}var an=X('<img data-media-lightbox-content=""/>');function on(a,n){if(new.target)return Te({component:on,...a});Se(n,!0);const o=d=>{var B=ke(),Y=oe(B);{var q=g=>{Ke(ut(g,{get imageUrl(){return s()},get imageName(){return v()},triggerClass:"h-9 w-9 bg-white/0 hover:bg-white/20",contentClass:"z-[1003]",get open(){return e(f)},set open(i){k(f,i,!0)}}),i=>k(y,i,!0),()=>e(y))};te(Y,g=>{M()&&g(q)})}x(d,B)};let u=h(n,"open",15,!1),s=h(n,"imageUrl",7),v=h(n,"imageName",23,()=>m.ui_imageLightbox_image_alt()),b=h(n,"onClose",7),P=h(n,"openerElement",7,null),M=h(n,"showActionsMenu",7,!1),F=J(void 0),U=J(void 0),R=J(!1),y=J(void 0),f=J(!1);ye(()=>{u()||k(f,!1)});function A(d){D(d),!d.defaultPrevented&&(e(U)?.handleKeydown(d)||S(d))}function S(d){if(d.key!=="ArrowLeft"&&d.key!=="ArrowRight"||d.metaKey||d.ctrlKey||d.altKey||d.shiftKey||e(f)||d.target instanceof HTMLInputElement)return;const B=rn(P(),d.key==="ArrowLeft"?-1:1);B&&(d.preventDefault(),e(F)?.handOffTo(B))}function D(d){u()&&M()&&e(y)?.handleCopy(d)}function Z(d){!M()||!je(s())||(d.preventDefault(),d.stopPropagation(),k(f,!0))}var N={get open(){return u()},set open(d=!1){u(d),_()},get imageUrl(){return s()},set imageUrl(d){s(d),_()},get imageName(){return v()},set imageName(d=m.ui_imageLightbox_image_alt()){v(d),_()},get onClose(){return b()},set onClose(d){b(d),_()},get openerElement(){return P()},set openerElement(d=null){P(d),_()},get showActionsMenu(){return M()},set showActionsMenu(d=!1){M(d),_()},$set:Ue,$on:(d,B)=>Re(n,d,B)};{let d=E(()=>m.ui_imageLightbox_preview_ariaLabel()),B=E(()=>m.ui_imageLightbox_close_ariaLabel());Ke(Ye(a,{get ariaLabel(){return e(d)},get closeLabel(){return e(B)},get onClose(){return b()},get openerElement(){return P()},get actions(){return o},onKeydown:A,onCopy:D,get open(){return u()},set open(Y){u(Y)},children:(Y,q)=>{var g=ke(),i=oe(g);wt(i,s,w=>{Ke(dt(w,{get pannable(){return e(R)},set pannable(l){k(R,l,!0)},children:(l,r)=>{var p=an();Q(()=>{Le(p,"src",s()),Le(p,"alt",v()),tt(p,1,`max-h-[90vh] max-w-[90vw] rounded-lg object-contain ${e(R)?"":"cursor-default"}`),Le(p,"draggable",!e(R))}),Me("contextmenu",p,Z),x(l,p)},$$slots:{default:!0}}),l=>k(U,l,!0),()=>e(U))}),x(Y,g)},$$slots:{default:!0}}),Y=>k(F,Y,!0),()=>e(F))}return Ne(N)}Ve(["contextmenu"]);var ln=X('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="video-info-duration"> </div>'),sn=X('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="video-info-dimensions"> </div>'),cn=X('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="video-info-size"> </div>'),un=X("<!> <!> <!> <!>",1),dn=X("<!> <!> <!>",1),fn=X("<!> <!>",1);function mt(a,n){if(new.target)return Te({component:mt,...a});Se(n,!0);let o=h(n,"videoUrl",7),u=h(n,"videoName",7),s=h(n,"sourceKind",7),v=h(n,"mimeType",7),b=h(n,"open",15,!1),P=h(n,"triggerClass",7),M=h(n,"contentClass",7);const F=E(()=>Ze(o())),U=E(()=>qe(o())),R=E(()=>s()??(e(F)?"inline":e(U)?"workspace":"remote"));let y=J(null),f=J(null),A=J(null),S=null;function D(){if(S===o())return;const g=S=o();k(y,null),k(f,null),k(A,e(F)?ct(e(F).base64):null,!0);const i=document.createElement("video");i.preload="metadata",i.onloadedmetadata=()=>{S===g&&(Number.isFinite(i.duration)&&i.duration>0&&k(y,i.duration,!0),i.videoWidth>0&&i.videoHeight>0&&k(f,{width:i.videoWidth,height:i.videoHeight},!0))},i.src=o(),e(F)||fetch(o()).then(w=>w.ok?w.blob():null).then(w=>{w&&S===g&&k(A,w.size,!0)}).catch(()=>{})}function Z(){const g=e(U)?.path.split("/").pop();if(g)return g;const i=(u()||"video").replace(/[/\\]/g,"_");if(/\.[A-Za-z0-9]+$/.test(i))return i;const w=(v()??e(F)?.mimeType)==="video/webm"?"webm":"mp4";return`${i}.${w}`}async function N(){let g=null;try{let i=o();if(!e(F)){const l=await fetch(o());if(!l.ok)throw new Error(`Video fetch failed: ${l.status}`);g=URL.createObjectURL(await l.blob()),i=g}const w=document.createElement("a");w.href=i,w.download=Z(),document.body.appendChild(w),w.click(),w.remove(),g&&URL.revokeObjectURL(g)}catch{g&&URL.revokeObjectURL(g),we.error(m.ui_videoActionsMenu_downloadFailed_error())}}async function d(g,i){try{await He(g),we.success(i)}catch{we.error(m.ui_videoActionsMenu_copyFailed_error())}}ye(()=>{b()&&D()}),ye(()=>{if(b())return Xe(()=>{b(!1)})});var B={get videoUrl(){return o()},set videoUrl(g){o(g),_()},get videoName(){return u()},set videoName(g){u(g),_()},get sourceKind(){return s()},set sourceKind(g){s(g),_()},get mimeType(){return v()},set mimeType(g){v(g),_()},get open(){return b()},set open(g=!1){b(g),_()},get triggerClass(){return P()},set triggerClass(g){P(g),_()},get contentClass(){return M()},set contentClass(g){M(g),_()},$set:Ue,$on:(g,i)=>Re(n,g,i)},Y=ke(),q=oe(Y);return me(q,()=>it,(g,i)=>{i(g,{get open(){return b()},set open(w){b(w)},children:(w,l)=>{var r=fn(),p=oe(r);{let I=E(()=>et("flex h-7 w-7 items-center justify-center rounded-md bg-black/60 text-white","hover:bg-black/75",P())),z=E(()=>m.ui_videoActionsMenu_trigger_ariaLabel());me(p,()=>nt,(W,ne)=>{ne(W,{get class(){return e(I)},get"aria-label"(){return e(z)},onclick:re=>re.stopPropagation(),children:(re,ue)=>{at(re,{class:"size-3.5"})},$$slots:{default:!0}})})}var L=O(p,2);me(L,()=>rt,(I,z)=>{z(I,{get class(){return M()},align:"end",children:(W,ne)=>{var re=dn(),ue=oe(re);me(ue,()=>$e,($,G)=>{G($,{onSelect:()=>void N(),children:(j,de)=>{Ie();var _e=ze();Q(fe=>ie(_e,fe),[()=>m.ui_videoActionsMenu_download_label()]),x(j,_e)},$$slots:{default:!0}})});var le=O(ue,2);{var xe=$=>{var G=ke(),j=oe(G);me(j,()=>$e,(de,_e)=>{_e(de,{onSelect:()=>void d(e(U).path,m.ui_videoActionsMenu_pathCopied_label()),children:(fe,Pe)=>{Ie();var H=ze();Q(ee=>ie(H,ee),[()=>m.ui_videoActionsMenu_copyPath_label()]),x(fe,H)},$$slots:{default:!0}})}),x($,G)},se=$=>{var G=ke(),j=oe(G);me(j,()=>$e,(de,_e)=>{_e(de,{onSelect:()=>void d(o(),m.ui_videoActionsMenu_linkCopied_label()),children:(fe,Pe)=>{Ie();var H=ze();Q(ee=>ie(H,ee),[()=>m.ui_videoActionsMenu_copyLink_label()]),x(fe,H)},$$slots:{default:!0}})}),x($,G)};te(le,$=>{e(R)==="workspace"&&e(U)?$(xe):e(R)==="remote"&&$(se,1)})}var ge=O(le,2);{var C=$=>{var G=un(),j=oe(G);me(j,()=>ot,(K,V)=>{V(K,{})});var de=O(j,2);{var _e=K=>{var V=ln(),ae=Ce(V,!0);Q(ce=>ie(ae,ce),[()=>m.ui_videoActionsMenu_duration_label({duration:Ct(e(y)*1e3)})]),x(K,V)};te(de,K=>{e(y)!==null&&K(_e)})}var fe=O(de,2);{var Pe=K=>{var V=sn(),ae=Ce(V,!0);Q(ce=>ie(ae,ce),[()=>m.ui_videoActionsMenu_dimensions_label({width:Be(e(f).width),height:Be(e(f).height)})]),x(K,V)};te(fe,K=>{e(f)&&K(Pe)})}var H=O(fe,2);{var ee=K=>{var V=cn(),ae=Ce(V,!0);Q(ce=>ie(ae,ce),[()=>lt(e(A))]),x(K,V)};te(H,K=>{e(A)!==null&&K(ee)})}x($,G)};te(ge,$=>{(e(y)!==null||e(f)||e(A)!==null)&&$(C)})}x(W,re)},$$slots:{default:!0}})}),x(w,r)},$$slots:{default:!0}})}),x(a,Y),Ne(B)}var mn=X('<p class="type-body text-white/80" role="status"> </p>'),gn=X('<div data-media-lightbox-content="" data-video-lightbox-root="" class="flex max-h-[90vh] max-w-[90vw] cursor-default flex-col items-center gap-3"><video controls="" preload="metadata" playsinline="" class="max-h-[85vh] max-w-[90vw] rounded-lg bg-black object-contain shadow-(--elevation-overlay)" data-testid="chat-video-player"> </video> <!></div>',2);function pn(a,n){if(new.target)return Te({component:pn,...a});Se(n,!0);const o=f=>{mt(f,{get videoUrl(){return s()},get videoName(){return v()},get sourceKind(){return P()},get mimeType(){return M()},triggerClass:"h-9 w-9 bg-white/0 hover:bg-white/20",contentClass:"z-[1003]"})};let u=h(n,"open",15,!1),s=h(n,"videoUrl",7),v=h(n,"videoName",23,()=>m.chat_videoBlock_fromAgent_label()),b=h(n,"poster",7),P=h(n,"sourceKind",7),M=h(n,"mimeType",7),F=h(n,"openerElement",7,null),U=h(n,"onClose",7),R=J(!1);ye(()=>{!u()||!s()||k(R,!1)});var y={get open(){return u()},set open(f=!1){u(f),_()},get videoUrl(){return s()},set videoUrl(f){s(f),_()},get videoName(){return v()},set videoName(f=m.chat_videoBlock_fromAgent_label()){v(f),_()},get poster(){return b()},set poster(f){b(f),_()},get sourceKind(){return P()},set sourceKind(f){P(f),_()},get mimeType(){return M()},set mimeType(f){M(f),_()},get openerElement(){return F()},set openerElement(f=null){F(f),_()},get onClose(){return U()},set onClose(f){U(f),_()},$set:Ue,$on:(f,A)=>Re(n,f,A)};{let f=E(()=>m.chat_videoBlock_dialog_title({name:v()})),A=E(()=>m.chat_videoBlock_close_ariaLabel());Ye(a,{get ariaLabel(){return e(f)},get closeLabel(){return e(A)},get openerElement(){return F()},get onClose(){return U()},get actions(){return o},get open(){return u()},set open(S){u(S)},children:(S,D)=>{var Z=gn(),N=ve(Z),d=Ce(N,!0),B=O(N,2);{var Y=q=>{var g=mn(),i=Ce(g,!0);Q(w=>ie(i,w),[()=>m.chat_videoBlock_unavailable_description()]),x(q,g)};te(B,q=>{e(R)&&q(Y)})}he(Z),Q(q=>{Le(N,"src",s()),Le(N,"poster",b()),Le(N,"aria-label",v()),ie(d,q)},[()=>m.chat_videoBlock_unsupported_description()]),Fe("error",N,()=>k(R,!0)),x(S,Z)},$$slots:{default:!0}})}return Ne(y)}var vn=X('<span class="block truncate text-foreground"> </span>'),hn=X("<!> ",1),_n=X("<!> <!>",1),bn=X('<span class="flex shrink-0 flex-wrap items-center gap-1"><!> <!></span>'),wn=X('<div class="type-caption flex w-fit min-w-0 max-w-full items-center gap-3 whitespace-normal py-1 text-muted-foreground" role="status" data-testid="media-unavailable"><span class="flex min-w-0 max-w-full flex-1 items-start gap-2"><span class="first-line-icon" aria-hidden="true"><!></span> <span class="min-w-0"><!> <span class="block break-words"> </span></span></span> <!></div>');function yn(a,n){if(new.target)return Te({component:yn,...a});Se(n,!0);let o=h(n,"name",7),u=h(n,"reason",7),s=h(n,"path",7),v=h(n,"workspaceId",7),b=h(n,"onRetry",7);const P=E(()=>u()==="missing"?m.ui_mediaUnavailable_missing_description():u()==="unsupported"?m.ui_mediaUnavailable_unsupported_description():u()==="other-workspace"?m.ui_mediaUnavailable_otherWorkspace_description():u()==="invalid-link"?m.ui_mediaUnavailable_invalidLink_description():m.ui_mediaUnavailable_loadFailed_description());function M(i){i.preventDefault(),i.stopPropagation()}function F(i){M(i),b()?.()}async function U(i){if(M(i),!!s())try{await He(s()),we.success(m.ui_imageActionsMenu_pathCopied_label())}catch{we.error(m.ui_imageActionsMenu_copyFailed_error())}}function R(i){if(M(i),!s()||!v())return;const w=s().split("/").map(encodeURIComponent).join("/");Ot(`intent://local/file/${w}`,{workspaceId:vt(v())})}var y={get name(){return o()},set name(i){o(i),_()},get reason(){return u()},set reason(i){u(i),_()},get path(){return s()},set path(i){s(i),_()},get workspaceId(){return v()},set workspaceId(i){v(i),_()},get onRetry(){return b()},set onRetry(i){b(i),_()},$set:Ue,$on:(i,w)=>Re(n,i,w)},f=wn(),A=ve(f),S=ve(A),D=ve(S);Ae(D,{get icon(){return Et},class:"size-3.5"}),he(S);var Z=O(S,2),N=ve(Z);{var d=i=>{var w=vn(),l=Ce(w,!0);We(w,(r,p)=>Ft?.(r,p),o),Q(()=>ie(l,o())),x(i,w)};te(N,i=>{o()&&i(d)})}var B=O(N,2),Y=Ce(B,!0);he(Z),he(A);var q=O(A,2);{var g=i=>{var w=bn(),l=ve(w);{var r=I=>{{let z=E(()=>m.chat_shared_retry_label());Ee(I,{variant:"ghost",size:"icon-compact",get tooltip(){return e(z)},onclick:F,children:(W,ne)=>{Ae(W,{get icon(){return It},size:"xs"})},$$slots:{default:!0}})}};te(l,I=>{b()&&I(r)})}var p=O(l,2);{var L=I=>{var z=_n(),W=oe(z);{var ne=ue=>{Ee(ue,{variant:"ghost",size:"compact",onclick:R,children:(le,xe)=>{var se=hn(),ge=oe(se);Ae(ge,{get icon(){return $t},size:"xs"});var C=O(ge);Q($=>ie(C,` ${$??""}`),[()=>m.chat_changesPanel_openFile_tooltip()]),x(le,se)},$$slots:{default:!0}})};te(W,ue=>{v()&&u()!=="other-workspace"&&u()!=="invalid-link"&&ue(ne)})}var re=O(W,2);{let ue=E(()=>m.ui_imageActionsMenu_copyPath_label());Ee(re,{variant:"ghost",size:"icon-compact",get tooltip(){return e(ue)},onclick:U,children:(le,xe)=>{Ae(le,{get icon(){return zt},size:"xs"})},$$slots:{default:!0}})}x(I,z)};te(p,I=>{s()&&I(L)})}he(w),x(i,w)};te(q,i=>{(b()||s())&&i(g)})}return he(f),Q(()=>{Le(f,"data-reason",u()),ie(Y,e(P))}),x(a,f),Ne(y)}export{ut as I,Ye as M,mt as V,dt as Z,on as a,yn as b,pn as c,ct as d,Wt as e,je as f,Ht as m,qe as p,Gn as r,Jn as s};
|
|
1
|
+
import{$ as gt}from"./cD292w1o.js";import{nZ as pt,br as vt}from"./D0qhIm1r.js";import{g as ht}from"./CMiilI_P.js";import{t as Te,bo as h,bw as Ue,b as Re,bm as m,br as _t}from"./Fcr7AvC-.js";import{ai as Ve,bs as Se,cb as bt,ca as ye,aD as e,a7 as ke,ay as oe,W as x,bn as Ne,bV as J,aA as _,a5 as ve,bS as O,bH as k,bA as he,b_ as Q,aj as Me,aw as Fe,bl as Ce,bO as ie,aB as X,c9 as E,be as Ie,b$ as ze,br as Qe}from"./3SdAC2_C.js";import{i as te}from"./BhYXv0ZM.js";import{k as wt}from"./Cc0763mU.js";import{s as Le,e as et,f as tt,g as yt}from"./BRCr02in.js";import{b as Ke}from"./Dn334wJv.js";import{c as me}from"./2z64ELW5.js";import{q as Xe,l as nt,d as rt,e as $e,K as at,h as ot,M as it}from"./D7KhILhs.js";import{a as xt}from"./CC7to1B5.js";import{m as we}from"./DkQdSPDN.js";import{f as Ee}from"./Beq_QLuz.js";import"./BAtAwQ72.js";import{l as Be,f as lt,m as kt,a as Ct}from"./C7b3vXLD.js";import"./ChTqQfQN.js";import"./DRMe5Ypb.js";import"./Cz3WzTlQ.js";import{bK as He}from"./DO0aZyxl.js";import{t as De}from"./CWfjuhY2.js";import{F as Ae,d3 as Lt,bW as Pt,bX as Mt,cq as At,bF as Et,cr as It,aZ as zt,a8 as $t}from"./ChHRVjww.js";import{S as Tt}from"./koUs6Gjt.js";import{n as Ut,g as Rt}from"./CxR-pcVt.js";import{e as We}from"./CA6H1-bp.js";import{i as St,f as Nt}from"./C3KgmGxd.js";import{P as Kt}from"./CVx5OKWy.js";import{h as Ot}from"./B0S6NxMp.js";import{t as Ft}from"./DAsc1V4f.js";function Bt(a,n){return a?.isExternalLink===!0&&typeof a.workspaceId=="string"&&a.workspaceId?a.workspaceId:n||void 0}function Ht(a,n,o){const u=a.label||a.id||"mention";if(a.type==="member")return gt(u);if(a.type==="note"&&a.id&&o){const s=Bt(a.meta,n),v=s?o(s,a.id)?.trim():void 0;if(v)return v}return u}function Gn(a,n,o){if(typeof document>"u"||!a.includes('data-type="note"'))return a;const u=document.createElement("template");u.innerHTML=a;let s=!1;for(const v of u.content.querySelectorAll('[data-mention][data-type="note"]')){let b=null;try{b=JSON.parse(v.getAttribute("data-meta")||"{}")}catch{b=null}const P=v.textContent??"",M=Ht({type:"note",id:v.getAttribute("data-id"),label:P,meta:b},n,o);M!==P&&(v.textContent=M,s=!0)}return s?u.innerHTML:a}const Jn=(a,n)=>{let o;try{o=ht().state}catch{return}const u=o?.workspaceNotes?.byWorkspaceId?.[a]?.notes;return u?pt(u,n)?.title:void 0};let Oe=null;var jt=X('<p class="mt-2 max-w-[90vw] rounded-md bg-black/60 px-3 py-1.5 text-center text-sm text-white"> </p>'),Dt=X('<div data-media-lightbox-root="" data-image-lightbox-root="" class="fixed inset-0 z-[1000] flex cursor-zoom-out flex-col items-center justify-center bg-black/80 p-4 backdrop-blur-sm" style="pointer-events: auto;" role="dialog" aria-modal="true" tabindex="-1"><div class="absolute right-4 top-4 z-[1002] flex items-center gap-1"><!> <!></div> <div class="flex min-h-0 w-full flex-1 items-center justify-center"><!></div> <!></div>');function Ye(a,n){if(new.target)return Te({component:Ye,...a});Se(n,!0);let o=h(n,"open",15,!1),u=h(n,"ariaLabel",7),s=h(n,"closeLabel",7),v=h(n,"onClose",7),b=h(n,"openerElement",7,null),P=h(n,"children",7),M=h(n,"actions",7),F=h(n,"caption",7),U=h(n,"onKeydown",7),R=h(n,"onCopy",7);const y=St(),f=Nt(()=>N());let A=J(null),S=J(null);const D=Symbol("media-lightbox");let Z=!1;function N({handoff:r=!1}={}){o()&&(Z=r,Oe?.source===D&&(Oe=null),o(!1),v()?.(),!r&&b()?.isConnected&&b().focus({preventScroll:!0}))}function d(r){Oe={source:D,close:()=>N({handoff:!0})},r.scrollIntoView({block:"nearest"}),r.click()}function B(r,p,L){return Z?{duration:0}:Rt(r,{tier:"moderate"},L)}bt(()=>{if(!o())return;const r=Oe;Z=r!==null&&r.source!==D,Z&&r&&(Oe=null,r.close())});function Y(r){(r.target instanceof Element?r.target:null)?.closest('[data-media-lightbox-content], [role="toolbar"], button, input')||N()}function q(r){if(U()?.(r),r.defaultPrevented||r.key!=="Tab"||!e(A))return;const p=Array.from(e(A).querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')),L=p[0],I=p[p.length-1];!L||!I||(r.shiftKey&&document.activeElement===L?(r.preventDefault(),I.focus()):!r.shiftKey&&document.activeElement===I&&(r.preventDefault(),L.focus()))}ye(()=>{if(o())return Xe(()=>N())}),ye(()=>{!o()||!e(S)||requestAnimationFrame(()=>e(S)?.focus())});var g={handOffTo:d,get open(){return o()},set open(r=!1){o(r),_()},get ariaLabel(){return u()},set ariaLabel(r){u(r),_()},get closeLabel(){return s()},set closeLabel(r){s(r),_()},get onClose(){return v()},set onClose(r){v(r),_()},get openerElement(){return b()},set openerElement(r=null){b(r),_()},get children(){return P()},set children(r){P(r),_()},get actions(){return M()},set actions(r){M(r),_()},get caption(){return F()},set caption(r){F(r),_()},get onKeydown(){return U()},set onKeydown(r){U(r),_()},get onCopy(){return R()},set onCopy(r){R(r),_()},$set:Ue,$on:(r,p)=>Re(n,r,p)},i=ke(),w=oe(i);{var l=r=>{{let p=E(()=>y?.target()??"body");Kt(r,{get target(){return e(p)},zIndex:1e3,children:(L,I)=>{var z=Dt(),W=ve(z),ne=ve(W);{var re=C=>{var $=ke(),G=oe($);De(G,M),x(C,$)};te(ne,C=>{M()&&C(re)})}var ue=O(ne,2);Ee(ue,{variant:"ghost",size:"icon",class:"text-white hover:bg-white/20 hover:text-white",onclick:()=>N(),get"aria-label"(){return s()},get ref(){return e(S)},set ref(C){k(S,C,!0)},children:(C,$)=>{Ae(C,{get icon(){return Lt},size:"lg"})},$$slots:{default:!0}}),he(W),We(W,C=>f?.(C));var le=O(W,2),xe=ve(le);De(xe,P),he(le),We(le,C=>f?.(C));var se=O(le,2);{var ge=C=>{var $=jt(),G=Ce($,!0);Q(()=>ie(G,F())),x(C,$)};te(se,C=>{F()&&C(ge)})}he(z),Ke(z,C=>k(A,C),()=>e(A)),Q(()=>Le(z,"aria-label",u())),Me("click",z,Y),Me("keydown",z,q),Fe("copy",z,function(...C){R()?.apply(this,C)}),Ut(3,z,()=>B),x(L,z)},$$slots:{default:!0}})}};te(w,r=>{o()&&r(l)})}return x(a,i),Ne(g)}Ve(["click","keydown"]);function qe(a){if(!a.startsWith("workspace-file://"))return null;const o=a.slice(17).split(/[?#]/)[0].split("/"),u=o[0],s=o.slice(1);if(!u||s.length===0)return null;const v=[];for(const b of s){if(!b)return null;try{v.push(decodeURIComponent(b))}catch{return null}}return{workspaceId:u,path:v.join("/")}}function st(a){try{return new URL(a).protocol==="https:"}catch{return!1}}function Ze(a){const n=/^data:([^;,]+);base64,(.*)$/s.exec(a);return n?{mimeType:n[1],base64:n[2]}:null}function je(a){return st(a)||qe(a)!==null||/^workspace-asset:\/\/[^/?#]+/.test(a)||/^data:image\/[a-z0-9.+-]+(?:;[^,]*)?,/i.test(a)}function ct(a){if(a.length===0)return 0;let n=0;return a.endsWith("==")?n=2:a.endsWith("=")&&(n=1),Math.floor(a.length*3/4)-n}function Wt(a,n){const o=atob(a),u=new Uint8Array(o.length);for(let s=0;s<o.length;s++)u[s]=o.charCodeAt(s);return new Blob([u],{type:n})}const Zt={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/avif":"avif","image/bmp":"bmp"};function Vt(a){if(a.workspacePath){const s=a.workspacePath.split("/").pop();if(s)return s}const n=(a.imageName||"image").replace(/[/\\]/g,"_");if(/\.[A-Za-z0-9]+$/.test(n))return n;const o=a.mimeType?.split(";")[0].trim().toLowerCase(),u=o&&Zt[o]||"png";return`${n}.${u}`}var Xt=X('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="image-info-dimensions"> </div>'),Yt=X('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="image-info-size"> </div>'),qt=X("<!> <!> <!>",1),Gt=X("<!> <!> <!> <!>",1),Jt=X("<!> <!>",1);function ut(a,n){if(new.target)return Te({component:ut,...a});Se(n,!0);let o=h(n,"imageUrl",7),u=h(n,"imageName",7),s=h(n,"open",15,!1),v=h(n,"triggerClass",7),b=h(n,"contentClass",7);const P=E(()=>Ze(o())),M=E(()=>qe(o())),F=E(()=>st(o()));let U=J(null),R=J(null),y=null;function f(){if(y===o())return;const l=y=o();k(U,null),k(R,e(P)?ct(e(P).base64):null,!0);const r=new Image;r.onload=()=>{y===l&&k(U,{width:r.naturalWidth,height:r.naturalHeight},!0)},r.src=o(),e(P)||fetch(o()).then(p=>p.ok?p.blob():null).then(p=>{p&&y===l&&k(R,p.size,!0)}).catch(()=>{})}ye(()=>{s()&&f()}),ye(()=>{if(s())return Xe(()=>{s(!1)})});async function A(l=o()){const r=Ze(l);if(r)return Wt(r.base64,r.mimeType);const p=await fetch(l);if(!p.ok)throw new Error(`Image fetch failed: ${p.status}`);return await p.blob()}async function S(){let l=null;try{let r=o(),p=e(P)?.mimeType;if(!e(P)){const I=await A();p=I.type,l=URL.createObjectURL(I),r=l}const L=document.createElement("a");L.href=r,L.download=Vt({workspacePath:e(M)?.path,imageName:u(),mimeType:p}),document.body.appendChild(L);try{L.click()}finally{L.remove()}}catch{we.error(m.ui_imageActionsMenu_downloadFailed_error())}finally{l&&URL.revokeObjectURL(l)}}async function D(){if(e(M))try{await He(e(M).path),we.success(m.ui_imageActionsMenu_pathCopied_label())}catch{we.error(m.ui_imageActionsMenu_copyFailed_error())}}async function Z(){if(e(F))try{await He(o()),we.success(m.ui_imageActionsMenu_linkCopied_label())}catch{we.error(m.ui_imageActionsMenu_copyFailed_error())}}async function N(l){let r,p;try{let L;if(l.type.split(";")[0].trim()==="image/svg+xml"){p=URL.createObjectURL(l);const W=new Image;W.src=p,await W.decode(),L=W}else L=r=await createImageBitmap(l);const I=document.createElement("canvas");I.width=L instanceof HTMLImageElement?L.naturalWidth:L.width,I.height=L instanceof HTMLImageElement?L.naturalHeight:L.height;const z=I.getContext("2d");if(!z)throw new Error("2d canvas context unavailable");return z.drawImage(L,0,0),await new Promise((W,ne)=>{I.toBlob(re=>re?W(re):ne(new Error("canvas toBlob failed")),"image/png")})}finally{r?.close(),p&&URL.revokeObjectURL(p)}}async function d(l=o()){try{let r=await A(l);r.type!=="image/png"&&(r=await N(r)),await navigator.clipboard.write([new ClipboardItem({"image/png":r})]),we.success(m.ui_imageActionsMenu_imageCopied_label())}catch{we.error(m.ui_imageActionsMenu_copyFailed_error())}}function B(l,r=o()){return l.defaultPrevented||!je(r)||l instanceof KeyboardEvent&&(l.key.toLowerCase()!=="c"||!(l.metaKey||l.ctrlKey)||l.altKey||l.shiftKey||l.isComposing)||xt(l.target)||document.getSelection()?.toString()?!1:(l.preventDefault(),l.stopPropagation(),l instanceof KeyboardEvent&&l.repeat||(d(r),s(!1)),!0)}var Y={handleCopy:B,get imageUrl(){return o()},set imageUrl(l){o(l),_()},get imageName(){return u()},set imageName(l){u(l),_()},get open(){return s()},set open(l=!1){s(l),_()},get triggerClass(){return v()},set triggerClass(l){v(l),_()},get contentClass(){return b()},set contentClass(l){b(l),_()},$set:Ue,$on:(l,r)=>Re(n,l,r)},q=ke(),g=oe(q);{var i=l=>{var r=ke(),p=oe(r);me(p,()=>it,(L,I)=>{I(L,{get open(){return s()},set open(z){s(z)},children:(z,W)=>{var ne=Jt(),re=oe(ne);{const le=(se,ge)=>{let C=()=>(ge?.()).props;{let $=E(()=>m.ui_imageActionsMenu_trigger_ariaLabel());Ee(se,_t(C,{variant:"plain",size:"icon-sm",wrapContent:!1,get active(){return s()},get"aria-label"(){return e($)},children:(G,j)=>{at(G,{class:"size-3.5"})},$$slots:{default:!0}}))}};let xe=E(()=>et("flex h-7 w-7 items-center justify-center rounded-md bg-black/60 text-white","hover:bg-black/75",v()));me(re,()=>nt,(se,ge)=>{ge(se,{get class(){return e(xe)},onclick:C=>C.stopPropagation(),onkeydown:C=>B(C),oncopy:C=>B(C),child:le,$$slots:{child:!0}})})}var ue=O(re,2);me(ue,()=>rt,(le,xe)=>{xe(le,{get class(){return b()},align:"end",onkeydown:se=>B(se),oncopy:se=>B(se),children:(se,ge)=>{var C=Gt(),$=oe(C);me($,()=>$e,(H,ee)=>{ee(H,{onSelect:()=>void S(),children:(K,V)=>{Ie();var ae=ze();Q(ce=>ie(ae,ce),[()=>m.ui_imageActionsMenu_download_label()]),x(K,ae)},$$slots:{default:!0}})});var G=O($,2);me(G,()=>$e,(H,ee)=>{ee(H,{onSelect:()=>void d(),children:(K,V)=>{Ie();var ae=ze();Q(ce=>ie(ae,ce),[()=>m.ui_imageActionsMenu_copyImage_label()]),x(K,ae)},$$slots:{default:!0}})});var j=O(G,2);{var de=H=>{var ee=ke(),K=oe(ee);me(K,()=>$e,(V,ae)=>{ae(V,{onSelect:()=>void D(),children:(ce,t)=>{Ie();var c=ze();Q(T=>ie(c,T),[()=>m.ui_imageActionsMenu_copyPath_label()]),x(ce,c)},$$slots:{default:!0}})}),x(H,ee)},_e=H=>{var ee=ke(),K=oe(ee);me(K,()=>$e,(V,ae)=>{ae(V,{onSelect:()=>void Z(),children:(ce,t)=>{Ie();var c=ze();Q(T=>ie(c,T),[()=>m.ui_imageActionsMenu_copyLink_label()]),x(ce,c)},$$slots:{default:!0}})}),x(H,ee)};te(j,H=>{e(M)?H(de):e(F)&&H(_e,1)})}var fe=O(j,2);{var Pe=H=>{var ee=qt(),K=oe(ee);me(K,()=>ot,(c,T)=>{T(c,{})});var V=O(K,2);{var ae=c=>{var T=Xt(),pe=Ce(T,!0);Q(be=>ie(pe,be),[()=>m.ui_imageActionsMenu_dimensions_label({width:Be(e(U).width),height:Be(e(U).height)})]),x(c,T)};te(V,c=>{e(U)&&c(ae)})}var ce=O(V,2);{var t=c=>{var T=Yt(),pe=Ce(T,!0);Q(be=>ie(pe,be),[()=>lt(e(R))]),x(c,T)};te(ce,c=>{e(R)!==null&&c(t)})}x(H,ee)};te(fe,H=>{(e(U)||e(R)!==null)&&H(Pe)})}x(se,C)},$$slots:{default:!0}})}),x(z,ne)},$$slots:{default:!0}})}),x(l,r)},w=E(()=>je(o()));te(g,l=>{e(w)&&l(i)})}return x(a,q),Ne(Y)}var Qt=X('<div role="application" tabindex="0" data-testid="zoom-pan-viewport"><div class="flex h-full w-full items-center justify-center will-change-transform" data-testid="zoom-pan-content"><!></div> <div class="absolute bottom-4 left-1/2 z-10 flex -translate-x-1/2 cursor-default items-center gap-2 rounded-full bg-black/60 px-3 py-1.5 backdrop-blur-sm" role="toolbar" tabindex="-1" data-testid="zoom-pan-controls"><!> <div class="w-36"><!></div> <!> <span class="min-w-12 text-center text-xs tabular-nums text-white/90" data-testid="zoom-pan-percent"> </span> <!></div></div>');function dt(a,n){if(new.target)return Te({component:dt,...a});Se(n,!0);let o=h(n,"children",7),u=h(n,"minZoom",7,.25),s=h(n,"maxZoom",7,8),v=h(n,"onScaleChange",7),b=h(n,"pannable",15,!1);const P=1.25,M=.0015,F=.01,U=4,R=.5;let y=J(1),f=J(0),A=J(0),S=J(!1),D=J(null),Z=J(null),N=J(Qe({width:0,height:0})),d=J(Qe({width:0,height:0}));const B=E(()=>e(d).width*e(y)>e(N).width+R),Y=E(()=>e(d).height*e(y)>e(N).height+R);ye(()=>{v()?.(e(y))}),ye(()=>{b(e(B)||e(Y))});function q(){e(D)&&k(N,{width:e(D).clientWidth,height:e(D).clientHeight},!0);const t=e(Z)?.firstElementChild;if(t instanceof HTMLElement)k(d,{width:t.offsetWidth,height:t.offsetHeight},!0);else if(t){const c=t.getBoundingClientRect();k(d,{width:c.width/e(y),height:c.height/e(y)},!0)}}function g(t,c,T){const pe=c*(1-e(y))/2,be=T*e(y)-c;return be<=R?pe:Math.min(pe+be/2,Math.max(pe-be/2,t))}function i(){k(f,g(e(f),e(N).width,e(d).width),!0),k(A,g(e(A),e(N).height,e(d).height),!0)}ye(()=>{const t=e(D),c=e(Z);if(!t||!c||typeof ResizeObserver>"u")return;const T=new ResizeObserver(()=>{q(),i()});return T.observe(t),c.firstElementChild&&T.observe(c.firstElementChild),()=>T.disconnect()});let w=null,l=0,r=0,p=0,L=!1;const I=E(()=>kt(e(y),{style:"percent",maximumFractionDigits:0}));function z(t){return Math.min(s(),Math.max(u(),t))}function W(t,c,T){const pe=z(T),be=e(D)?.getBoundingClientRect(),Ge=be?t-be.left:0,Je=be?c-be.top:0;q(),k(f,Ge-(Ge-e(f))/e(y)*pe),k(A,Je-(Je-e(A))/e(y)*pe),k(y,pe,!0),i()}function ne(t){const c=e(D)?.getBoundingClientRect();c?W(c.left+c.width/2,c.top+c.height/2,t):(k(y,z(t),!0),i())}function re(){k(y,1),k(f,0),k(A,0)}function ue(t){t.preventDefault();const c=t.ctrlKey?F:M;W(t.clientX,t.clientY,e(y)*Math.exp(-t.deltaY*c))}ye(()=>{const t=e(D);if(t)return t.addEventListener("wheel",ue,{passive:!1}),()=>t.removeEventListener("wheel",ue)});function le(t){if(t.metaKey||t.ctrlKey||t.altKey)return!1;if(t.key==="+"||t.key==="=")ne(e(y)*P);else if(t.key==="-")ne(e(y)/P);else if(t.key==="0")re();else return!1;return t.preventDefault(),!0}function xe(t){if(t.button>0||(q(),!e(B)&&!e(Y)))return;t.preventDefault(),k(S,!0),w=t.pointerId,l=t.clientX,r=t.clientY,p=0;const c=t.currentTarget;typeof c.setPointerCapture=="function"&&c.setPointerCapture(t.pointerId)}function se(t){if(!e(S)||t.pointerId!==w)return;const c=t.clientX-l,T=t.clientY-r;p+=Math.abs(c)+Math.abs(T),k(f,e(f)+c),k(A,e(A)+T),i(),l=t.clientX,r=t.clientY}function ge(t){if(!e(S)||t.pointerId!==w)return;k(S,!1),w=null,p>U&&(L=!0);const c=t.currentTarget;typeof c.hasPointerCapture=="function"&&typeof c.releasePointerCapture=="function"&&c.hasPointerCapture(t.pointerId)&&c.releasePointerCapture(t.pointerId)}function C(t){L&&(L=!1,t.preventDefault(),t.stopPropagation())}function $(t){const c=Number.parseFloat(t.currentTarget.value);Number.isFinite(c)&&ne(c)}var G={handleKeydown:le,get children(){return o()},set children(t){o(t),_()},get minZoom(){return u()},set minZoom(t=.25){u(t),_()},get maxZoom(){return s()},set maxZoom(t=8){s(t),_()},get onScaleChange(){return v()},set onScaleChange(t){v(t),_()},get pannable(){return b()},set pannable(t=!1){b(t),_()},$set:Ue,$on:(t,c)=>Re(n,t,c)},j=Qt(),de=ve(j),_e=ve(de);De(_e,o),he(de),Ke(de,t=>k(Z,t),()=>e(Z));var fe=O(de,2),Pe=ve(fe);{let t=E(()=>m.ui_zoomPanViewport_zoomOut_ariaLabel()),c=E(()=>m.ui_zoomPanViewport_zoomOut_ariaLabel());Ee(Pe,{variant:"ghost",size:"icon-sm",class:"text-white hover:bg-white/20 hover:text-white",onclick:()=>ne(e(y)/P),get"aria-label"(){return e(t)},get title(){return e(c)},children:(T,pe)=>{Ae(T,{get icon(){return Pt}})},$$slots:{default:!0}})}var H=O(Pe,2),ee=ve(H);{let t=E(()=>m.ui_zoomPanViewport_zoomSlider_ariaLabel()),c=E(()=>m.ui_zoomPanViewport_zoomSlider_ariaLabel());Tt(ee,{class:"accent-white",get min(){return u()},get max(){return s()},step:"0.01",get value(){return e(y)},oninput:$,get"aria-label"(){return e(t)},get title(){return e(c)},"data-testid":"zoom-pan-slider"})}he(H);var K=O(H,2);{let t=E(()=>m.ui_zoomPanViewport_zoomIn_ariaLabel()),c=E(()=>m.ui_zoomPanViewport_zoomIn_ariaLabel());Ee(K,{variant:"ghost",size:"icon-sm",class:"text-white hover:bg-white/20 hover:text-white",onclick:()=>ne(e(y)*P),get"aria-label"(){return e(t)},get title(){return e(c)},children:(T,pe)=>{Ae(T,{get icon(){return Mt}})},$$slots:{default:!0}})}var V=O(K,2),ae=Ce(V,!0),ce=O(V,2);{let t=E(()=>m.ui_zoomPanViewport_resetZoom_ariaLabel()),c=E(()=>m.ui_zoomPanViewport_resetZoom_ariaLabel());Ee(ce,{variant:"ghost",size:"icon-sm",class:"text-white hover:bg-white/20 hover:text-white",onclick:re,get"aria-label"(){return e(t)},get title(){return e(c)},children:(T,pe)=>{Ae(T,{get icon(){return At}})},$$slots:{default:!0}})}return he(fe),he(j),Ke(j,t=>k(D,t),()=>e(D)),Q((t,c)=>{tt(j,1,`relative h-full w-full touch-none select-none overflow-hidden ${e(S)?"cursor-grabbing":b()?"cursor-grab":""}`),Le(j,"aria-label",t),yt(de,`transform: translate(${e(f)??""}px, ${e(A)??""}px) scale(${e(y)??""}); transform-origin: 0 0;`),Le(fe,"aria-label",c),ie(ae,e(I))},[()=>m.ui_zoomPanViewport_viewport_ariaLabel(),()=>m.ui_zoomPanViewport_controls_ariaLabel()]),Me("pointerdown",j,xe),Me("pointermove",j,se),Me("pointerup",j,ge),Fe("pointercancel",j,ge),Fe("click",j,C,!0),Me("keydown",j,le),Me("pointerdown",fe,t=>t.stopPropagation()),x(a,j),Ne(G)}Ve(["pointerdown","pointermove","pointerup","keydown"]);const en="data-lightbox-gallery",ft="data-lightbox-opener",tn=`[${ft}], .markdown-content img`;function nn(a){return a.hasAttribute(ft)?!(a instanceof HTMLButtonElement&&a.disabled):a instanceof HTMLImageElement&&!a.closest("a")&&je(a.getAttribute("src")||"")}function rn(a,n){const o=a?.closest(`[${en}]`);if(!a||!o)return null;const u=Array.from(o.querySelectorAll(tn)).filter(nn),s=u.findIndex(v=>v===a||v.contains(a));return s<0?null:u[s+n]??null}var an=X('<img data-media-lightbox-content=""/>');function on(a,n){if(new.target)return Te({component:on,...a});Se(n,!0);const o=d=>{var B=ke(),Y=oe(B);{var q=g=>{Ke(ut(g,{get imageUrl(){return s()},get imageName(){return v()},triggerClass:"h-9 w-9 bg-white/0 hover:bg-white/20",contentClass:"z-[1003]",get open(){return e(f)},set open(i){k(f,i,!0)}}),i=>k(y,i,!0),()=>e(y))};te(Y,g=>{M()&&g(q)})}x(d,B)};let u=h(n,"open",15,!1),s=h(n,"imageUrl",7),v=h(n,"imageName",23,()=>m.ui_imageLightbox_image_alt()),b=h(n,"onClose",7),P=h(n,"openerElement",7,null),M=h(n,"showActionsMenu",7,!1),F=J(void 0),U=J(void 0),R=J(!1),y=J(void 0),f=J(!1);ye(()=>{u()||k(f,!1)});function A(d){D(d),!d.defaultPrevented&&(e(U)?.handleKeydown(d)||S(d))}function S(d){if(d.key!=="ArrowLeft"&&d.key!=="ArrowRight"||d.metaKey||d.ctrlKey||d.altKey||d.shiftKey||e(f)||d.target instanceof HTMLInputElement)return;const B=rn(P(),d.key==="ArrowLeft"?-1:1);B&&(d.preventDefault(),e(F)?.handOffTo(B))}function D(d){u()&&M()&&e(y)?.handleCopy(d)}function Z(d){!M()||!je(s())||(d.preventDefault(),d.stopPropagation(),k(f,!0))}var N={get open(){return u()},set open(d=!1){u(d),_()},get imageUrl(){return s()},set imageUrl(d){s(d),_()},get imageName(){return v()},set imageName(d=m.ui_imageLightbox_image_alt()){v(d),_()},get onClose(){return b()},set onClose(d){b(d),_()},get openerElement(){return P()},set openerElement(d=null){P(d),_()},get showActionsMenu(){return M()},set showActionsMenu(d=!1){M(d),_()},$set:Ue,$on:(d,B)=>Re(n,d,B)};{let d=E(()=>m.ui_imageLightbox_preview_ariaLabel()),B=E(()=>m.ui_imageLightbox_close_ariaLabel());Ke(Ye(a,{get ariaLabel(){return e(d)},get closeLabel(){return e(B)},get onClose(){return b()},get openerElement(){return P()},get actions(){return o},onKeydown:A,onCopy:D,get open(){return u()},set open(Y){u(Y)},children:(Y,q)=>{var g=ke(),i=oe(g);wt(i,s,w=>{Ke(dt(w,{get pannable(){return e(R)},set pannable(l){k(R,l,!0)},children:(l,r)=>{var p=an();Q(()=>{Le(p,"src",s()),Le(p,"alt",v()),tt(p,1,`max-h-[90vh] max-w-[90vw] rounded-lg object-contain ${e(R)?"":"cursor-default"}`),Le(p,"draggable",!e(R))}),Me("contextmenu",p,Z),x(l,p)},$$slots:{default:!0}}),l=>k(U,l,!0),()=>e(U))}),x(Y,g)},$$slots:{default:!0}}),Y=>k(F,Y,!0),()=>e(F))}return Ne(N)}Ve(["contextmenu"]);var ln=X('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="video-info-duration"> </div>'),sn=X('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="video-info-dimensions"> </div>'),cn=X('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="video-info-size"> </div>'),un=X("<!> <!> <!> <!>",1),dn=X("<!> <!> <!>",1),fn=X("<!> <!>",1);function mt(a,n){if(new.target)return Te({component:mt,...a});Se(n,!0);let o=h(n,"videoUrl",7),u=h(n,"videoName",7),s=h(n,"sourceKind",7),v=h(n,"mimeType",7),b=h(n,"open",15,!1),P=h(n,"triggerClass",7),M=h(n,"contentClass",7);const F=E(()=>Ze(o())),U=E(()=>qe(o())),R=E(()=>s()??(e(F)?"inline":e(U)?"workspace":"remote"));let y=J(null),f=J(null),A=J(null),S=null;function D(){if(S===o())return;const g=S=o();k(y,null),k(f,null),k(A,e(F)?ct(e(F).base64):null,!0);const i=document.createElement("video");i.preload="metadata",i.onloadedmetadata=()=>{S===g&&(Number.isFinite(i.duration)&&i.duration>0&&k(y,i.duration,!0),i.videoWidth>0&&i.videoHeight>0&&k(f,{width:i.videoWidth,height:i.videoHeight},!0))},i.src=o(),e(F)||fetch(o()).then(w=>w.ok?w.blob():null).then(w=>{w&&S===g&&k(A,w.size,!0)}).catch(()=>{})}function Z(){const g=e(U)?.path.split("/").pop();if(g)return g;const i=(u()||"video").replace(/[/\\]/g,"_");if(/\.[A-Za-z0-9]+$/.test(i))return i;const w=(v()??e(F)?.mimeType)==="video/webm"?"webm":"mp4";return`${i}.${w}`}async function N(){let g=null;try{let i=o();if(!e(F)){const l=await fetch(o());if(!l.ok)throw new Error(`Video fetch failed: ${l.status}`);g=URL.createObjectURL(await l.blob()),i=g}const w=document.createElement("a");w.href=i,w.download=Z(),document.body.appendChild(w),w.click(),w.remove(),g&&URL.revokeObjectURL(g)}catch{g&&URL.revokeObjectURL(g),we.error(m.ui_videoActionsMenu_downloadFailed_error())}}async function d(g,i){try{await He(g),we.success(i)}catch{we.error(m.ui_videoActionsMenu_copyFailed_error())}}ye(()=>{b()&&D()}),ye(()=>{if(b())return Xe(()=>{b(!1)})});var B={get videoUrl(){return o()},set videoUrl(g){o(g),_()},get videoName(){return u()},set videoName(g){u(g),_()},get sourceKind(){return s()},set sourceKind(g){s(g),_()},get mimeType(){return v()},set mimeType(g){v(g),_()},get open(){return b()},set open(g=!1){b(g),_()},get triggerClass(){return P()},set triggerClass(g){P(g),_()},get contentClass(){return M()},set contentClass(g){M(g),_()},$set:Ue,$on:(g,i)=>Re(n,g,i)},Y=ke(),q=oe(Y);return me(q,()=>it,(g,i)=>{i(g,{get open(){return b()},set open(w){b(w)},children:(w,l)=>{var r=fn(),p=oe(r);{let I=E(()=>et("flex h-7 w-7 items-center justify-center rounded-md bg-black/60 text-white","hover:bg-black/75",P())),z=E(()=>m.ui_videoActionsMenu_trigger_ariaLabel());me(p,()=>nt,(W,ne)=>{ne(W,{get class(){return e(I)},get"aria-label"(){return e(z)},onclick:re=>re.stopPropagation(),children:(re,ue)=>{at(re,{class:"size-3.5"})},$$slots:{default:!0}})})}var L=O(p,2);me(L,()=>rt,(I,z)=>{z(I,{get class(){return M()},align:"end",children:(W,ne)=>{var re=dn(),ue=oe(re);me(ue,()=>$e,($,G)=>{G($,{onSelect:()=>void N(),children:(j,de)=>{Ie();var _e=ze();Q(fe=>ie(_e,fe),[()=>m.ui_videoActionsMenu_download_label()]),x(j,_e)},$$slots:{default:!0}})});var le=O(ue,2);{var xe=$=>{var G=ke(),j=oe(G);me(j,()=>$e,(de,_e)=>{_e(de,{onSelect:()=>void d(e(U).path,m.ui_videoActionsMenu_pathCopied_label()),children:(fe,Pe)=>{Ie();var H=ze();Q(ee=>ie(H,ee),[()=>m.ui_videoActionsMenu_copyPath_label()]),x(fe,H)},$$slots:{default:!0}})}),x($,G)},se=$=>{var G=ke(),j=oe(G);me(j,()=>$e,(de,_e)=>{_e(de,{onSelect:()=>void d(o(),m.ui_videoActionsMenu_linkCopied_label()),children:(fe,Pe)=>{Ie();var H=ze();Q(ee=>ie(H,ee),[()=>m.ui_videoActionsMenu_copyLink_label()]),x(fe,H)},$$slots:{default:!0}})}),x($,G)};te(le,$=>{e(R)==="workspace"&&e(U)?$(xe):e(R)==="remote"&&$(se,1)})}var ge=O(le,2);{var C=$=>{var G=un(),j=oe(G);me(j,()=>ot,(K,V)=>{V(K,{})});var de=O(j,2);{var _e=K=>{var V=ln(),ae=Ce(V,!0);Q(ce=>ie(ae,ce),[()=>m.ui_videoActionsMenu_duration_label({duration:Ct(e(y)*1e3)})]),x(K,V)};te(de,K=>{e(y)!==null&&K(_e)})}var fe=O(de,2);{var Pe=K=>{var V=sn(),ae=Ce(V,!0);Q(ce=>ie(ae,ce),[()=>m.ui_videoActionsMenu_dimensions_label({width:Be(e(f).width),height:Be(e(f).height)})]),x(K,V)};te(fe,K=>{e(f)&&K(Pe)})}var H=O(fe,2);{var ee=K=>{var V=cn(),ae=Ce(V,!0);Q(ce=>ie(ae,ce),[()=>lt(e(A))]),x(K,V)};te(H,K=>{e(A)!==null&&K(ee)})}x($,G)};te(ge,$=>{(e(y)!==null||e(f)||e(A)!==null)&&$(C)})}x(W,re)},$$slots:{default:!0}})}),x(w,r)},$$slots:{default:!0}})}),x(a,Y),Ne(B)}var mn=X('<p class="type-body text-white/80" role="status"> </p>'),gn=X('<div data-media-lightbox-content="" data-video-lightbox-root="" class="flex max-h-[90vh] max-w-[90vw] cursor-default flex-col items-center gap-3"><video controls="" preload="metadata" playsinline="" class="max-h-[85vh] max-w-[90vw] rounded-lg bg-black object-contain shadow-(--elevation-overlay)" data-testid="chat-video-player"> </video> <!></div>',2);function pn(a,n){if(new.target)return Te({component:pn,...a});Se(n,!0);const o=f=>{mt(f,{get videoUrl(){return s()},get videoName(){return v()},get sourceKind(){return P()},get mimeType(){return M()},triggerClass:"h-9 w-9 bg-white/0 hover:bg-white/20",contentClass:"z-[1003]"})};let u=h(n,"open",15,!1),s=h(n,"videoUrl",7),v=h(n,"videoName",23,()=>m.chat_videoBlock_fromAgent_label()),b=h(n,"poster",7),P=h(n,"sourceKind",7),M=h(n,"mimeType",7),F=h(n,"openerElement",7,null),U=h(n,"onClose",7),R=J(!1);ye(()=>{!u()||!s()||k(R,!1)});var y={get open(){return u()},set open(f=!1){u(f),_()},get videoUrl(){return s()},set videoUrl(f){s(f),_()},get videoName(){return v()},set videoName(f=m.chat_videoBlock_fromAgent_label()){v(f),_()},get poster(){return b()},set poster(f){b(f),_()},get sourceKind(){return P()},set sourceKind(f){P(f),_()},get mimeType(){return M()},set mimeType(f){M(f),_()},get openerElement(){return F()},set openerElement(f=null){F(f),_()},get onClose(){return U()},set onClose(f){U(f),_()},$set:Ue,$on:(f,A)=>Re(n,f,A)};{let f=E(()=>m.chat_videoBlock_dialog_title({name:v()})),A=E(()=>m.chat_videoBlock_close_ariaLabel());Ye(a,{get ariaLabel(){return e(f)},get closeLabel(){return e(A)},get openerElement(){return F()},get onClose(){return U()},get actions(){return o},get open(){return u()},set open(S){u(S)},children:(S,D)=>{var Z=gn(),N=ve(Z),d=Ce(N,!0),B=O(N,2);{var Y=q=>{var g=mn(),i=Ce(g,!0);Q(w=>ie(i,w),[()=>m.chat_videoBlock_unavailable_description()]),x(q,g)};te(B,q=>{e(R)&&q(Y)})}he(Z),Q(q=>{Le(N,"src",s()),Le(N,"poster",b()),Le(N,"aria-label",v()),ie(d,q)},[()=>m.chat_videoBlock_unsupported_description()]),Fe("error",N,()=>k(R,!0)),x(S,Z)},$$slots:{default:!0}})}return Ne(y)}var vn=X('<span class="block truncate text-foreground"> </span>'),hn=X("<!> ",1),_n=X("<!> <!>",1),bn=X('<span class="flex shrink-0 flex-wrap items-center gap-1"><!> <!></span>'),wn=X('<div class="type-caption flex w-fit min-w-0 max-w-full items-center gap-3 whitespace-normal py-1 text-muted-foreground" role="status" data-testid="media-unavailable"><span class="flex min-w-0 max-w-full flex-1 items-start gap-2"><span class="first-line-icon" aria-hidden="true"><!></span> <span class="min-w-0"><!> <span class="block break-words"> </span></span></span> <!></div>');function yn(a,n){if(new.target)return Te({component:yn,...a});Se(n,!0);let o=h(n,"name",7),u=h(n,"reason",7),s=h(n,"path",7),v=h(n,"workspaceId",7),b=h(n,"onRetry",7);const P=E(()=>u()==="missing"?m.ui_mediaUnavailable_missing_description():u()==="unsupported"?m.ui_mediaUnavailable_unsupported_description():u()==="other-workspace"?m.ui_mediaUnavailable_otherWorkspace_description():u()==="invalid-link"?m.ui_mediaUnavailable_invalidLink_description():m.ui_mediaUnavailable_loadFailed_description());function M(i){i.preventDefault(),i.stopPropagation()}function F(i){M(i),b()?.()}async function U(i){if(M(i),!!s())try{await He(s()),we.success(m.ui_imageActionsMenu_pathCopied_label())}catch{we.error(m.ui_imageActionsMenu_copyFailed_error())}}function R(i){if(M(i),!s()||!v())return;const w=s().split("/").map(encodeURIComponent).join("/");Ot(`intent://local/file/${w}`,{workspaceId:vt(v())})}var y={get name(){return o()},set name(i){o(i),_()},get reason(){return u()},set reason(i){u(i),_()},get path(){return s()},set path(i){s(i),_()},get workspaceId(){return v()},set workspaceId(i){v(i),_()},get onRetry(){return b()},set onRetry(i){b(i),_()},$set:Ue,$on:(i,w)=>Re(n,i,w)},f=wn(),A=ve(f),S=ve(A),D=ve(S);Ae(D,{get icon(){return Et},class:"size-3.5"}),he(S);var Z=O(S,2),N=ve(Z);{var d=i=>{var w=vn(),l=Ce(w,!0);We(w,(r,p)=>Ft?.(r,p),o),Q(()=>ie(l,o())),x(i,w)};te(N,i=>{o()&&i(d)})}var B=O(N,2),Y=Ce(B,!0);he(Z),he(A);var q=O(A,2);{var g=i=>{var w=bn(),l=ve(w);{var r=I=>{{let z=E(()=>m.chat_shared_retry_label());Ee(I,{variant:"ghost",size:"icon-compact",get tooltip(){return e(z)},onclick:F,children:(W,ne)=>{Ae(W,{get icon(){return It},size:"xs"})},$$slots:{default:!0}})}};te(l,I=>{b()&&I(r)})}var p=O(l,2);{var L=I=>{var z=_n(),W=oe(z);{var ne=ue=>{Ee(ue,{variant:"ghost",size:"compact",onclick:R,children:(le,xe)=>{var se=hn(),ge=oe(se);Ae(ge,{get icon(){return $t},size:"xs"});var C=O(ge);Q($=>ie(C,` ${$??""}`),[()=>m.chat_changesPanel_openFile_tooltip()]),x(le,se)},$$slots:{default:!0}})};te(W,ue=>{v()&&u()!=="other-workspace"&&u()!=="invalid-link"&&ue(ne)})}var re=O(W,2);{let ue=E(()=>m.ui_imageActionsMenu_copyPath_label());Ee(re,{variant:"ghost",size:"icon-compact",get tooltip(){return e(ue)},onclick:U,children:(le,xe)=>{Ae(le,{get icon(){return zt},size:"xs"})},$$slots:{default:!0}})}x(I,z)};te(p,I=>{s()&&I(L)})}he(w),x(i,w)};te(q,i=>{(b()||s())&&i(g)})}return he(f),Q(()=>{Le(f,"data-reason",u()),ie(Y,e(P))}),x(a,f),Ne(y)}export{ut as I,Ye as M,mt as V,dt as Z,on as a,yn as b,pn as c,ct as d,Wt as e,je as f,Ht as m,qe as p,Gn as r,Jn as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{I as pr}from"./DzNzbnYA.js";import{b as f,a$ as Er,X as j,aW as Kt,ay as nt,P as Ue,B as ur,h as fr,z as N,a_ as Ke,aZ as _r,b0 as gr,V as xr,U as yr,Y as Ir,ax as Rr,J as Or,r as Lr,aV as Ft,bh as Q,aa as tt,l as vt,aH as Ge,Z as br,W as zt,a7 as mr,aQ as Xe}from"./BZnji9hP.js";import{d as Sr,h as le,g as pt,e as Ar,a as he,b as de}from"./D8CQQUv8.js";var ne=(function(){var e=f(function(_t,w,C,D){for(C=C||{},D=_t.length;D--;C[_t[D]]=w);return C},"o"),t=[1,2],a=[1,3],r=[1,4],i=[2,4],o=[1,9],s=[1,11],n=[1,12],h=[1,14],d=[1,15],E=[1,17],u=[1,18],_=[1,19],L=[1,25],g=[1,26],R=[1,27],T=[1,28],O=[1,29],x=[1,30],m=[1,31],S=[1,32],b=[1,33],P=[1,34],k=[1,35],B=[1,36],V=[1,37],H=[1,38],z=[1,39],X=[1,40],et=[1,42],rt=[1,43],U=[1,44],ot=[1,45],at=[1,46],W=[1,47],M=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],Z=[1,56],Mt=[1,75],A=[1,81],v=[1,82],dt=[1,83],st=[1,84],K=[1,85],mt=[1,86],pe=[1,87],Ee=[1,88],ue=[1,89],fe=[1,90],_e=[1,91],ge=[1,92],xe=[1,93],ye=[1,94],Ie=[1,95],Re=[1,96],Oe=[1,97],Le=[1,98],be=[1,99],me=[1,100],Se=[1,101],Ae=[1,102],we=[1,103],Ne=[1,104],Pe=[1,105],ke=[1,106],De=[2,79],ve=[2,78],Pt=[4,5,17,51,53,54],Bt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],Ce=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],$t=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Me=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],jt=[5,52],F=[62,70,71,72,73],Be=[62,73],lt=[1,152],te={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:f(function(w,C,D,y,G,c,kt){var p=c.length-1;switch(G){case 3:return y.apply(c[p]),c[p];case 4:case 10:this.$=[];break;case 5:case 11:c[p-1].push(c[p]),this.$=c[p-1];break;case 6:case 7:case 12:case 13:this.$=c[p];break;case 8:case 9:case 14:this.$=[];break;case 16:c[p].type="createParticipant",this.$=c[p];break;case 17:c[p-1].unshift({type:"boxStart",boxData:y.parseBoxData(c[p-2])}),c[p-1].push({type:"boxEnd",boxText:c[p-2]}),this.$=c[p-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(c[p-2]),sequenceIndexStep:Number(c[p-1]),sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(c[p-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:y.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[p-1].actor};break;case 24:this.$={type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[p-1].actor};break;case 30:y.setDiagramTitle(c[p].substring(6)),this.$=c[p].substring(6);break;case 31:y.setDiagramTitle(c[p].substring(7)),this.$=c[p].substring(7);break;case 32:this.$=c[p].trim(),y.setAccTitle(this.$);break;case 33:case 34:this.$=c[p].trim(),y.setAccDescription(this.$);break;case 35:c[p-1].unshift({type:"loopStart",loopText:y.parseMessage(c[p-2]),signalType:y.LINETYPE.LOOP_START}),c[p-1].push({type:"loopEnd",loopText:c[p-2],signalType:y.LINETYPE.LOOP_END}),this.$=c[p-1];break;case 36:c[p-1].unshift({type:"rectStart",color:y.parseMessage(c[p-2]),signalType:y.LINETYPE.RECT_START}),c[p-1].push({type:"rectEnd",color:y.parseMessage(c[p-2]),signalType:y.LINETYPE.RECT_END}),this.$=c[p-1];break;case 37:c[p-1].unshift({type:"optStart",optText:y.parseMessage(c[p-2]),signalType:y.LINETYPE.OPT_START}),c[p-1].push({type:"optEnd",optText:y.parseMessage(c[p-2]),signalType:y.LINETYPE.OPT_END}),this.$=c[p-1];break;case 38:c[p-1].unshift({type:"altStart",altText:y.parseMessage(c[p-2]),signalType:y.LINETYPE.ALT_START}),c[p-1].push({type:"altEnd",signalType:y.LINETYPE.ALT_END}),this.$=c[p-1];break;case 39:c[p-1].unshift({type:"parStart",parText:y.parseMessage(c[p-2]),signalType:y.LINETYPE.PAR_START}),c[p-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[p-1];break;case 40:c[p-1].unshift({type:"parStart",parText:y.parseMessage(c[p-2]),signalType:y.LINETYPE.PAR_OVER_START}),c[p-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[p-1];break;case 41:c[p-1].unshift({type:"criticalStart",criticalText:y.parseMessage(c[p-2]),signalType:y.LINETYPE.CRITICAL_START}),c[p-1].push({type:"criticalEnd",signalType:y.LINETYPE.CRITICAL_END}),this.$=c[p-1];break;case 42:c[p-1].unshift({type:"breakStart",breakText:y.parseMessage(c[p-2]),signalType:y.LINETYPE.BREAK_START}),c[p-1].push({type:"breakEnd",optText:y.parseMessage(c[p-2]),signalType:y.LINETYPE.BREAK_END}),this.$=c[p-1];break;case 44:this.$=c[p-3].concat([{type:"option",optionText:y.parseMessage(c[p-1]),signalType:y.LINETYPE.CRITICAL_OPTION},c[p]]);break;case 46:this.$=c[p-3].concat([{type:"and",parText:y.parseMessage(c[p-1]),signalType:y.LINETYPE.PAR_AND},c[p]]);break;case 48:this.$=c[p-3].concat([{type:"else",altText:y.parseMessage(c[p-1]),signalType:y.LINETYPE.ALT_ELSE},c[p]]);break;case 49:c[p-3].draw="participant",c[p-3].type="addParticipant",c[p-3].description=y.parseMessage(c[p-1]),this.$=c[p-3];break;case 50:c[p-1].draw="participant",c[p-1].type="addParticipant",this.$=c[p-1];break;case 51:c[p-3].draw="actor",c[p-3].type="addParticipant",c[p-3].description=y.parseMessage(c[p-1]),this.$=c[p-3];break;case 52:case 57:c[p-1].draw="actor",c[p-1].type="addParticipant",this.$=c[p-1];break;case 53:c[p-1].type="destroyParticipant",this.$=c[p-1];break;case 54:c[p-3].draw="participant",c[p-3].type="addParticipant",c[p-3].description=y.parseMessage(c[p-1]),this.$=c[p-3];break;case 55:c[p-1].draw="participant",c[p-1].type="addParticipant",this.$=c[p-1];break;case 56:c[p-3].draw="actor",c[p-3].type="addParticipant",c[p-3].description=y.parseMessage(c[p-1]),this.$=c[p-3];break;case 58:this.$=[c[p-1],{type:"addNote",placement:c[p-2],actor:c[p-1].actor,text:c[p]}];break;case 59:c[p-2]=[].concat(c[p-1],c[p-1]).slice(0,2),c[p-2][0]=c[p-2][0].actor,c[p-2][1]=c[p-2][1].actor,this.$=[c[p-1],{type:"addNote",placement:y.PLACEMENT.OVER,actor:c[p-2].slice(0,2),text:c[p]}];break;case 60:this.$=[c[p-1],{type:"addLinks",actor:c[p-1].actor,text:c[p]}];break;case 61:this.$=[c[p-1],{type:"addALink",actor:c[p-1].actor,text:c[p]}];break;case 62:this.$=[c[p-1],{type:"addProperties",actor:c[p-1].actor,text:c[p]}];break;case 63:this.$=[c[p-1],{type:"addDetails",actor:c[p-1].actor,text:c[p]}];break;case 66:this.$=[c[p-2],c[p]];break;case 67:this.$=c[p];break;case 68:this.$=y.PLACEMENT.LEFTOF;break;case 69:this.$=y.PLACEMENT.RIGHTOF;break;case 70:this.$=[c[p-4],c[p-1],{type:"addMessage",from:c[p-4].actor,to:c[p-1].actor,signalType:c[p-3],msg:c[p],activate:!0},{type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[p-1].actor}];break;case 71:this.$=[c[p-4],c[p-1],{type:"addMessage",from:c[p-4].actor,to:c[p-1].actor,signalType:c[p-3],msg:c[p]},{type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[p-4].actor}];break;case 72:this.$=[c[p-4],c[p-1],{type:"addMessage",from:c[p-4].actor,to:c[p-1].actor,signalType:c[p-3],msg:c[p],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[p-1].actor}];break;case 73:this.$=[c[p-4],c[p-1],{type:"addMessage",from:c[p-4].actor,to:c[p-1].actor,signalType:c[p-2],msg:c[p],activate:!1,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[p-4].actor}];break;case 74:this.$=[c[p-5],c[p-1],{type:"addMessage",from:c[p-5].actor,to:c[p-1].actor,signalType:c[p-3],msg:c[p],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[p-1].actor},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[p-5].actor}];break;case 75:this.$=[c[p-3],c[p-1],{type:"addMessage",from:c[p-3].actor,to:c[p-1].actor,signalType:c[p-2],msg:c[p]}];break;case 76:this.$={type:"addParticipant",actor:c[p-1],config:c[p]};break;case 77:this.$=c[p-1].trim();break;case 78:case 79:this.$={type:"addParticipant",actor:c[p]};break;case 80:this.$=y.LINETYPE.SOLID_OPEN;break;case 81:this.$=y.LINETYPE.DOTTED_OPEN;break;case 82:this.$=y.LINETYPE.SOLID;break;case 83:this.$=y.LINETYPE.SOLID_TOP;break;case 84:this.$=y.LINETYPE.SOLID_BOTTOM;break;case 85:this.$=y.LINETYPE.STICK_TOP;break;case 86:this.$=y.LINETYPE.STICK_BOTTOM;break;case 87:this.$=y.LINETYPE.SOLID_TOP_DOTTED;break;case 88:this.$=y.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 89:this.$=y.LINETYPE.STICK_TOP_DOTTED;break;case 90:this.$=y.LINETYPE.STICK_BOTTOM_DOTTED;break;case 91:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 92:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 93:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 94:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 95:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 96:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 97:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 98:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 99:this.$=y.LINETYPE.BIDIRECTIONAL_SOLID;break;case 100:this.$=y.LINETYPE.DOTTED;break;case 101:this.$=y.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 102:this.$=y.LINETYPE.SOLID_CROSS;break;case 103:this.$=y.LINETYPE.DOTTED_CROSS;break;case 104:this.$=y.LINETYPE.SOLID_POINT;break;case 105:this.$=y.LINETYPE.DOTTED_POINT;break;case 106:this.$=y.parseMessage(c[p].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:a,6:r},{1:[3]},{3:5,4:t,5:a,6:r},{3:6,4:t,5:a,6:r},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:n,13:13,14:h,15:d,18:16,19:E,22:u,23:41,24:_,25:20,26:21,27:22,28:23,29:24,30:L,31:g,32:R,34:T,36:O,37:x,38:m,39:S,40:b,42:P,44:k,45:B,47:V,51:H,53:z,54:X,56:et,61:rt,62:U,63:ot,64:at,73:W},e(M,[2,5]),{9:48,13:13,14:h,15:d,18:16,19:E,22:u,23:41,24:_,25:20,26:21,27:22,28:23,29:24,30:L,31:g,32:R,34:T,36:O,37:x,38:m,39:S,40:b,42:P,44:k,45:B,47:V,51:H,53:z,54:X,56:et,61:rt,62:U,63:ot,64:at,73:W},e(M,[2,7]),e(M,[2,8]),e(M,[2,9]),e(M,[2,15]),{13:49,51:H,53:z,54:X},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,62:Z,73:W},{23:57,62:Z,73:W},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},{5:[1,62]},e(M,[2,30]),e(M,[2,31]),{33:[1,63]},{35:[1,64]},e(M,[2,34]),{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{16:[1,72]},{23:73,55:74,62:Z,73:Mt},{23:76,55:77,62:Z,73:Mt},{23:78,62:Z,73:W},{69:79,72:[1,80],78:A,79:v,80:dt,81:st,82:K,83:mt,84:pe,85:Ee,86:ue,87:fe,88:_e,89:ge,90:xe,91:ye,92:Ie,93:Re,94:Oe,95:Le,96:be,97:me,98:Se,99:Ae,100:we,101:Ne,102:Pe,103:ke},{57:107,59:[1,108],67:[1,109],68:[1,110]},{23:111,62:Z,73:W},e([72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103],De,{23:112,62:Z,73:W}),{23:113,62:Z,73:W},{23:114,62:Z,73:W},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],ve),e(M,[2,6]),e(M,[2,16]),e(Pt,[2,10],{11:115}),e(M,[2,18]),{5:[1,117],20:[1,116]},{5:[1,118]},e(M,[2,22]),{5:[1,119]},e([5,52,66,104],De),{5:[1,120]},e(M,[2,25]),e(M,[2,26]),e(M,[2,27]),e(M,[2,28]),e(M,[2,29]),e(M,[2,32]),e(M,[2,33]),e(Bt,i,{7:121}),e(Bt,i,{7:122}),e(Bt,i,{7:123}),e(Ce,i,{41:124,7:125}),e($t,i,{43:126,7:127}),e($t,i,{7:127,43:128}),e(Me,i,{46:129,7:130}),e(Bt,i,{7:131}),{5:[1,133],52:[1,132]},{5:[1,135],52:[1,134]},e(jt,ve,{74:136,75:[1,137]}),{5:[1,139],52:[1,138]},{5:[1,141],52:[1,140]},{5:[1,142]},{23:146,62:Z,70:[1,143],71:[1,144],72:[1,145],73:W},{69:147,78:A,79:v,80:dt,81:st,82:K,83:mt,84:pe,85:Ee,86:ue,87:fe,88:_e,89:ge,90:xe,91:ye,92:Ie,93:Re,94:Oe,95:Le,96:be,97:me,98:Se,99:Ae,100:we,101:Ne,102:Pe,103:ke},e(F,[2,80]),e(F,[2,81]),e(F,[2,82]),e(F,[2,83]),e(F,[2,84]),e(F,[2,85]),e(F,[2,86]),e(F,[2,87]),e(F,[2,88]),e(F,[2,89]),e(F,[2,90]),e(F,[2,91]),e(F,[2,92]),e(F,[2,93]),e(F,[2,94]),e(F,[2,95]),e(F,[2,96]),e(F,[2,97]),e(F,[2,98]),e(F,[2,99]),e(F,[2,100]),e(F,[2,101]),e(F,[2,102]),e(F,[2,103]),e(F,[2,104]),e(F,[2,105]),{23:148,62:Z,73:W},{23:150,60:149,62:Z,73:W},e(Be,[2,68]),e(Be,[2,69]),{58:151,104:lt},{58:153,104:lt},{58:154,104:lt},{58:155,104:lt},{4:[1,158],5:[1,160],12:157,13:159,17:[1,156],51:H,53:z,54:X},{5:[1,161]},e(M,[2,20]),e(M,[2,21]),e(M,[2,23]),e(M,[2,24]),{4:o,5:s,8:8,9:10,10:n,13:13,14:h,15:d,17:[1,162],18:16,19:E,22:u,23:41,24:_,25:20,26:21,27:22,28:23,29:24,30:L,31:g,32:R,34:T,36:O,37:x,38:m,39:S,40:b,42:P,44:k,45:B,47:V,51:H,53:z,54:X,56:et,61:rt,62:U,63:ot,64:at,73:W},{4:o,5:s,8:8,9:10,10:n,13:13,14:h,15:d,17:[1,163],18:16,19:E,22:u,23:41,24:_,25:20,26:21,27:22,28:23,29:24,30:L,31:g,32:R,34:T,36:O,37:x,38:m,39:S,40:b,42:P,44:k,45:B,47:V,51:H,53:z,54:X,56:et,61:rt,62:U,63:ot,64:at,73:W},{4:o,5:s,8:8,9:10,10:n,13:13,14:h,15:d,17:[1,164],18:16,19:E,22:u,23:41,24:_,25:20,26:21,27:22,28:23,29:24,30:L,31:g,32:R,34:T,36:O,37:x,38:m,39:S,40:b,42:P,44:k,45:B,47:V,51:H,53:z,54:X,56:et,61:rt,62:U,63:ot,64:at,73:W},{17:[1,165]},{4:o,5:s,8:8,9:10,10:n,13:13,14:h,15:d,17:[2,47],18:16,19:E,22:u,23:41,24:_,25:20,26:21,27:22,28:23,29:24,30:L,31:g,32:R,34:T,36:O,37:x,38:m,39:S,40:b,42:P,44:k,45:B,47:V,50:[1,166],51:H,53:z,54:X,56:et,61:rt,62:U,63:ot,64:at,73:W},{17:[1,167]},{4:o,5:s,8:8,9:10,10:n,13:13,14:h,15:d,17:[2,45],18:16,19:E,22:u,23:41,24:_,25:20,26:21,27:22,28:23,29:24,30:L,31:g,32:R,34:T,36:O,37:x,38:m,39:S,40:b,42:P,44:k,45:B,47:V,49:[1,168],51:H,53:z,54:X,56:et,61:rt,62:U,63:ot,64:at,73:W},{17:[1,169]},{17:[1,170]},{4:o,5:s,8:8,9:10,10:n,13:13,14:h,15:d,17:[2,43],18:16,19:E,22:u,23:41,24:_,25:20,26:21,27:22,28:23,29:24,30:L,31:g,32:R,34:T,36:O,37:x,38:m,39:S,40:b,42:P,44:k,45:B,47:V,48:[1,171],51:H,53:z,54:X,56:et,61:rt,62:U,63:ot,64:at,73:W},{4:o,5:s,8:8,9:10,10:n,13:13,14:h,15:d,17:[1,172],18:16,19:E,22:u,23:41,24:_,25:20,26:21,27:22,28:23,29:24,30:L,31:g,32:R,34:T,36:O,37:x,38:m,39:S,40:b,42:P,44:k,45:B,47:V,51:H,53:z,54:X,56:et,61:rt,62:U,63:ot,64:at,73:W},{16:[1,173]},e(M,[2,50]),{16:[1,174]},e(M,[2,55]),e(jt,[2,76]),{76:[1,175]},{16:[1,176]},e(M,[2,52]),{16:[1,177]},e(M,[2,57]),e(M,[2,53]),{23:178,62:Z,73:W},{23:179,62:Z,73:W},{23:180,62:Z,73:W},{58:181,104:lt},{23:182,62:Z,72:[1,183],73:W},{58:184,104:lt},{58:185,104:lt},{66:[1,186],104:[2,67]},{5:[2,60]},{5:[2,106]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(M,[2,17]),e(Pt,[2,11]),{13:187,51:H,53:z,54:X},e(Pt,[2,13]),e(Pt,[2,14]),e(M,[2,19]),e(M,[2,35]),e(M,[2,36]),e(M,[2,37]),e(M,[2,38]),{16:[1,188]},e(M,[2,39]),{16:[1,189]},e(M,[2,40]),e(M,[2,41]),{16:[1,190]},e(M,[2,42]),{5:[1,191]},{5:[1,192]},{77:[1,193]},{5:[1,194]},{5:[1,195]},{58:196,104:lt},{58:197,104:lt},{58:198,104:lt},{5:[2,75]},{58:199,104:lt},{23:200,62:Z,73:W},{5:[2,58]},{5:[2,59]},{23:201,62:Z,73:W},e(Pt,[2,12]),e(Ce,i,{7:125,41:202}),e($t,i,{7:127,43:203}),e(Me,i,{7:130,46:204}),e(M,[2,49]),e(M,[2,54]),e(jt,[2,77]),e(M,[2,51]),e(M,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:205,104:lt},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],151:[2,60],152:[2,106],153:[2,61],154:[2,62],155:[2,63],181:[2,75],184:[2,58],185:[2,59],196:[2,70],197:[2,71],198:[2,72],199:[2,73],201:[2,66],202:[2,48],203:[2,46],204:[2,44],205:[2,74]},parseError:f(function(w,C){if(C.recoverable)this.trace(w);else{var D=new Error(w);throw D.hash=C,D}},"parseError"),parse:f(function(w){var C=this,D=[0],y=[],G=[null],c=[],kt=this.table,p="",Vt=0,Ye=0,lr=2,Ve=1,hr=c.slice.call(arguments,1),$=Object.create(this.lexer),It={yy:{}};for(var ee in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ee)&&(It.yy[ee]=this.yy[ee]);$.setInput(w,It.yy),It.yy.lexer=$,It.yy.parser=this,typeof $.yylloc>"u"&&($.yylloc={});var re=$.yylloc;c.push(re);var dr=$.options&&$.options.ranges;typeof It.yy.parseError=="function"?this.parseError=It.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Tr(ct){D.length=D.length-2*ct,G.length=G.length-ct,c.length=c.length-ct}f(Tr,"popStack");function We(){var ct;return ct=y.pop()||$.lex()||Ve,typeof ct!="number"&&(ct instanceof Array&&(y=ct,ct=y.pop()),ct=C.symbols_[ct]||ct),ct}f(We,"lex");for(var it,Rt,ht,ae,St={},Wt,Et,He,Ht;;){if(Rt=D[D.length-1],this.defaultActions[Rt]?ht=this.defaultActions[Rt]:((it===null||typeof it>"u")&&(it=We()),ht=kt[Rt]&&kt[Rt][it]),typeof ht>"u"||!ht.length||!ht[0]){var se="";Ht=[];for(Wt in kt[Rt])this.terminals_[Wt]&&Wt>lr&&Ht.push("'"+this.terminals_[Wt]+"'");$.showPosition?se="Parse error on line "+(Vt+1)+`:
|
|
1
|
+
import{I as pr}from"./BVEvAi2Z.js";import{b as f,a$ as Er,X as j,aW as Kt,ay as nt,P as Ue,B as ur,h as fr,z as N,a_ as Ke,aZ as _r,b0 as gr,V as xr,U as yr,Y as Ir,ax as Rr,J as Or,r as Lr,aV as Ft,bh as Q,aa as tt,l as vt,aH as Ge,Z as br,W as zt,a7 as mr,aQ as Xe}from"./Bosx7Vx3.js";import{d as Sr,h as le,g as pt,e as Ar,a as he,b as de}from"./Bvre4WDp.js";var ne=(function(){var e=f(function(_t,w,C,D){for(C=C||{},D=_t.length;D--;C[_t[D]]=w);return C},"o"),t=[1,2],a=[1,3],r=[1,4],i=[2,4],o=[1,9],s=[1,11],n=[1,12],h=[1,14],d=[1,15],E=[1,17],u=[1,18],_=[1,19],L=[1,25],g=[1,26],R=[1,27],T=[1,28],O=[1,29],x=[1,30],m=[1,31],S=[1,32],b=[1,33],P=[1,34],k=[1,35],B=[1,36],V=[1,37],H=[1,38],z=[1,39],X=[1,40],et=[1,42],rt=[1,43],U=[1,44],ot=[1,45],at=[1,46],W=[1,47],M=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],Z=[1,56],Mt=[1,75],A=[1,81],v=[1,82],dt=[1,83],st=[1,84],K=[1,85],mt=[1,86],pe=[1,87],Ee=[1,88],ue=[1,89],fe=[1,90],_e=[1,91],ge=[1,92],xe=[1,93],ye=[1,94],Ie=[1,95],Re=[1,96],Oe=[1,97],Le=[1,98],be=[1,99],me=[1,100],Se=[1,101],Ae=[1,102],we=[1,103],Ne=[1,104],Pe=[1,105],ke=[1,106],De=[2,79],ve=[2,78],Pt=[4,5,17,51,53,54],Bt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],Ce=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],$t=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Me=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],jt=[5,52],F=[62,70,71,72,73],Be=[62,73],lt=[1,152],te={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:f(function(w,C,D,y,G,c,kt){var p=c.length-1;switch(G){case 3:return y.apply(c[p]),c[p];case 4:case 10:this.$=[];break;case 5:case 11:c[p-1].push(c[p]),this.$=c[p-1];break;case 6:case 7:case 12:case 13:this.$=c[p];break;case 8:case 9:case 14:this.$=[];break;case 16:c[p].type="createParticipant",this.$=c[p];break;case 17:c[p-1].unshift({type:"boxStart",boxData:y.parseBoxData(c[p-2])}),c[p-1].push({type:"boxEnd",boxText:c[p-2]}),this.$=c[p-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(c[p-2]),sequenceIndexStep:Number(c[p-1]),sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(c[p-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:y.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[p-1].actor};break;case 24:this.$={type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[p-1].actor};break;case 30:y.setDiagramTitle(c[p].substring(6)),this.$=c[p].substring(6);break;case 31:y.setDiagramTitle(c[p].substring(7)),this.$=c[p].substring(7);break;case 32:this.$=c[p].trim(),y.setAccTitle(this.$);break;case 33:case 34:this.$=c[p].trim(),y.setAccDescription(this.$);break;case 35:c[p-1].unshift({type:"loopStart",loopText:y.parseMessage(c[p-2]),signalType:y.LINETYPE.LOOP_START}),c[p-1].push({type:"loopEnd",loopText:c[p-2],signalType:y.LINETYPE.LOOP_END}),this.$=c[p-1];break;case 36:c[p-1].unshift({type:"rectStart",color:y.parseMessage(c[p-2]),signalType:y.LINETYPE.RECT_START}),c[p-1].push({type:"rectEnd",color:y.parseMessage(c[p-2]),signalType:y.LINETYPE.RECT_END}),this.$=c[p-1];break;case 37:c[p-1].unshift({type:"optStart",optText:y.parseMessage(c[p-2]),signalType:y.LINETYPE.OPT_START}),c[p-1].push({type:"optEnd",optText:y.parseMessage(c[p-2]),signalType:y.LINETYPE.OPT_END}),this.$=c[p-1];break;case 38:c[p-1].unshift({type:"altStart",altText:y.parseMessage(c[p-2]),signalType:y.LINETYPE.ALT_START}),c[p-1].push({type:"altEnd",signalType:y.LINETYPE.ALT_END}),this.$=c[p-1];break;case 39:c[p-1].unshift({type:"parStart",parText:y.parseMessage(c[p-2]),signalType:y.LINETYPE.PAR_START}),c[p-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[p-1];break;case 40:c[p-1].unshift({type:"parStart",parText:y.parseMessage(c[p-2]),signalType:y.LINETYPE.PAR_OVER_START}),c[p-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[p-1];break;case 41:c[p-1].unshift({type:"criticalStart",criticalText:y.parseMessage(c[p-2]),signalType:y.LINETYPE.CRITICAL_START}),c[p-1].push({type:"criticalEnd",signalType:y.LINETYPE.CRITICAL_END}),this.$=c[p-1];break;case 42:c[p-1].unshift({type:"breakStart",breakText:y.parseMessage(c[p-2]),signalType:y.LINETYPE.BREAK_START}),c[p-1].push({type:"breakEnd",optText:y.parseMessage(c[p-2]),signalType:y.LINETYPE.BREAK_END}),this.$=c[p-1];break;case 44:this.$=c[p-3].concat([{type:"option",optionText:y.parseMessage(c[p-1]),signalType:y.LINETYPE.CRITICAL_OPTION},c[p]]);break;case 46:this.$=c[p-3].concat([{type:"and",parText:y.parseMessage(c[p-1]),signalType:y.LINETYPE.PAR_AND},c[p]]);break;case 48:this.$=c[p-3].concat([{type:"else",altText:y.parseMessage(c[p-1]),signalType:y.LINETYPE.ALT_ELSE},c[p]]);break;case 49:c[p-3].draw="participant",c[p-3].type="addParticipant",c[p-3].description=y.parseMessage(c[p-1]),this.$=c[p-3];break;case 50:c[p-1].draw="participant",c[p-1].type="addParticipant",this.$=c[p-1];break;case 51:c[p-3].draw="actor",c[p-3].type="addParticipant",c[p-3].description=y.parseMessage(c[p-1]),this.$=c[p-3];break;case 52:case 57:c[p-1].draw="actor",c[p-1].type="addParticipant",this.$=c[p-1];break;case 53:c[p-1].type="destroyParticipant",this.$=c[p-1];break;case 54:c[p-3].draw="participant",c[p-3].type="addParticipant",c[p-3].description=y.parseMessage(c[p-1]),this.$=c[p-3];break;case 55:c[p-1].draw="participant",c[p-1].type="addParticipant",this.$=c[p-1];break;case 56:c[p-3].draw="actor",c[p-3].type="addParticipant",c[p-3].description=y.parseMessage(c[p-1]),this.$=c[p-3];break;case 58:this.$=[c[p-1],{type:"addNote",placement:c[p-2],actor:c[p-1].actor,text:c[p]}];break;case 59:c[p-2]=[].concat(c[p-1],c[p-1]).slice(0,2),c[p-2][0]=c[p-2][0].actor,c[p-2][1]=c[p-2][1].actor,this.$=[c[p-1],{type:"addNote",placement:y.PLACEMENT.OVER,actor:c[p-2].slice(0,2),text:c[p]}];break;case 60:this.$=[c[p-1],{type:"addLinks",actor:c[p-1].actor,text:c[p]}];break;case 61:this.$=[c[p-1],{type:"addALink",actor:c[p-1].actor,text:c[p]}];break;case 62:this.$=[c[p-1],{type:"addProperties",actor:c[p-1].actor,text:c[p]}];break;case 63:this.$=[c[p-1],{type:"addDetails",actor:c[p-1].actor,text:c[p]}];break;case 66:this.$=[c[p-2],c[p]];break;case 67:this.$=c[p];break;case 68:this.$=y.PLACEMENT.LEFTOF;break;case 69:this.$=y.PLACEMENT.RIGHTOF;break;case 70:this.$=[c[p-4],c[p-1],{type:"addMessage",from:c[p-4].actor,to:c[p-1].actor,signalType:c[p-3],msg:c[p],activate:!0},{type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[p-1].actor}];break;case 71:this.$=[c[p-4],c[p-1],{type:"addMessage",from:c[p-4].actor,to:c[p-1].actor,signalType:c[p-3],msg:c[p]},{type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[p-4].actor}];break;case 72:this.$=[c[p-4],c[p-1],{type:"addMessage",from:c[p-4].actor,to:c[p-1].actor,signalType:c[p-3],msg:c[p],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[p-1].actor}];break;case 73:this.$=[c[p-4],c[p-1],{type:"addMessage",from:c[p-4].actor,to:c[p-1].actor,signalType:c[p-2],msg:c[p],activate:!1,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[p-4].actor}];break;case 74:this.$=[c[p-5],c[p-1],{type:"addMessage",from:c[p-5].actor,to:c[p-1].actor,signalType:c[p-3],msg:c[p],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[p-1].actor},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[p-5].actor}];break;case 75:this.$=[c[p-3],c[p-1],{type:"addMessage",from:c[p-3].actor,to:c[p-1].actor,signalType:c[p-2],msg:c[p]}];break;case 76:this.$={type:"addParticipant",actor:c[p-1],config:c[p]};break;case 77:this.$=c[p-1].trim();break;case 78:case 79:this.$={type:"addParticipant",actor:c[p]};break;case 80:this.$=y.LINETYPE.SOLID_OPEN;break;case 81:this.$=y.LINETYPE.DOTTED_OPEN;break;case 82:this.$=y.LINETYPE.SOLID;break;case 83:this.$=y.LINETYPE.SOLID_TOP;break;case 84:this.$=y.LINETYPE.SOLID_BOTTOM;break;case 85:this.$=y.LINETYPE.STICK_TOP;break;case 86:this.$=y.LINETYPE.STICK_BOTTOM;break;case 87:this.$=y.LINETYPE.SOLID_TOP_DOTTED;break;case 88:this.$=y.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 89:this.$=y.LINETYPE.STICK_TOP_DOTTED;break;case 90:this.$=y.LINETYPE.STICK_BOTTOM_DOTTED;break;case 91:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 92:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 93:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 94:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 95:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 96:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 97:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 98:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 99:this.$=y.LINETYPE.BIDIRECTIONAL_SOLID;break;case 100:this.$=y.LINETYPE.DOTTED;break;case 101:this.$=y.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 102:this.$=y.LINETYPE.SOLID_CROSS;break;case 103:this.$=y.LINETYPE.DOTTED_CROSS;break;case 104:this.$=y.LINETYPE.SOLID_POINT;break;case 105:this.$=y.LINETYPE.DOTTED_POINT;break;case 106:this.$=y.parseMessage(c[p].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:a,6:r},{1:[3]},{3:5,4:t,5:a,6:r},{3:6,4:t,5:a,6:r},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:n,13:13,14:h,15:d,18:16,19:E,22:u,23:41,24:_,25:20,26:21,27:22,28:23,29:24,30:L,31:g,32:R,34:T,36:O,37:x,38:m,39:S,40:b,42:P,44:k,45:B,47:V,51:H,53:z,54:X,56:et,61:rt,62:U,63:ot,64:at,73:W},e(M,[2,5]),{9:48,13:13,14:h,15:d,18:16,19:E,22:u,23:41,24:_,25:20,26:21,27:22,28:23,29:24,30:L,31:g,32:R,34:T,36:O,37:x,38:m,39:S,40:b,42:P,44:k,45:B,47:V,51:H,53:z,54:X,56:et,61:rt,62:U,63:ot,64:at,73:W},e(M,[2,7]),e(M,[2,8]),e(M,[2,9]),e(M,[2,15]),{13:49,51:H,53:z,54:X},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,62:Z,73:W},{23:57,62:Z,73:W},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},{5:[1,62]},e(M,[2,30]),e(M,[2,31]),{33:[1,63]},{35:[1,64]},e(M,[2,34]),{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{16:[1,72]},{23:73,55:74,62:Z,73:Mt},{23:76,55:77,62:Z,73:Mt},{23:78,62:Z,73:W},{69:79,72:[1,80],78:A,79:v,80:dt,81:st,82:K,83:mt,84:pe,85:Ee,86:ue,87:fe,88:_e,89:ge,90:xe,91:ye,92:Ie,93:Re,94:Oe,95:Le,96:be,97:me,98:Se,99:Ae,100:we,101:Ne,102:Pe,103:ke},{57:107,59:[1,108],67:[1,109],68:[1,110]},{23:111,62:Z,73:W},e([72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103],De,{23:112,62:Z,73:W}),{23:113,62:Z,73:W},{23:114,62:Z,73:W},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],ve),e(M,[2,6]),e(M,[2,16]),e(Pt,[2,10],{11:115}),e(M,[2,18]),{5:[1,117],20:[1,116]},{5:[1,118]},e(M,[2,22]),{5:[1,119]},e([5,52,66,104],De),{5:[1,120]},e(M,[2,25]),e(M,[2,26]),e(M,[2,27]),e(M,[2,28]),e(M,[2,29]),e(M,[2,32]),e(M,[2,33]),e(Bt,i,{7:121}),e(Bt,i,{7:122}),e(Bt,i,{7:123}),e(Ce,i,{41:124,7:125}),e($t,i,{43:126,7:127}),e($t,i,{7:127,43:128}),e(Me,i,{46:129,7:130}),e(Bt,i,{7:131}),{5:[1,133],52:[1,132]},{5:[1,135],52:[1,134]},e(jt,ve,{74:136,75:[1,137]}),{5:[1,139],52:[1,138]},{5:[1,141],52:[1,140]},{5:[1,142]},{23:146,62:Z,70:[1,143],71:[1,144],72:[1,145],73:W},{69:147,78:A,79:v,80:dt,81:st,82:K,83:mt,84:pe,85:Ee,86:ue,87:fe,88:_e,89:ge,90:xe,91:ye,92:Ie,93:Re,94:Oe,95:Le,96:be,97:me,98:Se,99:Ae,100:we,101:Ne,102:Pe,103:ke},e(F,[2,80]),e(F,[2,81]),e(F,[2,82]),e(F,[2,83]),e(F,[2,84]),e(F,[2,85]),e(F,[2,86]),e(F,[2,87]),e(F,[2,88]),e(F,[2,89]),e(F,[2,90]),e(F,[2,91]),e(F,[2,92]),e(F,[2,93]),e(F,[2,94]),e(F,[2,95]),e(F,[2,96]),e(F,[2,97]),e(F,[2,98]),e(F,[2,99]),e(F,[2,100]),e(F,[2,101]),e(F,[2,102]),e(F,[2,103]),e(F,[2,104]),e(F,[2,105]),{23:148,62:Z,73:W},{23:150,60:149,62:Z,73:W},e(Be,[2,68]),e(Be,[2,69]),{58:151,104:lt},{58:153,104:lt},{58:154,104:lt},{58:155,104:lt},{4:[1,158],5:[1,160],12:157,13:159,17:[1,156],51:H,53:z,54:X},{5:[1,161]},e(M,[2,20]),e(M,[2,21]),e(M,[2,23]),e(M,[2,24]),{4:o,5:s,8:8,9:10,10:n,13:13,14:h,15:d,17:[1,162],18:16,19:E,22:u,23:41,24:_,25:20,26:21,27:22,28:23,29:24,30:L,31:g,32:R,34:T,36:O,37:x,38:m,39:S,40:b,42:P,44:k,45:B,47:V,51:H,53:z,54:X,56:et,61:rt,62:U,63:ot,64:at,73:W},{4:o,5:s,8:8,9:10,10:n,13:13,14:h,15:d,17:[1,163],18:16,19:E,22:u,23:41,24:_,25:20,26:21,27:22,28:23,29:24,30:L,31:g,32:R,34:T,36:O,37:x,38:m,39:S,40:b,42:P,44:k,45:B,47:V,51:H,53:z,54:X,56:et,61:rt,62:U,63:ot,64:at,73:W},{4:o,5:s,8:8,9:10,10:n,13:13,14:h,15:d,17:[1,164],18:16,19:E,22:u,23:41,24:_,25:20,26:21,27:22,28:23,29:24,30:L,31:g,32:R,34:T,36:O,37:x,38:m,39:S,40:b,42:P,44:k,45:B,47:V,51:H,53:z,54:X,56:et,61:rt,62:U,63:ot,64:at,73:W},{17:[1,165]},{4:o,5:s,8:8,9:10,10:n,13:13,14:h,15:d,17:[2,47],18:16,19:E,22:u,23:41,24:_,25:20,26:21,27:22,28:23,29:24,30:L,31:g,32:R,34:T,36:O,37:x,38:m,39:S,40:b,42:P,44:k,45:B,47:V,50:[1,166],51:H,53:z,54:X,56:et,61:rt,62:U,63:ot,64:at,73:W},{17:[1,167]},{4:o,5:s,8:8,9:10,10:n,13:13,14:h,15:d,17:[2,45],18:16,19:E,22:u,23:41,24:_,25:20,26:21,27:22,28:23,29:24,30:L,31:g,32:R,34:T,36:O,37:x,38:m,39:S,40:b,42:P,44:k,45:B,47:V,49:[1,168],51:H,53:z,54:X,56:et,61:rt,62:U,63:ot,64:at,73:W},{17:[1,169]},{17:[1,170]},{4:o,5:s,8:8,9:10,10:n,13:13,14:h,15:d,17:[2,43],18:16,19:E,22:u,23:41,24:_,25:20,26:21,27:22,28:23,29:24,30:L,31:g,32:R,34:T,36:O,37:x,38:m,39:S,40:b,42:P,44:k,45:B,47:V,48:[1,171],51:H,53:z,54:X,56:et,61:rt,62:U,63:ot,64:at,73:W},{4:o,5:s,8:8,9:10,10:n,13:13,14:h,15:d,17:[1,172],18:16,19:E,22:u,23:41,24:_,25:20,26:21,27:22,28:23,29:24,30:L,31:g,32:R,34:T,36:O,37:x,38:m,39:S,40:b,42:P,44:k,45:B,47:V,51:H,53:z,54:X,56:et,61:rt,62:U,63:ot,64:at,73:W},{16:[1,173]},e(M,[2,50]),{16:[1,174]},e(M,[2,55]),e(jt,[2,76]),{76:[1,175]},{16:[1,176]},e(M,[2,52]),{16:[1,177]},e(M,[2,57]),e(M,[2,53]),{23:178,62:Z,73:W},{23:179,62:Z,73:W},{23:180,62:Z,73:W},{58:181,104:lt},{23:182,62:Z,72:[1,183],73:W},{58:184,104:lt},{58:185,104:lt},{66:[1,186],104:[2,67]},{5:[2,60]},{5:[2,106]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(M,[2,17]),e(Pt,[2,11]),{13:187,51:H,53:z,54:X},e(Pt,[2,13]),e(Pt,[2,14]),e(M,[2,19]),e(M,[2,35]),e(M,[2,36]),e(M,[2,37]),e(M,[2,38]),{16:[1,188]},e(M,[2,39]),{16:[1,189]},e(M,[2,40]),e(M,[2,41]),{16:[1,190]},e(M,[2,42]),{5:[1,191]},{5:[1,192]},{77:[1,193]},{5:[1,194]},{5:[1,195]},{58:196,104:lt},{58:197,104:lt},{58:198,104:lt},{5:[2,75]},{58:199,104:lt},{23:200,62:Z,73:W},{5:[2,58]},{5:[2,59]},{23:201,62:Z,73:W},e(Pt,[2,12]),e(Ce,i,{7:125,41:202}),e($t,i,{7:127,43:203}),e(Me,i,{7:130,46:204}),e(M,[2,49]),e(M,[2,54]),e(jt,[2,77]),e(M,[2,51]),e(M,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:205,104:lt},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],151:[2,60],152:[2,106],153:[2,61],154:[2,62],155:[2,63],181:[2,75],184:[2,58],185:[2,59],196:[2,70],197:[2,71],198:[2,72],199:[2,73],201:[2,66],202:[2,48],203:[2,46],204:[2,44],205:[2,74]},parseError:f(function(w,C){if(C.recoverable)this.trace(w);else{var D=new Error(w);throw D.hash=C,D}},"parseError"),parse:f(function(w){var C=this,D=[0],y=[],G=[null],c=[],kt=this.table,p="",Vt=0,Ye=0,lr=2,Ve=1,hr=c.slice.call(arguments,1),$=Object.create(this.lexer),It={yy:{}};for(var ee in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ee)&&(It.yy[ee]=this.yy[ee]);$.setInput(w,It.yy),It.yy.lexer=$,It.yy.parser=this,typeof $.yylloc>"u"&&($.yylloc={});var re=$.yylloc;c.push(re);var dr=$.options&&$.options.ranges;typeof It.yy.parseError=="function"?this.parseError=It.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Tr(ct){D.length=D.length-2*ct,G.length=G.length-ct,c.length=c.length-ct}f(Tr,"popStack");function We(){var ct;return ct=y.pop()||$.lex()||Ve,typeof ct!="number"&&(ct instanceof Array&&(y=ct,ct=y.pop()),ct=C.symbols_[ct]||ct),ct}f(We,"lex");for(var it,Rt,ht,ae,St={},Wt,Et,He,Ht;;){if(Rt=D[D.length-1],this.defaultActions[Rt]?ht=this.defaultActions[Rt]:((it===null||typeof it>"u")&&(it=We()),ht=kt[Rt]&&kt[Rt][it]),typeof ht>"u"||!ht.length||!ht[0]){var se="";Ht=[];for(Wt in kt[Rt])this.terminals_[Wt]&&Wt>lr&&Ht.push("'"+this.terminals_[Wt]+"'");$.showPosition?se="Parse error on line "+(Vt+1)+`:
|
|
2
2
|
`+$.showPosition()+`
|
|
3
3
|
Expecting `+Ht.join(", ")+", got '"+(this.terminals_[it]||it)+"'":se="Parse error on line "+(Vt+1)+": Unexpected "+(it==Ve?"end of input":"'"+(this.terminals_[it]||it)+"'"),this.parseError(se,{text:$.match,token:this.terminals_[it]||it,line:$.yylineno,loc:re,expected:Ht})}if(ht[0]instanceof Array&&ht.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Rt+", token: "+it);switch(ht[0]){case 1:D.push(it),G.push($.yytext),c.push($.yylloc),D.push(ht[1]),it=null,Ye=$.yyleng,p=$.yytext,Vt=$.yylineno,re=$.yylloc;break;case 2:if(Et=this.productions_[ht[1]][1],St.$=G[G.length-Et],St._$={first_line:c[c.length-(Et||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(Et||1)].first_column,last_column:c[c.length-1].last_column},dr&&(St._$.range=[c[c.length-(Et||1)].range[0],c[c.length-1].range[1]]),ae=this.performAction.apply(St,[p,Ye,Vt,It.yy,ht[1],G,c].concat(hr)),typeof ae<"u")return ae;Et&&(D=D.slice(0,-1*Et*2),G=G.slice(0,-1*Et),c=c.slice(0,-1*Et)),D.push(this.productions_[ht[1]][0]),G.push(St.$),c.push(St._$),He=kt[D[D.length-2]][D[D.length-1]],D.push(He);break;case 3:return!0}}return!0},"parse")},cr=(function(){var _t={EOF:1,parseError:f(function(C,D){if(this.yy.parser)this.yy.parser.parseError(C,D);else throw new Error(C)},"parseError"),setInput:f(function(w,C){return this.yy=C||this.yy||{},this._input=w,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var w=this._input[0];this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w;var C=w.match(/(?:\r\n?|\n).*/g);return C?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),w},"input"),unput:f(function(w){var C=w.length,D=w.split(/(?:\r\n?|\n)/g);this._input=w+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-C),this.offset-=C;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),D.length-1&&(this.yylineno-=D.length-1);var G=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:D?(D.length===y.length?this.yylloc.first_column:0)+y[y.length-D.length].length-D[0].length:this.yylloc.first_column-C},this.options.ranges&&(this.yylloc.range=[G[0],G[0]+this.yyleng-C]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(w){this.unput(this.match.slice(w))},"less"),pastInput:f(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var w=this.pastInput(),C=new Array(w.length+1).join("-");return w+this.upcomingInput()+`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w1 as V,v$ as E,hq as W,hr as H,i as K,Jk as $,JH as i,ac as z,nZ as T}from"./D0qhIm1r.js";import{bm as c}from"./Fcr7AvC-.js";import{aD as J,n as X,J as G,aF as k,g as Z}from"./CDCAMh6o.js";import{w as Q}from"./BwweojP5.js";import{cx as y,c_ as Y,cZ as v,d2 as ee}from"./cD292w1o.js";import{y as _}from"./Bqd7fdCF.js";const te=["connected","disconnected","unreachable","revoked","update-required"],f=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),d=e=>typeof e=="string"&&e.length>0,h=e=>typeof e=="string"&&e.length>0?e:void 0,P=e=>Number.isSafeInteger(e)&&e>=0?e:0;function ne(e){if(!f(e))return{};const t=Object.entries(e).filter(n=>d(n[1]));return t.length>0?{modelLabels:Object.fromEntries(t)}:{}}function re(e){if(!f(e))return;const t=Array.isArray(e.providers)?e.providers.flatMap(a=>f(a)&&d(a.id)?[{id:a.id,...a.visible===!1?{visible:!1}:{},status:typeof a.status=="string"?a.status:"unknown",models:Array.isArray(a.models)?a.models.filter(s=>d(s)):[],...ne(a.modelLabels),...a.modelsStale===!0?{modelsStale:!0}:{}}]:[]):[],n=h(e.intentdVersion),r=ae(e.capacity),o=oe(e.resources);return{...n?{intentdVersion:n}:{},providers:t,...r?{capacity:r}:{},...o?{resources:o}:{}}}function oe(e){if(!f(e)||!g(e.memoryUsedBytes)||!g(e.memoryTotalBytes)||e.memoryTotalBytes===0)return;const t=e.cpuPercent;return{...g(t)&&t<=100?{cpuPercent:t}:{},memoryUsedBytes:Math.min(e.memoryUsedBytes,e.memoryTotalBytes),memoryTotalBytes:e.memoryTotalBytes}}const g=e=>Number.isSafeInteger(e)&&e>=0;function ae(e){if(!(!f(e)||!g(e.runningAgents)||!g(e.agentCap)))return{runningAgents:e.runningAgents,agentCap:e.agentCap}}function Ue(e){if(!f(e)||!d(e.id)||!d(e.name)||!d(e.fingerprint)||!te.includes(e.state)||!Number.isInteger(e.port)||!d(e.addedAt))return null;const t=f(e.platform)&&d(e.platform.os)&&d(e.platform.arch)?{os:e.platform.os,arch:e.platform.arch}:void 0,n=re(e.capabilities),r=h(e.tcAddress),o=h(e.observedAt),a=h(e.lastConnectedAt),s=V(e.cloud),l=Number.isInteger(e.nodeProtocol)&&e.nodeProtocol>=0?e.nodeProtocol:void 0;return{id:e.id,name:e.name,...t?{platform:t}:{},hosts:Array.isArray(e.hosts)?e.hosts.filter(p=>d(p)):[],port:e.port,...r?{tcAddress:r}:{},fingerprint:e.fingerprint,state:e.state,runningAgents:P(e.runningAgents),...n?{capabilities:n}:{},...l!==void 0?{nodeProtocol:l}:{},...o?{observedAt:o}:{},addedAt:e.addedAt,...a?{lastConnectedAt:a}:{},...s?{cloud:s}:{}}}function je(e){if(!f(e)||!d(e.credentialId)||!d(e.backendId)||!d(e.backendName)||!d(e.createdAt))return null;const t=h(e.lastUsedAt);return{credentialId:e.credentialId,backendId:e.backendId,backendName:e.backendName,createdAt:e.createdAt,...t?{lastUsedAt:t}:{},connected:e.connected===!0,runningAgents:P(e.runningAgents)}}function qe(e){const t=(typeof e=="string"?e:"").trim().toUpperCase();return t===""?null:t}function se(e){if(!f(e)||typeof e.name!="string")return null;const t=e.name;return e.kind==="local"?{kind:"local",name:t}:e.kind==="machine"&&d(e.nodeId)?{kind:"machine",nodeId:e.nodeId,name:t}:e.kind==="cloud"&&d(e.cloudMachineId)?{kind:"cloud",cloudMachineId:e.cloudMachineId,name:t}:null}function Ve(e){if(!Array.isArray(e))return null;const t=[];for(const n of e){const r=se(n);if(!r)return null;t.push(r)}return t}function ce(e){return e.kind==="local"?{kind:"local"}:e.kind==="machine"?{kind:"machine",nodeId:e.nodeId}:{kind:"cloud",cloudMachineId:e.cloudMachineId}}function b(e){return e.kind==="local"?"local":e.kind==="machine"?`machine:${e.nodeId}`:`cloud:${e.cloudMachineId}`}const ie={macos:"macOS",linux:"Linux",windows:"Windows"},le={aarch64:"arm64",arm64:"arm64",x86_64:"x64",x64:"x64"};function m(e,t){const n=[e&&(ie[e]??e),t&&(le[t]??t)].filter(r=>!!r);return n.length?n.join(" "):null}function de(e){return e?.placement?.target==="remote"||_(e?.placement?.target)}const ue=new Set(["running","paused","resuming","pausing","stopping"]);function fe(e,t){if(e.placementError)return null;if(e.cloudStart)return"starting";if(!e.nodeId)return e.effectiveIsolation==="pending"?"starting":null;const n=t?.cloud?.state;return n&&ue.has(n)?n:e.effectiveIsolation==="pending"?"starting":null}function N(e,t){if(!e||!de(e))return null;const n=e.nodeId??e.placement?.nodeId??"",r=t&&t.id===n?t:null;if(_(e.placement?.target))return{nodeId:n,name:e.nodeName?.trim()||W(r?.cloud?.provider??H(e.placement?.cloudMachineId)),platform:m(r?.platform?.os,r?.platform?.arch),state:"ready",cloud:{state:fe(e,r)}};const o=m(e.placement?.os,e.placement?.arch)??m(r?.platform?.os,r?.platform?.arch),a=r?.state==="revoked"?"revoked":r?.state==="unreachable"||e.nodeState==="offline"?"unreachable":"ready";return{nodeId:n,name:e.nodeName?.trim()||r?.name||c.remoteAgent_location_unknownMachine(),platform:o,state:a}}function We(e,t){if(!e)return null;const n=t&&t.id===e?t:null;return{nodeId:e,name:n?.name||c.remoteAgent_location_unknownMachine(),platform:m(n?.platform?.os,n?.platform?.arch),state:n?.state==="revoked"?"revoked":n?.state==="unreachable"?"unreachable":"ready"}}function B(e){switch(e){case"starting":return c.cloudMachines_agent_starting();case"running":return c.cloudMachines_agent_running();case"paused":return c.cloudMachines_agent_paused();case"resuming":return c.cloudMachines_agent_resuming();case"pausing":return c.cloudMachines_agent_pausing();case"stopping":return c.cloudMachines_agent_stopping();default:return null}}function He(e){const t=B(e.cloud?.state);return t?c.cloudMachines_agent_chip({machine:e.name,state:t}):e.name}function Ke(e){if(e.cloud){const n=B(e.cloud.state),r=c.remoteAgent_location_tooltipNoPlatform({machine:e.name});return n?c.remoteAgent_location_tooltipWithState({location:r,state:n}):r}const t=e.platform?c.remoteAgent_location_tooltip({machine:e.name,platform:e.platform}):c.remoteAgent_location_tooltipNoPlatform({machine:e.name});switch(e.state){case"unreachable":return c.remoteAgent_location_tooltipWithState({location:t,state:c.remoteMachines_state_unreachable_label()});case"revoked":return c.remoteAgent_location_tooltipWithState({location:t,state:c.remoteMachines_state_revoked_label()});default:return t}}function x(e,t){return!e||!t?null:e.placementError?"failed":t.state==="revoked"?"revoked":t.state==="unreachable"?"unreachable":e.effectiveIsolation==="pending"||e.cloudStart?"starting":e.setup?.state==="failed"?"setup-failed":e.setup?.state==="running"?"setup-running":null}function w(e){if(!e.endsWith("}"))return null;for(let t=e.indexOf(" {");t>=0;t=e.indexOf(" {",t+1))try{const n=JSON.parse(e.slice(t+1));if(n&&typeof n=="object"&&typeof n.code=="string")return{message:e.slice(0,t).trim(),data:n}}catch{}return null}function me(e,t){const n=e.detail??"",r=w(n),o=e.code==="machine-update-required"||r?.data.code==="machine-update-required";if(o&&r?.data.reason==="prepared-checkout")return{updateRequired:o,message:c.remoteAgent_updateRequired_preparedCheckout({machine:t})};const a=E(r?.data),s=a??(e.code?E({code:e.code}):null);return s?{updateRequired:o,message:r?.message||n,cloud:s,cloudDetailKnown:!!a}:{updateRequired:o,message:r?.message||n}}function $e(e){if(!_(e?.placement?.target)||!e.placementError||e.status!==K.Error)return null;const t=me(e.placementError,"");return t.cloud?t:null}const pe=["attachments-too-large-for-machine:","node-prompt-too-large:"],he="remote-agent-unsupported:";function L(e){return new Intl.NumberFormat(void 0,{maximumFractionDigits:1}).format(e/1048576)}function ze(e){const t=w(e)?.message??e;for(const r of pe){const o=t.indexOf(r);if(o<0)continue;const a=t.slice(o+r.length).trim().replace(/^[a-z][\w]*(?:\.[\w]+)+:\s*/i,""),s=/come to (\d+) bytes\b.*?over its (\d+)-byte limit/.exec(a);return s?c.remoteAgent_attachmentsTooLargeSized_error({size:L(Number(s[1])),limit:L(Number(s[2]))}):a?c.remoteAgent_attachmentsTooLarge_error({detail:a}):c.remoteAgent_attachmentsTooLargeNoDetail_error()}const n=t.indexOf(he);return n>=0&&/attachment/i.test(t.slice(n))?c.remoteAgent_attachmentsUnsupported_error():null}function Je(e){return _(e?.placement?.target)&&x(e,N(e))==="starting"}function Xe(e,t){if(!_(e?.placement?.target))return!1;const n=N(e,t);return n?.cloud?.state==="resuming"&&x(e,n)===null}const S="",u="host:",A="cloud:";function M(e){return`${A}${e}`}function O(e){return e?.startsWith(A)&&e.slice(A.length)||null}const Ge=M("e2b");function ge(e,t){return e?.find(n=>M(n.cloudMachineId)===t&&n.unavailableReason===null)}const be=new Set(["connected","disconnected"]);function _e(e){switch(e){case"unreachable":return c.remoteMachines_state_unreachable_label();case"revoked":return c.remoteMachines_state_revoked_label();case"update-required":return c.remoteMachines_state_updateRequired_label();default:return}}function I(e){return be.has(e.state)}function Se({backendLabel:e,backendPlatform:t,machines:n,cloud:r,orchestrator:o=!1}){const a=[...o?[]:[{id:u,label:e,platform:m(t?.os,t?.arch),disabled:!1}],...n.map(s=>{const l=m(s.platform?.os,s.platform?.arch);return I(s)?{id:s.id,label:s.name,platform:l,disabled:!1}:{id:s.id,label:s.name,platform:l,disabled:!0,reason:_e(s.state)}})];for(const s of r??[])a.push({id:M(s.cloudMachineId),label:s.label,platform:null,kind:"cloud",disabled:s.unavailableReason!==null,...s.unavailableReason?{reason:s.unavailableReason}:s.needsProfile?{hint:c.cloudMachines_startOn_hint()}:{}});return a}function Ze(e,t=""){return e.find(n=>n.id===u)?.label??t}function Me(e){return(e.find(t=>!t.disabled)??e[0])?.id??S}function Qe(e,t,n){if(e!==u){if(e!==S)return O(e)?void 0:e;if(n)return t.find(r=>r.id!==u&&r.kind!=="cloud"&&!r.disabled)?.id}}function Oe({remoteMachinesVisible:e,supported:t,machines:n,cloud:r}){return e&&t&&(n.some(I)||(r??[]).some(o=>o.unavailableReason===null))}function Ae(e,t){return e.map(n=>{if(n.kind!=="cloud")return n;const r=t?.find(o=>M(o.cloudMachineId)===n.id)?.unavailableReason;return r?{...n,disabled:!0,reason:r,hint:void 0}:n})}function ke(e,t,n,r){const o=r?Me(r):S;if(!e)return o;if(e===u)return!r||r.some(s=>s.id===u)?u:o;if(O(e))return ge(n,e)?e:o;const a=t.find(s=>s.id===e);return a&&I(a)?a.id:o}function Ye(e,t){return t===u&&e!==u?S:t}function ve(e,{cloudEntries:t=!1,providerOf:n}={}){if(e===u)return{target:"local"};const r=O(e);if(r){const o=n?.(r);return t&&o&&o!=="e2b"?{target:"cloud",checkout:"isolated",cloudMachineId:r}:t?{target:"e2b",checkout:"isolated",cloudMachineId:r}:{target:"e2b",checkout:"isolated"}}return e?{target:"remote",checkout:"isolated",nodeId:e}:void 0}function et({groups:e,providerRef:t,model:n}){const r=s=>s.options.filter(l=>!l.disabled),o=e.find(s=>s.key===t),a=o?r(o):[];if(n){const s=$(n).modelId;if(a.some(l=>l.value===s))return null}else if(a.length>0)return null;if(o&&a.length>0)return{providerId:o.key,modelId:a[0].value};for(const s of e){if(s.key==="default")continue;const l=r(s);if(l.length>0)return{providerId:s.key,modelId:l[0].value}}return null}function ye(e,t,n,r){const o=e.map(b),a=o.indexOf(t),s=o.indexOf(n);if(a<0||s<0||a===s)return null;let l=s+(r==="after"?1:0);if(a<l&&(l-=1),l===a)return null;const p=[...e],[q]=p.splice(a,1);return p.splice(l,0,q),p.map(ce)}function tt(e,t,n){const r=e.findIndex(a=>b(a)===t),o=e[r+n];return r<0||!o?null:ye(e,t,b(o),n===-1?"before":"after")}function Ie(e,t){if(e===u)return"local";const n=t==="cloud"?O(e):null;return b(n?{kind:"cloud",cloudMachineId:n}:{kind:"machine",nodeId:e})}function Re(e,t){const n=new Map(t.map((o,a)=>[b(o),a])),r=o=>n.get(Ie(o.id,o.kind))??t.length;return e.map((o,a)=>({option:o,index:a})).sort((o,a)=>r(o.option)-r(a.option)||o.index-a.index).map(({option:o})=>o)}function nt(e,t){return t==="orchestrator"?e.filter(n=>n.kind!=="local"):[...e]}const Ce=i.createSelector(e=>Q.select(e)||y.select(e)),R=i.createSelector(e=>Ce.select(e)&&e.remoteMachines?.supported===!0),rt=i.createSelector(e=>R.select(e)&&J.select(e)&&!y.select(e)),D=i.createSelector(e=>R.select(e)&&e.remoteMachines.machineOrder===!0&&e.remoteMachines.order!==null),Ee=i.createSelector(e=>D.select(e)?e.remoteMachines.order??[]:[]),ot=i.createSelector(e=>e.remoteMachines.orderSaving!==null),C=i.createSelector(e=>Object.values(e.remoteMachines?.machines??{}).sort((t,n)=>t.name.localeCompare(n.name))),at=i.createSelector(e=>e.remoteMachines.localFingerprint),st=i.createSelector(e=>e.remoteMachines.pending),ct=i.createSelector(e=>e.remoteMachines.failures),it=i.createSelector(e=>e.remoteMachines.executorBackends??[]),Le=i.createSelector((e,t)=>{if(t===z)return c.layout_daemonStatus_localConnection_label();const n=T(e.connections.connections,t);return n?X(n):t}),Te=i.createSelector(e=>Le.select(e,e.connections.windowBackendId)),lt=i.createSelector((e,t)=>(t?e.remoteMachines.machines[t]??e.cloudMachines?.machines[t]:void 0)??null),dt=i.createSelector((e,t)=>{const n=e.providerSettings?.profiles;return G({catalogProfiles:ee.select(e,t),defaultRemoteIncompatibility:v.select(e,t),defaultRemoteLaunch:Y.select(e,t),profileDefaults:Object.values(n?.defaults??{}),profilesLoadStatus:n?.loadStatus??"idle"})}),ut=i.createSelector(e=>Object.fromEntries(Object.values(e.providerSettings?.profiles?.defaults??{}).map(t=>[t.baseProviderId,t.env.length>0]))),F=i.createSelector(e=>Oe({remoteMachinesVisible:R.select(e),supported:e.remoteMachines?.initialAgentPlacement===!0,machines:C.select(e),cloud:k(e)}));function Pe(e){const t=T(e.connections.connections,e.connections.windowBackendId);return t?.hostOs?{os:t.hostOs,arch:t.hostArch}:void 0}const U=i.createSelector(e=>{const t=y.select(e),n=Se({backendLabel:Te.select(e),backendPlatform:Pe(e),machines:C.select(e),cloud:k(e),orchestrator:t});return D.select(e)?Re(n,Ee.select(e)):n}),ft=i.createSelector(e=>F.select(e)?U.select(e):[]),mt=i.createSelector(e=>e.remoteMachines?.initialAgentPlacement===!0),pt=i.createSelector((e,t,n)=>{if(!F.select(e))return S;const r=j(e,n);return ke(t,C.select(e),r,Ae(U.select(e),r))});function j(e,t){const n=k(e);if(!n||!t)return n;const r=e.cloudMachines?.providers??{};return n.map(o=>{if(o.unavailableReason)return o;const a=Z(e,t,r[o.cloudMachineId]??null);return a?{...o,unavailableReason:a}:o})}const ht=i.createSelector((e,t)=>j(e,t));export{tt as $,pt as A,it as B,mt as C,at as D,Ee as E,ot as F,D as G,lt as H,ct as I,st as J,C as K,Ce as L,R as M,dt as N,rt as O,ht as P,ft as Q,U as R,S,F as T,Ze as U,M as V,O as W,Me as X,Qe as Y,Ae as Z,Ye as _,Ge as a,u as b,$e as c,Je as d,Xe as e,He as f,N as g,Ke as h,x as i,qe as j,nt as k,ve as l,We as m,et as n,b as o,m as p,ye as q,je as r,Ve as s,Ue as t,me as u,ze as v,ke as w,Le as x,Te as y,ut as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h8 as O,gQ as U,JV as B,KJ as H,DG as V,u6 as j,v3 as q,B9 as K,Ba as N,JT as Q,JU as z,Bb as X}from"./D0qhIm1r.js";import{selectWorkspaceTabOrder as f,selectCurrentWorkspaceTabId as S,selectLastClosedWorkspaceTab as Y}from"./_IjN0Lbt.js";import{i as Z,q as M,b as ee,j as te,l as ae}from"./CH7HNVC2.js";import{g as ne}from"./
|
|
1
|
+
import{h8 as O,gQ as U,JV as B,KJ as H,DG as V,u6 as j,v3 as q,B9 as K,Ba as N,JT as Q,JU as z,Bb as X}from"./D0qhIm1r.js";import{selectWorkspaceTabOrder as f,selectCurrentWorkspaceTabId as S,selectLastClosedWorkspaceTab as Y}from"./_IjN0Lbt.js";import{i as Z,q as M,b as ee,j as te,l as ae}from"./CH7HNVC2.js";import{g as ne}from"./xPQp-52E.js";import{bm as l}from"./Fcr7AvC-.js";import{z as oe,S as y}from"./BAtAwQ72.js";import{B as h,S as C,Q as ce}from"./Bqd7fdCF.js";import{al as le,aj as E}from"./QvexzmZW.js";import{g as se}from"./l3Y4i65_.js";function A(e,a){const n=f.select(e.state),o=S.select(e.state);if(!o)return null;const c=n.indexOf(o),s=c+(a==="left"?-1:1),p=n[s];return c<0||!p?null:(e.dispatch(j(o,p,a==="left"?"before":"after")),o)}function P(e){const a=S.select(e);return a&&f.select(e).includes(a)?a:null}function m(e,a,n){const o=P(e.state),c=o?`/workspace/${o}`:ne(e.state);return a!==c&&n(c),o}function ie(e,a,n,o){return e.dispatch(O(a)),m(e,n,o),a}function I(e,a){const o=a.match(/^\/workspace\/([^/]+)/)?.[1];return o?o==="new"?null:o:null}function R(e,a,n,o){if(n==="/")return D(e,a==="next"?0:"last",n,o);e.dispatch(a==="next"?Q():z());const c=S.select(e.state);if(!c)return null;const s=`/workspace/${c}`;return n!==s&&o(s),c}function re(e,a,n){const o=I(e,a);return o?ie(e,o,a,n):null}function pe(e,a,n){const o=I(e,a);if(!o)return null;const c=Z.select(e.state,o);if(!c)return null;const s=c.tabs.find(v=>v.id===c.activeTabId),p=c.tabs.length===0&&c.activeTabId===null,T=M.select(e.state,o)>1&&(p||c.tabs.length===1&&s!==void 0&&s.closable!==!1);if((!s||s.closable===!1)&&!T)return null;const g=n??se(o)?.availableCanvasWidth??void 0;return e.dispatch(U(o,void 0,g)),s?.id??c.id}function ue(e,a){const n=e.state.panelLayout.byWorkspaceId[a];return!n||n.restoreStatus==="pending"?!1:ee.select(e.state,a).length===0}function de(e,a,n){P(e.state)||e.dispatch(B(0)),m(e,a,n)}function L(e,a,{navigate:n,closeWindow:o}){return o?(o(),"window"):(m(e,a,n),null)}function be(e,a,n){const o=I(e,a);return o?pe(e,a,n.availableCanvasWidth)!==null?"panel":ue(e,o)?(e.dispatch(O(o)),f.select(e.state).length>0?(de(e,a,n.navigate),"workspace"):L(e,a,n)??"workspace"):null:f.select(e.state).length>0?null:L(e,a,n)}function fe(e,a,n){return e.dispatch(X()),m(e,a,n)}function ke(e,a,n){const o=a.match(/^\/workspace\/([^/]+)/),c=o&&o[1]!=="new"?o[1]:null,s=Y.select(e.state),p=c?ae.select(e.state,c):null;return c&&p&&(!s||p.closedAt>=s.closedAt)?p.kind==="column"?(e.dispatch(K(c)),"column"):(e.dispatch(N(c)),p.kind):s?(fe(e,a,n),"workspace"):null}function we(e,a){const n=a.match(/^\/workspace\/([^/]+)/),o=n&&n[1]!=="new"?n[1]:null;if(!o)return null;const c=q(o);return e.dispatch(c),te.select(e.state,o)}function D(e,a,n,o){const c=f.select(e.state),s=a==="last"?c.length-1:a;return s<0||s>=c.length?null:(e.dispatch(B(s)),m(e,n,o))}function We({isMac:e,register:a,store:n,getCurrentPath:o,navigate:c,openNewWorkspace:s,getRailMachineIds:p,onCreateAgent:T,onCreateNote:g,onCreateTerminal:v,onCreateBrowser:G,onWorkspaceTabMoved:W,closeWindow:F,resolveBinding:_}){const r=e?{meta:!0}:{ctrl:!0},$=oe("TOGGLE_SIDEBAR",e),k=t=>()=>t(o()),J=t=>()=>{const i=o().match(/^\/workspace\/([^/]+)/);i?.[1]&&i[1]!=="new"&&t(i[1])},u=t=>_?{binding:()=>_(t)}:{},w=t=>_?.(t)??ce(t);a({...u("global.new-space"),...r,key:"n",global:!0,description:l.workspace_shortcuts_newSpace_description(),action:s}),a({...u("panel.toggle-sidebar"),...$,global:!0,description:y.TOGGLE_SIDEBAR.label,action:()=>n.dispatch(H())}),a({...u("navigation.new-tab"),...r,key:"t",global:!0,description:l.workspace_shortcuts_newPanel_description(),action:k(t=>we(n,t))});for(const[t,i,b,d]of[["workspace.new-agent","a",l.ui_shortcuts_newAgent_label(),T],["workspace.new-note","n",l.layout_panelEmptyState_newItem_tooltip({label:l.layout_panelEmptyState_note_label()}),g],["workspace.new-terminal","t",l.layout_panelEmptyState_newItem_tooltip({label:l.layout_panelEmptyState_terminal_label()}),v],["workspace.new-browser","b",l.layout_panelEmptyState_newItem_tooltip({label:l.layout_panelEmptyState_browser_label()}),G]])d&&a({...u(t),...r,key:i,alt:!0,global:!0,allowInTerminal:!0,description:b,action:J(d)});a({...u("navigation.close-tab"),...r,key:"w",global:!0,description:l.workspace_shortcuts_closePanelTab_description(),action:k(t=>be(n,t,{navigate:c,closeWindow:F}))}),a({...u("navigation.close-space-tab"),...r,key:"w",shift:!0,global:!0,description:l.workspace_shortcuts_closeSpaceTab_description(),action:k(t=>re(n,t,c))}),a({...u("navigation.reopen-tab"),...r,key:"t",shift:!0,global:!0,description:l.workspace_shortcuts_reopenClosedTabOrSpace_description(),action:k(t=>ke(n,t,c))}),a({...u("navigation.move-space-tab-left"),...r,key:"ArrowLeft",alt:!0,shift:!0,global:!0,description:y.MOVE_SPACE_TAB_LEFT.label,action:()=>{const t=A(n,"left");t&&W?.({workspaceId:t,position:f.select(n.state).indexOf(t)+1})}}),a({...u("navigation.move-space-tab-right"),...r,key:"ArrowRight",alt:!0,shift:!0,global:!0,description:y.MOVE_SPACE_TAB_RIGHT.label,action:()=>{const t=A(n,"right");t&&W?.({workspaceId:t,position:f.select(n.state).indexOf(t)+1})}});for(const[t,i]of[["next",!1],["previous",!0]]){a({...u(t==="next"?"global.next-space":"global.previous-space"),key:"Tab",ctrl:!0,shift:i,global:!0,description:t==="next"?l.workspace_shortcuts_nextSpaceTab_description():l.workspace_shortcuts_previousSpaceTab_description(),action:k(d=>R(n,t,d,c))});const b=t==="next"?"global.next-space-alt":"global.previous-space-alt";a({...u(b),...r,key:t==="next"?"}":"{",shift:!0,global:!0,allowInTerminal:!0,preferLocal:!0,enabled:d=>!_||!h(b,d,_,e),description:t==="next"?l.workspace_shortcuts_nextSpaceTab_description():l.workspace_shortcuts_previousSpaceTab_description(),action:k(d=>R(n,t,d,c))})}const x=t=>{t===1?c("/"):D(n,t===9?"last":t-2,o(),c)};for(let t=1;t<=9;t++)a({...r,key:String(t),binding:()=>w("navigation.go-to-device").replace(/([1-8])-9$/,String(t)),global:!0,allowInTerminal:!0,enabled:i=>E.select(n.state)&&!h("navigation.go-to-device",i,w,e),description:l.machineRail_nav_ariaLabel(),action:()=>{const i=p?.()??le.select(n.state).map(d=>d.id),b=i[t===9?i.length-1:t-1];b&&n.dispatch(V(b))}});for(let t=1;t<=9;t++)a({...r,key:String(t),binding:()=>C["navigation.go-to-device"].replace(/([1-8])-9$/,String(t)),global:!0,allowInTerminal:!0,enabled:i=>!E.select(n.state)&&w("navigation.go-to-tab")===C["navigation.go-to-tab"]&&!h("navigation.go-to-device",i,w,e),description:l.ui_shortcuts_goToTab_label(),action:()=>x(t)});for(let t=1;t<=9;t++)a({binding:()=>w("navigation.go-to-tab").replace(/([1-8])-9$/,String(t)),...r,alt:!0,key:String(t),global:!0,allowInTerminal:!0,enabled:i=>!h("navigation.go-to-tab",i,w,e),description:t===1?l.home_navigation_description():t===9?l.workspace_shortcuts_selectLastSpaceTab_description():l.workspace_shortcuts_selectSpaceTab_description({digit:t}),action:()=>x(t)})}export{be as c,We as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var De=Object.defineProperty;var Ce=(i,s,e)=>s in i?De(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var E=(i,s,e)=>Ce(i,typeof s!="symbol"?s+"":s,e);import{K as Le,P as ce,a6 as le,as as z,aC as ve}from"./DPbxpEc3.js";import{b_ as we,c$ as ue,cr as de,cq as be}from"./C0JQvbI4.js";import{JH as p,Cg as Fe,bJ as ke,i as Ge,LM as me,ir as Ee,bV as Pe,Ec as H,CF as xe,fl as Ve,AL as Ue,e3 as fe,fh as _e,e2 as he,Be,Lq as $e,wy as Xe}from"./D0qhIm1r.js";import{aO as Se,dX as ge,A as K,P as Re,aK as Q}from"./cD292w1o.js";import{h as qe}from"./BAtAwQ72.js";import{c as W}from"./ChTqQfQN.js";import{a as We}from"./BdWqymET.js";import{m as j}from"./DkQdSPDN.js";import"./3SdAC2_C.js";import{bm as n}from"./Fcr7AvC-.js";import"./BRCr02in.js";import"./CWfjuhY2.js";import"./DRMe5Ypb.js";import{R as pe}from"./B5aYN90J.js";import{L as Ye}from"./CSiaiLHL.js";function ze(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const Te="confirmUnslothModelSwitch";function He(i){if(!i||typeof i!="object")return!1;const{agentId:s,agentName:e,workspaceId:t,workspaceTitle:r}=i;return typeof s=="string"&&typeof e=="string"&&typeof t=="string"&&(r===null||typeof r=="string")}function Ke(i){for(let s=i,e=0;s&&e<4;e++){const t=s.data;if(t&&typeof t=="object"){const{code:r,currentModel:a,requestedModel:l,agents:o}=t;if(r==="unsloth-model-switch-confirmation-required"&&typeof a=="string"&&typeof l=="string"&&Array.isArray(o)&&o.every(He))return{currentModel:a,requestedModel:l,agents:o}}s=s.cause}}function bt(i){if(!i||!(Te in i))return i;const{[Te]:s,...e}=i;return Object.keys(e).length>0?e:void 0}const Z=typeof performance<"u"?performance:{now:()=>Date.now()},V=new We("PerformanceOptimizer"),w=class w{constructor(){E(this,"metricsBuffer");E(this,"metricsIndex",0);E(this,"metricsCount",0);E(this,"MAX_METRICS",500);E(this,"TARGET_RESPONSE_TIME",100);E(this,"memoCache",new Map);E(this,"MEMO_TTL",6e4);E(this,"MAX_CACHE_SIZE",100);E(this,"cacheHits",0);E(this,"cacheMisses",0);E(this,"pendingRequests",new Map);E(this,"requestQueue",[]);E(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let o=0;o<s.length;o+=r){const _=s.slice(o,o+r).map((c,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(c);d(k)},g)})}),u=await Promise.all(_);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=Z.now();try{const a=t.cacheKey||s;if(t.memoize){const _=this.getMemoized(a);if(_!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),_;this.cacheMisses++}if(t.coalesce){const _=this.pendingRequests.get(s);if(_)return V.debug("Request coalesced",{operation:s}),_}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const o=await l;t.memoize&&this.memoize(a,o);const f=Z.now()-r;return this.recordMetric(s,f,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),f>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(f),target:this.TARGET_RESPONSE_TIME}),o}catch(a){const l=Z.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const c=this.metricsBuffer[(e+u)%this.MAX_METRICS];c&&s.push(c)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,c)=>u.duration-c.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const o=a/s.length,f=Math.floor(t.length*.95),_=Math.floor(t.length*.99);return{avgResponseTime:Math.round(o),p95ResponseTime:Math.round(t[f]?.duration||0),p99ResponseTime:Math.round(t[_]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};E(w,"instance");let te=w;const Qe=te.getInstance(),Ae={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},J={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},je={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function Ze(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Je(i,s){return Ze(i).every(t=>t in s)}function Oe(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function ee(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function et(i,s){return s&&J[i]&&Je(J[i],s)?Oe(J[i],s):je[i]||n.errors_userFriendly_fallback_error()}function tt(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?Ae[e]:Ae.GENERAL}const st={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function it(i){return st[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var N=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(N||{});class q extends Error{constructor(e,t,r={},a){super(e);E(this,"code");E(this,"context");E(this,"recoverySuggestions");E(this,"userMessage");E(this,"isRecoverable");E(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return et(e,this.context)}getDefaultRecoverySuggestions(e){return it(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return tt(this.code)}formatMessage(e){return Oe(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const rt={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function re(i){const s=i.toLowerCase();for(const e of rt.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const at="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=pe.DEFAULT_ATTEMPTS,retryDelay:a=pe.BASE_DELAY,exponentialBackoff:l=!0,notify:o=!1,notifyOnRetry:f=!1,context:_={},onError:u,onRetry:c,shouldRetry:R=this.defaultShouldRetry}=t;let g=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const C=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),C}catch(C){if(g=C,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:_}),u?.(g,d),d<=r&&R(g)){const h=l?a*Math.pow(2,d-1):a;f&&j.warning(n.agent_errorBoundary_retrying_message({seconds:h/1e3})),c?.(d),v.info(`[${e}] Retrying in ${h}ms`),await this.sleep(h)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${g?.message}`,P=ee(g?.message||n.agent_errorBoundary_generic_error()),D=g?.message?.toLowerCase()||"",$=D.includes("no available models")||D.includes("all models exhausted")||D.includes("all models unavailable");throw o&&!$&&j.error(P),new q(P,N.OPERATION_FAILED,{originalError:g?.message,detailedMessage:k,attempts:d,context:_})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&j.error(ee(a.message)),new q(ee(a.message),N.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return re(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof q?[N.NETWORK_ERROR,N.STREAM_TIMEOUT,N.STREAM_CONNECTION_FAILED,N.PROVIDER_CONNECTION_FAILED,N.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new q(`${t} timed out after ${e}ms`,N.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,o=[],f=[];for(let _=0;_<s.length;_+=r){const u=s.slice(_,_+r);(await Promise.allSettled(u.map(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")o.push(R.value);else{const d=R.reason;if(f.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],error:d.message}),!a)throw d}})}return f.length>0&&v.warn(`[${l}] Completed with ${f.length} errors`),{results:o,errors:f}}};E(b,"instance");let se=b;const nt=se.getInstance(),ie=W("browser/index"),F=new Map,B=new Map;let U;function ot(i,s,e){for(const t of s)try{t(e)}catch(r){ie.error("Error in agent subscriber callback",{agentId:i,error:r})}}function ct(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Se.select(e,t);B.get(t)!==a&&(B.set(t,a),ot(t,r,a))}})}function lt(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ft(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),ct();const a=p.state,l=Se.select(a,i);return r&&B.set(i,l),l?ie.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):ie.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const o=F.get(i);o&&(o.delete(s),o.size===0&&(F.delete(i),B.delete(i))),lt()}}const y=W("ErrorRecovery"),ye={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||re(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class ut{constructor(){E(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class dt extends ut{constructor(){super(...arguments);E(this,"activeRecoveries",new Map);E(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=ye.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let o,f=t.initialBackoffMs,_=0;for(let u=1;u<=t.maxRetries;u++){if(_=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const c=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:c,attempts:u,totalTime:Date.now()-a}}catch(c){o=c,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:o.message});const R=o.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:o.message});break}if(R.includes("no available models")||R.includes("all models exhausted")||R.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:o.message});break}if(re(o.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:o.message});break}if(!t.shouldRetry(o,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:o.message});break}if(u<t.maxRetries){const g=Math.random()*.2*f,d=Math.min(f+g,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:o.message}),await this.delay(d,l.signal),f=Math.min(f*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(o,_),this.emit("recovery:failure",{operationId:r,attempts:_,duration:Date.now()-a,error:o?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:o,attempts:_,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const o=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",o);const f=r;r=()=>{t.removeEventListener("abort",o),f()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const mt=new dt,O=new Ye({category:"WorkspaceMetrics"}),Et=100;class ft{constructor(){E(this,"metrics",new Map);E(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>Et;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const _t=new ft,M=W("AgentSend");function A(i){p.dispatch(i)}function Ie(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function ht(i){const s=Ie(i)&&i.success===!0&&"data"in i?i.data:i;return!Ie(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(at)}async function kt(i,s,e,t={}){const r=ge.select(p.state,e.id);if(!r)return;const a=Le(i,e.id),l=t.submission,o=!!l&&we.select(p.state,l.scope)?.supported===!0,f=(c,R,g=!1)=>{l&&A(Xe(l.scope,l.id,c,Date.now(),R,g))};let _=!1;const u=()=>(!l||_||be.select(p.state,l))&&r===ge.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return Qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let c=await p.dispatch(Fe(e.id,i));if(u()){if(!c)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));c={...c,isStreaming:c.isStreaming??!1};{if(c&&(c.status==="pending"||!c.id)&&!c.backendSessionId&&c.activationState!==K.ACTIVE&&c.activationState!==K.ACTIVATING){const h=e.id.startsWith("optimistic-"),Y=e.worktreePath||e.repositoryPath||e.path;if(!h&&Y){M.info("Activating pending session in sendMessage",{agentId:i,status:c.status,activationState:c.activationState,hasBackendSessionId:!!c.backendSessionId});const x=await p.dispatch(ke(e.id,i));if(!u())return;x&&(c=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else c&&c.status==="pending"&&c.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:c.backendSessionId,activationState:c.activationState}),c={...c,status:Ge.Active,activationState:K.ACTIVE},A(me({...c,workspaceId:e.id})));if(!c)throw new Error(`Failed to get or create session for agent ${i}`);A(me({...c,workspaceId:e.id}));const g=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)g.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)g.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??ce(),k=t.messageMetadata?.[Re],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[Re]:k}:{}},D={id:Ee(ue()),appMessageId:d,role:"user",contentBlocks:g,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};o||(l&&(f("rejected"),_=!0),A(Pe(c.id,D))),A(H(c.id,!0));let $=!1,C;try{o||await p.dispatch(xe(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=Ee(`msg_${ue()}`),Y=ce(),x=async()=>nt.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:c.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(m=>({type:m.type,mimeType:m.mimeType,dataLength:m.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(m=>({type:m.type,fileName:m.fileName,mimeType:m.mimeType,attachmentId:m.attachmentId,size:m.size}))||[]});const Me=t.model??t.modelId??c.model??void 0;A(Ve(i));const Ne=le(i,e.id),ne=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await qe("agent.sendMessage",{agentId:i,...o&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Me,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:Y,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(m=>{if(u())throw Ke(m)&&(C=m),m});if(u()){if(ht(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:c.id}),f("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const m=T.error,I=typeof m=="string"?m:m?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:c.id,queuedMessageId:T.queuedMessage?.id}),(!o||!l||!de.select(p.state,l))&&A(H(c.id,!1)),o||A(Ue(c.id,D.id)),o){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=fe(s,t),X=Q.select(p.state,i,e.id).find(oe=>oe.id===I.id||oe.turnId===L);A(_e(i,I.id,S,L,he(X??I,S),!X&&!!l&&de.select(p.state,l),ne))}f("accepted",I,!0),z(i,e.id);return}const m=T.queuedMessage;if(m){const I=T.turnId,G=typeof I=="string"?I:m.turnId;let L=m;if(u()&&le(i,e.id)===Ne){const S=Q.select(p.state,i,e.id),X=ze(S,m);A(Be(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:m.id}),await z(i,e.id).catch(()=>{}),L=Q.select(p.state,i,e.id).find(S=>S.id===m.id||S.turnId===G));if(u()&&typeof G=="string"){const S=fe(s,t);A(_e(i,m.id,S,G,he(L??m,S),!L,ne))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:m.id})}return}}o&&(f("accepted"),z(i,e.id),ve(i,e.id)),_t.incrementMessageSent(e.id)}},"send message",{retries:o?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),ae=o?await x().then(()=>({success:!0,error:void 0})):await mt.executeWithRecovery(x,ye.streaming,`send-message-${i}`);if(!ae.success)throw ae.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(H(c.id,!1)),!o&&t.messageMetadata&&A($e(c.id,D.id,{metadata:P})),o&&f($||C?"rejected":"uncertain"),C??h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Te as U,Ft as a,ee as c,ze as r,kt as s,Ke as u,bt as w};
|
|
1
|
+
var De=Object.defineProperty;var Ce=(i,s,e)=>s in i?De(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var E=(i,s,e)=>Ce(i,typeof s!="symbol"?s+"":s,e);import{K as Le,P as ce,a6 as le,as as z,aC as ve}from"./DauNjtnc.js";import{b_ as we,c$ as ue,cr as de,cq as be}from"./BbBEGYG_.js";import{JH as p,Cg as Fe,bJ as ke,i as Ge,LM as me,ir as Ee,bV as Pe,Ec as H,CF as xe,fl as Ve,AL as Ue,e3 as fe,fh as _e,e2 as he,Be,Lq as $e,wy as Xe}from"./D0qhIm1r.js";import{aO as Se,dX as ge,A as K,P as Re,aK as Q}from"./cD292w1o.js";import{h as qe}from"./BAtAwQ72.js";import{c as W}from"./ChTqQfQN.js";import{a as We}from"./BdWqymET.js";import{m as j}from"./DkQdSPDN.js";import"./3SdAC2_C.js";import{bm as n}from"./Fcr7AvC-.js";import"./BRCr02in.js";import"./CWfjuhY2.js";import"./DRMe5Ypb.js";import{R as pe}from"./B5aYN90J.js";import{L as Ye}from"./CSiaiLHL.js";function ze(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const Te="confirmUnslothModelSwitch";function He(i){if(!i||typeof i!="object")return!1;const{agentId:s,agentName:e,workspaceId:t,workspaceTitle:r}=i;return typeof s=="string"&&typeof e=="string"&&typeof t=="string"&&(r===null||typeof r=="string")}function Ke(i){for(let s=i,e=0;s&&e<4;e++){const t=s.data;if(t&&typeof t=="object"){const{code:r,currentModel:a,requestedModel:l,agents:o}=t;if(r==="unsloth-model-switch-confirmation-required"&&typeof a=="string"&&typeof l=="string"&&Array.isArray(o)&&o.every(He))return{currentModel:a,requestedModel:l,agents:o}}s=s.cause}}function bt(i){if(!i||!(Te in i))return i;const{[Te]:s,...e}=i;return Object.keys(e).length>0?e:void 0}const Z=typeof performance<"u"?performance:{now:()=>Date.now()},V=new We("PerformanceOptimizer"),w=class w{constructor(){E(this,"metricsBuffer");E(this,"metricsIndex",0);E(this,"metricsCount",0);E(this,"MAX_METRICS",500);E(this,"TARGET_RESPONSE_TIME",100);E(this,"memoCache",new Map);E(this,"MEMO_TTL",6e4);E(this,"MAX_CACHE_SIZE",100);E(this,"cacheHits",0);E(this,"cacheMisses",0);E(this,"pendingRequests",new Map);E(this,"requestQueue",[]);E(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let o=0;o<s.length;o+=r){const _=s.slice(o,o+r).map((c,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(c);d(k)},g)})}),u=await Promise.all(_);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=Z.now();try{const a=t.cacheKey||s;if(t.memoize){const _=this.getMemoized(a);if(_!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),_;this.cacheMisses++}if(t.coalesce){const _=this.pendingRequests.get(s);if(_)return V.debug("Request coalesced",{operation:s}),_}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const o=await l;t.memoize&&this.memoize(a,o);const f=Z.now()-r;return this.recordMetric(s,f,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),f>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(f),target:this.TARGET_RESPONSE_TIME}),o}catch(a){const l=Z.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const c=this.metricsBuffer[(e+u)%this.MAX_METRICS];c&&s.push(c)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,c)=>u.duration-c.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const o=a/s.length,f=Math.floor(t.length*.95),_=Math.floor(t.length*.99);return{avgResponseTime:Math.round(o),p95ResponseTime:Math.round(t[f]?.duration||0),p99ResponseTime:Math.round(t[_]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};E(w,"instance");let te=w;const Qe=te.getInstance(),Ae={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},J={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},je={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function Ze(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Je(i,s){return Ze(i).every(t=>t in s)}function Oe(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function ee(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function et(i,s){return s&&J[i]&&Je(J[i],s)?Oe(J[i],s):je[i]||n.errors_userFriendly_fallback_error()}function tt(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?Ae[e]:Ae.GENERAL}const st={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function it(i){return st[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var N=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(N||{});class q extends Error{constructor(e,t,r={},a){super(e);E(this,"code");E(this,"context");E(this,"recoverySuggestions");E(this,"userMessage");E(this,"isRecoverable");E(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return et(e,this.context)}getDefaultRecoverySuggestions(e){return it(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return tt(this.code)}formatMessage(e){return Oe(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const rt={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function re(i){const s=i.toLowerCase();for(const e of rt.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const at="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=pe.DEFAULT_ATTEMPTS,retryDelay:a=pe.BASE_DELAY,exponentialBackoff:l=!0,notify:o=!1,notifyOnRetry:f=!1,context:_={},onError:u,onRetry:c,shouldRetry:R=this.defaultShouldRetry}=t;let g=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const C=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),C}catch(C){if(g=C,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:_}),u?.(g,d),d<=r&&R(g)){const h=l?a*Math.pow(2,d-1):a;f&&j.warning(n.agent_errorBoundary_retrying_message({seconds:h/1e3})),c?.(d),v.info(`[${e}] Retrying in ${h}ms`),await this.sleep(h)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${g?.message}`,P=ee(g?.message||n.agent_errorBoundary_generic_error()),D=g?.message?.toLowerCase()||"",$=D.includes("no available models")||D.includes("all models exhausted")||D.includes("all models unavailable");throw o&&!$&&j.error(P),new q(P,N.OPERATION_FAILED,{originalError:g?.message,detailedMessage:k,attempts:d,context:_})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&j.error(ee(a.message)),new q(ee(a.message),N.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return re(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof q?[N.NETWORK_ERROR,N.STREAM_TIMEOUT,N.STREAM_CONNECTION_FAILED,N.PROVIDER_CONNECTION_FAILED,N.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new q(`${t} timed out after ${e}ms`,N.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,o=[],f=[];for(let _=0;_<s.length;_+=r){const u=s.slice(_,_+r);(await Promise.allSettled(u.map(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")o.push(R.value);else{const d=R.reason;if(f.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],error:d.message}),!a)throw d}})}return f.length>0&&v.warn(`[${l}] Completed with ${f.length} errors`),{results:o,errors:f}}};E(b,"instance");let se=b;const nt=se.getInstance(),ie=W("browser/index"),F=new Map,B=new Map;let U;function ot(i,s,e){for(const t of s)try{t(e)}catch(r){ie.error("Error in agent subscriber callback",{agentId:i,error:r})}}function ct(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Se.select(e,t);B.get(t)!==a&&(B.set(t,a),ot(t,r,a))}})}function lt(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ft(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),ct();const a=p.state,l=Se.select(a,i);return r&&B.set(i,l),l?ie.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):ie.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const o=F.get(i);o&&(o.delete(s),o.size===0&&(F.delete(i),B.delete(i))),lt()}}const y=W("ErrorRecovery"),ye={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||re(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class ut{constructor(){E(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class dt extends ut{constructor(){super(...arguments);E(this,"activeRecoveries",new Map);E(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=ye.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let o,f=t.initialBackoffMs,_=0;for(let u=1;u<=t.maxRetries;u++){if(_=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const c=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:c,attempts:u,totalTime:Date.now()-a}}catch(c){o=c,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:o.message});const R=o.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:o.message});break}if(R.includes("no available models")||R.includes("all models exhausted")||R.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:o.message});break}if(re(o.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:o.message});break}if(!t.shouldRetry(o,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:o.message});break}if(u<t.maxRetries){const g=Math.random()*.2*f,d=Math.min(f+g,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:o.message}),await this.delay(d,l.signal),f=Math.min(f*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(o,_),this.emit("recovery:failure",{operationId:r,attempts:_,duration:Date.now()-a,error:o?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:o,attempts:_,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const o=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",o);const f=r;r=()=>{t.removeEventListener("abort",o),f()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const mt=new dt,O=new Ye({category:"WorkspaceMetrics"}),Et=100;class ft{constructor(){E(this,"metrics",new Map);E(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>Et;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const _t=new ft,M=W("AgentSend");function A(i){p.dispatch(i)}function Ie(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function ht(i){const s=Ie(i)&&i.success===!0&&"data"in i?i.data:i;return!Ie(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(at)}async function kt(i,s,e,t={}){const r=ge.select(p.state,e.id);if(!r)return;const a=Le(i,e.id),l=t.submission,o=!!l&&we.select(p.state,l.scope)?.supported===!0,f=(c,R,g=!1)=>{l&&A(Xe(l.scope,l.id,c,Date.now(),R,g))};let _=!1;const u=()=>(!l||_||be.select(p.state,l))&&r===ge.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return Qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let c=await p.dispatch(Fe(e.id,i));if(u()){if(!c)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));c={...c,isStreaming:c.isStreaming??!1};{if(c&&(c.status==="pending"||!c.id)&&!c.backendSessionId&&c.activationState!==K.ACTIVE&&c.activationState!==K.ACTIVATING){const h=e.id.startsWith("optimistic-"),Y=e.worktreePath||e.repositoryPath||e.path;if(!h&&Y){M.info("Activating pending session in sendMessage",{agentId:i,status:c.status,activationState:c.activationState,hasBackendSessionId:!!c.backendSessionId});const x=await p.dispatch(ke(e.id,i));if(!u())return;x&&(c=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else c&&c.status==="pending"&&c.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:c.backendSessionId,activationState:c.activationState}),c={...c,status:Ge.Active,activationState:K.ACTIVE},A(me({...c,workspaceId:e.id})));if(!c)throw new Error(`Failed to get or create session for agent ${i}`);A(me({...c,workspaceId:e.id}));const g=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)g.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)g.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??ce(),k=t.messageMetadata?.[Re],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[Re]:k}:{}},D={id:Ee(ue()),appMessageId:d,role:"user",contentBlocks:g,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};o||(l&&(f("rejected"),_=!0),A(Pe(c.id,D))),A(H(c.id,!0));let $=!1,C;try{o||await p.dispatch(xe(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=Ee(`msg_${ue()}`),Y=ce(),x=async()=>nt.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:c.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(m=>({type:m.type,mimeType:m.mimeType,dataLength:m.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(m=>({type:m.type,fileName:m.fileName,mimeType:m.mimeType,attachmentId:m.attachmentId,size:m.size}))||[]});const Me=t.model??t.modelId??c.model??void 0;A(Ve(i));const Ne=le(i,e.id),ne=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await qe("agent.sendMessage",{agentId:i,...o&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Me,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:Y,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(m=>{if(u())throw Ke(m)&&(C=m),m});if(u()){if(ht(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:c.id}),f("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const m=T.error,I=typeof m=="string"?m:m?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:c.id,queuedMessageId:T.queuedMessage?.id}),(!o||!l||!de.select(p.state,l))&&A(H(c.id,!1)),o||A(Ue(c.id,D.id)),o){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=fe(s,t),X=Q.select(p.state,i,e.id).find(oe=>oe.id===I.id||oe.turnId===L);A(_e(i,I.id,S,L,he(X??I,S),!X&&!!l&&de.select(p.state,l),ne))}f("accepted",I,!0),z(i,e.id);return}const m=T.queuedMessage;if(m){const I=T.turnId,G=typeof I=="string"?I:m.turnId;let L=m;if(u()&&le(i,e.id)===Ne){const S=Q.select(p.state,i,e.id),X=ze(S,m);A(Be(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:m.id}),await z(i,e.id).catch(()=>{}),L=Q.select(p.state,i,e.id).find(S=>S.id===m.id||S.turnId===G));if(u()&&typeof G=="string"){const S=fe(s,t);A(_e(i,m.id,S,G,he(L??m,S),!L,ne))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:m.id})}return}}o&&(f("accepted"),z(i,e.id),ve(i,e.id)),_t.incrementMessageSent(e.id)}},"send message",{retries:o?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),ae=o?await x().then(()=>({success:!0,error:void 0})):await mt.executeWithRecovery(x,ye.streaming,`send-message-${i}`);if(!ae.success)throw ae.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(H(c.id,!1)),!o&&t.messageMetadata&&A($e(c.id,D.id,{metadata:P})),o&&f($||C?"rejected":"uncertain"),C??h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Te as U,Ft as a,ee as c,ze as r,kt as s,Ke as u,bt as w};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as t,s as r}from"./
|
|
1
|
+
import{c as t,s as r}from"./SMQhPblH.js";import{b as a}from"./Bosx7Vx3.js";var s=a(e=>`${r(e)}
|
|
2
2
|
.swimlane.cluster:not([data-color-id]) rect {
|
|
3
3
|
stroke: ${e.clusterBorder} !important;
|
|
4
4
|
}
|