@intent-hq/web 2.389.0 → 2.389.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/web/app/immutable/chunks/{DRbQVjcG.js → -MOfUnWK.js} +1 -1
- package/web/app/immutable/chunks/{Bauem7Ke.js → -iNNNnZP.js} +1 -1
- package/web/app/immutable/chunks/{qtHim0jP.js → 1biRkLeO.js} +1 -1
- package/web/app/immutable/chunks/{iIsyEXfi.js → 2TDNGwi2.js} +1 -1
- package/web/app/immutable/chunks/{B-r8Ld9c.js → 56loFVfQ.js} +1 -1
- package/web/app/immutable/chunks/{B91tdOJm.js → B-tK7hOH.js} +1 -1
- package/web/app/immutable/chunks/{k1pjOtcg.js → B2_6AX8w.js} +2 -2
- package/web/app/immutable/chunks/{HYdiaHV7.js → B3FnJcLx.js} +1 -1
- package/web/app/immutable/chunks/{hgE6oWwa.js → B7-Rf8Ja.js} +1 -1
- package/web/app/immutable/chunks/{T7iqVsMb.js → B7zssCpp.js} +1 -1
- package/web/app/immutable/chunks/{BdNfyyl1.js → B8rKVMLL.js} +1 -1
- package/web/app/immutable/chunks/{C9szebIt.js → BNu0Ucwh.js} +1 -1
- package/web/app/immutable/chunks/{2sf1Yn-s.js → BOyjfrDv.js} +1 -1
- package/web/app/immutable/chunks/{CeWx_dfN.js → BPcs9j0t.js} +1 -1
- package/web/app/immutable/chunks/{BwVhyX7o.js → BPmcj0VV.js} +1 -1
- package/web/app/immutable/chunks/{CgzHyieN.js → BRKRnHX6.js} +1 -1
- package/web/app/immutable/chunks/{0AIorxUa.js → BSXmccL1.js} +7 -7
- package/web/app/immutable/chunks/{Cp1B7D7t.js → BUo-3nO7.js} +1 -1
- package/web/app/immutable/chunks/{DVsXJTH5.js → B_EaOuZ7.js} +1 -1
- package/web/app/immutable/chunks/{s6Wn05Cg.js → B_QbDMuF.js} +1 -1
- package/web/app/immutable/chunks/{qWMP3EPi.js → BaH6sH1s.js} +1 -1
- package/web/app/immutable/chunks/{B4JMAhvp.js → Bb98JhKr.js} +1 -1
- package/web/app/immutable/chunks/{xXDRZ4UR.js → BbrUifYV.js} +1 -1
- package/web/app/immutable/chunks/{Di3tMG_J.js → Bc1CpNLz.js} +1 -1
- package/web/app/immutable/chunks/{dEPZ-XrU.js → BdrLG-E0.js} +1 -1
- package/web/app/immutable/chunks/{CXfRSojK.js → BfnPC1r8.js} +1 -1
- package/web/app/immutable/chunks/{BoCCPZlL.js → BiZ5HCfj.js} +1 -1
- package/web/app/immutable/chunks/{Bmlx0yvl.js → BjDM3rxu.js} +2 -2
- package/web/app/immutable/chunks/{D3shmp0V.js → BjVkuF0t.js} +1 -1
- package/web/app/immutable/chunks/{5J_xNo3h.js → BkqNdsh1.js} +2 -2
- package/web/app/immutable/chunks/{DM3Yrkkb.js → BouO3S3L.js} +1 -1
- package/web/app/immutable/chunks/{CUE71p7a.js → BqCpnQY_.js} +1 -1
- package/web/app/immutable/chunks/{C4UYdkwZ.js → BqXtiIKZ.js} +1 -1
- package/web/app/immutable/chunks/{Be-9sO50.js → BvDFX1mj.js} +1 -1
- package/web/app/immutable/chunks/{DN-c0DDt.js → BvZOajsk.js} +1 -1
- package/web/app/immutable/chunks/{BIVpRSxo.js → C1_cc_jh.js} +2 -2
- package/web/app/immutable/chunks/{D3vsaFn3.js → C4wGdw9l.js} +1 -1
- package/web/app/immutable/chunks/{CmBouCgt.js → C5YfJpVq.js} +2 -2
- package/web/app/immutable/chunks/{BhVbCtBE.js → C9Sx9tb_.js} +1 -1
- package/web/app/immutable/chunks/{D-q3diCz.js → CG1puMxA.js} +1 -1
- package/web/app/immutable/chunks/{fCCFSMRf.js → CHaC_gXH.js} +3 -3
- package/web/app/immutable/chunks/{CRPk37P7.js → CJ7X12Bw.js} +1 -1
- package/web/app/immutable/chunks/{vJJhwCPu.js → CKxZ8tlS.js} +1 -1
- package/web/app/immutable/chunks/{BQGIKN0g.js → CQlYR8ss.js} +1 -1
- package/web/app/immutable/chunks/{DBwApbzS.js → CTFqJlwB.js} +1 -1
- package/web/app/immutable/chunks/{BdQ54KL0.js → CTflyKHO.js} +1 -1
- package/web/app/immutable/chunks/{DZKOpbCv.js → CUeJC-BW.js} +1 -1
- package/web/app/immutable/chunks/{B-I8ZlVM.js → CUsiQpqx.js} +1 -1
- package/web/app/immutable/chunks/{mq9vi3Up.js → CVtmf86l.js} +3 -3
- package/web/app/immutable/chunks/{D63urNNT.js → CY1uQ_EK.js} +1 -1
- package/web/app/immutable/chunks/{Z2wqUYyr.js → CbGsjkOn.js} +2 -2
- package/web/app/immutable/chunks/{D17rwSNZ.js → CbwlFeZe.js} +1 -1
- package/web/app/immutable/chunks/{KvHDUk_b.js → CcDyBqhb.js} +2 -2
- package/web/app/immutable/chunks/{nfiajAfR.js → CeaP52uL.js} +1 -1
- package/web/app/immutable/chunks/{4VEtxogG.js → Cekr5Jry.js} +1 -1
- package/web/app/immutable/chunks/{85NDZF0c.js → Ch6a7ELM.js} +1 -1
- package/web/app/immutable/chunks/{BwCICkMn.js → ChXsVZci.js} +1 -1
- package/web/app/immutable/chunks/{Dsyh_lG5.js → Cj89j1C-.js} +1 -1
- package/web/app/immutable/chunks/{86aXQThN.js → ClbQbaTd.js} +1 -1
- package/web/app/immutable/chunks/{oBc79yRV.js → CmR2cnYT.js} +1 -1
- package/web/app/immutable/chunks/{BT5v4htV.js → CnNk48uP.js} +1 -1
- package/web/app/immutable/chunks/{D5dii3q-.js → CoGKQKFb.js} +1 -1
- package/web/app/immutable/chunks/{CS9nZ0mb.js → CpQ2QLnc.js} +1 -1
- package/web/app/immutable/chunks/{BR02ohTI.js → Cs6KI4dy.js} +1 -1
- package/web/app/immutable/chunks/{DtluaQEg.js → Cu11OjbU.js} +4 -4
- package/web/app/immutable/chunks/{D8EdnE4r.js → CyDuWtxr.js} +1 -1
- package/web/app/immutable/chunks/{R69_F6ow.js → D-19S-7Z.js} +1 -1
- package/web/app/immutable/chunks/{BNSbhHFY.js → D1CvgUga.js} +1 -1
- package/web/app/immutable/chunks/{DZz-0U7K.js → D3R31YXQ.js} +1 -1
- package/web/app/immutable/chunks/{Dl8k4QUp.js → D5WcE_P_.js} +1 -1
- package/web/app/immutable/chunks/{Z4vtXCdu.js → D6m95MWL.js} +1 -1
- package/web/app/immutable/chunks/{DDVnHnMH.js → D78ptBES.js} +3 -3
- package/web/app/immutable/chunks/{CdfbvT19.js → D915og2m.js} +1 -1
- package/web/app/immutable/chunks/{wX0L7qir.js → DA_7jaWc.js} +3 -3
- package/web/app/immutable/chunks/{CheN8m7G.js → DAoh5LIP.js} +1 -1
- package/web/app/immutable/chunks/{BWFaOHKx.js → DAwK7LKd.js} +1 -1
- package/web/app/immutable/chunks/{B6CGcXmK.js → DIvSo5Nm.js} +1 -1
- package/web/app/immutable/chunks/{DUJ7Uicl.js → DJ_B6Tb0.js} +1 -1
- package/web/app/immutable/chunks/{CIuThArl.js → DLnFsCgA.js} +3 -3
- package/web/app/immutable/chunks/{CFjHgtjF.js → DMomDPVD.js} +4 -4
- package/web/app/immutable/chunks/{DHz7ym-I.js → DNnyE4a4.js} +1 -1
- package/web/app/immutable/chunks/{DrF6vLLb.js → DPhH7vBg.js} +1 -1
- package/web/app/immutable/chunks/{CJ9ZGIU3.js → DQVuWRan.js} +1 -1
- package/web/app/immutable/chunks/{T6fchQhT.js → DRD4T4u0.js} +2 -2
- package/web/app/immutable/chunks/{C3vs7E1W.js → DSjchUEk.js} +1 -1
- package/web/app/immutable/chunks/{Cy--ZUaj.js → DWt5yjbU.js} +2 -2
- package/web/app/immutable/chunks/{Bm_geQt1.js → DXY_Cr2S.js} +1 -1
- package/web/app/immutable/chunks/{C8A41C8K.js → DYcuijJl.js} +1 -1
- package/web/app/immutable/chunks/{uftNwUIw.js → DZiUi6tE.js} +1 -1
- package/web/app/immutable/chunks/{gsePksRf.js → DaQPP3_d.js} +1 -1
- package/web/app/immutable/chunks/{DCFeaWgZ.js → Db4jRBl0.js} +1 -1
- package/web/app/immutable/chunks/{CkTunFkP.js → Dgc0jIMe.js} +1 -1
- package/web/app/immutable/chunks/{D2McplNW.js → DiBpIS7p.js} +1 -1
- package/web/app/immutable/chunks/{Ba3e0br1.js → DjbX62Cx.js} +1 -1
- package/web/app/immutable/chunks/{ublLekYt.js → DlWizs9I.js} +1 -1
- package/web/app/immutable/chunks/{Nthsb-68.js → Dm9VEl_l.js} +1 -1
- package/web/app/immutable/chunks/{CeZGOup4.js → DnhCnCMz.js} +1 -1
- package/web/app/immutable/chunks/{CM3NPzxs.js → Dz-zX_Ts.js} +1 -1
- package/web/app/immutable/chunks/{x0vz7jUI.js → EAuFbzCr.js} +1 -1
- package/web/app/immutable/chunks/{zA4TFq_E.js → IvX_QTkj.js} +1 -1
- package/web/app/immutable/chunks/{ByZRLPfm.js → J2YvrN12.js} +3 -3
- package/web/app/immutable/chunks/{g-pOypvE.js → JZ-O0OQl.js} +1 -1
- package/web/app/immutable/chunks/{BE4rQlti.js → MzHad0-m.js} +1 -1
- package/web/app/immutable/chunks/{DqRvDwkX.js → OIB4u9ZA.js} +1 -1
- package/web/app/immutable/chunks/{CB2iSm6U.js → OtJAfUmG.js} +1 -1
- package/web/app/immutable/chunks/{oEGQGYxq.js → PX_tznAF.js} +1 -1
- package/web/app/immutable/chunks/{Ci0dPfzv.js → RWuDgH63.js} +1 -1
- package/web/app/immutable/chunks/{BF_gPEg7.js → Rtit513z.js} +1 -1
- package/web/app/immutable/chunks/{BlTdGk3A.js → UZYqZZXR.js} +1 -1
- package/web/app/immutable/chunks/{BkYN9M7z.js → UsyUyHOM.js} +1 -1
- package/web/app/immutable/chunks/{C4sNRwZN.js → X6hYTxgn.js} +1 -1
- package/web/app/immutable/chunks/{DIPIWs2Q.js → cTFeOFQC.js} +4 -4
- package/web/app/immutable/chunks/{CzFnnQhI.js → cmil589m.js} +1 -1
- package/web/app/immutable/chunks/{JrdZaYjT.js → fKOcHw3K.js} +1 -1
- package/web/app/immutable/chunks/{C4JKtRY1.js → iTNhB2TC.js} +1 -1
- package/web/app/immutable/chunks/{sQSEv8Vy.js → j5mPVG9_.js} +1 -1
- package/web/app/immutable/chunks/{BVXrO_xP.js → kzuAnGps.js} +1 -1
- package/web/app/immutable/chunks/{2mfr9mCI.js → lei6Hlse.js} +1 -1
- package/web/app/immutable/chunks/{Cmw8ZiCg.js → lskgWJFV.js} +1 -1
- package/web/app/immutable/chunks/{CrK7N1sc.js → lzi3tV-r.js} +1 -1
- package/web/app/immutable/chunks/{CqqkIXTJ.js → pe4pVEc5.js} +1 -1
- package/web/app/immutable/chunks/{Da5bNPjQ.js → r3TSpOm2.js} +1 -1
- package/web/app/immutable/chunks/{97-360Ms.js → rEuNpCjM.js} +1 -1
- package/web/app/immutable/chunks/{Beb33qQi.js → rdKijoRw.js} +1 -1
- package/web/app/immutable/chunks/{D36a16oA.js → sPwEr0L4.js} +2 -2
- package/web/app/immutable/chunks/{CndXvgyH.js → tqn1yslZ.js} +6 -6
- package/web/app/immutable/chunks/{DOmB999d.js → yqU168vt.js} +1 -1
- package/web/app/immutable/entry/{app.Beuvfwpq.js → app.CD-KpBFY.js} +2 -2
- package/web/app/immutable/entry/start.BtJunRGi.js +1 -0
- package/web/app/immutable/nodes/{0.cL5zt7Bt.js → 0.BTKBksQU.js} +1 -1
- package/web/app/immutable/nodes/{1.Dj9s42wq.js → 1.CDH50XYo.js} +1 -1
- package/web/app/immutable/nodes/{10.CQpwV39P.js → 10.BSK1ezgF.js} +1 -1
- package/web/app/immutable/nodes/{11.ryjds32c.js → 11.BkTyY8lh.js} +1 -1
- package/web/app/immutable/nodes/{15.ffzaVnT8.js → 15.CRngZgh2.js} +1 -1
- package/web/app/immutable/nodes/{19.COuvk-IK.js → 19.CI9f3oHV.js} +2 -2
- package/web/app/immutable/nodes/{2.CyeHTGza.js → 2.BPIXyW9K.js} +1 -1
- package/web/app/immutable/nodes/{3.Cli5S3q6.js → 3.CjIzds8z.js} +1 -1
- package/web/app/immutable/nodes/{4.DnwVlUKb.js → 4.BzXxqxag.js} +1 -1
- package/web/app/immutable/nodes/{5.BBLKg00X.js → 5.B54vgJ_P.js} +1 -1
- package/web/app/immutable/nodes/{6.D_zrx8Je.js → 6.plJT8OLe.js} +1 -1
- package/web/app/immutable/nodes/{7.CbiG1FxN.js → 7.DSDH5hqz.js} +1 -1
- package/web/app/immutable/nodes/{8.BqucsZP2.js → 8.B7U72PdE.js} +1 -1
- package/web/app/immutable/nodes/{9.YctElBWI.js → 9.BY44vZ0i.js} +2 -2
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/entry/start.dSf-uLxv.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as t,s as r}from"./
|
|
1
|
+
import{c as t,s as r}from"./BvZOajsk.js";import{b as a}from"./Cu11OjbU.js";var s=a(e=>`${r(e)}
|
|
2
2
|
.swimlane.cluster:not([data-color-id]) rect {
|
|
3
3
|
stroke: ${e.clusterBorder} !important;
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as i}from"./
|
|
1
|
+
import{b as i}from"./Cu11OjbU.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as ae}from"./
|
|
1
|
+
import{g as ae}from"./CUeJC-BW.js";import{s as ce}from"./C4wGdw9l.js";import{b as l,ay as C,a1 as le,aP as he,W as de,O as G,X as B,aV as F,a8 as ge,an as ue,au as pe,H as fe}from"./Cu11OjbU.js";var Y=(function(){var n=l(function(x,s,i,o){for(i=i||{},o=x.length;o--;i[x[o]]=s);return i},"o"),e=[1,4],a=[1,13],d=[1,12],t=[1,15],h=[1,16],u=[1,20],m=[1,19],E=[6,7,8],_=[1,26],D=[1,24],w=[1,25],g=[6,7,11],R=[1,6,13,15,16,19,22],q=[1,33],J=[1,34],A=[1,6,7,11,13,15,16,19,22],j={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:l(function(s,i,o,c,f,r,$){var p=r.length-1;switch(f){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[p].id),c.addNode(r[p-1].length,r[p].id,r[p].descr,r[p].type);break;case 16:c.getLogger().trace("Icon: ",r[p]),c.decorateNode({icon:r[p]});break;case 17:case 21:c.decorateNode({class:r[p]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[p].id),c.addNode(0,r[p].id,r[p].descr,r[p].type);break;case 20:c.decorateNode({icon:r[p]});break;case 25:c.getLogger().trace("node found ..",r[p-2]),this.$={id:r[p-1],descr:r[p-1],type:c.getType(r[p-2],r[p])};break;case 26:this.$={id:r[p],descr:r[p],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[p-3]),this.$={id:r[p-3],descr:r[p-1],type:c.getType(r[p-2],r[p])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:a,7:[1,10],9:9,12:11,13:d,14:14,15:t,16:h,17:17,18:18,19:u,22:m},n(E,[2,3]),{1:[2,2]},n(E,[2,4]),n(E,[2,5]),{1:[2,6],6:a,12:21,13:d,14:14,15:t,16:h,17:17,18:18,19:u,22:m},{6:a,9:22,12:11,13:d,14:14,15:t,16:h,17:17,18:18,19:u,22:m},{6:_,7:D,10:23,11:w},n(g,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:u,22:m}),n(g,[2,18]),n(g,[2,19]),n(g,[2,20]),n(g,[2,21]),n(g,[2,23]),n(g,[2,24]),n(g,[2,26],{19:[1,30]}),{20:[1,31]},{6:_,7:D,10:32,11:w},{1:[2,7],6:a,12:21,13:d,14:14,15:t,16:h,17:17,18:18,19:u,22:m},n(R,[2,14],{7:q,11:J}),n(A,[2,8]),n(A,[2,9]),n(A,[2,10]),n(g,[2,15]),n(g,[2,16]),n(g,[2,17]),{20:[1,35]},{21:[1,36]},n(R,[2,13],{7:q,11:J}),n(A,[2,11]),n(A,[2,12]),{21:[1,37]},n(g,[2,25]),n(g,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(s,i){if(i.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=i,o}},"parseError"),parse:l(function(s){var i=this,o=[0],c=[],f=[null],r=[],$=this.table,p="",M=0,K=0,ie=2,Q=1,se=r.slice.call(arguments,1),y=Object.create(this.lexer),v={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(v.yy[H]=this.yy[H]);y.setInput(s,v.yy),v.yy.lexer=y,v.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var W=y.yylloc;r.push(W);var re=y.options&&y.options.ranges;typeof v.yy.parseError=="function"?this.parseError=v.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function oe(b){o.length=o.length-2*b,f.length=f.length-b,r.length=r.length-b}l(oe,"popStack");function Z(){var b;return b=c.pop()||y.lex()||Q,typeof b!="number"&&(b instanceof Array&&(c=b,b=c.pop()),b=i.symbols_[b]||b),b}l(Z,"lex");for(var k,T,S,X,O={},U,N,ee,V;;){if(T=o[o.length-1],this.defaultActions[T]?S=this.defaultActions[T]:((k===null||typeof k>"u")&&(k=Z()),S=$[T]&&$[T][k]),typeof S>"u"||!S.length||!S[0]){var z="";V=[];for(U in $[T])this.terminals_[U]&&U>ie&&V.push("'"+this.terminals_[U]+"'");y.showPosition?z="Parse error on line "+(M+1)+`:
|
|
2
2
|
`+y.showPosition()+`
|
|
3
3
|
Expecting `+V.join(", ")+", got '"+(this.terminals_[k]||k)+"'":z="Parse error on line "+(M+1)+": Unexpected "+(k==Q?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(z,{text:y.match,token:this.terminals_[k]||k,line:y.yylineno,loc:W,expected:V})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+T+", token: "+k);switch(S[0]){case 1:o.push(k),f.push(y.yytext),r.push(y.yylloc),o.push(S[1]),k=null,K=y.yyleng,p=y.yytext,M=y.yylineno,W=y.yylloc;break;case 2:if(N=this.productions_[S[1]][1],O.$=f[f.length-N],O._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},re&&(O._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),X=this.performAction.apply(O,[p,K,M,v.yy,S[1],f,r].concat(se)),typeof X<"u")return X;N&&(o=o.slice(0,-1*N*2),f=f.slice(0,-1*N),r=r.slice(0,-1*N)),o.push(this.productions_[S[1]][0]),f.push(O.$),r.push(O._$),ee=$[o[o.length-2]][o[o.length-1]],o.push(ee);break;case 3:return!0}}return!0},"parse")},ne=(function(){var x={EOF:1,parseError:l(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw new Error(i)},"parseError"),setInput:l(function(s,i){return this.yy=i||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var i=s.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:l(function(s){var i=s.length,o=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===c.length?this.yylloc.first_column:0)+c[c.length-o.length].length-o[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(s){this.unput(this.match.slice(s))},"less"),pastInput:l(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var s=this.pastInput(),i=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as je,bo as v,bm as c,bw as Ze,b as Xe,br as lr,bs as bt,bq as Gr}from"./CLAmm_T1.js";import{bs as Je,ay as H,be as ht,b$ as ct,b_ as D,bO as J,W as C,bS as h,aD as e,a7 as ut,bl as ke,bn as Ye,c9 as f,aA as w,aB as re,ca as Ue,c0 as It,bH as d,a5 as ie,bA as se,bV as W,br as Rt,bk as qr,bj as Hr,bf as zo,bo as Kr,c5 as pt,aw as or,bz as Wo,cd as Jt}from"./3SdAC2_C.js";import{i as be}from"./BFgvMDua.js";import{c as Y}from"./BwH4Bvte.js";import{g as Pr,i as Go,e as Ct,I as qo}from"./B1CKzIA2.js";import{f as xt,s as Be,g as Ho}from"./CcJmuwXr.js";import{b as kt}from"./Dn334wJv.js";import{b as Er}from"./D7b2VLAz.js";import{k as Ko}from"./CIbfGsF-.js";import{c as Dt}from"./ChTqQfQN.js";import{a as jo}from"./CC7to1B5.js";import{f as Oe}from"./nxtepGjE.js";import{F as Zo}from"./TB9r2XJy.js";import{m as vt}from"./96V4v2iI.js";import{t as Xo}from"./BwNrQXlF.js";import{cp as jr,F as ye,aZ as Jo,ar as Yo,cK as Qo,aM as en,a_ as nr,a0 as dr,a2 as ur,b1 as Zr,bb as tn,a8 as rn,aw as on,aC as Xr,cT as nn,ci as Jr,bS as Yr,cn as an}from"./DPttSllj.js";import"./BbYWP3Ow.js";import{rV as sn,JH as Se,g0 as ln,bE as dn,Ac as un,zu as cn,LI as Fr,dV as fn,bY as gn,LH as vn,v1 as wn,LF as Sr,gI as pn,un as bn,LG as mn,Ll as Lr,LE as Rr}from"./B9vHutcJ.js";import"./DtzJzV-4.js";import{R as hn,g as Yt,h as mt,f as _n,e as Ke,l as Qr,d as eo,K as yn,i as xn,k as Cn,j as In,M as to,E as kn}from"./Dd-LQrG1.js";import{a as ro,B as $t}from"./B5aYN90J.js";import{bK as Pn}from"./BF_gPEg7.js";import{a5 as En,w as Fn,ah as Sn}from"./Bm_geQt1.js";import{m as Ln,z as Rn}from"./BPQFiQQc.js";import{I as Nt}from"./DaWmj23r.js";import{d as $n}from"./CQ409-Pj.js";import{H as Tn,I as Un}from"./Bqd7fdCF.js";import{a as An,e as Bn,h as On,g as Nn,k as Mn,p as Dn,b as oo}from"./D4WPlvMg.js";import{e as Vn}from"./CYxt6gzD.js";import{i as ar}from"./CL3a4Hm1.js";import{i as zn,a as Wn}from"./KZwZoyIt.js";import{B as Gn}from"./GnUYJfg_.js";import"./hkJYqn41.js";import{l as ze}from"./Cu5e4npY.js";import{M as no}from"./B6dUCFoz.js";import"./C4jSaPCg.js";import"./CEE0831H.js";import{b as qn}from"./CVWwz1Ss.js";import"./CgrVbtN0.js";import{t as Hn,b as Kn}from"./CXXVPWBH.js";import{T as jn}from"./DxyD9o0t.js";import{c as Zn,d as Xn}from"./BksTLNI4.js";import{o as $r,s as wt,n as Bt}from"./CIyUrgF0.js";import{g as Jn}from"./DWGXN6Nr.js";import{f as Yn}from"./CXfRSojK.js";import{ay as Qn,$ as ea}from"./ByZRLPfm.js";import{a_ as ta}from"./C2UL5Ler.js";import{i as ra}from"./DKwAaLwd.js";import{o as oa}from"./C3dytrTL.js";function na(o,t){return o.loadURL(t)}function aa(o){return{previousUrlProp:o||null}}function Tr(o,t){o.previousUrlProp=t}function ia(o,t,n){const g=n||t;return o.previousUrlProp===g?null:(o.previousUrlProp=g,g)}function sa(o,t,n){return t?o.previousUrlProp===null?(o.previousUrlProp=t,{shouldLoad:!1,targetUrl:null}):t===o.previousUrlProp?{shouldLoad:!1,targetUrl:null}:n.webviewReady?(o.previousUrlProp=t,n.isValidBrowserUrl(t)?{shouldLoad:!0,targetUrl:t}:{shouldLoad:!1,targetUrl:null}):{shouldLoad:!1,targetUrl:null}:{shouldLoad:!1,targetUrl:null}}const ao=Dt("TabBoundsReporter"),la=150;function Qt(o,t,n){!(t>0)||!(n>0)||window.electronAPI?.invoke("browser:report-tab-bounds",{tabId:o,width:t,height:n}).catch(g=>{ao.debug("Failed to report tab bounds",{tabId:o,error:g})})}function Ur(o){window.electronAPI?.invoke("browser:report-tab-bounds",{tabId:o}).catch(t=>{ao.debug("Failed to clear tab bounds",{tabId:o,error:t})})}function io(o,t){let n=t,g;const m=typeof ResizeObserver>"u"?void 0:new ResizeObserver(P=>{if(!n)return;const b=P[P.length-1]?.contentRect;if(!b)return;const F=n;clearTimeout(g),g=setTimeout(()=>{Qt(F,b.width,b.height)},la)});if(m?.observe(o),n){const P=o.getBoundingClientRect();Qt(n,P.width,P.height)}return{update(P){if(P!==n&&(clearTimeout(g),n&&Ur(n),n=P,n)){const b=o.getBoundingClientRect();Qt(n,b.width,b.height)}},destroy(){clearTimeout(g),m?.disconnect(),n&&Ur(n)}}}function so(o){let t=o.trim();if(!t)return null;/^[a-z][a-z0-9+.-]*:\/\//i.test(t)||(t=(t.includes("localhost")||t.includes("127.0.0.1")||t.includes("0.0.0.0")?"http://":"https://")+t);try{return new URL(t),t}catch{return null}}function dt(o,t=typeof window<"u"?window.location.origin:""){return o==="about:blank"||lo(o,t)}function lo(o,t=typeof window<"u"?window.location.origin:""){if(!o)return!1;try{const n=new URL(o);return ro.NAVIGATION_ALLOWED.includes(n.protocol)&&n.origin!==t}catch{return!1}}const Mt=[{id:"iphone-se",name:"iPhone SE",category:"phone",width:375,height:667},{id:"iphone-15",name:"iPhone 15",category:"phone",width:393,height:852},{id:"pixel-8",name:"Pixel 8",category:"phone",width:412,height:915},{id:"ipad-mini",name:"iPad Mini",category:"tablet",width:768,height:1024},{id:"ipad-pro-11",name:"iPad Pro 11″",category:"tablet",width:834,height:1194},{id:"desktop-1280x800",name:"1280 × 800",category:"desktop",width:1280,height:800},{id:"desktop-1440x900",name:"1440 × 900",category:"desktop",width:1440,height:900}];function da(o){return{...o,width:o.height,height:o.width}}var ua=re('<span class="min-w-0 flex-1 truncate"> </span> <span class="type-caption ml-3 text-muted-foreground"> </span>',1),er=re("<!> <!> <!>",1),ca=re('<span class="min-w-0 flex-1"> </span> <span class="type-caption text-muted-foreground"> </span>',1),tr=re("<!> <!>",1);function cr(o,t){if(new.target)return je({component:cr,...o});Je(t,!0);let n=v(t,"viewport",7),g=v(t,"onViewportChange",7),m=v(t,"onCustom",7);const P=["phone","tablet","desktop"],b=f(()=>n().mode==="fit"?"fit":n().mode==="preset"?n().presetId:"custom");function F(u){if(u==="fit")return g()({mode:"fit"});const k=Mt.find(O=>O.id===u);k&&g()({mode:"preset",presetId:k.id,width:k.width,height:k.height})}var A={get viewport(){return n()},set viewport(u){n(u),w()},get onViewportChange(){return g()},set onViewportChange(u){g(u),w()},get onCustom(){return m()},set onCustom(u){m(u),w()},$set:Ze,$on:(u,k)=>Xe(t,u,k)},S=er(),s=H(S);Y(s,()=>hn,(u,k)=>{k(u,{get value(){return e(b)},onValueChange:F,children:(O,x)=>{var I=er(),R=H(I);Y(R,()=>Yt,(G,K)=>{K(G,{value:"fit",children:(oe,te)=>{ht();var X=ct();D(le=>J(X,le),[()=>c.browser_viewport_fitPanel_label()]),C(oe,X)},$$slots:{default:!0}})});var T=h(R,2);Pr(T,17,()=>P,Go,(G,K)=>{var oe=er(),te=H(oe);Y(te,()=>mt,(B,ae)=>{ae(B,{})});var X=h(te,2);Y(X,()=>_n,(B,ae)=>{ae(B,{children:(a,l)=>{ht();var j=ct();D(ue=>J(j,ue),[()=>e(K)==="phone"?c.browser_viewport_phoneGroup_label():e(K)==="tablet"?c.browser_viewport_tabletGroup_label():c.browser_viewport_desktopGroup_label()]),C(a,j)},$$slots:{default:!0}})});var le=h(X,2);Pr(le,17,()=>Mt.filter(B=>B.category===e(K)),B=>B.id,(B,ae)=>{var a=ut(),l=H(a);Y(l,()=>Yt,(j,ue)=>{ue(j,{get value(){return e(ae).id},children:(Ie,he)=>{var M=ua(),_=H(M),Z=ke(_,!0),V=h(_,2),z=ke(V,!0);D(y=>{J(Z,e(ae).name),J(z,y)},[()=>c.browser_viewport_dimensions_label({width:ze(e(ae).width),height:ze(e(ae).height)})]),C(Ie,M)},$$slots:{default:!0}})}),C(B,a)}),C(G,oe)});var ee=h(T,2);{var ge=G=>{var K=tr(),oe=H(K);Y(oe,()=>mt,(X,le)=>{le(X,{})});var te=h(oe,2);Y(te,()=>Yt,(X,le)=>{le(X,{value:"custom",get onSelect(){return m()},children:(B,ae)=>{var a=ca(),l=H(a),j=ke(l,!0),ue=h(l,2),Ie=ke(ue,!0);D((he,M)=>{J(j,he),J(Ie,M)},[()=>c.browser_viewport_custom_label(),()=>c.browser_viewport_dimensions_label({width:ze(n().width),height:ze(n().height)})]),C(B,a)},$$slots:{default:!0}})}),C(G,K)};be(ee,G=>{n().mode==="custom"&&G(ge)})}C(O,I)},$$slots:{default:!0}})});var L=h(s,2);{var Q=u=>{var k=tr(),O=H(k);Y(O,()=>mt,(I,R)=>{R(I,{})});var x=h(O,2);Y(x,()=>Ke,(I,R)=>{R(I,{get onSelect(){return m()},children:(T,ee)=>{ht();var ge=ct();D(G=>J(ge,G),[()=>c.browser_viewport_custom_label()]),C(T,ge)},$$slots:{default:!0}})}),C(u,k)};be(L,u=>{n().mode!=="custom"&&u(Q)})}var U=h(L,2);{var $=u=>{var k=tr(),O=H(k);Y(O,()=>mt,(I,R)=>{R(I,{})});var x=h(O,2);{let I=f(()=>c.browser_viewport_rotate_label());Y(x,()=>no,(R,T)=>{T(R,{get icon(){return jr},get label(){return e(I)},onSelect:()=>g()(da(n()))})})}C(u,k)};be(U,u=>{n().mode!=="fit"&&u($)})}return C(o,S),Ye(A)}var fa=re('<div class="grid grid-cols-2 gap-3"><label class="space-y-1 type-caption"><span> </span> <!></label> <label class="space-y-1 type-caption"><span> </span> <!></label></div>');function fr(o,t){if(new.target)return je({component:fr,...o});Je(t,!0);let n=v(t,"open",15,!1),g=v(t,"viewport",7),m=v(t,"onViewportChange",7),P=v(t,"returnFocus",7);const b=320,F=3840;let A=W(1280),S=W(800),s=W(null);function L(u){return typeof u=="number"&&Number.isInteger(u)&&u>=b&&u<=F}const Q=f(()=>L(e(A))&&L(e(S)));Ue(()=>{if(n())return()=>{It().then(()=>{P()?.isConnected&&P().focus()})}}),Ue(()=>{n()||(d(A,g().mode==="fit"?1280:g().width,!0),d(S,g().mode==="fit"?800:g().height,!0))});function U(){!e(Q)||e(A)===null||e(S)===null||(m()({mode:"custom",width:e(A),height:e(S)}),n(!1))}var $={get open(){return n()},set open(u=!1){n(u),w()},get viewport(){return g()},set viewport(u){g(u),w()},get onViewportChange(){return m()},set onViewportChange(u){m(u),w()},get returnFocus(){return P()},set returnFocus(u){P(u),w()},$set:Ze,$on:(u,k)=>Xe(t,u,k)};{let u=f(()=>c.browser_viewport_custom_label()),k=f(()=>c.browser_viewport_sizeRange_description({min:ze(b),max:ze(F)})),O=f(()=>c.browser_viewport_apply_label());qn(o,{get title(){return e(u)},get description(){return e(k)},get submitLabel(){return e(O)},get canSubmit(){return e(Q)},onSubmit:U,get initialFocus(){return e(s)},get open(){return n()},set open(x){n(x)},children:(x,I)=>{var R=fa(),T=ie(R),ee=ie(T),ge=ke(ee,!0),G=h(ee,2);{let le=f(()=>!L(e(A)));Nt(G,{type:"number",min:b,max:F,step:"1",get"aria-invalid"(){return e(le)},get value(){return e(A)},set value(B){d(A,B,!0)},get ref(){return e(s)},set ref(B){d(s,B,!0)}})}se(T);var K=h(T,2),oe=ie(K),te=ke(oe,!0),X=h(oe,2);{let le=f(()=>!L(e(S)));Nt(X,{type:"number",min:b,max:F,step:"1",get"aria-invalid"(){return e(le)},get value(){return e(S)},set value(B){d(S,B,!0)}})}se(K),se(R),D((le,B)=>{J(ge,le),J(te,B)},[()=>c.browser_viewport_width_label(),()=>c.browser_viewport_height_label()]),C(x,R)},$$slots:{default:!0}})}return Ye($)}var Ot=re("<!> <!>",1),ot=re("<!> ",1),ga=re('<!> <span class="min-w-0 flex-1 truncate"> </span>',1),va=re("<!> <!> <!> <!> <!>",1),wa=re('<!> <span class="min-w-0 flex-1"> </span> <kbd class="type-caption ml-5 text-muted-foreground" aria-hidden="true">⌘⌥I</kbd>',1),pa=re("<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>",1);function uo(o,t){if(new.target)return je({component:uo,...o});Je(t,!0);let n=v(t,"errorCount",7,0),g=v(t,"disabled",7,!1),m=v(t,"collapsed",7,!1),P=v(t,"canGoBack",7,!1),b=v(t,"canGoForward",7,!1),F=v(t,"canSelectElement",7,!1),A=v(t,"selectingElement",7,!1),S=v(t,"viewport",23,()=>({mode:"fit"})),s=v(t,"onGoBack",7),L=v(t,"onGoForward",7),Q=v(t,"onToggleElementPicker",7),U=v(t,"onViewportChange",7),$=v(t,"onOpenExternal",7),u=v(t,"onFullScreen",7),k=v(t,"onCopyUrl",7),O=v(t,"onScreenshot",7),x=v(t,"onOpenConsole",7),I=v(t,"onOpenSource",7),R=v(t,"onOpenInspector",7),T=v(t,"onReloadWithoutCache",7);const ee=f(()=>n()>0?c.browser_overflow_triggerWithErrors_ariaLabel({count:ze(n())}):c.browser_overflow_trigger_ariaLabel()),ge=f(()=>S().mode==="preset"?Mt.find(l=>l.id===S().presetId):void 0),G=f(()=>S().mode==="fit"?c.browser_viewport_fitPanel_label():e(ge)?.name??c.browser_viewport_dimensions_label({width:ze(S().width),height:ze(S().height)}));let K=W(!1),oe=W(null),te=W(!1);async function X(){d(te,!1),await It(),d(K,!0)}var le={get errorCount(){return n()},set errorCount(l=0){n(l),w()},get disabled(){return g()},set disabled(l=!1){g(l),w()},get collapsed(){return m()},set collapsed(l=!1){m(l),w()},get canGoBack(){return P()},set canGoBack(l=!1){P(l),w()},get canGoForward(){return b()},set canGoForward(l=!1){b(l),w()},get canSelectElement(){return F()},set canSelectElement(l=!1){F(l),w()},get selectingElement(){return A()},set selectingElement(l=!1){A(l),w()},get viewport(){return S()},set viewport(l={mode:"fit"}){S(l),w()},get onGoBack(){return s()},set onGoBack(l){s(l),w()},get onGoForward(){return L()},set onGoForward(l){L(l),w()},get onToggleElementPicker(){return Q()},set onToggleElementPicker(l){Q(l),w()},get onViewportChange(){return U()},set onViewportChange(l){U(l),w()},get onOpenExternal(){return $()},set onOpenExternal(l){$(l),w()},get onFullScreen(){return u()},set onFullScreen(l){u(l),w()},get onCopyUrl(){return k()},set onCopyUrl(l){k(l),w()},get onScreenshot(){return O()},set onScreenshot(l){O(l),w()},get onOpenConsole(){return x()},set onOpenConsole(l){x(l),w()},get onOpenSource(){return I()},set onOpenSource(l){I(l),w()},get onOpenInspector(){return R()},set onOpenInspector(l){R(l),w()},get onReloadWithoutCache(){return T()},set onReloadWithoutCache(l){T(l),w()},$set:Ze,$on:(l,j)=>Xe(t,l,j)},B=Ot(),ae=H(B);Y(ae,()=>to,(l,j)=>{j(l,{get open(){return e(te)},set open(ue){d(te,ue,!0)},children:(ue,Ie)=>{var he=Ot(),M=H(he);{const Z=(V,z)=>{let y=()=>(z?.()).props;{let q=f(()=>c.browser_overflow_trigger_tooltip());Oe(V,lr(y,{variant:"ghost-light",size:"icon-xs",class:"relative",get disabled(){return g()},get tooltip(){return e(q)},tooltipSide:"bottom",get"aria-label"(){return e(ee)},"data-testid":"browser-overflow-trigger",get ref(){return e(oe)},set ref(E){d(oe,E,!0)},children:(E,Pe)=>{var fe=Ot(),Qe=H(fe);yn(Qe,{class:"size-3.5"});var nt=h(Qe,2);{var We=Fe=>{Gn(Fe,{variant:"destructive",class:"absolute -right-1.5 -top-1.5 h-4 min-w-4 px-1 text-xs leading-none","data-testid":"browser-console-error-badge",children:(Ge,at)=>{ht();var it=ct();D(Me=>J(it,Me),[()=>n()>9?"9+":ze(n())]),C(Ge,it)},$$slots:{default:!0}})};be(nt,Fe=>{n()>0&&Fe(We)})}C(E,fe)},$$slots:{default:!0}}))}};Y(M,()=>Qr,(V,z)=>{z(V,{child:Z,$$slots:{child:!0}})})}var _=h(M,2);Y(_,()=>eo,(Z,V)=>{V(Z,{align:"end",class:"w-56",onCloseAutoFocus:z=>e(K)&&z.preventDefault(),children:(z,y)=>{var q=pa(),E=H(q);{var Pe=ve=>{var we=va(),Ee=H(we);{let ce=f(()=>!P());Y(Ee,()=>Ke,(xe,De)=>{De(xe,{get disabled(){return e(ce)},get onSelect(){return s()},children:(Ne,st)=>{var Ce=ot(),He=H(Ce);ye(He,{get icon(){return dr},size:"xs",class:"w-4 text-muted-foreground"});var et=h(He);D(Ve=>J(et,` ${Ve??""}`),[()=>c.browser_embedded_goBack_ariaLabel()]),C(Ne,Ce)},$$slots:{default:!0}})})}var Re=h(Ee,2);{let ce=f(()=>!b());Y(Re,()=>Ke,(xe,De)=>{De(xe,{get disabled(){return e(ce)},get onSelect(){return L()},children:(Ne,st)=>{var Ce=ot(),He=H(Ce);ye(He,{get icon(){return ur},size:"xs",class:"w-4 text-muted-foreground"});var et=h(He);D(Ve=>J(et,` ${Ve??""}`),[()=>c.browser_embedded_goForward_ariaLabel()]),C(Ne,Ce)},$$slots:{default:!0}})})}var pe=h(Re,2);{let ce=f(()=>!F());Y(pe,()=>Ke,(xe,De)=>{De(xe,{get disabled(){return e(ce)},onSelect:()=>void Q()?.(),children:(Ne,st)=>{var Ce=ot(),He=H(Ce);ye(He,{get icon(){return nr},size:"xs",class:"w-4 text-muted-foreground"});var et=h(He);D(Ve=>J(et,` ${Ve??""}`),[()=>A()?c.browser_embedded_cancelElementSelection_ariaLabel():c.browser_embedded_selectElement_ariaLabel()]),C(Ne,Ce)},$$slots:{default:!0}})})}var me=h(pe,2);Y(me,()=>xn,(ce,xe)=>{xe(ce,{children:(De,Ne)=>{var st=Ot(),Ce=H(st);{let et=f(()=>!U());Y(Ce,()=>Cn,(Ve,ft)=>{ft(Ve,{get disabled(){return e(et)},children:(St,gt)=>{var Pt=ga(),Et=H(Pt);ye(Et,{get icon(){return Zr},size:"xs",class:"w-4 text-muted-foreground"});var Ft=h(Et,2),Ut=ke(Ft,!0);D(Lt=>J(Ut,Lt),[()=>c.browser_viewport_trigger_ariaLabel({mode:e(G)})]),C(St,Pt)},$$slots:{default:!0}})})}var He=h(Ce,2);Y(He,()=>In,(et,Ve)=>{Ve(et,{class:"w-64",children:(ft,St)=>{cr(ft,{get viewport(){return S()},onViewportChange:gt=>U()?.(gt),onCustom:X})},$$slots:{default:!0}})}),C(De,st)},$$slots:{default:!0}})});var Ae=h(me,2);Y(Ae,()=>mt,(ce,xe)=>{xe(ce,{})}),C(ve,we)};be(E,ve=>{m()&&ve(Pe)})}var fe=h(E,2);{var Qe=ve=>{var we=ut(),Ee=H(we);Y(Ee,()=>Ke,(Re,pe)=>{pe(Re,{onSelect:()=>u()(),children:(me,Ae)=>{var ce=ot(),xe=H(ce);ye(xe,{get icon(){return tn},size:"xs",class:"w-4 text-muted-foreground"});var De=h(xe);D(Ne=>J(De,` ${Ne??""}`),[()=>c.browser_overflow_fullScreen_label()]),C(me,ce)},$$slots:{default:!0}})}),C(ve,we)},nt=ve=>{var we=ut(),Ee=H(we);Y(Ee,()=>Ke,(Re,pe)=>{pe(Re,{onSelect:()=>void $()(),children:(me,Ae)=>{var ce=ot(),xe=H(ce);ye(xe,{get icon(){return rn},size:"xs",class:"w-4 text-muted-foreground"});var De=h(xe);D(Ne=>J(De,` ${Ne??""}`),[()=>c.browser_overflow_openExternal_label()]),C(me,ce)},$$slots:{default:!0}})}),C(ve,we)};be(fe,ve=>{u()?ve(Qe):$()&&ve(nt,1)})}var We=h(fe,2);Y(We,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void k()(),children:(Ee,Re)=>{var pe=ot(),me=H(pe);ye(me,{get icon(){return Jo},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me);D(ce=>J(Ae,` ${ce??""}`),[()=>c.browser_overflow_copyUrl_label()]),C(Ee,pe)},$$slots:{default:!0}})});var Fe=h(We,2);Y(Fe,()=>mt,(ve,we)=>{we(ve,{})});var Ge=h(Fe,2);Y(Ge,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void O()(),children:(Ee,Re)=>{var pe=ot(),me=H(pe);ye(me,{get icon(){return Yo},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me);D(ce=>J(Ae,` ${ce??""}`),[()=>c.browser_overflow_screenshot_label()]),C(Ee,pe)},$$slots:{default:!0}})});var at=h(Ge,2);Y(at,()=>mt,(ve,we)=>{we(ve,{})});var it=h(at,2);Y(it,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void x()(),children:(Ee,Re)=>{var pe=ot(),me=H(pe);ye(me,{get icon(){return Qo},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me);D(ce=>J(Ae,` ${ce??""}`),[()=>c.browser_overflow_console_label()]),C(Ee,pe)},$$slots:{default:!0}})});var Me=h(it,2);Y(Me,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void I()(),children:(Ee,Re)=>{var pe=ot(),me=H(pe);ye(me,{get icon(){return en},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me);D(ce=>J(Ae,` ${ce??""}`),[()=>c.browser_overflow_source_label()]),C(Ee,pe)},$$slots:{default:!0}})});var qe=h(Me,2);Y(qe,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void R()(),children:(Ee,Re)=>{var pe=wa(),me=H(pe);ye(me,{get icon(){return nr},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me,2),ce=ke(Ae,!0);ht(2),D(xe=>J(ce,xe),[()=>c.browser_overflow_inspector_label()]),C(Ee,pe)},$$slots:{default:!0}})});var Le=h(qe,2);Y(Le,()=>mt,(ve,we)=>{we(ve,{})});var _t=h(Le,2);Y(_t,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void T()(),children:(Ee,Re)=>{var pe=ot(),me=H(pe);ye(me,{get icon(){return jr},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me);D(ce=>J(Ae,` ${ce??""}`),[()=>c.browser_overflow_reloadWithoutCache_label()]),C(Ee,pe)},$$slots:{default:!0}})}),C(z,q)},$$slots:{default:!0}})}),C(ue,he)},$$slots:{default:!0}})});var a=h(ae,2);return fr(a,{get viewport(){return S()},onViewportChange:l=>U()?.(l),get returnFocus(){return e(oe)},get open(){return e(K)},set open(l){d(K,l,!0)}}),C(o,B),Ye(le)}var ba=re('<span class="truncate"> </span> <!>',1),Ar=re("<!> <!>",1);function co(o,t){if(new.target)return je({component:co,...o});Je(t,!0);let n=v(t,"viewport",7),g=v(t,"onViewportChange",7),m=W(!1),P=W(!1),b=W(null);const F=f(()=>n().mode==="preset"?Mt.find(k=>k.id===n().presetId):void 0),A=f(()=>n().mode==="fit"?"":c.browser_viewport_dimensions_label({width:ze(n().width),height:ze(n().height)})),S=f(()=>n().mode==="fit"?c.browser_viewport_fit_short_label():n().mode==="preset"&&e(F)?e(F).name:e(A)),s=f(()=>n().mode==="fit"?c.browser_viewport_fitPanel_label():e(S));async function L(){d(m,!1),await It(),d(P,!0)}var Q={get viewport(){return n()},set viewport(k){n(k),w()},get onViewportChange(){return g()},set onViewportChange(k){g(k),w()},$set:Ze,$on:(k,O)=>Xe(t,k,O)},U=Ar(),$=H(U);Y($,()=>to,(k,O)=>{O(k,{get open(){return e(m)},set open(x){d(m,x,!0)},children:(x,I)=>{var R=Ar(),T=H(R);{const ge=(G,K)=>{let oe=()=>(K?.()).props;{let te=f(()=>c.browser_viewport_trigger_ariaLabel({mode:e(s)}));Oe(G,lr(oe,{variant:"ghost-light",size:"xs",class:"h-6 max-w-36 gap-1 rounded-full bg-muted px-2 text-xs hover:bg-muted/80",get"aria-label"(){return e(te)},"data-testid":"browser-viewport-trigger",get ref(){return e(b)},set ref(X){d(b,X,!0)},children:(X,le)=>{var B=ba(),ae=H(B),a=ke(ae,!0),l=h(ae,2);ye(l,{get icon(){return on},size:"xs",class:"shrink-0"}),D(()=>J(a,e(S))),C(X,B)},$$slots:{default:!0}}))}};Y(T,()=>Qr,(G,K)=>{K(G,{child:ge,$$slots:{child:!0}})})}var ee=h(T,2);Y(ee,()=>eo,(ge,G)=>{G(ge,{align:"end",class:"w-64",onCloseAutoFocus:K=>e(P)&&K.preventDefault(),children:(K,oe)=>{cr(K,{get viewport(){return n()},get onViewportChange(){return g()},onCustom:L})},$$slots:{default:!0}})}),C(x,R)},$$slots:{default:!0}})});var u=h($,2);return fr(u,{get viewport(){return n()},get onViewportChange(){return g()},get returnFocus(){return e(b)},get open(){return e(P)},set open(k){d(P,k,!0)}}),C(o,U),Ye(Q)}var ma=re('<span data-browser-viewport-readout=""> </span> <!>',1),ha=re('<div data-browser-device-frame-container=""><div><div><!> <!></div> <!></div></div>');function fo(o,t){if(new.target)return je({component:fo,...o});Je(t,!0);const n=320,g=3840,m=150,P=24;let b=v(t,"viewport",7),F=v(t,"onViewportChange",7),A=v(t,"chromeOutside",7,!1),S=v(t,"children",7),s=W(Rt(b().mode==="fit"?n:b().width)),L=W(Rt(b().mode==="fit"?n:b().height)),Q,U=W(0),$=W(0),u=W(!1),k=null,O=0,x=0,I=0,R=0,T;const ee=f(()=>b().mode==="fit"),ge=f(()=>c.browser_viewport_dimensions_label({width:ze(e(s)),height:ze(e(L))})),G=f(()=>A()?Math.max(0,e($)-P):e($)),K=f(()=>!e(ee)&&e(U)>0&&e(G)>0?Math.min(1,e(U)/e(s),e(G)/e(L)):1),oe=f(()=>e(s)*e(K)),te=f(()=>e(L)*e(K));Ue(()=>{e(u)||b().mode==="fit"||(d(s,b().width,!0),d(L,b().height,!0))});function X(y){return Math.min(g,Math.max(n,Math.round(y)))}function le(){F()({mode:"custom",width:e(s),height:e(L)})}function B(){clearTimeout(T),T=setTimeout(le,m)}function ae(y){e(ee)||y.button!==0||(y.preventDefault(),d(u,!0),k=y.pointerId,O=y.clientX,x=y.clientY,I=e(s),R=e(L),y.currentTarget instanceof HTMLElement&&y.currentTarget.setPointerCapture?.(y.pointerId))}function a(y){!e(u)||y.pointerId!==k||(d(s,X(I+y.clientX-O),!0),d(L,X(R+y.clientY-x),!0),B())}function l(y){if(!e(u)||y.pointerId!==k)return;clearTimeout(T),d(u,!1),k=null;const q=y.currentTarget;q instanceof HTMLElement&&q.hasPointerCapture?.(y.pointerId)&&q.releasePointerCapture&&q.releasePointerCapture(y.pointerId),le()}qr(()=>{const y=(E,Pe)=>{d(U,E,!0),d($,Pe,!0)};y(Q.clientWidth,Q.clientHeight);const q=typeof ResizeObserver>"u"?void 0:new ResizeObserver(([E])=>{y(E?.contentRect.width??Q.clientWidth,E?.contentRect.height??Q.clientHeight)});return q?.observe(Q),()=>q?.disconnect()}),Hr(()=>clearTimeout(T));var j={get viewport(){return b()},set viewport(y){b(y),w()},get onViewportChange(){return F()},set onViewportChange(y){F(y),w()},get chromeOutside(){return A()},set chromeOutside(y=!1){A(y),w()},get children(){return S()},set children(y){S(y),w()},$set:Ze,$on:(y,q)=>Xe(t,y,q)},ue=ha();{const y=E=>{var Pe=ma(),fe=H(Pe),Qe=ke(fe,!0),nt=h(fe,2);{let We=f(()=>A()?"top-full":"bottom-0"),Fe=f(()=>c.browser_viewport_resizeHandle_ariaLabel());Oe(nt,{type:"button",variant:"ghost",size:"icon-xs",iconOnly:!0,get class(){return`absolute right-0 z-20 size-5 cursor-nwse-resize touch-none border-0 bg-transparent p-0 after:absolute after:bottom-1 after:right-1 after:size-2 after:border-b-2 after:border-r-2 after:border-muted-foreground ${e(We)??""}`},get"aria-label"(){return e(Fe)},"data-testid":"browser-device-resize-handle",onpointerdown:ae,onpointermove:a,onpointerup:l,onpointercancel:l})}D(()=>{xt(fe,1,`pointer-events-none absolute left-1/2 z-10 -translate-x-1/2 rounded bg-background/90 px-1.5 py-0.5 text-xs text-muted-foreground shadow-sm backdrop-blur ${A()?"top-full mt-0.5":"bottom-1"}`),J(Qe,e(ge))}),C(E,Pe)};var Ie=ie(ue),he=ie(Ie);let q;var M=ie(he);Xo(M,()=>S()??zo);var _=h(M,2);{var Z=E=>{y(E)};be(_,E=>{!e(ee)&&!A()&&E(Z)})}se(he);var V=h(he,2);{var z=E=>{y(E)};be(V,E=>{!e(ee)&&A()&&E(z)})}se(Ie),se(ue),kt(ue,E=>Q=E,()=>Q),D(()=>{xt(Ie,1,`relative ${e(ee)?"h-full w-full":""} ${A()&&!e(ee)?"mb-6":""}`),xt(he,1,`relative overflow-hidden bg-background ${e(ee)?"h-full w-full":e(u)?"ring-2 ring-primary/30":""}`),Be(he,"data-browser-device-frame",e(ee)?void 0:""),Be(he,"data-width",e(ee)?void 0:e(s)),Be(he,"data-height",e(ee)?void 0:e(L)),q=Ho(he,"",q,{width:e(ee)?void 0:`${e(oe)}px`,height:e(ee)?void 0:`${e(te)}px`})})}return D(()=>xt(ue,1,`flex h-full w-full items-center justify-center overflow-hidden ${e(ee)?"bg-background":"bg-muted/40"}`)),C(o,ue),Ye(j)}const rr=Dt("BrowserViewSlot"),Br=()=>new Promise(o=>requestAnimationFrame(()=>o())),Or=async()=>{await Br(),await Br()};function Nr(o,t){return o===t?!0:!o||!t?!1:o.x===t.x&&o.y===t.y&&o.width===t.width&&o.height===t.height}function Mr(o){const t=o.getBoundingClientRect();return t.width<=0||t.height<=0?null:{x:t.left,y:t.top,width:t.width,height:t.height}}function _a(o){return o.isConnected?typeof o.checkVisibility=="function"?o.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):!0:!1}function ya(o,t){let n=Dr(o,t),g=`${t.workspaceId}\0${t.tabId}`;return{update(m){const P=`${m.workspaceId}\0${m.tabId}`;if(P===g){n.update(m);return}n.destroy(),g=P,n=Dr(o,m)},destroy(){n.destroy()}}}function Dr(o,t){let n=t;const g=An(o,{tabId:n.tabId,workspaceId:n.workspaceId,url:n.url,...n.pinned===void 0?{}:{pinned:n.pinned}});n.onWebview?.(g.webview);let m=null,P=Promise.resolve(),b="live",F=0,A=null,S=null,s=!1;const L=()=>{A?.remove(),A=null},Q=x=>{m=x;const I=n.tabId;return P=On(I,x.rect,x.visible).catch(R=>rr.debug("Could not place the browser page",{tabId:I,error:R})),P},U=()=>{if(S=null,s)return;const x=Mr(o),I=n.visible&&x!==null&&_a(o)&&b!=="frozen"&&g.ready;g.ready&&(!m||m.visible!==I||x&&!Nr(m.rect,x))&&(Nr(m?.rect??null,x)||Kn(),Q({rect:x??m?.rect??null,visible:I})),S=requestAnimationFrame(U)};S=requestAnimationFrame(U);const $=async x=>{if(b="freezing",g.ready&&m?.visible)try{const I=await g.webview.capturePage?.();if(x!==F||s)return;const R=I?.toDataURL()??"";if(R){const T=document.createElement("img");if(T.alt="",T.setAttribute("aria-hidden","true"),T.dataset.browserViewSnapshot="",T.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;",T.src=R,await T.decode().catch(()=>{}),x!==F||s||(L(),o.append(T),A=T,await Or(),x!==F||s))return}}catch(I){rr.debug("Could not snapshot the browser page",{tabId:n.tabId,error:I})}x!==F||s||(b="frozen")},u=async x=>{if(b="thawing",g.ready&&n.visible){const I=Mr(o);I&&await Q({rect:I,visible:!0}),await Or()}x!==F||s||(L(),b="live")},k=Hn({element:o,onCoveredChange(x){const I=++F;x?$(I):u(I)}});return{update(x){n=x},destroy:()=>{const x=n.tabId;s=!0,S!==null&&cancelAnimationFrame(S),S=null,k(),L(),g.dispose(),n.onWebview?.(null),P.then(()=>Bn(x).catch(I=>rr.debug("Could not take the browser page off screen",{tabId:x,error:I})))}}}var xa=re('<div class="relative h-full w-full overflow-hidden"></div>');function go(o,t){if(new.target)return je({component:go,...o});Je(t,!0);let n=v(t,"tabId",7),g=v(t,"workspaceId",7),m=v(t,"url",7),P=v(t,"pinned",7),b=v(t,"visible",7),F=v(t,"webview",15,null);var A={get tabId(){return n()},set tabId(s){n(s),w()},get workspaceId(){return g()},set workspaceId(s){g(s),w()},get url(){return m()},set url(s){m(s),w()},get pinned(){return P()},set pinned(s){P(s),w()},get visible(){return b()},set visible(s){b(s),w()},get webview(){return F()},set webview(s=null){F(s),w()},$set:Ze,$on:(s,L)=>Xe(t,s,L)},S=xa();return Ct(S,(s,L)=>ya?.(s,L),()=>({tabId:n(),workspaceId:g(),url:m(),...P()===void 0?{}:{pinned:P()},visible:b(),onWebview:s=>F(s)})),Ct(S,(s,L)=>io?.(s,L),n),D(()=>Be(S,"data-browser-view-slot",n())),C(o,S),Ye(A)}function vo(o,t){if(new.target)return je({component:vo,...o});Je(t,!0);let n=v(t,"active",7),g=v(t,"disabled",7),m=v(t,"onToggle",7);var P={get active(){return n()},set active(b){n(b),w()},get disabled(){return g()},set disabled(b){g(b),w()},get onToggle(){return m()},set onToggle(b){m(b),w()},$set:Ze,$on:(b,F)=>Xe(t,b,F)};{let b=f(()=>n()?"bg-muted text-foreground":""),F=f(()=>n()?c.browser_embedded_cancelElementSelection_tooltip():c.browser_embedded_selectElement_tooltip()),A=f(()=>n()?c.browser_embedded_cancelElementSelection_ariaLabel():c.browser_embedded_selectElement_ariaLabel());Oe(o,{variant:"ghost-light",size:"icon-xs",get class(){return e(b)},get onclick(){return m()},get disabled(){return g()},get tooltip(){return e(F)},tooltipSide:"bottom",get"aria-label"(){return e(A)},get"aria-pressed"(){return n()},"data-testid":"browser-select-element",children:(S,s)=>{ye(S,{get icon(){return nr},size:"xs"})},$$slots:{default:!0}})}return Ye(P)}var Ca=re('<span class="sr-only"> </span>'),Ia=re('<p class="min-h-0 overflow-y-auto text-sm text-foreground [overflow-wrap:anywhere]"> </p> <!>',1),ka=re("<!> <!>",1),Pa=re('<span class="inline-flex shrink-0"><!> <!></span>');function gr(o,t){const n=Kr();if(new.target)return je({component:gr,...o});Je(t,!0);let g=v(t,"label",7),m=v(t,"description",7),P=v(t,"ariaLabel",23,g),b=v(t,"tone",7,"info"),F=v(t,"actionLabel",7),A=v(t,"onAction",7),S=v(t,"actionFocusTarget",7),s=v(t,"descriptionId",7),L=W(!1),Q=!1;async function U(){Q=!0,d(L,!1),await It(),S()?.focus(),A()?.()}var $={get label(){return g()},set label(I){g(I),w()},get description(){return m()},set description(I){m(I),w()},get ariaLabel(){return P()},set ariaLabel(I=g){P(I),w()},get tone(){return b()},set tone(I="info"){b(I),w()},get actionLabel(){return F()},set actionLabel(I){F(I),w()},get onAction(){return A()},set onAction(I){A(I),w()},get actionFocusTarget(){return S()},set actionFocusTarget(I){S(I),w()},get descriptionId(){return s()},set descriptionId(I){s(I),w()},$set:Ze,$on:(I,R)=>Xe(t,I,R)},u=Pa(),k=ie(u);{var O=I=>{var R=Ca(),T=ke(R,!0);D(()=>{Be(R,"id",n),Be(R,"role",b()==="error"?"alert":"status"),J(T,m())}),C(I,R)};be(k,I=>{s()||I(O)})}var x=h(k,2);return Y(x,()=>Xn,(I,R)=>{R(I,{get open(){return e(L)},set open(T){d(L,T,!0)},children:(T,ee)=>{var ge=ka(),G=H(ge);{const oe=(te,X)=>{let le=()=>(X?.()).props;{let B=f(()=>b()==="error"?"text-danger":b()==="warning"?"text-warning-ink":"text-muted-foreground"),ae=f(()=>s()??n);Oe(te,lr(le,{variant:"ghost-light",size:"icon-compact",wrapContent:!1,get class(){return e(B)},get"aria-label"(){return P()},get"aria-describedby"(){return e(ae)},get tooltip(){return m()},get tooltipDisabled(){return e(L)},tooltipSide:"bottom",tooltipDelayDuration:300,children:(a,l)=>{{let j=f(()=>b()==="error"?Xr:b()==="warning"?nn:Zr);ye(a,{get icon(){return e(j)},size:"xs",class:"shrink-0"})}},$$slots:{default:!0}}))}};Y(G,()=>jn,(te,X)=>{X(te,{child:oe,$$slots:{child:!0}})})}var K=h(G,2);Y(K,()=>Zn,(oe,te)=>{te(oe,{align:"end",class:"flex max-h-[var(--bits-popover-content-available-height,calc(100dvh-1rem))] w-72 max-w-[calc(100vw-1rem)] flex-col gap-3 p-3",get"aria-label"(){return P()},onCloseAutoFocus:X=>{Q&&S()&&(X.preventDefault(),S().focus()),Q=!1},children:(X,le)=>{var B=Ia(),ae=H(B),a=ke(ae,!0),l=h(ae,2);{var j=ue=>{Oe(ue,{variant:"secondary",size:"sm",class:"self-start",onclick:()=>void U(),children:(Ie,he)=>{ht();var M=ct();D(()=>J(M,F())),C(Ie,M)},$$slots:{default:!0}})};be(l,ue=>{F()&&A()&&ue(j)})}D(()=>J(a,m())),C(X,B)},$$slots:{default:!0}})}),C(T,ge)},$$slots:{default:!0}})}),se(u),D(()=>Be(u,"data-browser-status",b())),C(o,u),Ye($)}function Ea(o,t,n){const g=n.width>0?t.width/n.width:1,m=n.height>0?t.height/n.height:1,P=Math.max(0,Math.floor(o.x*g)),b=Math.max(0,Math.floor(o.y*m)),F=Math.min(t.width,Math.ceil((o.x+o.width)*g)),A=Math.min(t.height,Math.ceil((o.y+o.height)*m));return{x:P,y:b,width:Math.max(0,F-P),height:Math.max(0,A-b)}}const Fa=$r({selector:wt().min(1),domPath:wt().min(1),tagName:wt().min(1),id:wt(),className:wt(),textSnippet:wt().max(120),rect:$r({x:Bt().finite(),y:Bt().finite(),width:Bt().finite().nonnegative(),height:Bt().finite().nonnegative()}).strict(),pageUrl:wt().min(1),sourceRef:wt().min(1).optional()}).strict(),Vr="__INTENT_ELEMENT_PICKED__:";function Sa(o){if(o==="__INTENT_ELEMENT_PICK_CANCELLED__")return{type:"cancelled"};if(!o.startsWith(Vr))return null;let t;try{t=JSON.parse(o.slice(Vr.length))}catch{t=null}const n=Fa.safeParse(t);return n.success?{type:"picked",element:n.data}:{type:"malformed",issues:n.error.issues}}const La=String.raw`
|
|
1
|
+
import{t as je,bo as v,bm as c,bw as Ze,b as Xe,br as lr,bs as bt,bq as Gr}from"./CLAmm_T1.js";import{bs as Je,ay as H,be as ht,b$ as ct,b_ as D,bO as J,W as C,bS as h,aD as e,a7 as ut,bl as ke,bn as Ye,c9 as f,aA as w,aB as re,ca as Ue,c0 as It,bH as d,a5 as ie,bA as se,bV as W,br as Rt,bk as qr,bj as Hr,bf as zo,bo as Kr,c5 as pt,aw as or,bz as Wo,cd as Jt}from"./3SdAC2_C.js";import{i as be}from"./BFgvMDua.js";import{c as Y}from"./BwH4Bvte.js";import{g as Pr,i as Go,e as Ct,I as qo}from"./B1CKzIA2.js";import{f as xt,s as Be,g as Ho}from"./CcJmuwXr.js";import{b as kt}from"./Dn334wJv.js";import{b as Er}from"./D7b2VLAz.js";import{k as Ko}from"./CIbfGsF-.js";import{c as Dt}from"./ChTqQfQN.js";import{a as jo}from"./CC7to1B5.js";import{f as Oe}from"./nxtepGjE.js";import{F as Zo}from"./TB9r2XJy.js";import{m as vt}from"./96V4v2iI.js";import{t as Xo}from"./BwNrQXlF.js";import{cp as jr,F as ye,aZ as Jo,ar as Yo,cK as Qo,aM as en,a_ as nr,a0 as dr,a2 as ur,b1 as Zr,bb as tn,a8 as rn,aw as on,aC as Xr,cT as nn,ci as Jr,bS as Yr,cn as an}from"./DPttSllj.js";import"./BbYWP3Ow.js";import{rV as sn,JH as Se,g0 as ln,bE as dn,Ac as un,zu as cn,LI as Fr,dV as fn,bY as gn,LH as vn,v1 as wn,LF as Sr,gI as pn,un as bn,LG as mn,Ll as Lr,LE as Rr}from"./B9vHutcJ.js";import"./DtzJzV-4.js";import{R as hn,g as Yt,h as mt,f as _n,e as Ke,l as Qr,d as eo,K as yn,i as xn,k as Cn,j as In,M as to,E as kn}from"./Dd-LQrG1.js";import{a as ro,B as $t}from"./B5aYN90J.js";import{bK as Pn}from"./Rtit513z.js";import{a5 as En,w as Fn,ah as Sn}from"./DXY_Cr2S.js";import{m as Ln,z as Rn}from"./BPQFiQQc.js";import{I as Nt}from"./DaWmj23r.js";import{d as $n}from"./CQ409-Pj.js";import{H as Tn,I as Un}from"./Bqd7fdCF.js";import{a as An,e as Bn,h as On,g as Nn,k as Mn,p as Dn,b as oo}from"./D4WPlvMg.js";import{e as Vn}from"./CYxt6gzD.js";import{i as ar}from"./CL3a4Hm1.js";import{i as zn,a as Wn}from"./KZwZoyIt.js";import{B as Gn}from"./GnUYJfg_.js";import"./hkJYqn41.js";import{l as ze}from"./Cu5e4npY.js";import{M as no}from"./B6dUCFoz.js";import"./C4jSaPCg.js";import"./CEE0831H.js";import{b as qn}from"./CVWwz1Ss.js";import"./CgrVbtN0.js";import{t as Hn,b as Kn}from"./CXXVPWBH.js";import{T as jn}from"./DxyD9o0t.js";import{c as Zn,d as Xn}from"./BksTLNI4.js";import{o as $r,s as wt,n as Bt}from"./CIyUrgF0.js";import{g as Jn}from"./DWGXN6Nr.js";import{f as Yn}from"./BfnPC1r8.js";import{ay as Qn,$ as ea}from"./J2YvrN12.js";import{a_ as ta}from"./C2UL5Ler.js";import{i as ra}from"./DKwAaLwd.js";import{o as oa}from"./C3dytrTL.js";function na(o,t){return o.loadURL(t)}function aa(o){return{previousUrlProp:o||null}}function Tr(o,t){o.previousUrlProp=t}function ia(o,t,n){const g=n||t;return o.previousUrlProp===g?null:(o.previousUrlProp=g,g)}function sa(o,t,n){return t?o.previousUrlProp===null?(o.previousUrlProp=t,{shouldLoad:!1,targetUrl:null}):t===o.previousUrlProp?{shouldLoad:!1,targetUrl:null}:n.webviewReady?(o.previousUrlProp=t,n.isValidBrowserUrl(t)?{shouldLoad:!0,targetUrl:t}:{shouldLoad:!1,targetUrl:null}):{shouldLoad:!1,targetUrl:null}:{shouldLoad:!1,targetUrl:null}}const ao=Dt("TabBoundsReporter"),la=150;function Qt(o,t,n){!(t>0)||!(n>0)||window.electronAPI?.invoke("browser:report-tab-bounds",{tabId:o,width:t,height:n}).catch(g=>{ao.debug("Failed to report tab bounds",{tabId:o,error:g})})}function Ur(o){window.electronAPI?.invoke("browser:report-tab-bounds",{tabId:o}).catch(t=>{ao.debug("Failed to clear tab bounds",{tabId:o,error:t})})}function io(o,t){let n=t,g;const m=typeof ResizeObserver>"u"?void 0:new ResizeObserver(P=>{if(!n)return;const b=P[P.length-1]?.contentRect;if(!b)return;const F=n;clearTimeout(g),g=setTimeout(()=>{Qt(F,b.width,b.height)},la)});if(m?.observe(o),n){const P=o.getBoundingClientRect();Qt(n,P.width,P.height)}return{update(P){if(P!==n&&(clearTimeout(g),n&&Ur(n),n=P,n)){const b=o.getBoundingClientRect();Qt(n,b.width,b.height)}},destroy(){clearTimeout(g),m?.disconnect(),n&&Ur(n)}}}function so(o){let t=o.trim();if(!t)return null;/^[a-z][a-z0-9+.-]*:\/\//i.test(t)||(t=(t.includes("localhost")||t.includes("127.0.0.1")||t.includes("0.0.0.0")?"http://":"https://")+t);try{return new URL(t),t}catch{return null}}function dt(o,t=typeof window<"u"?window.location.origin:""){return o==="about:blank"||lo(o,t)}function lo(o,t=typeof window<"u"?window.location.origin:""){if(!o)return!1;try{const n=new URL(o);return ro.NAVIGATION_ALLOWED.includes(n.protocol)&&n.origin!==t}catch{return!1}}const Mt=[{id:"iphone-se",name:"iPhone SE",category:"phone",width:375,height:667},{id:"iphone-15",name:"iPhone 15",category:"phone",width:393,height:852},{id:"pixel-8",name:"Pixel 8",category:"phone",width:412,height:915},{id:"ipad-mini",name:"iPad Mini",category:"tablet",width:768,height:1024},{id:"ipad-pro-11",name:"iPad Pro 11″",category:"tablet",width:834,height:1194},{id:"desktop-1280x800",name:"1280 × 800",category:"desktop",width:1280,height:800},{id:"desktop-1440x900",name:"1440 × 900",category:"desktop",width:1440,height:900}];function da(o){return{...o,width:o.height,height:o.width}}var ua=re('<span class="min-w-0 flex-1 truncate"> </span> <span class="type-caption ml-3 text-muted-foreground"> </span>',1),er=re("<!> <!> <!>",1),ca=re('<span class="min-w-0 flex-1"> </span> <span class="type-caption text-muted-foreground"> </span>',1),tr=re("<!> <!>",1);function cr(o,t){if(new.target)return je({component:cr,...o});Je(t,!0);let n=v(t,"viewport",7),g=v(t,"onViewportChange",7),m=v(t,"onCustom",7);const P=["phone","tablet","desktop"],b=f(()=>n().mode==="fit"?"fit":n().mode==="preset"?n().presetId:"custom");function F(u){if(u==="fit")return g()({mode:"fit"});const k=Mt.find(O=>O.id===u);k&&g()({mode:"preset",presetId:k.id,width:k.width,height:k.height})}var A={get viewport(){return n()},set viewport(u){n(u),w()},get onViewportChange(){return g()},set onViewportChange(u){g(u),w()},get onCustom(){return m()},set onCustom(u){m(u),w()},$set:Ze,$on:(u,k)=>Xe(t,u,k)},S=er(),s=H(S);Y(s,()=>hn,(u,k)=>{k(u,{get value(){return e(b)},onValueChange:F,children:(O,x)=>{var I=er(),R=H(I);Y(R,()=>Yt,(G,K)=>{K(G,{value:"fit",children:(oe,te)=>{ht();var X=ct();D(le=>J(X,le),[()=>c.browser_viewport_fitPanel_label()]),C(oe,X)},$$slots:{default:!0}})});var T=h(R,2);Pr(T,17,()=>P,Go,(G,K)=>{var oe=er(),te=H(oe);Y(te,()=>mt,(B,ae)=>{ae(B,{})});var X=h(te,2);Y(X,()=>_n,(B,ae)=>{ae(B,{children:(a,l)=>{ht();var j=ct();D(ue=>J(j,ue),[()=>e(K)==="phone"?c.browser_viewport_phoneGroup_label():e(K)==="tablet"?c.browser_viewport_tabletGroup_label():c.browser_viewport_desktopGroup_label()]),C(a,j)},$$slots:{default:!0}})});var le=h(X,2);Pr(le,17,()=>Mt.filter(B=>B.category===e(K)),B=>B.id,(B,ae)=>{var a=ut(),l=H(a);Y(l,()=>Yt,(j,ue)=>{ue(j,{get value(){return e(ae).id},children:(Ie,he)=>{var M=ua(),_=H(M),Z=ke(_,!0),V=h(_,2),z=ke(V,!0);D(y=>{J(Z,e(ae).name),J(z,y)},[()=>c.browser_viewport_dimensions_label({width:ze(e(ae).width),height:ze(e(ae).height)})]),C(Ie,M)},$$slots:{default:!0}})}),C(B,a)}),C(G,oe)});var ee=h(T,2);{var ge=G=>{var K=tr(),oe=H(K);Y(oe,()=>mt,(X,le)=>{le(X,{})});var te=h(oe,2);Y(te,()=>Yt,(X,le)=>{le(X,{value:"custom",get onSelect(){return m()},children:(B,ae)=>{var a=ca(),l=H(a),j=ke(l,!0),ue=h(l,2),Ie=ke(ue,!0);D((he,M)=>{J(j,he),J(Ie,M)},[()=>c.browser_viewport_custom_label(),()=>c.browser_viewport_dimensions_label({width:ze(n().width),height:ze(n().height)})]),C(B,a)},$$slots:{default:!0}})}),C(G,K)};be(ee,G=>{n().mode==="custom"&&G(ge)})}C(O,I)},$$slots:{default:!0}})});var L=h(s,2);{var Q=u=>{var k=tr(),O=H(k);Y(O,()=>mt,(I,R)=>{R(I,{})});var x=h(O,2);Y(x,()=>Ke,(I,R)=>{R(I,{get onSelect(){return m()},children:(T,ee)=>{ht();var ge=ct();D(G=>J(ge,G),[()=>c.browser_viewport_custom_label()]),C(T,ge)},$$slots:{default:!0}})}),C(u,k)};be(L,u=>{n().mode!=="custom"&&u(Q)})}var U=h(L,2);{var $=u=>{var k=tr(),O=H(k);Y(O,()=>mt,(I,R)=>{R(I,{})});var x=h(O,2);{let I=f(()=>c.browser_viewport_rotate_label());Y(x,()=>no,(R,T)=>{T(R,{get icon(){return jr},get label(){return e(I)},onSelect:()=>g()(da(n()))})})}C(u,k)};be(U,u=>{n().mode!=="fit"&&u($)})}return C(o,S),Ye(A)}var fa=re('<div class="grid grid-cols-2 gap-3"><label class="space-y-1 type-caption"><span> </span> <!></label> <label class="space-y-1 type-caption"><span> </span> <!></label></div>');function fr(o,t){if(new.target)return je({component:fr,...o});Je(t,!0);let n=v(t,"open",15,!1),g=v(t,"viewport",7),m=v(t,"onViewportChange",7),P=v(t,"returnFocus",7);const b=320,F=3840;let A=W(1280),S=W(800),s=W(null);function L(u){return typeof u=="number"&&Number.isInteger(u)&&u>=b&&u<=F}const Q=f(()=>L(e(A))&&L(e(S)));Ue(()=>{if(n())return()=>{It().then(()=>{P()?.isConnected&&P().focus()})}}),Ue(()=>{n()||(d(A,g().mode==="fit"?1280:g().width,!0),d(S,g().mode==="fit"?800:g().height,!0))});function U(){!e(Q)||e(A)===null||e(S)===null||(m()({mode:"custom",width:e(A),height:e(S)}),n(!1))}var $={get open(){return n()},set open(u=!1){n(u),w()},get viewport(){return g()},set viewport(u){g(u),w()},get onViewportChange(){return m()},set onViewportChange(u){m(u),w()},get returnFocus(){return P()},set returnFocus(u){P(u),w()},$set:Ze,$on:(u,k)=>Xe(t,u,k)};{let u=f(()=>c.browser_viewport_custom_label()),k=f(()=>c.browser_viewport_sizeRange_description({min:ze(b),max:ze(F)})),O=f(()=>c.browser_viewport_apply_label());qn(o,{get title(){return e(u)},get description(){return e(k)},get submitLabel(){return e(O)},get canSubmit(){return e(Q)},onSubmit:U,get initialFocus(){return e(s)},get open(){return n()},set open(x){n(x)},children:(x,I)=>{var R=fa(),T=ie(R),ee=ie(T),ge=ke(ee,!0),G=h(ee,2);{let le=f(()=>!L(e(A)));Nt(G,{type:"number",min:b,max:F,step:"1",get"aria-invalid"(){return e(le)},get value(){return e(A)},set value(B){d(A,B,!0)},get ref(){return e(s)},set ref(B){d(s,B,!0)}})}se(T);var K=h(T,2),oe=ie(K),te=ke(oe,!0),X=h(oe,2);{let le=f(()=>!L(e(S)));Nt(X,{type:"number",min:b,max:F,step:"1",get"aria-invalid"(){return e(le)},get value(){return e(S)},set value(B){d(S,B,!0)}})}se(K),se(R),D((le,B)=>{J(ge,le),J(te,B)},[()=>c.browser_viewport_width_label(),()=>c.browser_viewport_height_label()]),C(x,R)},$$slots:{default:!0}})}return Ye($)}var Ot=re("<!> <!>",1),ot=re("<!> ",1),ga=re('<!> <span class="min-w-0 flex-1 truncate"> </span>',1),va=re("<!> <!> <!> <!> <!>",1),wa=re('<!> <span class="min-w-0 flex-1"> </span> <kbd class="type-caption ml-5 text-muted-foreground" aria-hidden="true">⌘⌥I</kbd>',1),pa=re("<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>",1);function uo(o,t){if(new.target)return je({component:uo,...o});Je(t,!0);let n=v(t,"errorCount",7,0),g=v(t,"disabled",7,!1),m=v(t,"collapsed",7,!1),P=v(t,"canGoBack",7,!1),b=v(t,"canGoForward",7,!1),F=v(t,"canSelectElement",7,!1),A=v(t,"selectingElement",7,!1),S=v(t,"viewport",23,()=>({mode:"fit"})),s=v(t,"onGoBack",7),L=v(t,"onGoForward",7),Q=v(t,"onToggleElementPicker",7),U=v(t,"onViewportChange",7),$=v(t,"onOpenExternal",7),u=v(t,"onFullScreen",7),k=v(t,"onCopyUrl",7),O=v(t,"onScreenshot",7),x=v(t,"onOpenConsole",7),I=v(t,"onOpenSource",7),R=v(t,"onOpenInspector",7),T=v(t,"onReloadWithoutCache",7);const ee=f(()=>n()>0?c.browser_overflow_triggerWithErrors_ariaLabel({count:ze(n())}):c.browser_overflow_trigger_ariaLabel()),ge=f(()=>S().mode==="preset"?Mt.find(l=>l.id===S().presetId):void 0),G=f(()=>S().mode==="fit"?c.browser_viewport_fitPanel_label():e(ge)?.name??c.browser_viewport_dimensions_label({width:ze(S().width),height:ze(S().height)}));let K=W(!1),oe=W(null),te=W(!1);async function X(){d(te,!1),await It(),d(K,!0)}var le={get errorCount(){return n()},set errorCount(l=0){n(l),w()},get disabled(){return g()},set disabled(l=!1){g(l),w()},get collapsed(){return m()},set collapsed(l=!1){m(l),w()},get canGoBack(){return P()},set canGoBack(l=!1){P(l),w()},get canGoForward(){return b()},set canGoForward(l=!1){b(l),w()},get canSelectElement(){return F()},set canSelectElement(l=!1){F(l),w()},get selectingElement(){return A()},set selectingElement(l=!1){A(l),w()},get viewport(){return S()},set viewport(l={mode:"fit"}){S(l),w()},get onGoBack(){return s()},set onGoBack(l){s(l),w()},get onGoForward(){return L()},set onGoForward(l){L(l),w()},get onToggleElementPicker(){return Q()},set onToggleElementPicker(l){Q(l),w()},get onViewportChange(){return U()},set onViewportChange(l){U(l),w()},get onOpenExternal(){return $()},set onOpenExternal(l){$(l),w()},get onFullScreen(){return u()},set onFullScreen(l){u(l),w()},get onCopyUrl(){return k()},set onCopyUrl(l){k(l),w()},get onScreenshot(){return O()},set onScreenshot(l){O(l),w()},get onOpenConsole(){return x()},set onOpenConsole(l){x(l),w()},get onOpenSource(){return I()},set onOpenSource(l){I(l),w()},get onOpenInspector(){return R()},set onOpenInspector(l){R(l),w()},get onReloadWithoutCache(){return T()},set onReloadWithoutCache(l){T(l),w()},$set:Ze,$on:(l,j)=>Xe(t,l,j)},B=Ot(),ae=H(B);Y(ae,()=>to,(l,j)=>{j(l,{get open(){return e(te)},set open(ue){d(te,ue,!0)},children:(ue,Ie)=>{var he=Ot(),M=H(he);{const Z=(V,z)=>{let y=()=>(z?.()).props;{let q=f(()=>c.browser_overflow_trigger_tooltip());Oe(V,lr(y,{variant:"ghost-light",size:"icon-xs",class:"relative",get disabled(){return g()},get tooltip(){return e(q)},tooltipSide:"bottom",get"aria-label"(){return e(ee)},"data-testid":"browser-overflow-trigger",get ref(){return e(oe)},set ref(E){d(oe,E,!0)},children:(E,Pe)=>{var fe=Ot(),Qe=H(fe);yn(Qe,{class:"size-3.5"});var nt=h(Qe,2);{var We=Fe=>{Gn(Fe,{variant:"destructive",class:"absolute -right-1.5 -top-1.5 h-4 min-w-4 px-1 text-xs leading-none","data-testid":"browser-console-error-badge",children:(Ge,at)=>{ht();var it=ct();D(Me=>J(it,Me),[()=>n()>9?"9+":ze(n())]),C(Ge,it)},$$slots:{default:!0}})};be(nt,Fe=>{n()>0&&Fe(We)})}C(E,fe)},$$slots:{default:!0}}))}};Y(M,()=>Qr,(V,z)=>{z(V,{child:Z,$$slots:{child:!0}})})}var _=h(M,2);Y(_,()=>eo,(Z,V)=>{V(Z,{align:"end",class:"w-56",onCloseAutoFocus:z=>e(K)&&z.preventDefault(),children:(z,y)=>{var q=pa(),E=H(q);{var Pe=ve=>{var we=va(),Ee=H(we);{let ce=f(()=>!P());Y(Ee,()=>Ke,(xe,De)=>{De(xe,{get disabled(){return e(ce)},get onSelect(){return s()},children:(Ne,st)=>{var Ce=ot(),He=H(Ce);ye(He,{get icon(){return dr},size:"xs",class:"w-4 text-muted-foreground"});var et=h(He);D(Ve=>J(et,` ${Ve??""}`),[()=>c.browser_embedded_goBack_ariaLabel()]),C(Ne,Ce)},$$slots:{default:!0}})})}var Re=h(Ee,2);{let ce=f(()=>!b());Y(Re,()=>Ke,(xe,De)=>{De(xe,{get disabled(){return e(ce)},get onSelect(){return L()},children:(Ne,st)=>{var Ce=ot(),He=H(Ce);ye(He,{get icon(){return ur},size:"xs",class:"w-4 text-muted-foreground"});var et=h(He);D(Ve=>J(et,` ${Ve??""}`),[()=>c.browser_embedded_goForward_ariaLabel()]),C(Ne,Ce)},$$slots:{default:!0}})})}var pe=h(Re,2);{let ce=f(()=>!F());Y(pe,()=>Ke,(xe,De)=>{De(xe,{get disabled(){return e(ce)},onSelect:()=>void Q()?.(),children:(Ne,st)=>{var Ce=ot(),He=H(Ce);ye(He,{get icon(){return nr},size:"xs",class:"w-4 text-muted-foreground"});var et=h(He);D(Ve=>J(et,` ${Ve??""}`),[()=>A()?c.browser_embedded_cancelElementSelection_ariaLabel():c.browser_embedded_selectElement_ariaLabel()]),C(Ne,Ce)},$$slots:{default:!0}})})}var me=h(pe,2);Y(me,()=>xn,(ce,xe)=>{xe(ce,{children:(De,Ne)=>{var st=Ot(),Ce=H(st);{let et=f(()=>!U());Y(Ce,()=>Cn,(Ve,ft)=>{ft(Ve,{get disabled(){return e(et)},children:(St,gt)=>{var Pt=ga(),Et=H(Pt);ye(Et,{get icon(){return Zr},size:"xs",class:"w-4 text-muted-foreground"});var Ft=h(Et,2),Ut=ke(Ft,!0);D(Lt=>J(Ut,Lt),[()=>c.browser_viewport_trigger_ariaLabel({mode:e(G)})]),C(St,Pt)},$$slots:{default:!0}})})}var He=h(Ce,2);Y(He,()=>In,(et,Ve)=>{Ve(et,{class:"w-64",children:(ft,St)=>{cr(ft,{get viewport(){return S()},onViewportChange:gt=>U()?.(gt),onCustom:X})},$$slots:{default:!0}})}),C(De,st)},$$slots:{default:!0}})});var Ae=h(me,2);Y(Ae,()=>mt,(ce,xe)=>{xe(ce,{})}),C(ve,we)};be(E,ve=>{m()&&ve(Pe)})}var fe=h(E,2);{var Qe=ve=>{var we=ut(),Ee=H(we);Y(Ee,()=>Ke,(Re,pe)=>{pe(Re,{onSelect:()=>u()(),children:(me,Ae)=>{var ce=ot(),xe=H(ce);ye(xe,{get icon(){return tn},size:"xs",class:"w-4 text-muted-foreground"});var De=h(xe);D(Ne=>J(De,` ${Ne??""}`),[()=>c.browser_overflow_fullScreen_label()]),C(me,ce)},$$slots:{default:!0}})}),C(ve,we)},nt=ve=>{var we=ut(),Ee=H(we);Y(Ee,()=>Ke,(Re,pe)=>{pe(Re,{onSelect:()=>void $()(),children:(me,Ae)=>{var ce=ot(),xe=H(ce);ye(xe,{get icon(){return rn},size:"xs",class:"w-4 text-muted-foreground"});var De=h(xe);D(Ne=>J(De,` ${Ne??""}`),[()=>c.browser_overflow_openExternal_label()]),C(me,ce)},$$slots:{default:!0}})}),C(ve,we)};be(fe,ve=>{u()?ve(Qe):$()&&ve(nt,1)})}var We=h(fe,2);Y(We,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void k()(),children:(Ee,Re)=>{var pe=ot(),me=H(pe);ye(me,{get icon(){return Jo},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me);D(ce=>J(Ae,` ${ce??""}`),[()=>c.browser_overflow_copyUrl_label()]),C(Ee,pe)},$$slots:{default:!0}})});var Fe=h(We,2);Y(Fe,()=>mt,(ve,we)=>{we(ve,{})});var Ge=h(Fe,2);Y(Ge,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void O()(),children:(Ee,Re)=>{var pe=ot(),me=H(pe);ye(me,{get icon(){return Yo},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me);D(ce=>J(Ae,` ${ce??""}`),[()=>c.browser_overflow_screenshot_label()]),C(Ee,pe)},$$slots:{default:!0}})});var at=h(Ge,2);Y(at,()=>mt,(ve,we)=>{we(ve,{})});var it=h(at,2);Y(it,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void x()(),children:(Ee,Re)=>{var pe=ot(),me=H(pe);ye(me,{get icon(){return Qo},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me);D(ce=>J(Ae,` ${ce??""}`),[()=>c.browser_overflow_console_label()]),C(Ee,pe)},$$slots:{default:!0}})});var Me=h(it,2);Y(Me,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void I()(),children:(Ee,Re)=>{var pe=ot(),me=H(pe);ye(me,{get icon(){return en},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me);D(ce=>J(Ae,` ${ce??""}`),[()=>c.browser_overflow_source_label()]),C(Ee,pe)},$$slots:{default:!0}})});var qe=h(Me,2);Y(qe,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void R()(),children:(Ee,Re)=>{var pe=wa(),me=H(pe);ye(me,{get icon(){return nr},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me,2),ce=ke(Ae,!0);ht(2),D(xe=>J(ce,xe),[()=>c.browser_overflow_inspector_label()]),C(Ee,pe)},$$slots:{default:!0}})});var Le=h(qe,2);Y(Le,()=>mt,(ve,we)=>{we(ve,{})});var _t=h(Le,2);Y(_t,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void T()(),children:(Ee,Re)=>{var pe=ot(),me=H(pe);ye(me,{get icon(){return jr},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me);D(ce=>J(Ae,` ${ce??""}`),[()=>c.browser_overflow_reloadWithoutCache_label()]),C(Ee,pe)},$$slots:{default:!0}})}),C(z,q)},$$slots:{default:!0}})}),C(ue,he)},$$slots:{default:!0}})});var a=h(ae,2);return fr(a,{get viewport(){return S()},onViewportChange:l=>U()?.(l),get returnFocus(){return e(oe)},get open(){return e(K)},set open(l){d(K,l,!0)}}),C(o,B),Ye(le)}var ba=re('<span class="truncate"> </span> <!>',1),Ar=re("<!> <!>",1);function co(o,t){if(new.target)return je({component:co,...o});Je(t,!0);let n=v(t,"viewport",7),g=v(t,"onViewportChange",7),m=W(!1),P=W(!1),b=W(null);const F=f(()=>n().mode==="preset"?Mt.find(k=>k.id===n().presetId):void 0),A=f(()=>n().mode==="fit"?"":c.browser_viewport_dimensions_label({width:ze(n().width),height:ze(n().height)})),S=f(()=>n().mode==="fit"?c.browser_viewport_fit_short_label():n().mode==="preset"&&e(F)?e(F).name:e(A)),s=f(()=>n().mode==="fit"?c.browser_viewport_fitPanel_label():e(S));async function L(){d(m,!1),await It(),d(P,!0)}var Q={get viewport(){return n()},set viewport(k){n(k),w()},get onViewportChange(){return g()},set onViewportChange(k){g(k),w()},$set:Ze,$on:(k,O)=>Xe(t,k,O)},U=Ar(),$=H(U);Y($,()=>to,(k,O)=>{O(k,{get open(){return e(m)},set open(x){d(m,x,!0)},children:(x,I)=>{var R=Ar(),T=H(R);{const ge=(G,K)=>{let oe=()=>(K?.()).props;{let te=f(()=>c.browser_viewport_trigger_ariaLabel({mode:e(s)}));Oe(G,lr(oe,{variant:"ghost-light",size:"xs",class:"h-6 max-w-36 gap-1 rounded-full bg-muted px-2 text-xs hover:bg-muted/80",get"aria-label"(){return e(te)},"data-testid":"browser-viewport-trigger",get ref(){return e(b)},set ref(X){d(b,X,!0)},children:(X,le)=>{var B=ba(),ae=H(B),a=ke(ae,!0),l=h(ae,2);ye(l,{get icon(){return on},size:"xs",class:"shrink-0"}),D(()=>J(a,e(S))),C(X,B)},$$slots:{default:!0}}))}};Y(T,()=>Qr,(G,K)=>{K(G,{child:ge,$$slots:{child:!0}})})}var ee=h(T,2);Y(ee,()=>eo,(ge,G)=>{G(ge,{align:"end",class:"w-64",onCloseAutoFocus:K=>e(P)&&K.preventDefault(),children:(K,oe)=>{cr(K,{get viewport(){return n()},get onViewportChange(){return g()},onCustom:L})},$$slots:{default:!0}})}),C(x,R)},$$slots:{default:!0}})});var u=h($,2);return fr(u,{get viewport(){return n()},get onViewportChange(){return g()},get returnFocus(){return e(b)},get open(){return e(P)},set open(k){d(P,k,!0)}}),C(o,U),Ye(Q)}var ma=re('<span data-browser-viewport-readout=""> </span> <!>',1),ha=re('<div data-browser-device-frame-container=""><div><div><!> <!></div> <!></div></div>');function fo(o,t){if(new.target)return je({component:fo,...o});Je(t,!0);const n=320,g=3840,m=150,P=24;let b=v(t,"viewport",7),F=v(t,"onViewportChange",7),A=v(t,"chromeOutside",7,!1),S=v(t,"children",7),s=W(Rt(b().mode==="fit"?n:b().width)),L=W(Rt(b().mode==="fit"?n:b().height)),Q,U=W(0),$=W(0),u=W(!1),k=null,O=0,x=0,I=0,R=0,T;const ee=f(()=>b().mode==="fit"),ge=f(()=>c.browser_viewport_dimensions_label({width:ze(e(s)),height:ze(e(L))})),G=f(()=>A()?Math.max(0,e($)-P):e($)),K=f(()=>!e(ee)&&e(U)>0&&e(G)>0?Math.min(1,e(U)/e(s),e(G)/e(L)):1),oe=f(()=>e(s)*e(K)),te=f(()=>e(L)*e(K));Ue(()=>{e(u)||b().mode==="fit"||(d(s,b().width,!0),d(L,b().height,!0))});function X(y){return Math.min(g,Math.max(n,Math.round(y)))}function le(){F()({mode:"custom",width:e(s),height:e(L)})}function B(){clearTimeout(T),T=setTimeout(le,m)}function ae(y){e(ee)||y.button!==0||(y.preventDefault(),d(u,!0),k=y.pointerId,O=y.clientX,x=y.clientY,I=e(s),R=e(L),y.currentTarget instanceof HTMLElement&&y.currentTarget.setPointerCapture?.(y.pointerId))}function a(y){!e(u)||y.pointerId!==k||(d(s,X(I+y.clientX-O),!0),d(L,X(R+y.clientY-x),!0),B())}function l(y){if(!e(u)||y.pointerId!==k)return;clearTimeout(T),d(u,!1),k=null;const q=y.currentTarget;q instanceof HTMLElement&&q.hasPointerCapture?.(y.pointerId)&&q.releasePointerCapture&&q.releasePointerCapture(y.pointerId),le()}qr(()=>{const y=(E,Pe)=>{d(U,E,!0),d($,Pe,!0)};y(Q.clientWidth,Q.clientHeight);const q=typeof ResizeObserver>"u"?void 0:new ResizeObserver(([E])=>{y(E?.contentRect.width??Q.clientWidth,E?.contentRect.height??Q.clientHeight)});return q?.observe(Q),()=>q?.disconnect()}),Hr(()=>clearTimeout(T));var j={get viewport(){return b()},set viewport(y){b(y),w()},get onViewportChange(){return F()},set onViewportChange(y){F(y),w()},get chromeOutside(){return A()},set chromeOutside(y=!1){A(y),w()},get children(){return S()},set children(y){S(y),w()},$set:Ze,$on:(y,q)=>Xe(t,y,q)},ue=ha();{const y=E=>{var Pe=ma(),fe=H(Pe),Qe=ke(fe,!0),nt=h(fe,2);{let We=f(()=>A()?"top-full":"bottom-0"),Fe=f(()=>c.browser_viewport_resizeHandle_ariaLabel());Oe(nt,{type:"button",variant:"ghost",size:"icon-xs",iconOnly:!0,get class(){return`absolute right-0 z-20 size-5 cursor-nwse-resize touch-none border-0 bg-transparent p-0 after:absolute after:bottom-1 after:right-1 after:size-2 after:border-b-2 after:border-r-2 after:border-muted-foreground ${e(We)??""}`},get"aria-label"(){return e(Fe)},"data-testid":"browser-device-resize-handle",onpointerdown:ae,onpointermove:a,onpointerup:l,onpointercancel:l})}D(()=>{xt(fe,1,`pointer-events-none absolute left-1/2 z-10 -translate-x-1/2 rounded bg-background/90 px-1.5 py-0.5 text-xs text-muted-foreground shadow-sm backdrop-blur ${A()?"top-full mt-0.5":"bottom-1"}`),J(Qe,e(ge))}),C(E,Pe)};var Ie=ie(ue),he=ie(Ie);let q;var M=ie(he);Xo(M,()=>S()??zo);var _=h(M,2);{var Z=E=>{y(E)};be(_,E=>{!e(ee)&&!A()&&E(Z)})}se(he);var V=h(he,2);{var z=E=>{y(E)};be(V,E=>{!e(ee)&&A()&&E(z)})}se(Ie),se(ue),kt(ue,E=>Q=E,()=>Q),D(()=>{xt(Ie,1,`relative ${e(ee)?"h-full w-full":""} ${A()&&!e(ee)?"mb-6":""}`),xt(he,1,`relative overflow-hidden bg-background ${e(ee)?"h-full w-full":e(u)?"ring-2 ring-primary/30":""}`),Be(he,"data-browser-device-frame",e(ee)?void 0:""),Be(he,"data-width",e(ee)?void 0:e(s)),Be(he,"data-height",e(ee)?void 0:e(L)),q=Ho(he,"",q,{width:e(ee)?void 0:`${e(oe)}px`,height:e(ee)?void 0:`${e(te)}px`})})}return D(()=>xt(ue,1,`flex h-full w-full items-center justify-center overflow-hidden ${e(ee)?"bg-background":"bg-muted/40"}`)),C(o,ue),Ye(j)}const rr=Dt("BrowserViewSlot"),Br=()=>new Promise(o=>requestAnimationFrame(()=>o())),Or=async()=>{await Br(),await Br()};function Nr(o,t){return o===t?!0:!o||!t?!1:o.x===t.x&&o.y===t.y&&o.width===t.width&&o.height===t.height}function Mr(o){const t=o.getBoundingClientRect();return t.width<=0||t.height<=0?null:{x:t.left,y:t.top,width:t.width,height:t.height}}function _a(o){return o.isConnected?typeof o.checkVisibility=="function"?o.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):!0:!1}function ya(o,t){let n=Dr(o,t),g=`${t.workspaceId}\0${t.tabId}`;return{update(m){const P=`${m.workspaceId}\0${m.tabId}`;if(P===g){n.update(m);return}n.destroy(),g=P,n=Dr(o,m)},destroy(){n.destroy()}}}function Dr(o,t){let n=t;const g=An(o,{tabId:n.tabId,workspaceId:n.workspaceId,url:n.url,...n.pinned===void 0?{}:{pinned:n.pinned}});n.onWebview?.(g.webview);let m=null,P=Promise.resolve(),b="live",F=0,A=null,S=null,s=!1;const L=()=>{A?.remove(),A=null},Q=x=>{m=x;const I=n.tabId;return P=On(I,x.rect,x.visible).catch(R=>rr.debug("Could not place the browser page",{tabId:I,error:R})),P},U=()=>{if(S=null,s)return;const x=Mr(o),I=n.visible&&x!==null&&_a(o)&&b!=="frozen"&&g.ready;g.ready&&(!m||m.visible!==I||x&&!Nr(m.rect,x))&&(Nr(m?.rect??null,x)||Kn(),Q({rect:x??m?.rect??null,visible:I})),S=requestAnimationFrame(U)};S=requestAnimationFrame(U);const $=async x=>{if(b="freezing",g.ready&&m?.visible)try{const I=await g.webview.capturePage?.();if(x!==F||s)return;const R=I?.toDataURL()??"";if(R){const T=document.createElement("img");if(T.alt="",T.setAttribute("aria-hidden","true"),T.dataset.browserViewSnapshot="",T.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;",T.src=R,await T.decode().catch(()=>{}),x!==F||s||(L(),o.append(T),A=T,await Or(),x!==F||s))return}}catch(I){rr.debug("Could not snapshot the browser page",{tabId:n.tabId,error:I})}x!==F||s||(b="frozen")},u=async x=>{if(b="thawing",g.ready&&n.visible){const I=Mr(o);I&&await Q({rect:I,visible:!0}),await Or()}x!==F||s||(L(),b="live")},k=Hn({element:o,onCoveredChange(x){const I=++F;x?$(I):u(I)}});return{update(x){n=x},destroy:()=>{const x=n.tabId;s=!0,S!==null&&cancelAnimationFrame(S),S=null,k(),L(),g.dispose(),n.onWebview?.(null),P.then(()=>Bn(x).catch(I=>rr.debug("Could not take the browser page off screen",{tabId:x,error:I})))}}}var xa=re('<div class="relative h-full w-full overflow-hidden"></div>');function go(o,t){if(new.target)return je({component:go,...o});Je(t,!0);let n=v(t,"tabId",7),g=v(t,"workspaceId",7),m=v(t,"url",7),P=v(t,"pinned",7),b=v(t,"visible",7),F=v(t,"webview",15,null);var A={get tabId(){return n()},set tabId(s){n(s),w()},get workspaceId(){return g()},set workspaceId(s){g(s),w()},get url(){return m()},set url(s){m(s),w()},get pinned(){return P()},set pinned(s){P(s),w()},get visible(){return b()},set visible(s){b(s),w()},get webview(){return F()},set webview(s=null){F(s),w()},$set:Ze,$on:(s,L)=>Xe(t,s,L)},S=xa();return Ct(S,(s,L)=>ya?.(s,L),()=>({tabId:n(),workspaceId:g(),url:m(),...P()===void 0?{}:{pinned:P()},visible:b(),onWebview:s=>F(s)})),Ct(S,(s,L)=>io?.(s,L),n),D(()=>Be(S,"data-browser-view-slot",n())),C(o,S),Ye(A)}function vo(o,t){if(new.target)return je({component:vo,...o});Je(t,!0);let n=v(t,"active",7),g=v(t,"disabled",7),m=v(t,"onToggle",7);var P={get active(){return n()},set active(b){n(b),w()},get disabled(){return g()},set disabled(b){g(b),w()},get onToggle(){return m()},set onToggle(b){m(b),w()},$set:Ze,$on:(b,F)=>Xe(t,b,F)};{let b=f(()=>n()?"bg-muted text-foreground":""),F=f(()=>n()?c.browser_embedded_cancelElementSelection_tooltip():c.browser_embedded_selectElement_tooltip()),A=f(()=>n()?c.browser_embedded_cancelElementSelection_ariaLabel():c.browser_embedded_selectElement_ariaLabel());Oe(o,{variant:"ghost-light",size:"icon-xs",get class(){return e(b)},get onclick(){return m()},get disabled(){return g()},get tooltip(){return e(F)},tooltipSide:"bottom",get"aria-label"(){return e(A)},get"aria-pressed"(){return n()},"data-testid":"browser-select-element",children:(S,s)=>{ye(S,{get icon(){return nr},size:"xs"})},$$slots:{default:!0}})}return Ye(P)}var Ca=re('<span class="sr-only"> </span>'),Ia=re('<p class="min-h-0 overflow-y-auto text-sm text-foreground [overflow-wrap:anywhere]"> </p> <!>',1),ka=re("<!> <!>",1),Pa=re('<span class="inline-flex shrink-0"><!> <!></span>');function gr(o,t){const n=Kr();if(new.target)return je({component:gr,...o});Je(t,!0);let g=v(t,"label",7),m=v(t,"description",7),P=v(t,"ariaLabel",23,g),b=v(t,"tone",7,"info"),F=v(t,"actionLabel",7),A=v(t,"onAction",7),S=v(t,"actionFocusTarget",7),s=v(t,"descriptionId",7),L=W(!1),Q=!1;async function U(){Q=!0,d(L,!1),await It(),S()?.focus(),A()?.()}var $={get label(){return g()},set label(I){g(I),w()},get description(){return m()},set description(I){m(I),w()},get ariaLabel(){return P()},set ariaLabel(I=g){P(I),w()},get tone(){return b()},set tone(I="info"){b(I),w()},get actionLabel(){return F()},set actionLabel(I){F(I),w()},get onAction(){return A()},set onAction(I){A(I),w()},get actionFocusTarget(){return S()},set actionFocusTarget(I){S(I),w()},get descriptionId(){return s()},set descriptionId(I){s(I),w()},$set:Ze,$on:(I,R)=>Xe(t,I,R)},u=Pa(),k=ie(u);{var O=I=>{var R=Ca(),T=ke(R,!0);D(()=>{Be(R,"id",n),Be(R,"role",b()==="error"?"alert":"status"),J(T,m())}),C(I,R)};be(k,I=>{s()||I(O)})}var x=h(k,2);return Y(x,()=>Xn,(I,R)=>{R(I,{get open(){return e(L)},set open(T){d(L,T,!0)},children:(T,ee)=>{var ge=ka(),G=H(ge);{const oe=(te,X)=>{let le=()=>(X?.()).props;{let B=f(()=>b()==="error"?"text-danger":b()==="warning"?"text-warning-ink":"text-muted-foreground"),ae=f(()=>s()??n);Oe(te,lr(le,{variant:"ghost-light",size:"icon-compact",wrapContent:!1,get class(){return e(B)},get"aria-label"(){return P()},get"aria-describedby"(){return e(ae)},get tooltip(){return m()},get tooltipDisabled(){return e(L)},tooltipSide:"bottom",tooltipDelayDuration:300,children:(a,l)=>{{let j=f(()=>b()==="error"?Xr:b()==="warning"?nn:Zr);ye(a,{get icon(){return e(j)},size:"xs",class:"shrink-0"})}},$$slots:{default:!0}}))}};Y(G,()=>jn,(te,X)=>{X(te,{child:oe,$$slots:{child:!0}})})}var K=h(G,2);Y(K,()=>Zn,(oe,te)=>{te(oe,{align:"end",class:"flex max-h-[var(--bits-popover-content-available-height,calc(100dvh-1rem))] w-72 max-w-[calc(100vw-1rem)] flex-col gap-3 p-3",get"aria-label"(){return P()},onCloseAutoFocus:X=>{Q&&S()&&(X.preventDefault(),S().focus()),Q=!1},children:(X,le)=>{var B=Ia(),ae=H(B),a=ke(ae,!0),l=h(ae,2);{var j=ue=>{Oe(ue,{variant:"secondary",size:"sm",class:"self-start",onclick:()=>void U(),children:(Ie,he)=>{ht();var M=ct();D(()=>J(M,F())),C(Ie,M)},$$slots:{default:!0}})};be(l,ue=>{F()&&A()&&ue(j)})}D(()=>J(a,m())),C(X,B)},$$slots:{default:!0}})}),C(T,ge)},$$slots:{default:!0}})}),se(u),D(()=>Be(u,"data-browser-status",b())),C(o,u),Ye($)}function Ea(o,t,n){const g=n.width>0?t.width/n.width:1,m=n.height>0?t.height/n.height:1,P=Math.max(0,Math.floor(o.x*g)),b=Math.max(0,Math.floor(o.y*m)),F=Math.min(t.width,Math.ceil((o.x+o.width)*g)),A=Math.min(t.height,Math.ceil((o.y+o.height)*m));return{x:P,y:b,width:Math.max(0,F-P),height:Math.max(0,A-b)}}const Fa=$r({selector:wt().min(1),domPath:wt().min(1),tagName:wt().min(1),id:wt(),className:wt(),textSnippet:wt().max(120),rect:$r({x:Bt().finite(),y:Bt().finite(),width:Bt().finite().nonnegative(),height:Bt().finite().nonnegative()}).strict(),pageUrl:wt().min(1),sourceRef:wt().min(1).optional()}).strict(),Vr="__INTENT_ELEMENT_PICKED__:";function Sa(o){if(o==="__INTENT_ELEMENT_PICK_CANCELLED__")return{type:"cancelled"};if(!o.startsWith(Vr))return null;let t;try{t=JSON.parse(o.slice(Vr.length))}catch{t=null}const n=Fa.safeParse(t);return n.success?{type:"picked",element:n.data}:{type:"malformed",issues:n.error.issues}}const La=String.raw`
|
|
2
2
|
(function() {
|
|
3
3
|
var PICKED_PREFIX = '__INTENT_ELEMENT_PICKED__:';
|
|
4
4
|
var CANCELLED = '__INTENT_ELEMENT_PICK_CANCELLED__';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/DICr2Lvd.js","/app/immutable/chunks/lwn02icp.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as r}from"./CLAmm_T1.js";import{bn as L}from"./
|
|
2
|
+
import{_ as r}from"./CLAmm_T1.js";import{bn as L}from"./cTFeOFQC.js";function u(t){const m=[],p=new Set;for(const e of D(t.themes)){const i=s(e)?e.getThemes():[e];for(const o of i){if(p.has(o.name))throw new Error(`Theme collection already contains theme "${o.name}"`);p.add(o.name),m.push(o)}}const _=Object.freeze([...m]),l=Object.freeze(_.filter(e=>e.colorScheme==="light")),d=Object.freeze(_.filter(e=>e.colorScheme==="dark")),n=new Map(_.map(e=>[e.name,e])),I=Object.freeze(_.map(e=>e.name)),P=Object.freeze(l.map(e=>e.name)),R=Object.freeze(d.map(e=>e.name));function E(e){if(e==null)return _;const{colorScheme:i,collection:o}=e;return o==null?i==="light"?l:i==="dark"?d:_:_.filter(a=>a.collection!==o?!1:i==null||a.colorScheme===i)}return{getTheme(e){return n.get(e)},getThemes(e){return E(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme==="light"?P:e?.colorScheme==="dark"?R:I:E(e).map(i=>i.name)},hasTheme(e){return n.has(e)},orderBy(e){return u({themes:_.map((i,o)=>({descriptor:i,index:o})).sort((i,o)=>{const a=e(i.descriptor,o.descriptor);return a!==0?a:i.index-o.index}).map(i=>i.descriptor)})},pick(e){const i=[],o=new Set;for(const a of e){if(o.has(a))throw new Error(`Theme collection pick already includes theme "${a}"`);o.add(a);const h=n.get(a);if(h==null)throw new Error(`Theme collection does not contain theme "${a}"`);i.push(h)}return u({themes:i})},registerInto(e){for(const i of _)e.registerThemeIfAbsent(i.name,i.load)}}}function D(t){return O(t)?[t]:t}function O(t){return s(t)||k(t)}function k(t){return typeof t.name=="string"&&typeof t.load=="function"}function s(t){return typeof t.getThemes=="function"}function T({name:t,load:m,colorScheme:p,collection:_,displayName:l}){return{name:t,colorScheme:p,collection:_,displayName:l,load:A(m)}}function A(t){return async()=>{const[m,{normalizeTheme:p}]=await Promise.all([t(),r(()=>import("./DICr2Lvd.js").then(_=>_.c),__vite__mapDeps([0,1]),import.meta.url)]);return p(L(m))}}const f="pierre",V=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],g=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],b=[...g,...V],S=new Set(g);function w(t){return S.has(t)?"light":"dark"}const y={"pierre-dark":"Pierre Dark","pierre-dark-soft":"Pierre Dark Soft","pierre-dark-vibrant":"Pierre Dark Vibrant","pierre-dark-protanopia-deuteranopia":"Pierre Dark Protanopia & Deuteranopia","pierre-dark-tritanopia":"Pierre Dark Tritanopia","pierre-light":"Pierre Light","pierre-light-soft":"Pierre Light Soft","pierre-light-vibrant":"Pierre Light Vibrant","pierre-light-protanopia-deuteranopia":"Pierre Light Protanopia & Deuteranopia","pierre-light-tritanopia":"Pierre Light Tritanopia"},z={"pierre-dark":()=>r(()=>import("./CyvmCCZW.js"),[],import.meta.url),"pierre-dark-soft":()=>r(()=>import("./BHGpRqa4.js"),[],import.meta.url),"pierre-dark-vibrant":()=>r(()=>import("./BWBVywrn.js"),[],import.meta.url),"pierre-dark-protanopia-deuteranopia":()=>r(()=>import("./Rgc0TwpF.js"),[],import.meta.url),"pierre-dark-tritanopia":()=>r(()=>import("./Beq2gCRQ.js"),[],import.meta.url),"pierre-light":()=>r(()=>import("./480U9XYS.js"),[],import.meta.url),"pierre-light-soft":()=>r(()=>import("./CVdyfjmI.js"),[],import.meta.url),"pierre-light-vibrant":()=>r(()=>import("./DdTDNdfJ.js"),[],import.meta.url),"pierre-light-protanopia-deuteranopia":()=>r(()=>import("./CaVOBURG.js"),[],import.meta.url),"pierre-light-tritanopia":()=>r(()=>import("./B4_gpKOM.js"),[],import.meta.url)};function H(t){return T({name:t,collection:f,colorScheme:w(t),displayName:y[t],load:z[t]})}const x=u({themes:b.map(t=>H(t))}),M="shiki",v=["ayu-light","catppuccin-latte","everforest-light","github-light","github-light-default","github-light-high-contrast","gruvbox-light-hard","gruvbox-light-medium","gruvbox-light-soft","horizon-bright","kanagawa-lotus","light-plus","material-theme-lighter","min-light","night-owl-light","one-light","rose-pine-dawn","slack-ochin","snazzy-light","solarized-light","vitesse-light"],N=["andromeeda","aurora-x","ayu-dark","ayu-mirage","catppuccin-frappe","catppuccin-macchiato","catppuccin-mocha","dark-plus","dracula","dracula-soft","everforest-dark","github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","gruvbox-dark-hard","gruvbox-dark-medium","gruvbox-dark-soft","horizon","houston","kanagawa-dragon","kanagawa-wave","laserwave","material-theme","material-theme-darker","material-theme-ocean","material-theme-palenight","min-dark","monokai","night-owl","nord","one-dark-pro","plastic","poimandres","red","rose-pine","rose-pine-moon","slack-dark","solarized-dark","synthwave-84","tokyo-night","vesper","vitesse-black","vitesse-dark"],C=new Set(v);function K(t){return C.has(t)?"light":"dark"}const j={andromeeda:()=>r(()=>import("./C4gqWexZ.js"),[],import.meta.url),"aurora-x":()=>r(()=>import("./D-2ljcwZ.js"),[],import.meta.url),"ayu-dark":()=>r(()=>import("./DYE7WIF3.js"),[],import.meta.url),"ayu-light":()=>r(()=>import("./BA47KaF1.js"),[],import.meta.url),"ayu-mirage":()=>r(()=>import("./32ctXXKs.js"),[],import.meta.url),"catppuccin-frappe":()=>r(()=>import("./CZL1YF0i.js"),[],import.meta.url),"catppuccin-latte":()=>r(()=>import("./DH-8KZSZ.js"),[],import.meta.url),"catppuccin-macchiato":()=>r(()=>import("./B7yYVSCf.js"),[],import.meta.url),"catppuccin-mocha":()=>r(()=>import("./Ct7hS0mc.js"),[],import.meta.url),"dark-plus":()=>r(()=>import("./C3mMm8J8.js"),[],import.meta.url),dracula:()=>r(()=>import("./BzJJZx-M.js"),[],import.meta.url),"dracula-soft":()=>r(()=>import("./BXkSAIEj.js"),[],import.meta.url),"everforest-dark":()=>r(()=>import("./BgDCqdQA.js"),[],import.meta.url),"everforest-light":()=>r(()=>import("./C8M2exoo.js"),[],import.meta.url),"github-dark":()=>r(()=>import("./DHJKELXO.js"),[],import.meta.url),"github-dark-default":()=>r(()=>import("./Cuk6v7N8.js"),[],import.meta.url),"github-dark-dimmed":()=>r(()=>import("./DH5Ifo-i.js"),[],import.meta.url),"github-dark-high-contrast":()=>r(()=>import("./E3gJ1_iC.js"),[],import.meta.url),"github-light":()=>r(()=>import("./DAi9KRSo.js"),[],import.meta.url),"github-light-default":()=>r(()=>import("./D7oLnXFd.js"),[],import.meta.url),"github-light-high-contrast":()=>r(()=>import("./BfjtVDDH.js"),[],import.meta.url),"gruvbox-dark-hard":()=>r(()=>import("./CFHQjOhq.js"),[],import.meta.url),"gruvbox-dark-medium":()=>r(()=>import("./GsRaNv29.js"),[],import.meta.url),"gruvbox-dark-soft":()=>r(()=>import("./CVdnzihN.js"),[],import.meta.url),"gruvbox-light-hard":()=>r(()=>import("./CH1njM8p.js"),[],import.meta.url),"gruvbox-light-medium":()=>r(()=>import("./DRw_LuNl.js"),[],import.meta.url),"gruvbox-light-soft":()=>r(()=>import("./hJgmCMqR.js"),[],import.meta.url),horizon:()=>r(()=>import("./BUw7H-hv.js"),[],import.meta.url),"horizon-bright":()=>r(()=>import("./CUuTKBJd.js"),[],import.meta.url),houston:()=>r(()=>import("./DnULxvSX.js"),[],import.meta.url),"kanagawa-dragon":()=>r(()=>import("./BuwD2xS4.js"),[],import.meta.url),"kanagawa-lotus":()=>r(()=>import("./C3DzagqV.js"),[],import.meta.url),"kanagawa-wave":()=>r(()=>import("./DFGoQZhC.js"),[],import.meta.url),laserwave:()=>r(()=>import("./DUszq2jm.js"),[],import.meta.url),"light-plus":()=>r(()=>import("./B7mTdjB0.js"),[],import.meta.url),"material-theme":()=>r(()=>import("./D5KoaKCx.js"),[],import.meta.url),"material-theme-darker":()=>r(()=>import("./BfHTSMKl.js"),[],import.meta.url),"material-theme-lighter":()=>r(()=>import("./B0m2ddpp.js"),[],import.meta.url),"material-theme-ocean":()=>r(()=>import("./CyktbL80.js"),[],import.meta.url),"material-theme-palenight":()=>r(()=>import("./Csfq5Kiy.js"),[],import.meta.url),"min-dark":()=>r(()=>import("./CafNBF8u.js"),[],import.meta.url),"min-light":()=>r(()=>import("./CTRr51gU.js"),[],import.meta.url),monokai:()=>r(()=>import("./CR4piiQ-.js"),[],import.meta.url),"night-owl":()=>r(()=>import("./C39BiMTA.js"),[],import.meta.url),"night-owl-light":()=>r(()=>import("./CMTm3GFP.js"),[],import.meta.url),nord:()=>r(()=>import("./Ddv68eIx.js"),[],import.meta.url),"one-dark-pro":()=>r(()=>import("./CxGP3dtY.js"),[],import.meta.url),"one-light":()=>r(()=>import("./C3Wv6jpd.js"),[],import.meta.url),plastic:()=>r(()=>import("./3e1v2bzS.js"),[],import.meta.url),poimandres:()=>r(()=>import("./CS3Unz2-.js"),[],import.meta.url),red:()=>r(()=>import("./DMbB5_pp.js"),[],import.meta.url),"rose-pine":()=>r(()=>import("./5qJOZa0Y.js"),[],import.meta.url),"rose-pine-dawn":()=>r(()=>import("./zx0QlTCp.js"),[],import.meta.url),"rose-pine-moon":()=>r(()=>import("./C9pEdX9L.js"),[],import.meta.url),"slack-dark":()=>r(()=>import("./BthQWCQV.js"),[],import.meta.url),"slack-ochin":()=>r(()=>import("./DqwNpetd.js"),[],import.meta.url),"snazzy-light":()=>r(()=>import("./Bw305WKR.js"),[],import.meta.url),"solarized-dark":()=>r(()=>import("./UcubFVte.js"),[],import.meta.url),"solarized-light":()=>r(()=>import("./DCG28T6R.js"),[],import.meta.url),"synthwave-84":()=>r(()=>import("./CbfX1IO0.js"),[],import.meta.url),"tokyo-night":()=>r(()=>import("./hegEt444.js"),[],import.meta.url),vesper:()=>r(()=>import("./DRje8inN.js"),[],import.meta.url),"vitesse-black":()=>r(()=>import("./Bkuqu6BP.js"),[],import.meta.url),"vitesse-dark":()=>r(()=>import("./D0r3Knsf.js"),[],import.meta.url),"vitesse-light":()=>r(()=>import("./CVO1_9PV.js"),[],import.meta.url)};function c(t){return T({name:t,collection:M,colorScheme:K(t),load:j[t]})}const G=Object.freeze([...v.map(t=>c(t)),...N.map(t=>c(t))]),$=u({themes:G}),q=u({themes:[x,$]});export{T as createTheme,x as pierreThemes,$ as shikiThemes,q as themes};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/uvhZkGDU.js","/app/immutable/chunks/B9vHutcJ.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BBFoj-dS.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/BwNrQXlF.js","/app/immutable/chunks/CLAmm_T1.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/C2UL5Ler.js","/app/immutable/chunks/_UjuBCOJ.js","/app/immutable/chunks/DPttSllj.js","/app/immutable/chunks/BwH4Bvte.js","/app/immutable/chunks/BFgvMDua.js","/app/immutable/chunks/CcJmuwXr.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/B1CKzIA2.js","/app/immutable/chunks/TB9r2XJy.js","/app/immutable/chunks/UTM5G-w-.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BGrimfDs.js","/app/immutable/chunks/Cu5e4npY.js","/app/immutable/chunks/aZdb_rCN.js","/app/immutable/chunks/BPQFiQQc.js","/app/immutable/chunks/96V4v2iI.js","/app/immutable/chunks/nxtepGjE.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/CIbfGsF-.js","/app/immutable/chunks/BbYWP3Ow.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/CfNIzRu8.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.DylRFR3N.css","/app/immutable/chunks/D4ytz2EC.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/B_QPRXJ5.js","/app/immutable/chunks/BbhtQrkZ.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var Rt=Object.defineProperty;var xt=(e,t,n)=>t in e?Rt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pe=(e,t,n)=>xt(e,typeof t!="symbol"?t+"":t,n);import{JH as A,m as be,nZ as R,wu as Pt,CB as Ge,ww as Bt,DP as Ye,cK as Ot,cL as Lt,n_ as Je,nM as Ut,i as ke,fV as $t,ma as Nt,cS as Ht}from"./B9vHutcJ.js";import{J as Ft,Z as Kt,dX as Be,cU as pe,dI as Wt,ax as qt,be as Xe,I as jt,e9 as Vt}from"./C2UL5Ler.js";import{e as zt,b as ae,F as Gt,y as re,_ as _e,G as Yt,C as Jt,W as Qe,v as Xt,u as Qt,M as Zt}from"./BBFoj-dS.js";import{D as Oe,a as en,d as tn}from"./CQcEqK4G.js";import{m as nn,g as Ze,r as an,k as rn,D as sn}from"./CZr8f1ch.js";import{e as on}from"./CL3a4Hm1.js";import{z as et,O as cn,R as ln}from"./Bqd7fdCF.js";import{a as dn}from"./ClxyT-Se.js";import{f as un}from"./B_vpadVO.js";import{bm as h,_ as fe}from"./CLAmm_T1.js";import{a8 as tt,aA as se,I as he,a as nt,n as at,cT as rt,e as st,aI as ot,M as mn,aa as pn,aV as Le,d as le,C as fn,cU as hn,U as gn,a4 as yn,aJ as wn,b_ as bn}from"./BQGIKN0g.js";import{W as kn,L as _n,w as vn,R as Sn,h as it,M as Mn}from"./TB9r2XJy.js";import{l as H,i as An,n as In}from"./Cu5e4npY.js";import{b as Tn}from"./BbhtQrkZ.js";import{K as Cn,P as En,as as Dn,aC as Rn}from"./DIPIWs2Q.js";import{b as Ue,c as xn,a as Pn}from"./_UjuBCOJ.js";import{m as Bn}from"./DQw0Iiac.js";import{m as On}from"./96V4v2iI.js";import"./3SdAC2_C.js";import"./CcJmuwXr.js";import"./BwNrQXlF.js";import"./ChTqQfQN.js";import"./BbYWP3Ow.js";import{i as ct}from"./Dms_DO28.js";import{C as Ln}from"./B5aYN90J.js";import{i as Un}from"./Dqi2LMpO.js";import{o as L,e as $n,l as z,s as C,n as ce,b as Nn,d as Hn,c as Fn}from"./CIyUrgF0.js";const Vr=A.createSelector((e,t)=>e.unreadTracking.dividerSessionByAgentId[t]??null),zr=A.createSelector(e=>e.unreadTracking.currentlyViewedAgentId),Gr=A.createSelector(e=>{const t=[];for(const s of Object.values(e.panelLayout.byWorkspaceId))for(const o of Object.values(s.panels))for(const i of o.tabs)i.type==="agent"&&i.agentId&&t.push(i.agentId);const n=Object.keys(e.unreadTracking.dividerSessionByAgentId),a=new Set(e.agentSessions.agentIdsByWorkspace[be]??[]);return{chiefCardVisible:e.sidebarNav.panelItem==="chief",chiefSessionAgentIds:n.filter(s=>a.has(s)),dividerSessionAgentIds:n,openAgentTabIds:t}});function Yr(e,t){if(e)return e.model}function Kn({messages:e,pendingInitialPrompt:t,pendingContextReferenceCount:n=0}){return e.length>0||!!t||n>0}function Jr({session:e,messages:t,pendingInitialPrompt:n,pendingContextReferenceCount:a=0}){return!(e?Ft(e):!1)&&!Kn({messages:t,pendingInitialPrompt:n,pendingContextReferenceCount:a})}function Xr(e){return Kt(e.messageMetadata)}function Wn(e){return{id:e.id,appMessageId:e.appMessageId,role:"user",timestamp:new Date(e.createdAt??0).toISOString(),contentBlocks:[...e.content?[{type:"text",text:e.content}]:[],...e.imageBlocks??[],...e.fileBlocks??[]],metadata:e.messageMetadata,...e.author!==void 0?{author:e.author}:{}}}function Qr(e){return Wn({...e,createdAt:Date.parse(e.queuedAt)})}const qn=8*1024*1024,jn=3*1024*1024;function Vn(e){return Math.ceil(Math.max(0,e)/3)*4}function zn(e){const t=e.promptBase64Bytes;return e.mimeType==="image/jpeg"&&Number.isSafeInteger(e.size)&&e.size>0&&e.size<=jn&&typeof t=="number"&&t===Vn(e.size)?t:null}async function lt(e,t,n,a,r=()=>{}){const s=()=>{if(!a())throw new Error("media-send-retired")};if(s(),r("overlay-render"),!n.exportMedia)throw new Error("media-export-unavailable");const o=dn(e.source,e.saved);if(o.length>1e4)throw new Error("media-animation-layer-limit");const i=[];for(const c of o)s(),i.push({...c,png:await nn(e.source,e.saved,c.atMs)});s(),r("export");const l=await n.exportMedia({outputVersion:zt,jobId:t,media:e,layers:i});if(s(),!l.ok)throw new Error(["media-export-failed",l.error].filter(Boolean).join(":"));return{jobId:t,value:l.value}}const ve={CLIPBOARD_WRITE:"dock-media:clipboard-write",CLIPBOARD_READ:"dock-media:clipboard-read",MENU:"dock-media:menu"};function $e(e,t){return Math.max(0,(e.pausedAt??t)-e.startedAt-(e.pausedMs??0))}function ge(e,t){if(!t?.startsWith(".intent/attachments/"))return;const n=t.split("/").map(encodeURIComponent).join("/"),a=tt(`intent://local/file/${n}`,e);return a?.kind==="video"?a.url:void 0}function Gn(e){const t=e.video==="full"?h.dock_captureEditor_videoFull_label():h.dock_captureEditor_videoHighlights_label(),n=e.voice==="audio"?h.dock_captureEditor_voiceAudio_label():e.voice==="transcript"?h.dock_captureEditor_voiceTranscript_label():h.dock_captureEditor_voiceOff_summary();return`${t} · ${n}`}function Yn(e,t,n,a){if(a?.error==="permission")return a.kind==="pick"?"accessibility":"screen";if(e==="permission"||t==="permission")return"screen";if(n?.startsWith("microphone-permission"))return"microphone";if(n?.startsWith("speech-permission"))return"speech"}const V=un;function Zr(e){const{view:t,items:n,local:a,labels:r,copy:s}=e,o=t.speech.error??t.speech.capability?.reason??null,i=Yn(t.captureError,t.clips.find(y=>y.status==="failed"&&y.error==="permission")?.error??null,o,t.annotationIssue),l=t.annotationIssue?.error==="unavailable"?s?.annotationUnavailable:void 0,c=t.annotationIssue,d=t.captureError==="permission",u=c?.error==="permission"&&c.kind!=="pick",g=c?.error==="permission"&&c.kind==="pick",p=o?.startsWith("speech-permission")?"speech":o?.startsWith("microphone-permission")||o==="permission"?"microphone":void 0,m={},w={},f=(y,D,$)=>{m[y]=D,$&&(w[y]=$)};s&&(d&&(f("capture",s.permission,"screen"),t.recording||f("record",s.permission,"screen")),u&&!t.annotating&&f("annotate",s.permission,"screen"),g&&(f("pick",s.accessibilityPermission,"accessibility"),t.tool==="pick"&&!t.annotating&&f("annotate",s.accessibilityPermission,"accessibility")),p&&!t.dictation&&f("mic",(o&&r.speechError?.(o))??s.speechPermission,p));const k=y=>{const D=w[y];D&&e.actions.onOpenSettings(D)},_=new Set(t.evidenceOwnedItemIds),I=t.clips.find(y=>y.status==="recording"),S=t.clips.length>=ae.clips,v=t.capabilities,B=t.speech.available,E=new Set(t.clips.filter(y=>y.status==="recording"||y.status==="placing"||!!y.media).flatMap(y=>y.captureHistory?.map(D=>D.image.id)??[])),P=[...t.tiles.filter(({image:y,marks:D})=>!!y.media||y.source!=="annotate"||!E.has(y.id)||D.some(({mark:$})=>!$.clipId)).map(({image:y,marks:D})=>({kind:"image",id:y.contextItemId,url:a.previews[y.id]??"",markCount:D.length,owner:"evidence",...a.previews[y.id]?{}:{status:"placing"}})),...t.clips.filter(y=>!y.discarding).map(y=>({kind:"clip",id:y.contextItemId??y.id,duration:V(y.status==="recording"?$e(y,a.now):y.durationMs),recording:y.status==="recording",...y.media?.saved?{summary:Gn(y.media.saved)}:{},...y.status==="ready"&&ge(e.workspaceId,y.path)?{url:ge(e.workspaceId,y.path)}:{},owner:"evidence",...y.status==="placing"?{status:"placing"}:{},...y.status==="failed"?{status:"failed",...y.error==="limit"?{error:h.dock_composer_clipTooLarge_error()}:{}}:{}})),...n.filter(y=>!_.has(y.id)).map(y=>({...y.imageData&&y.imageMimeType?{kind:"image",id:y.id,url:`data:${y.imageMimeType};base64,${y.imageData}`,markCount:0,file:{name:y.label,imageData:y.imageData,imageMimeType:y.imageMimeType}}:{kind:"file",id:y.id,name:y.label},owner:"attachment",...y.placementStatus==="placing"?{status:"placing"}:{},...y.placementStatus==="failed"?{status:"failed",error:y.placementError}:{}}))];return{mediaStatus:t.recording?{kind:"recording",label:r.recording}:t.annotating?{kind:"annotating",label:r.annotating}:void 0,...i?{settingsPane:i}:{},...l?{annotationNotice:l}:{},labels:r,attachments:P,...s?{placeholder:t.dictation?"":s.idle}:{},state:{captureRevision:t.captureAccepted,capturePending:t.capturePending,captureDisabled:!v.capture||t.captureDisabled,...t.captureDisabled?{captureTooltip:r.captureLimit}:{},captureMode:t.evidence?.annotation?"fullscreen":t.captureMode,captureModesAvailable:!!v.captureModes&&!t.evidence?.annotation,annotationActive:t.annotating,tool:t.tool,toolUsed:t.toolUsed,annotationDisabled:!v.annotate,recording:t.recording&&!I?.discarding,recordingDisabled:!!I?.discarding||!t.recording&&(!v.record||S),...S&&!t.recording?{recordingTooltip:r.clipLimit}:{},recordingTime:V(I?$e(I,a.now):0),dictating:!!t.dictation,dictationPending:t.speech.pending||t.dictation?.status==="transcribing",dictationDisabled:!B&&!t.dictation&&!m.mic,...t.speech.error&&r.speechError?{dictationTooltip:r.speechError(t.speech.error)}:{},dictationTime:t.dictation?V(a.now-t.dictation.startedAt):V(0),inputLevels:t.speech.levels,...Object.keys(m).length?{alerts:m}:{}},...e.actions,...t.fileAttachmentsEnabled===!1?{onEdit:void 0}:{},onAlert:k,beforeSubmit:e.beforeSubmit}}const Se=()=>globalThis.electronAPI,Jn=["image/png","image/jpeg","image/webp"],Ne=e=>Jn.includes(e??"")?e:null;function He(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a+=1)n[a]=t.charCodeAt(a);return n}async function es(e,t){const{view:n,items:a,previews:r}=t,s=n.tiles.find(({image:c})=>c.id===e||c.contextItemId===e);if(s){const c=a.find(p=>p.id===s.image.contextItemId),d=s.image.media;if(s.image.mediaError)return null;if(d?.saved){if(!t.createSavedPreviewUrl||!t.revokeUrl)return null;const p={...d,saved:d.saved},m=await t.createSavedPreviewUrl(t.workspaceId,p);try{const w=await t.fetchBytes(m),f=p.saved.crop;return{kind:"image",name:c?.label||"screenshot.png",mimeType:"image/png",bytes:w,intent:{pixels:{mimeType:"image/png",width:Math.max(1,Math.round(f?.w??p.source.width)),height:Math.max(1,Math.round(f?.h??p.source.height)),displayScale:s.image.displayScale,capturedAt:s.image.capturedAt},raw:w,marks:[]}}}finally{t.revokeUrl(m)}}const u=Ne(c?.imageMimeType),g=r[s.image.id];return!c?.imageData||!u||!g?null:{kind:"image",name:c.label||"screenshot.png",mimeType:"image/png",bytes:await t.fetchBytes(g),intent:{pixels:{mimeType:u,width:s.image.width,height:s.image.height,displayScale:s.image.displayScale,capturedAt:s.image.capturedAt,...s.image.hash?{hash:s.image.hash}:{}},raw:He(c.imageData),marks:s.marks.map(({mark:p})=>({tool:p.tool,geometry:p.geometry,bounds:p.bounds,element:p.element}))}}}const o=n.clips.find(c=>c.id===e||c.contextItemId===e);if(o){const c=o.status==="ready"?ge(t.workspaceId,o.path):null;if(!c)return null;const d=a.find(g=>g.id===o.contextItemId),u=await t.fetchBytes(c);if(!Qn(u))throw new Error("Not a recording file");return{kind:"clip",name:d?.label||`recording-${o.id.slice(0,8)}.mp4`,mimeType:d?.attachmentMimeType||"video/mp4",bytes:u,durationMs:o.durationMs,hasMicAudio:o.hasMicAudio}}const i=a.find(c=>c.id===e),l=Ne(i?.imageMimeType);return i?.imageData&&l?{kind:"image",name:i.label||"image",mimeType:l,bytes:He(i.imageData)}:null}async function Xn(e){const t=await fetch(e);if(!t.ok)throw new Error(`Media request failed (${t.status})`);const n=new Uint8Array(await t.arrayBuffer()),a=Number(t.headers.get("content-length")??Number.NaN);if(n.byteLength===0||Number.isFinite(a)&&a!==n.byteLength)throw new Error("Media response was incomplete");return n}function Qn(e){return e.byteLength>8&&String.fromCharCode(...e.subarray(4,8))==="ftyp"}async function ts(e){try{return(await Se()?.invoke(ve.CLIPBOARD_WRITE,e))?.ok===!0}catch{return!1}}async function Zn(){try{return await Se()?.invoke(ve.CLIPBOARD_READ,{})??null}catch{return null}}async function ns(e){try{const t=await Se()?.invoke(ve.MENU,{canCut:e});return t?.action==="copy"||t?.action==="cut"?t.action:null}catch{return null}}const Fe=new WeakSet;async function ea(e,t){const[n]=e;if(e.length!==1||!n||n.size!==t.size)return!1;try{const a=await crypto.subtle.digest("SHA-256",await n.arrayBuffer());return Array.from(new Uint8Array(a),s=>s.toString(16).padStart(2,"0")).join("")===t.sha256}catch{return!1}}function as(e,{onIntentMedia:t,isCurrent:n,read:a=Zn}){const r=e.clipboardData;if(Fe.has(e)||!r||r.files.length===0)return!1;const s=e.target,o=Array.from(r.files),i=r.types.filter(l=>l!=="Files").map(l=>[l,r.getData(l)]);return e.preventDefault(),e.stopImmediatePropagation(),a().catch(()=>null).then(async l=>{if(!n())return;if(l&&await ea(o,l)){n()&&t(l);return}if(!n()||!(s instanceof Node)||!s.isConnected)return;const c=new DataTransfer;for(const u of o)c.items.add(u);for(const[u,g]of i)c.setData(u,g);const d=new ClipboardEvent("paste",{clipboardData:c,bubbles:!0,cancelable:!0});Fe.add(d),s.dispatchEvent(d)}),!0}function ta(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a++)n[a]=t.charCodeAt(a);return n}function na(e){let t="";for(let a=0;a<e.length;a+=32768)t+=String.fromCharCode(...e.subarray(a,a+32768));return btoa(t)}function dt(e){let t=0;return e.endsWith("==")?t=2:e.endsWith("=")&&(t=1),Math.floor(e.length*3/4)-t}async function aa(e){const t=await crypto.subtle.digest("SHA-256",e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength));return Array.from(new Uint8Array(t)).map(n=>n.toString(16).padStart(2,"0")).join("")}const ut={placeAttachment:ot,beginAttachmentUpload:st,sendAttachmentUploadChunk:rt,commitAttachmentUpload:at,abortAttachmentUpload:nt,getAttachmentInfo:he,mintIdempotencyKey:se};async function Me(e,t,n,a=ut){const{idempotencyKey:r}=n,s={...r!==void 0?{idempotencyKey:r}:{},...n.rawScreenshot!==void 0?{rawScreenshot:n.rawScreenshot}:{}},o=async m=>hn(m,r)?Le(e,r,a.getAttachmentInfo):void 0;if(dt(n.data)<=mn)try{return await a.placeAttachment(e,t,{data:n.data,mimeType:n.mimeType,...s})}catch(m){const w=await o(m);if(w)return w;throw m}const i=ta(n.data),l=await aa(i);let c,d;try{({uploadId:c,maxChunkBytes:d}=await a.beginAttachmentUpload(e,t,i.byteLength,l,{mimeType:n.mimeType,...s}))}catch(m){if(r!==void 0&&pn(m)){const w=await Le(e,r,a.getAttachmentInfo);if(w)return w}throw m}const u=Math.min(gn,d),g=Math.ceil(i.byteLength/u);let p=!1;try{for(let m=0;m<g;m++){const w=i.subarray(m*u,(m+1)*u);await a.sendAttachmentUploadChunk(c,m,na(w),e)}return p=!0,await a.commitAttachmentUpload(c,e)}catch(m){const w=p?await o(m):void 0;if(w)return w;throw await a.abortAttachmentUpload(c,e).catch(()=>{}),m}}function ra(e,t){return yn(e,`image-${Date.now()}-${t+1}`)}class Ae extends Error{constructor(n,a){super(n);Pe(this,"retryBlocks");this.name="ImagePlacementError",this.retryBlocks=a}}function sa(e,t){return e instanceof Ae?e.retryBlocks:t}async function oa(e,t,n=ut,a=()=>!0){const r=l=>(...c)=>(le(a),l(...c));n={placeAttachment:r(n.placeAttachment),beginAttachmentUpload:r(n.beginAttachmentUpload),sendAttachmentUploadChunk:r(n.sendAttachmentUploadChunk),commitAttachmentUpload:r(n.commitAttachmentUpload),abortAttachmentUpload:r(n.abortAttachmentUpload),getAttachmentInfo:r(n.getAttachmentInfo),mintIdempotencyKey:r(n.mintIdempotencyKey)};const s=[],o=[],i=[];for(let l=0;l<t.length;l++){le(a);const c=t[l];if("attachmentId"in c&&c.attachmentId){const p={type:"image",attachmentId:c.attachmentId,...c.mimeType?{mimeType:c.mimeType}:{}};s.push(p),o.push(p);continue}const d=c,u=d.placementFileName??ra(d.mimeType,l),g=n.mintIdempotencyKey(d.placementIdempotencyKey);try{const p=await Me(e,u,{data:d.data,mimeType:d.mimeType,...g!==void 0?{idempotencyKey:g}:{}},n),m={type:"image",attachmentId:p.attachmentId,...p.mimeType??d.mimeType?{mimeType:p.mimeType??d.mimeType}:{}};s.push(m),o.push(m)}catch(p){const m=fn(p);i.push(m?`${u} (${m})`:u),o.push(g!==void 0?{...d,placementIdempotencyKey:g,placementFileName:u}:d)}}if(i.length>0)throw new Ae(h.chat_imagePlacement_failed_error({names:i.join(", ")}),o);return le(a),s}const rs=Object.freeze(Object.defineProperty({__proto__:null,ImagePlacementError:Ae,base64DecodedBytes:dt,imageRetryBlocks:sa,placeImageAttachment:Me,toImageReferenceBlocks:oa},Symbol.toStringTag,{value:"Module"}));function mt(){try{return kn()}catch{return null}}function ia(){return{backendId:A.state.connections.windowBackendId??null,generation:A.state.daemonHealth.connectionGeneration,transport:mt()}}class Ie extends Error{constructor(){super("dock-evidence-backend-changed")}}function N(e,t){return async(...n)=>{e();const a=await t(...n);return e(),a}}const K={current:e=>mt()===e.transport&&A.state.daemonHealth.connectionGeneration===e.generation&&(A.state.connections.windowBackendId??null)===e.backendId,capabilities:()=>_n(),placeImage:(e,t,n,a)=>Me(e,t,n,{placeAttachment:N(a,ot),beginAttachmentUpload:N(a,st),sendAttachmentUploadChunk:N(a,rt),commitAttachmentUpload:N(a,at),abortAttachmentUpload:N(a,nt),getAttachmentInfo:N(a,he),mintIdempotencyKey:se}),lookup:(e,t)=>he({workspaceId:e,idempotencyKey:t}),mintKey:se};function Y(e){return K.current(e)}function ca(e,t){const n=A.state.dockConversation;return{generation:n.generation,authority:n.authority,clearRevision:R(n.drafts,Gt(e,t))?.clearRevision??0,binding:ia()}}function ss(e,t,n){const a=ca(e,t);return a.generation===n.generation&&a.authority===n.authority&&a.clearRevision===n.clearRevision&&Y(n.binding)}function pt(e,t){return()=>{if(!e.current(t))throw new Ie}}const ft=Object.freeze({rawRetention:!1,chiefAttachments:!1});function os(e){return e!==ft}const de=new Map;function ht(e,t=K){const n=`${e.backendId}:${e.generation}`;let a=de.get(n);if(!a){const r=pt(t,e);a=(async()=>{r();const o=await t.capabilities();r();const i=o?.server?.capabilities;if(!i||typeof i!="object")throw new Error("unobserved");return{rawRetention:i.rawScreenshotRetention===1,chiefAttachments:i.chiefAttachments===1}})().catch(()=>(de.delete(n),ft)),de.set(n,a)}return a}class ee extends Error{constructor(t){super(`dock-raw-retention-contract:${t}`),this.reason=t}}function gt(e){const{rpcCode:t,code:n}=e??{};return t===-32602||n==="INVALID_PARAMS"}function la(e){const t=String(e?.message??"");return gt(e)&&(t.includes("rawScreenshotExpired:")||/expired at .*not renewable/i.test(t))}function da(e,t,n){const a=e.rawScreenshot;if(!a||a.compositeAttachmentId!==t)return null;const r=Date.parse(a.expiresAt);return Number.isFinite(r)?a.expired||r<=n?"expired":{attachmentId:e.attachmentId,expiresAt:a.expiresAt}:null}function Ke(e){return{ok:!0,path:e.path,fileName:e.fileName,size:e.size,attachmentId:e.attachmentId,...e.mimeType?{mimeType:e.mimeType}:{},uploadedAt:e.uploadedAt,replayed:!0,...e.rawScreenshot?{rawScreenshot:e.rawScreenshot}:{}}}class ua extends Error{constructor(t,n){super("dock-evidence-placement-failed"),this.imageId=t,this.failure=n}}const We=e=>e.split("/")[1]?.replace("jpeg","jpg")||"png";async function ma(e){const t=e.api??K,n=e.now??Date.now,a=pt(t,e.binding);a();const r=await ht(e.binding,t);a();const s=r.rawRetention&&(e.workspaceId!==be||r.chiefAttachments),o=[];for(const i of e.images){const l=e.records[i.image.id];let c=l&&l.signature===i.signature&&l.workspaceId===e.workspaceId&&l.backendId===e.binding.backendId?l:{imageId:i.image.id,signature:i.signature,workspaceId:e.workspaceId,backendId:e.binding.backendId,compositeKey:null,rawKey:null,composite:null,raw:null,rawSettled:!1};const d=u=>{c=u,e.onRecord(u)};try{if(!c.composite){const g=c.compositeKey,p=t.mintKey(g??void 0)??null;p!==c.compositeKey&&d({...c,compositeKey:p});let m;g&&p===g&&(a(),m=await t.lookup(e.workspaceId,p).then(Ke).catch(()=>{}),a()),m||(a(),m=await t.placeImage(e.workspaceId,`screenshot-${i.image.id.slice(0,8)}.${We(i.composite.mimeType)}`,{data:i.composite.base64,mimeType:i.composite.mimeType,...p?{idempotencyKey:p}:{}},a),a()),d({...c,composite:{attachmentId:m.attachmentId,mimeType:m.mimeType??i.composite.mimeType}})}const u=c.composite.attachmentId;if(s&&i.raw&&!c.raw&&!c.rawSettled){const g=c.rawKey,p=t.mintKey(g??void 0);if(p){p!==c.rawKey&&d({...c,rawKey:p});let m;g&&p===g&&(a(),m=await t.lookup(e.workspaceId,p).then(Ke).catch(()=>{}),a());try{m||(a(),m=await t.placeImage(e.workspaceId,`screenshot-${i.image.id.slice(0,8)}-original.${We(i.raw.mimeType)}`,{data:i.raw.base64,mimeType:i.raw.mimeType,idempotencyKey:p,rawScreenshot:{compositeAttachmentId:u}},a),a());const w=da(m,u,n());if(w==="expired")d({...c,rawSettled:!0});else if(w)d({...c,raw:w});else throw new ee("echo")}catch(w){if(la(w))d({...c,rawSettled:!0});else throw w instanceof ee?w:gt(w)?new ee("refused"):w}}else throw new ee("unkeyed")}}catch(u){throw u instanceof Ie?u:new ua(i.image.id,u)}o.push(c)}return o}async function is(e,t,n,a){const r=()=>{if(!K.current(a))throw new Ie};r();const s=await K.placeImage(e,t,{...n,idempotencyKey:K.mintKey()},r);return r(),s}const pa=new Set(["invalid-saved-edit","media-send-retired","transcript-unavailable","transcript-pending","invalid-edit","stale-source","legacy-baked-marks","timing-unavailable","audio-unavailable","media-source-unavailable","media-export-unavailable","media-animation-layer-limit","media-export-failed","legacy-original-unavailable","capture-render-unavailable","capture-blur-unavailable","stale-source-pixels","not-a-screenshot","not-admitted","unavailable","dock-evidence-missing-pixels","draft-restore-failed","image-budget-exceeded"]),fa=new Set(["unavailable","permission","failed","busy","cancelled","limit"]);class O extends Error{constructor(t,n){super(n),this.stage=t,this.code=n,this.name="DockSendError"}}function oe(e){const t=e instanceof Error?e.message:typeof e=="string"?e:"";if(t.length>64)return"unclassified";const[n,...a]=t.split(":");return!pa.has(n)||a.length>2?"unclassified":n!=="media-export-failed"?a.length?"unclassified":n:[n,...a.map(r=>fa.has(r)?r:"other")].join(":")}function cs(e,t){return e instanceof O?{stage:e.stage,code:oe(e.code)}:{stage:t,code:oe(e)}}function W(e){if(!e||e.source.kind!=="recording")return!1;const t=e.source,n=e.saved??re(t,t.capturedMarks??[],e.transcript);if(n.video!=="full"||n.voice!=="audio"||n.crop||n.blurRegions.length||n.blurStrokes?.length)return!1;const a=_e(n,t,e.transcript);return t.visuals==="clean"?!a.errors.length&&!a.muted&&n.cuts.length===0&&!n.marks.some(r=>r.included)&&a.marks.length===0&&a.transcript===null&&a.kept.length===1&&a.kept[0].startMs===0&&a.kept[0].endMs===t.durationMs&&a.clips.length===1&&a.clips[0].startMs===0&&a.clips[0].endMs===t.durationMs:!a.errors.length&&!a.muted&&a.clips.length===1&&a.clips[0].startMs===0&&a.clips[0].endMs>=t.durationMs}async function ha(e,t,n,a,r,s){const o={images:{},files:[],frames:[],framePromptBytes:[],metadata:[]};let i="validate";try{const l=()=>{if(!r()||!Y(n))throw new Error("media-send-retired")};for(const c of[...t.images,...t.clips]){if(i="validate",s?.stage(i),c.mediaError)throw new Error("invalid-saved-edit");if(!c.media||W(c.media))continue;l();const d=structuredClone(c.media),u=d.source;let g=d.saved??re(u,u.capturedMarks??[],d.transcript),p=crypto.randomUUID();try{if(u.kind==="recording"&&g.voice==="transcript"&&d.transcript?.status!=="ready"){if(i="transcribe",s?.stage(i),!a?.transcribeMedia)throw new Error("transcript-unavailable");const f=await a.transcribeMedia({jobId:p,media:d});if(l(),!f.ok)throw new Error("transcript-unavailable");d.transcript=f.value,d.saved||(g=re(u,u.capturedMarks??[],d.transcript))}i="plan",s?.stage(i);const m=_e(g,u,d.transcript);if(m.errors.length)throw new Error(m.errors[0]);const w={id:c.id,kind:u.kind,video:g.video,voice:g.voice,transcript:m.transcript,batches:u.batches,marks:m.marks.map(({n:f,mark:k,frameAtMs:_})=>({n:f,id:k.id,at_ms:_,kind:k.kind,label:k.label,note:k.note,context:k.context,geometry:k.geometry}))};if(u.kind==="screenshot"){i="screenshot-source",s?.stage(i);const f=u.path.split("/").map(encodeURIComponent).join("/"),k=tt(`intent://local/file/${f}`,e);if(!k||k.kind!=="image")throw new Error("media-source-unavailable");const _=await Xn(k.url);l();const I={base64:Ze(_.buffer.slice(_.byteOffset,_.byteOffset+_.byteLength)),mimeType:/\.jpe?g$/i.test(u.path)?"image/jpeg":/\.webp$/i.test(u.path)?"image/webp":"image/png"};i="screenshot-render",s?.stage(i),o.images[c.id]=await an(u,g,I),l()}else{if(!m.clips.length){w.video_attachment_id=null,w.frames=[],w.kept_ms=[],o.metadata.push(w);continue}const f={...d,saved:g};let k=await a?.takePreparedRecording?.(f);if(k&&(p=k.jobId),l(),!k){if(!a)throw new Error("media-export-unavailable");k=await lt(f,p,a,()=>r()&&Y(n),S=>{i=S,s?.stage(S),S==="export"&&s?.exportAttempt(p)})}p=k.jobId,i="placement",s?.stage(i);const _=[k.value.video,...k.value.frames],I=[];for(let S=0;S<_.length;S++){l();const v=_[S],B=`capture-${c.id.slice(0,12)}-${S}.${S===0?"mp4":v.mimeType==="image/jpeg"?"jpg":"png"}`,E=await wn(e,B,{sourcePath:v.sourcePath,mimeType:v.mimeType,idempotencyKey:se()},void 0,void 0,()=>r()&&Y(n));l(),S===0?o.files.push({type:"file",attachmentId:E.attachmentId,fileName:B,mimeType:E.mimeType??v.mimeType,size:E.size}):(o.frames.push({type:"image",attachmentId:E.attachmentId,mimeType:v.mimeType==="image/jpeg"?"image/jpeg":"image/png"}),o.framePromptBytes.push(zn(v))),I.push(E.attachmentId)}w.video_attachment_id=I[0],w.frames=k.value.frames.map((S,v)=>({mark_id:S.markId,attachment_id:I[v+1]})),w.kept_ms=m.clips}o.metadata.push(w)}finally{s?.stage("release"),await a?.releaseMediaJob?.(p).catch(()=>{})}}return o}catch(l){throw l instanceof O?l:new O(i,oe(l))}}const ue=1568,ga=.85;async function ya(e,t){const n=Math.round(e.length*3/4/1024),a=await wa(e,t),{width:r,height:s}=a,o=r>ue||s>ue;let i=r,l=s;if(o){const f=ue/Math.max(r,s);i=Math.round(r*f),l=Math.round(s*f)}const c=new OffscreenCanvas(i,l),d=c.getContext("2d");if(!d)throw new Error("Failed to get 2D canvas context for image resize");d.drawImage(a,0,0,i,l);let u=t;ba(d,i,l)||(u="image/jpeg");const g=await c.convertToBlob({type:u,quality:u==="image/jpeg"?ga:void 0}),p=g.type||u,m=await ka(g),w=Math.round(m.length*3/4/1024);return console.debug(`[image-resize] ${r}×${s} → ${i}×${l} | ${t} → ${p} | ${n} KB → ${w} KB`),{base64:m,mimeType:p}}async function wa(e,t){const n=atob(e),a=new Uint8Array(n.length);for(let s=0;s<n.length;s++)a[s]=n.charCodeAt(s);const r=new Blob([a],{type:t});return createImageBitmap(r)}function ba(e,t,n){const r=e.getImageData(0,0,t,n).data;for(let s=3;s<r.length;s+=4)if(r[s]<255)return!0;return!1}async function ka(e){const t=await e.arrayBuffer(),n=new Uint8Array(t);let a="";for(let r=0;r<n.length;r++)a+=String.fromCharCode(n[r]);return btoa(a)}const T={...Oe,badge:Oe.badgeRadius*2};function _a(e,t,n=1,a=0){const r=Math.max(1,e.displayScale)*n,s=[],o=i=>i*n;for(const{n:i,mark:l}of t){const c=l.geometry;if(c.kind==="rect")s.push({kind:"rect",x:o(c.x),y:o(c.y),w:o(c.w),h:o(c.h),width:T.stroke*r});else if(c.kind==="path")s.push({kind:"path",points:c.points.map(m=>({x:o(m.x),y:o(m.y)})),width:T.pen*r});else{const m={x:o(c.from.x),y:o(c.from.y)},w={x:o(c.to.x),y:o(c.to.y)};s.push({kind:"arrow",from:m,to:w,head:Ia(m,w,T.arrowHead*r),width:T.stroke*r})}if(!T.showNumbers)continue;const d=Math.max(a,T.badge/2*r),u=o(l.bounds.x+l.bounds.w),g=o(l.bounds.y),p=tn({x:o(l.bounds.x),y:g,w:u-o(l.bounds.x),h:o(l.bounds.h)},{x:0,y:0,w:o(e.width),h:o(e.height)},r,d);s.push({kind:"badge",...p,radius:d,label:String(i),font:d*T.badgeTextScale})}return s}function va(e,t){"letterSpacing"in e&&(e.letterSpacing="0px"),"wordSpacing"in e&&(e.wordSpacing="0px");const n=(a,r,s)=>{e.strokeStyle=T.halo,e.lineWidth=a+T.haloWidth*r,s(),e.strokeStyle=T.accent,e.lineWidth=a,s()};e.strokeStyle=T.accent,e.lineCap="round",e.lineJoin="round";for(const a of t)if(a.kind==="rect")n(a.width,a.width/T.stroke,()=>e.strokeRect(a.x,a.y,a.w,a.h));else if(a.kind==="path"||a.kind==="arrow"){e.lineWidth=a.width,e.beginPath();const r=a.kind==="path"?a.points:[a.from,a.to];a.kind==="arrow"&&r.forEach((o,i)=>i?e.lineTo(o.x,o.y):e.moveTo(o.x,o.y)),a.kind==="arrow"&&(e.moveTo(a.head.left.x,a.head.left.y),e.lineTo(a.to.x,a.to.y),e.lineTo(a.head.right.x,a.head.right.y));const s=a.kind==="path"?new Path2D(en(a.points)):null;n(a.width,a.width/(a.kind==="path"?T.pen:T.stroke),()=>s?e.stroke(s):e.stroke())}else e.fillStyle=T.paper,e.beginPath(),e.arc(a.x,a.y,a.radius,0,Math.PI*2),e.closePath(),e.fill(),e.strokeStyle=T.accent,e.lineWidth=T.badgeOutline*a.radius/T.badgeRadius,e.stroke(),e.fillStyle=T.ink,e.font=`600 ${a.font}px ${T.badgeFontFamily}`,e.textAlign="center",e.textBaseline="middle",e.fillText(a.label,a.x,a.y)}async function Sa(e,t){const n=Uint8Array.from(atob(e),a=>a.charCodeAt(0));return createImageBitmap(new Blob([n],{type:t}))}async function Ma(e){const t=await e.convertToBlob({type:"image/png"});return Ze(await t.arrayBuffer())}async function yt(e,t,n,a,r=0){await rn();const s=await Sa(e.base64,e.mimeType);try{const o=Math.min(1,a/Math.max(t.width,t.height)),i=new OffscreenCanvas(Math.max(1,Math.round(t.width*o)),Math.max(1,Math.round(t.height*o))),l=i.getContext("2d");if(!l)throw new Error("dock-evidence-canvas-unavailable");return l.drawImage(s,0,0,i.width,i.height),va(l,_a(t,n,o,r)),i}finally{s.close()}}async function Aa(e,t,n){const a=await yt(e,t,n,Math.max(t.width,t.height));return ya(await Ma(a),"image/png")}async function ls(e,t,n,a=384){const r=await yt(e,t,n,a,a/32);return URL.createObjectURL(await r.convertToBlob({type:"image/png"}))}function Ia(e,t,n=T.arrowHead){const a=Math.atan2(t.y-e.y,t.x-e.x),r=T.arrowSpread;return{left:{x:t.x-n*Math.cos(a-r),y:t.y-n*Math.sin(a-r)},right:{x:t.x-n*Math.cos(a+r),y:t.y-n*Math.sin(a+r)}}}function ds(e,t){const n=Yt(t??void 0),a=new Set(t?.clips.filter(r=>!!r.media&&!W(r.media)).map(r=>r.contextItemId));return e.filter(r=>!n.has(r.id)&&!a.has(r.id))}async function us({workspaceId:e,agentId:t,evidence:n,clickedItems:a,sendItems:r,clickedPayload:s,binding:o,service:i,current:l,onRecord:c,timing:d}){const u=()=>{if(!l()||!Y(o))throw new O("validate","media-send-retired")};if(u(),n?.images.some(b=>b.mediaError)||n?.clips.some(b=>b.mediaError))throw new O("validate","invalid-saved-edit");const g=b=>!!b.media&&!W(b.media),p=n?{workspaceId:e,agentId:t,appUrl:`intent://local/workspace/${encodeURIComponent(e)}`,clipAttachmentIds:Object.fromEntries(n.clips.map(b=>[b.id,a.find(M=>M.id===b.contextItemId)?.attachmentId??null]))}:null;for(const b of n?.clips??[]){if(!b.media||!W(b.media))continue;const M=a.find(Q=>Q.id===b.contextItemId);if(!M||M.attachmentId!==b.media.source.attachmentId||M.path!==b.media.source.path||M.placementStatus!==void 0&&M.placementStatus!=="placed")throw new O("validate","legacy-original-unavailable")}const m=n?await ha(e,n,o,i,l,d):{images:{},files:[],frames:[],framePromptBytes:[],metadata:[]},w=new Set(n?.clips.filter(b=>g(b)||!!b.media&&W(b.media)).map(b=>b.id)),f=new Set(n?.clips.filter(b=>w.has(b.id)).flatMap(b=>(b.captureHistory??[]).map(M=>M.image.id))),k=(n?.images??[]).filter(b=>b.source!=="annotate"||!!b.media||!f.has(b.id)||n.marks.some(M=>M.imageId===b.id&&!(M.clipId&&w.has(M.clipId))));d?.stage("burn");let _=[];try{_=n?await Ta({...n,images:k},a,m.images):[]}catch(b){throw new O("burn",oe(b))}if(m.framePromptBytes.reduce((b,M)=>b+(M??0),0)>qn)throw new O("validate","image-budget-exceeded");const S=new Set(n?.images.filter(b=>b.media).map(b=>b.id)),v=n?{...n,images:k.map(b=>m.images[b.id]?{...b,width:m.images[b.id].width,height:m.images[b.id].height}:b),clips:n.clips.filter(b=>!g(b)),marks:n.marks.filter(b=>!S.has(b.imageId)&&!n.clips.some(M=>g(M)&&M.id===b.clipId))}:null;u();const B=m.metadata.some(b=>typeof b.transcript=="string"&&b.transcript.trim());if(!s.text.trim()&&!r.length&&!s.workspaceContextStr?.trim()&&!_.length&&!m.files.length&&!m.frames.length&&!s.imageBlocks?.length&&!s.fileBlocks?.length&&!B)return null;let E=_,P=null;d?.stage("placement");const xe=n?await ht(o):null;if(u(),n&&(e!==be||xe?.chiefAttachments)){const b=await ma({workspaceId:e,binding:o,images:k.map((M,Q)=>{const Z=a.find(Dt=>Dt.id===M.contextItemId);return{image:M,signature:Jt(n,M.id),composite:{base64:_[Q].data,mimeType:_[Q].mimeType},raw:!M.media&&Z?.imageData&&Z.imageMimeType?{base64:Z.imageData,mimeType:Z.imageMimeType}:null}}),records:n?.placements??{},onRecord:c});u(),E=b.map(M=>({type:"image",attachmentId:M.composite.attachmentId,mimeType:M.composite.mimeType})),P=Object.fromEntries(b.map(M=>[M.imageId,{attachmentId:M.composite.attachmentId,raw:M.raw}]))}const y=new Map(n?Qe(n).map(({n:b,mark:M})=>[M.id,b]):[]),D=p&&P?{...p,imageAttachments:P,markNumbers:y}:p&&{...p,markNumbers:y},$=n&&D?{...s,imageBlocks:[...E,...m.frames,...s.imageBlocks??[]],fileBlocks:[...s.fileBlocks??[],...m.files],workspaceContextStr:[Qt(v,D),m.metadata.length?`[Edited capture outputs]
|
|
2
|
+
var Rt=Object.defineProperty;var xt=(e,t,n)=>t in e?Rt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pe=(e,t,n)=>xt(e,typeof t!="symbol"?t+"":t,n);import{JH as A,m as be,nZ as R,wu as Pt,CB as Ge,ww as Bt,DP as Ye,cK as Ot,cL as Lt,n_ as Je,nM as Ut,i as ke,fV as $t,ma as Nt,cS as Ht}from"./B9vHutcJ.js";import{J as Ft,Z as Kt,dX as Be,cU as pe,dI as Wt,ax as qt,be as Xe,I as jt,e9 as Vt}from"./C2UL5Ler.js";import{e as zt,b as ae,F as Gt,y as re,_ as _e,G as Yt,C as Jt,W as Qe,v as Xt,u as Qt,M as Zt}from"./BBFoj-dS.js";import{D as Oe,a as en,d as tn}from"./CQcEqK4G.js";import{m as nn,g as Ze,r as an,k as rn,D as sn}from"./CZr8f1ch.js";import{e as on}from"./CL3a4Hm1.js";import{z as et,O as cn,R as ln}from"./Bqd7fdCF.js";import{a as dn}from"./ClxyT-Se.js";import{f as un}from"./B_vpadVO.js";import{bm as h,_ as fe}from"./CLAmm_T1.js";import{a8 as tt,aA as se,I as he,a as nt,n as at,cT as rt,e as st,aI as ot,M as mn,aa as pn,aV as Le,d as le,C as fn,cU as hn,U as gn,a4 as yn,aJ as wn,b_ as bn}from"./CQlYR8ss.js";import{W as kn,L as _n,w as vn,R as Sn,h as it,M as Mn}from"./TB9r2XJy.js";import{l as H,i as An,n as In}from"./Cu5e4npY.js";import{b as Tn}from"./BbhtQrkZ.js";import{K as Cn,P as En,as as Dn,aC as Rn}from"./cTFeOFQC.js";import{b as Ue,c as xn,a as Pn}from"./_UjuBCOJ.js";import{m as Bn}from"./DQw0Iiac.js";import{m as On}from"./96V4v2iI.js";import"./3SdAC2_C.js";import"./CcJmuwXr.js";import"./BwNrQXlF.js";import"./ChTqQfQN.js";import"./BbYWP3Ow.js";import{i as ct}from"./Dms_DO28.js";import{C as Ln}from"./B5aYN90J.js";import{i as Un}from"./Dqi2LMpO.js";import{o as L,e as $n,l as z,s as C,n as ce,b as Nn,d as Hn,c as Fn}from"./CIyUrgF0.js";const Vr=A.createSelector((e,t)=>e.unreadTracking.dividerSessionByAgentId[t]??null),zr=A.createSelector(e=>e.unreadTracking.currentlyViewedAgentId),Gr=A.createSelector(e=>{const t=[];for(const s of Object.values(e.panelLayout.byWorkspaceId))for(const o of Object.values(s.panels))for(const i of o.tabs)i.type==="agent"&&i.agentId&&t.push(i.agentId);const n=Object.keys(e.unreadTracking.dividerSessionByAgentId),a=new Set(e.agentSessions.agentIdsByWorkspace[be]??[]);return{chiefCardVisible:e.sidebarNav.panelItem==="chief",chiefSessionAgentIds:n.filter(s=>a.has(s)),dividerSessionAgentIds:n,openAgentTabIds:t}});function Yr(e,t){if(e)return e.model}function Kn({messages:e,pendingInitialPrompt:t,pendingContextReferenceCount:n=0}){return e.length>0||!!t||n>0}function Jr({session:e,messages:t,pendingInitialPrompt:n,pendingContextReferenceCount:a=0}){return!(e?Ft(e):!1)&&!Kn({messages:t,pendingInitialPrompt:n,pendingContextReferenceCount:a})}function Xr(e){return Kt(e.messageMetadata)}function Wn(e){return{id:e.id,appMessageId:e.appMessageId,role:"user",timestamp:new Date(e.createdAt??0).toISOString(),contentBlocks:[...e.content?[{type:"text",text:e.content}]:[],...e.imageBlocks??[],...e.fileBlocks??[]],metadata:e.messageMetadata,...e.author!==void 0?{author:e.author}:{}}}function Qr(e){return Wn({...e,createdAt:Date.parse(e.queuedAt)})}const qn=8*1024*1024,jn=3*1024*1024;function Vn(e){return Math.ceil(Math.max(0,e)/3)*4}function zn(e){const t=e.promptBase64Bytes;return e.mimeType==="image/jpeg"&&Number.isSafeInteger(e.size)&&e.size>0&&e.size<=jn&&typeof t=="number"&&t===Vn(e.size)?t:null}async function lt(e,t,n,a,r=()=>{}){const s=()=>{if(!a())throw new Error("media-send-retired")};if(s(),r("overlay-render"),!n.exportMedia)throw new Error("media-export-unavailable");const o=dn(e.source,e.saved);if(o.length>1e4)throw new Error("media-animation-layer-limit");const i=[];for(const c of o)s(),i.push({...c,png:await nn(e.source,e.saved,c.atMs)});s(),r("export");const l=await n.exportMedia({outputVersion:zt,jobId:t,media:e,layers:i});if(s(),!l.ok)throw new Error(["media-export-failed",l.error].filter(Boolean).join(":"));return{jobId:t,value:l.value}}const ve={CLIPBOARD_WRITE:"dock-media:clipboard-write",CLIPBOARD_READ:"dock-media:clipboard-read",MENU:"dock-media:menu"};function $e(e,t){return Math.max(0,(e.pausedAt??t)-e.startedAt-(e.pausedMs??0))}function ge(e,t){if(!t?.startsWith(".intent/attachments/"))return;const n=t.split("/").map(encodeURIComponent).join("/"),a=tt(`intent://local/file/${n}`,e);return a?.kind==="video"?a.url:void 0}function Gn(e){const t=e.video==="full"?h.dock_captureEditor_videoFull_label():h.dock_captureEditor_videoHighlights_label(),n=e.voice==="audio"?h.dock_captureEditor_voiceAudio_label():e.voice==="transcript"?h.dock_captureEditor_voiceTranscript_label():h.dock_captureEditor_voiceOff_summary();return`${t} · ${n}`}function Yn(e,t,n,a){if(a?.error==="permission")return a.kind==="pick"?"accessibility":"screen";if(e==="permission"||t==="permission")return"screen";if(n?.startsWith("microphone-permission"))return"microphone";if(n?.startsWith("speech-permission"))return"speech"}const V=un;function Zr(e){const{view:t,items:n,local:a,labels:r,copy:s}=e,o=t.speech.error??t.speech.capability?.reason??null,i=Yn(t.captureError,t.clips.find(y=>y.status==="failed"&&y.error==="permission")?.error??null,o,t.annotationIssue),l=t.annotationIssue?.error==="unavailable"?s?.annotationUnavailable:void 0,c=t.annotationIssue,d=t.captureError==="permission",u=c?.error==="permission"&&c.kind!=="pick",g=c?.error==="permission"&&c.kind==="pick",p=o?.startsWith("speech-permission")?"speech":o?.startsWith("microphone-permission")||o==="permission"?"microphone":void 0,m={},w={},f=(y,D,$)=>{m[y]=D,$&&(w[y]=$)};s&&(d&&(f("capture",s.permission,"screen"),t.recording||f("record",s.permission,"screen")),u&&!t.annotating&&f("annotate",s.permission,"screen"),g&&(f("pick",s.accessibilityPermission,"accessibility"),t.tool==="pick"&&!t.annotating&&f("annotate",s.accessibilityPermission,"accessibility")),p&&!t.dictation&&f("mic",(o&&r.speechError?.(o))??s.speechPermission,p));const k=y=>{const D=w[y];D&&e.actions.onOpenSettings(D)},_=new Set(t.evidenceOwnedItemIds),I=t.clips.find(y=>y.status==="recording"),S=t.clips.length>=ae.clips,v=t.capabilities,B=t.speech.available,E=new Set(t.clips.filter(y=>y.status==="recording"||y.status==="placing"||!!y.media).flatMap(y=>y.captureHistory?.map(D=>D.image.id)??[])),P=[...t.tiles.filter(({image:y,marks:D})=>!!y.media||y.source!=="annotate"||!E.has(y.id)||D.some(({mark:$})=>!$.clipId)).map(({image:y,marks:D})=>({kind:"image",id:y.contextItemId,url:a.previews[y.id]??"",markCount:D.length,owner:"evidence",...a.previews[y.id]?{}:{status:"placing"}})),...t.clips.filter(y=>!y.discarding).map(y=>({kind:"clip",id:y.contextItemId??y.id,duration:V(y.status==="recording"?$e(y,a.now):y.durationMs),recording:y.status==="recording",...y.media?.saved?{summary:Gn(y.media.saved)}:{},...y.status==="ready"&&ge(e.workspaceId,y.path)?{url:ge(e.workspaceId,y.path)}:{},owner:"evidence",...y.status==="placing"?{status:"placing"}:{},...y.status==="failed"?{status:"failed",...y.error==="limit"?{error:h.dock_composer_clipTooLarge_error()}:{}}:{}})),...n.filter(y=>!_.has(y.id)).map(y=>({...y.imageData&&y.imageMimeType?{kind:"image",id:y.id,url:`data:${y.imageMimeType};base64,${y.imageData}`,markCount:0,file:{name:y.label,imageData:y.imageData,imageMimeType:y.imageMimeType}}:{kind:"file",id:y.id,name:y.label},owner:"attachment",...y.placementStatus==="placing"?{status:"placing"}:{},...y.placementStatus==="failed"?{status:"failed",error:y.placementError}:{}}))];return{mediaStatus:t.recording?{kind:"recording",label:r.recording}:t.annotating?{kind:"annotating",label:r.annotating}:void 0,...i?{settingsPane:i}:{},...l?{annotationNotice:l}:{},labels:r,attachments:P,...s?{placeholder:t.dictation?"":s.idle}:{},state:{captureRevision:t.captureAccepted,capturePending:t.capturePending,captureDisabled:!v.capture||t.captureDisabled,...t.captureDisabled?{captureTooltip:r.captureLimit}:{},captureMode:t.evidence?.annotation?"fullscreen":t.captureMode,captureModesAvailable:!!v.captureModes&&!t.evidence?.annotation,annotationActive:t.annotating,tool:t.tool,toolUsed:t.toolUsed,annotationDisabled:!v.annotate,recording:t.recording&&!I?.discarding,recordingDisabled:!!I?.discarding||!t.recording&&(!v.record||S),...S&&!t.recording?{recordingTooltip:r.clipLimit}:{},recordingTime:V(I?$e(I,a.now):0),dictating:!!t.dictation,dictationPending:t.speech.pending||t.dictation?.status==="transcribing",dictationDisabled:!B&&!t.dictation&&!m.mic,...t.speech.error&&r.speechError?{dictationTooltip:r.speechError(t.speech.error)}:{},dictationTime:t.dictation?V(a.now-t.dictation.startedAt):V(0),inputLevels:t.speech.levels,...Object.keys(m).length?{alerts:m}:{}},...e.actions,...t.fileAttachmentsEnabled===!1?{onEdit:void 0}:{},onAlert:k,beforeSubmit:e.beforeSubmit}}const Se=()=>globalThis.electronAPI,Jn=["image/png","image/jpeg","image/webp"],Ne=e=>Jn.includes(e??"")?e:null;function He(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a+=1)n[a]=t.charCodeAt(a);return n}async function es(e,t){const{view:n,items:a,previews:r}=t,s=n.tiles.find(({image:c})=>c.id===e||c.contextItemId===e);if(s){const c=a.find(p=>p.id===s.image.contextItemId),d=s.image.media;if(s.image.mediaError)return null;if(d?.saved){if(!t.createSavedPreviewUrl||!t.revokeUrl)return null;const p={...d,saved:d.saved},m=await t.createSavedPreviewUrl(t.workspaceId,p);try{const w=await t.fetchBytes(m),f=p.saved.crop;return{kind:"image",name:c?.label||"screenshot.png",mimeType:"image/png",bytes:w,intent:{pixels:{mimeType:"image/png",width:Math.max(1,Math.round(f?.w??p.source.width)),height:Math.max(1,Math.round(f?.h??p.source.height)),displayScale:s.image.displayScale,capturedAt:s.image.capturedAt},raw:w,marks:[]}}}finally{t.revokeUrl(m)}}const u=Ne(c?.imageMimeType),g=r[s.image.id];return!c?.imageData||!u||!g?null:{kind:"image",name:c.label||"screenshot.png",mimeType:"image/png",bytes:await t.fetchBytes(g),intent:{pixels:{mimeType:u,width:s.image.width,height:s.image.height,displayScale:s.image.displayScale,capturedAt:s.image.capturedAt,...s.image.hash?{hash:s.image.hash}:{}},raw:He(c.imageData),marks:s.marks.map(({mark:p})=>({tool:p.tool,geometry:p.geometry,bounds:p.bounds,element:p.element}))}}}const o=n.clips.find(c=>c.id===e||c.contextItemId===e);if(o){const c=o.status==="ready"?ge(t.workspaceId,o.path):null;if(!c)return null;const d=a.find(g=>g.id===o.contextItemId),u=await t.fetchBytes(c);if(!Qn(u))throw new Error("Not a recording file");return{kind:"clip",name:d?.label||`recording-${o.id.slice(0,8)}.mp4`,mimeType:d?.attachmentMimeType||"video/mp4",bytes:u,durationMs:o.durationMs,hasMicAudio:o.hasMicAudio}}const i=a.find(c=>c.id===e),l=Ne(i?.imageMimeType);return i?.imageData&&l?{kind:"image",name:i.label||"image",mimeType:l,bytes:He(i.imageData)}:null}async function Xn(e){const t=await fetch(e);if(!t.ok)throw new Error(`Media request failed (${t.status})`);const n=new Uint8Array(await t.arrayBuffer()),a=Number(t.headers.get("content-length")??Number.NaN);if(n.byteLength===0||Number.isFinite(a)&&a!==n.byteLength)throw new Error("Media response was incomplete");return n}function Qn(e){return e.byteLength>8&&String.fromCharCode(...e.subarray(4,8))==="ftyp"}async function ts(e){try{return(await Se()?.invoke(ve.CLIPBOARD_WRITE,e))?.ok===!0}catch{return!1}}async function Zn(){try{return await Se()?.invoke(ve.CLIPBOARD_READ,{})??null}catch{return null}}async function ns(e){try{const t=await Se()?.invoke(ve.MENU,{canCut:e});return t?.action==="copy"||t?.action==="cut"?t.action:null}catch{return null}}const Fe=new WeakSet;async function ea(e,t){const[n]=e;if(e.length!==1||!n||n.size!==t.size)return!1;try{const a=await crypto.subtle.digest("SHA-256",await n.arrayBuffer());return Array.from(new Uint8Array(a),s=>s.toString(16).padStart(2,"0")).join("")===t.sha256}catch{return!1}}function as(e,{onIntentMedia:t,isCurrent:n,read:a=Zn}){const r=e.clipboardData;if(Fe.has(e)||!r||r.files.length===0)return!1;const s=e.target,o=Array.from(r.files),i=r.types.filter(l=>l!=="Files").map(l=>[l,r.getData(l)]);return e.preventDefault(),e.stopImmediatePropagation(),a().catch(()=>null).then(async l=>{if(!n())return;if(l&&await ea(o,l)){n()&&t(l);return}if(!n()||!(s instanceof Node)||!s.isConnected)return;const c=new DataTransfer;for(const u of o)c.items.add(u);for(const[u,g]of i)c.setData(u,g);const d=new ClipboardEvent("paste",{clipboardData:c,bubbles:!0,cancelable:!0});Fe.add(d),s.dispatchEvent(d)}),!0}function ta(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a++)n[a]=t.charCodeAt(a);return n}function na(e){let t="";for(let a=0;a<e.length;a+=32768)t+=String.fromCharCode(...e.subarray(a,a+32768));return btoa(t)}function dt(e){let t=0;return e.endsWith("==")?t=2:e.endsWith("=")&&(t=1),Math.floor(e.length*3/4)-t}async function aa(e){const t=await crypto.subtle.digest("SHA-256",e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength));return Array.from(new Uint8Array(t)).map(n=>n.toString(16).padStart(2,"0")).join("")}const ut={placeAttachment:ot,beginAttachmentUpload:st,sendAttachmentUploadChunk:rt,commitAttachmentUpload:at,abortAttachmentUpload:nt,getAttachmentInfo:he,mintIdempotencyKey:se};async function Me(e,t,n,a=ut){const{idempotencyKey:r}=n,s={...r!==void 0?{idempotencyKey:r}:{},...n.rawScreenshot!==void 0?{rawScreenshot:n.rawScreenshot}:{}},o=async m=>hn(m,r)?Le(e,r,a.getAttachmentInfo):void 0;if(dt(n.data)<=mn)try{return await a.placeAttachment(e,t,{data:n.data,mimeType:n.mimeType,...s})}catch(m){const w=await o(m);if(w)return w;throw m}const i=ta(n.data),l=await aa(i);let c,d;try{({uploadId:c,maxChunkBytes:d}=await a.beginAttachmentUpload(e,t,i.byteLength,l,{mimeType:n.mimeType,...s}))}catch(m){if(r!==void 0&&pn(m)){const w=await Le(e,r,a.getAttachmentInfo);if(w)return w}throw m}const u=Math.min(gn,d),g=Math.ceil(i.byteLength/u);let p=!1;try{for(let m=0;m<g;m++){const w=i.subarray(m*u,(m+1)*u);await a.sendAttachmentUploadChunk(c,m,na(w),e)}return p=!0,await a.commitAttachmentUpload(c,e)}catch(m){const w=p?await o(m):void 0;if(w)return w;throw await a.abortAttachmentUpload(c,e).catch(()=>{}),m}}function ra(e,t){return yn(e,`image-${Date.now()}-${t+1}`)}class Ae extends Error{constructor(n,a){super(n);Pe(this,"retryBlocks");this.name="ImagePlacementError",this.retryBlocks=a}}function sa(e,t){return e instanceof Ae?e.retryBlocks:t}async function oa(e,t,n=ut,a=()=>!0){const r=l=>(...c)=>(le(a),l(...c));n={placeAttachment:r(n.placeAttachment),beginAttachmentUpload:r(n.beginAttachmentUpload),sendAttachmentUploadChunk:r(n.sendAttachmentUploadChunk),commitAttachmentUpload:r(n.commitAttachmentUpload),abortAttachmentUpload:r(n.abortAttachmentUpload),getAttachmentInfo:r(n.getAttachmentInfo),mintIdempotencyKey:r(n.mintIdempotencyKey)};const s=[],o=[],i=[];for(let l=0;l<t.length;l++){le(a);const c=t[l];if("attachmentId"in c&&c.attachmentId){const p={type:"image",attachmentId:c.attachmentId,...c.mimeType?{mimeType:c.mimeType}:{}};s.push(p),o.push(p);continue}const d=c,u=d.placementFileName??ra(d.mimeType,l),g=n.mintIdempotencyKey(d.placementIdempotencyKey);try{const p=await Me(e,u,{data:d.data,mimeType:d.mimeType,...g!==void 0?{idempotencyKey:g}:{}},n),m={type:"image",attachmentId:p.attachmentId,...p.mimeType??d.mimeType?{mimeType:p.mimeType??d.mimeType}:{}};s.push(m),o.push(m)}catch(p){const m=fn(p);i.push(m?`${u} (${m})`:u),o.push(g!==void 0?{...d,placementIdempotencyKey:g,placementFileName:u}:d)}}if(i.length>0)throw new Ae(h.chat_imagePlacement_failed_error({names:i.join(", ")}),o);return le(a),s}const rs=Object.freeze(Object.defineProperty({__proto__:null,ImagePlacementError:Ae,base64DecodedBytes:dt,imageRetryBlocks:sa,placeImageAttachment:Me,toImageReferenceBlocks:oa},Symbol.toStringTag,{value:"Module"}));function mt(){try{return kn()}catch{return null}}function ia(){return{backendId:A.state.connections.windowBackendId??null,generation:A.state.daemonHealth.connectionGeneration,transport:mt()}}class Ie extends Error{constructor(){super("dock-evidence-backend-changed")}}function N(e,t){return async(...n)=>{e();const a=await t(...n);return e(),a}}const K={current:e=>mt()===e.transport&&A.state.daemonHealth.connectionGeneration===e.generation&&(A.state.connections.windowBackendId??null)===e.backendId,capabilities:()=>_n(),placeImage:(e,t,n,a)=>Me(e,t,n,{placeAttachment:N(a,ot),beginAttachmentUpload:N(a,st),sendAttachmentUploadChunk:N(a,rt),commitAttachmentUpload:N(a,at),abortAttachmentUpload:N(a,nt),getAttachmentInfo:N(a,he),mintIdempotencyKey:se}),lookup:(e,t)=>he({workspaceId:e,idempotencyKey:t}),mintKey:se};function Y(e){return K.current(e)}function ca(e,t){const n=A.state.dockConversation;return{generation:n.generation,authority:n.authority,clearRevision:R(n.drafts,Gt(e,t))?.clearRevision??0,binding:ia()}}function ss(e,t,n){const a=ca(e,t);return a.generation===n.generation&&a.authority===n.authority&&a.clearRevision===n.clearRevision&&Y(n.binding)}function pt(e,t){return()=>{if(!e.current(t))throw new Ie}}const ft=Object.freeze({rawRetention:!1,chiefAttachments:!1});function os(e){return e!==ft}const de=new Map;function ht(e,t=K){const n=`${e.backendId}:${e.generation}`;let a=de.get(n);if(!a){const r=pt(t,e);a=(async()=>{r();const o=await t.capabilities();r();const i=o?.server?.capabilities;if(!i||typeof i!="object")throw new Error("unobserved");return{rawRetention:i.rawScreenshotRetention===1,chiefAttachments:i.chiefAttachments===1}})().catch(()=>(de.delete(n),ft)),de.set(n,a)}return a}class ee extends Error{constructor(t){super(`dock-raw-retention-contract:${t}`),this.reason=t}}function gt(e){const{rpcCode:t,code:n}=e??{};return t===-32602||n==="INVALID_PARAMS"}function la(e){const t=String(e?.message??"");return gt(e)&&(t.includes("rawScreenshotExpired:")||/expired at .*not renewable/i.test(t))}function da(e,t,n){const a=e.rawScreenshot;if(!a||a.compositeAttachmentId!==t)return null;const r=Date.parse(a.expiresAt);return Number.isFinite(r)?a.expired||r<=n?"expired":{attachmentId:e.attachmentId,expiresAt:a.expiresAt}:null}function Ke(e){return{ok:!0,path:e.path,fileName:e.fileName,size:e.size,attachmentId:e.attachmentId,...e.mimeType?{mimeType:e.mimeType}:{},uploadedAt:e.uploadedAt,replayed:!0,...e.rawScreenshot?{rawScreenshot:e.rawScreenshot}:{}}}class ua extends Error{constructor(t,n){super("dock-evidence-placement-failed"),this.imageId=t,this.failure=n}}const We=e=>e.split("/")[1]?.replace("jpeg","jpg")||"png";async function ma(e){const t=e.api??K,n=e.now??Date.now,a=pt(t,e.binding);a();const r=await ht(e.binding,t);a();const s=r.rawRetention&&(e.workspaceId!==be||r.chiefAttachments),o=[];for(const i of e.images){const l=e.records[i.image.id];let c=l&&l.signature===i.signature&&l.workspaceId===e.workspaceId&&l.backendId===e.binding.backendId?l:{imageId:i.image.id,signature:i.signature,workspaceId:e.workspaceId,backendId:e.binding.backendId,compositeKey:null,rawKey:null,composite:null,raw:null,rawSettled:!1};const d=u=>{c=u,e.onRecord(u)};try{if(!c.composite){const g=c.compositeKey,p=t.mintKey(g??void 0)??null;p!==c.compositeKey&&d({...c,compositeKey:p});let m;g&&p===g&&(a(),m=await t.lookup(e.workspaceId,p).then(Ke).catch(()=>{}),a()),m||(a(),m=await t.placeImage(e.workspaceId,`screenshot-${i.image.id.slice(0,8)}.${We(i.composite.mimeType)}`,{data:i.composite.base64,mimeType:i.composite.mimeType,...p?{idempotencyKey:p}:{}},a),a()),d({...c,composite:{attachmentId:m.attachmentId,mimeType:m.mimeType??i.composite.mimeType}})}const u=c.composite.attachmentId;if(s&&i.raw&&!c.raw&&!c.rawSettled){const g=c.rawKey,p=t.mintKey(g??void 0);if(p){p!==c.rawKey&&d({...c,rawKey:p});let m;g&&p===g&&(a(),m=await t.lookup(e.workspaceId,p).then(Ke).catch(()=>{}),a());try{m||(a(),m=await t.placeImage(e.workspaceId,`screenshot-${i.image.id.slice(0,8)}-original.${We(i.raw.mimeType)}`,{data:i.raw.base64,mimeType:i.raw.mimeType,idempotencyKey:p,rawScreenshot:{compositeAttachmentId:u}},a),a());const w=da(m,u,n());if(w==="expired")d({...c,rawSettled:!0});else if(w)d({...c,raw:w});else throw new ee("echo")}catch(w){if(la(w))d({...c,rawSettled:!0});else throw w instanceof ee?w:gt(w)?new ee("refused"):w}}else throw new ee("unkeyed")}}catch(u){throw u instanceof Ie?u:new ua(i.image.id,u)}o.push(c)}return o}async function is(e,t,n,a){const r=()=>{if(!K.current(a))throw new Ie};r();const s=await K.placeImage(e,t,{...n,idempotencyKey:K.mintKey()},r);return r(),s}const pa=new Set(["invalid-saved-edit","media-send-retired","transcript-unavailable","transcript-pending","invalid-edit","stale-source","legacy-baked-marks","timing-unavailable","audio-unavailable","media-source-unavailable","media-export-unavailable","media-animation-layer-limit","media-export-failed","legacy-original-unavailable","capture-render-unavailable","capture-blur-unavailable","stale-source-pixels","not-a-screenshot","not-admitted","unavailable","dock-evidence-missing-pixels","draft-restore-failed","image-budget-exceeded"]),fa=new Set(["unavailable","permission","failed","busy","cancelled","limit"]);class O extends Error{constructor(t,n){super(n),this.stage=t,this.code=n,this.name="DockSendError"}}function oe(e){const t=e instanceof Error?e.message:typeof e=="string"?e:"";if(t.length>64)return"unclassified";const[n,...a]=t.split(":");return!pa.has(n)||a.length>2?"unclassified":n!=="media-export-failed"?a.length?"unclassified":n:[n,...a.map(r=>fa.has(r)?r:"other")].join(":")}function cs(e,t){return e instanceof O?{stage:e.stage,code:oe(e.code)}:{stage:t,code:oe(e)}}function W(e){if(!e||e.source.kind!=="recording")return!1;const t=e.source,n=e.saved??re(t,t.capturedMarks??[],e.transcript);if(n.video!=="full"||n.voice!=="audio"||n.crop||n.blurRegions.length||n.blurStrokes?.length)return!1;const a=_e(n,t,e.transcript);return t.visuals==="clean"?!a.errors.length&&!a.muted&&n.cuts.length===0&&!n.marks.some(r=>r.included)&&a.marks.length===0&&a.transcript===null&&a.kept.length===1&&a.kept[0].startMs===0&&a.kept[0].endMs===t.durationMs&&a.clips.length===1&&a.clips[0].startMs===0&&a.clips[0].endMs===t.durationMs:!a.errors.length&&!a.muted&&a.clips.length===1&&a.clips[0].startMs===0&&a.clips[0].endMs>=t.durationMs}async function ha(e,t,n,a,r,s){const o={images:{},files:[],frames:[],framePromptBytes:[],metadata:[]};let i="validate";try{const l=()=>{if(!r()||!Y(n))throw new Error("media-send-retired")};for(const c of[...t.images,...t.clips]){if(i="validate",s?.stage(i),c.mediaError)throw new Error("invalid-saved-edit");if(!c.media||W(c.media))continue;l();const d=structuredClone(c.media),u=d.source;let g=d.saved??re(u,u.capturedMarks??[],d.transcript),p=crypto.randomUUID();try{if(u.kind==="recording"&&g.voice==="transcript"&&d.transcript?.status!=="ready"){if(i="transcribe",s?.stage(i),!a?.transcribeMedia)throw new Error("transcript-unavailable");const f=await a.transcribeMedia({jobId:p,media:d});if(l(),!f.ok)throw new Error("transcript-unavailable");d.transcript=f.value,d.saved||(g=re(u,u.capturedMarks??[],d.transcript))}i="plan",s?.stage(i);const m=_e(g,u,d.transcript);if(m.errors.length)throw new Error(m.errors[0]);const w={id:c.id,kind:u.kind,video:g.video,voice:g.voice,transcript:m.transcript,batches:u.batches,marks:m.marks.map(({n:f,mark:k,frameAtMs:_})=>({n:f,id:k.id,at_ms:_,kind:k.kind,label:k.label,note:k.note,context:k.context,geometry:k.geometry}))};if(u.kind==="screenshot"){i="screenshot-source",s?.stage(i);const f=u.path.split("/").map(encodeURIComponent).join("/"),k=tt(`intent://local/file/${f}`,e);if(!k||k.kind!=="image")throw new Error("media-source-unavailable");const _=await Xn(k.url);l();const I={base64:Ze(_.buffer.slice(_.byteOffset,_.byteOffset+_.byteLength)),mimeType:/\.jpe?g$/i.test(u.path)?"image/jpeg":/\.webp$/i.test(u.path)?"image/webp":"image/png"};i="screenshot-render",s?.stage(i),o.images[c.id]=await an(u,g,I),l()}else{if(!m.clips.length){w.video_attachment_id=null,w.frames=[],w.kept_ms=[],o.metadata.push(w);continue}const f={...d,saved:g};let k=await a?.takePreparedRecording?.(f);if(k&&(p=k.jobId),l(),!k){if(!a)throw new Error("media-export-unavailable");k=await lt(f,p,a,()=>r()&&Y(n),S=>{i=S,s?.stage(S),S==="export"&&s?.exportAttempt(p)})}p=k.jobId,i="placement",s?.stage(i);const _=[k.value.video,...k.value.frames],I=[];for(let S=0;S<_.length;S++){l();const v=_[S],B=`capture-${c.id.slice(0,12)}-${S}.${S===0?"mp4":v.mimeType==="image/jpeg"?"jpg":"png"}`,E=await wn(e,B,{sourcePath:v.sourcePath,mimeType:v.mimeType,idempotencyKey:se()},void 0,void 0,()=>r()&&Y(n));l(),S===0?o.files.push({type:"file",attachmentId:E.attachmentId,fileName:B,mimeType:E.mimeType??v.mimeType,size:E.size}):(o.frames.push({type:"image",attachmentId:E.attachmentId,mimeType:v.mimeType==="image/jpeg"?"image/jpeg":"image/png"}),o.framePromptBytes.push(zn(v))),I.push(E.attachmentId)}w.video_attachment_id=I[0],w.frames=k.value.frames.map((S,v)=>({mark_id:S.markId,attachment_id:I[v+1]})),w.kept_ms=m.clips}o.metadata.push(w)}finally{s?.stage("release"),await a?.releaseMediaJob?.(p).catch(()=>{})}}return o}catch(l){throw l instanceof O?l:new O(i,oe(l))}}const ue=1568,ga=.85;async function ya(e,t){const n=Math.round(e.length*3/4/1024),a=await wa(e,t),{width:r,height:s}=a,o=r>ue||s>ue;let i=r,l=s;if(o){const f=ue/Math.max(r,s);i=Math.round(r*f),l=Math.round(s*f)}const c=new OffscreenCanvas(i,l),d=c.getContext("2d");if(!d)throw new Error("Failed to get 2D canvas context for image resize");d.drawImage(a,0,0,i,l);let u=t;ba(d,i,l)||(u="image/jpeg");const g=await c.convertToBlob({type:u,quality:u==="image/jpeg"?ga:void 0}),p=g.type||u,m=await ka(g),w=Math.round(m.length*3/4/1024);return console.debug(`[image-resize] ${r}×${s} → ${i}×${l} | ${t} → ${p} | ${n} KB → ${w} KB`),{base64:m,mimeType:p}}async function wa(e,t){const n=atob(e),a=new Uint8Array(n.length);for(let s=0;s<n.length;s++)a[s]=n.charCodeAt(s);const r=new Blob([a],{type:t});return createImageBitmap(r)}function ba(e,t,n){const r=e.getImageData(0,0,t,n).data;for(let s=3;s<r.length;s+=4)if(r[s]<255)return!0;return!1}async function ka(e){const t=await e.arrayBuffer(),n=new Uint8Array(t);let a="";for(let r=0;r<n.length;r++)a+=String.fromCharCode(n[r]);return btoa(a)}const T={...Oe,badge:Oe.badgeRadius*2};function _a(e,t,n=1,a=0){const r=Math.max(1,e.displayScale)*n,s=[],o=i=>i*n;for(const{n:i,mark:l}of t){const c=l.geometry;if(c.kind==="rect")s.push({kind:"rect",x:o(c.x),y:o(c.y),w:o(c.w),h:o(c.h),width:T.stroke*r});else if(c.kind==="path")s.push({kind:"path",points:c.points.map(m=>({x:o(m.x),y:o(m.y)})),width:T.pen*r});else{const m={x:o(c.from.x),y:o(c.from.y)},w={x:o(c.to.x),y:o(c.to.y)};s.push({kind:"arrow",from:m,to:w,head:Ia(m,w,T.arrowHead*r),width:T.stroke*r})}if(!T.showNumbers)continue;const d=Math.max(a,T.badge/2*r),u=o(l.bounds.x+l.bounds.w),g=o(l.bounds.y),p=tn({x:o(l.bounds.x),y:g,w:u-o(l.bounds.x),h:o(l.bounds.h)},{x:0,y:0,w:o(e.width),h:o(e.height)},r,d);s.push({kind:"badge",...p,radius:d,label:String(i),font:d*T.badgeTextScale})}return s}function va(e,t){"letterSpacing"in e&&(e.letterSpacing="0px"),"wordSpacing"in e&&(e.wordSpacing="0px");const n=(a,r,s)=>{e.strokeStyle=T.halo,e.lineWidth=a+T.haloWidth*r,s(),e.strokeStyle=T.accent,e.lineWidth=a,s()};e.strokeStyle=T.accent,e.lineCap="round",e.lineJoin="round";for(const a of t)if(a.kind==="rect")n(a.width,a.width/T.stroke,()=>e.strokeRect(a.x,a.y,a.w,a.h));else if(a.kind==="path"||a.kind==="arrow"){e.lineWidth=a.width,e.beginPath();const r=a.kind==="path"?a.points:[a.from,a.to];a.kind==="arrow"&&r.forEach((o,i)=>i?e.lineTo(o.x,o.y):e.moveTo(o.x,o.y)),a.kind==="arrow"&&(e.moveTo(a.head.left.x,a.head.left.y),e.lineTo(a.to.x,a.to.y),e.lineTo(a.head.right.x,a.head.right.y));const s=a.kind==="path"?new Path2D(en(a.points)):null;n(a.width,a.width/(a.kind==="path"?T.pen:T.stroke),()=>s?e.stroke(s):e.stroke())}else e.fillStyle=T.paper,e.beginPath(),e.arc(a.x,a.y,a.radius,0,Math.PI*2),e.closePath(),e.fill(),e.strokeStyle=T.accent,e.lineWidth=T.badgeOutline*a.radius/T.badgeRadius,e.stroke(),e.fillStyle=T.ink,e.font=`600 ${a.font}px ${T.badgeFontFamily}`,e.textAlign="center",e.textBaseline="middle",e.fillText(a.label,a.x,a.y)}async function Sa(e,t){const n=Uint8Array.from(atob(e),a=>a.charCodeAt(0));return createImageBitmap(new Blob([n],{type:t}))}async function Ma(e){const t=await e.convertToBlob({type:"image/png"});return Ze(await t.arrayBuffer())}async function yt(e,t,n,a,r=0){await rn();const s=await Sa(e.base64,e.mimeType);try{const o=Math.min(1,a/Math.max(t.width,t.height)),i=new OffscreenCanvas(Math.max(1,Math.round(t.width*o)),Math.max(1,Math.round(t.height*o))),l=i.getContext("2d");if(!l)throw new Error("dock-evidence-canvas-unavailable");return l.drawImage(s,0,0,i.width,i.height),va(l,_a(t,n,o,r)),i}finally{s.close()}}async function Aa(e,t,n){const a=await yt(e,t,n,Math.max(t.width,t.height));return ya(await Ma(a),"image/png")}async function ls(e,t,n,a=384){const r=await yt(e,t,n,a,a/32);return URL.createObjectURL(await r.convertToBlob({type:"image/png"}))}function Ia(e,t,n=T.arrowHead){const a=Math.atan2(t.y-e.y,t.x-e.x),r=T.arrowSpread;return{left:{x:t.x-n*Math.cos(a-r),y:t.y-n*Math.sin(a-r)},right:{x:t.x-n*Math.cos(a+r),y:t.y-n*Math.sin(a+r)}}}function ds(e,t){const n=Yt(t??void 0),a=new Set(t?.clips.filter(r=>!!r.media&&!W(r.media)).map(r=>r.contextItemId));return e.filter(r=>!n.has(r.id)&&!a.has(r.id))}async function us({workspaceId:e,agentId:t,evidence:n,clickedItems:a,sendItems:r,clickedPayload:s,binding:o,service:i,current:l,onRecord:c,timing:d}){const u=()=>{if(!l()||!Y(o))throw new O("validate","media-send-retired")};if(u(),n?.images.some(b=>b.mediaError)||n?.clips.some(b=>b.mediaError))throw new O("validate","invalid-saved-edit");const g=b=>!!b.media&&!W(b.media),p=n?{workspaceId:e,agentId:t,appUrl:`intent://local/workspace/${encodeURIComponent(e)}`,clipAttachmentIds:Object.fromEntries(n.clips.map(b=>[b.id,a.find(M=>M.id===b.contextItemId)?.attachmentId??null]))}:null;for(const b of n?.clips??[]){if(!b.media||!W(b.media))continue;const M=a.find(Q=>Q.id===b.contextItemId);if(!M||M.attachmentId!==b.media.source.attachmentId||M.path!==b.media.source.path||M.placementStatus!==void 0&&M.placementStatus!=="placed")throw new O("validate","legacy-original-unavailable")}const m=n?await ha(e,n,o,i,l,d):{images:{},files:[],frames:[],framePromptBytes:[],metadata:[]},w=new Set(n?.clips.filter(b=>g(b)||!!b.media&&W(b.media)).map(b=>b.id)),f=new Set(n?.clips.filter(b=>w.has(b.id)).flatMap(b=>(b.captureHistory??[]).map(M=>M.image.id))),k=(n?.images??[]).filter(b=>b.source!=="annotate"||!!b.media||!f.has(b.id)||n.marks.some(M=>M.imageId===b.id&&!(M.clipId&&w.has(M.clipId))));d?.stage("burn");let _=[];try{_=n?await Ta({...n,images:k},a,m.images):[]}catch(b){throw new O("burn",oe(b))}if(m.framePromptBytes.reduce((b,M)=>b+(M??0),0)>qn)throw new O("validate","image-budget-exceeded");const S=new Set(n?.images.filter(b=>b.media).map(b=>b.id)),v=n?{...n,images:k.map(b=>m.images[b.id]?{...b,width:m.images[b.id].width,height:m.images[b.id].height}:b),clips:n.clips.filter(b=>!g(b)),marks:n.marks.filter(b=>!S.has(b.imageId)&&!n.clips.some(M=>g(M)&&M.id===b.clipId))}:null;u();const B=m.metadata.some(b=>typeof b.transcript=="string"&&b.transcript.trim());if(!s.text.trim()&&!r.length&&!s.workspaceContextStr?.trim()&&!_.length&&!m.files.length&&!m.frames.length&&!s.imageBlocks?.length&&!s.fileBlocks?.length&&!B)return null;let E=_,P=null;d?.stage("placement");const xe=n?await ht(o):null;if(u(),n&&(e!==be||xe?.chiefAttachments)){const b=await ma({workspaceId:e,binding:o,images:k.map((M,Q)=>{const Z=a.find(Dt=>Dt.id===M.contextItemId);return{image:M,signature:Jt(n,M.id),composite:{base64:_[Q].data,mimeType:_[Q].mimeType},raw:!M.media&&Z?.imageData&&Z.imageMimeType?{base64:Z.imageData,mimeType:Z.imageMimeType}:null}}),records:n?.placements??{},onRecord:c});u(),E=b.map(M=>({type:"image",attachmentId:M.composite.attachmentId,mimeType:M.composite.mimeType})),P=Object.fromEntries(b.map(M=>[M.imageId,{attachmentId:M.composite.attachmentId,raw:M.raw}]))}const y=new Map(n?Qe(n).map(({n:b,mark:M})=>[M.id,b]):[]),D=p&&P?{...p,imageAttachments:P,markNumbers:y}:p&&{...p,markNumbers:y},$=n&&D?{...s,imageBlocks:[...E,...m.frames,...s.imageBlocks??[]],fileBlocks:[...s.fileBlocks??[],...m.files],workspaceContextStr:[Qt(v,D),m.metadata.length?`[Edited capture outputs]
|
|
3
3
|
${JSON.stringify(m.metadata)}`:"",s.workspaceContextStr].filter(Boolean).join(`
|
|
4
4
|
|
|
5
5
|
`),messageMetadata:{...s.messageMetadata,...Xt(v,D),edited_captures:m.metadata}}:s;return u(),$}async function Ta(e,t,n={}){const a=Qe(e);return Promise.all(e.images.map(async r=>{if(n[r.id])return{type:"image",...n[r.id]};const s=t.find(i=>i.id===r.contextItemId);if(!s?.imageData||!s.imageMimeType)throw new Error("dock-evidence-missing-pixels");const o=await Aa({base64:s.imageData,mimeType:s.imageMimeType},r,a.filter(({mark:i})=>i.imageId===r.id));return{type:"image",data:o.base64,mimeType:o.mimeType}}))}function Ca(){return et()}function ms(e){const{clip:t}=e;if(t.status!=="ready"||!t.path)return null;const n=e.marks.filter(s=>s.clipId===t.id&&typeof s.clipMs=="number").sort((s,o)=>s.clipMs-o.clipMs).map(s=>({id:s.id,tool:s.tool,atMs:s.clipMs,...s.element?.name?{label:s.element.name.slice(0,200)}:{}})),a=Zt(e.evidence??void 0,t.id),r=a?t.media:void 0;return{kind:"recording",workspaceId:e.workspaceId,agentId:e.agentId,attachmentId:a?.attachmentId??t.id,sourceRevision:a?`${a.id}:${a.revision}`:t.path,attachmentPath:t.path,title:"",durationMs:t.durationMs,marks:n,provenance:a?{...a.audio==="unknown"?{}:{hasMicAudio:a.audio==="available"},visuals:a.visuals}:{hasMicAudio:t.hasMicAudio,visuals:n.length>0?"baked-marks":"clean"},...a&&r?{source:a,saved:r.saved??null,transcript:r.transcript??null}:{}}}async function ps(e){if(!Ca())return{ok:!1,error:"unavailable"};try{return await on().invoke(sn.OPEN,e)??{ok:!1,error:"unavailable"}}catch{return{ok:!1,error:"transport"}}}function fs(e){let t=null,n=null;const a=i=>e.releaseMediaJob?.(i).catch(()=>{});function r(){const i=t;t=null,!(!i||i.taken||i.stopped)&&(i.stopped=!0,clearTimeout(i.timer),a(i.id))}function s(i,l,c){if(t?.key===i||n===i||(r(),n=null,!e.adoptMediaJob||!e.exportMedia||!c()||W(l)))return;const d=structuredClone(l),u=d.saved??re(d.source,d.source.capturedMarks??[],d.transcript),g=_e(u,d.source,d.transcript);if(d.source.kind!=="recording"||d.source.visuals!=="clean"||g.errors.length||!g.clips.length||u.voice==="transcript"&&d.transcript?.status!=="ready")return;const p={...d,saved:u},m=crypto.randomUUID(),w={key:i,mediaKey:JSON.stringify(p),id:m,current:c,taken:!1,stopped:!1,settled:!1,failed:!1,timer:setTimeout(()=>{t===w&&(n=i,r())},3e4),result:Promise.resolve({error:new Error("not-started")})};t=w,w.result=lt(p,m,e,()=>!w.stopped&&w.current()).then(async f=>w.stopped||!w.current()?(await a(m),{error:new Error("media-send-retired")}):{value:f},async f=>(w.failed=!0,t===w&&(n=i),await a(m),{error:f})).finally(()=>{w.settled=!0})}async function o(i,l,c){const d=t;if(!d||d.key!==i||d.mediaKey!==JSON.stringify(l)||d.stopped||d.taken||!c())return null;if(d.failed&&d.settled)return r(),null;d.taken=!0,d.current=c,clearTimeout(d.timer),t=null;const u=await d.result;if("error"in u)throw u.error;try{if(!c())throw new Error("media-send-retired");const g=await e.adoptMediaJob?.(d.id);if(!c())throw new Error("media-send-retired");return!g?.ok||!g.value?(await a(d.id),null):u.value}catch(g){throw await a(d.id),g}}return{warm:s,take:o,cancel:r}}function hs(e={}){const t=a=>cn(a,typeof e=="function"?e():e),n=a=>vn(t(a));return{actionHints:{get capture(){return{label:h.dock_composer_screenshotAction_label(),shortcut:t("dock.capture")}},get record(){return{label:h.ui_shortcuts_dockRecord_label(),shortcut:t("dock.record")}},get dictate(){return{label:h.dock_shortcut_dictate_label()}}},get capture(){return h.dock_composer_capture_tooltip({shortcut:n("dock.capture")})},captureMode:{get window(){return h.dock_composer_captureWindow_tooltip({shortcut:n("dock.capture")})},get region(){return h.dock_composer_captureRegion_tooltip({shortcut:n("dock.capture")})}},captureModes:{fullscreen:h.dock_composer_captureFullscreen_label(),window:h.dock_composer_captureWindow_label(),region:h.dock_composer_captureRegion_label()},captureOptions:h.dock_composer_captureModes_ariaLabel(),captureLimit:h.dock_composer_captureLimit_tooltip(),clipLimit:h.dock_composer_clipLimit_tooltip({limit:H(ae.clips)}),get record(){return h.dock_composer_record_tooltip({shortcut:n("dock.record")})},stopRecording:h.dock_composer_stopRecording_tooltip(),annotationTools:h.annotation_toolbar_ariaLabel(),annotateCurrent:a=>h.dock_composer_annotate_ariaLabel({tool:a}),tools:{pick:h.dock_composer_pick_label(),box:h.dock_composer_box_label(),pen:h.dock_composer_pen_label(),arrow:h.annotation_arrow_label()},get dictate(){return h.dock_shortcut_dictate_label()},stopDictating:h.dock_composer_stopDictating_tooltip(),annotating:h.dock_composer_annotating_status(),recording:h.dock_composer_recording_status(),markUp:h.dock_composer_markUp_label(),remove:h.chat_contextChip_remove_label(),play:h.dock_composer_play_label(),edit:h.dock_composer_edit_label(),done:h.dock_composer_done_label(),attachments:h.context_attachments_title_label(),retry:h.chat_shared_retry_label(),attachmentPending:h.dock_composer_attachmentPending_status(),attachmentFailed:h.dock_composer_attachmentFailed_error(),image:a=>h.dock_composer_image_ariaLabel({n:H(a)}),clip:a=>h.dock_composer_clip_ariaLabel({duration:a}),recordingReference:(a,r)=>r?h.dock_composer_recordingEnd_chip({n:H(a)}):h.dock_composer_recordingStart_chip({n:H(a)}),speechError:a=>a.includes("permission")?h.dock_composer_speechPermission_error():["unsupported-platform","helper-missing","recognizer-unavailable","locale-unsupported","assets-unavailable","unavailable"].includes(a)?h.dock_composer_speechUnavailable_error():h.dock_composer_speechFailed_error()}}function gs(e,t){return{enabled:e,limit:ae.files,excludedIds:t,unavailableMessage:h.dock_composer_filesUnavailable_error(),limitMessage:h.dock_composer_fileLimit_error({limit:H(ae.files)})}}function Ea(e){try{return new URL(e.pageUrl).hostname||e.pageUrl}catch{return e.pageUrl}}function ys(e,t){return e.targetAgentId===t}function ws(e){const t=e.element,n=e.viewport,a=Ea(e),r=t?`<${t.tagName.toLowerCase()}> · ${a}`:e.title||a,s=["<browser-element-capture>",`Page URL: ${e.pageUrl}`,`Page title: ${e.title}`,...t?[`DOM path: ${t.domPath}`,`CSS selector: ${t.selector}`,`Text snippet: ${t.textSnippet}`,...t.sourceRef?[`Source ref: ${t.sourceRef}`]:[],...n?[`Viewport: ${n.width}×${n.height}`]:[],`Element bounds: ${t.rect.width}×${t.rect.height} at (${t.rect.x}, ${t.rect.y})`]:[],"</browser-element-capture>"].join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as p,ay as C,aX as H,W as _,r as q,a6 as G,B as U,aV as j,X as K}from"./
|
|
1
|
+
import{b as p,ay as C,aX as H,W as _,r as q,a6 as G,B as U,aV as j,X as K}from"./Cu11OjbU.js";var A="",M="",O="",D=[],b=new Map,v=p(e=>j(e,K()),"sanitizeText"),y=p(e=>{switch(e.type){case"terminal":return{...e,value:v(e.value)};case"nonterminal":return{...e,name:v(e.name)};case"sequence":return{...e,elements:e.elements.map(y)};case"choice":return{...e,alternatives:e.alternatives.map(y)};case"optional":return{...e,element:y(e.element)};case"repetition":return{...e,element:y(e.element),separator:e.separator?y(e.separator):void 0};case"special":return{...e,text:v(e.text)}}},"sanitizeAstNode"),J=p(()=>{A="",M="",O="",D.length=0,b.clear(),q(),C.debug("[Railroad] Database cleared")},"clear"),Y=p(e=>{A=v(e),C.debug("[Railroad] Title set:",e)},"setTitle"),P=p(()=>A,"getTitle"),Q=p(e=>{const i={...e,name:v(e.name),definition:y(e.definition),comment:e.comment?v(e.comment):void 0};C.debug("[Railroad] Adding rule:",i.name),b.has(i.name)&&C.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),D.push(i),b.set(i.name,i)},"addRule"),Z=p(()=>D,"getRules"),V=p(e=>b.get(e),"getRule"),ee=p(e=>{M=v(e).replace(/^\s+/g,""),C.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),te=p(()=>M,"getAccTitle"),re=p(e=>{O=v(e).replace(/\n\s+/g,`
|
|
2
2
|
`),C.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ie=p(()=>O,"getAccDescription"),ae=Y,ne=P,oe={clear:J,setTitle:Y,getTitle:P,addRule:Q,getRules:Z,getRule:V,setAccTitle:ee,getAccTitle:te,setAccDescription:re,getAccDescription:ie,setDiagramTitle:ae,getDiagramTitle:ne},f={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},le=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,se=/^[\w "',.-]+$/,de=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),L=p(e=>e?Object.keys(e).every(i=>i==="railroad"||de.has(i)):!1,"isRailroadStyleOptions"),ce=p(e=>e?"railroad"in e&&e.railroad?e.railroad:L(e)?e:{}:{},"extractRailroadOverrides"),me=p(e=>{if(!e||L(e))return{};const{railroad:i,svgId:n,theme:a,look:t,...r}=e;return r},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const n=e.trim();return le.test(n)?n:i},"sanitizeColorValue"),X=p((e,i)=>{if(typeof e!="string")return i;const n=e.trim();return se.test(n)?n:i},"sanitizeFontFamilyValue"),F=p((e,i)=>{const n=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(n)&&n>=0?n:i},"sanitizeNumberValue"),he=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),pe=p(e=>{const i=X(e.fontFamily,f.fontFamily),n=he(e.fontSize)??f.fontSize;return{...f,fontFamily:i,fontSize:n,terminalFill:m(e.secondBkg??e.secondaryColor,f.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,f.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,f.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,f.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,f.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,f.nonTerminalTextColor),lineColor:m(e.lineColor,f.lineColor),markerFill:m(e.lineColor,f.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,f.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,f.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,f.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,f.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,f.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,f.ruleNameColor)}},"buildThemeDefaults"),E=p(e=>{const i=_(),n={...G(),...i.themeVariables??{},...me(e)},a=pe(n),t={...i.railroad??{},...ce(e)};return{compactMode:t.compactMode??a.compactMode,padding:F(t.padding,a.padding),verticalSeparation:F(t.verticalSeparation,a.verticalSeparation),horizontalSeparation:F(t.horizontalSeparation,a.horizontalSeparation),arcRadius:F(t.arcRadius,a.arcRadius),fontSize:F(t.fontSize,a.fontSize),fontFamily:X(t.fontFamily,a.fontFamily),terminalFill:m(t.terminalFill,a.terminalFill),terminalStroke:m(t.terminalStroke,a.terminalStroke),terminalTextColor:m(t.terminalTextColor,a.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,a.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,a.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,a.nonTerminalTextColor),lineColor:m(t.lineColor,a.lineColor),strokeWidth:F(t.strokeWidth,a.strokeWidth),markerFill:m(t.markerFill,a.markerFill),commentFill:m(t.commentFill,a.commentFill),commentStroke:m(t.commentStroke,a.commentStroke),commentTextColor:m(t.commentTextColor,a.commentTextColor),specialFill:m(t.specialFill,a.specialFill),specialStroke:m(t.specialStroke,a.specialStroke),ruleNameColor:m(t.ruleNameColor,a.ruleNameColor),showMarkers:t.showMarkers??a.showMarkers,markerRadius:F(t.markerRadius,a.markerRadius)}},"buildRailroadStyleOptions"),Te=p(e=>{const{fontFamily:i,fontSize:n,terminalFill:a,terminalStroke:t,terminalTextColor:r,nonTerminalFill:o,nonTerminalStroke:g,nonTerminalTextColor:l,lineColor:s,strokeWidth:h,markerFill:u,commentFill:c,commentStroke:w,commentTextColor:d,specialFill:T,specialStroke:z,ruleNameColor:S}=E(e);return`
|
|
3
3
|
.railroad-diagram {
|
|
4
4
|
font-family: ${i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Fe}from"./CzFnnQhI.js";import{ap as Me,a5 as xe,ar as Ke,bc as We,bb as Ye,be as Ve,bd as Ue,b9 as He,b7 as Xe,b2 as je,aN as Ge,aF as qe,aE as Je,az as Ze,aj as Qe,ai as $e,ak as et,S as tt,R as st,K as rt,k as it,I as at,f as nt,g as ot,e as ct,b as u,W as P,aW as X,ag as lt,aD as ut,B as ht,ay as y,r as gt,am as dt,aU as pt,ab as ft,x as bt,aT as St,p as xt,X as Le,ae as Lt,af as mt,aK as yt,z as wt,a3 as Et,ah as me,b6 as kt,aL as _t}from"./DtluaQEg.js";import{G as Dt}from"./-xK_vQQs.js";function Tt(e){return Array.isArray(e)}function Nt(e){if(Me(e))return e;const a=xe(e);if(!It(e))return{};if(Tt(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(Ke(e)){const s=e,c=s.constructor;return new c(s.buffer,s.byteOffset,s.length)}if(a==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(a==="[object DataView]"){const s=e,c=s.buffer,g=s.byteOffset,t=s.byteLength,h=new ArrayBuffer(t),x=new Uint8Array(c,g,t);return new Uint8Array(h).set(x),new DataView(h)}if(a==="[object Boolean]"||a==="[object Number]"||a==="[object String]"){const s=e.constructor,c=new s(e.valueOf());return a==="[object String]"?Ct(c,e):se(c,e),c}if(a==="[object Date]")return new Date(Number(e));if(a==="[object RegExp]"){const s=e,c=new RegExp(s.source,s.flags);return c.lastIndex=s.lastIndex,c}if(a==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(a==="[object Map]"){const s=e,c=new Map;return s.forEach((g,t)=>{c.set(t,g)}),c}if(a==="[object Set]"){const s=e,c=new Set;return s.forEach(g=>{c.add(g)}),c}if(a==="[object Arguments]"){const s=e,c={};return se(c,s),c.length=s.length,c[Symbol.iterator]=s[Symbol.iterator],c}const o={};return vt(o,e),se(o,e),Ot(o,e),o}function It(e){switch(xe(e)){case ct:case ot:case nt:case at:case it:case rt:case st:case tt:case et:case $e:case Qe:case Ze:case Je:case qe:case Ge:case je:case Xe:case He:case Ue:case Ve:case Ye:case We:return!0;default:return!1}}function se(e,a){for(const o in a)Object.hasOwn(a,o)&&(e[o]=a[o])}function Ot(e,a){const o=Object.getOwnPropertySymbols(a);for(let s=0;s<o.length;s++){const c=o[s];Object.prototype.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}}function Ct(e,a){const o=a.valueOf().length;for(const s in a)Object.hasOwn(a,s)&&(Number.isNaN(Number(s))||Number(s)>=o)&&(e[s]=a[s])}function vt(e,a){const o=Object.getPrototypeOf(a);o!==null&&typeof a.constructor=="function"&&Object.setPrototypeOf(e,o)}var ie=(function(){var e=u(function(C,d,i,l){for(i=i||{},l=C.length;l--;i[C[l]]=d);return i},"o"),a=[1,15],o=[1,7],s=[1,13],c=[1,14],g=[1,19],t=[1,16],h=[1,17],x=[1,18],L=[8,30],b=[8,10,21,28,29,30,31,39,43,46],f=[1,23],m=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],S=[8,10,15,16,21,27,28,29,30,31,39,43,46],_=[1,49],k={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:u(function(d,i,l,p,E,r,K){var n=r.length-1;switch(E){case 4:p.getLogger().debug("Rule: separator (NL) ");break;case 5:p.getLogger().debug("Rule: separator (Space) ");break;case 6:p.getLogger().debug("Rule: separator (EOF) ");break;case 7:p.getLogger().debug("Rule: hierarchy: ",r[n-1]),p.setHierarchy(r[n-1]);break;case 8:p.getLogger().debug("Stop NL ");break;case 9:p.getLogger().debug("Stop EOF ");break;case 10:p.getLogger().debug("Stop NL2 ");break;case 11:p.getLogger().debug("Stop EOF2 ");break;case 12:p.getLogger().debug("Rule: statement: ",r[n]),typeof r[n].length=="number"?this.$=r[n]:this.$=[r[n]];break;case 13:p.getLogger().debug("Rule: statement #2: ",r[n-1]),this.$=[r[n-1]].concat(r[n]);break;case 14:p.getLogger().debug("Rule: link: ",r[n],d),this.$={edgeTypeStr:r[n],label:""};break;case 15:p.getLogger().debug("Rule: LABEL link: ",r[n-3],r[n-1],r[n]),this.$={edgeTypeStr:r[n],label:r[n-1]};break;case 18:const F=parseInt(r[n]),Y=p.generateId();this.$={id:Y,type:"space",label:"",width:F,children:[]};break;case 23:p.getLogger().debug("Rule: (nodeStatement link node) ",r[n-2],r[n-1],r[n]," typestr: ",r[n-1].edgeTypeStr);const J=p.edgeStrToEdgeData(r[n-1].edgeTypeStr),V=p.edgeStrToEdgeStartData(r[n-1].edgeTypeStr),Z=p.edgeStrToThickness(r[n-1].edgeTypeStr),D=p.edgeStrToPattern(r[n-1].edgeTypeStr);this.$=[{id:r[n-2].id,label:r[n-2].label,type:r[n-2].type,directions:r[n-2].directions},{id:r[n-2].id+"-"+r[n].id,start:r[n-2].id,end:r[n].id,label:r[n-1].label,type:"edge",thickness:Z,pattern:D,directions:r[n].directions,arrowTypeEnd:J,arrowTypeStart:V},{id:r[n].id,label:r[n].label,type:p.typeStr2Type(r[n].typeStr),directions:r[n].directions}];break;case 24:p.getLogger().debug("Rule: nodeStatement (abc88 node size) ",r[n-1],r[n]),this.$={id:r[n-1].id,label:r[n-1].label,type:p.typeStr2Type(r[n-1].typeStr),directions:r[n-1].directions,widthInColumns:parseInt(r[n],10)};break;case 25:p.getLogger().debug("Rule: nodeStatement (node) ",r[n]),this.$={id:r[n].id,label:r[n].label,type:p.typeStr2Type(r[n].typeStr),directions:r[n].directions,widthInColumns:1};break;case 26:p.getLogger().debug("APA123",this?this:"na"),p.getLogger().debug("COLUMNS: ",r[n]),this.$={type:"column-setting",columns:r[n]==="auto"?-1:parseInt(r[n])};break;case 27:p.getLogger().debug("Rule: id-block statement : ",r[n-2],r[n-1]),p.generateId(),this.$={...r[n-2],type:"composite",children:r[n-1]};break;case 28:p.getLogger().debug("Rule: blockStatement : ",r[n-2],r[n-1],r[n]);const z=p.generateId();this.$={id:z,type:"composite",label:"",children:r[n-1]};break;case 29:p.getLogger().debug("Rule: node (NODE_ID separator): ",r[n]),this.$={id:r[n]};break;case 30:p.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",r[n-1],r[n]),this.$={id:r[n-1],label:r[n].label,typeStr:r[n].typeStr,directions:r[n].directions};break;case 31:p.getLogger().debug("Rule: dirList: ",r[n]),this.$=[r[n]];break;case 32:p.getLogger().debug("Rule: dirList: ",r[n-1],r[n]),this.$=[r[n-1]].concat(r[n]);break;case 33:p.getLogger().debug("Rule: nodeShapeNLabel: ",r[n-2],r[n-1],r[n]),this.$={typeStr:r[n-2]+r[n],label:r[n-1]};break;case 34:p.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",r[n-3],r[n-2]," #3:",r[n-1],r[n]),this.$={typeStr:r[n-3]+r[n],label:r[n-2],directions:r[n-1]};break;case 35:case 36:this.$={type:"classDef",id:r[n-1].trim(),css:r[n].trim()};break;case 37:this.$={type:"applyClass",id:r[n-1].trim(),styleClass:r[n].trim()};break;case 38:this.$={type:"applyStyles",id:r[n-1].trim(),stylesStr:r[n].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:a,11:3,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:s,29:c,31:g,39:t,43:h,46:x},{8:[1,20]},e(L,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:a,21:o,28:s,29:c,31:g,39:t,43:h,46:x}),e(b,[2,16],{14:22,15:f,16:m}),e(b,[2,17]),e(b,[2,18]),e(b,[2,19]),e(b,[2,20]),e(b,[2,21]),e(b,[2,22]),e(w,[2,25],{27:[1,25]}),e(b,[2,26]),{19:26,26:12,31:g},{10:a,11:27,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:s,29:c,31:g,39:t,43:h,46:x},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(S,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(L,[2,13]),{26:35,31:g},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:a,11:37,13:4,14:22,15:f,16:m,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:s,29:c,31:g,39:t,43:h,46:x},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(S,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(b,[2,28]),e(b,[2,35]),e(b,[2,36]),e(b,[2,37]),e(b,[2,38]),{36:[1,47]},{33:48,34:_},{15:[1,50]},e(b,[2,27]),e(S,[2,33]),{38:[1,51]},{33:52,34:_,38:[2,31]},{31:[2,15]},e(S,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:u(function(d,i){if(i.recoverable)this.trace(d);else{var l=new Error(d);throw l.hash=i,l}},"parseError"),parse:u(function(d){var i=this,l=[0],p=[],E=[null],r=[],K=this.table,n="",F=0,Y=0,J=2,V=1,Z=r.slice.call(arguments,1),D=Object.create(this.lexer),z={yy:{}};for(var Q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Q)&&(z.yy[Q]=this.yy[Q]);D.setInput(d,z.yy),z.yy.lexer=D,z.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var $=D.yylloc;r.push($);var Re=D.options&&D.options.ranges;typeof z.yy.parseError=="function"?this.parseError=z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Pe(I){l.length=l.length-2*I,E.length=E.length-I,r.length=r.length-I}u(Pe,"popStack");function de(){var I;return I=p.pop()||D.lex()||V,typeof I!="number"&&(I instanceof Array&&(p=I,I=p.pop()),I=i.symbols_[I]||I),I}u(de,"lex");for(var N,R,v,ee,M={},U,B,pe,H;;){if(R=l[l.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((N===null||typeof N>"u")&&(N=de()),v=K[R]&&K[R][N]),typeof v>"u"||!v.length||!v[0]){var te="";H=[];for(U in K[R])this.terminals_[U]&&U>J&&H.push("'"+this.terminals_[U]+"'");D.showPosition?te="Parse error on line "+(F+1)+`:
|
|
1
|
+
import{g as Fe}from"./cmil589m.js";import{ap as Me,a5 as xe,ar as Ke,bc as We,bb as Ye,be as Ve,bd as Ue,b9 as He,b7 as Xe,b2 as je,aN as Ge,aF as qe,aE as Je,az as Ze,aj as Qe,ai as $e,ak as et,S as tt,R as st,K as rt,k as it,I as at,f as nt,g as ot,e as ct,b as u,W as P,aW as X,ag as lt,aD as ut,B as ht,ay as y,r as gt,am as dt,aU as pt,ab as ft,x as bt,aT as St,p as xt,X as Le,ae as Lt,af as mt,aK as yt,z as wt,a3 as Et,ah as me,b6 as kt,aL as _t}from"./Cu11OjbU.js";import{G as Dt}from"./-xK_vQQs.js";function Tt(e){return Array.isArray(e)}function Nt(e){if(Me(e))return e;const a=xe(e);if(!It(e))return{};if(Tt(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(Ke(e)){const s=e,c=s.constructor;return new c(s.buffer,s.byteOffset,s.length)}if(a==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(a==="[object DataView]"){const s=e,c=s.buffer,g=s.byteOffset,t=s.byteLength,h=new ArrayBuffer(t),x=new Uint8Array(c,g,t);return new Uint8Array(h).set(x),new DataView(h)}if(a==="[object Boolean]"||a==="[object Number]"||a==="[object String]"){const s=e.constructor,c=new s(e.valueOf());return a==="[object String]"?Ct(c,e):se(c,e),c}if(a==="[object Date]")return new Date(Number(e));if(a==="[object RegExp]"){const s=e,c=new RegExp(s.source,s.flags);return c.lastIndex=s.lastIndex,c}if(a==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(a==="[object Map]"){const s=e,c=new Map;return s.forEach((g,t)=>{c.set(t,g)}),c}if(a==="[object Set]"){const s=e,c=new Set;return s.forEach(g=>{c.add(g)}),c}if(a==="[object Arguments]"){const s=e,c={};return se(c,s),c.length=s.length,c[Symbol.iterator]=s[Symbol.iterator],c}const o={};return vt(o,e),se(o,e),Ot(o,e),o}function It(e){switch(xe(e)){case ct:case ot:case nt:case at:case it:case rt:case st:case tt:case et:case $e:case Qe:case Ze:case Je:case qe:case Ge:case je:case Xe:case He:case Ue:case Ve:case Ye:case We:return!0;default:return!1}}function se(e,a){for(const o in a)Object.hasOwn(a,o)&&(e[o]=a[o])}function Ot(e,a){const o=Object.getOwnPropertySymbols(a);for(let s=0;s<o.length;s++){const c=o[s];Object.prototype.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}}function Ct(e,a){const o=a.valueOf().length;for(const s in a)Object.hasOwn(a,s)&&(Number.isNaN(Number(s))||Number(s)>=o)&&(e[s]=a[s])}function vt(e,a){const o=Object.getPrototypeOf(a);o!==null&&typeof a.constructor=="function"&&Object.setPrototypeOf(e,o)}var ie=(function(){var e=u(function(C,d,i,l){for(i=i||{},l=C.length;l--;i[C[l]]=d);return i},"o"),a=[1,15],o=[1,7],s=[1,13],c=[1,14],g=[1,19],t=[1,16],h=[1,17],x=[1,18],L=[8,30],b=[8,10,21,28,29,30,31,39,43,46],f=[1,23],m=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],S=[8,10,15,16,21,27,28,29,30,31,39,43,46],_=[1,49],k={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:u(function(d,i,l,p,E,r,K){var n=r.length-1;switch(E){case 4:p.getLogger().debug("Rule: separator (NL) ");break;case 5:p.getLogger().debug("Rule: separator (Space) ");break;case 6:p.getLogger().debug("Rule: separator (EOF) ");break;case 7:p.getLogger().debug("Rule: hierarchy: ",r[n-1]),p.setHierarchy(r[n-1]);break;case 8:p.getLogger().debug("Stop NL ");break;case 9:p.getLogger().debug("Stop EOF ");break;case 10:p.getLogger().debug("Stop NL2 ");break;case 11:p.getLogger().debug("Stop EOF2 ");break;case 12:p.getLogger().debug("Rule: statement: ",r[n]),typeof r[n].length=="number"?this.$=r[n]:this.$=[r[n]];break;case 13:p.getLogger().debug("Rule: statement #2: ",r[n-1]),this.$=[r[n-1]].concat(r[n]);break;case 14:p.getLogger().debug("Rule: link: ",r[n],d),this.$={edgeTypeStr:r[n],label:""};break;case 15:p.getLogger().debug("Rule: LABEL link: ",r[n-3],r[n-1],r[n]),this.$={edgeTypeStr:r[n],label:r[n-1]};break;case 18:const F=parseInt(r[n]),Y=p.generateId();this.$={id:Y,type:"space",label:"",width:F,children:[]};break;case 23:p.getLogger().debug("Rule: (nodeStatement link node) ",r[n-2],r[n-1],r[n]," typestr: ",r[n-1].edgeTypeStr);const J=p.edgeStrToEdgeData(r[n-1].edgeTypeStr),V=p.edgeStrToEdgeStartData(r[n-1].edgeTypeStr),Z=p.edgeStrToThickness(r[n-1].edgeTypeStr),D=p.edgeStrToPattern(r[n-1].edgeTypeStr);this.$=[{id:r[n-2].id,label:r[n-2].label,type:r[n-2].type,directions:r[n-2].directions},{id:r[n-2].id+"-"+r[n].id,start:r[n-2].id,end:r[n].id,label:r[n-1].label,type:"edge",thickness:Z,pattern:D,directions:r[n].directions,arrowTypeEnd:J,arrowTypeStart:V},{id:r[n].id,label:r[n].label,type:p.typeStr2Type(r[n].typeStr),directions:r[n].directions}];break;case 24:p.getLogger().debug("Rule: nodeStatement (abc88 node size) ",r[n-1],r[n]),this.$={id:r[n-1].id,label:r[n-1].label,type:p.typeStr2Type(r[n-1].typeStr),directions:r[n-1].directions,widthInColumns:parseInt(r[n],10)};break;case 25:p.getLogger().debug("Rule: nodeStatement (node) ",r[n]),this.$={id:r[n].id,label:r[n].label,type:p.typeStr2Type(r[n].typeStr),directions:r[n].directions,widthInColumns:1};break;case 26:p.getLogger().debug("APA123",this?this:"na"),p.getLogger().debug("COLUMNS: ",r[n]),this.$={type:"column-setting",columns:r[n]==="auto"?-1:parseInt(r[n])};break;case 27:p.getLogger().debug("Rule: id-block statement : ",r[n-2],r[n-1]),p.generateId(),this.$={...r[n-2],type:"composite",children:r[n-1]};break;case 28:p.getLogger().debug("Rule: blockStatement : ",r[n-2],r[n-1],r[n]);const z=p.generateId();this.$={id:z,type:"composite",label:"",children:r[n-1]};break;case 29:p.getLogger().debug("Rule: node (NODE_ID separator): ",r[n]),this.$={id:r[n]};break;case 30:p.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",r[n-1],r[n]),this.$={id:r[n-1],label:r[n].label,typeStr:r[n].typeStr,directions:r[n].directions};break;case 31:p.getLogger().debug("Rule: dirList: ",r[n]),this.$=[r[n]];break;case 32:p.getLogger().debug("Rule: dirList: ",r[n-1],r[n]),this.$=[r[n-1]].concat(r[n]);break;case 33:p.getLogger().debug("Rule: nodeShapeNLabel: ",r[n-2],r[n-1],r[n]),this.$={typeStr:r[n-2]+r[n],label:r[n-1]};break;case 34:p.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",r[n-3],r[n-2]," #3:",r[n-1],r[n]),this.$={typeStr:r[n-3]+r[n],label:r[n-2],directions:r[n-1]};break;case 35:case 36:this.$={type:"classDef",id:r[n-1].trim(),css:r[n].trim()};break;case 37:this.$={type:"applyClass",id:r[n-1].trim(),styleClass:r[n].trim()};break;case 38:this.$={type:"applyStyles",id:r[n-1].trim(),stylesStr:r[n].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:a,11:3,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:s,29:c,31:g,39:t,43:h,46:x},{8:[1,20]},e(L,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:a,21:o,28:s,29:c,31:g,39:t,43:h,46:x}),e(b,[2,16],{14:22,15:f,16:m}),e(b,[2,17]),e(b,[2,18]),e(b,[2,19]),e(b,[2,20]),e(b,[2,21]),e(b,[2,22]),e(w,[2,25],{27:[1,25]}),e(b,[2,26]),{19:26,26:12,31:g},{10:a,11:27,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:s,29:c,31:g,39:t,43:h,46:x},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(S,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(L,[2,13]),{26:35,31:g},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:a,11:37,13:4,14:22,15:f,16:m,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:s,29:c,31:g,39:t,43:h,46:x},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(S,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(b,[2,28]),e(b,[2,35]),e(b,[2,36]),e(b,[2,37]),e(b,[2,38]),{36:[1,47]},{33:48,34:_},{15:[1,50]},e(b,[2,27]),e(S,[2,33]),{38:[1,51]},{33:52,34:_,38:[2,31]},{31:[2,15]},e(S,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:u(function(d,i){if(i.recoverable)this.trace(d);else{var l=new Error(d);throw l.hash=i,l}},"parseError"),parse:u(function(d){var i=this,l=[0],p=[],E=[null],r=[],K=this.table,n="",F=0,Y=0,J=2,V=1,Z=r.slice.call(arguments,1),D=Object.create(this.lexer),z={yy:{}};for(var Q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Q)&&(z.yy[Q]=this.yy[Q]);D.setInput(d,z.yy),z.yy.lexer=D,z.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var $=D.yylloc;r.push($);var Re=D.options&&D.options.ranges;typeof z.yy.parseError=="function"?this.parseError=z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Pe(I){l.length=l.length-2*I,E.length=E.length-I,r.length=r.length-I}u(Pe,"popStack");function de(){var I;return I=p.pop()||D.lex()||V,typeof I!="number"&&(I instanceof Array&&(p=I,I=p.pop()),I=i.symbols_[I]||I),I}u(de,"lex");for(var N,R,v,ee,M={},U,B,pe,H;;){if(R=l[l.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((N===null||typeof N>"u")&&(N=de()),v=K[R]&&K[R][N]),typeof v>"u"||!v.length||!v[0]){var te="";H=[];for(U in K[R])this.terminals_[U]&&U>J&&H.push("'"+this.terminals_[U]+"'");D.showPosition?te="Parse error on line "+(F+1)+`:
|
|
2
2
|
`+D.showPosition()+`
|
|
3
3
|
Expecting `+H.join(", ")+", got '"+(this.terminals_[N]||N)+"'":te="Parse error on line "+(F+1)+": Unexpected "+(N==V?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(te,{text:D.match,token:this.terminals_[N]||N,line:D.yylineno,loc:$,expected:H})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+N);switch(v[0]){case 1:l.push(N),E.push(D.yytext),r.push(D.yylloc),l.push(v[1]),N=null,Y=D.yyleng,n=D.yytext,F=D.yylineno,$=D.yylloc;break;case 2:if(B=this.productions_[v[1]][1],M.$=E[E.length-B],M._$={first_line:r[r.length-(B||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(B||1)].first_column,last_column:r[r.length-1].last_column},Re&&(M._$.range=[r[r.length-(B||1)].range[0],r[r.length-1].range[1]]),ee=this.performAction.apply(M,[n,Y,F,z.yy,v[1],E,r].concat(Z)),typeof ee<"u")return ee;B&&(l=l.slice(0,-1*B*2),E=E.slice(0,-1*B),r=r.slice(0,-1*B)),l.push(this.productions_[v[1]][0]),E.push(M.$),r.push(M._$),pe=K[l[l.length-2]][l[l.length-1]],l.push(pe);break;case 3:return!0}}return!0},"parse")},T=(function(){var C={EOF:1,parseError:u(function(i,l){if(this.yy.parser)this.yy.parser.parseError(i,l);else throw new Error(i)},"parseError"),setInput:u(function(d,i){return this.yy=i||this.yy||{},this._input=d,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:u(function(){var d=this._input[0];this.yytext+=d,this.yyleng++,this.offset++,this.match+=d,this.matched+=d;var i=d.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),d},"input"),unput:u(function(d){var i=d.length,l=d.split(/(?:\r\n?|\n)/g);this._input=d+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var p=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===p.length?this.yylloc.first_column:0)+p[p.length-l.length].length-l[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:u(function(){return this._more=!0,this},"more"),reject:u(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:u(function(d){this.unput(this.match.slice(d))},"less"),pastInput:u(function(){var d=this.matched.substr(0,this.matched.length-this.match.length);return(d.length>20?"...":"")+d.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:u(function(){var d=this.match;return d.length<20&&(d+=this._input.substr(0,20-d.length)),(d.substr(0,20)+(d.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:u(function(){var d=this.pastInput(),i=new Array(d.length+1).join("-");return d+this.upcomingInput()+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as h}from"./
|
|
1
|
+
import{I as h}from"./CQlYR8ss.js";import{c as v}from"./ChTqQfQN.js";import{O as d}from"./TB9r2XJy.js";const g=v("AttachmentImageUrl");function y(t,n){const r=n.split("/").filter(e=>e.length>0).map(e=>encodeURIComponent(e)).join("/");return`workspace-file://${t}/${r}`}const u=new Map,a=new Map;let f=0,m=!1;function p(){m||(m=!0,d(()=>{f+=1,u.clear(),a.clear()}))}function A(t,n){u.delete(`${t}/${n}`)}function F(t,n,r){p();let e=!1,i=!1,o=!1;async function l(){if(!e){if(i){o=!0;return}i=!0;try{const c=await $(t,n);e||r(c)}finally{i=!1,o&&(o=!1,l())}}}const s=d(()=>{l()});return l(),{imageFailed(){e||(A(t,n),r(null))},dispose(){e=!0,s()}}}function $(t,n){p();const r=f,e=`${t}/${n}`,i=u.get(e);if(i)return Promise.resolve(i);const o=a.get(e);if(o)return o;const l=(async()=>{try{const s=await h({attachmentId:n,workspaceId:t});if(r!==f)return null;if(!s.exists)return g.warn("Attachment file missing on disk",{attachmentId:n}),null;const c=y(t,s.path);return u.set(e,c),c}catch(s){return g.warn("Failed to resolve attachment image",{attachmentId:n,error:s}),null}finally{r===f&&a.delete(e)}})();return a.set(e,l),l}export{A as e,F as o,$ as r};
|