Files
red-valley/resources/luxu_admin/web/assets/json.worker-Oy1FCN26.js

50 lines
357 KiB
JavaScript
Raw Normal View History

2026-03-29 21:41:17 +03:00
(function(){"use strict";class Ao{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?ot.isErrorNoTelemetry(t)?new ot(t.message+`
`+t.stack):new Error(t.message+`
`+t.stack):t},0)}}emit(t){this.listeners.forEach(n=>{n(t)})}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}}const ko=new Ao;function Rt(e){Ro(e)||ko.onUnexpectedError(e)}function Ur(e){if(e instanceof Error){const{name:t,message:n}=e,r=e.stacktrace||e.stack;return{$isError:!0,name:t,message:n,stack:r,noTelemetry:ot.isErrorNoTelemetry(e)}}return e}const Tn="Canceled";function Ro(e){return e instanceof Eo?!0:e instanceof Error&&e.name===Tn&&e.message===Tn}class Eo extends Error{constructor(){super(Tn),this.name=this.message}}class ot extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof ot)return t;const n=new ot;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}}class de extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,de.prototype)}}function Mo(e,t){const n=this;let r=!1,i;return function(){return r||(r=!0,i=e.apply(n,arguments)),i}}var Gt;(function(e){function t(x){return x&&typeof x=="object"&&typeof x[Symbol.iterator]=="function"}e.is=t;const n=Object.freeze([]);function r(){return n}e.empty=r;function*i(x){yield x}e.single=i;function s(x){return t(x)?x:i(x)}e.wrap=s;function a(x){return x||n}e.from=a;function*l(x){for(let b=x.length-1;b>=0;b--)yield x[b]}e.reverse=l;function o(x){return!x||x[Symbol.iterator]().next().done===!0}e.isEmpty=o;function u(x){return x[Symbol.iterator]().next().value}e.first=u;function h(x,b){let L=0;for(const S of x)if(b(S,L++))return!0;return!1}e.some=h;function c(x,b){for(const L of x)if(b(L))return L}e.find=c;function*m(x,b){for(const L of x)b(L)&&(yield L)}e.filter=m;function*d(x,b){let L=0;for(const S of x)yield b(S,L++)}e.map=d;function*g(x,b){let L=0;for(const S of x)yield*b(S,L++)}e.flatMap=g;function*p(...x){for(const b of x)yield*b}e.concat=p;function y(x,b,L){let S=L;for(const M of x)S=b(S,M);return S}e.reduce=y;function*w(x,b,L=x.length){for(b<0&&(b+=x.length),L<0?L+=x.length:L>x.length&&(L=x.length);b<L;b++)yield x[b]}e.slice=w;function _(x,b=Number.POSITIVE_INFINITY){const L=[];if(b===0)return[L,x];const S=x[Symbol.iterator]();for(let M=0;M<b;M++){const F=S.next();if(F.done)return[L,e.empty()];L.push(F.value)}return[L,{[Symbol.iterator](){return S}}]}e.consume=_;async function v(x){const b=[];for await(const L of x)b.push(L);return Promise.resolve(b)}e.asyncToArray=v})(Gt||(Gt={}));function L1(e){return e}function N1(e,t){}function qr(e){if(Gt.is(e)){const t=[];for(const n of e)if(n)try{n.dispose()}catch(r){t.push(r)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function Co(...e){return Jt(()=>qr(e))}function Jt(e){return{dispose:Mo(()=>{e()})}}class Et{static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{qr(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Et.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(t),t}deleteAndLeak(t){t&&this._toDispose.has(t)&&this._toDispose.delete(t)}}class Xt{static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new Et,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}}class G{static{this.Undefined=new G(void 0)}constructor(t){this.element=t,this.next=G.Undefined,this.prev=G.Undefined}}class To{constructor(){this._first=G.Undefined,this._last=G.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first
`).slice(2).join(`
`))}}class Fo extends Error{constructor(t,n){super(t),this.name="ListenerLeakError",this.stack=n}}class Vo extends Error{constructor(t,n){super(t),this.name="ListenerRefusalError",this.stack=n}}class Fn{constructor(t){this.value=t}}const Do=2;class we{constructor(t){this._size=0,this._options=t,this._leakageMon=this._options?.leakWarningThreshold?new Pn(t?.onListenerError??Rt,this._options?.leakWarningThreshold??Io):void 0,this._perfMon=this._options?._profName?new Zt(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(t,n,r)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const l=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(l);const o=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],u=new Vo(`${l}. HINT: Stack shows most frequent listener (${o[1]}-times)`,o[0]);return(this._options?.onListenerError||Rt)(u),Xt.None}if(this._disposed)return Xt.None;n&&(t=t.bind(n));const i=new Fn(t);let s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=In.create(),s=this._leakageMon.check(i.stack,this._size+1)),this._listeners?this._listeners instanceof Fn?(this._deliveryQueue??=new Oo,this._listeners=[this._listeners,i]):this._listeners.push(i):(this._options?.onWillAddFirstListener?.(this),this._listeners=i,this._options?.onDidAddFirstListener?.(this)),this._size++;const a=Jt(()=>{s?.(),this._removeListener(i)});return r instanceof Et?r.add(a):Array.isArray(r)&&r.push(a),a},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}const n=this._listeners,r=n.indexOf(t);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[r]=void 0;const i=this._deliveryQueue.current===this;if(this._size*Do<=n.length){let s=0;for(let a=0;a<n.length;a++)n[a]?n[s++]=n[a]:i&&(this._deliveryQueue.end--,s<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=s}}_deliver(t,n){if(!t)return;const r=this._options?.onListenerError||Rt;if(!r){t.value(n);return}try{t.value(n)}catch(i){r(i)}}_deliverQueue(t){const n=t.current._listeners;for(;t.i<t.end;)this._deliver(n[t.i++],t.value);t.reset()}fire(t){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Fn)this._deliver(this._listeners,t);else{const n=this._deliveryQueue;n.enqueue(this,t,this._listeners.length),this._deliverQueue(n)}this._perfMon?.stop()}hasListeners(){return this._size>0}}class Oo{constructor(){this.i=-1,this.end=0}enqueue(t,n,r){this.i=0,this.end=r,this.current=t,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}function Bo(){return globalThis._VSCODE_NLS_MESSAGES}function jr(){return globalThis._VSCODE_NLS_LANGUAGE}const $o=jr()==="pseudo"||typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function Wr(e,t){let n;return t.length===0?n=e:n=e.replace(/\{(\d+)\}/g,(r,i)=>{const s=i[0],a=t[s];let l=r;return typeof a=="string"?l=a:(typeof a=="number"||typeof a=="boolean"||a===void 0||a===null)&&(l=String(a)),l}),$o&&(n=""+n.replace(/[aouei]/g,"$&$&")+""),n}function X(e,t,...n){return Wr(typeof e=="number"?Uo(e,t):t,n)}function Uo(e,t){const n=Bo()?.[e];if(typeof n!="string"){if(typeof t=="string")return t;throw new Error(`!!! NLS MISSING: ${e} !!!`)}return n}const lt="en";let Vn=!1,Dn=!1,On=!1,Hr=!1,Bn=!1,Kt,$n=lt,zr=lt,qo,De;const Oe=g
`||e===" "}class hn{constructor(t,n,r){this.changes=t,this.moves=n,this.hitTimeout=r}}class bu{constructor(t,n){this.lineRangeMapping=t,this.changes=n}}class W{static addRange(t,n){let r=0;for(;r<n.length&&n[r].endExclusive<t.start;)r++;let i=r;for(;i<n.length&&n[i].start<=t.endExclusive;)i++;if(r===i)n.splice(r,0,t);else{const s=Math.min(t.start,n[r].start),a=Math.max(t.endExclusive,n[i-1].endExclusive);n.splice(r,i-r,new W(s,a))}}static tryCreate(t,n){if(!(t>n))return new W(t,n)}static ofLength(t){return new W(0,t)}static ofStartAndLength(t,n){return new W(t,t+n)}constructor(t,n){if(this.start=t,this.endExclusive=n,t>n)throw new de(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(t){return new W(this.start+t,this.endExclusive+t)}deltaStart(t){return new W(this.start+t,this.endExclusive)}deltaEnd(t){return new W(this.start,this.endExclusive+t)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}contains(t){return this.start<=t&&t<this.endExclusive}join(t){return new W(Math.min(this.start,t.start),Math.max(this.endExclusive,t.endExclusive))}intersect(t){const n=Math.max(this.start,t.start),r=Math.min(this.endExclusive,t.endExclusive);if(n<=r)return new W(n,r)}intersects(t){const n=Math.max(this.start,t.start),r=Math.min(this.endExclusive,t.endExclusive);return n<r}isBefore(t){return this.endExclusive<=t.start}isAfter(t){return this.start>=t.endExclusive}slice(t){return t.slice(this.start,this.endExclusive)}substring(t){return t.substring(this.start,this.endExclusive)}clip(t){if(this.isEmpty)throw new de(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,t))}clipCyclic(t){if(this.isEmpty)throw new de(`Invalid clipping range: ${this.toString()}`);return t<this.start?this.endExclusive-(this.start-t)%this.length:t>=this.endExclusive?this.start+(t-this.start)%this.length:t}forEach(t){for(let n=this.start;n<this.endExclusive;n++)t(n)}}function dt(e,t){const n=Pt(e,t);return n===-1?void 0:e[n]}function Pt(e,t,n=0,r=e.length){let i=n,s=r;for(;i<s;){const a=Math.floor((i+s)/2);t(e[a])?i=a+1:s=a}return i-1}function yu(e,t){const n=sr(e,t);return n===e.length?void 0:e[n]}function sr(e,t,n=0,r=e.length){let i=n,s=r;for(;i<s;){const a=Math.floor((i+s)/2);t(e[a])?s=a:i=a+1}return i}class mn{static{this.assertInvariants=!1}constructor(t){this._array=t,this._findLastMonotonousLastIdx=0}findLastMonotonous(t){if(mn.assertInvariants){if(this._prevFindLastPredicate){for(const r of this._array)if(this._prevFindLastPredicate(r)&&!t(r))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=t}const n=Pt(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=n+1,n===-1?void 0:this._array[n]}}class B{static fromRangeInclusive(t){return new B(t.startLineNumber,t.endLineNumber+1)}static joinMany(t){if(t.length===0)return[];let n=new Pe(t[0].slice());for(let r=1;r<t.length;r++)n=n.getUnion(new Pe(t[r].slice()));return n.ranges}static join(t){if(t.length===0)throw new de("lineRanges cannot be empty");let n=t[0].startLineNumber,r=t[0].endLineNumberExclusive;for(let i=1;i<t.length;i++)n=Math.min(n,t[i].startLineNumber),r=Math.max(r,t[i].endLineNumberExclusive);return new B(n,r)}static ofLength(t,n){return new B(t,t+n)}static deserialize(t){return new B(t[0],t[1])}constructor(t,n){if(t>n)throw new de(`startLineNumber ${t} cannot be after endLineNumberExclusive ${n}`);this.startLineNumber=t,this.endLineNumberExclusive=n}contains(t){return this.startLineNumber<=t&&t<this.endLineNumberExclusive}get isEmpty(){return this.startLineNumber===this.endLineNumberExclusive}delta(t){return new B(this.startLineNumber+t,this.endLineNumberExclusive+t)}deltaLength(t){return new B(this.startLineNumber,this.endLineNumberExclusive+t)}get length(){return this.endLineNumberExclusive-this.startLineNumber}join(t){return new B(Math.min(this.startLineNumber,t.startLineNumber),Math.max(this.endLineNumberExclusive,t.
`?(n++,r=0):r++;return new gt(n,r)}constructor(t,n){this.lineCount=t,this.columnCount=n}isGreaterThanOrEqualTo(t){return this.lineCount!==t.lineCount?this.lineCount>t.lineCount:this.columnCount>=t.columnCount}createRange(t){return this.lineCount===0?new z(t.lineNumber,t.column,t.lineNumber,t.column+this.columnCount):new z(t.lineNumber,t.column,t.lineNumber+this.lineCount,this.columnCount+1)}addToPosition(t){return this.lineCount===0?new K(t.lineNumber,t.column+this.columnCount):new K(t.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}}class vu{constructor(t,n){this.range=t,this.text=n}toSingleEditOperation(){return{range:this.range,text:this.text}}}class _e{static inverse(t,n,r){const i=[];let s=1,a=1;for(const o of t){const u=new _e(new B(s,o.original.startLineNumber),new B(a,o.modified.startLineNumber));u.modified.isEmpty||i.push(u),s=o.original.endLineNumberExclusive,a=o.modified.endLineNumberExclusive}const l=new _e(new B(s,n+1),new B(a,r+1));return l.modified.isEmpty||i.push(l),i}static clip(t,n,r){const i=[];for(const s of t){const a=s.original.intersect(n),l=s.modified.intersect(r);a&&!a.isEmpty&&l&&!l.isEmpty&&i.push(new _e(a,l))}return i}constructor(t,n){this.original=t,this.modified=n}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new _e(this.modified,this.original)}join(t){return new _e(this.original.join(t.original),this.modified.join(t.modified))}toRangeMapping(){const t=this.original.toInclusiveRange(),n=this.modified.toInclusiveRange();if(t&&n)return new Ae(t,n);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new de("not a valid diff");return new Ae(new z(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new z(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new Ae(new z(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new z(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(t,n){if(Ms(this.original.endLineNumberExclusive,t)&&Ms(this.modified.endLineNumberExclusive,n))return new Ae(new z(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new z(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new Ae(z.fromPositions(new K(this.original.startLineNumber,1),pt(new K(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)),z.fromPositions(new K(this.modified.startLineNumber,1),pt(new K(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),n)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new Ae(z.fromPositions(pt(new K(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),t),pt(new K(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)),z.fromPositions(pt(new K(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),n),pt(new K(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),n)));throw new de}}function pt(e,t){if(e.lineNumber<1)return new K(1,1);if(e.lineNumber>t.length)return new K(t.length,t[t.length-1].length+1);const n=t[e.lineNumber-1];return e.column>n.length+1?new K(e.lineNumber,n.length+1):e}function Ms(e,t){return e>=1&&e<=t.length}class $e extends _e{static fromRangeMappings(t){const n=B.join(t.map(i=>B.fromRangeInclusive(i.originalRange))),r=B.join(t.map(i=>B.fromRangeInclusive(i.modifiedRange)));return new $e(n,r,t)}constructor(t,n,r){super(t,n),this.innerChanges=r}flip(){return new $e(this.modified,this.original,this.innerChanges?.map(t=>t.flip()))}withInnerChangesFromLineRanges(){return new $e(this.original,this.modified,[this.toRangeMapping()])}}class Ae{static assertSorted(t){for(let n=1;n<t.length;n++){const r=t[n-1],i=t[n];if(!(r.originalRange.getEndPosition().isBeforeOrEqual(i.originalRange.getSta
`);this.histogram[l]=(this.histogram[l]||0)+1}this.totalCount=i}computeSimilarity(t){let n=0;const r=Math.max(this.histogram.length,t.histogram.length);for(let i=0;i<r;i++)n+=Math.abs((this.histogram[i]??0)-(t.histogram[i]??0));return 1-n/(this.totalCount+t.totalCount)}}class Tu{compute(t,n,r=Ft.instance,i){if(t.length===0||n.length===0)return Ue.trivial(t,n);const s=new ur(t.length,n.length),a=new ur(t.length,n.length),l=new ur(t.length,n.length);for(let g=0;g<t.length;g++)for(let p=0;p<n.length;p++){if(!r.isValid())return Ue.trivialTimedOut(t,n);const y=g===0?0:s.get(g-1,p),w=p===0?0:s.get(g,p-1);let _;t.getElement(g)===n.getElement(p)?(g===0||p===0?_=0:_=s.get(g-1,p-1),g>0&&p>0&&a.get(g-1,p-1)===3&&(_+=l.get(g-1,p-1)),_+=i?i(g,p):1):_=-1;const v=Math.max(y,w,_);if(v===_){const x=g>0&&p>0?l.get(g-1,p-1):0;l.set(g,p,x+1),a.set(g,p,3)}else v===y?(l.set(g,p,0),a.set(g,p,1)):v===w&&(l.set(g,p,0),a.set(g,p,2));s.set(g,p,v)}const o=[];let u=t.length,h=n.length;function c(g,p){(g+1!==u||p+1!==h)&&o.push(new Q(new W(g+1,u),new W(p+1,h))),u=g,h=p}let m=t.length-1,d=n.length-1;for(;m>=0&&d>=0;)a.get(m,d)===3?(c(m,d),m--,d--):a.get(m,d)===1?m--:d--;return c(-1,-1),o.reverse(),new Ue(o,!1)}}class Is{compute(t,n,r=Ft.instance){if(t.length===0||n.length===0)return Ue.trivial(t,n);const i=t,s=n;function a(p,y){for(;p<i.length&&y<s.length&&i.getElement(p)===s.getElement(y);)p++,y++;return p}let l=0;const o=new Pu;o.set(0,a(0,0));const u=new Iu;u.set(0,o.get(0)===0?null:new Fs(null,0,0,o.get(0)));let h=0;e:for(;;){if(l++,!r.isValid())return Ue.trivialTimedOut(i,s);const p=-Math.min(l,s.length+l%2),y=Math.min(l,i.length+l%2);for(h=p;h<=y;h+=2){const w=h===y?-1:o.get(h+1),_=h===p?-1:o.get(h-1)+1,v=Math.min(Math.max(w,_),i.length),x=v-h;if(v>i.length||x>s.length)continue;const b=a(v,x);o.set(h,b);const L=v===w?u.get(h+1):u.get(h-1);if(u.set(h,b!==v?new Fs(L,v,x,b-v):L),o.get(h)===i.length&&o.get(h)-h===s.length)break e}}let c=u.get(h);const m=[];let d=i.length,g=s.length;for(;;){const p=c?c.x+c.length:0,y=c?c.y+c.length:0;if((p!==d||y!==g)&&m.push(new Q(new W(p,d),new W(y,g))),!c)break;d=c.x,g=c.y,c=c.prev}return m.reverse(),new Ue(m,!1)}}class Fs{constructor(t,n,r,i){this.prev=t,this.x=n,this.y=r,this.length=i}}class Pu{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(t){return t<0?(t=-t-1,this.negativeArr[t]):this.positiveArr[t]}set(t,n){if(t<0){if(t=-t-1,t>=this.negativeArr.length){const r=this.negativeArr;this.negativeArr=new Int32Array(r.length*2),this.negativeArr.set(r)}this.negativeArr[t]=n}else{if(t>=this.positiveArr.length){const r=this.positiveArr;this.positiveArr=new Int32Array(r.length*2),this.positiveArr.set(r)}this.positiveArr[t]=n}}}class Iu{constructor(){this.positiveArr=[],this.negativeArr=[]}get(t){return t<0?(t=-t-1,this.negativeArr[t]):this.positiveArr[t]}set(t,n){t<0?(t=-t-1,this.negativeArr[t]=n):this.positiveArr[t]=n}}class bn{constructor(t,n,r){this.lines=t,this.range=n,this.considerWhitespaceChanges=r,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let i=this.range.startLineNumber;i<=this.range.endLineNumber;i++){let s=t[i-1],a=0;i===this.range.startLineNumber&&this.range.startColumn>1&&(a=this.range.startColumn-1,s=s.substring(a)),this.lineStartOffsets.push(a);let l=0;if(!r){const u=s.trimStart();l=s.length-u.length,s=u.trimEnd()}this.trimmedWsLengthsByLineIdx.push(l);const o=i===this.range.endLineNumber?Math.min(this.range.endColumn-1-a-l,s.length):s.length;for(let u=0;u<o;u++)this.elements.push(s.charCodeAt(u));i<this.range.endLineNumber&&(this.elements.push(10),this.firstElementOffsetByLineIdx.push(this.elements.length))}}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new W(0,this.length))}getText(t){return this.elements.slice(t.start,t.endExclusive).map(n=>String.fromCharCode(n)).join("")}getElement(t){return this.elements[t]}get length(){return this.elements.length}getBoundaryScore(t){const n=Ds(t>0?this.elements[t-1]:-1),r=Ds(t<this.e
`).length>=15&&Du(c,d=>d.length>=2)>=2}),a=Uu(e,a),a}function Du(e,t){let n=0;for(const r of e)t(r)&&n++;return n}function Ou(e,t,n,r){const i=[],s=e.filter(o=>o.modified.isEmpty&&o.original.length>=3).map(o=>new Vt(o.original,t,o)),a=new Set(e.filter(o=>o.original.isEmpty&&o.modified.length>=3).map(o=>new Vt(o.modified,n,o))),l=new Set;for(const o of s){let u=-1,h;for(const c of a){const m=o.computeSimilarity(c);m>u&&(u=m,h=c)}if(u>.9&&h&&(a.delete(h),i.push(new _e(o.range,h.range)),l.add(o.source),l.add(h.source)),!r.isValid())return{moves:i,excludedChanges:l}}return{moves:i,excludedChanges:l}}function Bu(e,t,n,r,i,s){const a=[],l=new iu;for(const m of e)for(let d=m.original.startLineNumber;d<m.original.endLineNumberExclusive-2;d++){const g=`${t[d-1]}:${t[d+1-1]}:${t[d+2-1]}`;l.add(g,{range:new B(d,d+3)})}const o=[];e.sort(dn(m=>m.modified.startLineNumber,gn));for(const m of e){let d=[];for(let g=m.modified.startLineNumber;g<m.modified.endLineNumberExclusive-2;g++){const p=`${n[g-1]}:${n[g+1-1]}:${n[g+2-1]}`,y=new B(g,g+3),w=[];l.forEach(p,({range:_})=>{for(const x of d)if(x.originalLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive&&x.modifiedLineRange.endLineNumberExclusive+1===y.endLineNumberExclusive){x.originalLineRange=new B(x.originalLineRange.startLineNumber,_.endLineNumberExclusive),x.modifiedLineRange=new B(x.modifiedLineRange.startLineNumber,y.endLineNumberExclusive),w.push(x);return}const v={modifiedLineRange:y,originalLineRange:_};o.push(v),w.push(v)}),d=w}if(!s.isValid())return[]}o.sort(Mu(dn(m=>m.modifiedLineRange.length,gn)));const u=new Pe,h=new Pe;for(const m of o){const d=m.modifiedLineRange.startLineNumber-m.originalLineRange.startLineNumber,g=u.subtractFrom(m.modifiedLineRange),p=h.subtractFrom(m.originalLineRange).getWithDelta(d),y=g.getIntersection(p);for(const w of y.ranges){if(w.length<3)continue;const _=w,v=w.delta(-d);a.push(new _e(v,_)),u.addRange(_),h.addRange(v)}}a.sort(dn(m=>m.original.startLineNumber,gn));const c=new mn(e);for(let m=0;m<a.length;m++){const d=a[m],g=c.findLastMonotonous(L=>L.original.startLineNumber<=d.original.startLineNumber),p=dt(e,L=>L.modified.startLineNumber<=d.modified.startLineNumber),y=Math.max(d.original.startLineNumber-g.original.startLineNumber,d.modified.startLineNumber-p.modified.startLineNumber),w=c.findLastMonotonous(L=>L.original.startLineNumber<d.original.endLineNumberExclusive),_=dt(e,L=>L.modified.startLineNumber<d.modified.endLineNumberExclusive),v=Math.max(w.original.endLineNumberExclusive-d.original.endLineNumberExclusive,_.modified.endLineNumberExclusive-d.modified.endLineNumberExclusive);let x;for(x=0;x<y;x++){const L=d.original.startLineNumber-x-1,S=d.modified.startLineNumber-x-1;if(L>r.length||S>i.length||u.contains(S)||h.contains(L)||!Os(r[L-1],i[S-1],s))break}x>0&&(h.addRange(new B(d.original.startLineNumber-x,d.original.startLineNumber)),u.addRange(new B(d.modified.startLineNumber-x,d.modified.startLineNumber)));let b;for(b=0;b<v;b++){const L=d.original.endLineNumberExclusive+b,S=d.modified.endLineNumberExclusive+b;if(L>r.length||S>i.length||u.contains(S)||h.contains(L)||!Os(r[L-1],i[S-1],s))break}b>0&&(h.addRange(new B(d.original.endLineNumberExclusive,d.original.endLineNumberExclusive+b)),u.addRange(new B(d.modified.endLineNumberExclusive,d.modified.endLineNumberExclusive+b))),(x>0||b>0)&&(a[m]=new _e(new B(d.original.startLineNumber-x,d.original.endLineNumberExclusive+b),new B(d.modified.startLineNumber-x,d.modified.endLineNumberExclusive+b)))}return a}function Os(e,t,n){if(e.trim()===t.trim())return!0;if(e.length>300&&t.length>300)return!1;const i=new Is().compute(new bn([e],new z(1,1,1,e.length),!1),new bn([t],new z(1,1,1,t.length),!1),n);let s=0;const a=Q.invert(i.diffs,e.length);for(const h of a)h.seq1Range.forEach(c=>{cr(e.charCodeAt(c))||s++});function l(h){let c=0;for(let m=0;m<e.length;m++)cr(h.charCodeAt(m))||c++;return c}const o=l(e.length>t.length?e:t);return s/o>.6&&o>10}function $u(e){if(e.length===0)return e;e.sort(dn(n=>n.original.startLineNumber,gn));const t=[e[0]];for(let n=1;n<e.length;n++){const r=t[t.length-
`)}isStronglyEqual(t,n){return this.lines[t]===this.lines[n]}}function js(e){let t=0;for(;t<e.length&&(e.charCodeAt(t)===32||e.charCodeAt(t)===9);)t++;return t}class Ju{constructor(){this.dynamicProgrammingDiffing=new Tu,this.myersDiffingAlgorithm=new Is}computeDiff(t,n,r){if(t.length<=1&&Su(t,n,(b,L)=>b===L))return new hn([],[],!1);if(t.length===1&&t[0].length===0||n.length===1&&n[0].length===0)return new hn([new $e(new B(1,t.length+1),new B(1,n.length+1),[new Ae(new z(1,1,t.length,t[t.length-1].length+1),new z(1,1,n.length,n[n.length-1].length+1))])],[],!1);const i=r.maxComputationTimeMs===0?Ft.instance:new Cu(r.maxComputationTimeMs),s=!r.ignoreTrimWhitespace,a=new Map;function l(b){let L=a.get(b);return L===void 0&&(L=a.size,a.set(b,L)),L}const o=t.map(b=>l(b.trim())),u=n.map(b=>l(b.trim())),h=new qs(o,t),c=new qs(u,n),m=h.length+c.length<1700?this.dynamicProgrammingDiffing.compute(h,c,i,(b,L)=>t[b]===n[L]?n[L].length===0?.1:1+Math.log(1+n[L].length):.99):this.myersDiffingAlgorithm.compute(h,c,i);let d=m.diffs,g=m.hitTimeout;d=Bs(h,c,d),d=zu(h,c,d);const p=[],y=b=>{if(s)for(let L=0;L<b;L++){const S=w+L,M=_+L;if(t[S]!==n[M]){const F=this.refineDiff(t,n,new Q(new W(S,S+1),new W(M,M+1)),i,s);for(const O of F.mappings)p.push(O);F.hitTimeout&&(g=!0)}}};let w=0,_=0;for(const b of d){fn(()=>b.seq1Range.start-w===b.seq2Range.start-_);const L=b.seq1Range.start-w;y(L),w=b.seq1Range.endExclusive,_=b.seq2Range.endExclusive;const S=this.refineDiff(t,n,b,i,s);S.hitTimeout&&(g=!0);for(const M of S.mappings)p.push(M)}y(t.length-w);const v=Ws(p,t,n);let x=[];return r.computeMoves&&(x=this.computeMoves(v,t,n,o,u,i,s)),fn(()=>{function b(S,M){if(S.lineNumber<1||S.lineNumber>M.length)return!1;const F=M[S.lineNumber-1];return!(S.column<1||S.column>F.length+1)}function L(S,M){return!(S.startLineNumber<1||S.startLineNumber>M.length+1||S.endLineNumberExclusive<1||S.endLineNumberExclusive>M.length+1)}for(const S of v){if(!S.innerChanges)return!1;for(const M of S.innerChanges)if(!(b(M.modifiedRange.getStartPosition(),n)&&b(M.modifiedRange.getEndPosition(),n)&&b(M.originalRange.getStartPosition(),t)&&b(M.originalRange.getEndPosition(),t)))return!1;if(!L(S.modified,n)||!L(S.original,t))return!1}return!0}),new hn(v,x,g)}computeMoves(t,n,r,i,s,a,l){return Vu(t,n,r,i,s,a).map(h=>{const c=this.refineDiff(n,r,new Q(h.original.toOffsetRange(),h.modified.toOffsetRange()),a,l),m=Ws(c.mappings,n,r,!0);return new bu(h,m)})}refineDiff(t,n,r,i,s){const l=Qu(r).toRangeMapping2(t,n),o=new bn(t,l.originalRange,s),u=new bn(n,l.modifiedRange,s),h=o.length+u.length<500?this.dynamicProgrammingDiffing.compute(o,u,i):this.myersDiffingAlgorithm.compute(o,u,i);let c=h.diffs;return c=Bs(o,u,c),c=Wu(o,u,c),c=ju(o,u,c),c=Gu(o,u,c),{mappings:c.map(d=>new Ae(o.translateRange(d.seq1Range),u.translateRange(d.seq2Range))),hitTimeout:h.hitTimeout}}}function Ws(e,t,n,r=!1){const i=[];for(const s of Au(e.map(a=>Xu(a,t,n)),(a,l)=>a.original.overlapOrTouch(l.original)||a.modified.overlapOrTouch(l.modified))){const a=s[0],l=s[s.length-1];i.push(new $e(a.original.join(l.original),a.modified.join(l.modified),s.map(o=>o.innerChanges[0])))}return fn(()=>!r&&i.length>0&&(i[0].modified.startLineNumber!==i[0].original.startLineNumber||n.length-i[i.length-1].modified.endLineNumberExclusive!==t.length-i[i.length-1].original.endLineNumberExclusive)?!1:Ns(i,(s,a)=>a.original.startLineNumber-s.original.endLineNumberExclusive===a.modified.startLineNumber-s.modified.endLineNumberExclusive&&s.original.endLineNumberExclusive<a.original.startLineNumber&&s.modified.endLineNumberExclusive<a.modified.startLineNumber)),i}function Xu(e,t,n){let r=0,i=0;e.modifiedRange.endColumn===1&&e.originalRange.endColumn===1&&e.originalRange.startLineNumber+r<=e.originalRange.endLineNumber&&e.modifiedRange.startLineNumber+r<=e.modifiedRange.endLineNumber&&(i=-1),e.modifiedRange.startColumn-1>=n[e.modifiedRange.startLineNumber-1].length&&e.originalRange.startColumn-1>=t[e.originalRange.startLineNumber-1].length&&e.originalRange.startLineNumber<=e.originalRange.endLineNumber+i&&e.modifiedRange.startLineNumber<=e.modi
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/function dr(e,t=!1){const n=e.length;let r=0,i="",s=0,a=16,l=0,o=0,u=0,h=0,c=0;function m(v,x){let b=0,L=0;for(;b<v;){let S=e.charCodeAt(r);if(S>=48&&S<=57)L=L*16+S-48;else if(S>=65&&S<=70)L=L*16+S-65+10;else if(S>=97&&S<=102)L=L*16+S-97+10;else break;r++,b++}return b<v&&(L=-1),L}function d(v){r=v,i="",s=0,a=16,c=0}function g(){let v=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&vt(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&vt(e.charCodeAt(r)))for(r++;r<e.length&&vt(e.charCodeAt(r));)r++;else return c=3,e.substring(v,r);let x=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&vt(e.charCodeAt(r))){for(r++;r<e.length&&vt(e.charCodeAt(r));)r++;x=r}else c=3;return e.substring(v,x)}function p(){let v="",x=r;for(;;){if(r>=n){v+=e.substring(x,r),c=2;break}const b=e.charCodeAt(r);if(b===34){v+=e.substring(x,r),r++;break}if(b===92){if(v+=e.substring(x,r),r++,r>=n){c=2;break}switch(e.charCodeAt(r++)){case 34:v+='"';break;case 92:v+="\\";break;case 47:v+="/";break;case 98:v+="\b";break;case 102:v+="\f";break;case 110:v+=`
`;break;case 114:v+="\r";break;case 116:v+=" ";break;case 117:const S=m(4);S>=0?v+=String.fromCharCode(S):c=4;break;default:c=5}x=r;continue}if(b>=0&&b<=31)if(Bt(b)){v+=e.substring(x,r),c=2;break}else c=6;r++}return v}function y(){if(i="",c=0,s=r,o=l,h=u,r>=n)return s=n,a=17;let v=e.charCodeAt(r);if(gr(v)){do r++,i+=String.fromCharCode(v),v=e.charCodeAt(r);while(gr(v));return a=15}if(Bt(v))return r++,i+=String.fromCharCode(v),v===13&&e.charCodeAt(r)===10&&(r++,i+=`
`),l++,u=r,a=14;switch(v){case 123:return r++,a=1;case 125:return r++,a=2;case 91:return r++,a=3;case 93:return r++,a=4;case 58:return r++,a=6;case 44:return r++,a=5;case 34:return r++,i=p(),a=10;case 47:const x=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!Bt(e.charCodeAt(r));)r++;return i=e.substring(x,r),a=12}if(e.charCodeAt(r+1)===42){r+=2;const b=n-1;let L=!1;for(;r<b;){const S=e.charCodeAt(r);if(S===42&&e.charCodeAt(r+1)===47){r+=2,L=!0;break}r++,Bt(S)&&(S===13&&e.charCodeAt(r)===10&&r++,l++,u=r)}return L||(r++,c=1),i=e.substring(x,r),a=13}return i+=String.fromCharCode(v),r++,a=16;case 45:if(i+=String.fromCharCode(v),r++,r===n||!vt(e.charCodeAt(r)))return a=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=g(),a=11;default:for(;r<n&&w(v);)r++,v=e.charCodeAt(r);if(s!==r){switch(i=e.substring(s,r),i){case"true":return a=8;case"false":return a=9;case"null":return a=7}return a=16}return i+=String.fromCharCode(v),r++,a=16}}function w(v){if(gr(v)||Bt(v))return!1;switch(v){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function _(){let v;do v=y();while(v>=12&&v<=15);return v}return{setPosition:d,getPosition:()=>r,scan:t?_:y,getToken:()=>a,getTokenValue:()=>i,getTokenOffset:()=>s,getTokenLength:()=>r-s,getTokenStartLine:()=>o,getTokenStartCharacter:()=>s-h,getTokenError:()=>c}}function gr(e){return e===32||e===9}function Bt(e){return e===10||e===13}function vt(e){return e>=48&&e<=57}var Ks;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(Ks||(Ks={}));var Ne=new Array(20).fill(0).map((e,t)=>" ".repeat(t)),xt=200,ea={" ":{"\n":new Array(xt).fill(0).map((e,t)=>`
`+" ".repeat(t)),"\r":new Array(xt).fill(0).map((e,t)=>"\r"+" ".repeat(t)),"\r\n":new Array(xt).fill(0).map((e,t)=>`\r
`+" ".repeat(t))}," ":{"\n":new Array(xt).fill(0).map((e,t)=>`
`+" ".repeat(t)),"\r":new Array(xt).fill(0).map((e,t)=>"\r"+" ".repeat(t)),"\r\n":new Array(xt).fill(0).map((e,t)=>`\r
`+" ".repeat(t))}},fc=[`
`,"\r",`\r
`];function hc(e,t,n){let r,i,s,a,l;if(t){for(a=t.offset,l=a+t.length,s=a;s>0&&!ta(e,s-1);)s--;let b=l;for(;b<e.length&&!ta(e,b);)b++;i=e.substring(s,b),r=mc(i,n)}else i=e,r=0,s=0,a=0,l=e.length;const o=dc(n,e),u=fc.includes(o);let h=0,c=0,m;n.insertSpaces?m=Ne[n.tabSize||4]??wt(Ne[1],n.tabSize||4):m=" ";const d=m===" "?" ":" ";let g=dr(i,!1),p=!1;function y(){if(h>1)return wt(o,h)+wt(m,r+c);const b=m.length*(r+c);return!u||b>ea[d][o].length?o+wt(m,r+c):b<=0?o:ea[d][o][b]}function w(){let b=g.scan();for(h=0;b===15||b===14;)b===14&&n.keepLines?h+=1:b===14&&(h=1),b=g.scan();return p=b===16||g.getTokenError()!==0,b}const _=[];function v(b,L,S){!p&&(!t||L<l&&S>a)&&e.substring(L,S)!==b&&_.push({offset:L,length:S-L,content:b})}let x=w();if(n.keepLines&&h>0&&v(wt(o,h),0,0),x!==17){let b=g.getTokenOffset()+s,L=m.length*r<20&&n.insertSpaces?Ne[m.length*r]:wt(m,r);v(L,s,b)}for(;x!==17;){let b=g.getTokenOffset()+g.getTokenLength()+s,L=w(),S="",M=!1;for(;h===0&&(L===12||L===13);){let O=g.getTokenOffset()+s;v(Ne[1],b,O),b=g.getTokenOffset()+g.getTokenLength()+s,M=L===12,S=M?y():"",L=w()}if(L===2)x!==1&&c--,n.keepLines&&h>0||!n.keepLines&&x!==1?S=y():n.keepLines&&(S=Ne[1]);else if(L===4)x!==3&&c--,n.keepLines&&h>0||!n.keepLines&&x!==3?S=y():n.keepLines&&(S=Ne[1]);else{switch(x){case 3:case 1:c++,n.keepLines&&h>0||!n.keepLines?S=y():S=Ne[1];break;case 5:n.keepLines&&h>0||!n.keepLines?S=y():S=Ne[1];break;case 12:S=y();break;case 13:h>0?S=y():M||(S=Ne[1]);break;case 6:n.keepLines&&h>0?S=y():M||(S=Ne[1]);break;case 10:n.keepLines&&h>0?S=y():L===6&&!M&&(S="");break;case 7:case 8:case 9:case 11:case 2:case 4:n.keepLines&&h>0?S=y():(L===12||L===13)&&!M?S=Ne[1]:L!==5&&L!==17&&(p=!0);break;case 16:p=!0;break}h>0&&(L===12||L===13)&&(S=y())}L===17&&(n.keepLines&&h>0?S=y():S=n.insertFinalNewline?o:"");const F=g.getTokenOffset()+s;v(S,b,F),x=L}return _}function wt(e,t){let n="";for(let r=0;r<t;r++)n+=e;return n}function mc(e,t){let n=0,r=0;const i=t.tabSize||4;for(;n<e.length;){let s=e.charAt(n);if(s===Ne[1])r++;else if(s===" ")r+=i;else break;n++}return Math.floor(r/i)}function dc(e,t){for(let n=0;n<t.length;n++){const r=t.charAt(n);if(r==="\r")return n+1<t.length&&t.charAt(n+1)===`
`?`\r
`:"\r";if(r===`
`)return`
`}return e&&e.eol||`
`}function ta(e,t){return`\r
`.indexOf(e.charAt(t))!==-1}var xn;(function(e){e.DEFAULT={allowTrailingComma:!1}})(xn||(xn={}));function gc(e,t=[],n=xn.DEFAULT){let r=null,i=[];const s=[];function a(o){Array.isArray(i)?i.push(o):r!==null&&(i[r]=o)}return bc(e,{onObjectBegin:()=>{const o={};a(o),s.push(i),i=o,r=null},onObjectProperty:o=>{r=o},onObjectEnd:()=>{i=s.pop()},onArrayBegin:()=>{const o=[];a(o),s.push(i),i=o,r=null},onArrayEnd:()=>{i=s.pop()},onLiteralValue:a,onError:(o,u,h)=>{t.push({error:o,offset:u,length:h})}},n),i[0]}function na(e){if(!e.parent||!e.parent.children)return[];const t=na(e.parent);if(e.parent.type==="property"){const n=e.parent.children[0].value;t.push(n)}else if(e.parent.type==="array"){const n=e.parent.children.indexOf(e);n!==-1&&t.push(n)}return t}function pr(e){switch(e.type){case"array":return e.children.map(pr);case"object":const t=Object.create(null);for(let n of e.children){const r=n.children[1];r&&(t[n.children[0].value]=pr(r))}return t;case"null":case"string":case"number":case"boolean":return e.value;default:return}}function pc(e,t,n=!1){return t>=e.offset&&t<e.offset+e.length||n&&t===e.offset+e.length}function ra(e,t,n=!1){if(pc(e,t,n)){const r=e.children;if(Array.isArray(r))for(let i=0;i<r.length&&r[i].offset<=t;i++){const s=ra(r[i],t,n);if(s)return s}return e}}function bc(e,t,n=xn.DEFAULT){const r=dr(e,!1),i=[];function s(N){return N?()=>N(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function a(N){return N?()=>N(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function l(N){return N?k=>N(k,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function o(N){return N?k=>N(k,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}const u=a(t.onObjectBegin),h=o(t.onObjectProperty),c=s(t.onObjectEnd),m=a(t.onArrayBegin),d=s(t.onArrayEnd),g=o(t.onLiteralValue),p=l(t.onSeparator),y=s(t.onComment),w=l(t.onError),_=n&&n.disallowComments,v=n&&n.allowTrailingComma;function x(){for(;;){const N=r.scan();switch(r.getTokenError()){case 4:b(14);break;case 5:b(15);break;case 3:b(13);break;case 1:_||b(11);break;case 2:b(12);break;case 6:b(16);break}switch(N){case 12:case 13:_?b(10):y();break;case 16:b(1);break;case 15:case 14:break;default:return N}}}function b(N,k=[],R=[]){if(w(N),k.length+R.length>0){let I=r.getToken();for(;I!==17;){if(k.indexOf(I)!==-1){x();break}else if(R.indexOf(I)!==-1)break;I=x()}}}function L(N){const k=r.getTokenValue();return N?g(k):(h(k),i.push(k)),x(),!0}function S(){switch(r.getToken()){case 11:const N=r.getTokenValue();let k=Number(N);isNaN(k)&&(b(2),k=0),g(k);break;case 7:g(null);break;case 8:g(!0);break;case 9:g(!1);break;default:return!1}return x(),!0}function M(){return r.getToken()!==10?(b(3,[],[2,5]),!1):(L(!1),r.getToken()===6?(p(":"),x(),C()||b(4,[],[2,5])):b(5,[],[2,5]),i.pop(),!0)}function F(){u(),x();let N=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(N||b(4,[],[]),p(","),x(),r.getToken()===2&&v)break}else N&&b(6,[],[]);M()||b(4,[],[2,5]),N=!0}return c(),r.getToken()!==2?b(7,[2],[]):x(),!0}function O(){m(),x();let N=!0,k=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(k||b(4,[],[]),p(","),x(),r.getToken()===4&&v)break}else k&&b(6,[],[]);N?(i.push(0),N=!1):i[i.length-1]++,C()||b(4,[],[4,5]),k=!0}return d(),N||i.pop(),r.getToken()!==4?b(8,[4],[]):x(),!0}function C(){switch(r.getToken()){case 3:return O();case 1:return F();case 10:return L(!0);default:return S()}}return x(),r.getToken()===17?n.allowEmptyContent?!0:(b(4,[],[]),!1):C()?(r.getToken()!==17&&b(9,[],[]),!0):(b(4,[],[]),!1)}var nt=dr,ia;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(ia||(ia={}));var sa;(func
`,i==="\r"&&r+1<t.length&&t.charAt(r+1)===`
`&&r++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(r===0)return Y.create(0,e);for(;n<r;){let s=Math.floor((n+r)/2);t[s]>e?r=s:n=s+1}let i=n-1;return Y.create(i,e-t[i])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)}get lineCount(){return this.getLineOffsets().length}},A;(function(e){const t=Object.prototype.toString;function n(d){return typeof d<"u"}e.defined=n;function r(d){return typeof d>"u"}e.undefined=r;function i(d){return d===!0||d===!1}e.boolean=i;function s(d){return t.call(d)==="[object String]"}e.string=s;function a(d){return t.call(d)==="[object Number]"}e.number=a;function l(d,g,p){return t.call(d)==="[object Number]"&&g<=d&&d<=p}e.numberRange=l;function o(d){return t.call(d)==="[object Number]"&&-2147483648<=d&&d<=2147483647}e.integer=o;function u(d){return t.call(d)==="[object Number]"&&0<=d&&d<=2147483647}e.uinteger=u;function h(d){return t.call(d)==="[object Function]"}e.func=h;function c(d){return d!==null&&typeof d=="object"}e.objectLiteral=c;function m(d,g){return Array.isArray(d)&&d.every(g)}e.typedArray=m})(A||(A={}));var ro=class $r{constructor(t,n,r,i){this._uri=t,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){const n=this.offsetAt(t.start),r=this.offsetAt(t.end);return this._content.substring(n,r)}return this._content}update(t,n){for(let r of t)if($r.isIncremental(r)){const i=so(r.range),s=this.offsetAt(i.start),a=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(a,this._content.length);const l=Math.max(i.start.line,0),o=Math.max(i.end.line,0);let u=this._lineOffsets;const h=io(r.text,!1,s);if(o-l===h.length)for(let m=0,d=h.length;m<d;m++)u[m+l+1]=h[m];else h.length<1e4?u.splice(l+1,o-l,...h):this._lineOffsets=u=u.slice(0,l+1).concat(h,u.slice(o+1));const c=r.text.length-(a-s);if(c!==0)for(let m=l+1+h.length,d=u.length;m<d;m++)u[m]=u[m]+c}else if($r.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=io(this._content,!0)),this._lineOffsets}positionAt(t){t=Math.max(Math.min(t,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:t};for(;r<i;){let a=Math.floor((r+i)/2);n[a]>t?i=a:r=a+1}let s=r-1;return{line:s,character:t-n[s]}}offsetAt(t){let n=this.getLineOffsets();if(t.line>=n.length)return this._content.length;if(t.line<0)return 0;let r=n[t.line],i=t.line+1<n.length?n[t.line+1]:this._content.length;return Math.max(Math.min(r+t.character,i),r)}get lineCount(){return this.getLineOffsets().length}static isIncremental(t){let n=t;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(t){let n=t;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}},Ee;(function(e){function t(i,s,a,l){return new ro(i,s,a,l)}e.create=t;function n(i,s,a){if(i instanceof ro)return i.update(s,a),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}e.update=n;function r(i,s){let a=i.getText(),l=Mr(s.map(Sc),(h,c)=>{let m=h.range.start.line-c.range.start.line;return m===0?h.range.start.character-c.range.start.character:m}),o=0;const u=[];for(const h of l){let c=i.offsetAt(h.range.start);if(c<o)throw new Error("Overlapping edit");c>o&&u.push(a.substring(o,c)),h.newText.length&&u.push(h.newText),o=i.offsetAt(h.range.end)}return u.push(a.substr(o)),u.join("")}e.applyEdits=r})(Ee||(Ee={}));function Mr(e,t){if(e.length<=1)return e;const n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);Mr(r,t),Mr(i,t);let s=
`;for(let s=0;s<e.length;s++)i+=r+Ir(e[s],r,n),s<e.length-1&&(i+=","),i+=`
`;return i+=t+"]",i}else{const i=Object.keys(e);if(i.length===0)return"{}";let s=`{
`;for(let a=0;a<i.length;a++){const l=i[a];s+=r+JSON.stringify(l)+": "+Ir(e[l],r,n),a<i.length-1&&(s+=","),s+=`
`}return s+=t+"}",s}}return n(e)}var Oc=class{constructor(e,t=[],n=Promise,r={}){this.schemaService=e,this.contributions=t,this.promiseConstructor=n,this.clientCapabilities=r}doResolve(e){for(let t=this.contributions.length-1;t>=0;t--){const n=this.contributions[t].resolveCompletion;if(n){const r=n(e);if(r)return r}}return this.promiseConstructor.resolve(e)}doComplete(e,t,n){const r={items:[],isIncomplete:!1},i=e.getText(),s=e.offsetAt(t);let a=n.getNodeFromOffset(s,!0);if(this.isInComment(e,a?a.offset:0,s))return Promise.resolve(r);if(a&&s===a.offset+a.length&&s>0){const c=i[s-1];(a.type==="object"&&c==="}"||a.type==="array"&&c==="]")&&(a=a.parent)}const l=this.getCurrentWord(e,s);let o;if(a&&(a.type==="string"||a.type==="number"||a.type==="boolean"||a.type==="null"))o=q.create(e.positionAt(a.offset),e.positionAt(a.offset+a.length));else{let c=s-l.length;c>0&&i[c-1]==='"'&&c--,o=q.create(e.positionAt(c),t)}const u=new Map,h={add:c=>{let m=c.label;const d=u.get(m);if(d)d.documentation||(d.documentation=c.documentation),d.detail||(d.detail=c.detail),d.labelDetails||(d.labelDetails=c.labelDetails);else{if(m=m.replace(/[\n]/g,"↵"),m.length>60){const g=m.substr(0,57).trim()+"...";u.has(g)||(m=g)}c.textEdit=Fe.replace(o,c.insertText),c.label=m,u.set(m,c),r.items.push(c)}},setAsIncomplete:()=>{r.isIncomplete=!0},error:c=>{console.error(c)},getNumberOfProposals:()=>r.items.length};return this.schemaService.getSchemaForResource(e.uri,n).then(c=>{const m=[];let d=!0,g="",p;if(a&&a.type==="string"){const w=a.parent;w&&w.type==="property"&&w.keyNode===a&&(d=!w.valueNode,p=w,g=i.substr(a.offset+1,a.length-2),w&&(a=w.parent))}if(a&&a.type==="object"){if(a.offset===s)return r;a.properties.forEach(x=>{(!p||p!==x)&&u.set(x.keyNode.value,kr.create("__"))});let _="";d&&(_=this.evaluateSeparatorAfter(e,e.offsetAt(o.end))),c?this.getPropertyCompletions(c,n,a,d,_,h):this.getSchemaLessPropertyCompletions(n,a,g,h);const v=Pr(a);this.contributions.forEach(x=>{const b=x.collectPropertyCompletions(e.uri,v,l,d,_==="",h);b&&m.push(b)}),!c&&l.length>0&&i.charAt(s-l.length-1)!=='"'&&(h.add({kind:ve.Property,label:this.getLabelForValue(l),insertText:this.getInsertTextForProperty(l,void 0,!1,_),insertTextFormat:re.Snippet,documentation:""}),h.setAsIncomplete())}const y={};return c?this.getValueCompletions(c,n,a,s,e,h,y):this.getSchemaLessValueCompletions(n,a,s,e,h),this.contributions.length>0&&this.getContributedValueCompletions(n,a,s,e,h,m),this.promiseConstructor.all(m).then(()=>{if(h.getNumberOfProposals()===0){let w=s;a&&(a.type==="string"||a.type==="number"||a.type==="boolean"||a.type==="null")&&(w=a.offset+a.length);const _=this.evaluateSeparatorAfter(e,w);this.addFillerValueCompletions(y,_,h)}return r})})}getPropertyCompletions(e,t,n,r,i,s){t.getMatchingSchemas(e.schema,n.offset).forEach(l=>{if(l.node===n&&!l.inverted){const o=l.schema.properties;o&&Object.keys(o).forEach(h=>{const c=o[h];if(typeof c=="object"&&!c.deprecationMessage&&!c.doNotSuggest){const m={kind:ve.Property,label:h,insertText:this.getInsertTextForProperty(h,c,r,i),insertTextFormat:re.Snippet,filterText:this.getFilterTextForValue(h),documentation:this.fromMarkup(c.markdownDescription)||c.description||""};c.suggestSortText!==void 0&&(m.sortText=c.suggestSortText),m.insertText&&$t(m.insertText,`$1${i}`)&&(m.command={title:"Suggest",command:"editor.action.triggerSuggest"}),s.add(m)}});const u=l.schema.propertyNames;if(typeof u=="object"&&!u.deprecationMessage&&!u.doNotSuggest){const h=(c,m=void 0)=>{const d={kind:ve.Property,label:c,insertText:this.getInsertTextForProperty(c,void 0,r,i),insertTextFormat:re.Snippet,filterText:this.getFilterTextForValue(c),documentation:m||this.fromMarkup(u.markdownDescription)||u.description||""};u.suggestSortText!==void 0&&(d.sortText=u.suggestSortText),d.insertText&&$t(d.insertText,`$1${i}`)&&(d.command={title:"Suggest",command:"editor.action.triggerSuggest"}),s.add(d)};if(u.enum)for(let c=0;c<u.enum.length;c++){let m;u.markdownEnumDescriptions&&c<u.markdownEnumDescriptions.length?m=this.fromMarkup(u.markdownEnumDescriptions[c]):u.enumDescript
`,m=m+`
`+d+"]",d+=" ",a="array";u=c+d+s.bodyText.split(`
`).join(`
`+d)+m+t,o=o||u,h=u.replace(/[\n]/g,"")}else return;n.add({kind:this.getSuggestionKind(a),label:o,documentation:this.fromMarkup(s.markdownDescription)||s.description,insertText:u,insertTextFormat:re.Snippet,filterText:h}),i=!0}),!i&&typeof e.items=="object"&&!Array.isArray(e.items)&&r<5&&this.addDefaultValueCompletions(e.items,t,n,r+1)}addEnumValueCompletions(e,t,n){if(Re(e.const)&&n.add({kind:this.getSuggestionKind(e.type),label:this.getLabelForValue(e.const),insertText:this.getInsertTextForValue(e.const,t),insertTextFormat:re.Snippet,documentation:this.fromMarkup(e.markdownDescription)||e.description}),Array.isArray(e.enum))for(let r=0,i=e.enum.length;r<i;r++){const s=e.enum[r];let a=this.fromMarkup(e.markdownDescription)||e.description;e.markdownEnumDescriptions&&r<e.markdownEnumDescriptions.length&&this.doesSupportMarkdown()?a=this.fromMarkup(e.markdownEnumDescriptions[r]):e.enumDescriptions&&r<e.enumDescriptions.length&&(a=e.enumDescriptions[r]),n.add({kind:this.getSuggestionKind(e.type),label:this.getLabelForValue(s),insertText:this.getInsertTextForValue(s,t),insertTextFormat:re.Snippet,documentation:a})}}collectTypes(e,t){if(Array.isArray(e.enum)||Re(e.const))return;const n=e.type;Array.isArray(n)?n.forEach(r=>t[r]=!0):n&&(t[n]=!0)}addFillerValueCompletions(e,t,n){e.object&&n.add({kind:this.getSuggestionKind("object"),label:"{}",insertText:this.getInsertTextForGuessedValue({},t),insertTextFormat:re.Snippet,detail:E("New object"),documentation:""}),e.array&&n.add({kind:this.getSuggestionKind("array"),label:"[]",insertText:this.getInsertTextForGuessedValue([],t),insertTextFormat:re.Snippet,detail:E("New array"),documentation:""})}addBooleanValueCompletion(e,t,n){n.add({kind:this.getSuggestionKind("boolean"),label:e?"true":"false",insertText:this.getInsertTextForValue(e,t),insertTextFormat:re.Snippet,documentation:""})}addNullValueCompletion(e,t){t.add({kind:this.getSuggestionKind("null"),label:"null",insertText:"null"+e,insertTextFormat:re.Snippet,documentation:""})}addDollarSchemaCompletions(e,t){this.schemaService.getRegisteredSchemaIds(r=>r==="http"||r==="https").forEach(r=>{r.startsWith("http://json-schema.org/draft-")&&(r=r+"#"),t.add({kind:ve.Module,label:this.getLabelForValue(r),filterText:this.getFilterTextForValue(r),insertText:this.getInsertTextForValue(r,e),insertTextFormat:re.Snippet,documentation:""})})}getLabelForValue(e){return JSON.stringify(e)}getValueFromLabel(e){return JSON.parse(e)}getFilterTextForValue(e){return JSON.stringify(e)}getFilterTextForSnippetValue(e){return JSON.stringify(e).replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")}getLabelForSnippetValue(e){return JSON.stringify(e).replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")}getInsertTextForPlainText(e){return e.replace(/[\\\$\}]/g,"\\$&")}getInsertTextForValue(e,t){const n=JSON.stringify(e,null," ");return n==="{}"?"{$1}"+t:n==="[]"?"[$1]"+t:this.getInsertTextForPlainText(n+t)}getInsertTextForSnippetValue(e,t){return Ir(e,"",r=>typeof r=="string"&&r[0]==="^"?r.substr(1):JSON.stringify(r))+t}getInsertTextForGuessedValue(e,t){switch(typeof e){case"object":return e===null?"${1:null}"+t:this.getInsertTextForValue(e,t);case"string":let n=JSON.stringify(e);return n=n.substr(1,n.length-2),n=this.getInsertTextForPlainText(n),'"${1:'+n+'}"'+t;case"number":case"boolean":return"${1:"+JSON.stringify(e)+"}"+t}return this.getInsertTextForValue(e,t)}getSuggestionKind(e){if(Array.isArray(e)){const t=e;e=t.length>0?t[0]:void 0}if(!e)return ve.Value;switch(e){case"string":return ve.Value;case"object":return ve.Module;case"property":return ve.Property;default:return ve.Value}}getLabelTextForMatchingNode(e,t){switch(e.type){case"array":return"[]";case"object":return"{}";default:return t.getText().substr(e.offset,e.length)}}getInsertTextForMatchingNode(e,t,n){switch(e.type){case"array":return this.getInsertTextForValue([],n);case"object":return this.getInsertTextForValue({},n);default:const r=t.getText().substr(e.offset,e.length)+n;return this.getInsertTextForPlainText(r)}}getInsertTextForProperty(e,t,n,r){const i=this.getInsertTextForValue(e,"");if(!n)return i;const s=i+
\r\v":{[,]}`.indexOf(r.charAt(n))===-1;)n--;return r.substring(n+1,t)}evaluateSeparatorAfter(e,t){const n=nt(e.getText(),!0);switch(n.setPosition(t),n.scan()){case 5:case 2:case 4:case 17:return"";default:return","}}findItemAtOffset(e,t,n){const r=nt(t.getText(),!0),i=e.items;for(let s=i.length-1;s>=0;s--){const a=i[s];if(n>a.offset+a.length)return r.setPosition(a.offset+a.length),r.scan()===5&&n>=r.getTokenOffset()+r.getTokenLength()?s+1:s;if(n>=a.offset)return s}return 0}isInComment(e,t,n){const r=nt(e.getText(),!1);r.setPosition(t);let i=r.scan();for(;i!==17&&r.getTokenOffset()+r.getTokenLength()<n;)i=r.scan();return(i===12||i===13)&&r.getTokenOffset()<=n}fromMarkup(e){if(e&&this.doesSupportMarkdown())return{kind:rt.Markdown,value:e}}doesSupportMarkdown(){if(!Re(this.supportsMarkdown)){const e=this.clientCapabilities.textDocument?.completion?.completionItem?.documentationFormat;this.supportsMarkdown=Array.isArray(e)&&e.indexOf(rt.Markdown)!==-1}return this.supportsMarkdown}doesSupportsCommitCharacters(){return Re(this.supportsCommitCharacters)||(this.labelDetailsSupport=this.clientCapabilities.textDocument?.completion?.completionItem?.commitCharactersSupport),this.supportsCommitCharacters}doesSupportsLabelDetails(){return Re(this.labelDetailsSupport)||(this.labelDetailsSupport=this.clientCapabilities.textDocument?.completion?.completionItem?.labelDetailsSupport),this.labelDetailsSupport}},Bc=class{constructor(e,t=[],n){this.schemaService=e,this.contributions=t,this.promise=n||Promise}doHover(e,t,n){const r=e.offsetAt(t);let i=n.getNodeFromOffset(r);if(!i||(i.type==="object"||i.type==="array")&&r>i.offset+1&&r<i.offset+i.length-1)return this.promise.resolve(null);const s=i;if(i.type==="string"){const u=i.parent;if(u&&u.type==="property"&&u.keyNode===i&&(i=u.valueNode,!i))return this.promise.resolve(null)}const a=q.create(e.positionAt(s.offset),e.positionAt(s.offset+s.length)),l=u=>({contents:u,range:a}),o=Pr(i);for(let u=this.contributions.length-1;u>=0;u--){const c=this.contributions[u].getInfoContribution(e.uri,o);if(c)return c.then(m=>l(m))}return this.schemaService.getSchemaForResource(e.uri,n).then(u=>{if(u&&i){const h=n.getMatchingSchemas(u.schema,i.offset);let c,m,d,g;h.every(y=>{if(y.node===i&&!y.inverted&&y.schema&&(c=c||y.schema.title,m=m||y.schema.markdownDescription||Fr(y.schema.description),y.schema.enum)){const w=y.schema.enum.indexOf(st(i));y.schema.markdownEnumDescriptions?d=y.schema.markdownEnumDescriptions[w]:y.schema.enumDescriptions&&(d=Fr(y.schema.enumDescriptions[w])),d&&(g=y.schema.enum[w],typeof g!="string"&&(g=JSON.stringify(g)))}return!0});let p="";return c&&(p=Fr(c)),m&&(p.length>0&&(p+=`
`),p+=m),d&&(p.length>0&&(p+=`
`),p+=`\`${$c(g)}\`: ${d}`),l([p])}return null})}};function Fr(e){if(e)return e.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,`$1
$3`).replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}function $c(e){return e.indexOf("`")!==-1?"`` "+e+" ``":e}var Uc=class{constructor(e,t){this.jsonSchemaService=e,this.promise=t,this.validationEnabled=!0}configure(e){e&&(this.validationEnabled=e.validate!==!1,this.commentSeverity=e.allowComments?void 0:ye.Error)}doValidation(e,t,n,r){if(!this.validationEnabled)return this.promise.resolve([]);const i=[],s={},a=o=>{const u=o.range.start.line+" "+o.range.start.character+" "+o.message;s[u]||(s[u]=!0,i.push(o))},l=o=>{let u=n?.trailingCommas?An(n.trailingCommas):ye.Error,h=n?.comments?An(n.comments):this.commentSeverity,c=n?.schemaValidation?An(n.schemaValidation):ye.Warning,m=n?.schemaRequest?An(n.schemaRequest):ye.Warning;if(o){const d=(g,p)=>{if(t.root&&m){const y=t.root,w=y.type==="object"?y.properties[0]:void 0;if(w&&w.keyNode.value==="$schema"){const _=w.valueNode||w,v=q.create(e.positionAt(_.offset),e.positionAt(_.offset+_.length));a(qe.create(v,g,m,p))}else{const _=q.create(e.positionAt(y.offset),e.positionAt(y.offset+1));a(qe.create(_,g,m,p))}}};if(o.errors.length)d(o.errors[0],H.SchemaResolveError);else if(c){for(const p of o.warnings)d(p,H.SchemaUnsupportedFeature);const g=t.validate(e,o.schema,c,n?.schemaDraft);g&&g.forEach(a)}ho(o.schema)&&(h=void 0),mo(o.schema)&&(u=void 0)}for(const d of t.syntaxErrors){if(d.code===H.TrailingComma){if(typeof u!="number")continue;d.severity=u}a(d)}if(typeof h=="number"){const d=E("Comments are not permitted in JSON.");t.comments.forEach(g=>{a(qe.create(g,d,h,H.CommentNotPermitted))})}return i};if(r){const o=r.id||"schemaservice://untitled/"+qc++;return this.jsonSchemaService.registerExternalSchema({uri:o,schema:r}).getResolvedSchema().then(h=>l(h))}return this.jsonSchemaService.getSchemaForResource(e.uri,t).then(o=>l(o))}getLanguageStatus(e,t){return{schemas:this.jsonSchemaService.getSchemaURIsForResource(e.uri,t)}}},qc=0;function ho(e){if(e&&typeof e=="object"){if(Ie(e.allowComments))return e.allowComments;if(e.allOf)for(const t of e.allOf){const n=ho(t);if(Ie(n))return n}}}function mo(e){if(e&&typeof e=="object"){if(Ie(e.allowTrailingCommas))return e.allowTrailingCommas;const t=e;if(Ie(t.allowsTrailingCommas))return t.allowsTrailingCommas;if(e.allOf)for(const n of e.allOf){const r=mo(n);if(Ie(r))return r}}}function An(e){switch(e){case"error":return ye.Error;case"warning":return ye.Warning;case"ignore":return}}var go=48,jc=57,Wc=65,kn=97,Hc=102;function ee(e){return e<go?0:e<=jc?e-go:(e<kn&&(e+=kn-Wc),e>=kn&&e<=Hc?e-kn+10:0)}function zc(e){if(e[0]==="#")switch(e.length){case 4:return{red:ee(e.charCodeAt(1))*17/255,green:ee(e.charCodeAt(2))*17/255,blue:ee(e.charCodeAt(3))*17/255,alpha:1};case 5:return{red:ee(e.charCodeAt(1))*17/255,green:ee(e.charCodeAt(2))*17/255,blue:ee(e.charCodeAt(3))*17/255,alpha:ee(e.charCodeAt(4))*17/255};case 7:return{red:(ee(e.charCodeAt(1))*16+ee(e.charCodeAt(2)))/255,green:(ee(e.charCodeAt(3))*16+ee(e.charCodeAt(4)))/255,blue:(ee(e.charCodeAt(5))*16+ee(e.charCodeAt(6)))/255,alpha:1};case 9:return{red:(ee(e.charCodeAt(1))*16+ee(e.charCodeAt(2)))/255,green:(ee(e.charCodeAt(3))*16+ee(e.charCodeAt(4)))/255,blue:(ee(e.charCodeAt(5))*16+ee(e.charCodeAt(6)))/255,alpha:(ee(e.charCodeAt(7))*16+ee(e.charCodeAt(8)))/255}}}var Gc=class{constructor(e){this.schemaService=e}findDocumentSymbols(e,t,n={resultLimit:Number.MAX_VALUE}){const r=t.root;if(!r)return[];let i=n.resultLimit||Number.MAX_VALUE;const s=e.uri;if((s==="vscode://defaultsettings/keybindings.json"||$t(s.toLowerCase(),"/user/keybindings.json"))&&r.type==="array"){const c=[];for(const m of r.items)if(m.type==="object"){for(const d of m.properties)if(d.keyNode.value==="key"&&d.valueNode){const g=Lt.create(e.uri,Ze(e,m));if(c.push({name:po(d.valueNode),kind:Ve.Function,location:g}),i--,i<=0)return n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(s),c}}return c}const a=[{node:r,containerName:""}];let l=0,o=!1;const u=[],h=(c,m)=>{c.type==="array"?c.items.forEach(d=>{d&&a.push({node:d,containerName:m})}):c.type==="object"&&c.properties.forEach(d=>{const g=d.valueNode;if(g)if(i>0){i--;const p=Lt.create(e.uri
`,keepLines:t?.keepLines===!0};return _c(e.getText(),r,i).map(s=>Fe.replace(q.create(e.positionAt(s.offset),e.positionAt(s.offset+s.length)),s.content))}var ie;(function(e){e[e.Object=0]="Object",e[e.Array=1]="Array"})(ie||(ie={}));var Rn=class{constructor(e,t){this.propertyName=e??"",this.beginningLineNumber=t,this.childrenProperties=[],this.lastProperty=!1,this.noKeyName=!1}addChildProperty(e){if(e.parent=this,this.childrenProperties.length>0){let t=0;e.noKeyName?t=this.childrenProperties.length:t=s1(this.childrenProperties,e,i1),t<0&&(t=t*-1-1),this.childrenProperties.splice(t,0,e)}else this.childrenProperties.push(e);return e}};function i1(e,t){const n=e.propertyName.toLowerCase(),r=t.propertyName.toLowerCase();return n<r?-1:n>r?1:0}function s1(e,t,n){const r=t.propertyName.toLowerCase(),i=e[0].propertyName.toLowerCase(),s=e[e.length-1].propertyName.toLowerCase();if(r<i)return 0;if(r>s)return e.length;let a=0,l=e.length-1;for(;a<=l;){let o=l+a>>1,u=n(t,e[o]);if(u>0)a=o+1;else if(u<0)l=o-1;else return o}return-a-1}function a1(e,t){const n={...t,keepLines:!1},r=Ee.applyEdits(e,Dr(e,n,void 0)),i=Ee.create("test://test.json","json",0,r),s=o1(i),a=l1(i,s),l=Dr(a,n,void 0),o=Ee.applyEdits(a,l);return[Fe.replace(q.create(Y.create(0,0),e.positionAt(e.getText().length)),o)]}function o1(e){const t=e.getText(),n=nt(t,!1);let r=new Rn,i=r,s=r,a=r,l,o=0,u=0,h,c,m=-1,d=-1,g=0,p=0,y=[],w=!1,_=!1;for(;(l=n.scan())!==17;){if(w===!0&&l!==14&&l!==15&&l!==12&&l!==13&&s.endLineNumber===void 0){let v=n.getTokenStartLine();c===2||c===4?a.endLineNumber=v-1:s.endLineNumber=v-1,g=v,w=!1}if(_===!0&&l!==14&&l!==15&&l!==12&&l!==13&&(g=n.getTokenStartLine(),_=!1),n.getTokenStartLine()!==o){for(let v=o;v<n.getTokenStartLine();v++){const x=e.getText(q.create(Y.create(v,0),Y.create(v+1,0))).length;u=u+x}o=n.getTokenStartLine()}switch(l){case 10:{if(h===void 0||h===1||h===5&&y[y.length-1]===ie.Object){const v=new Rn(n.getTokenValue(),g);a=s,s=i.addChildProperty(v)}break}case 3:{if(r.beginningLineNumber===void 0&&(r.beginningLineNumber=n.getTokenStartLine()),y[y.length-1]===ie.Object)i=s;else if(y[y.length-1]===ie.Array){const v=new Rn(n.getTokenValue(),g);v.noKeyName=!0,a=s,s=i.addChildProperty(v),i=s}y.push(ie.Array),s.type=ie.Array,g=n.getTokenStartLine(),g++;break}case 1:{if(r.beginningLineNumber===void 0)r.beginningLineNumber=n.getTokenStartLine();else if(y[y.length-1]===ie.Array){const v=new Rn(n.getTokenValue(),g);v.noKeyName=!0,a=s,s=i.addChildProperty(v)}s.type=ie.Object,y.push(ie.Object),i=s,g=n.getTokenStartLine(),g++;break}case 4:{p=n.getTokenStartLine(),y.pop(),s.endLineNumber===void 0&&(h===2||h===4)&&(s.endLineNumber=p-1,s.lastProperty=!0,s.lineWhereToAddComma=m,s.indexWhereToAddComa=d,a=s,s=s?s.parent:void 0,i=s),r.endLineNumber=p,g=p+1;break}case 2:{p=n.getTokenStartLine(),y.pop(),h!==1&&(s.endLineNumber===void 0&&(s.endLineNumber=p-1,s.lastProperty=!0,s.lineWhereToAddComma=m,s.indexWhereToAddComa=d),a=s,s=s?s.parent:void 0,i=s),r.endLineNumber=n.getTokenStartLine(),g=p+1;break}case 5:{p=n.getTokenStartLine(),s.endLineNumber===void 0&&(y[y.length-1]===ie.Object||y[y.length-1]===ie.Array&&(h===2||h===4))&&(s.endLineNumber=p,s.commaIndex=n.getTokenOffset()-u,s.commaLine=p),(h===2||h===4)&&(a=s,s=s?s.parent:void 0,i=s),g=p+1;break}case 13:{h===5&&m===n.getTokenStartLine()&&(y[y.length-1]===ie.Array&&(c===2||c===4)||y[y.length-1]===ie.Object)&&(y[y.length-1]===ie.Array&&(c===2||c===4)||y[y.length-1]===ie.Object)&&(s.endLineNumber=void 0,w=!0),(h===1||h===3)&&m===n.getTokenStartLine()&&(_=!0);break}}l!==14&&l!==13&&l!==12&&l!==15&&(c=h,h=l,m=n.getTokenStartLine(),d=n.getTokenOffset()+n.getTokenLength()-u)}return r}function l1(e,t){if(t.childrenProperties.length===0)return e;const n=Ee.create("test://test.json","json",0,e.getText()),r=[];for(xo(r,t,t.beginningLineNumber);r.length>0;){const i=r.shift(),s=i.propertyTreeArray;let a=i.beginningLineNumber;for(let l=0;l<s.length;l++){const o=s[l],u=q.create(Y.create(o.beginningLineNumber,0),Y.create(o.endLineNumber+1,0)),h=e.getText(u),c=Ee.create("test://test.json","json",0,h);if(o.lastProperty