~ K    A     L    I ~
UNAME : Linux web65.extendcp.co.uk 4.18.0-553.56.1.el8_10.x86_64 #1 SMP Tue Jun 10 05:00:59 EDT 2025 x86_64
SERVER IP : 10.0.187.65 -________- CLIENT IP : 216.73.216.254
PATH :/usr/share/maxscale/gui/js/
UP FILE :
MINI SHELL D ZAB '
Current File : //usr/share/maxscale/gui/js/npm.monaco-editor~12be0fc8.4b7af259.js
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["npm.monaco-editor~12be0fc8"],{3723:function(e,t,i){"use strict";var s=i("561a"),o=i("dff7"),n=i("303e"),r=i("b7d0");const l=Object(n["Jc"])("symbolIcon.arrayForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),d=Object(n["Jc"])("symbolIcon.booleanForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),a=Object(n["Jc"])("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hc:"#EE9D28"},Object(o["a"])("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),c=Object(n["Jc"])("symbolIcon.colorForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),h=Object(n["Jc"])("symbolIcon.constantForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),g=Object(n["Jc"])("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hc:"#B180D7"},Object(o["a"])("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),u=Object(n["Jc"])("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hc:"#EE9D28"},Object(o["a"])("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),p=Object(n["Jc"])("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},Object(o["a"])("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),b=Object(n["Jc"])("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hc:"#EE9D28"},Object(o["a"])("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),m=Object(n["Jc"])("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},Object(o["a"])("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),_=Object(n["Jc"])("symbolIcon.fileForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),f=Object(n["Jc"])("symbolIcon.folderForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),y=Object(n["Jc"])("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hc:"#B180D7"},Object(o["a"])("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),S=Object(n["Jc"])("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},Object(o["a"])("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),v=Object(n["Jc"])("symbolIcon.keyForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),w=Object(n["Jc"])("symbolIcon.keywordForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),x=Object(n["Jc"])("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hc:"#B180D7"},Object(o["a"])("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),O=Object(n["Jc"])("symbolIcon.moduleForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),C=Object(n["Jc"])("symbolIcon.namespaceForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),D=Object(n["Jc"])("symbolIcon.nullForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),T=Object(n["Jc"])("symbolIcon.numberForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),I=Object(n["Jc"])("symbolIcon.objectForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),k=Object(n["Jc"])("symbolIcon.operatorForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),j=Object(n["Jc"])("symbolIcon.packageForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),F=Object(n["Jc"])("symbolIcon.propertyForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),L=Object(n["Jc"])("symbolIcon.referenceForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),M=Object(n["Jc"])("symbolIcon.snippetForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),P=Object(n["Jc"])("symbolIcon.stringForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),N=Object(n["Jc"])("symbolIcon.structForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),R=Object(n["Jc"])("symbolIcon.textForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),E=Object(n["Jc"])("symbolIcon.typeParameterForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),W=Object(n["Jc"])("symbolIcon.unitForeground",{dark:n["pb"],light:n["pb"],hc:n["pb"]},Object(o["a"])("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),A=Object(n["Jc"])("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},Object(o["a"])("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));Object(r["f"])((e,t)=>{const i=e.getColor(l);i&&t.addRule(`${s["b"].symbolArray.cssSelector} { color: ${i}; }`);const o=e.getColor(d);o&&t.addRule(`${s["b"].symbolBoolean.cssSelector} { color: ${o}; }`);const n=e.getColor(a);n&&t.addRule(`${s["b"].symbolClass.cssSelector} { color: ${n}; }`);const r=e.getColor(x);r&&t.addRule(`${s["b"].symbolMethod.cssSelector} { color: ${r}; }`);const z=e.getColor(c);z&&t.addRule(`${s["b"].symbolColor.cssSelector} { color: ${z}; }`);const $=e.getColor(h);$&&t.addRule(`${s["b"].symbolConstant.cssSelector} { color: ${$}; }`);const H=e.getColor(g);H&&t.addRule(`${s["b"].symbolConstructor.cssSelector} { color: ${H}; }`);const V=e.getColor(u);V&&t.addRule(`\n\t\t\t${s["b"].symbolValue.cssSelector},${s["b"].symbolEnum.cssSelector} { color: ${V}; }`);const B=e.getColor(p);B&&t.addRule(`${s["b"].symbolEnumMember.cssSelector} { color: ${B}; }`);const q=e.getColor(b);q&&t.addRule(`${s["b"].symbolEvent.cssSelector} { color: ${q}; }`);const J=e.getColor(m);J&&t.addRule(`${s["b"].symbolField.cssSelector} { color: ${J}; }`);const K=e.getColor(_);K&&t.addRule(`${s["b"].symbolFile.cssSelector} { color: ${K}; }`);const U=e.getColor(f);U&&t.addRule(`${s["b"].symbolFolder.cssSelector} { color: ${U}; }`);const G=e.getColor(y);G&&t.addRule(`${s["b"].symbolFunction.cssSelector} { color: ${G}; }`);const Q=e.getColor(S);Q&&t.addRule(`${s["b"].symbolInterface.cssSelector} { color: ${Q}; }`);const X=e.getColor(v);X&&t.addRule(`${s["b"].symbolKey.cssSelector} { color: ${X}; }`);const Y=e.getColor(w);Y&&t.addRule(`${s["b"].symbolKeyword.cssSelector} { color: ${Y}; }`);const Z=e.getColor(O);Z&&t.addRule(`${s["b"].symbolModule.cssSelector} { color: ${Z}; }`);const ee=e.getColor(C);ee&&t.addRule(`${s["b"].symbolNamespace.cssSelector} { color: ${ee}; }`);const te=e.getColor(D);te&&t.addRule(`${s["b"].symbolNull.cssSelector} { color: ${te}; }`);const ie=e.getColor(T);ie&&t.addRule(`${s["b"].symbolNumber.cssSelector} { color: ${ie}; }`);const se=e.getColor(I);se&&t.addRule(`${s["b"].symbolObject.cssSelector} { color: ${se}; }`);const oe=e.getColor(k);oe&&t.addRule(`${s["b"].symbolOperator.cssSelector} { color: ${oe}; }`);const ne=e.getColor(j);ne&&t.addRule(`${s["b"].symbolPackage.cssSelector} { color: ${ne}; }`);const re=e.getColor(F);re&&t.addRule(`${s["b"].symbolProperty.cssSelector} { color: ${re}; }`);const le=e.getColor(L);le&&t.addRule(`${s["b"].symbolReference.cssSelector} { color: ${le}; }`);const de=e.getColor(M);de&&t.addRule(`${s["b"].symbolSnippet.cssSelector} { color: ${de}; }`);const ae=e.getColor(P);ae&&t.addRule(`${s["b"].symbolString.cssSelector} { color: ${ae}; }`);const ce=e.getColor(N);ce&&t.addRule(`${s["b"].symbolStruct.cssSelector} { color: ${ce}; }`);const he=e.getColor(R);he&&t.addRule(`${s["b"].symbolText.cssSelector} { color: ${he}; }`);const ge=e.getColor(E);ge&&t.addRule(`${s["b"].symbolTypeParameter.cssSelector} { color: ${ge}; }`);const ue=e.getColor(W);ue&&t.addRule(`${s["b"].symbolUnit.cssSelector} { color: ${ue}; }`);const pe=e.getColor(A);pe&&t.addRule(`${s["b"].symbolVariable.cssSelector} { color: ${pe}; }`)})},"4ef0":function(e,t,i){"use strict";i.d(t,"b",(function(){return v})),i.d(t,"g",(function(){return w})),i.d(t,"a",(function(){return O})),i.d(t,"c",(function(){return D})),i.d(t,"e",(function(){return I})),i.d(t,"d",(function(){return M})),i.d(t,"f",(function(){return R}));var s=i("2504"),o=i("fdcc"),n=i("7e93"),r=i("a666"),l=i("e58e"),d=i("ef8e"),a=i("6d8e"),c=i("7061"),h=i("6a89"),g=i("b78f"),u=i("7ef3"),p=i("dff7"),b=i("7e32"),m=i("9e74"),_=i("4fc3"),f=i("7340"),y=i("dc5a"),S=function(e,t,i,s){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,n){function r(e){try{d(s.next(e))}catch(t){n(t)}}function l(e){try{d(s["throw"](e))}catch(t){n(t)}}function d(e){e.done?i(e.value):o(e.value).then(r,l)}d((s=s.apply(e,t||[])).next())}))};const v={Visible:y["c"],DetailsVisible:new _["c"]("suggestWidgetDetailsVisible",!1,Object(p["a"])("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new _["c"]("suggestWidgetMultipleSuggestions",!1,Object(p["a"])("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new _["c"]("suggestionMakesTextEdit",!0,Object(p["a"])("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new _["c"]("acceptSuggestionOnEnter",!0,Object(p["a"])("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new _["c"]("suggestionHasInsertAndReplaceRange",!1,Object(p["a"])("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new _["c"]("suggestionInsertMode",void 0,{type:"string",description:Object(p["a"])("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new _["c"]("suggestionCanResolve",!1,Object(p["a"])("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},w=new b["b"]("suggestWidgetStatusBar");class x{constructor(e,t,i,s){this.position=e,this.completion=t,this.container=i,this.provider=s,this.isInvalid=!1,this.score=n["a"].Default,this.distance=0,this.textLabel="string"===typeof t.label?t.label:t.label.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),h["a"].isIRange(t.range)?(this.editStart=new c["a"](t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new c["a"](t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new c["a"](t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||h["a"].spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new c["a"](t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new c["a"](t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new c["a"](t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||h["a"].spansMultipleLines(t.range.insert)||h["a"].spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),"function"!==typeof s.resolveCompletionItem&&(this._resolveCache=Promise.resolve(),this._isResolved=!0)}get isResolved(){return!!this._isResolved}resolve(e){return S(this,void 0,void 0,(function*(){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._isResolved=!1});this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(e=>{Object.assign(this.completion,e),this._isResolved=!0,t.dispose()},e=>{Object(o["f"])(e)&&(this._resolveCache=void 0,this._isResolved=!1)})}return this._resolveCache}))}}class O{constructor(e=2,t=new Set,i=new Set,s=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.showDeprecated=s}}let C;function D(){return C}O.default=new O;class T{constructor(e,t,i,s){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=s}}function I(e,t,i,n=O.default,d={triggerKind:0},a=s["a"].None){return S(this,void 0,void 0,(function*(){const s=new l["a"](!0);i=i.clone();const c=t.getWordAtPosition(i),g=c?new h["a"](i.lineNumber,c.startColumn,i.lineNumber,c.endColumn):h["a"].fromPositions(i),p={replace:g,insert:g.setEndPosition(i.lineNumber,i.column)},b=[],m=new r["b"],_=[];let f=!1;const y=(e,t,s)=>{var o,l,d;let a=!1;if(!t)return a;for(let r of t.suggestions)if(!n.kindFilter.has(r.kind)){if(!n.showDeprecated&&(null===(o=null===r||void 0===r?void 0:r.tags)||void 0===o?void 0:o.includes(1)))continue;r.range||(r.range=p),r.sortText||(r.sortText="string"===typeof r.label?r.label:r.label.label),!f&&r.insertTextRules&&4&r.insertTextRules&&(f=u["c"].guessNeedsClipboard(r.insertText)),b.push(new x(i,r,t,e)),a=!0}return Object(r["h"])(t)&&m.add(t),_.push({providerName:null!==(l=e._debugDisplayName)&&void 0!==l?l:"unknown_provider",elapsedProvider:null!==(d=t.duration)&&void 0!==d?d:-1,elapsedOverall:s.elapsed()}),a},v=(()=>S(this,void 0,void 0,(function*(){if(!C||n.kindFilter.has(27))return;if(n.providerFilter.size>0&&!n.providerFilter.has(C))return;const e=new l["a"](!0),s=yield C.provideCompletionItems(t,i,d,a);y(C,s,e)})))();for(let r of e.orderedGroups(t)){let e=!1;if(yield Promise.all(r.map(s=>S(this,void 0,void 0,(function*(){if(!(n.providerFilter.size>0)||n.providerFilter.has(s))try{const o=new l["a"](!0),n=yield s.provideCompletionItems(t,i,d,a);e=y(s,n,o)||e}catch(r){Object(o["h"])(r)}})))),e||a.isCancellationRequested)break}return yield v,a.isCancellationRequested?(m.dispose(),Promise.reject(Object(o["c"])())):new T(b.sort(M(n.snippetSortOrder)),f,{entries:_,elapsed:s.elapsed()},m)}))}function k(e,t){if(e.sortTextLow&&t.sortTextLow){if(e.sortTextLow<t.sortTextLow)return-1;if(e.sortTextLow>t.sortTextLow)return 1}return e.completion.label<t.completion.label?-1:e.completion.label>t.completion.label?1:e.completion.kind-t.completion.kind}function j(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return-1;if(27===t.completion.kind)return 1}return k(e,t)}function F(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return 1;if(27===t.completion.kind)return-1}return k(e,t)}const L=new Map;function M(e){return L.get(e)}let P;L.set(0,j),L.set(2,F),L.set(1,k),m["a"].registerCommand("_executeCompletionItemProvider",(e,...t)=>S(void 0,void 0,void 0,(function*(){const[i,o,n,r]=t;Object(d["c"])(a["a"].isUri(i)),Object(d["c"])(c["a"].isIPosition(o)),Object(d["c"])("string"===typeof n||!n),Object(d["c"])("number"===typeof r||!r);const{completionProvider:l}=e.get(f["a"]),h=yield e.get(g["a"]).createModelReference(i);try{const e={incomplete:!1,suggestions:[]},t=[],i=yield I(l,h.object.textEditorModel,c["a"].lift(o),void 0,{triggerCharacter:n,triggerKind:n?1:0});for(const o of i.items)t.length<(null!==r&&void 0!==r?r:0)&&t.push(o.resolve(s["a"].None)),e.incomplete=e.incomplete||o.container.incomplete,e.suggestions.push(o.completion);try{return yield Promise.all(t),e}finally{setTimeout(()=>i.disposable.dispose(),100)}}finally{h.dispose()}})));let N=[];function R(e,t,i){const{completionProvider:s}=e.get(f["a"]);P||(P=new class{provideCompletionItems(){let e=N.slice(0),t={suggestions:e};return N.length=0,t}},s.register("*",P)),setTimeout(()=>{var e;N.push(...i),null===(e=t.getContribution("editor.contrib.suggestController"))||void 0===e||e.triggerSuggest((new Set).add(P))},0)}},"90db":function(e,t,i){"use strict";i.r(t),i.d(t,"SuggestController",(function(){return mt})),i.d(t,"TriggerSuggestAction",(function(){return ft}));var s=i("3813"),o=i("e8e3"),n=i("5fe7"),r=i("2504"),l=i("fdcc"),d=i("308f"),a=i("4b37"),c=i("a666"),h=i("30db"),g=i("e58e"),u=i("ef8e"),p=i("3907"),b=i("b2cc"),m=i("d3f4"),_=i("7061"),f=i("6a89"),y=i("c101"),S=i("b6c7"),v=i("7ef3"),w=i("4035"),x=i("2e5a"),O=i("fbba"),C=i("f5f3"),D=i("0a0f"),T=i("03e8"),I=function(e,t,i,s){var o,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},k=function(e,t){return function(i,s){t(i,s,e)}};class j{constructor(e){this.name=e}select(e,t,i){if(0===i.length)return 0;let s=i[0].score[0];for(let o=0;o<i.length;o++){const{score:e,completion:t}=i[o];if(e[0]!==s)break;if(t.preselect)return o}return 0}}class F extends j{constructor(){super("first")}memorize(e,t,i){}toJSON(){}fromJSON(){}}class L extends j{constructor(){super("recentlyUsed"),this._cache=new w["a"](300,.66),this._seq=0}memorize(e,t,i){const s=`${e.getLanguageId()}/${i.textLabel}`;this._cache.set(s,{touch:this._seq++,type:i.completion.kind,insertText:i.completion.insertText})}select(e,t,i){if(0===i.length)return 0;const s=e.getLineContent(t.lineNumber).substr(t.column-10,t.column-1);if(/\s$/.test(s))return super.select(e,t,i);let o=i[0].score[0],n=-1,r=-1,l=-1;for(let d=0;d<i.length;d++){if(i[d].score[0]!==o)break;const t=`${e.getLanguageId()}/${i[d].textLabel}`,s=this._cache.peek(t);if(s&&s.touch>l&&s.type===i[d].completion.kind&&s.insertText===i[d].completion.insertText&&(l=s.touch,r=d),i[d].completion.preselect&&-1===n)return d}return-1!==r?r:-1!==n?n:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();let t=0;for(const[i,s]of e)s.touch=t,s.type="number"===typeof s.type?s.type:x["b"].fromString(s.type),this._cache.set(i,s);this._seq=this._cache.size}}class M extends j{constructor(){super("recentlyUsedByPrefix"),this._trie=w["c"].forStrings(),this._seq=0}memorize(e,t,i){const{word:s}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${s}`;this._trie.set(o,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){let{word:s}=e.getWordUntilPosition(t);if(!s)return super.select(e,t,i);let o=`${e.getLanguageId()}/${s}`,n=this._trie.get(o);if(n||(n=this._trie.findSubstr(o)),n)for(let r=0;r<i.length;r++){let{kind:e,insertText:t}=i[r].completion;if(e===n.type&&t===n.insertText)return r}return super.select(e,t,i)}toJSON(){let e=[];return this._trie.forEach((t,i)=>e.push([i,t])),e.sort((e,t)=>-(e[1].touch-t[1].touch)).forEach((e,t)=>e[1].touch=t),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type="number"===typeof i.type?i.type:x["b"].fromString(i.type),this._trie.set(t,i)}}}let P=class e{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new c["b"],this._persistSoon=new n["h"](()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(e=>{e.reason===T["c"].SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(t,i){var s;const o=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:t.getLanguageIdAtPosition(i.lineNumber,i.column),resource:t.uri});if((null===(s=this._strategy)||void 0===s?void 0:s.name)!==o){this._saveState();const t=e._strategyCtors.get(o)||F;this._strategy=new t;try{const t=this._configService.getValue("editor.suggest.shareSuggestSelections"),i=t?0:1,s=this._storageService.get(`${e._storagePrefix}/${o}`,i);s&&this._strategy.fromJSON(JSON.parse(s))}catch(n){}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections"),i=t?0:1,s=JSON.stringify(this._strategy);this._storageService.store(`${e._storagePrefix}/${this._strategy.name}`,s,i,1)}}};P._strategyCtors=new Map([["recentlyUsedByPrefix",M],["recentlyUsed",L],["first",F]]),P._storagePrefix="suggest/memories",P=I([k(0,T["a"]),k(1,O["a"])],P);const N=Object(D["c"])("ISuggestMemories");Object(C["b"])(N,P,!0);var R=i("4fc3"),E=function(e,t,i,s){var o,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},W=function(e,t){return function(i,s){t(i,s,e)}};let A=class e{constructor(t,i){this._editor=t,this._enabled=!1,this._ckAtEnd=e.AtEnd.bindTo(i),this._configListener=this._editor.onDidChangeConfiguration(e=>e.hasChanged(111)&&this._update()),this._update()}dispose(){var e;this._configListener.dispose(),null===(e=this._selectionListener)||void 0===e||e.dispose(),this._ckAtEnd.reset()}_update(){const e="on"===this._editor.getOption(111);if(this._enabled!==e)if(this._enabled=e,this._enabled){const e=()=>{if(!this._editor.hasModel())return void this._ckAtEnd.set(!1);const e=this._editor.getModel(),t=this._editor.getSelection(),i=e.getWordAtPosition(t.getStartPosition());i?this._ckAtEnd.set(i.endColumn===t.getStartPosition().column):this._ckAtEnd.set(!1)};this._selectionListener=this._editor.onDidChangeCursorSelection(e),e()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};A.AtEnd=new R["c"]("atEndOfWord",!1),A=E([W(1,R["b"])],A);var z=i("dff7"),$=i("7e32"),H=i("9e74"),V=i("9eb8"),B=i("d3d7"),q=i("4ef0"),J=function(e,t,i,s){var o,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},K=function(e,t){return function(i,s){t(i,s,e)}};let U=class e{constructor(t,i){this._editor=t,this._index=0,this._ckOtherSuggestions=e.OtherSuggestions.bindTo(i)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),null===(e=this._listener)||void 0===e||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:t,index:i},s){if(0===t.items.length)return void this.reset();let o=e._moveIndex(!0,t,i);o!==i?(this._acceptNext=s,this._model=t,this._index=i,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)):this.reset()}static _moveIndex(e,t,i){let s=i;while(1){if(s=(s+t.items.length+(e?1:-1))%t.items.length,s===i)break;if(!t.items[s].completion.additionalTextEdits)break}return s}next(){this._move(!0)}prev(){this._move(!1)}_move(t){if(this._model)try{this._ignore=!0,this._index=e._moveIndex(t,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};U.OtherSuggestions=new R["c"]("hasOtherSuggestions",!1),U=J([K(1,R["b"])],U);var G=i("3170");class Q{constructor(e,t,i){this._disposables=new c["b"],this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(s=>{if(this._active&&!t.isFrozen()){const t=s.charCodeAt(s.length-1);this._active.acceptCharacters.has(t)&&e.getOption(0)&&i(this._active.item)}}))}_onItem(e){if(!e||!Object(o["r"])(e.item.completion.commitCharacters))return void this.reset();if(this._active&&this._active.item.item===e.item)return;const t=new G["b"];for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}var X=i("3742"),Y=i("8025"),Z=i("09db"),ee=i("1341"),te=function(e,t,i,s){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,n){function r(e){try{d(s.next(e))}catch(t){n(t)}}function l(e){try{d(s["throw"](e))}catch(t){n(t)}}function d(e){e.done?i(e.value):o(e.value).then(r,l)}d((s=s.apply(e,t||[])).next())}))};class ie{static create(e,t){return te(this,void 0,void 0,(function*(){if(!t.getOption(106).localityBonus)return ie.None;if(!t.hasModel())return ie.None;const i=t.getModel(),s=t.getPosition();if(!e.canComputeWordRanges(i.uri))return ie.None;const[n]=yield(new ee["a"]).provideSelectionRanges(i,[s]);if(0===n.length)return ie.None;const r=yield e.computeWordRanges(i.uri,n[0].range);if(!r)return ie.None;const l=i.getWordUntilPosition(s);return delete r[l.word],new class extends ie{distance(e,i){if(!s.equals(t.getPosition()))return 0;if(17===i.kind)return 2<<20;let l="string"===typeof i.label?i.label:i.label.label,d=r[l];if(Object(o["q"])(d))return 2<<20;let a=Object(o["d"])(d,f["a"].fromPositions(e),f["a"].compareRangesUsingStarts),c=a>=0?d[a]:d[Math.max(0,~a-1)],h=n.length;for(const t of n){if(!f["a"].containsRange(t.range,c))break;h-=1}return h}}}))}}ie.None=new class extends ie{distance(){return 0}};var se=i("f577"),oe=i("5d75"),ne=i("41e7"),re=i("7340"),le=function(e,t,i,s){var o,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},de=function(e,t){return function(i,s){t(i,s,e)}},ae=function(e,t,i,s){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,n){function r(e){try{d(s.next(e))}catch(t){n(t)}}function l(e){try{d(s["throw"](e))}catch(t){n(t)}}function d(e){e.done?i(e.value):o(e.value).then(r,l)}d((s=s.apply(e,t||[])).next())}))};class ce{constructor(e,t,i,s){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.auto=i,this.shy=s}static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenizeIfCheap(i.lineNumber);const s=t.getWordAtPosition(i);return!!s&&(s.endColumn===i.column&&!!isNaN(Number(s.word)))}}function he(e,t,i){if(!Boolean(t.getContextKeyValue("inlineSuggestionVisible")))return!0;const s=i.getValue("editor.inlineSuggest.allowQuickSuggestions");return void 0!==s&&Boolean(s)}function ge(e,t,i){if(!Boolean(t.getContextKeyValue("inlineSuggestionVisible")))return!0;const s=i.getValue("editor.inlineSuggest.allowSuggestOnTriggerCharacters");return void 0!==s&&Boolean(s)}let ue=class e{constructor(e,t,i,s,o,r,l,a){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=s,this._logService=o,this._contextKeyService=r,this._configurationService=l,this._languageFeaturesService=a,this._toDispose=new c["b"],this._quickSuggestDelay=10,this._triggerCharacterListener=new c["b"],this._triggerQuickSuggest=new n["j"],this._state=0,this._completionDisposables=new c["b"],this._onDidCancel=new d["b"],this._onDidTrigger=new d["b"],this._onDidSuggest=new d["b"],this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new Y["a"](1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters(),this._updateQuickSuggest()})),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()}));let h=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{h=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{h=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(e=>{h||this._onCursorChange(e)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{h||this._refilterCompletionItems()})),this._updateTriggerCharacters(),this._updateQuickSuggest()}dispose(){Object(c["g"])(this._triggerCharacterListener),Object(c["g"])([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateQuickSuggest(){this._quickSuggestDelay=this._editor.getOption(80),(isNaN(this._quickSuggestDelay)||!this._quickSuggestDelay&&0!==this._quickSuggestDelay||this._quickSuggestDelay<0)&&(this._quickSuggestDelay=10)}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(81)||!this._editor.hasModel()||!this._editor.getOption(109))return;const e=new Map;for(const i of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const t of i.triggerCharacters||[]){let s=e.get(t);s||(s=new Set,s.add(Object(q["c"])()),e.set(t,s)),s.add(i)}const t=t=>{if(!ge(this._editor,this._contextKeyService,this._configurationService))return;if(ce.shouldAutoTrigger(this._editor))return;if(!t){const e=this._editor.getPosition(),i=this._editor.getModel();t=i.getLineContent(e.lineNumber).substr(0,e.column-1)}let i="";Object(X["F"])(t.charCodeAt(t.length-1))?Object(X["E"])(t.charCodeAt(t.length-2))&&(i=t.substr(t.length-2)):i=t.charAt(t.length-1);const s=e.get(i);if(s){const e=this._completionModel?{items:this._completionModel.adopt(s),clipboardText:this._completionModel.clipboardText}:void 0;this.trigger({auto:!0,shy:!1,triggerCharacter:i},Boolean(this._completionModel),s,e)}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._state}cancel(e=!1){var t;0!==this._state&&(this._triggerQuickSuggest.cancel(),null===(t=this._requestToken)||void 0===t||t.cancel(),this._requestToken=void 0,this._state=0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){0!==this._state&&(this._editor.hasModel()&&this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.trigger({auto:2===this._state,shy:!1},!0):this.cancel())}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||0!==e.reason&&3!==e.reason||"keyboard"!==e.source&&"deleteLeft"!==e.source?this.cancel():0===this._state&&0===e.reason?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():0!==this._state&&3===e.reason&&this._refilterCompletionItems()}_onCompositionEnd(){0===this._state?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){var e;!1!==this._editor.getOption(79)&&(this._editor.getOption(106).snippetsPreventQuickSuggestions&&(null===(e=S["SnippetController2"].get(this._editor))||void 0===e?void 0:e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(0!==this._state)return;if(!ce.shouldAutoTrigger(this._editor))return;if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=this._editor.getOption(79);if(!1!==i){if(!0===i);else{e.tokenizeIfCheap(t.lineNumber);const s=e.getLineTokens(t.lineNumber),o=s.getStandardTokenType(s.findTokenIndexAtOffset(Math.max(t.column-1-1,0))),n=i.other&&0===o||i.comments&&1===o||i.strings&&2===o;if(!n)return}he(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(e)&&this.trigger({auto:!0,shy:!1})}},this._quickSuggestDelay)))}_refilterCompletionItems(){Promise.resolve().then(()=>{if(0===this._state)return;if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=new ce(e,t,2===this._state,!1);this._onNewContext(i)})}trigger(t,i=!1,s,o){var n;if(!this._editor.hasModel())return;const d=this._editor.getModel(),a=t.auto,c=new ce(d,this._editor.getPosition(),a,t.shy);this.cancel(i),this._state=a?2:1,this._onDidTrigger.fire({auto:a,shy:t.shy,position:this._editor.getPosition()}),this._context=c;let h={triggerKind:null!==(n=t.triggerKind)&&void 0!==n?n:0};t.triggerCharacter&&(h={triggerKind:1,triggerCharacter:t.triggerCharacter}),this._requestToken=new r["b"];const g=this._editor.getOption(101);let u=1;switch(g){case"top":u=0;break;case"bottom":u=2;break}const{itemKind:p,showDeprecated:b}=e._createSuggestFilter(this._editor),m=ie.create(this._editorWorkerService,this._editor),_=Object(q["e"])(this._languageFeaturesService.completionProvider,d,this._editor.getPosition(),new q["a"](u,p,s,b),h,this._requestToken.token);Promise.all([_,m]).then(([e,i])=>ae(this,void 0,void 0,(function*(){var s;if(null===(s=this._requestToken)||void 0===s||s.dispose(),!this._editor.hasModel())return;let n=null===o||void 0===o?void 0:o.clipboardText;if(!n&&e.needsClipboard&&(n=yield this._clipboardService.readText()),0===this._state)return;const r=this._editor.getModel();let l=e.items;if(o){const e=Object(q["d"])(u);l=l.concat(o.items).sort(e)}const d=new ce(r,this._editor.getPosition(),a,t.shy);this._completionModel=new ne["a"](l,this._context.column,{leadingLineContent:d.leadingLineContent,characterCountDelta:d.column-this._context.column},i,this._editor.getOption(106),this._editor.getOption(101),n),this._completionDisposables.add(e.disposable),this._onNewContext(d),this._reportDurationsTelemetry(e.durations)}))).catch(l["g"])}_reportDurationsTelemetry(e){this._telemetryGate++%230===0&&setTimeout(()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)})}static _createSuggestFilter(e){const t=new Set,i=e.getOption(101);"none"===i&&t.add(27);const s=e.getOption(106);return s.showMethods||t.add(0),s.showFunctions||t.add(1),s.showConstructors||t.add(2),s.showFields||t.add(3),s.showVariables||t.add(4),s.showClasses||t.add(5),s.showStructs||t.add(6),s.showInterfaces||t.add(7),s.showModules||t.add(8),s.showProperties||t.add(9),s.showEvents||t.add(10),s.showOperators||t.add(11),s.showUnits||t.add(12),s.showValues||t.add(13),s.showConstants||t.add(14),s.showEnums||t.add(15),s.showEnumMembers||t.add(16),s.showKeywords||t.add(17),s.showWords||t.add(18),s.showColors||t.add(19),s.showFiles||t.add(20),s.showReferences||t.add(21),s.showColors||t.add(22),s.showFolders||t.add(23),s.showTypeParameters||t.add(24),s.showSnippets||t.add(27),s.showUsers||t.add(25),s.showIssues||t.add(26),{itemKind:t,showDeprecated:s.showDeprecated}}_onNewContext(e){if(this._context)if(e.lineNumber===this._context.lineNumber)if(Object(X["x"])(e.leadingLineContent)===Object(X["x"])(this._context.leadingLineContent)){if(e.column<this._context.column)e.leadingWord.word?this.trigger({auto:this._context.auto,shy:!1},!0):this.cancel();else if(this._completionModel)if(0!==e.leadingWord.word.length&&e.leadingWord.startColumn>this._context.leadingWord.startColumn){const e=new Set(this._languageFeaturesService.completionProvider.all(this._editor.getModel()));for(let i of this._completionModel.allProvider)e.delete(i);const t=this._completionModel.adopt(new Set);this.trigger({auto:this._context.auto,shy:!1},!0,e,{items:t,clipboardText:this._completionModel.clipboardText})}else if(e.column>this._context.column&&this._completionModel.incomplete.size>0&&0!==e.leadingWord.word.length){const{incomplete:e}=this._completionModel,t=this._completionModel.adopt(e);this.trigger({auto:2===this._state,shy:!1,triggerKind:2},!0,e,{items:t,clipboardText:this._completionModel.clipboardText})}else{let t=this._completionModel.lineContext,i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},0===this._completionModel.items.length){if(ce.shouldAutoTrigger(this._editor)&&this._context.leadingWord.endColumn<e.leadingWord.startColumn)return void this.trigger({auto:this._context.auto,shy:!1},!0);if(this._context.auto)return void this.cancel();if(this._completionModel.lineContext=t,i=this._completionModel.items.length>0,i&&0===e.leadingWord.word.length)return void this.cancel()}this._onDidSuggest.fire({completionModel:this._completionModel,auto:this._context.auto,shy:this._context.shy,isFrozen:i})}}else this.cancel();else this.cancel()}};ue=le([de(1,Z["a"]),de(2,se["a"]),de(3,oe["a"]),de(4,B["b"]),de(5,R["b"]),de(6,O["a"]),de(7,re["a"])],ue);class pe{constructor(e,t){this._disposables=new c["b"],this._lastOvertyped=[],this._empty=!0,this._disposables.add(e.onWillType(()=>{if(!this._empty)return;if(!e.hasModel())return;const t=e.getSelections(),i=t.length;let s=!1;for(let e=0;e<i;e++)if(!t[e].isEmpty()){s=!0;break}if(!s)return;this._lastOvertyped=[];const o=e.getModel();for(let e=0;e<i;e++){const i=t[e];if(o.getValueLengthInRange(i)>pe._maxSelectionLength)return;this._lastOvertyped[e]={value:o.getValueInRange(i),multiline:i.startLineNumber!==i.endLineNumber}}this._empty=!1})),this._disposables.add(t.onDidCancel(e=>{this._empty||e.retrigger||(this._empty=!0)}))}getLastOvertypedInfo(e){if(!this._empty&&e>=0&&e<this._lastOvertyped.length)return this._lastOvertyped[e]}dispose(){this._disposables.dispose()}}pe._maxSelectionLength=51200;var be=i("11f7"),me=(i("b9db"),i("72a7")),_e=i("49d9"),fe=(i("a582"),i("d379")),ye=i("5aa5"),Se=i("7944"),ve=function(e,t,i,s){var o,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},we=function(e,t){return function(i,s){t(i,s,e)}};class xe extends Se["a"]{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=Object(z["a"])("ddd","{0} ({1})",this._action.label,xe.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return null===(t=e.getLabel())||void 0===t?void 0:t.replace(/\benter\b/gi,"⏎")}}let Oe=class{constructor(e,t,i,s){this._menuService=i,this._contextKeyService=s,this._menuDisposables=new c["b"],this.element=be["q"](e,be["a"](".suggest-status-bar"));const o=e=>e instanceof $["c"]?t.createInstance(xe,e,void 0):void 0;this._leftActions=new ye["a"](this.element,{actionViewItemProvider:o}),this._rightActions=new ye["a"](this.element,{actionViewItemProvider:o}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(q["g"],this._contextKeyService),t=()=>{const t=[],i=[];for(let[s,o]of e.getActions())"left"===s?t.push(...o):i.push(...o);this._leftActions.clear(),this._leftActions.push(t),this._rightActions.clear(),this._rightActions.push(i)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};Oe=ve([we(1,D["a"]),we(2,$["a"]),we(3,R["b"])],Oe);i("3723");var Ce=i("303e"),De=i("a6d7"),Te=i("b7d0"),Ie=i("89ff"),ke=i("0f70"),je=i("1898"),Fe=i("561a"),Le=i("78bc"),Me=i("85c1"),Pe=i("fd49"),Ne=function(e,t,i,s){var o,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},Re=function(e,t){return function(i,s){t(i,s,e)}};function Ee(e){return!!e&&Boolean(e.completion.documentation||e.completion.detail&&e.completion.detail!==e.completion.label)}let We=class{constructor(e,t){this._editor=e,this._onDidClose=new d["b"],this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new d["b"],this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new c["b"],this._renderDisposeable=new c["b"],this._borderWidth=1,this._size=new be["b"](330,0),this.domNode=be["a"](".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(Me["a"],{editor:e}),this._body=be["a"](".body"),this._scrollbar=new je["a"](this._body,{}),be["q"](this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=be["q"](this._body,be["a"](".header")),this._close=be["q"](this._header,be["a"]("span"+Fe["b"].close.cssSelector)),this._close.title=z["a"]("details.close","Close"),this._type=be["q"](this._header,be["a"]("p.type")),this._docs=be["q"](this._body,be["a"]("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(44)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(44),i=t.getMassagedFontFamily(ke["isSafari"]?Pe["d"].fontFamily:null),s=e.get(107)||t.fontSize,o=e.get(108)||t.lineHeight,n=t.fontWeight,r=s+"px",l=o+"px";this.domNode.style.fontSize=r,this.domNode.style.lineHeight=""+o/s,this.domNode.style.fontWeight=n,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=l,this._close.style.width=l}getLayoutInfo(){const e=this._editor.getOption(108)||this._editor.getOption(44).lineHeight,t=this._borderWidth,i=2*t;return{lineHeight:e,borderWidth:t,borderHeight:i,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=z["a"]("loading","Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,2*this.getLayoutInfo().lineHeight),this._onDidChangeContents.fire(this)}renderItem(e,t){var i,s;this._renderDisposeable.clear();let{detail:o,documentation:n}=e.completion;if(t){let t="";t+=`score: ${e.score[0]}\n`,t+=`prefix: ${null!==(i=e.word)&&void 0!==i?i:"(no prefix)"}\n`,t+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel}\n`,t+=`distance: ${e.distance} (localityBonus-setting)\n`,t+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"}\n`,t+=`commit_chars: ${null===(s=e.completion.commitCharacters)||void 0===s?void 0:s.join("")}\n`,n=(new Le["a"]).appendCodeblock("empty",t),o="Provider: "+e.provider._debugDisplayName}if(t||Ee(e)){if(this.domNode.classList.remove("no-docs","no-type"),o){const e=o.length>1e5?o.substr(0,1e5)+"…":o;this._type.textContent=e,this._type.title=e,be["X"](this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gim.test(e))}else be["t"](this._type),this._type.title="",be["L"](this._type),this.domNode.classList.add("no-type");if(be["t"](this._docs),"string"===typeof n)this._docs.classList.remove("markdown-docs"),this._docs.textContent=n;else if(n){this._docs.classList.add("markdown-docs"),be["t"](this._docs);const e=this._markdownRenderer.render(n);this._docs.appendChild(e.element),this._renderDisposeable.add(e),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=e=>{e.preventDefault(),e.stopPropagation()},this._close.onclick=e=>{e.preventDefault(),e.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}else this.clearContents()}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get size(){return this._size}layout(e,t){const i=new be["b"](e,t);be["b"].equals(i,this._size)||(this._size=i,be["Y"](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}};We=Ne([Re(1,D["a"])],We);class Ae{constructor(e,t){let i,s;this.widget=e,this._editor=t,this._disposables=new c["b"],this._added=!1,this._preferAlignAtTop=!0,this._resizable=new Ie["a"],this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let o=0,n=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,s=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(e=>{if(i&&s){this.widget.layout(e.dimension.width,e.dimension.height);let t=!1;e.west&&(n=s.width-e.dimension.width,t=!0),e.north&&(o=s.height-e.dimension.height,t=!0),t&&this._applyTopLeft({top:i.top+o,left:i.left+n})}e.done&&(i=void 0,s=void 0,o=0,n=0,this._userSize=e.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{var e;this._anchorBox&&this._placeAtAnchor(this._anchorBox,null!==(e=this._userSize)&&void 0!==e?e: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 s=e.getBoundingClientRect();this._anchorBox=s,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,null!==(i=this._userSize)&&void 0!==i?i:this.widget.size,t)}_placeAtAnchor(e,t,i){var s;const o=be["A"](document.body),n=this.widget.getLayoutInfo(),r=new be["b"](220,2*n.lineHeight),l=e.top,d=function(){const i=o.width-(e.left+e.width+n.borderWidth+n.horizontalPadding),s=-n.borderWidth+e.left+e.width,d=new be["b"](i,o.height-e.top-n.borderHeight-n.verticalPadding),a=d.with(void 0,e.top+e.height-n.borderHeight-n.verticalPadding);return{top:l,left:s,fit:i-t.width,maxSizeTop:d,maxSizeBottom:a,minSize:r.with(Math.min(i,r.width))}}(),a=function(){const i=e.left-n.borderWidth-n.horizontalPadding,s=Math.max(n.horizontalPadding,e.left-t.width-n.borderWidth),d=new be["b"](i,o.height-e.top-n.borderHeight-n.verticalPadding),a=d.with(void 0,e.top+e.height-n.borderHeight-n.verticalPadding);return{top:l,left:s,fit:i-t.width,maxSizeTop:d,maxSizeBottom:a,minSize:r.with(Math.min(i,r.width))}}(),c=function(){const i=e.left,s=-n.borderWidth+e.top+e.height,l=new be["b"](e.width-n.borderHeight,o.height-e.top-e.height-n.verticalPadding);return{top:s,left:i,fit:l.height-t.height,maxSizeBottom:l,maxSizeTop:l,minSize:r.with(l.width)}}(),h=[d,a,c],g=null!==(s=h.find(e=>e.fit>=0))&&void 0!==s?s:h.sort((e,t)=>t.fit-e.fit)[0],u=e.top+e.height-n.borderHeight;let p,b=t.height;const m=Math.max(g.maxSizeTop.height,g.maxSizeBottom.height);let _;b>m&&(b=m),i?b<=g.maxSizeTop.height?(p=!0,_=g.maxSizeTop):(p=!1,_=g.maxSizeBottom):b<=g.maxSizeBottom.height?(p=!1,_=g.maxSizeBottom):(p=!0,_=g.maxSizeTop),this._applyTopLeft({left:g.left,top:p?g.top:u-b}),this.getDomNode().style.position="fixed",this._resizable.enableSashes(!p,g===d,p,g!==d),this._resizable.minSize=g.minSize,this._resizable.maxSize=_,this._resizable.layout(b,Math.min(_.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this.getDomNode().style.left=this._topLeft.left+"px",this.getDomNode().style.top=this._topLeft.top+"px"}}var ze,$e=i("c4e3"),He=i("7e93"),Ve=i("6d8e"),Be=i("8aeb"),qe=i("944a"),Je=i("0867"),Ke=i("459c"),Ue=i("bf5b"),Ge=function(e,t,i,s){var o,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},Qe=function(e,t){return function(i,s){t(i,s,e)}};function Xe(e){return"suggest-aria-id:"+e}const Ye=Object(Ue["b"])("suggest-more-info",Fe["b"].chevronRight,z["a"]("suggestMoreInfoIcon","Icon for more information in the suggest widget.")),Ze=new(ze=class e{extract(t,i){if(t.textLabel.match(e._regexStrict))return i[0]=t.textLabel,!0;if(t.completion.detail&&t.completion.detail.match(e._regexStrict))return i[0]=t.completion.detail,!0;if("string"===typeof t.completion.documentation){const s=e._regexRelaxed.exec(t.completion.documentation);if(s&&(0===s.index||s.index+s[0].length===t.completion.documentation.length))return i[0]=s[0],!0}return!1}},ze._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/,ze._regexStrict=new RegExp(`^${ze._regexRelaxed.source}$`,"i"),ze);let et=class{constructor(e,t,i,s){this._editor=e,this._modelService=t,this._languageService=i,this._themeService=s,this._onDidToggleDetails=new d["b"],this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=Object.create(null);t.disposables=new c["b"],t.root=e,t.root.classList.add("show-file-icons"),t.icon=Object(be["q"])(e,Object(be["a"])(".icon")),t.colorspan=Object(be["q"])(t.icon,Object(be["a"])("span.colorspan"));const i=Object(be["q"])(e,Object(be["a"])(".contents")),s=Object(be["q"])(i,Object(be["a"])(".main"));t.iconContainer=Object(be["q"])(s,Object(be["a"])(".icon-label.codicon")),t.left=Object(be["q"])(s,Object(be["a"])("span.left")),t.right=Object(be["q"])(s,Object(be["a"])("span.right")),t.iconLabel=new $e["a"](t.left,{supportHighlights:!0,supportIcons:!0}),t.disposables.add(t.iconLabel),t.parametersLabel=Object(be["q"])(t.left,Object(be["a"])("span.signature-label")),t.qualifierLabel=Object(be["q"])(t.left,Object(be["a"])("span.qualifier-label")),t.detailsLabel=Object(be["q"])(t.right,Object(be["a"])("span.details-label")),t.readMore=Object(be["q"])(t.right,Object(be["a"])("span.readMore"+Te["d"].asCSSSelector(Ye))),t.readMore.title=z["a"]("readMore","Read More");const o=()=>{const e=this._editor.getOptions(),i=e.get(44),o=i.getMassagedFontFamily(ke["isSafari"]?Pe["d"].fontFamily:null),n=i.fontFeatureSettings,r=e.get(107)||i.fontSize,l=e.get(108)||i.lineHeight,d=i.fontWeight,a=r+"px",c=l+"px";t.root.style.fontSize=a,t.root.style.fontWeight=d,s.style.fontFamily=o,s.style.fontFeatureSettings=n,s.style.lineHeight=c,t.icon.style.height=c,t.icon.style.width=c,t.readMore.style.height=c,t.readMore.style.width=c};return o(),t.disposables.add(this._editor.onDidChangeConfiguration(e=>{(e.hasChanged(44)||e.hasChanged(107)||e.hasChanged(108))&&o()})),t}renderElement(e,t,i){const{completion:s}=e;i.root.id=Xe(t),i.colorspan.style.backgroundColor="";const n={labelEscapeNewLines:!0,matches:Object(He["c"])(e.score)};let r=[];if(19===s.kind&&Ze.extract(e,r))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=r[0];else if(20===s.kind&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const t=Object(Be["a"])(this._modelService,this._languageService,Ve["a"].from({scheme:"fake",path:e.textLabel}),Ke["a"].FILE),o=Object(Be["a"])(this._modelService,this._languageService,Ve["a"].from({scheme:"fake",path:s.detail}),Ke["a"].FILE);n.extraClasses=t.length>o.length?t:o}else 23===s.kind&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",n.extraClasses=Object(o["o"])([Object(Be["a"])(this._modelService,this._languageService,Ve["a"].from({scheme:"fake",path:e.textLabel}),Ke["a"].FOLDER),Object(Be["a"])(this._modelService,this._languageService,Ve["a"].from({scheme:"fake",path:s.detail}),Ke["a"].FOLDER)])):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...Fe["a"].asClassNameArray(x["b"].toIcon(s.kind))));s.tags&&s.tags.indexOf(1)>=0&&(n.extraClasses=(n.extraClasses||[]).concat(["deprecated"]),n.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,n),"string"===typeof s.label?(i.parametersLabel.textContent="",i.detailsLabel.textContent=tt(s.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=tt(s.label.detail||""),i.detailsLabel.textContent=tt(s.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(106).showInlineDetails?Object(be["X"])(i.detailsLabel):Object(be["L"])(i.detailsLabel),Ee(e)?(i.right.classList.add("can-expand-details"),Object(be["X"])(i.readMore),i.readMore.onmousedown=e=>{e.stopPropagation(),e.preventDefault()},i.readMore.onclick=e=>{e.stopPropagation(),e.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),Object(be["L"])(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};function tt(e){return e.replace(/\r\n|\r|\n/g,"")}et=Ge([Qe(1,qe["a"]),Qe(2,Je["a"]),Qe(3,Te["b"])],et);var it=function(e,t,i,s){var o,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},st=function(e,t){return function(i,s){t(i,s,e)}},ot=function(e,t,i,s){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,n){function r(e){try{d(s.next(e))}catch(t){n(t)}}function l(e){try{d(s["throw"](e))}catch(t){n(t)}}function d(e){e.done?i(e.value):o(e.value).then(r,l)}d((s=s.apply(e,t||[])).next())}))};Object(Ce["Jc"])("editorSuggestWidget.background",{dark:Ce["jb"],light:Ce["jb"],hc:Ce["jb"]},z["a"]("editorSuggestWidgetBackground","Background color of the suggest widget.")),Object(Ce["Jc"])("editorSuggestWidget.border",{dark:Ce["kb"],light:Ce["kb"],hc:Ce["kb"]},z["a"]("editorSuggestWidgetBorder","Border color of the suggest widget."));const nt=Object(Ce["Jc"])("editorSuggestWidget.foreground",{dark:Ce["I"],light:Ce["I"],hc:Ce["I"]},z["a"]("editorSuggestWidgetForeground","Foreground color of the suggest widget.")),rt=(Object(Ce["Jc"])("editorSuggestWidget.selectedForeground",{dark:Ce["Gc"],light:Ce["Gc"],hc:Ce["Gc"]},z["a"]("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget.")),Object(Ce["Jc"])("editorSuggestWidget.selectedIconForeground",{dark:Ce["Hc"],light:Ce["Hc"],hc:Ce["Hc"]},z["a"]("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget.")),Object(Ce["Jc"])("editorSuggestWidget.selectedBackground",{dark:Ce["Fc"],light:Ce["Fc"],hc:Ce["Fc"]},z["a"]("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget.")));Object(Ce["Jc"])("editorSuggestWidget.highlightForeground",{dark:Ce["Vb"],light:Ce["Vb"],hc:Ce["Vb"]},z["a"]("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget.")),Object(Ce["Jc"])("editorSuggestWidget.focusHighlightForeground",{dark:Ce["Tb"],light:Ce["Tb"],hc:Ce["Tb"]},z["a"]("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused.")),Object(Ce["Jc"])("editorSuggestWidgetStatus.foreground",{dark:Object(Ce["Vc"])(nt,.5),light:Object(Ce["Vc"])(nt,.5),hc:Object(Ce["Vc"])(nt,.5)},z["a"]("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class lt{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof fe["a"]}`}restore(){var e;const t=null!==(e=this._service.get(this._key,0))&&void 0!==e?e:"";try{const e=JSON.parse(t);if(be["b"].is(e))return be["b"].lift(e)}catch(i){}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let dt=class e{constructor(e,t,i,s,o){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new n["j"],this._disposables=new c["b"],this._onDidSelect=new d["b"],this._onDidFocus=new d["b"],this._onDidHide=new d["b"],this._onDidShow=new d["b"],this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new d["b"],this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new Ie["a"],this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new at(this,e),this._persistedSize=new lt(t,e);class r{constructor(e,t,i=!1,s=!1){this.persistedSize=e,this.currentSize=t,this.persistHeight=i,this.persistWidth=s}}let l;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),l=new r(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(e=>{var t,i,s,o;if(this._resize(e.dimension.width,e.dimension.height),l&&(l.persistHeight=l.persistHeight||!!e.north||!!e.south,l.persistWidth=l.persistWidth||!!e.east||!!e.west),e.done){if(l){const{itemHeight:e,defaultSize:n}=this.getLayoutInfo(),r=Math.round(e/2);let{width:d,height:a}=this.element.size;(!l.persistHeight||Math.abs(l.currentSize.height-a)<=r)&&(a=null!==(i=null===(t=l.persistedSize)||void 0===t?void 0:t.height)&&void 0!==i?i:n.height),(!l.persistWidth||Math.abs(l.currentSize.width-d)<=r)&&(d=null!==(o=null===(s=l.persistedSize)||void 0===s?void 0:s.width)&&void 0!==o?o:n.width),this._persistedSize.store(new be["b"](d,a))}this._contentWidget.unlockPreference(),l=void 0}})),this._messageElement=be["q"](this.element.domNode,be["a"](".message")),this._listElement=be["q"](this.element.domNode,be["a"](".tree"));const a=o.createInstance(We,this.editor);a.onDidClose(this.toggleDetails,this,this._disposables),this._details=new Ae(a,this.editor);const h=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(106).showIcons);h();const g=o.createInstance(et,this.editor);this._disposables.add(g),this._disposables.add(g.onDidToggleDetails(()=>this.toggleDetails())),this._list=new me["c"]("SuggestWidget",this._listElement,{getHeight:e=>this.getLayoutInfo().itemHeight,getTemplateId:e=>"suggestion"},[g],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>z["a"]("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:e=>{let t=e.textLabel;if("string"!==typeof e.completion.label){const{detail:i,description:s}=e.completion.label;i&&s?t=z["a"]("label.full","{0}{1}, {2}",t,i,s):i?t=z["a"]("label.detail","{0}{1}",t,i):s&&(t=z["a"]("label.desc","{0}, {1}",t,s))}if(!e.isResolved||!this._isDetailsVisible())return t;const{documentation:i,detail:s}=e.completion,o=X["v"]("{0}{1}",s||"",i?"string"===typeof i?i:i.value:"");return z["a"]("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",t,o)}}}),this._status=o.createInstance(Oe,this.element.domNode);const u=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(106).showStatusBar);u(),this._disposables.add(Object(De["b"])(this._list,s,{listInactiveFocusBackground:rt,listInactiveFocusOutline:Ce["b"]})),this._disposables.add(s.onDidColorThemeChange(e=>this._onThemeChange(e))),this._onThemeChange(s.getColorTheme()),this._disposables.add(this._list.onMouseDown(e=>this._onListMouseDownOrTap(e))),this._disposables.add(this._list.onTap(e=>this._onListMouseDownOrTap(e))),this._disposables.add(this._list.onDidChangeSelection(e=>this._onListSelection(e))),this._disposables.add(this._list.onDidChangeFocus(e=>this._onListFocus(e))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(e=>{e.hasChanged(106)&&(u(),h())})),this._ctxSuggestWidgetVisible=q["b"].Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=q["b"].DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=q["b"].MultipleSuggestions.bindTo(i),this._disposables.add(be["o"](this._details.widget.domNode,"keydown",e=>{this._onDetailsKeydown.fire(e)})),this._disposables.add(this.editor.onMouseDown(e=>this._onEditorMouseDown(e)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),null===(e=this._loadingTimeout)||void 0===e||e.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){0!==this._state&&this._contentWidget.layout()}_onListMouseDownOrTap(e){"undefined"!==typeof e.element&&"undefined"!==typeof e.index&&(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth="hc"===e.type?2:1}_onListFocus(e){var t;if(this._ignoreFocusEvents)return;if(!e.elements.length)return this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),void this.editor.setAriaOptions({activeDescendant:void 0});if(!this._completionModel)return;const i=e.elements[0],s=e.indexes[0];i!==this._focusedItem&&(null===(t=this._currentSuggestionDetails)||void 0===t||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=i,this._list.reveal(s),this._currentSuggestionDetails=Object(n["l"])(e=>ot(this,void 0,void 0,(function*(){const t=Object(n["m"])(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),s=e.onCancellationRequested(()=>t.dispose()),o=yield i.resolve(e);return t.dispose(),s.dispose(),o}))),this._currentSuggestionDetails.then(()=>{s>=this._list.length||i!==this._list.element(s)||(this._ignoreFocusEvents=!0,this._list.splice(s,1,[i]),this._list.setFocus([s]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:Xe(s)}))}).catch(l["g"])),this._onDidFocus.fire({item:i,index:s,model:this._completionModel})}_setState(t){if(this._state!==t)switch(this._state=t,this.element.domNode.classList.toggle("frozen",4===t),this.element.domNode.classList.remove("message"),t){case 0:be["L"](this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=e.LOADING_MESSAGE,be["L"](this._listElement,this._status.element),be["X"](this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0;break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=e.NO_SUGGESTIONS_MESSAGE,be["L"](this._listElement,this._status.element),be["X"](this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0;break;case 3:be["L"](this._messageElement),be["X"](this._listElement,this._status.element),this._show();break;case 4:be["L"](this._messageElement),be["X"](this._listElement,this._status.element),this._show();break;case 5:be["L"](this._messageElement),be["X"](this._listElement,this._status.element),this._details.show(),this._show();break}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet(()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)},100)}showTriggered(e,t){0===this._state&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=Object(n["m"])(()=>this._setState(1),t)))}showSuggestions(e,t,i,s){var o,n;if(this._contentWidget.setPosition(this.editor.getPosition()),null===(o=this._loadingTimeout)||void 0===o||o.dispose(),null===(n=this._currentSuggestionDetails)||void 0===n||n.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&2!==this._state&&0!==this._state)return void this._setState(4);const r=this._completionModel.items.length,l=0===r;if(this._ctxSuggestWidgetMultipleSuggestions.set(r>1),l)return this._setState(s?0:2),void(this._completionModel=void 0);this._focusedItem=void 0,this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?4:3),this._list.reveal(t,0),this._list.setFocus([t]),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")}selectNextPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(0!==this._state&&2!==this._state&&1!==this._state&&this._completionModel)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){5===this._state?(this._setState(3),this._details.widget.domNode.classList.remove("focused")):3===this._state&&this._isDetailsVisible()&&(this._setState(5),this._details.widget.domNode.classList.add("focused"))}toggleDetails(){this._isDetailsVisible()?(this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):!Ee(this._list.getFocusedElements()[0])&&!this._explainMode||3!==this._state&&5!==this._state&&4!==this._state||(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._positionDetails(),this.editor.focus(),this.element.domNode.classList.add("shows-details")}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var e;null===(e=this._loadingTimeout)||void 0===e||e.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const t=this._persistedSize.restore(),i=Math.ceil(4.3*this.getLayoutInfo().itemHeight);t&&t.height<i&&this._persistedSize.store(t.with(void 0,i))}isFrozen(){return 4===this._state}_afterRender(e){null!==e?2!==this._state&&1!==this._state&&(this._isDetailsVisible()&&this._details.show(),this._positionDetails()):this._isDetailsVisible()&&this._details.hide()}_layout(e){var t,i,s;if(!this.editor.hasModel())return;if(!this.editor.getDomNode())return;const o=be["A"](document.body),n=this.getLayoutInfo();e||(e=n.defaultSize);let r=e.height,l=e.width;if(this._status.element.style.lineHeight=n.itemHeight+"px",2===this._state||1===this._state)r=n.itemHeight+n.borderHeight,l=n.defaultSize.width/2,this.element.enableSashes(!1,!1,!1,!1),this.element.minSize=this.element.maxSize=new be["b"](l,r),this._contentWidget.setPreference(2);else{const d=o.width-n.borderHeight-2*n.horizontalPadding;l>d&&(l=d);const a=this._completionModel?this._completionModel.stats.pLabelLen*n.typicalHalfwidthCharacterWidth:l,c=n.statusBarHeight+this._list.contentHeight+n.borderHeight,h=n.itemHeight+n.statusBarHeight,g=be["E"](this.editor.getDomNode()),u=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),p=g.top+u.top+u.height,b=Math.min(o.height-p-n.verticalPadding,c),m=g.top+u.top-n.verticalPadding,_=Math.min(m,c);let f=Math.min(Math.max(_,b)+n.borderHeight,c);r===(null===(t=this._cappedHeight)||void 0===t?void 0:t.capped)&&(r=this._cappedHeight.wanted),r<h&&(r=h),r>f&&(r=f);const y=150;r>b||this._forceRenderingAbove&&m>y?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),f=_):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),f=b),this.element.preferredSize=new be["b"](a,n.defaultSize.height),this.element.maxSize=new be["b"](d,f),this.element.minSize=new be["b"](220,h),this._cappedHeight=r===c?{wanted:null!==(s=null===(i=this._cappedHeight)||void 0===i?void 0:i.wanted)&&void 0!==s?s:e.height,capped:r}:void 0}this._resize(l,r)}_resize(e,t){const{width:i,height:s}=this.element.maxSize;e=Math.min(i,e),t=Math.min(s,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height=t-o+"px",this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){var e;this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,2===(null===(e=this._contentWidget.getPosition())||void 0===e?void 0:e.preference[0]))}getLayoutInfo(){const e=this.editor.getOption(44),t=Object(_e["c"])(this.editor.getOption(108)||e.lineHeight,8,1e3),i=this.editor.getOption(106).showStatusBar&&2!==this._state&&1!==this._state?t:0,s=this._details.widget.borderWidth,o=2*s;return{itemHeight:t,statusBarHeight:i,borderWidth:s,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new be["b"](430,i+12*t+o)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}};dt.LOADING_MESSAGE=z["a"]("suggestWidget.loading","Loading..."),dt.NO_SUGGESTIONS_MESSAGE=z["a"]("suggestWidget.noSuggestions","No suggestions."),dt=it([st(1,T["a"]),st(2,R["b"]),st(3,Te["b"]),st(4,D["a"])],dt);class at{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return!this._hidden&&this._position&&this._preference?{position:this._position,preference:[this._preference]}:null}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:s}=this._widget.getLayoutInfo();return new be["b"](t+2*i+s,e+2*i)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var ct=i("82c9"),ht=i("eda7"),gt=function(e,t,i,s){var o,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},ut=function(e,t){return function(i,s){t(i,s,e)}};let pt=!1;class bt{constructor(e,t){this._model=e,this._position=t;const i=e.getLineMaxColumn(t.lineNumber);if(i!==t.column){const i=e.getOffsetAt(t),s=e.getPositionAt(i+1);this._marker=e.deltaDecorations([],[{range:f["a"].fromPositions(t,s),options:{description:"suggest-line-suffix",stickiness:1}}])}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.deltaDecorations(this._marker,[])}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker[0]),i=this._model.getOffsetAt(t.getStartPosition());return i-this._model.getOffsetAt(e)}return this._model.getLineMaxColumn(e.lineNumber)-e.column}}let mt=class e{constructor(e,t,i,s,o,r,l){this._memoryService=t,this._commandService=i,this._contextKeyService=s,this._instantiationService=o,this._logService=r,this._telemetryService=l,this._lineSuffix=new c["d"],this._toDispose=new c["b"],this._selectors=new _t(e=>e.priority),this._telemetryGate=0,this.editor=e,this.model=o.createInstance(ue,this.editor);const d=q["b"].InsertMode.bindTo(s);d.set(e.getOption(106).insertMode),this.model.onDidTrigger(()=>d.set(e.getOption(106).insertMode)),this.widget=this._toDispose.add(new n["d"](()=>{const e=this._instantiationService.createInstance(dt,this.editor);this._toDispose.add(e),this._toDispose.add(e.onDidSelect(e=>this._insertSuggestion(e,0),this));const t=new Q(this.editor,e,e=>this._insertSuggestion(e,2));this._toDispose.add(t),this._toDispose.add(this.model.onDidSuggest(e=>{0===e.completionModel.items.length&&t.reset()}));const i=q["b"].MakesTextEdit.bindTo(this._contextKeyService),s=q["b"].HasInsertAndReplaceRange.bindTo(this._contextKeyService),o=q["b"].CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(Object(c["j"])(()=>{i.reset(),s.reset(),o.reset()})),this._toDispose.add(e.onDidFocus(({item:e})=>{const t=this.editor.getPosition(),n=e.editStart.column,r=t.column;let l=!0;if("smart"===this.editor.getOption(1)&&2===this.model.state&&!e.completion.additionalTextEdits&&!(4&e.completion.insertTextRules)&&r-n===e.completion.insertText.length){const i=this.editor.getModel().getValueInRange({startLineNumber:t.lineNumber,startColumn:n,endLineNumber:t.lineNumber,endColumn:r});l=i!==e.completion.insertText}i.set(l),s.set(!_["a"].equals(e.editInsertEnd,e.editReplaceEnd)),o.set(Boolean(e.provider.resolveCompletionItem)||Boolean(e.completion.documentation)||e.completion.detail!==e.completion.label)})),this._toDispose.add(e.onDetailsKeyDown(e=>{e.toKeybinding().equals(new a["d"](!0,!1,!1,!1,33))||h["i"]&&e.toKeybinding().equals(new a["d"](!1,!1,!1,!0,33))?e.stopPropagation():e.toKeybinding().isModifierKey()||this.editor.focus()})),e})),this._overtypingCapturer=this._toDispose.add(new n["d"](()=>this._toDispose.add(new pe(this.editor,this.model)))),this._alternatives=this._toDispose.add(new n["d"](()=>this._toDispose.add(new U(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance(A,e)),this._toDispose.add(this.model.onDidTrigger(e=>{this.widget.value.showTriggered(e.auto,e.shy?250:50),this._lineSuffix.value=new bt(this.editor.getModel(),e.position)})),this._toDispose.add(this.model.onDidSuggest(e=>{if(!e.shy){let t=-1;for(const i of this._selectors.itemsOrderedByPriorityDesc)if(t=i.select(this.editor.getModel(),this.editor.getPosition(),e.completionModel.items),-1!==t)break;-1===t&&(t=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),e.completionModel.items)),this.widget.value.showSuggestions(e.completionModel,t,e.isFrozen,e.auto)}})),this._toDispose.add(this.model.onDidCancel(e=>{e.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{pt||(this.model.cancel(),this.model.clear())}));let g=q["b"].AcceptSuggestionsOnEnter.bindTo(s),u=()=>{const e=this.editor.getOption(1);g.set("on"===e||"smart"===e)};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>u())),u()}static get(t){return t.getContribution(e.ID)}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose()}_insertSuggestion(e,t){if(!e||!e.item)return this._alternatives.value.reset(),this.model.cancel(),void this.model.clear();if(!this.editor.hasModel())return;const i=S["SnippetController2"].get(this.editor);if(!i)return;const s=this.editor.getModel(),o=s.getAlternativeVersionId(),{item:n}=e,d=[],a=new r["b"];1&t||this.editor.pushUndoStop();const c=this.getOverwriteInfo(n,Boolean(8&t));if(this._memoryService.memorize(s,this.editor.getPosition(),n),Array.isArray(n.completion.additionalTextEdits)){const e=p["a"].capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",n.completion.additionalTextEdits.map(e=>m["a"].replace(f["a"].lift(e.range),e.text))),e.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!n.isResolved){const e=new g["a"](!0);let i;const o=s.onDidChangeContent(e=>{if(e.isFlush)return a.cancel(),void o.dispose();for(let t of e.changes){const e=f["a"].getEndPosition(t.range);i&&!_["a"].isBefore(e,i)||(i=e)}});let r=t;t|=2;let l=!1,c=this.editor.onWillType(()=>{c.dispose(),l=!0,2&r||this.editor.pushUndoStop()});d.push(n.resolve(a.token).then(()=>{if(!n.completion.additionalTextEdits||a.token.isCancellationRequested)return!1;if(i&&n.completion.additionalTextEdits.some(e=>_["a"].isBefore(i,f["a"].getStartPosition(e.range))))return!1;l&&this.editor.pushUndoStop();const e=p["a"].capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",n.completion.additionalTextEdits.map(e=>m["a"].replace(f["a"].lift(e.range),e.text))),e.restoreRelativeVerticalPositionOfCursor(this.editor),!l&&2&r||this.editor.pushUndoStop(),!0}).then(t=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",e.elapsed(),t),o.dispose(),c.dispose()}))}let{insertText:h}=n.completion;4&n.completion.insertTextRules||(h=v["c"].escape(h)),i.insert(h,{overwriteBefore:c.overwriteBefore,overwriteAfter:c.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(1&n.completion.insertTextRules),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),2&t||this.editor.pushUndoStop(),n.completion.command?n.completion.command.id===ft.id?this.model.trigger({auto:!0,shy:!1},!0):(d.push(this._commandService.executeCommand(n.completion.command.id,...n.completion.command.arguments?[...n.completion.command.arguments]:[]).catch(l["g"])),this.model.cancel()):this.model.cancel(),4&t&&this._alternatives.value.set(e,e=>{a.cancel();while(s.canUndo()){o!==s.getAlternativeVersionId()&&s.undo(),this._insertSuggestion(e,3|(8&t?8:0));break}}),this._alertCompletionItem(n),Promise.all(d).finally(()=>{this._reportSuggestionAcceptedTelemetry(s,e),this.model.clear(),a.dispose()})}_reportSuggestionAcceptedTelemetry(e,t){var i;if(this._telemetryGate++%100!==0)return;const s=(null!==(i=t.item.provider._debugDisplayName)&&void 0!==i?i:"unknown").split("(",1)[0].toLowerCase();this._telemetryService.publicLog2("suggest.acceptedSuggestion",{providerId:s,basenameHash:Object(ht["c"])(Object(ct["b"])(e.uri)).toString(16),languageId:e.getLanguageId(),fileExtension:Object(ct["f"])(e.uri)})}getOverwriteInfo(e,t){Object(u["c"])(this.editor.hasModel());let i="replace"===this.editor.getOption(106).insertMode;t&&(i=!i);const s=e.position.column-e.editStart.column,o=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,n=this.editor.getPosition().column-e.position.column,r=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:s+n,overwriteAfter:o+r}}_alertCompletionItem(e){if(Object(o["r"])(e.completion.additionalTextEdits)){let t=z["a"]("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);Object(s["a"])(t)}}triggerSuggest(e,t){this.editor.hasModel()&&(this.model.trigger({auto:null!==t&&void 0!==t&&t,shy:!1},!1,e),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},s=e=>{if(4&e.completion.insertTextRules||e.completion.additionalTextEdits)return!0;const t=this.editor.getPosition(),i=e.editStart.column,s=t.column;if(s-i!==e.completion.insertText.length)return!0;const o=this.editor.getModel().getValueInRange({startLineNumber:t.lineNumber,startColumn:i,endLineNumber:t.lineNumber,endColumn:s});return o!==e.completion.insertText};d["c"].once(this.model.onDidTrigger)(e=>{let t=[];d["c"].any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{Object(c["g"])(t),i()},void 0,t),this.model.onDidSuggest(({completionModel:e})=>{if(Object(c["g"])(t),0===e.items.length)return void i();const o=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),e.items),n=e.items[o];s(n)?(this.editor.pushUndoStop(),this._insertSuggestion({index:o,item:n,model:e},7)):i()},void 0,t)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let s=0;e&&(s|=4),t&&(s|=8),this._insertSuggestion(i,s)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.value.forceRenderingAbove()}stopForceRenderingAbove(){this.widget.isInitialized&&this.widget.value.stopForceRenderingAbove()}registerSelector(e){return this._selectors.register(e)}};mt.ID="editor.contrib.suggestController",mt=gt([ut(1,N),ut(2,H["b"]),ut(3,R["b"]),ut(4,D["a"]),ut(5,B["b"]),ut(6,oe["a"])],mt);class _t{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(-1!==this._items.indexOf(e))throw new Error("Value is already registered");return this._items.push(e),this._items.sort((e,t)=>this.prioritySelector(t)-this.prioritySelector(e)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class ft extends b["b"]{constructor(){super({id:ft.id,label:z["a"]("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:R["a"].and(y["a"].writable,y["a"].hasCompletionItemProvider),kbOpts:{kbExpr:y["a"].textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,i){const s=mt.get(t);if(!s)return;let o;i&&"object"===typeof i&&!0===i.auto&&(o=!0),s.triggerSuggest(void 0,o)}}ft.id="editor.action.triggerSuggest",Object(b["l"])(mt.ID,mt),Object(b["j"])(ft);const yt=190,St=b["c"].bindToContribution(mt.get);Object(b["k"])(new St({id:"acceptSelectedSuggestion",precondition:q["b"].Visible,handler(e){e.acceptSelectedSuggestion(!0,!1)}})),V["a"].registerKeybindingRule({id:"acceptSelectedSuggestion",when:R["a"].and(q["b"].Visible,y["a"].textInputFocus),primary:2,weight:yt}),V["a"].registerKeybindingRule({id:"acceptSelectedSuggestion",when:R["a"].and(q["b"].Visible,y["a"].textInputFocus,q["b"].AcceptSuggestionsOnEnter,q["b"].MakesTextEdit),primary:3,weight:yt}),$["d"].appendMenuItem(q["g"],{command:{id:"acceptSelectedSuggestion",title:z["a"]("accept.insert","Insert")},group:"left",order:1,when:q["b"].HasInsertAndReplaceRange.toNegated()}),$["d"].appendMenuItem(q["g"],{command:{id:"acceptSelectedSuggestion",title:z["a"]("accept.insert","Insert")},group:"left",order:1,when:R["a"].and(q["b"].HasInsertAndReplaceRange,q["b"].InsertMode.isEqualTo("insert"))}),$["d"].appendMenuItem(q["g"],{command:{id:"acceptSelectedSuggestion",title:z["a"]("accept.replace","Replace")},group:"left",order:1,when:R["a"].and(q["b"].HasInsertAndReplaceRange,q["b"].InsertMode.isEqualTo("replace"))}),Object(b["k"])(new St({id:"acceptAlternativeSelectedSuggestion",precondition:R["a"].and(q["b"].Visible,y["a"].textInputFocus),kbOpts:{weight:yt,kbExpr:y["a"].textInputFocus,primary:1027,secondary:[1026]},handler(e){e.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:q["g"],group:"left",order:2,when:R["a"].and(q["b"].HasInsertAndReplaceRange,q["b"].InsertMode.isEqualTo("insert")),title:z["a"]("accept.replace","Replace")},{menuId:q["g"],group:"left",order:2,when:R["a"].and(q["b"].HasInsertAndReplaceRange,q["b"].InsertMode.isEqualTo("replace")),title:z["a"]("accept.insert","Insert")}]})),H["a"].registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion"),Object(b["k"])(new St({id:"hideSuggestWidget",precondition:q["b"].Visible,handler:e=>e.cancelSuggestWidget(),kbOpts:{weight:yt,kbExpr:y["a"].textInputFocus,primary:9,secondary:[1033]}})),Object(b["k"])(new St({id:"selectNextSuggestion",precondition:R["a"].and(q["b"].Visible,q["b"].MultipleSuggestions),handler:e=>e.selectNextSuggestion(),kbOpts:{weight:yt,kbExpr:y["a"].textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})),Object(b["k"])(new St({id:"selectNextPageSuggestion",precondition:R["a"].and(q["b"].Visible,q["b"].MultipleSuggestions),handler:e=>e.selectNextPageSuggestion(),kbOpts:{weight:yt,kbExpr:y["a"].textInputFocus,primary:12,secondary:[2060]}})),Object(b["k"])(new St({id:"selectLastSuggestion",precondition:R["a"].and(q["b"].Visible,q["b"].MultipleSuggestions),handler:e=>e.selectLastSuggestion()})),Object(b["k"])(new St({id:"selectPrevSuggestion",precondition:R["a"].and(q["b"].Visible,q["b"].MultipleSuggestions),handler:e=>e.selectPrevSuggestion(),kbOpts:{weight:yt,kbExpr:y["a"].textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})),Object(b["k"])(new St({id:"selectPrevPageSuggestion",precondition:R["a"].and(q["b"].Visible,q["b"].MultipleSuggestions),handler:e=>e.selectPrevPageSuggestion(),kbOpts:{weight:yt,kbExpr:y["a"].textInputFocus,primary:11,secondary:[2059]}})),Object(b["k"])(new St({id:"selectFirstSuggestion",precondition:R["a"].and(q["b"].Visible,q["b"].MultipleSuggestions),handler:e=>e.selectFirstSuggestion()})),Object(b["k"])(new St({id:"toggleSuggestionDetails",precondition:q["b"].Visible,handler:e=>e.toggleSuggestionDetails(),kbOpts:{weight:yt,kbExpr:y["a"].textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:q["g"],group:"right",order:1,when:R["a"].and(q["b"].DetailsVisible,q["b"].CanResolve),title:z["a"]("detail.more","show less")},{menuId:q["g"],group:"right",order:1,when:R["a"].and(q["b"].DetailsVisible.toNegated(),q["b"].CanResolve),title:z["a"]("detail.less","show more")}]})),Object(b["k"])(new St({id:"toggleExplainMode",precondition:q["b"].Visible,handler:e=>e.toggleExplainMode(),kbOpts:{weight:100,primary:2133}})),Object(b["k"])(new St({id:"toggleSuggestionFocus",precondition:q["b"].Visible,handler:e=>e.toggleSuggestionFocus(),kbOpts:{weight:yt,kbExpr:y["a"].textInputFocus,primary:2570,mac:{primary:778}}})),Object(b["k"])(new St({id:"insertBestCompletion",precondition:R["a"].and(y["a"].textInputFocus,R["a"].equals("config.editor.tabCompletion","on"),A.AtEnd,q["b"].Visible.toNegated(),U.OtherSuggestions.toNegated(),S["SnippetController2"].InSnippetMode.toNegated()),handler:(e,t)=>{e.triggerSuggestAndAcceptBest(Object(u["l"])(t)?Object.assign({fallback:"tab"},t):{fallback:"tab"})},kbOpts:{weight:yt,primary:2}})),Object(b["k"])(new St({id:"insertNextSuggestion",precondition:R["a"].and(y["a"].textInputFocus,R["a"].equals("config.editor.tabCompletion","on"),U.OtherSuggestions,q["b"].Visible.toNegated(),S["SnippetController2"].InSnippetMode.toNegated()),handler:e=>e.acceptNextSuggestion(),kbOpts:{weight:yt,kbExpr:y["a"].textInputFocus,primary:2}})),Object(b["k"])(new St({id:"insertPrevSuggestion",precondition:R["a"].and(y["a"].textInputFocus,R["a"].equals("config.editor.tabCompletion","on"),U.OtherSuggestions,q["b"].Visible.toNegated(),S["SnippetController2"].InSnippetMode.toNegated()),handler:e=>e.acceptPrevSuggestion(),kbOpts:{weight:yt,kbExpr:y["a"].textInputFocus,primary:1026}})),Object(b["j"])(class extends b["b"]{constructor(){super({id:"editor.action.resetSuggestSize",label:z["a"]("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(e,t){var i;null===(i=mt.get(t))||void 0===i||i.resetWidgetSize()}})}}]);
Coded by KALI :v Greetz to DR HARD ../ kali.zbi@hotmail.com