@sma1lboy/rove 0.9.253 → 0.9.256
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/dist/cli/{chunk-xmf4053m.js → chunk-09v8w5jq.js} +1 -1
- package/dist/cli/{chunk-sncjkw3g.js → chunk-0yyvfpcg.js} +3 -3
- package/dist/cli/{chunk-t6j3pmpp.js → chunk-18dpws0y.js} +1 -1
- package/dist/cli/{chunk-19h18xca.js → chunk-1e6jbj70.js} +1 -1
- package/dist/cli/{chunk-avdg2rrh.js → chunk-1s8ctwmv.js} +1 -1
- package/dist/cli/{chunk-97vsqj97.js → chunk-372yekdz.js} +1 -1
- package/dist/cli/{chunk-g3wdrhxk.js → chunk-3aecx6za.js} +2 -2
- package/dist/cli/{chunk-yq99x0r6.js → chunk-3r8v2gza.js} +1 -1
- package/dist/cli/chunk-3vq0ywzf.js +3 -0
- package/dist/cli/{chunk-rm2wy5hf.js → chunk-3x0hyz6y.js} +3 -3
- package/dist/cli/{chunk-mrtfvgb2.js → chunk-4mxn5jg6.js} +1 -1
- package/dist/cli/{chunk-zy20hzvh.js → chunk-5a6b4kv9.js} +1 -1
- package/dist/cli/{chunk-bdvqjzwh.js → chunk-5csm9ffj.js} +9 -7
- package/dist/cli/{chunk-3j1x55tc.js → chunk-5d0vb6v9.js} +1 -1
- package/dist/cli/{chunk-c3d36ryd.js → chunk-5j6z32fh.js} +1 -1
- package/dist/cli/{chunk-8je3dmzq.js → chunk-5s4g1bkx.js} +1 -1
- package/dist/cli/{chunk-34vpdm19.js → chunk-6d5csfp4.js} +1 -1
- package/dist/cli/{chunk-vcq9hb2a.js → chunk-73chbrb4.js} +1 -1
- package/dist/cli/chunk-7wga6bet.js +8 -0
- package/dist/cli/{chunk-nhpadsbv.js → chunk-7yb48mar.js} +1 -1
- package/dist/cli/{chunk-2nfz06mq.js → chunk-7zpkyrxy.js} +1 -1
- package/dist/cli/{chunk-ffjwgbck.js → chunk-80zzjcvp.js} +1 -1
- package/dist/cli/{chunk-wq6pfbek.js → chunk-8vh57pq0.js} +2 -2
- package/dist/cli/{chunk-3r4ekafa.js → chunk-8wf3p9er.js} +1 -1
- package/dist/cli/chunk-9g0vz9dk.js +209 -0
- package/dist/cli/{chunk-6e54q8g5.js → chunk-9qny0zke.js} +1 -1
- package/dist/cli/{chunk-epyw87gt.js → chunk-adkk89dp.js} +1 -1
- package/dist/cli/{chunk-ad5gbdcf.js → chunk-ant4k6dm.js} +1 -1
- package/dist/cli/{chunk-6k424rbf.js → chunk-bampejxv.js} +1 -1
- package/dist/cli/{chunk-76adkzyf.js → chunk-btpp4geb.js} +1 -1
- package/dist/cli/chunk-c9xg9dn0.js +3 -0
- package/dist/cli/{chunk-pcyatg4b.js → chunk-ccqs21dj.js} +1 -1
- package/dist/cli/{chunk-814ktvx2.js → chunk-cqdebtbr.js} +1 -1
- package/dist/cli/{chunk-2bmebw8q.js → chunk-d4mvprvq.js} +1 -1
- package/dist/cli/{chunk-dk0hffvd.js → chunk-dqprpnd6.js} +1 -1
- package/dist/cli/chunk-edsm15ht.js +4 -0
- package/dist/cli/{chunk-rpm771v5.js → chunk-ekre1aps.js} +8 -8
- package/dist/cli/chunk-em6vwq07.js +2 -0
- package/dist/cli/{chunk-vjvkkrzc.js → chunk-f5n0tgky.js} +1 -1
- package/dist/cli/chunk-fhrs8ja3.js +2 -0
- package/dist/cli/{chunk-y33j54yr.js → chunk-fnsch8kr.js} +2 -2
- package/dist/cli/{chunk-mw35vd6g.js → chunk-fvksjtsk.js} +1 -1
- package/dist/cli/{chunk-tq1hrd9n.js → chunk-ggzfard0.js} +1 -1
- package/dist/cli/{chunk-x2c8f2qz.js → chunk-gpcxqdmq.js} +1 -1
- package/dist/cli/{chunk-hbq7nqnp.js → chunk-h0h51emh.js} +1 -1
- package/dist/cli/{chunk-0x7zcw52.js → chunk-hkyn3kme.js} +1 -1
- package/dist/cli/{chunk-p8d9va1w.js → chunk-hqp8b49k.js} +2 -2
- package/dist/cli/{chunk-yjk0465m.js → chunk-hzzq6pdb.js} +1 -1
- package/dist/cli/{chunk-s21t29qn.js → chunk-j7831wcj.js} +1 -1
- package/dist/cli/{chunk-67q0qw7z.js → chunk-jetsx9zr.js} +1 -1
- package/dist/cli/{chunk-q349ydch.js → chunk-jtpjdmb6.js} +1 -1
- package/dist/cli/{chunk-c4e149yb.js → chunk-jwtqe209.js} +1 -1
- package/dist/cli/{chunk-gt1vbz3f.js → chunk-k7ke95vy.js} +1 -1
- package/dist/cli/{chunk-6r84zkcz.js → chunk-ksk3j88n.js} +1 -1
- package/dist/cli/{chunk-mwm63vz3.js → chunk-m3pn99w9.js} +8 -8
- package/dist/cli/{chunk-xgq5ycyn.js → chunk-mk1xzp2k.js} +1 -1
- package/dist/cli/{chunk-02h0488p.js → chunk-mvsvmfsf.js} +1 -1
- package/dist/cli/{chunk-hqzgejfj.js → chunk-p5902z3e.js} +1 -1
- package/dist/cli/{chunk-q1e0qqmd.js → chunk-pahcf9td.js} +1 -1
- package/dist/cli/{chunk-9wkf17yd.js → chunk-pfx1tg6q.js} +1 -1
- package/dist/cli/{chunk-8wze6dnr.js → chunk-ptaj848y.js} +1 -1
- package/dist/cli/chunk-pw10r9fk.js +2 -0
- package/dist/cli/{chunk-b1mk33gy.js → chunk-pw1twn8f.js} +1 -1
- package/dist/cli/{chunk-k8dm013e.js → chunk-q800jxzk.js} +1 -1
- package/dist/cli/{chunk-v9avfsxq.js → chunk-q9f24pkx.js} +1 -1
- package/dist/cli/{chunk-6ygwq4w5.js → chunk-rc2nwsdd.js} +1 -1
- package/dist/cli/{chunk-zmw0v18d.js → chunk-rf4z7b6g.js} +1 -1
- package/dist/cli/{chunk-jbqpyp76.js → chunk-rnxk3587.js} +1 -1
- package/dist/cli/chunk-rzd7xpx2.js +30 -0
- package/dist/cli/{chunk-pwybgztt.js → chunk-s96qnht3.js} +1 -1
- package/dist/cli/{chunk-jk9b9ztf.js → chunk-se20ckc5.js} +1 -1
- package/dist/cli/chunk-sma961wh.js +3 -0
- package/dist/cli/{chunk-b18pnmsv.js → chunk-stcvcsfm.js} +1 -1
- package/dist/cli/{chunk-hm7t9gkb.js → chunk-tewt7vre.js} +1 -1
- package/dist/cli/{chunk-b3j5s2jb.js → chunk-tq6pq1ws.js} +1 -1
- package/dist/cli/{chunk-3dgghmjv.js → chunk-v7prawj1.js} +1 -1
- package/dist/cli/chunk-vbv6v4hs.js +52 -0
- package/dist/cli/chunk-vfwbgx85.js +2 -0
- package/dist/cli/{chunk-qc06psqb.js → chunk-vvw1njx5.js} +1 -1
- package/dist/cli/{chunk-7hkkjx6g.js → chunk-vydwyjz2.js} +1 -1
- package/dist/cli/{chunk-sk3h2pzj.js → chunk-w9grtqm8.js} +2 -2
- package/dist/cli/{chunk-dkb8nj75.js → chunk-wy5xx1ez.js} +1 -1
- package/dist/cli/{chunk-65tbvcjj.js → chunk-xd4qfcm6.js} +1 -1
- package/dist/cli/{chunk-p98w5ffk.js → chunk-y330t2bt.js} +2 -2
- package/dist/cli/{chunk-bq0xsdqx.js → chunk-y4vxge6s.js} +1 -1
- package/dist/cli/{chunk-bk4pfjs0.js → chunk-ypzac0kj.js} +1 -1
- package/dist/cli/{chunk-mt8vtz20.js → chunk-z41s748k.js} +2 -2
- package/dist/cli/index.js +4 -4
- package/dist/cli/pty-host-node.mjs +5 -2
- package/dist/cli/rove.js +4 -4
- package/dist/completions/rove.bash +1 -1
- package/dist/completions/rove.fish +1 -1
- package/dist/completions/rove.zsh +1 -1
- package/dist/skills/rove/SKILL.md +14 -3
- package/dist/skills/rove/references/api-flags.md +47 -32
- package/dist/web/assets/{index-DmRZRttZ.js → index-BydepNFM.js} +1 -1
- package/dist/web/index.html +1 -1
- package/dist/web-ui/assets/{harness-BHiciz5A.js → harness-dYkQBfYz.js} +3 -3
- package/dist/web-ui/assets/{index-BkxJISAI.js → index-ByMdqeTv.js} +2 -2
- package/dist/web-ui/index.html +1 -1
- package/package.json +6 -4
- package/dist/cli/chunk-75zg2k73.js +0 -3
- package/dist/cli/chunk-9g7gneek.js +0 -30
- package/dist/cli/chunk-9jbcfrse.js +0 -2
- package/dist/cli/chunk-9r6x8mh4.js +0 -8
- package/dist/cli/chunk-admwmjjy.js +0 -4
- package/dist/cli/chunk-cgy92ks5.js +0 -2
- package/dist/cli/chunk-n7dtvega.js +0 -2
- package/dist/cli/chunk-parvvj8h.js +0 -2
- package/dist/cli/chunk-r2pd9tv9.js +0 -3
- package/dist/cli/chunk-sb2xg6py.js +0 -5
- package/dist/cli/chunk-vx4e787s.js +0 -3
- package/dist/cli/chunk-zfjqy7hp.js +0 -52
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,n as t,r as n,t as r}from"./index-BkxJISAI.js";var i=e(t()),a=2,o=1,s=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),s=window.getComputedStyle(this._terminal.element),c={top:parseInt(s.getPropertyValue(`padding-top`)),bottom:parseInt(s.getPropertyValue(`padding-bottom`)),right:parseInt(s.getPropertyValue(`padding-right`)),left:parseInt(s.getPropertyValue(`padding-left`))},l=c.top+c.bottom,u=c.right+c.left,d=r-l,f=i-u-t;return{cols:Math.max(a,Math.floor(f/e.css.cell.width)),rows:Math.max(o,Math.floor(d/e.css.cell.height))}}},c=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),l=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),u=e=>{let t=l(e);return t.charAt(0).toUpperCase()+t.slice(1)},d=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),f=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},p={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},m=(0,i.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a=``,children:o,iconNode:s,...c},l)=>(0,i.createElement)(`svg`,{ref:l,...p,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:d(`lucide`,a),...!o&&!f(c)&&{"aria-hidden":`true`},...c},[...s.map(([e,t])=>(0,i.createElement)(e,t)),...Array.isArray(o)?o:[o]])),h=((e,t)=>{let n=(0,i.forwardRef)(({className:n,...r},a)=>(0,i.createElement)(m,{ref:a,iconNode:t,className:d(`lucide-${c(u(e))}`,`lucide-${e}`,n),...r}));return n.displayName=u(e),n})(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),g=`3.7.8`,_=g,v=typeof Buffer==`function`,y=typeof TextDecoder==`function`?new TextDecoder:void 0,ee=typeof TextEncoder==`function`?new TextEncoder:void 0,b=Array.prototype.slice.call(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`),te=(e=>{let t={};return e.forEach((e,n)=>t[e]=n),t})(b),ne=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,x=String.fromCharCode.bind(String),re=typeof Uint8Array.from==`function`?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),ie=e=>e.replace(/=/g,``).replace(/[+\/]/g,e=>e==`+`?`-`:`_`),S=e=>e.replace(/[^A-Za-z0-9\+\/]/g,``),ae=e=>{let t,n,r,i,a=``,o=e.length%3;for(let o=0;o<e.length;){if((n=e.charCodeAt(o++))>255||(r=e.charCodeAt(o++))>255||(i=e.charCodeAt(o++))>255)throw TypeError(`invalid character found`);t=n<<16|r<<8|i,a+=b[t>>18&63]+b[t>>12&63]+b[t>>6&63]+b[t&63]}return o?a.slice(0,o-3)+`===`.substring(o):a},C=typeof btoa==`function`?e=>btoa(e):v?e=>Buffer.from(e,`binary`).toString(`base64`):ae,oe=v?e=>Buffer.from(e).toString(`base64`):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(x.apply(null,e.subarray(n,n+4096)));return C(t.join(``))},se=(e,t=!1)=>t?ie(oe(e)):oe(e),w=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?x(192|t>>>6)+x(128|t&63):x(224|t>>>12&15)+x(128|t>>>6&63)+x(128|t&63)}var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return x(240|t>>>18&7)+x(128|t>>>12&63)+x(128|t>>>6&63)+x(128|t&63)},T=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,E=e=>e.replace(T,w),D=v?e=>Buffer.from(e,`utf8`).toString(`base64`):ee?e=>oe(ee.encode(e)):e=>C(E(e)),ce=(e,t=!1)=>t?ie(D(e)):D(e),le=e=>ce(e,!0),O=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,k=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return x((t>>>10)+55296)+x((t&1023)+56320);case 3:return x((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return x((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},A=e=>e.replace(O,k),ue=e=>{if(e=e.replace(/\s+/g,``),!ne.test(e))throw TypeError(`malformed base64.`);e+=`==`.slice(2-(e.length&3));let t,n,r,i=[];for(let a=0;a<e.length;)t=te[e.charAt(a++)]<<18|te[e.charAt(a++)]<<12|(n=te[e.charAt(a++)])<<6|(r=te[e.charAt(a++)]),n===64?i.push(x(t>>16&255)):r===64?i.push(x(t>>16&255,t>>8&255)):i.push(x(t>>16&255,t>>8&255,t&255));return i.join(``)},de=typeof atob==`function`?e=>atob(S(e)):v?e=>Buffer.from(e,`base64`).toString(`binary`):ue,fe=v?e=>re(Buffer.from(e,`base64`)):e=>re(de(e).split(``).map(e=>e.charCodeAt(0))),pe=e=>fe(he(e)),me=v?e=>Buffer.from(e,`base64`).toString(`utf8`):y?e=>y.decode(fe(e)):e=>A(de(e)),he=e=>S(e.replace(/[-_]/g,e=>e==`-`?`+`:`/`)),ge=e=>me(he(e)),_e=e=>{if(typeof e!=`string`)return!1;let t=e.replace(/\s+/g,``).replace(/={0,2}$/,``);return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},ve=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),ye=function(){let e=(e,t)=>Object.defineProperty(String.prototype,e,ve(t));e(`fromBase64`,function(){return ge(this)}),e(`toBase64`,function(e){return ce(this,e)}),e(`toBase64URI`,function(){return ce(this,!0)}),e(`toBase64URL`,function(){return ce(this,!0)}),e(`toUint8Array`,function(){return pe(this)})},be=function(){let e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,ve(t));e(`toBase64`,function(e){return se(this,e)}),e(`toBase64URI`,function(){return se(this,!0)}),e(`toBase64URL`,function(){return se(this,!0)})},xe={version:g,VERSION:_,atob:de,atobPolyfill:ue,btoa:C,btoaPolyfill:ae,fromBase64:ge,toBase64:ce,encode:ce,encodeURI:le,encodeURL:le,utob:E,btou:A,decode:ge,isValid:_e,fromUint8Array:se,toUint8Array:pe,extendString:ye,extendUint8Array:be,extendBuiltins:()=>{ye(),be()}},Se=class{constructor(e=new we,t=new Ce){this._base64=e,this._provider=t}activate(e){this._terminal=e,this._disposable=e.parser.registerOscHandler(52,e=>this._setOrReportClipboard(e))}dispose(){return this._disposable?.dispose()}_readText(e,t){let n=this._base64.encodeText(t);this._terminal?.input(`\x1B]52;${e};${n}\x07`,!1)}_setOrReportClipboard(e){let t=e.split(`;`);if(t.length<2)return!0;let n=t[0],r=t[1];if(r===`?`){let e=this._provider.readText(n);return e instanceof Promise?e.then(e=>(this._readText(n,e),!0)):(this._readText(n,e),!0)}let i=``;try{i=this._base64.decodeText(r)}catch{}let a=this._provider.writeText(n,i);return a instanceof Promise?a.then(()=>!0):!0}},Ce=class{async readText(e){return e===`c`?navigator.clipboard.readText():Promise.resolve(``)}async writeText(e,t){return e===`c`?navigator.clipboard.writeText(t):Promise.resolve()}},we=class{encodeText(e){return xe.encode(e)}decodeText(e){let t=xe.decode(e);return!xe.isValid(e)||xe.encode(t)!==e?``:t}},Te=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],Ee=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],De;function Oe(e,t){let n=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var ke=class{constructor(){if(this.version=`6`,!De){De=new Uint8Array(65536),De.fill(1),De[0]=0,De.fill(0,1,32),De.fill(0,127,160),De.fill(2,4352,4448),De[9001]=2,De[9002]=2,De.fill(2,11904,42192),De[12351]=1,De.fill(2,44032,55204),De.fill(2,63744,64256),De.fill(2,65040,65050),De.fill(2,65072,65136),De.fill(2,65280,65377),De.fill(2,65504,65511);for(let e=0;e<Te.length;++e)De.fill(0,Te[e][0],Te[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?De[e]:Oe(e,Ee)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let e=pt.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return pt.createPropertyValue(0,n,r)}},Ae=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Fe.isErrorNoTelemetry(e)?new Fe(e.message+`
|
|
1
|
+
import{i as e,n as t,r as n,t as r}from"./index-ByMdqeTv.js";var i=e(t()),a=2,o=1,s=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),s=window.getComputedStyle(this._terminal.element),c={top:parseInt(s.getPropertyValue(`padding-top`)),bottom:parseInt(s.getPropertyValue(`padding-bottom`)),right:parseInt(s.getPropertyValue(`padding-right`)),left:parseInt(s.getPropertyValue(`padding-left`))},l=c.top+c.bottom,u=c.right+c.left,d=r-l,f=i-u-t;return{cols:Math.max(a,Math.floor(f/e.css.cell.width)),rows:Math.max(o,Math.floor(d/e.css.cell.height))}}},c=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),l=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),u=e=>{let t=l(e);return t.charAt(0).toUpperCase()+t.slice(1)},d=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),f=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},p={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},m=(0,i.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a=``,children:o,iconNode:s,...c},l)=>(0,i.createElement)(`svg`,{ref:l,...p,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:d(`lucide`,a),...!o&&!f(c)&&{"aria-hidden":`true`},...c},[...s.map(([e,t])=>(0,i.createElement)(e,t)),...Array.isArray(o)?o:[o]])),h=((e,t)=>{let n=(0,i.forwardRef)(({className:n,...r},a)=>(0,i.createElement)(m,{ref:a,iconNode:t,className:d(`lucide-${c(u(e))}`,`lucide-${e}`,n),...r}));return n.displayName=u(e),n})(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),g=`3.7.8`,_=g,v=typeof Buffer==`function`,y=typeof TextDecoder==`function`?new TextDecoder:void 0,ee=typeof TextEncoder==`function`?new TextEncoder:void 0,b=Array.prototype.slice.call(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`),te=(e=>{let t={};return e.forEach((e,n)=>t[e]=n),t})(b),ne=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,x=String.fromCharCode.bind(String),re=typeof Uint8Array.from==`function`?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),ie=e=>e.replace(/=/g,``).replace(/[+\/]/g,e=>e==`+`?`-`:`_`),S=e=>e.replace(/[^A-Za-z0-9\+\/]/g,``),ae=e=>{let t,n,r,i,a=``,o=e.length%3;for(let o=0;o<e.length;){if((n=e.charCodeAt(o++))>255||(r=e.charCodeAt(o++))>255||(i=e.charCodeAt(o++))>255)throw TypeError(`invalid character found`);t=n<<16|r<<8|i,a+=b[t>>18&63]+b[t>>12&63]+b[t>>6&63]+b[t&63]}return o?a.slice(0,o-3)+`===`.substring(o):a},C=typeof btoa==`function`?e=>btoa(e):v?e=>Buffer.from(e,`binary`).toString(`base64`):ae,oe=v?e=>Buffer.from(e).toString(`base64`):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(x.apply(null,e.subarray(n,n+4096)));return C(t.join(``))},se=(e,t=!1)=>t?ie(oe(e)):oe(e),w=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?x(192|t>>>6)+x(128|t&63):x(224|t>>>12&15)+x(128|t>>>6&63)+x(128|t&63)}var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return x(240|t>>>18&7)+x(128|t>>>12&63)+x(128|t>>>6&63)+x(128|t&63)},T=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,E=e=>e.replace(T,w),D=v?e=>Buffer.from(e,`utf8`).toString(`base64`):ee?e=>oe(ee.encode(e)):e=>C(E(e)),ce=(e,t=!1)=>t?ie(D(e)):D(e),le=e=>ce(e,!0),O=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,k=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return x((t>>>10)+55296)+x((t&1023)+56320);case 3:return x((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return x((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},A=e=>e.replace(O,k),ue=e=>{if(e=e.replace(/\s+/g,``),!ne.test(e))throw TypeError(`malformed base64.`);e+=`==`.slice(2-(e.length&3));let t,n,r,i=[];for(let a=0;a<e.length;)t=te[e.charAt(a++)]<<18|te[e.charAt(a++)]<<12|(n=te[e.charAt(a++)])<<6|(r=te[e.charAt(a++)]),n===64?i.push(x(t>>16&255)):r===64?i.push(x(t>>16&255,t>>8&255)):i.push(x(t>>16&255,t>>8&255,t&255));return i.join(``)},de=typeof atob==`function`?e=>atob(S(e)):v?e=>Buffer.from(e,`base64`).toString(`binary`):ue,fe=v?e=>re(Buffer.from(e,`base64`)):e=>re(de(e).split(``).map(e=>e.charCodeAt(0))),pe=e=>fe(he(e)),me=v?e=>Buffer.from(e,`base64`).toString(`utf8`):y?e=>y.decode(fe(e)):e=>A(de(e)),he=e=>S(e.replace(/[-_]/g,e=>e==`-`?`+`:`/`)),ge=e=>me(he(e)),_e=e=>{if(typeof e!=`string`)return!1;let t=e.replace(/\s+/g,``).replace(/={0,2}$/,``);return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},ve=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),ye=function(){let e=(e,t)=>Object.defineProperty(String.prototype,e,ve(t));e(`fromBase64`,function(){return ge(this)}),e(`toBase64`,function(e){return ce(this,e)}),e(`toBase64URI`,function(){return ce(this,!0)}),e(`toBase64URL`,function(){return ce(this,!0)}),e(`toUint8Array`,function(){return pe(this)})},be=function(){let e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,ve(t));e(`toBase64`,function(e){return se(this,e)}),e(`toBase64URI`,function(){return se(this,!0)}),e(`toBase64URL`,function(){return se(this,!0)})},xe={version:g,VERSION:_,atob:de,atobPolyfill:ue,btoa:C,btoaPolyfill:ae,fromBase64:ge,toBase64:ce,encode:ce,encodeURI:le,encodeURL:le,utob:E,btou:A,decode:ge,isValid:_e,fromUint8Array:se,toUint8Array:pe,extendString:ye,extendUint8Array:be,extendBuiltins:()=>{ye(),be()}},Se=class{constructor(e=new we,t=new Ce){this._base64=e,this._provider=t}activate(e){this._terminal=e,this._disposable=e.parser.registerOscHandler(52,e=>this._setOrReportClipboard(e))}dispose(){return this._disposable?.dispose()}_readText(e,t){let n=this._base64.encodeText(t);this._terminal?.input(`\x1B]52;${e};${n}\x07`,!1)}_setOrReportClipboard(e){let t=e.split(`;`);if(t.length<2)return!0;let n=t[0],r=t[1];if(r===`?`){let e=this._provider.readText(n);return e instanceof Promise?e.then(e=>(this._readText(n,e),!0)):(this._readText(n,e),!0)}let i=``;try{i=this._base64.decodeText(r)}catch{}let a=this._provider.writeText(n,i);return a instanceof Promise?a.then(()=>!0):!0}},Ce=class{async readText(e){return e===`c`?navigator.clipboard.readText():Promise.resolve(``)}async writeText(e,t){return e===`c`?navigator.clipboard.writeText(t):Promise.resolve()}},we=class{encodeText(e){return xe.encode(e)}decodeText(e){let t=xe.decode(e);return!xe.isValid(e)||xe.encode(t)!==e?``:t}},Te=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],Ee=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],De;function Oe(e,t){let n=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var ke=class{constructor(){if(this.version=`6`,!De){De=new Uint8Array(65536),De.fill(1),De[0]=0,De.fill(0,1,32),De.fill(0,127,160),De.fill(2,4352,4448),De[9001]=2,De[9002]=2,De.fill(2,11904,42192),De[12351]=1,De.fill(2,44032,55204),De.fill(2,63744,64256),De.fill(2,65040,65050),De.fill(2,65072,65136),De.fill(2,65280,65377),De.fill(2,65504,65511);for(let e=0;e<Te.length;++e)De.fill(0,Te[e][0],Te[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?De[e]:Oe(e,Ee)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let e=pt.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return pt.createPropertyValue(0,n,r)}},Ae=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Fe.isErrorNoTelemetry(e)?new Fe(e.message+`
|
|
2
2
|
|
|
3
3
|
`+e.stack):Error(e.message+`
|
|
4
4
|
|
|
@@ -82,6 +82,6 @@ out vec4 outColor;
|
|
|
82
82
|
|
|
83
83
|
void main() {
|
|
84
84
|
outColor = v_color;
|
|
85
|
-
}`,Jd=8,Yd=Jd*Float32Array.BYTES_PER_ELEMENT,Xd=20*Jd,Zd=class{constructor(){this.attributes=new Float32Array(Xd),this.count=0}},Qd=0,$d=0,ef=0,tf=0,nf=0,rf=0,af=0,of=class extends Il{constructor(e,t,n,r){super(),this._terminal=e,this._gl=t,this._dimensions=n,this._themeService=r,this._vertices=new Zd,this._verticesCursor=new Zd;let i=this._gl;this._program=X(Ed(i,Kd,qd)),this._register(Nl(()=>i.deleteProgram(this._program))),this._projectionLocation=X(i.getUniformLocation(this._program,`u_projection`)),this._vertexArrayObject=i.createVertexArray(),i.bindVertexArray(this._vertexArrayObject);let a=new Float32Array([0,0,1,0,0,1,1,1]),o=i.createBuffer();this._register(Nl(()=>i.deleteBuffer(o))),i.bindBuffer(i.ARRAY_BUFFER,o),i.bufferData(i.ARRAY_BUFFER,a,i.STATIC_DRAW),i.enableVertexAttribArray(3),i.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let s=new Uint8Array([0,1,2,3]),c=i.createBuffer();this._register(Nl(()=>i.deleteBuffer(c))),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,c),i.bufferData(i.ELEMENT_ARRAY_BUFFER,s,i.STATIC_DRAW),this._attributesBuffer=X(i.createBuffer()),this._register(Nl(()=>i.deleteBuffer(this._attributesBuffer))),i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.enableVertexAttribArray(0),i.vertexAttribPointer(0,2,i.FLOAT,!1,Yd,0),i.vertexAttribDivisor(0,1),i.enableVertexAttribArray(1),i.vertexAttribPointer(1,2,i.FLOAT,!1,Yd,2*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(1,1),i.enableVertexAttribArray(2),i.vertexAttribPointer(2,4,i.FLOAT,!1,Yd,4*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(2,1),this._updateCachedColors(r.colors),this._register(this._themeService.onChangeColors(e=>{this._updateCachedColors(e),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,Td),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,n=this._vertices,r=1,i,a,o,s,c,l,u,d,f,p,m;for(i=0;i<t.rows;i++){for(o=-1,s=0,c=0,l=!1,a=0;a<t.cols;a++)u=(i*t.cols+a)*Bd,d=e.cells[u+Vd],f=e.cells[u+Hd],p=!!(f&67108864),(d!==s||f!==c&&(l||p))&&((s!==0||l&&c!==0)&&(m=r++*Jd,this._updateRectangle(n,m,c,s,o,a,i)),o=a,s=d,c=f,l=p);(s!==0||l&&c!==0)&&(m=r++*Jd,this._updateRectangle(n,m,c,s,o,t.cols,i))}n.count=r}updateCursor(e){let t=this._verticesCursor,n=e.cursor;if(!n||n.style===`block`){t.count=0;return}let r,i=0;(n.style===`bar`||n.style===`outline`)&&(r=i++*Jd,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.style===`bar`?n.dpr*n.cursorWidth:n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(n.style===`underline`||n.style===`outline`)&&(r=i++*Jd,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,(n.y+1)*this._dimensions.device.cell.height-n.dpr,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat)),n.style===`outline`&&(r=i++*Jd,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat),r=i++*Jd,this._addRectangleFloat(t.attributes,r,(n.x+n.width)*this._dimensions.device.cell.width-n.dpr,n.y*this._dimensions.device.cell.height,n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=i}_updateRectangle(e,t,n,r,i,a,o){if(n&67108864)switch(n&50331648){case 16777216:case 33554432:Qd=this._themeService.colors.ansi[n&255].rgba;break;case 50331648:Qd=(n&16777215)<<8;break;default:Qd=this._themeService.colors.foreground.rgba}else switch(r&50331648){case 16777216:case 33554432:Qd=this._themeService.colors.ansi[r&255].rgba;break;case 50331648:Qd=(r&16777215)<<8;break;default:Qd=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=Od(e.attributes,this._terminal.rows*this._terminal.cols*Jd)),$d=i*this._dimensions.device.cell.width,ef=o*this._dimensions.device.cell.height,tf=(Qd>>24&255)/255,nf=(Qd>>16&255)/255,rf=(Qd>>8&255)/255,af=1,this._addRectangle(e.attributes,t,$d,ef,(a-i)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,tf,nf,rf,af)}_addRectangle(e,t,n,r,i,a,o,s,c,l){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=s,e[t+6]=c,e[t+7]=l}_addRectangleFloat(e,t,n,r,i,a,o){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},sf=class extends Il{constructor(e,t,n,r,i,a,o,s){super(),this._container=t,this._alpha=i,this._coreBrowserService=a,this._optionsService=o,this._themeService=s,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-${n}-layer`),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(t=>{this._refreshCharAtlas(e,t),this.reset(e)})),this._register(Nl(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=X(this._canvas.getContext(`2d`,{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,n){}handleSelectionChanged(e,t,n,r=!1){}_setTransparency(e,t){if(t===this._alpha)return;let n=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,n),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=vd(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,n=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,n*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,n,r){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight))}_fillCharTrueColor(e,t,n,r){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=Su,this._clipCell(n,r,t.getWidth()),this._ctx.fillText(t.getChars(),n*this._deviceCellWidth+this._deviceCharLeft,r*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,n){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,n){let r=t?e.options.fontWeightBold:e.options.fontWeight;return`${n?`italic`:``} ${r} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},cf=class extends sf{constructor(e,t,n,r,i,a,o){super(n,e,`link`,t,!0,i,a,o),this._register(r.onShowLinkUnderline(e=>this._handleShowLinkUnderline(e))),this._register(r.onHideLinkUnderline(e=>this._handleHideLinkUnderline(e)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&gd(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},lf=typeof window==`object`?window:globalThis,uf=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Z,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Z,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};uf.INSTANCE=new uf;var df=uf;function ff(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}df.INSTANCE.onDidChangeZoomLevel,df.INSTANCE.onDidChangeFullscreen;var pf=typeof navigator==`object`?navigator.userAgent:``;pf.indexOf(`Firefox`);var mf=pf.indexOf(`AppleWebKit`)>=0;!(pf.indexOf(`Chrome`)>=0)&&pf.indexOf(`Safari`),pf.indexOf(`Electron/`),pf.indexOf(`Android`);var hf=!1;if(typeof lf.matchMedia==`function`){let e=lf.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=lf.matchMedia(`(display-mode: fullscreen)`);hf=e.matches,ff(lf,e,({matches:e})=>{hf&&t.matches||(hf=e)})}function gf(){return hf}var _f=`en`,vf=!1,yf=!1,bf=!1,xf=_f,Sf,Cf=globalThis,wf;typeof Cf.vscode<`u`&&typeof Cf.vscode.process<`u`?wf=Cf.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(wf=process);var Tf=typeof wf?.versions?.electron==`string`&&wf?.type===`renderer`;if(typeof wf==`object`){wf.platform,wf.platform,vf=wf.platform===`linux`,vf&&wf.env.SNAP&&wf.env.SNAP_REVISION,wf.env.CI||wf.env.BUILD_ARTIFACTSTAGINGDIRECTORY,xf=_f;let e=wf.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,xf=t.resolvedLanguage||_f,t.languagePack?.translationsConfigFile}catch{}yf=!0}else typeof navigator==`object`&&!Tf?(Sf=navigator.userAgent,Sf.indexOf(`Windows`),Sf.indexOf(`Macintosh`),(Sf.indexOf(`Macintosh`)>=0||Sf.indexOf(`iPad`)>=0||Sf.indexOf(`iPhone`)>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,vf=Sf.indexOf(`Linux`)>=0,Sf?.indexOf(`Mobi`),bf=!0,xf=globalThis._VSCODE_NLS_LANGUAGE||_f,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var Ef=yf;bf&&typeof Cf.importScripts==`function`&&Cf.origin;var Df=Sf,Of=xf,kf;(e=>{function t(){return Of}e.value=t;function n(){return Of.length===2?Of===`en`:Of.length>=3&&Of[0]===`e`&&Of[1]===`n`&&Of[2]===`-`}e.isDefaultVariant=n;function r(){return Of===`en`}e.isDefault=r})(kf||={});var Af=typeof Cf.postMessage==`function`&&!Cf.importScripts;(()=>{if(Af){let e=[];Cf.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){let r=e[n];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(n,1),r.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),Cf.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var jf=!!(Df&&Df.indexOf(`Chrome`)>=0);Df&&Df.indexOf(`Firefox`),!jf&&Df&&Df.indexOf(`Safari`),Df&&Df.indexOf(`Edg/`),Df&&Df.indexOf(`Android`);var Mf=typeof navigator==`object`?navigator:{};Ef||document.queryCommandSupported&&document.queryCommandSupported(`copy`)||Mf&&Mf.clipboard&&Mf.clipboard.writeText,Ef||Mf&&Mf.clipboard&&Mf.clipboard.readText,Ef||gf()||Mf.keyboard,`ontouchstart`in lf||Mf.maxTouchPoints,lf.PointerEvent&&(`ontouchstart`in lf||navigator.maxTouchPoints);var Nf=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Pf=new Nf,Ff=new Nf,If=new Nf;Array(230);var Lf;(e=>{function t(e){return Pf.keyCodeToStr(e)}e.toString=t;function n(e){return Pf.strToKeyCode(e)}e.fromString=n;function r(e){return Ff.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return If.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return Ff.strToKeyCode(e)||If.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=98&&e<=113)return null;switch(e){case 16:return`Up`;case 18:return`Down`;case 15:return`Left`;case 17:return`Right`}return Pf.keyCodeToStr(e)}e.toElectronAccelerator=o})(Lf||={});var Rf=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),zf;(e=>{function t(t){return t===e.None||t===e.Cancelled||t instanceof Bf?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:qu.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Rf})})(zf||={});var Bf=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Rf:(this._emitter||=new Z,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}};(function(){typeof globalThis.requestIdleCallback!=`function`||globalThis.cancelIdleCallback})();var Vf;(e=>{async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(typeof t<`u`)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(Vf||={});var Hf=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new Z,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await qu.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};Hf.EMPTY=Hf.fromArray([]);function Uf(e){return Wf(e,0)}function Wf(e,t){switch(typeof e){case`object`:return e===null?Gf(349,t):Array.isArray(e)?Jf(e,t):Yf(e,t);case`string`:return qf(e,t);case`boolean`:return Kf(e,t);case`number`:return Gf(e,t);case`undefined`:return Gf(937,t);default:return Gf(617,t)}}function Gf(e,t){return(t<<5)-t+e|0}function Kf(e,t){return Gf(e?433:863,t)}function qf(e,t){t=Gf(149417,t);for(let n=0,r=e.length;n<r;n++)t=Gf(e.charCodeAt(n),t);return t}function Jf(e,t){return t=Gf(104579,t),e.reduce((e,t)=>Wf(t,e),t)}function Yf(e,t){return t=Gf(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=qf(n,t),Wf(e[n],t)),t)}var{registerWindow:Xf,getWindow:Zf,getDocument:Qf,getWindows:$f,getWindowsCount:ep,getWindowId:tp,getWindowById:np,hasWindow:rp,onDidRegisterWindow:ip,onWillUnregisterWindow:ap,onDidUnregisterWindow:op}=function(){let e=new Map,t={window:lf,disposables:new Fl};e.set(lf.vscodeWindowId,t);let n=new Z,r=new Z,i=new Z;function a(n,r){return(typeof n==`number`?e.get(n):void 0)??(r?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(t){if(e.has(t.vscodeWindowId))return Il.None;let a=new Fl,o={window:t,disposables:a.add(new Fl)};return e.set(t.vscodeWindowId,o),a.add(Nl(()=>{e.delete(t.vscodeWindowId),r.fire(t)})),a.add(cp(t,up.BEFORE_UNLOAD,()=>{i.fire(t)})),n.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(e){return e.vscodeWindowId},hasWindow(t){return e.has(t)},getWindowById:a,getWindow(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;let n=e;return n?.view?n.view.window:lf},getDocument(e){return Zf(e).document}}}(),sp=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&=(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,null)}};function cp(e,t,n,r){return new sp(e,t,n,r)}var lp=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(e){return typeof e==`object`&&typeof e.height==`number`&&typeof e.width==`number`}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};lp.None=new lp(0,0),new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=Uf(n),a=r.get(i);if(a)a.users+=1;else{let o=new Z,s=new MutationObserver(e=>o.fire(e));s.observe(e,n);let c=a={users:1,observer:s,onDidMutate:o.event};t.add(Nl(()=>{--c.users,c.users===0&&(o.dispose(),s.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,a)}return a.onDidMutate}};var up={CLICK:`click`,AUXCLICK:`auxclick`,DBLCLICK:`dblclick`,MOUSE_UP:`mouseup`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_MOVE:`mousemove`,MOUSE_OUT:`mouseout`,MOUSE_ENTER:`mouseenter`,MOUSE_LEAVE:`mouseleave`,MOUSE_WHEEL:`wheel`,POINTER_UP:`pointerup`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_LEAVE:`pointerleave`,CONTEXT_MENU:`contextmenu`,WHEEL:`wheel`,KEY_DOWN:`keydown`,KEY_PRESS:`keypress`,KEY_UP:`keyup`,LOAD:`load`,BEFORE_UNLOAD:`beforeunload`,UNLOAD:`unload`,PAGE_SHOW:`pageshow`,PAGE_HIDE:`pagehide`,PASTE:`paste`,ABORT:`abort`,ERROR:`error`,RESIZE:`resize`,SCROLL:`scroll`,FULLSCREEN_CHANGE:`fullscreenchange`,WK_FULLSCREEN_CHANGE:`webkitfullscreenchange`,SELECT:`select`,CHANGE:`change`,SUBMIT:`submit`,RESET:`reset`,FOCUS:`focus`,FOCUS_IN:`focusin`,FOCUS_OUT:`focusout`,BLUR:`blur`,INPUT:`input`,STORAGE:`storage`,DRAG_START:`dragstart`,DRAG:`drag`,DRAG_ENTER:`dragenter`,DRAG_LEAVE:`dragleave`,DRAG_OVER:`dragover`,DROP:`drop`,DRAG_END:`dragend`,ANIMATION_START:mf?`webkitAnimationStart`:`animationstart`,ANIMATION_END:mf?`webkitAnimationEnd`:`animationend`,ANIMATION_ITERATION:mf?`webkitAnimationIteration`:`animationiteration`},dp=class extends Il{constructor(e,t,n,r,i,a,o,s,c){super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._optionsService=o,this._themeService=s,this._cursorBlinkStateManager=new Ll,this._charAtlasDisposable=this._register(new Ll),this._observerDisposable=this._register(new Ll),this._model=new Gd,this._workCell=new wd,this._workCell2=new wd,this._rectangleRenderer=this._register(new Ll),this._glyphRenderer=this._register(new Ll),this._onChangeTextureAtlas=this._register(new Z),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Z),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Z),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Z),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Z),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`);let l={antialias:!1,depth:!1,preserveDrawingBuffer:c};if(this._gl=this._canvas.getContext(`webgl2`,l),!this._gl)throw Error(`WebGL2 not supported `+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new bu(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new cf(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=uu(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(cp(this._canvas,`webglcontextlost`,e=>{console.log(`webglcontextlost event received`),e.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn(`webgl context not restored; firing onContextLoss`),this._onContextLoss.fire(e)},3e3)})),this._register(cp(this._canvas,`webglcontextrestored`,e=>{console.warn(`webglcontextrestored event received`),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,yd(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=Sd(this._canvas,this._coreBrowserService.window,(e,t)=>this._setCanvasDevicePixelDimensions(e,t)),this._register(this._coreBrowserService.onWindowChange(e=>{this._observerDisposable.value=Sd(this._canvas,e,(e,t)=>this._setCanvasDevicePixelDimensions(e,t))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(Nl(()=>{for(let e of this._renderLayers)e.dispose();this._canvas.parentElement?.removeChild(this._canvas),yd(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let e of this._renderLayers)e.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,n){for(let r of this._renderLayers)r.handleSelectionChanged(this._terminal,e,t,n);this._model.selection.update(this._core,e,t,n),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new of(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new Ld(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=vd(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=Ml(qu.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),qu.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached){if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return}for(let n of this._renderLayers)n.handleGridChanged(this._terminal,e,t);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new xd(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let n=this._core,r=this._workCell,i,a,o,s,c,l,u=0,d=!0,f,p,m,h,g,_,v,y,ee;e=pp(e,n.rows-1,0),t=pp(t,n.rows-1,0);let b=this._coreService.decPrivateModes.cursorStyle??n.options.cursorStyle??`block`,te=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,ne=te-n.buffer.ydisp,x=Math.min(this._terminal.buffer.active.cursorX,n.cols-1),re=-1,ie=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let S=!1;for(a=e;a<=t;a++)for(o=a+n.buffer.ydisp,s=n.buffer.lines.get(o),this._model.lineLengths[a]=0,m=te===o,u=0,c=this._characterJoinerService.getJoinedCharacters(o),y=0;y<n.cols;y++){if(i=this._cellColorResolver.result.bg,s.loadCell(y,r),y===0&&(i=this._cellColorResolver.result.bg),l=!1,d=y>=u,f=y,c.length>0&&y===c[0][0]&&d){p=c.shift();let e=this._model.selection.isCellSelected(this._terminal,p[0],o);for(v=p[0]+1;v<p[1];v++)d&&=e===this._model.selection.isCellSelected(this._terminal,v,o);d&&=!m||x<p[0]||x>=p[1],d?(l=!0,r=new fp(r,s.translateToString(!0,p[0],p[1]),p[1]-p[0]),f=p[1]-1):u=p[1]}if(h=r.getChars(),g=r.getCode(),v=(a*n.cols+y)*Bd,this._cellColorResolver.resolve(r,y,o,this.dimensions.device.cell.width),ie&&o===te&&(y===x&&(this._model.cursor={x,y:ne,width:r.getWidth(),style:this._coreBrowserService.isFocused?b:n.options.cursorInactiveStyle,cursorWidth:n.options.cursorWidth,dpr:this._devicePixelRatio},re=x+r.getWidth()-1),y>=x&&y<=re&&(this._coreBrowserService.isFocused&&b===`block`||this._coreBrowserService.isFocused===!1&&n.options.cursorInactiveStyle===`block`)&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),g!==0&&(this._model.lineLengths[a]=y+1),(this._model.cells[v]!==g||this._model.cells[v+Vd]!==this._cellColorResolver.result.bg||this._model.cells[v+Hd]!==this._cellColorResolver.result.fg||this._model.cells[v+Ud]!==this._cellColorResolver.result.ext)&&(S=!0,h.length>1&&(g|=Wd),this._model.cells[v]=g,this._model.cells[v+Vd]=this._cellColorResolver.result.bg,this._model.cells[v+Hd]=this._cellColorResolver.result.fg,this._model.cells[v+Ud]=this._cellColorResolver.result.ext,_=r.getWidth(),this._glyphRenderer.value.updateCell(y,a,g,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,h,_,i),l)){for(r=this._workCell,y++;y<=f;y++)ee=(a*n.cols+y)*Bd,this._glyphRenderer.value.updateCell(y,a,0,0,0,0,Gl,0,0),this._model.cells[ee]=0,this._model.cells[ee+Vd]=this._cellColorResolver.result.bg,this._model.cells[ee+Hd]=this._cellColorResolver.result.fg,this._model.cells[ee+Ud]=this._cellColorResolver.result.ext;y--}}S&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},fp=class extends Hu{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function pp(e,t,n=0){return Math.max(Math.min(e,t),n)}var mp=`di$target`,hp=`di$dependencies`,gp=new Map;function _p(e){if(gp.has(e))return gp.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);vp(t,e,r)};return t._id=e,gp.set(e,t),t}function vp(e,t,n){t[mp]===t?t[hp].push({id:e,index:n}):(t[hp]=[{id:e,index:n}],t[mp]=t)}_p(`BufferService`),_p(`CoreMouseService`),_p(`CoreService`),_p(`CharsetService`),_p(`InstantiationService`),_p(`LogService`);var yp=_p(`OptionsService`);_p(`OscLinkService`),_p(`UnicodeService`),_p(`DecorationService`);var bp={trace:0,debug:1,info:2,warn:3,error:4,off:5},xp=`xterm.js: `,Sp=class extends Il{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange(`logLevel`,()=>this._updateLogLevel())),Cp=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=bp[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:xp)+t,...n)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};Sp=hl([gl(0,yp)],Sp);var Cp,wp=class extends Il{constructor(e){if(Ul&&Wl()<16&&!document.createElement(`canvas`).getContext(`webgl2`,{antialias:!1,depth:!1,preserveDrawingBuffer:!0}))throw Error(`Webgl2 is only supported on Safari 16 and above`);super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new Z),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Z),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Z),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Z),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element){this._register(t.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let n=t.coreService,r=t.optionsService,i=t,a=i._renderService,o=i._characterJoinerService,s=i._charSizeService,c=i._coreBrowserService,l=i._decorationService;i._logService;let u=i._themeService;this._renderer=this._register(new dp(e,o,s,c,n,l,r,u,this._preserveDrawingBuffer)),this._register(qu.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(qu.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(qu.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(qu.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),a.setRenderer(this._renderer),this._register(Nl(()=>{if(this._terminal._core._store._isDisposed)return;let t=this._terminal._core._renderService;t.setRenderer(this._terminal._core._createRenderer()),t.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}};function Tp(e){try{e.loadAddon(new fl.CanvasAddon)}catch{}}function Ep(e,t,n){if(t===`dom`)return;if(n){Tp(e);return}let r,i=()=>{try{r?.dispose()}catch{}Tp(e)};try{r=new wp,r.onContextLoss(i),e.loadAddon(r)}catch{i()}}var Dp={background:`#141413`,foreground:`#eae7df`,cursor:`#cc785c`,cursorAccent:`#141413`,selectionBackground:`#33312e`,black:`#141413`,red:`#d47563`,green:`#9aca86`,yellow:`#e8c96b`,blue:`#61aaf2`,magenta:`#9b87f5`,cyan:`#d4967e`,white:`#a9a39a`,brightBlack:`#6b665f`,brightRed:`#d47563`,brightGreen:`#9aca86`,brightYellow:`#e8c96b`,brightBlue:`#61aaf2`,brightMagenta:`#9b87f5`,brightCyan:`#e0ab96`,brightWhite:`#eae7df`},Op=`"JetBrains Mono", "JetBrainsMono Nerd Font", "MesloLGS NF", "Symbols Nerd Font Mono", "SF Mono", ui-monospace, Menlo, monospace`,kp=[`"JetBrains Mono"`,`"JetBrainsMono Nerd Font"`,`"MesloLGS NF"`,`"Symbols Nerd Font Mono"`];async function Ap(){if(`fonts`in document){await Promise.allSettled(kp.map(e=>document.fonts.load(`12px ${e}`)));try{await document.fonts.ready}catch{}}}function jp(e,{renderer:t,transparent:n,hostBackground:r,cursorBlink:i}){let a=new dl({theme:n?{...Dp,background:r??`rgba(0,0,0,0.01)`}:Dp,allowTransparency:n,fontFamily:Op,fontSize:12,cursorBlink:i,allowProposedApi:!0,scrollback:5e3});return a.loadAddon(new xt),a.unicode.activeVersion=`11`,a.loadAddon(new Se),a.loadAddon(new Dt),a.open(e),Ep(a,t,n),a}var Mp=`rove-web-token`;function Np(){try{return sessionStorage.getItem(Mp)?.trim()??``}catch{return``}}function Pp(e){try{sessionStorage.setItem(Mp,e)}catch{}}function Fp(){if(typeof document<`u`){let e=document.querySelector(`meta[name="rove-web-token"]`)?.getAttribute(`content`)?.trim();if(e)return Pp(e),e;let t=Np();if(t)return t}return``}var Ip=null;function Lp(){return Ip===null&&(Ip=Fp()),Ip}function Rp(e){let t=Lp();return t?`${e}${e.includes(`?`)?`&`:`?`}token=${encodeURIComponent(t)}`:e}function zp(){return`${location.protocol===`https:`?`wss`:`ws`}://${location.host}`}function Bp(e,t,n,r,i){let a=new URLSearchParams({tab:e,taskId:t,mode:n,cols:String(r),rows:String(i)});return Rp(`${zp()}/pty?${a.toString()}`)}var Vp=r(),Hp=new TextDecoder;function Up(e){let t=e.buffer.active,n=t.viewportY,r=Math.min(t.length,n+e.rows),i=[];for(let e=n;e<r;e+=1)i.push(t.getLine(e)?.translateToString(!0)??``);return i.join(`
|
|
85
|
+
}`,Jd=8,Yd=Jd*Float32Array.BYTES_PER_ELEMENT,Xd=20*Jd,Zd=class{constructor(){this.attributes=new Float32Array(Xd),this.count=0}},Qd=0,$d=0,ef=0,tf=0,nf=0,rf=0,af=0,of=class extends Il{constructor(e,t,n,r){super(),this._terminal=e,this._gl=t,this._dimensions=n,this._themeService=r,this._vertices=new Zd,this._verticesCursor=new Zd;let i=this._gl;this._program=X(Ed(i,Kd,qd)),this._register(Nl(()=>i.deleteProgram(this._program))),this._projectionLocation=X(i.getUniformLocation(this._program,`u_projection`)),this._vertexArrayObject=i.createVertexArray(),i.bindVertexArray(this._vertexArrayObject);let a=new Float32Array([0,0,1,0,0,1,1,1]),o=i.createBuffer();this._register(Nl(()=>i.deleteBuffer(o))),i.bindBuffer(i.ARRAY_BUFFER,o),i.bufferData(i.ARRAY_BUFFER,a,i.STATIC_DRAW),i.enableVertexAttribArray(3),i.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let s=new Uint8Array([0,1,2,3]),c=i.createBuffer();this._register(Nl(()=>i.deleteBuffer(c))),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,c),i.bufferData(i.ELEMENT_ARRAY_BUFFER,s,i.STATIC_DRAW),this._attributesBuffer=X(i.createBuffer()),this._register(Nl(()=>i.deleteBuffer(this._attributesBuffer))),i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.enableVertexAttribArray(0),i.vertexAttribPointer(0,2,i.FLOAT,!1,Yd,0),i.vertexAttribDivisor(0,1),i.enableVertexAttribArray(1),i.vertexAttribPointer(1,2,i.FLOAT,!1,Yd,2*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(1,1),i.enableVertexAttribArray(2),i.vertexAttribPointer(2,4,i.FLOAT,!1,Yd,4*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(2,1),this._updateCachedColors(r.colors),this._register(this._themeService.onChangeColors(e=>{this._updateCachedColors(e),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,Td),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,n=this._vertices,r=1,i,a,o,s,c,l,u,d,f,p,m;for(i=0;i<t.rows;i++){for(o=-1,s=0,c=0,l=!1,a=0;a<t.cols;a++)u=(i*t.cols+a)*Bd,d=e.cells[u+Vd],f=e.cells[u+Hd],p=!!(f&67108864),(d!==s||f!==c&&(l||p))&&((s!==0||l&&c!==0)&&(m=r++*Jd,this._updateRectangle(n,m,c,s,o,a,i)),o=a,s=d,c=f,l=p);(s!==0||l&&c!==0)&&(m=r++*Jd,this._updateRectangle(n,m,c,s,o,t.cols,i))}n.count=r}updateCursor(e){let t=this._verticesCursor,n=e.cursor;if(!n||n.style===`block`){t.count=0;return}let r,i=0;(n.style===`bar`||n.style===`outline`)&&(r=i++*Jd,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.style===`bar`?n.dpr*n.cursorWidth:n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(n.style===`underline`||n.style===`outline`)&&(r=i++*Jd,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,(n.y+1)*this._dimensions.device.cell.height-n.dpr,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat)),n.style===`outline`&&(r=i++*Jd,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat),r=i++*Jd,this._addRectangleFloat(t.attributes,r,(n.x+n.width)*this._dimensions.device.cell.width-n.dpr,n.y*this._dimensions.device.cell.height,n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=i}_updateRectangle(e,t,n,r,i,a,o){if(n&67108864)switch(n&50331648){case 16777216:case 33554432:Qd=this._themeService.colors.ansi[n&255].rgba;break;case 50331648:Qd=(n&16777215)<<8;break;default:Qd=this._themeService.colors.foreground.rgba}else switch(r&50331648){case 16777216:case 33554432:Qd=this._themeService.colors.ansi[r&255].rgba;break;case 50331648:Qd=(r&16777215)<<8;break;default:Qd=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=Od(e.attributes,this._terminal.rows*this._terminal.cols*Jd)),$d=i*this._dimensions.device.cell.width,ef=o*this._dimensions.device.cell.height,tf=(Qd>>24&255)/255,nf=(Qd>>16&255)/255,rf=(Qd>>8&255)/255,af=1,this._addRectangle(e.attributes,t,$d,ef,(a-i)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,tf,nf,rf,af)}_addRectangle(e,t,n,r,i,a,o,s,c,l){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=s,e[t+6]=c,e[t+7]=l}_addRectangleFloat(e,t,n,r,i,a,o){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},sf=class extends Il{constructor(e,t,n,r,i,a,o,s){super(),this._container=t,this._alpha=i,this._coreBrowserService=a,this._optionsService=o,this._themeService=s,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-${n}-layer`),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(t=>{this._refreshCharAtlas(e,t),this.reset(e)})),this._register(Nl(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=X(this._canvas.getContext(`2d`,{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,n){}handleSelectionChanged(e,t,n,r=!1){}_setTransparency(e,t){if(t===this._alpha)return;let n=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,n),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=vd(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,n=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,n*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,n,r){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight))}_fillCharTrueColor(e,t,n,r){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=Su,this._clipCell(n,r,t.getWidth()),this._ctx.fillText(t.getChars(),n*this._deviceCellWidth+this._deviceCharLeft,r*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,n){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,n){let r=t?e.options.fontWeightBold:e.options.fontWeight;return`${n?`italic`:``} ${r} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},cf=class extends sf{constructor(e,t,n,r,i,a,o){super(n,e,`link`,t,!0,i,a,o),this._register(r.onShowLinkUnderline(e=>this._handleShowLinkUnderline(e))),this._register(r.onHideLinkUnderline(e=>this._handleHideLinkUnderline(e)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&gd(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},lf=typeof window==`object`?window:globalThis,uf=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Z,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Z,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};uf.INSTANCE=new uf;var df=uf;function ff(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}df.INSTANCE.onDidChangeZoomLevel,df.INSTANCE.onDidChangeFullscreen;var pf=typeof navigator==`object`?navigator.userAgent:``;pf.indexOf(`Firefox`);var mf=pf.indexOf(`AppleWebKit`)>=0;!(pf.indexOf(`Chrome`)>=0)&&pf.indexOf(`Safari`),pf.indexOf(`Electron/`),pf.indexOf(`Android`);var hf=!1;if(typeof lf.matchMedia==`function`){let e=lf.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=lf.matchMedia(`(display-mode: fullscreen)`);hf=e.matches,ff(lf,e,({matches:e})=>{hf&&t.matches||(hf=e)})}function gf(){return hf}var _f=`en`,vf=!1,yf=!1,bf=!1,xf=_f,Sf,Cf=globalThis,wf;typeof Cf.vscode<`u`&&typeof Cf.vscode.process<`u`?wf=Cf.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(wf=process);var Tf=typeof wf?.versions?.electron==`string`&&wf?.type===`renderer`;if(typeof wf==`object`){wf.platform,wf.platform,vf=wf.platform===`linux`,vf&&wf.env.SNAP&&wf.env.SNAP_REVISION,wf.env.CI||wf.env.BUILD_ARTIFACTSTAGINGDIRECTORY,xf=_f;let e=wf.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,xf=t.resolvedLanguage||_f,t.languagePack?.translationsConfigFile}catch{}yf=!0}else typeof navigator==`object`&&!Tf?(Sf=navigator.userAgent,Sf.indexOf(`Windows`),Sf.indexOf(`Macintosh`),(Sf.indexOf(`Macintosh`)>=0||Sf.indexOf(`iPad`)>=0||Sf.indexOf(`iPhone`)>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,vf=Sf.indexOf(`Linux`)>=0,Sf?.indexOf(`Mobi`),bf=!0,xf=globalThis._VSCODE_NLS_LANGUAGE||_f,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var Ef=yf;bf&&typeof Cf.importScripts==`function`&&Cf.origin;var Df=Sf,Of=xf,kf;(e=>{function t(){return Of}e.value=t;function n(){return Of.length===2?Of===`en`:Of.length>=3&&Of[0]===`e`&&Of[1]===`n`&&Of[2]===`-`}e.isDefaultVariant=n;function r(){return Of===`en`}e.isDefault=r})(kf||={});var Af=typeof Cf.postMessage==`function`&&!Cf.importScripts;(()=>{if(Af){let e=[];Cf.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){let r=e[n];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(n,1),r.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),Cf.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var jf=!!(Df&&Df.indexOf(`Chrome`)>=0);Df&&Df.indexOf(`Firefox`),!jf&&Df&&Df.indexOf(`Safari`),Df&&Df.indexOf(`Edg/`),Df&&Df.indexOf(`Android`);var Mf=typeof navigator==`object`?navigator:{};Ef||document.queryCommandSupported&&document.queryCommandSupported(`copy`)||Mf&&Mf.clipboard&&Mf.clipboard.writeText,Ef||Mf&&Mf.clipboard&&Mf.clipboard.readText,Ef||gf()||Mf.keyboard,`ontouchstart`in lf||Mf.maxTouchPoints,lf.PointerEvent&&(`ontouchstart`in lf||navigator.maxTouchPoints);var Nf=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Pf=new Nf,Ff=new Nf,If=new Nf;Array(230);var Lf;(e=>{function t(e){return Pf.keyCodeToStr(e)}e.toString=t;function n(e){return Pf.strToKeyCode(e)}e.fromString=n;function r(e){return Ff.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return If.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return Ff.strToKeyCode(e)||If.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=98&&e<=113)return null;switch(e){case 16:return`Up`;case 18:return`Down`;case 15:return`Left`;case 17:return`Right`}return Pf.keyCodeToStr(e)}e.toElectronAccelerator=o})(Lf||={});var Rf=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),zf;(e=>{function t(t){return t===e.None||t===e.Cancelled||t instanceof Bf?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:qu.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Rf})})(zf||={});var Bf=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Rf:(this._emitter||=new Z,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}};(function(){typeof globalThis.requestIdleCallback!=`function`||globalThis.cancelIdleCallback})();var Vf;(e=>{async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(typeof t<`u`)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(Vf||={});var Hf=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new Z,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await qu.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};Hf.EMPTY=Hf.fromArray([]);function Uf(e){return Wf(e,0)}function Wf(e,t){switch(typeof e){case`object`:return e===null?Gf(349,t):Array.isArray(e)?Jf(e,t):Yf(e,t);case`string`:return qf(e,t);case`boolean`:return Kf(e,t);case`number`:return Gf(e,t);case`undefined`:return Gf(937,t);default:return Gf(617,t)}}function Gf(e,t){return(t<<5)-t+e|0}function Kf(e,t){return Gf(e?433:863,t)}function qf(e,t){t=Gf(149417,t);for(let n=0,r=e.length;n<r;n++)t=Gf(e.charCodeAt(n),t);return t}function Jf(e,t){return t=Gf(104579,t),e.reduce((e,t)=>Wf(t,e),t)}function Yf(e,t){return t=Gf(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=qf(n,t),Wf(e[n],t)),t)}var{registerWindow:Xf,getWindow:Zf,getDocument:Qf,getWindows:$f,getWindowsCount:ep,getWindowId:tp,getWindowById:np,hasWindow:rp,onDidRegisterWindow:ip,onWillUnregisterWindow:ap,onDidUnregisterWindow:op}=function(){let e=new Map,t={window:lf,disposables:new Fl};e.set(lf.vscodeWindowId,t);let n=new Z,r=new Z,i=new Z;function a(n,r){return(typeof n==`number`?e.get(n):void 0)??(r?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(t){if(e.has(t.vscodeWindowId))return Il.None;let a=new Fl,o={window:t,disposables:a.add(new Fl)};return e.set(t.vscodeWindowId,o),a.add(Nl(()=>{e.delete(t.vscodeWindowId),r.fire(t)})),a.add(cp(t,up.BEFORE_UNLOAD,()=>{i.fire(t)})),n.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(e){return e.vscodeWindowId},hasWindow(t){return e.has(t)},getWindowById:a,getWindow(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;let n=e;return n?.view?n.view.window:lf},getDocument(e){return Zf(e).document}}}(),sp=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&=(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,null)}};function cp(e,t,n,r){return new sp(e,t,n,r)}var lp=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(e){return typeof e==`object`&&typeof e.height==`number`&&typeof e.width==`number`}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};lp.None=new lp(0,0),new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=Uf(n),a=r.get(i);if(a)a.users+=1;else{let o=new Z,s=new MutationObserver(e=>o.fire(e));s.observe(e,n);let c=a={users:1,observer:s,onDidMutate:o.event};t.add(Nl(()=>{--c.users,c.users===0&&(o.dispose(),s.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,a)}return a.onDidMutate}};var up={CLICK:`click`,AUXCLICK:`auxclick`,DBLCLICK:`dblclick`,MOUSE_UP:`mouseup`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_MOVE:`mousemove`,MOUSE_OUT:`mouseout`,MOUSE_ENTER:`mouseenter`,MOUSE_LEAVE:`mouseleave`,MOUSE_WHEEL:`wheel`,POINTER_UP:`pointerup`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_LEAVE:`pointerleave`,CONTEXT_MENU:`contextmenu`,WHEEL:`wheel`,KEY_DOWN:`keydown`,KEY_PRESS:`keypress`,KEY_UP:`keyup`,LOAD:`load`,BEFORE_UNLOAD:`beforeunload`,UNLOAD:`unload`,PAGE_SHOW:`pageshow`,PAGE_HIDE:`pagehide`,PASTE:`paste`,ABORT:`abort`,ERROR:`error`,RESIZE:`resize`,SCROLL:`scroll`,FULLSCREEN_CHANGE:`fullscreenchange`,WK_FULLSCREEN_CHANGE:`webkitfullscreenchange`,SELECT:`select`,CHANGE:`change`,SUBMIT:`submit`,RESET:`reset`,FOCUS:`focus`,FOCUS_IN:`focusin`,FOCUS_OUT:`focusout`,BLUR:`blur`,INPUT:`input`,STORAGE:`storage`,DRAG_START:`dragstart`,DRAG:`drag`,DRAG_ENTER:`dragenter`,DRAG_LEAVE:`dragleave`,DRAG_OVER:`dragover`,DROP:`drop`,DRAG_END:`dragend`,ANIMATION_START:mf?`webkitAnimationStart`:`animationstart`,ANIMATION_END:mf?`webkitAnimationEnd`:`animationend`,ANIMATION_ITERATION:mf?`webkitAnimationIteration`:`animationiteration`},dp=class extends Il{constructor(e,t,n,r,i,a,o,s,c){super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._optionsService=o,this._themeService=s,this._cursorBlinkStateManager=new Ll,this._charAtlasDisposable=this._register(new Ll),this._observerDisposable=this._register(new Ll),this._model=new Gd,this._workCell=new wd,this._workCell2=new wd,this._rectangleRenderer=this._register(new Ll),this._glyphRenderer=this._register(new Ll),this._onChangeTextureAtlas=this._register(new Z),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Z),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Z),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Z),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Z),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`);let l={antialias:!1,depth:!1,preserveDrawingBuffer:c};if(this._gl=this._canvas.getContext(`webgl2`,l),!this._gl)throw Error(`WebGL2 not supported `+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new bu(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new cf(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=uu(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(cp(this._canvas,`webglcontextlost`,e=>{console.log(`webglcontextlost event received`),e.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn(`webgl context not restored; firing onContextLoss`),this._onContextLoss.fire(e)},3e3)})),this._register(cp(this._canvas,`webglcontextrestored`,e=>{console.warn(`webglcontextrestored event received`),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,yd(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=Sd(this._canvas,this._coreBrowserService.window,(e,t)=>this._setCanvasDevicePixelDimensions(e,t)),this._register(this._coreBrowserService.onWindowChange(e=>{this._observerDisposable.value=Sd(this._canvas,e,(e,t)=>this._setCanvasDevicePixelDimensions(e,t))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(Nl(()=>{for(let e of this._renderLayers)e.dispose();this._canvas.parentElement?.removeChild(this._canvas),yd(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let e of this._renderLayers)e.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,n){for(let r of this._renderLayers)r.handleSelectionChanged(this._terminal,e,t,n);this._model.selection.update(this._core,e,t,n),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new of(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new Ld(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=vd(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=Ml(qu.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),qu.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached){if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return}for(let n of this._renderLayers)n.handleGridChanged(this._terminal,e,t);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new xd(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let n=this._core,r=this._workCell,i,a,o,s,c,l,u=0,d=!0,f,p,m,h,g,_,v,y,ee;e=pp(e,n.rows-1,0),t=pp(t,n.rows-1,0);let b=this._coreService.decPrivateModes.cursorStyle??n.options.cursorStyle??`block`,te=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,ne=te-n.buffer.ydisp,x=Math.min(this._terminal.buffer.active.cursorX,n.cols-1),re=-1,ie=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let S=!1;for(a=e;a<=t;a++)for(o=a+n.buffer.ydisp,s=n.buffer.lines.get(o),this._model.lineLengths[a]=0,m=te===o,u=0,c=this._characterJoinerService.getJoinedCharacters(o),y=0;y<n.cols;y++){if(i=this._cellColorResolver.result.bg,s.loadCell(y,r),y===0&&(i=this._cellColorResolver.result.bg),l=!1,d=y>=u,f=y,c.length>0&&y===c[0][0]&&d){p=c.shift();let e=this._model.selection.isCellSelected(this._terminal,p[0],o);for(v=p[0]+1;v<p[1];v++)d&&=e===this._model.selection.isCellSelected(this._terminal,v,o);d&&=!m||x<p[0]||x>=p[1],d?(l=!0,r=new fp(r,s.translateToString(!0,p[0],p[1]),p[1]-p[0]),f=p[1]-1):u=p[1]}if(h=r.getChars(),g=r.getCode(),v=(a*n.cols+y)*Bd,this._cellColorResolver.resolve(r,y,o,this.dimensions.device.cell.width),ie&&o===te&&(y===x&&(this._model.cursor={x,y:ne,width:r.getWidth(),style:this._coreBrowserService.isFocused?b:n.options.cursorInactiveStyle,cursorWidth:n.options.cursorWidth,dpr:this._devicePixelRatio},re=x+r.getWidth()-1),y>=x&&y<=re&&(this._coreBrowserService.isFocused&&b===`block`||this._coreBrowserService.isFocused===!1&&n.options.cursorInactiveStyle===`block`)&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),g!==0&&(this._model.lineLengths[a]=y+1),(this._model.cells[v]!==g||this._model.cells[v+Vd]!==this._cellColorResolver.result.bg||this._model.cells[v+Hd]!==this._cellColorResolver.result.fg||this._model.cells[v+Ud]!==this._cellColorResolver.result.ext)&&(S=!0,h.length>1&&(g|=Wd),this._model.cells[v]=g,this._model.cells[v+Vd]=this._cellColorResolver.result.bg,this._model.cells[v+Hd]=this._cellColorResolver.result.fg,this._model.cells[v+Ud]=this._cellColorResolver.result.ext,_=r.getWidth(),this._glyphRenderer.value.updateCell(y,a,g,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,h,_,i),l)){for(r=this._workCell,y++;y<=f;y++)ee=(a*n.cols+y)*Bd,this._glyphRenderer.value.updateCell(y,a,0,0,0,0,Gl,0,0),this._model.cells[ee]=0,this._model.cells[ee+Vd]=this._cellColorResolver.result.bg,this._model.cells[ee+Hd]=this._cellColorResolver.result.fg,this._model.cells[ee+Ud]=this._cellColorResolver.result.ext;y--}}S&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},fp=class extends Hu{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function pp(e,t,n=0){return Math.max(Math.min(e,t),n)}var mp=`di$target`,hp=`di$dependencies`,gp=new Map;function _p(e){if(gp.has(e))return gp.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);vp(t,e,r)};return t._id=e,gp.set(e,t),t}function vp(e,t,n){t[mp]===t?t[hp].push({id:e,index:n}):(t[hp]=[{id:e,index:n}],t[mp]=t)}_p(`BufferService`),_p(`CoreMouseService`),_p(`CoreService`),_p(`CharsetService`),_p(`InstantiationService`),_p(`LogService`);var yp=_p(`OptionsService`);_p(`OscLinkService`),_p(`UnicodeService`),_p(`DecorationService`);var bp={trace:0,debug:1,info:2,warn:3,error:4,off:5},xp=`xterm.js: `,Sp=class extends Il{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange(`logLevel`,()=>this._updateLogLevel())),Cp=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=bp[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:xp)+t,...n)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};Sp=hl([gl(0,yp)],Sp);var Cp,wp=class extends Il{constructor(e){if(Ul&&Wl()<16&&!document.createElement(`canvas`).getContext(`webgl2`,{antialias:!1,depth:!1,preserveDrawingBuffer:!0}))throw Error(`Webgl2 is only supported on Safari 16 and above`);super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new Z),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Z),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Z),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Z),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element){this._register(t.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let n=t.coreService,r=t.optionsService,i=t,a=i._renderService,o=i._characterJoinerService,s=i._charSizeService,c=i._coreBrowserService,l=i._decorationService;i._logService;let u=i._themeService;this._renderer=this._register(new dp(e,o,s,c,n,l,r,u,this._preserveDrawingBuffer)),this._register(qu.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(qu.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(qu.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(qu.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),a.setRenderer(this._renderer),this._register(Nl(()=>{if(this._terminal._core._store._isDisposed)return;let t=this._terminal._core._renderService;t.setRenderer(this._terminal._core._createRenderer()),t.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}};function Tp(e){try{e.loadAddon(new fl.CanvasAddon)}catch{}}function Ep(e,t,n){if(t===`dom`)return;if(n){Tp(e);return}let r,i=()=>{try{r?.dispose()}catch{}Tp(e)};try{r=new wp,r.onContextLoss(i),e.loadAddon(r)}catch{i()}}var Dp={background:`#141413`,foreground:`#eae7df`,cursor:`#cc785c`,cursorAccent:`#141413`,selectionBackground:`#33312e`,black:`#141413`,red:`#d47563`,green:`#9aca86`,yellow:`#e8c96b`,blue:`#61aaf2`,magenta:`#9b87f5`,cyan:`#d4967e`,white:`#a9a39a`,brightBlack:`#6b665f`,brightRed:`#d47563`,brightGreen:`#9aca86`,brightYellow:`#e8c96b`,brightBlue:`#61aaf2`,brightMagenta:`#9b87f5`,brightCyan:`#e0ab96`,brightWhite:`#eae7df`},Op=`"JetBrains Mono", "JetBrainsMono Nerd Font", "MesloLGS NF", "Symbols Nerd Font Mono", "SF Mono", ui-monospace, Menlo, monospace`,kp=[`"JetBrains Mono"`,`"JetBrainsMono Nerd Font"`,`"MesloLGS NF"`,`"Symbols Nerd Font Mono"`];async function Ap(){if(`fonts`in document){await Promise.allSettled(kp.map(e=>document.fonts.load(`12px ${e}`)));try{await document.fonts.ready}catch{}}}function jp(e,{renderer:t,transparent:n,hostBackground:r,cursorBlink:i,fontScale:a=1}){let o=new dl({theme:n?{...Dp,background:r??`rgba(0,0,0,0.01)`}:Dp,allowTransparency:n,fontFamily:Op,fontSize:12*a,cursorBlink:i,allowProposedApi:!0,scrollback:5e3});return o.loadAddon(new xt),o.unicode.activeVersion=`11`,o.loadAddon(new Se),o.loadAddon(new Dt),o.open(e),Ep(o,t,n),o}var Mp=`rove-web-token`;function Np(){try{return sessionStorage.getItem(Mp)?.trim()??``}catch{return``}}function Pp(e){try{sessionStorage.setItem(Mp,e)}catch{}}function Fp(){if(typeof document<`u`){let e=document.querySelector(`meta[name="rove-web-token"]`)?.getAttribute(`content`)?.trim();if(e)return Pp(e),e;let t=Np();if(t)return t}return``}var Ip=null;function Lp(){return Ip===null&&(Ip=Fp()),Ip}function Rp(e){let t=Lp();return t?`${e}${e.includes(`?`)?`&`:`?`}token=${encodeURIComponent(t)}`:e}function zp(){return`${location.protocol===`https:`?`wss`:`ws`}://${location.host}`}function Bp(e,t,n,r,i){let a=new URLSearchParams({tab:e,taskId:t,mode:n,cols:String(r),rows:String(i)});return Rp(`${zp()}/pty?${a.toString()}`)}var Vp=r(),Hp=new TextDecoder;function Up(e){let t=e.buffer.active,n=t.viewportY,r=Math.min(t.length,n+e.rows),i=[];for(let e=n;e<r;e+=1)i.push(t.getLine(e)?.translateToString(!0)??``);return i.join(`
|
|
86
86
|
`)}function Wp({tabId:e,taskId:t,mode:n,testId:r,renderer:a=`automatic`,transparent:o=!1,hostBackground:c,onStatusChange:l,onBufferChange:u}){let d=(0,i.useRef)(null),f=(0,i.useRef)(null),[p,m]=(0,i.useState)(`connecting`),[g,_]=(0,i.useState)(0);return(0,i.useEffect)(()=>{let r=!1,i=d.current;if(!i)return;let p=null,h=null,g=null,_=null;m(`connecting`),l?.(`connecting`);let v=()=>{!p||!u||_!==null||(_=requestAnimationFrame(()=>{_=null,!r&&p&&u(Up(p))}))};return(async()=>{if(await Ap(),r)return;p=jp(i,{renderer:a,transparent:o,hostBackground:c,cursorBlink:!0});let u=new s;p.loadAddon(u);try{u.fit()}catch{}h=new WebSocket(Bp(e,t,n,p.cols,p.rows)),f.current=h,h.binaryType=`arraybuffer`,h.onopen=()=>{r||(m(`open`),l?.(`open`))},h.onmessage=e=>{if(r)return;let t=typeof e.data==`string`?e.data:Hp.decode(e.data);p?.write(t,v)},h.onclose=e=>{if(!r){let t=e.reason?`: ${e.reason}`:``;p?.writeln(`\r\n[detached${t} — reattach below]`,v),m(`closed`),l?.(`closed`)}},p.onData(e=>{h?.readyState===WebSocket.OPEN&&h.send(e)});let d=()=>{if(p){try{u.fit()}catch{return}h?.readyState===WebSocket.OPEN&&h.send(JSON.stringify({type:`resize`,cols:p.cols,rows:p.rows}))}};g=new ResizeObserver(()=>d()),g.observe(i)})(),()=>{r=!0,g?.disconnect(),_!==null&&cancelAnimationFrame(_),h?.close(),p?.dispose(),f.current=null}},[e,t,n,g,a,o,c,l,u]),(0,Vp.jsxs)(`div`,{className:`flex h-full w-full flex-col`,children:[(0,Vp.jsx)(`div`,{ref:d,"data-testid":r,"data-pty-status":r?p:void 0,className:`min-h-0 w-full flex-1 overflow-hidden`}),p===`closed`?(0,Vp.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center justify-between gap-2 border-t border-line bg-surface px-2`,children:[(0,Vp.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] text-rove-yellow`,children:`detached — the session keeps running`}),(0,Vp.jsxs)(`button`,{type:`button`,onClick:()=>_(e=>e+1),className:`flex shrink-0 items-center gap-1.5 border border-line bg-bg px-2 py-1 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg`,children:[(0,Vp.jsx)(h,{size:11,strokeWidth:2}),`Reattach`]})]}):null]})}function Gp(e){let[t,...n]=e.split(`
|
|
87
|
-
`).filter(e=>e.length>0);if(!t)throw Error(`empty cast`);let r=JSON.parse(t);if(r.version!==2||!r.width||!r.height)throw Error(`not an asciicast v2 recording`);let i=n.map(e=>JSON.parse(e));return{cols:r.width,rows:r.height,events:i}}function Kp(e){return e.events.filter(e=>e[1]===`m`).map(([e,,t])=>({t:e,label:t}))}function qp(e){return e.events.at(-1)?.[0]??0}function Jp(e,t,n){let r=t>0?e.events[t-1]:void 0,i=r!==void 0&&r[0]>n,a=i?0:t,o=[],s=``,c=()=>{s&&o.push({kind:`write`,data:s}),s=``};for(;a<e.events.length;a+=1){let[t,r,i]=e.events[a];if(t>n)break;if(r===`o`)s+=i;else if(r===`r`){c();let[e,t]=i.split(`x`).map(Number);o.push({kind:`resize`,cols:e,rows:t})}}return c(),{reset:i,steps:o,cursor:a}}function Yp(){let{promise:e,resolve:t}=Promise.withResolvers();return requestAnimationFrame(()=>requestAnimationFrame(()=>t())),e}function Xp({renderer:e,transparent:t,hostBackground:n}){let
|
|
87
|
+
`).filter(e=>e.length>0);if(!t)throw Error(`empty cast`);let r=JSON.parse(t);if(r.version!==2||!r.width||!r.height)throw Error(`not an asciicast v2 recording`);let i=n.map(e=>JSON.parse(e));return{cols:r.width,rows:r.height,events:i}}function Kp(e){return e.events.filter(e=>e[1]===`m`).map(([e,,t])=>({t:e,label:t}))}function qp(e){return e.events.at(-1)?.[0]??0}function Jp(e,t,n){let r=t>0?e.events[t-1]:void 0,i=r!==void 0&&r[0]>n,a=i?0:t,o=[],s=``,c=()=>{s&&o.push({kind:`write`,data:s}),s=``};for(;a<e.events.length;a+=1){let[t,r,i]=e.events[a];if(t>n)break;if(r===`o`)s+=i;else if(r===`r`){c();let[e,t]=i.split(`x`).map(Number);o.push({kind:`resize`,cols:e,rows:t})}}return c(),{reset:i,steps:o,cursor:a}}function Yp(){let{promise:e,resolve:t}=Promise.withResolvers();return requestAnimationFrame(()=>requestAnimationFrame(()=>t())),e}function Xp({renderer:e,transparent:t,hostBackground:n,scale:r=1}){let a=(0,i.useRef)(null);return(0,i.useEffect)(()=>{let i=a.current;if(!i)return;let o=!1,s=null;return(async()=>{if(await Ap(),o)return;let a=jp(i,{renderer:e,transparent:t,hostBackground:n,cursorBlink:!1,fontScale:r});s=a;let c=null,l=0,u=e=>{a.reset(),a.resize(e.cols,e.rows)};window.__replay={async load(e){return c=Gp(e),l=0,u(c),await Yp(),{duration:qp(c),markers:Kp(c)}},async seek(e){if(!c)throw Error(`__replay.seek before load`);let t=Jp(c,l,e);t.reset&&u(c);for(let e of t.steps){if(e.kind===`resize`){a.resize(e.cols,e.rows);continue}let{promise:t,resolve:n}=Promise.withResolvers();a.write(e.data,n),await t}l=t.cursor;let n=t.reset||t.steps.length>0;return n&&await Yp(),n}},i.dataset.replayReady=`true`})(),()=>{o=!0,delete window.__replay,s?.dispose()}},[e,t,n,r]),(0,Vp.jsx)(`div`,{ref:a,"data-testid":`opentui-terminal`,className:`h-full w-full overflow-hidden`})}function Zp(e){return e.get(`renderer`)===`dom`?`dom`:`automatic`}function Qp(){let e=(new URLSearchParams(window.location.search).get(`run`)??`manual`).replace(/[^a-zA-Z0-9_-]/g,``).slice(0,48)||`manual`,t=Zp(new URLSearchParams(window.location.search)),n=new URLSearchParams(window.location.search).get(`wallpaper`),r=n?.startsWith(`/`)?n:null,a=new URLSearchParams(window.location.search).get(`hostbg`),o=a&&/^#[0-9a-fA-F]{6}$/.test(a)?a:null,s=`visual-${e}`,c=new URLSearchParams(window.location.search).has(`replay`),l=Number(new URLSearchParams(window.location.search).get(`scale`)??`1`),[u,d]=(0,i.useState)(`connecting`),[f,p]=(0,i.useState)(``);return(0,Vp.jsxs)(`div`,{"data-testid":`opentui-harness`,"data-pty-status":u,style:{position:`fixed`,inset:0,background:r?`#0F0E0D url("${r}") center/cover no-repeat`:o??`#141413`},children:[r||o?(0,Vp.jsx)(`style`,{children:`.xterm-viewport{background-color:transparent !important}`}):null,c?(0,Vp.jsx)(Xp,{renderer:t,transparent:r!==null||o!==null,hostBackground:o??void 0,scale:l>=1&&l<=4?l:1}):(0,Vp.jsxs)(Vp.Fragment,{children:[(0,Vp.jsx)(Wp,{tabId:s,taskId:s,mode:`shell`,testId:`opentui-terminal`,renderer:t,transparent:r!==null||o!==null,hostBackground:o??void 0,onStatusChange:d,onBufferChange:p}),(0,Vp.jsx)(`pre`,{"data-testid":`opentui-buffer`,style:{display:`none`},children:f})]})]})}export{Qp as component};
|