cc-viewer 1.5.14 → 1.5.16
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.
|
@@ -645,7 +645,8 @@ void main() {
|
|
|
645
645
|
|
|
646
646
|
`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},HCe=new FCe;function NQ(t){KCe(t)||HCe.onUnexpectedError(t)}var hC="Canceled";function KCe(t){return t instanceof JCe?!0:t instanceof Error&&t.name===hC&&t.message===hC}var JCe=class extends Error{constructor(){super(hC),this.name=this.message}},xz=class fC extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof fC)return e;let n=new fC;return n.message=e.message,n.stack=e.stack,n}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}};function e2e(t,e){let n=this,r=!1,i;return function(){return r||(r=!0,e||(i=t.apply(n,arguments))),i}}var t2e;(t=>{function e(s){return s<0}t.isLessThan=e;function n(s){return s<=0}t.isLessThanOrEqual=n;function r(s){return s>0}t.isGreaterThan=r;function i(s){return s===0}t.isNeitherLessOrGreaterThan=i,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(t2e||(t2e={}));var hY;(t=>{function e(x){return x&&typeof x=="object"&&typeof x[Symbol.iterator]=="function"}t.is=e;let n=Object.freeze([]);function r(){return n}t.empty=r;function*i(x){yield x}t.single=i;function s(x){return e(x)?x:i(x)}t.wrap=s;function o(x){return x||n}t.from=o;function*a(x){for(let w=x.length-1;w>=0;w--)yield x[w]}t.reverse=a;function l(x){return!x||x[Symbol.iterator]().next().done===!0}t.isEmpty=l;function c(x){return x[Symbol.iterator]().next().value}t.first=c;function u(x,w){let C=0;for(let T of x)if(w(T,C++))return!0;return!1}t.some=u;function d(x,w){for(let C of x)if(w(C))return C}t.find=d;function*h(x,w){for(let C of x)w(C)&&(yield C)}t.filter=h;function*p(x,w){let C=0;for(let T of x)yield w(T,C++)}t.map=p;function*g(x,w){let C=0;for(let T of x)yield*w(T,C++)}t.flatMap=g;function*v(...x){for(let w of x)yield*w}t.concat=v;function $(x,w,C){let T=C;for(let z of x)T=w(T,z);return T}t.reduce=$;function*b(x,w,C=x.length){for(w<0&&(w+=x.length),C<0?C+=x.length:C>x.length&&(C=x.length);w<C;w++)yield x[w]}t.slice=b;function _(x,w=Number.POSITIVE_INFINITY){let C=[];if(w===0)return[C,x];let T=x[Symbol.iterator]();for(let z=0;z<w;z++){let R=T.next();if(R.done)return[C,t.empty()];C.push(R.value)}return[C,{[Symbol.iterator](){return T}}]}t.consume=_;async function Q(x){let w=[];for await(let C of x)w.push(C);return Promise.resolve(w)}t.asyncToArray=Q})(hY||(hY={}));function fY(t){if(hY.is(t)){let e=[];for(let n of t)if(n)try{n.dispose()}catch(r){e.push(r)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function n2e(...t){return pY(()=>fY(t))}function pY(t){return{dispose:e2e(()=>{t()})}}var mY=class gY{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{fY(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?gY.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};mY.DISABLE_DISPOSED_WARNING=!1;var w5=mY,_1=class{constructor(){this._store=new w5,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};_1.None=Object.freeze({dispose(){}});var r2e=globalThis.performance&&typeof globalThis.performance.now=="function",i2e=class vY{static create(e){return new vY(e)}constructor(e){this._now=r2e&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},s2e;(t=>{t.None=()=>_1.None;function e(k,X){return d(k,()=>{},0,void 0,!0,void 0,X)}t.defer=e;function n(k){return(X,E=null,N)=>{let j=!1,L;return L=k(V=>{if(!j)return L?L.dispose():j=!0,X.call(E,V)},null,N),j&&L.dispose(),L}}t.once=n;function r(k,X,E){return c((N,j=null,L)=>k(V=>N.call(j,X(V)),null,L),E)}t.map=r;function i(k,X,E){return c((N,j=null,L)=>k(V=>{X(V),N.call(j,V)},null,L),E)}t.forEach=i;function s(k,X,E){return c((N,j=null,L)=>k(V=>X(V)&&N.call(j,V),null,L),E)}t.filter=s;function o(k){return k}t.signal=o;function a(...k){return(X,E=null,N)=>{let j=n2e(...k.map(L=>L(V=>X.call(E,V))));return u(j,N)}}t.any=a;function l(k,X,E,N){let j=E;return r(k,L=>(j=X(j,L),j),N)}t.reduce=l;function c(k,X){let E,N={onWillAddFirstListener(){E=k(j.fire,j)},onDidRemoveLastListener(){E==null||E.dispose()}},j=new cu(N);return X==null||X.add(j),j.event}function u(k,X){return X instanceof Array?X.push(k):X&&X.add(k),k}function d(k,X,E=100,N=!1,j=!1,L,V){let B,q,U,D=0,Z,H={leakWarningThreshold:L,onWillAddFirstListener(){B=k(te=>{D++,q=X(q,te),N&&!U&&(K.fire(q),q=void 0),Z=()=>{let le=q;q=void 0,U=void 0,(!N||D>1)&&K.fire(le),D=0},typeof E=="number"?(clearTimeout(U),U=setTimeout(Z,E)):U===void 0&&(U=0,queueMicrotask(Z))})},onWillRemoveListener(){j&&D>0&&(Z==null||Z())},onDidRemoveLastListener(){Z=void 0,B.dispose()}},K=new cu(H);return V==null||V.add(K),K.event}t.debounce=d;function h(k,X=0,E){return t.debounce(k,(N,j)=>N?(N.push(j),N):[j],X,void 0,!0,void 0,E)}t.accumulate=h;function p(k,X=(N,j)=>N===j,E){let N=!0,j;return s(k,L=>{let V=N||!X(L,j);return N=!1,j=L,V},E)}t.latch=p;function g(k,X,E){return[t.filter(k,X,E),t.filter(k,N=>!X(N),E)]}t.split=g;function v(k,X=!1,E=[],N){let j=E.slice(),L=k(q=>{j?j.push(q):B.fire(q)});N&&N.add(L);let V=()=>{j==null||j.forEach(q=>B.fire(q)),j=null},B=new cu({onWillAddFirstListener(){L||(L=k(q=>B.fire(q)),N&&N.add(L))},onDidAddFirstListener(){j&&(X?setTimeout(V):V())},onDidRemoveLastListener(){L&&L.dispose(),L=null}});return N&&N.add(B),B.event}t.buffer=v;function $(k,X){return(E,N,j)=>{let L=X(new _);return k(function(V){let B=L.evaluate(V);B!==b&&E.call(N,B)},void 0,j)}}t.chain=$;let b=Symbol("HaltChainable");class _{constructor(){this.steps=[]}map(X){return this.steps.push(X),this}forEach(X){return this.steps.push(E=>(X(E),E)),this}filter(X){return this.steps.push(E=>X(E)?E:b),this}reduce(X,E){let N=E;return this.steps.push(j=>(N=X(N,j),N)),this}latch(X=(E,N)=>E===N){let E=!0,N;return this.steps.push(j=>{let L=E||!X(j,N);return E=!1,N=j,L?j:b}),this}evaluate(X){for(let E of this.steps)if(X=E(X),X===b)break;return X}}function Q(k,X,E=N=>N){let N=(...B)=>V.fire(E(...B)),j=()=>k.on(X,N),L=()=>k.removeListener(X,N),V=new cu({onWillAddFirstListener:j,onDidRemoveLastListener:L});return V.event}t.fromNodeEventEmitter=Q;function x(k,X,E=N=>N){let N=(...B)=>V.fire(E(...B)),j=()=>k.addEventListener(X,N),L=()=>k.removeEventListener(X,N),V=new cu({onWillAddFirstListener:j,onDidRemoveLastListener:L});return V.event}t.fromDOMEventEmitter=x;function w(k){return new Promise(X=>n(k)(X))}t.toPromise=w;function C(k){let X=new cu;return k.then(E=>{X.fire(E)},()=>{X.fire(void 0)}).finally(()=>{X.dispose()}),X.event}t.fromPromise=C;function T(k,X){return k(E=>X.fire(E))}t.forward=T;function z(k,X,E){return X(E),k(N=>X(N))}t.runAndSubscribe=z;class R{constructor(X,E){this._observable=X,this._counter=0,this._hasChanged=!1;let N={onWillAddFirstListener:()=>{X.addObserver(this)},onDidRemoveLastListener:()=>{X.removeObserver(this)}};this.emitter=new cu(N),E&&E.add(this.emitter)}beginUpdate(X){this._counter++}handlePossibleChange(X){}handleChange(X,E){this._hasChanged=!0}endUpdate(X){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function W(k,X){return new R(k,X).emitter.event}t.fromObservable=W;function I(k){return(X,E,N)=>{let j=0,L=!1,V={beginUpdate(){j++},endUpdate(){j--,j===0&&(k.reportChanges(),L&&(L=!1,X.call(E)))},handlePossibleChange(){},handleChange(){L=!0}};k.addObserver(V),k.reportChanges();let B={dispose(){k.removeObserver(V)}};return N instanceof w5?N.add(B):Array.isArray(N)&&N.push(B),B}}t.fromObservableLight=I})(s2e||(s2e={}));var pC=class mC{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${mC._idPool++}`,mC.all.add(this)}start(e){this._stopWatch=new i2e,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};pC.all=new Set,pC._idPool=0;var o2e=pC,a2e=-1,$Y=class SY{constructor(e,n,r=(SY._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){var e;(e=this._stacks)==null||e.clear()}check(e,n){let r=this.threshold;if(r<=0||n<r)return;this._stacks||(this._stacks=new Map);let i=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,i+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;let[s,o]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${o}):`;console.warn(a),console.warn(s);let l=new u2e(a,s);this._errorHandler(l)}return()=>{let s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,n=0;for(let[r,i]of this._stacks)(!e||n<i)&&(e=[r,i],n=i);return e}};$Y._idPool=1;var l2e=$Y,c2e=class bY{constructor(e){this.value=e}static create(){let e=new Error;return new bY(e.stack??"")}print(){console.warn(this.value.split(`
|
|
647
647
|
`).slice(2).join(`
|
|
648
|
-
`))}},u2e=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},d2e=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},O2e=0,jQ=class{constructor(t){this.value=t,this.id=O2e++}},h2e=2,f2e,cu=class{constructor(e){var n,r,i,s;this._size=0,this._options=e,this._leakageMon=(n=this._options)!=null&&n.leakWarningThreshold?new l2e((e==null?void 0:e.onListenerError)??NQ,((r=this._options)==null?void 0:r.leakWarningThreshold)??a2e):void 0,this._perfMon=(i=this._options)!=null&&i._profName?new o2e(this._options._profName):void 0,this._deliveryQueue=(s=this._options)==null?void 0:s.deliveryQueue}dispose(){var e,n,r,i;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(r=(n=this._options)==null?void 0:n.onDidRemoveLastListener)==null||r.call(n),(i=this._leakageMon)==null||i.dispose())}get event(){return this._event??(this._event=(e,n,r)=>{var a,l,c,u,d;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let h=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(h);let p=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],g=new d2e(`${h}. HINT: Stack shows most frequent listener (${p[1]}-times)`,p[0]);return(((a=this._options)==null?void 0:a.onListenerError)||NQ)(g),_1.None}if(this._disposed)return _1.None;n&&(e=e.bind(n));let i=new jQ(e),s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=c2e.create(),s=this._leakageMon.check(i.stack,this._size+1)),this._listeners?this._listeners instanceof jQ?(this._deliveryQueue??(this._deliveryQueue=new p2e),this._listeners=[this._listeners,i]):this._listeners.push(i):((c=(l=this._options)==null?void 0:l.onWillAddFirstListener)==null||c.call(l,this),this._listeners=i,(d=(u=this._options)==null?void 0:u.onDidAddFirstListener)==null||d.call(u,this)),this._size++;let o=pY(()=>{s==null||s(),this._removeListener(i)});return r instanceof w5?r.add(o):Array.isArray(r)&&r.push(o),o}),this._event}_removeListener(e){var s,o,a,l;if((o=(s=this._options)==null?void 0:s.onWillRemoveListener)==null||o.call(s,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(l=(a=this._options)==null?void 0:a.onDidRemoveLastListener)==null||l.call(a,this),this._size=0;return}let n=this._listeners,r=n.indexOf(e);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[r]=void 0;let i=this._deliveryQueue.current===this;if(this._size*h2e<=n.length){let c=0;for(let u=0;u<n.length;u++)n[u]?n[c++]=n[u]:i&&(this._deliveryQueue.end--,c<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=c}}_deliver(e,n){var i;if(!e)return;let r=((i=this._options)==null?void 0:i.onListenerError)||NQ;if(!r){e.value(n);return}try{e.value(n)}catch(s){r(s)}}_deliverQueue(e){let n=e.current._listeners;for(;e.i<e.end;)this._deliver(n[e.i++],e.value);e.reset()}fire(e){var n,r,i,s;if((n=this._deliveryQueue)!=null&&n.current&&(this._deliverQueue(this._deliveryQueue),(r=this._perfMon)==null||r.stop()),(i=this._perfMon)==null||i.start(this._size),this._listeners)if(this._listeners instanceof jQ)this._deliver(this._listeners,e);else{let o=this._deliveryQueue;o.enqueue(this,e,this._listeners.length),this._deliverQueue(o)}(s=this._perfMon)==null||s.stop()}hasListeners(){return this._size>0}},p2e=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,n){this.i=0,this.end=n,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Q1=class g${constructor(){this._providers=Object.create(null),this._active="",this._onChange=new cu,this.onChange=this._onChange.event;let e=new GCe;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!==0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,n,r=!1){return(e&16777215)<<3|(n&3)<<1|(r?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let n=0,r=0,i=e.length;for(let s=0;s<i;++s){let o=e.charCodeAt(s);if(55296<=o&&o<=56319){if(++s>=i)return n+this.wcwidth(o);let c=e.charCodeAt(s);56320<=c&&c<=57343?o=(o-55296)*1024+c-56320+65536:n+=this.wcwidth(c)}let a=this.charProperties(o,r),l=g$.extractWidth(a);g$.extractShouldJoin(a)&&(l-=g$.extractWidth(r)),n+=l,r=a}return n}charProperties(e,n){return this._activeProvider.charProperties(e,n)}},IQ=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],m2e=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],LQ=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],g2e=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],lc;function wz(t,e){let n=0,r=e.length-1,i;if(t<e[0][0]||t>e[r][1])return!1;for(;r>=n;)if(i=n+r>>1,t>e[i][1])n=i+1;else if(t<e[i][0])r=i-1;else return!0;return!1}var v2e=class{constructor(){if(this.version="11",!lc){lc=new Uint8Array(65536),lc.fill(1),lc[0]=0,lc.fill(0,1,32),lc.fill(0,127,160);for(let t=0;t<IQ.length;++t)lc.fill(0,IQ[t][0],IQ[t][1]+1);for(let t=0;t<LQ.length;++t)lc.fill(2,LQ[t][0],LQ[t][1]+1)}}wcwidth(t){return t<32?0:t<127?1:t<65536?lc[t]:wz(t,m2e)?0:wz(t,g2e)?2:1}charProperties(t,e){let n=this.wcwidth(t),r=n===0&&e!==0;if(r){let i=Q1.extractWidth(e);i===0?r=!1:i>n&&(n=i)}return Q1.createPropertyValue(0,n,r)}},$2e=class{activate(t){t.unicode.register(new v2e)}dispose(){}};const S2e="_terminalPanel_jipsg_1",b2e="_terminalContainer_jipsg_8",y2e="_virtualKeybar_jipsg_16",_2e="_virtualKey_jipsg_16",Q2e="_virtualKeyPressed_jipsg_47",WO={terminalPanel:S2e,terminalContainer:b2e,virtualKeybar:y2e,virtualKey:_2e,virtualKeyPressed:Q2e},x2e=[{label:"↑",seq:"\x1B[A"},{label:"↓",seq:"\x1B[B"},{label:"←",seq:"\x1B[D"},{label:"→",seq:"\x1B[C"},{label:"Enter",seq:"\r"},{label:"Tab",seq:" "},{label:"Esc",seq:"\x1B"},{label:"Ctrl+C",seq:""}];class yY extends ne.Component{constructor(n){super(n);Rt(this,"handleVirtualKey",n=>{var r,i;if(this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"input",data:n})),Wr){const s=(r=this.containerRef.current)==null?void 0:r.querySelector(".xterm-helper-textarea");s&&s.blur()}else(i=this.terminal)==null||i.focus()});Rt(this,"_vkTouchStart",n=>{n.preventDefault();const r=n.touches[0];this._vkStartX=r.clientX,this._vkStartY=r.clientY,this._vkMoved=!1,this._vkTarget=n.currentTarget,this._vkTarget.classList.add(WO.virtualKeyPressed)});Rt(this,"_vkTouchMove",n=>{if(this._vkMoved)return;const r=n.touches[0],i=r.clientX-this._vkStartX,s=r.clientY-this._vkStartY;i*i+s*s>64&&(this._vkMoved=!0)});Rt(this,"_vkTouchEnd",(n,r)=>{var i;r.preventDefault(),(i=this._vkTarget)==null||i.classList.remove(WO.virtualKeyPressed),this._vkTarget=null,this._vkMoved||this.handleVirtualKey(n)});this.containerRef=ne.createRef(),this.terminal=null,this.fitAddon=null,this.ws=null,this.resizeObserver=null}componentDidMount(){this.initTerminal(),this.connectWebSocket(),this.setupResizeObserver()}componentWillUnmount(){this._stopMobileMomentum&&this._stopMobileMomentum(),this._writeTimer&&cancelAnimationFrame(this._writeTimer),this.ws&&(this.ws.close(),this.ws=null),this._resizeDebounceTimer&&clearTimeout(this._resizeDebounceTimer),this._webglRecoveryTimer&&clearTimeout(this._webglRecoveryTimer),this.resizeObserver&&this.resizeObserver.disconnect(),this.webglAddon&&(this.webglAddon.dispose(),this.webglAddon=null),this.terminal&&this.terminal.dispose()}initTerminal(){this.terminal=new nPe({cursorBlink:!Wr,fontSize:Wr?11:13,fontFamily:'Menlo, Monaco, "Courier New", monospace',theme:{background:"#0a0a0a",foreground:"#d4d4d4",cursor:"#d4d4d4",selectionBackground:"#264f78"},allowProposedApi:!0,scrollback:Wr?2e3:5e3,smoothScrollDuration:0,scrollOnUserInput:!0}),this.fitAddon=new sPe,this.terminal.loadAddon(this.fitAddon),this.terminal.loadAddon(new qCe);const n=new $2e;this.terminal.loadAddon(n),this.terminal.unicode.activeVersion="11",this.terminal.open(this.containerRef.current),this._loadWebglAddon(!1),this._writeBuffer="",this._writeTimer=null,requestAnimationFrame(Wr?()=>{this._mobileFixedResize()}:()=>{this.fitAddon.fit(),this.terminal.focus()}),this.terminal.onData(r=>{this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"input",data:r}))}),Wr&&this._setupMobileTouchScroll()}_setupMobileTouchScroll(){var g;const n=(g=this.containerRef.current)==null?void 0:g.querySelector(".xterm-screen");if(!n)return;const r=this.terminal,i=()=>{var $,b,_,Q;const v=(Q=(_=(b=($=r._core)==null?void 0:$._renderService)==null?void 0:b.dimensions)==null?void 0:_.css)==null?void 0:Q.cell;return(v==null?void 0:v.height)||15};let s=0,o=0,a=null,l=0,c=0,u=null,d=[];const h=()=>{a&&(cancelAnimationFrame(a),a=null),u&&(cancelAnimationFrame(u),u=null),c=0,l=0},p=()=>{if(u=null,c===0)return;l+=c,c=0;const v=i(),$=Math.trunc(l/v);$!==0&&(r.scrollLines($),l-=$*v)};n.addEventListener("touchstart",v=>{h(),v.touches.length===1&&(s=v.touches[0].clientY,o=performance.now(),d=[])},{passive:!0}),n.addEventListener("touchmove",v=>{if(v.touches.length!==1)return;const $=v.touches[0].clientY,b=performance.now(),_=b-o,Q=s-$;if(_>0){const x=Q/_*16;for(d.push({v:x,t:b});d.length>0&&b-d[0].t>100;)d.shift()}c+=Q,u||(u=requestAnimationFrame(p)),s=$,o=b},{passive:!0}),n.addEventListener("touchend",()=>{if(u&&(cancelAnimationFrame(u),u=null),c!==0){l+=c,c=0;const Q=i(),x=Math.trunc(l/Q);x!==0&&r.scrollLines(x),l=0}let v=0;if(d.length>=2){let Q=0,x=0;const w=d[d.length-1].t;for(const C of d){const T=Math.max(0,1-(w-C.t)/100);x+=C.v*T,Q+=T}v=Q>0?x/Q:0}if(d=[],Math.abs(v)<.5)return;const $=.95;let b=0;const _=()=>{if(Math.abs(v)<.3){const w=i(),C=Math.round(b/w);C!==0&&r.scrollLines(C),a=null;return}b+=v;const Q=i(),x=Math.trunc(b/Q);x!==0&&(r.scrollLines(x),b-=x*Q),v*=$,a=requestAnimationFrame(_)};a=requestAnimationFrame(_)},{passive:!0}),this._stopMobileMomentum=h}connectWebSocket(){const r=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`;this.ws=new WebSocket(r),this.ws.onmessage=i=>{try{const s=JSON.parse(i.data);s.type==="data"?this._throttledWrite(s.data):s.type==="exit"?(this._flushWrite(),this.terminal.write(`\r
|
|
648
|
+
`))}},u2e=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},d2e=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},O2e=0,jQ=class{constructor(t){this.value=t,this.id=O2e++}},h2e=2,f2e,cu=class{constructor(e){var n,r,i,s;this._size=0,this._options=e,this._leakageMon=(n=this._options)!=null&&n.leakWarningThreshold?new l2e((e==null?void 0:e.onListenerError)??NQ,((r=this._options)==null?void 0:r.leakWarningThreshold)??a2e):void 0,this._perfMon=(i=this._options)!=null&&i._profName?new o2e(this._options._profName):void 0,this._deliveryQueue=(s=this._options)==null?void 0:s.deliveryQueue}dispose(){var e,n,r,i;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(r=(n=this._options)==null?void 0:n.onDidRemoveLastListener)==null||r.call(n),(i=this._leakageMon)==null||i.dispose())}get event(){return this._event??(this._event=(e,n,r)=>{var a,l,c,u,d;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let h=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(h);let p=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],g=new d2e(`${h}. HINT: Stack shows most frequent listener (${p[1]}-times)`,p[0]);return(((a=this._options)==null?void 0:a.onListenerError)||NQ)(g),_1.None}if(this._disposed)return _1.None;n&&(e=e.bind(n));let i=new jQ(e),s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=c2e.create(),s=this._leakageMon.check(i.stack,this._size+1)),this._listeners?this._listeners instanceof jQ?(this._deliveryQueue??(this._deliveryQueue=new p2e),this._listeners=[this._listeners,i]):this._listeners.push(i):((c=(l=this._options)==null?void 0:l.onWillAddFirstListener)==null||c.call(l,this),this._listeners=i,(d=(u=this._options)==null?void 0:u.onDidAddFirstListener)==null||d.call(u,this)),this._size++;let o=pY(()=>{s==null||s(),this._removeListener(i)});return r instanceof w5?r.add(o):Array.isArray(r)&&r.push(o),o}),this._event}_removeListener(e){var s,o,a,l;if((o=(s=this._options)==null?void 0:s.onWillRemoveListener)==null||o.call(s,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(l=(a=this._options)==null?void 0:a.onDidRemoveLastListener)==null||l.call(a,this),this._size=0;return}let n=this._listeners,r=n.indexOf(e);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[r]=void 0;let i=this._deliveryQueue.current===this;if(this._size*h2e<=n.length){let c=0;for(let u=0;u<n.length;u++)n[u]?n[c++]=n[u]:i&&(this._deliveryQueue.end--,c<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=c}}_deliver(e,n){var i;if(!e)return;let r=((i=this._options)==null?void 0:i.onListenerError)||NQ;if(!r){e.value(n);return}try{e.value(n)}catch(s){r(s)}}_deliverQueue(e){let n=e.current._listeners;for(;e.i<e.end;)this._deliver(n[e.i++],e.value);e.reset()}fire(e){var n,r,i,s;if((n=this._deliveryQueue)!=null&&n.current&&(this._deliverQueue(this._deliveryQueue),(r=this._perfMon)==null||r.stop()),(i=this._perfMon)==null||i.start(this._size),this._listeners)if(this._listeners instanceof jQ)this._deliver(this._listeners,e);else{let o=this._deliveryQueue;o.enqueue(this,e,this._listeners.length),this._deliverQueue(o)}(s=this._perfMon)==null||s.stop()}hasListeners(){return this._size>0}},p2e=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,n){this.i=0,this.end=n,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Q1=class g${constructor(){this._providers=Object.create(null),this._active="",this._onChange=new cu,this.onChange=this._onChange.event;let e=new GCe;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!==0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,n,r=!1){return(e&16777215)<<3|(n&3)<<1|(r?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let n=0,r=0,i=e.length;for(let s=0;s<i;++s){let o=e.charCodeAt(s);if(55296<=o&&o<=56319){if(++s>=i)return n+this.wcwidth(o);let c=e.charCodeAt(s);56320<=c&&c<=57343?o=(o-55296)*1024+c-56320+65536:n+=this.wcwidth(c)}let a=this.charProperties(o,r),l=g$.extractWidth(a);g$.extractShouldJoin(a)&&(l-=g$.extractWidth(r)),n+=l,r=a}return n}charProperties(e,n){return this._activeProvider.charProperties(e,n)}},IQ=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],m2e=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],LQ=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],g2e=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],lc;function wz(t,e){let n=0,r=e.length-1,i;if(t<e[0][0]||t>e[r][1])return!1;for(;r>=n;)if(i=n+r>>1,t>e[i][1])n=i+1;else if(t<e[i][0])r=i-1;else return!0;return!1}var v2e=class{constructor(){if(this.version="11",!lc){lc=new Uint8Array(65536),lc.fill(1),lc[0]=0,lc.fill(0,1,32),lc.fill(0,127,160);for(let t=0;t<IQ.length;++t)lc.fill(0,IQ[t][0],IQ[t][1]+1);for(let t=0;t<LQ.length;++t)lc.fill(2,LQ[t][0],LQ[t][1]+1)}}wcwidth(t){return t<32?0:t<127?1:t<65536?lc[t]:wz(t,m2e)?0:wz(t,g2e)?2:1}charProperties(t,e){let n=this.wcwidth(t),r=n===0&&e!==0;if(r){let i=Q1.extractWidth(e);i===0?r=!1:i>n&&(n=i)}return Q1.createPropertyValue(0,n,r)}},$2e=class{activate(t){t.unicode.register(new v2e)}dispose(){}};const S2e="_terminalPanel_jipsg_1",b2e="_terminalContainer_jipsg_8",y2e="_virtualKeybar_jipsg_16",_2e="_virtualKey_jipsg_16",Q2e="_virtualKeyPressed_jipsg_47",WO={terminalPanel:S2e,terminalContainer:b2e,virtualKeybar:y2e,virtualKey:_2e,virtualKeyPressed:Q2e},x2e=[{label:"↑",seq:"\x1B[A"},{label:"↓",seq:"\x1B[B"},{label:"←",seq:"\x1B[D"},{label:"→",seq:"\x1B[C"},{label:"Enter",seq:"\r"},{label:"Tab",seq:" "},{label:"Esc",seq:"\x1B"},{label:"Ctrl+C",seq:""}];class yY extends ne.Component{constructor(n){super(n);Rt(this,"_handlePaste",n=>{var i,s,o;if((s=(i=this.terminal)==null?void 0:i.modes)!=null&&s.bracketedPasteMode)return;const r=(o=n.clipboardData)==null?void 0:o.getData("text");if(!(!r||!this.ws||this.ws.readyState!==WebSocket.OPEN)&&(r.includes(`
|
|
649
|
+
`)||r.includes("\r"))){n.preventDefault(),n.stopPropagation();const a=`\x1B[200~${r}\x1B[201~`;this.ws.send(JSON.stringify({type:"input",data:a}))}});Rt(this,"handleVirtualKey",n=>{var r,i;if(this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"input",data:n})),Wr){const s=(r=this.containerRef.current)==null?void 0:r.querySelector(".xterm-helper-textarea");s&&s.blur()}else(i=this.terminal)==null||i.focus()});Rt(this,"_vkTouchStart",n=>{n.preventDefault();const r=n.touches[0];this._vkStartX=r.clientX,this._vkStartY=r.clientY,this._vkMoved=!1,this._vkTarget=n.currentTarget,this._vkTarget.classList.add(WO.virtualKeyPressed)});Rt(this,"_vkTouchMove",n=>{if(this._vkMoved)return;const r=n.touches[0],i=r.clientX-this._vkStartX,s=r.clientY-this._vkStartY;i*i+s*s>64&&(this._vkMoved=!0)});Rt(this,"_vkTouchEnd",(n,r)=>{var i;r.preventDefault(),(i=this._vkTarget)==null||i.classList.remove(WO.virtualKeyPressed),this._vkTarget=null,this._vkMoved||this.handleVirtualKey(n)});this.containerRef=ne.createRef(),this.terminal=null,this.fitAddon=null,this.ws=null,this.resizeObserver=null}componentDidMount(){this.initTerminal(),this.connectWebSocket(),this.setupResizeObserver()}componentWillUnmount(){this._stopMobileMomentum&&this._stopMobileMomentum(),this._writeTimer&&cancelAnimationFrame(this._writeTimer),this.ws&&(this.ws.close(),this.ws=null),this._resizeDebounceTimer&&clearTimeout(this._resizeDebounceTimer),this._webglRecoveryTimer&&clearTimeout(this._webglRecoveryTimer),this.resizeObserver&&this.resizeObserver.disconnect(),this.webglAddon&&(this.webglAddon.dispose(),this.webglAddon=null),this.terminal&&(this.terminal.textarea&&this.terminal.textarea.removeEventListener("paste",this._handlePaste,!0),this.terminal.dispose())}initTerminal(){this.terminal=new nPe({cursorBlink:!Wr,fontSize:Wr?11:13,fontFamily:'Menlo, Monaco, "Courier New", monospace',theme:{background:"#0a0a0a",foreground:"#d4d4d4",cursor:"#d4d4d4",selectionBackground:"#264f78"},allowProposedApi:!0,scrollback:Wr?2e3:5e3,smoothScrollDuration:0,scrollOnUserInput:!0}),this.fitAddon=new sPe,this.terminal.loadAddon(this.fitAddon),this.terminal.loadAddon(new qCe);const n=new $2e;this.terminal.loadAddon(n),this.terminal.unicode.activeVersion="11",this.terminal.open(this.containerRef.current),this._loadWebglAddon(!1),this._writeBuffer="",this._writeTimer=null,requestAnimationFrame(Wr?()=>{this._mobileFixedResize()}:()=>{this.fitAddon.fit(),this.terminal.focus()}),this.terminal.onData(r=>{this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"input",data:r}))}),this.terminal.textarea&&this.terminal.textarea.addEventListener("paste",this._handlePaste,!0),Wr&&this._setupMobileTouchScroll()}_setupMobileTouchScroll(){var g;const n=(g=this.containerRef.current)==null?void 0:g.querySelector(".xterm-screen");if(!n)return;const r=this.terminal,i=()=>{var $,b,_,Q;const v=(Q=(_=(b=($=r._core)==null?void 0:$._renderService)==null?void 0:b.dimensions)==null?void 0:_.css)==null?void 0:Q.cell;return(v==null?void 0:v.height)||15};let s=0,o=0,a=null,l=0,c=0,u=null,d=[];const h=()=>{a&&(cancelAnimationFrame(a),a=null),u&&(cancelAnimationFrame(u),u=null),c=0,l=0},p=()=>{if(u=null,c===0)return;l+=c,c=0;const v=i(),$=Math.trunc(l/v);$!==0&&(r.scrollLines($),l-=$*v)};n.addEventListener("touchstart",v=>{h(),v.touches.length===1&&(s=v.touches[0].clientY,o=performance.now(),d=[])},{passive:!0}),n.addEventListener("touchmove",v=>{if(v.touches.length!==1)return;const $=v.touches[0].clientY,b=performance.now(),_=b-o,Q=s-$;if(_>0){const x=Q/_*16;for(d.push({v:x,t:b});d.length>0&&b-d[0].t>100;)d.shift()}c+=Q,u||(u=requestAnimationFrame(p)),s=$,o=b},{passive:!0}),n.addEventListener("touchend",()=>{if(u&&(cancelAnimationFrame(u),u=null),c!==0){l+=c,c=0;const Q=i(),x=Math.trunc(l/Q);x!==0&&r.scrollLines(x),l=0}let v=0;if(d.length>=2){let Q=0,x=0;const w=d[d.length-1].t;for(const C of d){const T=Math.max(0,1-(w-C.t)/100);x+=C.v*T,Q+=T}v=Q>0?x/Q:0}if(d=[],Math.abs(v)<.5)return;const $=.95;let b=0;const _=()=>{if(Math.abs(v)<.3){const w=i(),C=Math.round(b/w);C!==0&&r.scrollLines(C),a=null;return}b+=v;const Q=i(),x=Math.trunc(b/Q);x!==0&&(r.scrollLines(x),b-=x*Q),v*=$,a=requestAnimationFrame(_)};a=requestAnimationFrame(_)},{passive:!0}),this._stopMobileMomentum=h}connectWebSocket(){const r=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`;this.ws=new WebSocket(r),this.ws.onmessage=i=>{try{const s=JSON.parse(i.data);s.type==="data"?this._throttledWrite(s.data):s.type==="exit"?(this._flushWrite(),this.terminal.write(`\r
|
|
649
650
|
\x1B[33m${de("ui.terminal.exited",{code:s.exitCode??"?"})}\x1B[0m\r
|
|
650
651
|
`),this.terminal.write(`\x1B[90m${de("ui.terminal.pressEnterForShell")}\x1B[0m\r
|
|
651
652
|
`)):s.type==="editor-open"?this.props.onEditorOpen&&this.props.onEditorOpen(s.sessionId,s.filePath):s.type==="state"&&!s.running&&s.exitCode!==null&&(this._flushWrite(),this.terminal.write(`\x1B[33m${de("ui.terminal.exited",{code:s.exitCode})}\x1B[0m\r
|
|
@@ -687,7 +688,7 @@ void main() {
|
|
|
687
688
|
\${}
|
|
688
689
|
} else {
|
|
689
690
|
\${}
|
|
690
|
-
}`,{label:"if",detail:"/ else block",type:"keyword"}),Dn('import ${name} "${module}"\n${}',{label:"import",detail:"declaration",type:"keyword"})],eN=new mb,KD=new Set(["SourceFile","Block","FunctionDecl","MethodDecl","FunctionLiteral","ForStatement","SwitchStatement","TypeSwitchStatement","IfStatement"]);function YO(t,e){return(n,r)=>{e:for(let i=n.node.firstChild,s=0,o=null;;){for(;!i;){if(!s)break e;s--,i=o.nextSibling,o=o.parent}e&&i.name==e||i.name=="SpecList"?(s++,o=i,i=i.firstChild):(i.name=="DefName"&&r(i,t),i=i.nextSibling)}return!0}}const BIe={FunctionDecl:YO("function"),VarDecl:YO("var","VarSpec"),ConstDecl:YO("constant","ConstSpec"),TypeDecl:YO("type","TypeSpec"),ImportDecl:YO("constant","ImportSpec"),Parameter:YO("var"),__proto__:null};function JD(t,e){let n=eN.get(e);if(n)return n;let r=[],i=!0;function s(o,a){let l=t.sliceString(o.from,o.to);r.push({label:l,type:a})}return e.cursor(Or.IncludeAnonymous).iterate(o=>{if(i)i=!1;else if(o.name){let a=BIe[o.name];if(a&&a(o,s)||KD.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of JD(t,o.node))r.push(a);return!1}}),eN.set(e,r),r}const tN=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,eZ=["String","LineComment","BlockComment","DefName","LabelName","FieldName",".","?."],UIe=t=>{let e=pr(t.state).resolveInner(t.pos,-1);if(eZ.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&tN.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)KD.has(i.name)&&(r=r.concat(JD(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:tN}},Yx=Ns.define({name:"go",parser:VIe.configure({props:[uo.add({IfStatement:ki({except:/^\s*({|else\b)/}),LabeledStatement:vb,"SwitchBlock SelectBlock":t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n||r?0:t.unit)},Block:kl({closing:"}"}),BlockComment:()=>null,Statement:ki({except:/^{/})}),Vs.add({"Block SwitchBlock SelectBlock LiteralValue InterfaceType StructType SpecList":Zl,BlockComment(t){return{from:t.from+2,to:t.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case\b|default\b|\})$/}});let qIe=t=>({label:t,type:"keyword"});const DIe="interface struct chan map package go return break continue goto fallthrough else defer range true false nil".split(" ").map(qIe);function ZIe(){let t=YIe.concat(DIe);return new oo(Yx,[Yx.data.of({autocomplete:_b(eZ,zg(t))}),Yx.data.of({autocomplete:UIe})])}const GIe="_fileContentView_ryksq_1",FIe="_editorBanner_ryksq_8",HIe="_header_ryksq_18",KIe="_headerLeft_ryksq_28",JIe="_headerRight_ryksq_36",eLe="_backBtn_ryksq_43",tLe="_filePath_ryksq_64",nLe="_fileSize_ryksq_72",rLe="_saveBtn_ryksq_78",iLe="_saveStatus_ryksq_104",sLe="_saveStatusSaved_ryksq_110",oLe="_saveStatusFailed_ryksq_114",aLe="_contentContainer_ryksq_118",lLe="_editorWrapper_ryksq_127",cLe="_lineNumCol_ryksq_135",uLe="_lineNumRow_ryksq_145",dLe="_editorCol_ryksq_155",OLe="_loading_ryksq_175",hLe="_error_ryksq_185",Ni={fileContentView:GIe,editorBanner:FIe,header:HIe,headerLeft:KIe,headerRight:JIe,backBtn:eLe,filePath:tLe,fileSize:nLe,saveBtn:rLe,saveStatus:iLe,saveStatusSaved:sLe,saveStatusFailed:oLe,contentContainer:aLe,editorWrapper:lLe,lineNumCol:cLe,lineNumRow:uLe,editorCol:dLe,loading:OLe,error:hLe},nN={js:Wp,jsx:Wp,ts:Wp,tsx:Wp,py:q6e,java:H6e,c:AO,cpp:AO,cc:AO,cxx:AO,h:AO,hpp:AO,go:ZIe,rs:Wze,php:IMe,html:M0,htm:M0,xml:M0,svg:M0,json:dNe,yml:CM,yaml:CM,md:YM,markdown:YM,css:Ap,scss:Ap,sass:Ap,less:Ap,sql:mIe};function fLe(t){var n;const e=(n=t.split(".").pop())==null?void 0:n.toLowerCase();return nN[e]?[nN[e]()]:[]}function pLe(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}const mLe=Pt.theme({"&":{backgroundColor:"#0d0d0d",color:"#e0e0e0",height:"100%",overflow:"visible"},".cm-gutters:not(.cm-minimap-gutter)":{display:"none"},"& .cm-scroller":{position:"absolute",inset:"0",fontFamily:"'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace",fontSize:"13px",lineHeight:"1.5"},".cm-minimap-gutter":{background:"#0f0f0f",borderLeft:"1px solid #262626"},".cm-minimap-overlay":{border:"1px solid rgba(128, 144, 178, 0.6)",background:"rgba(95, 110, 145, 0.15)",borderRadius:"2px",transition:"opacity 0.2s ease"},".cm-minimap-gutter:hover .cm-minimap-overlay":{border:"1px solid rgba(128, 144, 178, 0.85)",background:"rgba(95, 110, 145, 0.25)"},".cm-activeLine":{backgroundColor:"
|
|
691
|
+
}`,{label:"if",detail:"/ else block",type:"keyword"}),Dn('import ${name} "${module}"\n${}',{label:"import",detail:"declaration",type:"keyword"})],eN=new mb,KD=new Set(["SourceFile","Block","FunctionDecl","MethodDecl","FunctionLiteral","ForStatement","SwitchStatement","TypeSwitchStatement","IfStatement"]);function YO(t,e){return(n,r)=>{e:for(let i=n.node.firstChild,s=0,o=null;;){for(;!i;){if(!s)break e;s--,i=o.nextSibling,o=o.parent}e&&i.name==e||i.name=="SpecList"?(s++,o=i,i=i.firstChild):(i.name=="DefName"&&r(i,t),i=i.nextSibling)}return!0}}const BIe={FunctionDecl:YO("function"),VarDecl:YO("var","VarSpec"),ConstDecl:YO("constant","ConstSpec"),TypeDecl:YO("type","TypeSpec"),ImportDecl:YO("constant","ImportSpec"),Parameter:YO("var"),__proto__:null};function JD(t,e){let n=eN.get(e);if(n)return n;let r=[],i=!0;function s(o,a){let l=t.sliceString(o.from,o.to);r.push({label:l,type:a})}return e.cursor(Or.IncludeAnonymous).iterate(o=>{if(i)i=!1;else if(o.name){let a=BIe[o.name];if(a&&a(o,s)||KD.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of JD(t,o.node))r.push(a);return!1}}),eN.set(e,r),r}const tN=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,eZ=["String","LineComment","BlockComment","DefName","LabelName","FieldName",".","?."],UIe=t=>{let e=pr(t.state).resolveInner(t.pos,-1);if(eZ.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&tN.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)KD.has(i.name)&&(r=r.concat(JD(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:tN}},Yx=Ns.define({name:"go",parser:VIe.configure({props:[uo.add({IfStatement:ki({except:/^\s*({|else\b)/}),LabeledStatement:vb,"SwitchBlock SelectBlock":t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n||r?0:t.unit)},Block:kl({closing:"}"}),BlockComment:()=>null,Statement:ki({except:/^{/})}),Vs.add({"Block SwitchBlock SelectBlock LiteralValue InterfaceType StructType SpecList":Zl,BlockComment(t){return{from:t.from+2,to:t.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case\b|default\b|\})$/}});let qIe=t=>({label:t,type:"keyword"});const DIe="interface struct chan map package go return break continue goto fallthrough else defer range true false nil".split(" ").map(qIe);function ZIe(){let t=YIe.concat(DIe);return new oo(Yx,[Yx.data.of({autocomplete:_b(eZ,zg(t))}),Yx.data.of({autocomplete:UIe})])}const GIe="_fileContentView_ryksq_1",FIe="_editorBanner_ryksq_8",HIe="_header_ryksq_18",KIe="_headerLeft_ryksq_28",JIe="_headerRight_ryksq_36",eLe="_backBtn_ryksq_43",tLe="_filePath_ryksq_64",nLe="_fileSize_ryksq_72",rLe="_saveBtn_ryksq_78",iLe="_saveStatus_ryksq_104",sLe="_saveStatusSaved_ryksq_110",oLe="_saveStatusFailed_ryksq_114",aLe="_contentContainer_ryksq_118",lLe="_editorWrapper_ryksq_127",cLe="_lineNumCol_ryksq_135",uLe="_lineNumRow_ryksq_145",dLe="_editorCol_ryksq_155",OLe="_loading_ryksq_175",hLe="_error_ryksq_185",Ni={fileContentView:GIe,editorBanner:FIe,header:HIe,headerLeft:KIe,headerRight:JIe,backBtn:eLe,filePath:tLe,fileSize:nLe,saveBtn:rLe,saveStatus:iLe,saveStatusSaved:sLe,saveStatusFailed:oLe,contentContainer:aLe,editorWrapper:lLe,lineNumCol:cLe,lineNumRow:uLe,editorCol:dLe,loading:OLe,error:hLe},nN={js:Wp,jsx:Wp,ts:Wp,tsx:Wp,py:q6e,java:H6e,c:AO,cpp:AO,cc:AO,cxx:AO,h:AO,hpp:AO,go:ZIe,rs:Wze,php:IMe,html:M0,htm:M0,xml:M0,svg:M0,json:dNe,yml:CM,yaml:CM,md:YM,markdown:YM,css:Ap,scss:Ap,sass:Ap,less:Ap,sql:mIe};function fLe(t){var n;const e=(n=t.split(".").pop())==null?void 0:n.toLowerCase();return nN[e]?[nN[e]()]:[]}function pLe(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}const mLe=Pt.theme({"&":{backgroundColor:"#0d0d0d",color:"#e0e0e0",height:"100%",overflow:"visible"},".cm-gutters:not(.cm-minimap-gutter)":{display:"none"},"& .cm-scroller":{position:"absolute",inset:"0",fontFamily:"'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace",fontSize:"13px",lineHeight:"1.5"},".cm-minimap-gutter":{background:"#0f0f0f",borderLeft:"1px solid #262626"},".cm-minimap-overlay":{border:"1px solid rgba(128, 144, 178, 0.6)",background:"rgba(95, 110, 145, 0.15)",borderRadius:"2px",transition:"opacity 0.2s ease"},".cm-minimap-gutter:hover .cm-minimap-overlay":{border:"1px solid rgba(128, 144, 178, 0.85)",background:"rgba(95, 110, 145, 0.25)"},".cm-activeLine":{backgroundColor:"rgba(255, 255, 255, 0.06)"},".cm-cursor":{borderLeftColor:"#e0e0e0"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground":{backgroundColor:"#264f78"}},{dark:!0}),gLe=$f.define([{tag:A.keyword,color:"#ff7b72"},{tag:[A.name,A.deleted,A.character,A.propertyName,A.macroName],color:"#ffa657"},{tag:[A.function(A.variableName),A.labelName],color:"#d2a8ff"},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:"#79c0ff"},{tag:[A.definition(A.name),A.separator],color:"#e0e0e0"},{tag:[A.typeName,A.className,A.number,A.changed,A.annotation,A.modifier,A.self,A.namespace],color:"#ffa657"},{tag:[A.operator,A.operatorKeyword,A.url,A.escape,A.regexp,A.link,A.special(A.string)],color:"#79c0ff"},{tag:[A.meta,A.comment],color:"#8b949e",fontStyle:"italic"},{tag:A.strong,fontWeight:"bold"},{tag:A.emphasis,fontStyle:"italic"},{tag:A.strikethrough,textDecoration:"line-through"},{tag:A.link,color:"#79c0ff",textDecoration:"underline"},{tag:A.heading,fontWeight:"bold",color:"#ffa657"},{tag:[A.atom,A.bool,A.special(A.variableName)],color:"#79c0ff"},{tag:[A.processingInstruction,A.string,A.inserted],color:"#a5d6ff"},{tag:A.invalid,color:"#f85149"}]),vLe=tk(gLe);function $Le({filePath:t,onClose:e,editorSession:n}){const[r,i]=f.useState(null),[s,o]=f.useState(null),[a,l]=f.useState(null),[c,u]=f.useState(0),[d,h]=f.useState(!0),[p,g]=f.useState(null),[v,$]=f.useState(0),b=f.useRef(!0),_=f.useRef(null),Q=f.useRef(null),x=f.useRef(null),w=f.useRef(null),C=f.useRef(null),T=r!==null&&s!==null&&r!==s,z=f.useCallback(async()=>{if(T){g("saving");try{const j=await fetch("/api/file-content",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t,content:s,...n?{editorSession:!0}:{}})});if(!j.ok){const V=await j.json().catch(()=>({}));throw new Error(V.error||`HTTP ${j.status}`)}const L=await j.json();b.current&&(i(s),u(L.size),g("saved"),_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{b.current&&g(null)},2e3))}catch{b.current&&(g("failed"),_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{b.current&&g(null)},3e3))}}},[T,t,s]);Q.current=z;const R=f.useMemo(()=>Pt.updateListener.of(j=>{if(j.geometryChanged||j.viewportChanged){const L=j.view.scrollDOM;x.current&&(x.current.scrollTop=L.scrollTop)}}),[]),W=f.useCallback(j=>{w.current=j;const L=j.scrollDOM,V=()=>{x.current&&(x.current.scrollTop=L.scrollTop)};L.addEventListener("scroll",V),V()},[]),I=f.useCallback(()=>{b.current=!0,i(null),o(null),l(null),h(!0),$(0),fetch(`/api/file-content?path=${encodeURIComponent(t)}${n?"&editorSession=true":""}`).then(j=>j.ok?j.json():j.json().then(L=>{throw new Error(L.error||"Failed to load")}).catch(()=>{throw new Error(`HTTP ${j.status}`)})).then(j=>{b.current&&(i(j.content),o(j.content),u(j.size),$(j.content.split(`
|
|
691
692
|
`).length),h(!1))}).catch(j=>{b.current&&(l(`${de("ui.fileLoadError")}: ${j.message}`),h(!1))})},[t,n]);f.useEffect(()=>(I(),()=>{b.current=!1,_.current&&clearTimeout(_.current)}),[I]);const k=f.useMemo(()=>{const j=[...fLe(t),vLe,R,Jd.of([{key:"Mod-s",run:()=>{var L;return(L=Q.current)==null||L.call(Q),!0}}])];return j.push(Ip.compute(["doc"],L=>({create:V=>({dom:document.createElement("div")}),displayText:"characters",showOverlay:"mouse-over"}))),j},[t,R]),X=f.useCallback(j=>{o(j),$(j.split(`
|
|
692
693
|
`).length)},[]),E=p==="saving"?de("ui.saving"):p==="saved"?de("ui.saved"):p==="failed"?de("ui.saveFailed"):null,N=f.useMemo(()=>{if(v<=0)return null;const j=[];for(let L=1;L<=v;L++)j.push(y.jsx("div",{className:Ni.lineNumRow,children:L},L));return j},[v]);return y.jsxs("div",{className:Ni.fileContentView,children:[n&&y.jsx("div",{className:Ni.editorBanner,children:de("ui.editorSession.banner")}),y.jsxs("div",{className:Ni.header,children:[y.jsxs("div",{className:Ni.headerLeft,children:[y.jsx("button",{className:Ni.backBtn,onClick:e,title:de("ui.backToChat"),children:y.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:y.jsx("polyline",{points:"15 18 9 12 15 6"})})}),y.jsx("span",{className:Ni.filePath,children:t})]}),y.jsxs("div",{className:Ni.headerRight,children:[E&&y.jsx("span",{className:`${Ni.saveStatus} ${p==="failed"?Ni.saveStatusFailed:p==="saved"?Ni.saveStatusSaved:""}`,children:E}),y.jsxs("button",{className:Ni.saveBtn,onClick:z,disabled:!T||p==="saving",title:`${de("ui.save")} (Ctrl+S)`,children:[y.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"}),y.jsx("polyline",{points:"17 21 17 13 7 13 7 21"}),y.jsx("polyline",{points:"7 3 7 8 15 8"})]}),de("ui.save")]}),c>0&&y.jsx("span",{className:Ni.fileSize,children:pLe(c)})]})]}),y.jsxs("div",{className:Ni.contentContainer,children:[a&&y.jsx("div",{className:Ni.error,children:a}),d&&!a&&y.jsx("div",{className:Ni.loading,children:de("ui.loading")}),!d&&r!==null&&y.jsxs("div",{className:Ni.editorWrapper,ref:C,children:[y.jsx("div",{className:Ni.lineNumCol,ref:x,children:N}),y.jsx("div",{className:Ni.editorCol,children:y.jsx(mq,{value:r,height:"100%",theme:mLe,extensions:k,onChange:X,onCreateEditor:W,basicSetup:{lineNumbers:!1,foldGutter:!1,highlightActiveLine:!0,highlightSelectionMatches:!0,bracketMatching:!0,autocompletion:!1}})})]})]})]})}const SLe="_gitChanges_1in24_1",bLe="_header_1in24_12",yLe="_headerTitle_1in24_21",_Le="_collapseBtn_1in24_29",QLe="_changesContainer_1in24_48",xLe="_changeItem_1in24_54",wLe="_changeItemSelected_1in24_71",PLe="_dirItem_1in24_75",CLe="_dirArrow_1in24_86",TLe="_dirName_1in24_95",kLe="_status_1in24_100",RLe="_icon_1in24_109",ELe="_fileName_1in24_118",XLe="_loading_1in24_124",zLe="_error_1in24_130",MLe="_empty_1in24_136",ps={gitChanges:SLe,header:bLe,headerTitle:yLe,collapseBtn:_Le,changesContainer:QLe,changeItem:xLe,changeItemSelected:wLe,dirItem:PLe,dirArrow:CLe,dirName:TLe,status:kLe,icon:RLe,fileName:ELe,loading:XLe,error:zLe,empty:MLe},NLe={M:"#e2c08d",A:"#73c991",D:"#f14c4c",R:"#73c991",C:"#73c991",U:"#e2c08d","?":"#73c991"},jLe={js:"#e8d44d",jsx:"#61dafb",ts:"#3178c6",tsx:"#3178c6",json:"#999",md:"#519aba",css:"#a86fd9",scss:"#cd6799",html:"#e34c26",py:"#3572a5",go:"#00add8",rs:"#dea584"};function ILe(t){const e=t.includes(".")?t.split(".").pop().toLowerCase():"",n=jLe[e]||"#888";return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"1.5",children:[y.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),y.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function LLe(){return y.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"#c09553",stroke:"none",children:y.jsx("path",{d:"M2 6c0-1.1.9-2 2-2h5l2 2h9a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6z"})})}function WLe(t){const e={dirs:{},files:[]};for(const n of t){const r=n.file.split("/");let i=e;for(let s=0;s<r.length-1;s++)i.dirs[r[s]]||(i.dirs[r[s]]={dirs:{},files:[]}),i=i.dirs[r[s]];i.files.push({name:r[r.length-1],status:n.status,fullPath:n.file})}return e}function tZ({name:t,node:e,depth:n,onFileClick:r,selectedFile:i}){const s=Object.keys(e.dirs).sort(),o=[...e.files].sort((a,l)=>a.name.localeCompare(l.name));return y.jsxs(y.Fragment,{children:[t&&y.jsxs("div",{className:ps.dirItem,style:{paddingLeft:8+n*16},children:[y.jsx("span",{className:ps.dirArrow,children:y.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:"rotate(90deg)"},children:y.jsx("polyline",{points:"9 6 15 12 9 18"})})}),y.jsx("span",{className:ps.icon,children:LLe()}),y.jsx("span",{className:ps.dirName,children:t})]}),s.map(a=>y.jsx(tZ,{name:a,node:e.dirs[a],depth:t?n+1:n,onFileClick:r,selectedFile:i},a)),o.map(a=>y.jsxs("div",{className:`${ps.changeItem} ${i===a.fullPath?ps.changeItemSelected:""}`,style:{paddingLeft:8+(t?n+1:n)*16},onClick:()=>r&&r(a.fullPath),children:[y.jsx("span",{className:ps.icon,children:ILe(a.name)}),y.jsx("span",{className:ps.fileName,children:a.name}),y.jsx("span",{className:ps.status,style:{color:NLe[a.status]||"#888"},children:a.status})]},a.fullPath))]})}function ALe({onClose:t,onFileClick:e}){const[n,r]=f.useState(null),[i,s]=f.useState(null),[o,a]=f.useState(!0),[l,c]=f.useState(null),u=f.useRef(!0);return f.useEffect(()=>(u.current=!0,a(!0),fetch(Vn("/api/git-status")).then(d=>d.ok?d.json():Promise.reject()).then(d=>{u.current&&(r(d.changes||[]),a(!1))}).catch(()=>{u.current&&(s("Failed to load git status"),a(!1))}),()=>{u.current=!1}),[]),y.jsxs("div",{className:ps.gitChanges,children:[y.jsxs("div",{className:ps.header,children:[y.jsx("span",{className:ps.headerTitle,children:de("ui.gitChanges")}),y.jsx("button",{className:ps.collapseBtn,onClick:t,title:"Close",children:y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("polyline",{points:"11 17 6 12 11 7"}),y.jsx("polyline",{points:"18 17 13 12 18 7"})]})})]}),y.jsxs("div",{className:ps.changesContainer,children:[o&&y.jsx("div",{className:ps.loading,children:"Loading..."}),i&&y.jsx("div",{className:ps.error,children:i}),!o&&!i&&n&&n.length===0&&y.jsx("div",{className:ps.empty,children:"No changes"}),!o&&!i&&n&&n.length>0&&y.jsx(tZ,{name:"",node:WLe(n),depth:0,onFileClick:d=>{c(d),e&&e(d)},selectedFile:l})]})]})}var Bx,rN;function VLe(){if(rN)return Bx;rN=1;function t(ce){return ce instanceof Map?ce.clear=ce.delete=ce.set=function(){throw new Error("map is read-only")}:ce instanceof Set&&(ce.add=ce.clear=ce.delete=function(){throw new Error("set is read-only")}),Object.freeze(ce),Object.getOwnPropertyNames(ce).forEach(Ce=>{const Ie=ce[Ce],ut=typeof Ie;(ut==="object"||ut==="function")&&!Object.isFrozen(Ie)&&t(Ie)}),ce}class e{constructor(Ce){Ce.data===void 0&&(Ce.data={}),this.data=Ce.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(ce){return ce.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(ce,...Ce){const Ie=Object.create(null);for(const ut in ce)Ie[ut]=ce[ut];return Ce.forEach(function(ut){for(const zt in ut)Ie[zt]=ut[zt]}),Ie}const i="</span>",s=ce=>!!ce.scope,o=(ce,{prefix:Ce})=>{if(ce.startsWith("language:"))return ce.replace("language:","language-");if(ce.includes(".")){const Ie=ce.split(".");return[`${Ce}${Ie.shift()}`,...Ie.map((ut,zt)=>`${ut}${"_".repeat(zt+1)}`)].join(" ")}return`${Ce}${ce}`};class a{constructor(Ce,Ie){this.buffer="",this.classPrefix=Ie.classPrefix,Ce.walk(this)}addText(Ce){this.buffer+=n(Ce)}openNode(Ce){if(!s(Ce))return;const Ie=o(Ce.scope,{prefix:this.classPrefix});this.span(Ie)}closeNode(Ce){s(Ce)&&(this.buffer+=i)}value(){return this.buffer}span(Ce){this.buffer+=`<span class="${Ce}">`}}const l=(ce={})=>{const Ce={children:[]};return Object.assign(Ce,ce),Ce};class c{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(Ce){this.top.children.push(Ce)}openNode(Ce){const Ie=l({scope:Ce});this.add(Ie),this.stack.push(Ie)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(Ce){return this.constructor._walk(Ce,this.rootNode)}static _walk(Ce,Ie){return typeof Ie=="string"?Ce.addText(Ie):Ie.children&&(Ce.openNode(Ie),Ie.children.forEach(ut=>this._walk(Ce,ut)),Ce.closeNode(Ie)),Ce}static _collapse(Ce){typeof Ce!="string"&&Ce.children&&(Ce.children.every(Ie=>typeof Ie=="string")?Ce.children=[Ce.children.join("")]:Ce.children.forEach(Ie=>{c._collapse(Ie)}))}}class u extends c{constructor(Ce){super(),this.options=Ce}addText(Ce){Ce!==""&&this.add(Ce)}startScope(Ce){this.openNode(Ce)}endScope(){this.closeNode()}__addSublanguage(Ce,Ie){const ut=Ce.root;Ie&&(ut.scope=`language:${Ie}`),this.add(ut)}toHTML(){return new a(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function d(ce){return ce?typeof ce=="string"?ce:ce.source:null}function h(ce){return v("(?=",ce,")")}function p(ce){return v("(?:",ce,")*")}function g(ce){return v("(?:",ce,")?")}function v(...ce){return ce.map(Ie=>d(Ie)).join("")}function $(ce){const Ce=ce[ce.length-1];return typeof Ce=="object"&&Ce.constructor===Object?(ce.splice(ce.length-1,1),Ce):{}}function b(...ce){return"("+($(ce).capture?"":"?:")+ce.map(ut=>d(ut)).join("|")+")"}function _(ce){return new RegExp(ce.toString()+"|").exec("").length-1}function Q(ce,Ce){const Ie=ce&&ce.exec(Ce);return Ie&&Ie.index===0}const x=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function w(ce,{joinWith:Ce}){let Ie=0;return ce.map(ut=>{Ie+=1;const zt=Ie;let Ke=d(ut),Ve="";for(;Ke.length>0;){const Le=x.exec(Ke);if(!Le){Ve+=Ke;break}Ve+=Ke.substring(0,Le.index),Ke=Ke.substring(Le.index+Le[0].length),Le[0][0]==="\\"&&Le[1]?Ve+="\\"+String(Number(Le[1])+zt):(Ve+=Le[0],Le[0]==="("&&Ie++)}return Ve}).map(ut=>`(${ut})`).join(Ce)}const C=/\b\B/,T="[a-zA-Z]\\w*",z="[a-zA-Z_]\\w*",R="\\b\\d+(\\.\\d+)?",W="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",I="\\b(0b[01]+)",k="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",X=(ce={})=>{const Ce=/^#![ ]*\//;return ce.binary&&(ce.begin=v(Ce,/.*\b/,ce.binary,/\b.*/)),r({scope:"meta",begin:Ce,end:/$/,relevance:0,"on:begin":(Ie,ut)=>{Ie.index!==0&&ut.ignoreMatch()}},ce)},E={begin:"\\\\[\\s\\S]",relevance:0},N={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[E]},j={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[E]},L={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},V=function(ce,Ce,Ie={}){const ut=r({scope:"comment",begin:ce,end:Ce,contains:[]},Ie);ut.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const zt=b("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return ut.contains.push({begin:v(/[ ]+/,"(",zt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),ut},B=V("//","$"),q=V("/\\*","\\*/"),U=V("#","$"),D={scope:"number",begin:R,relevance:0},Z={scope:"number",begin:W,relevance:0},H={scope:"number",begin:I,relevance:0},K={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[E,{begin:/\[/,end:/\]/,relevance:0,contains:[E]}]},te={scope:"title",begin:T,relevance:0},le={scope:"title",begin:z,relevance:0},ie={begin:"\\.\\s*"+z,relevance:0};var be=Object.freeze({__proto__:null,APOS_STRING_MODE:N,BACKSLASH_ESCAPE:E,BINARY_NUMBER_MODE:H,BINARY_NUMBER_RE:I,COMMENT:V,C_BLOCK_COMMENT_MODE:q,C_LINE_COMMENT_MODE:B,C_NUMBER_MODE:Z,C_NUMBER_RE:W,END_SAME_AS_BEGIN:function(ce){return Object.assign(ce,{"on:begin":(Ce,Ie)=>{Ie.data._beginMatch=Ce[1]},"on:end":(Ce,Ie)=>{Ie.data._beginMatch!==Ce[1]&&Ie.ignoreMatch()}})},HASH_COMMENT_MODE:U,IDENT_RE:T,MATCH_NOTHING_RE:C,METHOD_GUARD:ie,NUMBER_MODE:D,NUMBER_RE:R,PHRASAL_WORDS_MODE:L,QUOTE_STRING_MODE:j,REGEXP_MODE:K,RE_STARTERS_RE:k,SHEBANG:X,TITLE_MODE:te,UNDERSCORE_IDENT_RE:z,UNDERSCORE_TITLE_MODE:le});function fe(ce,Ce){ce.input[ce.index-1]==="."&&Ce.ignoreMatch()}function ae(ce,Ce){ce.className!==void 0&&(ce.scope=ce.className,delete ce.className)}function me(ce,Ce){Ce&&ce.beginKeywords&&(ce.begin="\\b("+ce.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",ce.__beforeBegin=fe,ce.keywords=ce.keywords||ce.beginKeywords,delete ce.beginKeywords,ce.relevance===void 0&&(ce.relevance=0))}function oe(ce,Ce){Array.isArray(ce.illegal)&&(ce.illegal=b(...ce.illegal))}function Oe(ce,Ce){if(ce.match){if(ce.begin||ce.end)throw new Error("begin & end are not supported with match");ce.begin=ce.match,delete ce.match}}function se(ce,Ce){ce.relevance===void 0&&(ce.relevance=1)}const $e=(ce,Ce)=>{if(!ce.beforeMatch)return;if(ce.starts)throw new Error("beforeMatch cannot be used with starts");const Ie=Object.assign({},ce);Object.keys(ce).forEach(ut=>{delete ce[ut]}),ce.keywords=Ie.keywords,ce.begin=v(Ie.beforeMatch,h(Ie.begin)),ce.starts={relevance:0,contains:[Object.assign(Ie,{endsParent:!0})]},ce.relevance=0,delete Ie.beforeMatch},we=["of","and","for","in","not","or","if","then","parent","list","value"],Xe="keyword";function ze(ce,Ce,Ie=Xe){const ut=Object.create(null);return typeof ce=="string"?zt(Ie,ce.split(" ")):Array.isArray(ce)?zt(Ie,ce):Object.keys(ce).forEach(function(Ke){Object.assign(ut,ze(ce[Ke],Ce,Ke))}),ut;function zt(Ke,Ve){Ce&&(Ve=Ve.map(Le=>Le.toLowerCase())),Ve.forEach(function(Le){const Re=Le.split("|");ut[Re[0]]=[Ke,ge(Re[0],Re[1])]})}}function ge(ce,Ce){return Ce?Number(Ce):Qe(ce)?0:1}function Qe(ce){return we.includes(ce.toLowerCase())}const _e={},xe=ce=>{console.error(ce)},Be=(ce,...Ce)=>{console.log(`WARN: ${ce}`,...Ce)},Ge=(ce,Ce)=>{_e[`${ce}/${Ce}`]||(console.log(`Deprecated as of ${ce}. ${Ce}`),_e[`${ce}/${Ce}`]=!0)},ht=new Error;function lt(ce,Ce,{key:Ie}){let ut=0;const zt=ce[Ie],Ke={},Ve={};for(let Le=1;Le<=Ce.length;Le++)Ve[Le+ut]=zt[Le],Ke[Le+ut]=!0,ut+=_(Ce[Le-1]);ce[Ie]=Ve,ce[Ie]._emit=Ke,ce[Ie]._multi=!0}function nt(ce){if(Array.isArray(ce.begin)){if(ce.skip||ce.excludeBegin||ce.returnBegin)throw xe("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ht;if(typeof ce.beginScope!="object"||ce.beginScope===null)throw xe("beginScope must be object"),ht;lt(ce,ce.begin,{key:"beginScope"}),ce.begin=w(ce.begin,{joinWith:""})}}function ct(ce){if(Array.isArray(ce.end)){if(ce.skip||ce.excludeEnd||ce.returnEnd)throw xe("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ht;if(typeof ce.endScope!="object"||ce.endScope===null)throw xe("endScope must be object"),ht;lt(ce,ce.end,{key:"endScope"}),ce.end=w(ce.end,{joinWith:""})}}function je(ce){ce.scope&&typeof ce.scope=="object"&&ce.scope!==null&&(ce.beginScope=ce.scope,delete ce.scope)}function Ne(ce){je(ce),typeof ce.beginScope=="string"&&(ce.beginScope={_wrap:ce.beginScope}),typeof ce.endScope=="string"&&(ce.endScope={_wrap:ce.endScope}),nt(ce),ct(ce)}function Fe(ce){function Ce(Ve,Le){return new RegExp(d(Ve),"m"+(ce.case_insensitive?"i":"")+(ce.unicodeRegex?"u":"")+(Le?"g":""))}class Ie{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Le,Re){Re.position=this.position++,this.matchIndexes[this.matchAt]=Re,this.regexes.push([Re,Le]),this.matchAt+=_(Le)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Le=this.regexes.map(Re=>Re[1]);this.matcherRe=Ce(w(Le,{joinWith:"|"}),!0),this.lastIndex=0}exec(Le){this.matcherRe.lastIndex=this.lastIndex;const Re=this.matcherRe.exec(Le);if(!Re)return null;const Ae=Re.findIndex((et,wt)=>wt>0&&et!==void 0),Me=this.matchIndexes[Ae];return Re.splice(0,Ae),Object.assign(Re,Me)}}class ut{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Le){if(this.multiRegexes[Le])return this.multiRegexes[Le];const Re=new Ie;return this.rules.slice(Le).forEach(([Ae,Me])=>Re.addRule(Ae,Me)),Re.compile(),this.multiRegexes[Le]=Re,Re}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Le,Re){this.rules.push([Le,Re]),Re.type==="begin"&&this.count++}exec(Le){const Re=this.getMatcher(this.regexIndex);Re.lastIndex=this.lastIndex;let Ae=Re.exec(Le);if(this.resumingScanAtSamePosition()&&!(Ae&&Ae.index===this.lastIndex)){const Me=this.getMatcher(0);Me.lastIndex=this.lastIndex+1,Ae=Me.exec(Le)}return Ae&&(this.regexIndex+=Ae.position+1,this.regexIndex===this.count&&this.considerAll()),Ae}}function zt(Ve){const Le=new ut;return Ve.contains.forEach(Re=>Le.addRule(Re.begin,{rule:Re,type:"begin"})),Ve.terminatorEnd&&Le.addRule(Ve.terminatorEnd,{type:"end"}),Ve.illegal&&Le.addRule(Ve.illegal,{type:"illegal"}),Le}function Ke(Ve,Le){const Re=Ve;if(Ve.isCompiled)return Re;[ae,Oe,Ne,$e].forEach(Me=>Me(Ve,Le)),ce.compilerExtensions.forEach(Me=>Me(Ve,Le)),Ve.__beforeBegin=null,[me,oe,se].forEach(Me=>Me(Ve,Le)),Ve.isCompiled=!0;let Ae=null;return typeof Ve.keywords=="object"&&Ve.keywords.$pattern&&(Ve.keywords=Object.assign({},Ve.keywords),Ae=Ve.keywords.$pattern,delete Ve.keywords.$pattern),Ae=Ae||/\w+/,Ve.keywords&&(Ve.keywords=ze(Ve.keywords,ce.case_insensitive)),Re.keywordPatternRe=Ce(Ae,!0),Le&&(Ve.begin||(Ve.begin=/\B|\b/),Re.beginRe=Ce(Re.begin),!Ve.end&&!Ve.endsWithParent&&(Ve.end=/\B|\b/),Ve.end&&(Re.endRe=Ce(Re.end)),Re.terminatorEnd=d(Re.end)||"",Ve.endsWithParent&&Le.terminatorEnd&&(Re.terminatorEnd+=(Ve.end?"|":"")+Le.terminatorEnd)),Ve.illegal&&(Re.illegalRe=Ce(Ve.illegal)),Ve.contains||(Ve.contains=[]),Ve.contains=[].concat(...Ve.contains.map(function(Me){return rt(Me==="self"?Ve:Me)})),Ve.contains.forEach(function(Me){Ke(Me,Re)}),Ve.starts&&Ke(Ve.starts,Le),Re.matcher=zt(Re),Re}if(ce.compilerExtensions||(ce.compilerExtensions=[]),ce.contains&&ce.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return ce.classNameAliases=r(ce.classNameAliases||{}),Ke(ce)}function qe(ce){return ce?ce.endsWithParent||qe(ce.starts):!1}function rt(ce){return ce.variants&&!ce.cachedVariants&&(ce.cachedVariants=ce.variants.map(function(Ce){return r(ce,{variants:null},Ce)})),ce.cachedVariants?ce.cachedVariants:qe(ce)?r(ce,{starts:ce.starts?r(ce.starts):null}):Object.isFrozen(ce)?r(ce):ce}var Ye="11.11.1";class tt extends Error{constructor(Ce,Ie){super(Ce),this.name="HTMLInjectionError",this.html=Ie}}const ft=n,bt=r,on=Symbol("nomatch"),an=7,Dt=function(ce){const Ce=Object.create(null),Ie=Object.create(null),ut=[];let zt=!0;const Ke="Could not find the language '{}', did you forget to load/include a language module?",Ve={disableAutodetect:!0,name:"Plain text",contains:[]};let Le={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:u};function Re(Pe){return Le.noHighlightRe.test(Pe)}function Ae(Pe){let Ze=Pe.className+" ";Ze+=Pe.parentNode?Pe.parentNode.className:"";const pt=Le.languageDetectRe.exec(Ze);if(pt){const Jt=Je(pt[1]);return Jt||(Be(Ke.replace("{}",pt[1])),Be("Falling back to no-highlight mode for this block.",Pe)),Jt?pt[1]:"no-highlight"}return Ze.split(/\s+/).find(Jt=>Re(Jt)||Je(Jt))}function Me(Pe,Ze,pt){let Jt="",kn="";typeof Ze=="object"?(Jt=Pe,pt=Ze.ignoreIllegals,kn=Ze.language):(Ge("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ge("10.7.0",`Please use highlight(code, options) instead.
|
|
693
694
|
https://github.com/highlightjs/highlight.js/issues/2277`),kn=Pe,Jt=Ze),pt===void 0&&(pt=!0);const jn={code:Jt,language:kn};Kt("before:highlight",jn);const _r=jn.result?jn.result:et(jn.language,jn.code,pt);return _r.code=jn.code,Kt("after:highlight",_r),_r}function et(Pe,Ze,pt,Jt){const kn=Object.create(null);function jn(it,kt){return it.keywords[kt]}function _r(){if(!Zt.keywords){er.addText(_t);return}let it=0;Zt.keywordPatternRe.lastIndex=0;let kt=Zt.keywordPatternRe.exec(_t),en="";for(;kt;){en+=_t.substring(it,kt.index);const vn=mr.case_insensitive?kt[0].toLowerCase():kt[0],sr=jn(Zt,vn);if(sr){const[ti,Ec]=sr;if(er.addText(en),en="",kn[vn]=(kn[vn]||0)+1,kn[vn]<=an&&(gn+=Ec),ti.startsWith("_"))en+=kt[0];else{const Xc=mr.classNameAliases[ti]||ti;cr(kt[0],Xc)}}else en+=kt[0];it=Zt.keywordPatternRe.lastIndex,kt=Zt.keywordPatternRe.exec(_t)}en+=_t.substring(it),er.addText(en)}function Nr(){if(_t==="")return;let it=null;if(typeof Zt.subLanguage=="string"){if(!Ce[Zt.subLanguage]){er.addText(_t);return}it=et(Zt.subLanguage,_t,!0,Zr[Zt.subLanguage]),Zr[Zt.subLanguage]=it._top}else it=Ct(_t,Zt.subLanguage.length?Zt.subLanguage:null);Zt.relevance>0&&(gn+=it.relevance),er.__addSublanguage(it._emitter,it.language)}function lr(){Zt.subLanguage!=null?Nr():_r(),_t=""}function cr(it,kt){it!==""&&(er.startScope(kt),er.addText(it),er.endScope())}function Jr(it,kt){let en=1;const vn=kt.length-1;for(;en<=vn;){if(!it._emit[en]){en++;continue}const sr=mr.classNameAliases[it[en]]||it[en],ti=kt[en];sr?cr(ti,sr):(_t=ti,_r(),_t=""),en++}}function Vr(it,kt){return it.scope&&typeof it.scope=="string"&&er.openNode(mr.classNameAliases[it.scope]||it.scope),it.beginScope&&(it.beginScope._wrap?(cr(_t,mr.classNameAliases[it.beginScope._wrap]||it.beginScope._wrap),_t=""):it.beginScope._multi&&(Jr(it.beginScope,kt),_t="")),Zt=Object.create(it,{parent:{value:Zt}}),Zt}function Xn(it,kt,en){let vn=Q(it.endRe,en);if(vn){if(it["on:end"]){const sr=new e(it);it["on:end"](kt,sr),sr.isMatchIgnored&&(vn=!1)}if(vn){for(;it.endsParent&&it.parent;)it=it.parent;return it}}if(it.endsWithParent)return Xn(it.parent,kt,en)}function It(it){return Zt.matcher.regexIndex===0?(_t+=it[0],1):(gr=!0,0)}function Et(it){const kt=it[0],en=it.rule,vn=new e(en),sr=[en.__beforeBegin,en["on:begin"]];for(const ti of sr)if(ti&&(ti(it,vn),vn.isMatchIgnored))return It(kt);return en.skip?_t+=kt:(en.excludeBegin&&(_t+=kt),lr(),!en.returnBegin&&!en.excludeBegin&&(_t=kt)),Vr(en,it),en.returnBegin?0:kt.length}function zn(it){const kt=it[0],en=Ze.substring(it.index),vn=Xn(Zt,it,en);if(!vn)return on;const sr=Zt;Zt.endScope&&Zt.endScope._wrap?(lr(),cr(kt,Zt.endScope._wrap)):Zt.endScope&&Zt.endScope._multi?(lr(),Jr(Zt.endScope,it)):sr.skip?_t+=kt:(sr.returnEnd||sr.excludeEnd||(_t+=kt),lr(),sr.excludeEnd&&(_t=kt));do Zt.scope&&er.closeNode(),!Zt.skip&&!Zt.subLanguage&&(gn+=Zt.relevance),Zt=Zt.parent;while(Zt!==vn.parent);return vn.starts&&Vr(vn.starts,it),sr.returnEnd?0:kt.length}function Mn(){const it=[];for(let kt=Zt;kt!==mr;kt=kt.parent)kt.scope&&it.unshift(kt.scope);it.forEach(kt=>er.openNode(kt))}let Wn={};function Fn(it,kt){const en=kt&&kt[0];if(_t+=it,en==null)return lr(),0;if(Wn.type==="begin"&&kt.type==="end"&&Wn.index===kt.index&&en===""){if(_t+=Ze.slice(kt.index,kt.index+1),!zt){const vn=new Error(`0 width match regex (${Pe})`);throw vn.languageName=Pe,vn.badRule=Wn.rule,vn}return 1}if(Wn=kt,kt.type==="begin")return Et(kt);if(kt.type==="illegal"&&!pt){const vn=new Error('Illegal lexeme "'+en+'" for mode "'+(Zt.scope||"<unnamed>")+'"');throw vn.mode=Zt,vn}else if(kt.type==="end"){const vn=zn(kt);if(vn!==on)return vn}if(kt.type==="illegal"&&en==="")return _t+=`
|
package/dist/index.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<title>Claude Code Viewer</title>
|
|
7
7
|
<link rel="icon" href="/favicon.ico?v=1">
|
|
8
8
|
<link rel="shortcut icon" href="/favicon.ico?v=1">
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-Bljh1U2F.js"></script>
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/index-DI-cFJZT.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|