| 582 | `),P=0,W=0,D=A.at(-1);if(D){let Z=typeof D?.x1==="number"&&typeof D?.x2==="number",T=typeof D?.y1==="number"&&typeof D?.y2==="number";if(Z){let v=kZ8(j);if(J+v<=D.x1||J>=D.x2)continue}if(T){let v=X.length;if(M+v<=D.y1||M>=D.y2)continue}if(Z){if(X=X.map((v)=>{let V=J<D.x1?D.x1-J:0,E=O1(v),S=J+E>D.x2?D.x2-J:E,R=of(v,V,S);if(O1(R)>S-V)R=of(v,V,S-1);return R}),J<D.x1)J=D.x1}if(T){let v=M<D.y1?D.y1-M:0,V=X.length,E=M+V>D.y2?D.y2-M:V;if(H&&v>0&&H[v]===!0)W=J+O1(X[v-1]);if(X=X.slice(v,E),P=v,M<D.y1)M=D.y1}}let f=q.softWrap,G=0;for(let Z of X){let T=M+G;if(T>=_)break;let v=n0_(q,Z,J,T,K,this.stylePool,this.charCache);if(Y+=v-J,H){let V=H[P+G]===!0;f[T]=V?W:0,W=v}G++}continue}}for(let w of this.operations)if(w.type==="noSelect"){let{x:j,y:H,width:J,height:M}=w.region;Mtq(q,j,H,J,M)}let O=z+Y;if(O>1000&&Y>z)N(`High write ratio: blit=${z}, write=${Y} (${(Y/O*100).toFixed(1)}% writes), screen=${_}x${K}`);return q}}function c0_(q,K){if(q===K)return!0;let _=q.length;if(_!==K.length)return!1;if(_===0)return!0;for(let z=0;z<_;z++)if(q[z].code!==K[z].code)return!1;return!0}function l0_(q,K){let _=q.length;if(_===0)return[];let z=[],Y=[],$=q[0].styles;for(let A=0;A<_;A++){let O=q[A],w=O.styles;if(Y.length>0&&!c0_(w,$))f84(Y.join(""),$,K,z),Y.length=0;Y.push(O.value),$=w}if(Y.length>0)f84(Y.join(""),$,K,z);return z}function f84(q,K,_,z){let Y=Htq(K)??void 0,A=Y!==void 0||K.some((w)=>w.code.length>=Pl6.length&&w.code.startsWith(Pl6))?Jtq(K):K,O=_.intern(A);for(let{segment:w}of YH().segment(q))z.push({value:w,width:O1(w),styleId:O,hyperlink:Y})}function n0_(q,K,_,z,Y,$,A){let O=A.get(K);if(!O)O=X84(l0_(vsq(ZT6(K)),$)),A.set(K,O);let w=_;for(let j=0;j<O.length;j++){let H=O[j],J=H.value.codePointAt(0);if(J!==void 0&&J<=31){if(J===9){let W=8-w%8;for(let D=0;D<W&&w<Y;D++)d08(q,w,z,{char:" ",styleId:$.none,width:0,hyperlink:void 0}),w++}else if(J===27){let P=O[j+1]?.value,W=P?.codePointAt(0);if(P==="("||P===")"||P==="*"||P==="+")j+=2;else if(P==="["){j++;while(j<O.length-1){j++;let D=O[j]?.value.codePointAt(0);if(D!==void 0&&D>=64&&D<=126)break}}else if(P==="]"||P==="P"||P==="_"||P==="^"||P==="X"){j++;while(j<O.length-1){j++;let D=O[j]?.value;if(D==="\x07")break;if(D==="\x1B"){if(O[j+1]?.value==="\\"){j++;break}}}}else if(W!==void 0&&W>=48&&W<=126)j++}continue}let M=H.width;if(M===0)continue;let X=M>=2;if(X&&w+2>Y){d08(q,w,z,{char:" ",styleId:$.none,width:3,hyperlink:void 0}),w++;continue}d08(q,w,z,{char:H.value,styleId:H.styleId,width:X?1:0,hyperlink:H.hyperlink}),w+=X?2:1}return w}var VZ8=y(()=>{GT6();_8();mk();$A6();P84();Hl6();Ci();Q5();sE1()});function tE1(q,K=1,_={}){let{indent:z=" ",includeEmptyLines:Y=!1}=_;if(typeof q!=="string")throw TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof q}\``);if(typeof K!=="number")throw TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof K}\``);if(K<0)throw RangeError(`Expected \`count\` to be at least 0, got \`${K}\``);if(typeof z!=="string")throw TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof z}\``);if(K===0)return q;let $=Y?/^/gm:/^(?!\s*$)/gm;return q.replace($,z.repeat(K))}var i0_=(q)=>{return q.getComputedWidth()-q.getComputedPadding(F_.Left)-q.getComputedPadding(F_.Right)-q.getComputedBorder(F_.Left)-q.getComputedBorder(F_.Right)},Z84;var G84=y(()=>{KA6();Z84=i0_});var T84=m((ICA,r0_)=>{r0_.exports={single:{topLeft:"┌",top:"─",topRight:"┐",right:"│",bottomRight:"┘",bottom:"─",bottomLeft:"└",left:"│"},double:{topLeft:"╔",top:"═",topRight:"╗",right:"║",bottomRight:"╝",bottom:"═",bottomLeft:"╚",left:"║"},round:{topLeft:"╭",top:"─",topRight:"╮",right:"│",bottomRight:"╯",bottom:"─",bottomLeft:"╰",left:"│"},bold:{topLeft:"┏",top:"━",topRight:"┓",right:"┃",bottomRight:"┛",bottom:"━",bottomLeft:"┗",left:"┃"},singleDouble:{topLeft:"╓",top:"─",topRight:"╖",right:"║",bottomRight:"╜",bottom:"─",bottomLeft:"╙",left:"║"},doubleSingle:{topLeft:"╒",top:"═",topRight:"╕",right:"│",bottomRight:"╛",bottom:"═",bottomLeft:"╘",left:"│"},classic:{topLeft:"+",top:"-",topRight:"+",right:"|",bottomRight:"+",bottom:"-",bottomLeft:"+",left:"|"},arrow:{topLeft:"↘",top:"↓",topRight:"↙",right:"←",bottomRight:"↖",bottom:"↑",bottomLeft:"↗",left:"→"}}});var k84=m((uCA,eE1)=>{var v84=T84();eE1.exports=v84;eE1.exports.default=v84});function V84(q,K,_,z=0,Y){let $=O1(K),A=q.length;if($>=A-2)return["",K.substring(0,A),""];let O;if(_==="center")O=Math.floor((A-$)/2);else if(_==="start")O=z+1;else O=A-$-z-1;O=Math.max(1,Math.min(O,A-$-1));let w=q.substring(0,1)+Y.repeat(O-1),j=Y.repeat(A-O-$-1)+q.substring(A-1);return[w,K,j]}function uT6(q,K,_){let z=Ni(q,K);if(_)z=$8.dim(z);return z}var N84,o0_,a0_=(q,K,_,z)=>{if(_.style.borderStyle){let Y=Math.floor(_.yogaNode.getComputedWidth()),$=Math.floor(_.yogaNode.getComputedHeight()),A=typeof _.style.borderStyle==="string"?o0_[_.style.borderStyle]??N84.default[_.style.borderStyle]:_.style.borderStyle,O=_.style.borderTopColor??_.style.borderColor,w=_.style.borderBottomColor??_.style.borderColor,j=_.style.borderLeftColor??_.style.borderColor,H=_.style.borderRightColor??_.style.borderColor,J=_.style.borderTopDimColor??_.style.borderDimColor,M=_.style.borderBottomDimColor??_.style.borderDimColor,X=_.style.borderLeftDimColor??_.style.borderDimColor,P=_.style.borderRightDimColor??_.style.borderDimColor,W=_.style.borderTop!==!1,D=_.style.borderBottom!==!1,f=_.style.borderLeft!==!1,G=_.style.borderRight!==!1,Z=Math.max(0,Y-(f?1:0)-(G?1:0)),T=W?(f?A.topLeft:"")+A.top.repeat(Z)+(G?A.topRight:""):"",v;if(W&&_.style.borderText?.position==="top"){let[B,p,C]=V84(T,_.style.borderText.content,_.style.borderText.align,_.style.borderText.offset,A.top);v=uT6(B,O,J)+p+uT6(C,O,J)}else if(W)v=uT6(T,O,J);let V=$;if(W)V-=1;if(D)V-=1;V=Math.max(0,V);let E=(Ni(A.left,j)+` |
| 584 | `).repeat(V);if(P)S=$8.dim(S);let R=D?(f?A.bottomLeft:"")+A.bottom.repeat(Z)+(G?A.bottomRight:""):"",x;if(D&&_.style.borderText?.position==="bottom"){let[B,p,C]=V84(R,_.style.borderText.content,_.style.borderText.align,_.style.borderText.offset,A.bottom);x=uT6(B,w,M)+p+uT6(C,w,M)}else if(D)x=uT6(R,w,M);let I=W?1:0;if(v)z.write(q,K,v);if(f)z.write(q,K+I,E);if(G)z.write(q+Y-1,K+I,S);if(x)z.write(q,K+$-1,x)}},y84;var E84=y(()=>{x3();s$6();Q5();N84=O6(k84(),1),o0_={dashed:{top:"╌",left:"╎",right:"╎",bottom:"╌",topLeft:" ",topRight:" ",bottomLeft:" ",bottomRight:" "}};y84=a0_});function s0_(){return process.env.TERM_PROGRAM==="vscode"||pi()}function YL1(){mT6=!1}function C84(){return mT6}function b84(){NZ8=null,_L1=xl6,xl6=[]}function x84(){return NZ8}function I84(){$L1=null}function u84(){return $L1}function m84(){let q=zL1;return zL1=null,q}function zZ_(q,K,_){let z=K>0?1:-1,Y=Math.abs(K),$=0;if(Y>qL1)$+=z*(Y-qL1),Y=qL1;let A=Y<=e0_?Y:Y<qZ_?KZ_:_Z_;$+=z*A;let O=Y-A,w=Math.max(1,_-1),j=Math.abs($);if(j>w){let H=j-w;return q.pendingScrollDelta=z*(O+H),z*w}return q.pendingScrollDelta=O>0?z*O:void 0,$}function YZ_(q,K,_){let z=Math.abs(K),Y=Math.max(1,_-1),$=Math.min(Y,Math.max(t0_,z*3>>2));if(z<=$)return q.pendingScrollDelta=void 0,K;let A=K>0?$:-$;return q.pendingScrollDelta=K-A,A}function yZ8(q,K){return`${L84}8;;${K}${R84}${q}${L84}8;;${R84}`}function $Z_(q){let K=[];for(let _=0;_<q.length;_++){let z=q[_].text.length;for(let Y=0;Y<z;Y++)K.push(_)}return K}function AZ_(q,K,_,z,Y=!1){let $=q.split(` |