@intent-hq/web 2.387.2 → 2.387.4
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/{CElnCtuM.js → 1Akrw_Go.js} +1 -1
- package/web/app/immutable/chunks/{DVdxemX2.js → 1QDpzamF.js} +1 -1
- package/web/app/immutable/chunks/{CJ1JqFmW.js → 214RIO0F.js} +1 -1
- package/web/app/immutable/chunks/{B3TMsgS_.js → 5A77Sz5A.js} +1 -1
- package/web/app/immutable/chunks/{DZ5jcXxx.js → 5fvMqmo4.js} +3 -3
- package/web/app/immutable/chunks/{Cw2Jpa3G.js → 5vn8moF9.js} +2 -2
- package/web/app/immutable/chunks/{CfbxOJat.js → 67dtpfJi.js} +1 -1
- package/web/app/immutable/chunks/{BRjGoMQ9.js → 6PPfObSI.js} +1 -1
- package/web/app/immutable/chunks/{D8nUBH9m.js → 8HuK1Er9.js} +1 -1
- package/web/app/immutable/chunks/{DMEYEHEJ.js → B0Wlo7fG.js} +1 -1
- package/web/app/immutable/chunks/{DsP8kMCe.js → B4Eq4HPv.js} +1 -1
- package/web/app/immutable/chunks/{D2F02ltW.js → B5o2kGUY.js} +1 -1
- package/web/app/immutable/chunks/{E-oQnJBy.js → B6QI2vvR.js} +1 -1
- package/web/app/immutable/chunks/{DQdW3cIp.js → B6uboii2.js} +1 -1
- package/web/app/immutable/chunks/{D1O8c-XE.js → BAX4cv8-.js} +1 -1
- package/web/app/immutable/chunks/{CS6vI0me.js → BBO_ZZVY.js} +1 -1
- package/web/app/immutable/chunks/{yvEwd65w.js → BBzUJjqG.js} +1 -1
- package/web/app/immutable/chunks/{B00JHs7f.js → BDZtKblf.js} +1 -1
- package/web/app/immutable/chunks/{Bjf7hugP.js → BDkhdOE6.js} +2 -2
- package/web/app/immutable/chunks/{-lHTHpP1.js → BEDd7-Vb.js} +2 -2
- package/web/app/immutable/chunks/{DTp2ogAW.js → BF_iaTyY.js} +1 -1
- package/web/app/immutable/chunks/{SUc3hjvu.js → BJLXRpRv.js} +1 -1
- package/web/app/immutable/chunks/{BUV-totk.js → BJm_zW19.js} +1 -1
- package/web/app/immutable/chunks/{Cp82YYua.js → BKydj3v8.js} +1 -1
- package/web/app/immutable/chunks/{lthgBKpc.js → BOgSka4V.js} +1 -1
- package/web/app/immutable/chunks/{BgLEGr1h.js → BRpMp0pC.js} +1 -1
- package/web/app/immutable/chunks/{BI_DusvG.js → BVQHXRSK.js} +1 -1
- package/web/app/immutable/chunks/{ujrHKn1R.js → BVyUyuge.js} +3 -3
- package/web/app/immutable/chunks/{DmBIaaw1.js → B_EqXRVT.js} +1 -1
- package/web/app/immutable/chunks/{DgXUCDp0.js → Bf2GXBZb.js} +2 -2
- package/web/app/immutable/chunks/{DwHRyZvZ.js → BfuYsPIk.js} +1 -1
- package/web/app/immutable/chunks/{cLiNexV2.js → BiHGQ82i.js} +1 -1
- package/web/app/immutable/chunks/{q1hD1wA_.js → Bjc0qUac.js} +1 -1
- package/web/app/immutable/chunks/{008oakff.js → Bk3dbb-9.js} +2 -2
- package/web/app/immutable/chunks/{CyTx9--U.js → BkuBneEQ.js} +1 -1
- package/web/app/immutable/chunks/{CsxKvalJ.js → BlaS78J9.js} +1 -1
- package/web/app/immutable/chunks/{iYBWUn-Y.js → Bmhkf_5j.js} +1 -1
- package/web/app/immutable/chunks/{5PJaIC3r.js → BmqLtUjV.js} +1 -1
- package/web/app/immutable/chunks/{BL-MsXUm.js → BoGUeIJ1.js} +7 -7
- package/web/app/immutable/chunks/{sRkVH83r.js → BoIUFr4e.js} +1 -1
- package/web/app/immutable/chunks/{Bxy-dKiU.js → BoMrPoLQ.js} +1 -1
- package/web/app/immutable/chunks/{Be8Ashad.js → BoMxhDDf.js} +1 -1
- package/web/app/immutable/chunks/{BIRGsT3P.js → BoR-Aoll.js} +1 -1
- package/web/app/immutable/chunks/{BWPNcv11.js → BoV1rY2_.js} +1 -1
- package/web/app/immutable/chunks/{CR20hpZS.js → Bp7ymIHg.js} +1 -1
- package/web/app/immutable/chunks/{CnskB1XE.js → BqZSjcLc.js} +1 -1
- package/web/app/immutable/chunks/{50A7Z_-B.js → BrJDea9R.js} +2 -2
- package/web/app/immutable/chunks/{DzEQS47t.js → BsUZk3L4.js} +1 -1
- package/web/app/immutable/chunks/{DkM6pApv.js → BvBYznmq.js} +1 -1
- package/web/app/immutable/chunks/{BPQAdw1o.js → BxNQVrws.js} +1 -1
- package/web/app/immutable/chunks/{CV2tYqJV.js → BxbyAaYq.js} +1 -1
- package/web/app/immutable/chunks/{BDNdgg66.js → Bxw-w3wD.js} +1 -1
- package/web/app/immutable/chunks/{B8xvO_6_.js → BzCsk4FY.js} +1 -1
- package/web/app/immutable/chunks/{CSvryKTi.js → C7DuWL7w.js} +1 -1
- package/web/app/immutable/chunks/{CQLtSEV2.js → C7z_7wxk.js} +1 -1
- package/web/app/immutable/chunks/{AOZzp8ty.js → CJDIH3zv.js} +3 -3
- package/web/app/immutable/chunks/{Bksce3O_.js → CJHyv6VE.js} +1 -1
- package/web/app/immutable/chunks/{DjWdAsv4.js → CJZaf5GR.js} +4 -4
- package/web/app/immutable/chunks/{DKUSDh19.js → CJo7javP.js} +1 -1
- package/web/app/immutable/chunks/{B-zoUUuH.js → CK-M6xTH.js} +1 -1
- package/web/app/immutable/chunks/{BDt9E5uz.js → CLL8WWfZ.js} +1 -1
- package/web/app/immutable/chunks/{CAaPJl7G.js → CNVWV9On.js} +1 -1
- package/web/app/immutable/chunks/{CkSfh61f.js → CNaWErup.js} +1 -1
- package/web/app/immutable/chunks/{BsTFmNb9.js → COWkK7Nj.js} +1 -1
- package/web/app/immutable/chunks/{CcT7kKD0.js → CPXag2IK.js} +1 -1
- package/web/app/immutable/chunks/{BCvggkji.js → CPibcNDa.js} +1 -1
- package/web/app/immutable/chunks/{CdaZbV8l.js → CRnu0LJs.js} +3 -3
- package/web/app/immutable/chunks/{CmbDm8yU.js → CTls0dV-.js} +1 -1
- package/web/app/immutable/chunks/{Cof8gmNK.js → CZ0HmBBV.js} +1 -1
- package/web/app/immutable/chunks/{B9y0cZhw.js → CcRX-nCw.js} +1 -1
- package/web/app/immutable/chunks/{gs8EHWKj.js → CeJSMQkW.js} +1 -1
- package/web/app/immutable/chunks/{Q--Jdcqq.js → CgqsFsAU.js} +1 -1
- package/web/app/immutable/chunks/{DYtAW_JF.js → Cl2OCShB.js} +1 -1
- package/web/app/immutable/chunks/{B3MH86Vn.js → ClG1RwH0.js} +1 -1
- package/web/app/immutable/chunks/{Q2Fhc9xf.js → Cn2SDR81.js} +1 -1
- package/web/app/immutable/chunks/{CvHiGYhL.js → Cpki0rxV.js} +1 -1
- package/web/app/immutable/chunks/{DABB0YKb.js → Ct87Z5qn.js} +1 -1
- package/web/app/immutable/chunks/{C4iGtRjS.js → CtfFhA78.js} +1 -1
- package/web/app/immutable/chunks/{jrJ2dWK7.js → Cvh_LEwS.js} +3 -3
- package/web/app/immutable/chunks/{zec4sHtD.js → Czs35Wob.js} +1 -1
- package/web/app/immutable/chunks/{BCXPUO8b.js → D4D4k3tr.js} +1 -1
- package/web/app/immutable/chunks/{BDWHrJG-.js → D5RijXzM.js} +2 -2
- package/web/app/immutable/chunks/{Beo-CJDg.js → D8DfwJKa.js} +1 -1
- package/web/app/immutable/chunks/{CAgbd5Ti.js → DF3aZxlM.js} +1 -1
- package/web/app/immutable/chunks/{CWsF2_VC.js → DFykJCOx.js} +1 -1
- package/web/app/immutable/chunks/{B0ezV3l2.js → DG-9OyGU.js} +1 -1
- package/web/app/immutable/chunks/{t7OX0H3A.js → DHCSPZdq.js} +1 -1
- package/web/app/immutable/chunks/{E0h7d-uJ.js → DHXBG4FM.js} +1 -1
- package/web/app/immutable/chunks/{9-uroABC.js → DMTO2PV_.js} +1 -1
- package/web/app/immutable/chunks/{ddYZXH0s.js → DOOF7B7y.js} +1 -1
- package/web/app/immutable/chunks/{D4HnBWIz.js → DPy2R9Zi.js} +1 -1
- package/web/app/immutable/chunks/{DzX7N4dl.js → DVOEOs4-.js} +1 -1
- package/web/app/immutable/chunks/{BSE7V9gR.js → Df4VXfby.js} +1 -1
- package/web/app/immutable/chunks/{BXLAqQEF.js → DhKNHQHg.js} +2 -2
- package/web/app/immutable/chunks/{CfhdjjBQ.js → DhhPztVH.js} +1 -1
- package/web/app/immutable/chunks/{CVhzAujT.js → DiYOhgmK.js} +1 -1
- package/web/app/immutable/chunks/{C8xlptKa.js → Dl_jpyYK.js} +1 -1
- package/web/app/immutable/chunks/{CBkBKkDd.js → DpYKjUjw.js} +4 -4
- package/web/app/immutable/chunks/{C2bGK2Dk.js → Dq8ATg_b.js} +6 -6
- package/web/app/immutable/chunks/{BUuO1cTh.js → Dxuw05vp.js} +2 -2
- package/web/app/immutable/chunks/{BxLkg7uH.js → DzPivCMD.js} +2 -2
- package/web/app/immutable/chunks/{BherRhQp.js → JZ7BvHUd.js} +1 -1
- package/web/app/immutable/chunks/{BRKRniXi.js → JZDgBuEz.js} +1 -1
- package/web/app/immutable/chunks/{tdkdPDHZ.js → JvuJOCwu.js} +1 -1
- package/web/app/immutable/chunks/{BJexyObh.js → LHa10x3T.js} +1 -1
- package/web/app/immutable/chunks/{DiGF1QZI.js → Ou8gj1D1.js} +1 -1
- package/web/app/immutable/chunks/{BDlra3t9.js → S6AaQrSi.js} +1 -1
- package/web/app/immutable/chunks/{D353gQK9.js → S8psjxQ2.js} +1 -1
- package/web/app/immutable/chunks/{E4QyIuMc.js → TupkTp1Q.js} +1 -1
- package/web/app/immutable/chunks/{CuNu9amm.js → YNjTtSCb.js} +1 -1
- package/web/app/immutable/chunks/{D6kOheez.js → b4uB8aKo.js} +1 -1
- package/web/app/immutable/chunks/{CQjRAr0U.js → cRzPGz4C.js} +1 -1
- package/web/app/immutable/chunks/{c-b7vp56.js → fOB2HeFJ.js} +1 -1
- package/web/app/immutable/chunks/{B43V2T0m.js → gQAxPojN.js} +1 -1
- package/web/app/immutable/chunks/{CI8Lw58b.js → geSBAPxG.js} +1 -1
- package/web/app/immutable/chunks/{kPePSbed.js → hcMtdTEL.js} +1 -1
- package/web/app/immutable/chunks/{DXAvNH3m.js → jfp05fHi.js} +1 -1
- package/web/app/immutable/chunks/{BkMXle2_.js → l5M-GDty.js} +1 -1
- package/web/app/immutable/chunks/{Ccr5qYxN.js → lSNpOVFA.js} +1 -1
- package/web/app/immutable/chunks/{0x2uouHf.js → lcF-Oq8x.js} +1 -1
- package/web/app/immutable/chunks/{BLkSfPBb.js → mfsBIyaW.js} +1 -1
- package/web/app/immutable/chunks/{a8KDQTjI.js → qPGtX9h3.js} +1 -1
- package/web/app/immutable/chunks/{Ce0BIIDa.js → qoyPAw2g.js} +1 -1
- package/web/app/immutable/chunks/{WIpix-jK.js → spiRJNAz.js} +4 -4
- package/web/app/immutable/chunks/{DoOGebPl.js → vQkUvlEK.js} +1 -1
- package/web/app/immutable/chunks/{N6CYAKjU.js → wZuM-cUZ.js} +3 -3
- package/web/app/immutable/chunks/{AYY4LgeX.js → yYsiZvHK.js} +1 -1
- package/web/app/immutable/entry/{app.CiEe3jVw.js → app.BGMaTRIT.js} +2 -2
- package/web/app/immutable/entry/start.1B_chnno.js +1 -0
- package/web/app/immutable/nodes/{0.Rx4EZM26.js → 0.DSCvQOLG.js} +1 -1
- package/web/app/immutable/nodes/{1.CTGLcOWT.js → 1.DLtWVL_-.js} +1 -1
- package/web/app/immutable/nodes/{10.B1s4o90R.js → 10.DRDamboA.js} +1 -1
- package/web/app/immutable/nodes/{11.BwS8WTYv.js → 11.CY5DZ2rh.js} +1 -1
- package/web/app/immutable/nodes/{15.aeOKe3S4.js → 15.Cy-jyVKL.js} +1 -1
- package/web/app/immutable/nodes/{19.p0y9h6Bd.js → 19.DlESwA1r.js} +2 -2
- package/web/app/immutable/nodes/{2.DmLTCsKI.js → 2.OryK6Ezb.js} +1 -1
- package/web/app/immutable/nodes/{3.CIGlwKH6.js → 3.Dow9c7eK.js} +1 -1
- package/web/app/immutable/nodes/{4.xsZADnG7.js → 4.27pNAxuC.js} +1 -1
- package/web/app/immutable/nodes/{5.DISXcTBo.js → 5.CuQ-XIg-.js} +1 -1
- package/web/app/immutable/nodes/{6.BBw6C3qe.js → 6.Gl-Qpl3s.js} +1 -1
- package/web/app/immutable/nodes/{7.D_jGH1JW.js → 7.Cstr_8Uy.js} +1 -1
- package/web/app/immutable/nodes/{8.C9qcwGHA.js → 8.N-hU-IO8.js} +1 -1
- package/web/app/immutable/nodes/{9.CKMXXqjg.js → 9.BgAeUM8M.js} +2 -2
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/entry/start.lgb00fUy.js +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/0Kw0mmSW.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/YLhFQnIu.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/D5wnbxHp.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BUsnh1ZW.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CrpUtGFn.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/DJivXy66.js","/app/immutable/chunks/CTowDLQa.js","/app/immutable/chunks/BQhBnAuP.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/Bq7euxCs.js","/app/immutable/chunks/CKcb8dge.js","/app/immutable/chunks/B-bGycam.js","/app/immutable/chunks/lZ7zkdkp.js","/app/immutable/chunks/BQ8hOnRo.js","/app/immutable/chunks/BpwKnO7b.js","/app/immutable/assets/register.CUyDR59i.css","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/CQ409-Pj.js","/app/immutable/chunks/_3Ca9E4W.js","/app/immutable/chunks/VcnbZvDh.js","/app/immutable/assets/terminal-manager.MhP_vFvK.css","/app/immutable/chunks/
|
|
2
|
-
import{Jx as n,o7 as I,nZ as g,nY as k,ms as Z,r0 as Q,iq as ee,oe as Ce,mv as te,vX as He,jY as $e,DS as Be,vs as Ve,qz as ze,mu as Ke,m7 as Je,aU as le,mh as Ye,mn as Xe,yI as Ze,Gt as Qe,DQ as et,A6 as tt,oc as st,mx as rt}from"./D5wnbxHp.js";import{selectActiveWorkspaceIds as nt}from"./L3K71tUU.js";import{b8 as V,b3 as se,cR as _,cU as ue,cC as at,dH as M,cx as ot,b4 as ct,cS as it,dC as lt,v as de,Z as ut,dE as dt,ch as pt,aw as mt,aG as ht,ao as ft,bQ as St,cO as gt,da as yt,cA as bt,bR as kt}from"./BJbm_MWC.js";import{x as wt}from"./Idk978zJ.js";import{ag as It,cP as vt,aZ as _t,av as Ct,p as At}from"./iYBWUn-Y.js";import{h as Rt}from"./0Kw0mmSW.js";import{bm as p,_ as q}from"./YLhFQnIu.js";import{i as w}from"./CL3a4Hm1.js";import{I as Et}from"./Bqd7fdCF.js";import{L as P}from"./iAKTK0Nq.js";import{ag as Tt,l as Pt,i as O,a9 as Ot,q as Wt}from"./B3TMsgS_.js";import{c as Nt}from"./ChTqQfQN.js";import{r as x}from"./uXuxG9cN.js";import{j as xt,u as Mt,n as Lt}from"./COVS9Crf.js";import{u as Dt}from"./_3Ca9E4W.js";import{aq as Ut,p as jt}from"./0x2uouHf.js";import{M as pe,O as me,h as Ae}from"./DJivXy66.js";import{d as Gt,o as he,l as fe,s as Se}from"./CIyUrgF0.js";import{m as qt,p as Ft}from"./CwCTYQp7.js";const ur=n.createSelector(e=>e.workspaceShare.open),dr=n.createSelector(e=>e.workspaceShare.workspaceId),pr=n.createSelector(e=>{const{open:t,workspaceId:s,session:r}=e.workspaceShare;return t&&s?{workspaceId:s,session:r}:null}),re=n.createSelector(e=>{const{open:t,workspaceId:s,withheld:r}=e.workspaceShare;return!t||!s||r||I(e.workspaceShare,s).inviteWithheld?!1:V.select(e,s)}),mr=n.createSelector(e=>e.workspaceShare.createRequest),hr=n.createSelector(e=>e.workspaceShare.mutationGeneration),fr=n.createSelector(e=>e.workspaceShare.workspaceTitle),Sr=n.createSelector(e=>g(e.workspaceShare.members)),gr=n.createSelector((e,t)=>k(e.workspaceShare.members,t)!==void 0),yr=n.createSelector(e=>e.workspaceShare.open&&e.workspaceShare.workspaceId&&!e.workspaceShare.withheld&&!I(e.workspaceShare,e.workspaceShare.workspaceId).inviteWithheld?g(e.workspaceShare.invites).filter(t=>t.workspaceId===e.workspaceShare.workspaceId):[]),br=n.createSelector(e=>{const{principals:t,members:s}=e.workspaceShare;return g(t).filter(r=>!k(s,r.principalId)&&(r.hostRole===void 0||r.hostRole==="guest"))}),kr=n.createSelector(e=>e.workspaceShare.guestCount),wr=n.createSelector(e=>e.workspaceShare.guestLimit),Ir=n.createSelector(e=>e.workspaceShare.loadStatus==="loading"),vr=n.createSelector(e=>e.workspaceShare.loadError),_r=n.createSelector(e=>e.workspaceShare.creating),Cr=n.createSelector(e=>e.workspaceShare.createError),Ar=n.createSelector(e=>e.workspaceShare.createdLink),Rr=n.createSelector(e=>e.workspaceShare.revokingInviteId),Er=n.createSelector(e=>e.workspaceShare.removingPrincipalId),Tr=n.createSelector(e=>e.workspaceShare.addingPrincipalId),Pr=n.createSelector(e=>e.workspaceShare.actionError),Or=n.createSelector((e,t)=>I(e.workspaceShare,t).loadStatus!=="idle"),Wr=n.createSelector((e,t)=>t?g(I(e.workspaceShare,t).members):[]),Nr=n.createSelector((e,t)=>!!t&&!I(e.workspaceShare,t).withheld&&V.select(e,t));n.createSelector((e,t)=>!!t&&I(e.workspaceShare,t).withheld);const xr=n.createSelector((e,t)=>t?I(e.workspaceShare,t).removingPrincipalId:null);n.createSelector((e,t)=>t?I(e.workspaceShare,t).removeError:null);const Mr=n.createSelector(e=>e.workspaceShare.integrationAuth),Lr=n.createSelector(e=>e.workspaceShare.ownerForgeMissing),z=n.createSelector(e=>re.select(e)&&se.select(e)&&e.workspaceShare.sharingContext!==null&&e.workspaceShare.sharingContext===_.select(e)),Ht=n.createSelector(e=>z.select(e)?e.workspaceShare.sharingEnabled:null),Dr=n.createSelector(e=>z.select(e)&&e.workspaceShare.sharingChecking),$t=n.createSelector(e=>z.select(e)&&e.workspaceShare.sharingEnabling),Bt=n.createSelector(e=>z.select(e)?e.workspaceShare.sharingError:null),Ur=n.createSelector(e=>{if(!re.select(e))return!1;const t=e.workspaceShare;return!t.integrationAuthLoaded||se.select(e)&&Ht.select(e)===null&&Bt.select(e)===null&&!$t.select(e)?!0:g(t.members).length===0&&(t.loadStatus==="idle"||t.loadStatus==="loading")}),jr=n.createSelector(e=>re.select(e)&&!!e.workspaceShare.workspaceId&&(se.select(e)||(ge.select(e)?ge.select(e)===ue.select(e)?.principal.id:at.select(e,e.workspaceShare.workspaceId)))&&ue.select(e)?.capabilities.workspaceGuestRoles===!0),Gr=n.createSelector(e=>e.workspaceShare.pendingRolePrincipalIds),qr=n.createSelector(e=>e.workspaceShare.roleErrors),ge=n.createSelector(e=>{const t=e.workspaceShare.workspaceId;return t?M.select(e,t)?.ownerPrincipalId??null:null}),Vt=n.createSelector(e=>{const t=_.select(e),s=nt.select(e);return{context:t,workspaceIds:t?s.filter(r=>V.select(e,r)):[]}}),Fr=n.createSelector((e,t)=>{const s=I(e.workspaceShare,t);return{context:s.inviteContext,generation:s.inviteGeneration,withheld:s.inviteWithheld}}),zt=[],Kt=n.createSelector((e,t)=>{const s=_.select(e),r=I(e.workspaceShare,t);if(!s||r.inviteContext!==s||r.inviteWithheld||!V.select(e,t))return zt;const a=e.presence?.context===s?e.presence.members[t]:void 0,o=new Set(a?g(a).flatMap(i=>i.identity?[JSON.stringify([i.identity.provider,i.identity.host.toLowerCase(),i.identity.externalUserId])]:[]):[]),c=new Set;return g(e.workspaceShare.invites).filter(i=>{if(i.workspaceId!==t||!i.pinLogin?.trim()||i.revokedAt||i.redeemedAt&&!i.reusable||!(Date.parse(i.expiresAt)>r.inviteReceivedAt))return!1;const l=i.pinIdentity??(i.pinGithubUserId!==void 0?{provider:"github",host:"github.com",externalUserId:String(i.pinGithubUserId)}:null);if(a&&i.redeemedByPrincipalId&&k(a,i.redeemedByPrincipalId))return!1;if(!l)return!0;const m=JSON.stringify([l.provider,l.host.toLowerCase(),l.externalUserId]);return o.has(m)||c.has(m)?!1:(c.add(m),!0)})}),Hr=n.createSelector(e=>{const s=Vt.select(e).workspaceIds.flatMap(r=>Kt.select(e,r).map(a=>Date.parse(a.expiresAt)));return s.length?Math.min(...s):null});function $r(e){return Object.entries(e).some(([t,s])=>s.available&&wt(t,s.authenticated))}const Br=n.createSelector(e=>e.hostRequirements.git),Vr=n.createSelector(e=>e.hostRequirements.node),zr=n.createSelector(e=>e.hostRequirements.gh),Kr=n.createSelector(e=>e.hostRequirements.checking),Jr=n.createSelector(e=>e.hostRequirements.hasCheckedOnce);function Re(e){const t=e.gitlabAuth?.statusFailed===!0;return It({labsEnabled:e.userPreferences?.labsPlainFolderWorkspacesEnabled===!0,protocolVersion:e.daemonHealth?.stats?.protocolVersion,githubConnected:e.githubAuth?.isAuthenticated===!0,githubSettled:e.githubAuth?.statusSettled===!0,githubFailed:e.githubAuth?.statusFailed===!0,gitlabConnected:e.gitlabAuth?.isConfigured===!0,gitlabSettled:e.gitlabAuth?.statusReady===!0||t,gitlabFailed:t})}const Yr=n.createSelector(Re),Jt=n.createSelector(e=>!ot.select(e)),Xr=n.createSelector(e=>(e.hostRequirements.node.ok||!Jt.select(e))&&(e.hostRequirements.git.available||Re(e))),Zr=n.createSelector(e=>{const t=e.hostRequirements.providerCli;return t?{context:t.context,warnings:g(t.warnings)}:void 0}),Qr="22.0.0";function Yt(e){return e.length>15?`${e.slice(0,15)}…`:e}function H(e){return e.name?.trim()||Yt(e.clientId)}function en(e){const{eligibleClients:t,ownClientId:s,driving:r,pinnedClientId:a}=e,o=t.find(l=>l.clientId===s&&l.connected),c=r!==null&&!r.connected,i=!r||r.clientId===s;return{mode:c?"offline":i?"here":"elsewhere",hostName:r?H(r):o?H(o):"",canSwitchHere:!!(o&&a!==s)}}const tn=n.createSelector(e=>e?.browserClients?.ownClientId??null),sn=n.createSelector(e=>e?.browserClients?.ownClientIdConfirmed===!0);n.createSelector(e=>g(e.browserClients.liveClients));const rn=n.createSelector((e,t)=>t?e?.browserClients?.byWorkspaceId[t]?.liveClientsLoaded??!1:e?.browserClients?.liveClientsLoaded??!1);n.createSelector((e,t)=>k(e.browserClients.liveClients,t));const nn=n.createSelector((e,t)=>(e?.browserClients?.byWorkspaceId[t]??Z).browserClient),an=n.createSelector((e,t)=>{const s=e?.browserClients?.byWorkspaceId[t];return s?.pinnedClientId!==void 0||s?.browserClient!=null});function X(e){const t=e.prettyHostname??e.hostname??e.name;return{clientId:e.clientId,...t!==void 0?{name:t}:{},connected:!0}}const on=n.createSelector((e,t)=>{const s=e?.browserClients??Q,r=s.byWorkspaceId[t]?.liveClients??ee(),a=g(r).filter(y=>y.capabilities.browserExec===!0).map(X),o=(s.byWorkspaceId[t]??Z).browserClient,c=s.byWorkspaceId[t],i=c?.pinnedClientId!==void 0?c.pinnedClientId:o?.source==="workspace"?o.clientId:null,l=i===null?Rt(o):void 0;let m=null;if(o?.resolved){const y=k(r,o.resolved.clientId);m=y?X(y):{...o.resolved,connected:!0}}else o?.source==="workspace"?m={clientId:o.clientId,connected:!1}:l&&(m={clientId:l.clientId,connected:!1});return{eligibleClients:a,ownClientId:s.ownClientId??"",routedVia:o?.source==="default"?l?.via:void 0,driving:m,pinnedClientId:i}}),cn=n.createSelector((e,t)=>{const s=e?.browserClients??Q;if(!s.ownClientId||!s.ownClientIdConfirmed)return!1;const r=s.byWorkspaceId[t]?.liveClients??ee(),a=k(r,s.ownClientId);return a!==void 0&&a.capabilities.browserExec!==!0}),ln=n.createSelector((e,t,s)=>{const r=e?.browserClients??Q,a=s?r.byWorkspaceId[s]?.liveClients??ee():r.liveClients,o=s?r.byWorkspaceId[s]?.liveClientsLoaded:r.liveClientsLoaded,c=k(a,t);return c?{name:H(X(c)),connected:!0}:{name:H({clientId:t}),connected:!o}}),un=n.createSelector((e,t)=>(e?.browserClients?.byWorkspaceId[t]??Z).tabsRevision),dn=n.createSelector(e=>Object.entries(e.browserClients?.byWorkspaceId??{}).filter(([,t])=>Object.keys(t.consumers??{}).length>0).map(([t])=>t)),N=new Map;function pn(e,t){return N.set(e,t),()=>{N.get(e)===t&&N.delete(e)}}async function mn(e){const t=N.get(e);return t?t():null}function hn(e){N.delete(e)}const Ee="From repo config",fn="repo-config";function Sn(e,t){return t==="repo-config"?p.workspace_setupScriptEditor_fromRepoConfig_name():t==="custom"?p.workspace_setupScriptEditor_custom_name():e}function Te(e){if(!e||typeof e!="object"||Array.isArray(e))return{setupScript:null};const t=e.setupScript;return{setupScript:typeof t=="string"&&t.trim().length>0?t:null}}function Xt(e){let t;try{t=JSON.parse(e)}catch{return null}return Te(t).setupScript}async function gn(e){if(!e)return null;try{const t=await w(Et.SETUP_SCRIPTS.READ_REPO_CONFIG,{repoPath:e}),s=t?.success?t.data?.content:null;return typeof s=="string"?Xt(s):null}catch{return null}}async function yn(e,t,s){if(!e||!t)return null;try{const{appClient:r}=await q(async()=>{const{appClient:o}=await import("./0Kw0mmSW.js").then(c=>c.s);return{appClient:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]),import.meta.url),a=await r.integrations.githubRepoConfig(e,t,s);return Te(a.config).setupScript}catch{return null}}function bn(e){const t=e.setupScript.trim();return t?e.setupScriptNameSource==="repo-config"&&e.setupScriptName===Ee&&e.repoConfigScriptRepo===e.repoPath&&t===(e.repoConfigScript??"").trim()?void 0:t:e.explicitChoice?"cd .":void 0}function kn(e){const{repoConfigScript:t,lastUsed:s,genericTemplate:r}=e;return t?{content:t,name:Ee,source:"repo-config"}:s?{content:s.content,name:s.nameSource==="repo-config"?"Custom":s.name,source:s.nameSource==="repo-config"?"custom":s.nameSource??"named"}:r?{content:r.content,name:r.name,source:"named"}:{content:"",name:"Custom",source:"custom"}}const Pe="setup-scripts:last-used-by-repo",Oe="setup-scripts:recent-by-repo",$=20,We=10,Zt=["repo-config","custom","named"];function ne(e,t){return t?`${e}\0${t}`:e}function Ne(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.name=="string"&&typeof t.content=="string"&&t.content.trim().length>0&&typeof t.usedAt=="string"&&(t.nameSource===void 0||Zt.includes(t.nameSource))}function B(){try{const e=localStorage.getItem(Pe);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const s={};for(const[r,a]of Object.entries(t))r&&Ne(a)&&(s[r]=a);return s}catch{return{}}}function xe(){try{const e=localStorage.getItem(Oe);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const s={};for(const[r,a]of Object.entries(t)){if(!r||!Array.isArray(a))continue;const o=a.filter(Ne);o.length>0&&(s[r]=o)}return s}catch{return{}}}function Qt(e,t){return e.name===t.name&&(e.nameSource??"named")===(t.nameSource??"named")&&e.content.trim()===t.content.trim()}function Me(e){return[...e].sort((t,s)=>s.usedAt.localeCompare(t.usedAt))}function Le(e){const t=[];for(const s of e)t.some(r=>Qt(r,s))||t.push(s);return t}function wn(e,t){if(!e)return[];const s=ne(e,t),r=xe()[s]??[],a=B()[s];return Le(Me(a?[...r,a]:r)).slice(0,We).map(c=>({name:c.name,content:c.content,nameSource:c.nameSource??"named",usedAt:c.usedAt}))}function es(e,t,s){try{const r=xe(),a=r[e]??(s?[s]:[]);r[e]=Le([t,...Me(a)]).slice(0,We);const o=Object.entries(r);o.length>$&&(o.sort(([,c],[,i])=>i[0].usedAt.localeCompare(c[0].usedAt)),o.length=$),localStorage.setItem(Oe,JSON.stringify(Object.fromEntries(o)))}catch{}}function In(e,t){if(!e)return;const s=B()[ne(e,t)];return s?{name:s.name,content:s.content,nameSource:s.nameSource??"named"}:void 0}function vn(e,t,s){const r=t.content.trim();if(!e||!r)return;const a=ne(e,s),o={name:t.name,content:r,usedAt:new Date().toISOString(),nameSource:t.nameSource??"named"};es(a,o,B()[a]);try{const c=B();c[a]=o;const i=Object.entries(c);i.length>$&&(i.sort(([,l],[,m])=>m.usedAt.localeCompare(l.usedAt)),i.length=$),localStorage.setItem(Pe,JSON.stringify(Object.fromEntries(i)))}catch{}}const ts={async isAuthenticated(e){try{return await w(P.IS_AUTHENTICATED,...e===void 0?[]:[{workspaceId:e}])}catch{return!1}},async getAuthState(e=!1,t){try{return await w(P.GET_AUTH_STATE,e,...t===void 0?[]:[{workspaceId:t}])}catch{return{isAuthenticated:!1,requiresDaemonAuth:!0}}},async getStatus(e){try{return await w(P.GET_STATUS,...e===void 0?[]:[{workspaceId:e}])}catch{return{isConfigured:!1,oauthUrl:""}}},async fetchMyIssues(e="assigned",t){return(await this.fetchMyIssuesPage(e,t===void 0?void 0:{workspaceId:t})).issues},async fetchMyIssuesPage(e="assigned",t){try{return await w(P.FETCH_MY_ISSUES,e,t)}catch{return{issues:[],nextToken:null}}},async searchIssues(e,t){return(await this.searchIssuesPage(e,t===void 0?void 0:{workspaceId:t})).issues},async searchIssuesPage(e,t){try{return await w(P.SEARCH_ISSUES,e,t)}catch{return{issues:[],nextToken:null}}}},_n=Object.freeze(Object.defineProperty({__proto__:null,linearAuthClient:ts},Symbol.toStringTag,{value:"Module"})),v={IS_AUTHENTICATED:"sentry-auth:is-authenticated",SAVE_CONFIG:"sentry-auth:save-config",GET_AUTH_STATE:"sentry-auth:get-auth-state",LOGOUT:"sentry-auth:logout",FETCH_PROJECTS:"sentry-auth:fetch-projects",FETCH_ISSUES:"sentry-auth:fetch-issues",SEARCH_ISSUES:"sentry-auth:search-issues",GET_ISSUE:"sentry-auth:get-issue"},ss={async isAuthenticated(e){try{return await w(v.IS_AUTHENTICATED,...e===void 0?[]:[{workspaceId:e}])}catch{return!1}},async saveConfig(e,t){return await w(v.SAVE_CONFIG,{organization:e,apiToken:t})},async getAuthState(e){try{return await w(v.GET_AUTH_STATE,...e===void 0?[]:[{workspaceId:e}])}catch{return{isAuthenticated:!1}}},async logout(){await w(v.LOGOUT)},async fetchProjects(e){try{return await w(v.FETCH_PROJECTS,...e===void 0?[]:[{workspaceId:e}])}catch{return[]}},async fetchIssues(e){return(await this.fetchIssuesPage(e)).issues},async fetchIssuesPage(e){try{return await w(v.FETCH_ISSUES,e)}catch{return{issues:[],nextToken:null}}},async searchIssues(e,t){return(await this.searchIssuesPage(e,t)).issues},async searchIssuesPage(e,t,s){try{return await w(v.SEARCH_ISSUES,{query:e,project:t,...s})}catch{return{issues:[],nextToken:null}}},async getIssue(e,t){try{return await w(v.GET_ISSUE,e,...t===void 0?[]:[{workspaceId:t}])}catch{return null}}},Cn=Object.freeze(Object.defineProperty({__proto__:null,sentryAuthClient:ss},Symbol.toStringTag,{value:"Module"})),ae=n.createSelector(e=>{const t=_.select(e);return!t||!ct.select(e)?null:JSON.stringify([t,e.hostExecution.generation,e.repositoryCheckout.authorityGeneration,e.gitlabAuth.host,e.gitlabAuth.instanceBaseUrl,e.gitlabAuth.statusReady,e.gitlabAuth.isConfigured,e.gitlabAuth.user])}),K=n.createSelector((e,t)=>k(e.repositoryCheckout.forms,t)??null),An=n.createSelector((e,t)=>{const s=K.select(e,t);return s?.admission===ae.select(e)&&s.status==="ready"?g(s.projects):[]}),Rn=n.createSelector((e,t)=>{const s=K.select(e,t);return s?.admission===ae.select(e)&&s.status==="ready"?g(s.branches):[]}),rs=n.createSelector((e,t)=>{const s=K.select(e,t);return!s||s.status!=="ready"||s.admission!==ae.select(e)||!s.capture||!s.project||!s.branch?null:{checkoutId:s.capture.checkoutId,revision:s.capture.revision,projectPath:s.project.projectPath,branch:s.branch.name,commitSha:s.branch.commitSha,mode:s.mode}}),En=n.createSelector((e,t)=>{const s=rs.select(e,t);return!!s&&(s.mode==="direct"||K.select(e,t)?.warmStatus==="ready")}),Tn="__new-workspace__",Pn="__initializer__",On="compact-workspace-initializer-state-prompt",Wn="onboarding-prompt",U=20*1024*1024,ye=Nt("NewWorkspaceDraft");function Nn(e,t){if(e.length>U)return ye.warn("Draft text exceeds the size guard; skipping persistence",{textLength:e.length,limit:U}),null;const s=Tt(t);if(s.length===0)return{text:e};const r=[];let a=e.length+2,o=0;for(const c of s){const i=JSON.stringify(c).length+1;if(a+i>U){o+=1;continue}r.push(c),a+=i}return o>0&&ye.warn("Draft attachments exceed the size guard; persisting the ones that fit",{limit:U,attachmentCount:s.length,droppedCount:o}),r.length>0?{text:e,attachments:r}:{text:e}}const ns="host.providerAuthStatus";function as(e={}){const t={};return e.workspaceId&&(t.workspaceId=e.workspaceId),typeof e.providerId=="string"&&e.providerId.length>0&&(t.providerId=e.providerId),typeof e.force=="boolean"&&(t.force=e.force),t}function os(e,t){const s=t.toLowerCase(),r=e.toLowerCase();return s.startsWith(r)?/^(['’]s\s+organization)?$/.test(s.slice(r.length)):!1}function cs(e){const{email:t,orgName:s}=e??{};return t&&s?os(t,s)?t:`${t} · ${s}`:t||s||void 0}function is(e){const t={};for(const s of e?.providers??[]){const r={authenticated:s.authenticated??void 0},a=cs(s.identity);a!==void 0&&(r.authDetails=a),s.identity?.email&&(r.email=s.identity.email),t[s.id]=r}return t}const ls=6e4,R=new Map,j=new Map,A=new Map;let F=0,De=0;const us=e=>JSON.stringify([it.select(n.state),De,e.workspaceId??null,e.providerId??"*"]);function ds(e){if(e.method!=="events.event"||!e.params)return;const t=e.params,r=(t.event&&typeof t.event=="object"?t.event:t).type;return typeof r=="string"?r:void 0}function J(e){if(F+=1,e)for(const t of R.keys()){const[,,,s]=JSON.parse(t);(s===e||s==="*")&&R.delete(t)}else R.clear()}typeof pe=="function"&&pe(e=>{["provider:auth-changed","host:execution-context-changed"].includes(ds(e)??"")&&J()});typeof me=="function"&&me(()=>{De+=1,J()});function ps(e={}){const t=us(e);if(e.force)J(e.providerId);else{const o=R.get(t);if(o&&o.expiresAt>Date.now())return Promise.resolve(o.verdicts);o&&R.delete(t)}const s=j.get(t);if(!e.force&&s?.generation===F)return s.promise;if(s){const o=A.get(t);if(o)return o.force||=e.force===!0,o.promise;let c;const i=s.promise.catch(()=>({})).then(()=>(A.get(t)===c&&A.delete(t),ps({...e,force:c.force}))).finally(()=>{A.get(t)===c&&A.delete(t)});return c={force:e.force===!0,promise:i},A.set(t,c),i}const r=F,a=Ae(ns,as(e)).then(is).then(o=>(r===F&&R.set(t,{verdicts:o,expiresAt:Date.now()+ls}),o)).finally(()=>{j.get(t)?.promise===a&&j.delete(t)});return j.set(t,{generation:r,promise:a}),a}function xn(e,t){return e.name?.trim()?e.name.trim():e.kind==="workspace"?e.id&&e.id!=="default"?p.workspace_discussion_conversation_title():p.workspace_discussion_title():e.participants.filter(r=>r.principalId!==t).map(r=>r.displayName||r.login||p.workspace_discussion_unknownAuthor_label()).join(", ")||p.workspace_discussion_group_title()}const ms=n.createSelector((e,t,s)=>{const r=Ce(e.repositoryContext,t);return s!==null&&r.binding===s?r:null});n.createSelector((e,t,s)=>{const r=ms.select(e,t.workspaceId,s);return r?.status==="ready"?k(r.roots,x(t))?.context:void 0});const Mn=n.createSelector((e,t)=>{if(t.admission===null||_.select(e)!==t.admission)return null;const s=Ce(e.repositoryContext,t.workspaceId),r=s.ownership;return!r||r.demandId!==t.demandId||r.admission!==t.admission||r.request.workspaceId!==t.workspaceId?null:{status:s.status,scope:s.scope,revision:s.revision,roots:s.status==="ready"?g(s.roots).map(a=>a.context):[],unavailableReason:s.unavailableReason}}),Ln=n.createSelector((e,t)=>{if(t.admission===null||_.select(e)!==t.admission)return null;const s=e.repositoryContext.selectionEdits,r=s?k(s,t.editId):void 0;return r&&r.status!=="closed"&&r.owner.admission===t.admission&&x(r.owner.root)===x(t.root)?r:null}),Dn=n.createSelector((e,t)=>{const s=e.repositoryContext.selectionEdits;return!!s&&g(s).some(r=>r.owner.root.workspaceId===t&&r.owner.admission===_.select(e)&&(r.status==="capturing"||r.status==="pending"&&(!r.observation||r.observation.attempt?.status==="pending")))}),Un=n.createSelector((e,t)=>{if(t.admission===null||_.select(e)!==t.admission||t.hostContext===null||lt.select(e,t.root.workspaceId)!==t.hostContext)return null;const s=e.repositoryContext.nativeReviewAttempts,r=s?k(s,t.attemptId):void 0;return r&&r.status!=="closed"&&r.owner.admission===t.admission&&r.owner.hostContext===t.hostContext&&x(r.owner.root)===x(t.root)?r:null}),jn=n.createSelector((e,t)=>e.repositoryContext.nativeReviewAttempts?k(e.repositoryContext.nativeReviewAttempts,t):void 0),be={auggie:"npm install -g @augmentcode/auggie","claude-code":"curl -fsSL https://claude.ai/install.sh | bash",codex:"npm i -g @openai/codex",opencode:"curl -fsSL https://opencode.ai/install | bash",droid:"curl -fsSL https://app.factory.ai/cli | sh",grok:"npm i -g @xai-official/grok",cursor:"curl https://cursor.com/install -fsS | bash",cortex:"curl -LsS https://ai.snowflake.com/static/cc-scripts/install.sh | sh"};function Gn(e){return Object.hasOwn(be,e)?be[e]:void 0}const hs=["venv",".venv","virtualenv","node_modules","google-cloud-sdk","__pycache__",".pytest_cache",".mypy_cache",".ruff_cache",".tox",".nox"];function fs(e){return e.replace(/\\/g,"/").split("/").filter(t=>t.length>0&&t!==".")}function Ss(e){const t=new Set(hs);return fs(e).some(s=>t.has(s))}const gs=new Set(["lastActivity","statusMessage","statusImageAssetId"]),ys=new Set([".git",".playwright-cli",".svelte-kit",".vite",".turbo",".cache",".parcel-cache",".next",".nuxt",".output","build","coverage","dist","playwright-report","target","test-results"]);function bs(e){return e.replace(/\\/g,"/").split("/").filter(t=>t.length>0&&t!==".")}function ks(e){if(!e.type.startsWith("file:"))return null;const t=e.data,s=t?.relativePath??t?.path??t?.filePath;return typeof s=="string"&&s.length>0?s:null}function ws(e){const t=ks(e);return!t||Ss(t)?!1:!bs(t).some(s=>ys.has(s))}function Is(e){if(e.type==="workspace:displayStatus-changed")return!0;if(e.type!=="workspace:updated")return!1;const t=e.data;if(!t?.changes||typeof t.changes!="object"||Array.isArray(t.changes))return!1;const s=Object.keys(t.changes).filter(r=>r!=="workspaceId");return s.length>0&&s.every(r=>gs.has(r))}function h(e){return typeof e=="string"?e.trim():""}function E(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function ke(e){const t=E(e.data),s=h(t.agentId)||h(e.sessionId),r=h(t.messageId);return s&&r?JSON.stringify([s,r]):""}function vs(e){const t=E(e.data),s={workspaceId:e.workspaceId,closable:!0},r=a=>a?{...s,type:"note",noteId:a,title:h(t.title)||h(t.noteTitle)||p.layout_tabTypes_note_title()}:null;switch(e.type){case"note:created":case"note:updated":case"comment:added":case"comment:resolved":return r(h(t.noteId));case"task:status-changed":return r(h(t.noteId)||h(t.linkedNoteId));case"spec:updated":case"goal:updated":return r("spec");case"agent:created":case"agent:renamed":case"agent:restored":case"agent:updated":case"agent:message":case"agent:user-message:sent":{const a=h(t.agentId)||h(e.sessionId);return a?{...s,type:"agent",agentId:a,title:h(t.agentName)||p.layout_tabTypes_agent_title()}:null}case"file:changed":{const a=h(t.path)||h(t.relativePath);return a&&t.action!=="delete"?{...s,type:"file",filePath:a,title:a.split(/[\\/]/).pop()||a}:null}case"git:commit":{const a=h(t.commit),o=h(t.gitRootId);return a?{...s,type:"changes",title:p.layout_tabTypes_changes_title(),data:{commitHash:a,...o?{gitRootId:o}:{}}}:null}default:return null}}function we(e,t){const s=E(e.data),r=Object.fromEntries(Object.entries(s).filter(([,c])=>typeof c=="string")),a=c=>t?p.workspace_peopleActivity_actorAction_label({name:t,action:c}):c;switch(e.type){case"note:created":case"note:updated":case"note:deleted":case"spec:updated":case"goal:updated":return O({...e,actor:{...e.actor,name:t},data:r});case"agent:created":case"agent:renamed":case"agent:deleted":case"agent:restored":case"git:commit":case"git:push":case"git:pull":case"git:branch":case"git:merge":return a(O({...e,actor:{...e.actor,name:void 0},data:r}));case"agent:updated":return h(s.modelId)||s.completionReportCleared===!0?a(O({...e,actor:{...e.actor,name:void 0},data:s})):null;case"file:changed":return ws(e)?O({...e,actor:{...e.actor,name:t},data:{path:h(s.path)||h(s.relativePath),action:h(s.action)}}):null;case"comment:added":return t?p.events_activity_authorCommented_label({author:t}):p.workspace_peopleActivity_commented_label();case"comment:resolved":return s.resolved===!1?a(p.events_activity_reopenedCommentThread_label()):s.resolved===!0?a(p.events_activity_resolvedCommentThread_label()):null;case"agent:message":case"agent:user-message:sent":{const c=h(s.agentName)||h(s.toAgentName);return a(c?p.workspace_peopleActivity_messagedAgent_label({agent:c}):p.workspace_peopleActivity_sentMessage_label())}case"task:status-changed":return a(O({...e,actor:{...e.actor,name:void 0},data:{taskName:h(s.taskName)||h(s.noteTitle),newStatus:h(s.newStatus)||h(s.status)}}));case"workspace:created":return a(p.events_activity_createdWorkspace_label());case"workspace:updated":{if(Is(e))return null;const c=E(s.changes);if(Object.keys(c).filter(l=>l!=="workspaceId").length===0)return null;const i=h(c.title);return a(i?p.events_activity_renamedWorkspaceTo_label({title:i}):p.events_activity_updatedWorkspace_label())}default:return null}}function W(e,t){const s=h(e);return s===t||/^(user|you|system|unknown|anonymous|local user)$/i.test(s)?"":s}function _s(e,t,s,r){const a=new Map(s.map(u=>[u.principalId,u])),o=new Map;for(const u of t){if(u.workspaceId!==e||u.type!=="agent:last-message")continue;const d=E(u.data),f=de({role:d.role==="user"?"user":"system",author:d.author,metadata:d.metadata}),S=ke(u);if(!f||!S||typeof d.lastUserMessage!="string")continue;const b=Pt({id:h(d.messageId),role:"user",timestamp:u.timestamp,contentBlocks:[{type:"text",text:d.lastUserMessage}],author:f,metadata:d.metadata},r);b&&o.set(S,b)}const c=new Set,i=new Set,l=[];let m=0;for(const u of t){if(u.workspaceId!==e||!h(u.id)||c.has(u.id))continue;const d=Date.parse(u.timestamp);if(!Number.isFinite(d)){m++;continue}const f=E(u.data),S=u.type==="agent:message",b=S?de({role:f.role==="user"?"user":"system",author:f.author,metadata:f.metadata}):null;if(S?!b:u.actor?.type!=="user"){S&&f.role==="user"&&u.actor?.type==="user"&&ut(f.metadata)&&l.push({row:null,timestamp:d,segment:m});continue}const Fe=S?h(f.messageId):"",T=S?ke(u):"";if(T&&i.has(T))continue;const C=h(u.actor?.id),Y=C?a.get(C):void 0,L=b?W(b.displayName,b.principalId??"")||W(b.login,b.principalId??""):W(u.actor.name,C)||W(Y?.displayName,C)||W(Y?.login,C),ce=we(u,"");if(!ce)continue;if(!L){l.push({row:null,timestamp:d,segment:m});continue}const D=S?o.get(T)??null:null,ie=D?p.workspace_peopleActivity_actorAction_label({name:L,action:D}):we(u,L);ie&&(c.add(u.id),T&&i.add(T),l.push({timestamp:d,segment:m,row:{id:u.id,name:L,principalId:b?h(b.principalId)||null:C||null,avatarUrl:b?b.avatarUrl:Y?.avatarUrl??null,label:ie,actionLabel:D??ce,continuation:!1,timestamp:u.timestamp,destination:vs(u),messageId:Fe||null,messagePreview:D}}))}l.sort((u,d)=>d.timestamp-u.timestamp);const y=[];for(const[u,d]of l.entries()){if(!d.row)continue;const f=l[u-1],S=f?f.timestamp-d.timestamp:NaN;d.row.continuation=!!(d.row.principalId&&f?.row?.principalId===d.row.principalId&&f.segment===d.segment&&Number.isFinite(S)&&S>=0&&S<=15*6e4),y.push(d.row)}return y}const qn=n.createSelector(e=>e.workspaceEvents.subscriptionAttempt),Fn=n.createSelector(e=>e.workspaceEvents.subscriptionGeneration),Cs=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??te).events),Hn=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??te).nextToken),$n=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]?.peopleRequestId??null)!==null),Bn=n.createSelector((e,t)=>e.workspaceEvents.byWorkspaceId[t]?.peopleError??null),Vn=n.createSelector((e,t)=>e.workspaceEvents.byWorkspaceId[t]?.peopleInitialized??!1),Ue=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??te).peopleStreams),zn=n.createSelector((e,t)=>Object.values(Ue.select(e,t)).every(s=>s.initialized&&s.nextToken===null)),Kn=n.createSelector((e,t,s)=>{const r=Cs.select(e,t),o=_s(t,r,vt.select(e,t),M.select(e,t)?.ownerPrincipalId)[s-1]?.timestamp,c=Ue.select(e,t);return["user","message"].filter(i=>{const l=c[i];if(!l.initialized)return!0;if(l.nextToken===null)return!1;const m=r.find(y=>y.id===l.oldestEventId)?.timestamp;return!o||!m||!(Date.parse(m)<=Date.parse(o))})});function Jn(e,t=e,s="default",r,a){if(!Dt.select(n.state))return;const o=a??xt.select(n.state,t)??Mt.select(n.state,t)[0];if(!o)return;const c=Lt.select(n.state,t,o),i={type:"discussion",title:r??(s==="new"?p.workspace_discussion_new_title():p.workspace_discussion_title()),workspaceId:e,closable:!0,data:{conversationId:s}},l=c?.tabs.find(m=>He(m,i));s==="new"&&n.dispatch($e(e)),n.dispatch(l?Be(t,l.id,o):Ve(t,i,o,void 0,!0,void 0,!0))}const Yn=n.createSelector((e,t)=>{const s=[],r=new Set,a=new Set,o=c=>{const i=c.block.attachmentId??c.id;if(!r.has(i)){if(!c.block.attachmentId&&c.block.data&&!c.block.dataTruncated){const l=`${c.block.mimeType}/${c.block.data}`;if(a.has(l))return;a.add(l)}r.add(i),s.push(c)}};for(const[c,i]of Object.entries(Ot.select(e,t)))for(const l of g(i))l.imageData&&l.imageMimeType?o({id:`draft/${c}/${l.id}`,name:l.label,block:{type:"image",data:l.imageData,mimeType:l.imageMimeType}}):l.type==="file"&&(l.attachmentId||l.placementStatus)&&o({id:`draft/${c}/${l.id}`,name:l.label,placementStatus:l.placementStatus,block:{type:l.attachmentMimeType?.startsWith("image/")?"image":"file",attachmentId:l.attachmentId,mimeType:l.attachmentMimeType,fileName:l.label,size:l.attachmentSize}});for(const c of dt.select(e,t)){const i=pt.select(e,c),l=[...mt.select(e,c),...ht.select(e,c)];for(const m of l)if(m.role==="user")for(const[y,u]of(m.contentBlocks??[]).entries()){if(u.type!=="image"&&!Wt(u))continue;const d=u.id?i?.[ze(m.id,u.id)]:void 0,f=d?.status==="loaded"?d.block:u;o({id:`${c}/${m.id}/${u.id??y}`,name:f.fileName,block:f,agentId:c,messageId:m.id,hydration:d})}}return s}),As=n.createSelector((e,t)=>e.context.byWorkspaceId[t]??Ke),Rs=n.createSelector((e,t)=>g(As.select(e,t).items)),Xn=n.createSelector((e,t)=>Rs.select(e,t).filter(s=>!s.parentNoteId)),Zn=n.createSelector((e,t)=>e.agentLock.byWorkspaceId[t]?.lockedAgentIds??je),Qn=n.createSelector((e,t)=>e.agentLock.byWorkspaceId[t]?.lockedFilePaths??je),je={},ea=n.createSelector((e,t,s)=>{const r=e.gitWrite.byWorkspaceId[t]?.operations;return r?k(r,s):void 0}),Ge=n.createSelector((e,t)=>{const s=e.gitWrite.byWorkspaceId[t]?.operations;return s?g(s):[]}),ta=n.createSelector((e,t)=>Ge.select(e,t).some(s=>s.status==="queued"||s.status==="running")),sa=n.createSelector((e,t)=>Ge.select(e,t).filter(s=>s.operation.kind==="partialCommit"&&(s.status==="queued"||s.status==="running")));function Ie(e){return e.title||`PR #${e.number}`}const oe=n.createSelector((e,t)=>{const s=e.gitRoots?.byWorkspaceId?.[t];return s?g(s.gitRoots):[]});function Es(e){return{key:"primary",isPrimary:!0,path:e.worktreePath??e.path,branch:e.branch,repoOwner:e.repositoryOwner,repoName:e.repositoryName,prNumber:e.prNumber,prUrl:e.prUrl,prStatus:e.prStatus,pullRequests:e.pullRequests}}function Ts(e){return{key:e.id,isPrimary:!1,path:e.path,branch:e.branch,repoOwner:e.repoOwner,repoName:e.repoName,prNumber:e.prNumber,prUrl:e.prUrl,prStatus:e.prStatus,pullRequests:e.pullRequests,gitRoot:e}}const ra=n.createSelector((e,t)=>{const s=M.select(e,t),r=oe.select(e,t).map(Ts);return s?[Es(s),...r]:r}),na=n.createSelector((e,t)=>oe.select(e,t).length>0),aa=n.createSelector(e=>Object.entries(e.gitRoots?.byWorkspaceId??{}).filter(([,t])=>Object.keys(t.consumers??{}).length>0).map(([t])=>t)),Ps=n.createSelector((e,t,s)=>k((e.acceptWorkflow.byWorkspaceId[t]??Je).operations,s)),oa=n.createSelector((e,t,s)=>Ps.select(e,t,s)?.status==="running"),ca=n.createSelector((e,t)=>e.acceptWorkflow.byWorkspaceId[t]?.mergeDrawerOpen??!1),ia=n.createSelector((e,t)=>{const s=ft.select(e,t)?.hasRemote??!1,r=M.select(e,t)?.pullRequests?.some(a=>a.status===le.Open||a.status===le.Draft)??!1;return{squash:!1,viaPR:s&&r,pushAfter:s,...e.acceptWorkflow.byWorkspaceId[t]?.mergeOptions}}),la=n.createSelector(e=>Object.keys(e.acceptWorkflow.byWorkspaceId).filter(t=>e.acceptWorkflow.byWorkspaceId[t].observerRequested)),ua=n.createSelector((e,t)=>{const s=M.select(e,t),r=St.select(e,t),a=gt.select(e,t),o=s?.repositoryOwner&&s.repositoryName?`${s.repositoryOwner}/${s.repositoryName}`:void 0,c=_t(Ct(s?.pullRequests,s?.activePullRequest,(i,l)=>At(i,s?.repositoryOwner,s?.repositoryName,l),Ie,o),yt.select(e,t),o,oe.select(e,t),Ie).own;return{visible:(e.acceptWorkflow.byWorkspaceId[t]?.consumerCount??0)>0,ready:kt.select(e,t),owner:!bt.select(e,t),authenticated:Ut.select(e),pushedCount:r.filter(i=>i.isPushed).length,hasRemote:a.hasRemote,clearReset:a.hasResetToTrunk&&c.some(i=>i.status!=="merged"),clearMerge:!!(a.mergeHeadSha&&r[0]?.hash&&a.mergeHeadSha!==r[0].hash)}}),da=n.createSelector((e,t,s)=>e.bgExecutor?.byWorkspaceId[t]?.executors[s]??Ye),Os=n.createSelector((e,t)=>e.prWorkflow.byWorkspaceId[t]??Xe);n.createSelector((e,t,s)=>Os.select(e,t).operations[s]);const pa=n.createSelector(e=>Object.keys(e.noteReadTracking.unreadNoteIds)),ma=n.createSelector(e=>e.noteReadTracking.readRecords),Ws="host.providerTestPrompt",Ns=Gt("ok",[he({ok:fe(!0)}).passthrough(),he({ok:fe(!1),reason:Se().min(1),message:Se()}).passthrough()]),xs=3e5;async function ha(e){const t=await Ae(Ws,{providerId:e.providerId,...e.model?{model:e.model}:{}},{timeoutMs:xs}),s=Ns.parse(t);return(s.ok||s.reason==="auth-required")&&J(e.providerId),s}const Ms=-1,Ls=/^remote-script-lost:\s*/,Ds=["idle","starting","running","restarting","exited"],ve=e=>!!e&&typeof e=="object"&&!Array.isArray(e),_e=e=>typeof e=="string"&&e.trim().length>0;function Us(e){return ve(e)&&_e(e.remoteAgentId)&&_e(e.nodeId)&&ve(e.runtime)&&Ds.includes(e.runtime.status)}function fa(e){return Array.isArray(e.machineRuns)?e.machineRuns.filter(Us):[]}function Sa(e,t,s){const r=qt(e.nodeId,s)??{nodeId:e.nodeId,name:p.remoteAgent_location_unknownMachine(),platform:null,state:"ready"};if(s&&s.id===e.nodeId)return r;const a=t?.nodeId===e.nodeId?t:null;return{...r,name:a?.nodeName?.trim()||r.name,platform:Ft(a?.placement?.os,a?.placement?.arch)}}function js(e){return e.status==="exited"&&e.exitCode===Ms}function Gs(e){const t=e.error?.trim().replace(Ls,"").trim();switch(t){case"the machine disconnected":return p.scripts_remote_lostDisconnected_label();case"the machine was removed":return p.scripts_remote_lostRemoved_label();case"the agent was deleted":return p.scripts_remote_lostAgentDeleted_label();case"the agent was stopped for good":return p.scripts_remote_lostAgentStopped_label();default:return t||p.scripts_remote_lostReason_fallback()}}function ga(e){if(js(e))return{kind:"lost",label:p.scripts_remote_lost_tooltip({reason:Gs(e)})};const t=jt(e);switch(t){case"running":return{kind:t,label:p.terminal_quakeOverlay_status_running()};case"restarting":return{kind:t,label:p.workspace_devScripts_restarting_label()};case"idle":return{kind:t,label:p.terminal_quakeOverlay_status_idle()};case"succeeded":return{kind:t,label:p.terminal_quakeOverlay_status_exitedZero()};case"failed":return{kind:t,label:p.terminal_quakeOverlay_status_errorCode({code:e.exitCode??1})};case"stopped":return{kind:t,label:p.terminal_quakeOverlay_status_stoppedSignal({signal:(e.exitCode??128)-128})};default:return{kind:t,label:p.terminal_quakeOverlay_status_exited()}}}const G=e=>typeof e=="string"&&e.length>0,qs=/\bremote-script-agent-ending:/;function ya(e){return!!e&&qs.test(e)}function ba(e){if(!e||typeof e!="object")return null;const t=e.data;if(!t||typeof t!="object")return null;const s=t,r=e instanceof Error&&e.message?{message:e.message}:{};return s.code==="machine-update-required"?{success:!1,code:"machine-update-required",update:s.update==="backend"?"backend":"machine",...G(s.machineVersion)?{machineVersion:s.machineVersion}:{},...G(s.backendVersion)?{backendVersion:s.backendVersion}:{},...r}:s.code==="machine-unreachable"?{success:!1,code:"machine-unreachable",attempts:Array.isArray(s.attempts)?s.attempts.flatMap(o=>{const c=o??{};return G(c.route)&&G(c.error)?[{route:c.route,error:c.error}]:[]}):[],...r}:null}function ka(e){const s=e.filter(a=>a.runtime.status==="running"&&a.runtime.detectedUrl?.trim()).sort((a,o)=>(o.runtime.startedAt??"").localeCompare(a.runtime.startedAt??""))[0],r=s?.runtime.detectedUrl?.trim();return!s||!r?null:{scriptId:s.id,name:s.name,url:r}}const Fs={status:"idle",error:null},Hs=n.createSelector((e,t)=>e.workspaceLifecycle.loadByWorkspaceId[t]??Fs);n.createSelector((e,t)=>Hs.select(e,t).error);const wa=n.createSelector((e,t)=>k(e.workspace.workspaces,t)??e.workspace.pendingCreations[t]),qe=n.createSelector((e,t)=>e.workspaceLifecycle.sessionPhaseByWorkspaceId[t]),$s=e=>e==="hydrated"||e==="live",Ia=n.createSelector((e,t)=>{const s=qe.select(e,t);return s==="hydrated"||s==="live"}),va=n.createSelector(e=>{const t=e.workspaceLifecycle.sessionPhaseByWorkspaceId;return Object.keys(t).filter(s=>$s(t[s]))}),_a=n.createSelector((e,t)=>qe.select(e,t)==="live");function Ca(e){const{selectedProviderId:t,activeProviderId:s,recommitActive:r,dispatch:a}=e;if(!t)return;const o=s&&Ze(s)===t?s:t;if(!(!r&&o===s))return a(Qe({providerId:t,enabled:!0})),a(et(o)),a(tt()),t}function Aa(e){const t=[];for(const s of e){let r={};if(s.metadata)try{r=JSON.parse(s.metadata)}catch{}const a=[];if(a.push(`[${s.identifier}] ${s.title}`),s.url&&a.push(`URL: ${s.url}`),s.description&&a.push(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/0Kw0mmSW.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/YLhFQnIu.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/D5wnbxHp.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BUsnh1ZW.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CrpUtGFn.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/DJivXy66.js","/app/immutable/chunks/CTowDLQa.js","/app/immutable/chunks/BQhBnAuP.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/Bq7euxCs.js","/app/immutable/chunks/CKcb8dge.js","/app/immutable/chunks/B-bGycam.js","/app/immutable/chunks/lZ7zkdkp.js","/app/immutable/chunks/BQ8hOnRo.js","/app/immutable/chunks/BpwKnO7b.js","/app/immutable/assets/register.CUyDR59i.css","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/CQ409-Pj.js","/app/immutable/chunks/_3Ca9E4W.js","/app/immutable/chunks/VcnbZvDh.js","/app/immutable/assets/terminal-manager.MhP_vFvK.css","/app/immutable/chunks/BoMrPoLQ.js","/app/immutable/chunks/lcF-Oq8x.js","/app/immutable/chunks/BJbm_MWC.js","/app/immutable/chunks/gwv5JQYH.js","/app/immutable/chunks/DwGyIIXK.js","/app/immutable/chunks/YeOAvjnW.js","/app/immutable/chunks/oBIu7LTI.js","/app/immutable/chunks/DIEHuZ8f.js","/app/immutable/chunks/CL3a4Hm1.js","/app/immutable/chunks/DzPivCMD.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/mUNs8NSR.js","/app/immutable/chunks/L3K71tUU.js","/app/immutable/chunks/COVS9Crf.js","/app/immutable/chunks/Idk978zJ.js","/app/immutable/chunks/vQkUvlEK.js","/app/immutable/chunks/5A77Sz5A.js","/app/immutable/chunks/Bmhkf_5j.js","/app/immutable/chunks/CZB2ndi9.js","/app/immutable/chunks/Cw2fqKk9.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/CBbdbU2x.js","/app/immutable/chunks/D48_y-cl.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/FLpsgWeB.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/D4WPlvMg.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{Jx as n,o7 as I,nZ as g,nY as k,ms as Z,r0 as Q,iq as ee,oe as Ce,mv as te,vX as He,jY as $e,DS as Be,vs as Ve,qz as ze,mu as Ke,m7 as Je,aU as le,mh as Ye,mn as Xe,yI as Ze,Gt as Qe,DQ as et,A6 as tt,oc as st,mx as rt}from"./D5wnbxHp.js";import{selectActiveWorkspaceIds as nt}from"./L3K71tUU.js";import{b8 as V,b3 as se,cR as _,cU as ue,cC as at,dH as M,cx as ot,b4 as ct,cS as it,dC as lt,v as de,Z as ut,dE as dt,ch as pt,aw as mt,aG as ht,ao as ft,bQ as St,cO as gt,da as yt,cA as bt,bR as kt}from"./BJbm_MWC.js";import{x as wt}from"./Idk978zJ.js";import{ag as It,cP as vt,aZ as _t,av as Ct,p as At}from"./Bmhkf_5j.js";import{h as Rt}from"./0Kw0mmSW.js";import{bm as p,_ as q}from"./YLhFQnIu.js";import{i as w}from"./CL3a4Hm1.js";import{I as Et}from"./Bqd7fdCF.js";import{L as P}from"./iAKTK0Nq.js";import{ag as Tt,l as Pt,i as O,a9 as Ot,q as Wt}from"./5A77Sz5A.js";import{c as Nt}from"./ChTqQfQN.js";import{r as x}from"./uXuxG9cN.js";import{j as xt,u as Mt,n as Lt}from"./COVS9Crf.js";import{u as Dt}from"./_3Ca9E4W.js";import{aq as Ut,p as jt}from"./lcF-Oq8x.js";import{M as pe,O as me,h as Ae}from"./DJivXy66.js";import{d as Gt,o as he,l as fe,s as Se}from"./CIyUrgF0.js";import{m as qt,p as Ft}from"./CwCTYQp7.js";const ur=n.createSelector(e=>e.workspaceShare.open),dr=n.createSelector(e=>e.workspaceShare.workspaceId),pr=n.createSelector(e=>{const{open:t,workspaceId:s,session:r}=e.workspaceShare;return t&&s?{workspaceId:s,session:r}:null}),re=n.createSelector(e=>{const{open:t,workspaceId:s,withheld:r}=e.workspaceShare;return!t||!s||r||I(e.workspaceShare,s).inviteWithheld?!1:V.select(e,s)}),mr=n.createSelector(e=>e.workspaceShare.createRequest),hr=n.createSelector(e=>e.workspaceShare.mutationGeneration),fr=n.createSelector(e=>e.workspaceShare.workspaceTitle),Sr=n.createSelector(e=>g(e.workspaceShare.members)),gr=n.createSelector((e,t)=>k(e.workspaceShare.members,t)!==void 0),yr=n.createSelector(e=>e.workspaceShare.open&&e.workspaceShare.workspaceId&&!e.workspaceShare.withheld&&!I(e.workspaceShare,e.workspaceShare.workspaceId).inviteWithheld?g(e.workspaceShare.invites).filter(t=>t.workspaceId===e.workspaceShare.workspaceId):[]),br=n.createSelector(e=>{const{principals:t,members:s}=e.workspaceShare;return g(t).filter(r=>!k(s,r.principalId)&&(r.hostRole===void 0||r.hostRole==="guest"))}),kr=n.createSelector(e=>e.workspaceShare.guestCount),wr=n.createSelector(e=>e.workspaceShare.guestLimit),Ir=n.createSelector(e=>e.workspaceShare.loadStatus==="loading"),vr=n.createSelector(e=>e.workspaceShare.loadError),_r=n.createSelector(e=>e.workspaceShare.creating),Cr=n.createSelector(e=>e.workspaceShare.createError),Ar=n.createSelector(e=>e.workspaceShare.createdLink),Rr=n.createSelector(e=>e.workspaceShare.revokingInviteId),Er=n.createSelector(e=>e.workspaceShare.removingPrincipalId),Tr=n.createSelector(e=>e.workspaceShare.addingPrincipalId),Pr=n.createSelector(e=>e.workspaceShare.actionError),Or=n.createSelector((e,t)=>I(e.workspaceShare,t).loadStatus!=="idle"),Wr=n.createSelector((e,t)=>t?g(I(e.workspaceShare,t).members):[]),Nr=n.createSelector((e,t)=>!!t&&!I(e.workspaceShare,t).withheld&&V.select(e,t));n.createSelector((e,t)=>!!t&&I(e.workspaceShare,t).withheld);const xr=n.createSelector((e,t)=>t?I(e.workspaceShare,t).removingPrincipalId:null);n.createSelector((e,t)=>t?I(e.workspaceShare,t).removeError:null);const Mr=n.createSelector(e=>e.workspaceShare.integrationAuth),Lr=n.createSelector(e=>e.workspaceShare.ownerForgeMissing),z=n.createSelector(e=>re.select(e)&&se.select(e)&&e.workspaceShare.sharingContext!==null&&e.workspaceShare.sharingContext===_.select(e)),Ht=n.createSelector(e=>z.select(e)?e.workspaceShare.sharingEnabled:null),Dr=n.createSelector(e=>z.select(e)&&e.workspaceShare.sharingChecking),$t=n.createSelector(e=>z.select(e)&&e.workspaceShare.sharingEnabling),Bt=n.createSelector(e=>z.select(e)?e.workspaceShare.sharingError:null),Ur=n.createSelector(e=>{if(!re.select(e))return!1;const t=e.workspaceShare;return!t.integrationAuthLoaded||se.select(e)&&Ht.select(e)===null&&Bt.select(e)===null&&!$t.select(e)?!0:g(t.members).length===0&&(t.loadStatus==="idle"||t.loadStatus==="loading")}),jr=n.createSelector(e=>re.select(e)&&!!e.workspaceShare.workspaceId&&(se.select(e)||(ge.select(e)?ge.select(e)===ue.select(e)?.principal.id:at.select(e,e.workspaceShare.workspaceId)))&&ue.select(e)?.capabilities.workspaceGuestRoles===!0),Gr=n.createSelector(e=>e.workspaceShare.pendingRolePrincipalIds),qr=n.createSelector(e=>e.workspaceShare.roleErrors),ge=n.createSelector(e=>{const t=e.workspaceShare.workspaceId;return t?M.select(e,t)?.ownerPrincipalId??null:null}),Vt=n.createSelector(e=>{const t=_.select(e),s=nt.select(e);return{context:t,workspaceIds:t?s.filter(r=>V.select(e,r)):[]}}),Fr=n.createSelector((e,t)=>{const s=I(e.workspaceShare,t);return{context:s.inviteContext,generation:s.inviteGeneration,withheld:s.inviteWithheld}}),zt=[],Kt=n.createSelector((e,t)=>{const s=_.select(e),r=I(e.workspaceShare,t);if(!s||r.inviteContext!==s||r.inviteWithheld||!V.select(e,t))return zt;const a=e.presence?.context===s?e.presence.members[t]:void 0,o=new Set(a?g(a).flatMap(i=>i.identity?[JSON.stringify([i.identity.provider,i.identity.host.toLowerCase(),i.identity.externalUserId])]:[]):[]),c=new Set;return g(e.workspaceShare.invites).filter(i=>{if(i.workspaceId!==t||!i.pinLogin?.trim()||i.revokedAt||i.redeemedAt&&!i.reusable||!(Date.parse(i.expiresAt)>r.inviteReceivedAt))return!1;const l=i.pinIdentity??(i.pinGithubUserId!==void 0?{provider:"github",host:"github.com",externalUserId:String(i.pinGithubUserId)}:null);if(a&&i.redeemedByPrincipalId&&k(a,i.redeemedByPrincipalId))return!1;if(!l)return!0;const m=JSON.stringify([l.provider,l.host.toLowerCase(),l.externalUserId]);return o.has(m)||c.has(m)?!1:(c.add(m),!0)})}),Hr=n.createSelector(e=>{const s=Vt.select(e).workspaceIds.flatMap(r=>Kt.select(e,r).map(a=>Date.parse(a.expiresAt)));return s.length?Math.min(...s):null});function $r(e){return Object.entries(e).some(([t,s])=>s.available&&wt(t,s.authenticated))}const Br=n.createSelector(e=>e.hostRequirements.git),Vr=n.createSelector(e=>e.hostRequirements.node),zr=n.createSelector(e=>e.hostRequirements.gh),Kr=n.createSelector(e=>e.hostRequirements.checking),Jr=n.createSelector(e=>e.hostRequirements.hasCheckedOnce);function Re(e){const t=e.gitlabAuth?.statusFailed===!0;return It({labsEnabled:e.userPreferences?.labsPlainFolderWorkspacesEnabled===!0,protocolVersion:e.daemonHealth?.stats?.protocolVersion,githubConnected:e.githubAuth?.isAuthenticated===!0,githubSettled:e.githubAuth?.statusSettled===!0,githubFailed:e.githubAuth?.statusFailed===!0,gitlabConnected:e.gitlabAuth?.isConfigured===!0,gitlabSettled:e.gitlabAuth?.statusReady===!0||t,gitlabFailed:t})}const Yr=n.createSelector(Re),Jt=n.createSelector(e=>!ot.select(e)),Xr=n.createSelector(e=>(e.hostRequirements.node.ok||!Jt.select(e))&&(e.hostRequirements.git.available||Re(e))),Zr=n.createSelector(e=>{const t=e.hostRequirements.providerCli;return t?{context:t.context,warnings:g(t.warnings)}:void 0}),Qr="22.0.0";function Yt(e){return e.length>15?`${e.slice(0,15)}…`:e}function H(e){return e.name?.trim()||Yt(e.clientId)}function en(e){const{eligibleClients:t,ownClientId:s,driving:r,pinnedClientId:a}=e,o=t.find(l=>l.clientId===s&&l.connected),c=r!==null&&!r.connected,i=!r||r.clientId===s;return{mode:c?"offline":i?"here":"elsewhere",hostName:r?H(r):o?H(o):"",canSwitchHere:!!(o&&a!==s)}}const tn=n.createSelector(e=>e?.browserClients?.ownClientId??null),sn=n.createSelector(e=>e?.browserClients?.ownClientIdConfirmed===!0);n.createSelector(e=>g(e.browserClients.liveClients));const rn=n.createSelector((e,t)=>t?e?.browserClients?.byWorkspaceId[t]?.liveClientsLoaded??!1:e?.browserClients?.liveClientsLoaded??!1);n.createSelector((e,t)=>k(e.browserClients.liveClients,t));const nn=n.createSelector((e,t)=>(e?.browserClients?.byWorkspaceId[t]??Z).browserClient),an=n.createSelector((e,t)=>{const s=e?.browserClients?.byWorkspaceId[t];return s?.pinnedClientId!==void 0||s?.browserClient!=null});function X(e){const t=e.prettyHostname??e.hostname??e.name;return{clientId:e.clientId,...t!==void 0?{name:t}:{},connected:!0}}const on=n.createSelector((e,t)=>{const s=e?.browserClients??Q,r=s.byWorkspaceId[t]?.liveClients??ee(),a=g(r).filter(y=>y.capabilities.browserExec===!0).map(X),o=(s.byWorkspaceId[t]??Z).browserClient,c=s.byWorkspaceId[t],i=c?.pinnedClientId!==void 0?c.pinnedClientId:o?.source==="workspace"?o.clientId:null,l=i===null?Rt(o):void 0;let m=null;if(o?.resolved){const y=k(r,o.resolved.clientId);m=y?X(y):{...o.resolved,connected:!0}}else o?.source==="workspace"?m={clientId:o.clientId,connected:!1}:l&&(m={clientId:l.clientId,connected:!1});return{eligibleClients:a,ownClientId:s.ownClientId??"",routedVia:o?.source==="default"?l?.via:void 0,driving:m,pinnedClientId:i}}),cn=n.createSelector((e,t)=>{const s=e?.browserClients??Q;if(!s.ownClientId||!s.ownClientIdConfirmed)return!1;const r=s.byWorkspaceId[t]?.liveClients??ee(),a=k(r,s.ownClientId);return a!==void 0&&a.capabilities.browserExec!==!0}),ln=n.createSelector((e,t,s)=>{const r=e?.browserClients??Q,a=s?r.byWorkspaceId[s]?.liveClients??ee():r.liveClients,o=s?r.byWorkspaceId[s]?.liveClientsLoaded:r.liveClientsLoaded,c=k(a,t);return c?{name:H(X(c)),connected:!0}:{name:H({clientId:t}),connected:!o}}),un=n.createSelector((e,t)=>(e?.browserClients?.byWorkspaceId[t]??Z).tabsRevision),dn=n.createSelector(e=>Object.entries(e.browserClients?.byWorkspaceId??{}).filter(([,t])=>Object.keys(t.consumers??{}).length>0).map(([t])=>t)),N=new Map;function pn(e,t){return N.set(e,t),()=>{N.get(e)===t&&N.delete(e)}}async function mn(e){const t=N.get(e);return t?t():null}function hn(e){N.delete(e)}const Ee="From repo config",fn="repo-config";function Sn(e,t){return t==="repo-config"?p.workspace_setupScriptEditor_fromRepoConfig_name():t==="custom"?p.workspace_setupScriptEditor_custom_name():e}function Te(e){if(!e||typeof e!="object"||Array.isArray(e))return{setupScript:null};const t=e.setupScript;return{setupScript:typeof t=="string"&&t.trim().length>0?t:null}}function Xt(e){let t;try{t=JSON.parse(e)}catch{return null}return Te(t).setupScript}async function gn(e){if(!e)return null;try{const t=await w(Et.SETUP_SCRIPTS.READ_REPO_CONFIG,{repoPath:e}),s=t?.success?t.data?.content:null;return typeof s=="string"?Xt(s):null}catch{return null}}async function yn(e,t,s){if(!e||!t)return null;try{const{appClient:r}=await q(async()=>{const{appClient:o}=await import("./0Kw0mmSW.js").then(c=>c.s);return{appClient:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]),import.meta.url),a=await r.integrations.githubRepoConfig(e,t,s);return Te(a.config).setupScript}catch{return null}}function bn(e){const t=e.setupScript.trim();return t?e.setupScriptNameSource==="repo-config"&&e.setupScriptName===Ee&&e.repoConfigScriptRepo===e.repoPath&&t===(e.repoConfigScript??"").trim()?void 0:t:e.explicitChoice?"cd .":void 0}function kn(e){const{repoConfigScript:t,lastUsed:s,genericTemplate:r}=e;return t?{content:t,name:Ee,source:"repo-config"}:s?{content:s.content,name:s.nameSource==="repo-config"?"Custom":s.name,source:s.nameSource==="repo-config"?"custom":s.nameSource??"named"}:r?{content:r.content,name:r.name,source:"named"}:{content:"",name:"Custom",source:"custom"}}const Pe="setup-scripts:last-used-by-repo",Oe="setup-scripts:recent-by-repo",$=20,We=10,Zt=["repo-config","custom","named"];function ne(e,t){return t?`${e}\0${t}`:e}function Ne(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.name=="string"&&typeof t.content=="string"&&t.content.trim().length>0&&typeof t.usedAt=="string"&&(t.nameSource===void 0||Zt.includes(t.nameSource))}function B(){try{const e=localStorage.getItem(Pe);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const s={};for(const[r,a]of Object.entries(t))r&&Ne(a)&&(s[r]=a);return s}catch{return{}}}function xe(){try{const e=localStorage.getItem(Oe);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const s={};for(const[r,a]of Object.entries(t)){if(!r||!Array.isArray(a))continue;const o=a.filter(Ne);o.length>0&&(s[r]=o)}return s}catch{return{}}}function Qt(e,t){return e.name===t.name&&(e.nameSource??"named")===(t.nameSource??"named")&&e.content.trim()===t.content.trim()}function Me(e){return[...e].sort((t,s)=>s.usedAt.localeCompare(t.usedAt))}function Le(e){const t=[];for(const s of e)t.some(r=>Qt(r,s))||t.push(s);return t}function wn(e,t){if(!e)return[];const s=ne(e,t),r=xe()[s]??[],a=B()[s];return Le(Me(a?[...r,a]:r)).slice(0,We).map(c=>({name:c.name,content:c.content,nameSource:c.nameSource??"named",usedAt:c.usedAt}))}function es(e,t,s){try{const r=xe(),a=r[e]??(s?[s]:[]);r[e]=Le([t,...Me(a)]).slice(0,We);const o=Object.entries(r);o.length>$&&(o.sort(([,c],[,i])=>i[0].usedAt.localeCompare(c[0].usedAt)),o.length=$),localStorage.setItem(Oe,JSON.stringify(Object.fromEntries(o)))}catch{}}function In(e,t){if(!e)return;const s=B()[ne(e,t)];return s?{name:s.name,content:s.content,nameSource:s.nameSource??"named"}:void 0}function vn(e,t,s){const r=t.content.trim();if(!e||!r)return;const a=ne(e,s),o={name:t.name,content:r,usedAt:new Date().toISOString(),nameSource:t.nameSource??"named"};es(a,o,B()[a]);try{const c=B();c[a]=o;const i=Object.entries(c);i.length>$&&(i.sort(([,l],[,m])=>m.usedAt.localeCompare(l.usedAt)),i.length=$),localStorage.setItem(Pe,JSON.stringify(Object.fromEntries(i)))}catch{}}const ts={async isAuthenticated(e){try{return await w(P.IS_AUTHENTICATED,...e===void 0?[]:[{workspaceId:e}])}catch{return!1}},async getAuthState(e=!1,t){try{return await w(P.GET_AUTH_STATE,e,...t===void 0?[]:[{workspaceId:t}])}catch{return{isAuthenticated:!1,requiresDaemonAuth:!0}}},async getStatus(e){try{return await w(P.GET_STATUS,...e===void 0?[]:[{workspaceId:e}])}catch{return{isConfigured:!1,oauthUrl:""}}},async fetchMyIssues(e="assigned",t){return(await this.fetchMyIssuesPage(e,t===void 0?void 0:{workspaceId:t})).issues},async fetchMyIssuesPage(e="assigned",t){try{return await w(P.FETCH_MY_ISSUES,e,t)}catch{return{issues:[],nextToken:null}}},async searchIssues(e,t){return(await this.searchIssuesPage(e,t===void 0?void 0:{workspaceId:t})).issues},async searchIssuesPage(e,t){try{return await w(P.SEARCH_ISSUES,e,t)}catch{return{issues:[],nextToken:null}}}},_n=Object.freeze(Object.defineProperty({__proto__:null,linearAuthClient:ts},Symbol.toStringTag,{value:"Module"})),v={IS_AUTHENTICATED:"sentry-auth:is-authenticated",SAVE_CONFIG:"sentry-auth:save-config",GET_AUTH_STATE:"sentry-auth:get-auth-state",LOGOUT:"sentry-auth:logout",FETCH_PROJECTS:"sentry-auth:fetch-projects",FETCH_ISSUES:"sentry-auth:fetch-issues",SEARCH_ISSUES:"sentry-auth:search-issues",GET_ISSUE:"sentry-auth:get-issue"},ss={async isAuthenticated(e){try{return await w(v.IS_AUTHENTICATED,...e===void 0?[]:[{workspaceId:e}])}catch{return!1}},async saveConfig(e,t){return await w(v.SAVE_CONFIG,{organization:e,apiToken:t})},async getAuthState(e){try{return await w(v.GET_AUTH_STATE,...e===void 0?[]:[{workspaceId:e}])}catch{return{isAuthenticated:!1}}},async logout(){await w(v.LOGOUT)},async fetchProjects(e){try{return await w(v.FETCH_PROJECTS,...e===void 0?[]:[{workspaceId:e}])}catch{return[]}},async fetchIssues(e){return(await this.fetchIssuesPage(e)).issues},async fetchIssuesPage(e){try{return await w(v.FETCH_ISSUES,e)}catch{return{issues:[],nextToken:null}}},async searchIssues(e,t){return(await this.searchIssuesPage(e,t)).issues},async searchIssuesPage(e,t,s){try{return await w(v.SEARCH_ISSUES,{query:e,project:t,...s})}catch{return{issues:[],nextToken:null}}},async getIssue(e,t){try{return await w(v.GET_ISSUE,e,...t===void 0?[]:[{workspaceId:t}])}catch{return null}}},Cn=Object.freeze(Object.defineProperty({__proto__:null,sentryAuthClient:ss},Symbol.toStringTag,{value:"Module"})),ae=n.createSelector(e=>{const t=_.select(e);return!t||!ct.select(e)?null:JSON.stringify([t,e.hostExecution.generation,e.repositoryCheckout.authorityGeneration,e.gitlabAuth.host,e.gitlabAuth.instanceBaseUrl,e.gitlabAuth.statusReady,e.gitlabAuth.isConfigured,e.gitlabAuth.user])}),K=n.createSelector((e,t)=>k(e.repositoryCheckout.forms,t)??null),An=n.createSelector((e,t)=>{const s=K.select(e,t);return s?.admission===ae.select(e)&&s.status==="ready"?g(s.projects):[]}),Rn=n.createSelector((e,t)=>{const s=K.select(e,t);return s?.admission===ae.select(e)&&s.status==="ready"?g(s.branches):[]}),rs=n.createSelector((e,t)=>{const s=K.select(e,t);return!s||s.status!=="ready"||s.admission!==ae.select(e)||!s.capture||!s.project||!s.branch?null:{checkoutId:s.capture.checkoutId,revision:s.capture.revision,projectPath:s.project.projectPath,branch:s.branch.name,commitSha:s.branch.commitSha,mode:s.mode}}),En=n.createSelector((e,t)=>{const s=rs.select(e,t);return!!s&&(s.mode==="direct"||K.select(e,t)?.warmStatus==="ready")}),Tn="__new-workspace__",Pn="__initializer__",On="compact-workspace-initializer-state-prompt",Wn="onboarding-prompt",U=20*1024*1024,ye=Nt("NewWorkspaceDraft");function Nn(e,t){if(e.length>U)return ye.warn("Draft text exceeds the size guard; skipping persistence",{textLength:e.length,limit:U}),null;const s=Tt(t);if(s.length===0)return{text:e};const r=[];let a=e.length+2,o=0;for(const c of s){const i=JSON.stringify(c).length+1;if(a+i>U){o+=1;continue}r.push(c),a+=i}return o>0&&ye.warn("Draft attachments exceed the size guard; persisting the ones that fit",{limit:U,attachmentCount:s.length,droppedCount:o}),r.length>0?{text:e,attachments:r}:{text:e}}const ns="host.providerAuthStatus";function as(e={}){const t={};return e.workspaceId&&(t.workspaceId=e.workspaceId),typeof e.providerId=="string"&&e.providerId.length>0&&(t.providerId=e.providerId),typeof e.force=="boolean"&&(t.force=e.force),t}function os(e,t){const s=t.toLowerCase(),r=e.toLowerCase();return s.startsWith(r)?/^(['’]s\s+organization)?$/.test(s.slice(r.length)):!1}function cs(e){const{email:t,orgName:s}=e??{};return t&&s?os(t,s)?t:`${t} · ${s}`:t||s||void 0}function is(e){const t={};for(const s of e?.providers??[]){const r={authenticated:s.authenticated??void 0},a=cs(s.identity);a!==void 0&&(r.authDetails=a),s.identity?.email&&(r.email=s.identity.email),t[s.id]=r}return t}const ls=6e4,R=new Map,j=new Map,A=new Map;let F=0,De=0;const us=e=>JSON.stringify([it.select(n.state),De,e.workspaceId??null,e.providerId??"*"]);function ds(e){if(e.method!=="events.event"||!e.params)return;const t=e.params,r=(t.event&&typeof t.event=="object"?t.event:t).type;return typeof r=="string"?r:void 0}function J(e){if(F+=1,e)for(const t of R.keys()){const[,,,s]=JSON.parse(t);(s===e||s==="*")&&R.delete(t)}else R.clear()}typeof pe=="function"&&pe(e=>{["provider:auth-changed","host:execution-context-changed"].includes(ds(e)??"")&&J()});typeof me=="function"&&me(()=>{De+=1,J()});function ps(e={}){const t=us(e);if(e.force)J(e.providerId);else{const o=R.get(t);if(o&&o.expiresAt>Date.now())return Promise.resolve(o.verdicts);o&&R.delete(t)}const s=j.get(t);if(!e.force&&s?.generation===F)return s.promise;if(s){const o=A.get(t);if(o)return o.force||=e.force===!0,o.promise;let c;const i=s.promise.catch(()=>({})).then(()=>(A.get(t)===c&&A.delete(t),ps({...e,force:c.force}))).finally(()=>{A.get(t)===c&&A.delete(t)});return c={force:e.force===!0,promise:i},A.set(t,c),i}const r=F,a=Ae(ns,as(e)).then(is).then(o=>(r===F&&R.set(t,{verdicts:o,expiresAt:Date.now()+ls}),o)).finally(()=>{j.get(t)?.promise===a&&j.delete(t)});return j.set(t,{generation:r,promise:a}),a}function xn(e,t){return e.name?.trim()?e.name.trim():e.kind==="workspace"?e.id&&e.id!=="default"?p.workspace_discussion_conversation_title():p.workspace_discussion_title():e.participants.filter(r=>r.principalId!==t).map(r=>r.displayName||r.login||p.workspace_discussion_unknownAuthor_label()).join(", ")||p.workspace_discussion_group_title()}const ms=n.createSelector((e,t,s)=>{const r=Ce(e.repositoryContext,t);return s!==null&&r.binding===s?r:null});n.createSelector((e,t,s)=>{const r=ms.select(e,t.workspaceId,s);return r?.status==="ready"?k(r.roots,x(t))?.context:void 0});const Mn=n.createSelector((e,t)=>{if(t.admission===null||_.select(e)!==t.admission)return null;const s=Ce(e.repositoryContext,t.workspaceId),r=s.ownership;return!r||r.demandId!==t.demandId||r.admission!==t.admission||r.request.workspaceId!==t.workspaceId?null:{status:s.status,scope:s.scope,revision:s.revision,roots:s.status==="ready"?g(s.roots).map(a=>a.context):[],unavailableReason:s.unavailableReason}}),Ln=n.createSelector((e,t)=>{if(t.admission===null||_.select(e)!==t.admission)return null;const s=e.repositoryContext.selectionEdits,r=s?k(s,t.editId):void 0;return r&&r.status!=="closed"&&r.owner.admission===t.admission&&x(r.owner.root)===x(t.root)?r:null}),Dn=n.createSelector((e,t)=>{const s=e.repositoryContext.selectionEdits;return!!s&&g(s).some(r=>r.owner.root.workspaceId===t&&r.owner.admission===_.select(e)&&(r.status==="capturing"||r.status==="pending"&&(!r.observation||r.observation.attempt?.status==="pending")))}),Un=n.createSelector((e,t)=>{if(t.admission===null||_.select(e)!==t.admission||t.hostContext===null||lt.select(e,t.root.workspaceId)!==t.hostContext)return null;const s=e.repositoryContext.nativeReviewAttempts,r=s?k(s,t.attemptId):void 0;return r&&r.status!=="closed"&&r.owner.admission===t.admission&&r.owner.hostContext===t.hostContext&&x(r.owner.root)===x(t.root)?r:null}),jn=n.createSelector((e,t)=>e.repositoryContext.nativeReviewAttempts?k(e.repositoryContext.nativeReviewAttempts,t):void 0),be={auggie:"npm install -g @augmentcode/auggie","claude-code":"curl -fsSL https://claude.ai/install.sh | bash",codex:"npm i -g @openai/codex",opencode:"curl -fsSL https://opencode.ai/install | bash",droid:"curl -fsSL https://app.factory.ai/cli | sh",grok:"npm i -g @xai-official/grok",cursor:"curl https://cursor.com/install -fsS | bash",cortex:"curl -LsS https://ai.snowflake.com/static/cc-scripts/install.sh | sh"};function Gn(e){return Object.hasOwn(be,e)?be[e]:void 0}const hs=["venv",".venv","virtualenv","node_modules","google-cloud-sdk","__pycache__",".pytest_cache",".mypy_cache",".ruff_cache",".tox",".nox"];function fs(e){return e.replace(/\\/g,"/").split("/").filter(t=>t.length>0&&t!==".")}function Ss(e){const t=new Set(hs);return fs(e).some(s=>t.has(s))}const gs=new Set(["lastActivity","statusMessage","statusImageAssetId"]),ys=new Set([".git",".playwright-cli",".svelte-kit",".vite",".turbo",".cache",".parcel-cache",".next",".nuxt",".output","build","coverage","dist","playwright-report","target","test-results"]);function bs(e){return e.replace(/\\/g,"/").split("/").filter(t=>t.length>0&&t!==".")}function ks(e){if(!e.type.startsWith("file:"))return null;const t=e.data,s=t?.relativePath??t?.path??t?.filePath;return typeof s=="string"&&s.length>0?s:null}function ws(e){const t=ks(e);return!t||Ss(t)?!1:!bs(t).some(s=>ys.has(s))}function Is(e){if(e.type==="workspace:displayStatus-changed")return!0;if(e.type!=="workspace:updated")return!1;const t=e.data;if(!t?.changes||typeof t.changes!="object"||Array.isArray(t.changes))return!1;const s=Object.keys(t.changes).filter(r=>r!=="workspaceId");return s.length>0&&s.every(r=>gs.has(r))}function h(e){return typeof e=="string"?e.trim():""}function E(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function ke(e){const t=E(e.data),s=h(t.agentId)||h(e.sessionId),r=h(t.messageId);return s&&r?JSON.stringify([s,r]):""}function vs(e){const t=E(e.data),s={workspaceId:e.workspaceId,closable:!0},r=a=>a?{...s,type:"note",noteId:a,title:h(t.title)||h(t.noteTitle)||p.layout_tabTypes_note_title()}:null;switch(e.type){case"note:created":case"note:updated":case"comment:added":case"comment:resolved":return r(h(t.noteId));case"task:status-changed":return r(h(t.noteId)||h(t.linkedNoteId));case"spec:updated":case"goal:updated":return r("spec");case"agent:created":case"agent:renamed":case"agent:restored":case"agent:updated":case"agent:message":case"agent:user-message:sent":{const a=h(t.agentId)||h(e.sessionId);return a?{...s,type:"agent",agentId:a,title:h(t.agentName)||p.layout_tabTypes_agent_title()}:null}case"file:changed":{const a=h(t.path)||h(t.relativePath);return a&&t.action!=="delete"?{...s,type:"file",filePath:a,title:a.split(/[\\/]/).pop()||a}:null}case"git:commit":{const a=h(t.commit),o=h(t.gitRootId);return a?{...s,type:"changes",title:p.layout_tabTypes_changes_title(),data:{commitHash:a,...o?{gitRootId:o}:{}}}:null}default:return null}}function we(e,t){const s=E(e.data),r=Object.fromEntries(Object.entries(s).filter(([,c])=>typeof c=="string")),a=c=>t?p.workspace_peopleActivity_actorAction_label({name:t,action:c}):c;switch(e.type){case"note:created":case"note:updated":case"note:deleted":case"spec:updated":case"goal:updated":return O({...e,actor:{...e.actor,name:t},data:r});case"agent:created":case"agent:renamed":case"agent:deleted":case"agent:restored":case"git:commit":case"git:push":case"git:pull":case"git:branch":case"git:merge":return a(O({...e,actor:{...e.actor,name:void 0},data:r}));case"agent:updated":return h(s.modelId)||s.completionReportCleared===!0?a(O({...e,actor:{...e.actor,name:void 0},data:s})):null;case"file:changed":return ws(e)?O({...e,actor:{...e.actor,name:t},data:{path:h(s.path)||h(s.relativePath),action:h(s.action)}}):null;case"comment:added":return t?p.events_activity_authorCommented_label({author:t}):p.workspace_peopleActivity_commented_label();case"comment:resolved":return s.resolved===!1?a(p.events_activity_reopenedCommentThread_label()):s.resolved===!0?a(p.events_activity_resolvedCommentThread_label()):null;case"agent:message":case"agent:user-message:sent":{const c=h(s.agentName)||h(s.toAgentName);return a(c?p.workspace_peopleActivity_messagedAgent_label({agent:c}):p.workspace_peopleActivity_sentMessage_label())}case"task:status-changed":return a(O({...e,actor:{...e.actor,name:void 0},data:{taskName:h(s.taskName)||h(s.noteTitle),newStatus:h(s.newStatus)||h(s.status)}}));case"workspace:created":return a(p.events_activity_createdWorkspace_label());case"workspace:updated":{if(Is(e))return null;const c=E(s.changes);if(Object.keys(c).filter(l=>l!=="workspaceId").length===0)return null;const i=h(c.title);return a(i?p.events_activity_renamedWorkspaceTo_label({title:i}):p.events_activity_updatedWorkspace_label())}default:return null}}function W(e,t){const s=h(e);return s===t||/^(user|you|system|unknown|anonymous|local user)$/i.test(s)?"":s}function _s(e,t,s,r){const a=new Map(s.map(u=>[u.principalId,u])),o=new Map;for(const u of t){if(u.workspaceId!==e||u.type!=="agent:last-message")continue;const d=E(u.data),f=de({role:d.role==="user"?"user":"system",author:d.author,metadata:d.metadata}),S=ke(u);if(!f||!S||typeof d.lastUserMessage!="string")continue;const b=Pt({id:h(d.messageId),role:"user",timestamp:u.timestamp,contentBlocks:[{type:"text",text:d.lastUserMessage}],author:f,metadata:d.metadata},r);b&&o.set(S,b)}const c=new Set,i=new Set,l=[];let m=0;for(const u of t){if(u.workspaceId!==e||!h(u.id)||c.has(u.id))continue;const d=Date.parse(u.timestamp);if(!Number.isFinite(d)){m++;continue}const f=E(u.data),S=u.type==="agent:message",b=S?de({role:f.role==="user"?"user":"system",author:f.author,metadata:f.metadata}):null;if(S?!b:u.actor?.type!=="user"){S&&f.role==="user"&&u.actor?.type==="user"&&ut(f.metadata)&&l.push({row:null,timestamp:d,segment:m});continue}const Fe=S?h(f.messageId):"",T=S?ke(u):"";if(T&&i.has(T))continue;const C=h(u.actor?.id),Y=C?a.get(C):void 0,L=b?W(b.displayName,b.principalId??"")||W(b.login,b.principalId??""):W(u.actor.name,C)||W(Y?.displayName,C)||W(Y?.login,C),ce=we(u,"");if(!ce)continue;if(!L){l.push({row:null,timestamp:d,segment:m});continue}const D=S?o.get(T)??null:null,ie=D?p.workspace_peopleActivity_actorAction_label({name:L,action:D}):we(u,L);ie&&(c.add(u.id),T&&i.add(T),l.push({timestamp:d,segment:m,row:{id:u.id,name:L,principalId:b?h(b.principalId)||null:C||null,avatarUrl:b?b.avatarUrl:Y?.avatarUrl??null,label:ie,actionLabel:D??ce,continuation:!1,timestamp:u.timestamp,destination:vs(u),messageId:Fe||null,messagePreview:D}}))}l.sort((u,d)=>d.timestamp-u.timestamp);const y=[];for(const[u,d]of l.entries()){if(!d.row)continue;const f=l[u-1],S=f?f.timestamp-d.timestamp:NaN;d.row.continuation=!!(d.row.principalId&&f?.row?.principalId===d.row.principalId&&f.segment===d.segment&&Number.isFinite(S)&&S>=0&&S<=15*6e4),y.push(d.row)}return y}const qn=n.createSelector(e=>e.workspaceEvents.subscriptionAttempt),Fn=n.createSelector(e=>e.workspaceEvents.subscriptionGeneration),Cs=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??te).events),Hn=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??te).nextToken),$n=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]?.peopleRequestId??null)!==null),Bn=n.createSelector((e,t)=>e.workspaceEvents.byWorkspaceId[t]?.peopleError??null),Vn=n.createSelector((e,t)=>e.workspaceEvents.byWorkspaceId[t]?.peopleInitialized??!1),Ue=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??te).peopleStreams),zn=n.createSelector((e,t)=>Object.values(Ue.select(e,t)).every(s=>s.initialized&&s.nextToken===null)),Kn=n.createSelector((e,t,s)=>{const r=Cs.select(e,t),o=_s(t,r,vt.select(e,t),M.select(e,t)?.ownerPrincipalId)[s-1]?.timestamp,c=Ue.select(e,t);return["user","message"].filter(i=>{const l=c[i];if(!l.initialized)return!0;if(l.nextToken===null)return!1;const m=r.find(y=>y.id===l.oldestEventId)?.timestamp;return!o||!m||!(Date.parse(m)<=Date.parse(o))})});function Jn(e,t=e,s="default",r,a){if(!Dt.select(n.state))return;const o=a??xt.select(n.state,t)??Mt.select(n.state,t)[0];if(!o)return;const c=Lt.select(n.state,t,o),i={type:"discussion",title:r??(s==="new"?p.workspace_discussion_new_title():p.workspace_discussion_title()),workspaceId:e,closable:!0,data:{conversationId:s}},l=c?.tabs.find(m=>He(m,i));s==="new"&&n.dispatch($e(e)),n.dispatch(l?Be(t,l.id,o):Ve(t,i,o,void 0,!0,void 0,!0))}const Yn=n.createSelector((e,t)=>{const s=[],r=new Set,a=new Set,o=c=>{const i=c.block.attachmentId??c.id;if(!r.has(i)){if(!c.block.attachmentId&&c.block.data&&!c.block.dataTruncated){const l=`${c.block.mimeType}/${c.block.data}`;if(a.has(l))return;a.add(l)}r.add(i),s.push(c)}};for(const[c,i]of Object.entries(Ot.select(e,t)))for(const l of g(i))l.imageData&&l.imageMimeType?o({id:`draft/${c}/${l.id}`,name:l.label,block:{type:"image",data:l.imageData,mimeType:l.imageMimeType}}):l.type==="file"&&(l.attachmentId||l.placementStatus)&&o({id:`draft/${c}/${l.id}`,name:l.label,placementStatus:l.placementStatus,block:{type:l.attachmentMimeType?.startsWith("image/")?"image":"file",attachmentId:l.attachmentId,mimeType:l.attachmentMimeType,fileName:l.label,size:l.attachmentSize}});for(const c of dt.select(e,t)){const i=pt.select(e,c),l=[...mt.select(e,c),...ht.select(e,c)];for(const m of l)if(m.role==="user")for(const[y,u]of(m.contentBlocks??[]).entries()){if(u.type!=="image"&&!Wt(u))continue;const d=u.id?i?.[ze(m.id,u.id)]:void 0,f=d?.status==="loaded"?d.block:u;o({id:`${c}/${m.id}/${u.id??y}`,name:f.fileName,block:f,agentId:c,messageId:m.id,hydration:d})}}return s}),As=n.createSelector((e,t)=>e.context.byWorkspaceId[t]??Ke),Rs=n.createSelector((e,t)=>g(As.select(e,t).items)),Xn=n.createSelector((e,t)=>Rs.select(e,t).filter(s=>!s.parentNoteId)),Zn=n.createSelector((e,t)=>e.agentLock.byWorkspaceId[t]?.lockedAgentIds??je),Qn=n.createSelector((e,t)=>e.agentLock.byWorkspaceId[t]?.lockedFilePaths??je),je={},ea=n.createSelector((e,t,s)=>{const r=e.gitWrite.byWorkspaceId[t]?.operations;return r?k(r,s):void 0}),Ge=n.createSelector((e,t)=>{const s=e.gitWrite.byWorkspaceId[t]?.operations;return s?g(s):[]}),ta=n.createSelector((e,t)=>Ge.select(e,t).some(s=>s.status==="queued"||s.status==="running")),sa=n.createSelector((e,t)=>Ge.select(e,t).filter(s=>s.operation.kind==="partialCommit"&&(s.status==="queued"||s.status==="running")));function Ie(e){return e.title||`PR #${e.number}`}const oe=n.createSelector((e,t)=>{const s=e.gitRoots?.byWorkspaceId?.[t];return s?g(s.gitRoots):[]});function Es(e){return{key:"primary",isPrimary:!0,path:e.worktreePath??e.path,branch:e.branch,repoOwner:e.repositoryOwner,repoName:e.repositoryName,prNumber:e.prNumber,prUrl:e.prUrl,prStatus:e.prStatus,pullRequests:e.pullRequests}}function Ts(e){return{key:e.id,isPrimary:!1,path:e.path,branch:e.branch,repoOwner:e.repoOwner,repoName:e.repoName,prNumber:e.prNumber,prUrl:e.prUrl,prStatus:e.prStatus,pullRequests:e.pullRequests,gitRoot:e}}const ra=n.createSelector((e,t)=>{const s=M.select(e,t),r=oe.select(e,t).map(Ts);return s?[Es(s),...r]:r}),na=n.createSelector((e,t)=>oe.select(e,t).length>0),aa=n.createSelector(e=>Object.entries(e.gitRoots?.byWorkspaceId??{}).filter(([,t])=>Object.keys(t.consumers??{}).length>0).map(([t])=>t)),Ps=n.createSelector((e,t,s)=>k((e.acceptWorkflow.byWorkspaceId[t]??Je).operations,s)),oa=n.createSelector((e,t,s)=>Ps.select(e,t,s)?.status==="running"),ca=n.createSelector((e,t)=>e.acceptWorkflow.byWorkspaceId[t]?.mergeDrawerOpen??!1),ia=n.createSelector((e,t)=>{const s=ft.select(e,t)?.hasRemote??!1,r=M.select(e,t)?.pullRequests?.some(a=>a.status===le.Open||a.status===le.Draft)??!1;return{squash:!1,viaPR:s&&r,pushAfter:s,...e.acceptWorkflow.byWorkspaceId[t]?.mergeOptions}}),la=n.createSelector(e=>Object.keys(e.acceptWorkflow.byWorkspaceId).filter(t=>e.acceptWorkflow.byWorkspaceId[t].observerRequested)),ua=n.createSelector((e,t)=>{const s=M.select(e,t),r=St.select(e,t),a=gt.select(e,t),o=s?.repositoryOwner&&s.repositoryName?`${s.repositoryOwner}/${s.repositoryName}`:void 0,c=_t(Ct(s?.pullRequests,s?.activePullRequest,(i,l)=>At(i,s?.repositoryOwner,s?.repositoryName,l),Ie,o),yt.select(e,t),o,oe.select(e,t),Ie).own;return{visible:(e.acceptWorkflow.byWorkspaceId[t]?.consumerCount??0)>0,ready:kt.select(e,t),owner:!bt.select(e,t),authenticated:Ut.select(e),pushedCount:r.filter(i=>i.isPushed).length,hasRemote:a.hasRemote,clearReset:a.hasResetToTrunk&&c.some(i=>i.status!=="merged"),clearMerge:!!(a.mergeHeadSha&&r[0]?.hash&&a.mergeHeadSha!==r[0].hash)}}),da=n.createSelector((e,t,s)=>e.bgExecutor?.byWorkspaceId[t]?.executors[s]??Ye),Os=n.createSelector((e,t)=>e.prWorkflow.byWorkspaceId[t]??Xe);n.createSelector((e,t,s)=>Os.select(e,t).operations[s]);const pa=n.createSelector(e=>Object.keys(e.noteReadTracking.unreadNoteIds)),ma=n.createSelector(e=>e.noteReadTracking.readRecords),Ws="host.providerTestPrompt",Ns=Gt("ok",[he({ok:fe(!0)}).passthrough(),he({ok:fe(!1),reason:Se().min(1),message:Se()}).passthrough()]),xs=3e5;async function ha(e){const t=await Ae(Ws,{providerId:e.providerId,...e.model?{model:e.model}:{}},{timeoutMs:xs}),s=Ns.parse(t);return(s.ok||s.reason==="auth-required")&&J(e.providerId),s}const Ms=-1,Ls=/^remote-script-lost:\s*/,Ds=["idle","starting","running","restarting","exited"],ve=e=>!!e&&typeof e=="object"&&!Array.isArray(e),_e=e=>typeof e=="string"&&e.trim().length>0;function Us(e){return ve(e)&&_e(e.remoteAgentId)&&_e(e.nodeId)&&ve(e.runtime)&&Ds.includes(e.runtime.status)}function fa(e){return Array.isArray(e.machineRuns)?e.machineRuns.filter(Us):[]}function Sa(e,t,s){const r=qt(e.nodeId,s)??{nodeId:e.nodeId,name:p.remoteAgent_location_unknownMachine(),platform:null,state:"ready"};if(s&&s.id===e.nodeId)return r;const a=t?.nodeId===e.nodeId?t:null;return{...r,name:a?.nodeName?.trim()||r.name,platform:Ft(a?.placement?.os,a?.placement?.arch)}}function js(e){return e.status==="exited"&&e.exitCode===Ms}function Gs(e){const t=e.error?.trim().replace(Ls,"").trim();switch(t){case"the machine disconnected":return p.scripts_remote_lostDisconnected_label();case"the machine was removed":return p.scripts_remote_lostRemoved_label();case"the agent was deleted":return p.scripts_remote_lostAgentDeleted_label();case"the agent was stopped for good":return p.scripts_remote_lostAgentStopped_label();default:return t||p.scripts_remote_lostReason_fallback()}}function ga(e){if(js(e))return{kind:"lost",label:p.scripts_remote_lost_tooltip({reason:Gs(e)})};const t=jt(e);switch(t){case"running":return{kind:t,label:p.terminal_quakeOverlay_status_running()};case"restarting":return{kind:t,label:p.workspace_devScripts_restarting_label()};case"idle":return{kind:t,label:p.terminal_quakeOverlay_status_idle()};case"succeeded":return{kind:t,label:p.terminal_quakeOverlay_status_exitedZero()};case"failed":return{kind:t,label:p.terminal_quakeOverlay_status_errorCode({code:e.exitCode??1})};case"stopped":return{kind:t,label:p.terminal_quakeOverlay_status_stoppedSignal({signal:(e.exitCode??128)-128})};default:return{kind:t,label:p.terminal_quakeOverlay_status_exited()}}}const G=e=>typeof e=="string"&&e.length>0,qs=/\bremote-script-agent-ending:/;function ya(e){return!!e&&qs.test(e)}function ba(e){if(!e||typeof e!="object")return null;const t=e.data;if(!t||typeof t!="object")return null;const s=t,r=e instanceof Error&&e.message?{message:e.message}:{};return s.code==="machine-update-required"?{success:!1,code:"machine-update-required",update:s.update==="backend"?"backend":"machine",...G(s.machineVersion)?{machineVersion:s.machineVersion}:{},...G(s.backendVersion)?{backendVersion:s.backendVersion}:{},...r}:s.code==="machine-unreachable"?{success:!1,code:"machine-unreachable",attempts:Array.isArray(s.attempts)?s.attempts.flatMap(o=>{const c=o??{};return G(c.route)&&G(c.error)?[{route:c.route,error:c.error}]:[]}):[],...r}:null}function ka(e){const s=e.filter(a=>a.runtime.status==="running"&&a.runtime.detectedUrl?.trim()).sort((a,o)=>(o.runtime.startedAt??"").localeCompare(a.runtime.startedAt??""))[0],r=s?.runtime.detectedUrl?.trim();return!s||!r?null:{scriptId:s.id,name:s.name,url:r}}const Fs={status:"idle",error:null},Hs=n.createSelector((e,t)=>e.workspaceLifecycle.loadByWorkspaceId[t]??Fs);n.createSelector((e,t)=>Hs.select(e,t).error);const wa=n.createSelector((e,t)=>k(e.workspace.workspaces,t)??e.workspace.pendingCreations[t]),qe=n.createSelector((e,t)=>e.workspaceLifecycle.sessionPhaseByWorkspaceId[t]),$s=e=>e==="hydrated"||e==="live",Ia=n.createSelector((e,t)=>{const s=qe.select(e,t);return s==="hydrated"||s==="live"}),va=n.createSelector(e=>{const t=e.workspaceLifecycle.sessionPhaseByWorkspaceId;return Object.keys(t).filter(s=>$s(t[s]))}),_a=n.createSelector((e,t)=>qe.select(e,t)==="live");function Ca(e){const{selectedProviderId:t,activeProviderId:s,recommitActive:r,dispatch:a}=e;if(!t)return;const o=s&&Ze(s)===t?s:t;if(!(!r&&o===s))return a(Qe({providerId:t,enabled:!0})),a(et(o)),a(tt()),t}function Aa(e){const t=[];for(const s of e){let r={};if(s.metadata)try{r=JSON.parse(s.metadata)}catch{}const a=[];if(a.push(`[${s.identifier}] ${s.title}`),s.url&&a.push(`URL: ${s.url}`),s.description&&a.push(`
|
|
3
3
|
Description:
|
|
4
4
|
${s.description}`),r.state&&a.push(`Status: ${r.state}`),r.teamName&&a.push(`Team: ${r.teamName}`),r.priority!==void 0){const o=["No priority","Urgent","High","Medium","Low"];a.push(`Priority: ${o[r.priority]||r.priority}`)}r.assignee&&a.push(`Assignee: ${r.assignee}`),t.push({type:s.itemType||"unknown",provider:s.provider,identifier:s.identifier,title:s.title,url:s.url,content:a.join(`
|
|
5
|
-
`),metadata:r})}return t}function Ra(e){const t=[];for(const s of e){if(s.type!=="file")continue;let r=s.meta?.fullPath||s.meta?.path||"";if(!r&&s.id?.startsWith("file-")){const a=s.id.slice(5);(a.startsWith("/")||/^[A-Za-z]:/.test(a))&&(r=a)}if(!r&&s.uri)if(s.uri.startsWith("devspace://file/"))try{r=decodeURIComponent(s.uri.slice(16))}catch{}else s.uri.startsWith("file:")&&(r=s.uri.slice(5));r||(r=s.label||s.meta?.name||""),t.push({type:"file",path:r,title:s.label})}return t}async function Ea(e,t){const s=[];for(const r of e){if(r.type==="terminal")try{const{terminalManager:a}=await q(async()=>{const{terminalManager:l}=await import("./CKcb8dge.js").then(m=>m.b);return{terminalManager:l}},__vite__mapDeps([23,3,2,18,19,12,8,0,1,4,5,6,7,9,10,11,13,14,15,16,17,20,21,22,24,25,26,27,28,29,30,31,32,33]),import.meta.url),o=r.meta?.workspaceId||"",c=r.id??"",i=await a.getBufferContent(c,o);i&&s.push({type:"terminal",content:i,title:r.label,metadata:{terminalName:r.label,terminalId:c}})}catch(a){t?.warn("[OnboardingContext] Failed to read terminal buffer:",a)}if(r.type==="script")try{const{selectScriptById:a,selectScriptRuntime:o}=await q(async()=>{const{selectScriptById:S,selectScriptRuntime:b}=await import("./
|
|
5
|
+
`),metadata:r})}return t}function Ra(e){const t=[];for(const s of e){if(s.type!=="file")continue;let r=s.meta?.fullPath||s.meta?.path||"";if(!r&&s.id?.startsWith("file-")){const a=s.id.slice(5);(a.startsWith("/")||/^[A-Za-z]:/.test(a))&&(r=a)}if(!r&&s.uri)if(s.uri.startsWith("devspace://file/"))try{r=decodeURIComponent(s.uri.slice(16))}catch{}else s.uri.startsWith("file:")&&(r=s.uri.slice(5));r||(r=s.label||s.meta?.name||""),t.push({type:"file",path:r,title:s.label})}return t}async function Ea(e,t){const s=[];for(const r of e){if(r.type==="terminal")try{const{terminalManager:a}=await q(async()=>{const{terminalManager:l}=await import("./CKcb8dge.js").then(m=>m.b);return{terminalManager:l}},__vite__mapDeps([23,3,2,18,19,12,8,0,1,4,5,6,7,9,10,11,13,14,15,16,17,20,21,22,24,25,26,27,28,29,30,31,32,33]),import.meta.url),o=r.meta?.workspaceId||"",c=r.id??"",i=await a.getBufferContent(c,o);i&&s.push({type:"terminal",content:i,title:r.label,metadata:{terminalName:r.label,terminalId:c}})}catch(a){t?.warn("[OnboardingContext] Failed to read terminal buffer:",a)}if(r.type==="script")try{const{selectScriptById:a,selectScriptRuntime:o}=await q(async()=>{const{selectScriptById:S,selectScriptRuntime:b}=await import("./BoMrPoLQ.js");return{selectScriptById:S,selectScriptRuntime:b}},__vite__mapDeps([34,4,5,3,6,7,8,9,2,10,11,12,35,36,37,38,39,15,16,40,21,13,14,17,31,41,42,19,18,43,44,45,46,22,47,48,1]),import.meta.url),{readScriptContextOutputLines:c}=await q(async()=>{const{readScriptContextOutputLines:S}=await import("./vQkUvlEK.js");return{readScriptContextOutputLines:S}},__vite__mapDeps([49,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,50,36,37,38,39,40,31,41,51,35,42,43,44,45,46,47,48,52,53,54,55,56,57,58,59,60,61,62,34]),import.meta.url),i=r.meta?.workspaceId||"",l=r.id??"",m=n.state,y=await c(m,i,l),u=a.select(m,i,l),d=o.select(m,i,l);let f=`Script: ${u?.name||r.label}
|
|
6
6
|
`;if(f+=`Command: ${u?.command||"unknown"}
|
|
7
7
|
`,f+=`Status: ${d.status}`,d.exitCode!==null&&d.exitCode!==void 0&&(f+=` (exit code: ${d.exitCode})`),f+=`
|
|
8
8
|
`,d.detectedUrl&&(f+=`URL: ${d.detectedUrl}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Jt}from"./
|
|
1
|
+
import{g as Jt}from"./BoR-Aoll.js";import{g as Zt}from"./YNjTtSCb.js";import{s as $t}from"./qPGtX9h3.js";import{b as C,a$ as e1,ay as Z,X as Ae,a1 as t1,aP as s1,bh as at,a_ as i1,aZ as r1,b0 as a1,V as n1,U as u1,Y as o1,z as l1,ax as c1,J as h1,aq as st,as as d1,$ as it,aW as rt,r as p1,a2 as f1,N as g1,am as b1,aU as k1,ab as A1,x as m1,aT as C1,p as S1}from"./CJZaf5GR.js";import{c as D1}from"./BvBYznmq.js";import{aR as T1}from"./Bmhkf_5j.js";var E1="flowchart-",y1=["laneRole","laneIndex","drawnExtent"];function Wt(s){if(!s||typeof s!="object")return s;const i={...s};for(const a of y1)Reflect.deleteProperty(i,a);return i}C(Wt,"withoutInternalKeys");var Pe,x1=(Pe=class{constructor(){this.vertexCounter=0,this.config=Ae(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.droppedSubGraphMembers=[],this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=i1,this.setAccDescription=r1,this.setDiagramTitle=a1,this.getAccTitle=n1,this.getAccDescription=u1,this.getDiagramTitle=o1,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return l1.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}setDiagramId(i){this.diagramId=i}lookUpDomId(i){for(const a of this.vertices.values())if(a.id===i)return this.diagramId?`${this.diagramId}-${a.domId}`:a.domId;return this.diagramId?`${this.diagramId}-${i}`:i}addVertex(i,a,n,r,l,g,o={},m){if(!i||i.trim().length===0)return;let d;if(m!==void 0){let f;m.includes(`
|
|
2
2
|
`)?f=m+`
|
|
3
3
|
`:f=`{
|
|
4
4
|
`+m+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as et,bo as c,bw as tt,b as nt,bp as ma,bm as h,br as $n,bq as or,bs as be}from"./YLhFQnIu.js";import{bs as rt,aD as e,a5 as Q,bS as S,bA as K,W as g,bn as at,c9 as i,aA as d,a7 as ke,ay as ee,be as je,b$ as Ve,aC as mt,ai as Bs,bo as ha,ca as Ue,bH as H,bf as _a,b_ as B,aj as Fs,bV as Ae,bO as q,aB as j,aw as Mt,bl as ue,cb as ba,am as Yr,c5 as Ut,a as En,$ as wa,cd as Yt,c0 as Xt,br as js}from"./3SdAC2_C.js";import{i as U}from"./YeOAvjnW.js";import{k as ya}from"./CBbdbU2x.js";import{c as Ct}from"./DwGyIIXK.js";import{b as xa,f as bt,c as un,s as we,g as Tn}from"./BQhBnAuP.js";import{t as $t,k as Vs}from"./CrpUtGFn.js";import{h as qs}from"./DJivXy66.js";import{b as Zs,a as Hs}from"./CIWQMI37.js";import{a as Gr,o as Jr,S as Gn,E as Ws,e as Rn}from"./ItBm4ElA.js";import"./kvtKUeBe.js";import"./KtEuoG00.js";import"./WvHbj6rB.js";import{r as Ks,e as Xs}from"./iAKTK0Nq.js";import{m as Gt}from"./CZB2ndi9.js";import"./ChTqQfQN.js";import"./D48_y-cl.js";import{jz as ir,Jx as le,i as Aa,v0 as Qs,br as Ys,jC as Gs,yW as Js,yY as eo,jv as to,U as ea,V as ta,kd as tr,k9 as Jn,jZ as na,kh as no,jM as ro,ke as ao,x5 as so,x6 as oo,x3 as io,jN as lo,kc as ra,k6 as co,jA as uo,ng as go,nf as po,jw as aa,rM as fo,k3 as vo,jB as mo,k0 as ho,jK as sa,Lw as _o,jH as bo,kb as wo}from"./D5wnbxHp.js";import{a_ as lr,dH as yo,O as xo,cU as Ao}from"./BJbm_MWC.js";import{E as ka}from"./Bj4IsLvN.js";import"./CGdXewiA.js";import{m as Sn,bE as ko,A as Io,bD as Ro,e as So,ah as Mo,bC as Co,bK as Po}from"./
|
|
1
|
+
import{t as et,bo as c,bw as tt,b as nt,bp as ma,bm as h,br as $n,bq as or,bs as be}from"./YLhFQnIu.js";import{bs as rt,aD as e,a5 as Q,bS as S,bA as K,W as g,bn as at,c9 as i,aA as d,a7 as ke,ay as ee,be as je,b$ as Ve,aC as mt,ai as Bs,bo as ha,ca as Ue,bH as H,bf as _a,b_ as B,aj as Fs,bV as Ae,bO as q,aB as j,aw as Mt,bl as ue,cb as ba,am as Yr,c5 as Ut,a as En,$ as wa,cd as Yt,c0 as Xt,br as js}from"./3SdAC2_C.js";import{i as U}from"./YeOAvjnW.js";import{k as ya}from"./CBbdbU2x.js";import{c as Ct}from"./DwGyIIXK.js";import{b as xa,f as bt,c as un,s as we,g as Tn}from"./BQhBnAuP.js";import{t as $t,k as Vs}from"./CrpUtGFn.js";import{h as qs}from"./DJivXy66.js";import{b as Zs,a as Hs}from"./CIWQMI37.js";import{a as Gr,o as Jr,S as Gn,E as Ws,e as Rn}from"./ItBm4ElA.js";import"./kvtKUeBe.js";import"./KtEuoG00.js";import"./WvHbj6rB.js";import{r as Ks,e as Xs}from"./iAKTK0Nq.js";import{m as Gt}from"./CZB2ndi9.js";import"./ChTqQfQN.js";import"./D48_y-cl.js";import{jz as ir,Jx as le,i as Aa,v0 as Qs,br as Ys,jC as Gs,yW as Js,yY as eo,jv as to,U as ea,V as ta,kd as tr,k9 as Jn,jZ as na,kh as no,jM as ro,ke as ao,x5 as so,x6 as oo,x3 as io,jN as lo,kc as ra,k6 as co,jA as uo,ng as go,nf as po,jw as aa,rM as fo,k3 as vo,jB as mo,k0 as ho,jK as sa,Lw as _o,jH as bo,kb as wo}from"./D5wnbxHp.js";import{a_ as lr,dH as yo,O as xo,cU as Ao}from"./BJbm_MWC.js";import{E as ka}from"./Bj4IsLvN.js";import"./CGdXewiA.js";import{m as Sn,bE as ko,A as Io,bD as Ro,e as So,ah as Mo,bC as Co,bK as Po}from"./lcF-Oq8x.js";import{u as Ia}from"./_3Ca9E4W.js";import{d1 as Ra,al as Do,c$ as $o,a1 as Eo,bH as nr,be as cr,bj as Sa,bb as To,bk as zo,bA as Uo,by as Oo,bd as Lo,ba as No,cs as Bo,bv as Fo,bx as jo,bI as Vo,bD as qo,bl as Zo,bm as Ma,bL as Ho,bE as Wo,bz as Ko,bh as Xo,bG as Qo,bg as Yo,bn as oa,bi as ia,bf as la,bs as Go}from"./Bmhkf_5j.js";import{e as Jo}from"./6NStP9u7.js";import{h as Ca,e as Pa,g as gt,i as gn,I as Da}from"./oBIu7LTI.js";import{b as Qt}from"./Dn334wJv.js";import{f as Oe,ae as ei}from"./Cw2fqKk9.js";import{T as ti}from"./CrL2Nk6a.js";import"./BNDTLRE1.js";import{c as ni}from"./D-62MVd3.js";import{P as zn}from"./CV5qbjYN.js";import{l as pn,k as $a,q as rr,i as ri}from"./DIEHuZ8f.js";import{F as kt,cn as ai,aS as si,bj as oi,Q as ii,cj as Ea,b7 as li,aZ as ci,bY as di,bF as ui,cd as gi,a6 as pi,$ as fi,d3 as vi,ad as mi}from"./gwv5JQYH.js";import{A as fn}from"./DPjr22dV.js";import{B as Ta}from"./DEQDOTA1.js";import{parseIntentLink as hi}from"./BDkhdOE6.js";import{h as _i}from"./BrJDea9R.js";import{M as bi}from"./CJDIH3zv.js";import{a as wi}from"./CLL8WWfZ.js";import{T as za}from"./BpXDXz8J.js";import{c as Ua,d as Oa}from"./B9BALnhr.js";import"./DU3vNstz.js";import{i as yi}from"./BjLb7AHW.js";import{a2 as xi}from"./BoGUeIJ1.js";import{a as Ai,A as ca}from"./B0Wlo7fG.js";import{I as ki}from"./DkERMj5B.js";import{S as Ii}from"./DkOk28fz.js";import{C as Ri}from"./BoZ2kJyE.js";import{D as Si,p as Mi}from"./Dxuw05vp.js";import{h as da,C as Ci}from"./CRnu0LJs.js";import{g as Pi}from"./DWGXN6Nr.js";import{u as Di,n as $i}from"./COVS9Crf.js";const Ei=/^!\[([^\]\n]*)\]\((workspace-asset:\/\/[^\s()]+)\)$/,Ti={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp"};function ar(s,n){const l=s.split(`
|
|
2
2
|
`),r=[];let a=l.length;for(;a>0;){const f=Ei.exec(l[a-1]);if(!f||!Ra(f[2],n))break;r.unshift({name:f[1],url:f[2]}),a--}if(!r.length)return{text:s,images:r};const u=l.slice(0,a).join(`
|
|
3
3
|
`);return{text:u.endsWith(`
|
|
4
4
|
`)?u.slice(0,-1):u,images:r}}function Mn(s,n){if(!n.length)return s;const l=n.map(({name:r,url:a})=>`![${r.replace(/[[\]()\\\n\r]/g,"").trim()||"image"}](${a})`);return s?`${s}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/Co9CFvqw.js","/app/immutable/chunks/D5wnbxHp.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BUsnh1ZW.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CrpUtGFn.js","/app/immutable/chunks/YLhFQnIu.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/COVS9Crf.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as Zt,bo as J,bw as te,bs as U,bq as ee,b as re,bm as i,_ as se}from"./YLhFQnIu.js";import{bo as ae,bs as ne,ca as C,bH as N,c5 as yt,aD as F,bj as ie,a5 as O,bS as p,bA as D,b_ as x,W as f,bn as oe,cd as lt,bV as kt,c9 as G,aA as Q,bl as R,bO as h,ay as wt,aB as y}from"./3SdAC2_C.js";import{i as L}from"./YeOAvjnW.js";import{f as $t,g as le,s as ce}from"./BQhBnAuP.js";import{b as ue}from"./Dn334wJv.js";import{b as de}from"./D3yXvqwY.js";import{Jx as m,D2 as pe,CU as me,CT as fe,Jr as _e,CF as ve,iA as be,i_ as ge}from"./D5wnbxHp.js";import{d as xe,T as he,D as ye,L as ke,o as we}from"./CKcb8dge.js";import{F as ct,d3 as $e,cb as Se,c$ as Ae}from"./gwv5JQYH.js";import{f as St}from"./Cw2fqKk9.js";import{m as rt}from"./CZB2ndi9.js";import"./DJivXy66.js";import"./CrpUtGFn.js";import"./ChTqQfQN.js";import"./D48_y-cl.js";import{r as Ce}from"./Mmc_61iE.js";import{selectScriptById as ut,selectScriptRuntime as Fe,selectScriptOutput as At,selectScriptRetainedOutput as Oe,selectCanDeleteScript as Ct}from"./
|
|
2
|
+
import{t as Zt,bo as J,bw as te,bs as U,bq as ee,b as re,bm as i,_ as se}from"./YLhFQnIu.js";import{bo as ae,bs as ne,ca as C,bH as N,c5 as yt,aD as F,bj as ie,a5 as O,bS as p,bA as D,b_ as x,W as f,bn as oe,cd as lt,bV as kt,c9 as G,aA as Q,bl as R,bO as h,ay as wt,aB as y}from"./3SdAC2_C.js";import{i as L}from"./YeOAvjnW.js";import{f as $t,g as le,s as ce}from"./BQhBnAuP.js";import{b as ue}from"./Dn334wJv.js";import{b as de}from"./D3yXvqwY.js";import{Jx as m,D2 as pe,CU as me,CT as fe,Jr as _e,CF as ve,iA as be,i_ as ge}from"./D5wnbxHp.js";import{d as xe,T as he,D as ye,L as ke,o as we}from"./CKcb8dge.js";import{F as ct,d3 as $e,cb as Se,c$ as Ae}from"./gwv5JQYH.js";import{f as St}from"./Cw2fqKk9.js";import{m as rt}from"./CZB2ndi9.js";import"./DJivXy66.js";import"./CrpUtGFn.js";import"./ChTqQfQN.js";import"./D48_y-cl.js";import{r as Ce}from"./Mmc_61iE.js";import{selectScriptById as ut,selectScriptRuntime as Fe,selectScriptOutput as At,selectScriptRetainedOutput as Oe,selectCanDeleteScript as Ct}from"./BoMrPoLQ.js";import{g as De}from"./_3Ca9E4W.js";import{c4 as Re,d$ as Le,dC as Ft}from"./BJbm_MWC.js";import"./kvtKUeBe.js";import"./KtEuoG00.js";import"./WvHbj6rB.js";import{e as Ie}from"./iAKTK0Nq.js";import{u as Ot}from"./lcF-Oq8x.js";var Dt=y("<!> ",1),Te=y('<div class="bg-danger-background/20 border-y border-danger/20 px-3 py-1.5 flex items-center justify-between"><div class="flex items-center gap-2 text-sm text-danger font-medium"><div class="w-4 h-4 rounded-full bg-danger-background flex items-center justify-center"><!></div> <span> </span></div> <!></div>'),qe=y('<pre class="retained-text px-3 pb-3 text-xs svelte-115p4sl"> </pre>'),Be=y('<p class="px-3 pb-3 text-xs text-muted-foreground" role="status"> </p>'),Ee=y('<details class="retained-output border-b border-border svelte-115p4sl"><summary class="cursor-pointer px-3 py-2 text-xs text-muted-foreground"> </summary> <p class="px-3 pb-2 text-xs text-muted-foreground"> </p> <!></details>'),Pe=y('<div class="px-3 py-1 text-xs text-muted-foreground"> </div>'),Me=y('<code class="text-muted-foreground font-mono text-xs"> </code>'),Ue=y('<span class="sr-only"> </span>'),We=y('<div class="flex-1 flex items-center justify-center px-4 py-8"><div class="flex items-center gap-3 text-sm"><span class="text-subtle font-mono">$</span> <!> <!> <!></div></div>'),je=y('<div><!> <!> <!> <!> <div><div class="xterm-output svelte-115p4sl"></div></div></div>');function ze(_,c){const j=ae();if(new.target)return Zt({component:ze,..._});ne(c,!0);const I=()=>U(Mt,"$outputAuthority",T),u=()=>U(Tt,"$runtime$",T),v=()=>U(qt,"$output$",T),$=()=>U(Pt,"$codeFontFamilyCSS",T),W=()=>U(Bt,"$retainedOutput$",T),Rt=()=>U(Et,"$hidesAgentLifecycleActions$",T),dt=()=>U(It,"$script$",T),[T,Lt]=ee();let S=J(c,"scriptId",7),b=J(c,"workspaceId",7),st=J(c,"class",7,""),at=J(c,"runDisabled",7,!1),q=J(c,"runDisabledReason",7,null);const pt=G(()=>at()||q()!==null),B=lt(""),z=lt(""),mt=lt("");let nt=kt(!1);C(()=>B.set(b())),C(()=>z.set(S()));let E,o=null,H=null,Y=null,V=null,P=null,X=null;const It=ut(B,z),Tt=Fe(B,z),qt=At(B,z),Bt=Oe(B,z,mt),Et=Re(B),Pt=De(),Mt=Le(B),ft=crypto.randomUUID();C(()=>{const t=b();return S(),()=>{t&&m.dispatch(pe(t,ft))}}),C(()=>{const t=b(),e=S(),n=I(),r=u();if(!n||!t||!e)return;r.status,r.startedAt;const a=crypto.randomUUID();return mt.set(a),N(nt,yt(()=>v().chunks.length===0),!0),m.dispatch(me(t,e,a)),()=>m.dispatch(fe(t,e,a))});let Z=kt(0);const Ut=G(()=>u().status==="exited"&&u().exitCode!=null&&u().exitCode!==0&&u().exitCode<128);function Wt(){if(!E||o)return;V=new he(E);const t=V.getCurrentTheme();o=new ye({allowProposedApi:!0,linkHandler:{activate:(r,a)=>e(a)},fontFamily:$(),fontSize:13,lineHeight:1.2,letterSpacing:0,cursorBlink:!1,cursorStyle:"underline",cursorWidth:1,scrollback:1e4,allowTransparency:!0,convertEol:!0,disableStdin:!0,drawBoldTextInBrightColors:!0,theme:t}),o.attachCustomKeyEventHandler(r=>{const a=r.metaKey||r.ctrlKey;return!(a&&r.key==="`"||a&&r.key==="j"||a&&r.key==="k")}),H=new we,o.loadAddon(H);function e(r){try{const a=new URL(r);a.hostname==="localhost"||a.hostname==="127.0.0.1"?Ce(r).then(g=>{se(async()=>{const{getPanelLayoutManager:k}=await import("./Co9CFvqw.js").then(A=>A.p);return{getPanelLayoutManager:k}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url).then(({getPanelLayoutManager:k})=>{k(b()).openBrowserPanel(g.url,void 0,void 0,g.requestedUrl)}).catch(()=>{window.open(g.url,"_blank")})}):window.open(r,"_blank")}catch{window.open(r,"_blank")}}const n=new ke((r,a)=>e(a));o.loadAddon(n),o.open(E),V.applyTheme(o),X=requestAnimationFrame(()=>{X=null,H?.fit()}),Y=new ResizeObserver(()=>{H?.fit()}),Y.observe(E),jt()}function jt(){if(!o)return;const t=At.select(m.state,b(),S());t.chunks.length>0&&o.write(t.chunks.map(e=>e.text).join("")),N(Z,t.dropped+t.chunks.length)}function _t(){P!==null&&(cancelAnimationFrame(P),P=null),X!==null&&(cancelAnimationFrame(X),X=null),Y?.disconnect(),Y=null,V?.dispose(),V=null;const t=o;o=null,H=null,N(Z,0),t&&xe(t)}C(()=>{const t=v(),e=yt(()=>F(Z)),n=t.dropped+t.chunks.length;if(!o||n<=e)return;const r=Math.max(e-t.dropped,0);o.write(t.chunks.slice(r).map(a=>a.text).join("")),N(Z,n)}),C(()=>{const t=$();o&&o.options.fontFamily!==t&&(o.options.fontFamily=t)});function zt(){F(pt)||m.dispatch(_e(b(),S()))}function Ht(){if(!b()){rt.error(i.terminal_scriptOutput_noWorkspace_error());return}m.dispatch(be(b(),S(),W()?.text,ft))}C(()=>{u().status==="idle"&&v().chunks.length===0&&_t()}),C(()=>{!(u().status==="idle"&&v().chunks.length===0)&&E&&!o&&(P!==null&&cancelAnimationFrame(P),P=requestAnimationFrame(()=>{P=null,Wt()}))}),ie(()=>{_t()});var Vt={get scriptId(){return S()},set scriptId(t){S(t),Q()},get workspaceId(){return b()},set workspaceId(t){b(t),Q()},get class(){return st()},set class(t=""){st(t),Q()},get runDisabled(){return at()},set runDisabled(t=!1){at(t),Q()},get runDisabledReason(){return q()},set runDisabledReason(t=null){q(t),Q()},$set:te,$on:(t,e)=>re(c,t,e)},tt=je(),vt=O(tt);{var Xt=t=>{var e=Te(),n=O(e),r=O(n),a=O(r);ct(a,{get icon(){return $e},size:"xs"}),D(r);var g=p(r,2),k=R(g,!0);D(n);var A=p(n,2);{var d=s=>{St(s,{variant:"outline",size:"sm",class:"h-7 text-xs bg-background border border-border text-danger",onclick:Ht,children:(l,w)=>{var M=Dt(),K=wt(M);ct(K,{get icon(){return Ae},size:"sm",class:"mr-1.5"});var et=p(K);x(ot=>h(et,` ${ot??""}`),[()=>i.terminal_scriptOutput_askAiToFix_label()]),f(l,M)},$$slots:{default:!0}})};L(A,s=>{Rt()||s(d)})}D(e),x(s=>h(k,s),[()=>i.terminal_scriptOutput_buildFailed_label({exitCode:u().exitCode??0})]),f(t,e)};L(vt,t=>{F(Ut)&&t(Xt)})}var bt=p(vt,2);{var Kt=t=>{var e=Ee(),n=O(e),r=R(n,!0),a=p(n,2),g=R(a,!0),k=p(a,2);{var A=s=>{var l=qe();let w;var M=R(l,!0);x(()=>{w=le(l,"",w,{"font-family":$()}),h(M,W().text)}),f(s,l)},d=s=>{var l=Be(),w=R(l,!0);x(M=>h(w,M),[()=>W().status==="loading"?i.terminal_scriptOutput_retainedLoading_label():i.terminal_scriptOutput_retainedUnavailable_label()]),f(s,l)};L(k,s=>{W().status==="available"?s(A):s(d,-1)})}D(e),x((s,l)=>{h(r,s),h(g,l)},[()=>i.terminal_scriptOutput_retained_label(),()=>i.terminal_scriptOutput_retained_description()]),de("open","toggle",e,s=>N(nt,s),()=>F(nt)),f(t,e)};L(bt,t=>{W()&&t(Kt)})}var gt=p(bt,2);{var Jt=t=>{var e=Pe(),n=R(e,!0);x(r=>h(n,r),[()=>i.terminal_scriptOutput_live_label()]),f(t,e)};L(gt,t=>{v().chunks.length>0&&W()&&t(Jt)})}var xt=p(gt,2);{var Nt=t=>{var e=We(),n=O(e),r=p(O(n),2);{var a=d=>{var s=Me(),l=R(s,!0);x(w=>h(l,w),[()=>ve(dt())]),f(d,s)};L(r,d=>{dt()&&d(a)})}var g=p(r,2);{let d=G(()=>q()??void 0),s=G(()=>i.terminal_scriptOutput_run_label()),l=G(()=>q()?j:void 0);St(g,{variant:"ghost",size:"xs",get disabled(){return F(pt)},get tooltip(){return F(d)},get"aria-label"(){return F(s)},get"aria-describedby"(){return F(l)},onclick:zt,class:"text-muted-foreground hover:text-foreground",children:(w,M)=>{var K=Dt(),et=wt(K);ct(et,{get icon(){return Se},class:"h-3 w-3 mr-1"});var ot=p(et);x(Yt=>h(ot,` ${Yt??""}`),[()=>i.terminal_scriptOutput_run_label()]),f(w,K)},$$slots:{default:!0}})}var k=p(g,2);{var A=d=>{var s=Ue(),l=R(s,!0);x(()=>{ce(s,"id",j),h(l,q())}),f(d,s)};L(k,d=>{q()&&d(A)})}D(n),D(e),f(t,e)};L(xt,t=>{u().status==="idle"&&v().chunks.length===0&&t(Nt)})}var it=p(xt,2);let ht;var Gt=O(it);ue(Gt,t=>E=t,()=>E),D(it),D(tt),x(()=>{$t(tt,1,`script-output-viewer ${st()??""}`,"svelte-115p4sl"),ht=$t(it,1,"flex-1 relative overflow-hidden",null,ht,{hidden:u().status==="idle"&&v().chunks.length===0})}),f(_,tt);var Qt=oe(Vt);return Lt(),Qt}async function fr(_,c,j){const I=ut.select(m.state,_,c);if(!I||!j()||!Ct.select(m.state,_,c))return;const u=Ot(I.runtime?.status),v=Ft.select(m.state,_);if(!v){rt.error(i.workspace_client_accessChanged_error());return}if(!await Ie({title:i.scripts_delete_title({name:I.name}),description:u?i.scripts_delete_running_description():i.scripts_delete_description(),confirmLabel:i.scripts_delete_label(),destructive:!0}))return;if(v!==Ft.select(m.state,_)){rt.error(i.workspace_client_accessChanged_error());return}const $=ut.select(m.state,_,c);if(!j()||!$||$.createdAt!==I.createdAt||$.name!==I.name||!u&&Ot($.runtime?.status)||!Ct.select(m.state,_,c)){rt.error(i.scripts_delete_changed_error());return}m.dispatch(ge(_,c,i.terminal_quakeOverlay_deleteScriptFailed_error()))}export{ze as S,fr as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as Xt,bo as de,_ as aa,bw as Yt,bs as ge,bq as pr,b as Jt,bm as d}from"./YLhFQnIu.js";import{bs as Zt,ca as se,aD as e,bH as c,a5 as F,bA as $,W as s,bn as Gt,bV as j,c9 as i,aA as ce,c6 as Bt,ay as ve,be as ot,b$ as ct,b_ as I,bO as m,bS as g,bl as C,aB as x,bj as oa,aw as ut,ai as ia,c5 as ur,a as Lr,a7 as Ue,aj as yt,cd as na,br as la,bf as sa}from"./3SdAC2_C.js";import{i as Y}from"./YeOAvjnW.js";import{k as Mr}from"./CBbdbU2x.js";import{g as Ut}from"./oBIu7LTI.js";import{c as Nt}from"./DwGyIIXK.js";import{s as Qe,g as jt,f as Kt}from"./BQhBnAuP.js";import{b as Rr}from"./Dn334wJv.js";import{Jx as R,nY as jr,wf as Ur,we as Vr,LN as da,LO as ca,eK as ua,eL as fa,Ld as yr,m6 as nr,Cy as kr,sH as $r,ok as va,A3 as pa,ad as Ir,n_ as ga,K4 as ma,Kk as _a,ny as ha,iX as wa,vH as ba,Aw as xa,Lc as Pa}from"./D5wnbxHp.js";import{g as ya}from"./DWGXN6Nr.js";import{a as ka,h as $a,j as Ia,c as Sa,d as Ca,i as Fa,e as Da,f as Sr,g as Ta,b as lr}from"./BIfjK4Wy.js";import{bO as Ea,b$ as La,dH as Ma}from"./BJbm_MWC.js";import{w as Cr,d as Ra}from"./wEnqV1Ol.js";import{f as ja}from"./COVS9Crf.js";import{m as sr}from"./CZB2ndi9.js";import{f as Te}from"./Cw2fqKk9.js";import{h as Ua}from"./DJivXy66.js";import"./CrpUtGFn.js";import{F as dt,ac as Va,au as za,aZ as Aa,b3 as Ot,ct as Wa,cu as Na,bm as Ha,cS as Ba,c9 as Oa}from"./gwv5JQYH.js";import{E as qa,b as Ka,S as Fr}from"./ItBm4ElA.js";import{c as Xa}from"./ChTqQfQN.js";import"./D48_y-cl.js";import{$ as Ya}from"./BL-MsXUm.js";import{i as dr,b as Ja,a as Za}from"./H2jLkRRS.js";import{C as fr,p as Ga}from"./DmpdpJAo.js";import{M as Qa}from"./AOZzp8ty.js";import{l as cr,m as zr}from"./DIEHuZ8f.js";import"./CGdXewiA.js";import"./CIWQMI37.js";import{M as Ht}from"./Lk7a_7W9.js";import{V as eo}from"./DMV5KQix.js";import{bT as to,b7 as ro}from"./iYBWUn-Y.js";import{g as ao}from"./Hi2H4bj8.js";import{H as oo}from"./Bqd7fdCF.js";import{g as io,W as no}from"./R5lmOJFS.js";import{b as lo,h as so}from"./DLO_0egf.js";import{u as co}from"./DP0K41jk.js";const Dr=1024*1024,uo=5e3;function fo(A,_){if(A.length>Dr||new TextEncoder().encode(A).byteLength>Dr){_(null);return}let re;try{re=new Worker(new URL("/app/immutable/workers/html-file-preview.worker-BfFljPK-.js",import.meta.url),{type:"module"})}catch{_(null);return}let He=!1;const ee=setTimeout(()=>O(null),uo);function P(){He||(He=!0,clearTimeout(ee),re.terminate())}function O(ae){He||(P(),_(ae))}return re.onmessage=({data:ae})=>O(ae),re.onerror=ae=>{ae.preventDefault(),O(null)},re.postMessage(A),P}const Ar=R.createSelector((A,_)=>jr(A.pdfPreview.previews,_));var vo=x('<div class="flex shrink-0 flex-wrap items-center justify-center gap-2 border-b border-border p-2"><!> <span aria-live="polite"> </span> <!> <!> <span> </span> <!></div> <div class="min-h-0 flex-1 overflow-auto p-4"><canvas class="mx-auto block" role="img"></canvas></div>',1),po=x('<div class="flex h-full min-h-0 flex-col" data-testid="pdf-viewer"><!></div>');function vr(A,_){if(new.target)return Xt({component:vr,...A});Zt(_,!0);const re=()=>ge(ye,"$preview",He),[He,ee]=pr();let P=de(_,"workspaceId",7),O=de(_,"filePath",7),ae=de(_,"gitRootId",7);const Ee=crypto.randomUUID(),ye=Ar(Ee),be=new WeakMap;let oe=j(null),et=j(void 0),U=j(1),H=j(1),pe=j(!0),xe=j(!1),Le=j(null),W=j(0);const ke=i(()=>re()?.error??e(Le)),Ce=i(()=>e(ke)==="missing"?d.file_pdf_missing_error():e(ke)==="large"?d.file_pdf_large_error():e(ke)==="invalid"?d.file_pdf_invalid_error():e(ke)==="password"?d.file_pdf_password_error():d.file_pdf_load_error());se(()=>{const v=P(),f=O();e(W);const ie=crypto.randomUUID();return R.dispatch(Ur(Ee,ie,v,f,...ae()?[{gitRootId:ae()}]:[])),()=>{R.dispatch(Vr(Ee,ie))}}),se(()=>{const v=re()?.url;let f=!1,ie;if(c(oe,null),c(Le,null),c(pe,!0),c(U,1),c(H,1),!!v)return(async()=>{try{const{loadPdfDocument:y}=await aa(async()=>{const{loadPdfDocument:N}=await import("./cb1JHFKl.js");return{loadPdfDocument:N}},[],import.meta.url);if(f)return;ie=y(v);const J=await ie.promise;f||c(oe,J)}catch(y){if(f)return;c(Le,y instanceof Error&&y.name==="PasswordException"?"password":y instanceof Error&&y.name==="InvalidPDFException"?"invalid":"load",!0)}finally{f||c(pe,!1)}})(),()=>{f=!0,ie?.destroy()}}),se(()=>{const v=e(oe),f=e(et),ie=e(U),y=e(H);if(!v||!f)return;let J=!1,N,D;const fe=()=>{if(!D)return;const Z=(be.get(D)??1)-1;Z?be.set(D,Z):(be.delete(D),D.cleanup()),D=void 0};return c(xe,!0),(async()=>{try{if(D=await v.getPage(ie),be.set(D,(be.get(D)??0)+1),J){fe();return}const Z=D.getViewport({scale:y}),ne=Math.min(window.devicePixelRatio||1,2,Math.sqrt(16e6/(Z.width*Z.height)));f.width=Math.ceil(Z.width*ne),f.height=Math.ceil(Z.height*ne),f.style.width=`${Z.width}px`,f.style.height=`${Z.height}px`,N=D.render({canvas:f,viewport:Z,transform:[ne,0,0,ne,0,0]}),await N.promise}catch{J||c(Le,"invalid")}finally{J||c(xe,!1)}})(),()=>{J=!0,N?.cancel(),N?N.promise.then(fe,fe):fe()}});var qe={get workspaceId(){return P()},set workspaceId(v){P(v),ce()},get filePath(){return O()},set filePath(v){O(v),ce()},get gitRootId(){return ae()},set gitRootId(v){ae(v),ce()},$set:Yt,$on:(v,f)=>Jt(_,v,f)},Ve=po(),Ke=F(Ve);{var ue=v=>{{const f=y=>{ot();var J=ct();I(()=>m(J,e(Ce))),s(y,J)};let ie=i(()=>d.ui_combobox_retry_label());qa(v,{onRetry:()=>Bt(W),get retryLabel(){return e(ie)},class:"m-auto",message:f,$$slots:{message:!0}})}},a=v=>{{let f=i(()=>d.file_pdf_loading_label());Ka(v,{get label(){return e(f)},count:1,class:"p-4"})}},l=v=>{var f=vo(),ie=ve(f),y=F(ie);{let me=i(()=>e(U)<=1);Te(y,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>Bt(U,-1),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.file_pdf_previous_label()]),s(Me,_e)},$$slots:{default:!0}})}var J=g(y,2),N=C(J,!0),D=g(J,2);{let me=i(()=>e(U)>=e(oe).numPages);Te(D,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>Bt(U),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.file_pdf_next_label()]),s(Me,_e)},$$slots:{default:!0}})}var fe=g(D,2);{let me=i(()=>e(H)<=.25);Te(fe,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>c(H,Math.max(.25,e(H)-.25),!0),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.editor_fileViewer_zoomOut_tooltip()]),s(Me,_e)},$$slots:{default:!0}})}var Z=g(fe,2),ne=C(Z,!0),ft=g(Z,2);{let me=i(()=>e(H)>=3);Te(ft,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>c(H,Math.min(3,e(H)+.25),!0),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.editor_fileViewer_zoomIn_tooltip()]),s(Me,_e)},$$slots:{default:!0}})}$(ie);var vt=g(ie,2),pt=F(vt);let bt;Rr(pt,me=>c(et,me),()=>e(et)),$(vt),I((me,Me,tt)=>{m(N,me),m(ne,Me),Qe(vt,"aria-busy",e(xe)),Qe(pt,"aria-label",tt),bt=jt(pt,"",bt,{visibility:e(xe)?"hidden":"visible"})},[()=>d.file_pdf_page_label({page:cr(e(U)),total:cr(e(oe).numPages)}),()=>zr(e(H),{style:"percent"}),()=>d.file_pdf_canvas_ariaLabel({name:O(),page:cr(e(U))})]),s(v,f)};Y(Ke,v=>{e(ke)?v(ue):e(pe)||re()?.status==="loading"?v(a,1):e(oe)&&v(l,2)})}$(Ve),s(A,Ve);var q=Gt(qe);return ee(),q}const go=R.createSelector((A,_)=>jr(A.videoPreview.previews,_));var mo=x('<p role="status"> </p>'),_o=x('<p role="alert"> </p>'),ho=x('<div class="flex flex-col items-center gap-3 p-6 text-center text-sm text-subtle"><p class="break-all"> </p> <!> <!></div>'),wo=x('<video controls="" preload="metadata" playsinline="" class="max-w-full max-h-full" data-testid="file-video"> </video>',2),bo=x('<div class="min-h-0 flex-1 flex items-center justify-center bg-background"><!></div>');function Wr(A,_){if(new.target)return Xt({component:Wr,...A});Zt(_,!0);const re=()=>ge(et,"$preview",He),[He,ee]=pr();let P=de(_,"sourceUrl",7),O=de(_,"fileName",7),ae=de(_,"allowDownload",7),Ee=de(_,"downloading",7),ye=de(_,"onDownload",7),be=j(null);const oe=crypto.randomUUID(),et=go(oe),U=i(()=>re()?.status==="loading"),H=i(()=>e(be)??re()?.error);let pe=!1,xe=!1;oa(()=>{xe=!0,R.dispatch(da(oe))});function Le(){if(xe||e(U))return;const a=P().startsWith("workspace-file://")?new URL(P()):null;if(pe||!a||!a.pathname.toLowerCase().endsWith(".mp4")){c(be,"unsupported");return}pe=!0,a.searchParams.set("preview","h264"),R.dispatch(ca(oe,a.hostname,a.toString()))}function W(a){if(xe)return;const l=a.currentTarget.error?.code;l===2?c(be,"network"):l!==1&&Le()}var ke={get sourceUrl(){return P()},set sourceUrl(a){P(a),ce()},get fileName(){return O()},set fileName(a){O(a),ce()},get allowDownload(){return ae()},set allowDownload(a){ae(a),ce()},get downloading(){return Ee()},set downloading(a){Ee(a),ce()},get onDownload(){return ye()},set onDownload(a){ye(a),ce()},$set:Yt,$on:(a,l)=>Jt(_,a,l)},Ce=bo(),qe=F(Ce);{var Ve=a=>{var l=ho(),q=F(l),v=C(q,!0),f=g(q,2);{var ie=D=>{var fe=mo(),Z=C(fe,!0);I(ne=>m(Z,ne),[()=>d.editor_fileViewer_videoPreparing_label()]),s(D,fe)},y=D=>{var fe=_o(),Z=C(fe,!0);I(ne=>m(Z,ne),[()=>e(H)==="network"?d.editor_fileViewer_videoLoad_error():d.editor_fileViewer_videoUnsupported_label()]),s(D,fe)};Y(f,D=>{e(U)?D(ie):D(y,-1)})}var J=g(f,2);{var N=D=>{Te(D,{variant:"secondary",size:"sm",get onclick(){return ye()},get disabled(){return Ee()},children:(fe,Z)=>{ot();var ne=ct();I(ft=>m(ne,ft),[()=>d.layout_fileTab_downloadFile_label()]),s(fe,ne)},$$slots:{default:!0}})};Y(J,D=>{ae()&&D(N)})}$(l),I(()=>m(v,O())),s(a,l)},Ke=a=>{var l=wo(),q=C(l,!0);I(v=>{Qe(l,"src",re()?.url??P()),m(q,v)},[()=>d.editor_fileViewer_videoUnsupported_label()]),ut("error",l,W),ut("loadedmetadata",l,v=>{v.currentTarget.videoWidth===0&&Le()}),s(a,l)};Y(qe,a=>{e(H)||e(U)?a(Ve):a(Ke,-1)})}$(Ce),s(A,Ce);var ue=Gt(ke);return ee(),ue}var xo=x('<!> <span class="text-xs text-subtle min-w-[50px] text-center"> </span> <!> <div class="w-px h-5 bg-border mx-1"></div>',1),Po=x('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="w-px h-5 bg-border mx-1"></div> <!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),yo=x('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),ko=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"></path></svg></div> <div class="text-sm text-subtle mb-4"> </div> <audio controls="" class="w-full max-w-md"><source/> </audio></div>'),$o=x("<!> ",1),Io=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg></div> <p class="text-sm text-subtle mb-4"> </p> <!></div>'),So=x('<th class="border border-border px-2 py-1 text-left text-xs font-medium bg-muted"> </th>'),Co=x('<td class="border border-border px-2 py-1 text-xs"> </td>'),Fo=x("<tr></tr>"),Do=x('<div class="flex-1 overflow-auto p-4"><table class="w-full border-collapse"><thead><tr></tr></thead><tbody></tbody></table></div>'),To=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),Eo=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),Lo=x('<div class="h-full flex flex-col"><!></div>');function qt(A,_){if(new.target)return Xt({component:qt,...A});Zt(_,!0);const re=t=>{var o=xo(),u=ve(o);{let V=i(()=>d.editor_fileViewer_zoomOut_tooltip());Te(u,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:fe,get title(){return e(V)},children:(T,K)=>{dt(T,{get icon(){return Wa},size:"sm"})},$$slots:{default:!0}})}var w=g(u,2),k=C(w,!0),E=g(w,2);{let V=i(()=>d.editor_fileViewer_zoomIn_tooltip());Te(E,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:D,get title(){return e(V)},children:(T,K)=>{dt(T,{get icon(){return Na},size:"sm"})},$$slots:{default:!0}})}ot(2),I(()=>m(k,e(Le))),s(t,o)},He=Xa("FileViewer");let ee=de(_,"filePath",7),P=de(_,"fileContent",7,""),O=de(_,"sourceUrl",7),ae=de(_,"language",7),Ee=de(_,"isBinary",7),ye=de(_,"allowDownload",7,!0),be=de(_,"onDownload",7),oe=de(_,"downloading",7,!1);const et=t=>{const o=t.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif"].includes(o)?"image":o==="svg"?"svg":["mp4","webm","ogg","mov","avi"].includes(o)?"video":["mp3","wav","ogg","m4a","flac"].includes(o)?"audio":o==="pdf"?"pdf":["md","markdown"].includes(o)?"markdown":o==="json"?"json":o==="csv"?"csv":["yaml","yml"].includes(o)?"yaml":o==="xml"?"xml":["zip","tar","gz","rar","7z","bz2"].includes(o)?"archive":["exe","dll","so","dylib","wasm"].includes(o)?"binary":"text"},U=i(()=>et(ee())),H=i(()=>ee().split("/").pop()||d.editor_fileViewer_unknown_fallback());let pe=j(100),xe=j(0);const Le=i(()=>zr(e(pe)/100,{style:"percent",maximumFractionDigits:0}));let W=j(!1),ke=j(0),Ce=j(0),qe=j(0),Ve=j(0),Ke=j(!1),ue=null;function a(){const t=ue;ue=null,c(Ke,!1),t?.viewport.hasPointerCapture(t.pointerId)&&t.viewport.releasePointerCapture(t.pointerId)}function l(t){if(t.button!==0||!t.isPrimary||ue)return;const o=t.currentTarget;o.setPointerCapture(t.pointerId),ue={pointerId:t.pointerId,x:t.clientX,y:t.clientY,viewport:o},c(Ke,!0),t.preventDefault()}function q(t){if(!(!ue||t.pointerId!==ue.pointerId)){if((t.buttons&1)===0){a();return}c(qe,ue.viewport.scrollLeft,!0),c(Ve,ue.viewport.scrollTop,!0),c(ke,e(ke)+(t.clientX-ue.x)),c(Ce,e(Ce)+(t.clientY-ue.y)),ue.x=t.clientX,ue.y=t.clientY}}function v(t){t.pointerId===ue?.pointerId&&a()}se(()=>{ee(),O(),e(pe),e(xe),c(qe,0),c(Ve,0)}),se(()=>(ee(),O(),ur(()=>{a(),c(ke,0),c(Ce,0)}),a));const f=t=>{const o=t.split(".").pop()?.toLowerCase();return o==="jpg"||o==="jpeg"?"image/jpeg":o==="png"?"image/png":o==="gif"?"image/gif":o==="webp"?"image/webp":"application/octet-stream"},ie=t=>{const o=t.split(".").pop()?.toLowerCase();if(o==="mp4")return"video/mp4";if(o==="webm")return"video/webm"},y=()=>{if(O())return O();if(typeof P()=="string")return P().startsWith("data:")||P().startsWith("http")?P():Ee()?`data:${f(ee())};base64,${P()}`:`data:${f(ee())};base64,${P()}`;if(P()instanceof ArrayBuffer){const o=new Uint8Array(P()).reduce((w,k)=>w+String.fromCharCode(k),""),u=btoa(o);return`data:${f(ee())};base64,${u}`}return""},J=()=>{if(O())return O();const t=ie(ee());if(!t)return"";if(typeof P()=="string")return P().startsWith("data:")||P().startsWith("http")?P():`data:${t};base64,${P()}`;const o=new Uint8Array(P()),u=[],w=32768;for(let k=0;k<o.length;k+=w)u.push(String.fromCharCode(...o.subarray(k,k+w)));return`data:${t};base64,${btoa(u.join(""))}`},N=()=>{const t=typeof P()=="string"?new TextEncoder().encode(P()):new Uint8Array(P()),o=[],u=32768;for(let w=0;w<t.length;w+=u)o.push(String.fromCharCode(...t.subarray(w,w+u)));return`data:image/svg+xml;base64,${btoa(o.join(""))}`},D=()=>{c(pe,Math.min(e(pe)+25,500),!0)},fe=()=>{c(pe,Math.max(e(pe)-25,25),!0)},Z=()=>{c(xe,(e(xe)+90)%360)},ne=()=>{if(!ye()||oe())return;if(be()){be()();return}const t=document.createElement("a");t.href=e(U)==="video"?J():e(U)==="svg"?N():y(),t.download=e(H),t.click()},ft=async()=>{try{const t=y(),o=new Image;o.crossOrigin="anonymous";const u=await new Promise((w,k)=>{o.onload=()=>{const E=document.createElement("canvas");E.width=o.naturalWidth,E.height=o.naturalHeight;const V=E.getContext("2d");if(!V){k(new Error("Failed to get canvas context"));return}V.drawImage(o,0,0),E.toBlob(T=>{T?w(T):k(new Error("Failed to create blob from canvas"))},"image/png",1)},o.onerror=()=>k(new Error("Failed to load image")),o.src=t});await navigator.clipboard.write([new ClipboardItem({"image/png":u})]),c(W,!0),setTimeout(()=>c(W,!1),2e3)}catch(t){He.error("Failed to copy image:",t)}},vt=t=>{try{const o=JSON.parse(t);return JSON.stringify(o,null,2)}catch{return t}},pt=t=>t.split(`
|
|
1
|
+
import{t as Xt,bo as de,_ as aa,bw as Yt,bs as ge,bq as pr,b as Jt,bm as d}from"./YLhFQnIu.js";import{bs as Zt,ca as se,aD as e,bH as c,a5 as F,bA as $,W as s,bn as Gt,bV as j,c9 as i,aA as ce,c6 as Bt,ay as ve,be as ot,b$ as ct,b_ as I,bO as m,bS as g,bl as C,aB as x,bj as oa,aw as ut,ai as ia,c5 as ur,a as Lr,a7 as Ue,aj as yt,cd as na,br as la,bf as sa}from"./3SdAC2_C.js";import{i as Y}from"./YeOAvjnW.js";import{k as Mr}from"./CBbdbU2x.js";import{g as Ut}from"./oBIu7LTI.js";import{c as Nt}from"./DwGyIIXK.js";import{s as Qe,g as jt,f as Kt}from"./BQhBnAuP.js";import{b as Rr}from"./Dn334wJv.js";import{Jx as R,nY as jr,wf as Ur,we as Vr,LN as da,LO as ca,eK as ua,eL as fa,Ld as yr,m6 as nr,Cy as kr,sH as $r,ok as va,A3 as pa,ad as Ir,n_ as ga,K4 as ma,Kk as _a,ny as ha,iX as wa,vH as ba,Aw as xa,Lc as Pa}from"./D5wnbxHp.js";import{g as ya}from"./DWGXN6Nr.js";import{a as ka,h as $a,j as Ia,c as Sa,d as Ca,i as Fa,e as Da,f as Sr,g as Ta,b as lr}from"./BIfjK4Wy.js";import{bO as Ea,b$ as La,dH as Ma}from"./BJbm_MWC.js";import{w as Cr,d as Ra}from"./wEnqV1Ol.js";import{f as ja}from"./COVS9Crf.js";import{m as sr}from"./CZB2ndi9.js";import{f as Te}from"./Cw2fqKk9.js";import{h as Ua}from"./DJivXy66.js";import"./CrpUtGFn.js";import{F as dt,ac as Va,au as za,aZ as Aa,b3 as Ot,ct as Wa,cu as Na,bm as Ha,cS as Ba,c9 as Oa}from"./gwv5JQYH.js";import{E as qa,b as Ka,S as Fr}from"./ItBm4ElA.js";import{c as Xa}from"./ChTqQfQN.js";import"./D48_y-cl.js";import{$ as Ya}from"./BoGUeIJ1.js";import{i as dr,b as Ja,a as Za}from"./H2jLkRRS.js";import{C as fr,p as Ga}from"./DmpdpJAo.js";import{M as Qa}from"./CJDIH3zv.js";import{l as cr,m as zr}from"./DIEHuZ8f.js";import"./CGdXewiA.js";import"./CIWQMI37.js";import{M as Ht}from"./Lk7a_7W9.js";import{V as eo}from"./DMV5KQix.js";import{bT as to,b7 as ro}from"./Bmhkf_5j.js";import{g as ao}from"./Hi2H4bj8.js";import{H as oo}from"./Bqd7fdCF.js";import{g as io,W as no}from"./R5lmOJFS.js";import{b as lo,h as so}from"./DLO_0egf.js";import{u as co}from"./DP0K41jk.js";const Dr=1024*1024,uo=5e3;function fo(A,_){if(A.length>Dr||new TextEncoder().encode(A).byteLength>Dr){_(null);return}let re;try{re=new Worker(new URL("/app/immutable/workers/html-file-preview.worker-BfFljPK-.js",import.meta.url),{type:"module"})}catch{_(null);return}let He=!1;const ee=setTimeout(()=>O(null),uo);function P(){He||(He=!0,clearTimeout(ee),re.terminate())}function O(ae){He||(P(),_(ae))}return re.onmessage=({data:ae})=>O(ae),re.onerror=ae=>{ae.preventDefault(),O(null)},re.postMessage(A),P}const Ar=R.createSelector((A,_)=>jr(A.pdfPreview.previews,_));var vo=x('<div class="flex shrink-0 flex-wrap items-center justify-center gap-2 border-b border-border p-2"><!> <span aria-live="polite"> </span> <!> <!> <span> </span> <!></div> <div class="min-h-0 flex-1 overflow-auto p-4"><canvas class="mx-auto block" role="img"></canvas></div>',1),po=x('<div class="flex h-full min-h-0 flex-col" data-testid="pdf-viewer"><!></div>');function vr(A,_){if(new.target)return Xt({component:vr,...A});Zt(_,!0);const re=()=>ge(ye,"$preview",He),[He,ee]=pr();let P=de(_,"workspaceId",7),O=de(_,"filePath",7),ae=de(_,"gitRootId",7);const Ee=crypto.randomUUID(),ye=Ar(Ee),be=new WeakMap;let oe=j(null),et=j(void 0),U=j(1),H=j(1),pe=j(!0),xe=j(!1),Le=j(null),W=j(0);const ke=i(()=>re()?.error??e(Le)),Ce=i(()=>e(ke)==="missing"?d.file_pdf_missing_error():e(ke)==="large"?d.file_pdf_large_error():e(ke)==="invalid"?d.file_pdf_invalid_error():e(ke)==="password"?d.file_pdf_password_error():d.file_pdf_load_error());se(()=>{const v=P(),f=O();e(W);const ie=crypto.randomUUID();return R.dispatch(Ur(Ee,ie,v,f,...ae()?[{gitRootId:ae()}]:[])),()=>{R.dispatch(Vr(Ee,ie))}}),se(()=>{const v=re()?.url;let f=!1,ie;if(c(oe,null),c(Le,null),c(pe,!0),c(U,1),c(H,1),!!v)return(async()=>{try{const{loadPdfDocument:y}=await aa(async()=>{const{loadPdfDocument:N}=await import("./cb1JHFKl.js");return{loadPdfDocument:N}},[],import.meta.url);if(f)return;ie=y(v);const J=await ie.promise;f||c(oe,J)}catch(y){if(f)return;c(Le,y instanceof Error&&y.name==="PasswordException"?"password":y instanceof Error&&y.name==="InvalidPDFException"?"invalid":"load",!0)}finally{f||c(pe,!1)}})(),()=>{f=!0,ie?.destroy()}}),se(()=>{const v=e(oe),f=e(et),ie=e(U),y=e(H);if(!v||!f)return;let J=!1,N,D;const fe=()=>{if(!D)return;const Z=(be.get(D)??1)-1;Z?be.set(D,Z):(be.delete(D),D.cleanup()),D=void 0};return c(xe,!0),(async()=>{try{if(D=await v.getPage(ie),be.set(D,(be.get(D)??0)+1),J){fe();return}const Z=D.getViewport({scale:y}),ne=Math.min(window.devicePixelRatio||1,2,Math.sqrt(16e6/(Z.width*Z.height)));f.width=Math.ceil(Z.width*ne),f.height=Math.ceil(Z.height*ne),f.style.width=`${Z.width}px`,f.style.height=`${Z.height}px`,N=D.render({canvas:f,viewport:Z,transform:[ne,0,0,ne,0,0]}),await N.promise}catch{J||c(Le,"invalid")}finally{J||c(xe,!1)}})(),()=>{J=!0,N?.cancel(),N?N.promise.then(fe,fe):fe()}});var qe={get workspaceId(){return P()},set workspaceId(v){P(v),ce()},get filePath(){return O()},set filePath(v){O(v),ce()},get gitRootId(){return ae()},set gitRootId(v){ae(v),ce()},$set:Yt,$on:(v,f)=>Jt(_,v,f)},Ve=po(),Ke=F(Ve);{var ue=v=>{{const f=y=>{ot();var J=ct();I(()=>m(J,e(Ce))),s(y,J)};let ie=i(()=>d.ui_combobox_retry_label());qa(v,{onRetry:()=>Bt(W),get retryLabel(){return e(ie)},class:"m-auto",message:f,$$slots:{message:!0}})}},a=v=>{{let f=i(()=>d.file_pdf_loading_label());Ka(v,{get label(){return e(f)},count:1,class:"p-4"})}},l=v=>{var f=vo(),ie=ve(f),y=F(ie);{let me=i(()=>e(U)<=1);Te(y,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>Bt(U,-1),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.file_pdf_previous_label()]),s(Me,_e)},$$slots:{default:!0}})}var J=g(y,2),N=C(J,!0),D=g(J,2);{let me=i(()=>e(U)>=e(oe).numPages);Te(D,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>Bt(U),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.file_pdf_next_label()]),s(Me,_e)},$$slots:{default:!0}})}var fe=g(D,2);{let me=i(()=>e(H)<=.25);Te(fe,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>c(H,Math.max(.25,e(H)-.25),!0),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.editor_fileViewer_zoomOut_tooltip()]),s(Me,_e)},$$slots:{default:!0}})}var Z=g(fe,2),ne=C(Z,!0),ft=g(Z,2);{let me=i(()=>e(H)>=3);Te(ft,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>c(H,Math.min(3,e(H)+.25),!0),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.editor_fileViewer_zoomIn_tooltip()]),s(Me,_e)},$$slots:{default:!0}})}$(ie);var vt=g(ie,2),pt=F(vt);let bt;Rr(pt,me=>c(et,me),()=>e(et)),$(vt),I((me,Me,tt)=>{m(N,me),m(ne,Me),Qe(vt,"aria-busy",e(xe)),Qe(pt,"aria-label",tt),bt=jt(pt,"",bt,{visibility:e(xe)?"hidden":"visible"})},[()=>d.file_pdf_page_label({page:cr(e(U)),total:cr(e(oe).numPages)}),()=>zr(e(H),{style:"percent"}),()=>d.file_pdf_canvas_ariaLabel({name:O(),page:cr(e(U))})]),s(v,f)};Y(Ke,v=>{e(ke)?v(ue):e(pe)||re()?.status==="loading"?v(a,1):e(oe)&&v(l,2)})}$(Ve),s(A,Ve);var q=Gt(qe);return ee(),q}const go=R.createSelector((A,_)=>jr(A.videoPreview.previews,_));var mo=x('<p role="status"> </p>'),_o=x('<p role="alert"> </p>'),ho=x('<div class="flex flex-col items-center gap-3 p-6 text-center text-sm text-subtle"><p class="break-all"> </p> <!> <!></div>'),wo=x('<video controls="" preload="metadata" playsinline="" class="max-w-full max-h-full" data-testid="file-video"> </video>',2),bo=x('<div class="min-h-0 flex-1 flex items-center justify-center bg-background"><!></div>');function Wr(A,_){if(new.target)return Xt({component:Wr,...A});Zt(_,!0);const re=()=>ge(et,"$preview",He),[He,ee]=pr();let P=de(_,"sourceUrl",7),O=de(_,"fileName",7),ae=de(_,"allowDownload",7),Ee=de(_,"downloading",7),ye=de(_,"onDownload",7),be=j(null);const oe=crypto.randomUUID(),et=go(oe),U=i(()=>re()?.status==="loading"),H=i(()=>e(be)??re()?.error);let pe=!1,xe=!1;oa(()=>{xe=!0,R.dispatch(da(oe))});function Le(){if(xe||e(U))return;const a=P().startsWith("workspace-file://")?new URL(P()):null;if(pe||!a||!a.pathname.toLowerCase().endsWith(".mp4")){c(be,"unsupported");return}pe=!0,a.searchParams.set("preview","h264"),R.dispatch(ca(oe,a.hostname,a.toString()))}function W(a){if(xe)return;const l=a.currentTarget.error?.code;l===2?c(be,"network"):l!==1&&Le()}var ke={get sourceUrl(){return P()},set sourceUrl(a){P(a),ce()},get fileName(){return O()},set fileName(a){O(a),ce()},get allowDownload(){return ae()},set allowDownload(a){ae(a),ce()},get downloading(){return Ee()},set downloading(a){Ee(a),ce()},get onDownload(){return ye()},set onDownload(a){ye(a),ce()},$set:Yt,$on:(a,l)=>Jt(_,a,l)},Ce=bo(),qe=F(Ce);{var Ve=a=>{var l=ho(),q=F(l),v=C(q,!0),f=g(q,2);{var ie=D=>{var fe=mo(),Z=C(fe,!0);I(ne=>m(Z,ne),[()=>d.editor_fileViewer_videoPreparing_label()]),s(D,fe)},y=D=>{var fe=_o(),Z=C(fe,!0);I(ne=>m(Z,ne),[()=>e(H)==="network"?d.editor_fileViewer_videoLoad_error():d.editor_fileViewer_videoUnsupported_label()]),s(D,fe)};Y(f,D=>{e(U)?D(ie):D(y,-1)})}var J=g(f,2);{var N=D=>{Te(D,{variant:"secondary",size:"sm",get onclick(){return ye()},get disabled(){return Ee()},children:(fe,Z)=>{ot();var ne=ct();I(ft=>m(ne,ft),[()=>d.layout_fileTab_downloadFile_label()]),s(fe,ne)},$$slots:{default:!0}})};Y(J,D=>{ae()&&D(N)})}$(l),I(()=>m(v,O())),s(a,l)},Ke=a=>{var l=wo(),q=C(l,!0);I(v=>{Qe(l,"src",re()?.url??P()),m(q,v)},[()=>d.editor_fileViewer_videoUnsupported_label()]),ut("error",l,W),ut("loadedmetadata",l,v=>{v.currentTarget.videoWidth===0&&Le()}),s(a,l)};Y(qe,a=>{e(H)||e(U)?a(Ve):a(Ke,-1)})}$(Ce),s(A,Ce);var ue=Gt(ke);return ee(),ue}var xo=x('<!> <span class="text-xs text-subtle min-w-[50px] text-center"> </span> <!> <div class="w-px h-5 bg-border mx-1"></div>',1),Po=x('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="w-px h-5 bg-border mx-1"></div> <!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),yo=x('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),ko=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"></path></svg></div> <div class="text-sm text-subtle mb-4"> </div> <audio controls="" class="w-full max-w-md"><source/> </audio></div>'),$o=x("<!> ",1),Io=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg></div> <p class="text-sm text-subtle mb-4"> </p> <!></div>'),So=x('<th class="border border-border px-2 py-1 text-left text-xs font-medium bg-muted"> </th>'),Co=x('<td class="border border-border px-2 py-1 text-xs"> </td>'),Fo=x("<tr></tr>"),Do=x('<div class="flex-1 overflow-auto p-4"><table class="w-full border-collapse"><thead><tr></tr></thead><tbody></tbody></table></div>'),To=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),Eo=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),Lo=x('<div class="h-full flex flex-col"><!></div>');function qt(A,_){if(new.target)return Xt({component:qt,...A});Zt(_,!0);const re=t=>{var o=xo(),u=ve(o);{let V=i(()=>d.editor_fileViewer_zoomOut_tooltip());Te(u,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:fe,get title(){return e(V)},children:(T,K)=>{dt(T,{get icon(){return Wa},size:"sm"})},$$slots:{default:!0}})}var w=g(u,2),k=C(w,!0),E=g(w,2);{let V=i(()=>d.editor_fileViewer_zoomIn_tooltip());Te(E,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:D,get title(){return e(V)},children:(T,K)=>{dt(T,{get icon(){return Na},size:"sm"})},$$slots:{default:!0}})}ot(2),I(()=>m(k,e(Le))),s(t,o)},He=Xa("FileViewer");let ee=de(_,"filePath",7),P=de(_,"fileContent",7,""),O=de(_,"sourceUrl",7),ae=de(_,"language",7),Ee=de(_,"isBinary",7),ye=de(_,"allowDownload",7,!0),be=de(_,"onDownload",7),oe=de(_,"downloading",7,!1);const et=t=>{const o=t.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif"].includes(o)?"image":o==="svg"?"svg":["mp4","webm","ogg","mov","avi"].includes(o)?"video":["mp3","wav","ogg","m4a","flac"].includes(o)?"audio":o==="pdf"?"pdf":["md","markdown"].includes(o)?"markdown":o==="json"?"json":o==="csv"?"csv":["yaml","yml"].includes(o)?"yaml":o==="xml"?"xml":["zip","tar","gz","rar","7z","bz2"].includes(o)?"archive":["exe","dll","so","dylib","wasm"].includes(o)?"binary":"text"},U=i(()=>et(ee())),H=i(()=>ee().split("/").pop()||d.editor_fileViewer_unknown_fallback());let pe=j(100),xe=j(0);const Le=i(()=>zr(e(pe)/100,{style:"percent",maximumFractionDigits:0}));let W=j(!1),ke=j(0),Ce=j(0),qe=j(0),Ve=j(0),Ke=j(!1),ue=null;function a(){const t=ue;ue=null,c(Ke,!1),t?.viewport.hasPointerCapture(t.pointerId)&&t.viewport.releasePointerCapture(t.pointerId)}function l(t){if(t.button!==0||!t.isPrimary||ue)return;const o=t.currentTarget;o.setPointerCapture(t.pointerId),ue={pointerId:t.pointerId,x:t.clientX,y:t.clientY,viewport:o},c(Ke,!0),t.preventDefault()}function q(t){if(!(!ue||t.pointerId!==ue.pointerId)){if((t.buttons&1)===0){a();return}c(qe,ue.viewport.scrollLeft,!0),c(Ve,ue.viewport.scrollTop,!0),c(ke,e(ke)+(t.clientX-ue.x)),c(Ce,e(Ce)+(t.clientY-ue.y)),ue.x=t.clientX,ue.y=t.clientY}}function v(t){t.pointerId===ue?.pointerId&&a()}se(()=>{ee(),O(),e(pe),e(xe),c(qe,0),c(Ve,0)}),se(()=>(ee(),O(),ur(()=>{a(),c(ke,0),c(Ce,0)}),a));const f=t=>{const o=t.split(".").pop()?.toLowerCase();return o==="jpg"||o==="jpeg"?"image/jpeg":o==="png"?"image/png":o==="gif"?"image/gif":o==="webp"?"image/webp":"application/octet-stream"},ie=t=>{const o=t.split(".").pop()?.toLowerCase();if(o==="mp4")return"video/mp4";if(o==="webm")return"video/webm"},y=()=>{if(O())return O();if(typeof P()=="string")return P().startsWith("data:")||P().startsWith("http")?P():Ee()?`data:${f(ee())};base64,${P()}`:`data:${f(ee())};base64,${P()}`;if(P()instanceof ArrayBuffer){const o=new Uint8Array(P()).reduce((w,k)=>w+String.fromCharCode(k),""),u=btoa(o);return`data:${f(ee())};base64,${u}`}return""},J=()=>{if(O())return O();const t=ie(ee());if(!t)return"";if(typeof P()=="string")return P().startsWith("data:")||P().startsWith("http")?P():`data:${t};base64,${P()}`;const o=new Uint8Array(P()),u=[],w=32768;for(let k=0;k<o.length;k+=w)u.push(String.fromCharCode(...o.subarray(k,k+w)));return`data:${t};base64,${btoa(u.join(""))}`},N=()=>{const t=typeof P()=="string"?new TextEncoder().encode(P()):new Uint8Array(P()),o=[],u=32768;for(let w=0;w<t.length;w+=u)o.push(String.fromCharCode(...t.subarray(w,w+u)));return`data:image/svg+xml;base64,${btoa(o.join(""))}`},D=()=>{c(pe,Math.min(e(pe)+25,500),!0)},fe=()=>{c(pe,Math.max(e(pe)-25,25),!0)},Z=()=>{c(xe,(e(xe)+90)%360)},ne=()=>{if(!ye()||oe())return;if(be()){be()();return}const t=document.createElement("a");t.href=e(U)==="video"?J():e(U)==="svg"?N():y(),t.download=e(H),t.click()},ft=async()=>{try{const t=y(),o=new Image;o.crossOrigin="anonymous";const u=await new Promise((w,k)=>{o.onload=()=>{const E=document.createElement("canvas");E.width=o.naturalWidth,E.height=o.naturalHeight;const V=E.getContext("2d");if(!V){k(new Error("Failed to get canvas context"));return}V.drawImage(o,0,0),E.toBlob(T=>{T?w(T):k(new Error("Failed to create blob from canvas"))},"image/png",1)},o.onerror=()=>k(new Error("Failed to load image")),o.src=t});await navigator.clipboard.write([new ClipboardItem({"image/png":u})]),c(W,!0),setTimeout(()=>c(W,!1),2e3)}catch(t){He.error("Failed to copy image:",t)}},vt=t=>{try{const o=JSON.parse(t);return JSON.stringify(o,null,2)}catch{return t}},pt=t=>t.split(`
|
|
2
2
|
`).map(u=>u.split(",").map(w=>w.trim()));var bt={get filePath(){return ee()},set filePath(t){ee(t),ce()},get fileContent(){return P()},set fileContent(t=""){P(t),ce()},get sourceUrl(){return O()},set sourceUrl(t){O(t),ce()},get language(){return ae()},set language(t){ae(t),ce()},get isBinary(){return Ee()},set isBinary(t){Ee(t),ce()},get allowDownload(){return ye()},set allowDownload(t=!0){ye(t),ce()},get onDownload(){return be()},set onDownload(t){be(t),ce()},get downloading(){return oe()},set downloading(t=!1){oe(t),ce()},$set:Yt,$on:(t,o)=>Jt(_,t,o)},me=Lo();ut("blur",Lr,a);var Me=F(me);{var tt=t=>{var o=Po(),u=F(o),w=F(u);re(w);var k=g(w,2);{let Pe=i(()=>d.editor_fileViewer_rotate_tooltip());Te(k,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:Z,get title(){return e(Pe)},children:(Ae,Ye)=>{dt(Ae,{get icon(){return Va},size:"sm"})},$$slots:{default:!0}})}var E=g(k,4);{let Pe=i(()=>d.editor_fileViewer_copyImage_tooltip());Te(E,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ft,get title(){return e(Pe)},children:(Ae,Ye)=>{var rt=Ue(),Je=ve(rt);{var $t=Fe=>{dt(Fe,{get icon(){return za},size:"sm",class:"text-green-500"})},Vt=Fe=>{dt(Fe,{get icon(){return Aa},size:"sm"})};Y(Je,Fe=>{e(W)?Fe($t):Fe(Vt,-1)})}s(Ae,rt)},$$slots:{default:!0}})}var V=g(E,2);{let Pe=i(()=>!ye()||oe()),Ae=i(()=>d.editor_fileViewer_download_tooltip());Te(V,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ne,get disabled(){return e(Pe)},get title(){return e(Ae)},children:(Ye,rt)=>{dt(Ye,{get icon(){return Ot},size:"sm"})},$$slots:{default:!0}})}var T=g(V,2),K=C(T,!0);$(u);var L=g(u,2),he=C(L);$(o),I(Pe=>{m(K,e(H)),Kt(L,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(Ke)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),jt(L,`--pan-scroll-x: ${e(qe)??""}px; --pan-scroll-y: ${e(Ve)??""}px;`),Qe(he,"src",Pe),Qe(he,"alt",e(H)),jt(he,`translate: ${e(ke)??""}px ${e(Ce)??""}px; transform: scale(${e(pe)/100}) rotate(${e(xe)??""}deg); transition: transform 0.2s;`)},[()=>y()]),yt("pointerdown",L,l),yt("pointermove",L,q),yt("pointerup",L,v),ut("pointercancel",L,v),ut("lostpointercapture",L,v),s(t,o)},_e=t=>{var o=yo(),u=F(o),w=F(u);re(w);var k=g(w,2);{let L=i(()=>!ye()||oe()),he=i(()=>d.editor_fileViewer_download_tooltip());Te(k,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ne,get disabled(){return e(L)},get title(){return e(he)},children:(Pe,Ae)=>{dt(Pe,{get icon(){return Ot},size:"sm"})},$$slots:{default:!0}})}var E=g(k,2),V=C(E,!0);$(u);var T=g(u,2),K=C(T);$(o),I(L=>{m(V,e(H)),Kt(T,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(Ke)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),jt(T,`--pan-scroll-x: ${e(qe)??""}px; --pan-scroll-y: ${e(Ve)??""}px;`),Qe(K,"src",L),Qe(K,"alt",e(H)),jt(K,`translate: ${e(ke)??""}px ${e(Ce)??""}px; transform: scale(${e(pe)/100});`)},[()=>N()]),yt("pointerdown",T,l),yt("pointermove",T,q),yt("pointerup",T,v),ut("pointercancel",T,v),ut("lostpointercapture",T,v),s(t,o)},Re=t=>{const o=i(J);var u=Ue(),w=ve(u);Mr(w,()=>ee()+e(o),k=>{Wr(k,{get sourceUrl(){return e(o)},get fileName(){return e(H)},get allowDownload(){return ye()},get downloading(){return oe()},onDownload:ne})}),s(t,u)},Qt=t=>{var o=ko(),u=g(F(o),2),w=C(u,!0),k=g(u,2),E=F(k),V=g(E);$(k),$(o),I((T,K)=>{m(w,e(H)),Qe(E,"src",T),m(V,` ${K??""}`)},[()=>y(),()=>d.editor_fileViewer_audioUnsupported_label()]),s(t,o)},kt=t=>{var o=Io(),u=g(F(o),2),w=C(u,!0),k=g(u,2);{let E=i(()=>!ye()||oe());Te(k,{size:"sm",variant:"secondary",onclick:ne,get disabled(){return e(E)},children:(V,T)=>{var K=$o(),L=ve(K);dt(L,{get icon(){return Ot},size:"sm",class:"mr-2"});var he=g(L);I(Pe=>m(he,` ${Pe??""}`),[()=>d.editor_fileViewer_downloadPdf_label()]),s(V,K)},$$slots:{default:!0}})}$(o),I(E=>m(w,E),[()=>d.editor_fileViewer_pdfUnavailable_label()]),s(t,o)},er=t=>{{let o=i(()=>vt(P().toString()));fr(t,{get value(){return e(o)},language:"json",get fileName(){return ee()},lineNumbers:!0,readOnly:!0})}},tr=t=>{const o=i(()=>pt(P().toString()));var u=Do(),w=F(u),k=F(w),E=F(k);Ut(E,23,()=>e(o)[0]||[],(T,K)=>`header-${K}-${T}`,(T,K)=>{var L=So(),he=C(L,!0);I(()=>m(he,e(K))),s(T,L)}),$(E),$(k);var V=g(k);Ut(V,23,()=>e(o).slice(1),(T,K)=>`row-${K}`,(T,K,L)=>{var he=Fo();Ut(he,23,()=>e(K),(Pe,Ae)=>`cell-${e(L)}-${Ae}`,(Pe,Ae)=>{var Ye=Co(),rt=C(Ye,!0);I(()=>m(rt,e(Ae))),s(Pe,Ye)}),$(he),s(T,he)}),$(V),$(w),$(u),s(t,u)},Xe=t=>{var o=To(),u=g(F(o),2),w=C(u,!0),k=g(u,2),E=C(k,!0);$(o),I(V=>{m(w,e(H)),m(E,V)},[()=>d.editor_fileViewer_archive_label()]),s(t,o)},ze=t=>{var o=Eo(),u=g(F(o),2),w=C(u,!0),k=g(u,2),E=C(k,!0);$(o),I(V=>{m(w,e(H)),m(E,V)},[()=>d.editor_fileViewer_binary_label()]),s(t,o)},rr=t=>{{let o=i(()=>P().toString());fr(t,{get value(){return e(o)},get language(){return ae()},get fileName(){return ee()},lineNumbers:!0,highlightActiveLine:!0})}};Y(Me,t=>{e(U)==="image"?t(tt):e(U)==="svg"?t(_e,1):e(U)==="video"?t(Re,2):e(U)==="audio"?t(Qt,3):e(U)==="pdf"?t(kt,4):e(U)==="json"?t(er,5):e(U)==="csv"?t(tr,6):e(U)==="archive"?t(Xe,7):e(U)==="binary"?t(ze,8):t(rr,-1)})}return $(me),s(A,me),Gt(bt)}ia(["pointerdown","pointermove","pointerup"]);const Mo=/access denied|permission denied|outside (?:the )?workspace/i,Ro=/file not found|no such file or directory/i;function jo(A){return Mo.test(A)?"access-denied":A===d.files_read_notFound_error()||Ro.test(A)?"not-found":"generic"}function Uo(A){switch(A){case"access-denied":return d.layout_fileTab_errorAccessDenied_label();case"not-found":return d.layout_fileTab_errorNotFound_label();case"generic":return d.layout_fileTab_errorGeneric_label()}}var Vo=x("<!> <!>",1),zo=x("<!> <!> <!>",1),Ao=x('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p> </p> <p class="text-xs"> </p></div>'),Tr=x('<div class="flex h-full items-center justify-center p-4 text-subtle"><p role="alert"> </p></div>'),Wo=x('<div class="flex h-full items-center justify-center text-subtle"><p> </p></div>'),Er=x('<div class="flex items-center justify-center h-full text-subtle"><p> </p></div>'),No=x('<div class="flex items-center gap-3"><!> <!></div>'),Ho=x('<div class="flex flex-col h-full"><div class="flex-1 p-4 space-y-2"></div></div>'),Bo=x('<p class="text-xs"> </p>'),Oo=x("<li><!></li>"),qo=x('<p class="text-xs mt-2"> </p> <ul class="flex flex-col items-center gap-1"></ul>',1),Ko=x('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p class="text-danger" role="alert"> </p> <p class="text-xs font-mono"> </p> <!> <!></div>'),Xo=x('<div class="flex flex-col items-center justify-center h-full text-subtle gap-3 p-4"><p> </p> <p class="text-xs break-all"> </p> <!></div>'),Yo=x('<div class="h-full overflow-auto p-4"><!></div>'),Jo=x("<div><!></div>"),Zo=x('<iframe sandbox="" referrerpolicy="no-referrer"></iframe>'),Go=x('<div class="absolute inset-0 flex items-center justify-center text-subtle" role="status"> </div>'),Qo=x('<div class="relative size-full"><!> <!> <!></div>');function ei(A,_){if(new.target)return Xt({component:ei,...A});Zt(_,!0);const re=()=>ge(tr,"$workspace",W),He=()=>ge(D,"$fileContentStore",W),ee=()=>ge(fe,"$fileLoadingStore",W),P=()=>ge(Z,"$fileSavingStore",W),O=()=>ge(ne,"$fileErrorStore",W),ae=()=>ge(ft,"$fileErrorInfoStore",W),Ee=()=>ge(vt,"$homeView$",W),ye=()=>ge(pt,"$fileNotFoundCandidatesStore",W),be=()=>ge(bt,"$isFileBinaryStore",W),oe=()=>ge(me,"$isFileDirtyStore",W),et=()=>ge(Me,"$fileLastUpdatedStore",W),U=()=>ge(tt,"$ftChanges$",W),H=()=>ge(er,"$gutterRead$",W),pe=()=>ge(Ke,"$lineWrapping",W),xe=()=>ge(ue,"$diffIndicators",W),Le=()=>ge(Qt,"$rootMediaPreview",W),[W,ke]=pr(),Ce=(r,n=sa)=>{var b=Or,S=qr;{let le=i(()=>xe()?e(rt):[]),$e=i(()=>n()&&v());Rr(fr(r,{get value(){return b()},set value(G){S(G)},get language(){return e(or)},get readOnly(){return e(y)},get fileName(){return a().filePath},get workspaceId(){return l()},get filePath(){return a().filePath},get lineWrapping(){return pe()},get lineChanges(){return e(le)},get jumpTo(){return e($t)},get externalContentVersion(){return e(Pe)},get isPanelFocused(){return e($e)}}),G=>c(Ye,G,!0),()=>e(Ye))}},qe=r=>{var n=Vo(),b=ve(n);{var S=G=>{var Be=Ue(),Ze=ve(Be);Nt(Ze,()=>Ht,(nt,Tt)=>{Tt(nt,{get icon(){return Ha},get label(){return e(Ae)},disabled:!0})}),s(G,Be)};Y(b,G=>{!e(It)&&!e(y)&&!e(L)&&G(S)})}var le=g(b,2);{var $e=G=>{{let Be=i(()=>e(_t)?d.ui_viewSettings_htmlPreview_label():void 0),Ze=i(()=>!e(We)),nt=i(()=>!e(y)&&!e(We));eo(G,{embedded:!0,showFold:!1,showSplit:!1,get showPreview(){return e(wr)},get previewLabel(){return e(Be)},get previewEnabled(){return e(Fe)},onTogglePreview:()=>c(Fe,!e(Fe)),get showWrap(){return e(Ze)},get wrapEnabled(){return pe()},onToggleWrap:()=>R.dispatch(_a()),get showDiff(){return e(nt)},get diffEnabled(){return xe()},onToggleDiff:()=>R.dispatch(ma())})}};Y(le,G=>{a().filePath&&!e(It)&&!e(L)&&G($e)})}s(r,n)},Ve=r=>{var n=Ue(),b=ve(n);{var S=le=>{var $e=zo(),G=ve($e);{var Be=Oe=>{var at=Ue(),ht=ve(at);{let Et=i(()=>d.layout_fileTab_goToChanges_tooltip());Nt(ht,()=>Ht,(Lt,Mt)=>{Mt(Lt,{get icon(){return Oa},get label(){return e(Et)},onclick:Jr})})}s(Oe,at)};Y(G,Oe=>{e(Br)&&Oe(Be)})}var Ze=g(G,2);{var nt=Oe=>{var at=Ue(),ht=ve(at);{let Et=i(()=>d.layout_fileTab_downloadFile_label()),Lt=i(()=>!e(Ct)||e(mt));Nt(ht,()=>Ht,(Mt,ir)=>{ir(Mt,{get icon(){return Ot},get label(){return e(Et)},onclick:At,get disabled(){return e(Lt)}})})}s(Oe,at)};Y(Ze,Oe=>{e(it)&&Oe(nt)})}var Tt=g(Ze,2);{let Oe=i(()=>d.layout_fileTab_deleteFile_tooltip());Nt(Tt,()=>Ht,(at,ht)=>{ht(at,{get icon(){return Ba},get label(){return e(Oe)},onclick:Zr,destructive:!0})})}s(le,$e)};Y(b,le=>{a().filePath&&!e(It)&&!e(y)&&le(S)})}s(r,n)},Ke=to(),ue=ro();let a=de(_,"tab",7),l=de(_,"workspaceId",7),q=de(_,"isActive",7),v=de(_,"isPanelFocused",7);se(()=>{const r=l();if(!(!q()||!r||e(f)))return R.dispatch(ua(r,"files")),()=>R.dispatch(fa(r,"files"))});const f=i(()=>typeof a().data?.gitRootId=="string"?a().data.gitRootId:void 0),ie=i(()=>typeof a().data?.gitRootPath=="string"?a().data.gitRootPath:void 0),y=i(()=>!!e(f)),J=i(()=>a().filePath?ja(a().filePath,e(f)):a().filePath),N=na(e(J));se(()=>{N.set(e(J))});const D=ka(l(),N),fe=$a(l(),N),Z=Ia(l(),N),ne=Sa(l(),N),ft=Ca(l(),N),vt=co(l()),pt=Fa(l(),N),bt=Da(l(),N),me=Sr(l(),N),Me=Ta(l(),N),tt=Ea(l()),_e=ya(),Re=crypto.randomUUID(),Qt=Ar(Re),kt=`file-gutter:${crypto.randomUUID()}`,er=La(l(),kt),tr=Ma(l()),Xe=i(()=>re()?.worktreePath||re()?.repositoryPath||re()?.path||null),ze=i(He),rr=io();se(()=>{e(ze)!==null&&e(ze)!==void 0&&rr?.markContentLoaded()});const t=i(ee),o=i(P),u=i(O),w=i(()=>e(u)?jo(e(u)):"generic"),k=i(()=>e(u)?lo(ae()):null);let E=j(0),V=!1;se(()=>{const r=Ee();if(!r||r.unavailable){V=!1;return}e(k)&&!V&&(V=!0,ur(()=>Bt(E)))});const T=5,K=i(()=>(ye()??[]).slice(0,T)),L=i(be),he=i(oe),Pe=i(et),Ae=i(()=>e(o)?d.ui_saveIndicator_saving_tooltip():e(he)?d.ui_saveIndicator_autoSaving_tooltip():d.ui_saveIndicator_saved_tooltip());let Ye=j(null),rt=j(la([])),Je=j(null),$t=j(void 0),Vt=j(void 0),Fe=j(!0),gr=j(null);se(()=>{const r=a().data?.line,n=a().data?.jumpTimestamp;!r||n!==void 0&&n===e(Vt)||(c(Vt,n,!0),c($t,{line:r},!0),c(Fe,!1))});const gt=i(()=>e(f)?Cr(a().filePath,e(ie)):null),It=i(()=>e(f)?!e(gt):!!(a().filePath&&(Ja(a().filePath)||e(Xe)&&Za(a().filePath,e(Xe))))),St=i(()=>a().filePath&&e(Xe)?dr(a().filePath)?a().filePath:`${e(Xe)}/${a().filePath}`:null),xt=i(()=>!!a().filePath&&/\.pdf$/i.test(a().filePath)),Pt=i(()=>!!a().filePath&&/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(a().filePath)),it=i(()=>l()&&/^[A-Za-z0-9._-]+$/.test(l())?Cr(a().filePath,e(Xe)):null),Nr=i(()=>!e(f)&&e(it)?e(it).split("/").slice(0,-1).join("/"):void 0),ar=i(()=>e(xt)||e(Pt)?e(it):null),mr=i(()=>e(f)&&e(Pt)?{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",mp4:"video/mp4",webm:"video/webm"}[a().filePath?.split(".").pop()?.toLowerCase()??""]:void 0);se(()=>{if(!q()||!e(f)||!e(gt)||!e(mr))return;const r=crypto.randomUUID();return R.dispatch(Ur(Re,r,l(),e(gt),{gitRootId:e(f),mimeType:e(mr)})),()=>R.dispatch(Vr(Re,r))});let mt=j(!1);const Ct=i(()=>!!e(it)&&!e(t)&&(!e(Pt)||e(Je)===e(it))),_r=i(()=>e(Je)&&l()?`workspace-file://${l()}/${e(Je).split("/").map(encodeURIComponent).join("/")}`:null),or=i(()=>a().filePath?ga(a().filePath):"plaintext"),hr=i(()=>e(or)==="markdown"),_t=i(()=>/\.html?$/i.test(a().filePath??""));let Ft=j(void 0);const zt=i(()=>e(Ft)?.source===e(ze)),wr=i(()=>e(hr)||e(_t)&&!(e(zt)&&e(Ft)?.document===null)),We=i(()=>e(wr)&&e(Fe));se(()=>{if(!q()||!e(_t)||!e(We)||e(L)||e(u))return;const r=e(ze);if(!(r===null||e(zt)))return fo(r,n=>{c(Ft,{source:r,document:n}),n===null&&c(Fe,!1)})}),se(()=>{e(_t)&&!e(We)&&a().filePath&&c(gr,a().filePath,!0)}),se(()=>{if(!e(_t)||!e(We)||!q()||!v())return;function r(n){const b=n.detail?.line;b&&(c($t,{line:b},!0),c(Fe,!1))}return window.addEventListener("workspace:go-to-line",r),()=>window.removeEventListener("workspace:go-to-line",r)}),se(()=>{if(!q()||e(xt)||e(f))return;const r=e(ar),n=a().filePath,b=l(),S=a().id;if(c(Je,null),!r||!n||!b)return;let le=!1;const $e=()=>!le&&l()===b&&a().id===S&&a().filePath===n;return(async()=>{let G=!1;try{G=(await Ua("file.stat",{workspaceId:b,path:r}))?.isFile===!0}catch{}if(!$e())return;if(G){c(Je,r,!0);return}if(!/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(r)){c(Je,r,!0);return}const{candidates:Be,truncated:Ze}=await Ya(b,r);if($e()){if(!Ze&&Be.length===1){R.dispatch(yr(b,n,Be[0],S));return}c(Je,r,!0)}})(),()=>{le=!0}});function Hr(r,n){return!!(r.file===n||r.relativePath===n||r.relativePath&&n.endsWith("/"+r.relativePath)||r.file&&n.endsWith("/"+r.file)||r.relativePath&&r.relativePath.endsWith("/"+n)||r.file&&r.file.endsWith("/"+n))}const Dt=i(()=>e(y)||!a().filePath?null:U().find(r=>Hr(r,a().filePath))??null),Br=i(()=>!!e(Dt));se(()=>{if(e(y))return;const r=l(),n=a().filePath,b=e(Xe);return()=>{if(!r||!n)return;const S=lr.select(R.state,r,n);if(S?.kind!=="editable-text")return;const le=nr(S.localContent),$e=Sr.select(R.state,r,n),G=dr(n)?n:b?`${b}/${n}`:null;$e&&G&&R.dispatch(kr(r,n,G,le))}}),se(()=>{const r=a().filePath,n=e(St),b=l();if(e(E),!q())return;const S=!e(f)&&!!r&&dr(r)&&!e(Xe);r&&b&&!e(It)&&!e(Pt)&&!e(xt)&&!S&&(e(f)&&e(gt)&&e(J)?R.dispatch($r(b,e(J),n??r,{gitRoot:{id:e(f),relativePath:e(gt)}})):R.dispatch($r(b,r,n??r)))});function Or(){return e(ze)??""}function qr(r){e(y)||e(L)||!a().filePath||!l()||!e(St)||R.dispatch(Pa(l(),a().filePath,nr(r)))}function Kr(){if(e(y)||e(L)||!a().filePath||!e(St)||e(ze)===null||e(o))return;const r=lr.select(R.state,l(),a().filePath);r?.kind==="editable-text"&&R.dispatch(kr(l(),a().filePath,e(St),nr(r.localContent)))}function Xr(r){const n=a().filePath;!n||!l()||(R.dispatch(xa(l(),n)),R.dispatch(yr(l(),n,r,a().id)))}se(()=>{const r=a().filePath,n=e(Dt);if(!r||!n){c(rt,[],!0);return}if(!q())return;const b=l(),S=crypto.randomUUID();return R.dispatch(va(b,kt,S,{kind:"diffs",path:r,staged:n.stage==="staged"})),()=>{R.dispatch(pa(b,kt,S))}}),se(()=>{const r=H(),n=r?.result?.kind==="diffs"?r.result.chunks:[],b=n.find(S=>S.file===a().filePath)??n[0];c(rt,b?Ga(b.chunks.map(S=>({oldStart:S.oldStart,oldLines:S.oldLines,newStart:S.newStart,newLines:S.newLines,lines:S.lines.map(le=>(le.type===Ir.Addition?"+":le.type===Ir.Deletion?"-":" ")+le.content)}))):[],!0)});function Yr(r){const n=/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),b=$e=>oo(r,ao($e),n);if(b("editor.save")){r.preventDefault(),e(he)&&!e(o)&&Kr();return}const S=b("editor.undo")?"undo":b("editor.redo")?"redo":b("editor.toggle-task-list")?"toggle-task-list":b("editor.copy")?"copy":b("editor.select-all")?"select-all":null;if(!S||e(y)&&S!=="copy"&&S!=="select-all")return;S!=="toggle-task-list"&&e(Ye)?.runShortcut(S)&&r.preventDefault()}function Jr(r){if(!a().filePath||!e(Dt))return;const n=r?.metaKey||r?.ctrlKey||!1,S=r?.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0;R.dispatch(ba(l(),e(Dt),{filePath:a().filePath,changeId:e(Dt).id,openInAdjacentPanel:n,sourcePanelId:S}))}async function At(){const r=e(it);if(!(e(y)||!r||!l()||!e(Ct)||e(mt))){c(mt,!0);try{const n=await Ra(l(),r,e(Xe));!n?.success&&!n?.canceled&&sr.error(n?.error?.message||d.layout_fileTab_downloadFailed_error())}catch{sr.error(d.layout_fileTab_downloadFailed_error())}finally{c(mt,!1)}}}function Zr(){const r=e(St);if(e(y)||!a().filePath||!l()||!r)return;const n=ha(lr.select(R.state,l(),a().filePath));if(!n){sr.error(d.ui_reversibleActions_failed_error({message:d.fileExplorer_tree_undoUnavailable_error()}));return}R.dispatch(wa(l(),a().filePath,{absolutePath:r,tabId:a().id,snapshot:n}))}se(()=>{if(!_e||!q())return;const r={isDirty:!e(y)&&e(he),isSaving:!e(y)&&e(o)};ur(()=>{_e.registerActions({display:qe,actions:Ve}),_e.registerState(r)})});var Gr={get tab(){return a()},set tab(r){a(r),ce()},get workspaceId(){return l()},set workspaceId(r){l(r),ce()},get isActive(){return q()},set isActive(r){q(r),ce()},get isPanelFocused(){return v()},set isPanelFocused(r){v(r),ce()},$set:Yt,$on:(r,n)=>Jt(_,r,n)},br=Ue();ut("keydown",Lr,r=>q()&&Yr(r));var Qr=ve(br);{var ea=r=>{var n=Ue(),b=ve(n);Mr(b,()=>a().filePath,S=>{var le=Ue(),$e=ve(le);{var G=h=>{var p=Ao(),M=F(p),X=C(M,!0),z=g(M,2),je=C(z,!0);$(p),I(te=>{m(X,te),m(je,a().filePath)},[()=>d.layout_fileTab_outsideWorkspace_label()]),s(h,p)},Be=h=>{var p=Ue(),M=ve(p);{var X=z=>{vr(z,{get workspaceId(){return l()},get filePath(){return e(gt)},get gitRootId(){return e(f)}})};Y(M,z=>{q()&&z(X)})}s(h,p)},Ze=h=>{var p=Ue(),M=ve(p);{var X=te=>{var Ie=Tr(),B=F(Ie),we=C(B,!0);$(Ie),I(Q=>m(we,Q),[()=>d.layout_fileTab_errorLoading_label()]),s(te,Ie)},z=te=>{qt(te,{get filePath(){return a().filePath},get sourceUrl(){return Le().url},allowDownload:!1})},je=te=>{var Ie=Wo(),B=F(Ie),we=C(B,!0);$(Ie),I(Q=>m(we,Q),[()=>d.layout_fileTab_preparing_label()]),s(te,Ie)};Y(M,te=>{Le()?.error?te(X):Le()?.url?te(z,1):te(je,-1)})}s(h,p)},nt=h=>{var p=Ue(),M=ve(p);{var X=z=>{vr(z,{get workspaceId(){return l()},get filePath(){return e(ar)}})};Y(M,z=>{q()&&z(X)})}s(h,p)},Tt=h=>{var p=Tr(),M=F(p),X=C(M,!0);$(p),I(z=>m(X,z),[()=>d.file_pdf_load_error()]),s(h,p)},Oe=h=>{{let p=i(()=>e(Je)??a().filePath),M=i(()=>!e(y)&&e(Ct));qt(h,{get filePath(){return e(p)},get sourceUrl(){return e(_r)},onDownload:At,get allowDownload(){return e(M)},get downloading(){return e(mt)}})}},at=h=>{var p=Er(),M=F(p),X=C(M,!0);$(p),I(z=>m(X,z),[()=>d.layout_fileTab_preparing_label()]),s(h,p)},ht=h=>{var p=Ho(),M=F(p);Ut(M,20,()=>[...Array(20).keys()],X=>X,(X,z)=>{var je=No(),te=F(je);Fr(te,{class:"h-3 w-8 shrink-0"});var Ie=g(te,2);Fr(Ie,{class:"h-3",style:`width: ${30+Math.random()*60}%`}),$(je),s(X,je)}),$(M),$(p),s(h,p)},Et=h=>{{let p=i(()=>so(e(k)));no(h,{get view(){return e(p)}})}},Lt=h=>{var p=Ko(),M=F(p),X=C(M,!0),z=g(M,2),je=C(z,!0),te=g(z,2);{var Ie=Q=>{var lt=Bo(),Ge=C(lt,!0);I(()=>m(Ge,e(u))),s(Q,lt)};Y(te,Q=>{e(w)==="generic"&&Q(Ie)})}var B=g(te,2);{var we=Q=>{var lt=qo(),Ge=ve(lt),Rt=C(Ge,!0),Wt=g(Ge,2);Ut(Wt,20,()=>e(K),wt=>wt,(wt,De)=>{var Se=Oo(),Ne=F(Se);Te(Ne,{variant:"link",size:"compact",class:"h-auto p-0 font-mono text-xs",onclick:()=>Xr(De),children:(st,xr)=>{ot();var Pr=ct();I(()=>m(Pr,De)),s(st,Pr)},$$slots:{default:!0}}),$(Se),s(wt,Se)}),$(Wt),I(wt=>m(Rt,wt),[()=>d.layout_fileTab_didYouMean_label()]),s(Q,lt)};Y(B,Q=>{e(K).length>0&&Q(we)})}$(p),I(Q=>{m(X,Q),m(je,a().filePath)},[()=>Uo(e(w))]),s(h,p)},Mt=h=>{var p=Xo(),M=F(p),X=C(M,!0),z=g(M,2),je=C(z,!0),te=g(z,2);{var Ie=B=>{{let we=i(()=>!e(Ct)||e(mt));Te(B,{variant:"secondary",size:"sm",onclick:At,get disabled(){return e(we)},children:(Q,lt)=>{ot();var Ge=ct();I(Rt=>m(Ge,Rt),[()=>d.layout_fileTab_downloadFile_label()]),s(Q,Ge)},$$slots:{default:!0}})}};Y(te,B=>{!e(y)&&e(it)&&B(Ie)})}$(p),I(B=>{m(X,B),m(je,a().filePath)},[()=>d.editor_fileViewer_binary_label()]),s(h,p)},ir=h=>{const p=i(()=>a().filePath?.toLowerCase().endsWith(".svg"));var M=Ue(),X=ve(M);{var z=B=>{{let we=i(()=>a().filePath||""),Q=i(()=>!e(y)&&e(Ct));qt(B,{get filePath(){return e(we)},get fileContent(){return e(ze)},get language(){return e(or)},get isBinary(){return e(L)},onDownload:At,get allowDownload(){return e(Q)},get downloading(){return e(mt)}})}},je=B=>{var we=Yo(),Q=F(we);Qa(Q,{get content(){return e(ze)},get workspaceId(){return l()},get relativeMediaBase(){return e(Nr)},renderRichFencesAsCode:!0,renderDiagrams:!0}),$(we),s(B,we)},te=B=>{var we=Qo(),Q=F(we);{var lt=De=>{var Se=Jo();let Ne;var st=F(Se);Ce(st,()=>!e(We)),$(Se),I(()=>{Ne=Kt(Se,1,"size-full",null,Ne,{invisible:e(We)}),Se.inert=e(We)}),s(De,Se)};Y(Q,De=>{(!e(We)||e(gr)===a().filePath)&&De(lt)})}var Ge=g(Q,2);{var Rt=De=>{const Se=i(()=>e(We)&&e(zt));var Ne=Zo();let st;I(xr=>{Qe(Ne,"title",xr),Qe(Ne,"srcdoc",e(Ft).document),st=Kt(Ne,1,"absolute inset-0 block size-full border-0 bg-background",null,st,{invisible:!e(Se)}),Ne.inert=!e(Se)},[()=>d.ui_viewSettings_htmlPreview_label()]),s(De,Ne)};Y(Ge,De=>{e(Ft)?.document!=null&&De(Rt)})}var Wt=g(Ge,2);{var wt=De=>{var Se=Go(),Ne=C(Se,!0);I(st=>m(Ne,st),[()=>d.layout_fileTab_preparing_label()]),s(De,Se)};Y(Wt,De=>{e(We)&&!e(zt)&&De(wt)})}$(we),s(B,we)},Ie=B=>{Ce(B,()=>!0)};Y(X,B=>{e(p)?B(z):e(hr)&&e(We)?B(je,1):e(_t)?B(te,2):B(Ie,-1)})}s(h,M)},ra=h=>{var p=Er(),M=F(p),X=C(M,!0);$(p),I(z=>m(X,z),[()=>d.layout_fileTab_preparing_label()]),s(h,p)};Y($e,h=>{e(It)?h(G):e(f)&&e(xt)&&e(gt)?h(Be,1):e(f)&&e(Pt)?h(Ze,2):e(xt)&&e(ar)?h(nt,3):e(xt)?h(Tt,4):e(_r)?h(Oe,5):e(Pt)?h(at,6):e(t)&&(!e(_t)||e(ze)===null)?h(ht,7):e(k)?h(Et,8):e(u)?h(Lt,9):e(L)?h(Mt,10):e(ze)!==null?h(ir,11):h(ra,-1)})}s(S,le)}),s(r,n)};Y(Qr,r=>{a().filePath&&r(ea)})}s(A,br);var ta=Gt(Gr);return ke(),ta}export{ei as default};
|