2022-11-09 20:26:02 +08:00
var w9 = Object . defineProperty , S9 = Object . defineProperties ; var y9 = Object . getOwnPropertyDescriptors ; var VN = Object . getOwnPropertySymbols ; var L9 = Object . prototype . hasOwnProperty , D9 = Object . prototype . propertyIsEnumerable ; var HN = ( o , e , t ) => e in o ? w9 ( o , e , { enumerable : ! 0 , configurable : ! 0 , writable : ! 0 , value : t } ) : o [ e ] = t , I _ = ( o , e ) => { for ( var t in e || ( e = { } ) ) L9 . call ( e , t ) && HN ( o , t , e [ t ] ) ; if ( VN ) for ( var t of VN ( e ) ) D9 . call ( e , t ) && HN ( o , t , e [ t ] ) ; return o } , E _ = ( o , e ) => S9 ( o , y9 ( e ) ) ; var io = ( o , e , t ) => new Promise ( ( i , n ) => { var s = l => { try { a ( t . next ( l ) ) } catch ( c ) { n ( c ) } } , r = l => { try { a ( t . throw ( l ) ) } catch ( c ) { n ( c ) } } , a = l => l . done ? i ( l . value ) : Promise . resolve ( l . value ) . then ( s , r ) ; a ( ( t = t . apply ( o , e ) ) . next ( ) ) } ) ; import { a as uC } from "./chunk.6424c2fc.js" ; import { bJ as k9 , b as gC , d as vx , m as qR , e as Un , aD as Nd , au as Cx , h as fC , r as ki , w as Ul , o as pC , b6 as GR , q as li , F as Wn , z as y0 , A as si , R as x9 , _ as ZR , as as wx , bK as I9 , bL as E9 , n as Ho , p as Sx , b7 as N9 , v as Nt , E as fd , G as T9 , H as M9 , D as A9 , W as Gb , ae as YR , aA as XR , al as R9 , aC as uy , bM as O9 , S as yx , ag as P9 , c as F9 , bk as zN , b1 as B9 , bN as UN , bA as QR , P as JR , Q as eO , C as L0 , Y as W9 , aF as V9 , az as tO , O as Lx , t as Ka , I as mC , a9 as Dx , av as _C , $ as bC , a1 as iO , y as Xn , a4 as H9 , x as Hr , by as z9 , aN as U9 , a5 as nO , a6 as sO , a7 as Xr , a2 as oO , aa as $N , N as $9 , bO as jN , bP as j9 , aB as N _ , L as K9 , a0 as rO } from "./index.js" ; import { l as q9 } from "./chunk.4a114b4a.js" ; const Gc = o => k9 ( o ) , vC = Symbol ( "tabsRootContextKey" ) , G9 = gC ( { tabs : { type : vx ( Array ) , default : ( ) => qR ( [ ] ) } } ) , Z9 = { name : "ElTabBar" } , Y9 = Un ( E _ ( I _ ( { } , Z9 ) , { props : G9 , setup ( o , { expose : e } ) { const t = o , i = "ElTabBar" , n = wx ( ) , s = Nd ( vC ) ; s || Cx ( i , "<el-tabs><el-tab-bar /></el-tabs>" ) ; const r = fC ( "tabs" ) , a = ki ( ) , l = ki ( ) , c = ( ) => { let h = 0 , u = 0 ; const g = [ "top" , "bottom" ] . includes ( s . props . tabPosition ) ? "width" : "height" , f = g === "width" ? "x" : "y" ; return t . tabs . every ( _ => { var b , v , C , w ; const S = ( v = ( b = n . parent ) == null ? void 0 : b . refs ) == null ? void 0 : v [ ` tab- ${ _ . uid } ` ] ; if ( ! S ) return ! 1 ; if ( ! _ . active ) return ! 0 ; u = S [ ` client ${ Gc ( g ) } ` ] ; const k = f === "x" ? "left" : "top" ; h = S . getBoundingClientRect ( ) [ k ] - ( ( w = ( C = S . parentElement ) == null ? void 0 : C . getBoundingClientRect ( ) [ k ] ) != null ? w : 0 ) ; const x = window . getComputedStyle ( S ) ; return g === "width" && ( t . tabs . length > 1 && ( u -= Number . parseFloat ( x . paddingLeft ) + Number . parseFloat ( x . paddingRight ) ) , h += Number . parseFloat ( x . paddingLeft ) ) , ! 1 } ) , { [ g ] : ` ${ u } px ` , transform : ` translate ${ Gc ( f ) } ( ${ h } px) ` } } , d = ( ) => l . value = c ( ) ; return Ul ( ( ) => t . tabs , ( ) => io ( this , null , function * ( ) { yield pC ( ) , d ( ) } ) , { immediate : ! 0 } ) , GR ( a , ( ) => d ( ) ) , e ( { ref : a , update : d } ) , ( h , u ) => ( li ( ) , Wn ( "div" , { ref _key : "barRef" , ref : a , class : y0 ( [ si ( r ) . e ( "active-bar" ) , si ( r ) . is ( si ( s ) . props . tabPosition ) ] ) , style : x9 ( l . value ) } , null , 6 ) ) } } ) ) ; var X9 = ZR ( Y9 , [ [ "__file" , "/home/runner/work/element-plus/element-plus/packages/components/tabs/src/tab-bar.vue" ] ] ) ; const Q9 = gC ( { panes : { type : vx ( Array ) , default : ( ) => qR ( [ ] ) } , currentName : { type : [ String , Number ] , default : "" } , editable : Boolean , type : { type : String , values : [ "card" , "border-card" , "" ] , default : "" } , stretch : Boolean } ) , J9 = { tabClick : ( o , e , t ) => t instanceof Event , tabRemove : ( o , e ) => e instanceof Event } , KN = "ElTabNav" , e8 = Un ( { name : KN , props : Q9 , emits : J9 , setup ( o , { expose : e , emit : t } ) { const i = wx ( ) , n = Nd ( vC ) ; n || Cx ( KN , "<el-tabs><tab-nav /></el-tabs>" ) ; const s = fC ( "tabs" ) , r = I9 ( ) , a = E9 ( ) , l = ki ( ) , c = ki ( ) , d = ki ( ) , h = ki ( ! 1 ) , u = ki ( 0 ) , g = ki ( ! 1 ) , f = ki ( ! 0 ) , _ = Ho ( ( ) => [ "top" , "bottom" ] . includes ( n . props . tabPosition ) ? "width" : "height" ) , b = Ho ( ( ) => ( { transform : ` translate ${ _ . value === "width" ? "X" : "Y" } (- ${ u . value } px) ` } ) ) , v = ( ) => { if ( ! l . value ) return ; const D = l . value [ ` offset ${ Gc ( _ . value ) } ` ] , I = u . value ; if ( ! I ) return ; const R = I > D ? I - D : 0 ; u . value = R } , C = ( ) => { if ( ! l . value || ! c . value ) return ; const D = c . value [ ` offset ${ Gc ( _ . value ) } ` ] , I = l . value [ ` offset ${ Gc ( _ . value ) } ` ] , R = u . value ; if ( D - R <= I ) return ; const P = D - R > I * 2 ? R + I : D - I ; u . value = P } , w = ( ) => io ( this , null , function * ( ) { const D = c . value ; if ( ! h . value || ! d . value || ! l . value || ! D ) return ; yield pC ( ) ; const I = d . value . querySelector ( ".is-active" ) ; if ( ! I ) return ; const R = l . value , P = [ "top" , "bottom" ] . includes ( n . props . tabPosition ) , H = I . getBoundingClientRect ( ) , $ = R . getBoundingClientRect ( ) , ne = P ? D . offsetWidth - $ . width : D . offsetHeight - $ . height , ae = u . value ; let de = ae ; P ? ( H . left < $ . left && ( de = ae - ( $ . left - H . left ) ) , H . right > $ . right && ( de = ae + H . right - $ . right ) ) : ( H . to
2022-10-26 20:27:06 +08:00
` +e.stack):new Error(e.message+ `
2022-11-09 20:26:02 +08:00
` +e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const dO=new T8;function Ee(o){ol(o)||dO.onUnexpectedError(o)}function Ai(o){ol(o)||dO.onUnexpectedExternalError(o)}function qN(o){if(o instanceof Error){const{name:e,message:t}=o,i=o.stacktrace||o.stack;return{ $ isError:!0,name:e,message:t,stack:i,noTelemetry:Yu.isErrorNoTelemetry(o)}}return o}const D0="Canceled";function ol(o){return o instanceof yc?!0:o instanceof Error&&o.name===D0&&o.message===D0}class yc extends Error{constructor(){super(D0),this.name=this.message}}function hO(){const o=new Error(D0);return o.name=o.message,o}function zo(o){return o?new Error( ` Illegal argument : $ { o } ` ):new Error("Illegal argument")}function M8(o){return o?new Error( ` Illegal state : $ { o } ` ):new Error("Illegal state")}class A8 extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class Yu extends Error{constructor(e){super(e),this.name="ErrorNoTelemetry"}static fromError(e){if(e instanceof Yu)return e;const t=new Yu;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="ErrorNoTelemetry"}}class kx extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,kx.prototype);debugger}}function nc(o){const e=this;let t=!1,i;return function(){return t||(t=!0,i=o.apply(e,arguments)),i}}var Ue;(function(o){function e(S){return S&&typeof S=="object"&&typeof S[Symbol.iterator]=="function"}o.is=e;const t=Object.freeze([]);function i(){return t}o.empty=i;function*n(S){yield S}o.single=n;function s(S){return S||t}o.from=s;function r(S){return!S||S[Symbol.iterator]().next().done===!0}o.isEmpty=r;function a(S){return S[Symbol.iterator]().next().value}o.first=a;function l(S,k){for(const x of S)if(k(x))return!0;return!1}o.some=l;function c(S,k){for(const x of S)if(k(x))return x}o.find=c;function*d(S,k){for(const x of S)k(x)&&(yield x)}o.filter=d;function*h(S,k){let x=0;for(const y of S)yield k(y,x++)}o.map=h;function*u(...S){for(const k of S)for(const x of k)yield x}o.concat=u;function*g(S){for(const k of S)for(const x of k)yield x}o.concatNested=g;function f(S,k,x){let y=x;for(const D of S)y=k(y,D);return y}o.reduce=f;function _(S,k){let x=0;for(const y of S)k(y,x++)}o.forEach=_;function*b(S,k,x=S.length){for(k<0&&(k+=S.length),x<0?x+=S.length:x>S.length&&(x=S.length);k<x;k++)yield S[k]}o.slice=b;function v(S,k=Number.POSITIVE_INFINITY){const x=[];if(k===0)return[x,S];const y=S[Symbol.iterator]();for(let D=0;D<k;D++){const I=y.next();if(I.done)return[x,o.empty()];x.push(I.value)}return[x,{[Symbol.iterator](){return y}}]}o.consume=v;function C(S){return v(S)[0]}o.collect=C;function w(S,k,x=(y,D)=>y===D){const y=S[Symbol.iterator](),D=k[Symbol.iterator]();for(;;){const I=y.next(),R=D.next();if(I.done!==R.done)return!1;if(I.done)return!0;if(!x(I.value,R.value))return!1}}o.equals=w})(Ue||(Ue={}));class R8 extends Error{constructor(e){super( ` Encountered errors while disposing of store . Errors : [ $ { e . join ( ", " ) } ] ` ),this.errors=e}}function xx(o){return typeof o.dispose=="function"&&o.dispose.length===0}function et(o){if(Ue.is(o)){const e=[];for(const t of o)if(t)try{t.dispose()}catch(i){e.push(i)}if(e.length===1)throw e[0];if(e.length>1)throw new R8(e);return Array.isArray(o)?[]:o}else if(o)return o.dispose(),o}function Pr(...o){return ze(()=>et(o))}function ze(o){return{dispose:nc(()=>{o()})}}class ee{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){try{et(this._toDispose.values())}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?ee.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}}ee.DISABLE_DISPOSED_WARNING=!1;class z{con
2022-10-26 20:27:06 +08:00
` ).slice(2).join( `
2022-11-09 20:26:02 +08:00
` ))}}class G8{constructor(e,t,i){this.callback=e,this.callbackThis=t,this.stack=i,this.subscription=new P8}invoke(e){this.callback.call(this.callbackThis,e)}}class O{constructor(e){var t,i;this._disposed=!1,this._options=e,this._leakageMon=void 0,this._perfMon=!((t=this._options)===null||t===void 0)&&t._profName?new CC(this._options._profName):void 0,this._deliveryQueue=(i=this._options)===null||i===void 0?void 0:i.deliveryQueue}dispose(){var e,t,i,n;this._disposed||(this._disposed=!0,this._listeners&&this._listeners.clear(),(e=this._deliveryQueue)===null||e===void 0||e.clear(this),(i=(t=this._options)===null||t===void 0?void 0:t.onLastListenerRemove)===null||i===void 0||i.call(t),(n=this._leakageMon)===null||n===void 0||n.dispose())}get event(){return this._event||(this._event=(e,t,i)=>{var n,s,r;this._listeners||(this._listeners=new wn);const a=this._listeners.isEmpty();a&&((n=this._options)===null||n===void 0?void 0:n.onFirstListenerAdd)&&this._options.onFirstListenerAdd(this);let l,c;this._leakageMon&&this._listeners.size>=30&&(c=Nx.create(),l=this._leakageMon.check(c,this._listeners.size+1));const d=new G8(e,t,c),h=this._listeners.push(d);a&&((s=this._options)===null||s===void 0?void 0:s.onFirstListenerDidAdd)&&this._options.onFirstListenerDidAdd(this),!((r=this._options)===null||r===void 0)&&r.onListenerDidAdd&&this._options.onListenerDidAdd(this,e,t);const u=d.subscription.set(()=>{l==null||l(),this._disposed||(h(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return i instanceof ee?i.add(u):Array.isArray(i)&&i.push(u),u}),this._event}fire(e){var t,i;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new Z8);for(const n of this._listeners)this._deliveryQueue.push(this,n,e);(t=this._perfMon)===null||t===void 0||t.start(this._deliveryQueue.size),this._deliveryQueue.deliver(),(i=this._perfMon)===null||i===void 0||i.stop()}}}class mO{constructor(){this._queue=new wn}get size(){return this._queue.size}push(e,t,i){this._queue.push(new Y8(e,t,i))}clear(e){const t=new wn;for(const i of this._queue)i.emitter!==e&&t.push(i);this._queue=t}deliver(){for(;this._queue.size>0;){const e=this._queue.shift();try{e.listener.invoke(e.event)}catch(t){Ee(t)}}}}class Z8 extends mO{clear(e){this._queue.clear()}}class Y8{constructor(e,t,i){this.emitter=e,this.listener=t,this.event=i}}class I0 extends O{constructor(e){super(e),this._isPaused=0,this._eventQueue=new wn,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._listeners&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class X8 extends I0{constructor(e){var t;super(e),this._delay=(t=e.delay)!==null&&t!==void 0?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class Tx{constructor(){this.buffers=[]}wrapEvent(e){return(t,i,n)=>e(s=>{const r=this.buffers[this.buffers.length-1];r?r.push(()=>t.call(i,s)):t.call(i,s)},void 0,n)}bufferEvents(e){const t=[];this.buffers.push(t);const i=e();return this.buffers.pop(),t.forEach(n=>n()),i}}class YN{constructor(){this.listening=!1,this.inputEvent=pe.None,this.inputEventListener=z.None,this.emitter=new O({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}class gy{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}gy.INSTANCE=new gy;class Q8 extends z{constructor(){super(
2022-10-26 20:27:06 +08:00
* 'to' : A mandatory logical position value providing where to move the cursor .
\ ` \` \`
'left' , 'right' , 'up' , 'down' , 'prevBlankLine' , 'nextBlankLine' ,
'wrappedLineStart' , 'wrappedLineEnd' , 'wrappedLineColumnCenter'
'wrappedLineFirstNonWhitespaceCharacter' , 'wrappedLineLastNonWhitespaceCharacter'
'viewPortTop' , 'viewPortCenter' , 'viewPortBottom' , 'viewPortIfOutside'
\ ` \` \`
* 'by' : Unit to move . Default is computed based on 'to' value .
\ ` \` \`
'line' , 'wrappedLine' , 'character' , 'halfLine'
\ ` \` \`
* 'value' : Number of units to move . Default is '1' .
* 'select' : If 'true' makes the selection . Default is 'false' .
2022-11-09 20:26:02 +08:00
` ,constraint:e,schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},o.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},o.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(i){if(!i.to)return null;let n;switch(i.to){case o.RawDirection.Left:n=0;break;case o.RawDirection.Right:n=1;break;case o.RawDirection.Up:n=2;break;case o.RawDirection.Down:n=3;break;case o.RawDirection.PrevBlankLine:n=4;break;case o.RawDirection.NextBlankLine:n=5;break;case o.RawDirection.WrappedLineStart:n=6;break;case o.RawDirection.WrappedLineFirstNonWhitespaceCharacter:n=7;break;case o.RawDirection.WrappedLineColumnCenter:n=8;break;case o.RawDirection.WrappedLineEnd:n=9;break;case o.RawDirection.WrappedLineLastNonWhitespaceCharacter:n=10;break;case o.RawDirection.ViewPortTop:n=11;break;case o.RawDirection.ViewPortBottom:n=13;break;case o.RawDirection.ViewPortCenter:n=12;break;case o.RawDirection.ViewPortIfOutside:n=14;break;default:return null}let s=0;switch(i.by){case o.RawUnit.Line:s=1;break;case o.RawUnit.WrappedLine:s=2;break;case o.RawUnit.Character:s=3;break;case o.RawUnit.HalfLine:s=4;break}return{direction:n,unit:s,select:!!i.select,value:i.value||1}}o.parse=t})(j0||(j0={}));var oi;(function(o){o[o.None=0]="None",o[o.Indent=1]="Indent",o[o.IndentOutdent=2]="IndentOutdent",o[o.Outdent=3]="Outdent"})(oi||(oi={}));class Lw{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t<i;t++)switch(e.notIn[t]){case"string":this._inString=!1;break;case"comment":this._inComment=!1;break;case"regex":this._inRegEx=!1;break}}isOK(e){switch(e){case 0:return!0;case 1:return this._inComment;case 2:return this._inString;case 3:return this._inRegEx}}shouldAutoClose(e,t){if(e.getTokenCount()===0)return!0;const i=e.findTokenIndexAtOffset(t-2),n=e.getStandardTokenType(i);return this.isOK(n)}_findNeutralCharacterInRange(e,t){for(let i=e;i<=t;i++){const n=String.fromCharCode(i);if(!this.open.includes(n)&&!this.close.includes(n))return n}return null}findNeutralCharacter(){return this._neutralCharacterSearched||(this._neutralCharacterSearched=!0,this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(48,57)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(97,122)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(65,90))),this._neutralCharacter}}class hW{constructor(e){this.autoClosingPairsOpenByStart=new Map,this.autoClosingPairsOpenByEnd=new Map,this.autoClosingPairsCloseByStart=new Map,this.autoClosingPairsCloseByEnd=new Map,this.autoClosingPairsCloseSingleChar=new Map;for(const t of e)cf(this.autoClosingPairsOpenByStart,t.open.charAt(0),t),cf(this.autoClosingPairsOpenByEnd,t.open.charAt(t.open.length-1),t),cf(this.autoClosingPairsCloseByStart,t.close.charAt(0),t),cf(this.autoClosingPairsCloseByEnd,t.close.charAt(t.close.length-1),t),t.close.length===1&&t.open.length===1&&cf(this.autoClosingPairsCloseSingleChar,t.close,t)}}function cf(o,e,t){o.has(e)?o.get(e).pus
` ;function Ts(o,e=0){return o[o.length-(1+e)]}function fW(o){if(o.length===0)throw new Error("Invalid tail call");return[o.slice(0,o.length-1),o[o.length-1]]}function ys(o,e,t=(i,n)=>i===n){if(o===e)return!0;if(!o||!e||o.length!==e.length)return!1;for(let i=0,n=o.length;i<n;i++)if(!t(o[i],e[i]))return!1;return!0}function pW(o,e){const t=o.length-1;e<t&&(o[e]=o[t]),o.pop()}function tI(o,e,t){return mW(o.length,i=>t(o[i],e))}function mW(o,e){let t=0,i=o-1;for(;t<=i;){const n=(t+i)/2|0,s=e(n);if(s<0)t=n+1;else if(s>0)i=n-1;else return n}return-(t+1)}function fP(o,e){let t=0,i=o.length;if(i===0)return 0;for(;t<i;){const n=Math.floor((t+i)/2);e(o[n])?i=n:t=n+1}return t}function Iy(o,e,t){if(o=o|0,o>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],n=[],s=[],r=[];for(const a of e){const l=t(a,i);l<0?n.push(a):l>0?s.push(a):r.push(a)}return o<n.length?Iy(o,n,t):o<n.length+r.length?r[0]:Iy(o-(n.length+r.length),s,t)}function bT(o,e){const t=[];let i;for(const n of o.slice(0).sort(e))!i||e(i[0],n)!==0?(i=[n],t.push(i)):i.push(n);return t}function BC(o){return o.filter(e=>!!e)}function pP(o){return!Array.isArray(o)||o.length===0}function en(o){return Array.isArray(o)&&o.length>0}function el(o,e=t=>t){const t=new Set;return o.filter(i=>{const n=e(i);return t.has(n)?!1:(t.add(n),!0)})}function Ey(o,e){const t=_W(o,e);if(t!==-1)return o[t]}function _W(o,e){for(let t=o.length-1;t>=0;t--){const i=o[t];if(e(i))return t}return-1}function mP(o,e){return o.length>0?o[0]:e}function mn(o,e){let t=typeof e=="number"?o:0;typeof e=="number"?t=o:(t=0,e=o);const i=[];if(t<=e)for(let n=t;n<e;n++)i.push(n);else for(let n=t;n>e;n--)i.push(n);return i}function WC(o,e,t){const i=o.slice(0,e),n=o.slice(e);return i.concat(t,n)}function Dw(o,e){const t=o.indexOf(e);t>-1&&(o.splice(t,1),o.unshift(e))}function W_(o,e){const t=o.indexOf(e);t>-1&&(o.splice(t,1),o.push(e))}function vT(o,e){for(const t of e)o.push(t)}function iI(o){return Array.isArray(o)?o:[o]}function bW(o,e,t){const i=_P(o,e),n=o.length,s=t.length;o.length=n+s;for(let r=n-1;r>=i;r--)o[r+s]=o[r];for(let r=0;r<s;r++)o[r+i]=t[r]}function CT(o,e,t,i){const n=_P(o,e),s=o.splice(n,t);return bW(o,n,i),s}function _P(o,e){return e<0?Math.max(e+o.length,0):Math.min(e,o.length)}var wT;(function(o){function e(n){return n<0}o.isLessThan=e;function t(n){return n>0}o.isGreaterThan=t;function i(n){return n===0}o.isNeitherLessOrGreaterThan=i,o.greaterThan=1,o.lessThan=-1,o.neitherLessOrGreaterThan=0})(wT||(wT={}));function Xf(o,e){return(t,i)=>e(o(t),o(i))}const vW=(o,e)=>o-e;function bP(o,e){if(o.length===0)return;let t=o[0];for(let i=1;i<o.length;i++){const n=o[i];e(n,t)>0&&(t=n)}return t}function vP(o,e){if(o.length===0)return;let t=o[0];for(let i=1;i<o.length;i++){const n=o[i];e(n,t)>=0&&(t=n)}return t}function CW(o,e){return bP(o,(t,i)=>-e(t,i))}class Ap{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;const i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}const ST=typeof Buffer!="undefined";let kw;class VC{constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}static wrap(e){return ST&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new VC(e)}toString(){return ST?this.buffer.toString():(kw||(kw=new TextDecoder),kw.decode(this.buffer))}}function wW(o,e){return o[e+0]<<0>>>0|o[e+1]<<8>>>0}function SW(o,e,t){o[t+0]=e&255,e=e>>>8,o[t+1]=e&255}function xo(o,e){return o[e]*Math.pow(2,24)+o[e+1]*Math.pow(2,16)+o[e+2]*Math.pow(2,8)+o[e+3]}function Io(o,e,t){o
` )!==n.length-1&&(s=!1),s){const h=new L(d.lineNumber,1,d.lineNumber,1);r[a]=new Jx(h,n,c,!0)}else r[a]=new Wi(c,n)}return new En(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _distributePasteToCursors(e,t,i,n,s){if(n||t.length===1)return null;if(s&&s.length===t.length)return s;if(e.multiCursorPaste==="spread"){i.charCodeAt(i.length-1)===10&&(i=i.substr(0,i.length-1)),i.charCodeAt(i.length-1)===13&&(i=i.substr(0,i.length-1));const r=Ur(i);if(r.length===t.length)return r}return null}static paste(e,t,i,n,s,r){const a=this._distributePasteToCursors(e,i,n,s,r);return a?(i=i.sort(L.compareRangesUsingStarts),this._distributedPaste(e,t,i,a)):this._simplePaste(e,t,i,n,s)}static _goodIndentForLine(e,t,i){let n=null,s="";const r= $ C(e.autoIndent,t,i,!1,e.languageConfigurationService);if(r)n=r.action,s=r.indentation;else if(i>1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(Fr(d)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=Nu(e.autoIndent,t,new L(a,l,a,l),e.languageConfigurationService);c&&(s=c.indentation+c.appendText)}return n&&(n===oi.Indent&&(s=Ot.shiftIndent(e,s)),n===oi.Outdent&&(s=Ot.unshiftIndent(e,s)),s=e.normalizeIndentation(s)),s||null}static _replaceJumpToNextIndent(e,t,i,n){let s="";const r=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,r),l=e.indentSize,c=l-a%l;for(let d=0;d<c;d++)s+=" "}else s=" ";return new Wi(i,s,n)}static tab(e,t,i){const n=[];for(let s=0,r=i.length;s<r;s++){const a=i[s];if(a.isEmpty()){const l=t.getLineContent(a.startLineNumber);if(/^ \s * $ /.test(l)&&t.tokenization.isCheapToTokenize(a.startLineNumber)){let c=this._goodIndentForLine(e,t,a.startLineNumber);c=c||" ";const d=e.normalizeIndentation(c);if(!l.startsWith(d)){n[s]=new Wi(new L(a.startLineNumber,1,a.startLineNumber,l.length+1),d,!0);continue}}n[s]=this._replaceJumpToNextIndent(e,t,a,!0)}else{if(a.startLineNumber===a.endLineNumber){const l=t.getLineMaxColumn(a.startLineNumber);if(a.startColumn!==1||a.endColumn!==l){n[s]=this._replaceJumpToNextIndent(e,t,a,!1);continue}}n[s]=new Fs(a,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService)}}return n}static compositionType(e,t,i,n,s,r,a,l){const c=n.map(d=>this._compositionType(i,d,s,r,a,l));return new En(4,c,{shouldPushStackElementBefore:H_(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,s,r){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-n),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+s),d=new L(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(d)===i&&r===0?null:new e0(d,i,0,r)}static _typeCommand(e,t,i){return i?new F_(e,t,!0):new Wi(e,t,!0)}static _enter(e,t,i,n){if(e.autoIndent===0)return Ot._typeCommand(n, `
` ,i);if(!t.tokenization.isCheapToTokenize(n.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(n.startLineNumber),c=pt(l).substring(0,n.startColumn-1);return Ot._typeCommand(n, `
` +e.normalizeIndentation(c),i)}const s=Nu(e.autoIndent,t,n,e.languageConfigurationService);if(s){if(s.indentAction===oi.None)return Ot._typeCommand(n, `
` +e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===oi.Indent)return Ot._typeCommand(n, `
` +e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===oi.IndentOutdent){const l=e.normalizeIndentation(s.indentation),c=e.normalizeIndentation(s.indentation+s.appendText),d= `
2022-10-26 20:27:06 +08:00
` +c+ `
2022-11-09 20:26:02 +08:00
` +l;return i?new F_(n,d,!0):new e0(n,d,-1,c.length-l.length,!0)}else if(s.indentAction===oi.Outdent){const l=Ot.unshiftIndent(e,s.indentation);return Ot._typeCommand(n, `
` +e.normalizeIndentation(l+s.appendText),i)}}const r=t.getLineContent(n.startLineNumber),a=pt(r).substring(0,n.startColumn-1);if(e.autoIndent>=4){const l=aV(e.autoIndent,t,n,{unshiftIndent:c=>Ot.unshiftIndent(e,c),shiftIndent:c=>Ot.shiftIndent(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,n.getEndPosition());const d=n.endColumn,h=t.getLineContent(n.endLineNumber),u=Sn(h);if(u>=0?n=n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,u+1)):n=n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new F_(n, `
` +e.normalizeIndentation(l.afterEnter),!0);{let g=0;return d<=u+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),g=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new e0(n, `
` +e.normalizeIndentation(l.afterEnter),0,g,!0)}}}return Ot._typeCommand(n, `
` +e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let n=0,s=i.length;n<s;n++)if(!t.tokenization.isCheapToTokenize(i[n].getEndPosition().lineNumber))return!1;return!0}static _runAutoIndentType(e,t,i,n){const s=MP(t,i.startLineNumber,i.startColumn),r=lV(e.autoIndent,t,i,n,{shiftIndent:a=>Ot.shiftIndent(e,a),unshiftIndent:a=>Ot.unshiftIndent(e,a)},e.languageConfigurationService);if(r===null)return null;if(r!==e.normalizeIndentation(s)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?Ot._typeCommand(new L(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+n,!1):Ot._typeCommand(new L(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+t.getLineContent(i.startLineNumber).substring(a-1,i.startColumn-1)+n,!1)}return null}static _isAutoClosingOvertype(e,t,i,n,s){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(s))return!1;for(let r=0,a=i.length;r<a;r++){const l=i[r];if(!l.isEmpty())return!1;const c=l.getPosition(),d=t.getLineContent(c.lineNumber);if(d.charAt(c.column-1)!==s)return!1;const u=wl(s);if((c.column>2?d.charCodeAt(c.column-2):0)===92&&u)return!1;if(e.autoClosingOvertype==="auto"){let f=!1;for(let _=0,b=n.length;_<b;_++){const v=n[_];if(c.lineNumber===v.startLineNumber&&c.column===v.startColumn){f=!0;break}}if(!f)return!1}}return!0}static _runAutoClosingOvertype(e,t,i,n,s){const r=[];for(let a=0,l=n.length;a<l;a++){const d=n[a].getPosition(),h=new L(d.lineNumber,d.column,d.lineNumber,d.column+1);r[a]=new Wi(h,s)}return new En(4,r,{shouldPushStackElementBefore:H_(e,4),shouldPushStackElementAfter:!1})}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],s=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],r=n.some(l=>t.startsWith(l.open)),a=s.some(l=>t.startsWith(l.close));return!r&&a}static _findAutoClosingPairOpen(e,t,i,n){const s=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!s)return null;let r=null;for(const a of s)if(r===null||a.open.length>r.open.length){let l=!0;for(const c of i)if(t.getValueInRange(new L(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+n!==a.open){l=!1;break}l&&(r=a)}return r}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let s=null;for(const r of n)r.open!==t.open&&t.open.includes(r.open)&&t.close.endsWith(r.close)&&(!s||r.open.length>s.open.length)&&(s=r);return s}static _getAutoClosingPairClose(e,t,i,n,s){const r=wl(n),a=r?e.autoClosingQuotes:e.autoClosingBrackets,l=r?e.shouldAutoCloseBefore.quote:e.shouldAutoCloseBefore.bracket;if(a==="never")return null;for(const f of i)if(!f.isEmpty())return null;const c=i.map(f=>{const _=f.getPosition();return s?{lineNumber:_.lineNumber,beforeColumn:_.column-n.length,afterColumn:_.column}:{lineNumber:_.lineNumber,beforeColumn:_.column,afterColumn:_.column}}),d=this._findAutoClosingPairOpen(e,t,c.map(f=>new B(f.lineNumber,f.beforeColumn)),n);if(!d)return null;const h=this._findContainedAutoClosingPair(e,d),u=h?h.close:"";let g=!0;for(const f of c){const{lineNumber:_,beforeColumn:b,afterColumn:v}=f,C=t.getLineContent(_),w=C.substring(0,b-1),S=C.substring(v-1);if(S.startsWith(u)||(g=!1),S.length>0){const D=S.charAt(0);if(!Ot._isBeforeClosingBrace(e,S)&&!l(D))return null}if(d.open.length===1&&(n==="'"||n==='"')&&a!=="always"){const D=Zs(e.wordSeparators);if(w.length>0){const I=w.charCodeAt(w.length-1);if(D.get(I)===0)return null}}if(!t.tokenization.isCheapToTokenize(_))return null;t.tokenization.forceTokenization(_);const k=t.tokenization.getLineTokens(_),x=OC(k,b-1);if(!d.shouldAutoClose(x,b-x.firstCharOffset))return null;const y=d.findNeutralCharacter();if(y){const D=t.tokenization.getTokenTypeIfInsertingCharacter(_,b,y);if(!d.isOK(D))return null}}return g?d.close.substring(0,d.close.length-u.length):d.close}static _runAutoClosingOpenCharType(e,t,i,n,s,r,a){const l=[];for(let c=0,d=n.len
` ){const d=[];for(let h=0,u=s.length;h<u;h++)d[h]=Ot._enter(i,n,!1,s[h]);return new En(4,d,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoIndentType(i,n,s)){const d=[];let h=!1;for(let u=0,g=s.length;u<g;u++)if(d[u]=this._runAutoIndentType(i,n,s[u],a),!d[u]){h=!0;break}if(!h)return new En(4,d,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(i,n,s,r,a))return this._runAutoClosingOvertype(t,i,n,s,a);if(!e){const d=this._getAutoClosingPairClose(i,n,s,a,!1);if(d)return this._runAutoClosingOpenCharType(t,i,n,s,a,!1,d)}if(!e&&this._isSurroundSelectionType(i,n,s,a))return this._runSurroundSelectionType(t,i,n,s,a);if(!e&&this._isTypeInterceptorElectricChar(i,n,s)){const d=this._typeInterceptorElectricChar(t,i,n,s[0],a);if(d)return d}const l=[];for(let d=0,h=s.length;d<h;d++)l[d]=new Wi(s[d],a);const c=Mw(a,t);return new En(c,l,{shouldPushStackElementBefore:H_(t,c),shouldPushStackElementAfter:!1})}static typeWithoutInterceptors(e,t,i,n,s){const r=[];for(let l=0,c=n.length;l<c;l++)r[l]=new Wi(n[l],s);const a=Mw(s,e);return new En(a,r,{shouldPushStackElementBefore:H_(e,a),shouldPushStackElementAfter:!1})}static lineInsertBefore(e,t,i){if(t===null||i===null)return[];const n=[];for(let s=0,r=i.length;s<r;s++){let a=i[s].positionLineNumber;if(a===1)n[s]=new F_(new L(1,1,1,1), `
` );else{a--;const l=t.getLineMaxColumn(a);n[s]=this._enter(e,t,!1,new L(a,l,a,l))}}return n}static lineInsertAfter(e,t,i){if(t===null||i===null)return[];const n=[];for(let s=0,r=i.length;s<r;s++){const a=i[s].positionLineNumber,l=t.getLineMaxColumn(a);n[s]=this._enter(e,t,!1,new L(a,l,a,l))}return n}static lineBreakInsert(e,t,i){const n=[];for(let s=0,r=i.length;s<r;s++)n[s]=this._enter(e,t,!0,i[s]);return n}}class OP extends e0{constructor(e,t,i,n){super(e,(i?t:"")+n,0,-n.length),this._openCharacter=t,this._closeCharacter=n,this.closeCharacterRange=null,this.enclosingRange=null}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return this.closeCharacterRange=new L(n.startLineNumber,n.endColumn-this._closeCharacter.length,n.endLineNumber,n.endColumn),this.enclosingRange=new L(n.startLineNumber,n.endColumn-this._openCharacter.length-this._closeCharacter.length,n.endLineNumber,n.endColumn),super.computeCursorState(e,t)}}class cV{constructor(e,t,i,n,s,r){this.deletedText=e,this.deletedSelectionStart=t,this.deletedSelectionEnd=i,this.insertedText=n,this.insertedSelectionStart=s,this.insertedSelectionEnd=r}}function Mw(o,e){return o===" "?e===5||e===6?6:5:4}function H_(o,e){return OT(o)&&!OT(e)?!0:o===5?!1:RT(o)!==RT(e)}function RT(o){return o===6||o===5?"space":o}function OT(o){return o===4||o===5||o===6}var T;(function(o){o.editorSimpleInput=new ce("editorSimpleInput",!1,!0),o.editorTextFocus=new ce("editorTextFocus",!1,p("editorTextFocus","Whether the editor text has focus (cursor is blinking)")),o.focus=new ce("editorFocus",!1,p("editorFocus","Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),o.textInputFocus=new ce("textInputFocus",!1,p("textInputFocus","Whether an editor or a rich text input has focus (cursor is blinking)")),o.readOnly=new ce("editorReadonly",!1,p("editorReadonly","Whether the editor is read only")),o.inDiffEditor=new ce("inDiffEditor",!1,p("inDiffEditor","Whether the context is a diff editor")),o.columnSelection=new ce("editorColumnSelection",!1,p("editorColumnSelection","Whether ` editor . columnSelection ` is enabled")),o.writable=o.readOnly.toNegated(),o.hasNonEmptySelection=new ce("editorHasSelection",!1,p("editorHasSelection","Whether the editor has text selected")),o.hasOnlyEmptySelection=o.hasNonEmptySelection.toNegated(),o.hasMultipleSelections=new ce("editorHasMultipleSelections",!1,p("editorHasMultipleSelections","Whether the editor has multiple selections")),o.hasSingleSelection=o.hasMultipleSelections.toNegated(),o.tabMovesFocus=new ce("editorTabMovesFocus",!1,p("editorTabMovesFocus","Whether ` Tab ` will move focus out of the editor")),o.tabDoesNotMoveFocus=o.tabMovesFocus.toNegated(),o.isInWalkThroughSnippet=new ce("isInEmbeddedEditor",!1,!0),o.canUndo=new ce("canUndo",!1,!0),o.canRedo=new ce("canRedo",!1,!0),o.hoverVisible=new ce("editorHoverVisible",!1,p("editorHoverVisible","Whether the editor hover is visible")),o.inCompositeEditor=new ce("inCompositeEditor",void 0,p("inCompositeEditor","Whether the editor is part of a larger editor (e.g. notebooks)")),o.notInCompositeEditor=o.inCompositeEditor.toNegated(),o.languageId=new ce("editorLangId","",p("editorLangId","The language identifier of the editor")),o.hasCompletionItemProvider=new ce("editorHasCompletionItemProvider",!1,p("editorHasCompletionItemProvider","Whether the editor has a completion item provider")),o.hasCodeActionsProvider=new ce("editorHasCodeActionsProvider",!1,p("editorHasCodeActionsProvider","Whether the editor has a code actions provider")),o.hasCodeLensProvider=new ce("editorHasCodeLensProvider",!1,p("editorHasCodeLensProvider","Whether the editor has a code lens provider")),o.hasDefinitionProvider=new ce("editorHasDefinitionProvider",!1,p("editorHasDefinitionProvider","Whether the editor has a definition provider")),o.hasDeclarationProvider=new ce("editorHasDeclarationProvider",!1,p("editorHasDeclarationProvider","Whether the editor has a declaration provider")),o.hasImplementationProvider=new ce("editorHasImplementationProvider",!1,p("editorHasImplementationProvid
2022-10-26 20:27:06 +08:00
- Use 0 to automatically compute the line height from the font size .
- Values between 0 and 8 will be used as a multiplier with the font size .
2022-11-09 20:26:02 +08:00
- Values greater than or equal to 8 will be used as effective values . ` )})}compute(e,t,i){return e.fontInfo.lineHeight}}class MV extends hi{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(67,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:p("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:p("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[p("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),p("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),p("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:p("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:p("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:p("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:p("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:p("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:p("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Ce(t.enabled,this.defaultValue.enabled),autohide:Ce(t.autohide,this.defaultValue.autohide),size:Ui(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:Ui(t.side,this.defaultValue.side,["right","left"]),showSlider:Ui(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:Ce(t.renderCharacters,this.defaultValue.renderCharacters),scale:Et.clampedInt(t.scale,1,1,3),maxColumn:Et.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function AV(o){return o==="ctrlCmd"?Ze?"metaKey":"ctrlKey":"altKey"}class RV extends hi{constructor(){super(77,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:p("padding.top","Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:p("padding.bottom","Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{top:Et.clampedInt(t.top,0,0,1e3),bottom:Et.clampedInt(t.bottom,0,0,1e3)}}}class OV extends hi{constructor(){const e={enabled:!0,cycle:!1};super(78,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:p("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:p("parameterHints.cycle","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Ce(t.enabled,this.defaultValue.enabled),cycle:Ce(t.cycle,this.defaultValue.cycle)}}}class PV extends Bg{constructor(){super(131)}compute(e,t,i){return e.pixelRatio}}class FV extends hi{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off
` )}}const KC=new vH;di.add(qP.ColorContribution,KC);function CH(o){return o===null||typeof o.hcLight=="undefined"&&(o.hcDark===null||typeof o.hcDark=="string"?o.hcLight=o.hcDark:o.hcLight=o.light),o}function N(o,e,t,i,n){return KC.registerColor(o,CH(e),t,i,n)}const X=N("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},p("foreground","Overall foreground color. This color is only used if not overridden by a component."));N("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},p("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));const wH=N("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},p("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));N("descriptionForeground",{light:"#717171",dark:fe(X,.7),hcDark:fe(X,.7),hcLight:fe(X,.7)},p("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const z_=N("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},p("iconForeground","The default color for icons in the workbench.")),Hs=N("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#0F4A85"},p("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),Be=N("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},p("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),At=N("contrastActiveBorder",{light:null,dark:null,hcDark:Hs,hcLight:Hs},p("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));N("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},p("selectionBackground","The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));N("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:W.black,hcLight:"#292929"},p("textSeparatorForeground","Color for text separators."));const qC=N("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},p("textLinkForeground","Foreground color for links in text.")),GC=N("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},p("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));N("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#D7BA7D",hcLight:"#292929"},p("textPreformatForeground","Foreground color for preformatted text segments."));N("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hcDark:null,hcLight:"#F2F2F2"},p("textBlockQuoteBackground","Background color for block quotes in text."));N("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:W.white,hcLight:"#292929"},p("textBlockQuoteBorder","Border color for block quotes in text."));const GP=N("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:W.black,hcLight:"#F2F2F2"},p("textCodeBlockBackground","Background color for code blocks in text.")),Tr=N("widget.shadow",{dark:fe(W.black,.36),light:fe(W.black,.16),hcDark:null,hcLight:null},p("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),ZC=N("input.background",{dark:"#3C3C3C",light:W.white,hcDark:W.black,hcLight:W.white},p("inputBoxBackground","Input box background.")),YC=N("input.foreground",{dark:X,light:X,hcDark:X,hcLight:X},p("inputBoxForeground","Input box foreground.")),XC=N("input.border",{dark:null,light:null,hcDark:Be,hcLight:Be},p("inputBoxBorder","Input box border.")),Y0=N("inputOption.activeBorder",{dark:"#007ACC00",light:"#007ACC00",hcDark:Be,hcLight:Be},p("inputBoxActiveOptionBorder","Border color of activated options in input fields."));N("inputOption.hoverBackground",{dark:"#5
$ { Qz ( n ) } : $ { r } ; ` }return i+= `
} ` ,i}dispose(){this._styleElement.remove()}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function Qz(o){return o.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=> ` - $ { e . toLowerCase ( ) } ` )}class Zm extends z{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,n=e.length;i<n;i++){const s=e[i];switch(s.type){case 0:this.onCompositionStart(s)&&(t=!0);break;case 1:this.onCompositionEnd(s)&&(t=!0);break;case 2:this.onConfigurationChanged(s)&&(t=!0);break;case 3:this.onCursorStateChanged(s)&&(t=!0);break;case 4:this.onDecorationsChanged(s)&&(t=!0);break;case 5:this.onFlushed(s)&&(t=!0);break;case 6:this.onFocusChanged(s)&&(t=!0);break;case 7:this.onLanguageConfigurationChanged(s)&&(t=!0);break;case 8:this.onLineMappingChanged(s)&&(t=!0);break;case 9:this.onLinesChanged(s)&&(t=!0);break;case 10:this.onLinesDeleted(s)&&(t=!0);break;case 11:this.onLinesInserted(s)&&(t=!0);break;case 12:this.onRevealRangeRequest(s)&&(t=!0);break;case 13:this.onScrollChanged(s)&&(t=!0);break;case 15:this.onTokensChanged(s)&&(t=!0);break;case 14:this.onThemeChanged(s)&&(t=!0);break;case 16:this.onTokensColorsChanged(s)&&(t=!0);break;case 17:this.onZonesChanged(s)&&(t=!0);break;default:console.info("View received unknown event: "),console.info(s)}}t&&(this._shouldRender=!0)}}class Es extends Zm{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class jr{static write(e,t){e.setAttribute("data-mprt",String(t))}static read(e){const t=e.getAttribute("data-mprt");return t===null?0:parseInt(t,10)}static collect(e,t){const i=[];let n=0;for(;e&&e!==document.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(i[n++]=this.read(e)),e=e.parentElement;const s=new Uint8Array(n);for(let r=0;r<n;r++)s[r]=i[n-r-1];return s}}class Jz{constructor(e,t){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;const i=this._viewLayout.getCurrentViewport();this.scrollTop=i.top,this.scrollLeft=i.left,this.viewportWidth=i.width,this.viewportHeight=i.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e){return this._viewLayout.getVerticalOffsetForLineNumber(e)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class eU extends Jz{constructor(e,t,i){super(e,t),this._renderingContextBrand=void 0,this._viewLines=i}linesVisibleRangesForRange(e,t){return this._viewLines.linesVisibleRangesForRange(e,t)}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)}}class tU{constructor(e,t,i){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i}}class JC{constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}static from(e){const t=new Array(e.length);for(let i=0,n=e.length;i<n;i++){const s=e[i];t[i]=new JC(s.left,s.width)}return t}toString(){return ` [ $ { this . left } , $ { this . width } ] ` }}class Ru{constructor(e,t){this._floatHorizontalRangeBrand=void 0,this.left=e,this.width=t}toString(){return ` [ $ { this . left } , $ { this . width } ] ` }sta
target : $ { this . target ? this . target . outerHTML : null } ` }_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?_i.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return Tn.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return Tn.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,n){return Tn.createMargin(e,this.target,this._getMouseColumn(t),t,i,n)}fulfillViewZone(e,t,i){return Tn.createViewZone(e,this.target,this._getMouseColumn(t),t,i)}fulfillContentText(e,t,i){return Tn.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return Tn.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return Tn.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return Tn.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return Tn.createOverlayWidget(this.target,this._getMouseColumn(),e)}withTarget(e){return new yI(this._ctx,this.editorPos,this.pos,this.relativePos,e)}}const JT={isAfterLines:!0};function Ow(o){return{isAfterLines:!1,horizontalDistanceToText:o}}class qi{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=jr.collect(t,this._viewHelper.viewDomNode);return!!(no.isChildOfContentWidgets(i)||no.isChildOfOverflowingContentWidgets(i)||no.isChildOfOverlayWidgets(i))}createMouseTarget(e,t,i,n,s){const r=new cg(this._context,this._viewHelper,e),a=new yI(r,t,i,n,s);try{return qi._createMouseTarget(r,a,!1)}catch(l){return a.fulfillUnknown()}}static _createMouseTarget(e,t,i){if(t.target===null){if(i)return t.fulfillUnknown();const r=qi._doHitTest(e,t);return r.type===1?qi.createMouseTargetFromHitTestPosition(e,t,r.spanNode,r.position,r.injectedText):this._createMouseTarget(e,t.withTarget(r.hitTarget),!0)}const n=t;let s=null;return s=s||qi._hitTestContentWidget(e,n),s=s||qi._hitTestOverlayWidget(e,n),s=s||qi._hitTestMinimap(e,n),s=s||qi._hitTestScrollbarSlider(e,n),s=s||qi._hitTestViewZone(e,n),s=s||qi._hitTestMargin(e,n),s=s||qi._hitTestViewCursor(e,n),s=s||qi._hitTestTextArea(e,n),s=s||qi._hitTestViewLines(e,n,i),s=s||qi._hitTestScrollbar(e,n),s||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(no.isChildOfContentWidgets(t.targetPath)||no.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(no.isChildOfOverlayWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillOverlayWidget(i):t.fulfillUnknown()}return null}static _hitTestViewCursor(e,t){if(t.target){const i=e.lastRenderData.lastViewCursorsRenderData;for(const n of i)if(t.target===n.domNode)return t.fulfillContentText(n.position,null,{mightBeForeignElement:!1,injectedText:null})}if(t.isInContentArea){const i=e.lastRenderData.lastViewCursorsRenderData,n=t.mouseContentHorizontalOffset,s=t.mouseVerticalOffset;for(const r of i){if(n<r.contentLeft||n>r.contentLeft+r.width)continue;const a=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(a<=s&&s<=a+r.height)return t.fulfillContentText(r.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const n=t.isInContentArea?8:5;return t.fulfillViewZone(n,i.position,i)}return null}static _hitTestTextArea(e,t){return no.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),n=i.range.getStartPosition();let s=Math.abs(t.relativePos.x);const r={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMargin
` ,s+1))!==-1;)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const n=Math.min(Pd(e.value,t.value),e.selectionStart,t.selectionStart),s=Math.min(Np(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(n,e.value.length-s);const r=t.value.substring(n,t.value.length-s),a=e.selectionStart-n,l=e.selectionEnd-n,c=t.selectionStart-n,d=t.selectionEnd-n;if(c===d){const u=e.selectionStart-n;return{text:r,replacePrevCharCnt:u,replaceNextCharCnt:0,positionDelta:0}}const h=l-a;return{text:r,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(Pd(e.value,t.value),e.selectionEnd),n=Math.min(Np(e.value,t.value),e.value.length-e.selectionEnd),s=e.value.substring(i,e.value.length-n),r=t.value.substring(i,t.value.length-n);e.selectionStart-i;const a=e.selectionEnd-i;t.selectionStart-i;const l=t.selectionEnd-i;return{text:r,replacePrevCharCnt:a,replaceNextCharCnt:s.length-a,positionDelta:l-r.length}}}Vi.EMPTY=new Vi("",0,0,null,null);class mu{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,n=i+1,s=i+t;return new L(n,1,s+1,1)}static fromEditorSelection(e,t,i,n,s){const r=mu._getPageOfLine(i.startLineNumber,n),a=mu._getRangeForPage(r,n),l=mu._getPageOfLine(i.endLineNumber,n),c=mu._getRangeForPage(l,n),d=a.intersectRanges(new L(1,1,i.startLineNumber,i.startColumn));let h=t.getValueInRange(d,1);const u=t.getLineCount(),g=t.getLineMaxColumn(u),f=c.intersectRanges(new L(i.endLineNumber,i.endColumn,u,g));let _=t.getValueInRange(f,1),b;if(r===l||r+1===l)b=t.getValueInRange(i,1);else{const v=a.intersectRanges(i),C=c.intersectRanges(i);b=t.getValueInRange(v,1)+String.fromCharCode(8230)+t.getValueInRange(C,1)}return s&&(h.length>500&&(h=h.substring(h.length-500,h.length)),_.length>500&&(_=_.substring(0,500)),b.length>2*500&&(b=b.substring(0,500)+String.fromCharCode(8230)+b.substring(b.length-500,b.length))),new Vi(h+b+_,h.length,h.length+b.length,new B(i.startLineNumber,i.startColumn),new B(i.endLineNumber,i.endColumn))}}var tv;(function(o){o.Tap="-monaco-textarea-synthetic-tap"})(tv||(tv={}));const Gy={forceCopyWithSyntaxHighlighting:!1};class Wp{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}}Wp.INSTANCE=new Wp;class LU{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";const t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}class DU extends z{constructor(e,t,i,n){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._onFocus=this._register(new O),this.onFocus=this._onFocus.event,this._onBlur=this._register(new O),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new O),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new O),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new O),this.onCut=this._onCut.event,this._onPaste=this._register(new O),this.onPaste=this._onPaste.event,this._onType=this._register(new O),this.onType=this._onType.event,this._onCompositionStart=this._register(new O),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new O),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new O),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new O),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new ft(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new ft(()=>th
` ):t.text,i),e.preventDefault(),e.clipboardData&&e2.setTextData(e.clipboardData,t.text,t.html,i)}}class e2{static getTextData(e){const t=e.getData(Pn.text);let i=null;const n=e.getData("vscode-editor-data");if(typeof n=="string")try{i=JSON.parse(n),i.version!==1&&(i=null)}catch(s){}return t.length===0&&i===null&&e.files.length>0?[Array.prototype.slice.call(e.files,0).map(r=>r.name).join( `
` ),null]:[t,i]}static setTextData(e,t,i,n){e.setData(Pn.text,t),typeof i=="string"&&e.setData("text/html",i),e.setData("vscode-editor-data",JSON.stringify(n))}}class kU extends z{constructor(e){super(),this._actual=e,this.onKeyDown=this._register(ko(this._actual,"keydown")).event,this.onKeyUp=this._register(ko(this._actual,"keyup")).event,this.onCompositionStart=this._register(ko(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(ko(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(ko(this._actual,"compositionend")).event,this.onInput=this._register(ko(this._actual,"input")).event,this.onCut=this._register(ko(this._actual,"cut")).event,this.onCopy=this._register(ko(this._actual,"copy")).event,this.onPaste=this._register(ko(this._actual,"paste")).event,this.onFocus=this._register(ko(this._actual,"focus")).event,this.onBlur=this._register(ko(this._actual,"blur")).event,this._onSyntheticTap=this._register(new O),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(q(this._actual,tv.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=Md(this._actual);return e?e.activeElement===this._actual:Vx(this._actual)?document.activeElement===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const n=this._actual;let s=null;const r=Md(n);r?s=r.activeElement:s=document.activeElement;const a=s===n,l=n.selectionStart,c=n.selectionEnd;if(a&&l===t&&c===i){Ls&&window.parent!==window&&n.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),Ls&&window.parent!==window&&n.focus();return}try{const d=fB(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),pB(n,d)}catch(d){}}}class xU extends LI{constructor(e,t,i){super(e,t,i),this._register(ut.addTarget(this.viewHelper.linesContentDomNode)),this._register(q(this.viewHelper.linesContentDomNode,kt.Tap,s=>this.onTap(s))),this._register(q(this.viewHelper.linesContentDomNode,kt.Change,s=>this.onChange(s))),this._register(q(this.viewHelper.linesContentDomNode,kt.Contextmenu,s=>this._onContextMenu(new cc(s,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(q(this.viewHelper.linesContentDomNode,"pointerdown",s=>{const r=s.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const n=new Zz(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,s=>this._onMouseMove(s))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,s=>this._onMouseUp(s))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,s=>this._onMouseLeave(s))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(s,r)=>this._onMouseDown(s,r)))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new cc(e,!1,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:t.type===6&&t.detail.injectedText!==null})}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e,t){e.brow
` ),v=_.substring(b+1),C=v.lastIndexOf(" "),w=v.length-C-1,S=h.getStartPosition(),k=Math.min(S.column-1,w),x=S.column-1-k,y=v.substring(0,v.length-k),D=g $ (y,this._fontInfo);return{distanceToModelLineStart:x,widthOfHiddenTextBefore:D}})(),{distanceToModelLineEnd:f}=(()=>{const _=d.value.substring(Math.max(d.selectionStart,d.selectionEnd)),b=_.indexOf( `
` ),v=b===-1?_:_.substring(0,b),C=v.indexOf(" "),w=C===-1?v.length:v.length-C-1,S=h.getEndPosition(),k=Math.min(this._context.viewModel.model.getLineMaxColumn(S.lineNumber)-S.column,w);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(S.lineNumber)-S.column-k}})();this._context.viewModel.revealRange("keyboard",!0,L.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new h $ (this._context,h.startLineNumber,u,g,f),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName( ` inputarea $ { vd } ime - input ` ),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(c=>{!this._visibleTextArea||(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this._render(),this.textArea.setClassName( ` inputarea $ { vd } ` ),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)}))}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t=' ` ~ ! @ # $ % ^ & * ( ) -= + [ { ] } \ \ | ; : ",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),n=Zs(t);let s=!0,r=e.column,a=!0,l=e.column,c=0;for(;c<50&&(s||a);){if(s&&r<=1&&(s=!1),s){const d=i.charCodeAt(r-2);n.get(d)!==0?s=!1:r--}if(a&&l>i.length&&(a=!1),a){const d=i.charCodeAt(l-1);n.get(d)!==0?a=!1:l++}c++}return[i.substring(r-1,l-1),e.column-r]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=Zs(this._context.configuration.options.get(119));let n=e.column,s=0;for(;n>1;){const r=t.charCodeAt(n-2);if(i.get(r)!==0||s>50)return t.substring(n-1,e.column-1);s++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!wi(i.charCodeAt(0)))return i}return" "}_getAriaLabel(e){return e.get(2)===1?p(" accessibilityOffAriaLabel "," The editor is not accessible at this time . Press { 0 } for options . ",sn?" Shift + Alt + F1 ":" Alt + F1 "):e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===Jo.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(133);return this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(46),this._lineHeight=t.get(61),this._emptySelectionClipboard=t.get(33),this._copyWithSyntaxHighlighting=t.get(21),this.textArea.setAttribute(" aria - label ",this._getAriaLabel(t)),this.textArea.setAttribute(" tabindex ",String(t.get(114))),(e.hasChanged(30)||e.hasChanged(83))&&(t.get(30)&&t.get(83)?this.textArea.setAttribute(" readonly "," true "):this.textArea.removeAttribute(" readonly ")),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent(" strategy changed "),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent(" selection changed "),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute(" aria - haspopup "," true "),this.textArea.setAttribute(" aria - autocomplete "," list "),this.textArea.setAttribute(" aria - activedescendant ",e.activeDescendant)):(this.textArea.setAttribute(" aria - haspopup "," fal
` ,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:uf?0:1,height:uf?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;tn(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?W.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration( ` $ { e . underline ? " underline" : "" } $ { e . strikethrough ? " line-through" : "" } ` ),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const n=this._context.configuration.options;n.get(52)?i.setClassName("monaco-editor-background textAreaCover "+zd.OUTER_CLASS_NAME):n.get(62).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+dg.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}}function g $ (o,e){if(o.length===0)return 0;const t=document.createElement("div");t.style.position="absolute",t.style.top="-50000px",t.style.width="50000px";const i=document.createElement("span");tn(i,e),i.style.whiteSpace="pre",i.append(o),t.appendChild(i),document.body.appendChild(t);const n=i.offsetWidth;return document.body.removeChild(t),n}class f ${ constructor ( e , t , i , n ) { this . configuration = e , this . viewModel = t , this . userInputEvents = i , this . commandDelegate = n } paste(e,t,i,n){this.commandDelegate.paste(e,t,i,n)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,n){this.commandDelegate.compositionType(e,t,i,n)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){yi.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new B(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(72)){case"altKey":return e.altKey;case"ctrlKey":return e.ctrlKey;case"metaKey":return e.metaKey;default:return!1}}_hasNonMulticursorModifier(e){switch(this.configuration.options.get(72)){case"altKey":return e.ctrlKey||e.metaKey;case"ctrlKey":return e.altKey||e.metaKey;case"metaKey":return e.ctrlKey||e.altKey;default:return!1}}dispatchMouse(e){const t=this.configuration.options,i=sn&&t.get(98),n=t.get(18);e.middleButton&&!i?this._columnSelect(e.position,e.mouseColumn,e.inSelectionMode):e.startedOnLineNumbers?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelect(e.position):this._createCursor(e.position,!0):e.inSelectionMode?this._lineSelectDrag(e.position):this._lineSelect(e.position):e.mouseDownCount>=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position):this._lastCursorLineSelect(e.position):e.inSelectionMode?this._lineSelectDrag(e.position):this._lineSelect(e.position):e.mouseDownCount===2?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position):e.inSelectionMode?this._wordSelectDrag(e.position):this._wordSelect(e.position)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):n?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position):this.moveTo(e.position)}_usualArgs(e){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e}}moveTo(e){yi.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_moveToSelect(e){yi.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_columnSelect(e,t,i){e=this._validateViewColumn(e),yi.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseCo
2022-10-26 20:27:06 +08:00
. monaco - scrollable - element > . shadow . top {
box - shadow : $ { t } 0 6 px 6 px - 6 px inset ;
}
. monaco - scrollable - element > . shadow . left {
box - shadow : $ { t } 6 px 0 6 px - 6 px inset ;
}
. monaco - scrollable - element > . shadow . top . left {
box - shadow : $ { t } 6 px 6 px 6 px - 6 px inset ;
}
2022-11-09 20:26:02 +08:00
` );const i=o.getColor(rd);i&&e.addRule( `
2022-10-26 20:27:06 +08:00
. monaco - scrollable - element > . scrollbar > . slider {
background : $ { i } ;
}
2022-11-09 20:26:02 +08:00
` );const n=o.getColor(ad);n&&e.addRule( `
2022-10-26 20:27:06 +08:00
. monaco - scrollable - element > . scrollbar > . slider : hover {
background : $ { n } ;
}
2022-11-09 20:26:02 +08:00
` );const s=o.getColor(ld);s&&e.addRule( `
2022-10-26 20:27:06 +08:00
. monaco - scrollable - element > . scrollbar > . slider . active {
background : $ { s } ;
}
2022-11-09 20:26:02 +08:00
` )});class sv{constructor(e,t,i){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i)}}class II extends zg{_render(e,t,i){const n=[];for(let a=e;a<=t;a++){const l=a-e;n[l]=[]}if(i.length===0)return n;i.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.className<l.className?-1:1);let s=null,r=0;for(let a=0,l=i.length;a<l;a++){const c=i[a],d=c.className;let h=Math.max(c.startLineNumber,e)-e;const u=Math.min(c.endLineNumber,t)-e;s===d?(h=Math.max(r+1,h),r=Math.max(r,u)):(s=d,r=u);for(let g=h;g<=r;g++)n[g].push(s)}return n}}class P $ extends II{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(133);this._lineHeight=t.get(61),this._glyphMargin=t.get(52),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(133);return this._lineHeight=t.get(61),this._glyphMargin=t.get(52),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let s=0,r=t.length;s<r;s++){const a=t[s],l=a.options.glyphMarginClassName;l&&(i[n++]=new sv(a.range.startLineNumber,a.range.endLineNumber,l))}return i}prepareRender(e){if(!this._glyphMargin){this._renderResult=null;return}const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),s=this._lineHeight.toString(),r=this._glyphMarginLeft.toString(),a=this._glyphMarginWidth.toString(),l='" style="left:'+r+"px;width:"+a+"px;height:"+s+'px;"></div>',c=[];for(let d=t;d<=i;d++){const h=d-t,u=n[h];u.length===0?c[h]="":c[h]='<div class="cgmr codicon '+u.join(" ")+l}this._renderResult=c}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class k4 extends z{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function s1(o,e){let t=0,i=0;const n=o.length;for(;i<n;){const s=o.charCodeAt(i);if(s===32)t++;else if(s===9)t=t-t%e+e;else break;i++}return i===n?-1:t}var Cd;(function(o){o[o.Disabled=0]="Disabled",o[o.EnabledForActive=1]="EnabledForActive",o[o.Enabled=2]="Enabled"})(Cd||(Cd={}));class hd{constructor(e,t,i,n,s,r){if(this.visibleColumn=e,this.column=t,this.className=i,this.horizontalLine=n,this.forWrappedLinesAfterColumn=s,this.forWrappedLinesBeforeOrAtColumn=r,e!==-1==(t!==-1))throw new Error}}class ep{constructor(e,t){this.top=e,this.endColumn=t}}class F $ extends k4{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return s1(this.textModel.getLineContent(e+1),this.textModel.getOptions().tabSize)}getActiveIndentGuide(e,t,i){this.assertNotDisposed();const n=this.textModel.getLineCount();if(e<1||e>n)throw new Error("Illegal value for lineNumber");const s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=Boolean(s&&s.offSide);let a=-2,l=-1,c=-2,d=-1;const h=y=>{if(a!==-1&&(a===-2||a>y-1)){a=-1,l=-1;for(let D=y-2;D>=0;D--){const I=this._computeIndentLevel(D);if(I>=0){a=D,l=I;break}}}if(c===-2){c=-1,d=-1;for(let D=y;D<n;D++){const I=this._computeIndentLevel(D);if(I>=0){c=D,d=I;break}}}};let u=-2,g=-1,f=-2,_=-1;const b=y=>{if(u===-2){u=-1,g=-1;for(let D=y-2;D>=0;D--){const I=this._computeIndentLevel(D);if(I>=0){u=D,g=I;break}}}if(f!==-1&&(f===-2
` )>=0)return null;const r=s.text.match(/([) \] }>'" ` ] ) ( [ ^ ) \ ] } > ' "`]*)$/);if(!r)return null;const a=r[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,d=s.text.length-r[2].length-1,h=s.text.lastIndexOf(c,d-1);if(h===-1)return null;t.push([h,d])}return t}executeEdits(e,t,i,n){let s=null;t===" snippet "&&(s=this._findAutoClosingPairs(i)),s&&(i[0]._isTracked=!0);const r=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,c=>{if(s)for(let h=0,u=s.length;h<u;h++){const[g,f]=s[h],_=c[h],b=_.range.startLineNumber,v=_.range.startColumn-1+g,C=_.range.startColumn-1+f;r.push(new L(b,C+1,b,C+2)),a.push(new L(b,v+1,b,C+2))}const d=n(c);return d&&(this._isHandling=!0),d});l&&(this._isHandling=!1,this.setSelections(e,t,l,0)),r.length>0&&this._pushAutoClosedAction(r,a)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const s=sp.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){Ee(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,s,!1)&&this.revealPrimary(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return _2.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new op(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t===" keyboard "&&this._executeEditOperation(Ot.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,i){this._executeEdit(()=>{if(i===" keyboard " ) { const n = t . length ; let s = 0 ; for ( ; s < n ; ) { const r = qx ( t , s ) , a = t . substr ( s , r ) ; this . _executeEditOperation ( Ot . typeWithInterceptors ( ! ! this . _compositionState , this . _prevEditOperationType , this . context . cursorConfig , this . _model , this . getSelections ( ) , this . getAutoClosedCharacters ( ) , a ) ) , s += r } } else this . _executeEditOperation ( Ot . typeWithoutInterceptors ( this . _prevEditOperationType , this . context . cursorConfig , this . _model , this . getSelections ( ) , t ) ) } , e , i ) } compositionType ( e , t , i , n , s , r ) { if ( t . length === 0 && i === 0 && n === 0 ) { if ( s !== 0 ) { const a = this . getSelections ( ) . map ( l => { const c = l . getPosition ( ) ; return new oe ( c . lineNumber , c . column + s , c . lineNumber , c . column + s ) } ) ; this . setSelections ( e , r , a , 0 ) } return } this . _executeEdit ( ( ) => { this . _executeEditOperation ( Ot . compositionType ( this . _prevEditOperationType , this . context . cursorConfig , this . _model , this . getSelections ( ) , t , i , n , s ) ) } , e , r ) } paste ( e , t , i , n , s ) { this . _executeEdit ( ( ) => { this . _executeEditOperation ( Ot . paste ( this . context . cursorConfig , this . _model , this . getSelections ( ) , t , i , n || [ ] ) ) } , e , s , 4 ) } cut ( e , t ) { this . _executeEdit ( ( ) => { this . _executeEditOperation ( Wd . cut ( this . context . cursorConfig , this . _model , this . getSelections ( ) ) ) } , e , t ) } executeCommand ( e , t , i ) { this . _executeEdit ( ( ) => { this . _cursors . killSecondaryCursors ( ) , this . _executeEditOperation ( new En ( 0 , [ t ] , { shouldPushStackElementBefore : ! 1 , shouldPushStackElementAfter : ! 1 } ) ) } , e , i ) } executeCommands ( e , t , i ) { this . _executeEdit ( ( ) => { this . _executeEditOperation ( new En ( 0 , t , { shouldPushStackElementBefore : ! 1 , shouldPushStackElementAfter : ! 1 } ) ) } , e , i ) } } ug . MAX _CURSOR _COUNT = 1e4 ; class sp { constructor ( e , t ) { this . modelVersionId = e , this . cursorState = t } static from ( e , t ) { return new sp ( e . getVersionId ( ) , t . getCursorStates ( ) ) } equals ( e ) { if ( ! e || this . modelVersionId !== e . modelVersionId || this . cursorState . length !== e . cursorState . length ) return ! 1 ; for ( let t = 0 , i = this . cursorState . length ; t < i ; t ++ ) if ( ! this . cursorState [ t ] . equals ( e . cursorState [ t ] ) ) return ! 1 ; return ! 0 } } class _2 { constructor ( e , t , i ) { this . _model = e , this . _autoClosedCharactersDecorations = t , this . _autoClosedEnclosingDecorations = i } static getAllAutoClosedCharacters ( e ) { let t = [ ] ; for ( const i of e ) t = t . concat ( i . getAutoClosedCharactersRanges ( ) ) ; return t } dispose ( ) { this . _autoClosedCharactersDecorations = this . _model . deltaDecorations ( this . _autoClosedCharactersDecorations , [ ] ) , this . _autoClosedEn
` ,"gi"):null,s=[];let r,a=0,l=0,c=0,d=0;const h=new Array;for(let f=0;f<60;f++)h.push(new El(Xt(0,f),0,-1,ri.getEmpty(),new Xh(Xt(0,f))));const u=new Array;for(let f=0;f<60;f++)u.push(new El(Xt(1,f),0,-1,ri.getEmpty(),new Xh(Xt(1,f))));if(n)for(n.lastIndex=0;(r=n.exec(e))!==null;){const f=r.index,_=r[0];if(_=== `
` )a++,l=f+1;else{if(c!==f){let b;if(d===a){const v=f-c;if(v<h.length)b=h[v];else{const C=Xt(0,v);b=new El(C,0,-1,ri.getEmpty(),new Xh(C))}}else{const v=a-d,C=f-l;if(v===1&&C<u.length)b=u[C];else{const w=Xt(v,C);b=new El(w,0,-1,ri.getEmpty(),new Xh(w))}}s.push(b)}s.push(t.getToken(_)),c=f+_.length,d=a}}const g=e.length;if(c!==g){const f=d===a?Xt(0,g-c):Xt(a-d,g-l);s.push(new El(f,0,-1,ri.getEmpty(),new Xh(f)))}this.length=Xt(a,g-l),this.tokens=s}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new A8}}class FI{constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}static createFromLanguage(e,t){function i(s){return t.getKey( ` $ { s . languageId } : : : $ { s . bracketText } ` )}const n=new Map;for(const s of e.bracketsNew.openingBrackets){const r=Xt(0,s.bracketText.length),a=i(s),l=ri.getEmpty().add(a,v2);n.set(s.bracketText,new El(r,1,a,l,dv.create(r,s,l)))}for(const s of e.bracketsNew.closingBrackets){const r=Xt(0,s.bracketText.length);let a=ri.getEmpty();const l=s.getClosedBrackets();for(const c of l)a=a.add(i(c),v2);n.set(s.bracketText,new El(r,2,i(l[0]),a,dv.create(r,s,a)))}return new FI(n)}getRegExpStr(){if(this.isEmpty)return null;{const e=[...this.map.keys()];return e.sort(),e.reverse(),e.map(t=>lK(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(i.kind===2&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function lK(o){let e=Ds(o);return/^[ \w ]+/.test(o)&&(e= ` \ \ b$ { e } ` ),/[ \w ]+ $ /.test(o)&&(e= ` $ { e } \ \ b ` ),e}class O4{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=FI.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function cK(o){if(o.length===0)return null;if(o.length===1)return o[0];let e=0;function t(){if(e>=o.length)return null;const r=e,a=o[r].listHeight;for(e++;e<o.length&&o[e].listHeight===a;)e++;return e-r>=2?P4(r===0&&e===o.length?o:o.slice(r,e),!1):o[r]}let i=t(),n=t();if(!n)return i;for(let r=t();r;r=t())C2(i,n)<=C2(n,r)?(i=Hw(i,n),n=r):n=Hw(n,r);return Hw(i,n)}function P4(o,e=!1){if(o.length===0)return null;if(o.length===1)return o[0];let t=o.length;for(;t>3;){const i=t>>1;for(let n=0;n<i;n++){const s=n<<1;o[n]=Kr.create23(o[s],o[s+1],s+3===t?o[s+2]:null,e)}t=i}return Kr.create23(o[0],o[1],t>=3?o[2]:null,e)}function C2(o,e){return Math.abs(o.listHeight-e.listHeight)}function Hw(o,e){return o.listHeight===e.listHeight?Kr.create23(o,e,null,!1):o.listHeight>e.listHeight?dK(o,e):hK(e,o)}function dK(o,e){o=o.toMutable();let t=o;const i=new Array;let n;for(;;){if(e.listHeight===t.listHeight){n=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let s=i.length-1;s>=0;s--){const r=i[s];n?r.childrenLength>=3?n=Kr.create23(r.unappendChild(),n,null,!1):(r.appendChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?Kr.create23(o,n,null,!1):o}function hK(o,e){o=o.toMutable();let t=o;const i=new Array;for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let n=e;for(let s=i.length-1;s>=0;s--){const r=i[s];n?r.childrenLength>=3?n=Kr.create23(n,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?Kr.create23(n,o,null,!1):o}class uK{constructor(e){this.lastOffset=go,this.nextNodes=[e],this.offsets=[go],this.idxs=[]}readLongestNodeAt(e,t){if(Fu(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=ff(this.nextNodes);if(!i)return;const n=ff(this.offsets);if(Fu(e,n))return;if(Fu(n,e))if(qt(n,i.length)<=e)this.nextN
` ?0:1}function Da(o){return o?o instanceof U4||o instanceof xK:!1}class WI{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Da(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Da(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e){const t=this._undoRedoService.getLastElement(this._model.uri);if(Da(t)&&t.canAppend(this._model))return t;const i=new U4(p("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(i),i}pushEOL(e){const t=this._getOrCreateEditStackElement(null);this._model.setEOL(e),t.append(this._model,[],oL(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i){const n=this._getOrCreateEditStackElement(e),s=this._model.applyEdits(t,!0),r=WI._computeCursorState(i,s),a=s.map((l,c)=>({index:c,textChange:l.textChange}));return a.sort((l,c)=>l.textChange.oldPosition===c.textChange.oldPosition?l.index-c.index:l.textChange.oldPosition-c.textChange.oldPosition),n.append(this._model,a.map(l=>l.textChange),oL(this._model),this._model.getAlternativeVersionId(),r),r}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return Ee(i),null}}}class IK{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function EK(o,e,t,i,n){n.spacesDiff=0,n.looksLikeAlignment=!1;let s;for(s=0;s<e&&s<i;s++){const u=o.charCodeAt(s),g=t.charCodeAt(s);if(u!==g)break}let r=0,a=0;for(let u=s;u<e;u++)o.charCodeAt(u)===32?r++:a++;let l=0,c=0;for(let u=s;u<i;u++)t.charCodeAt(u)===32?l++:c++;if(r>0&&a>0||l>0&&c>0)return;const d=Math.abs(a-c),h=Math.abs(r-l);if(d===0){n.spacesDiff=h,h>0&&0<=l-1&&l-1<o.length&&l<t.length&&t.charCodeAt(l)!==32&&o.charCodeAt(l-1)===32&&o.charCodeAt(o.length-1)===44&&(n.looksLikeAlignment=!0);return}if(h%d===0){n.spacesDiff=h/d;return}}function D2(o,e,t){const i=Math.min(o.getLineCount(),1e4);let n=0,s=0,r="",a=0;const l=[2,4,6,8,3,5,7],c=8,d=[0,0,0,0,0,0,0,0,0],h=new IK;for(let f=1;f<=i;f++){const _=o.getLineLength(f),b=o.getLineContent(f),v=_<=65536;let C=!1,w=0,S=0,k=0;for(let y=0,D=_;y<D;y++){const I=v?b.charCodeAt(y):o.getLineCharCode(f,y);if(I===9)k++;else if(I===32)S++;else{C=!0,w=y;break}}if(!C||(k>0?n++:S>1&&s++,EK(r,a,b,w,h),h.looksLikeAlignment&&!(t&&e===h.spacesDiff)))continue;const x=h.spacesDiff;x<=c&&d[x]++,r=b,a=w}let u=t;n!==s&&(u=n<s);let g=e;if(u){let f=u?0:.1*i;l.forEach(_=>{const b=d[_];b>f&&(f=b,g=_)}),g===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(g=2)}return{insertSpaces:u,tabSize:g}}function Nn(o){return(o.metadata&1)>>>0}function yt(o,e){o.metadata=o.metadata&254|e<<0}function $ i(o){return(o.metadata&2)>>>1===1}function wt(o,e){o.metadata=o.metadata&253|(e?1:0)<<1}function $ 4(o){return(o.metadata&4)>>>2===1}function k2(o,e){o.metadata=o.metadata&251|(e?1:0)<<2}function NK(o){return(o.metadata&24)>>>3}function x2(o,e){o.metadata=o.metadata&231|e<<3}function TK(o){return(o.metadata&32)>>>5===1}function I2(o,e){o.metadata=o.metadata&223|(e?1:0)<<5}class j4{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,yt(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,k2(this,!1),x2(this,1),I2(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,wt(this,!1)}reset(e,t,i,n){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=n}setOptions(e){this.options=e;const t=this.options.className;k2(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),x2(this,this.options.stickiness),I2(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const Ae=new j4(null,0,0);Ae.parent=Ae;Ae.left=Ae;Ae.right=Ae;yt(Ae,0);class $ w{constructor(){this.root=Ae,this.requestNor
` )>=0;let t=null;try{t=qO(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch(n){return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new Z $ (t,this.wordSeparators?Zs(this.wordSeparators):null,i?this.searchString:null)}}function $ K(o){if(!o||o.length===0)return!1;for(let e=0,t=o.length;e<t;e++){const i=o.charCodeAt(e);if(i===10)return!0;if(i===92){if(e++,e>=t)break;const n=o.charCodeAt(e);if(n===110||n===114||n===87)return!0}}return!1}function Qc(o,e,t){if(!t)return new Kp(o,null);const i=[];for(let n=0,s=e.length;n<s;n++)i[n]=e[n];return new Kp(o,i)}class M2{constructor(e){const t=[];let i=0;for(let n=0,s=e.length;n<s;n++)e.charCodeAt(n)===10&&(t[i++]=n);this._lineFeedsOffsets=t}findLineFeedCountBeforeOffset(e){const t=this._lineFeedsOffsets;let i=0,n=t.length-1;if(n===-1||e<=t[0])return 0;for(;i<n;){const s=i+((n-i)/2>>0);t[s]>=e?n=s-1:t[s+1]>=e?(i=s,n=s):i=s+1}return i+1}}class ib{static findMatches(e,t,i,n,s){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new _u(r.wordSeparators,r.regex),n,s):this._doFindMatchesLineByLine(e,i,r,n,s):[]}static _getMultilineMatchRange(e,t,i,n,s,r){let a,l=0;n?(l=n.findLineFeedCountBeforeOffset(s),a=t+s+l):a=t+s;let c;if(n){const g=n.findLineFeedCountBeforeOffset(s+r.length)-l;c=a+r.length+g}else c=a+r.length;const d=e.getPositionAt(a),h=e.getPositionAt(c);return new L(d.lineNumber,d.column,h.lineNumber,h.column)}static _doFindMatchesMultiline(e,t,i,n,s){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()=== ` \ r
` ?new M2(a):null,c=[];let d=0,h;for(i.reset(0);h=i.next(a);)if(c[d++]=Qc(this._getMultilineMatchRange(e,r,a,l,h.index,h[0]),h,n),d>=s)return c;return c}static _doFindMatchesLineByLine(e,t,i,n,s){const r=[];let a=0;if(t.startLineNumber===t.endLineNumber){const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,r,n,s),r}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,r,n,s);for(let c=t.startLineNumber+1;c<t.endLineNumber&&a<s;c++)a=this._findMatchesInLine(i,e.getLineContent(c),c,0,a,r,n,s);if(a<s){const c=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);a=this._findMatchesInLine(i,c,t.endLineNumber,0,a,r,n,s)}return r}static _findMatchesInLine(e,t,i,n,s,r,a,l){const c=e.wordSeparators;if(!a&&e.simpleSearch){const u=e.simpleSearch,g=u.length,f=t.length;let _=-g;for(;(_=t.indexOf(u,_+g))!==-1;)if((!c||UI(c,t,f,_,g))&&(r[s++]=new Kp(new L(i,_+1+n,i,_+1+g+n),null),s>=l))return s;return s}const d=new _u(e.wordSeparators,e.regex);let h;d.reset(0);do if(h=d.next(t),h&&(r[s++]=Qc(new L(i,h.index+1+n,i,h.index+1+h[0].length+n),h,a),s>=l))return s;while(h);return s}static findNextMatch(e,t,i,n){const s=t.parseSearchRequest();if(!s)return null;const r=new _u(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindNextMatchMultiline(e,i,r,n):this._doFindNextMatchLineByLine(e,i,r,n)}static _doFindNextMatchMultiline(e,t,i,n){const s=new B(t.lineNumber,1),r=e.getOffsetAt(s),a=e.getLineCount(),l=e.getValueInRange(new L(s.lineNumber,s.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()=== ` \ r
` ?new M2(l):null;i.reset(t.column-1);const d=i.next(l);return d?Qc(this._getMultilineMatchRange(e,r,l,c,d.index,d[0]),d,n):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new B(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const s=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),l=this._findFirstMatchInLine(i,a,r,t.column,n);if(l)return l;for(let c=1;c<=s;c++){const d=(r+c-1)%s,h=e.getLineContent(d+1),u=this._findFirstMatchInLine(i,h,d+1,1,n);if(u)return u}return null}static _findFirstMatchInLine(e,t,i,n,s){e.reset(n-1);const r=e.next(t);return r?Qc(new L(i,r.index+1,i,r.index+1+r[0].length),r,s):null}static findPreviousMatch(e,t,i,n){const s=t.parseSearchRequest();if(!s)return null;const r=new _u(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,n):this._doFindPreviousMatchLineByLine(e,i,r,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const s=this._doFindMatchesMultiline(e,new L(1,1,t.lineNumber,t.column),i,n,10*UK);if(s.length>0)return s[s.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new B(r,e.getLineMaxColumn(r)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const s=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r).substring(0,t.column-1),l=this._findLastMatchInLine(i,a,r,n);if(l)return l;for(let c=1;c<=s;c++){const d=(s+r-c-1)%s,h=e.getLineContent(d+1),u=this._findLastMatchInLine(i,h,d+1,n);if(u)return u}return null}static _findLastMatchInLine(e,t,i,n){let s=null,r;for(e.reset(0);r=e.next(t);)s=Qc(new L(i,r.index+1,i,r.index+1+r[0].length),r,n);return s}}function jK(o,e,t,i,n){if(i===0)return!0;const s=e.charCodeAt(i-1);if(o.get(s)!==0||s===13||s===10)return!0;if(n>0){const r=e.charCodeAt(i);if(o.get(r)!==0)return!0}return!1}function KK(o,e,t,i,n){if(i+n===t)return!0;const s=e.charCodeAt(i+n);if(o.get(s)!==0||s===13||s===10)return!0;if(n>0){const r=e.charCodeAt(i+n-1);if(o.get(r)!==0)return!0}return!1}function UI(o,e,t,i,n){return jK(o,e,t,i,n)&&KK(o,e,t,i,n)}class _u{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(i=this._searchRegex.exec(e),!i))return null;const n=i.index,s=i[0].length;if(n===this._prevMatchStartIndex&&s===this._prevMatchLength){if(s===0){F0(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=s,!this._wordSeparators||UI(this._wordSeparators,e,t,n,s))return i}while(i);return null}}const la=65535;function G4(o){let e;return o[o.length-1]<65536?e=new Uint16Array(o.length):e=new Uint32Array(o.length),e.set(o,0),e}class qK{constructor(e,t,i,n,s){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=s}}function va(o,e=!0){const t=[0];let i=1;for(let n=0,s=o.length;n<s;n++){const r=o.charCodeAt(n);r===13?n+1<s&&o.charCodeAt(n+1)===10?(t[i++]=n+2,n++):t[i++]=n+1:r===10&&(t[i++]=n+1)}return e?G4(t):t}function GK(o,e){o.length=0,o[0]=0;let t=1,i=0,n=0,s=0,r=!0;for(let l=0,c=e.length;l<c;l++){const d=e.charCodeAt(l);d===13?l+1<c&&e.charCodeAt(l+1)===10?(s++,o[t++]=l+2,l++):(i++,o[t++]=l+1):d===10?(n++,o[t++]=l+1):r&&d!==9&&(d<32||d>126)&&(r=!1)}const a=new qK(G4(o),i,n,s,r);return o.length=0,a}class jn{constructor(e,t,i,n,s){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=s}}class Jc{constructor(e,t){this.buffer=e,this.lineStarts=t}}class ZK{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==ke&&e.iterate(e.root,i=>(i!==ke&&this._pieces.push(i.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this
` }if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(n,s-1)===13){const _=this.positionInBuffer(n,s-1);this.deleteNodeTail(n,_),t=" \r "+t,n.piece.length===0&&d.push(n)}else this.deleteNodeTail(n,c);else this.deleteNodeTail(n,c);const u=this.createNewPieces(t);h.length>0&&this.rbInsertRight(n,h);let g=n;for(let f=0;f<u.length;f++)g=this.rbInsertRight(g,u[f]);this.deleteNodes(d)}else this.insertContentToNodeRight(t,n)}else{const n=this.createNewPieces(t);let s=this.rbInsertLeft(null,n[0]);for(let r=1;r<n.length;r++)s=this.rbInsertRight(s,n[r])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===ke)return;const i=this.nodeAt(e),n=this.nodeAt(e+t),s=i.node,r=n.node;if(s===r){const u=this.positionInBuffer(s,i.remainder),g=this.positionInBuffer(s,n.remainder);if(i.nodeStartOffset===e){if(t===s.piece.length){const f=s.next();tb(this,s),this.validateCRLFWithPrevNode(f),this.computeBufferMetadata();return}this.deleteNodeHead(s,g),this._searchCache.validate(e),this.validateCRLFWithPrevNode(s),this.computeBufferMetadata();return}if(i.nodeStartOffset+s.piece.length===e+t){this.deleteNodeTail(s,u),this.validateCRLFWithNextNode(s),this.computeBufferMetadata();return}this.shrinkNode(s,u,g),this.computeBufferMetadata();return}const a=[],l=this.positionInBuffer(s,i.remainder);this.deleteNodeTail(s,l),this._searchCache.validate(e),s.piece.length===0&&a.push(s);const c=this.positionInBuffer(r,n.remainder);this.deleteNodeHead(r,c),r.piece.length===0&&a.push(r);const d=s.next();for(let u=d;u!==ke&&u!==r;u=u.next())a.push(u);const h=s.piece.length===0?s.prev():s;this.deleteNodes(a),this.validateCRLFWithNextNode(h),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){const i=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){const r=t.piece,a={line:r.start.line+1,column:0},l=new jn(r.bufferIndex,a,r.end,this.getLineFeedCnt(r.bufferIndex,a,r.end),r.length-1);t.piece=l,e+= `
` ,pa(this,t,-1,-1),t.piece.length===0&&i.push(t)}const n=this.createNewPieces(e);let s=this.rbInsertLeft(t,n[n.length-1]);for(let r=n.length-2;r>=0;r--)s=this.rbInsertLeft(s,n[r]);this.validateCRLFWithPrevNode(s),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+= `
` );const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let s=n;for(let r=1;r<i.length;r++)s=this.rbInsertRight(s,i[r]);this.validateCRLFWithPrevNode(n)}positionInBuffer(e,t,i){const n=e.piece,s=e.piece.bufferIndex,r=this._buffers[s].lineStarts,l=r[n.start.line]+n.start.column+t;let c=n.start.line,d=n.end.line,h=0,u=0,g=0;for(;c<=d&&(h=c+(d-c)/2|0,g=r[h],h!==d);)if(u=r[h+1],l<g)d=h-1;else if(l>=u)c=h+1;else break;return i?(i.line=h,i.column=l-g,null):{line:h,column:l-g}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;const n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;const s=n[i.line+1],r=n[i.line]+i.column;if(s>r+1)return i.line-t.line;const a=r-1;return this._buffers[e].buffer.charCodeAt(a)===13?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;t<e.length;t++)tb(this,e[t])}createNewPieces(e){if(e.length>la){const d=[];for(;e.length>la;){const u=e.charCodeAt(la-1);let g;u===13||u>=55296&&u<=56319?(g=e.substring(0,la-1),e=e.substring(la-1)):(g=e.substring(0,la),e=e.substring(la));const f=va(g);d.push(new jn(this._buffers.length,{line:0,column:0},{line:f.length-1,column:g.length-f[f.length-1]},f.length-1,g.length)),this._buffers.push(new Jc(g,f))}const h=va(e);return d.push(new jn(this._buffers.length,{line:0,column:0},{line:h.length-1,column:e.length-h[h.length-1]},h.length-1,e.length)),this._buffers.push(new Jc(e,h)),d}let t=this._buffers[0].buffer.length;const i=va(e,!1);let n=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},n=this._lastChangeBufferPos;for(let d=0;d<i.length;d++)i[d]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+="_"+e,t+=1}else{if(t!==0)for(let d=0;d<i.length;d++)i[d]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+=e}const s=this._buffers[0].buffer.length,r=this._buffers[0].lineStarts.length-1,a=s-this._buffers[0].lineStarts[r],l={line:r,column:a},c=new jn(0,n,l,this.getLineFeedCnt(0,n,l),s-t);return this._lastChangeBufferPos=l,[c]}getLineRawContent(e,t=0){let i=this.root,n="";const s=this._searchCache.get2(e);if(s){i=s.node;const r=this.getAccumulatedValue(i,e-s.nodeStartLineNumber-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(s.nodeStartLineNumber+i.piece.lineFeedCnt===e)n=a.substring(l+r,l+i.piece.length);else{const c=this.getAccumulatedValue(i,e-s.nodeStartLineNumber);return a.substring(l+r,l+c-t)}}else{let r=0;const a=e;for(;i!==ke;)if(i.left!==ke&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this.getAccumulatedValue(i,e-i.lf_left-1),d=this._buffers[i.piece.bufferIndex].buffer,h=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return r+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:r,nodeStartLineNumber:a-(e-1-i.lf_left)}),d.substring(h+l,h+c-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this._buffers[i.piece.bufferIndex].buffer,d=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=c.substring(d+l,d+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,r+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==ke;){const r=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(i,0),l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=r.substring(l,l+a-t),n}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=r.substr(a,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==ke;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this.
` );const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const s=va(t,!1);for(let g=0;g<s.length;g++)s[g]+=n;if(i){const g=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:n-g}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(s.slice(1));const r=this._buffers[0].lineStarts.length-1,a=this._buffers[0].buffer.length-this._buffers[0].lineStarts[r],l={line:r,column:a},c=e.piece.length+t.length,d=e.piece.lineFeedCnt,h=this.getLineFeedCnt(0,e.piece.start,l),u=h-d;e.piece=new jn(e.piece.bufferIndex,e.piece.start,l,h,c),this._lastChangeBufferPos=l,pa(this,e,t.length,u)}nodeAt(e){let t=this.root;const i=this._searchCache.get(e);if(i)return{node:i.node,nodeStartOffset:i.nodeStartOffset,remainder:e-i.nodeStartOffset};let n=0;for(;t!==ke;)if(t.size_left>e)t=t.left;else if(t.size_left+t.piece.length>=e){n+=t.size_left;const s={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(s),s}else e-=t.size_left+t.piece.length,n+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,n=0;for(;i!==ke;)if(i.left!==ke&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(s+t-1,r),nodeStartOffset:n}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2);if(s+t-1<=i.piece.length)return{node:i,remainder:s+t-1,nodeStartOffset:n};t-=i.piece.length-s;break}else e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==ke;){if(i.piece.lineFeedCnt>0){const s=this.getAccumulatedValue(i,0),r=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,s),nodeStartOffset:r}}else if(i.piece.length>=t-1){const s=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:s}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(n)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL=== `
` )}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===ke||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,s=i[n]+t.start.column;return n===i.length-1||i[n+1]>s+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(s)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===ke||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],n=this._buffers[e.piece.bufferIndex].lineStarts;let s;e.piece.end.column===0?s={line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:s={line:e.piece.end.line,column:e.piece.end.column-1};const r=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new jn(e.piece.bufferIndex,e.piece.start,s,a,r),pa(this,e,-1,-1),e.piece.length===0&&i.push(e);const l={line:t.piece.start.line+1,column:0},c=t.piece.length-1,d=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new jn(t.piece.bufferIndex,l,t.piece.end,d,c),pa(this,t,-1,-1),t.piece.length===0&&i.push(t);const h=this.createNewPieces( ` \ r
` );this.rbInsertRight(e,h[0]);for(let u=0;u<i.length;u++)tb(this,i[u])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const i=t.next();if(this.startWithLF(i)){if(e+= `
` ,i.piece.length===1)tb(this,i);else{const n=i.piece,s={line:n.start.line+1,column:0},r=n.length-1,a=this.getLineFeedCnt(n.bufferIndex,s,n.end);i.piece=new jn(n.bufferIndex,s,n.end,a,r),pa(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===ke)return t(ke);const i=this.iterate(e.left,t);return i&&t(e)&&this.iterate(e.right,t)}getNodeContent(e){if(e===ke)return"";const t=this._buffers[e.piece.bufferIndex],i=e.piece,n=this.offsetInBuffer(i.bufferIndex,i.start),s=this.offsetInBuffer(i.bufferIndex,i.end);return t.buffer.substring(n,s)}getPieceContent(e){const t=this._buffers[e.bufferIndex],i=this.offsetInBuffer(e.bufferIndex,e.start),n=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(i,n)}rbInsertRight(e,t){const i=new rL(t,1);if(i.left=ke,i.right=ke,i.parent=ke,i.size_left=0,i.lf_left=0,this.root===ke)this.root=i,i.color=0;else if(e.right===ke)e.right=i,i.parent=e;else{const s=VI(e.right);s.left=i,i.parent=s}return T2(this,i),i}rbInsertLeft(e,t){const i=new rL(t,1);if(i.left=ke,i.right=ke,i.parent=ke,i.size_left=0,i.lf_left=0,this.root===ke)this.root=i,i.color=0;else if(e.left===ke)e.left=i,i.parent=e;else{const n=q4(e.left);n.right=i,i.parent=n}return T2(this,i),i}}class Bu extends z{constructor(e,t,i,n,s,r,a){super(),this._onDidChangeContent=this._register(new O),this._BOM=t,this._mightContainNonBasicASCII=!r,this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._pieceTree=new XK(e,i,a)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:"")}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){const i=e+t,n=this.getPositionAt(e),s=this.getPositionAt(i);return new L(n.lineNumber,n.column,s.lineNumber,s.column)}getValueInRange(e,t=0){if(e.isEmpty())return"";const i=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,i)}getValueLengthInRange(e,t=0){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;const i=this.getOffsetAt(e.startLineNumber,e.startColumn);return this.getOffsetAt(e.endLineNumber,e.endColumn)-i}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0;const n=e.startLineNumber,s=e.endLineNumber;for(let r=n;r<=s;r++){const a=this.getLineContent(r),l=r===n?e.startColumn-1:0,c=r===s?e.endColumn-1:a.length;for(let d=l;d<c;d++)wi(a.charCodeAt(d))?(i=i+1,d=d+1):i=i+1}return i+=this._getEndOfLine(t).length*(s-n),i}return this.getValueLengthInRange(e,t)}getLength(){return this._pieceTree.getLength()}getLineCount(){return this._pieceTree.getLineCount()}getLinesContent(){return this._pieceTree.getLinesContent()}getLineContent(e){return this._pieceTree.getLineContent(e)}getLineCharCode(e,t){return this._pieceTree.getLineCharCode(e,t)}getLineLength(e){return this._pieceTree.getLineLength(e)}getLineFirstNonWhitespaceColumn(e){const t=Sn(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Fr(this.getLineContent(e));return t===-1?0:t+2}_getEndOfLine(e){switch(e){case 1:return `
2022-10-26 20:27:06 +08:00
` ;case 2:return ` \ r
2022-11-09 20:26:02 +08:00
` ;case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,i){let n=this._mightContainRTL,s=this._mightContainUnusualLineTerminators,r=this._mightContainNonBasicASCII,a=!0,l=[];for(let _=0;_<e.length;_++){const b=e[_];a&&b._isTracked&&(a=!1);const v=b.range;if(b.text){let x=!0;r||(x=!DC(b.text),r=x),!n&&x&&(n=ig(b.text)),!s&&x&&(s=YO(b.text))}let C="",w=0,S=0,k=0;if(b.text){let x;[w,S,k,x]=Ud(b.text);const y=this.getEOL();x===0||x===(y=== ` \ r
` ?2:1)?C=b.text:C=b.text.replace(/ \r \n | \r | \n /g,y)}l[_]={sortIndex:_,identifier:b.identifier||null,range:v,rangeOffset:this.getOffsetAt(v.startLineNumber,v.startColumn),rangeLength:this.getValueLengthInRange(v),text:C,eolCount:w,firstLineLength:S,lastLineLength:k,forceMoveMarkers:Boolean(b.forceMoveMarkers),isAutoWhitespaceEdit:b.isAutoWhitespaceEdit||!1}}l.sort(Bu._sortOpsAscending);let c=!1;for(let _=0,b=l.length-1;_<b;_++){const v=l[_].range.getEndPosition(),C=l[_+1].range.getStartPosition();if(C.isBeforeOrEqual(v)){if(C.isBefore(v))throw new Error("Overlapping ranges are not allowed!");c=!0}}a&&(l=this._reduceOperations(l));const d=i||t?Bu._getInverseEditRanges(l):[],h=[];if(t)for(let _=0;_<l.length;_++){const b=l[_],v=d[_];if(b.isAutoWhitespaceEdit&&b.range.isEmpty())for(let C=v.startLineNumber;C<=v.endLineNumber;C++){let w="";C===v.startLineNumber&&(w=this.getLineContent(b.range.startLineNumber),Sn(w)!==-1)||h.push({lineNumber:C,oldContent:w})}}let u=null;if(i){let _=0;u=[];for(let b=0;b<l.length;b++){const v=l[b],C=d[b],w=this.getValueInRange(v.range),S=v.rangeOffset+_;_+=v.text.length-w.length,u[b]={sortIndex:v.sortIndex,identifier:v.identifier,range:C,text:w,textChange:new Hi(v.rangeOffset,w,S,v.text)}}c||u.sort((b,v)=>b.sortIndex-v.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._mightContainNonBasicASCII=r;const g=this._doApplyEdits(l);let f=null;if(t&&h.length>0){h.sort((_,b)=>b.lineNumber-_.lineNumber),f=[];for(let _=0,b=h.length;_<b;_++){const v=h[_].lineNumber;if(_>0&&h[_-1].lineNumber===v)continue;const C=h[_].oldContent,w=this.getLineContent(v);w.length===0||w===C||Sn(w)!==-1||f.push(v)}}return this._onDidChangeContent.fire(),new Y $ (u,g,f)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,n=e[e.length-1].range,s=new L(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let r=i.startLineNumber,a=i.startColumn;const l=[];for(let g=0,f=e.length;g<f;g++){const _=e[g],b=_.range;t=t||_.forceMoveMarkers,l.push(this.getValueInRange(new L(r,a,b.startLineNumber,b.startColumn))),_.text.length>0&&l.push(_.text),r=b.endLineNumber,a=b.endColumn}const c=l.join(""),[d,h,u]=Ud(c);return{sortIndex:0,identifier:e[0].identifier,range:s,rangeOffset:this.getOffsetAt(s.startLineNumber,s.startColumn),rangeLength:this.getValueLengthInRange(s,0),text:c,eolCount:d,firstLineLength:h,lastLineLength:u,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(Bu._sortOpsDescending);const t=[];for(let i=0;i<e.length;i++){const n=e[i],s=n.range.startLineNumber,r=n.range.startColumn,a=n.range.endLineNumber,l=n.range.endColumn;if(s===a&&r===l&&n.text.length===0)continue;n.text?(this._pieceTree.delete(n.rangeOffset,n.rangeLength),this._pieceTree.insert(n.rangeOffset,n.text,!0)):this._pieceTree.delete(n.rangeOffset,n.rangeLength);const c=new L(s,r,a,l);t.push({range:c,rangeLength:n.rangeLength,text:n.text,rangeOffset:n.rangeOffset,forceMoveMarkers:n.forceMoveMarkers})}return t}findMatchesLineByLine(e,t,i,n){return this._pieceTree.findMatchesLineByLine(e,t,i,n)}static _getInverseEditRanges(e){const t=[];let i=0,n=0,s=null;for(let r=0,a=e.length;r<a;r++){const l=e[r];let c,d;s?s.range.endLineNumber===l.range.startLineNumber?(c=i,d=n+(l.range.startColumn-s.range.endColumn)):(c=i+(l.range.startLineNumber-s.range.endLineNumber),d=l.range.startColumn):(c=l.range.startLineNumber,d=l.range.startColumn);let h;if(l.text.length>0){const u=l.eolCount+1;u===1?h=new L(c,d,c,d+l.firstLineLength):h=new L(c,d,c+u-1,l.lastLineLength+1)}else h=new L(c,d,c,d);i=h.endLineNumber,n=h.endColumn,t.push(h),s=l}return t}static _sortOpsAscending(e,t){const i=L.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=L.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class QK{constructor(e,t,i,n,s,r,a,l,c){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=s,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,
2022-10-26 20:27:06 +08:00
` : ` \ r
` :i>t/2? ` \ r
` : `
` }create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&(t=== ` \ r
` &&(this._cr>0||this._lf>0)||t=== `
2022-11-09 20:26:02 +08:00
` &&(this._cr>0||this._crlf>0)))for(let s=0,r=i.length;s<r;s++){const a=i[s].buffer.replace(/ \r \n | \r | \n /g,t),l=va(a);i[s]=new Jc(a,l)}const n=new Bu(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:n,disposable:n}}}class Z4{constructor(){this.chunks=[],this.BOM="",this._hasPreviousChar=!1,this._previousChar=0,this._tmpLineStarts=[],this.cr=0,this.lf=0,this.crlf=0,this.containsRTL=!1,this.containsUnusualLineTerminators=!1,this.isBasicASCII=!0}acceptChunk(e){if(e.length===0)return;this.chunks.length===0&&Zx(e)&&(this.BOM=RB,e=e.substr(1));const t=e.charCodeAt(e.length-1);t===13||t>=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=GK(this._tmpLineStarts,e);this.chunks.push(new Jc(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,this.isBasicASCII&&(this.isBasicASCII=t.isBasicASCII),!this.isBasicASCII&&!this.containsRTL&&(this.containsRTL=ig(e)),!this.isBasicASCII&&!this.containsUnusualLineTerminators&&(this.containsUnusualLineTerminators=YO(e))}finish(e=!0){return this._finish(),new QK(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=va(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class Si{constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=i}static createEmpty(e,t){const i=Si.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new Si(n,e,t)}equals(e){return e instanceof Si?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const n=t<<1,s=n+(i<<1);for(let r=n;r<s;r++)if(this._tokens[r]!==e._tokens[r])return!1;return!0}getLineContent(){return this._text}getCount(){return this._tokensCount}getStartOffset(e){return e>0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],i=Yn.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return Yn.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return Yn.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return Yn.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return Yn.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return Yn.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return Si.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new $ I(this,e,t,i)}static convertToEndOffset(e,t){const n=(e.length>>>1)-1;for(let s=0;s<n;s++)e[s<<1]=e[s+1<<1];e[n<<1]=t}static findIndexInTokensArray(e,t){if(e.length<=2)return 0;let i=0,n=(e.length>>>1)-1;for(;i<n;){const s=i+Math.floor((n-i)/2),r=e[s<<1];if(r===t)return s+1;r<t?i=s+1:r>t&&(n=s)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,n="";const s=new Array;let r=0;for(;;){const a=t<this._tokensCount?this._tokens[t<<1]:-1,l=i<e.length?e[i]:null;if(a!==-1&&(l===null||a<=l.offset)){n+=this._text.substring(r,a);const c=this._tokens[(t<<1)+1];s.push(n.length,c),t++,r=a}else if(l){if(l.offset>r){n+=this._text.substring(r,l.offset);const c=this._tokens[(t<<1)+1];s.push(n.length,c),r=l.offset}n+=l.text,s.push(n.length,l.tokenMetadata),i++}else break}return new Si(new Uint32Array(s),n,this._languageIdCodec)}}Si.defaultTokenMetadata=(0<<11|1<<15|2<<24)>>>0;class
` ,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=z.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new wd(e,t)))}setValue(e){if(this._assertNotDisposed(),e===null)return;const{textBuffer:t,disposable:i}=O2(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,s,r,a){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:s,isRedoing:r,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),r=this.getLineMaxColumn(s);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._tokenizationTextModelPart.flush(),this._decorations=Object.create(null),this._decorationsTree=new P2,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new Pu([new Cj],this._versionId,!1,!1),this._createContentChanged2(new L(1,1,s,r),0,n,this.getValue(),!1,!1,!0))}setEOL(e){this._assertNotDisposed();const t=e===1? ` \ r
2022-10-26 20:27:06 +08:00
` : `
2022-11-09 20:26:02 +08:00
` ;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),r=this.getLineMaxColumn(s);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new Pu([new yj],this._versionId,!1,!1),this._createContentChanged2(new L(1,1,s,r),0,n,this.getValue(),!1,!1,!1))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i<n;i++){const s=t[i],r=s.range,a=s.cachedAbsoluteStart-s.start,l=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),c=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);s.cachedAbsoluteStart=l,s.cachedAbsoluteEnd=c,s.cachedVersionId=e,s.start=l-a,s.end=c-a,hc(s)}}onBeforeAttached(){this._attachedEditorCount++,this._attachedEditorCount===1&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0))}onBeforeDetached(){this._attachedEditorCount--,this._attachedEditorCount===0&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0))}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let n=1;n<=i;n++){const s=this._buffer.getLineLength(n);s>=aq?t+=s:e+=s}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=typeof e.tabSize!="undefined"?e.tabSize:this._options.tabSize,i=typeof e.indentSize!="undefined"?e.indentSize:this._options.indentSize,n=typeof e.insertSpaces!="undefined"?e.insertSpaces:this._options.insertSpaces,s=typeof e.trimAutoWhitespace!="undefined"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=typeof e.bracketColorizationOptions!="undefined"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new n0({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:s,bracketPairColorizationOptions:r});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const i=D2(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),U0(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(ZO.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(i=>({range:i.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versi
` ?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let s=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof n=="number"&&!isNaN(n)?n:1);if(s<1)s=1,r=1;else if(s>t)s=t,r=this.getLineMaxColumn(s);else if(r<=1)r=1;else{const h=this.getLineMaxColumn(s);r>=h&&(r=h)}const a=e.endLineNumber,l=e.endColumn;let c=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),d=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(c<1)c=1,d=1;else if(c>t)c=t,d=this.getLineMaxColumn(c);else if(d<=1)d=1;else{const h=this.getLineMaxColumn(c);d>=h&&(d=h)}return i===s&&n===r&&a===c&&l===d&&e instanceof L&&!(e instanceof oe)?e:new L(s,r,c,d)}_isValidPosition(e,t,i){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const n=this._buffer.getLineCount();if(e>n)return!1;if(t===1)return!0;const s=this.getLineMaxColumn(e);if(t>s)return!1;if(i===1){const r=this._buffer.getLineCharCode(e,t-2);if(wi(r))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),s=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(n<1)return new B(1,1);if(n>r)return new B(r,this.getLineMaxColumn(r));if(s<=1)return new B(n,1);const a=this.getLineMaxColumn(n);if(s>=a)return new B(n,a);if(i===1){const l=this._buffer.getLineCharCode(n,s-2);if(wi(l))return new B(n,s-1)}return new B(n,s)}validatePosition(e){return this._assertNotDisposed(),e instanceof B&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,n,0)||!this._isValidPosition(s,r,0))return!1;if(t===1){const a=n>1?this._buffer.getLineCharCode(i,n-2):0,l=r>1&&r<=this._buffer.getLineLength(s)?this._buffer.getLineCharCode(s,r-2):0,c=wi(a),d=wi(l);return!c&&!d}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof L&&!(e instanceof oe)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),n=this._validatePosition(e.endLineNumber,e.endColumn,0),s=i.lineNumber,r=i.column,a=n.lineNumber,l=n.column;{const c=r>1?this._buffer.getLineCharCode(s,r-2):0,d=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,h=wi(c),u=wi(d);return!h&&!u?new L(s,r,a,l):s===a&&r===l?new L(s,r-1,a,l-1):h&&u?new L(s,r-1,a,l+1):h?new L(s,r-1,a,l):new L(s,r,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new L(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,s,r,a=rq){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(h=>L.isIRange(h))&&(l=t.map(h=>this.validateRange(h)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((h,u)=>h.startLineNumber-u.startLineNumber||h.startColumn-u.startColumn);const c=[];c.push(l.reduce((h,u)=>L.areIntersecting(h,u)?h.plusRange(u):(c.push(h),u)));let d;if(!i&&e.indexOf( `
` )<0){const u=new jc(e,i,n,s).parseSearchRequest();if(!u)return[];d=g=>this.findMatchesLineByLine(g,u,r,a)}else d=h=>ib.findMatches(this,new jc(e,i,n,s),h,r,a);return c.map(d).reduce((h,u)=>h.concat(u),[])}findNextMatch(e,t,i,n,s,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf( `
` )<0){const c=new jc(e,i,n,s).parseSearchRequest();if(!c)return null;const d=this.getLineCount();let h=new L(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),u=this.findMatchesLineByLine(h,c,r,1);return ib.findNextMatch(this,new jc(e,i,n,s),a,r),u.length>0||(h=new L(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),u=this.findMatchesLineByLine(h,c,r,1),u.length>0)?u[0]:null}return ib.findNextMatch(this,new jc(e,i,n,s),a,r)}findPreviousMatch(e,t,i,n,s,r){this._assertNotDisposed();const a=this.validatePosition(t);return ib.findPreviousMatch(this,new jc(e,i,n,s),a,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()=== `
` ?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof Ww?e:new Ww(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this._validateEditOperation(e[i]);return t}pushEditOperations(e,t,i){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),i)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,i){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){const n=t.map(r=>({range:this.validateRange(r.range),text:r.text}));let s=!0;if(e)for(let r=0,a=e.length;r<a;r++){const l=e[r];let c=!1;for(let d=0,h=n.length;d<h;d++){const u=n[d].range,g=u.startLineNumber>l.endLineNumber,f=l.startLineNumber>u.endLineNumber;if(!g&&!f){c=!0;break}}if(!c){s=!1;break}}if(s)for(let r=0,a=this._trimAutoWhitespaceLines.length;r<a;r++){const l=this._trimAutoWhitespaceLines[r],c=this.getLineMaxColumn(l);let d=!0;for(let h=0,u=n.length;h<u;h++){const g=n[h].range,f=n[h].text;if(!(l<g.startLineNumber||l>g.endLineNumber)&&!(l===g.startLineNumber&&g.startColumn===c&&g.isEmpty()&&f&&f.length>0&&f.charAt(0)=== `
2022-10-26 20:27:06 +08:00
` )&&!(l===g.startLineNumber&&g.startColumn===1&&g.isEmpty()&&f&&f.length>0&&f.charAt(f.length-1)=== `
2022-11-09 20:26:02 +08:00
` )){d=!1;break}}if(d){const h=new L(l,1,l,c);t.push(new Ww(null,h,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i)}_applyUndo(e,t,i,n){const s=e.map(r=>{const a=this.getPositionAt(r.newPosition),l=this.getPositionAt(r.newEnd);return{range:new L(a.lineNumber,a.column,l.lineNumber,l.column),text:r.oldText}});this._applyUndoRedoEdits(s,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const s=e.map(r=>{const a=this.getPositionAt(r.oldPosition),l=this.getPositionAt(r.oldEnd);return{range:new L(a.lineNumber,a.column,l.lineNumber,l.column),text:r.newText}});this._applyUndoRedoEdits(s,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,s,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(s)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),n=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),s=this._buffer.getLineCount(),r=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,r.length!==0){for(let c=0,d=r.length;c<d;c++){const h=r[c],[u,g,f]=Ud(h.text);this._tokenizationTextModelPart.acceptEdit(h.range,h.text,u,g,f),this._decorationsTree.acceptReplace(h.rangeOffset,h.rangeLength,h.text.length,h.forceMoveMarkers)}const a=[];this._increaseVersionId();let l=i;for(let c=0,d=r.length;c<d;c++){const h=r[c],[u]=Ud(h.text);this._onDidChangeDecorations.fire();const g=h.range.startLineNumber,f=h.range.endLineNumber,_=f-g,b=u,v=Math.min(_,b),C=b-_,w=s-l-C+g,S=w,k=w+b,x=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new B(S,1)),this.getOffsetAt(new B(k,this.getLineMaxColumn(k))),0),y=Yo.fromDecorations(x),D=new Ap(y);for(let I=v;I>=0;I--){const R=g+I,P=w+I;D.takeFromEndWhile( $ => $ .lineNumber>P);const H=D.takeFromEndWhile( $ => $ .lineNumber===P);a.push(new m2(R,this.getLineContent(P),H))}if(v<_){const I=g+v;a.push(new wj(I+1,f))}if(v<b){const I=new Ap(y),R=g+v,P=b-v,H=s-l-P+R+1, $ =[],ne=[];for(let ae=0;ae<P;ae++){const de=H+ae;ne[ae]=this.getLineContent(de),I.takeWhile(we=>we.lineNumber<de), $ [ae]=I.takeWhile(we=>we.lineNumber===de)}a.push(new Sj(R+1,g+b,ne, $ ))}l+=C}this._emitContentChangedEvent(new Pu(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:r,eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return n.reverseEdits===null?void 0:n.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const i=Array.from(e).map(n=>new m2(n,this.getLineContent(n),this._getInjectedTextInLine(n)));this._onDidChangeInjectedText.fire(new N4(i))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(s,r)=>this._deltaDecorationsImpl(e,[],[{range:s,options:r}])[0],changeDecoration:(s,r)=>{this._changeDecorationImpl(s,r)},changeDecorationOptions:(s,r)=>{this._changeDecorationOptionsImpl(s,B2(r))},removeDecoration:s=>{this._deltaDecorationsImpl(e,[s],[])},deltaDecorations:(s,r)=>s.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,s,r)};let n=null;try{n=t(i)}catch(s){Ee(s)}return i.addDecoration=
` :this.model.getEOL();e=e.slice(0),e.sort(L.compareRangesUsingStarts);let s=!1,r=!1;for(const l of e)l.isEmpty()?s=!0:r=!0;if(!r){if(!t)return"";const l=e.map(d=>d.startLineNumber);let c="";for(let d=0;d<l.length;d++)d>0&&l[d-1]===l[d]||(c+=this.model.getLineContent(l[d])+n);return c}if(s&&t){const l=[];let c=0;for(const d of e){const h=d.startLineNumber;d.isEmpty()?h!==c&&l.push(this.model.getLineContent(h)):l.push(this.model.getValueInRange(d,i?2:0)),c=h}return l.length===1?l[0]:l}const a=[];for(const l of e)l.isEmpty()||a.push(this.model.getValueInRange(l,i?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===Us||e.length!==1)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const d=n.startLineNumber;n=new L(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}const s=this._configuration.options.get(46),r=this._getColorMap(),l=/[:; \\ \/ <>]/.test(s.fontFamily)||s.fontFamily===ns.fontFamily;let c;return l?c=ns.fontFamily:(c=s.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c= ` '${c}' ` ),c= ` $ { c } , $ { ns . fontFamily } ` ),{mode:i,html: ` < div style = "color: ${r[1]};background-color: ${r[2]};font-family: ${c};font-weight: ${s.fontWeight};font-size: ${s.fontSize}px;line-height: ${s.lineHeight}px;white-space: pre;" > ` +this._getHTMLToCopy(n,r)+"</div>"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let l="";for(let c=i;c<=s;c++){const d=this.model.tokenization.getLineTokens(c),h=d.getLineContent(),u=c===i?n-1:0,g=c===s?r-1:h.length;h===""?l+="<br>":l+=mq(h,d.inflate(),t,u,g,a,nn)}return l}_getColorMap(){const e=Jt.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;i<n;i++)t[i]=W.Format.CSS.formatHex(e[i]);return t}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,t,i){return this._withViewEventsCollector(n=>this._cursor.setStates(n,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector(n=>this._cursor.setSelections(n,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new Wj);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(n=>this._cursor.executeEdits(n,e,t,i))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,n,s){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,n,s))}paste(e,t,i,n){this._executeCursorEdit(s=>this._cursor.paste(s,e,t,i,n))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealPrimary(n,e,i,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new L(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new s0(e,!1,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new L(
2022-10-26 20:27:06 +08:00
` ?i=1:e&&e.lineEnding&&e.lineEnding=== ` \ r
2022-11-09 20:26:02 +08:00
` &&(i=2),this._modelData.model.getValue(i,t)}setValue(e){!this._modelData||this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){const t=e;if(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;const i=this.hasTextFocus(),n=this._detachModel();this._attachModel(t),i&&this.hasModel()&&this.focus();const s={oldModelUrl:n?n.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(s),this._postDetachModelCleanup(n)}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,n){const s=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?Qh._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?Qh._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const s=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,n)}getBottomForLineNumber(e,t=!1){return this._modelData?Qh._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e){var t;(t=this._modelData)===null||t===void 0||t.viewModel.setHiddenAreas(e.map(i=>L.lift(i)))}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return _i.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(!!this._modelData){if(!B.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!L.isIRange(e))throw new Error("Invalid arguments");const s=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(s);this._modelData.viewModel.revealRange("api",i,r,t,n)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new L(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,n){if(!B.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new L(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=oe.isISelection(e),n=L.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){const s={selectionStartLineNumb
2022-10-26 20:27:06 +08:00
` : `
` ),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=" \n ` ` ` " , this . value += e , this . value += `
2022-11-09 20:26:02 +08:00
` ,this.value+=t,this.value+=" \n ` ` ` \ n ",this}appendLink(e,t,i){return this.value+=" [ ",this.value+=this._escape(t," ] "),this.value+=" ] ( ",this.value+=this._escape(String(e)," ) "),i&&(this.value+=` " $ { this . _escape ( this . _escape ( i , '"' ) , ")" ) } "`),this.value+=" ) ",this}_escape(e,t){const i=new RegExp(Ds(t)," g ");return e.replace(i,(n,s)=>e.charAt(s-1)!==" \ \ "?`\\${n}`:n)}}function pg(o){return g5(o)?!o.value:Array.isArray(o)?o.every(pg):!0}function g5(o){return o instanceof Rn?!0:o&&typeof o==" object "?typeof o.value==" string "&&(typeof o.isTrusted==" boolean "||o.isTrusted===void 0)&&(typeof o.supportThemeIcons==" boolean "||o.supportThemeIcons===void 0):!1}function RG(o){return o.replace(/[\\`*_{}[\]()#+\-!]/g," \ \ $ & ")}function cb(o){return o.replace(/" / g , """ ) } function nS ( o ) { return o && o . replace ( /\\([\\`*_{}[\]()#+\-.!])/g , "$1" ) } function OG ( o ) { const e = [ ] , t = o . split ( "|" ) . map ( n => n . trim ( ) ) ; o = t [ 0 ] ; const i = t [ 1 ] ; if ( i ) { const n = /height=(\d+)/ . exec ( i ) , s = /width=(\d+)/ . exec ( i ) , r = n ? n [ 1 ] : "" , a = s ? s [ 1 ] : "" , l = isFinite ( parseInt ( a ) ) , c = isFinite ( parseInt ( r ) ) ; l && e . push ( ` width=" ${ a } " ` ) , c && e . push ( ` height=" ${ r } " ` ) } return { href : o , dimensions : e } } var pL = globalThis && globalThis . _ _awaiter || function ( o , e , t , i ) { function n ( s ) { return s instanceof t ? s : new t ( function ( r ) { r ( s ) } ) } return new ( t || ( t = Promise ) ) ( function ( s , r ) { function a ( d ) { try { c ( i . next ( d ) ) } catch ( h ) { r ( h ) } } function l ( d ) { try { c ( i . throw ( d ) ) } catch ( h ) { r ( h ) } } function c ( d ) { d . done ? s ( d . value ) : n ( d . value ) . then ( a , l ) } c ( ( i = i . apply ( o , e || [ ] ) ) . next ( ) ) } ) } ; function PG ( o , e ) { ts ( e ) ? o . title = u5 ( e ) : e != null && e . markdownNotSupportedFallback ? o . title = e . markdownNotSupportedFallback : o . removeAttribute ( "title" ) } class FG { constructor ( e , t , i ) { this . hoverDelegate = e , this . target = t , this . fadeInAnimation = i } update ( e , t , i ) { var n ; return pL ( this , void 0 , void 0 , function * ( ) { if ( this . _cancellationTokenSource && ( this . _cancellationTokenSource . dispose ( ! 0 ) , this . _cancellationTokenSource = void 0 ) , this . isDisposed ) return ; let s ; if ( e === void 0 || ts ( e ) || e instanceof HTMLElement ) s = e ; else if ( ! E0 ( e . markdown ) ) s = ( n = e . markdown ) !== null && n !== void 0 ? n : e . markdownNotSupportedFallback ; else { this . _hoverWidget || this . show ( p ( "iconLabel.loading" , "Loading..." ) , t ) , this . _cancellationTokenSource = new gn ; const r = this . _cancellationTokenSource . token ; if ( s = yield e . markdown ( r ) , s === void 0 && ( s = e . markdownNotSupportedFallback ) , this . isDisposed || r . isCancellationRequested ) return } this . show ( s , t , i ) } ) } show ( e , t , i ) { const n = this . _hoverWidget ; if ( this . hasContent ( e ) ) { const s = Object . assign ( { content : e , target : this . target , showPointer : this . hoverDelegate . placement === "element" , hoverPosition : 2 , skipFadeInAnimation : ! this . fadeInAnimation || ! ! n } , i ) ; this . _hoverWidget = this . hoverDelegate . showHover ( s , t ) } n == null || n . dispose ( ) } hasContent ( e ) { return e ? g5 ( e ) ? ! ! e . value : ! 0 : ! 1 } get isDisposed ( ) { var e ; return ( e = this . _hoverWidget ) === null || e === void 0 ? void 0 : e . isDisposed } dispose ( ) { var e , t ; ( e = this . _hoverWidget ) === null || e === void 0 || e . dispose ( ) , ( t = this . _cancellationTokenSource ) === null || t === void 0 || t . dispose ( ! 0 ) , this . _cancellationTokenSource = void 0 } } function f5 ( o , e , t , i ) { let n , s ; const r = ( h , u ) => { var g ; h && ( s == null || s . dispose ( ) , s = void 0 ) , u && ( n == null || n . dispose ( ) , n = void 0 ) , ( g = o . onDidHideHover ) === null || g === void 0 || g . call ( o ) } , a = ( h , u , g ) => new Is ( ( ) => pL ( this , void 0 , void 0 , function * ( ) { ( ! s || s . isDisposed ) && ( s = new FG ( o , g || e , h > 0 ) , yield s . update ( t , u , i ) ) } ) , h ) , l = ( ) => { if ( n ) return ; const h = new ee , u = _ => r ( ! 1 , _ . fromElement === e ) ; h . add ( q ( e , le . MOUSE _LEAVE , u , ! 0 ) ) ; const g = ( ) => r ( ! 0 , ! 0 ) ; h . add ( q ( e , le . MOUSE _DOWN , g , ! 0 ) ) ; const f = { targetElements : [ e ] , dispose : ( ) => { } } ; if ( o . placement === void 0 || o . placement === "mouse" ) { const _ = b => { f . x = b . x + 10 , b . target instanceof HTMLElement && b . target . classList . contains ( "action-label" ) && r ( ! 0 , ! 0 ) } ; h . add ( q ( e , le . MOUSE _MOVE , _ , ! 0 ) ) } h . add ( a ( o . delay , ! 1 , f ) ) , n = h } , c = q ( e , le . MOUSE _OVER , l , ! 0 ) ; return { show : h => { r ( ! 1 , ! 0 ) , a ( 0 , h ) } , hide : ( ) => { r ( ! 0 , ! 0 ) } , update : ( h , u ) => pL ( this , void 0 , void 0 , function * ( ) { t = h , yield s == null ? void 0 : s . update ( t , void 0 , u ) } ) , dispose : ( ) => { c . dispose ( ) , r ( ! 0 , ! 0 ) } } } class wr extends z { constructor ( e , t , i = { } ) { super ( ) , this . options = i , this . _context = e || this , this . _action = t , t instanceof is && this . _register ( t . onDidChange ( n => { ! this . element || this . handleActionChangeEvent ( n ) } ) ) } get action ( ) { return thi
` )}}const vh=new VG;di.add(WG.IconContribution,vh);function fi(o,e,t,i){return vh.registerIcon(o,e,t,i)}function p5(){return vh}function HG(){for(const o of m.getAll())vh.registerIcon(o.id,o.definition,o.description)}HG();const m5="vscode://schemas/icons",_5=di.as(UC.JSONContribution);_5.registerSchema(m5,vh.getIconSchema());const iM=new ft(()=>_5.notifySchemaChanged(m5),200);vh.onDidChange(()=>{iM.isScheduled()||iM.schedule()});const b5=fi("widget-close",m.close,p("widgetClose","Icon for the close action in widgets."));fi("goto-previous-location",m.arrowUp,p("previousChangeIcon","Icon for goto previous editor location."));fi("goto-next-location",m.arrowDown,p("nextChangeIcon","Icon for goto next editor location."));nt.modify(m.sync,"spin");nt.modify(m.loading,"spin");var zG=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},UG=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}}, $ G=globalThis&&globalThis.__awaiter||function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(d){try{c(i.next(d))}catch(h){r(h)}}function l(d){try{c(i.throw(d))}catch(h){r(h)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(o,e||[])).next())})},sS;const db=3;class _f{constructor(e,t,i,n){this.originalLineStart=e,this.originalLineEnd=t,this.modifiedLineStart=i,this.modifiedLineEnd=n}getType(){return this.originalLineStart===0?1:this.modifiedLineStart===0?2:0}}class oS{constructor(e){this.entries=e}}const jG=fi("diff-review-insert",m.add,p("diffReviewInsertIcon","Icon for 'Insert' in diff review.")),KG=fi("diff-review-remove",m.remove,p("diffReviewRemoveIcon","Icon for 'Remove' in diff review.")),qG=fi("diff-review-close",m.close,p("diffReviewCloseIcon","Icon for 'Close' in diff review."));let _v=class Kc extends z{constructor(e,t){super(),this._languageService=t,this._width=0,this._diffEditor=e,this._isVisible=!1,this.shadow=Je(document.createElement("div")),this.shadow.setClassName("diff-review-shadow"),this.actionBarContainer=Je(document.createElement("div")),this.actionBarContainer.setClassName("diff-review-actions"),this._actionBar=this._register(new qr(this.actionBarContainer.domNode)),this._actionBar.push(new is("diffreview.close",p("label.close","Close"),"close-diff-review "+nt.asClassName(qG),!0,()=> $ G(this,void 0,void 0,function*(){return this.hide()})),{label:!1,icon:!0}),this.domNode=Je(document.createElement("div")),this.domNode.setClassName("diff-review monaco-editor-background"),this._content=Je(document.createElement("div")),this._content.setClassName("diff-review-content"),this._content.setAttribute("role","code"),this.scrollbar=this._register(new e_(this._content.domNode,{})),this.domNode.domNode.appendChild(this.scrollbar.getDomNode()),this._register(e.onDidUpdateDiff(()=>{!this._isVisible||(this._diffs=this._compute(),this._render())})),this._register(e.getModifiedEditor().onDidChangeCursorPosition(()=>{!this._isVisible||this._render()})),this._register(Ei(this.domNode.domNode,"click",i=>{i.preventDefault();const n=WO(i.target,"diff-review-row");n&&this._goToRow(n)})),this._register(Ei(this.domNode.domNode,"keydown",i=>{(i.equals(18)||i.equals(2066)||i.equals(530))&&(i.preventDefault(),this._goToRow(this._getNextRow())),(i.equals(16)||i.equals(2064)||i.equals(528))&&(i.preventDefault(),this._goToRow(this._getPrevRow())),(i.equals(9)||i.equals(2057)||i.equals(521)||i.equals(1033))&&(i.preventDefault(),this.hide()),(i.equals(10)||i.equals(3))&&(i.preventDefault(),this.accept())})),this._diffs=[],this._currentDiff=null}prev(){let e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){let i=-1;for(let n=0,s=this._diffs.length;n<s;n++)if(this._diffs[n]===this._currentDiff){i=n;break}e=this._diffs.
2022-10-26 20:27:06 +08:00
` : ` \ r
2022-11-09 20:26:02 +08:00
` )}else yield this._clipboardService.writeText(_)})),c.push(u)),i.getOption(83)||c.push(new is("diff.inline.revertChange",p("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>rS(this,void 0,void 0,function*(){const _=new L(n.originalStartLineNumber,1,n.originalEndLineNumber,n.originalModel.getLineMaxColumn(n.originalEndLineNumber)),b=n.originalModel.getValueInRange(_);if(n.modifiedEndLineNumber===0){const v=i.getModel().getLineMaxColumn(n.modifiedStartLineNumber);i.executeEdits("diffEditor",[{range:new L(n.modifiedStartLineNumber,v,n.modifiedStartLineNumber,v),text:l+b}])}else{const v=i.getModel().getLineMaxColumn(n.modifiedEndLineNumber);i.executeEdits("diffEditor",[{range:new L(n.modifiedStartLineNumber,1,n.modifiedEndLineNumber,v),text:b}])}})));const f=(_,b)=>{this._contextMenuService.showContextMenu({getAnchor:()=>({x:_,y:b}),getActions:()=>(u&&(u.label=d?p("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",n.originalStartLineNumber+h):p("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",n.originalStartLineNumber+h)),c),autoSelectFirstItem:!0})};this._register(Ei(this._diffActions,"mousedown",_=>{const{top:b,height:v}=Qi(this._diffActions),C=Math.floor(a/3);_.preventDefault(),f(_.posx,b+v+C)})),this._register(i.onMouseMove(_=>{_.target.type===8||_.target.type===5?_.target.detail.viewZoneId===this._viewZoneId?(this.visibility=!0,h=this._updateLightBulbPosition(this._marginDomNode,_.event.browserEvent.y,a)):this.visibility=!1:this.visibility=!1})),this._register(i.onMouseDown(_=>{!_.event.rightButton||(_.target.type===8||_.target.type===5)&&_.target.detail.viewZoneId===this._viewZoneId&&(_.event.preventDefault(),h=this._updateLightBulbPosition(this._marginDomNode,_.event.browserEvent.y,a),f(_.event.posx,_.event.posy+a))}))}get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,e?this._diffActions.style.visibility="visible":this._diffActions.style.visibility="hidden")}_updateLightBulbPosition(e,t,i){const{top:n}=Qi(e),s=t-n,r=Math.floor(s/i),a=r*i;if(this._diffActions.style.top= ` $ { a } px ` ,this.diff.viewLineCounts){let l=0;for(let c=0;c<this.diff.viewLineCounts.length;c++)if(l+=this.diff.viewLineCounts[c],r<l)return c}return r}}const dl=qe("clipboardService"),C5=qe("progressService");Object.freeze({total(){},worked(){},done(){}});class wh{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}}wh.None=Object.freeze({report(){}});const kc=qe("editorProgressService");var QG=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ua=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}},aS;class nM{constructor(e,t){this._contextMenuService=e,this._clipboardService=t,this._zones=[],this._inlineDiffMargins=[],this._zonesMap={},this._decorations=[]}getForeignViewZones(e){return e.filter(t=>!this._zonesMap[String(t.id)])}clean(e){this._zones.length>0&&e.changeViewZones(t=>{for(const i of this._zones)t.removeZone(i)}),this._zones=[],this._zonesMap={},e.changeDecorations(t=>{this._decorations=t.deltaDecorations(this._decorations,[])})}apply(e,t,i,n){const s=n?uc.capture(e):null;e.changeViewZones(r=>{var a;for(const l of this._zones)r.removeZone(l);for(const l of this._inlineDiffMargins)l.dispose();this._zones=[],this._zonesMap={},this._inlineDiffMargins=[];for(let l=0,c=i.zones.length;l<c;l++){const d=i.zones[l];d.suppressMouseDown=!0;const h=r.addZone(d);this._zones.push(h),this._zonesMap[String(h)]=!0,i.zones[l].diff&&d.marginDomNode&&(d.suppressMouseDown=!1,((a=i.zones[l].diff)===null||a===void 0?void 0:a.originalModel.getValueLength())!==0&&this._inlineDiffMargins.push(new XG(h,d.marginDomNode,e,i.zones[l].diff,this._contextMenuService,this._clipboardService)))}}),s==null||s.
2022-10-26 20:27:06 +08:00
. monaco - diff - editor . diffViewport {
background : $ { u } ;
}
2022-11-09 20:26:02 +08:00
` );const g=o.getColor(ad);g&&e.addRule( `
2022-10-26 20:27:06 +08:00
. monaco - diff - editor . diffViewport : hover {
background : $ { g } ;
}
2022-11-09 20:26:02 +08:00
` );const f=o.getColor(ld);f&&e.addRule( `
2022-10-26 20:27:06 +08:00
. monaco - diff - editor . diffViewport : active {
background : $ { f } ;
}
2022-11-09 20:26:02 +08:00
` );const _=o.getColor(az);e.addRule( `
2022-10-26 20:27:06 +08:00
. monaco - editor . diagonal - fill {
background - image : linear - gradient (
- 45 deg ,
$ { _ } 12.5 % ,
# 0000 12.5 % , # 0000 50 % ,
$ { _ } 50 % , $ { _ } 62.5 % ,
# 0000 62.5 % , # 0000 100 %
) ;
background - size : 8 px 8 px ;
}
2022-11-09 20:26:02 +08:00
` )});const rZ={followsCaret:!0,ignoreCharChanges:!0,alwaysRevealFirst:!0};class aZ extends z{constructor(e,t={}){super(),this._onDidUpdate=this._register(new O),this._editor=e,this._options=ea(t,rZ,!1),this.disposed=!1,this.nextIdx=-1,this.ranges=[],this.ignoreSelectionChange=!1,this.revealFirst=Boolean(this._options.alwaysRevealFirst),this._register(this._editor.onDidDispose(()=>this.dispose())),this._register(this._editor.onDidUpdateDiff(()=>this._onDiffUpdated())),this._options.followsCaret&&this._register(this._editor.getModifiedEditor().onDidChangeCursorPosition(i=>{this.ignoreSelectionChange||(this.nextIdx=-1)})),this._options.alwaysRevealFirst&&this._register(this._editor.getModifiedEditor().onDidChangeModel(i=>{this.revealFirst=!0})),this._init()}_init(){this._editor.getLineChanges()}_onDiffUpdated(){this._init(),this._compute(this._editor.getLineChanges()),this.revealFirst&&this._editor.getLineChanges()!==null&&(this.revealFirst=!1,this.nextIdx=-1,this.next(1))}_compute(e){this.ranges=[],e&&e.forEach(t=>{!this._options.ignoreCharChanges&&t.charChanges?t.charChanges.forEach(i=>{this.ranges.push({rhs:!0,range:new L(i.modifiedStartLineNumber,i.modifiedStartColumn,i.modifiedEndLineNumber,i.modifiedEndColumn)})}):t.modifiedEndLineNumber===0?this.ranges.push({rhs:!0,range:new L(t.modifiedStartLineNumber,1,t.modifiedStartLineNumber+1,1)}):this.ranges.push({rhs:!0,range:new L(t.modifiedStartLineNumber,1,t.modifiedEndLineNumber+1,1)})}),this.ranges.sort((t,i)=>L.compareRangesUsingStarts(t.range,i.range)),this._onDidUpdate.fire(this)}_initIdx(e){let t=!1;const i=this._editor.getPosition();if(!i){this.nextIdx=0;return}for(let n=0,s=this.ranges.length;n<s&&!t;n++){const r=this.ranges[n].range;i.isBeforeOrEqual(r.getStartPosition())&&(this.nextIdx=n+(e?0:-1),t=!0)}t||(this.nextIdx=e?0:this.ranges.length-1),this.nextIdx<0&&(this.nextIdx=this.ranges.length-1)}_move(e,t){if(Yf(!this.disposed,"Illegal State - diff navigator has been disposed"),!this.canNavigate())return;this.nextIdx===-1?this._initIdx(e):e?(this.nextIdx+=1,this.nextIdx>=this.ranges.length&&(this.nextIdx=0)):(this.nextIdx-=1,this.nextIdx<0&&(this.nextIdx=this.ranges.length-1));const i=this.ranges[this.nextIdx];this.ignoreSelectionChange=!0;try{const n=i.range.getStartPosition();this._editor.setPosition(n),this._editor.revealRangeInCenter(i.range,t)}finally{this.ignoreSelectionChange=!1}}canNavigate(){return this.ranges&&this.ranges.length>0}next(e=0){this._move(!0,e)}previous(e=0){this._move(!1,e)}dispose(){super.dispose(),this.ranges=[],this.disposed=!0}}var lZ=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},cZ=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}},h1=globalThis&&globalThis.__awaiter||function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(d){try{c(i.next(d))}catch(h){r(h)}}function l(d){try{c(i.throw(d))}catch(h){r(h)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(o,e||[])).next())})};const u1=new ce("selectionAnchorSet",!1);let nl=class k5{constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=u1.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}static get(e){return e.getContribution(k5.ID)}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(oe.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Rn().appendText(p("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),un(p("anchorSet","Anchor set at {0}:{
2022-10-26 20:27:06 +08:00
. monaco - drag - image ,
. monaco - list$ { t } : focus . monaco - list - row . selected . focused { background - color : $ { e . listFocusAndSelectionBackground } ; }
` ),e.listFocusAndSelectionForeground&&i.push( `
. monaco - drag - image ,
. monaco - list$ { t } : focus . monaco - list - row . selected . focused { color : $ { e . listFocusAndSelectionForeground } ; }
` ),e.listInactiveFocusForeground&&(i.push( ` . monaco - list$ { t } . monaco - list - row . focused { color : $ { e . listInactiveFocusForeground } ; } ` ),i.push( ` . monaco - list$ { t } . monaco - list - row . focused : hover { color : $ { e . listInactiveFocusForeground } ; } ` )),e.listInactiveSelectionIconForeground&&i.push( ` . monaco - list$ { t } . monaco - list - row . focused . codicon { color : $ { e . listInactiveSelectionIconForeground } ; } ` ),e.listInactiveFocusBackground&&(i.push( ` . monaco - list$ { t } . monaco - list - row . focused { background - color : $ { e . listInactiveFocusBackground } ; } ` ),i.push( ` . monaco - list$ { t } . monaco - list - row . focused : hover { background - color : $ { e . listInactiveFocusBackground } ; } ` )),e.listInactiveSelectionBackground&&(i.push( ` . monaco - list$ { t } . monaco - list - row . selected { background - color : $ { e . listInactiveSelectionBackground } ; } ` ),i.push( ` . monaco - list$ { t } . monaco - list - row . selected : hover { background - color : $ { e . listInactiveSelectionBackground } ; } ` )),e.listInactiveSelectionForeground&&i.push( ` . monaco - list$ { t } . monaco - list - row . selected { color : $ { e . listInactiveSelectionForeground } ; } ` ),e.listHoverBackground&&i.push( ` . monaco - list$ { t } : not ( . drop - target ) . monaco - list - row : hover : not ( . selected ) : not ( . focused ) { background - color : $ { e . listHoverBackground } ; } ` ),e.listHoverForeground&&i.push( ` . monaco - list$ { t } . monaco - list - row : hover : not ( . selected ) : not ( . focused ) { color : $ { e . listHoverForeground } ; } ` ),e.listSelectionOutline&&i.push( ` . monaco - list$ { t } . monaco - list - row . selected { outline : 1 px dotted $ { e . listSelectionOutline } ; outline - offset : - 1 px ; } ` ),e.listFocusOutline&&i.push( `
. monaco - drag - image ,
. monaco - list$ { t } : focus . monaco - list - row . focused { outline : 1 px solid $ { e . listFocusOutline } ; outline - offset : - 1 px ; }
. monaco - workbench . context - menu - visible . monaco - list$ { t } . last - focused . monaco - list - row . focused { outline : 1 px solid $ { e . listFocusOutline } ; outline - offset : - 1 px ; }
` ),e.listInactiveFocusOutline&&i.push( ` . monaco - list$ { t } . monaco - list - row . focused { outline : 1 px dotted $ { e . listInactiveFocusOutline } ; outline - offset : - 1 px ; } ` ),e.listHoverOutline&&i.push( ` . monaco - list$ { t } . monaco - list - row : hover { outline : 1 px dashed $ { e . listHoverOutline } ; outline - offset : - 1 px ; } ` ),e.listDropBackground&&i.push( `
. monaco - list$ { t } . drop - target ,
. monaco - list$ { t } . monaco - list - rows . drop - target ,
. monaco - list$ { t } . monaco - list - row . drop - target { background - color : $ { e . listDropBackground } ! important ; color : inherit ! important ; }
` ),e.tableColumnsBorder&&i.push( `
. monaco - table : hover > . monaco - split - view2 ,
. monaco - table : hover > . monaco - split - view2 . monaco - sash . vertical : : before {
border - color : $ { e . tableColumnsBorder } ;
} ` ),e.tableOddRowsBackgroundColor&&i.push( `
. monaco - table . monaco - list - row [ data - parity = odd ] : not ( . focused ) : not ( . selected ) : not ( : hover ) . monaco - table - tr ,
. monaco - table . monaco - list : not ( : focus ) . monaco - list - row [ data - parity = odd ] . focused : not ( . selected ) : not ( : hover ) . monaco - table - tr ,
. monaco - table . monaco - list : not ( . focused ) . monaco - list - row [ data - parity = odd ] . focused : not ( . selected ) : not ( : hover ) . monaco - table - tr {
background - color : $ { e . tableOddRowsBackgroundColor } ;
}
` ),this.styleElement.textContent=i.join( `
2022-11-09 20:26:02 +08:00
` )}}const JZ={listFocusBackground:W.fromHex("#7FB0D0"),listActiveSelectionBackground:W.fromHex("#0E639C"),listActiveSelectionForeground:W.fromHex("#FFFFFF"),listActiveSelectionIconForeground:W.fromHex("#FFFFFF"),listFocusAndSelectionOutline:W.fromHex("#90C2F9"),listFocusAndSelectionBackground:W.fromHex("#094771"),listFocusAndSelectionForeground:W.fromHex("#FFFFFF"),listInactiveSelectionBackground:W.fromHex("#3F3F46"),listInactiveSelectionIconForeground:W.fromHex("#FFFFFF"),listHoverBackground:W.fromHex("#2A2D2E"),listDropBackground:W.fromHex("#383B3D"),treeIndentGuidesStroke:W.fromHex("#a9a9a9"),tableColumnsBorder:W.fromHex("#cccccc").transparent(.2),tableOddRowsBackgroundColor:W.fromHex("#cccccc").transparent(.04)},eY={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){}}};function tY(o,e){const t=o.indexOf(e);if(t===-1)return[];const i=[];let n=t-1;for(;n>=0&&o[n]===e-(t-n);)i.push(o[n--]);for(i.reverse(),n=t;n<o.length&&o[n]===e+(n-t);)i.push(o[n++]);return i}function bL(o,e){const t=[];let i=0,n=0;for(;i<o.length||n<e.length;)if(i>=o.length)t.push(e[n++]);else if(n>=e.length)t.push(o[i++]);else if(o[i]===e[n]){t.push(o[i]),i++,n++;continue}else o[i]<e[n]?t.push(o[i++]):t.push(e[n++]);return t}function iY(o,e){const t=[];let i=0,n=0;for(;i<o.length||n<e.length;)if(i>=o.length)t.push(e[n++]);else if(n>=e.length)t.push(o[i++]);else if(o[i]===e[n]){i++,n++;continue}else o[i]<e[n]?t.push(o[i++]):n++;return t}const fM=(o,e)=>o-e;class nY{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,n){let s=0;for(const r of this.renderers)r.renderElement(e,t,i[s++],n)}disposeElement(e,t,i,n){var s;let r=0;for(const a of this.renderers)(s=a.disposeElement)===null||s===void 0||s.call(a,e,t,i[r],n),r+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class sY{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e);n?i.setAttribute("aria-label",n):i.removeAttribute("aria-label");const s=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof s=="number"?i.setAttribute("aria-level", ` $ { s } ` ):i.removeAttribute("aria-level")}disposeTemplate(e){}}class oY{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){var i,n;(n=(i=this.dnd).onDragStart)===null||n===void 0||n.call(i,e,t)}onDragOver(e,t,i,n){return this.dnd.onDragOver(e,t,i,n)}onDragLeave(e,t,i,n){var s,r;(r=(s=this.dnd).onDragLeave)===null||r===void 0||r.call(s,e,t,i,n)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}drop(e,t,i,n){this.dnd.drop(e,t,i,n)}}class ir{constructor(e,t,i,n,s=eY){var r,a,l,c;this.user=e,this._options=s,this.focus=new Cv("focused"),this.anchor=new Cv("anchor"),this.eventBufferer=new Tx,this._ariaLabel="",this.disposables=new ee,this._onDidDispose=new O,this.onDidDispose=this._onDidDispose.event;const d=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(r=this._options.accessibilityProvider)===null||r===void 0?void 0:r.getWidgetRole():"list";this.selection=new GZ(d!=="listbox"),ea(s,JZ,!1);const h=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=s.accessibilityProvider,this.accessibilityProvider&&(h.push(new sY(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map(g=>new nY(g.templateId,[...h,g]));const u=Object.assign(Object.assign({},s),{dnd:s.dnd&&new oY(this,s.dnd)});if(this.view=new wo(t,i,n,u),this.view.domNode.setAttribute("role",d),
2022-10-26 20:27:06 +08:00
. monaco - editor . contentWidgets $ { m . lightBulb . cssSelector } {
color : $ { n } ;
background - color : $ { i } ;
2022-11-09 20:26:02 +08:00
} ` );const s=o.getColor(XH);s&&e.addRule( `
2022-10-26 20:27:06 +08:00
. monaco - editor . contentWidgets $ { m . lightbulbAutofix . cssSelector } {
color : $ { s } ;
background - color : $ { i } ;
2022-11-09 20:26:02 +08:00
} ` )});var hY=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},uY=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}},uS=globalThis&&globalThis.__awaiter||function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(d){try{c(i.next(d))}catch(h){r(h)}}function l(d){try{c(i.throw(d))}catch(h){r(h)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(o,e||[])).next())})},gY=globalThis&&globalThis.__classPrivateFieldSet||function(o,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?o!==e||!n:!e.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(o,t):n?n.value=t:e.set(o,t),t},fY=globalThis&&globalThis.__classPrivateFieldGet||function(o,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?o!==e||!i:!e.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(o):i?i.value:e.get(o)},a0;let wL=class extends z{constructor(e,t,i,n,s){super(),this._editor=e,this.delegate=n,this._activeCodeActions=this._register(new Vn),this.previewOn=!1,a0.set(this,!1),this._codeActionWidget=new eg(()=>this._register(s.createInstance(wv,this._editor,{onSelectCodeAction:(r,a)=>uS(this,void 0,void 0,function*(){this.previewOn?this.delegate.applyCodeAction(r,!0,Boolean(this.previewOn)):this.delegate.applyCodeAction(r,!0,Boolean(a.preview)),this.previewOn=!1})}))),this._lightBulbWidget=new eg(()=>{const r=this._register(s.createInstance(Sv,this._editor,t,i));return this._register(r.onClick(a=>this.showCodeActionList(a.trigger,a.actions,a,{includeDisabledActions:!1,fromLightbulb:!0}))),r})}dispose(){gY(this,a0,!0,"f"),super.dispose()}hideCodeActionWidget(){this._codeActionWidget.hasValue()&&this._codeActionWidget.getValue().hideCodeActionWidget()}onEnter(){this._codeActionWidget.hasValue()&&this._codeActionWidget.getValue().onEnterSet()}onPreviewEnter(){this.previewOn=!0,this.onEnter()}navigateList(e){this._codeActionWidget.hasValue()&&(e?this._codeActionWidget.getValue().navigateListWithKeysUp():this._codeActionWidget.getValue().navigateListWithKeysDown())}update(e){var t,i,n,s,r;return uS(this,void 0,void 0,function*(){if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let a;try{a=yield e.actions}catch(l){Ee(l);return}if(!fY(this,a0,"f"))if(this._lightBulbWidget.getValue().update(a,e.trigger,e.position),e.trigger.type===1){if(!((i=e.trigger.filter)===null||i===void 0)&&i.include){const c=this.tryGetValidActionToApply(e.trigger,a);if(c){try{this._lightBulbWidget.getValue().hide(),yield this.delegate.applyCodeAction(c,!1,!1)}finally{a.dispose()}return}if(e.trigger.context){const d=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,a);if(d&&d.action.disabled){(n=rs.get(this._editor))===null||n===void 0||n.showMessage(d.action.disabled,e.trigger.context.position),a.dispose();return}}}const l=!!(!((s=e.trigger.filter)===null||s===void 0)&&s.include);if(e.trigger.context&&(!a.allActions.length||!l&&!a.validActions.length)){(r=rs.get(this._editor))===null||r===void 0||r.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=a,a.dispose();return}this._activeCodeActions.value=a,this._codeActionWidget.getValue().show(e.trigger,a,e.position,{includeDisabledActions:l,fromLightbulb:!1})}else this._codeActionWidget.getValue().isVisible?a.dispose():this._activeCodeActions.value=a})}getInvalidActionThatWouldHaveBeenApplied(e
2022-10-26 20:27:06 +08:00
. monaco - editor . codelens - decoration . $ { this . _styleClassName } { line - height : $ { e } px ; font - size : $ { t } px ; padding - right : $ { Math . round ( t * . 5 ) } px ; font - feature - settings : var ( $ { r } ) }
. monaco - editor . codelens - decoration . $ { this . _styleClassName } span . codicon { line - height : $ { e } px ; font - size : $ { t } px ; }
2022-11-09 20:26:02 +08:00
` ;i&&(a+= ` . monaco - editor . codelens - decoration . $ { this . _styleClassName } { font - family : var ( $ { s } ) , $ { ns . fontFamily } } ` ),this._styleElement.textContent=a,this._editor.getContainerDomNode().style.setProperty(s,i!=null?i:"inherit"),this._editor.getContainerDomNode().style.setProperty(r,n.fontFeatureSettings),this._editor.changeViewZones(l=>{for(const c of this._lenses)c.updateHeight(e,l)})}_localDispose(){var e,t,i;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(i=this._currentCodeLensModel)===null||i===void 0||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(14))return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&this._localToDispose.add(Hd(()=>{const n=this._codeLensCache.get(e);t===n&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3));return}for(const n of this._languageFeaturesService.codeLensProvider.all(e))if(typeof n.onDidChange=="function"){const s=n.onDidChange(()=>i.schedule());this._localToDispose.add(s)}const i=new ft(()=>{var n;const s=Date.now();(n=this._getCodeLensModelPromise)===null||n===void 0||n.cancel(),this._getCodeLensModelPromise=Ti(r=>Y5(this._languageFeaturesService.codeLensProvider,e,r)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r);const a=this._provideCodeLensDebounce.update(e,Date.now()-s);i.delay=a,this._renderCodeLensSymbols(r),this._resolveCodeLensesInViewportSoon()},Ee)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(ze(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._editor.changeDecorations(n=>{this._editor.changeViewZones(s=>{const r=[];let a=-1;this._lenses.forEach(c=>{!c.isValid()||a===c.getLineNumber()?r.push(c):(c.update(s),a=c.getLineNumber())});const l=new mS;r.forEach(c=>{c.dispose(l,s),this._lenses.splice(this._lenses.indexOf(c),1)}),l.commit(n)})}),i.schedule()})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidScrollChange(n=>{n.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(ze(()=>{if(this._editor.getModel()){const n=uc.capture(this._editor);this._editor.changeDecorations(s=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(s,r)})}),n.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(n=>{if(n.target.type!==9)return;let s=n.target.element;if((s==null?void 0:s.tagName)==="SPAN"&&(s=s.parentElement),(s==null?void 0:s.tagName)==="A")for(const r of this._lenses){const a=r.getCommand(s);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new mS;for(const n of this._lenses)n.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let n;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(n&&n[n.length-1].symbol.range.startLineNumber===l?n.push(a):(n=[a],i.push(n)))}const s=uc.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new mS;let d=0,h=0;for(;h<i.length&&d<this._lenses.length;){const u=i[h][0].symbol.range.startLineNumber,g=this._lenses[d].getLineNumber();g<u?(this._lenses[d].dispose(c,l),this._lenses.splice(d,1)):g===u?(this._lenses[d]
[ { 1 } ] { 2 } ` ,s,SE.modifierLabels[Os].altKey,c)}return s}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){var t;this._itemClassDispose.value=void 0;const{element:i,label:n}=this;if(!i||!n)return;const s=this._commandAction.checked&&((t=e.toggled)===null||t===void 0?void 0:t.icon)?e.toggled.icon:e.icon;if(!!s)if(nt.isThemeIcon(s)){const r=nt.asClassNameArray(s);n.classList.add(...r),this._itemClassDispose.value=ze(()=>{n.classList.remove(...r)})}else n.style.backgroundImage=Xx(this._themeService.getColorTheme().type)?Od(s.dark):Od(s.light),n.classList.add("icon"),this._itemClassDispose.value=Pr(ze(()=>{n.style.backgroundImage="",n.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};_g=yE([Rs(2,rn),Rs(3,gi),Rs(4,xe),Rs(5,vt),Rs(6,cl)],_g);let IL=class extends nF{constructor(e,t,i,n){var s,r;const a=Object.assign({},t!=null?t:Object.create(null),{menuAsChild:(s=t==null?void 0:t.menuAsChild)!==null&&s!==void 0?s:!1,classNames:(r=t==null?void 0:t.classNames)!==null&&r!==void 0?r:nt.isThemeIcon(e.item.icon)?nt.asClassName(e.item.icon):void 0});super(e,{getActions:()=>e.actions},i,a),this._contextMenuService=i,this._themeService=n}render(e){super.render(e),gt(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!nt.isThemeIcon(i)){this.element.classList.add("icon");const n=()=>{this.element&&(this.element.style.backgroundImage=Xx(this._themeService.getColorTheme().type)?Od(i.dark):Od(i.light))};n(),this._register(this._themeService.onDidColorThemeChange(()=>{n()}))}}};IL=yE([Rs(2,cl),Rs(3,vt)],IL);let EL=class extends wr{constructor(e,t,i,n,s,r,a,l){var c,d,h;super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=s,this._menuService=r,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey= ` $ { e . item . submenu . id } _lastActionId ` ;let u;const g=l.get(this._storageKey,1);g&&(u=e.actions.find(_=>g===_.id)),u||(u=e.actions[0]),this._defaultAction=this._instaService.createInstance(_g,u,{keybinding:this._getDefaultActionKeybindingLabel(u)});const f=Object.assign({},t!=null?t:Object.create(null),{menuAsChild:(c=t==null?void 0:t.menuAsChild)!==null&&c!==void 0?c:!0,classNames:(d=t==null?void 0:t.classNames)!==null&&d!==void 0?d:["codicon","codicon-chevron-down"],actionRunner:(h=t==null?void 0:t.actionRunner)!==null&&h!==void 0?h:new Ju});this._dropdown=new nF(e,e.actions,this._contextMenuService,f),this._dropdown.actionRunner.onDidRun(_=>{_.action instanceof ac&&this.update(_.action)})}update(e){this._storageService.store(this._storageKey,e.id,1,0),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(_g,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends Ju{runAction(t,i){return sF(this,void 0,void 0,function*(){yield t.run(void 0)})}},this._container&&this._defaultAction.render(mB(this._container,se(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let i;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){const n=this._keybindingService.lookupKeybinding(e.id);n&&(i= ` ( $ { n . getLabel ( ) } ) ` )}return i}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=se(".action-container");this._defaultAction.render(G(this._container,t)),this._register(q(t,le.KEY_DOWN,n=>{const s=new Mt(n);s.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),s.stopPropagation())}));const i=se(".dropdown-action-container");this._dropdown.render(G(this._container,i)),this._register(q(i,le.KEY_DOWN,n=>{var s;const r=new Mt(n);r.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocu
2022-10-26 20:27:06 +08:00
top : $ { this . virtualDelegate . headerRowHeight + 1 } px ;
height : calc ( 100 % - $ { this . virtualDelegate . headerRowHeight } px ) ;
} ` ),this.styleElement.textContent=t.join( `
2022-11-09 20:26:02 +08:00
` ),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}w1.InstanceCount=0;const BX={inputActiveOptionBorder:W.fromHex("#007ACC00"),inputActiveOptionForeground:W.fromHex("#FFFFFF"),inputActiveOptionBackground:W.fromHex("#0E639C50")};class h_ extends tr{constructor(e){super(),this._onChange=this._register(new O),this.onChange=this._onChange.event,this._onKeyDown=this._register(new O),this.onKeyDown=this._onKeyDown.event,this._opts=Object.assign(Object.assign({},BX),e),this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...Cn.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this.domNode.title=this._opts.title,this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,i=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),i.preventDefault())}),this.ignoreGesture(this.domNode),this.onkeydown(this.domNode,i=>{if(i.keyCode===10||i.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault(),i.stopPropagation();return}this._onKeyDown.fire(i)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 2+2+2+16}style(e){e.inputActiveOptionBorder&&(this._opts.inputActiveOptionBorder=e.inputActiveOptionBorder),e.inputActiveOptionForeground&&(this._opts.inputActiveOptionForeground=e.inputActiveOptionForeground),e.inputActiveOptionBackground&&(this._opts.inputActiveOptionBackground=e.inputActiveOptionBackground),this.applyStyles()}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder?this._opts.inputActiveOptionBorder.toString():"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground?this._opts.inputActiveOptionForeground.toString():"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground?this._opts.inputActiveOptionBackground.toString():"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const WX=p("caseDescription","Match Case"),VX=p("wordsDescription","Match Whole Word"),HX=p("regexDescription","Use Regular Expression");class uF extends h_{constructor(e){super({icon:m.caseSensitive,title:WX+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class gF extends h_{constructor(e){super({icon:m.wholeWord,title:VX+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class fF extends h_{constructor(e){super({icon:m.regex,title:HX+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}function zX(o,e={}){const t=LE(e);return t.textContent=o,t}function UX(o,e={}){const t=LE(e);return pF(t,jX(o,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function LE(o){const e=o.inline?"span":"div",t=document.createElement(e);return o.className&&(t.className=o.className),t}class $ X{constructor(e){this.source=e,this.
` )n.type===2&&(n=s.pop()),n.children.push({type:8});else if(n.type!==2){const c={type:2,content:a};n.children.push(c),s.push(n),n=c}else n.content+=a}return n.type===2&&(n=s.pop()),t}function KX(o,e){return NL(o,e)!==0}function NL(o,e){switch(o){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case" ` ":return e?7:0;default:return 0}}class qX{constructor(e,t=0,i=e.length,n=t-1){this.items=e,this.start=t,this.end=i,this.index=n}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class GX{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._currentPosition()!==this._elements.length-1?this._navigator.next():null}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new qX(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}}const wf=se,ZX={inputBackground:W.fromHex(" # 3 C3C3C "),inputForeground:W.fromHex(" # CCCCCC "),inputValidationInfoBorder:W.fromHex(" # 55 AAFF "),inputValidationInfoBackground:W.fromHex(" # 063 B49 "),inputValidationWarningBorder:W.fromHex(" # B89500 "),inputValidationWarningBackground:W.fromHex(" # 352 A05 "),inputValidationErrorBorder:W.fromHex(" # BE1100 "),inputValidationErrorBackground:W.fromHex(" # 5 A1D1D ")};class mF extends tr{constructor(e,t,i){var n;super(),this.state=" idle ",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new O),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new O),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i||Object.create(null),ea(this.options,ZX,!1),this.message=null,this.placeholder=this.options.placeholder||" ",this.tooltip=(n=this.options.tooltip)!==null&&n!==void 0?n:this.placeholder||" ",this.ariaLabel=this.options.ariaLabel||" ",this.inputBackground=this.options.inputBackground,this.inputForeground=this.options.inputForeground,this.inputBorder=this.options.inputBorder,this.inputValidationInfoBorder=this.options.inputValidationInfoBorder,this.inputValidationInfoBackground=this.options.inputValidationInfoBackground,this.inputValidationInfoForeground=this.options.inputValidationInfoForeground,this.inputValidationWarningBorder=this.options.inputValidationWarningBorder,this.inputValidationWarningBackground=this.options.inputValidationWarningBackground,this.inputValidationWarningForeground=this.options.inputValidationWarningForeground,this.inputValidationErrorBorder=this.options.inputValidationErrorBorder,this.inputValidationErrorBackground=this.options.inputValidationErrorBackground,this.inputValidationErrorForeground=this.options.inputValidationErrorForeground,this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=G(e,wf(" . monaco - inputbox . idle "));const s=this.options.flexibleHeight?" textarea ":" input ",r=G(this.element,wf(" . ibwrapper "));if(this.input=G(r,wf(s+" . input . empty ")),this.input.setAttribute(" autocorrect "," off "),this.input.setAttribute(" autocapitalize "," off "),this.input.setAttribute(" spellcheck "," false "),this.onfocus(this.input,()=>this.element.classList.add(" synthetic - focus " ) ) , this . onblur ( this . input , ( ) => this . element . classList . re
` ),(t=this.findController)===null||t===void 0||t.style(e),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const i=e.map(s=>this.model.getNode(s));this.selection.set(i,t);const n=e.map(s=>this.model.getListIndex(s)).filter(s=>s>-1);this.view.setSelection(n,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const i=e.map(s=>this.model.getNode(s));this.focus.set(i,t);const n=e.map(s=>this.model.getListIndex(s)).filter(s=>s>-1);this.view.setFocus(n,t,!0)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);i!==-1&&this.view.reveal(i,t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const r=this.model.getParentNodeLocation(n);if(!r)return;const a=this.model.getListIndex(r);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some(l=>l.visible))return;const[r]=this.view.getFocus(),a=r+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i),s=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,s)}dispose(){et(this.disposables),this.view.dispose()}}class IE{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new JX(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(n,s){return i.sorter.compare(n.element,s.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=Ue.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=Ue.empty(),i){const n=new Set,s=new Set,r=l=>{var c;if(l.element===null)return;const d=l;if(n.add(d.element),this.nodes.set(d.element,d),this.identityProvider){const h=this.identityProvider.getId(d.element).toString();s.add(h),this.nodesByIdentity.set(h,d)}(c=i.onDidCreateNode)===null||c===void 0||c.call(i,d)},a=l=>{var c;if(l.element===null)return;const d=l;if(n.has(d.element)||this.nodes.delete(d.element),this.identityProvider){const h=this.identityProvider.getId(d.element).toString();s.has(h)||this.nodesByIdentity.delete(h)}(c=i.onDidDeleteNode)===null||c===void 0||c.call(i,d)};this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:r,onDidDeleteNode:a}))}preserveCollapseState(e=Ue.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),Ue.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const r=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(r)}if(!i)return Object.assign(Object.assign({},t),{children:this.preserveCollapseState(t.children)});const n=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible,s=typeof t.collapsed!="undefined"?t.collapsed:i.collapsed;return Object.assign(Object.assign({},t),{collapsible:n,collapsed:s,children:this.preserveCollapseState(t.children)})})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);re
` ?-1:0,r+=i;for(const a of t)a.end<=r||(a.start>=r&&(a.start+=n),a.end>=r&&(a.end+=n));return i+=n," \u 23CE"})}}class LS{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class Tv extends z{constructor(e,t){super(),this.customHovers=new Map,this.domNode=this._register(new LS(G(e,se(".monaco-icon-label")))),this.labelContainer=G(this.domNode.element,se(".monaco-icon-label-container"));const i=G(this.labelContainer,se("span.monaco-icon-name-container"));this.descriptionContainer=this._register(new LS(G(this.labelContainer,se("span.monaco-icon-description-container")))),(t==null?void 0:t.supportHighlights)||(t==null?void 0:t.supportIcons)?this.nameNode=new UQ(i,!!t.supportIcons):this.nameNode=new HQ(i),t!=null&&t.supportDescriptionHighlights?this.descriptionNodeFactory=()=>new Qd(G(this.descriptionContainer.element,se("span.label-description")),{supportIcons:!!t.supportIcons}):this.descriptionNodeFactory=()=>this._register(new LS(G(this.descriptionContainer.element,se("span.label-description")))),this.hoverDelegate=t==null?void 0:t.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,i){const n=["monaco-icon-label"];i&&(i.extraClasses&&n.push(...i.extraClasses),i.italic&&n.push("italic"),i.strikethrough&&n.push("strikethrough")),this.domNode.className=n.join(" "),this.setupHover(i!=null&&i.descriptionTitle?this.labelContainer:this.element,i==null?void 0:i.title),this.nameNode.setLabel(e,i),(t||this.descriptionNode)&&(this.descriptionNode||(this.descriptionNode=this.descriptionNodeFactory()),this.descriptionNode instanceof Qd?(this.descriptionNode.set(t||"",i?i.descriptionMatches:void 0),this.setupHover(this.descriptionNode.element,i==null?void 0:i.descriptionTitle)):(this.descriptionNode.textContent=t||"",this.setupHover(this.descriptionNode.element,(i==null?void 0:i.descriptionTitle)||""),this.descriptionNode.empty=!t))}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(!this.hoverDelegate)PG(e,t);else{const n=f5(this.hoverDelegate,e,t);n&&this.customHovers.set(e,n)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}}class HQ{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&& $ s(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=G(this.container,se("a.label-name",{id:t==null?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i<e.length;i++){const n=e[i],s=(t==null?void 0:t.domId)&& ` $ { t == null ? void 0 : t . domId } _$ { i } ` ;G(this.container,se("a.label-name",{id:s,"data-icon-label-count":e.length,"data-icon-label-index":i,role:"treeitem"},n)),i<e.length-1&&G(this.container,se("span.label-separator",void 0,(t==null?void 0:t.separator)||"/"))}}}}function zQ(o,e,t){if(!t)return;let i=0;return o.map(n=>{const s={start:i,end:i+n.length},r=t.map(a=>Gi.intersect(s,a)).filter(a=>!Gi.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=s.end+e.length,r})}class UQ{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&& $ s(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=new Qd(G(this.container,se("a.label-name",{id:t==null?void 0:t.domId})),{supportIcons:this.supportIcons})),this.singleLabel.set(e,t==null?void 0:t.matches,void 0,t==null?void 0:t.l
2022-10-26 20:27:06 +08:00
In order to be iterable , non - array objects must have a [ Symbol . iterator ] ( ) method . ` )}function a(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults=a();function l(Z){e.defaults=Z}var c=/[&<>"']/,d=/[&<>"']/g,h=/[<>"']|&(?!#? \w +;)/,u=/[<>"']|&(?!#? \w +;)/g,g={"&":"&","<":"<",">":">",'"':""","'":"'"},f=function(U){return g[U]};function _(Z,U){if(U){if(c.test(Z))return Z.replace(d,f)}else if(h.test(Z))return Z.replace(u,f);return Z}var b=/&(#(?: \d +)|(?:#x[0-9A-Fa-f]+)|(?: \w +));?/ig;function v(Z){return Z.replace(b,function(U,j){return j=j.toLowerCase(),j==="colon"?":":j.charAt(0)==="#"?j.charAt(1)==="x"?String.fromCharCode(parseInt(j.substring(2),16)):String.fromCharCode(+j.substring(1)):""})}var C=/(^|[^ \[ ]) \^ /g;function w(Z,U){Z=typeof Z=="string"?Z:Z.source,U=U||"";var j={replace:function(M,V){return V=V.source||V,V=V.replace(C," $ 1"),Z=Z.replace(M,V),j},getRegex:function(){return new RegExp(Z,U)}};return j}var S=/[^ \w :]/g,k=/^ $ |^[a-z][a-z0-9+.-]*:|^[?#]/i;function x(Z,U,j){if(Z){var E;try{E=decodeURIComponent(v(j)).replace(S,"").toLowerCase()}catch(M){return null}if(E.indexOf("javascript:")===0||E.indexOf("vbscript:")===0||E.indexOf("data:")===0)return null}U&&!k.test(j)&&(j=P(U,j));try{j=encodeURI(j).replace(/%25/g,"%")}catch(M){return null}return j}var y={},D=/^[^:]+: \/ *[^/]* $ /,I=/^([^:]+:)[ \s \S ]* $ /,R=/^([^:]+: \/ *[^/]*)[ \s \S ]* $ /;function P(Z,U){y[" "+Z]||(D.test(Z)?y[" "+Z]=Z+"/":y[" "+Z]=ae(Z,"/",!0)),Z=y[" "+Z];var j=Z.indexOf(":")===-1;return U.substring(0,2)==="//"?j?U:Z.replace(I," $ 1")+U:U.charAt(0)==="/"?j?U:Z.replace(R," $ 1")+U:Z+U}var H={exec:function(){}};function $ (Z){for(var U=1,j,E;U<arguments.length;U++){j=arguments[U];for(E in j)Object.prototype.hasOwnProperty.call(j,E)&&(Z[E]=j[E])}return Z}function ne(Z,U){var j=Z.replace(/ \| /g,function(V,F,Y){for(var ie=!1,ye=F;--ye>=0&&Y[ye]===" \\ ";)ie=!ie;return ie?"|":" |"}),E=j.split(/ \| /),M=0;if(E[0].trim()||E.shift(),E.length>0&&!E[E.length-1].trim()&&E.pop(),E.length>U)E.splice(U);else for(;E.length<U;)E.push("");for(;M<E.length;M++)E[M]=E[M].trim().replace(/ \\ \| /g,"|");return E}function ae(Z,U,j){var E=Z.length;if(E===0)return"";for(var M=0;M<E;){var V=Z.charAt(E-M-1);if(V===U&&!j)M++;else if(V!==U&&j)M++;else break}return Z.slice(0,E-M)}function de(Z,U){if(Z.indexOf(U[1])===-1)return-1;for(var j=Z.length,E=0,M=0;M<j;M++)if(Z[M]===" \\ ")M++;else if(Z[M]===U[0])E++;else if(Z[M]===U[1]&&(E--,E<0))return M;return-1}function we(Z){Z&&Z.sanitize&&!Z.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function Se(Z,U){if(U<1)return"";for(var j="";U>1;)U&1&&(j+=Z),U>>=1,Z+=Z;return j+Z}function Me(Z,U,j,E){var M=U.href,V=U.title?_(U.title):null,F=Z[1].replace(/ \\ ([ \[ \] ])/g," $ 1");if(Z[0].charAt(0)!=="!"){E.state.inLink=!0;var Y={type:"link",raw:j,href:M,title:V,text:F,tokens:E.inlineTokens(F,[])};return E.state.inLink=!1,Y}return{type:"image",raw:j,href:M,title:V,text:_(F)}}function St(Z,U){var j=Z.match(/^( \s +)(?: ` ` ` ) / ) ; if ( j === null ) return U ; var E = j [ 1 ] ; return U . split ( `
` ).map(function(M){var V=M.match(/^ \s +/);if(V===null)return M;var F=V[0];return F.length>=E.length?M.slice(E.length):M}).join( `
` )}var mt=function(){function Z(j){this.options=j||e.defaults}var U=Z.prototype;return U.space=function(E){var M=this.rules.block.newline.exec(E);if(M&&M[0].length>0)return{type:"space",raw:M[0]}},U.code=function(E){var M=this.rules.block.code.exec(E);if(M){var V=M[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:M[0],codeBlockStyle:"indented",text:this.options.pedantic?V:ae(V, `
2022-11-09 20:26:02 +08:00
` )}}},U.fences=function(E){var M=this.rules.block.fences.exec(E);if(M){var V=M[0],F=St(V,M[3]||"");return{type:"code",raw:V,lang:M[2]?M[2].trim():M[2],text:F}}},U.heading=function(E){var M=this.rules.block.heading.exec(E);if(M){var V=M[2].trim();if(/# $ /.test(V)){var F=ae(V,"#");(this.options.pedantic||!F||/ $ /.test(F))&&(V=F.trim())}var Y={type:"heading",raw:M[0],depth:M[1].length,text:V,tokens:[]};return this.lexer.inline(Y.text,Y.tokens),Y}},U.hr=function(E){var M=this.rules.block.hr.exec(E);if(M)return{type:"hr",raw:M[0]}},U.blockquote=function(E){var M=this.rules.block.blockquote.exec(E);if(M){var V=M[0].replace(/^ *>[ \t ]?/gm,"");return{type:"blockquote",raw:M[0],tokens:this.lexer.blockTokens(V,[]),text:V}}},U.list=function(E){var M=this.rules.block.list.exec(E);if(M){var V,F,Y,ie,ye,ve,Fe,Pe,Ct,at,De,pi,Gt=M[1].trim(),Ns=Gt.length>1,zt={type:"list",raw:"",ordered:Ns,start:Ns?+Gt.slice(0,-1):"",loose:!1,items:[]};Gt=Ns?" \\ d{1,9} \\ "+Gt.slice(-1):" \\ "+Gt,this.options.pedantic&&(Gt=Ns?Gt:"[*+-]");for(var Oi=new RegExp("^( {0,3}"+Gt+")((?:[ ][^ \\ n]*)?(?: \\ n| $ ))");E&&(pi=!1,!(!(M=Oi.exec(E))||this.rules.block.hr.test(E)));){if(V=M[0],E=E.substring(V.length),Pe=M[2].split( `
2022-10-26 20:27:06 +08:00
` ,1)[0],Ct=E.split( `
` ,1)[0],this.options.pedantic?(ie=2,De=Pe.trimLeft()):(ie=M[2].search(/[^ ]/),ie=ie>4?1:ie,De=Pe.slice(ie),ie+=M[1].length),ve=!1,!Pe&&/^ * $ /.test(Ct)&&(V+=Ct+ `
2022-11-09 20:26:02 +08:00
` ,E=E.substring(Ct.length+1),pi=!0),!pi)for(var Rc=new RegExp("^ {0,"+Math.min(3,ie-1)+"}(?:[*+-]| \\ d{1,9}[.)])((?: [^ \\ n]*)?(?: \\ n| $ ))"),ds=new RegExp("^ {0,"+Math.min(3,ie-1)+"}((?:- *){3,}|(?:_ *){3,}|(?: \\ * *){3,})(?: \\ n+| $ )");E&&(at=E.split( `
` ,1)[0],Pe=at,this.options.pedantic&&(Pe=Pe.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(Rc.test(Pe)||ds.test(E)));){if(Pe.search(/[^ ]/)>=ie||!Pe.trim())De+= `
2022-10-26 20:27:06 +08:00
` +Pe.slice(ie);else if(!ve)De+= `
` +Pe;else break;!ve&&!Pe.trim()&&(ve=!0),V+=at+ `
2022-11-09 20:26:02 +08:00
` ,E=E.substring(at.length+1)}zt.loose||(Fe?zt.loose=!0:/ \n * \n * $ /.test(V)&&(Fe=!0)),this.options.gfm&&(F=/^ \[ [ xX] \] /.exec(De),F&&(Y=F[0]!=="[ ] ",De=De.replace(/^ \[ [ xX] \] +/,""))),zt.items.push({type:"list_item",raw:V,task:!!F,checked:Y,loose:!1,text:De}),zt.raw+=V}zt.items[zt.items.length-1].raw=V.trimRight(),zt.items[zt.items.length-1].text=De.trimRight(),zt.raw=zt.raw.trimRight();var rr=zt.items.length;for(ye=0;ye<rr;ye++){this.lexer.state.top=!1,zt.items[ye].tokens=this.lexer.blockTokens(zt.items[ye].text,[]);var oa=zt.items[ye].tokens.filter(function(gl){return gl.type==="space"}),Oc=oa.every(function(gl){for(var Pc=gl.raw.split(""),to=0,k_=r(Pc),of;!(of=k_()).done;){var x_=of.value;if(x_=== `
` &&(to+=1),to>1)return!0}return!1});!zt.loose&&oa.length&&Oc&&(zt.loose=!0,zt.items[ye].loose=!0)}return zt}},U.html=function(E){var M=this.rules.block.html.exec(E);if(M){var V={type:"html",raw:M[0],pre:!this.options.sanitizer&&(M[1]==="pre"||M[1]==="script"||M[1]==="style"),text:M[0]};return this.options.sanitize&&(V.type="paragraph",V.text=this.options.sanitizer?this.options.sanitizer(M[0]):_(M[0]),V.tokens=[],this.lexer.inline(V.text,V.tokens)),V}},U.def=function(E){var M=this.rules.block.def.exec(E);if(M){M[3]&&(M[3]=M[3].substring(1,M[3].length-1));var V=M[1].toLowerCase().replace(/ \s +/g," ");return{type:"def",tag:V,raw:M[0],href:M[2],title:M[3]}}},U.table=function(E){var M=this.rules.block.table.exec(E);if(M){var V={type:"table",header:ne(M[1]).map(function(Fe){return{text:Fe}}),align:M[2].replace(/^ *| \| * $ /g,"").split(/ * \| */),rows:M[3]&&M[3].trim()?M[3].replace(/ \n [ \t ]* $ /,"").split( `
2022-10-26 20:27:06 +08:00
` ):[]};if(V.header.length===V.align.length){V.raw=M[0];var F=V.align.length,Y,ie,ye,ve;for(Y=0;Y<F;Y++)/^ *-+: * $ /.test(V.align[Y])?V.align[Y]="right":/^ *:-+: * $ /.test(V.align[Y])?V.align[Y]="center":/^ *:-+ * $ /.test(V.align[Y])?V.align[Y]="left":V.align[Y]=null;for(F=V.rows.length,Y=0;Y<F;Y++)V.rows[Y]=ne(V.rows[Y],V.header.length).map(function(Fe){return{text:Fe}});for(F=V.header.length,ie=0;ie<F;ie++)V.header[ie].tokens=[],this.lexer.inline(V.header[ie].text,V.header[ie].tokens);for(F=V.rows.length,ie=0;ie<F;ie++)for(ve=V.rows[ie],ye=0;ye<ve.length;ye++)ve[ye].tokens=[],this.lexer.inline(ve[ye].text,ve[ye].tokens);return V}}},U.lheading=function(E){var M=this.rules.block.lheading.exec(E);if(M){var V={type:"heading",raw:M[0],depth:M[2].charAt(0)==="="?1:2,text:M[1],tokens:[]};return this.lexer.inline(V.text,V.tokens),V}},U.paragraph=function(E){var M=this.rules.block.paragraph.exec(E);if(M){var V={type:"paragraph",raw:M[0],text:M[1].charAt(M[1].length-1)=== `
` ?M[1].slice(0,-1):M[1],tokens:[]};return this.lexer.inline(V.text,V.tokens),V}},U.text=function(E){var M=this.rules.block.text.exec(E);if(M){var V={type:"text",raw:M[0],text:M[0],tokens:[]};return this.lexer.inline(V.text,V.tokens),V}},U.escape=function(E){var M=this.rules.inline.escape.exec(E);if(M)return{type:"escape",raw:M[0],text:_(M[1])}},U.tag=function(E){var M=this.rules.inline.tag.exec(E);if(M)return!this.lexer.state.inLink&&/^<a /i.test(M[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^< \/ a>/i.test(M[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)( \s |>)/i.test(M[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^< \/ (pre|code|kbd|script)( \s |>)/i.test(M[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:M[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(M[0]):_(M[0]):M[0]}},U.link=function(E){var M=this.rules.inline.link.exec(E);if(M){var V=M[2].trim();if(!this.options.pedantic&&/^</.test(V)){if(!/> $ /.test(V))return;var F=ae(V.slice(0,-1)," \\ ");if((V.length-F.length)%2===0)return}else{var Y=de(M[2],"()");if(Y>-1){var ie=M[0].indexOf("!")===0?5:4,ye=ie+M[1].length+Y;M[2]=M[2].substring(0,Y),M[0]=M[0].substring(0,ye).trim(),M[3]=""}}var ve=M[2],Fe="";if(this.options.pedantic){var Pe=/^([^'"]*[^ \s ]) \s +(['"])(.*) \2 /.exec(ve);Pe&&(ve=Pe[1],Fe=Pe[3])}else Fe=M[3]?M[3].slice(1,-1):"";return ve=ve.trim(),/^</.test(ve)&&(this.options.pedantic&&!/> $ /.test(V)?ve=ve.slice(1):ve=ve.slice(1,-1)),Me(M,{href:ve&&ve.replace(this.rules.inline._escapes," $ 1"),title:Fe&&Fe.replace(this.rules.inline._escapes," $ 1")},M[0],this.lexer)}},U.reflink=function(E,M){var V;if((V=this.rules.inline.reflink.exec(E))||(V=this.rules.inline.nolink.exec(E))){var F=(V[2]||V[1]).replace(/ \s +/g," ");if(F=M[F.toLowerCase()],!F||!F.href){var Y=V[0].charAt(0);return{type:"text",raw:Y,text:Y}}return Me(V,F,V[0],this.lexer)}},U.emStrong=function(E,M,V){V===void 0&&(V="");var F=this.rules.inline.emStrong.lDelim.exec(E);if(!!F&&!(F[3]&&V.match(/(?:[0-9A-Za-z \x AA \x B2 \x B3 \x B5 \x B9 \x BA \x BC- \x BE \x C0- \x D6 \x D8- \x F6 \x F8- \u 02C1 \u 02C6- \u 02D1 \u 02E0- \u 02E4 \u 02EC \u 02EE \u 0370- \u 0374 \u 0376 \u 0377 \u 037A- \u 037D \u 037F \u 0386 \u 0388- \u 038A \u 038C \u 038E- \u 03A1 \u 03A3- \u 03F5 \u 03F7- \u 0481 \u 048A- \u 052F \u 0531- \u 0556 \u 0559 \u 0560- \u 0588 \u 05D0- \u 05EA \u 05EF- \u 05F2 \u 0620- \u 064A \u 0660- \u 0669 \u 066E \u 066F \u 0671- \u 06D3 \u 06D5 \u 06E5 \u 06E6 \u 06EE- \u 06FC \u 06FF \u 0710 \u 0712- \u 072F \u 074D- \u 07A5 \u 07B1 \u 07C0- \u 07EA \u 07F4 \u 07F5 \u 07FA \u 0800- \u 0815 \u 081A \u 0824 \u 0828 \u 0840- \u 0858 \u 0860- \u 086A \u 0870- \u 0887 \u 0889- \u 088E \u 08A0- \u 08C9 \u 0904- \u 0939 \u 093D \u 0950 \u 0958- \u 0961 \u 0966- \u 096F \u 0971- \u 0980 \u 0985- \u 098C \u 098F \u 0990 \u 0993- \u 09A8 \u 09AA- \u 09B0 \u 09B2 \u 09B6- \u 09B9 \u 09BD \u 09CE \u 09DC \u 09DD \u 09DF- \u 09E1 \u 09E6- \u 09F1 \u 09F4- \u 09F9 \u 09FC \u 0A05- \u 0A0A \u 0A0F \u 0A10 \u 0A13- \u 0A28 \u 0A2A- \u 0A30 \u 0A32 \u 0A33 \u 0A35 \u 0A36 \u 0A38 \u 0A39 \u 0A59- \u 0A5C \u 0A5E \u 0A66- \u 0A6F \u 0A72- \u 0A74 \u 0A85- \u 0A8D \u 0A8F- \u 0A91 \u 0A93- \u 0AA8 \u 0AAA- \u 0AB0 \u 0AB2 \u 0AB3 \u 0AB5- \u 0AB9 \u 0ABD \u 0AD0 \u 0AE0 \u 0AE1 \u 0AE6- \u 0AEF \u 0AF9 \u 0B05- \u 0B0C \u 0B0F \u 0B10 \u 0B13- \u 0B28 \u 0B2A- \u 0B30 \u 0B32 \u 0B33 \u 0B35- \u 0B39 \u 0B3D \u 0B5C \u 0B5D \u 0B5F- \u 0B61 \u 0B66- \u 0B6F \u 0B71- \u 0B77 \u 0B83 \u 0B85- \u 0B8A \u 0B8E- \u 0B90 \u 0B92- \u 0B95 \u 0B99 \u 0B9A \u 0B9C \u 0B9E \u 0B9F \u 0BA3 \u 0BA4 \u 0BA8- \u 0BAA \u 0BAE- \u 0BB9 \u 0BD0 \u 0BE6- \u 0BF2 \u 0C05- \u 0C0C \u 0C0E- \u 0C10 \u 0C12- \u 0C28 \u 0C2A- \u 0C39 \u 0C3D \u 0C58- \u 0C5A \u 0C5D \u 0C60 \u 0C61 \u 0C66- \u 0C6F \u 0C78- \u 0C7E \u 0C80 \u 0C85- \u 0C8C \u 0C8E- \u 0C90 \u 0C92- \u 0CA8 \u 0CAA- \u 0CB3 \u 0CB5- \u 0CB9 \u 0CBD \u 0CDD \u 0CDE \u 0CE0 \u 0CE1 \u 0CE6- \u 0CEF \u 0CF1 \u 0CF2 \u 0D04- \u 0D0C \u 0D0E- \u 0D10 \u 0D12- \u 0D3A \u 0D3D \u 0D4E \u 0D54- \u 0D56 \u 0D58- \u 0D61 \u 0D66- \u 0D78 \u 0D7A- \u 0D7F \u 0D85- \u 0D96 \u 0D9A- \u 0DB1 \u 0DB3- \u 0DBB \u 0DBD \u 0DC0- \u 0DC6 \u 0DE6- \u 0DEF \u 0E01- \u 0E30 \u 0E32 \u 0E33 \u 0E40- \u 0E46 \u 0E50- \u 0E59 \u 0E81 \u 0E82 \u 0E84 \u 0E86- \u 0E8A \u 0E8C- \u 0EA3 \u 0EA5 \u 0EA7- \u 0EB0 \u 0EB2 \u 0EB3 \u 0EBD \u 0EC0- \u 0EC4 \u 0EC6 \u 0ED0- \u 0ED9 \u 0EDC- \u 0EDF \u 0F00 \u 0F20- \u 0F33 \u 0F40- \u 0F47 \u 0F49- \u 0F6C \u 0F88- \u 0F8C \u 1000- \u 102A \u 103F- \u 1049 \u 1050- \u 1055 \u 105A-
2022-11-09 20:26:02 +08:00
] ` ).replace("lheading",_e.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ge={escape:/^ \\ ([!"# $ %&'()*+, \- ./:;<=>?@ \[ \] \\ ^_ ` { | } ~ ] ) / , autolink : /^<(scheme:[^\s\x00-\x1f<>]*|email)>/ , url : H , tag : "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>" , link : /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/ , reflink : /^!?\[(label)\]\[(ref)\]/ , nolink : /^!?\[(ref)\](?:\[\])?/ , reflinkSearch : "reflink|nolink(?!\\()" , emStrong : { lDelim : /^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/ , rDelimAst : /^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/ , rDelimUnd : /^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/ } , code : /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/ , br : /^( {2,}|\\)\n(?!\s*$)/ , del : H , text : /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/ , punctuation : /^([\spunctuation])/ } ; ge . _punctuation = "!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~" , ge . punctuation = w ( ge . punctuation ) . replace ( /punctuation/g , ge . _punctuation ) . getRegex ( ) , ge . blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g , ge . escapedEmSt = /\\\*|\\_/g , ge . _comment = w ( _e . _comment ) . replace ( "(?:-->|$)" , "-->" ) . getRegex ( ) , ge . emStrong . lDelim = w ( ge . emStrong . lDelim ) . replace ( /punct/g , ge . _punctuation ) . getRegex ( ) , ge . emStrong . rDelimAst = w ( ge . emStrong . rDelimAst , "g" ) . replace ( /punct/g , ge . _punctuation ) . getRegex ( ) , ge . emStrong . rDelimUnd = w ( ge . emStrong . rDelimUnd , "g" ) . replace ( /punct/g , ge . _punctuation ) . getRegex ( ) , ge . _escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g , ge . _scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/ , ge . _email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/ , ge . autolink = w ( ge . autolink ) . replace ( "scheme" , ge . _scheme ) . replace ( "email" , ge . _email ) . getRegex ( ) , ge . _attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/ , ge . tag = w ( ge . tag ) . replace ( "comment" , ge . _comment ) . replace ( "attribute" , ge . _attribute ) . getRegex ( ) , ge . _label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/ , ge . _href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/ , ge . _title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/ , ge . link = w ( ge . link ) . replace ( "label" , ge . _label ) . replace ( "href" , ge . _href ) . replace ( "title" , ge . _title ) . getRegex ( ) , ge . reflink = w ( ge . reflink ) . replace ( "label" , ge . _label ) . replace ( "ref" , _e . _label ) . getRegex ( ) , ge . nolink = w ( ge . nolink ) . replace ( "ref" , _e . _label ) . getRegex ( ) , ge . reflinkSearch = w ( ge . reflinkSearch , "g" ) . replace ( "reflink" , ge . reflink ) . replace ( "nolink" , ge . nolink ) . getRegex ( ) , ge . normal = $ ( { } , ge ) , ge . pedantic = $ ( { } , ge . normal , { strong : { start : /^__|\*\*/ , middle : /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/ , endAst : /\*\*(?!\*)/g , endUnd : /__(?!_)/g } , em : { start : /^_|\*/ , middle : /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/ , endAst : /\*(?!\*)/g , endUnd : /_(?!_)/g } , link : w ( /^!?\[(label)\]\((.*?)\)/ ) . replace ( "label" , ge . _label ) . getRegex ( ) , reflink : w ( /^!?\[(label)\]\s*\[([^\]]*)\]/ ) . replace ( "label" , ge . _label ) . getRegex ( ) } ) , ge . gfm = $ ( { } , ge . normal , { escape : w ( ge . escape ) . replace ( "])" , "~|])" ) . getRegex ( ) , _extended _email : /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/ , url : /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/ , _backpedal : /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/ , del : /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/ , text : /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/ } ) , ge . gfm . url = w ( ge . gfm . url , "i" ) . replace ( "email" , ge . gfm . _extended _email ) . getRegex ( ) , ge . breaks = $ ( { } , ge . gfm , { br
2022-10-26 20:27:06 +08:00
` ),this.blockTokens(E,this.tokens);for(var M;M=this.inlineQueue.shift();)this.inlineTokens(M.src,M.tokens);return this.tokens},U.blockTokens=function(E,M){var V=this;M===void 0&&(M=[]),this.options.pedantic?E=E.replace(/ \t /g," ").replace(/^ + $ /gm,""):E=E.replace(/^( *)( \t +)/gm,function(Fe,Pe,Ct){return Pe+" ".repeat(Ct.length)});for(var F,Y,ie,ye;E;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Fe){return(F=Fe.call({lexer:V},E,M))?(E=E.substring(F.raw.length),M.push(F),!0):!1}))){if(F=this.tokenizer.space(E)){E=E.substring(F.raw.length),F.raw.length===1&&M.length>0?M[M.length-1].raw+= `
` :M.push(F);continue}if(F=this.tokenizer.code(E)){E=E.substring(F.raw.length),Y=M[M.length-1],Y&&(Y.type==="paragraph"||Y.type==="text")?(Y.raw+= `
` +F.raw,Y.text+= `
` +F.text,this.inlineQueue[this.inlineQueue.length-1].src=Y.text):M.push(F);continue}if(F=this.tokenizer.fences(E)){E=E.substring(F.raw.length),M.push(F);continue}if(F=this.tokenizer.heading(E)){E=E.substring(F.raw.length),M.push(F);continue}if(F=this.tokenizer.hr(E)){E=E.substring(F.raw.length),M.push(F);continue}if(F=this.tokenizer.blockquote(E)){E=E.substring(F.raw.length),M.push(F);continue}if(F=this.tokenizer.list(E)){E=E.substring(F.raw.length),M.push(F);continue}if(F=this.tokenizer.html(E)){E=E.substring(F.raw.length),M.push(F);continue}if(F=this.tokenizer.def(E)){E=E.substring(F.raw.length),Y=M[M.length-1],Y&&(Y.type==="paragraph"||Y.type==="text")?(Y.raw+= `
` +F.raw,Y.text+= `
` +F.raw,this.inlineQueue[this.inlineQueue.length-1].src=Y.text):this.tokens.links[F.tag]||(this.tokens.links[F.tag]={href:F.href,title:F.title});continue}if(F=this.tokenizer.table(E)){E=E.substring(F.raw.length),M.push(F);continue}if(F=this.tokenizer.lheading(E)){E=E.substring(F.raw.length),M.push(F);continue}if(ie=E,this.options.extensions&&this.options.extensions.startBlock&&function(){var Fe=1/0,Pe=E.slice(1),Ct=void 0;V.options.extensions.startBlock.forEach(function(at){Ct=at.call({lexer:this},Pe),typeof Ct=="number"&&Ct>=0&&(Fe=Math.min(Fe,Ct))}),Fe<1/0&&Fe>=0&&(ie=E.substring(0,Fe+1))}(),this.state.top&&(F=this.tokenizer.paragraph(ie))){Y=M[M.length-1],ye&&Y.type==="paragraph"?(Y.raw+= `
` +F.raw,Y.text+= `
` +F.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=Y.text):M.push(F),ye=ie.length!==E.length,E=E.substring(F.raw.length);continue}if(F=this.tokenizer.text(E)){E=E.substring(F.raw.length),Y=M[M.length-1],Y&&Y.type==="text"?(Y.raw+= `
` +F.raw,Y.text+= `
2022-11-09 20:26:02 +08:00
` +F.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=Y.text):M.push(F);continue}if(E){var ve="Infinite loop on byte: "+E.charCodeAt(0);if(this.options.silent){console.error(ve);break}else throw new Error(ve)}}return this.state.top=!0,M},U.inline=function(E,M){this.inlineQueue.push({src:E,tokens:M})},U.inlineTokens=function(E,M){var V=this;M===void 0&&(M=[]);var F,Y,ie,ye=E,ve,Fe,Pe;if(this.tokens.links){var Ct=Object.keys(this.tokens.links);if(Ct.length>0)for(;(ve=this.tokenizer.rules.inline.reflinkSearch.exec(ye))!=null;)Ct.includes(ve[0].slice(ve[0].lastIndexOf("[")+1,-1))&&(ye=ye.slice(0,ve.index)+"["+Se("a",ve[0].length-2)+"]"+ye.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ve=this.tokenizer.rules.inline.blockSkip.exec(ye))!=null;)ye=ye.slice(0,ve.index)+"["+Se("a",ve[0].length-2)+"]"+ye.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(ve=this.tokenizer.rules.inline.escapedEmSt.exec(ye))!=null;)ye=ye.slice(0,ve.index)+"++"+ye.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;E;)if(Fe||(Pe=""),Fe=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(De){return(F=De.call({lexer:V},E,M))?(E=E.substring(F.raw.length),M.push(F),!0):!1}))){if(F=this.tokenizer.escape(E)){E=E.substring(F.raw.length),M.push(F);continue}if(F=this.tokenizer.tag(E)){E=E.substring(F.raw.length),Y=M[M.length-1],Y&&F.type==="text"&&Y.type==="text"?(Y.raw+=F.raw,Y.text+=F.text):M.push(F);continue}if(F=this.tokenizer.link(E)){E=E.substring(F.raw.length),M.push(F);continue}if(F=this.tokenizer.reflink(E,this.tokens.links)){E=E.substring(F.raw.length),Y=M[M.length-1],Y&&F.type==="text"&&Y.type==="text"?(Y.raw+=F.raw,Y.text+=F.text):M.push(F);continue}if(F=this.tokenizer.emStrong(E,ye,Pe)){E=E.substring(F.raw.length),M.push(F);continue}if(F=this.tokenizer.codespan(E)){E=E.substring(F.raw.length),M.push(F);continue}if(F=this.tokenizer.br(E)){E=E.substring(F.raw.length),M.push(F);continue}if(F=this.tokenizer.del(E)){E=E.substring(F.raw.length),M.push(F);continue}if(F=this.tokenizer.autolink(E,Ri)){E=E.substring(F.raw.length),M.push(F);continue}if(!this.state.inLink&&(F=this.tokenizer.url(E,Ri))){E=E.substring(F.raw.length),M.push(F);continue}if(ie=E,this.options.extensions&&this.options.extensions.startInline&&function(){var De=1/0,pi=E.slice(1),Gt=void 0;V.options.extensions.startInline.forEach(function(Ns){Gt=Ns.call({lexer:this},pi),typeof Gt=="number"&&Gt>=0&&(De=Math.min(De,Gt))}),De<1/0&&De>=0&&(ie=E.substring(0,De+1))}(),F=this.tokenizer.inlineText(ie,It)){E=E.substring(F.raw.length),F.raw.slice(-1)!=="_"&&(Pe=F.raw.slice(-1)),Fe=!0,Y=M[M.length-1],Y&&Y.type==="text"?(Y.raw+=F.raw,Y.text+=F.text):M.push(F);continue}if(E){var at="Infinite loop on byte: "+E.charCodeAt(0);if(this.options.silent){console.error(at);break}else throw new Error(at)}}return M},i(Z,null,[{key:"rules",get:function(){return{block:_e,inline:ge}}}]),Z}(),Lo=function(){function Z(j){this.options=j||e.defaults}var U=Z.prototype;return U.code=function(E,M,V){var F=(M||"").match(/ \S */)[0];if(this.options.highlight){var Y=this.options.highlight(E,F);Y!=null&&Y!==E&&(V=!0,E=Y)}return E=E.replace(/ \n $ /,"")+ `
2022-10-26 20:27:06 +08:00
` ,F?'<pre><code class="'+this.options.langPrefix+_(F,!0)+'">'+(V?E:_(E,!0))+ ` < / c o d e > < / p r e >
` :"<pre><code>"+(V?E:_(E,!0))+ ` < / c o d e > < / p r e >
` },U.blockquote=function(E){return ` < blockquote >
` +E+ ` < / b l o c k q u o t e >
` },U.html=function(E){return E},U.heading=function(E,M,V,F){if(this.options.headerIds){var Y=this.options.headerPrefix+F.slug(V);return"<h"+M+' id="'+Y+'">'+E+"</h"+M+ ` >
` }return"<h"+M+">"+E+"</h"+M+ ` >
` },U.hr=function(){return this.options.xhtml? ` < hr / >
` : ` < hr >
` },U.list=function(E,M,V){var F=M?"ol":"ul",Y=M&&V!==1?' start="'+V+'"':"";return"<"+F+Y+ ` >
` +E+"</"+F+ ` >
` },U.listitem=function(E){return"<li>"+E+ ` < / l i >
` },U.checkbox=function(E){return"<input "+(E?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},U.paragraph=function(E){return"<p>"+E+ ` < / p >
` },U.table=function(E,M){return M&&(M="<tbody>"+M+"</tbody>"), ` < table >
< thead >
` +E+ ` < / t h e a d >
` +M+ ` < / t a b l e >
` },U.tablerow=function(E){return ` < tr >
` +E+ ` < / t r >
` },U.tablecell=function(E,M){var V=M.header?"th":"td",F=M.align?"<"+V+' align="'+M.align+'">':"<"+V+">";return F+E+("</"+V+ ` >
2022-11-09 20:26:02 +08:00
` )},U.strong=function(E){return"<strong>"+E+"</strong>"},U.em=function(E){return"<em>"+E+"</em>"},U.codespan=function(E){return"<code>"+E+"</code>"},U.br=function(){return this.options.xhtml?"<br/>":"<br>"},U.del=function(E){return"<del>"+E+"</del>"},U.link=function(E,M,V){if(E=x(this.options.sanitize,this.options.baseUrl,E),E===null)return V;var F='<a href="'+_(E)+'"';return M&&(F+=' title="'+M+'"'),F+=">"+V+"</a>",F},U.image=function(E,M,V){if(E=x(this.options.sanitize,this.options.baseUrl,E),E===null)return V;var F='<img src="'+E+'" alt="'+V+'"';return M&&(F+=' title="'+M+'"'),F+=this.options.xhtml?"/>":">",F},U.text=function(E){return E},Z}(),sa=function(){function Z(){}var U=Z.prototype;return U.strong=function(E){return E},U.em=function(E){return E},U.codespan=function(E){return E},U.del=function(E){return E},U.html=function(E){return E},U.text=function(E){return E},U.link=function(E,M,V){return""+V},U.image=function(E,M,V){return""+V},U.br=function(){return""},Z}(),Do=function(){function Z(){this.seen={}}var U=Z.prototype;return U.serialize=function(E){return E.toLowerCase().trim().replace(/<[! \/ a-z].*?>/ig,"").replace(/[ \u 2000- \u 206F \u 2E00- \u 2E7F \\ '!"# $ %&()*+,./:;<=>?@[ \] ^ ` { | } ~ ] / g , "" ) . replace ( /\s/g , "-" ) } , U . getNextSafeSlug = function ( E , M ) { var V = E , F = 0 ; if ( this . seen . hasOwnProperty ( V ) ) { F = this . seen [ E ] ; do F ++ , V = E + "-" + F ; while ( this . seen . hasOwnProperty ( V ) ) } return M || ( this . seen [ E ] = F , this . seen [ V ] = 0 ) , V } , U . slug = function ( E , M ) { M === void 0 && ( M = { } ) ; var V = this . serialize ( E ) ; return this . getNextSafeSlug ( V , M . dryrun ) } , Z } ( ) , or = function ( ) { function Z ( j ) { this . options = j || e . defaults , this . options . renderer = this . options . renderer || new Lo , this . renderer = this . options . renderer , this . renderer . options = this . options , this . textRenderer = new sa , this . slugger = new Do } Z . parse = function ( E , M ) { var V = new Z ( M ) ; return V . parse ( E ) } , Z . parseInline = function ( E , M ) { var V = new Z ( M ) ; return V . parseInline ( E ) } ; var U = Z . prototype ; return U . parse = function ( E , M ) { M === void 0 && ( M = ! 0 ) ; var V = "" , F , Y , ie , ye , ve , Fe , Pe , Ct , at , De , pi , Gt , Ns , zt , Oi , Rc , ds , rr , oa , Oc = E . length ; for ( F = 0 ; F < Oc ; F ++ ) { if ( De = E [ F ] , this . options . extensions && this . options . extensions . renderers && this . options . extensions . renderers [ De . type ] && ( oa = this . options . extensions . renderers [ De . type ] . call ( { parser : this } , De ) , oa !== ! 1 || ! [ "space" , "hr" , "heading" , "code" , "table" , "blockquote" , "list" , "html" , "paragraph" , "text" ] . includes ( De . type ) ) ) { V += oa || "" ; continue } switch ( De . type ) { case "space" : continue ; case "hr" : { V += this . renderer . hr ( ) ; continue } case "heading" : { V += this . renderer . heading ( this . parseInline ( De . tokens ) , De . depth , v ( this . parseInline ( De . tokens , this . textRenderer ) ) , this . slugger ) ; continue } case "code" : { V += this . renderer . code ( De . text , De . lang , De . escaped ) ; continue } case "table" : { for ( Ct = "" , Pe = "" , ye = De . header . length , Y = 0 ; Y < ye ; Y ++ ) Pe += this . renderer . tablecell ( this . parseInline ( De . header [ Y ] . tokens ) , { header : ! 0 , align : De . align [ Y ] } ) ; for ( Ct += this . renderer . tablerow ( Pe ) , at = "" , ye = De . rows . length , Y = 0 ; Y < ye ; Y ++ ) { for ( Fe = De . rows [ Y ] , Pe = "" , ve = Fe . length , ie = 0 ; ie < ve ; ie ++ ) Pe += this . renderer . tablecell ( this . parseInline ( Fe [ ie ] . tokens ) , { header : ! 1 , align : De . align [ ie ] } ) ; at += this . renderer . tablerow ( Pe ) } V += this . renderer . table ( Ct , at ) ; continue } case "blockquote" : { at = this . parse ( De . tokens ) , V += this . renderer . blockquote ( at ) ; continue } case "list" : { for ( pi = De . ordered , Gt = De . start , Ns = De . loose , ye = De . items . length , at = "" , Y = 0 ; Y < ye ; Y ++ ) Oi = De . items [ Y ] , Rc = Oi . checked , ds = Oi . task , zt = "" , Oi . task && ( rr = this . renderer . checkbox ( Rc ) , Ns ? Oi . tokens . length > 0 && Oi . tokens [ 0 ] . type === "paragraph" ? ( Oi . tokens [ 0 ] . text = rr + " " + Oi . tokens [ 0 ] . text , Oi . tokens [ 0 ] . tokens && Oi . tokens [ 0 ] . tokens . length > 0 && Oi . tokens [ 0 ] . tokens [ 0 ] . type === "text" && ( Oi . tokens [ 0 ] . tokens [ 0 ] . text = rr + " " + Oi . tokens [ 0 ] . tokens [ 0 ] . text ) ) : Oi . tokens . unshift ( { type : "text" , text : rr } ) : zt += rr ) , zt += this . parse ( Oi . tokens , Ns ) , at += this . renderer . listitem ( zt , ds , Rc ) ; V += this . renderer . list ( at , pi , Gt ) ; continue } case "html" : { V += this . renderer . html ( De . text ) ; continue } case "paragraph" : { V += this . renderer . paragraph ( this . parseInline ( De . tokens ) ) ; continue } case "text" : { for ( at = De . tokens ? this . parseInline ( De . tokens ) : De . text ; F + 1 < Oc && E [ F + 1 ] . type === "text" ; ) De = E [ ++ F ] , at += `
` +(De.tokens?this.parseInline(De.tokens):De.text);V+=M?this.renderer.paragraph(at):at;continue}default:{var gl='Token with "'+De.type+'" type was not found.';if(this.options.silent){console.error(gl);return}else throw new Error(gl)}}}return V},U.parseInline=function(E,M){M=M||this.renderer;var V="",F,Y,ie,ye=E.length;for(F=0;F<ye;F++){if(Y=E[F],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[Y.type]&&(ie=this.options.extensions.renderers[Y.type].call({parser:this},Y),ie!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(Y.type))){V+=ie||"";continue}switch(Y.type){case"escape":{V+=M.text(Y.text);break}case"html":{V+=M.html(Y.text);break}case"link":{V+=M.link(Y.href,Y.title,this.parseInline(Y.tokens,M));break}case"image":{V+=M.image(Y.href,Y.title,Y.text);break}case"strong":{V+=M.strong(this.parseInline(Y.tokens,M));break}case"em":{V+=M.em(this.parseInline(Y.tokens,M));break}case"codespan":{V+=M.codespan(Y.text);break}case"br":{V+=M.br();break}case"del":{V+=M.del(this.parseInline(Y.tokens,M));break}case"text":{V+=M.text(Y.text);break}default:{var ve='Token with "'+Y.type+'" type was not found.';if(this.options.silent){console.error(ve);return}else throw new Error(ve)}}}return V},Z}();function Oe(Z,U,j){if(typeof Z=="undefined"||Z===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Z!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Z)+", string expected");if(typeof U=="function"&&(j=U,U=null),U= $ ({},Oe.defaults,U||{}),we(U),j){var E=U.highlight,M;try{M=Dn.lex(Z,U)}catch(ie){return j(ie)}var V=function(ye){var ve;if(!ye)try{U.walkTokens&&Oe.walkTokens(M,U.walkTokens),ve=or.parse(M,U)}catch(Fe){ye=Fe}return U.highlight=E,ye?j(ye):j(null,ve)};if(!E||E.length<3||(delete U.highlight,!M.length))return V();var F=0;Oe.walkTokens(M,function(ie){ie.type==="code"&&(F++,setTimeout(function(){E(ie.text,ie.lang,function(ye,ve){if(ye)return V(ye);ve!=null&&ve!==ie.text&&(ie.text=ve,ie.escaped=!0),F--,F===0&&V()})},0))}),F===0&&V();return}try{var Y=Dn.lex(Z,U);return U.walkTokens&&Oe.walkTokens(Y,U.walkTokens),or.parse(Y,U)}catch(ie){if(ie.message+= `
Please report this to https : //github.com/markedjs/marked.`,U.silent)return"<p>An error occurred:</p><pre>"+_(ie.message+"",!0)+"</pre>";throw ie}}Oe.options=Oe.setOptions=function(Z){return $(Oe.defaults,Z),l(Oe.defaults),Oe},Oe.getDefaults=a,Oe.defaults=e.defaults,Oe.use=function(){for(var Z=arguments.length,U=new Array(Z),j=0;j<Z;j++)U[j]=arguments[j];var E=$.apply(void 0,[{}].concat(U)),M=Oe.defaults.extensions||{renderers:{},childTokens:{}},V;U.forEach(function(F){if(F.extensions&&(V=!0,F.extensions.forEach(function(ie){if(!ie.name)throw new Error("extension name required");if(ie.renderer){var ye=M.renderers?M.renderers[ie.name]:null;ye?M.renderers[ie.name]=function(){for(var ve=arguments.length,Fe=new Array(ve),Pe=0;Pe<ve;Pe++)Fe[Pe]=arguments[Pe];var Ct=ie.renderer.apply(this,Fe);return Ct===!1&&(Ct=ye.apply(this,Fe)),Ct}:M.renderers[ie.name]=ie.renderer}if(ie.tokenizer){if(!ie.level||ie.level!=="block"&&ie.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");M[ie.level]?M[ie.level].unshift(ie.tokenizer):M[ie.level]=[ie.tokenizer],ie.start&&(ie.level==="block"?M.startBlock?M.startBlock.push(ie.start):M.startBlock=[ie.start]:ie.level==="inline"&&(M.startInline?M.startInline.push(ie.start):M.startInline=[ie.start]))}ie.childTokens&&(M.childTokens[ie.name]=ie.childTokens)})),F.renderer&&function(){var ie=Oe.defaults.renderer||new Lo,ye=function(Pe){var Ct=ie[Pe];ie[Pe]=function(){for(var at=arguments.length,De=new Array(at),pi=0;pi<at;pi++)De[pi]=arguments[pi];var Gt=F.renderer[Pe].apply(ie,De);return Gt===!1&&(Gt=Ct.apply(ie,De)),Gt}};for(var ve in F.renderer)ye(ve);E.renderer=ie}(),F.tokenizer&&function(){var ie=Oe.defaults.tokenizer||new mt,ye=function(Pe){var Ct=ie[Pe];ie[Pe]=function(){for(var at=arguments.length,De=new Array(at),pi=0;pi<at;pi++)De[pi]=arguments[pi];var Gt=F.tokenizer[Pe].apply(ie,De);return Gt===!1&&(Gt=Ct.apply(ie,De)),Gt}};for(var ve in F.tokenizer)ye(ve);E.tokenizer=ie}(),F.walkTokens){var Y=Oe.defaults.walkTokens;E.walkTokens=function(ie){F.walkTokens.call(this,ie),Y&&Y.call(this,ie)}}V&&(E.extensions=M),Oe.setOptions(E)})},Oe.walkTokens=function(Z,U){for(var j=function(){var F=M.value;switch(U.call(Oe,F),F.type){case"table":{for(var Y=r(F.header),ie;!(ie=Y()).done;){var ye=ie.value;Oe.walkTokens(ye.tokens,U)}for(var ve=r(F.rows),Fe;!(Fe=ve()).done;)for(var Pe=Fe.value,Ct=r(Pe),at;!(at=Ct()).done;){var De=at.value;Oe.walkTokens(De.tokens,U)}break}case"list":{Oe.walkTokens(F.items,U);break}default:Oe.defaults.extensions&&Oe.defaults.extensions.childTokens&&Oe.defaults.extensions.childTokens[F.type]?Oe.defaults.extensions.childTokens[F.type].forEach(function(pi){Oe.walkTokens(F[pi],U)}):F.tokens&&Oe.walkTokens(F.tokens,U)}},E=r(Z),M;!(M=E()).done;)j()},Oe.parseInline=function(Z,U){if(typeof Z=="undefined"||Z===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof Z!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(Z)+", string expected");U=$({},Oe.defaults,U||{}),we(U);try{var j=Dn.lexInline(Z,U);return U.walkTokens&&Oe.walkTokens(j,U.walkTokens),or.parseInline(j,U)}catch(E){if(E.message+=`
Please report this to https : //github.com/markedjs/marked.`,U.silent)return"<p>An error occurred:</p><pre>"+_(E.message+"",!0)+"</pre>";throw E}},Oe.Parser=or,Oe.parser=or.parse,Oe.Renderer=Lo,Oe.TextRenderer=sa,Oe.Lexer=Dn,Oe.lexer=Dn.lex,Oe.Tokenizer=mt,Oe.Slugger=Do,Oe.parse=Oe;var hl=Oe.options,nf=Oe.setOptions,sf=Oe.use,ul=Oe.walkTokens,Ih=Oe.parseInline,L_=Oe,Eh=or.parse,D_=Dn.lex;e.Lexer=Dn,e.Parser=or,e.Renderer=Lo,e.Slugger=Do,e.TextRenderer=sa,e.Tokenizer=mt,e.getDefaults=a,e.lexer=D_,e.marked=Oe,e.options=hl,e.parse=L_,e.parseInline=Ih,e.parser=Eh,e.setOptions=nf,e.use=sf,e.walkTokens=ul,Object.defineProperty(e,"__esModule",{value:!0})})})();var zM=s3||exports;function Ov(o){let e=JSON.parse(o);return e=JL(e),e}function JL(o,e=0){if(!o||e>200)return o;if(typeof o=="object"){switch(o.$mid){case 1:return me.revive(o);case 2:return new RegExp(o.source,o.flags);case 14:return new Date(o.source)}if(o instanceof VC||o instanceof Uint8Array)return o;if(Array.isArray(o))for(let t=0;t<o.length;++t)o[t]=JL(o[t],e+1);else for(const t in o)Object.hasOwnProperty.call(o,t)&&(o[t]=JL(o[t],e+1))}return o}function pJ(o,e={},t={}){var i;const n=new ee;let s=!1;const r=LE(e),a=function(_){let b;try{b=Ov(decodeURIComponent(_))}catch(v){}return b?(b=FP(b,v=>{if(o.uris&&o.uris[v])return me.revive(o.uris[v])}),encodeURIComponent(JSON.stringify(b))):_},l=function(_,b){const v=o.uris&&o.uris[_];let C=me.revive(v);return b?_.startsWith(Ne.data+":")?_:(C||(C=me.parse(_)),RO.asBrowserUri(C).toString(!0)):!C||me.parse(_).toString()===C.toString()?_:(C.query&&(C=C.with({query:a(C.query)})),C.toString())},c=new zM.Renderer;c.image=(_,b,v)=>{let C=[],w=[];return _&&({href:_,dimensions:C}=OG(_),w.push(`src="${cb(_)}"`)),v&&w.push(`alt="${cb(v)}"`),b&&w.push(`title="${cb(b)}"`),C.length&&(w=w.concat(C)),"<img "+w.join(" ")+">"},c.link=(_,b,v)=>typeof _!="string"?"":(_===v&&(v=nS(v)),b=typeof b=="string"?cb(nS(b)):"",_=nS(_),_=_.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),`<a href="${_}" title="${b||_}">${v}</a>`),c.paragraph=_=>`<p>${_}</p>`;const d=[];if(e.codeBlockRenderer&&(c.code=(_,b)=>{const v=iF.nextId(),C=e.codeBlockRenderer(b!=null?b:"",_);return d.push(C.then(w=>[v,w])),`<div class="code" data-code="${v}">${Hx(_)}</div>`}),e.actionHandler){const _=e.actionHandler.disposables.add(new _t(r,"click")),b=e.actionHandler.disposables.add(new _t(r,"auxclick"));e.actionHandler.disposables.add(pe.any(_.event,b.event)(v=>{const C=new Ir(v);if(!C.leftButton&&!C.middleButton)return;let w=C.target;if(!(w.tagName!=="A"&&(w=w.parentElement,!w||w.tagName!=="A")))try{let S=w.dataset.href;S&&(o.baseUri&&(S=OS(me.from(o.baseUri),S)),e.actionHandler.callback(S,C))}catch(S){Ee(S)}finally{C.preventDefault()}}))}o.supportHtml||(t.sanitizer=_=>(o.isTrusted?_.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?_:"",t.sanitize=!0,t.silent=!0),t.renderer=c;let h=(i=o.value)!==null&&i!==void 0?i:"";h.length>1e5&&(h=`${h.substr(0,1e5)}\u2026`),o.supportThemeIcons&&(h=TG(h));let u=zM.parse(h,t);o.supportThemeIcons&&(u=yd(u).map(b=>typeof b=="string"?b:b.outerHTML).join(""));const f=new DOMParser().parseFromString(UM(o,u),"text/html");if(f.body.querySelectorAll("img").forEach(_=>{const b=_.getAttribute("src");if(b){let v=b;try{o.baseUri&&(v=OS(me.from(o.baseUri),v))}catch(C){}_.src=l(v,!0)}}),f.body.querySelectorAll("a").forEach(_=>{const b=_.getAttribute("href");if(_.setAttribute("href",""),!b||/^data:|javascript:/i.test(b)||/^command:/i.test(b)&&!o.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(b))_.replaceWith(..._.childNodes);else{let v=l(b,!1);o.baseUri&&(v=OS(me.from(o.baseUri),b)),_.dataset.href=v}}),r.innerHTML=UM(o,f.body.innerHTML),d.length>0&&Promise.all(d).then(_=>{var b,v;if(s)return;const C=new Map(_),w=r.querySelectorAll("div[data-code]");for(const S of w){const k=C.get((b=S.dataset.code)!==null&&b!==void 0?b:"");k&&Rd(S,k)}(v=e.asyncRenderCallback)===null||v===void 0||v.call(e)}),e.asyncRenderCallback)for(const _ of r.getElementsByTagName("img")){const b=n.add(q(_,"load",
2022-10-26 20:27:06 +08:00
. monaco - editor . zone - widget $ { s } ,
. markers - panel . marker - icon$ { s } ,
. text - search - provider - messages . providerMessage $ { s } ,
. extensions - viewlet > . extensions $ { s } {
color : $ { t } ;
}
2022-11-09 20:26:02 +08:00
` )}const i=o.getColor(zz);if(i){const s=m.warning.cssSelector;e.addRule( `
2022-10-26 20:27:06 +08:00
. monaco - editor . zone - widget $ { s } ,
. markers - panel . marker - icon$ { s } ,
. extensions - viewlet > . extensions $ { s } ,
. extension - editor $ { s } ,
. text - search - provider - messages . providerMessage $ { s } ,
. preferences - editor $ { s } {
color : $ { i } ;
}
2022-11-09 20:26:02 +08:00
` )}const n=o.getColor(Uz);if(n){const s=m.info.cssSelector;e.addRule( `
2022-10-26 20:27:06 +08:00
. monaco - editor . zone - widget $ { s } ,
. markers - panel . marker - icon$ { s } ,
. extensions - viewlet > . extensions $ { s } ,
. text - search - provider - messages . providerMessage $ { s } ,
. extension - editor $ { s } {
color : $ { n } ;
}
2022-11-09 20:26:02 +08:00
` )}});var kJ=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},zh=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}};class xJ{constructor(e,t,i,n,s){this._openerService=n,this._labelService=s,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new ee,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(Ei(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new D4(r,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left= ` - $ { a . scrollLeft } px ` ,r.style.top= ` - $ { a . scrollTop } px ` })),this._disposables.add(this._scrollable)}dispose(){et(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:s}=e;let r=((t==null?void 0:t.length)||0)+2;s&&(typeof s=="string"?r+=s.length:r+=s.value.length);const a=Ur(i);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+r,this._longestLineLength);Ii(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const u of a)l=document.createElement("div"),l.innerText=u,u===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||s){const u=document.createElement("span");if(u.classList.add("details"),l.appendChild(u),t){const g=document.createElement("span");g.innerText=t,g.classList.add("source"),u.appendChild(g)}if(s)if(typeof s=="string"){const g=document.createElement("span");g.innerText= ` ( $ { s } ) ` ,g.classList.add("code"),u.appendChild(g)}else{this._codeLink=se("a.code-link"),this._codeLink.setAttribute("href", ` $ { s . target . toString ( ) } ` ),this._codeLink.onclick=f=>{this._openerService.open(s.target,{allowCommands:!0}),f.preventDefault(),f.stopPropagation()};const g=G(this._codeLink,se("span"));g.innerText=s.value,u.appendChild(this._codeLink)}}if(Ii(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),en(n)){const u=this._relatedBlock.appendChild(document.createElement("div"));u.style.paddingTop= ` $ { Math . floor ( this . _editor . getOption ( 61 ) * . 66 ) } px ` ,this._lines+=1;for(const g of n){const f=document.createElement("div"),_=document.createElement("a");_.classList.add("filename"),_.innerText= ` $ { this . _labelService . getUriBasenameLabel ( g . resource ) } ( $ { g . startLineNumber } , $ { g . startColumn } ) : ` ,_.title=this._labelService.getUriLabel(g.resource),this._relatedDiagnostics.set(_,g);const b=document.createElement("span");b.innerText=g.message,f.appendChild(_),f.appendChild(b),this._lines+=1,u.appendChild(f)}}const c=this._editor.getOption(46),d=Math.ceil(c.typicalFullwidthCharacterWidth*this._longestLineLength*.75),h=c.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:d,scrollHeight:h})}layout(e,t){this._scrollable.getDomNode().style.height= ` $ { e } px ` ,this._scrollable.getDomNode().style.width= ` $ { t } px ` ,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case Ft.Error:t=p("Error","Error");break;case Ft.Warning:t=p("Warning","Warning");break;case Ft.Info:t=p("Info","Info");break;case Ft.Hint:t=p("Hint","Hint");break}let i=p(
2022-10-26 20:27:06 +08:00
` ),parse:o=>o.split( ` \ r
2022-11-09 20:26:02 +08:00
` ).filter(e=>!e.startsWith("#"))});class Pt{static insert(e,t){return{range:new L(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}const bm=qe("contextService");function QM(o){const e=o;return typeof(e==null?void 0:e.id)=="string"&&me.isUri(e.uri)}function ZJ(o){if(o.configuration)return{id:o.id,configPath:o.configuration};if(o.folders.length===1)return{id:o.id,uri:o.folders[0].uri}}class YJ{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const lD="code-workspace";p("codeWorkspace","Code Workspace");function JM(o,e=nn){return wK(o,e)?o.charAt(0).toUpperCase()+o.slice(1):o}var XJ=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},QJ=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}};Object.freeze({CURRENT_YEAR:!0,CURRENT_YEAR_SHORT:!0,CURRENT_MONTH:!0,CURRENT_DATE:!0,CURRENT_HOUR:!0,CURRENT_MINUTE:!0,CURRENT_SECOND:!0,CURRENT_DAY_NAME:!0,CURRENT_DAY_NAME_SHORT:!0,CURRENT_MONTH_NAME:!0,CURRENT_MONTH_NAME_SHORT:!0,CURRENT_SECONDS_UNIX:!0,SELECTION:!0,CLIPBOARD:!0,TM_SELECTED_TEXT:!0,TM_CURRENT_LINE:!0,TM_CURRENT_WORD:!0,TM_LINE_INDEX:!0,TM_LINE_NUMBER:!0,TM_FILENAME:!0,TM_FILENAME_BASE:!0,TM_DIRECTORY:!0,TM_FILEPATH:!0,CURSOR_INDEX:!0,CURSOR_NUMBER:!0,RELATIVE_FILEPATH:!0,BLOCK_COMMENT_START:!0,BLOCK_COMMENT_END:!0,LINE_COMMENT:!0,WORKSPACE_NAME:!0,WORKSPACE_FOLDER:!0,RANDOM:!0,RANDOM_HEX:!0,UUID:!0});class eA{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(i!==void 0)return i}}}class tA{constructor(e,t,i,n){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=n}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let i=this._model.getValueInRange(this._selection)||void 0,n=this._selection.startLineNumber!==this._selection.endLineNumber;if(!i&&this._overtypingCapturer){const s=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);s&&(i=s.value,n=s.multiline)}if(i&&n&&e.snippet){const s=this._model.getLineContent(this._selection.startLineNumber),r=pt(s,0,this._selection.startColumn-1);let a=r;e.snippet.walk(c=>c===e?!1:(c instanceof On&&(a=pt(Ur(c.value).pop())),!0));const l=Pd(a,r);i=i.replace(/( \r \n | \r | \n )(.*)/g,(c,d,h)=> ` $ { d } $ { a . substr ( l ) } $ { h } ` )}return i}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const i=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return i&&i.word||void 0}else{if(t==="TM_LINE_INDEX")return String(this._selection.positionLineNumber-1);if(t==="TM_LINE_NUMBER")return String(this._selection.positionLineNumber);if(t==="CURSOR_INDEX")return String(this._selectionIdx);if(t==="CURSOR_NUMBER")return String(this._selectionIdx+1)}}}}class iA{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return pd(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=pd(this._model.uri.fsPath),n=i.lastIndexOf(".");return n<=0?i:i.slice(0,n)}else{if(t==="TM_DIRECTORY")return EO(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(a1(this._model.uri));if(t==="TM_FILEPATH")return this._labelService.getUriLabel(this._model.uri);if(t==="RELATIVE_FILEPATH")return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class nA{constructor(e,t,i,n){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=n}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboa
` ),this._selectionId=t.trackSelection(i);return}i.startLineNumber<i.endLineNumber&&i.endColumn===1&&(this._moveEndPositionDown=!0,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const n=Sa._gatherPreflightData(this._type,this._insertSpace,e,i.startLineNumber,i.endLineNumber,this._ignoreEmptyLines,this._ignoreFirstLine,this.languageConfigurationService);return n.supported?this._executeLineComments(e,t,n,i):this._executeBlockComment(e,t,i)}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),new oe(i.selectionStartLineNumber,i.selectionStartColumn+this._deltaColumn,i.positionLineNumber,i.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){const i=[];for(let n=0,s=e.length;n<s;n++){const r=e[n];r.ignore||i.push(Pt.delete(new L(t+n,r.commentStrOffset+1,t+n,r.commentStrOffset+r.commentStrLength+1)))}return i}_createAddLineCommentsOperations(e,t){const i=[],n=this._insertSpace?" ":"";for(let s=0,r=e.length;s<r;s++){const a=e[s];a.ignore||i.push(Pt.insert(new B(t+s,a.commentStrOffset+1),a.commentStr+n))}return i}static nextVisibleColumn(e,t,i,n){return i?e+(t-e%t):e+n}static _normalizeInsertionPoint(e,t,i,n){let s=1073741824,r,a;for(let l=0,c=t.length;l<c;l++){if(t[l].ignore)continue;const d=e.getLineContent(i+l);let h=0;for(let u=0,g=t[l].commentStrOffset;h<s&&u<g;u++)h=Sa.nextVisibleColumn(h,n,d.charCodeAt(u)===9,1);h<s&&(s=h)}s=Math.floor(s/n)*n;for(let l=0,c=t.length;l<c;l++){if(t[l].ignore)continue;const d=e.getLineContent(i+l);let h=0;for(r=0,a=t[l].commentStrOffset;h<s&&r<a;r++)h=Sa.nextVisibleColumn(h,n,d.charCodeAt(r)===9,1);h>s?t[l].commentStrOffset=r-1:t[l].commentStrOffset=r}}}class eN extends he{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(ti);if(!t.hasModel())return;const n=t.getModel(),s=[],r=n.getOptions(),a=t.getOption(19),l=t.getSelections().map((d,h)=>({selection:d,index:h,ignoreFirstLine:!1}));l.sort((d,h)=>L.compareRangesUsingStarts(d.selection,h.selection));let c=l[0];for(let d=1;d<l.length;d++){const h=l[d];c.selection.endLineNumber===h.selection.startLineNumber&&(c.index<h.index?h.ignoreFirstLine=!0:(c.ignoreFirstLine=!0,c=h))}for(const d of l)s.push(new Sa(i,d.selection,r.tabSize,this._type,a.insertSpace,a.ignoreEmptyLines,d.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class nee extends eN{constructor(){super(0,{id:"editor.action.commentLine",label:p("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:2133,weight:100},menuOpts:{menuId:A.MenubarEditMenu,group:"5_insert",title:p({key:"miToggleLineComment",comment:["&& denotes a mnemonic"]},"&&Toggle Line Comment"),order:1}})}}class see extends eN{constructor(){super(1,{id:"editor.action.addCommentLine",label:p("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:vi(2089,2081),weight:100}})}}class oee extends eN{constructor(){super(2,{id:"editor.action.removeCommentLine",label:p("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:vi(2089,2099),weight:100}})}}class ree extends he{constructor(){super({id:"editor.action.blockComment",label:p("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:A.MenubarEditMenu,group:"5_insert",title:p({key:"miToggleBlockComment",comment:["&& denotes a mnemonic"]},"Toggle &&Block Comment"),order:2}})}run(e,t){const i=e.get(ti);if(!t.hasModel())return;const n=t.getOption(19),s=[],r=t.getSelections();for(const a of r)s.push(new Vl(a,n.insertSpace,i));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}te(nee);te(see);te(oee);te(ree);var aee=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.g
` ,i+1);break;case 116:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(r));break}continue}if(s===36){if(i++,i>=n)break;const r=o.charCodeAt(i);if(r===36){t.emitUnchanged(i-1),t.emitStatic(" $ ",i+1);continue}if(r===48||r===38){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(49<=r&&r<=57){let a=r-48;if(i+1<n){const l=o.charCodeAt(i+1);if(48<=l&&l<=57){i++,a=a*10+(l-48),t.emitUnchanged(i-2),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}t.emitUnchanged(i-1),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}}return t.finalize()}const Ic=new ce("findWidgetVisible",!1);Ic.toNegated();const O1=new ce("findInputFocussed",!1),tN=new ce("replaceInputFocussed",!1),yb={primary:545,mac:{primary:2593}},Lb={primary:565,mac:{primary:2613}},Db={primary:560,mac:{primary:2608}},kb={primary:554,mac:{primary:2602}},xb={primary:558,mac:{primary:2606}},Dt={StartFindAction:"actions.find",StartFindWithSelection:"actions.findWithSelection",StartFindWithArgs:"editor.actions.findWithArgs",NextMatchFindAction:"editor.action.nextMatchFindAction",PreviousMatchFindAction:"editor.action.previousMatchFindAction",NextSelectionMatchFindAction:"editor.action.nextSelectionMatchFindAction",PreviousSelectionMatchFindAction:"editor.action.previousSelectionMatchFindAction",StartFindReplaceAction:"editor.action.startFindReplaceAction",CloseFindWidgetCommand:"closeFindWidget",ToggleCaseSensitiveCommand:"toggleFindCaseSensitive",ToggleWholeWordCommand:"toggleFindWholeWord",ToggleRegexCommand:"toggleFindRegex",ToggleSearchScopeCommand:"toggleFindInSelection",TogglePreserveCaseCommand:"togglePreserveCase",ReplaceOneAction:"editor.action.replaceOne",ReplaceAllAction:"editor.action.replaceAll",SelectAllMatchesAction:"editor.action.selectAllMatches"},Hl=19999,mee=240;class pp{constructor(e,t){this._toDispose=new ee,this._editor=e,this._state=t,this._isDisposed=!1,this._startSearchingTimer=new Is,this._decorations=new cn(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new ft(()=>this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===3||i.reason===5||i.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,et(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||!this._editor.hasModel()||(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},mee)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;typeof t!="undefined"?t!==null&&(Array.isArray(t)?i=t:i=[t]):i=this._decorations.getFindScopes(),i!==null&&(i=i.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new L(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const n=this._findMatches(i,!1,Hl);this._decorations.set(n,i);const s=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(s);if(r===0&&n.length>0){const a=fP(n.map(l=>l.range),l=>L.compareRangesUsingStarts(l,s)>=0);r=a>0?a-1+1:r}this._state.changeMatchInfo(r,this._decorations.getCount(),void 0),e&&this._editor.getOption(37).cursorMoveOnType&&this._moveT
` ),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return _A(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return bA(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(mA|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{nn&&Uo&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(p("ctrlEnter.keybindingChanged","Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.")),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(pA,!0,0,0)),this._replaceInput.inputBox.insertAtCursor( `
` ),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return _A(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return bA(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t? ` ( $ { t . getLabel ( ) } ) ` :""}_buildDomNode(){this._findInput=this._register(new ZL(null,this._contextViewProvider,{width:Bee,label:Lee,placeholder:Dee,appendCaseSensitiveLabel:this._keybindingLabelFor(Dt.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Dt.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Dt.ToggleRegexCommand),validation:l=>{if(l.length===0||!this._findInput.getRegex())return null;try{return new RegExp(l,"gu"),null}catch(c){return{content:c.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>hA(this._keybindingService)},this._contextKeyService,!0)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(l=>this._onFindInputKeyDown(l))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(l=>{l.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),l.preventDefault())})),this._register(this._findInput.onRegexKeyDown(l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),l.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(l=>{this._tryUpdateHeight()&&this._showViewZone()})),sn&&this._register(this._findInput.onMouseDown(l=>this._onFindInputMouseDown(l))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new jh({label:kee+this._keybindingLabelFor(Dt.PreviousMatchFindAction),icon:See,onTrigger:()=>{this._codeEditor.getAction(Dt.PreviousMatchFindAction).run().then(void 0,Ee)}})),this._nextBtn=this._register(new jh({label:xee+this._keybindingLabelFor(Dt.NextMatchFindAction),icon:yee,onTrigger:()=>{this._codeEditor.getAction(Dt.NextMatchFindAction).run().then(void 0,Ee)}}));const i=document.createElement("div");i.className="find-part",i.appendChild(this._findInput.domNode);const n=document.createElement("div");n.className="find-actions",i.appendChild(n),n.appendChild(this._matchesCount),n.appendChild(this._prevBtn.domNode),n.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new h_({icon:vee,title:Iee+this._keybindingLabelFor(Dt.ToggleSearchScopeCommand),isChecked:!1})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){const l=this._codeEditor.getSelections();l.map(c=>(c.endColumn===1&&c.endLineNumber>c.startLineNumber&&(c=c.setEndPosition(c.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(c.endLineNumber-1))),c.isEmpty()?null:c)).filter(c=>!!c),l.length&&this._state.change({searchScope:l},!0)}}else this._state.change({searchScope:null},!0)})),n.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new jh({label:Eee+this._keybindingLabelFor(Dt.CloseFindWidgetCommand),icon:b5,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():th
2022-10-26 20:27:06 +08:00
. monaco - editor . find - widget . button : not ( . disabled ) : hover ,
. monaco - editor . find - widget . codicon - find - selection : hover {
background - color : $ { u } ! important ;
}
2022-11-09 20:26:02 +08:00
` );const g=o.getColor(Hs);g&&e.addRule( ` . monaco - editor . find - widget . monaco - inputbox . synthetic - focus { outline - color : $ { g } ; } ` )});var w3=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},_r=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}},th=globalThis&&globalThis.__awaiter||function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(d){try{c(i.next(d))}catch(h){r(h)}}function l(d){try{c(i.throw(d))}catch(h){r(h)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(o,e||[])).next())})};const Vee=524288;function dD(o,e="single",t=!1){if(!o.hasModel())return null;const i=o.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const n=o.getConfiguredWordAtPosition(i.getStartPosition());if(n&&t===!1)return n.word}else if(o.getModel().getValueLengthInRange(i)<Vee)return o.getModel().getValueInRange(i)}return null}let as=class S3 extends z{constructor(e,t,i,n){super(),this._editor=e,this._findWidgetVisible=Ic.bindTo(t),this._contextKeyService=t,this._storageService=i,this._clipboardService=n,this._updateHistoryDelayer=new $ r(500),this._state=this._register(new _ee),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange(s=>this._onStateChanged(s))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const s=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),s&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(37).loop})}))}get editor(){return this._editor}static get(e){return e.getContribution(S3.ID)}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,0),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,0),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,0),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,0)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!O1.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.i
2022-10-26 20:27:06 +08:00
The flag will not be saved for the future .
0 : Do Nothing
1 : True
2 : False ` )},wholeWord:{type:"boolean"},wholeWordOverride:{type:"number",description:p("actions.find.wholeWordOverride", ` Overrides "Match Whole Word" flag .
The flag will not be saved for the future .
0 : Do Nothing
1 : True
2 : False ` )},matchCase:{type:"boolean"},matchCaseOverride:{type:"number",description:p("actions.find.matchCaseOverride", ` Overrides "Math Case" flag .
The flag will not be saved for the future .
0 : Do Nothing
1 : True
2 : False ` )},preserveCase:{type:"boolean"},preserveCaseOverride:{type:"number",description:p("actions.find.preserveCaseOverride", ` Overrides "Preserve Case" flag .
The flag will not be saved for the future .
0 : Do Nothing
1 : True
2022-11-09 20:26:02 +08:00
2 : False ` )},findInSelection:{type:"boolean"}}}}]};class Uee extends he{constructor(){super({id:Dt.StartFindWithArgs,label:p("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},description:zee})}run(e,t,i){return th(this,void 0,void 0,function*(){const n=as.get(t);if(n){const s=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:i.replaceString!==void 0,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};yield n.start({forceRevealReplace:!1,seedSearchStringFromSelection:n.getState().searchString.length===0&&t.getOption(37).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(37).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(i==null?void 0:i.findInSelection)||!1,loop:t.getOption(37).loop},s),n.setGlobalBufferTerm(n.getState().searchString)}})}}class $ ee extends he{constructor(){super({id:Dt.StartFindWithSelection,label:p("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}run(e,t){return th(this,void 0,void 0,function*(){const i=as.get(t);i&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(37).loop}),i.setGlobalBufferTerm(i.getState().searchString))})}}class y3 extends he{run(e,t){return th(this,void 0,void 0,function*(){const i=as.get(t);i&&!this._run(i)&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.getState().searchString.length===0&&t.getOption(37).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(37).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(37).loop}),this._run(i))})}}class jee extends y3{constructor(){super({id:Dt.NextMatchFindAction,label:p("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:T.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:re.and(T.focus,O1),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class Kee extends y3{constructor(){super({id:Dt.PreviousMatchFindAction,label:p("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:T.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:re.and(T.focus,O1),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class L3 extends he{run(e,t){return th(this,void 0,void 0,function*(){const i=as.get(t);if(!i)return;const n=t.getOption(37).seedSearchStringFromSelection==="selection";let s=null;t.getOption(37).seedSearchStringFromSelection!=="never"&&(s=dD(t,"single",n)),s&&i.setSearchString(s),this._run(i)||(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:t.getOption(37).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:n,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(37).loop}),this._run(i))})}}class qee extends L3{constructor(){super({id:Dt.NextSelectionMatchFindAction,label:p("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class Gee extends L3{constructor(){super({id:Dt.PreviousSelectionMatchFindAction,label:p("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const Zee=aP(new rP({id:Dt.StartFindReplaceAct
2022-10-26 20:27:06 +08:00
* 'levels' : Number of levels to unfold . If not set , defaults to 1.
* 'direction' : If 'up' , unfold given number of levels up otherwise unfolds down .
* 'selectionLines' : Array of the start lines ( 0 - based ) of the editor selections to apply the unfold action to . If not set , the active selection ( s ) will be used .
2022-11-09 20:26:02 +08:00
` ,constraint:E3,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const s=n&&n.levels||1,r=this.getLineNumbers(n,i);n&&n.direction==="up"?D3(t,!1,s,r):Zg(t,!1,s,r)}}class vte extends pn{constructor(){super({id:"editor.unfoldRecursively",label:p("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:an,kbOpts:{kbExpr:T.editorTextFocus,primary:vi(2089,2137),weight:100}})}invoke(e,t,i,n){Zg(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class Cte extends pn{constructor(){super({id:"editor.fold",label:p("foldAction.label","Fold"),alias:"Fold",precondition:an,kbOpts:{kbExpr:T.editorTextFocus,primary:3159,mac:{primary:2647},weight:100},description:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description: ` Property - value pairs that can be passed through this argument :
2022-10-26 20:27:06 +08:00
* 'levels' : Number of levels to fold .
* 'direction' : If 'up' , folds given number of levels up otherwise folds down .
* 'selectionLines' : Array of the start lines ( 0 - based ) of the editor selections to apply the fold action to . If not set , the active selection ( s ) will be used .
If no levels or direction is set , folds the region at the locations or if already collapsed , the first uncollapsed parent instead .
2022-11-09 20:26:02 +08:00
` ,constraint:E3,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const s=this.getLineNumbers(n,i),r=n&&n.levels,a=n&&n.direction;typeof r!="number"&&typeof a!="string"?Jee(t,!0,s):a==="up"?D3(t,!0,r||1,s):Zg(t,!0,r||1,s)}}class wte extends pn{constructor(){super({id:"editor.toggleFold",label:p("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:an,kbOpts:{kbExpr:T.editorTextFocus,primary:vi(2089,2090),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);Qee(t,1,n)}}class Ste extends pn{constructor(){super({id:"editor.foldRecursively",label:p("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:an,kbOpts:{kbExpr:T.editorTextFocus,primary:vi(2089,2135),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);Zg(t,!0,Number.MAX_VALUE,n)}}class yte extends pn{constructor(){super({id:"editor.foldAllBlockComments",label:p("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:an,kbOpts:{kbExpr:T.editorTextFocus,primary:vi(2089,2133),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())nN(t,Zo.Comment.value,!0);else{const r=i.getModel();if(!r)return;const a=s.getLanguageConfiguration(r.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^ \\ s*"+Ds(a.blockCommentStartToken));iN(t,l,!0)}}}}class Lte extends pn{constructor(){super({id:"editor.foldAllMarkerRegions",label:p("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:an,kbOpts:{kbExpr:T.editorTextFocus,primary:vi(2089,2077),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())nN(t,Zo.Region.value,!0);else{const r=i.getModel();if(!r)return;const a=s.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);iN(t,l,!0)}}}}class Dte extends pn{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:p("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:an,kbOpts:{kbExpr:T.editorTextFocus,primary:vi(2089,2078),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())nN(t,Zo.Region.value,!1);else{const r=i.getModel();if(!r)return;const a=s.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);iN(t,l,!1)}}}}class kte extends pn{constructor(){super({id:"editor.foldAllExcept",label:p("foldAllExcept.label","Fold All Regions Except Selected"),alias:"Fold All Regions Except Selected",precondition:an,kbOpts:{kbExpr:T.editorTextFocus,primary:vi(2089,2131),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);k3(t,!0,n)}}class xte extends pn{constructor(){super({id:"editor.unfoldAllExcept",label:p("unfoldAllExcept.label","Unfold All Regions Except Selected"),alias:"Unfold All Regions Except Selected",precondition:an,kbOpts:{kbExpr:T.editorTextFocus,primary:vi(2089,2129),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);k3(t,!1,n)}}class Ite extends pn{constructor(){super({id:"editor.foldAll",label:p("foldAllAction.label","Fold All"),alias:"Fold All",precondition:an,kbOpts:{kbExpr:T.editorTextFocus,primary:vi(2089,2069),weight:100}})}invoke(e,t,i){Zg(t,!0)}}class Ete extends pn{constructor(){super({id:"editor.unfoldAll",label:p("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:an,kbOpts:{kbExpr:T.editorTextFocus,primary:vi(2089,2088),weight:100}})}invoke(e,t,i){Zg(t,!1)}}class ih extends pn{getFoldingLevel(){return parseInt(this.id.substr(ih.ID_PREFIX.length))}invoke(e,t,i){ete(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}ih.ID_PREFIX="editor.foldLevel";ih.ID=o=>ih.ID_PREFIX+o;class Nte extends pn{constructor(){super({id:"editor.gotoParentFold",label:p("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:an,kbOpts:{kbExpr:T.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const s
. monaco - editor . cldr$ { nt . asCSSSelector ( b _ ) } ,
. monaco - editor . cldr$ { nt . asCSSSelector ( B1 ) } ,
. monaco - editor . cldr$ { nt . asCSSSelector ( sN ) } ,
. monaco - editor . cldr$ { nt . asCSSSelector ( x3 ) } {
2022-10-26 20:27:06 +08:00
color : $ { i } ! important ;
}
2022-11-09 20:26:02 +08:00
` )});class Fte extends he{constructor(){super({id:"editor.action.fontZoomIn",label:p("EditorFontZoomIn.label","Editor Font Zoom In"),alias:"Editor Font Zoom In",precondition:void 0})}run(e,t){tl.setZoomLevel(tl.getZoomLevel()+1)}}class Bte extends he{constructor(){super({id:"editor.action.fontZoomOut",label:p("EditorFontZoomOut.label","Editor Font Zoom Out"),alias:"Editor Font Zoom Out",precondition:void 0})}run(e,t){tl.setZoomLevel(tl.getZoomLevel()-1)}}class Wte extends he{constructor(){super({id:"editor.action.fontZoomReset",label:p("EditorFontZoomReset.label","Editor Font Zoom Reset"),alias:"Editor Font Zoom Reset",precondition:void 0})}run(e,t){tl.setZoomLevel(0)}}te(Fte);te(Bte);te(Wte);class Lg{static _handleEolEdits(e,t){let i;const n=[];for(const s of t)typeof s.eol=="number"&&(i=s.eol),s.range&&typeof s.text=="string"&&n.push(s);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),n}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),n=i.validateRange(t.range);return i.getFullModelRange().equalsRange(n)}static execute(e,t,i){i&&e.pushUndoStop();const n=Lg._handleEolEdits(e,t);n.length===1&&Lg._isFullModelReplaceEdit(e,n[0])?e.executeEdits("formatEditsCommand",n.map(s=>Pt.replace(L.lift(s.range),s.text))):e.executeEdits("formatEditsCommand",n.map(s=>Pt.replaceMove(L.lift(s.range),s.text))),i&&e.pushUndoStop()}}class US{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}var Qo=globalThis&&globalThis.__awaiter||function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(d){try{c(i.next(d))}catch(h){r(h)}}function l(d){try{c(i.throw(d))}catch(h){r(h)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(o,e||[])).next())})};function oN(o){if(o=o.filter(n=>n.range),!o.length)return;let{range:e}=o[0];for(let n=1;n<o.length;n++)e=L.plusRange(e,o[n].range);const{startLineNumber:t,endLineNumber:i}=e;t===i?o.length===1?un(p("hint11","Made 1 formatting edit on line {0}",t)):un(p("hintn1","Made {0} formatting edits on line {1}",o.length,t)):o.length===1?un(p("hint1n","Made 1 formatting edit between lines {0} and {1}",t,i)):un(p("hintnn","Made {0} formatting edits between lines {1} and {2}",o.length,t,i))}function N3(o,e,t){const i=[],n=new Set,s=o.ordered(t);for(const a of s)i.push(a),a.extensionId&&n.add(US.toKey(a.extensionId));const r=e.ordered(t);for(const a of r){if(a.extensionId){if(n.has(US.toKey(a.extensionId)))continue;n.add(US.toKey(a.extensionId))}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,d){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,d)}})}return i}class nh{static setFormatterSelector(e){return{dispose:nh._selectors.unshift(e)}}static select(e,t,i){return Qo(this,void 0,void 0,function*(){if(e.length===0)return;const n=Ue.first(nh._selectors);if(n)return yield n(e,t,i)})}}nh._selectors=new wn;function T3(o,e,t,i,n,s){return Qo(this,void 0,void 0,function*(){const r=o.get(Re),{documentRangeFormattingEditProvider:a}=o.get(ue),l=pc(e)?e.getModel():e,c=a.ordered(l),d=yield nh.select(c,l,i);d&&(n.report(d),yield r.invokeFunction(Vte,d,e,t,s))})}function Vte(o,e,t,i,n){return Qo(this,void 0,void 0,function*(){const s=o.get(Qs);let r,a;pc(t)?(r=t.getModel(),a=new Kd(t,5,void 0,n)):(r=t,a=new dE(t,n));const l=[];let c=0;for(const f of iI(i).sort(L.compareRangesUsingStarts))c>0&&L.areIntersectingOrTouching(l[c-1],f)?l[c-1]=L.fromPositions(l[c-1].getStartPosition(),f.getEndPosition()):c=l.push(f);const d=f=>Qo(this,void 0,void 0,function*(){return(yield e.provideDocumentRangeFormattingEdits(r,f,r.getFormattingOptions(),a.token))||[]}),h=(f,_)=>{if(!f.length||!_.length)return!1;const b=f.reduce((v,C)=>L.plusRange(v,C.range),f[0].range);if(!_.some(v=>L.intersectRanges(b,v.range)))return!1;for(const v of f)for(const C of _)if(L.intersectRanges(v.range,C.range))return!0;return!1},u=[],g=[];try{for(const f of l){if(a.token.isCancellationRequested
` &&this.lineStartOffsetByLineIdx.push(t+1)}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}}const eie=[];function tie(){return eie}class O3{constructor(e,t,i=0){this.lineNumber=e,this.parts=t,this.additionalReservedLineCount=i}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],i=e.substr(0,t.column-1);return Qte(i,this.parts.map(s=>({range:{startLineNumber:1,endLineNumber:1,startColumn:s.column,endColumn:s.column},text:s.lines.join( `
` )}))).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}}class gD{constructor(e,t,i){this.column=e,this.lines=t,this.preview=i}}class P3{constructor(e,t,i,n,s=0){this.lineNumber=e,this.columnStart=t,this.length=i,this.newLines=n,this.additionalReservedLineCount=s,this.parts=[new gD(this.columnStart+this.length,this.newLines,!1)]}renderForScreenReader(e){return this.newLines.join( `
` )}}class F3 extends z{constructor(e){super(),this.editor=e,this._expanded=void 0,this.onDidChangeEmitter=new O,this.onDidChange=this.onDidChangeEmitter.event,this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(108)&&this._expanded===void 0&&this.onDidChangeEmitter.fire()}))}setExpanded(e){this._expanded=!0,this.onDidChangeEmitter.fire()}}function $ v(o,e){if(!e)return e;const t=o.getValueInRange(e.range),i=Pd(t,e.insertText),n=o.getOffsetAt(e.range.getStartPosition())+i,s=o.getPositionAt(n),r=t.substr(i),a=Np(r,e.insertText),l=o.getPositionAt(Math.max(n,o.getOffsetAt(e.range.getEndPosition())-a));return{range:L.fromPositions(s,l),insertText:e.insertText.substr(i,e.insertText.length-i-a),snippetInfo:e.snippetInfo,filterText:e.filterText,additionalTextEdits:e.additionalTextEdits}}function iie(o,e){return o===e?!0:!o||!e?!1:o.range.equalsRange(e.range)&&o.insertText===e.insertText&&o.command===e.command}function B3(o,e,t,i,n=0){if(o.range.startLineNumber!==o.range.endLineNumber)return;const s=e.getLineContent(o.range.startLineNumber),r=pt(s).length;if(o.range.startColumn-1<=r){const g=pt(o.insertText).length,f=s.substring(o.range.startColumn-1,r),_=L.fromPositions(o.range.getStartPosition().delta(0,f.length),o.range.getEndPosition()),b=o.insertText.startsWith(f)?o.insertText.substring(f.length):o.insertText.substring(g);o={range:_,insertText:b,command:o.command,snippetInfo:void 0,filterText:o.filterText,additionalTextEdits:o.additionalTextEdits}}const l=e.getValueInRange(o.range),c=nie(l,o.insertText);if(!c)return;const d=o.range.startLineNumber,h=new Array;if(t==="prefix"){const g=c.filter(f=>f.originalLength===0);if(g.length>1||g.length===1&&g[0].originalStart!==l.length)return}const u=o.insertText.length-n;for(const g of c){const f=o.range.startColumn+g.originalStart+g.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===o.range.startLineNumber&&f<i.column||g.originalLength>0)return;if(g.modifiedLength===0)continue;const _=g.modifiedStart+g.modifiedLength,b=Math.max(g.modifiedStart,Math.min(_,u)),v=o.insertText.substring(g.modifiedStart,b),C=o.insertText.substring(b,Math.max(g.modifiedStart,_));if(v.length>0){const w=Ur(v);h.push(new gD(f,w,!1))}if(C.length>0){const w=Ur(C);h.push(new gD(f,w,!0))}}return new O3(d,h,0)}let hr;function nie(o,e){if((hr==null?void 0:hr.originalValue)===o&&(hr==null?void 0:hr.newValue)===e)return hr==null?void 0:hr.changes;{let t=yA(o,e,!0);if(t){const i=SA(t);if(i>0){const n=yA(o,e,!1);n&&SA(n)<i&&(t=n)}}return hr={originalValue:o,newValue:e,changes:t},t}}function SA(o){let e=0;for(const t of o)e+=Math.max(t.originalLength-t.modifiedLength,0);return e}function yA(o,e,t){if(o.length>5e3||e.length>5e3)return;function i(c){let d=0;for(let h=0,u=c.length;h<u;h++){const g=c.charCodeAt(h);g>d&&(d=g)}return d}const n=Math.max(i(o),i(e));function s(c){if(c<0)throw new Error("unexpected");return n+c+1}function r(c){let d=0,h=0;const u=new Int32Array(c.length);for(let g=0,f=c.length;g<f;g++)if(t&&c[g]==="("){const _=h*100+d;u[g]=s(2*_),d++}else if(t&&c[g]===")"){d=Math.max(d-1,0);const _=h*100+d;u[g]=s(2*_+1),d===0&&h++}else u[g]=c.charCodeAt(g);return u}const a=r(o),l=r(e);return new kr({getElements:()=>a},{getElements:()=>l}).ComputeDiff(!1).changes}function sie(o,e){const t=new A4,i=new O4(t,c=>e.getLanguageConfiguration(c)),n=new R4(new oie([o]),i),s=tL(n,[],void 0,!0);let r="";const a=o.getLineContent();function l(c,d){if(c.kind===2)l(c.openingBracket,d),d=qt(d,c.openingBracket.length),c.child&&(l(c.child,d),d=qt(d,c.child.length)),c.closingBracket?(l(c.closingBracket,d),d=qt(d,c.closingBracket.length)):r+=i.getSingleLanguageBracketTokens(c.openingBracket.languageId).findClosingTokenText(c.openingBracket.bracketIds);else if(c.kind!==3){if(c.kind===0||c.kind===1)r+=a.substring(d,qt(d,c.length));else if(c.kind===4)for(const h of c.children)l(h,d),d=qt(d,h.length)}}return l(s,go),r}class oie{constructor(e){this.lines=e,this.tokenization={getLineTokens:t=>this.lines[t-1]}}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}var rie=global
` ),0)}get currentCompletion(){const e=this.currentCachedCompletion;if(!!e)return e.toLiveInlineCompletion()}get isValid(){return this.editor.getPosition().lineNumber===this.triggerPosition.lineNumber}scheduleAutomaticUpdate(){this.updateOperation.clear(),this.updateSoon.schedule(this.debounce.get(this.editor.getModel()))}update(e){return Ia(this,void 0,void 0,function*(){if(!this.shouldUpdate())return;const t=this.editor.getPosition(),i=new Date,n=Ti(r=>Ia(this,void 0,void 0,function*(){let a;try{a=yield V3(this.registry,t,this.editor.getModel(),{triggerKind:e,selectedSuggestionInfo:void 0},r,this.languageConfigurationService);const l=new Date;this.debounce.update(this.editor.getModel(),l.getTime()-i.getTime())}catch(l){Ee(l);return}r.isCancellationRequested||(this.cache.setValue(this.editor,a,e),this.updateFilteredInlineCompletions(),this.onDidChangeEmitter.fire())})),s=new W3(n,e);this.updateOperation.value=s,yield n,this.updateOperation.value===s&&this.updateOperation.clear()})}takeOwnership(e){this._register(e)}commitCurrentCompletion(){if(!this.ghostText)return;const t=this.currentCompletion;t&&this.commit(t)}commit(e){var t;const i=this.cache.clearAndLeak();e.snippetInfo?(this.editor.executeEdits("inlineSuggestion.accept",[Pt.replaceMove(e.range,""),...e.additionalTextEdits]),this.editor.setPosition(e.snippetInfo.range.getStartPosition()),(t=Mi.get(this.editor))===null||t===void 0||t.insert(e.snippetInfo.snippet)):this.editor.executeEdits("inlineSuggestion.accept",[Pt.replaceMove(e.range,e.insertText),...e.additionalTextEdits]),e.command?this.commandService.executeCommand(e.command.id,...e.command.arguments||[]).finally(()=>{i==null||i.dispose()}).then(void 0,Ai):i==null||i.dispose(),this.onDidChangeEmitter.fire()}get commands(){var e;return[...new Set(((e=this.cache.value)===null||e===void 0?void 0:e.completions.map(i=>i.inlineCompletion.sourceInlineCompletions))||[])].flatMap(i=>i.commands||[])}}class W3{constructor(e,t){this.promise=e,this.triggerKind=t}dispose(){this.promise.cancel()}}class lie extends z{constructor(e,t,i,n){super(),this.editor=t,this.onChange=i,this.triggerKind=n,this.isDisposing=!1;const s=t.changeDecorations(r=>r.deltaDecorations([],e.items.map(a=>({range:a.range,options:{description:"inline-completion-tracking-range"}}))));this._register(ze(()=>{this.isDisposing=!0,t.removeDecorations(s)})),this.completions=e.items.map((r,a)=>new cie(r,s[a])),this._register(t.onDidChangeModelContent(()=>{this.updateRanges()})),this._register(e)}updateRanges(){if(this.isDisposing)return;let e=!1;const t=this.editor.getModel();for(const i of this.completions){const n=t.getDecorationRange(i.decorationId);if(!n){Ee(new Error("Decoration has no range"));continue}i.synchronizedRange.equalsRange(n)||(e=!0,i.synchronizedRange=n)}e&&this.onChange()}}class cie{constructor(e,t){this.inlineCompletion=e,this.decorationId=t,this.semanticId=JSON.stringify({text:this.inlineCompletion.insertText,abbreviation:this.inlineCompletion.filterText,startLine:this.inlineCompletion.range.startLineNumber,startColumn:this.inlineCompletion.range.startColumn,command:this.inlineCompletion.command}),this.synchronizedRange=e.range}toLiveInlineCompletion(){return{insertText:this.inlineCompletion.insertText,range:this.synchronizedRange,command:this.inlineCompletion.command,sourceProvider:this.inlineCompletion.sourceProvider,sourceInlineCompletions:this.inlineCompletion.sourceInlineCompletions,sourceInlineCompletion:this.inlineCompletion.sourceInlineCompletion,snippetInfo:this.inlineCompletion.snippetInfo,filterText:this.inlineCompletion.filterText,additionalTextEdits:this.inlineCompletion.additionalTextEdits}}}function V3(o,e,t,i,n=We.None,s){return Ia(this,void 0,void 0,function*(){const r=die(e,t),a=o.all(t),l=yield Promise.all(a.map(d=>Ia(this,void 0,void 0,function*(){const h=yield Promise.resolve(d.provideInlineCompletions(t,e,i,n)).catch(Ai);return{completions:h,provider:d,dispose:()=>{h&&d.freeInlineCompletions(h)}}}))),c=new Map;for(const d of l){const h=d.completions;if(!!h)for(const u of h.items){let g=u.range?L.lift(u.range):r;if(
$ { m . symbolValue . cssSelector } , $ { m . symbolEnum . cssSelector } { color : $ { c } ; } ` );const d=o.getColor(Rie);d&&e.addRule( ` $ { m . symbolEnumMember . cssSelector } { color : $ { d } ; } ` );const h=o.getColor(Oie);h&&e.addRule( ` $ { m . symbolEvent . cssSelector } { color : $ { h } ; } ` );const u=o.getColor(Pie);u&&e.addRule( ` $ { m . symbolField . cssSelector } { color : $ { u } ; } ` );const g=o.getColor(Fie);g&&e.addRule( ` $ { m . symbolFile . cssSelector } { color : $ { g } ; } ` );const f=o.getColor(Bie);f&&e.addRule( ` $ { m . symbolFolder . cssSelector } { color : $ { f } ; } ` );const _=o.getColor(Wie);_&&e.addRule( ` $ { m . symbolFunction . cssSelector } { color : $ { _ } ; } ` );const b=o.getColor(Vie);b&&e.addRule( ` $ { m . symbolInterface . cssSelector } { color : $ { b } ; } ` );const v=o.getColor(Hie);v&&e.addRule( ` $ { m . symbolKey . cssSelector } { color : $ { v } ; } ` );const C=o.getColor(zie);C&&e.addRule( ` $ { m . symbolKeyword . cssSelector } { color : $ { C } ; } ` );const w=o.getColor( $ ie);w&&e.addRule( ` $ { m . symbolModule . cssSelector } { color : $ { w } ; } ` );const S=o.getColor(jie);S&&e.addRule( ` $ { m . symbolNamespace . cssSelector } { color : $ { S } ; } ` );const k=o.getColor(Kie);k&&e.addRule( ` $ { m . symbolNull . cssSelector } { color : $ { k } ; } ` );const x=o.getColor(qie);x&&e.addRule( ` $ { m . symbolNumber . cssSelector } { color : $ { x } ; } ` );const y=o.getColor(Gie);y&&e.addRule( ` $ { m . symbolObject . cssSelector } { color : $ { y } ; } ` );const D=o.getColor(Zie);D&&e.addRule( ` $ { m . symbolOperator . cssSelector } { color : $ { D } ; } ` );const I=o.getColor(Yie);I&&e.addRule( ` $ { m . symbolPackage . cssSelector } { color : $ { I } ; } ` );const R=o.getColor(Xie);R&&e.addRule( ` $ { m . symbolProperty . cssSelector } { color : $ { R } ; } ` );const P=o.getColor(Qie);P&&e.addRule( ` $ { m . symbolReference . cssSelector } { color : $ { P } ; } ` );const H=o.getColor(Jie);H&&e.addRule( ` $ { m . symbolSnippet . cssSelector } { color : $ { H } ; } ` );const $ =o.getColor(ene); $ &&e.addRule( ` $ { m . symbolString . cssSelector } { color : $ { $ } ; } ` );const ne=o.getColor(tne);ne&&e.addRule( ` $ { m . symbolStruct . cssSelector } { color : $ { ne } ; } ` );const ae=o.getColor(ine);ae&&e.addRule( ` $ { m . symbolText . cssSelector } { color : $ { ae } ; } ` );const de=o.getColor(nne);de&&e.addRule( ` $ { m . symbolTypeParameter . cssSelector } { color : $ { de } ; } ` );const we=o.getColor(sne);we&&e.addRule( ` $ { m . symbolUnit . cssSelector } { color : $ { we } ; } ` );const Se=o.getColor(one);Se&&e.addRule( ` $ { m . symbolVariable . cssSelector } { color : $ { Se } ; } ` )});class $ 3{constructor(){this._onDidWillResize=new O,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new O,this.onDidResize=this._onDidResize.event,this._sashListener=new ee,this._size=new bt(0,0),this._minSize=new bt(0,0),this._maxSize=new bt(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Zi(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new Zi(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new Zi(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:pv.North}),this._southSash=new Zi(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:pv.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(pe.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(pe.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(n=>{e&&(i=n.currentX-n.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(n=>{e&&(i=-(n.currentX-n.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.
2022-10-26 20:27:06 +08:00
` ,a+= ` prefix : $ { ( i = e . word ) !== null && i !== void 0 ? i : "(no prefix)" }
` ,a+= ` word : $ { e . completion . filterText ? e . completion . filterText + " (filterText)" : e . textLabel }
` ,a+= ` distance : $ { e . distance } ( localityBonus - setting )
` ,a+= ` index : $ { e . idx } , based on $ { e . completion . sortText && ` sortText: " ${ e . completion . sortText } " ` || "label" }
` ,a+= ` commit _chars : $ { ( n = e . completion . commitCharacters ) === null || n === void 0 ? void 0 : n . join ( "" ) }
2022-11-09 20:26:02 +08:00
` ,r=new Rn().appendCodeblock("empty",a),s= ` Provider : $ { e . provider . _debugDisplayName } ` }if(!t&&!cN(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),s){const a=s.length>1e5? ` $ { s . substr ( 0 , 1e5 ) } \u2026 ` :s;this._type.textContent=a,this._type.title=a,bs(this._type),this._type.classList.toggle("auto-wrap",!/ \r ? \n ^ \s +/gmi.test(a))}else Ii(this._type),this._type.title="",An(this._type),this.domNode.classList.add("no-type");if(Ii(this._docs),typeof r=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=r;else if(r){this._docs.classList.add("markdown-docs"),Ii(this._docs);const a=this._markdownRenderer.render(r);this._docs.appendChild(a.element),this._renderDisposeable.add(a),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=a=>{a.preventDefault(),a.stopPropagation()},this._close.onclick=a=>{a.preventDefault(),a.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get size(){return this._size}layout(e,t){const i=new bt(e,t);bt.equals(i,this._size)||(this._size=i,dB(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}};_D=rne([ane(1,Re)],_D);class lne{constructor(e,t){this.widget=e,this._editor=t,this._disposables=new ee,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new $ 3,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,n,s=0,r=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,n=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&n){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(r=n.width-a.dimension.width,l=!0),a.north&&(s=n.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:i.top+s,left:i.left+r})}a.done&&(i=void 0,n=void 0,s=0,r=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{var a;this._anchorBox&&this._placeAtAnchor(this._anchorBox,(a=this._userSize)!==null&&a!==void 0?a:this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return null}show(){this._added||(this._editor.addOverlayWidget(this),this.getDomNode().style.position="fixed",this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){var i;const n=e.getBoundingClientRect();this._anchorBox=n,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,(i=this._userSize)!==null&&i!==void 0?i:this.widget.size,t)}_placeAtAnchor(e,t,i){var n;const s=yC(document.body),r=this.widget.getLayoutInfo(),a=new bt(220,2*r.lineHeight),l=e.top,c=function(){const w=s.width-(e.left+e.width+r.borderWidth+r.horizontalPadding),S=-r.borderWidth+e.left+e.width,k=new bt(w,s.height-e.top-r.borderHeight-r.verticalPadding),x=k.with(void 0,e.top+e.height-r.borderHeight-r.verticalPadding);return{top:l,left:S,fit:w-t.width,maxSizeTop:k,maxSizeBottom:x,minSize:a.with(Math.min(w,a.width))}}(),d=function(){const w=e.left-r.borderWidth-r.horizontalPadding,S=Math.max(r.horizontalPadding,e.
2022-10-26 20:27:06 +08:00
` );s===""&&this._isCopyingDown&&(this._startLineNumberDelta++,this._endLineNumberDelta++),this._noop?t.addEditOperation(new L(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber+1,1),i.endLineNumber===e.getLineCount()?"": `
` ):this._isCopyingDown?t.addEditOperation(new L(i.startLineNumber,1,i.startLineNumber,1),s+ `
` ):t.addEditOperation(new L(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)), `
2022-11-09 20:26:02 +08:00
` +s),this._selectionId=t.trackSelection(i),this._selectionDirection=this._selection.getDirection()}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);if(this._startLineNumberDelta!==0||this._endLineNumberDelta!==0){let n=i.startLineNumber,s=i.startColumn,r=i.endLineNumber,a=i.endColumn;this._startLineNumberDelta!==0&&(n=n+this._startLineNumberDelta,s=1),this._endLineNumberDelta!==0&&(r=r+this._endLineNumberDelta,a=1),i=oe.createWithDirection(n,s,r,a,this._selectionDirection)}return i}}var use=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},gse=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}};let TD=class{constructor(e,t,i,n){this._languageConfigurationService=n,this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const i=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===i){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let n=this._selection;n.startLineNumber<n.endLineNumber&&n.endColumn===1&&(this._moveEndPositionDown=!0,n=n.setEndPosition(n.endLineNumber-1,e.getLineMaxColumn(n.endLineNumber-1)));const{tabSize:s,indentSize:r,insertSpaces:a}=e.getOptions(),l=this.buildIndentConverter(s,r,a),c={tokenization:{getLineTokens:d=>e.tokenization.getLineTokens(d),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(d,h)=>e.getLanguageIdAtPosition(d,h)},getLineContent:null};if(n.startLineNumber===n.endLineNumber&&e.getLineMaxColumn(n.startLineNumber)===1){const d=n.startLineNumber,h=this._isMovingDown?d+1:d-1;e.getLineMaxColumn(h)===1?t.addEditOperation(new L(1,1,1,1),null):(t.addEditOperation(new L(d,1,d,1),e.getLineContent(h)),t.addEditOperation(new L(h,1,h,e.getLineMaxColumn(h)),null)),n=new oe(h,1,h,1)}else{let d,h;if(this._isMovingDown){d=n.endLineNumber+1,h=e.getLineContent(d),t.addEditOperation(new L(d-1,e.getLineMaxColumn(d-1),d,e.getLineMaxColumn(d)),null);let u=h;if(this.shouldAutoIndent(e,n)){const g=this.matchEnterRule(e,l,s,d,n.startLineNumber-1);if(g!==null){const _=pt(e.getLineContent(d)),b=g+Kn(_,s);u=mp(b,s,a)+this.trimLeft(h)}else{c.getLineContent=b=>b===n.startLineNumber?e.getLineContent(d):e.getLineContent(b);const _=Qf(this._autoIndent,c,e.getLanguageIdAtPosition(d,1),n.startLineNumber,l,this._languageConfigurationService);if(_!==null){const b=pt(e.getLineContent(d)),v=Kn(_,s),C=Kn(b,s);v!==C&&(u=mp(v,s,a)+this.trimLeft(h))}}t.addEditOperation(new L(n.startLineNumber,1,n.startLineNumber,1),u+ `
` );const f=this.matchEnterRuleMovingDown(e,l,s,n.startLineNumber,d,u);if(f!==null)f!==0&&this.getIndentEditsOfMovingBlock(e,t,n,s,a,f);else{c.getLineContent=b=>b===n.startLineNumber?u:b>=n.startLineNumber+1&&b<=n.endLineNumber+1?e.getLineContent(b-1):e.getLineContent(b);const _=Qf(this._autoIndent,c,e.getLanguageIdAtPosition(d,1),n.startLineNumber+1,l,this._languageConfigurationService);if(_!==null){const b=pt(e.getLineContent(n.startLineNumber)),v=Kn(_,s),C=Kn(b,s);if(v!==C){const w=v-C;this.getIndentEditsOfMovingBlock(e,t,n,s,a,w)}}}}else t.addEditOperation(new L(n.startLineNumber,1,n.startLineNumber,1),u+ `
2022-10-26 20:27:06 +08:00
` )}else if(d=n.startLineNumber-1,h=e.getLineContent(d),t.addEditOperation(new L(d,1,d+1,1),null),t.addEditOperation(new L(n.endLineNumber,e.getLineMaxColumn(n.endLineNumber),n.endLineNumber,e.getLineMaxColumn(n.endLineNumber)), `
2022-11-09 20:26:02 +08:00
` +h),this.shouldAutoIndent(e,n)){c.getLineContent=g=>g===d?e.getLineContent(n.startLineNumber):e.getLineContent(g);const u=this.matchEnterRule(e,l,s,n.startLineNumber,n.startLineNumber-2);if(u!==null)u!==0&&this.getIndentEditsOfMovingBlock(e,t,n,s,a,u);else{const g=Qf(this._autoIndent,c,e.getLanguageIdAtPosition(n.startLineNumber,1),d,l,this._languageConfigurationService);if(g!==null){const f=pt(e.getLineContent(n.startLineNumber)),_=Kn(g,s),b=Kn(f,s);if(_!==b){const v=_-b;this.getIndentEditsOfMovingBlock(e,t,n,s,a,v)}}}}}this._selectionId=t.trackSelection(n)}buildIndentConverter(e,t,i){return{shiftIndent:n=>Fs.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>Fs.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,s){if(s){let r=s.indentation;s.indentAction===oi.None||s.indentAction===oi.Indent?r=s.indentation+s.appendText:s.indentAction===oi.IndentOutdent?r=s.indentation:s.indentAction===oi.Outdent&&(r=t.unshiftIndent(s.indentation)+s.appendText);const a=e.getLineContent(n);if(this.trimLeft(a).indexOf(this.trimLeft(r))>=0){const l=pt(e.getLineContent(n));let c=pt(r);const d=RP(e,n,this._languageConfigurationService);d!==null&&d&2&&(c=t.unshiftIndent(c));const h=Kn(c,i),u=Kn(l,i);return h-u}}return null}matchEnterRuleMovingDown(e,t,i,n,s,r){if(Fr(r)>=0){const a=e.getLineMaxColumn(s),l=Nu(this._autoIndent,e,new L(s,a,s,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}else{let a=n-1;for(;a>=1;){const d=e.getLineContent(a);if(Fr(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=Nu(this._autoIndent,e,new L(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,c)}}matchEnterRule(e,t,i,n,s,r){let a=s;for(;a>=1;){let d;if(a===s&&r!==void 0?d=r:d=e.getLineContent(a),Fr(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=Nu(this._autoIndent,e,new L(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,c)}trimLeft(e){return e.replace(/^ \s +/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const i=e.getLanguageIdAtPosition(t.startLineNumber,1),n=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(i!==n||this._languageConfigurationService.getLanguageConfiguration(i).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,i,n,s,r){for(let a=i.startLineNumber;a<=i.endLineNumber;a++){const l=e.getLineContent(a),c=pt(l),h=Kn(c,n)+r,u=mp(h,n,s);u!==c&&(t.addEditOperation(new L(a,1,a,c.length+1),u),a===i.endLineNumber&&i.endColumn<=c.length+1&&u===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber<i.endLineNumber&&(i=i.setEndPosition(i.endLineNumber,2)),i}};TD=use([gse(3,ti)],TD);class Jl{constructor(e,t){this.selection=e,this.descending=t,this.selectionId=null}static getCollator(){return Jl._COLLATOR||(Jl._COLLATOR=new Intl.Collator),Jl._COLLATOR}getEditOperations(e,t){const i=fse(e,this.selection,this.descending);i&&t.addEditOperation(i.range,i.text),this.selectionId=t.trackSelection(this.selection)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}static canRun(e,t,i){if(e===null)return!1;const n=i7(e,t,i);if(!n)return!1;for(let s=0,r=n.before.length;s<r;s++)if(n.before[s]!==n.after[s])return!0;return!1}}Jl._COLLATOR=null;function i7(o,e,t){const i=e.startLineNumber;let n=e.endLineNumber;if(e.endColumn===1&&n--,i>=n)return null;const s=[];for(let a=i;a<=n;a++)s.push(o.getLineContent(a));let r=s.slice(0);return r.sort(Jl.getCollator().compare),t===!0&&(r=r.reverse()),{startLineNumber:i,endLineNumber:n,before:s,after:r}}function fse(o,e,t){const i=i7(o,e,t);return i?Pt.replace(new L(i.startLineNumber,1,i.endLineNumber,o.getLineMaxColumn(i.endLineNumber)),i.after.join( `
` )):null}class n7 extends he{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((r,a)=>({selection:r,index:a,ignore:!1}));i.sort((r,a)=>L.compareRangesUsingStarts(r.selection,a.selection));let n=i[0];for(let r=1;r<i.length;r++){const a=i[r];n.selection.endLineNumber===a.selection.startLineNumber&&(n.index<a.index?a.ignore=!0:(n.ignore=!0,n=a))}const s=[];for(const r of i)s.push(new t7(r.selection,this.down,r.ignore));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class pse extends n7{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:p("lines.copyUp","Copy Line Up"),alias:"Copy Line Up",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:A.MenubarSelectionMenu,group:"2_line",title:p({key:"miCopyLinesUp",comment:["&& denotes a mnemonic"]},"&&Copy Line Up"),order:1}})}}class mse extends n7{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:p("lines.copyDown","Copy Line Down"),alias:"Copy Line Down",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:A.MenubarSelectionMenu,group:"2_line",title:p({key:"miCopyLinesDown",comment:["&& denotes a mnemonic"]},"Co&&py Line Down"),order:2}})}}class _se extends he{constructor(){super({id:"editor.action.duplicateSelection",label:p("duplicateSelection","Duplicate Selection"),alias:"Duplicate Selection",precondition:T.writable,menuOpts:{menuId:A.MenubarSelectionMenu,group:"2_line",title:p({key:"miDuplicateSelection",comment:["&& denotes a mnemonic"]},"&&Duplicate Selection"),order:5}})}run(e,t,i){if(!t.hasModel())return;const n=[],s=t.getSelections(),r=t.getModel();for(const a of s)if(a.isEmpty())n.push(new t7(a,!0));else{const l=new oe(a.endLineNumber,a.endColumn,a.endLineNumber,a.endColumn);n.push(new lW(l,r.getValueInRange(a)))}t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class s7 extends he{constructor(e,t){super(t),this.down=e}run(e,t){const i=e.get(ti),n=[],s=t.getSelections()||[],r=t.getOption(9);for(const a of s)n.push(new TD(a,this.down,r,i));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class bse extends s7{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:p("lines.moveUp","Move Line Up"),alias:"Move Line Up",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:A.MenubarSelectionMenu,group:"2_line",title:p({key:"miMoveLinesUp",comment:["&& denotes a mnemonic"]},"Mo&&ve Line Up"),order:3}})}}class vse extends s7{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:p("lines.moveDown","Move Line Down"),alias:"Move Line Down",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:A.MenubarSelectionMenu,group:"2_line",title:p({key:"miMoveLinesDown",comment:["&& denotes a mnemonic"]},"Move &&Line Down"),order:4}})}}class o7 extends he{constructor(e,t){super(t),this.descending=e}run(e,t){const i=t.getSelections()||[];for(const s of i)if(!Jl.canRun(t.getModel(),s,this.descending))return;const n=[];for(let s=0,r=i.length;s<r;s++)n[s]=new Jl(i[s],this.descending);t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class Cse extends o7{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:p("lines.sortAscending","Sort Lines Ascending"),alias:"Sort Lines Ascending",precondition:T.writable})}}class wse extends o7{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:p("lines.sortDescending","Sort Lines Descending"),alias:"Sort Lines Descending",precondition:T.writable})}}class Sse extends he{constructor(){super({id:"editor.action.removeDuplicateLines",label:p("lines.deleteDuplicates","Delete Duplicate Lines"),alias:"Delete Duplicate Lines",precondition:T.writable})}run(e,t){if(!t.hasModel())return;const i=t.getModel();if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return;const n=[],s=[];let r=0;for(const a of t.getSel
` ))),s.push(u),r+=a.endLineNumber-a.startLineNumber+1-c.length}t.pushUndoStop(),t.executeEdits(this.id,n,s),t.pushUndoStop()}}class q1 extends he{constructor(){super({id:q1.ID,label:p("lines.trimTrailingWhitespace","Trim Trailing Whitespace"),alias:"Trim Trailing Whitespace",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:vi(2089,2102),weight:100}})}run(e,t,i){let n=[];i.reason==="auto-save"&&(n=(t.getSelections()||[]).map(a=>new B(a.positionLineNumber,a.positionColumn)));const s=t.getSelection();if(s===null)return;const r=new dse(s,n);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop()}}q1.ID="editor.action.trimTrailingWhitespace";class yse extends he{constructor(){super({id:"editor.action.deleteLines",label:p("lines.delete","Delete Line"),alias:"Delete Line",precondition:T.writable,kbOpts:{kbExpr:T.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),n=t.getModel();if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let s=0;const r=[],a=[];for(let l=0,c=i.length;l<c;l++){const d=i[l];let h=d.startLineNumber,u=d.endLineNumber,g=1,f=n.getLineMaxColumn(u);u<n.getLineCount()?(u+=1,f=1):h>1&&(h-=1,g=n.getLineMaxColumn(h)),r.push(Pt.replace(new oe(h,g,u,f),"")),a.push(new oe(h-s,d.positionColumn,h-s,d.positionColumn)),s+=d.endLineNumber-d.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(s=>{let r=s.endLineNumber;return s.startLineNumber<s.endLineNumber&&s.endColumn===1&&(r-=1),{startLineNumber:s.startLineNumber,selectionStartColumn:s.selectionStartColumn,endLineNumber:r,positionColumn:s.positionColumn}});t.sort((s,r)=>s.startLineNumber===r.startLineNumber?s.endLineNumber-r.endLineNumber:s.startLineNumber-r.startLineNumber);const i=[];let n=t[0];for(let s=1;s<t.length;s++)n.endLineNumber+1>=t[s].startLineNumber?n.endLineNumber=t[s].endLineNumber:(i.push(n),n=t[s]);return i.push(n),i}}class Lse extends he{constructor(){super({id:"editor.action.indentLines",label:p("lines.indent","Indent Line"),alias:"Indent Line",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:2137,weight:100}})}run(e,t){const i=t._getViewModel();!i||(t.pushUndoStop(),t.executeCommands(this.id,Ot.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class Dse extends he{constructor(){super({id:"editor.action.outdentLines",label:p("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:2135,weight:100}})}run(e,t){Tu.Outdent.runEditorCommand(e,t,null)}}class kse extends he{constructor(){super({id:"editor.action.insertLineBefore",label:p("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();!i||(t.pushUndoStop(),t.executeCommands(this.id,Ot.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class xse extends he{constructor(){super({id:"editor.action.insertLineAfter",label:p("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();!i||(t.pushUndoStop(),t.executeCommands(this.id,Ot.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class r7 extends he{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),n=this._getRangesToDelete(t),s=[];for(let l=0,c=n.length-1;l<c;l++){const d=n[l],h=n[l+1];L.intersectRanges(d,h)===null?s.push(d):n[l+1]=L.plusRange(d,h)}s.push(n[n.length-1]);const r=this._getEndCursorState(i,s),a=s.map(l=>Pt.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,r),t.pushUndoStop()}}class Ise extends r7{constructor(){super({id:"deleteAllLeft",label:p("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:T.writable,kbOpts:{kbExpr:T.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let i=null;const n=[];let s=0;return t.forEach(r=>
` );return new Em(e,t,n,c,s,r,d)}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new Ob(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new Ob(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(119):null,!1);return i?new oe(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new Ob(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new Ob(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(119):null,!1);return i?new oe(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(119):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(119):null,!1,1073741824)}}class rh extends z{constructor(e){super(),this._sessionDispose=this._register(new ee),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}static get(e){return e.getContribution(rh.ID)}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=Em.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(n=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(n=>{(n.matchCase||n.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new oe(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){!e||(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(!!this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const n=e.getState().matchCase;if(!g7(this._editor.getModel(),t,n)){const r=this._editor.getModel(),a=[];for(let l=0,c=t.length;l<c;l++)a[l]=this._expandEmptyToWord(r,t[l]);this.
2022-10-26 20:27:06 +08:00
` ):void 0}:{range:L.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join( `
2022-11-09 20:26:02 +08:00
` ):void 0}})}provideRenameEdits(e,t){return Id(this,void 0,void 0,function*(){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)})}_provideRenameEdits(e,t,i,n){return Id(this,void 0,void 0,function*(){const s=this._providers[t];if(!s)return{edits:[],rejectReason:i.join( `
` )};const r=yield s.provideRenameEdits(this.model,this.position,e,n);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(p("no result","No result.")),n);return r})}}function moe(o,e,t,i){return Id(this,void 0,void 0,function*(){const n=new fN(e,t,o),s=yield n.resolveRenameLocation(We.None);return s!=null&&s.rejectReason?{edits:[],rejectReason:s.rejectReason}:n.provideRenameEdits(i,We.None)})}let dh=class v7{constructor(e,t,i,n,s,r,a,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=s,this._logService=r,this._configService=a,this._languageFeaturesService=l,this._disposableStore=new ee,this._cts=new gn,this._renameInputField=this._disposableStore.add(new ql(()=>this._disposableStore.add(this._instaService.createInstance(RD,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))))}static get(e){return e.getContribution(v7.ID)}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}run(){var e,t;return Id(this,void 0,void 0,function*(){if(this._cts.dispose(!0),!this.editor.hasModel())return;const i=this.editor.getPosition(),n=new fN(this.editor.getModel(),i,this._languageFeaturesService.renameProvider);if(!n.hasProvider())return;this._cts=new Kd(this.editor,5);let s;try{const u=n.resolveRenameLocation(this._cts.token);this._progressService.showWhile(u,250),s=yield u}catch(u){(e=rs.get(this.editor))===null||e===void 0||e.showMessage(u||p("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),i);return}if(!s)return;if(s.rejectReason){(t=rs.get(this.editor))===null||t===void 0||t.showMessage(s.rejectReason,i);return}if(this._cts.token.isCancellationRequested)return;this._cts.dispose(),this._cts=new Kd(this.editor,5,s.range);const r=this.editor.getSelection();let a=0,l=s.text.length;!L.isEmpty(r)&&!L.spansMultipleLines(r)&&L.containsRange(s.range,r)&&(a=Math.max(0,r.startColumn-s.range.startColumn),l=Math.min(s.range.endColumn,r.endColumn)-s.range.startColumn);const c=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),d=yield this._renameInputField.value.getInput(s.range,s.text,a,l,c,this._cts.token);if(typeof d=="boolean"){d&&this.editor.focus();return}this.editor.focus();const h=aI(n.provideRenameEdits(d.newName,this._cts.token),this._cts.token).then(u=>Id(this,void 0,void 0,function*(){if(!(!u||!this.editor.hasModel())){if(u.rejectReason){this._notificationService.info(u.rejectReason);return}this.editor.setSelection(L.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply( $ g.convert(u),{editor:this.editor,showPreview:d.wantsPreview,label:p("label","Renaming '{0}' to '{1}'",s==null?void 0:s.text,d.newName),code:"undoredo.rename",quotableLabel:p("quotableLabel","Renaming {0} to {1}",s==null?void 0:s.text,d.newName),respectAutoSaveConfig:!0}).then(g=>{g.ariaSummary&&un(p("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",s.text,d.newName,g.ariaSummary))}).catch(g=>{this._notificationService.error(p("rename.failedApply","Rename failed to apply edits")),this._logService.error(g)})}}),u=>{this._notificationService.error(p("rename.failed","Rename failed to compute edits")),this._logService.error(u)});return this._progressService.showWhile(h,250),h})}acceptRenameInput(e){this._renameInputField.value.acceptInput(e)}cancelRenameInput(){this._renameInputField.value.cancelInput(!0)}};dh.ID="editor.contrib.renameController";dh=poe([zc(1,Re),zc(2,gi),zc(3,n_),zc(4,kc),zc(5,Co),zc(6,gN),zc(7,ue)],dh);class _oe extends he{constructor(){super({id:"editor.action.rename",label:p("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:re.and(T.writable,T.hasRenameProvider),kbOpts:{kbExpr:T.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(dt),[n,s]=Array.isArray(t)&&t||[void 0,void 0];return me.isUri(n)&&B.isIPosition(s)?i.openCodeEditor({resour
` ||o===" "}var Noe=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Toe=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}};let Ck=class extends z{constructor(e,t,i={},n){var s;super(),this._link=t,this._enabled=!0,this.el=G(e,se("a.monaco-link",{tabIndex:(s=t.tabIndex)!==null&&s!==void 0?s:0,href:t.href,title:t.title},t.label)),this.el.setAttribute("role","button");const r=this._register(new _t(this.el,"click")),a=this._register(new _t(this.el,"keypress")),l=pe.chain(a.event).map(h=>new Mt(h)).filter(h=>h.keyCode===3).event,c=this._register(new _t(this.el,kt.Tap)).event;this._register(ut.addTarget(this.el));const d=pe.any(r.event,l,c);this._register(d(h=>{!this.enabled||(ct.stop(h,!0),i!=null&&i.opener?i.opener(this._link.href):n.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}};Ck=Noe([Toe(3,So)],Ck);Rt((o,e)=>{const t=o.getColor(qC);t&&e.addRule( ` . monaco - link { color : $ { t } ; } ` );const i=o.getColor(GC);i&&e.addRule( ` . monaco - link : hover { color : $ { i } ; } ` )});var y7=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},L7=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}};const Moe=26;let wk=class extends z{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(Sk))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show(Object.assign(Object.assign({},e),{onClose:()=>{var t;this.hide(),(t=e.onClose)===null||t===void 0||t.call(e)}})),this._editor.setBanner(this.banner.element,Moe)}};wk=y7([L7(1,Re)],wk);let Sk=class extends z{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(sl,{}),this.element=se("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=se("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Ii(this.element)}show(e){Ii(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=G(this.element,se("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(se( ` div$ { nt . asCSSSelector ( e . icon ) } ` ));const n=G(this.element,se("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=G(this.element,se("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(Ck,this.messageActionsContainer,Object.assign(Object.assign({},r),{tabIndex:-1}),{}));const s=G(this.element,se("div.action-container"));this.actionBar=this._register(new qr(s)),this.actionBar.push(this._register(new is("banner.close","Close Banner",nt.asClassName(b5),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};Sk=y7([L7(0,Re)],Sk);const D7=qe("workspaceTrustManagementService");v
2022-10-26 20:27:06 +08:00
` ?a=2:l=== `
2022-11-09 20:26:02 +08:00
` &&(a=1);let c=Xi.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace!="undefined"&&(c=e.editor.trimAutoWhitespace==="false"?!1:Boolean(e.editor.trimAutoWhitespace));let d=Xi.detectIndentation;e.editor&&typeof e.editor.detectIndentation!="undefined"&&(d=e.editor.detectIndentation==="false"?!1:Boolean(e.editor.detectIndentation));let h=Xi.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations!="undefined"&&(h=e.editor.largeFileOptimizations==="false"?!1:Boolean(e.editor.largeFileOptimizations));let u=Xi.bracketPairColorizationOptions;return((i=e.editor)===null||i===void 0?void 0:i.bracketPairColorization)&&typeof e.editor.bracketPairColorization=="object"&&(u={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:n,indentSize:s,insertSpaces:r,detectIndentation:d,defaultEOL:a,trimAutoWhitespace:c,largeFileOptimizations:h,bracketPairColorizationOptions:u}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:Os===3||Os===2? `
2022-10-26 20:27:06 +08:00
` : ` \ r
2022-11-09 20:26:02 +08:00
` }_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){let n=this._modelCreationOptionsByLanguageAndResource[e+t];if(!n){const s=this._configurationService.getValue("editor",{overrideIdentifier:e,resource:t}),r=this._getEOL(t,e);n=Gf._readModelOptions({editor:s,eol:r},i),this._modelCreationOptionsByLanguageAndResource[e+t]=n}return n}_updateModelOptions(){const e=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const t=Object.keys(this._models);for(let i=0,n=t.length;i<n;i++){const s=t[i],r=this._models[s],a=r.model.getLanguageId(),l=r.model.uri,c=e[a+l],d=this.getCreationOptions(a,l,r.model.isForSimpleWidget);Gf._setModelOptionsForModel(r.model,d,c)}}static _setModelOptionsForModel(e,t,i){i&&i.defaultEOL!==t.defaultEOL&&e.getLineCount()===1&&e.setEOL(t.defaultEOL===1?0:1),!(i&&i.detectIndentation===t.detectIndentation&&i.insertSpaces===t.insertSpaces&&i.tabSize===t.tabSize&&i.indentSize===t.indentSize&&i.trimAutoWhitespace===t.trimAutoWhitespace&& $ s(i.bracketPairColorizationOptions,t.bracketPairColorizationOptions))&&(t.detectIndentation?(e.detectIndentation(t.insertSpaces,t.tabSize),e.updateOptions({trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions})):e.updateOptions({insertSpaces:t.insertSpaces,tabSize:t.tabSize,indentSize:t.indentSize,trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions}))}_insertDisposedModel(e){this._disposedModels.set(vl(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(vl(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(vl(e)),t}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,n)=>i.time-n.time);t.length>0&&this._disposedModelsHeapSize>e;){const i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){const s=this.getCreationOptions(t,i,n),r=new il(e,t,s,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(vl(i))){const c=this._removeDisposedModel(i),d=this._undoRedoService.getElements(i),h=UA(r)===c.sha1;if(h||c.sharesUndoRedoStack){for(const u of d.past)Da(u)&&u.matchesResource(i)&&u.setModel(r);for(const u of d.future)Da(u)&&u.matchesResource(i)&&u.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,u=>Da(u)&&u.matchesResource(i)),h&&(r._overwriteVersionId(c.versionId),r._overwriteAlternativeVersionId(c.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=vl(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new ire(r,c=>this._onWillDispose(c),(c,d)=>this._onDidChangeLanguage(c,d));return this._models[a]=l,l}createModel(e,t,i,n=!1){let s;return t?(s=this._createModelData(e,t.languageId,i,n),this.setMode(s.model,t)):s=this._createModelData(e,Us,i,n),this._onModelAdded.fire(s.model),s.model}setMode(e,t){if(!t)return;const i=this._models[vl(e.uri)];!i||i.setLanguage(t)}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i<n;i++){const s=t[i];e.push(this._models[s].model)}return e}getModel(e){const t=vl(e),i=this._models[t];return i?i.model:null}getSemanticTokensProviderStyling(e){return this._semanticStyling.get(e)}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===Ne.file||e.scheme===Ne.vscodeRemote||e.scheme===Ne.vscodeUserData||e.scheme===Ne.vscodeNotebookCell||e.scheme==="fake-fs"}_onWillDispose(e){const t=vl(e.uri),i=this._models[t],n=this._undoRedoService.getUriComparisonKey(e.uri)!==e.uri.toString();let s=!1,r=0;if(n
` :e,l=a.length;let c=i.embeddedLanguageData,d=i.stack,h=0,u=null,g=!0;for(;g||h<l;){const f=h,_=d.depth,b=u?u.groups.length:0,v=d.state;let C=null,w=null,S=null,k=null,x=null;if(u){C=u.matches;const I=u.groups.shift();w=I.matched,S=I.action,k=u.rule,u.groups.length===0&&(u=null)}else{if(!g&&h>=l)break;g=!1;let I=this._lexer.tokenizer[v];if(!I&&(I=Fb(this._lexer,v),!I))throw Lt(this._lexer,"tokenizer state is not defined: "+v);const R=a.substr(h);for(const P of I)if((h===0||!P.matchOnlyAtLineStart)&&(C=R.match(P.regex),C)){w=C[0],S=P.action;break}}if(C||(C=[""],w=""),S||(h<l&&(C=[a.charAt(h)],w=C[0]),S=this._lexer.defaultToken),w===null)break;for(h+=w.length;Dae(S)&&rR(S)&&S.test;)S=S.test(w,C,v,h===l);let y=null;if(typeof S=="string"||Array.isArray(S))y=S;else if(S.group)y=S.group;else if(S.token!==null&&S.token!==void 0){if(S.tokenSubst?y=Tl(this._lexer,S.token,w,C,v):y=S.token,S.nextEmbedded)if(S.nextEmbedded==="@pop"){if(!c)throw Lt(this._lexer,"cannot pop embedded language if not inside one");c=null}else{if(c)throw Lt(this._lexer,"cannot enter embedded language from within an embedded language");x=Tl(this._lexer,S.nextEmbedded,w,C,v)}if(S.goBack&&(h=Math.max(0,h-S.goBack)),S.switchTo&&typeof S.switchTo=="string"){let I=Tl(this._lexer,S.switchTo,w,C,v);if(I[0]==="@"&&(I=I.substr(1)),Fb(this._lexer,I))d=d.switchTo(I);else throw Lt(this._lexer,"trying to switch to a state '"+I+"' that is undefined in rule: "+this._safeRuleName(k))}else{if(S.transform&&typeof S.transform=="function")throw Lt(this._lexer,"action.transform not supported");if(S.next)if(S.next==="@push"){if(d.depth>=this._lexer.maxStack)throw Lt(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(v)}else if(S.next==="@pop"){if(d.depth<=1)throw Lt(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(k));d=d.pop()}else if(S.next==="@popall")d=d.popall();else{let I=Tl(this._lexer,S.next,w,C,v);if(I[0]==="@"&&(I=I.substr(1)),Fb(this._lexer,I))d=d.push(I);else throw Lt(this._lexer,"trying to set a next state '"+I+"' that is undefined in rule: "+this._safeRuleName(k))}}S.log&&typeof S.log=="string"&&kae(this._lexer,this._lexer.languageId+": "+Tl(this._lexer,S.log,w,C,v))}if(y===null)throw Lt(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(k));const D=I=>{const R=this._languageService.getLanguageIdByLanguageName(I)||this._languageService.getLanguageIdByMimeType(I)||I,P=this._getNestedEmbeddedLanguageData(R);if(h<l){const H=e.substr(h);return this._nestedTokenize(H,t,Ml.create(d,P),n+h,s)}else return Ml.create(d,P)};if(Array.isArray(y)){if(u&&u.groups.length>0)throw Lt(this._lexer,"groups cannot be nested: "+this._safeRuleName(k));if(C.length!==y.length+1)throw Lt(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(k));let I=0;for(let R=1;R<C.length;R++)I+=C[R].length;if(I!==w.length)throw Lt(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(k));u={rule:k,matches:C,groups:[]};for(let R=0;R<y.length;R++)u.groups[R]={action:y[R],matched:C[R+1]};h-=w.length;continue}else{if(y==="@rematch"&&(h-=w.length,w="",C=null,y="",x!==null))return D(x);if(w.length===0){if(l===0||_!==d.depth||v!==d.state||(u?u.groups.length:0)!==b)continue;throw Lt(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(k))}let I=null;if(j7(y)&&y.indexOf("@brackets")===0){const R=y.substr(9),P=Tae(this._lexer,w);if(!P)throw Lt(this._lexer,"@brackets token returned but no bracket defined as: "+w);I=aR(P.token+R)}else{const R=y===""?"":y+this._lexer.tokenPostfix;I=aR(R)}f<r&&s.emit(f+n,I)}if(x!==null)return D(x)}return Ml.create(d,c)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new yu(e,Jp);e!==this._languageId&&(Jt.getOrCreate(e),this._embeddedLanguages[e]=!0);const t=Jt.get(e);return t?new yu(e,t.getInitialState()):new yu(e,Jp)}};Pm=Iae([Eae(4,ot)],Pm);function Tae(o,e){if(!e)return null;e=ic(o,e);const t=o.brackets;for(const i o
` )}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class Hae{constructor(e,t,i,n,s,r,a){this.id=++Y7,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=s,this.sourceId=r,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new uR),this.removedResources.has(t)||this.removedResources.set(t,new hR(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new uR),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new hR(e,0)))}toString(){return ` [ id : $ { this . id } ] [ group : $ { this . groupId } ] [ $ { this . invalidatedResources ? "INVALID" : " VALID" } ] $ { this . actual . constructor . name } - $ { this . actual } ` }}class X7{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push( ` * $ { this . strResource } : ` );for(let t=0;t<this._past.length;t++)e.push( ` * [ UNDO ] $ { this . _past [ t ] } ` );for(let t=this._future.length-1;t>=0;t--)e.push( ` * [ REDO ] $ { this . _future [ t ] } ` );return e.join( `
` )}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,n=this._past.length;i<n;i++)t.push(this._past[i].id);for(let i=this._future.length-1;i>=0;i--)t.push(this._future[i].id);return new X4(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,s=-1;for(let a=0,l=this._past.length;a<l;a++,n++){const c=this._past[a];i&&(n>=t||c.id!==e.elements[n])&&(i=!1,s=0),!i&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let r=-1;for(let a=this._future.length-1;a>=0;a--,n++){const l=this._future[a];i&&(n>=t||l.id!==e.elements[n])&&(i=!1,r=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}s!==-1&&(this._past=this._past.slice(0,s)),r!==-1&&(this._future=this._future.slice(r+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class ny{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;t<i;t++)this._versionIds[t]=this.editStacks[t].versionId}isValid(){for(let e=0,t=this.editStacks.length;e<t;e++)if(this._versionIds[e]!==this.editStacks[e].versionId)return!1;return!0}}const Q7=new X7("","");Q7.locked=!0;let Wk=class{constructor(e,t){this._dialogService=e,this._notificationService=t,this._editStacks=new Map,this._uriComparisonKeyComputers=[]}getUriComparisonKey(e){for(const t of this._uriComparisonKeyComputers)if(t[0]===e.scheme)return t[1].getComparisonKey(e);return e.toString()}_print(e){console.log("------------------------------------"),console.log( ` AFTER $ { e } : ` );const t=[];for(const i of this._editStacks)t.push(i[1].toString());console.log(t.join( `
` ))}pushElement(e,t=gg.None,i=Lr.None){if(e.type===0){const n=Wb(e.resource),s=this.getUriComparisonKey(e.resource);this._pushElement(new Vb(e,n,s,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const n=new Set,s=[],r=[];for(const a of e.resources){const l=Wb(a),c=this.getUriComparisonKey(a);n.has(c)||(n.add(c),s.push(l),r.push(c))}s.length===1?this._pushElement(new Vb(e,s[0],r[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new Hae(e,s,r,t.id,t.nextOrder(),i.id,i.nextOrder()))}}_pushElement(e){for(let t=0,i=e.strResources.length;t<i;t++){const n=e.resourceLabels[t],s=e.strResources[t];let r;this._editStacks.has(s)?r=this._editStacks.get(s):(r=new X7(n,s),this._editStacks.set(s,r)),r.pushElement(e)}}getLastElement(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const i=this._editStacks.get(t);if(i.hasFutureElements())return null;const n=i.getClosestPastElement();return n?n.actual:null}return null}_splitPastWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const s of i){const r=Wb(s.resource),a=this.getUriComparisonKey(s.resource),l=new Vb(s,r,a,0,0,0,0);n.set(l.strResource,l)}for(const s of e.strResources){if(t&&t.has(s))continue;this._editStacks.get(s).splitPastWorkspaceElement(e,n)}}_splitFutureWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const s of i){const r=Wb(s.resource),a=this.getUriComparisonKey(s.resource),l=new Vb(s,r,a,0,0,0,0);n.set(l.strResource,l)}for(const s of e.strResources){if(t&&t.has(s))continue;this._editStacks.get(s).splitFutureWorkspaceElement(e,n)}}removeElements(e){const t=typeof e=="string"?e:this.getUriComparisonKey(e);this._editStacks.has(t)&&(this._editStacks.get(t).dispose(),this._editStacks.delete(t))}setElementsValidFlag(e,t,i){const n=this.getUriComparisonKey(e);this._editStacks.has(n)&&this._editStacks.get(n).setElementsValidFlag(t,i)}createSnapshot(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).createSnapshot(e):new X4(e,[])}restoreSnapshot(e){const t=this.getUriComparisonKey(e.resource);if(this._editStacks.has(t)){const i=this._editStacks.get(t);i.restoreSnapshot(e),!i.hasPastElements()&&!i.hasFutureElements()&&(i.dispose(),this._editStacks.delete(t))}}getElements(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).getElements():{past:[],future:[]}}_findClosestUndoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,s]of this._editStacks){const r=s.getClosestPastElement();!r||r.sourceId===e&&(!t||r.sourceOrder>t.sourceOrder)&&(t=r,i=n)}return[t,i]}canUndo(e){if(e instanceof Lr){const[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){Ee(e);for(const i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,n,s){const r=this._acquireLocks(i);let a;try{a=t()}catch(l){return r(),n.dispose(),this._onError(l,e)}return a?a.then(()=>(r(),n.dispose(),s()),l=>(r(),n.dispose(),this._onError(l,e))):(r(),n.dispose(),s())}_invokeWorkspacePrepare(e){return Bb(this,void 0,void 0,function*(){if(typeof e.actual.prepareUndoRedo=="undefined")return z.None;const t=e.actual.prepareUndoRedo();return typeof t=="undefined"?z.None:t})}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo=="undefined")return t(z.None);const i=e.actual.prepareUndoRedo();return i?xx(i)?t(i):i.then(n=>t(n)):t(z.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||Q7);return new ny(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new Hb(this._undo(e,0,!0));for(const s of t.strResources)this.removeElements(s);return this._notificationService.
2022-10-26 20:27:06 +08:00
: host {
all : initial ; /* 1st rule so subsequent properties are reset. */
}
@ font - face {
font - family : "codicon" ;
font - display : block ;
src : url ( "./codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6" ) format ( "truetype" ) ;
}
. codicon [ class *= 'codicon-' ] {
font : normal normal normal 16 px / 1 codicon ;
display : inline - block ;
text - decoration : none ;
text - rendering : auto ;
text - align : center ;
- webkit - font - smoothing : antialiased ;
- moz - osx - font - smoothing : grayscale ;
user - select : none ;
- webkit - user - select : none ;
- ms - user - select : none ;
}
: host {
font - family : - apple - system , BlinkMacSystemFont , "Segoe WPC" , "Segoe UI" , "HelveticaNeue-Light" , system - ui , "Ubuntu" , "Droid Sans" , sans - serif ;
}
: host - context ( . mac ) { font - family : - apple - system , BlinkMacSystemFont , sans - serif ; }
: host - context ( . mac : lang ( zh - Hans ) ) { font - family : - apple - system , BlinkMacSystemFont , "PingFang SC" , "Hiragino Sans GB" , sans - serif ; }
: host - context ( . mac : lang ( zh - Hant ) ) { font - family : - apple - system , BlinkMacSystemFont , "PingFang TC" , sans - serif ; }
: host - context ( . mac : lang ( ja ) ) { font - family : - apple - system , BlinkMacSystemFont , "Hiragino Kaku Gothic Pro" , sans - serif ; }
: host - context ( . mac : lang ( ko ) ) { font - family : - apple - system , BlinkMacSystemFont , "Nanum Gothic" , "Apple SD Gothic Neo" , "AppleGothic" , sans - serif ; }
: host - context ( . windows ) { font - family : "Segoe WPC" , "Segoe UI" , sans - serif ; }
: host - context ( . windows : lang ( zh - Hans ) ) { font - family : "Segoe WPC" , "Segoe UI" , "Microsoft YaHei" , sans - serif ; }
: host - context ( . windows : lang ( zh - Hant ) ) { font - family : "Segoe WPC" , "Segoe UI" , "Microsoft Jhenghei" , sans - serif ; }
: host - context ( . windows : lang ( ja ) ) { font - family : "Segoe WPC" , "Segoe UI" , "Yu Gothic UI" , "Meiryo UI" , sans - serif ; }
: host - context ( . windows : lang ( ko ) ) { font - family : "Segoe WPC" , "Segoe UI" , "Malgun Gothic" , "Dotom" , sans - serif ; }
: host - context ( . linux ) { font - family : system - ui , "Ubuntu" , "Droid Sans" , sans - serif ; }
: host - context ( . linux : lang ( zh - Hans ) ) { font - family : system - ui , "Ubuntu" , "Droid Sans" , "Source Han Sans SC" , "Source Han Sans CN" , "Source Han Sans" , sans - serif ; }
: host - context ( . linux : lang ( zh - Hant ) ) { font - family : system - ui , "Ubuntu" , "Droid Sans" , "Source Han Sans TC" , "Source Han Sans TW" , "Source Han Sans" , sans - serif ; }
: host - context ( . linux : lang ( ja ) ) { font - family : system - ui , "Ubuntu" , "Droid Sans" , "Source Han Sans J" , "Source Han Sans JP" , "Source Han Sans" , sans - serif ; }
: host - context ( . linux : lang ( ko ) ) { font - family : system - ui , "Ubuntu" , "Droid Sans" , "Source Han Sans K" , "Source Han Sans JR" , "Source Han Sans" , "UnDotum" , "FBaekmuk Gulim" , sans - serif ; }
2022-11-09 20:26:02 +08:00
` ;var qae=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Gae=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}};let Hk=class extends z{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=z.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new Ng(this.container,1)),this.layout(),this._register(e.onDidLayout(()=>this.layout()))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,i){t?(t!==this.container||this.shadowRoot!==i)&&(this.container=t,this.setContainer(t,i?3:2)):this.layoutService.hasContainer&&this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.shadowRoot=i,this.contextView.show(e);const n=ze(()=>{this.currentViewDisposable===n&&this.hideContextView()});return this.currentViewDisposable=n,n}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};Hk=qae([Gae(0,tf)],Hk);var mR=globalThis&&globalThis.__awaiter||function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(d){try{c(i.next(d))}catch(h){r(h)}}function l(d){try{c(i.throw(d))}catch(h){r(h)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(o,e||[])).next())})};const zb="**",_R="/",C0="[/ \\ \\ ]",w0="[^/ \\ \\ ]",Zae=/ \/ /g;function bR(o,e){switch(o){case 0:return"";case 1:return ` $ { w0 } * ? ` ;default:return ` ( ? : $ { C0 } | $ { w0 } + $ { C0 } $ { e ? ` | ${ C0 } ${ w0 } + ` : "" } ) * ? ` }}function vR(o,e){if(!o)return[];const t=[];let i=!1,n=!1,s="";for(const r of o){switch(r){case e:if(!i&&!n){t.push(s),s="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":n=!0;break;case"]":n=!1;break}s+=r}return s&&t.push(s),t}function J7(o){if(!o)return"";let e="";const t=vR(o,_R);if(t.every(i=>i===zb))e=".*";else{let i=!1;t.forEach((n,s)=>{if(n===zb){if(i)return;e+=bR(2,s===t.length-1)}else{let r=!1,a="",l=!1,c="";for(const d of n){if(d!=="}"&&r){a+=d;continue}if(l&&(d!=="]"||!c)){let h;d==="-"?h=d:(d==="^"||d==="!")&&!c?h="^":d===_R?h="":h=Ds(d),c+=h;continue}switch(d){case"{":r=!0;continue;case"[":l=!0;continue;case"}":{e+= ` ( ? : $ { vR ( a , "," ) . map ( g => J7 ( g ) ) . join ( "|" ) } ) ` ,r=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=w0;continue;case"*":e+=bR(1);continue;default:e+=Ds(d)}}s<t.length-1&&(t[s+1]!==zb||s+2<t.length)&&(e+=C0)}i=n===zb})}return e}const Yae=/^ \* \* \/ \* \. [ \w \. -]+ $ /,Xae=/^ \* \* \/ ([ \w \. -]+) \/ ? $ /,Qae=/^{ \* \* \/ \* ?[ \w \. -]+ \/ ?(, \* \* \/ \* ?[ \w \. -]+ \/ ?)*} $ /,Jae=/^{ \* \* \/ \* ?[ \w \. -]+( \/ ( \* \* )?)?(, \* \* \/ \* ?[ \w \. -]+( \/ ( \* \* )?)?)*} $ /,ele=/^ \* \* (( \/ [ \w \. -]+)+) \/ ? $ /,tle=/^([ \w \. -]+( \/ [ \w \. -]+)*) \/ ? $ /,CR=new bh(1e4),wR=function(){return!1},Vr=function(){return null};function xN(o,e){if(!o)return Vr;let t;typeof o!="string"?t=o.pattern:t=o,t=t.trim();const i= ` $ { t } _$ { ! ! e . trimForExclusions } ` ;let n=CR.get(i);if(n)return SR(n,o);let s;return Yae.test(t)?n=ile(t.substr(4),t):(s=Xae.exec(sy(t,e)))?n=nle(s[1],t):(e.trimForExclusions?Jae:Qae).test(t)?n=sle(t,e):(s=ele.exec(sy(t,e)))?n=yR(s[1].substr(1),t,!0):(s=tle.exec(sy(t,e)))?n=yR(s[1],t,!1):n=ole(t),CR.set(i,n),SR(n,o)}function SR(o,e){if(typeof e=="string")return o;const t=function(i,n){return sL(i,e.base,!sn)?o(i.substr(e.base.length+1),n):null};return t.allBasenames=o.allBasenames,t.allPaths=o.allPaths,t.basenames=o.basenames,t.patterns=o.patterns,t}function sy(o,e){return e.trimForExclusions&&o.endsWith("/**")?o.substr(0,o.length-2):o}function ile(o,e){return function(t,i){return typeof t=="string"&&t.endsWith(o)?e:null}}function nle(o,e){const t= ` / $ { o } ` ,i= ` \ \ $ { o } ` ,n=function(r,a){return typeof r!="string"?null:a?a===o?e:null:r===o||r.endsWith(t)||r.endsWith(i)?e:null},s=[o];return
2022-10-26 20:27:06 +08:00
. monaco - menu {
font - size : 13 px ;
border - radius : 5 px ;
min - width : 160 px ;
}
2022-11-09 20:26:02 +08:00
$ { kA ( m . menuSelection ) }
$ { kA ( m . menuSubmenu ) }
2022-10-26 20:27:06 +08:00
. monaco - menu . monaco - action - bar {
text - align : right ;
overflow : hidden ;
white - space : nowrap ;
}
. monaco - menu . monaco - action - bar . actions - container {
display : flex ;
margin : 0 auto ;
padding : 0 ;
width : 100 % ;
justify - content : flex - end ;
}
. monaco - menu . monaco - action - bar . vertical . actions - container {
display : inline - block ;
}
. monaco - menu . monaco - action - bar . reverse . actions - container {
flex - direction : row - reverse ;
}
. monaco - menu . monaco - action - bar . action - item {
cursor : pointer ;
display : inline - block ;
transition : transform 50 ms ease ;
position : relative ; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */
}
. monaco - menu . monaco - action - bar . action - item . disabled {
cursor : default ;
}
. monaco - menu . monaco - action - bar . animated . action - item . active {
transform : scale ( 1.272019649 , 1.272019649 ) ; /* 1.272019649 = \u221A\u03C6 */
}
. monaco - menu . monaco - action - bar . action - item . icon ,
. monaco - menu . monaco - action - bar . action - item . codicon {
display : inline - block ;
}
. monaco - menu . monaco - action - bar . action - item . codicon {
display : flex ;
align - items : center ;
}
. monaco - menu . monaco - action - bar . action - label {
font - size : 11 px ;
margin - right : 4 px ;
}
. monaco - menu . monaco - action - bar . action - item . disabled . action - label ,
. monaco - menu . monaco - action - bar . action - item . disabled . action - label : hover {
color : var ( -- vscode - disabledForeground ) ;
}
/* Vertical actions */
. monaco - menu . monaco - action - bar . vertical {
text - align : left ;
}
. monaco - menu . monaco - action - bar . vertical . action - item {
display : block ;
}
. monaco - menu . monaco - action - bar . vertical . action - label . separator {
display : block ;
border - bottom : 1 px solid var ( -- vscode - menu - separatorBackground ) ;
padding - top : 1 px ;
padding : 30 px ;
}
. monaco - menu . secondary - actions . monaco - action - bar . action - label {
margin - left : 6 px ;
}
/* Action Items */
. monaco - menu . monaco - action - bar . action - item . select - container {
overflow : hidden ; /* somehow the dropdown overflows its container, we prevent it here to not push */
flex : 1 ;
max - width : 170 px ;
min - width : 60 px ;
display : flex ;
align - items : center ;
justify - content : center ;
margin - right : 10 px ;
}
. monaco - menu . monaco - action - bar . vertical {
margin - left : 0 ;
overflow : visible ;
}
. monaco - menu . monaco - action - bar . vertical . actions - container {
display : block ;
}
. monaco - menu . monaco - action - bar . vertical . action - item {
padding : 0 ;
transform : none ;
display : flex ;
}
. monaco - menu . monaco - action - bar . vertical . action - item . active {
transform : none ;
}
. monaco - menu . monaco - action - bar . vertical . action - menu - item {
flex : 1 1 auto ;
display : flex ;
height : 2 em ;
align - items : center ;
position : relative ;
}
. monaco - menu . monaco - action - bar . vertical . action - menu - item : hover . keybinding ,
. monaco - menu . monaco - action - bar . vertical . action - menu - item : focus . keybinding {
opacity : unset ;
}
. monaco - menu . monaco - action - bar . vertical . action - label {
flex : 1 1 auto ;
text - decoration : none ;
padding : 0 1 em ;
background : none ;
font - size : 12 px ;
line - height : 1 ;
}
. monaco - menu . monaco - action - bar . vertical . keybinding ,
. monaco - menu . monaco - action - bar . vertical . submenu - indicator {
display : inline - block ;
flex : 2 1 auto ;
padding : 0 1 em ;
text - align : right ;
font - size : 12 px ;
line - height : 1 ;
}
. monaco - menu . monaco - action - bar . vertical . submenu - indicator {
height : 100 % ;
}
. monaco - menu . monaco - action - bar . vertical . submenu - indicator . codicon {
font - size : 16 px ! important ;
display : flex ;
align - items : center ;
}
. monaco - menu . monaco - action - bar . vertical . submenu - indicator . codicon : : before {
margin - left : auto ;
margin - right : - 20 px ;
}
. monaco - menu . monaco - action - bar . vertical . action - item . disabled . keybinding ,
. monaco - menu . monaco - action - bar . vertical . action - item . disabled . submenu - indicator {
opacity : 0.4 ;
}
. monaco - menu . monaco - action - bar . vertical . action - label : not ( . separator ) {
display : inline - block ;
box - sizing : border - box ;
margin : 0 ;
}
. monaco - menu . monaco - action - bar . vertical . action - item {
position : static ;
overflow : visible ;
}
. monaco - menu . monaco - action - bar . vertical . action - item . monaco - submenu {
position : absolute ;
}
. monaco - menu . monaco - action - bar . vertical . action - label . separator {
width : 100 % ;
height : 0 px ! important ;
opacity : 1 ;
}
. monaco - menu . monaco - action - bar . vertical . action - label . separator . text {
padding : 0.7 em 1 em 0.1 em 1 em ;
font - weight : bold ;
opacity : 1 ;
}
. monaco - menu . monaco - action - bar . vertical . action - label : hover {
color : inherit ;
}
. monaco - menu . monaco - action - bar . vertical . menu - item - check {
position : absolute ;
visibility : hidden ;
width : 1 em ;
height : 100 % ;
}
. monaco - menu . monaco - action - bar . vertical . action - menu - item . checked . menu - item - check {
visibility : visible ;
display : flex ;
align - items : center ;
justify - content : center ;
}
/* Context Menu */
. context - view . monaco - menu - container {
outline : 0 ;
border : none ;
animation : fadeIn 0.083 s linear ;
- webkit - app - region : no - drag ;
}
. context - view . monaco - menu - container : focus ,
. context - view . monaco - menu - container . monaco - action - bar . vertical : focus ,
. context - view . monaco - menu - container . monaco - action - bar . vertical : focus {
outline : 0 ;
}
. hc - black . context - view . monaco - menu - container ,
. hc - light . context - view . monaco - menu - container ,
: host - context ( . hc - black ) . context - view . monaco - menu - container ,
: host - context ( . hc - light ) . context - view . monaco - menu - container {
box - shadow : none ;
}
. hc - black . monaco - menu . monaco - action - bar . vertical . action - item . focused ,
. hc - light . monaco - menu . monaco - action - bar . vertical . action - item . focused ,
: host - context ( . hc - black ) . monaco - menu . monaco - action - bar . vertical . action - item . focused ,
: host - context ( . hc - light ) . monaco - menu . monaco - action - bar . vertical . action - item . focused {
background : none ;
}
/* Vertical Action Bar Styles */
. monaco - menu . monaco - action - bar . vertical {
padding : . 6 em 0 ;
}
. monaco - menu . monaco - action - bar . vertical . action - menu - item {
height : 2 em ;
}
. monaco - menu . monaco - action - bar . vertical . action - label : not ( . separator ) ,
. monaco - menu . monaco - action - bar . vertical . keybinding {
font - size : inherit ;
padding : 0 2 em ;
}
. monaco - menu . monaco - action - bar . vertical . menu - item - check {
font - size : inherit ;
width : 2 em ;
}
. monaco - menu . monaco - action - bar . vertical . action - label . separator {
font - size : inherit ;
margin : 5 px 0 ! important ;
padding : 0 ;
border - radius : 0 ;
}
. linux . monaco - menu . monaco - action - bar . vertical . action - label . separator ,
: host - context ( . linux ) . monaco - menu . monaco - action - bar . vertical . action - label . separator {
margin - left : 0 ;
margin - right : 0 ;
}
. monaco - menu . monaco - action - bar . vertical . submenu - indicator {
font - size : 60 % ;
padding : 0 1.8 em ;
}
. linux . monaco - menu . monaco - action - bar . vertical . submenu - indicator {
: host - context ( . linux ) . monaco - menu . monaco - action - bar . vertical . submenu - indicator {
height : 100 % ;
mask - size : 10 px 10 px ;
- webkit - mask - size : 10 px 10 px ;
}
. monaco - menu . action - item {
cursor : default ;
} ` ;if(e){t+= `
/* Arrows */
. monaco - scrollable - element > . scrollbar > . scra {
cursor : pointer ;
font - size : 11 px ! important ;
}
. monaco - scrollable - element > . visible {
opacity : 1 ;
/* Background rule added for IE9 - to allow clicks on dom node */
background : rgba ( 0 , 0 , 0 , 0 ) ;
transition : opacity 100 ms linear ;
}
. monaco - scrollable - element > . invisible {
opacity : 0 ;
pointer - events : none ;
}
. monaco - scrollable - element > . invisible . fade {
transition : opacity 800 ms linear ;
}
/* Scrollable Content Inset Shadow */
. monaco - scrollable - element > . shadow {
position : absolute ;
display : none ;
}
. monaco - scrollable - element > . shadow . top {
display : block ;
top : 0 ;
left : 3 px ;
height : 3 px ;
width : 100 % ;
}
. monaco - scrollable - element > . shadow . left {
display : block ;
top : 3 px ;
left : 0 ;
height : 100 % ;
width : 3 px ;
}
. monaco - scrollable - element > . shadow . top - left - corner {
display : block ;
top : 0 ;
left : 0 ;
height : 3 px ;
width : 3 px ;
}
` ;const i=o.scrollbarShadow;i&&(t+= `
. monaco - scrollable - element > . shadow . top {
box - shadow : $ { i } 0 6 px 6 px - 6 px inset ;
}
. monaco - scrollable - element > . shadow . left {
box - shadow : $ { i } 6 px 0 6 px - 6 px inset ;
}
. monaco - scrollable - element > . shadow . top . left {
box - shadow : $ { i } 6 px 6 px 6 px - 6 px inset ;
}
` );const n=o.scrollbarSliderBackground;n&&(t+= `
. monaco - scrollable - element > . scrollbar > . slider {
background : $ { n } ;
}
` );const s=o.scrollbarSliderHoverBackground;s&&(t+= `
. monaco - scrollable - element > . scrollbar > . slider : hover {
background : $ { s } ;
}
` );const r=o.scrollbarSliderActiveBackground;r&&(t+= `
. monaco - scrollable - element > . scrollbar > . slider . active {
background : $ { r } ;
}
2022-11-09 20:26:02 +08:00
` )}return t}class vle{constructor(e,t,i,n,s){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.themeService=s,this.focusToReturn=null,this.block=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=document.activeElement;let i;const n=zO(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:s=>{const r=e.getMenuClassName?e.getMenuClassName():"";r&&(s.className+=" "+r),this.options.blockMouse&&(this.block=s.appendChild(se(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",q(this.block,le.MOUSE_DOWN,c=>c.stopPropagation()));const a=new ee,l=e.actionRunner||new Ju;return l.onBeforeRun(this.onActionRun,this,a),l.onDidRun(this.onDidActionRun,this,a),i=new Ku(s,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:l,getKeyBinding:e.getKeyBinding?e.getKeyBinding:c=>this.keybindingService.lookupKeybinding(c.id)}),a.add(IQ(i,this.themeService)),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a),a.add(q(window,le.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(q(window,le.MOUSE_DOWN,c=>{if(c.defaultPrevented)return;const d=new Ir(c);let h=d.target;if(!d.rightButton){for(;h;){if(h===s)return;h=h.parentElement}this.contextViewService.hideContextView(!0)}})),Pr(a,i)},focus:()=>{i==null||i.focus(!!e.autoSelectFirstItem)},onHide:s=>{var r;(r=e.onHide)===null||r===void 0||r.call(e,!!s),this.block&&(this.block.remove(),this.block=null),this.focusToReturn&&this.focusToReturn.focus()}},n,!!n)}onActionRun(e){this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1),this.focusToReturn&&this.focusToReturn.focus()}onDidActionRun(e){e.error&&!ol(e.error)&&this.notificationService.error(e.error)}}var Cle=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Nf=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}};let $ k=class extends z{constructor(e,t,i,n,s){super(),this._onDidShowContextMenu=new O,this._onDidHideContextMenu=new O,this.contextMenuHandler=new vle(i,e,t,n,s)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){this.contextMenuHandler.showContextMenu(Object.assign(Object.assign({},e),{onHide:t=>{var i;(i=e.onHide)===null||i===void 0||i.call(e,t),this._onDidHideContextMenu.fire()}})),Rl.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}}; $ k=Cle([Nf(0,rl),Nf(1,gi),Nf(2,Ch),Nf(3,rn),Nf(4,vt)], $ k);var rC;(function(o){o[o.API=0]="API",o[o.USER=1]="USER"})(rC||(rC={}));var EN=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},aC=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}},id=globalThis&&globalThis.__awaiter||function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(d){try{c(i.next(d))}catch(h){r(h)}}function l(d){try{c(i.throw(d))}catch(h){r(h)}}function c
` );a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}}rw.MAX_WIDTH=600;var Xk;(function(o){o[o.PRESERVE=0]="PRESERVE",o[o.LAST=1]="LAST"})(Xk||(Xk={}));const s9={Quickaccess:"workbench.contributions.quickaccess"};class Fle{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((t,i)=>i.prefix.length-t.prefix.length),ze(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return BC([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}}di.add(s9.Quickaccess,new Fle);var Ble=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},PR=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}};let Qk=class extends z{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=di.as(s9.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){var n;const[s,r]=this.getOrInstantiateProvider(e),a=this.visibleQuickAccess,l=a==null?void 0:a.descriptor;if(a&&r&&l===r){e!==r.prefix&&!(i!=null&&i.preserveValue)&&(a.picker.value=e),this.adjustValueSelection(a.picker,r,i);return}if(r&&!(i!=null&&i.preserveValue)){let g;if(a&&l&&l!==r){const f=a.value.substr(l.prefix.length);f&&(g= ` $ { r . prefix } $ { f } ` )}if(!g){const f=s==null?void 0:s.defaultFilterValue;f===Xk.LAST?g=this.lastAcceptedPickerValues.get(r):typeof f=="string"&&(g= ` $ { r . prefix } $ { f } ` )}typeof g=="string"&&(e=g)}const c=new ee,d=c.add(this.quickInputService.createQuickPick());d.value=e,this.adjustValueSelection(d,r,i),d.placeholder=r==null?void 0:r.placeholder,d.quickNavigate=i==null?void 0:i.quickNavigateConfiguration,d.hideInput=!!d.quickNavigate&&!a,(typeof(i==null?void 0:i.itemActivation)=="number"||(i==null?void 0:i.quickNavigateConfiguration))&&(d.itemActivation=(n=i==null?void 0:i.itemActivation)!==null&&n!==void 0?n:Eo.SECOND),d.contextKey=r==null?void 0:r.contextKey,d.filterValue=g=>g.substring(r?r.prefix.length:0),r!=null&&r.placeholder&&(d.ariaLabel=r==null?void 0:r.placeholder);let h;t&&(h=new jP,c.add(nc(d.onWillAccept)(g=>{g.veto(),d.hide()}))),c.add(this.registerPickerListeners(d,s,r,e));const u=c.add(new gn);if(s&&c.add(s.provide(d,u.token)),nc(d.onDidHide)(()=>{d.selectedItems.length===0&&u.cancel(),c.dispose(),h==null||h.complete(d.selectedItems.slice(0))}),d.show(),t)return h==null?void 0:h.p}adjustValueSelection(e,t,i){var n;let s;i!=null&&i.preserveValue?s=[e.value.length,e.value.length]:s=[(n=t==null?void 0:t.prefix.length)!==null&&n!==void 0?n:0,e.value.length],e.valueSelection=s}registerPickerListeners(e,t,i,n){const s=new ee,r=this.visibleQuickAccess={picker:e,descriptor:i,value:n};return s.add(ze(()=>{r===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),s.add(e.onDidChangeValue(a=>{const[l]=this.getOrInstantiateProvider(a);l!==t?this.show(a,{preserveValue:!0}):r.value=a})),i&&s.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),s}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let i=this.mapProviderToDescriptor.get(t);return i||(i=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,i)),[i,t]}};Qk=Ble([PR(0,c_),PR(1,Re)],Qk);var Wle=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.deco
` )}const Zle={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"098658"},{token:"attribute.value.unit",foreground:"098658"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[bi]:"#FFFFFE",[ws]:"#000000",[_I]:"#E5EBF1",[Xm]:"#D3D3D3",[Qm]:"#939393",[bI]:"#ADD6FF4D"}},Yle={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[bi]:"#1E1E1E",[ws]:"#D4D4D4",
` )}}}class a9{getIcon(e){const t=p5();let i=e.defaults;for(;nt.isThemeIcon(i);){const n=t.getIcon(i.id);if(!n)return;i=n.defaults}return i}}const Al="vs",Sp="vs-dark",qu="hc-black",Gu="hc-light",l9=di.as(qP.ColorContribution),ece=di.as(tP.ThemingContribution);class c9{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(S0(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,W.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=ix(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,W.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=l9.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return Object.prototype.hasOwnProperty.call(this.getColors(),e)}get type(){switch(this.base){case Al:return Vs.LIGHT;case qu:return Vs.HIGH_CONTRAST_DARK;case Gu:return Vs.HIGH_CONTRAST_LIGHT;default:return Vs.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const s=ix(this.themeData.base);e=s.rules,s.encodedTokensColors&&(t=s.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const s={token:""};i&&(s.foreground=i),n&&(s.background=n),e.push(s)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=r9.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const s=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=Yn.getForeground(s),a=Yn.getFontStyle(s);return{foreground:r,italic:Boolean(a&1),bold:Boolean(a&2),underline:Boolean(a&4),strikethrough:Boolean(a&8)}}}function S0(o){return o===Al||o===Sp||o===qu||o===Gu}function ix(o){switch(o){case Al:return Zle;case Sp:return Yle;case qu:return Xle;case Gu:return Qle}}function Kb(o){const e=ix(o);return new c9(o,e)}class tce extends z{constructor(){super(),this._onColorThemeChange=this._register(new O),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new O),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new a9,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Al,Kb(Al)),this._knownThemes.set(Sp,Kb(Sp)),this._knownThemes.set(qu,Kb(qu)),this._knownThemes.set(Gu,Kb(Gu));const e=Jle(this);this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS= ` $ { this . _codiconCSS }
$ { this . _themeCSS } ` ,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Al),this._onOSSchemeChanged(),e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()}),Mx("(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return Dp(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=qs(),this._globalStyleElement.className="monaco-colors",this._globalStyleElement.textContent=this._allCSS,this._styleElements.push(this._globalStyleElement)),z.None}_registerShadowDomContainer(e){const t=qs(e);return t.className="monaco-colors",t.textContent=this._allCSS,this._styleElements.push(t),{dispose:()=>{for(let i=0;i<this._styleElements.length;i++)if(this._styleElements[i]===t){this._styleElements.splice(i,1);return}}}}defineTheme(e,t){if(!/^[a-z0-9 \- ]+ $ /i.test(e))throw new Error("Illegal theme name!");if(!S0(t.base)&&!S0(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new c9(e,t)),S0(e)&&this._knownThemes.forEach(i=>{i.base===e&&i.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(Al),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=window.matchMedia("(forced-colors: active)").matches;if(e!==yn(this._theme.type)){let t;Xx(this._theme.type)?t=e?qu:Sp:t=e?Gu:Al,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:r=>{t[r]||(e.push(r),t[r]=!0)}};ece.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const n=[];for(const r of l9.getColors()){const a=this._theme.getColor(r.id,!0);a&&n.push( ` $ { KP ( r . id ) } : $ { a . toString ( ) } ; ` )}i.addRule( ` . monaco - editor { $ { n . join ( `
` )} } ` ) ; const s = this . _colorMapOverride || this . _theme . tokenTheme . getColorMap ( ) ; i . addRule ( Gle ( s ) ) , this . _themeCSS = e . join ( `
2022-10-26 20:27:06 +08:00
` ),this._updateCSS(),Jt.setColorMap(s),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS= ` $ { this . _codiconCSS }
2022-11-09 20:26:02 +08:00
$ { this . _themeCSS } ` ,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const yo=qe("themeService");var ice=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},dy=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}};let nx=class extends z{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new O,this._onDidChangeReducedMotion=new O,this._accessibilityModeEnabledContext=Km.bindTo(this._contextKeyService);const n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire()),r.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),n(),this._register(this.onDidChangeScreenReaderOptimized(()=>n()));const s=window.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=s.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(s)}initReducedMotionListeners(e){if(!this._layoutService.hasContainer)return;this._register(q(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.container.classList.toggle("reduce-motion",i),this._layoutService.container.classList.toggle("enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};nx=ice([dy(0,xe),dy(1,tf),dy(2,ot)],nx);var RN=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Zu=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}};let sx=class{constructor(e,t){this._commandService=e,this._hiddenStates=new lC(t)}createMenu(e,t,i){return new ox(e,this._hiddenStates,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},i),this._commandService,t,this)}};sx=RN([Zu(0,Ci),Zu(1,ia)],sx);let lC=class Zf{constructor(e){this._storageService=e,this._disposables=new ee,this._onDidChange=new O,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1;try{const t=e.get(Zf._key,0,"{}");this._data=JSON.parse(t)}catch(t){this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(t=>{if(t.key===Zf._key){if(!this._ignoreChangeEvent)try{const i=e.get(Zf._key,0,"{}");this._data=JSON.parse(i)}catch(i){console.log("FAILED to read storage after UPDATE",i)}this._onDidChange.fire()}}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}isHidden(e,t){var i,n;return(n=(i=this._data[e.id])===null||i===vo
` )}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(const[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const s=this._findCycle(n,t);if(s)return s;t.delete(i)}}}class VR extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=(t=e.findCycleSlow())!==null&&t!==void 0?t: ` UNABLE to detect cycle , dumping graph :
$ { e . toString ( ) } ` }}class PN{constructor(e=new c1,t=!1,i){this._activeInstantiations=new Set,this._services=e,this._strict=t,this._parent=i,this._services.set(Re,this)}createChild(e){return new PN(e,this._strict,this)}invokeFunction(e,...t){const i=co.traceInvocation(e);let n=!1;try{return e({get:r=>{if(n)throw M8("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(r,i);if(!a)throw new Error( ` [ invokeFunction ] unknown service '${r}' ` );return a}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){let i,n;return e instanceof vr?(i=co.traceCreation(e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=co.traceCreation(e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=Po.getServiceDependencies(e).sort((a,l)=>a.index-l.index),s=[];for(const a of n){const l=this._getOrCreateServiceInstance(a.id,i);l||this._throwIfStrict( ` [ createInstance ] $ { e . name } depends on UNKNOWN service $ { a . id } . ` ,!1),s.push(l)}const r=n.length>0?n[0].index:t.length;if(t.length!==r){console.trace( ` [ createInstance ] First service dependency of $ { e . name } at position $ { r + 1 } conflicts with $ { t . length } static arguments ` );const a=r-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,r)}return new e(...t,...s)}_setServiceInstance(e,t){if(this._services.get(e)instanceof vr)this._services.set(e,t);else if(this._parent)this._parent._setServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){const i=this._getServiceInstanceOrDescriptor(e);return i instanceof vr?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error( ` illegal state - RECURSIVELY instantiating service '${e}' ` );this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){const n=new pce(a=>a.id.toString());let s=0;const r=[{id:e,desc:t,_trace:i}];for(;r.length;){const a=r.pop();if(n.lookupOrInsertNode(a),s++>1e3)throw new VR(n);for(const l of Po.getServiceDependencies(a.desc.ctor)){const c=this._getServiceInstanceOrDescriptor(l.id);if(c||this._throwIfStrict( ` [ createInstance ] $ { e } depends on $ { l . id } which is NOT registered . ` ,!0),c instanceof vr){const d={id:l.id,desc:c,_trace:a._trace.branch(l.id,!0)};n.insertEdge(a,d),r.push(d)}}}for(;;){const a=n.roots();if(a.length===0){if(!n.isEmpty())throw new VR(n);break}for(const{data:l}of a){if(this._getServiceInstanceOrDescriptor(l.id)instanceof vr){const d=this._createServiceInstanceWithOwner(l.id,l.desc.ctor,l.desc.staticArguments,l.desc.supportsDelayedInstantiation,l._trace);this._setServiceInstance(l.id,d)}n.removeNode(l)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,s){if(this._services.get(e)instanceof vr)return this._createServiceInstance(t,i,n,s);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,s);throw new Error( ` illegalState - creating UNKNOWN service instance $ { t . name } ` )}_createServiceInstance(e,t=[],i,n){if(i){const s=new ql(()=>this._createInstance(e,t,n));return new Proxy(Object.create(null),{get(r,a){if(a in r)return r[a];const l=s.value;let c=l[a];return typeof c!="function"||(c=c.bind(l),r[a]=c),c},set(r,a,l){return s.value[a]=l,!0}})}else return this._createInstance(e,t,n)}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class co{constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}static traceInvocation(e){return co._None}static traceCreation(e){return co._None}branch(e,t){const i=new co(2,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;co._totals+=e;let t=!1;function i(s,r){const a=[],l=new Array(s+1).join(" ");for(const[c,d,h]of r._dep)if(d&&h){t=!0,
` )}const n=[ ` $ { this . type === 0 ? "CREATE" : "CALL" } $ { this . name } ` , ` $ { i ( 1 , this ) } ` , ` DONE , took $ { e . toFixed ( 2 ) } ms ( grand total $ { co . _totals . toFixed ( 2 ) } ms ) ` ];(e>2||t)&&console.log(n.join( `
` ))}}co._None=new class extends co{constructor(){super(-1,null)}stop(){}branch(){return this}};co._totals=0;class mce{constructor(){this._byResource=new hn,this._byOwner=new Map}set(e,t,i){let n=this._byResource.get(e);n||(n=new Map,this._byResource.set(e,n)),n.set(t,i);let s=this._byOwner.get(t);s||(s=new hn,this._byOwner.set(t,s)),s.set(e,i)}get(e,t){const i=this._byResource.get(e);return i==null?void 0:i.get(t)}delete(e,t){let i=!1,n=!1;const s=this._byResource.get(e);s&&(i=s.delete(t));const r=this._byOwner.get(t);if(r&&(n=r.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){var t,i,n,s;return typeof e=="string"?(i=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&i!==void 0?i:Ue.empty():me.isUri(e)?(s=(n=this._byResource.get(e))===null||n===void 0?void 0:n.values())!==null&&s!==void 0?s:Ue.empty():Ue.map(Ue.concat(...this._byOwner.values()),r=>r[1])}}class _ce{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new hn,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const i=this._data.get(t);i&&this._substract(i);const n=this._resourceStats(t);this._add(n),this._data.set(t,n)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(e.scheme===Ne.inMemory||e.scheme===Ne.walkThrough||e.scheme===Ne.walkThroughSnippet||e.scheme===Ne.vscodeSourceControl)return t;for(const{severity:i}of this._service.read({resource:e}))i===Ft.Error?t.errors+=1:i===Ft.Warning?t.warnings+=1:i===Ft.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class xl{constructor(){this._onMarkerChanged=new X8({delay:0,merge:xl._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new mce,this._stats=new _ce(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(pP(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const n=[];for(const s of i){const r=xl._toMarker(e,t,s);r&&n.push(r)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:s,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:h,relatedInformation:u,tags:g}=i;if(!!r)return l=l>0?l:1,c=c>0?c:1,d=d>=l?d:l,h=h>0?h:c,{resource:t,owner:e,code:n,severity:s,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:h,relatedInformation:u,tags:g}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const s of n){const r=Ue.first(s);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(en(t)){const s=new hn;for(const{resource:r,marker:a}of t){const l=xl._toMarker(e,r,a);if(!l)continue;const c=s.get(r);c?c.push(l):(s.set(r,[l]),i.push(r))}for(const[r,a]of s)this._data.set(r,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:s}=e;if((!s||s<0)&&(s=-1),t&&i){const r=this._data.get(i,t);if(r){const a=[];for(const l of r)if(xl._accept(l,n)){const c=a.push(l);if(s>0&&c===s)break}return a}else return[]}else if(!t&&!i){const r=[];for(const a of this._data.values())for(const l of a)if(xl._accept(l,n)){const c=r.push(l);if(s>0&&c===s)return r}return r}else{const r=this._data.values(i!=null?i:t),a=[];for(const l of r)for(const c of l)if(xl._accept(c,n)){const d=a.push(c);if(s>0&&d===s)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new hn;for(const i of e)for(const n of i)t.set(n,!0);return Array.from(t.keys())}}function h9(o,e,t,i,n,s){if(Array.isArray(o)){let r=0;for(const a of o){const l=h9(a,e,t,i,n,s);if(l===10)return l;l>r&&(r=l)}return r}else{if(typeof o=="string")return i?o==="*"?5:o===t?10:0:0;if(o){const{language:r,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:d}=o;if(!i&&!c)retur
2022-10-26 20:27:06 +08:00
2022-11-09 20:26:02 +08:00
` +e.detail),Promise.resolve(window.confirm(t))}show(e,t,i,n){return Promise.resolve({choice:0})}}class cw{info(e){return this.notify({severity:Vt.Info,message:e})}warn(e){return this.notify({severity:Vt.Warning,message:e})}error(e){return this.notify({severity:Vt.Error,message:e})}notify(e){switch(e.severity){case Vt.Error:console.error(e.message);break;case Vt.Warning:console.warn(e.message);break;default:console.log(e.message);break}return cw.NO_OP}status(e,t){return z.None}}cw.NO_OP=new Rq;let cx=class{constructor(e){this._onWillExecuteCommand=new O,this._onDidExecuteCommand=new O,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=Ye.getCommand(e);if(!i)return Promise.reject(new Error( ` command '${e}' not found ` ));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}};cx=Ac([dn(0,Re)],cx);let cC=class extends $ ae{constructor(e,t,i,n,s,r){super(e,t,i,n,s),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=g=>{const f=new ee;f.add(q(g,le.KEY_DOWN,_=>{const b=new Mt(_);this._dispatch(b,b.target)&&(b.preventDefault(),b.stopPropagation())})),f.add(q(g,le.KEY_UP,_=>{const b=new Mt(_);this._singleModifierDispatch(b,b.target)&&b.preventDefault()})),this._domNodeListeners.push(new yce(g,f))},l=g=>{for(let f=0;f<this._domNodeListeners.length;f++){const _=this._domNodeListeners[f];_.domNode===g&&(this._domNodeListeners.splice(f,1),_.dispose())}},c=g=>{g.getOption(56)||a(g.getContainerDomNode())},d=g=>{g.getOption(56)||l(g.getContainerDomNode())};this._register(r.onCodeEditorAdd(c)),this._register(r.onCodeEditorRemove(d)),r.listCodeEditors().forEach(c);const h=g=>{a(g.getContainerDomNode())},u=g=>{l(g.getContainerDomNode())};this._register(r.onDiffEditorAdd(h)),this._register(r.onDiffEditorRemove(u)),r.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,n){const s=_y(t,Os),r=new ee;return s&&(this._dynamicKeybindings.push({keybinding:s.parts,command:e,when:n,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}),r.add(ze(()=>{for(let a=0;a<this._dynamicKeybindings.length;a++)if(this._dynamicKeybindings[a].command===e){this._dynamicKeybindings.splice(a,1),this.updateResolver();return}}))),r.add(Ye.registerCommand(e,i)),this.updateResolver(),r}updateResolver(){this._cachedResolver=null,this._onDidUpdateKeybindings.fire()}_getResolver(){if(!this._cachedResolver){const e=this._toNormalizedKeybindingItems(ls.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new wp(e,t,i=>this._log(i))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const s of e){const r=s.when||void 0,a=s.keybinding;if(!a)i[n++]=new pR(void 0,s.command,s.commandArgs,r,t,null,!1);else{const l=Fm.resolveUserBinding(a,Os);for(const c of l)i[n++]=new pR(c,s.command,s.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new Td(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode).toChord();return new Fm(t,Os)}};cC=Ac([dn(0,xe),dn(1,Ci),dn(2,rl),dn(3,gi),dn(4,Co),dn(5,dt)],cC);class yce extends z{constructor(e,t){super(),this.domNode=e,this._register(t)}}function zR(o){return o&&typeof o=="object"&&(!o.overrideIdentifier||typeof o.overrideIdentifier=="string")&&(!o.resource||o.resource instanceof me)}class f9{constructor(){this._onDidChangeConfiguration=new O,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configuration=new nw(new vce,new Zn,new Zn,new Zn)}getValue(e,t){const i=typeof e=="string"?e:void 0,n=zR(e)?e:zR(t)?t:{};return this._configuration.getValue(i,n,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const n of e){const[s,r]=n;this.getValue(s)!==r&&(this._configurati
2022-10-26 20:27:06 +08:00
` : ` \ r
2022-11-09 20:26:02 +08:00
` }};hx=Ac([dn(0,ot)],hx);class Lce{publicLog(e,t){return Promise.resolve(void 0)}publicLog2(e,t){return this.publicLog(e,t)}}class zm{constructor(){const e=me.from({scheme:zm.SCHEME,authority:"model",path:"/"});this.workspace={id:"4064f6ec-cb38-4ad0-af64-ee6467e63c82",folders:[new YJ({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===zm.SCHEME?this.workspace.folders[0]:null}}zm.SCHEME="inmemory";function dC(o,e,t){if(!e||!(o instanceof f9))return;const i=[];Object.keys(e).forEach(n=>{EY(n)&&i.push([ ` editor . $ { n } ` ,e[n]]),t&&NY(n)&&i.push([ ` diffEditor . $ { n } ` ,e[n]])}),i.length>0&&o.updateValues(i)}let ux=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return g9(this,void 0,void 0,function*(){const i=new Map;for(const r of e){if(!(r instanceof Sd))throw new Error("bad edit - only text edits are supported");const a=this._modelService.getModel(r.resource);if(!a)throw new Error("bad edit - model not found");if(typeof r.versionId=="number"&&a.getVersionId()!==r.versionId)throw new Error("bad state - model changed in the meantime");let l=i.get(a);l||(l=[],i.set(a,l)),l.push(Pt.replaceMove(L.lift(r.textEdit.range),r.textEdit.text))}let n=0,s=0;for(const[r,a]of i)r.pushStackElement(),r.pushEditOperations([],a,()=>[]),r.pushStackElement(),s+=1,n+=a.length;return{ariaSummary:tg(Nk.bulkEditServiceSummary,n,s)}})}};ux=Ac([dn(0,Bt)],ux);class Dce{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return Ys(e)}}let gx=class extends Hk{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const n=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();n&&(t=n.getContainerDomNode())}return super.showContextView(e,t,i)}};gx=Ac([dn(0,tf),dn(1,dt)],gx);class kce{constructor(){this._neverEmitter=new O,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class xce extends Wm{constructor(){super()}}class Ice extends QB{constructor(){super(new XB)}}let fx=class extends $ k{constructor(e,t,i,n,s){super(e,t,i,n,s),this.configure({blockMouse:!1})}};fx=Ac([dn(0,rl),dn(1,gi),dn(2,Ch),dn(3,rn),dn(4,vt)],fx);Xe(ot,f9);Xe(gN,dx);Xe(b7,hx);Xe(bm,zm);Xe(bg,Dce);Xe(rl,Lce);Xe(CN,Sce);Xe(gi,cw);Xe(ta,xl);Xe(Ht,xce);Xe(yo,tce);Xe(Co,Ice);Xe(Bt,Jv);Xe(oI,Gk);Xe(xe,ax);Xe(C5,wce);Xe(kc,lw);Xe(ia,PY);Xe(Qs,Pk);Xe(n_,ux);Xe(D7,kce);Xe( $ n,lx);Xe(ll,nx);Xe(eo,RL);Xe(Ci,cx);Xe(rn,cC);Xe(c_,tx);Xe(Ch,gx);Xe(So,qk);Xe(dl,rx);Xe(cl,fx);Xe(fh,sx);var Le;(function(o){const e=new c1;for(const[r,a]of kT())e.set(r,a);const t=new PN(e,!0);e.set(Re,t);function i(r){const a=e.get(r);if(!a)throw new Error("Missing service "+r);return a instanceof vr?t.invokeFunction(l=>l.get(r)):a}o.get=i;let n=!1;function s(r){if(n)return t;n=!0;for(const[a,l]of kT())e.get(a)||e.set(a,l);for(const a in r)if(r.hasOwnProperty(a)){const l=qe(a);e.get(l)instanceof vr&&e.set(l,r[a])}return t}o.initialize=s})(Le||(Le={}));var FN=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Tt=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}};let Ece=0,UR=!1;function Nce(o){if(!o){if(UR)return;UR=!0}SB(o||document.body)}let hC=class extends fg{constructor(e,t,i,n,s,r,a,l,c,d,h,u){const g=Object.assign({},t);g.ariaLabel=g.ariaLabel||eC.editorViewAccessibleLabel,g.ariaLabel=g.ariaLabel+";"+eC.accessibilityHelpMessage,super(e,g,{},i,n,s,r,l,c,d,h,u),a instanceof cC?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,Nce(g.ariaContainerElement)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const n="DYNAMIC_"+ ++Ece,s=re.deserialize
` );let r=t;return s!==-1&&(r=t.substring(0,s)), $ R(o,t,e.createByFilepathOrFirstLine(n||null,r),n)}return $ R(o,t,e.createById(i),n)}function $ R(o,e,t,i){return o.createModel(e,t,i)}function Tce(o,e,t){return Le.initialize(t||{}).createInstance(px,o,e)}function Mce(o){return Le.get(dt).onCodeEditorAdd(t=>{o(t)})}function Ace(o){return Le.get(dt).onDiffEditorAdd(t=>{o(t)})}function Rce(){return Le.get(dt).listCodeEditors()}function Oce(){return Le.get(dt).listDiffEditors()}function Pce(o,e,t){return Le.initialize(t||{}).createInstance(mx,o,e)}function Fce(o,e){return new aZ(o,e)}function Bce(o,e,t){const i=Le.get(Ht),n=i.getLanguageIdByMimeType(e)||e;return p9(Le.get(Bt),i,o,n,t)}function Wce(o,e){const t=Le.get(Ht);Le.get(Bt).setMode(o,t.createById(e))}function Vce(o,e,t){o&&Le.get(ta).changeOne(e,o.uri,t)}function Hce(o){Le.get(ta).changeAll(o,[])}function zce(o){return Le.get(ta).read(o)}function Uce(o){return Le.get(ta).onMarkerChanged(o)}function $ ce(o){return Le.get(Bt).getModel(o)}function jce(){return Le.get(Bt).getModels()}function Kce(o){return Le.get(Bt).onModelAdded(o)}function qce(o){return Le.get(Bt).onModelRemoved(o)}function Gce(o){return Le.get(Bt).onModelLanguageChanged(t=>{o({model:t.model,oldLanguage:t.oldLanguageId})})}function Zce(o){return Sae(Le.get(Bt),Le.get(ti),o)}function Yce(o,e){const t=Le.get(Ht),i=Le.get(yo);return i.registerEditorContainer(o),kN.colorizeElement(i,t,o,e)}function Xce(o,e,t){const i=Le.get(Ht);return Le.get(yo).registerEditorContainer(document.body),kN.colorize(i,o,e,t)}function Qce(o,e,t=4){return Le.get(yo).registerEditorContainer(document.body),kN.colorizeModelLine(o,e,t)}function Jce(o){const e=Jt.get(o);return e||{getInitialState:()=>Jp,tokenize:(t,i,n)=>Y4(o,n)}}function ede(o,e){Jt.getOrCreate(e);const t=Jce(e),i=Ur(o),n=[];let s=t.getInitialState();for(let r=0,a=i.length;r<a;r++){const l=i[r],c=t.tokenize(l,!0,s);n[r]=c.tokens,s=c.endState}return n}function tde(o,e){Le.get(yo).defineTheme(o,e)}function ide(o){Le.get(yo).setTheme(o)}function nde(){By.clearAllFontInfos()}function sde(o,e){return Ye.registerCommand({id:o,handler:e})}function ode(){return{create:Tce,getEditors:Rce,getDiffEditors:Oce,onDidCreateEditor:Mce,onDidCreateDiffEditor:Ace,createDiffEditor:Pce,createDiffNavigator:Fce,createModel:Bce,setModelLanguage:Wce,setModelMarkers:Vce,getModelMarkers:zce,removeAllMarkers:Hce,onDidChangeMarkers:Uce,getModels:jce,getModel: $ ce,onDidCreateModel:Kce,onWillDisposeModel:qce,onDidChangeModelLanguage:Gce,createWebWorker:Zce,colorizeElement:Yce,colorize:Xce,colorizeModelLine:Qce,tokenize:ede,defineTheme:tde,setTheme:ide,remeasureFonts:nde,registerCommand:sde,AccessibilitySupport:OD,ContentWidgetPositionPreference:VD,CursorChangeReason:HD,DefaultEndOfLine:zD,EditorAutoIndentStrategy: $ D,EditorOption:jD,EndOfLinePreference:KD,EndOfLineSequence:qD,MinimapPosition:tk,MouseTargetType:ik,OverlayWidgetPositionPreference:nk,OverviewRulerLane:sk,RenderLineNumbersType:rk,RenderMinimap:ak,ScrollbarVisibility:ck,ScrollType:lk,TextEditorCursorBlinkingStyle:fk,TextEditorCursorStyle:pk,TrackedRangeStickiness:mk,WrappingIndent:_k,InjectedTextCursorStops:ZD,PositionAffinity:ok,ConfigurationChangedEvent:VP,BareFontInfo:bd,FontInfo:Fy,TextModelResolvedOptions:n0,FindMatch:Kp,ApplyUpdateResult:Jf,EditorType:r1,EditorOptions:Jo}}function rde(o,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!o(t))return!1;return!0}function qb(o,e){return typeof o=="boolean"?o:e}function jR(o,e){return typeof o=="string"?o:e}function ade(o){const e={};for(const t of o)e[t]=!0;return e}function KR(o,e=!1){e&&(o=o.map(function(i){return i.toLowerCase()}));const t=ade(o);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function _x(o,e){e=e.replace(/@@/g," ");let t=0,i;do i=!1,e=e.replace(/@( \w +)/g,function(s,r){i=!0;let a="";if(typeof o[r]=="string")a=o[r];else if(o[r]&&o[r]instanceof RegExp)a=o[r].source;else throw o[r]===void 0?Lt(o,"language definition does not contain attribute '"+r+"', used at: "+e):Lt
hint : use the 'bracket' attribute if matching on equal brackets is required . ` );if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")s.push({token:a.token+t.tokenPostfix,open:ic(t,a.open),close:ic(t,a.close)});else throw Lt(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=s,t.noThrow=!0,t}var hde=globalThis&&globalThis.__awaiter||function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(d){try{c(i.next(d))}catch(h){r(h)}}function l(d){try{c(i.throw(d))}catch(h){r(h)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(o,e||[])).next())})};function ude(o){sg.registerLanguage(o)}function gde(){let o=[];return o=o.concat(sg.getLanguages()),o}function fde(o){return Le.get(Ht).languageIdCodec.encodeLanguageId(o)}function pde(o,e){const i=Le.get(Ht).onDidEncounterLanguage(n=>{n===o&&(i.dispose(),e())});return i}function mde(o,e){if(!Le.get(Ht).isRegisteredLanguageId(o))throw new Error( ` Cannot set configuration for unknown language $ { o } ` );return Le.get(ti).register(o,e,100)}class _de{constructor(e,t){this._languageId=e,this._actual=t}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return Um.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new i1(n.tokens,n.endState)}}class Um{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let s=0,r=e.length;s<r;s++){const a=e[s];let l=a.startIndex;s===0?l=0:l<n&&(l=n),i[s]=new Vp(l,a.scopes,t),n=l}return i}static adaptTokenize(e,t,i,n){const s=t.tokenize(i,n),r=Um._toClassicTokens(s.tokens,e);let a;return s.endState.equals(n)?a=n:a=s.endState,new DI(r,a)}tokenize(e,t,i){return Um.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,s=[];let r=0,a=0;for(let c=0,d=t.length;c<d;c++){const h=t[c],u=n.match(i,h.scopes);if(r>0&&s[r-1]===u)continue;let g=h.startIndex;c===0?g=0:g<a&&(g=a),s[r++]=g,s[r++]=u,a=g}const l=new Uint32Array(r);for(let c=0;c<r;c++)l[c]=s[c];return l}tokenizeEncoded(e,t,i){const n=this._actual.tokenize(e,i),s=this._toBinaryTokens(this._languageService.languageIdCodec,n.tokens);let r;return n.endState.equals(i)?r=i:r=n.endState,new i1(s,r)}}function bde(o){return typeof o.getInitialState=="function"}function vde(o){return"tokenizeEncoded"in o}function _9(o){return o&&typeof o.then=="function"}function Cde(o){const e=Le.get(yo);if(o){const t=[null];for(let i=1,n=o.length;i<n;i++)t[i]=W.fromHex(o[i]);e.setColorMapOverride(t)}else e.setColorMapOverride(null)}function b9(o,e){return vde(e)?new _de(o,e):new Um(o,e,Le.get(Ht),Le.get(yo))}function BN(o,e){const t={createTokenizationSupport:()=>hde(this,void 0,void 0,function*(){const i=yield Promise.resolve(e.create());return i?bde(i)?b9(o,i):new Pm(Le.get(Ht),Le.get(yo),o,m9(o,i),Le.get(ot)):null})};return Jt.registerFactory(o,t)}function wde(o,e){if(!Le.get(Ht).isRegisteredLanguageId(o))throw new Error( ` Cannot set tokens provider for unknown language $ { o } ` );return _9(e)?BN(o,{create:()=>e}):Jt.register(o,b9(o,e))}function Sde(o,e){const t=i=>new Pm(Le.get(Ht),Le.get(yo),o,m9(o,i),Le.get(ot));return _9(e)?BN(o,{create:()=>e}):Jt.register(o,t(e))}function yde(o,e){return Le.get(ue).referenceProvider.register(o,e)}function Lde(o,e){return Le.get(ue).renameProvider.register(o,e)}function Dde(o,e){return Le.get(ue).signatureHelpProvider.register(o,e)}function kde(o,e){return Le.get(ue).hoverProvider.register(o,{provideHover:(i,n,s)=>{const r=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,s)).then(a=>{if(!!a)return!a.range&&r&&(a.range=new L(n.lineNumber,r.startColumn,n.lineNumber,r.endColumn))