paas-component-library 0.9.12 → 0.9.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{cssMode-Bg85wzMS.js → cssMode-D4GqqmZd.js} +1 -1
- package/dist/{freemarker2-ChIB18j7.js → freemarker2-ONVUityt.js} +1 -1
- package/dist/{handlebars-DznNwYh_.js → handlebars-DWu8O1yv.js} +1 -1
- package/dist/{html-CGYxWzPm.js → html-5zeK6APH.js} +1 -1
- package/dist/{htmlMode-fITpOM9i.js → htmlMode-RmnTTGNE.js} +1 -1
- package/dist/{index-DkWZ7v_D.js → index-C9N62IKd.js} +23 -23
- package/dist/{javascript-B1LK_6y6.js → javascript-DDOBqGZ5.js} +1 -1
- package/dist/{jsonMode-Ddjz5c3s.js → jsonMode-B6eo6QJ5.js} +1 -1
- package/dist/{liquid-DB_1uh7e.js → liquid-odaNG7XA.js} +1 -1
- package/dist/{mdx-CAJShIJ1.js → mdx-BfxIoMhO.js} +1 -1
- package/dist/paas-ui.js +1 -1
- package/dist/paas-ui.umd.cjs +1 -1
- package/dist/{python-CWC_XEXt.js → python-CWvZIqYJ.js} +1 -1
- package/dist/{razor-Db_ju-6-.js → razor-DD39BcOc.js} +1 -1
- package/dist/{tsMode-Bt6QH4sj.js → tsMode-f7oP2SQq.js} +1 -1
- package/dist/{typescript-CE-ZA83y.js → typescript-CvdH2-wv.js} +1 -1
- package/dist/{xml-CuBtdNGF.js → xml-CQV6agVZ.js} +1 -1
- package/dist/{yaml-C1RBKB1x.js → yaml-BEFnCxcS.js} +1 -1
- package/package.json +1 -1
package/dist/paas-ui.umd.cjs
CHANGED
|
@@ -1152,7 +1152,7 @@ ${e.toString()}`}}class aw{constructor(e=new l4,t=!1,n,r=Xje){this._services=e,t
|
|
|
1152
1152
|
`));const p=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:"advanced"});return J7.fromFn(async()=>{const m=await p.computeDiff(this._originalModel.get(),this._modifiedModel.get(),{computeMoves:!1,ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3},St.None);if(!m.identical)return new yot(yt.fromRangeInclusive(u),h(d),m.changes)})}),this._fetchStore=this._register(new ge),this._inlineEditsFetchResult=G8(this,void 0),this._inlineEdits=_a({owner:this,equalsFn:X7},l=>{var c;return((c=this._inlineEditsFetchResult.read(l))==null?void 0:c.completions.map(u=>new Oot(u)))??[]}),this._fetchInlineEditsPromise=eae({owner:this,createEmptyChangeSummary:()=>({inlineCompletionTriggerKind:ec.Automatic}),handleChange:(l,c)=>(l.didChange(this._forceUpdateExplicitlySignal)&&(c.inlineCompletionTriggerKind=ec.Explicit),!0)},async(l,c)=>{this._fetchStore.clear(),this._forceUpdateExplicitlySignal.read(l),this._textModelVersionId.read(l);function u(p,m){return m(p)}const d=this._pinnedRange.range.read(l)??u(this._selection.read(l),p=>p.isEmpty()?void 0:p);if(!d){this._inlineEditsFetchResult.set(void 0,void 0),this.userPrompt.set(void 0,void 0);return}const h={triggerKind:c.inlineCompletionTriggerKind,selectedSuggestionInfo:void 0,userPrompt:this.userPrompt.read(l)},f=aL(this._fetchStore);await ud(200,f);const g=await Hge(this.languageFeaturesService.inlineCompletionsProvider,d,this.textModel,h,f);f.isCancellationRequested||this._inlineEditsFetchResult.set(g,void 0)}),this._filteredInlineEditItems=_a({owner:this,equalsFn:Y7()},l=>this._inlineEdits.read(l)),this.selectedInlineCompletionIndex=Ze(this,l=>{const c=this._selectedInlineCompletionId.read(l),u=this._filteredInlineEditItems.read(l),d=this._selectedInlineCompletionId===void 0?-1:u.findIndex(h=>h.semanticId===c);return d===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):d}),this.selectedInlineEdit=Ze(this,l=>{const c=this._filteredInlineEditItems.read(l),u=this.selectedInlineCompletionIndex.read(l);return c[u]}),this._register(V0(this._fetchInlineEditsPromise))}async triggerExplicitly(e){l1(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineEditsPromise.get()}stop(e){l1(e,t=>{this.userPrompt.set(void 0,t),this._isActive.set(!1,t),this._inlineEditsFetchResult.set(void 0,t),this._pinnedRange.setRange(void 0,t)})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineEditItems.get()||[];if(t.length>0){const n=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[n].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}async accept(e){if(e.getModel()!==this.textModel)throw new nn;const t=this.selectedInlineEdit.get();t&&(e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[t.inlineCompletion.toSingleTextEdit().toSingleEditOperation()]),this.stop())}},d_=ym,ym._modelId=0,ym);YF=d_=xot([ZF(4,Be),ZF(5,ub),ZF(6,An)],YF);class Oot{constructor(e){this.inlineCompletion=e,this.semanticId=this.inlineCompletion.hash()}}class Lot extends re{constructor(e,t){super(),this._textModel=e,this._versionId=t,this._decorations=kt(this,[]),this.range=Ze(this,n=>{this._versionId.read(n);const r=this._decorations.read(n)[0];return r?this._textModel.getDecorationRange(r)??null:null}),this._register(Qe(()=>{this._textModel.deltaDecorations(this._decorations.get(),[])}))}setRange(e,t){this._decorations.set(this._textModel.deltaDecorations(this._decorations.get(),e?[{range:e,options:{description:"trackedRange"}}]:[]),t)}}var kot=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},h_=function(i,e){return function(t,n){e(t,n,i)}},XF;let ih=(wm=class extends re{static get(e){return e.getContribution(XF.ID)}constructor(e,t,n,r,s,o){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=n,this._debounceService=r,this._languageFeaturesService=s,this._configurationService=o,this._enabled=qZe("editor.inlineEdits.enabled",!1,this._configurationService),this._editorObs=jo(this.editor),this._selection=Ze(this,a=>this._editorObs.cursorSelection.read(a)??new We(1,1,1,1)),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineEditsDebounce",{min:50,max:50}),this.model=bs(this,a=>{if(!this._enabled.read(a)||this._editorObs.isReadonly.read(a))return;const l=this._editorObs.model.read(a);return l?this._instantiationService.createInstance($o(YF,a),l,this._editorObs.versionId,this._selection,this._debounceValue):void 0}),this._hadInlineEdit=Q8(this,(a,l)=>{var c;return l||((c=this.model.read(a))==null?void 0:c.inlineEdit.read(a))!==void 0}),this._widget=bs(this,a=>{if(this._hadInlineEdit.read(a))return this._instantiationService.createInstance($o(GF,a),this.editor,this.model.map((l,c)=>l==null?void 0:l.inlineEdit.read(c)),Eot(l=>{var c;return((c=this.model.read(l))==null?void 0:c.userPrompt)??kt("empty","")}))}),this._register(Tc(b2,this._contextKeyService,a=>{var l;return!!((l=this.model.read(a))!=null&&l.inlineEdit.read(a))})),this._register(Tc(mot,this._contextKeyService,a=>{var l;return!!((l=this.model.read(a))!=null&&l.isPinned.read(a))})),this.model.recomputeInitiallyAndOnChange(this._store),this._widget.recomputeInitiallyAndOnChange(this._store)}},XF=wm,wm.ID="editor.contrib.inlineEditsController",wm);ih=XF=kot([h_(1,Ke),h_(2,lt),h_(3,fa),h_(4,Be),h_(5,Lt)],ih);function Eot(i){return Z8(void 0,e=>i(e).read(e),(e,t)=>{i(void 0).set(e,t)})}function f_(i){return{label:i.value,alias:i.original}}const wO=class wO extends Ve{constructor(){super({id:wO.ID,...f_(ut("action.inlineEdits.showNext","Show Next Inline Edit")),precondition:pe.and(B.writable,b2),kbOpts:{weight:100,primary:606}})}async run(e,t){var r;const n=ih.get(t);(r=n==null?void 0:n.model.get())==null||r.next()}};wO.ID=pot;let QF=wO;const SO=class SO extends Ve{constructor(){super({id:SO.ID,...f_(ut("action.inlineEdits.showPrevious","Show Previous Inline Edit")),precondition:pe.and(B.writable,b2),kbOpts:{weight:100,primary:604}})}async run(e,t){var r;const n=ih.get(t);(r=n==null?void 0:n.model.get())==null||r.previous()}};SO.ID=got;let KF=SO;class Tot extends Ve{constructor(){super({id:"editor.action.inlineEdits.trigger",...f_(ut("action.inlineEdits.trigger","Trigger Inline Edit")),precondition:B.writable})}async run(e,t){const n=ih.get(t);await Joe(async r=>{var s;await((s=n==null?void 0:n.model.get())==null?void 0:s.triggerExplicitly(r))})}}class Pot extends Ve{constructor(){super({id:fot,...f_(ut("action.inlineEdits.accept","Accept Inline Edit")),precondition:b2,menuOpts:{menuId:je.InlineEditsActions,title:b("inlineEditsActions","Accept Inline Edit"),group:"primary",order:1,icon:Le.check},kbOpts:{primary:2058,weight:2e4,kbExpr:b2}})}async run(e,t){var r;t instanceof Ml&&(t=t.getParentEditor());const n=ih.get(t);n&&((r=n.model.get())==null||r.accept(n.editor),n.editor.focus())}}const CO=class CO extends Ve{constructor(){super({id:CO.ID,...f_(ut("action.inlineEdits.hide","Hide Inline Edit")),precondition:b2,kbOpts:{weight:100,primary:9}})}async run(e,t){const n=ih.get(t);di(r=>{var s;(s=n==null?void 0:n.model.get())==null||s.stop(r)})}};CO.ID="editor.action.inlineEdits.hide";let JF=CO;qt(ih.ID,ih,3),we(Tot),we(QF),we(KF),we(Pot),we(JF);const vp={Visible:new Ae("parameterHintsVisible",!1),MultipleSignatures:new Ae("parameterHintsMultipleSignatures",!1)};async function D1e(i,e,t,n,r){const s=i.ordered(e);for(const o of s)try{const a=await o.provideSignatureHelp(e,t,r,n);if(a)return a}catch(a){xi(a)}}Wt.registerCommand("_executeSignatureHelpProvider",async(i,...e)=>{const[t,n,r]=e;Xt(tt.isUri(t)),Xt(te.isIPosition(n)),Xt(typeof r=="string"||!r);const s=i.get(Be),o=await i.get(io).createModelReference(t);try{const a=await D1e(s.signatureHelpProvider,o.object.textEditorModel,te.lift(n),{triggerKind:eu.Invoke,isRetrigger:!1,triggerCharacter:r},St.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{o.dispose()}});var Mf;(function(i){i.Default={type:0};class e{constructor(r,s){this.request=r,this.previouslyActiveHints=s,this.type=2}}i.Pending=e;class t{constructor(r){this.hints=r,this.type=1}}i.Active=t})(Mf||(Mf={}));const xO=class xO extends re{constructor(e,t,n=xO.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new ie),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=Mf.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Ki),this.triggerChars=new H5,this.retriggerChars=new H5,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new $a(n),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(r=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(r=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(r=>this.onCursorChange(r))),this._register(this.editor.onDidChangeModelContent(r=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(r=>this.onDidType(r))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=Mf.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const n=this.editor.getModel();if(!n||!this.providers.has(n))return;const r=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(r),t).catch(bt)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t%e===e-1,r=this.editor.getOption(86).cycle;if((e<2||n)&&!r){this.cancel();return}this.updateActiveSignature(n&&r?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t===0,r=this.editor.getOption(86).cycle;if((e<2||n)&&!r){this.cancel();return}this.updateActiveSignature(n&&r?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new Mf.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){const t=this.state.type===1||this.state.type===2,n=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const r=this._pendingTriggers.reduce(Not);this._pendingTriggers=[];const s={triggerKind:r.triggerKind,triggerCharacter:r.triggerCharacter,isRetrigger:t,activeSignatureHelp:n};if(!this.editor.hasModel())return!1;const o=this.editor.getModel(),a=this.editor.getPosition();this.state=new Mf.Pending(er(l=>D1e(this.providers,o,a,s,l)),n);try{const l=await this.state.request;return e!==this.triggerId?(l==null||l.dispose(),!1):!l||!l.value.signatures||l.value.signatures.length===0?(l==null||l.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new Mf.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=Mf.Default),bt(l),!1}}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const n of t.signatureHelpTriggerCharacters||[])if(n.length){const r=n.charCodeAt(0);this.triggerChars.add(r),this.retriggerChars.add(r)}for(const n of t.signatureHelpRetriggerCharacters||[])n.length&&this.retriggerChars.add(n.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,n=e.charCodeAt(t);(this.triggerChars.has(n)||this.isTriggered&&this.retriggerChars.has(n))&&this.trigger({triggerKind:eu.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:eu.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:eu.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(86).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}};xO.DEFAULT_DELAY=120;let eV=xO;function Not(i,e){switch(e.triggerKind){case eu.Invoke:return e;case eu.ContentChange:return i;case eu.TriggerCharacter:default:return e}}var Dot=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},U9=function(i,e){return function(t,n){e(t,n,i)}},tV;const Na=Ee,Iot=Vn("parameter-hints-next",Le.chevronDown,b("parameterHintsNextIcon","Icon for show next parameter hint.")),Aot=Vn("parameter-hints-previous",Le.chevronUp,b("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let nV=(Sm=class extends re{constructor(e,t,n,r,s,o){super(),this.editor=e,this.model=t,this.telemetryService=o,this.renderDisposeables=this._register(new ge),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new Od({editor:e},s,r)),this.keyVisible=vp.Visible.bindTo(n),this.keyMultipleSignatures=vp.MultipleSignatures.bindTo(n)}createParameterHintDOMNodes(){const e=Na(".editor-widget.parameter-hints-widget"),t=_e(e,Na(".phwrapper"));t.tabIndex=-1;const n=_e(t,Na(".controls")),r=_e(n,Na(".button"+ot.asCSSSelector(Aot))),s=_e(n,Na(".overloads")),o=_e(n,Na(".button"+ot.asCSSSelector(Iot)));this._register(ae(r,"click",h=>{zt.stop(h),this.previous()})),this._register(ae(o,"click",h=>{zt.stop(h),this.next()}));const a=Na(".body"),l=new N8(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const c=_e(a,Na(".signature")),u=_e(a,Na(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:c,overloads:s,docs:u,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(h=>{this.visible&&this.editor.layoutContentWidget(this)}));const d=()=>{if(!this.domNodes)return;const h=this.editor.getOption(50),f=this.domNodes.element;f.style.fontSize=`${h.fontSize}px`,f.style.lineHeight=`${h.lineHeight/h.fontSize}`,f.style.setProperty("--vscode-parameterHintsWidget-editorFontFamily",h.fontFamily),f.style.setProperty("--vscode-parameterHintsWidget-editorFontFamilyDefault",Ns.fontFamily)};d(),this._register(Pe.chain(this.editor.onDidChangeConfiguration.bind(this.editor),h=>h.filter(f=>f.hasChanged(50)))(d)),this._register(this.editor.onDidLayoutChange(h=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{var e;(e=this.domNodes)==null||e.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,(e=this.domNodes)==null||e.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){if(this.renderDisposeables.clear(),!this.domNodes)return;const t=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",t),this.keyMultipleSignatures.set(t),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const n=e.signatures[e.activeSignature];if(!n)return;const r=_e(this.domNodes.signature,Na(".code")),s=n.parameters.length>0,o=n.activeParameter??e.activeParameter;if(s)this.renderParameters(r,n,o);else{const c=_e(r,Na("span"));c.textContent=n.label}const a=n.parameters[o];if(a!=null&&a.documentation){const c=Na("span.documentation");if(typeof a.documentation=="string")c.textContent=a.documentation;else{const u=this.renderMarkdownDocs(a.documentation);c.appendChild(u.element)}_e(this.domNodes.docs,Na("p",{},c))}if(n.documentation!==void 0)if(typeof n.documentation=="string")_e(this.domNodes.docs,Na("p",{},n.documentation));else{const c=this.renderMarkdownDocs(n.documentation);_e(this.domNodes.docs,c.element)}const l=this.hasDocs(n,a);if(this.domNodes.signature.classList.toggle("has-docs",l),this.domNodes.docs.classList.toggle("empty",!l),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,a){let c="";const u=n.parameters[o];Array.isArray(u.label)?c=n.label.substring(u.label[0],u.label[1]):c=u.label,u.documentation&&(c+=typeof u.documentation=="string"?`, ${u.documentation}`:`, ${u.documentation.value}`),n.documentation&&(c+=typeof n.documentation=="string"?`, ${n.documentation}`:`, ${n.documentation.value}`),this.announcedLabel!==c&&(Vs(b("hint","{0}, hint",c)),this.announcedLabel=c)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=new lr,n=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var s;(s=this.domNodes)==null||s.scrollbar.scanDomNode()}}));n.element.classList.add("markdown-docs");const r=t.elapsed();return r>300&&this.telemetryService.publicLog2("parameterHints.parseMarkdown",{renderDuration:r}),n}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&Oh(t.documentation).length>0||t&&typeof t.documentation=="object"&&Oh(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&Oh(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&Oh(e.documentation.value).length>0)}renderParameters(e,t,n){const[r,s]=this.getParameterLabelOffsets(t,n),o=document.createElement("span");o.textContent=t.label.substring(0,r);const a=document.createElement("span");a.textContent=t.label.substring(r,s),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(s),_e(e,o,a,l)}getParameterLabelOffsets(e,t){const n=e.parameters[t];if(n){if(Array.isArray(n.label))return n.label;if(n.label.length){const r=new RegExp(`(\\W|^)${oa(n.label)}(?=\\W|$)`,"g");r.test(e.label);const s=r.lastIndex-n.label.length;return s>=0?[s,r.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return tV.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const n=this.domNodes.element.getElementsByClassName("phwrapper");n.length&&(n[0].style.maxHeight=t)}},tV=Sm,Sm.ID="editor.widget.parameterHintsWidget",Sm);nV=tV=Dot([U9(2,lt),U9(3,lo),U9(4,Jn),U9(5,Qr)],nV),z("editorHoverWidget.highlightForeground",w0,b("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));var Mot=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},I1e=function(i,e){return function(t,n){e(t,n,i)}},iV;let v2=(Cm=class extends re{static get(e){return e.getContribution(iV.ID)}constructor(e,t,n){super(),this.editor=e,this.model=this._register(new eV(e,n.signatureHelpProvider)),this._register(this.model.onChangedHints(r=>{var s;r?(this.widget.value.show(),this.widget.value.render(r)):(s=this.widget.rawValue)==null||s.hide()})),this.widget=new tc(()=>this._register(t.createInstance(nV,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){var e;(e=this.widget.rawValue)==null||e.previous()}next(){var e;(e=this.widget.rawValue)==null||e.next()}trigger(e){this.model.trigger(e,0)}},iV=Cm,Cm.ID="editor.controller.parameterHints",Cm);v2=iV=Mot([I1e(1,Ke),I1e(2,Be)],v2);class Rot extends Ve{constructor(){super({id:"editor.action.triggerParameterHints",label:b("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:B.hasSignatureHelpProvider,kbOpts:{kbExpr:B.editorTextFocus,primary:3082,weight:100}})}run(e,t){const n=v2.get(t);n==null||n.trigger({triggerKind:eu.Invoke})}}qt(v2.ID,v2,2),we(Rot);const rV=175,sV=Gi.bindToContribution(v2.get);De(new sV({id:"closeParameterHints",precondition:vp.Visible,handler:i=>i.cancel(),kbOpts:{weight:rV,kbExpr:B.focus,primary:9,secondary:[1033]}})),De(new sV({id:"showPrevParameterHint",precondition:pe.and(vp.Visible,vp.MultipleSignatures),handler:i=>i.previous(),kbOpts:{weight:rV,kbExpr:B.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}})),De(new sV({id:"showNextParameterHint",precondition:pe.and(vp.Visible,vp.MultipleSignatures),handler:i=>i.next(),kbOpts:{weight:rV,kbExpr:B.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var Fot=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Vot=function(i,e){return function(t,n){e(t,n,i)}};class Hot{constructor(e){this.instantiationService=e}init(...e){}}function Bot(i,e){return class extends e{constructor(){super(...arguments),this._autorun=void 0}init(...n){this._autorun=co((r,s)=>{const o=$o(i(),r);s.add(this.instantiationService.createInstance(o,...n))})}dispose(){var n;(n=this._autorun)==null||n.dispose()}}}function zot(i){return Zw()?Bot(i,oV):i()}let oV=class extends Hot{constructor(e,t){super(t),this.init(e)}};oV=Fot([Vot(1,Ke)],oV),qt(u_.ID,zot(()=>u_),0),z("editor.placeholder.foreground",RHe,b("placeholderForeground","Foreground color of the placeholder text in the editor."));var $ot=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},q9=function(i,e){return function(t,n){e(t,n,i)}};const y2=new Ae("renameInputVisible",!1,b("renameInputVisible","Whether the rename input widget is visible"));new Ae("renameInputFocused",!1,b("renameInputFocused","Whether the rename input widget is focused"));let aV=class{constructor(e,t,n,r,s,o){this._editor=e,this._acceptKeybindings=t,this._themeService=n,this._keybindingService=r,this._logService=o,this.allowEditorOverflow=!0,this._disposables=new ge,this._visibleContextKey=y2.bindTo(s),this._isEditingRenameCandidate=!1,this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,this._candidates=new Set,this._beforeFirstInputFieldEditSW=new lr,this._inputWithButton=new jot,this._disposables.add(this._inputWithButton),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(50)&&this._updateFont()})),this._disposables.add(n.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._domNode.appendChild(this._inputWithButton.domNode),this._renameCandidateListView=this._disposables.add(new lV(this._domNode,{fontInfo:this._editor.getOption(50),onFocusChange:e=>{this._inputWithButton.input.value=e,this._isEditingRenameCandidate=!1},onSelectionChange:()=>{this._isEditingRenameCandidate=!1,this.acceptInput(!1)}})),this._disposables.add(this._inputWithButton.onDidInputChange(()=>{var e,t,n;((e=this._renameCandidateListView)==null?void 0:e.focusedCandidate)!==void 0&&(this._isEditingRenameCandidate=!0),this._timeBeforeFirstInputFieldEdit??(this._timeBeforeFirstInputFieldEdit=this._beforeFirstInputFieldEditSW.elapsed()),((t=this._renameCandidateProvidersCts)==null?void 0:t.token.isCancellationRequested)===!1&&this._renameCandidateProvidersCts.cancel(),(n=this._renameCandidateListView)==null||n.clearFocus()})),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){if(!this._domNode)return;const t=e.getColor(_0),n=e.getColor(Nse);this._domNode.style.backgroundColor=String(e.getColor(ga)??""),this._domNode.style.boxShadow=t?` 0 0 8px 2px ${t}`:"",this._domNode.style.border=n?`1px solid ${n}`:"",this._domNode.style.color=String(e.getColor(Bse)??"");const r=e.getColor(zse);this._inputWithButton.domNode.style.backgroundColor=String(e.getColor(xT)??""),this._inputWithButton.input.style.backgroundColor=String(e.getColor(xT)??""),this._inputWithButton.domNode.style.borderWidth=r?"1px":"0px",this._inputWithButton.domNode.style.borderStyle=r?"solid":"none",this._inputWithButton.domNode.style.borderColor=(r==null?void 0:r.toString())??"none"}_updateFont(){if(this._domNode===void 0)return;Xt(this._label!==void 0,"RenameWidget#_updateFont: _label must not be undefined given _domNode is defined"),this._editor.applyFontInfo(this._inputWithButton.input);const e=this._editor.getOption(50);this._label.style.fontSize=`${this._computeLabelFontSize(e.fontSize)}px`}_computeLabelFontSize(e){return e*.8}getPosition(){if(!this._visible||!this._editor.hasModel()||!this._editor.getDomNode())return null;const e=Rh(this.getDomNode().ownerDocument.body),t=Oi(this._editor.getDomNode()),n=this._getTopForPosition();this._nPxAvailableAbove=n+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const r=this._editor.getOption(67),{totalHeight:s}=g_.getLayoutInfo({lineHeight:r}),o=this._nPxAvailableBelow>s*6?[2,1]:[1,2];return{position:this._position,preference:o}}beforeRender(){var n,r;const[e,t]=this._acceptKeybindings;return this._label.innerText=b({key:"label",comment:['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"']},"{0} to Rename, {1} to Preview",(n=this._keybindingService.lookupKeybinding(e))==null?void 0:n.getLabel(),(r=this._keybindingService.lookupKeybinding(t))==null?void 0:r.getLabel()),this._domNode.style.minWidth="200px",null}afterRender(e){if(e===null){this.cancelInput(!0,"afterRender (because position is null)");return}if(!this._editor.hasModel()||!this._editor.getDomNode())return;Xt(this._renameCandidateListView),Xt(this._nPxAvailableAbove!==void 0),Xt(this._nPxAvailableBelow!==void 0);const t=hd(this._inputWithButton.domNode),n=hd(this._label);let r;e===2?r=this._nPxAvailableBelow:r=this._nPxAvailableAbove,this._renameCandidateListView.layout({height:r-n-t,width:Po(this._inputWithButton.domNode)})}acceptInput(e){var t;this._trace("invoking acceptInput"),(t=this._currentAcceptInput)==null||t.call(this,e)}cancelInput(e,t){var n;(n=this._currentCancelInput)==null||n.call(this,e)}focusNextRenameSuggestion(){var e;(e=this._renameCandidateListView)!=null&&e.focusNext()||(this._inputWithButton.input.value=this._currentName)}focusPreviousRenameSuggestion(){var e;(e=this._renameCandidateListView)!=null&&e.focusPrevious()||(this._inputWithButton.input.value=this._currentName)}getInput(e,t,n,r,s){const{start:o,end:a}=this._getSelection(e,t);this._renameCts=s;const l=new ge;this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,r===void 0?this._inputWithButton.button.style.display="none":(this._inputWithButton.button.style.display="flex",this._requestRenameCandidatesOnce=r,this._requestRenameCandidates(t,!1),l.add(ae(this._inputWithButton.button,"click",()=>this._requestRenameCandidates(t,!0))),l.add(ae(this._inputWithButton.button,ke.KEY_DOWN,u=>{const d=new kn(u);(d.equals(3)||d.equals(10))&&(d.stopPropagation(),d.preventDefault(),this._requestRenameCandidates(t,!0))}))),this._isEditingRenameCandidate=!1,this._domNode.classList.toggle("preview",n),this._position=new te(e.startLineNumber,e.startColumn),this._currentName=t,this._inputWithButton.input.value=t,this._inputWithButton.input.setAttribute("selectionStart",o.toString()),this._inputWithButton.input.setAttribute("selectionEnd",a.toString()),this._inputWithButton.input.size=Math.max((e.endColumn-e.startColumn)*1.1,20),this._beforeFirstInputFieldEditSW.reset(),l.add(Qe(()=>{this._renameCts=void 0,s.dispose(!0)})),l.add(Qe(()=>{this._renameCandidateProvidersCts!==void 0&&(this._renameCandidateProvidersCts.dispose(!0),this._renameCandidateProvidersCts=void 0)})),l.add(Qe(()=>this._candidates.clear()));const c=new Ym;return c.p.finally(()=>{l.dispose(),this._hide()}),this._currentCancelInput=u=>{var d;return this._trace("invoking _currentCancelInput"),this._currentAcceptInput=void 0,this._currentCancelInput=void 0,(d=this._renameCandidateListView)==null||d.clearCandidates(),c.complete(u),!0},this._currentAcceptInput=u=>{this._trace("invoking _currentAcceptInput"),Xt(this._renameCandidateListView!==void 0);const d=this._renameCandidateListView.nCandidates;let h,f;const g=this._renameCandidateListView.focusedCandidate;if(g!==void 0?(this._trace("using new name from renameSuggestion"),h=g,f={k:"renameSuggestion"}):(this._trace("using new name from inputField"),h=this._inputWithButton.input.value,f=this._isEditingRenameCandidate?{k:"userEditedRenameSuggestion"}:{k:"inputField"}),h===t||h.trim().length===0){this.cancelInput(!0,"_currentAcceptInput (because newName === value || newName.trim().length === 0)");return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView.clearCandidates(),c.complete({newName:h,wantsPreview:n&&u,stats:{source:f,nRenameSuggestions:d,timeBeforeFirstInputFieldEdit:this._timeBeforeFirstInputFieldEdit,nRenameSuggestionsInvocations:this._nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:this._hadAutomaticRenameSuggestionsInvocation}})},l.add(s.token.onCancellationRequested(()=>this.cancelInput(!0,"cts.token.onCancellationRequested"))),l.add(this._editor.onDidBlurEditorWidget(()=>{var u;return this.cancelInput(!((u=this._domNode)!=null&&u.ownerDocument.hasFocus()),"editor.onDidBlurEditorWidget")})),this._show(),c.p}_requestRenameCandidates(e,t){if(this._requestRenameCandidatesOnce!==void 0&&(this._renameCandidateProvidersCts!==void 0&&this._renameCandidateProvidersCts.dispose(!0),Xt(this._renameCts),this._inputWithButton.buttonState!=="stop")){this._renameCandidateProvidersCts=new oi;const n=t?V3.Invoke:V3.Automatic,r=this._requestRenameCandidatesOnce(n,this._renameCandidateProvidersCts.token);if(r.length===0){this._inputWithButton.setSparkleButton();return}t||(this._hadAutomaticRenameSuggestionsInvocation=!0),this._nRenameSuggestionsInvocations+=1,this._inputWithButton.setStopButton(),this._updateRenameCandidates(r,e,this._renameCts.token)}}_getSelection(e,t){Xt(this._editor.hasModel());const n=this._editor.getSelection();let r=0,s=t.length;return!M.isEmpty(n)&&!M.spansMultipleLines(n)&&M.containsRange(e,n)&&(r=Math.max(0,n.startColumn-e.startColumn),s=Math.min(e.endColumn,n.endColumn)-e.startColumn),{start:r,end:s}}_show(){this._trace("invoking _show"),this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._inputWithButton.input.focus(),this._inputWithButton.input.setSelectionRange(parseInt(this._inputWithButton.input.getAttribute("selectionStart")),parseInt(this._inputWithButton.input.getAttribute("selectionEnd")))},100)}async _updateRenameCandidates(e,t,n){const r=(...c)=>this._trace("_updateRenameCandidates",...c);r("start");const s=await q3(Promise.allSettled(e),n);if(this._inputWithButton.setSparkleButton(),s===void 0){r("returning early - received updateRenameCandidates results - undefined");return}const o=s.flatMap(c=>c.status==="fulfilled"&&Qc(c.value)?c.value:[]);r(`received updateRenameCandidates results - total (unfiltered) ${o.length} candidates.`);const a=nd(o,c=>c.newSymbolName);r(`distinct candidates - ${a.length} candidates.`);const l=a.filter(({newSymbolName:c})=>c.trim().length>0&&c!==this._inputWithButton.input.value&&c!==t&&!this._candidates.has(c));if(r(`valid distinct candidates - ${o.length} candidates.`),l.forEach(c=>this._candidates.add(c.newSymbolName)),l.length<1){r("returning early - no valid distinct candidates");return}r("setting candidates"),this._renameCandidateListView.setCandidates(l),r("asking editor to re-layout"),this._editor.layoutContentWidget(this)}_hide(){this._trace("invoked _hide"),this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}_getTopForPosition(){const e=this._editor.getVisibleRanges();let t;return e.length>0?t=e[0].startLineNumber:(this._logService.warn("RenameWidget#_getTopForPosition: this should not happen - visibleRanges is empty"),t=Math.max(1,this._position.lineNumber-5)),this._editor.getTopForLineNumber(this._position.lineNumber)-this._editor.getTopForLineNumber(t)}_trace(...e){this._logService.trace("RenameWidget",...e)}};aV=$ot([q9(2,Zi),q9(3,an),q9(4,lt),q9(5,Pr)],aV);class lV{constructor(e,t){this._disposables=new ge,this._availableHeight=0,this._minimumWidth=0,this._lineHeight=t.fontInfo.lineHeight,this._typicalHalfwidthCharacterWidth=t.fontInfo.typicalHalfwidthCharacterWidth,this._listContainer=document.createElement("div"),this._listContainer.className="rename-box rename-candidate-list-container",e.appendChild(this._listContainer),this._listWidget=lV._createListWidget(this._listContainer,this._candidateViewHeight,t.fontInfo),this._listWidget.onDidChangeFocus(n=>{n.elements.length===1&&t.onFocusChange(n.elements[0].newSymbolName)},this._disposables),this._listWidget.onDidChangeSelection(n=>{n.elements.length===1&&t.onSelectionChange()},this._disposables),this._disposables.add(this._listWidget.onDidBlur(n=>{this._listWidget.setFocus([])})),this._listWidget.style(g1({listInactiveFocusForeground:E8,listInactiveFocusBackground:T8}))}dispose(){this._listWidget.dispose(),this._disposables.dispose()}layout({height:e,width:t}){this._availableHeight=e,this._minimumWidth=t}setCandidates(e){this._listWidget.splice(0,0,e);const t=this._pickListHeight(this._listWidget.length),n=this._pickListWidth(e);this._listWidget.layout(t,n),this._listContainer.style.height=`${t}px`,this._listContainer.style.width=`${n}px`,bu(b("renameSuggestionsReceivedAria","Received {0} rename suggestions",e.length))}clearCandidates(){this._listContainer.style.height="0px",this._listContainer.style.width="0px",this._listWidget.splice(0,this._listWidget.length,[])}get nCandidates(){return this._listWidget.length}get focusedCandidate(){if(this._listWidget.length===0)return;const e=this._listWidget.getSelectedElements()[0];if(e!==void 0)return e.newSymbolName;const t=this._listWidget.getFocusedElements()[0];if(t!==void 0)return t.newSymbolName}focusNext(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0)return this._listWidget.focusFirst(),this._listWidget.reveal(0),!0;if(e[0]===this._listWidget.length-1)return this._listWidget.setFocus([]),this._listWidget.reveal(0),!1;{this._listWidget.focusNext();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}focusPrevious(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0){this._listWidget.focusLast();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}else{if(e[0]===0)return this._listWidget.setFocus([]),!1;{this._listWidget.focusPrevious();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}}clearFocus(){this._listWidget.setFocus([])}get _candidateViewHeight(){const{totalHeight:e}=g_.getLayoutInfo({lineHeight:this._lineHeight});return e}_pickListHeight(e){const t=this._candidateViewHeight*e;return Math.min(t,this._availableHeight,this._candidateViewHeight*7)}_pickListWidth(e){const t=Math.ceil(Math.max(...e.map(r=>r.newSymbolName.length))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,25+t+10)}static _createListWidget(e,t,n){const r=new class{getTemplateId(o){return"candidate"}getHeight(o){return t}},s=new class{constructor(){this.templateId="candidate"}renderTemplate(o){return new g_(o,n)}renderElement(o,a,l){l.populate(o)}disposeTemplate(o){o.dispose()}};return new va("NewSymbolNameCandidates",e,r,[s],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1})}}class jot{constructor(){this._onDidInputChange=new ie,this.onDidInputChange=this._onDidInputChange.event,this._disposables=new ge}get domNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="rename-input-with-button",this._domNode.style.display="flex",this._domNode.style.flexDirection="row",this._domNode.style.alignItems="center",this._inputNode=document.createElement("input"),this._inputNode.className="rename-input",this._inputNode.type="text",this._inputNode.style.border="none",this._inputNode.setAttribute("aria-label",b("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._inputNode),this._buttonNode=document.createElement("div"),this._buttonNode.className="rename-suggestions-button",this._buttonNode.setAttribute("tabindex","0"),this._buttonGenHoverText=b("generateRenameSuggestionsButton","Generate new name suggestions"),this._buttonCancelHoverText=b("cancelRenameSuggestionsButton","Cancel"),this._buttonHover=bc().setupManagedHover(Hs("element"),this._buttonNode,this._buttonGenHoverText),this._disposables.add(this._buttonHover),this._domNode.appendChild(this._buttonNode),this._disposables.add(ae(this.input,ke.INPUT,()=>this._onDidInputChange.fire())),this._disposables.add(ae(this.input,ke.KEY_DOWN,e=>{const t=new kn(e);(t.keyCode===15||t.keyCode===17)&&this._onDidInputChange.fire()})),this._disposables.add(ae(this.input,ke.CLICK,()=>this._onDidInputChange.fire())),this._disposables.add(ae(this.input,ke.FOCUS,()=>{this.domNode.style.outlineWidth="1px",this.domNode.style.outlineStyle="solid",this.domNode.style.outlineOffset="-1px",this.domNode.style.outlineColor="var(--vscode-focusBorder)"})),this._disposables.add(ae(this.input,ke.BLUR,()=>{this.domNode.style.outline="none"}))),this._domNode}get input(){return Xt(this._inputNode),this._inputNode}get button(){return Xt(this._buttonNode),this._buttonNode}get buttonState(){return this._buttonState}setSparkleButton(){var e;this._buttonState="sparkle",this._sparkleIcon??(this._sparkleIcon=n1(Le.sparkle)),br(this.button),this.button.appendChild(this._sparkleIcon),this.button.setAttribute("aria-label","Generating new name suggestions"),(e=this._buttonHover)==null||e.update(this._buttonGenHoverText),this.input.focus()}setStopButton(){var e;this._buttonState="stop",this._stopIcon??(this._stopIcon=n1(Le.primitiveSquare)),br(this.button),this.button.appendChild(this._stopIcon),this.button.setAttribute("aria-label","Cancel generating new name suggestions"),(e=this._buttonHover)==null||e.update(this._buttonCancelHoverText),this.input.focus()}dispose(){this._disposables.dispose()}}const bv=class bv{constructor(e,t){this._domNode=document.createElement("div"),this._domNode.className="rename-box rename-candidate",this._domNode.style.display="flex",this._domNode.style.columnGap="5px",this._domNode.style.alignItems="center",this._domNode.style.height=`${t.lineHeight}px`,this._domNode.style.padding=`${bv._PADDING}px`;const n=document.createElement("div");n.style.display="flex",n.style.alignItems="center",n.style.width=n.style.height=`${t.lineHeight*.8}px`,this._domNode.appendChild(n),this._icon=n1(Le.sparkle),this._icon.style.display="none",n.appendChild(this._icon),this._label=document.createElement("div"),vr(this._label,t),this._domNode.appendChild(this._label),e.appendChild(this._domNode)}populate(e){this._updateIcon(e),this._updateLabel(e)}_updateIcon(e){var n;const t=!!((n=e.tags)!=null&&n.includes(_L.AIGenerated));this._icon.style.display=t?"inherit":"none"}_updateLabel(e){this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+bv._PADDING*2}}dispose(){}};bv._PADDING=2;let g_=bv;var Wot=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Rf=function(i,e){return function(t,n){e(t,n,i)}},cV;class uV{constructor(e,t,n){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=n.ordered(e)}hasProvider(){return this._providers.length>0}async resolveRenameLocation(e){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx<this._providers.length;this._providerRenameIdx++){const r=this._providers[this._providerRenameIdx];if(!r.resolveRenameLocation)break;const s=await r.resolveRenameLocation(this.model,this.position,e);if(s){if(s.rejectReason){t.push(s.rejectReason);continue}return s}}this._providerRenameIdx=0;const n=this.model.getWordAtPosition(this.position);return n?{range:new M(this.position.lineNumber,n.startColumn,this.position.lineNumber,n.endColumn),text:n.word,rejectReason:t.length>0?t.join(`
|
|
1153
1153
|
`):void 0}:{range:M.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(`
|
|
1154
1154
|
`):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,n,r){const s=this._providers[t];if(!s)return{edits:[],rejectReason:n.join(`
|
|
1155
|
-
`)};const o=await s.provideRenameEdits(this.model,this.position,e,r);if(o){if(o.rejectReason)return this._provideRenameEdits(e,t+1,n.concat(o.rejectReason),r)}else return this._provideRenameEdits(e,t+1,n.concat(b("no result","No result.")),r);return o}}async function Uot(i,e,t,n){const r=new uV(e,t,i),s=await r.resolveRenameLocation(St.None);return s!=null&&s.rejectReason?{edits:[],rejectReason:s.rejectReason}:r.provideRenameEdits(n,St.None)}let Ff=(xm=class{static get(e){return e.getContribution(cV.ID)}constructor(e,t,n,r,s,o,a,l,c){this.editor=e,this._instaService=t,this._notificationService=n,this._bulkEditService=r,this._progressService=s,this._logService=o,this._configService=a,this._languageFeaturesService=l,this._telemetryService=c,this._disposableStore=new ge,this._cts=new oi,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(aV,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var g,p;const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new oi,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),n=new uV(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!n.hasProvider()){e("skeleton has no provider");return}const r=new xf(this.editor,5,void 0,this._cts.token);let s;try{e("resolving rename location");const m=n.resolveRenameLocation(r.token);this._progressService.showWhile(m,250),s=await m,e("resolved rename location")}catch(m){m instanceof _l?e("resolve rename location cancelled",JSON.stringify(m,null," ")):(e("resolve rename location failed",m instanceof Error?m:JSON.stringify(m,null," ")),(typeof m=="string"||pc(m))&&((g=Uo.get(this.editor))==null||g.showMessage(m||b("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),t)));return}finally{r.dispose()}if(!s){e("returning early - no loc");return}if(s.rejectReason){e(`returning early - rejected with reason: ${s.rejectReason}`,s.rejectReason),(p=Uo.get(this.editor))==null||p.showMessage(s.rejectReason,t);return}if(r.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const o=new xf(this.editor,5,s.range,this._cts.token),a=this.editor.getModel(),l=this._languageFeaturesService.newSymbolNamesProvider.all(a),c=await Promise.all(l.map(async m=>[m,await m.supportsAutomaticNewSymbolNamesTriggerKind??!1])),u=(m,_)=>{let v=c.slice();return m===V3.Automatic&&(v=v.filter(([w,y])=>y)),v.map(([w])=>w.provideNewSymbolNames(a,s.range,m,_))};e("creating rename input field and awaiting its result");const d=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),h=await this._renameWidget.getInput(s.range,s.text,d,l.length>0?u:void 0,o);if(e("received response from rename input field"),l.length>0&&this._reportTelemetry(l.length,a.getLanguageId(),h),typeof h=="boolean"){e(`returning early - rename input field response - ${h}`),h&&this.editor.focus(),o.dispose();return}this.editor.focus(),e("requesting rename edits");const f=q3(n.provideRenameEdits(h.newName,o.token),o.token).then(async m=>{if(!m){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(m.rejectReason){e(`returning early - rejected with reason: ${m.rejectReason}`),this._notificationService.info(m.rejectReason);return}this.editor.setSelection(M.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(m,{editor:this.editor,showPreview:h.wantsPreview,label:b("label","Renaming '{0}' to '{1}'",s==null?void 0:s.text,h.newName),code:"undoredo.rename",quotableLabel:b("quotableLabel","Renaming {0} to {1}",s==null?void 0:s.text,h.newName),respectAutoSaveConfig:!0}).then(_=>{e("edits applied"),_.ariaSummary&&Vs(b("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",s.text,h.newName,_.ariaSummary))}).catch(_=>{e(`error when applying edits ${JSON.stringify(_,null," ")}`),this._notificationService.error(b("rename.failedApply","Rename failed to apply edits")),this._logService.error(_)})},m=>{e("error when providing rename edits",JSON.stringify(m,null," ")),this._notificationService.error(b("rename.failed","Rename failed to compute edits")),this._logService.error(m)}).finally(()=>{o.dispose()});return e("returning rename operation"),this._progressService.showWhile(f,250),f}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}_reportTelemetry(e,t,n){const r=typeof n=="boolean"?{kind:"cancelled",languageId:t,nRenameSuggestionProviders:e}:{kind:"accepted",languageId:t,nRenameSuggestionProviders:e,source:n.stats.source.k,nRenameSuggestions:n.stats.nRenameSuggestions,timeBeforeFirstInputFieldEdit:n.stats.timeBeforeFirstInputFieldEdit,wantsPreview:n.wantsPreview,nRenameSuggestionsInvocations:n.stats.nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:n.stats.hadAutomaticRenameSuggestionsInvocation};this._telemetryService.publicLog2("renameInvokedEvent",r)}},cV=xm,xm.ID="editor.contrib.renameController",xm);Ff=cV=Wot([Rf(1,Ke),Rf(2,Ni),Rf(3,B8),Rf(4,Kh),Rf(5,Pr),Rf(6,Z5),Rf(7,Be),Rf(8,Qr)],Ff);class qot extends Ve{constructor(){super({id:"editor.action.rename",label:b("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:pe.and(B.writable,B.hasRenameProvider),kbOpts:{kbExpr:B.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const n=e.get(Kt),[r,s]=Array.isArray(t)&&t||[void 0,void 0];return tt.isUri(r)&&te.isIPosition(s)?n.openCodeEditor({resource:r},n.getActiveCodeEditor()).then(o=>{o&&(o.setPosition(s),o.invokeWithinContext(a=>(this.reportTelemetry(a,o),this.run(a,o))))},bt):super.runCommand(e,t)}run(e,t){const n=e.get(Pr),r=Ff.get(t);return r?(n.trace("[RenameAction] got controller, running..."),r.run()):(n.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}qt(Ff.ID,Ff,4),we(qot);const dV=Gi.bindToContribution(Ff.get);De(new dV({id:"acceptRenameInput",precondition:y2,handler:i=>i.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:pe.and(B.focus,pe.not("isComposing")),primary:3}})),De(new dV({id:"acceptRenameInputWithPreview",precondition:pe.and(y2,pe.has("config.editor.rename.enablePreview")),handler:i=>i.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:pe.and(B.focus,pe.not("isComposing")),primary:2051}})),De(new dV({id:"cancelRenameInput",precondition:y2,handler:i=>i.cancelRenameInput(),kbOpts:{weight:199,kbExpr:B.focus,primary:9,secondary:[1033]}})),En(class extends Ms{constructor(){super({id:"focusNextRenameSuggestion",title:{...ut("focusNextRenameSuggestion","Focus Next Rename Suggestion")},precondition:y2,keybinding:[{primary:18,weight:199}]})}run(e){const t=e.get(Kt).getFocusedCodeEditor();if(!t)return;const n=Ff.get(t);n&&n.focusNextRenameSuggestion()}}),En(class extends Ms{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...ut("focusPreviousRenameSuggestion","Focus Previous Rename Suggestion")},precondition:y2,keybinding:[{primary:16,weight:199}]})}run(e){const t=e.get(Kt).getFocusedCodeEditor();if(!t)return;const n=Ff.get(t);n&&n.focusPreviousRenameSuggestion()}}),oo("_executeDocumentRenameProvider",function(i,e,t,...n){const[r]=n;Xt(typeof r=="string");const{renameProvider:s}=i.get(Be);return Uot(s,e,t,r)}),oo("_executePrepareRename",async function(i,e,t){const{renameProvider:n}=i.get(Be),s=await new uV(e,t,n).resolveRenameLocation(St.None);if(s!=null&&s.rejectReason)throw new Error(s.rejectReason);return s}),ai.as(xl.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:b("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var Got=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},A1e=function(i,e){return function(t,n){e(t,n,i)}};let G9=(v3=class extends re{constructor(e,t,n){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=n,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(73)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(r=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(r=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(r=>{var o;const s=(o=this.editor.getModel())==null?void 0:o.getLanguageId();s&&r.affects(s)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(r=>{this.options&&!r.hasChanged(73)||(this.options=this.createOptions(e.getOption(73)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(r=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(r=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new yn(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const n=this.languageConfigurationService.getLanguageConfiguration(t).comments,r=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!n&&!(r!=null&&r.markers)))return{foldingRules:r,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){var n,r;if(!this.editor.hasModel()||!((n=this.options)!=null&&n.findMarkSectionHeaders)&&!((r=this.options)!=null&&r.findRegionSectionHeaders))return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(s=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(s)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(s=>{if(!s.shouldBeInComments)return!0;const o=t.validateRange(s.range),a=t.tokenization.getLineTokens(o.startLineNumber),l=a.findTokenIndexAtOffset(o.startColumn-1),c=a.getStandardTokenType(l);return a.getLanguageId(l)===t.getLanguageId()&&c===1}));const n=Object.values(this.currentOccurrences).map(s=>s.decorationId),r=e.map(s=>Zot(s));this.editor.changeDecorations(s=>{const o=s.deltaDecorations(n,r);this.currentOccurrences={};for(let a=0,l=o.length;a<l;a++){const c={sectionHeader:e[a],decorationId:o[a]};this.currentOccurrences[c.decorationId]=c}})}stop(){this.computeSectionHeaders.cancel(),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop(),this.decorations.clear()}},v3.ID="editor.sectionHeaderDetector",v3);G9=Got([A1e(1,li),A1e(2,ho)],G9);function Zot(i){return{range:i.range,options:vt.createDynamic({description:"section-header",stickiness:3,collapseOnReplaceEdit:!0,minimap:{color:void 0,position:1,sectionHeaderStyle:i.hasSeparatorLine?2:1,sectionHeaderText:i.text}})}}qt(G9.ID,G9,1);function Yot(i){for(let e=0,t=i.length;e<t;e+=4){const n=i[e+0],r=i[e+1],s=i[e+2],o=i[e+3];i[e+0]=o,i[e+1]=s,i[e+2]=r,i[e+3]=n}}function Xot(i){const e=new Uint8Array(i.buffer,i.byteOffset,i.length*4);return Xte()||Yot(e),N5.wrap(e)}function M1e(i){const e=new Uint32Array(Qot(i));let t=0;if(e[t++]=i.id,i.type==="full")e[t++]=1,e[t++]=i.data.length,e.set(i.data,t),t+=i.data.length;else{e[t++]=2,e[t++]=i.deltas.length;for(const n of i.deltas)e[t++]=n.start,e[t++]=n.deleteCount,n.data?(e[t++]=n.data.length,e.set(n.data,t),t+=n.data.length):e[t++]=0}return Xot(e)}function Qot(i){let e=0;if(e+=2,i.type==="full")e+=1+i.data.length;else{e+=1,e+=3*i.deltas.length;for(const t of i.deltas)t.data&&(e+=t.data.length)}return e}function Z9(i){return i&&!!i.data}function R1e(i){return i&&Array.isArray(i.edits)}class Kot{constructor(e,t,n){this.provider=e,this.tokens=t,this.error=n}}function F1e(i,e){return i.has(e)}function Jot(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:[]}async function V1e(i,e,t,n,r){const s=Jot(i,e),o=await Promise.all(s.map(async a=>{let l,c=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?n:null,r)}catch(u){c=u,l=null}return(!l||!Z9(l)&&!R1e(l))&&(l=null),new Kot(a,l,c)}));for(const a of o){if(a.error)throw a.error;if(a.tokens)return a}return o.length>0?o[0]:null}function eat(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:null}class tat{constructor(e,t){this.provider=e,this.tokens=t}}function nat(i,e){return i.has(e)}function H1e(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:[]}async function hV(i,e,t,n){const r=H1e(i,e),s=await Promise.all(r.map(async o=>{let a;try{a=await o.provideDocumentRangeSemanticTokens(e,t,n)}catch(l){xi(l),a=null}return(!a||!Z9(a))&&(a=null),new tat(o,a)}));for(const o of s)if(o.tokens)return o;return s.length>0?s[0]:null}Wt.registerCommand("_provideDocumentSemanticTokensLegend",async(i,...e)=>{const[t]=e;Xt(t instanceof tt);const n=i.get(An).getModel(t);if(!n)return;const{documentSemanticTokensProvider:r}=i.get(Be),s=eat(r,n);return s?s[0].getLegend():i.get(Dn).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)}),Wt.registerCommand("_provideDocumentSemanticTokens",async(i,...e)=>{const[t]=e;Xt(t instanceof tt);const n=i.get(An).getModel(t);if(!n)return;const{documentSemanticTokensProvider:r}=i.get(Be);if(!F1e(r,n))return i.get(Dn).executeCommand("_provideDocumentRangeSemanticTokens",t,n.getFullModelRange());const s=await V1e(r,n,null,null,St.None);if(!s)return;const{provider:o,tokens:a}=s;if(!a||!Z9(a))return;const l=M1e({id:0,type:"full",data:a.data});return a.resultId&&o.releaseDocumentSemanticTokens(a.resultId),l}),Wt.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(i,...e)=>{const[t,n]=e;Xt(t instanceof tt);const r=i.get(An).getModel(t);if(!r)return;const{documentRangeSemanticTokensProvider:s}=i.get(Be),o=H1e(s,r);if(o.length===0)return;if(o.length===1)return o[0].getLegend();if(!n||!M.isIRange(n))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),o[0].getLegend();const a=await hV(s,r,M.lift(n),St.None);if(a)return a.provider.getLegend()}),Wt.registerCommand("_provideDocumentRangeSemanticTokens",async(i,...e)=>{const[t,n]=e;Xt(t instanceof tt),Xt(M.isIRange(n));const r=i.get(An).getModel(t);if(!r)return;const{documentRangeSemanticTokensProvider:s}=i.get(Be),o=await hV(s,r,M.lift(n),St.None);if(!(!o||!o.tokens))return M1e({id:0,type:"full",data:o.tokens.data})});const fV="editor.semanticHighlighting";function Y9(i,e,t){var r;const n=(r=t.getValue(fV,{overrideIdentifier:i.getLanguageId(),resource:i.uri}))==null?void 0:r.enabled;return typeof n=="boolean"?n:e.getColorTheme().semanticHighlighting}var B1e=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},$u=function(i,e){return function(t,n){e(t,n,i)}},Vf;let gV=class extends re{constructor(e,t,n,r,s,o){super(),this._watchers=Object.create(null);const a=u=>{this._watchers[u.uri.toString()]=new pV(u,e,n,s,o)},l=(u,d)=>{d.dispose(),delete this._watchers[u.uri.toString()]},c=()=>{for(const u of t.getModels()){const d=this._watchers[u.uri.toString()];Y9(u,n,r)?d||a(u):d&&l(u,d)}};t.getModels().forEach(u=>{Y9(u,n,r)&&a(u)}),this._register(t.onModelAdded(u=>{Y9(u,n,r)&&a(u)})),this._register(t.onModelRemoved(u=>{const d=this._watchers[u.uri.toString()];d&&l(u,d)})),this._register(r.onDidChangeConfiguration(u=>{u.affectsConfiguration(fV)&&c()})),this._register(n.onDidColorThemeChange(c))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};gV=B1e([$u(0,r7),$u(1,An),$u(2,Zi),$u(3,Lt),$u(4,fa),$u(5,Be)],gV);let pV=(yg=class extends re{constructor(e,t,n,r,s){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=s.documentSemanticTokensProvider,this._debounceInformation=r.for(this._provider,"DocumentSemanticTokens",{min:Vf.REQUEST_MIN_DELAY,max:Vf.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new yn(()=>this._fetchDocumentSemanticTokensNow(),Vf.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const o=()=>{xn(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};o(),this._register(this._provider.onDidChange(()=>{o(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(n.onDidColorThemeChange(a=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),xn(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!F1e(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new oi,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,n=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,r=V1e(this._provider,this._model,t,n,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const s=[],o=this._model.onDidChangeContent(l=>{s.push(l)}),a=new lr(!1);r.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,s);else{const{provider:c,tokens:u}=l,d=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,u||null,d,s)}},l=>{l&&(Ha(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||bt(l),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),(s.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,n,r,s){s=Math.min(s,n.length-r,e.length-t);for(let o=0;o<s;o++)n[r+o]=e[t+o]}_setDocumentSemanticTokens(e,t,n,r){const s=this._currentDocumentResponse,o=()=>{(r.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!n){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),o();return}if(R1e(t)){if(!s){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:s.data};else{let a=0;for(const h of t.edits)a+=(h.data?h.data.length:0)-h.deleteCount;const l=s.data,c=new Uint32Array(l.length+a);let u=l.length,d=c.length;for(let h=t.edits.length-1;h>=0;h--){const f=t.edits[h];if(f.start>l.length){n.warnInvalidEditStart(s.resultId,t.resultId,h,f.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const g=u-(f.start+f.deleteCount);g>0&&(Vf._copy(l,u-g,c,d-g,g),d-=g),f.data&&(Vf._copy(f.data,0,c,d-f.data.length,f.data.length),d-=f.data.length),u=f.start}u>0&&Vf._copy(l,0,c,0,u),t={resultId:t.resultId,data:c}}}if(Z9(t)){this._currentDocumentResponse=new iat(e,t.resultId,t.data);const a=sse(t,n,this._model.getLanguageId());if(r.length>0)for(const l of r)for(const c of a)for(const u of l.changes)c.applyEdit(u.range,u.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);o()}},Vf=yg,yg.REQUEST_MIN_DELAY=300,yg.REQUEST_MAX_DELAY=2e3,yg);pV=Vf=B1e([$u(1,r7),$u(2,Zi),$u(3,fa),$u(4,Be)],pV);class iat{constructor(e,t,n){this.provider=e,this.resultId=t,this.data=n}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}c4(gV);var rat=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},p_=function(i,e){return function(t,n){e(t,n,i)}};let X9=(y3=class extends re{constructor(e,t,n,r,s,o){super(),this._semanticTokensStylingService=t,this._themeService=n,this._configurationService=r,this._editor=e,this._provider=o.documentRangeSemanticTokensProvider,this._debounceInformation=s.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new yn(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(l=>{this._cancelAll(),a()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(l=>{l.affectsConfiguration(fV)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,n=this._outstandingRequests.length;t<n;t++)if(this._outstandingRequests[t]===e){this._outstandingRequests.splice(t,1);return}}_tokenizeViewportNow(){if(!this._editor.hasModel())return;const e=this._editor.getModel();if(e.tokenization.hasCompleteSemanticTokens())return;if(!Y9(e,this._themeService,this._configurationService)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}if(!nat(this._provider,e)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}const t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map(n=>this._requestRange(e,n)))}_requestRange(e,t){const n=e.getVersionId(),r=er(o=>Promise.resolve(hV(this._provider,e,t,o))),s=new lr(!1);return r.then(o=>{if(this._debounceInformation.update(e,s.elapsed()),!o||!o.tokens||e.isDisposed()||e.getVersionId()!==n)return;const{provider:a,tokens:l}=o,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,sse(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(r),()=>this._removeOutstandingRequest(r)),r}},y3.ID="editor.contrib.viewportSemanticTokens",y3);X9=rat([p_(1,r7),p_(2,Zi),p_(3,Lt),p_(4,fa),p_(5,Be)],X9),qt(X9.ID,X9,1);class sat{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const n=[];for(const r of t){const s=[];n.push(s),this.selectSubwords&&this._addInWordRanges(s,e,r),this._addWordRanges(s,e,r),this._addWhitespaceLine(s,e,r),s.push({range:e.getFullModelRange()})}return n}_addInWordRanges(e,t,n){const r=t.getWordAtPosition(n);if(!r)return;const{word:s,startColumn:o}=r,a=n.column-o;let l=a,c=a,u=0;for(;l>=0;l--){const d=s.charCodeAt(l);if(l!==a&&(d===95||d===45))break;if(Dh(d)&&nu(u))break;u=d}for(l+=1;c<s.length;c++){const d=s.charCodeAt(c);if(nu(d)&&Dh(u))break;if(d===95||d===45)break;u=d}l<c&&e.push({range:new M(n.lineNumber,o+l,n.lineNumber,o+c)})}_addWordRanges(e,t,n){const r=t.getWordAtPosition(n);r&&e.push({range:new M(n.lineNumber,r.startColumn,n.lineNumber,r.endColumn)})}_addWhitespaceLine(e,t,n){t.getLineLength(n.lineNumber)>0&&t.getLineFirstNonWhitespaceColumn(n.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(n.lineNumber)===0&&e.push({range:new M(n.lineNumber,1,n.lineNumber,t.getLineMaxColumn(n.lineNumber))})}}var oat=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},aat=function(i,e){return function(t,n){e(t,n,i)}},mV;class bV{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const n=new bV(t,this.ranges);return n.ranges[t].equalsRange(this.ranges[this.index])?n.mov(e):n}}let m_=(Om=class{static get(e){return e.getContribution(mV.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)==null||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),n=this._editor.getModel();if(this._state||await $1e(this._languageFeaturesService.selectionRangeProvider,n,t.map(s=>s.getPosition()),this._editor.getOption(114),St.None).then(s=>{var o;if(!(!ds(s)||s.length!==t.length)&&!(!this._editor.hasModel()||!Kn(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;a<s.length;a++)s[a]=s[a].filter(l=>l.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),s[a].unshift(t[a]);this._state=s.map(a=>new bV(0,a)),(o=this._selectionListener)==null||o.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)==null||a.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(s=>s.mov(e));const r=this._state.map(s=>We.fromPositions(s.ranges[s.index].getStartPosition(),s.ranges[s.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(r)}finally{this._ignoreSelection=!1}}},mV=Om,Om.ID="editor.contrib.smartSelectController",Om);m_=mV=oat([aat(1,Be)],m_);class z1e extends Ve{constructor(e,t){super(t),this._forward=e}async run(e,t){const n=m_.get(t);n&&await n.run(this._forward)}}class lat extends z1e{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:b("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:B.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:je.MenubarSelectionMenu,group:"1_basic",title:b({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}Wt.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class cat extends z1e{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:b("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:B.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:je.MenubarSelectionMenu,group:"1_basic",title:b({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}qt(m_.ID,m_,4),we(lat),we(cat);async function $1e(i,e,t,n,r){const s=i.all(e).concat(new sat(n.selectSubwords));s.length===1&&s.unshift(new m9);const o=[],a=[];for(const l of s)o.push(Promise.resolve(l.provideSelectionRanges(e,t,r)).then(c=>{if(ds(c)&&c.length===t.length)for(let u=0;u<t.length;u++){a[u]||(a[u]=[]);for(const d of c[u])M.isIRange(d.range)&&M.containsPosition(d.range,t[u])&&a[u].push(M.lift(d.range))}},xi));return await Promise.all(o),a.map(l=>{if(l.length===0)return[];l.sort((h,f)=>te.isBefore(h.getStartPosition(),f.getStartPosition())?1:te.isBefore(f.getStartPosition(),h.getStartPosition())||te.isBefore(h.getEndPosition(),f.getEndPosition())?-1:te.isBefore(f.getEndPosition(),h.getEndPosition())?1:0);const c=[];let u;for(const h of l)(!u||M.containsRange(h,u)&&!M.equalsRange(h,u))&&(c.push(h),u=h);if(!n.selectLeadingAndTrailingWhitespace)return c;const d=[c[0]];for(let h=1;h<c.length;h++){const f=c[h-1],g=c[h];if(g.startLineNumber!==f.startLineNumber||g.endLineNumber!==f.endLineNumber){const p=new M(f.startLineNumber,e.getLineFirstNonWhitespaceColumn(f.startLineNumber),f.endLineNumber,e.getLineLastNonWhitespaceColumn(f.endLineNumber));p.containsRange(f)&&!p.equalsRange(f)&&g.containsRange(p)&&!g.equalsRange(p)&&d.push(p);const m=new M(f.startLineNumber,1,f.endLineNumber,e.getLineMaxColumn(f.endLineNumber));m.containsRange(f)&&!m.equalsRange(p)&&g.containsRange(m)&&!g.equalsRange(m)&&d.push(m)}d.push(g)}return d})}Wt.registerCommand("_executeSelectionRangeProvider",async function(i,...e){const[t,n]=e;Xt(tt.isUri(t));const r=i.get(Be).selectionRangeProvider,s=await i.get(io).createModelReference(t);try{return $1e(r,s.object.textEditorModel,n,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},St.None)}finally{s.dispose()}});const uat=Object.freeze({View:ut("view","View"),Help:ut("help","Help"),Test:ut("test","Test"),File:ut("file","File"),Preferences:ut("preferences","Preferences"),Developer:ut({key:"developer",comment:["A developer on Code itself or someone diagnosing issues in Code"]},"Developer")});class b_{constructor(e,t,n,r=null){this.startLineNumbers=e,this.endLineNumbers=t,this.lastLineRelativePosition=n,this.showEndForLine=r}equals(e){return!!e&&this.lastLineRelativePosition===e.lastLineRelativePosition&&this.showEndForLine===e.showEndForLine&&Kn(this.startLineNumbers,e.startLineNumbers)&&Kn(this.endLineNumbers,e.endLineNumbers)}static get Empty(){return new b_([],[],0)}}const j1e=_d("stickyScrollViewLayer",{createHTML:i=>i}),_V="data-sticky-line-index",W1e="data-sticky-is-line",dat="data-sticky-is-line-number",U1e="data-sticky-is-folding-icon";class hat extends re{constructor(e){super(),this._editor=e,this._foldingIconStore=new ge,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._lineHeight=this._editor.getOption(67),this._renderedStickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof Ml),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(116).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(116)&&t(),n.hasChanged(67)&&(this._lineHeight=this._editor.getOption(67))})),this._register(this._editor.onDidScrollChange(n=>{n.scrollLeftChanged&&t(),n.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(n=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getRenderedStickyLine(e){return this._renderedStickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,n){if(n===void 0&&(!this._previousState&&!e||this._previousState&&this._previousState.equals(e)))return;const r=this._isWidgetHeightZero(e),s=r?void 0:e,o=r?0:this._findLineToRebuildWidgetFrom(e,n);this._renderRootNode(s,t,o),this._previousState=e}_isWidgetHeightZero(e){if(!e)return!0;const t=e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition;if(t>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const n=[...e.startLineNumbers];e.showEndForLine!==null&&(n[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=n}else this._lastLineRelativePosition=0,this._lineNumbers=[];return t===0}_findLineToRebuildWidgetFrom(e,t){if(!e||!this._previousState)return 0;if(t!==void 0)return t;const n=this._previousState,r=e.startLineNumbers.findIndex(s=>!n.startLineNumbers.includes(s));return r===-1?0:r}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_clearStickyLinesFromLine(e){this._foldingIconStore.clear();for(let t=e;t<this._renderedStickyLines.length;t++){const n=this._renderedStickyLines[t];n.lineNumberDomNode.remove(),n.lineDomNode.remove()}this._renderedStickyLines=this._renderedStickyLines.slice(0,e),this._rootDomNode.style.display="none"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._renderedStickyLines){const n=t.foldingIcon;n&&n.setVisible(e?!0:n.isCollapsed)}}async _renderRootNode(e,t,n){if(this._clearStickyLinesFromLine(n),!e)return;for(const a of this._renderedStickyLines)this._updateTopAndZIndexOfStickyLine(a);const r=this._editor.getLayoutInfo(),s=this._lineNumbers.slice(n);for(const[a,l]of s.entries()){const c=this._renderChildNode(a+n,l,t,r);c&&(this._linesDomNode.appendChild(c.lineDomNode),this._lineNumbersDomNode.appendChild(c.lineNumberDomNode),this._renderedStickyLines.push(c))}t&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));const o=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${o}px`,this._linesDomNodeScrollable.style.height=`${o}px`,this._rootDomNode.style.height=`${o}px`,this._rootDomNode.style.marginLeft="0px",this._minContentWidthInPx=Math.max(...this._renderedStickyLines.map(a=>a.scrollWidth))+r.verticalScrollbarWidth,this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(111)==="mouseover"&&(this._foldingIconStore.add(ae(this._lineNumbersDomNode,ke.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(ae(this._lineNumbersDomNode,ke.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,n,r){const s=this._editor._getViewModel();if(!s)return;const o=s.coordinatesConverter.convertModelPositionToViewPosition(new te(t,1)).lineNumber,a=s.getViewLineRenderingData(o),l=this._editor.getOption(68);let c;try{c=zs.filter(a.inlineDecorations,o,a.minColumn,a.maxColumn)}catch{c=[]}const u=new ff(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,c,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),d=new s0(2e3),h=F6(u,d);let f;j1e?f=j1e.createHTML(d.build()):f=d.build();const g=document.createElement("span");g.setAttribute(_V,String(e)),g.setAttribute(W1e,""),g.setAttribute("role","listitem"),g.tabIndex=0,g.className="sticky-line-content",g.classList.add(`stickyLine${t}`),g.style.lineHeight=`${this._lineHeight}px`,g.innerHTML=f;const p=document.createElement("span");p.setAttribute(_V,String(e)),p.setAttribute(dat,""),p.className="sticky-line-number",p.style.lineHeight=`${this._lineHeight}px`;const m=r.contentLeft;p.style.width=`${m}px`;const _=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?_.innerText=t.toString():l.renderType===2&&(_.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),_.className="sticky-line-number-inner",_.style.lineHeight=`${this._lineHeight}px`,_.style.width=`${r.lineNumbersWidth}px`,_.style.paddingLeft=`${r.lineNumbersLeft}px`,p.appendChild(_);const v=this._renderFoldingIconForLine(n,t);v&&p.appendChild(v.domNode),this._editor.applyFontInfo(g),this._editor.applyFontInfo(_),p.style.lineHeight=`${this._lineHeight}px`,g.style.lineHeight=`${this._lineHeight}px`,p.style.height=`${this._lineHeight}px`,g.style.height=`${this._lineHeight}px`;const w=new fat(e,t,g,p,v,h.characterMapping,g.scrollWidth);return this._updateTopAndZIndexOfStickyLine(w)}_updateTopAndZIndexOfStickyLine(e){var u;const t=e.index,n=e.lineDomNode,r=e.lineNumberDomNode,s=t===this._lineNumbers.length-1,o="0",a="1";n.style.zIndex=s?o:a,r.style.zIndex=s?o:a;const l=`${t*this._lineHeight+this._lastLineRelativePosition+((u=e.foldingIcon)!=null&&u.isCollapsed?1:0)}px`,c=`${t*this._lineHeight}px`;return n.style.top=s?l:c,r.style.top=s?l:c,e}_renderFoldingIconForLine(e,t){const n=this._editor.getOption(111);if(!e||n==="never")return;const r=e.regions,s=r.findRange(t),o=r.getStartLineNumber(s);if(!(t===o))return;const l=r.isCollapsed(s),c=new gat(l,o,r.getEndLineNumber(s),this._lineHeight);return c.setVisible(this._isOnGlyphMargin?!0:l||n==="always"),c.domNode.setAttribute(U1e,""),c}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:2,stackOridinal:10}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e<this._renderedStickyLines.length&&this._renderedStickyLines[e].lineDomNode.focus()}getEditorPositionFromNode(e){if(!e||e.children.length>0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const n=rI(t.characterMapping,e,0);return new te(t.lineNumber,n)}getLineNumberFromChildDomNode(e){var t;return((t=this._getRenderedStickyLineFromChildDomNode(e))==null?void 0:t.lineNumber)??null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._renderedStickyLines.length?null:this._renderedStickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,_V);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,W1e)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,U1e)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const n=e.getAttribute(t);if(n!==null)return n;e=e.parentElement}}}class fat{constructor(e,t,n,r,s,o,a){this.index=e,this.lineNumber=t,this.lineDomNode=n,this.lineNumberDomNode=r,this.foldingIcon=s,this.characterMapping=o,this.scrollWidth=a}}class gat{constructor(e,t,n,r){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=n,this.dimension=r,this.domNode=document.createElement("div"),this.domNode.style.width=`${r}px`,this.domNode.style.height=`${r}px`,this.domNode.className=ot.asClassName(e?t9:e9)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class __{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class Q9{constructor(e,t,n){this.range=e,this.children=t,this.parent=n}}class q1e{constructor(e,t,n,r){this.uri=e,this.version=t,this.element=n,this.outlineProviderId=r}}var K9=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},v_=function(i,e){return function(t,n){e(t,n,i)}},y_;(function(i){i.OUTLINE_MODEL="outlineModel",i.FOLDING_PROVIDER_MODEL="foldingProviderModel",i.INDENTATION_MODEL="indentationModel"})(y_||(y_={}));var Hf;(function(i){i[i.VALID=0]="VALID",i[i.INVALID=1]="INVALID",i[i.CANCELED=2]="CANCELED"})(Hf||(Hf={}));let vV=class extends re{constructor(e,t,n,r){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new $a(300)),this._updateOperation=this._register(new ge),this._editor.getOption(116).defaultModel){case y_.OUTLINE_MODEL:this._modelProviders.push(new yV(this._editor,r));case y_.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new SV(this._editor,t,r));case y_.INDENTATION_MODEL:this._modelProviders.push(new wV(this._editor,n));break}}dispose(){this._modelProviders.forEach(e=>e.dispose()),this._updateOperation.clear(),this._cancelModelPromise(),super.dispose()}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const t of this._modelProviders){const{statusPromise:n,modelPromise:r}=t.computeStickyModel(e);this._modelPromise=r;const s=await n;if(this._modelPromise!==r)return null;switch(s){case Hf.CANCELED:return this._updateOperation.clear(),null;case Hf.VALID:return t.stickyModel}}return null}).catch(t=>(bt(t),null))}};vV=K9([v_(2,Ke),v_(3,Be)],vV);class G1e extends re{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,Hf.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=er(n=>this.createModelFromProvider(n));return{statusPromise:t.then(n=>this.isModelValid(n)?e.isCancellationRequested?Hf.CANCELED:(this._stickyModel=this.createStickyModel(e,n),Hf.VALID):this._invalid()).then(void 0,n=>(bt(n),Hf.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let yV=class extends G1e{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return Jd.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){var o;const{stickyOutlineElement:n,providerID:r}=this._stickyModelFromOutlineModel(t,(o=this._stickyModel)==null?void 0:o.outlineProviderId),s=this._editor.getModel();return new q1e(s.uri,s.getVersionId(),n,r)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let n;if(jt.first(e.children.values())instanceof Nge){const a=jt.find(e.children.values(),l=>l.id===t);if(a)n=a.children;else{let l="",c=-1,u;for(const[d,h]of e.children.entries()){const f=this._findSumOfRangesOfGroup(h);f>c&&(u=h,c=f,l=h.id)}t=l,n=u.children}}else n=e.children;const r=[],s=Array.from(n.values()).sort((a,l)=>{const c=new __(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),u=new __(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(c,u)});for(const a of s)r.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new Q9(void 0,r,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const n=[];for(const s of e.children.values())if(s.symbol.selectionRange.startLineNumber!==s.symbol.range.endLineNumber)if(s.symbol.selectionRange.startLineNumber!==t)n.push(this._stickyModelFromOutlineElement(s,s.symbol.selectionRange.startLineNumber));else for(const o of s.children.values())n.push(this._stickyModelFromOutlineElement(o,s.symbol.selectionRange.startLineNumber));n.sort((s,o)=>this._comparator(s.range,o.range));const r=new __(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new Q9(r,n,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const n of e.children.values())t+=this._findSumOfRangesOfGroup(n);return e instanceof FR?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};yV=K9([v_(1,Be)],yV);class Z1e extends G1e{constructor(e){super(e),this._foldingLimitReporter=new Ege(e)}createStickyModel(e,t){const n=this._fromFoldingRegions(t),r=this._editor.getModel();return new q1e(r.uri,r.getVersionId(),n,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,n=[],r=new Q9(void 0,[],void 0);for(let s=0;s<t;s++){const o=e.getParentIndex(s);let a;o!==-1?a=n[o]:a=r;const l=new Q9(new __(e.getStartLineNumber(s),e.getEndLineNumber(s)+1),[],a);a.children.push(l),n.push(l)}return r}}let wV=class extends Z1e{constructor(e,t){super(e),this._languageConfigurationService=t,this.provider=this._register(new DR(e.getModel(),this._languageConfigurationService,this._foldingLimitReporter))}async createModelFromProvider(e){return this.provider.compute(e)}};wV=K9([v_(1,li)],wV);let SV=class extends Z1e{constructor(e,t,n){super(e),this._languageFeaturesService=n;const r=Pf.getFoldingRangeProviders(this._languageFeaturesService,e.getModel());r.length>0&&(this.provider=this._register(new MR(e.getModel(),r,t,this._foldingLimitReporter,void 0)))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){var t;return((t=this.provider)==null?void 0:t.compute(e))??null}};SV=K9([v_(2,Be)],SV);var pat=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Y1e=function(i,e){return function(t,n){e(t,n,i)}};class mat{constructor(e,t,n){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=n}}let CV=class extends re{constructor(e,t,n){super(),this._languageFeaturesService=t,this._languageConfigurationService=n,this._onDidChangeStickyScroll=this._register(new ie),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new ge),this._updateSoon=this._register(new yn(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(116)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(116).enabled&&(this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this.updateStickyModelProvider(),this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this._sessionStore.add(Qe(()=>{var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null})),this.updateStickyModelProvider(),this.update())}getVersionId(){var e;return(e=this._model)==null?void 0:e.version}updateStickyModelProvider(){var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null;const e=this._editor;e.hasModel()&&(this._stickyModelProvider=new vV(e,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){var e;(e=this._cts)==null||e.dispose(!0),this._cts=new oi,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=await this._stickyModelProvider.update(e);e.isCancellationRequested||(this._model=t)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,n,r,s){if(t.children.length===0)return;let o=s;const a=[];for(let u=0;u<t.children.length;u++){const d=t.children[u];d.range&&a.push(d.range.startLineNumber)}const l=this.updateIndex(k3(a,e.startLineNumber,(u,d)=>u-d)),c=this.updateIndex(k3(a,e.startLineNumber+r,(u,d)=>u-d));for(let u=l;u<=c;u++){const d=t.children[u];if(!d)return;if(d.range){const h=d.range.startLineNumber,f=d.range.endLineNumber;e.startLineNumber<=f+1&&h-1<=e.endLineNumber&&h!==o&&(o=h,n.push(new mat(h,f-1,r+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,n,r+1,h))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,n,r,s)}}getCandidateStickyLinesIntersecting(e){var r,s;if(!((r=this._model)!=null&&r.element))return[];let t=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,t,0,-1);const n=(s=this._editor._getViewModel())==null?void 0:s.getHiddenAreas();if(n)for(const o of n)t=t.filter(a=>!(a.startLineNumber>=o.startLineNumber&&a.endLineNumber<=o.endLineNumber+1));return t}};CV=pat([Y1e(1,Be),Y1e(2,li)],CV);var bat=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},w2=function(i,e){return function(t,n){e(t,n,i)}},xV;let rh=(Lm=class extends re{constructor(e,t,n,r,s,o,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=n,this._instaService=r,this._contextKeyService=a,this._sessionStore=new ge,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._stickyScrollWidget=new hat(this._editor),this._stickyLineCandidateProvider=new CV(this._editor,n,s),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=b_.Empty,this._onDidResize(),this._readConfiguration();const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(u=>{this._readConfigurationChange(u)})),this._register(ae(l,ke.CONTEXT_MENU,async u=>{this._onContextMenu(nt(l),u)})),this._stickyScrollFocusedContextKey=B.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=B.stickyScrollVisible.bindTo(this._contextKeyService);const c=this._register(sc(l));this._register(c.onDidBlur(u=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(c.onDidFocus(u=>{this.focus()})),this._registerMouseListeners(),this._register(ae(l,ke.MOUSE_DOWN,u=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(xV.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)==null||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new ge,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex<this._stickyScrollWidget.lineNumberCount-1&&this._focusNav(!0)}focusPrevious(){this._focusedStickyElementIndex>0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(M.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new ge),t=this._register(new NS(this._editor,{extractLineNumberFromMouseEvent:s=>{const o=this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);return o?o.lineNumber:0}})),n=s=>{if(!this._editor.hasModel()||s.target.type!==12||s.target.detail!==this._stickyScrollWidget.getId())return null;const o=s.target.element;if(!o||o.innerText!==o.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(o);return a?{range:new M(a.lineNumber,a.column,a.lineNumber,a.column+o.innerText.length),textElement:o}:null},r=this._stickyScrollWidget.getDomNode();this._register(pi(r,ke.CLICK,s=>{if(s.ctrlKey||s.altKey||s.metaKey||!s.leftButton)return;if(s.shiftKey){const c=this._stickyScrollWidget.getLineIndexFromChildDomNode(s.target);if(c===null)return;const u=new te(this._endLineNumbers[c],1);this._revealLineInCenterIfOutsideViewport(u);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(s.target)){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);this._toggleFoldingRegionForLine(c);return}if(!this._stickyScrollWidget.isInStickyLine(s.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(s.target);if(!l){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);if(c===null)return;l=new te(c,1)}this._revealPosition(l)})),this._register(pi(r,ke.MOUSE_MOVE,s=>{if(s.shiftKey){const o=this._stickyScrollWidget.getLineIndexFromChildDomNode(s.target);if(o===null||this._showEndForLine!==null&&this._showEndForLine===o)return;this._showEndForLine=o,this._renderStickyScroll();return}this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(ae(r,ke.MOUSE_LEAVE,s=>{this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([s,o])=>{const a=n(s);if(!a||!s.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:c}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(c.style.textDecoration==="underline")return;const u=new oi;e.add(Qe(()=>u.dispose(!0)));let d;Vb(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new te(l.startLineNumber,l.startColumn+1),!1,u.token).then(h=>{if(!u.token.isCancellationRequested)if(h.length!==0){this._candidateDefinitionsLength=h.length;const f=c;d!==f?(e.clear(),d=f,d.style.textDecoration="underline",e.add(Qe(()=>{d.style.textDecoration="none"}))):d||(d=f,d.style.textDecoration="underline",e.add(Qe(()=>{d.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async s=>{if(s.target.type!==12||s.target.detail!==this._stickyScrollWidget.getId())return;const o=this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);o&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:o.lineNumber,column:1})),this._instaService.invokeFunction(Wfe,s,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const n=new yl(e,t);this._contextMenuService.showContextMenu({menuId:je.StickyScrollContext,getAnchor:()=>n})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),n=t==null?void 0:t.foldingIcon;if(!n)return;TR(this._foldingModel,Number.MAX_VALUE,[e]),n.isCollapsed=!n.isCollapsed;const r=(n.isCollapsed?this._editor.getTopForLineNumber(n.foldingEndLine):this._editor.getTopForLineNumber(n.foldingStartLine))-this._editor.getOption(67)*t.index+1;this._editor.setScrollTop(r),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(116);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(n=>{n.scrollTopChanged&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(n=>this._onTokensChange(n))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=void 0,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(68).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=void 0,this._renderStickyScroll(0)}))}_readConfigurationChange(e){(e.hasChanged(116)||e.hasChanged(73)||e.hasChanged(67)||e.hasChanged(111)||e.hasChanged(68))&&this._readConfiguration(),e.hasChanged(68)&&this._renderStickyScroll(0)}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const n of t)for(const r of e.ranges)if(n>=r.fromLineNumber&&n<=r.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(0)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(67);this._maxStickyLines=Math.round(t*.25)}async _renderStickyScroll(e){const t=this._editor.getModel();if(!t||t.isTooLargeForTokenization()){this._resetState();return}const n=this._updateAndGetMinRebuildFromLine(e),r=this._stickyLineCandidateProvider.getVersionId();if(r===void 0||r===t.getVersionId())if(!this._focused)await this._updateState(n);else if(this._focusedStickyElementIndex===-1)await this._updateState(n),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const o=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(n),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(o)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}_updateAndGetMinRebuildFromLine(e){if(e!==void 0){const t=this._minRebuildFromLine!==void 0?this._minRebuildFromLine:1/0;this._minRebuildFromLine=Math.min(e,t)}return this._minRebuildFromLine}async _updateState(e){var n;this._minRebuildFromLine=void 0,this._foldingModel=await((n=Pf.get(this._editor))==null?void 0:n.getFoldingModel())??void 0,this._widgetState=this.findScrollWidgetState();const t=this._widgetState.startLineNumbers.length>0;this._stickyScrollVisibleContextKey.set(t),this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}async _resetState(){this._minRebuildFromLine=void 0,this._foldingModel=void 0,this._widgetState=b_.Empty,this._stickyScrollVisibleContextKey.set(!1),this._stickyScrollWidget.setState(void 0,void 0)}findScrollWidgetState(){const e=this._editor.getOption(67),t=Math.min(this._maxStickyLines,this._editor.getOption(116).maxLineCount),n=this._editor.getScrollTop();let r=0;const s=[],o=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new __(a[0].startLineNumber,a[a.length-1].endLineNumber),c=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const u of c){const d=u.startLineNumber,h=u.endLineNumber,f=u.nestingDepth;if(h-d>0){const g=(f-1)*e,p=f*e,m=this._editor.getBottomForLineNumber(d)-n,_=this._editor.getTopForLineNumber(h)-n,v=this._editor.getBottomForLineNumber(h)-n;if(g>_&&g<=v){s.push(d),o.push(h+1),r=v-p;break}else p>m&&p<=v&&(s.push(d),o.push(h+1));if(s.length===t)break}}}return this._endLineNumbers=o,new b_(s,o,r,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},xV=Lm,Lm.ID="store.contrib.stickyScrollController",Lm);rh=xV=bat([w2(1,Ao),w2(2,Be),w2(3,Ke),w2(4,li),w2(5,fa),w2(6,lt)],rh);class _at extends Ms{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...ut("toggleEditorStickyScroll","Toggle Editor Sticky Scroll"),mnemonicTitle:b({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Editor Sticky Scroll")},metadata:{description:ut("toggleEditorStickyScroll.description","Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:uat.View,toggled:{condition:pe.equals("config.editor.stickyScroll.enabled",!0),title:b("stickyScroll","Sticky Scroll"),mnemonicTitle:b({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:je.CommandPalette},{id:je.MenubarAppearanceMenu,group:"4_editor",order:3},{id:je.StickyScrollContext}]})}async run(e){const t=e.get(Lt),n=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",n)}}const J9=100;class vat extends lc{constructor(){super({id:"editor.action.focusStickyScroll",title:{...ut("focusStickyScroll","Focus on the editor sticky scroll"),mnemonicTitle:b({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll")},precondition:pe.and(pe.has("config.editor.stickyScroll.enabled"),B.stickyScrollVisible),menu:[{id:je.CommandPalette}]})}runEditorCommand(e,t){var n;(n=rh.get(t))==null||n.focus()}}class yat extends lc{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:ut("selectNextStickyScrollLine.title","Select the next editor sticky scroll line"),precondition:B.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:J9,primary:18}})}runEditorCommand(e,t){var n;(n=rh.get(t))==null||n.focusNext()}}class wat extends lc{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:ut("selectPreviousStickyScrollLine.title","Select the previous sticky scroll line"),precondition:B.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:J9,primary:16}})}runEditorCommand(e,t){var n;(n=rh.get(t))==null||n.focusPrevious()}}class Sat extends lc{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:ut("goToFocusedStickyScrollLine.title","Go to the focused sticky scroll line"),precondition:B.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:J9,primary:3}})}runEditorCommand(e,t){var n;(n=rh.get(t))==null||n.goToFocused()}}class Cat extends lc{constructor(){super({id:"editor.action.selectEditor",title:ut("selectEditor.title","Select Editor"),precondition:B.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:J9,primary:9}})}runEditorCommand(e,t){var n;(n=rh.get(t))==null||n.selectEditor()}}qt(rh.ID,rh,1),En(_at),En(vat),En(wat),En(yat),En(Sat),En(Cat);var X1e=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},w_=function(i,e){return function(t,n){e(t,n,i)}};class xat{constructor(e,t,n,r,s,o){this.range=e,this.insertText=t,this.filterText=n,this.additionalTextEdits=r,this.command=s,this.completion=o}}let OV=class extends eEe{constructor(e,t,n,r,s,o){super(s.disposable),this.model=e,this.line=t,this.word=n,this.completionModel=r,this._suggestMemoryService=o}canBeReused(e,t,n){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===n.startColumn&&this.word.endColumn<n.endColumn&&this.completionModel.getIncompleteProvider().size===0}get items(){const e=[],{items:t}=this.completionModel,n=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},t),r=jt.slice(t,n),s=jt.slice(t,0,n);let o=5;for(const a of jt.concat(r,s)){if(a.score===gc.Default)continue;const l=new M(a.editStart.lineNumber,a.editStart.column,a.editInsertEnd.lineNumber,a.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),c=a.completion.insertTextRules&&a.completion.insertTextRules&4?{snippet:a.completion.insertText}:a.completion.insertText;e.push(new xat(l,c,a.filterTextLow??a.labelLow,a.completion.additionalTextEdits,a.completion.command,a)),o-->=0&&a.resolve(St.None)}return e}};OV=X1e([w_(5,g9)],OV);let LV=class extends re{constructor(e,t,n,r){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=n,this._editorService=r,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,n,r){var f;if(n.selectedSuggestionInfo)return;let s;for(const g of this._editorService.listCodeEditors())if(g.getModel()===e){s=g;break}if(!s)return;const o=s.getOption(90);if(o2.isAllOff(o))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(o2.valueFor(o,l)!=="inline")return;let c=e.getWordAtPosition(t),u;if(c!=null&&c.word||(u=this._getTriggerCharacterInfo(e,t)),!(c!=null&&c.word)&&!u||(c||(c=e.getWordUntilPosition(t)),c.endColumn!==t.column))return;let d;const h=e.getValueInRange(new M(t.lineNumber,1,t.lineNumber,t.column));if(!u&&((f=this._lastResult)!=null&&f.canBeReused(e,t.lineNumber,c))){const g=new s1e(h,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=g,this._lastResult.acquire(),d=this._lastResult}else{const g=await jR(this._languageFeatureService.completionProvider,e,t,new Zb(void 0,_9.createSuggestFilter(s).itemKind,u==null?void 0:u.providers),u&&{triggerKind:1,triggerCharacter:u.ch},r);let p;g.needsClipboard&&(p=await this._clipboardService.readText());const m=new Df(g.items,t.column,new s1e(h,0),b9.None,s.getOption(119),s.getOption(113),{boostFullMatch:!1,firstMatchCanBeWeak:!1},p);d=new OV(e,t.lineNumber,c,m,g,this._suggestMemoryService)}return this._lastResult=d,d}handleItemDidShow(e,t){t.completion.resolve(St.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var s;const n=e.getValueInRange(M.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),r=new Set;for(const o of this._languageFeatureService.completionProvider.all(e))(s=o.triggerCharacters)!=null&&s.includes(n)&&r.add(o);if(r.size!==0)return{providers:r,ch:n}}};LV=X1e([w_(0,Be),w_(1,Hd),w_(2,g9),w_(3,Kt)],LV),c4(LV);class Oat extends Ve{constructor(){super({id:"editor.action.forceRetokenize",label:b("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getModel();n.tokenization.resetTokenization();const r=new lr;n.tokenization.forceTokenization(n.getLineCount()),r.stop(),console.log(`tokenization took ${r.elapsed()}`)}}we(Oat);const OO=class OO extends Ms{constructor(){super({id:OO.ID,title:ut({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},metadata:{description:ut("tabMovesFocusDescriptions","Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const t=!f4.getTabFocusMode();f4.setTabFocusMode(t),Vs(t?b("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):b("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}};OO.ID="editor.action.toggleTabFocusMode";let kV=OO;En(kV);var Lat=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Q1e=function(i,e){return function(t,n){e(t,n,i)}};let EV=class extends re{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,n={},r,s){super(),this._link=t,this._hoverService=r,this._enabled=!0,this.el=_e(e,Ee("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=n.hoverDelegate??Hs("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const o=this._register(new Ht(this.el,"click")),a=this._register(new Ht(this.el,"keypress")),l=Pe.chain(a.event,d=>d.map(h=>new kn(h)).filter(h=>h.keyCode===3)),c=this._register(new Ht(this.el,In.Tap)).event;this._register(Kr.addTarget(this.el));const u=Pe.any(o.event,l,c);this._register(u(d=>{this.enabled&&(zt.stop(d,!0),n!=null&&n.opener?n.opener(this._link.href):s.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){this.hoverDelegate.showNativeHover?this.el.title=e??"":!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};EV=Lat([Q1e(3,gu),Q1e(4,lo)],EV);var K1e=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},J1e=function(i,e){return function(t,n){e(t,n,i)}};const kat=26;let TV=class extends re{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(PV))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{var t;this.hide(),(t=e.onClose)==null||t.call(e)}}),this._editor.setBanner(this.banner.element,kat)}};TV=K1e([J1e(1,Ke)],TV);let PV=class extends re{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(Od,{}),this.element=Ee("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=Ee("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){br(this.element)}show(e){br(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const n=_e(this.element,Ee("div.icon-container"));n.setAttribute("aria-hidden","true"),e.icon&&n.appendChild(Ee(`div${ot.asCSSSelector(e.icon)}`));const r=_e(this.element,Ee("div.message-container"));if(r.setAttribute("aria-hidden","true"),r.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=_e(this.element,Ee("div.message-actions-container")),e.actions)for(const o of e.actions)this._register(this.instantiationService.createInstance(EV,this.messageActionsContainer,{...o,tabIndex:-1},{}));const s=_e(this.element,Ee("div.action-container"));this.actionBar=this._register(new ya(s)),this.actionBar.push(this._register(new Do("banner.close","Close Banner",ot.asClassName(Dce),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};PV=K1e([J1e(0,Ke)],PV);var NV=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},S2=function(i,e){return function(t,n){e(t,n,i)}};const Eat=Vn("extensions-warning-message",Le.warning,b("warningIcon","Icon shown with a warning message in the extensions editor."));let S_=(w3=class extends re{constructor(e,t,n,r){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=n,this._highlighter=null,this._bannerClosed=!1,this._updateState=s=>{if(s&&s.hasMore){if(this._bannerClosed)return;const o=Math.max(s.ambiguousCharacterCount,s.nonBasicAsciiCharacterCount,s.invisibleCharacterCount);let a;if(s.nonBasicAsciiCharacterCount>=o)a={message:b("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new x_};else if(s.ambiguousCharacterCount>=o)a={message:b("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new yp};else if(s.invisibleCharacterCount>=o)a={message:b("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new C_};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:Eat,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(r.createInstance(TV,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(126),this._register(n.onDidChangeTrust(s=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(s=>{s.hasChanged(126)&&(this._options=e.getOption(126),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=Tat(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(n=>n===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(n=>n.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(n=>n==="_os"?new Intl.NumberFormat().resolvedOptions().locale:n==="_vscode"?tke:n)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new DV(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new Pat(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},w3.ID="editor.contrib.unicodeHighlighter",w3);S_=NV([S2(1,ho),S2(2,$oe),S2(3,Ke)],S_);function Tat(i,e){return{nonBasicASCII:e.nonBasicASCII===ra?!i:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===ra?!i:e.includeComments,includeStrings:e.includeStrings===ra?!i:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let DV=class extends re{constructor(e,t,n,r){super(),this._editor=e,this._options=t,this._updateState=n,this._editorWorkerService=r,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new yn(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const n=[];if(!t.hasMore)for(const r of t.ranges)n.push({range:r,options:eC.instance.getDecorationFromOptions(this._options)});this._decorations.set(n)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!YI(t,e))return null;const n=t.getValueInRange(e.range);return{reason:tpe(n,this._options),inComment:XI(t,e),inString:QI(t,e)}}};DV=NV([S2(3,ho)],DV);class Pat extends re{constructor(e,t,n){super(),this._editor=e,this._options=t,this._updateState=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new yn(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],n={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const r of e){const s=NE.computeUnicodeHighlights(this._model,this._options,r);for(const o of s.ranges)n.ranges.push(o);n.ambiguousCharacterCount+=n.ambiguousCharacterCount,n.invisibleCharacterCount+=n.invisibleCharacterCount,n.nonBasicAsciiCharacterCount+=n.nonBasicAsciiCharacterCount,n.hasMore=n.hasMore||s.hasMore}if(!n.hasMore)for(const r of n.ranges)t.push({range:r,options:eC.instance.getDecorationFromOptions(this._options)});this._updateState(n),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),n=t.getValueInRange(e.range);return YI(t,e)?{reason:tpe(n,this._options),inComment:XI(t,e),inString:QI(t,e)}:null}}const epe=b("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options");let IV=class{constructor(e,t,n){this._editor=e,this._languageService=t,this._openerService=n,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const n=this._editor.getModel(),r=this._editor.getContribution(S_.ID);if(!r)return[];const s=[],o=new Set;let a=300;for(const l of t){const c=r.getDecorationInfo(l);if(!c)continue;const d=n.getValueInRange(l.range).codePointAt(0),h=MV(d);let f;switch(c.reason.kind){case 0:{j3(c.reason.confusableWith)?f=b("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",h,MV(c.reason.confusableWith.codePointAt(0))):f=b("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",h,MV(c.reason.confusableWith.codePointAt(0)));break}case 1:f=b("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",h);break;case 2:f=b("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",h);break}if(o.has(f))continue;o.add(f);const g={codePoint:d,reason:c.reason,inComment:c.inComment,inString:c.inString},p=b("unicodeHighlight.adjustSettings","Adjust settings"),m=`command:${tC.ID}?${encodeURIComponent(JSON.stringify(g))}`,_=new Jr("",!0).appendMarkdown(f).appendText(" ").appendLink(m,p,epe);s.push(new Al(this,l.range,[_],!1,a++))}return s}renderHoverParts(e,t){return ret(e,t,this._editor,this._languageService,this._openerService)}};IV=NV([S2(1,Jn),S2(2,lo)],IV);function AV(i){return`U+${i.toString(16).padStart(4,"0")}`}function MV(i){let e=`\`${AV(i)}\``;return Ag.isInvisibleCharacter(i)||(e+=` "${`${Nat(i)}`}"`),e}function Nat(i){return i===96?"`` ` ``":"`"+String.fromCodePoint(i)+"`"}function tpe(i,e){return NE.computeUnicodeHighlightReason(i,e)}const LO=class LO{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const n=`${e}${t}`;let r=this.map.get(n);return r||(r=vt.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(n,r)),r}};LO.instance=new LO;let eC=LO;class Dat extends Ve{constructor(){super({id:yp.ID,label:b("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=b("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}async run(e,t,n){const r=e==null?void 0:e.get(Lt);r&&this.runAction(r)}async runAction(e){await e.updateValue(to.includeComments,!1,2)}}class Iat extends Ve{constructor(){super({id:yp.ID,label:b("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=b("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}async run(e,t,n){const r=e==null?void 0:e.get(Lt);r&&this.runAction(r)}async runAction(e){await e.updateValue(to.includeStrings,!1,2)}}const kO=class kO extends Ve{constructor(){super({id:kO.ID,label:b("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=b("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}async run(e,t,n){const r=e==null?void 0:e.get(Lt);r&&this.runAction(r)}async runAction(e){await e.updateValue(to.ambiguousCharacters,!1,2)}};kO.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let yp=kO;const EO=class EO extends Ve{constructor(){super({id:EO.ID,label:b("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=b("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}async run(e,t,n){const r=e==null?void 0:e.get(Lt);r&&this.runAction(r)}async runAction(e){await e.updateValue(to.invisibleCharacters,!1,2)}};EO.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let C_=EO;const TO=class TO extends Ve{constructor(){super({id:TO.ID,label:b("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=b("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}async run(e,t,n){const r=e==null?void 0:e.get(Lt);r&&this.runAction(r)}async runAction(e){await e.updateValue(to.nonBasicASCII,!1,2)}};TO.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let x_=TO;const PO=class PO extends Ve{constructor(){super({id:PO.ID,label:b("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,n){const{codePoint:r,reason:s,inString:o,inComment:a}=n,l=String.fromCodePoint(r),c=e.get(Ja),u=e.get(Lt);function d(g){return Ag.isInvisibleCharacter(g)?b("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",AV(g)):b("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${AV(g)} "${l}"`)}const h=[];if(s.kind===0)for(const g of s.notAmbiguousInLocales)h.push({label:b("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',g),run:async()=>{Mat(u,[g])}});if(h.push({label:d(r),run:()=>Aat(u,[r])}),a){const g=new Dat;h.push({label:g.label,run:async()=>g.runAction(u)})}else if(o){const g=new Iat;h.push({label:g.label,run:async()=>g.runAction(u)})}if(s.kind===0){const g=new yp;h.push({label:g.label,run:async()=>g.runAction(u)})}else if(s.kind===1){const g=new C_;h.push({label:g.label,run:async()=>g.runAction(u)})}else if(s.kind===2){const g=new x_;h.push({label:g.label,run:async()=>g.runAction(u)})}else Rat(s);const f=await c.pick(h,{title:epe});f&&await f.run()}};PO.ID="editor.action.unicodeHighlight.showExcludeOptions";let tC=PO;async function Aat(i,e){const t=i.getValue(to.allowedCharacters);let n;typeof t=="object"&&t?n=t:n={};for(const r of e)n[String.fromCodePoint(r)]=!0;await i.updateValue(to.allowedCharacters,n,2)}async function Mat(i,e){var r;const t=(r=i.inspect(to.allowedLocales).user)==null?void 0:r.value;let n;typeof t=="object"&&t?n=Object.assign({},t):n={};for(const s of e)n[s]=!0;await i.updateValue(to.allowedLocales,n,2)}function Rat(i){throw new Error(`Unexpected value: ${i}`)}we(yp),we(C_),we(x_),we(tC),qt(S_.ID,S_,1),sp.register(IV);var Fat=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},npe=function(i,e){return function(t,n){e(t,n,i)}};const ipe="ignoreUnusualLineTerminators";function Vat(i,e,t){i.setModelProperty(e.uri,ipe,t)}function Hat(i,e){return i.getModelProperty(e.uri,ipe)}let nC=(S3=class extends re{constructor(e,t,n){super(),this._editor=e,this._dialogService=t,this._codeEditorService=n,this._isPresentingDialog=!1,this._config=this._editor.getOption(127),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(127)&&(this._config=this._editor.getOption(127),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(r=>{r.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||Hat(this._codeEditorService,e)===!0||this._editor.getOption(92))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let n;try{this._isPresentingDialog=!0,n=await this._dialogService.confirm({title:b("unusualLineTerminators.title","Unusual Line Terminators"),message:b("unusualLineTerminators.message","Detected unusual line terminators"),detail:b("unusualLineTerminators.detail","The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",Xa(e.uri)),primaryButton:b({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:b("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!n.confirmed){Vat(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},S3.ID="editor.contrib.unusualLineTerminatorsDetector",S3);nC=Fat([npe(1,_8),npe(2,Kt)],nC),qt(nC.ID,nC,1);var Bat=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},zat=function(i,e){return function(t,n){e(t,n,i)}};class rpe{constructor(){this.selector={language:"*"}}provideDocumentHighlights(e,t,n){const r=[],s=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return s?e.isDisposed()?void 0:e.findMatches(s.word,!0,!1,!0,Mv,!1).map(a=>({range:a.range,kind:Wm.Text})):Promise.resolve(r)}provideMultiDocumentHighlights(e,t,n,r){const s=new dr,o=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!o)return Promise.resolve(s);for(const a of[e,...n]){if(a.isDisposed())continue;const c=a.findMatches(o.word,!0,!1,!0,Mv,!1).map(u=>({range:u.range,kind:Wm.Text}));c&&s.set(a.uri,c)}return s}}let RV=class extends re{constructor(e){super(),this._register(e.documentHighlightProvider.register("*",new rpe)),this._register(e.multiDocumentHighlightProvider.register("*",new rpe))}};RV=Bat([zat(0,Be)],RV);var spe=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},iC=function(i,e){return function(t,n){e(t,n,i)}},Ii,FV;const VV=new Ae("hasWordHighlights",!1);function ope(i,e,t,n){const r=i.ordered(e);return kk(r.map(s=>()=>Promise.resolve(s.provideDocumentHighlights(e,t,n)).then(void 0,xi)),s=>s!=null).then(s=>{if(s){const o=new dr;return o.set(e.uri,s),o}return new dr})}function $at(i,e,t,n,r,s){const o=i.ordered(e);return kk(o.map(a=>()=>{const l=s.filter(c=>hre(c)).filter(c=>cT(a.selector,c.uri,c.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,l,r)).then(void 0,xi)}),a=>a!=null)}class ape{constructor(e,t,n){this._model=e,this._selection=t,this._wordSeparators=n,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=er(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const n=e.getWordAtPosition(t.getPosition());return n?new M(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):null}isValid(e,t,n){const r=t.startLineNumber,s=t.startColumn,o=t.endColumn,a=this._getCurrentWordRange(e,t);let l=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let c=0,u=n.length;!l&&c<u;c++){const d=n.getRange(c);d&&d.startLineNumber===r&&d.startColumn<=s&&d.endColumn>=o&&(l=!0)}return l}cancel(){this.result.cancel()}}class jat extends ape{constructor(e,t,n,r){super(e,t,n),this._providers=r}_compute(e,t,n,r){return ope(this._providers,e,t.getPosition(),r).then(s=>s||new dr)}}class Wat extends ape{constructor(e,t,n,r,s){super(e,t,n),this._providers=r,this._otherModels=s}_compute(e,t,n,r){return $at(this._providers,e,t.getPosition(),n,r,this._otherModels).then(s=>s||new dr)}}function Uat(i,e,t,n,r){return new jat(e,t,r,i)}function qat(i,e,t,n,r,s){return new Wat(e,t,r,i,s)}oo("_executeDocumentHighlights",async(i,e,t)=>{const n=i.get(Be),r=await ope(n.documentHighlightProvider,e,t,St.None);return r==null?void 0:r.get(e.uri)});let HV=(wg=class{constructor(e,t,n,r,s){this.toUnhook=new ge,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new dr,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.runDelayer=this.toUnhook.add(new $a(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=n,this.codeEditorService=s,this._hasWordHighlights=VV.bindTo(r),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(81),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(o=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this.runDelayer.trigger(()=>{this._onPositionChanged(o)})})),this.toUnhook.add(e.onDidFocusEditorText(o=>{this.occurrencesHighlight!=="off"&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}))})),this.toUnhook.add(e.onDidChangeModelContent(o=>{a5(this.model.uri,"output")||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(o=>{!o.newModelUrl&&o.oldModelUrl?this._stopSingular():Ii.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(o=>{var l,c;const a=this.editor.getOption(81);if(this.occurrencesHighlight!==a)switch(this.occurrencesHighlight=a,a){case"off":this._stopAll();break;case"singleFile":this._stopAll((c=(l=Ii.query)==null?void 0:l.modelInfo)==null?void 0:c.model);break;case"multiFile":Ii.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",a);break}})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,Ii.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&(this.runDelayer.cancel(),this._run())}_getSortedHighlights(){return this.decorations.getRanges().sort(M.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),n=(e.findIndex(s=>s.containsPosition(this.editor.getPosition()))+1)%e.length,r=e[n];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(r.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(r);const s=this._getWord();if(s){const o=this.editor.getModel().getLineContent(r.startLineNumber);Vs(`${o}, ${n+1} of ${e.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),n=(e.findIndex(s=>s.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,r=e[n];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(r.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(r);const s=this._getWord();if(s){const o=this.editor.getModel().getLineContent(r.startLineNumber);Vs(`${o}, ${n+1} of ${e.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=Ii.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),Ii.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){const t=this.codeEditorService.listCodeEditors(),n=[];for(const r of t){if(!r.hasModel()||R8(r.getModel().uri,e==null?void 0:e.uri))continue;const s=Ii.storedDecorationIDs.get(r.getModel().uri);if(!s)continue;r.removeDecorations(s),n.push(r.getModel().uri);const o=Bf.get(r);o!=null&&o.wordHighlighter&&o.wordHighlighter.decorations.length>0&&(o.wordHighlighter.decorations.clear(),o.wordHighlighter.workerRequest=null,o.wordHighlighter._hasWordHighlights.set(!1))}for(const r of n)Ii.storedDecorationIDs.delete(r)}_stopSingular(){var e,t,n,r;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((e=this.editor.getModel())==null?void 0:e.uri.scheme)!==_t.vscodeNotebookCell&&((n=(t=Ii.query)==null?void 0:t.modelInfo)==null?void 0:n.model.uri.scheme)!==_t.vscodeNotebookCell?(Ii.query=null,this._run()):(r=Ii.query)!=null&&r.modelInfo&&(Ii.query.modelInfo=null)),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(e){this._removeAllDecorations(e),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){var t;if(this.occurrencesHighlight==="off"){this._stopAll();return}if(e.reason!==3&&((t=this.editor.getModel())==null?void 0:t.uri.scheme)!==_t.vscodeNotebookCell){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,n=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:n})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===_t.vscodeNotebookCell){const s=[],o=this.codeEditorService.listCodeEditors();for(const a of o){const l=a.getModel();l&&l!==e&&l.uri.scheme===_t.vscodeNotebookCell&&s.push(l)}return s}const n=[],r=this.codeEditorService.listCodeEditors();for(const s of r){if(!BA(s))continue;const o=s.getModel();o&&e===o.modified&&n.push(o.modified)}if(n.length)return n;if(this.occurrencesHighlight==="singleFile")return[];for(const s of r){const o=s.getModel();o&&o!==e&&n.push(o)}return n}_run(e){var r,s;let t;if(this.editor.hasTextFocus()){const o=this.editor.getSelection();if(!o||o.startLineNumber!==o.endLineNumber){Ii.query=null,this._stopAll();return}const a=o.startColumn,l=o.endColumn,c=this._getWord();if(!c||c.startColumn>a||c.endColumn<l){Ii.query=null,this._stopAll();return}t=this.workerRequest&&this.workerRequest.isValid(this.model,o,this.decorations),Ii.query={modelInfo:{model:this.model,selection:o},word:c}}else if(!Ii.query){this._stopAll();return}if(this.lastCursorPositionChangeTime=new Date().getTime(),t)this.workerRequestCompleted&&this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else if(R8(this.editor.getModel().uri,(r=Ii.query.modelInfo)==null?void 0:r.model.uri)){if(!e){const l=this.decorations.getRanges();for(const c of l)if(c.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model:void 0);const o=++this.workerRequestTokenId;this.workerRequestCompleted=!1;const a=this.getOtherModelsToHighlight(this.editor.getModel());if(!Ii.query||!Ii.query.modelInfo||Ii.query.modelInfo.model.isDisposed())return;this.workerRequest=this.computeWithModel(Ii.query.modelInfo.model,Ii.query.modelInfo.selection,Ii.query.word,a),(s=this.workerRequest)==null||s.result.then(l=>{o===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=l||[],this._beginRenderDecorations())},bt)}}computeWithModel(e,t,n,r){return r.length?qat(this.multiDocumentProviders,e,t,n,this.editor.getOption(132),r):Uat(this.providers,e,t,n,this.editor.getOption(132))}_beginRenderDecorations(){const e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){var t,n,r;this.renderDecorationsTimer=-1;const e=this.codeEditorService.listCodeEditors();for(const s of e){const o=Bf.get(s);if(!o)continue;const a=[],l=(t=s.getModel())==null?void 0:t.uri;if(l&&this.workerRequestValue.has(l)){const c=Ii.storedDecorationIDs.get(l),u=this.workerRequestValue.get(l);if(u)for(const h of u)h.range&&a.push({range:h.range,options:Ast(h.kind)});let d=[];s.changeDecorations(h=>{d=h.deltaDecorations(c??[],a)}),Ii.storedDecorationIDs=Ii.storedDecorationIDs.set(l,d),a.length>0&&((n=o.wordHighlighter)==null||n.decorations.set(a),(r=o.wordHighlighter)==null||r._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}},Ii=wg,wg.storedDecorationIDs=new dr,wg.query=null,wg);HV=Ii=spe([iC(4,Kt)],HV);let Bf=(km=class extends re{static get(e){return e.getContribution(FV.ID)}constructor(e,t,n,r){super(),this._wordHighlighter=null;const s=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new HV(e,n.documentHighlightProvider,n.multiDocumentHighlightProvider,t,r))};this._register(e.onDidChangeModel(o=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),s()})),s()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)==null||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)==null||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},FV=km,km.ID="editor.contrib.wordHighlighter",km);Bf=FV=spe([iC(1,lt),iC(2,Be),iC(3,Kt)],Bf);class lpe extends Ve{constructor(e,t){super(t),this._isNext=e}run(e,t){const n=Bf.get(t);n&&(this._isNext?n.moveNext():n.moveBack())}}class Gat extends lpe{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:b("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:VV,kbOpts:{kbExpr:B.editorTextFocus,primary:65,weight:100}})}}class Zat extends lpe{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:b("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:VV,kbOpts:{kbExpr:B.editorTextFocus,primary:1089,weight:100}})}}class Yat extends Ve{constructor(){super({id:"editor.action.wordHighlight.trigger",label:b("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:void 0,kbOpts:{kbExpr:B.editorTextFocus,primary:0,weight:100}})}run(e,t,n){const r=Bf.get(t);r&&r.restoreViewState(!0)}}qt(Bf.ID,Bf,0),we(Gat),we(Zat),we(Yat),c4(RV);class rC extends Gi{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){if(!t.hasModel())return;const r=qa(t.getOption(132),t.getOption(131)),s=t.getModel(),o=t.getSelections(),a=o.length>1,l=o.map(c=>{const u=new te(c.positionLineNumber,c.positionColumn),d=this._move(r,s,u,this._wordNavigationType,a);return this._moveTo(c,d,this._inSelectionMode)});if(s.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,l.map(c=>Jt.fromModelSelection(c))),l.length===1){const c=new te(l[0].positionLineNumber,l[0].positionColumn);t.revealPosition(c,0)}}_moveTo(e,t,n){return n?new We(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new We(t.lineNumber,t.column,t.lineNumber,t.column)}}class zf extends rC{_move(e,t,n,r,s){return ln.moveWordLeft(e,t,n,r,s)}}class $f extends rC{_move(e,t,n,r,s){return ln.moveWordRight(e,t,n,r)}}class Xat extends zf{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class Qat extends zf{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class Kat extends zf{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:pe.and(B.textInputFocus,(e=pe.and(F8,Hy))==null?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class Jat extends zf{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class elt extends zf{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class tlt extends zf{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:pe.and(B.textInputFocus,(e=pe.and(F8,Hy))==null?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class nlt extends zf{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,n,r,s){return super._move(qa(Ql.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,s)}}class ilt extends zf{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,n,r,s){return super._move(qa(Ql.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,s)}}class rlt extends $f{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class slt extends $f{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:pe.and(B.textInputFocus,(e=pe.and(F8,Hy))==null?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class olt extends $f{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class alt extends $f{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class llt extends $f{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:pe.and(B.textInputFocus,(e=pe.and(F8,Hy))==null?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class clt extends $f{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class ult extends $f{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,n,r,s){return super._move(qa(Ql.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,s)}}class dlt extends $f{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,n,r,s){return super._move(qa(Ql.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,s)}}class sC extends Gi{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){const r=e.get(li);if(!t.hasModel())return;const s=qa(t.getOption(132),t.getOption(131)),o=t.getModel(),a=t.getSelections(),l=t.getOption(6),c=t.getOption(11),u=r.getLanguageConfiguration(o.getLanguageId()).getAutoClosingPairs(),d=t._getViewModel(),h=a.map(f=>{const g=this._delete({wordSeparators:s,model:o,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:u,autoClosedCharacters:d.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Rr(g,"")});t.pushUndoStop(),t.executeCommands(this.id,h),t.pushUndoStop()}}class BV extends sC{_delete(e,t){const n=ln.deleteWordLeft(e,t);return n||new M(1,1,1,1)}}class zV extends sC{_delete(e,t){const n=ln.deleteWordRight(e,t);if(n)return n;const r=e.model.getLineCount(),s=e.model.getLineMaxColumn(r);return new M(r,s,r,s)}}class hlt extends BV{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:B.writable})}}class flt extends BV{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:B.writable})}}class glt extends BV{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:B.writable,kbOpts:{kbExpr:B.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class plt extends zV{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:B.writable})}}class mlt extends zV{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:B.writable})}}class blt extends zV{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:B.writable,kbOpts:{kbExpr:B.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class _lt extends Ve{constructor(){super({id:"deleteInsideWord",precondition:B.writable,label:b("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,n){if(!t.hasModel())return;const r=qa(t.getOption(132),t.getOption(131)),s=t.getModel(),a=t.getSelections().map(l=>{const c=ln.deleteInsideWord(r,s,l);return new Rr(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}De(new Xat),De(new Qat),De(new Kat),De(new Jat),De(new elt),De(new tlt),De(new rlt),De(new slt),De(new olt),De(new alt),De(new llt),De(new clt),De(new nlt),De(new ilt),De(new ult),De(new dlt),De(new hlt),De(new flt),De(new glt),De(new plt),De(new mlt),De(new blt),we(_lt);class vlt extends sC{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:B.writable,kbOpts:{kbExpr:B.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const n=Ow.deleteWordPartLeft(e);return n||new M(1,1,1,1)}}class ylt extends sC{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:B.writable,kbOpts:{kbExpr:B.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const n=Ow.deleteWordPartRight(e);if(n)return n;const r=e.model.getLineCount(),s=e.model.getLineMaxColumn(r);return new M(r,s,r,s)}}class cpe extends rC{_move(e,t,n,r,s){return Ow.moveWordPartLeft(e,t,n,s)}}class wlt extends cpe{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:B.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}Wt.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class Slt extends cpe{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:B.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}Wt.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class upe extends rC{_move(e,t,n,r,s){return Ow.moveWordPartRight(e,t,n)}}class Clt extends upe{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:B.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class xlt extends upe{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:B.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}De(new vlt),De(new ylt),De(new wlt),De(new Slt),De(new Clt),De(new xlt);const Cte=class Cte extends re{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=Uo.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(93);t||(this.editor.isSimpleWidget?t=new Jr(b("editor.simple.readonly","Cannot edit in read-only input")):t=new Jr(b("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};Cte.ID="editor.contrib.readOnlyMessageController";let oC=Cte;qt(oC.ID,oC,2);var Olt=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},dpe=function(i,e){return function(t,n){e(t,n,i)}};let $V=class extends re{constructor(e,t,n){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=n,this._currentModel=kt(this,void 0);const r=Dr("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),s=Dr("_textModel.onDidChangeContent",Pe.debounce(o=>this._textModel.onDidChangeContent(o),()=>{},100));this._register(co(async(o,a)=>{r.read(o),s.read(o);const l=a.add(new uZe),c=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(c,void 0)}))}getBreadcrumbItems(e,t){const n=this._currentModel.read(t);if(!n)return[];const r=n.asListOfDocumentSymbols().filter(s=>e.contains(s.range.startLineNumber)&&!e.contains(s.range.endLineNumber));return r.sort(Rte(ks(s=>s.range.endLineNumber-s.range.startLineNumber,ml))),r.map(s=>({name:s.name,kind:s.kind,startLineNumber:s.range.startLineNumber}))}};$V=Olt([dpe(1,Be),dpe(2,qb)],$V),eS.setBreadcrumbsSourceFactory((i,e)=>e.createInstance($V,i));const xte=class xte extends re{constructor(e){super(),this.editor=e,this.widget=null,Xl&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(92);!this.widget&&e?this.widget=new jV(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};xte.ID="editor.contrib.iPadShowKeyboard";let aC=xte;const NO=class NO extends re{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(ae(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(ae(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return NO.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}};NO.ID="editor.contrib.ShowKeyboardWidget";let jV=NO;qt(aC.ID,aC,3);var Llt=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},hpe=function(i,e){return function(t,n){e(t,n,i)}},WV;let O_=(Em=class extends re{static get(e){return e.getContribution(WV.ID)}constructor(e,t,n){super(),this._editor=e,this._languageService=n,this._widget=null,this._register(this._editor.onDidChangeModel(r=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(r=>this.stop())),this._register(vi.onDidChange(r=>this.stop())),this._register(this._editor.onKeyUp(r=>r.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new UV(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}},WV=Em,Em.ID="editor.contrib.inspectTokens",Em);O_=WV=Llt([hpe(1,Oa),hpe(2,Jn)],O_);class klt extends Ve{constructor(){super({id:"editor.action.inspectTokens",label:vP.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const n=O_.get(t);n==null||n.launch()}}function Elt(i){let e="";for(let t=0,n=i.length;t<n;t++){const r=i.charCodeAt(t);switch(r){case 9:e+="→";break;case 32:e+="·";break;default:e+=String.fromCharCode(r)}}return e}function Tlt(i,e){const t=vi.get(e);if(t)return t;const n=i.encodeLanguageId(e);return{getInitialState:()=>E0,tokenize:(r,s,o)=>oP(e,o),tokenizeEncoded:(r,s,o)=>I7(n,o)}}const DO=class DO extends re{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=Tlt(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(n=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return DO._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let n=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){n=l;break}}let r=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){r=l;break}const s=this._model.getLineContent(e.lineNumber);let o="";if(n<t.tokens1.length){const l=t.tokens1[n].offset,c=n+1<t.tokens1.length?t.tokens1[n+1].offset:s.length;o=s.substring(l,c)}_r(this._domNode,Ee("h2.tm-token",void 0,Elt(o),Ee("span.tm-token-length",void 0,`${o.length} ${o.length===1?"char":"chars"}`))),_e(this._domNode,Ee("hr.tokens-inspect-separator",{style:"clear:both"}));const a=(r<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(r<<1)+1]):null;_e(this._domNode,Ee("table.tm-metadata-table",void 0,Ee("tbody",void 0,Ee("tr",void 0,Ee("td.tm-metadata-key",void 0,"language"),Ee("td.tm-metadata-value",void 0,`${a?a.languageId:"-?-"}`)),Ee("tr",void 0,Ee("td.tm-metadata-key",void 0,"token type"),Ee("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),Ee("tr",void 0,Ee("td.tm-metadata-key",void 0,"font style"),Ee("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),Ee("tr",void 0,Ee("td.tm-metadata-key",void 0,"foreground"),Ee("td.tm-metadata-value",void 0,`${a?be.Format.CSS.formatHex(a.foreground):"-?-"}`)),Ee("tr",void 0,Ee("td.tm-metadata-key",void 0,"background"),Ee("td.tm-metadata-value",void 0,`${a?be.Format.CSS.formatHex(a.background):"-?-"}`))))),_e(this._domNode,Ee("hr.tokens-inspect-separator")),n<t.tokens1.length&&_e(this._domNode,Ee("span.tm-token-type",void 0,t.tokens1[n].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const t=vi.getColorMap(),n=ao.getLanguageId(e),r=ao.getTokenType(e),s=ao.getFontStyle(e),o=ao.getForeground(e),a=ao.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(n),tokenType:r,fontStyle:s,foreground:t[o],background:t[a]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return e&1&&(t+="italic "),e&2&&(t+="bold "),e&4&&(t+="underline "),e&8&&(t+="strikethrough "),t.length===0&&(t="---"),t}_getTokensAtLine(e){const t=this._getStateBeforeLine(e),n=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),r=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:n.tokens,tokens2:r.tokens,endState:n.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let n=1;n<e;n++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(n),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}};DO._ID="editor.contrib.inspectTokensWidget";let UV=DO;qt(O_.ID,O_,4),we(klt);var Plt=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},fpe=function(i,e){return function(t,n){e(t,n,i)}},L_;let qV=(Tm=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=ai.as(C1.Quickaccess)}provide(e){const t=new ge;return t.add(e.onDidAccept(()=>{const[n]=e.selectedItems;n&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(n=>{const r=this.registry.getQuickAccessProvider(n.substr(L_.PREFIX.length));r&&r.prefix&&r.prefix!==L_.PREFIX&&this.quickInputService.quickAccess.show(r.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(n=>n.prefix!==L_.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,n)=>t.prefix.localeCompare(n.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const n=t.prefix||e.prefix,r=n||"…";return{prefix:n,label:r,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:b("helpPickAriaLabel","{0}, {1}",r,t.description),description:t.description}})}},L_=Tm,Tm.PREFIX="?",Tm);qV=L_=Plt([fpe(0,Ja),fpe(1,an)],qV),ai.as(C1.Quickaccess).registerQuickAccessProvider({ctor:qV,prefix:"",helpEntries:[{description:yP.helpQuickAccessActionLabel}]});class gpe{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,n){var o;const r=new ge;e.canAcceptInBackground=!!((o=this.options)!=null&&o.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const s=r.add(new Ki);return s.value=this.doProvide(e,t,n),r.add(this.onDidActiveTextEditorControlChange(()=>{s.value=void 0,s.value=this.doProvide(e,t)})),r}doProvide(e,t,n){const r=new ge,s=this.activeTextEditorControl;if(s&&this.canProvideWithTextEditor(s)){const o={editor:s},a=zde(s);if(a){let l=s.saveViewState()??void 0;r.add(a.onDidChangeCursorPosition(()=>{l=s.saveViewState()??void 0})),o.restoreViewState=()=>{l&&s===this.activeTextEditorControl&&s.restoreViewState(l)},r.add(kh(t.onCancellationRequested)(()=>{var c;return(c=o.restoreViewState)==null?void 0:c.call(o)}))}r.add(Qe(()=>this.clearDecorations(s))),r.add(this.provideWithTextEditor(o,e,t,n))}else r.add(this.provideWithoutTextEditor(e,t));return r}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,"code.jump"),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const n=e.getModel();n&&"getLineContent"in n&&bu(`${n.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return BA(e)?(t=e.getModel())==null?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(n=>{const r=[];this.rangeHighlightDecorationId&&(r.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),r.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const s=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:yi(Tae),position:ua.Full}}}],[o,a]=n.deltaDecorations(r,s);this.rangeHighlightDecorationId={rangeHighlightId:o,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(n=>{n.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const IO=class IO extends gpe{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=b("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,re.None}provideWithTextEditor(e,t,n){const r=e.editor,s=new ge;s.add(t.onDidAccept(l=>{const[c]=t.selectedItems;if(c){if(!this.isValidLineNumber(r,c.lineNumber))return;this.gotoLocation(e,{range:this.toRange(c.lineNumber,c.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));const o=()=>{const l=this.parsePosition(r,t.value.trim().substr(IO.PREFIX.length)),c=this.getPickLabel(r,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:c}],t.ariaLabel=c,!this.isValidLineNumber(r,l.lineNumber)){this.clearDecorations(r);return}const u=this.toRange(l.lineNumber,l.column);r.revealRangeInCenter(u,0),this.addDecorations(r,u)};o(),s.add(t.onDidChangeValue(()=>o()));const a=zde(r);return a&&a.getOptions().get(68).renderType===2&&(a.updateOptions({lineNumbers:"on"}),s.add(Qe(()=>a.updateOptions({lineNumbers:"relative"})))),s}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const n=t.split(/,|:|#/).map(s=>parseInt(s,10)).filter(s=>!isNaN(s)),r=this.lineCount(e)+1;return{lineNumber:n[0]>0?n[0]:r+n[0],column:n[1]}}getPickLabel(e,t,n){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,n)?b("gotoLineColumnLabel","Go to line {0} and character {1}.",t,n):b("gotoLineLabel","Go to line {0}.",t);const r=e.getPosition()||{lineNumber:1,column:1},s=this.lineCount(e);return s>1?b("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",r.lineNumber,r.column,s):b("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",r.lineNumber,r.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,n){if(!n||typeof n!="number")return!1;const r=this.getModel(e);if(!r)return!1;const s={lineNumber:t,column:n};return r.validatePosition(s).equals(s)}lineCount(e){var t;return((t=this.getModel(e))==null?void 0:t.getLineCount())??0}};IO.PREFIX=":";let GV=IO;var Nlt=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Dlt=function(i,e){return function(t,n){e(t,n,i)}};let k_=class extends GV{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=Pe.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};k_=Nlt([Dlt(0,Kt)],k_);let ppe=(Pm=class extends Ve{constructor(){super({id:Pm.ID,label:U7.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:B.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Ja).quickAccess.show(k_.PREFIX)}},Pm.ID="editor.action.gotoLine",Pm);we(ppe),ai.as(C1.Quickaccess).registerQuickAccessProvider({ctor:k_,prefix:k_.PREFIX,helpEntries:[{description:U7.gotoLineActionLabel,commandId:ppe.ID}]});const mpe=[void 0,[]];function ZV(i,e,t=0,n=0){const r=e;return r.values&&r.values.length>1?Ilt(i,r.values,t,n):bpe(i,e,t,n)}function Ilt(i,e,t,n){let r=0;const s=[];for(const o of e){const[a,l]=bpe(i,o,t,n);if(typeof a!="number")return mpe;r+=a,s.push(...l)}return[r,Alt(s)]}function bpe(i,e,t,n){const r=s1(e.original,e.originalLowercase,t,i,i.toLowerCase(),n,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?[r[0],I8(r)]:mpe}function Alt(i){const e=i.sort((r,s)=>r.start-s.start),t=[];let n;for(const r of e)!n||!Mlt(n,r)?(n=r,t.push(r)):(n.start=Math.min(n.start,r.start),n.end=Math.max(n.end,r.end));return t}function Mlt(i,e){return!(i.end<e.start||e.end<i.start)}function _pe(i){return i.startsWith('"')&&i.endsWith('"')}const vpe=" ";function YV(i){typeof i!="string"&&(i="");const e=i.toLowerCase(),{pathNormalized:t,normalized:n,normalizedLowercase:r}=ype(i),s=t.indexOf(Kl)>=0,o=_pe(i);let a;const l=i.split(vpe);if(l.length>1)for(const c of l){const u=_pe(c),{pathNormalized:d,normalized:h,normalizedLowercase:f}=ype(c);h&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:d,normalized:h,normalizedLowercase:f,expectContiguousMatch:u}))}return{original:i,originalLowercase:e,pathNormalized:t,normalized:n,normalizedLowercase:r,values:a,containsPathSeparator:s,expectContiguousMatch:o}}function ype(i){let e;Er?e=i.replace(/\//g,Kl):e=i.replace(/\\/g,Kl);const t=GEe(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function wpe(i){return Array.isArray(i)?YV(i.map(e=>e.original).join(vpe)):YV(i.original)}var Rlt=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Spe=function(i,e){return function(t,n){e(t,n,i)}},lC;let wp=(qc=class extends gpe{constructor(e,t,n=Object.create(null)){super(n),this._languageFeaturesService=e,this._outlineModelService=t,this.options=n,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,b("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),re.None}provideWithTextEditor(e,t,n,r){const s=e.editor,o=this.getModel(s);return o?this._languageFeaturesService.documentSymbolProvider.has(o)?this.doProvideWithEditorSymbols(e,o,t,n,r):this.doProvideWithoutEditorSymbols(e,o,t,n):re.None}doProvideWithoutEditorSymbols(e,t,n,r){const s=new ge;return this.provideLabelPick(n,b("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,s)||r.isCancellationRequested||s.add(this.doProvideWithEditorSymbols(e,t,n,r)))(),s}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const n=new Ym,r=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(r.dispose(),n.complete(!0))}));return t.add(Qe(()=>n.complete(!1))),n.p}doProvideWithEditorSymbols(e,t,n,r,s){var d;const o=e.editor,a=new ge;a.add(n.onDidAccept(h=>{var g;const[f]=n.selectedItems;f&&f.range&&(this.gotoLocation(e,{range:f.range.selection,keyMods:n.keyMods,preserveFocus:h.inBackground}),(g=s==null?void 0:s.handleAccept)==null||g.call(s,f),h.inBackground||n.hide())})),a.add(n.onDidTriggerItemButton(({item:h})=>{h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:n.keyMods,forceSideBySide:!0}),n.hide())}));const l=this.getDocumentSymbols(t,r);let c;const u=async h=>{c==null||c.dispose(!0),n.busy=!1,c=new oi(r),n.busy=!0;try{const f=YV(n.value.substr(lC.PREFIX.length).trim()),g=await this.doGetSymbolPicks(l,f,void 0,c.token,t);if(r.isCancellationRequested)return;if(g.length>0){if(n.items=g,h&&f.original.length===0){const p=u8(g,m=>!!(m.type!=="separator"&&m.range&&M.containsPosition(m.range.decoration,h)));p&&(n.activeItems=[p])}}else f.original.length>0?this.provideLabelPick(n,b("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(n,b("noSymbolResults","No editor symbols"))}finally{r.isCancellationRequested||(n.busy=!1)}};return a.add(n.onDidChangeValue(()=>u(void 0))),u((d=o.getSelection())==null?void 0:d.getPosition()),a.add(n.onDidChangeActive(()=>{const[h]=n.activeItems;h&&h.range&&(o.revealRangeInCenter(h.range.selection,0),this.addDecorations(o,h.range.decoration))})),a}async doGetSymbolPicks(e,t,n,r,s){var m,_;const o=await e;if(r.isCancellationRequested)return[];const a=t.original.indexOf(lC.SCOPE_PREFIX)===0,l=a?1:0;let c,u;t.values&&t.values.length>1?(c=wpe(t.values[0]),u=wpe(t.values.slice(1))):c=t;let d;const h=(_=(m=this.options)==null?void 0:m.openSideBySideDirection)==null?void 0:_.call(m);h&&(d=[{iconClass:h==="right"?ot.asClassName(Le.splitHorizontal):ot.asClassName(Le.splitVertical),tooltip:h==="right"?b("openToSide","Open to the Side"):b("openToBottom","Open to the Bottom")}]);const f=[];for(let v=0;v<o.length;v++){const w=o[v],y=UEe(w.name),S=`$(${Zv.toIcon(w.kind).id}) ${y}`,x=S.length-y.length;let O=w.containerName;n!=null&&n.extraContainerLabel&&(O?O=`${n.extraContainerLabel} • ${O}`:O=n.extraContainerLabel);let L,T,N,E;if(t.original.length>l){let I=!1;if(c!==t&&([L,T]=ZV(S,{...t,values:void 0},l,x),typeof L=="number"&&(I=!0)),typeof L!="number"&&([L,T]=ZV(S,c,l,x),typeof L!="number"))continue;if(!I&&u){if(O&&u.original.length>0&&([N,E]=ZV(O,u)),typeof N!="number")continue;typeof L=="number"&&(L+=N)}}const P=w.tags&&w.tags.indexOf(1)>=0;f.push({index:v,kind:w.kind,score:L,label:S,ariaLabel:VEe(w.name,w.kind),description:O,highlights:P?void 0:{label:T,description:E},range:{selection:M.collapseToStart(w.selectionRange),decoration:w.range},uri:s.uri,symbolName:y,strikethrough:P,buttons:d})}const g=f.sort((v,w)=>a?this.compareByKindAndScore(v,w):this.compareByScore(v,w));let p=[];if(a){let S=function(){w&&typeof v=="number"&&y>0&&(w.label=Dg(QV[v]||XV,y))},v,w,y=0;for(const x of g)v!==x.kind?(S(),v=x.kind,y=1,w={type:"separator"},p.push(w)):y++,p.push(x);S()}else g.length>0&&(p=[{label:b("symbols","symbols ({0})",f.length),type:"separator"},...g]);return p}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){const n=QV[e.kind]||XV,r=QV[t.kind]||XV,s=n.localeCompare(r);return s===0?this.compareByScore(e,t):s}async getDocumentSymbols(e,t){const n=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:n.asListOfDocumentSymbols()}},lC=qc,qc.PREFIX="@",qc.SCOPE_PREFIX=":",qc.PREFIX_BY_CATEGORY=`${qc.PREFIX}${qc.SCOPE_PREFIX}`,qc);wp=lC=Rlt([Spe(0,Be),Spe(1,qb)],wp);const XV=b("property","properties ({0})"),QV={5:b("method","methods ({0})"),11:b("function","functions ({0})"),8:b("_constructor","constructors ({0})"),12:b("variable","variables ({0})"),4:b("class","classes ({0})"),22:b("struct","structs ({0})"),23:b("event","events ({0})"),24:b("operator","operators ({0})"),10:b("interface","interfaces ({0})"),2:b("namespace","namespaces ({0})"),3:b("package","packages ({0})"),25:b("typeParameter","type parameters ({0})"),1:b("modules","modules ({0})"),6:b("property","properties ({0})"),9:b("enum","enumerations ({0})"),21:b("enumMember","enumeration members ({0})"),14:b("string","strings ({0})"),0:b("file","files ({0})"),17:b("array","arrays ({0})"),15:b("number","numbers ({0})"),16:b("boolean","booleans ({0})"),18:b("object","objects ({0})"),19:b("key","keys ({0})"),7:b("field","fields ({0})"),13:b("constant","constants ({0})")};var Flt=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},KV=function(i,e){return function(t,n){e(t,n,i)}};let JV=class extends wp{constructor(e,t,n){super(t,n),this.editorService=e,this.onDidActiveTextEditorControlChange=Pe.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};JV=Flt([KV(0,Kt),KV(1,Be),KV(2,qb)],JV);const AO=class AO extends Ve{constructor(){super({id:AO.ID,label:U8.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:B.hasDocumentSymbolProvider,kbOpts:{kbExpr:B.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Ja).quickAccess.show(wp.PREFIX,{itemActivation:wc.NONE})}};AO.ID="editor.action.quickOutline";let cC=AO;we(cC),ai.as(C1.Quickaccess).registerQuickAccessProvider({ctor:JV,prefix:wp.PREFIX,helpEntries:[{description:U8.quickOutlineActionLabel,prefix:wp.PREFIX,commandId:cC.ID},{description:U8.quickOutlineByCategoryActionLabel,prefix:wp.PREFIX_BY_CATEGORY}]});function Vlt(i){const e=new Map;for(const t of i)e.set(t,(e.get(t)??0)+1);return e}class E_{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const n=this.computeEmbedding(e),r=new Map,s=[];for(const[o,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,n,r);c>0&&s.push({key:o,score:c})}}return s}static termFrequencies(e){return Vlt(E_.splitTerms(e))}static*splitTerms(e){const t=n=>n.toLowerCase();for(const[n]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield t(n);const r=n.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(r.length>1)for(const s of r)s.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(s)&&(yield t(s))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const n=[];for(const r of t.textChunks){const s=E_.termFrequencies(r);for(const o of s.keys())this.chunkOccurrences.set(o,(this.chunkOccurrences.get(o)??0)+1);n.push({text:r,tf:s})}this.chunkCount+=n.length,this.documents.set(t.key,{chunks:n})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const n of t.chunks)for(const r of n.tf.keys()){const s=this.chunkOccurrences.get(r);if(typeof s=="number"){const o=s-1;o<=0?this.chunkOccurrences.delete(r):this.chunkOccurrences.set(r,o)}}}}computeSimilarityScore(e,t,n){let r=0;for(const[s,o]of Object.entries(t)){const a=e.tf.get(s);if(!a)continue;let l=n.get(s);typeof l!="number"&&(l=this.computeIdf(s),n.set(s,l));const c=a*l;r+=c*o}return r}computeEmbedding(e){const t=E_.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[n,r]of e){const s=this.computeIdf(n);s>0&&(t[n]=r*s)}return t}}function Hlt(i){var n;const e=i.slice(0);e.sort((r,s)=>s.score-r.score);const t=((n=e[0])==null?void 0:n.score)??0;if(t>0)for(const r of e)r.score/=t;return e}var C2;(function(i){i[i.NO_ACTION=0]="NO_ACTION",i[i.CLOSE_PICKER=1]="CLOSE_PICKER",i[i.REFRESH_PICKER=2]="REFRESH_PICKER",i[i.REMOVE_ITEM=3]="REMOVE_ITEM"})(C2||(C2={}));function eH(i){const e=i;return Array.isArray(e.items)}function Cpe(i){const e=i;return!!e.picks&&e.additionalPicks instanceof Promise}class Blt extends re{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,n){var c;const r=new ge;e.canAcceptInBackground=!!((c=this.options)!=null&&c.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let s;const o=r.add(new Ki),a=async()=>{var m;const u=o.value=new ge;s==null||s.dispose(!0),e.busy=!1,s=new oi(t);const d=s.token;let h=e.value.substring(this.prefix.length);(m=this.options)!=null&&m.shouldSkipTrimPickFilter||(h=h.trim());const f=this._getPicks(h,u,d,n),g=(_,v)=>{var S;let w,y;if(eH(_)?(w=_.items,y=_.active):w=_,w.length===0){if(v)return!1;(h.length>0||e.hideInput)&&((S=this.options)!=null&&S.noResultsPick)&&(T3(this.options.noResultsPick)?w=[this.options.noResultsPick(h)]:w=[this.options.noResultsPick])}return e.items=w,y&&(e.activeItems=[y]),!0},p=async _=>{let v=!1,w=!1;await Promise.all([(async()=>{typeof _.mergeDelay=="number"&&(await ud(_.mergeDelay),d.isCancellationRequested)||w||(v=g(_.picks,!0))})(),(async()=>{e.busy=!0;try{const y=await _.additionalPicks;if(d.isCancellationRequested)return;let S,x;eH(_.picks)?(S=_.picks.items,x=_.picks.active):S=_.picks;let O,L;if(eH(y)?(O=y.items,L=y.active):O=y,O.length>0||!v){let T;if(!x&&!L){const N=e.activeItems[0];N&&S.indexOf(N)!==-1&&(T=N)}g({items:[...S,...O],active:x||L||T})}}finally{d.isCancellationRequested||(e.busy=!1),w=!0}})()])};if(f!==null)if(Cpe(f))await p(f);else if(!(f instanceof Promise))g(f);else{e.busy=!0;try{const _=await f;if(d.isCancellationRequested)return;Cpe(_)?await p(_):g(_)}finally{d.isCancellationRequested||(e.busy=!1)}}};r.add(e.onDidChangeValue(()=>a())),a(),r.add(e.onDidAccept(u=>{var h;if(n!=null&&n.handleAccept){u.inBackground||e.hide(),(h=n.handleAccept)==null||h.call(n,e.activeItems[0]);return}const[d]=e.selectedItems;typeof(d==null?void 0:d.accept)=="function"&&(u.inBackground||e.hide(),d.accept(e.keyMods,u))}));const l=async(u,d)=>{var f;if(typeof d.trigger!="function")return;const h=((f=d.buttons)==null?void 0:f.indexOf(u))??-1;if(h>=0){const g=d.trigger(h,e.keyMods),p=typeof g=="number"?g:await g;if(t.isCancellationRequested)return;switch(p){case C2.NO_ACTION:break;case C2.CLOSE_PICKER:e.hide();break;case C2.REFRESH_PICKER:a();break;case C2.REMOVE_ITEM:{const m=e.items.indexOf(d);if(m!==-1){const _=e.items.slice(),v=_.splice(m,1),w=e.activeItems.filter(S=>S!==v[0]),y=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=_,w&&(e.activeItems=w),e.keepScrollPosition=y}break}}}};return r.add(e.onDidTriggerItemButton(({button:u,item:d})=>l(u,d))),r.add(e.onDidTriggerSeparatorButton(({button:u,separator:d})=>l(u,d))),r}}var xpe=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},jf=function(i,e){return function(t,n){e(t,n,i)}},Sp,Ui;let tH=(ed=class extends Blt{constructor(e,t,n,r,s,o){super(Sp.PREFIX,e),this.instantiationService=t,this.keybindingService=n,this.commandService=r,this.telemetryService=s,this.dialogService=o,this.commandsHistory=this._register(this.instantiationService.createInstance(nH)),this.options=e}async _getPicks(e,t,n,r){var f,g;const s=await this.getCommandPicks(n);if(n.isCancellationRequested)return[];const o=kh(()=>{const p=new E_;p.updateDocuments(s.map(_=>({key:_.commandId,textChunks:[this.getTfIdfChunk(_)]})));const m=p.calculateScores(e,n);return Hlt(m).filter(_=>_.score>Sp.TFIDF_THRESHOLD).slice(0,Sp.TFIDF_MAX_RESULTS)}),a=[];for(const p of s){const m=Sp.WORD_FILTER(e,p.label)??void 0,_=p.commandAlias?Sp.WORD_FILTER(e,p.commandAlias)??void 0:void 0;if(m||_)p.highlights={label:m,detail:this.options.showAlias?_:void 0},a.push(p);else if(e===p.commandId)a.push(p);else if(e.length>=3){const v=o();if(n.isCancellationRequested)return[];const w=v.find(y=>y.key===p.commandId);w&&(p.tfIdfScore=w.score,a.push(p))}}const l=new Map;for(const p of a){const m=l.get(p.label);m?(p.description=p.commandId,m.description=m.commandId):l.set(p.label,p)}a.sort((p,m)=>{if(p.tfIdfScore&&m.tfIdfScore)return p.tfIdfScore===m.tfIdfScore?p.label.localeCompare(m.label):m.tfIdfScore-p.tfIdfScore;if(p.tfIdfScore)return 1;if(m.tfIdfScore)return-1;const _=this.commandsHistory.peek(p.commandId),v=this.commandsHistory.peek(m.commandId);if(_&&v)return _>v?-1:1;if(_)return-1;if(v)return 1;if(this.options.suggestedCommandIds){const w=this.options.suggestedCommandIds.has(p.commandId),y=this.options.suggestedCommandIds.has(m.commandId);if(w&&y)return 0;if(w)return-1;if(y)return 1}return p.label.localeCompare(m.label)});const c=[];let u=!1,d=!0,h=!!this.options.suggestedCommandIds;for(let p=0;p<a.length;p++){const m=a[p];p===0&&this.commandsHistory.peek(m.commandId)&&(c.push({type:"separator",label:b("recentlyUsed","recently used")}),u=!0),d&&m.tfIdfScore!==void 0&&(c.push({type:"separator",label:b("suggested","similar commands")}),d=!1),h&&m.tfIdfScore===void 0&&!this.commandsHistory.peek(m.commandId)&&((f=this.options.suggestedCommandIds)!=null&&f.has(m.commandId))&&(c.push({type:"separator",label:b("commonlyUsed","commonly used")}),u=!0,h=!1),u&&m.tfIdfScore===void 0&&!this.commandsHistory.peek(m.commandId)&&!((g=this.options.suggestedCommandIds)!=null&&g.has(m.commandId))&&(c.push({type:"separator",label:b("morecCommands","other commands")}),u=!1),c.push(this.toCommandPick(m,r))}return this.hasAdditionalCommandPicks(e,n)?{picks:c,additionalPicks:(async()=>{var _;const p=await this.getAdditionalCommandPicks(s,a,e,n);if(n.isCancellationRequested)return[];const m=p.map(v=>this.toCommandPick(v,r));return d&&((_=m[0])==null?void 0:_.type)!=="separator"&&m.unshift({type:"separator",label:b("suggested","similar commands")}),m})()}:c}toCommandPick(e,t){if(e.type==="separator")return e;const n=this.keybindingService.lookupKeybinding(e.commandId),r=n?b("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,n.getAriaLabel()):e.label;return{...e,ariaLabel:r,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:n,accept:async()=>{var s;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(t==null?void 0:t.from)??"quick open"});try{(s=e.args)!=null&&s.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(o){Ha(o)||this.dialogService.error(b("canNotRun","Command '{0}' resulted in an error",e.label),_S(o))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:n}){let r=e;return t&&t!==e&&(r+=` - ${t}`),n&&n.value!==e&&(r+=` - ${n.value===n.original?n.value:`${n.value} (${n.original})`}`),r}},Sp=ed,ed.PREFIX=">",ed.TFIDF_THRESHOLD=.5,ed.TFIDF_MAX_RESULTS=5,ed.WORD_FILTER=FT(D8,rRe,ooe),ed);tH=Sp=xpe([jf(1,Ke),jf(2,an),jf(3,Dn),jf(4,Qr),jf(5,_8)],tH);let nH=(Gc=class extends re{constructor(e,t,n){super(),this.storageService=e,this.configurationService=t,this.logService=n,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===s6.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Ui.getConfiguredCommandHistoryLength(this.configurationService),Ui.cache&&Ui.cache.limit!==this.configuredCommandsHistoryLength&&(Ui.cache.limit=this.configuredCommandsHistoryLength,Ui.hasChanges=!0))}load(){const e=this.storageService.get(Ui.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(r){this.logService.error(`[CommandsHistory] invalid data: ${r}`)}const n=Ui.cache=new au(this.configuredCommandsHistoryLength,1);if(t){let r;t.usesLRU?r=t.entries:r=t.entries.sort((s,o)=>s.value-o.value),r.forEach(s=>n.set(s.key,s.value))}Ui.counter=this.storageService.getNumber(Ui.PREF_KEY_COUNTER,0,Ui.counter)}push(e){Ui.cache&&(Ui.cache.set(e,Ui.counter++),Ui.hasChanges=!0)}peek(e){var t;return(t=Ui.cache)==null?void 0:t.peek(e)}saveState(){if(!Ui.cache||!Ui.hasChanges)return;const e={usesLRU:!0,entries:[]};Ui.cache.forEach((t,n)=>e.entries.push({key:n,value:t})),this.storageService.store(Ui.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(Ui.PREF_KEY_COUNTER,Ui.counter,0,0),Ui.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var r,s;const n=(s=(r=e.getValue().workbench)==null?void 0:r.commandPalette)==null?void 0:s.history;return typeof n=="number"?n:Ui.DEFAULT_COMMANDS_HISTORY_LENGTH}},Ui=Gc,Gc.DEFAULT_COMMANDS_HISTORY_LENGTH=50,Gc.PREF_KEY_CACHE="commandPalette.mru.cache",Gc.PREF_KEY_COUNTER="commandPalette.mru.counter",Gc.counter=1,Gc.hasChanges=!1,Gc);nH=Ui=xpe([jf(0,Nl),jf(1,Lt),jf(2,Pr)],nH);class zlt extends tH{constructor(e,t,n,r,s,o){super(e,t,n,r,s,o)}getCodeEditorCommandPicks(){var n;const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const r of e.getSupportedActions()){let s;(n=r.metadata)!=null&&n.description&&(eHe(r.metadata.description)?s=r.metadata.description:s={original:r.metadata.description,value:r.metadata.description}),t.push({commandId:r.id,commandAlias:r.alias,commandDescription:s,label:ZT(r.label)||r.id})}return t}}var $lt=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},x2=function(i,e){return function(t,n){e(t,n,i)}};let T_=class extends zlt{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,n,r,s,o){super({showAlias:!1},e,n,r,s,o),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};T_=$lt([x2(0,Ke),x2(1,Kt),x2(2,an),x2(3,Dn),x2(4,Qr),x2(5,_8)],T_);const MO=class MO extends Ve{constructor(){super({id:MO.ID,label:q7.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:B.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Ja).quickAccess.show(T_.PREFIX)}};MO.ID="editor.action.quickCommand";let uC=MO;we(uC),ai.as(C1.Quickaccess).registerQuickAccessProvider({ctor:T_,prefix:T_.PREFIX,helpEntries:[{description:q7.quickCommandHelp,commandId:uC.ID}]});var jlt=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},O2=function(i,e){return function(t,n){e(t,n,i)}};let iH=class extends lp{constructor(e,t,n,r,s,o,a){super(!0,e,t,n,r,s,o,a)}};iH=jlt([O2(1,lt),O2(2,Kt),O2(3,Ni),O2(4,Ke),O2(5,Nl),O2(6,Lt)],iH),qt(lp.ID,iH,4);class Wlt extends Ve{constructor(){super({id:"editor.action.toggleHighContrast",label:SP.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const n=e.get(Oa),r=n.getColorTheme();dc(r.type)?(n.setTheme(this._originalThemeName||(b0(r.type)?s4:Vd)),this._originalThemeName=null):(n.setTheme(b0(r.type)?N1:D1),this._originalThemeName=r.themeName)}}we(Wlt);function Ult(i){return new Worker("/assets/json.worker-D1dAtg0Q.js",{name:i==null?void 0:i.name})}const Cr=(i,e)=>{const t=i.__vccOpts||i;for(const[n,r]of e)t[n]=r;return t};self.MonacoEnvironment={getWorker(){return new Ult}};const qlt={name:"PaasCodeEditor",props:{modelValue:{default:""},height:{default:400},scrollEnd:{default:!1},config:{}},setup(i,{emit:e}){let t;const{proxy:n}=C.getCurrentInstance();return C.watch(()=>i.modelValue,r=>{r!==(t==null?void 0:t.getValue())&&t.setValue(r)}),C.onMounted(()=>{t=zA.create(n.$refs.editContainer,{value:i.modelValue,...i.config}),t.onDidChangeModelContent(()=>{const r=t==null?void 0:t.getValue();if(e("update:modelValue",r),i.scrollEnd){var s=t.getModel().getLineCount();console.log(s),t.revealLine(s,zA.ScrollType.Immediate)}}),window.addEventListener("resize",function(){t.layout()})}),{}}};function Glt(i,e,t,n,r,s){return C.openBlock(),C.createElementBlock("div",{ref:"editContainer",style:C.normalizeStyle("width: 100%;height:"+this.height+"px;")},null,4)}const Zlt=Cr(qlt,[["render",Glt]]),Ylt={name:"PaasDate",props:{type:{type:String,default:"date"},icon:String,readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},modelValue:{type:[String,Array,Date]},showTime:{type:Boolean,default:!1},format:{type:String,default:null}},data(){return{}},methods:{handleChange(i){this.$emit("update:modelValue",i)}}};function Xlt(i,e,t,n,r,s){const o=C.resolveComponent("a-date-picker");return C.openBlock(),C.createBlock(o,{"show-time":t.showTime,readonly:t.readonly,disabled:t.disabled,value:t.modelValue,format:t.format,picker:t.type,onChange:s.handleChange},null,8,["show-time","readonly","disabled","value","format","picker","onChange"])}const Qlt=Cr(Ylt,[["render",Xlt]]),Klt={name:"PaasMenu",components:{AMenu:Qn.Menu,ASubMenu:Qn.Menu.SubMenu,AMenuItem:Qn.Menu.Item},props:{url:String,disabled:{type:Boolean,default:!1},theme:{type:String,default:"light"},value:String,format:{type:String,default:"YYYY-MM-DD"},type:{type:String,default:"date"},selected:{type:String,default:""}},computed:{current(){return this.$store.menus.current},openKeys(){return this.$store.menus.openKeys},data(){return this.$store.menus.data}},watch:{selected(i){this.selectedKeys=i},url(i){this.$post(i).then(e=>{this.$store.setMenuData(e.data.data)})}},mounted(){this.$store.loginFlag&&this.data.length===0&&this.$post(this.url).then(i=>{this.$store.setMenuData(i.data.data)})},data(){return{selectedKeys:""}},methods:{onOpenChange(i){const e=i.find(t=>this.openKeys.indexOf(t)===-1);this.$store.setOpenKeys(e?[e]:[])},menuSelect(i){this.$store.setCurrent(i.key),this.$store.setTitle(i.item.title),this.$store.setMenuId(i.item.id),this.$router.push(i.key),this.$store.setMenuCache({key:i.key,title:i.item.title})}}};function Jlt(i,e,t,n,r,s){const o=C.resolveComponent("paas-icon"),a=C.resolveComponent("a-menu-item"),l=C.resolveComponent("a-sub-menu"),c=C.resolveComponent("a-menu");return C.openBlock(),C.createBlock(c,{ref:"menus",theme:t.theme,selectedKeys:[r.selectedKeys],"open-keys":s.openKeys,onOpenChange:s.onOpenChange,onSelect:s.menuSelect,mode:"inline"},{default:C.withCtx(()=>[(C.openBlock(!0),C.createElementBlock(C.Fragment,null,C.renderList(s.data,u=>(C.openBlock(),C.createElementBlock(C.Fragment,{key:u.id},[u.children&&u.children.length?(C.openBlock(),C.createBlock(l,{key:u.key,id:u.id},{title:C.withCtx(()=>[C.createVNode(o,{icon:u.icon},null,8,["icon"]),C.createTextVNode(" "+C.toDisplayString(u.title),1)]),default:C.withCtx(()=>[(C.openBlock(!0),C.createElementBlock(C.Fragment,null,C.renderList(u.children,d=>(C.openBlock(),C.createBlock(a,{key:d.key,id:d.id,title:d.title},{default:C.withCtx(()=>[C.createVNode(o,{icon:d.icon},null,8,["icon"]),C.createTextVNode(" "+C.toDisplayString(d.title),1)]),_:2},1032,["id","title"]))),128))]),_:2},1032,["id"])):(C.openBlock(),C.createBlock(a,{key:u.key||"",id:u.id,title:u.title},{default:C.withCtx(()=>[C.createTextVNode(C.toDisplayString(u.title),1)]),_:2},1032,["id","title"]))],64))),128))]),_:1},8,["theme","selectedKeys","open-keys","onOpenChange","onSelect"])}const ect=Cr(Klt,[["render",Jlt]]),tct={name:"PaasPageTable",inject:{parentMethods:{from:"parentMethods",default:()=>{}}},props:{showButton:{default:1},checkbox:{default:!1},height:{default:0},radio:{default:!1},border:{default:!0},stripe:{default:!1},params:{},columns:{type:Array,default:()=>[]},id:{default:"id"},path:"",module:"",noPage:{default:!1}},computed:{queryData(){return this.$store.queryData},current(){return this.$store.menus.current},menuData(){return this.$store.menus.data},menuId(){return this.$store.menus.menuId},buttonProxy(){return this.$store.buttonProxy}},watch:{menuId(i){this.getMenuButtons()}},mounted(){this.$store.setSee(!1),this.url=this.module?`${this.module}/page`:`${this.$route.path}/page`,this.menuId&&this.getMenuButtons(),this.$bus.on("loadData",()=>{this.loadData()}),this.loadData()},beforeUnmount(){this.$bus.off("loadData")},data(){return{url:"",colors:["default","blue","green","yellow","dark"],headerButtons:[],columnButtons:[],loading:!1,datas:[],searchKey:"",searchVal:"",selectData:[],page:{current:1,pageSize:10,total:0,showQuickJumper:!0,pageSizeOptions:["10","20","50","100","200","500","1000"]}}},methods:{pageClick(i,e,t,n,r){this.page=i,this.loadData()},async getMenuButtons(){let i;if(!this.$store.buttons[this.menuId])if(i=(await this.$post(`${this.buttonProxy}/sysbuttons/getButtons/${this.menuId}`)).data.data,i.length>0){let t={};t[this.menuId]=i,this.$store.setButtons(t)}else return;i.forEach(e=>{e.state==1?this.headerButtons.push(e):this.columnButtons.push(e)})},loadData(){this.loading||(this.loading=!0,this.datas=[],this.$post(this.url,{page:{current:this.page.current,size:this.page.pageSize},...this.$store.queryData[this.current],...this.params}).then(i=>{var e;this.loading=!1,(e=i.data)!=null&&e.data?(this.datas=i.data.data.rows||[],this.page.total=i.data.data.total||0):(this.datas=[],this.page.total=0)}))},handle(i,e,t){this.selectData=t,this.$store.setAction(i),this.$store.setSee(!1);var n=this.$parent[i];if(n||(n=this.parentMethods&&this.parentMethods[i]),n&&n instanceof Function){n(this.selectData);return}else this[i]?this[i]():console.error("按钮事件方法未找到:",i)},query(){this.$store.setSee(!1),this.$store.setAction("query"),this.$store.setSubTitle("查询"),this.$router.push(this.current+"/query")},add(){let i=this.getColumnId();this.$store.setSee(!1),this.$store.setSubTitle("创建"),i?this.$router.push({path:this.current+"/form",query:{id:i}}):this.$router.push(this.current+"/form")},edit(){let i=this.getColumnId();i!=null&&(this.$store.setSee(!1),this.$store.setSubTitle("编辑"),this.$router.push({path:this.current+"/form",query:{id:i}}))},del(){let i=this.getColumnId();if(i==null)return;let e=this;Qn.Modal.confirm({title:"确定删除?",okText:"确定",cancelText:"取消",onOk(){let t=e.$store.menus.current+"/"+i;e.module&&(t=e.module+"/"+i),e.$delete(t).then(n=>{let r=n.data;e.$dyAlert(r,!1)})},onCancel(){}})},see(){let i=this.getColumnId();i!=null&&(this.$store.setSubTitle("查看"),this.$store.setSee(!0),this.$router.push({path:this.current+"/form",query:{id:i}}))},getColumnId(){let i=this.selectData;if(this.checkbox&&(i=this.selectData[0]),i==null||i.length==0)return this.$store.forms.action!="add"&&Qn.message.warn("请选中任意列表数据"),null;let e="";return this.id?this.id instanceof Array?(this.id.forEach(t=>{e+=i[t]+"&"}),e=e.substring(0,e.length-1)):e+=i[this.id]:e=i[this.columns[0].dataIndex],e}}},nct=["onClick"];function ict(i,e,t,n,r,s){const o=C.resolveComponent("paas-icon"),a=C.resolveComponent("a-button"),l=C.resolveComponent("a-flex"),c=C.resolveComponent("a-divider"),u=C.resolveComponent("a-space"),d=C.resolveComponent("a-table");return C.openBlock(),C.createElementBlock("div",null,[C.createVNode(l,{gap:"middle",justify:"flex-end"},{default:C.withCtx(()=>[(C.openBlock(!0),C.createElementBlock(C.Fragment,null,C.renderList(r.headerButtons,(h,f)=>(C.openBlock(),C.createBlock(a,{type:h.type||"primary",key:f,onClick:g=>s.handle(h.tag||h.click,h.title)},{default:C.withCtx(()=>[C.createVNode(o,{icon:h.icon},null,8,["icon"]),C.createTextVNode(C.toDisplayString(h.title),1)]),_:2},1032,["type","onClick"]))),128))]),_:1}),C.createVNode(c,{style:{"margin-top":"12px","margin-bottom":"8px"}}),C.createElementVNode("div",null,[C.createVNode(d,{ref:"table",bordered:"","data-source":r.datas,columns:t.columns,loading:r.loading,onChange:s.pageClick,pagination:r.page,scroll:{x:"max-content"},"row-key":t.id},{bodyCell:C.withCtx(({column:h,record:f})=>[h.key==="action"?(C.openBlock(),C.createBlock(u,{key:0,warp:""},{default:C.withCtx(()=>[(C.openBlock(!0),C.createElementBlock(C.Fragment,null,C.renderList(r.columnButtons,(g,p)=>(C.openBlock(),C.createElementBlock("a",{type:"link",key:p,block:"",onClick:m=>s.handle(g.tag||g.click,g.title,f)},C.toDisplayString(g.title),9,nct))),128))]),_:2},1024)):C.createCommentVNode("",!0)]),_:1},8,["data-source","columns","loading","onChange","pagination","row-key"])])])}const rct=Cr(tct,[["render",ict]]),sct={name:"PaasSelect",props:{multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},modelValue:{type:[String,Array,Number],default:null},params:{type:String,default:""}},mounted(){this.data=this.$store.dicts[this.params]||[],this.modelValue?typeof this.modelValue=="string"&&this.modelValue.includes(",")?this.value=this.modelValue.split(","):this.value=Array.isArray(this.modelValue)?this.modelValue:[this.modelValue]:this.value=this.modelValue},data(){return{value:null,data:[]}},watch:{modelValue(i){i==null&&(i="");let e=new Array;Array.isArray(i)?(i.forEach(t=>{t!=""&&e.push(String(t))}),this.value=e):i instanceof String&&(i!=null&&i.includes(","))?(i.spit(",").forEach(t=>{t!=""&&e.push(String(t))}),this.value=e):this.multiple&&i?this.value=[String(i)]:this.value=String(i)},value(i){console.log(i),this.$emit("update:modelValue",i),this.$emit("change",i)}}};function oct(i,e,t,n,r,s){const o=C.resolveComponent("a-select");return C.openBlock(),C.createBlock(o,{options:r.data,mode:t.multiple?"multiple":void 0,value:r.value,"onUpdate:value":e[0]||(e[0]=a=>r.value=a),disabled:t.disabled,class:"paas-select",allowClear:!0},null,8,["options","mode","value","disabled"])}const act=Cr(sct,[["render",oct]]),lct={name:"PaasTree",props:{multiple:{default:!1},fieldNames:{type:Object,default:{children:"children",title:"label",key:"value"}},disabled:{default:!1},open:{type:Boolean,default:!1},modelValue:{},params:{},url:"",listToTree:{type:Boolean,default:!0}},data(){return{value:null,datas:[]}},mounted(){this.getTreeData(),this.modelValue?typeof this.modelValue=="string"&&this.modelValue.includes(",")?this.value=this.modelValue.split(","):this.value=Array.isArray(this.modelValue)?this.modelValue:[this.modelValue]:this.value=this.modelValue},computed:{see(){return this.$store.forms.see}},watch:{modelValue(i){i==null&&(i="");let e=new Array;Array.isArray(i)?(i.forEach(t=>{t!=""&&e.push(String(t))}),this.value=e):i instanceof String&&(i!=null&&i.includes(","))?(i.spit(",").forEach(t=>{t!=""&&e.push(String(t))}),this.value=e):this.multiple&&i?this.value=[String(i)]:this.value=String(i),this.$emit("update:modelValue",this.value)}},methods:{async getTreeData(){let i=await this.$post(this.url,{page:{current:1,size:1e6},...this.params});this.listToTree?this.datas=this.$listToTree(i.data.data.rows):this.datas=i.data.data.rows}}};function cct(i,e,t,n,r,s){const o=C.resolveComponent("a-tree-select");return C.openBlock(),C.createBlock(o,{"show-search":!0,"allow-clear":!0,"tree-data":r.datas,value:r.value,"onUpdate:value":e[0]||(e[0]=a=>r.value=a),mode:t.multiple?"multiple":void 0,disabled:s.see||t.disabled,"tree-node-filter-prop":"label",treeLine:!0,fieldNames:t.fieldNames,class:"paas-select","tree-default-expand-all":t.open},null,8,["tree-data","value","mode","disabled","fieldNames","tree-default-expand-all"])}const uct=Cr(lct,[["render",cct]]),dct={name:"PaasUploadModal",props:{open:{type:Boolean,required:!0},url:{type:String,required:!0},params:{type:Object,default:()=>({})},title:{type:String,default:"文件上传"},multiple:{type:Boolean,default:!1},types:{type:String,default:""},success:{type:Function,default:i=>{}},templateUrl:{type:String,default:""}},data(){return{isOpen:this.open,fileList:[]}},watch:{open(i){this.isOpen=i}},methods:{customRequest(){const i=new FormData;this.multiple?this.fileList.forEach(e=>{i.append("files[]",e)}):i.append("file",this.fileList[0]),Object.keys(this.params).forEach(e=>{i.append(e,this.params[e])}),this.$upload(this.url,i).then(e=>{e.data.code==this.$success&&(this.fileList=[],Qn.message.success(e.data.msg),this.success(e.data.data),this.closeModal())}).catch(()=>{Qn.message.error("文件上传失败!")})},beforeUpload(i){return this.fileList.push(i),!1},closeModal(){this.isOpen=!1,this.$emit("update:open",!1),this.fileList=[]},downloadTemplate(){this.templateUrl&&window.open(this.templateUrl,"_blank")}}};function hct(i,e,t,n,r,s){const o=C.resolveComponent("a-upload-dragger"),a=C.resolveComponent("a-button"),l=C.resolveComponent("a-modal");return C.openBlock(),C.createBlock(l,{open:r.isOpen,"onUpdate:open":e[0]||(e[0]=c=>r.isOpen=c),title:t.title,closable:!1},{footer:C.withCtx(()=>[t.templateUrl?(C.openBlock(),C.createBlock(a,{key:0,onClick:s.downloadTemplate},{default:C.withCtx(()=>e[2]||(e[2]=[C.createTextVNode("下载模板")])),_:1},8,["onClick"])):C.createCommentVNode("",!0),C.createVNode(a,{onClick:s.closeModal},{default:C.withCtx(()=>e[3]||(e[3]=[C.createTextVNode("关闭")])),_:1},8,["onClick"]),C.createVNode(a,{type:"primary",onClick:s.customRequest},{default:C.withCtx(()=>e[4]||(e[4]=[C.createTextVNode("上传")])),_:1},8,["onClick"])]),default:C.withCtx(()=>[C.createVNode(o,{"before-upload":s.beforeUpload,name:t.multiple?"files":"file"},{default:C.withCtx(()=>e[1]||(e[1]=[C.createElementVNode("p",{class:"ant-upload-drag-icon"},[C.createElementVNode("i",{class:"anticon anticon-inbox"})],-1),C.createElementVNode("p",{class:"ant-upload-text"},"点击或拖拽文件到此区域上传",-1)])),_:1},8,["before-upload","name"])]),_:1},8,["open","title"])}const fct=Cr(dct,[["render",hct],["__scopeId","data-v-d10e2841"]]),gct={name:"FormDate",props:{label:String,name:String,size:{type:Number,default:2},labelWidth:{type:Number,default:null},type:{type:String,default:"date"},icon:String,readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},modelValue:{type:[String,Array,Date]},showTime:{type:Boolean,default:!1},format:{type:String,default:null}},methods:{handleChange(i){this.$emit("update:modelValue",i)}}};function pct(i,e,t,n,r,s){const o=C.resolveComponent("a-date-picker"),a=C.resolveComponent("a-form-item"),l=C.resolveComponent("a-col");return C.openBlock(),C.createBlock(l,{span:24/t.size},{default:C.withCtx(()=>[C.createVNode(a,C.mergeProps({label:t.label,name:t.name},t.labelWidth?{labelCol:{span:t.labelWidth}}:{}),{default:C.withCtx(()=>[C.createVNode(o,{"show-time":t.showTime,readonly:t.readonly,disabled:t.disabled,value:t.modelValue,format:t.format,picker:t.type,onChange:s.handleChange},null,8,["show-time","readonly","disabled","value","format","picker","onChange"])]),_:1},16,["label","name"])]),_:1},8,["span"])}const mct=Cr(gct,[["render",pct]]),bct={name:"FormInput",props:{label:{type:String,default:""},labelWidth:{type:Number,default:null},name:{type:String,default:""},type:{type:String,default:"text"},modelValue:{type:[String,Number,Object],default:""},size:{type:Number,default:2},icon:{type:String,default:""},readonly:{type:Boolean,default:!1}},computed:{see(){return this.$store.forms.see}},methods:{updateValue(i){this.$emit("update:modelValue",i.target.value)}}};function _ct(i,e,t,n,r,s){const o=C.resolveComponent("a-input"),a=C.resolveComponent("a-form-item"),l=C.resolveComponent("a-col");return C.openBlock(),C.createBlock(l,{span:24/t.size},{default:C.withCtx(()=>[C.createVNode(a,C.mergeProps({label:t.label,name:t.name,icon:t.icon},t.labelWidth?{labelCol:{span:t.labelWidth}}:{}),{default:C.withCtx(()=>[C.createVNode(o,{type:t.type,value:t.modelValue,onInput:s.updateValue,disabled:s.see||t.readonly},null,8,["type","value","onInput","disabled"])]),_:1},16,["label","name","icon"])]),_:1},8,["span"])}const vct=Cr(bct,[["render",_ct]]),yct={name:"FormNumber",mounted(){},props:{label:String,name:String,size:{type:Number,default:2},value:{},modelValue:{},readonly:{default:!1},precision:{default:null},max:{},min:{}},computed:{see(){return this.$store.forms.see}},methods:{updateValue(i){this.$emit("update:modelValue",i)}}};function wct(i,e,t,n,r,s){const o=C.resolveComponent("a-input-number"),a=C.resolveComponent("FormItem"),l=C.resolveComponent("a-col");return C.openBlock(),C.createBlock(l,{span:24/t.size},{default:C.withCtx(()=>[C.createVNode(a,{label:t.label,name:t.name},{default:C.withCtx(()=>[C.createVNode(o,{type:i.type,precision:t.precision,max:t.max,min:t.min,value:t.modelValue,onChange:s.updateValue,readonly:s.see||t.readonly},null,8,["type","precision","max","min","value","onChange","readonly"])]),_:1},8,["label","name"])]),_:1},8,["span"])}const Sct=Cr(yct,[["render",wct]]);var Cct={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zM648.3 426.8l-87.7 161.1h45.7c5.5 0 10 4.5 10 10v21.3c0 5.5-4.5 10-10 10h-63.4v29.7h63.4c5.5 0 10 4.5 10 10v21.3c0 5.5-4.5 10-10 10h-63.4V752c0 5.5-4.5 10-10 10h-41.3c-5.5 0-10-4.5-10-10v-51.8h-63.1c-5.5 0-10-4.5-10-10v-21.3c0-5.5 4.5-10 10-10h63.1v-29.7h-63.1c-5.5 0-10-4.5-10-10v-21.3c0-5.5 4.5-10 10-10h45.2l-88-161.1c-2.6-4.8-.9-10.9 4-13.6 1.5-.8 3.1-1.2 4.8-1.2h46c3.8 0 7.2 2.1 8.9 5.5l72.9 144.3 73.2-144.3a10 10 0 018.9-5.5h45c5.5 0 10 4.5 10 10 .1 1.7-.3 3.3-1.1 4.8z"}}]},name:"account-book",theme:"filled"};function Vl(i,e){xct(i)&&(i="100%");var t=Oct(i);return i=e===360?i:Math.min(e,Math.max(0,parseFloat(i))),t&&(i=parseInt(String(i*e),10)/100),Math.abs(i-e)<1e-6?1:(e===360?i=(i<0?i%e+e:i%e)/parseFloat(String(e)):i=i%e/parseFloat(String(e)),i)}function xct(i){return typeof i=="string"&&i.indexOf(".")!==-1&&parseFloat(i)===1}function Oct(i){return typeof i=="string"&&i.indexOf("%")!==-1}function Lct(i){return i=parseFloat(i),(isNaN(i)||i<0||i>1)&&(i=1),i}function dC(i){return i<=1?"".concat(Number(i)*100,"%"):i}function rH(i){return i.length===1?"0"+i:String(i)}function kct(i,e,t){return{r:Vl(i,255)*255,g:Vl(e,255)*255,b:Vl(t,255)*255}}function sH(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*(6*t):t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function Ect(i,e,t){var n,r,s;if(i=Vl(i,360),e=Vl(e,100),t=Vl(t,100),e===0)r=t,s=t,n=t;else{var o=t<.5?t*(1+e):t+e-t*e,a=2*t-o;n=sH(a,o,i+1/3),r=sH(a,o,i),s=sH(a,o,i-1/3)}return{r:n*255,g:r*255,b:s*255}}function Tct(i,e,t){i=Vl(i,255),e=Vl(e,255),t=Vl(t,255);var n=Math.max(i,e,t),r=Math.min(i,e,t),s=0,o=n,a=n-r,l=n===0?0:a/n;if(n===r)s=0;else{switch(n){case i:s=(e-t)/a+(e<t?6:0);break;case e:s=(t-i)/a+2;break;case t:s=(i-e)/a+4;break}s/=6}return{h:s,s:l,v:o}}function Pct(i,e,t){i=Vl(i,360)*6,e=Vl(e,100),t=Vl(t,100);var n=Math.floor(i),r=i-n,s=t*(1-e),o=t*(1-r*e),a=t*(1-(1-r)*e),l=n%6,c=[t,o,s,s,a,t][l],u=[a,t,t,o,s,s][l],d=[s,s,a,t,t,o][l];return{r:c*255,g:u*255,b:d*255}}function Nct(i,e,t,n){var r=[rH(Math.round(i).toString(16)),rH(Math.round(e).toString(16)),rH(Math.round(t).toString(16))];return r.join("")}function Ope(i){return ol(i)/255}function ol(i){return parseInt(i,16)}var Lpe={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function P_(i){var e={r:0,g:0,b:0},t=1,n=null,r=null,s=null,o=!1,a=!1;return typeof i=="string"&&(i=Act(i)),typeof i=="object"&&(sh(i.r)&&sh(i.g)&&sh(i.b)?(e=kct(i.r,i.g,i.b),o=!0,a=String(i.r).substr(-1)==="%"?"prgb":"rgb"):sh(i.h)&&sh(i.s)&&sh(i.v)?(n=dC(i.s),r=dC(i.v),e=Pct(i.h,n,r),o=!0,a="hsv"):sh(i.h)&&sh(i.s)&&sh(i.l)&&(n=dC(i.s),s=dC(i.l),e=Ect(i.h,n,s),o=!0,a="hsl"),Object.prototype.hasOwnProperty.call(i,"a")&&(t=i.a)),t=Lct(t),{ok:o,format:i.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var Dct="[-\\+]?\\d+%?",Ict="[-\\+]?\\d*\\.\\d+%?",Wf="(?:".concat(Ict,")|(?:").concat(Dct,")"),oH="[\\s|\\(]+(".concat(Wf,")[,|\\s]+(").concat(Wf,")[,|\\s]+(").concat(Wf,")\\s*\\)?"),aH="[\\s|\\(]+(".concat(Wf,")[,|\\s]+(").concat(Wf,")[,|\\s]+(").concat(Wf,")[,|\\s]+(").concat(Wf,")\\s*\\)?"),Rc={CSS_UNIT:new RegExp(Wf),rgb:new RegExp("rgb"+oH),rgba:new RegExp("rgba"+aH),hsl:new RegExp("hsl"+oH),hsla:new RegExp("hsla"+aH),hsv:new RegExp("hsv"+oH),hsva:new RegExp("hsva"+aH),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Act(i){if(i=i.trim().toLowerCase(),i.length===0)return!1;var e=!1;if(Lpe[i])i=Lpe[i],e=!0;else if(i==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=Rc.rgb.exec(i);return t?{r:t[1],g:t[2],b:t[3]}:(t=Rc.rgba.exec(i),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Rc.hsl.exec(i),t?{h:t[1],s:t[2],l:t[3]}:(t=Rc.hsla.exec(i),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Rc.hsv.exec(i),t?{h:t[1],s:t[2],v:t[3]}:(t=Rc.hsva.exec(i),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Rc.hex8.exec(i),t?{r:ol(t[1]),g:ol(t[2]),b:ol(t[3]),a:Ope(t[4]),format:e?"name":"hex8"}:(t=Rc.hex6.exec(i),t?{r:ol(t[1]),g:ol(t[2]),b:ol(t[3]),format:e?"name":"hex"}:(t=Rc.hex4.exec(i),t?{r:ol(t[1]+t[1]),g:ol(t[2]+t[2]),b:ol(t[3]+t[3]),a:Ope(t[4]+t[4]),format:e?"name":"hex8"}:(t=Rc.hex3.exec(i),t?{r:ol(t[1]+t[1]),g:ol(t[2]+t[2]),b:ol(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function sh(i){return!!Rc.CSS_UNIT.exec(String(i))}var hC=2,kpe=.16,Mct=.05,Rct=.05,Fct=.15,Epe=5,Tpe=4,Vct=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function Ppe(i){var e=i.r,t=i.g,n=i.b,r=Tct(e,t,n);return{h:r.h*360,s:r.s,v:r.v}}function fC(i){var e=i.r,t=i.g,n=i.b;return"#".concat(Nct(e,t,n))}function Hct(i,e,t){var n=t/100,r={r:(e.r-i.r)*n+i.r,g:(e.g-i.g)*n+i.g,b:(e.b-i.b)*n+i.b};return r}function Npe(i,e,t){var n;return Math.round(i.h)>=60&&Math.round(i.h)<=240?n=t?Math.round(i.h)-hC*e:Math.round(i.h)+hC*e:n=t?Math.round(i.h)+hC*e:Math.round(i.h)-hC*e,n<0?n+=360:n>=360&&(n-=360),n}function Dpe(i,e,t){if(i.h===0&&i.s===0)return i.s;var n;return t?n=i.s-kpe*e:e===Tpe?n=i.s+kpe:n=i.s+Mct*e,n>1&&(n=1),t&&e===Epe&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function Ipe(i,e,t){var n;return t?n=i.v+Rct*e:n=i.v-Fct*e,n>1&&(n=1),Number(n.toFixed(2))}function lH(i){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[],n=P_(i),r=Epe;r>0;r-=1){var s=Ppe(n),o=fC(P_({h:Npe(s,r,!0),s:Dpe(s,r,!0),v:Ipe(s,r,!0)}));t.push(o)}t.push(fC(n));for(var a=1;a<=Tpe;a+=1){var l=Ppe(n),c=fC(P_({h:Npe(l,a),s:Dpe(l,a),v:Ipe(l,a)}));t.push(c)}return e.theme==="dark"?Vct.map(function(u){var d=u.index,h=u.opacity,f=fC(Hct(P_(e.backgroundColor||"#141414"),P_(t[d]),h*100));return f}):t}var cH={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},gC={},uH={};Object.keys(cH).forEach(function(i){gC[i]=lH(cH[i]),gC[i].primary=gC[i][5],uH[i]=lH(cH[i],{theme:"dark",backgroundColor:"#141414"}),uH[i].primary=uH[i][5]});var Bct=gC.blue,zct=Symbol("iconContext"),dH=function(){return C.inject(zct,{prefixCls:C.ref("anticon"),rootClassName:C.ref(""),csp:C.ref()})};function hH(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function $ct(i,e){return i&&i.contains?i.contains(e):!1}var Ape="data-vc-order",jct="vc-icon-key",fH=new Map;function Mpe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=i.mark;return e?e.startsWith("data-")?e:"data-".concat(e):jct}function gH(i){if(i.attachTo)return i.attachTo;var e=document.querySelector("head");return e||document.body}function Wct(i){return i==="queue"?"prependQueue":i?"prepend":"append"}function Rpe(i){return Array.from((fH.get(i)||i).children).filter(function(e){return e.tagName==="STYLE"})}function Fpe(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!hH())return null;var t=e.csp,n=e.prepend,r=document.createElement("style");r.setAttribute(Ape,Wct(n)),t&&t.nonce&&(r.nonce=t.nonce),r.innerHTML=i;var s=gH(e),o=s.firstChild;if(n){if(n==="queue"){var a=Rpe(s).filter(function(l){return["prepend","prependQueue"].includes(l.getAttribute(Ape))});if(a.length)return s.insertBefore(r,a[a.length-1].nextSibling),r}s.insertBefore(r,o)}else s.appendChild(r);return r}function Uct(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=gH(e);return Rpe(t).find(function(n){return n.getAttribute(Mpe(e))===i})}function qct(i,e){var t=fH.get(i);if(!t||!$ct(document,t)){var n=Fpe("",e),r=n.parentNode;fH.set(i,r),i.removeChild(n)}}function Gct(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=gH(t);qct(n,t);var r=Uct(e,t);if(r)return t.csp&&t.csp.nonce&&r.nonce!==t.csp.nonce&&(r.nonce=t.csp.nonce),r.innerHTML!==i&&(r.innerHTML=i),r;var s=Fpe(i,t);return s.setAttribute(Mpe(t),e),s}function Vpe(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.forEach(function(r){Zct(i,r,t[r])})}return i}function Zct(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Yct(i,e){process.env.NODE_ENV!=="production"&&!i&&console!==void 0&&console.error("Warning: ".concat(e))}function pH(i,e){Yct(i,"[@ant-design/icons-vue] ".concat(e))}function Hpe(i){return typeof i=="object"&&typeof i.name=="string"&&typeof i.theme=="string"&&(typeof i.icon=="object"||typeof i.icon=="function")}function mH(i,e,t){return t?C.h(i.tag,Vpe({key:e},t,i.attrs),(i.children||[]).map(function(n,r){return mH(n,"".concat(e,"-").concat(i.tag,"-").concat(r))})):C.h(i.tag,Vpe({key:e},i.attrs),(i.children||[]).map(function(n,r){return mH(n,"".concat(e,"-").concat(i.tag,"-").concat(r))}))}function Bpe(i){return lH(i)[0]}function zpe(i){return i?Array.isArray(i)?i:[i]:[]}var Xct={width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false"},Qct=`
|
|
1155
|
+
`)};const o=await s.provideRenameEdits(this.model,this.position,e,r);if(o){if(o.rejectReason)return this._provideRenameEdits(e,t+1,n.concat(o.rejectReason),r)}else return this._provideRenameEdits(e,t+1,n.concat(b("no result","No result.")),r);return o}}async function Uot(i,e,t,n){const r=new uV(e,t,i),s=await r.resolveRenameLocation(St.None);return s!=null&&s.rejectReason?{edits:[],rejectReason:s.rejectReason}:r.provideRenameEdits(n,St.None)}let Ff=(xm=class{static get(e){return e.getContribution(cV.ID)}constructor(e,t,n,r,s,o,a,l,c){this.editor=e,this._instaService=t,this._notificationService=n,this._bulkEditService=r,this._progressService=s,this._logService=o,this._configService=a,this._languageFeaturesService=l,this._telemetryService=c,this._disposableStore=new ge,this._cts=new oi,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(aV,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var g,p;const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new oi,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),n=new uV(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!n.hasProvider()){e("skeleton has no provider");return}const r=new xf(this.editor,5,void 0,this._cts.token);let s;try{e("resolving rename location");const m=n.resolveRenameLocation(r.token);this._progressService.showWhile(m,250),s=await m,e("resolved rename location")}catch(m){m instanceof _l?e("resolve rename location cancelled",JSON.stringify(m,null," ")):(e("resolve rename location failed",m instanceof Error?m:JSON.stringify(m,null," ")),(typeof m=="string"||pc(m))&&((g=Uo.get(this.editor))==null||g.showMessage(m||b("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),t)));return}finally{r.dispose()}if(!s){e("returning early - no loc");return}if(s.rejectReason){e(`returning early - rejected with reason: ${s.rejectReason}`,s.rejectReason),(p=Uo.get(this.editor))==null||p.showMessage(s.rejectReason,t);return}if(r.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const o=new xf(this.editor,5,s.range,this._cts.token),a=this.editor.getModel(),l=this._languageFeaturesService.newSymbolNamesProvider.all(a),c=await Promise.all(l.map(async m=>[m,await m.supportsAutomaticNewSymbolNamesTriggerKind??!1])),u=(m,_)=>{let v=c.slice();return m===V3.Automatic&&(v=v.filter(([w,y])=>y)),v.map(([w])=>w.provideNewSymbolNames(a,s.range,m,_))};e("creating rename input field and awaiting its result");const d=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),h=await this._renameWidget.getInput(s.range,s.text,d,l.length>0?u:void 0,o);if(e("received response from rename input field"),l.length>0&&this._reportTelemetry(l.length,a.getLanguageId(),h),typeof h=="boolean"){e(`returning early - rename input field response - ${h}`),h&&this.editor.focus(),o.dispose();return}this.editor.focus(),e("requesting rename edits");const f=q3(n.provideRenameEdits(h.newName,o.token),o.token).then(async m=>{if(!m){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(m.rejectReason){e(`returning early - rejected with reason: ${m.rejectReason}`),this._notificationService.info(m.rejectReason);return}this.editor.setSelection(M.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(m,{editor:this.editor,showPreview:h.wantsPreview,label:b("label","Renaming '{0}' to '{1}'",s==null?void 0:s.text,h.newName),code:"undoredo.rename",quotableLabel:b("quotableLabel","Renaming {0} to {1}",s==null?void 0:s.text,h.newName),respectAutoSaveConfig:!0}).then(_=>{e("edits applied"),_.ariaSummary&&Vs(b("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",s.text,h.newName,_.ariaSummary))}).catch(_=>{e(`error when applying edits ${JSON.stringify(_,null," ")}`),this._notificationService.error(b("rename.failedApply","Rename failed to apply edits")),this._logService.error(_)})},m=>{e("error when providing rename edits",JSON.stringify(m,null," ")),this._notificationService.error(b("rename.failed","Rename failed to compute edits")),this._logService.error(m)}).finally(()=>{o.dispose()});return e("returning rename operation"),this._progressService.showWhile(f,250),f}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}_reportTelemetry(e,t,n){const r=typeof n=="boolean"?{kind:"cancelled",languageId:t,nRenameSuggestionProviders:e}:{kind:"accepted",languageId:t,nRenameSuggestionProviders:e,source:n.stats.source.k,nRenameSuggestions:n.stats.nRenameSuggestions,timeBeforeFirstInputFieldEdit:n.stats.timeBeforeFirstInputFieldEdit,wantsPreview:n.wantsPreview,nRenameSuggestionsInvocations:n.stats.nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:n.stats.hadAutomaticRenameSuggestionsInvocation};this._telemetryService.publicLog2("renameInvokedEvent",r)}},cV=xm,xm.ID="editor.contrib.renameController",xm);Ff=cV=Wot([Rf(1,Ke),Rf(2,Ni),Rf(3,B8),Rf(4,Kh),Rf(5,Pr),Rf(6,Z5),Rf(7,Be),Rf(8,Qr)],Ff);class qot extends Ve{constructor(){super({id:"editor.action.rename",label:b("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:pe.and(B.writable,B.hasRenameProvider),kbOpts:{kbExpr:B.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const n=e.get(Kt),[r,s]=Array.isArray(t)&&t||[void 0,void 0];return tt.isUri(r)&&te.isIPosition(s)?n.openCodeEditor({resource:r},n.getActiveCodeEditor()).then(o=>{o&&(o.setPosition(s),o.invokeWithinContext(a=>(this.reportTelemetry(a,o),this.run(a,o))))},bt):super.runCommand(e,t)}run(e,t){const n=e.get(Pr),r=Ff.get(t);return r?(n.trace("[RenameAction] got controller, running..."),r.run()):(n.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}qt(Ff.ID,Ff,4),we(qot);const dV=Gi.bindToContribution(Ff.get);De(new dV({id:"acceptRenameInput",precondition:y2,handler:i=>i.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:pe.and(B.focus,pe.not("isComposing")),primary:3}})),De(new dV({id:"acceptRenameInputWithPreview",precondition:pe.and(y2,pe.has("config.editor.rename.enablePreview")),handler:i=>i.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:pe.and(B.focus,pe.not("isComposing")),primary:2051}})),De(new dV({id:"cancelRenameInput",precondition:y2,handler:i=>i.cancelRenameInput(),kbOpts:{weight:199,kbExpr:B.focus,primary:9,secondary:[1033]}})),En(class extends Ms{constructor(){super({id:"focusNextRenameSuggestion",title:{...ut("focusNextRenameSuggestion","Focus Next Rename Suggestion")},precondition:y2,keybinding:[{primary:18,weight:199}]})}run(e){const t=e.get(Kt).getFocusedCodeEditor();if(!t)return;const n=Ff.get(t);n&&n.focusNextRenameSuggestion()}}),En(class extends Ms{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...ut("focusPreviousRenameSuggestion","Focus Previous Rename Suggestion")},precondition:y2,keybinding:[{primary:16,weight:199}]})}run(e){const t=e.get(Kt).getFocusedCodeEditor();if(!t)return;const n=Ff.get(t);n&&n.focusPreviousRenameSuggestion()}}),oo("_executeDocumentRenameProvider",function(i,e,t,...n){const[r]=n;Xt(typeof r=="string");const{renameProvider:s}=i.get(Be);return Uot(s,e,t,r)}),oo("_executePrepareRename",async function(i,e,t){const{renameProvider:n}=i.get(Be),s=await new uV(e,t,n).resolveRenameLocation(St.None);if(s!=null&&s.rejectReason)throw new Error(s.rejectReason);return s}),ai.as(xl.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:b("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var Got=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},A1e=function(i,e){return function(t,n){e(t,n,i)}};let G9=(v3=class extends re{constructor(e,t,n){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=n,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(73)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(r=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(r=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(r=>{var o;const s=(o=this.editor.getModel())==null?void 0:o.getLanguageId();s&&r.affects(s)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(r=>{this.options&&!r.hasChanged(73)||(this.options=this.createOptions(e.getOption(73)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(r=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(r=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new yn(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const n=this.languageConfigurationService.getLanguageConfiguration(t).comments,r=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!n&&!(r!=null&&r.markers)))return{foldingRules:r,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){var n,r;if(!this.editor.hasModel()||!((n=this.options)!=null&&n.findMarkSectionHeaders)&&!((r=this.options)!=null&&r.findRegionSectionHeaders))return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(s=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(s)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(s=>{if(!s.shouldBeInComments)return!0;const o=t.validateRange(s.range),a=t.tokenization.getLineTokens(o.startLineNumber),l=a.findTokenIndexAtOffset(o.startColumn-1),c=a.getStandardTokenType(l);return a.getLanguageId(l)===t.getLanguageId()&&c===1}));const n=Object.values(this.currentOccurrences).map(s=>s.decorationId),r=e.map(s=>Zot(s));this.editor.changeDecorations(s=>{const o=s.deltaDecorations(n,r);this.currentOccurrences={};for(let a=0,l=o.length;a<l;a++){const c={sectionHeader:e[a],decorationId:o[a]};this.currentOccurrences[c.decorationId]=c}})}stop(){this.computeSectionHeaders.cancel(),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop(),this.decorations.clear()}},v3.ID="editor.sectionHeaderDetector",v3);G9=Got([A1e(1,li),A1e(2,ho)],G9);function Zot(i){return{range:i.range,options:vt.createDynamic({description:"section-header",stickiness:3,collapseOnReplaceEdit:!0,minimap:{color:void 0,position:1,sectionHeaderStyle:i.hasSeparatorLine?2:1,sectionHeaderText:i.text}})}}qt(G9.ID,G9,1);function Yot(i){for(let e=0,t=i.length;e<t;e+=4){const n=i[e+0],r=i[e+1],s=i[e+2],o=i[e+3];i[e+0]=o,i[e+1]=s,i[e+2]=r,i[e+3]=n}}function Xot(i){const e=new Uint8Array(i.buffer,i.byteOffset,i.length*4);return Xte()||Yot(e),N5.wrap(e)}function M1e(i){const e=new Uint32Array(Qot(i));let t=0;if(e[t++]=i.id,i.type==="full")e[t++]=1,e[t++]=i.data.length,e.set(i.data,t),t+=i.data.length;else{e[t++]=2,e[t++]=i.deltas.length;for(const n of i.deltas)e[t++]=n.start,e[t++]=n.deleteCount,n.data?(e[t++]=n.data.length,e.set(n.data,t),t+=n.data.length):e[t++]=0}return Xot(e)}function Qot(i){let e=0;if(e+=2,i.type==="full")e+=1+i.data.length;else{e+=1,e+=3*i.deltas.length;for(const t of i.deltas)t.data&&(e+=t.data.length)}return e}function Z9(i){return i&&!!i.data}function R1e(i){return i&&Array.isArray(i.edits)}class Kot{constructor(e,t,n){this.provider=e,this.tokens=t,this.error=n}}function F1e(i,e){return i.has(e)}function Jot(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:[]}async function V1e(i,e,t,n,r){const s=Jot(i,e),o=await Promise.all(s.map(async a=>{let l,c=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?n:null,r)}catch(u){c=u,l=null}return(!l||!Z9(l)&&!R1e(l))&&(l=null),new Kot(a,l,c)}));for(const a of o){if(a.error)throw a.error;if(a.tokens)return a}return o.length>0?o[0]:null}function eat(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:null}class tat{constructor(e,t){this.provider=e,this.tokens=t}}function nat(i,e){return i.has(e)}function H1e(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:[]}async function hV(i,e,t,n){const r=H1e(i,e),s=await Promise.all(r.map(async o=>{let a;try{a=await o.provideDocumentRangeSemanticTokens(e,t,n)}catch(l){xi(l),a=null}return(!a||!Z9(a))&&(a=null),new tat(o,a)}));for(const o of s)if(o.tokens)return o;return s.length>0?s[0]:null}Wt.registerCommand("_provideDocumentSemanticTokensLegend",async(i,...e)=>{const[t]=e;Xt(t instanceof tt);const n=i.get(An).getModel(t);if(!n)return;const{documentSemanticTokensProvider:r}=i.get(Be),s=eat(r,n);return s?s[0].getLegend():i.get(Dn).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)}),Wt.registerCommand("_provideDocumentSemanticTokens",async(i,...e)=>{const[t]=e;Xt(t instanceof tt);const n=i.get(An).getModel(t);if(!n)return;const{documentSemanticTokensProvider:r}=i.get(Be);if(!F1e(r,n))return i.get(Dn).executeCommand("_provideDocumentRangeSemanticTokens",t,n.getFullModelRange());const s=await V1e(r,n,null,null,St.None);if(!s)return;const{provider:o,tokens:a}=s;if(!a||!Z9(a))return;const l=M1e({id:0,type:"full",data:a.data});return a.resultId&&o.releaseDocumentSemanticTokens(a.resultId),l}),Wt.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(i,...e)=>{const[t,n]=e;Xt(t instanceof tt);const r=i.get(An).getModel(t);if(!r)return;const{documentRangeSemanticTokensProvider:s}=i.get(Be),o=H1e(s,r);if(o.length===0)return;if(o.length===1)return o[0].getLegend();if(!n||!M.isIRange(n))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),o[0].getLegend();const a=await hV(s,r,M.lift(n),St.None);if(a)return a.provider.getLegend()}),Wt.registerCommand("_provideDocumentRangeSemanticTokens",async(i,...e)=>{const[t,n]=e;Xt(t instanceof tt),Xt(M.isIRange(n));const r=i.get(An).getModel(t);if(!r)return;const{documentRangeSemanticTokensProvider:s}=i.get(Be),o=await hV(s,r,M.lift(n),St.None);if(!(!o||!o.tokens))return M1e({id:0,type:"full",data:o.tokens.data})});const fV="editor.semanticHighlighting";function Y9(i,e,t){var r;const n=(r=t.getValue(fV,{overrideIdentifier:i.getLanguageId(),resource:i.uri}))==null?void 0:r.enabled;return typeof n=="boolean"?n:e.getColorTheme().semanticHighlighting}var B1e=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},$u=function(i,e){return function(t,n){e(t,n,i)}},Vf;let gV=class extends re{constructor(e,t,n,r,s,o){super(),this._watchers=Object.create(null);const a=u=>{this._watchers[u.uri.toString()]=new pV(u,e,n,s,o)},l=(u,d)=>{d.dispose(),delete this._watchers[u.uri.toString()]},c=()=>{for(const u of t.getModels()){const d=this._watchers[u.uri.toString()];Y9(u,n,r)?d||a(u):d&&l(u,d)}};t.getModels().forEach(u=>{Y9(u,n,r)&&a(u)}),this._register(t.onModelAdded(u=>{Y9(u,n,r)&&a(u)})),this._register(t.onModelRemoved(u=>{const d=this._watchers[u.uri.toString()];d&&l(u,d)})),this._register(r.onDidChangeConfiguration(u=>{u.affectsConfiguration(fV)&&c()})),this._register(n.onDidColorThemeChange(c))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};gV=B1e([$u(0,r7),$u(1,An),$u(2,Zi),$u(3,Lt),$u(4,fa),$u(5,Be)],gV);let pV=(yg=class extends re{constructor(e,t,n,r,s){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=s.documentSemanticTokensProvider,this._debounceInformation=r.for(this._provider,"DocumentSemanticTokens",{min:Vf.REQUEST_MIN_DELAY,max:Vf.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new yn(()=>this._fetchDocumentSemanticTokensNow(),Vf.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const o=()=>{xn(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};o(),this._register(this._provider.onDidChange(()=>{o(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(n.onDidColorThemeChange(a=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),xn(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!F1e(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new oi,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,n=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,r=V1e(this._provider,this._model,t,n,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const s=[],o=this._model.onDidChangeContent(l=>{s.push(l)}),a=new lr(!1);r.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,s);else{const{provider:c,tokens:u}=l,d=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,u||null,d,s)}},l=>{l&&(Ha(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||bt(l),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),(s.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,n,r,s){s=Math.min(s,n.length-r,e.length-t);for(let o=0;o<s;o++)n[r+o]=e[t+o]}_setDocumentSemanticTokens(e,t,n,r){const s=this._currentDocumentResponse,o=()=>{(r.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!n){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),o();return}if(R1e(t)){if(!s){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:s.data};else{let a=0;for(const h of t.edits)a+=(h.data?h.data.length:0)-h.deleteCount;const l=s.data,c=new Uint32Array(l.length+a);let u=l.length,d=c.length;for(let h=t.edits.length-1;h>=0;h--){const f=t.edits[h];if(f.start>l.length){n.warnInvalidEditStart(s.resultId,t.resultId,h,f.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const g=u-(f.start+f.deleteCount);g>0&&(Vf._copy(l,u-g,c,d-g,g),d-=g),f.data&&(Vf._copy(f.data,0,c,d-f.data.length,f.data.length),d-=f.data.length),u=f.start}u>0&&Vf._copy(l,0,c,0,u),t={resultId:t.resultId,data:c}}}if(Z9(t)){this._currentDocumentResponse=new iat(e,t.resultId,t.data);const a=sse(t,n,this._model.getLanguageId());if(r.length>0)for(const l of r)for(const c of a)for(const u of l.changes)c.applyEdit(u.range,u.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);o()}},Vf=yg,yg.REQUEST_MIN_DELAY=300,yg.REQUEST_MAX_DELAY=2e3,yg);pV=Vf=B1e([$u(1,r7),$u(2,Zi),$u(3,fa),$u(4,Be)],pV);class iat{constructor(e,t,n){this.provider=e,this.resultId=t,this.data=n}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}c4(gV);var rat=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},p_=function(i,e){return function(t,n){e(t,n,i)}};let X9=(y3=class extends re{constructor(e,t,n,r,s,o){super(),this._semanticTokensStylingService=t,this._themeService=n,this._configurationService=r,this._editor=e,this._provider=o.documentRangeSemanticTokensProvider,this._debounceInformation=s.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new yn(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(l=>{this._cancelAll(),a()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(l=>{l.affectsConfiguration(fV)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,n=this._outstandingRequests.length;t<n;t++)if(this._outstandingRequests[t]===e){this._outstandingRequests.splice(t,1);return}}_tokenizeViewportNow(){if(!this._editor.hasModel())return;const e=this._editor.getModel();if(e.tokenization.hasCompleteSemanticTokens())return;if(!Y9(e,this._themeService,this._configurationService)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}if(!nat(this._provider,e)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}const t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map(n=>this._requestRange(e,n)))}_requestRange(e,t){const n=e.getVersionId(),r=er(o=>Promise.resolve(hV(this._provider,e,t,o))),s=new lr(!1);return r.then(o=>{if(this._debounceInformation.update(e,s.elapsed()),!o||!o.tokens||e.isDisposed()||e.getVersionId()!==n)return;const{provider:a,tokens:l}=o,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,sse(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(r),()=>this._removeOutstandingRequest(r)),r}},y3.ID="editor.contrib.viewportSemanticTokens",y3);X9=rat([p_(1,r7),p_(2,Zi),p_(3,Lt),p_(4,fa),p_(5,Be)],X9),qt(X9.ID,X9,1);class sat{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const n=[];for(const r of t){const s=[];n.push(s),this.selectSubwords&&this._addInWordRanges(s,e,r),this._addWordRanges(s,e,r),this._addWhitespaceLine(s,e,r),s.push({range:e.getFullModelRange()})}return n}_addInWordRanges(e,t,n){const r=t.getWordAtPosition(n);if(!r)return;const{word:s,startColumn:o}=r,a=n.column-o;let l=a,c=a,u=0;for(;l>=0;l--){const d=s.charCodeAt(l);if(l!==a&&(d===95||d===45))break;if(Dh(d)&&nu(u))break;u=d}for(l+=1;c<s.length;c++){const d=s.charCodeAt(c);if(nu(d)&&Dh(u))break;if(d===95||d===45)break;u=d}l<c&&e.push({range:new M(n.lineNumber,o+l,n.lineNumber,o+c)})}_addWordRanges(e,t,n){const r=t.getWordAtPosition(n);r&&e.push({range:new M(n.lineNumber,r.startColumn,n.lineNumber,r.endColumn)})}_addWhitespaceLine(e,t,n){t.getLineLength(n.lineNumber)>0&&t.getLineFirstNonWhitespaceColumn(n.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(n.lineNumber)===0&&e.push({range:new M(n.lineNumber,1,n.lineNumber,t.getLineMaxColumn(n.lineNumber))})}}var oat=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},aat=function(i,e){return function(t,n){e(t,n,i)}},mV;class bV{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const n=new bV(t,this.ranges);return n.ranges[t].equalsRange(this.ranges[this.index])?n.mov(e):n}}let m_=(Om=class{static get(e){return e.getContribution(mV.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)==null||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),n=this._editor.getModel();if(this._state||await $1e(this._languageFeaturesService.selectionRangeProvider,n,t.map(s=>s.getPosition()),this._editor.getOption(114),St.None).then(s=>{var o;if(!(!ds(s)||s.length!==t.length)&&!(!this._editor.hasModel()||!Kn(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;a<s.length;a++)s[a]=s[a].filter(l=>l.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),s[a].unshift(t[a]);this._state=s.map(a=>new bV(0,a)),(o=this._selectionListener)==null||o.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)==null||a.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(s=>s.mov(e));const r=this._state.map(s=>We.fromPositions(s.ranges[s.index].getStartPosition(),s.ranges[s.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(r)}finally{this._ignoreSelection=!1}}},mV=Om,Om.ID="editor.contrib.smartSelectController",Om);m_=mV=oat([aat(1,Be)],m_);class z1e extends Ve{constructor(e,t){super(t),this._forward=e}async run(e,t){const n=m_.get(t);n&&await n.run(this._forward)}}class lat extends z1e{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:b("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:B.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:je.MenubarSelectionMenu,group:"1_basic",title:b({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}Wt.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class cat extends z1e{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:b("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:B.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:je.MenubarSelectionMenu,group:"1_basic",title:b({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}qt(m_.ID,m_,4),we(lat),we(cat);async function $1e(i,e,t,n,r){const s=i.all(e).concat(new sat(n.selectSubwords));s.length===1&&s.unshift(new m9);const o=[],a=[];for(const l of s)o.push(Promise.resolve(l.provideSelectionRanges(e,t,r)).then(c=>{if(ds(c)&&c.length===t.length)for(let u=0;u<t.length;u++){a[u]||(a[u]=[]);for(const d of c[u])M.isIRange(d.range)&&M.containsPosition(d.range,t[u])&&a[u].push(M.lift(d.range))}},xi));return await Promise.all(o),a.map(l=>{if(l.length===0)return[];l.sort((h,f)=>te.isBefore(h.getStartPosition(),f.getStartPosition())?1:te.isBefore(f.getStartPosition(),h.getStartPosition())||te.isBefore(h.getEndPosition(),f.getEndPosition())?-1:te.isBefore(f.getEndPosition(),h.getEndPosition())?1:0);const c=[];let u;for(const h of l)(!u||M.containsRange(h,u)&&!M.equalsRange(h,u))&&(c.push(h),u=h);if(!n.selectLeadingAndTrailingWhitespace)return c;const d=[c[0]];for(let h=1;h<c.length;h++){const f=c[h-1],g=c[h];if(g.startLineNumber!==f.startLineNumber||g.endLineNumber!==f.endLineNumber){const p=new M(f.startLineNumber,e.getLineFirstNonWhitespaceColumn(f.startLineNumber),f.endLineNumber,e.getLineLastNonWhitespaceColumn(f.endLineNumber));p.containsRange(f)&&!p.equalsRange(f)&&g.containsRange(p)&&!g.equalsRange(p)&&d.push(p);const m=new M(f.startLineNumber,1,f.endLineNumber,e.getLineMaxColumn(f.endLineNumber));m.containsRange(f)&&!m.equalsRange(p)&&g.containsRange(m)&&!g.equalsRange(m)&&d.push(m)}d.push(g)}return d})}Wt.registerCommand("_executeSelectionRangeProvider",async function(i,...e){const[t,n]=e;Xt(tt.isUri(t));const r=i.get(Be).selectionRangeProvider,s=await i.get(io).createModelReference(t);try{return $1e(r,s.object.textEditorModel,n,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},St.None)}finally{s.dispose()}});const uat=Object.freeze({View:ut("view","View"),Help:ut("help","Help"),Test:ut("test","Test"),File:ut("file","File"),Preferences:ut("preferences","Preferences"),Developer:ut({key:"developer",comment:["A developer on Code itself or someone diagnosing issues in Code"]},"Developer")});class b_{constructor(e,t,n,r=null){this.startLineNumbers=e,this.endLineNumbers=t,this.lastLineRelativePosition=n,this.showEndForLine=r}equals(e){return!!e&&this.lastLineRelativePosition===e.lastLineRelativePosition&&this.showEndForLine===e.showEndForLine&&Kn(this.startLineNumbers,e.startLineNumbers)&&Kn(this.endLineNumbers,e.endLineNumbers)}static get Empty(){return new b_([],[],0)}}const j1e=_d("stickyScrollViewLayer",{createHTML:i=>i}),_V="data-sticky-line-index",W1e="data-sticky-is-line",dat="data-sticky-is-line-number",U1e="data-sticky-is-folding-icon";class hat extends re{constructor(e){super(),this._editor=e,this._foldingIconStore=new ge,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._lineHeight=this._editor.getOption(67),this._renderedStickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof Ml),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(116).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(116)&&t(),n.hasChanged(67)&&(this._lineHeight=this._editor.getOption(67))})),this._register(this._editor.onDidScrollChange(n=>{n.scrollLeftChanged&&t(),n.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(n=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getRenderedStickyLine(e){return this._renderedStickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,n){if(n===void 0&&(!this._previousState&&!e||this._previousState&&this._previousState.equals(e)))return;const r=this._isWidgetHeightZero(e),s=r?void 0:e,o=r?0:this._findLineToRebuildWidgetFrom(e,n);this._renderRootNode(s,t,o),this._previousState=e}_isWidgetHeightZero(e){if(!e)return!0;const t=e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition;if(t>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const n=[...e.startLineNumbers];e.showEndForLine!==null&&(n[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=n}else this._lastLineRelativePosition=0,this._lineNumbers=[];return t===0}_findLineToRebuildWidgetFrom(e,t){if(!e||!this._previousState)return 0;if(t!==void 0)return t;const n=this._previousState,r=e.startLineNumbers.findIndex(s=>!n.startLineNumbers.includes(s));return r===-1?0:r}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_clearStickyLinesFromLine(e){this._foldingIconStore.clear();for(let t=e;t<this._renderedStickyLines.length;t++){const n=this._renderedStickyLines[t];n.lineNumberDomNode.remove(),n.lineDomNode.remove()}this._renderedStickyLines=this._renderedStickyLines.slice(0,e),this._rootDomNode.style.display="none"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._renderedStickyLines){const n=t.foldingIcon;n&&n.setVisible(e?!0:n.isCollapsed)}}async _renderRootNode(e,t,n){if(this._clearStickyLinesFromLine(n),!e)return;for(const a of this._renderedStickyLines)this._updateTopAndZIndexOfStickyLine(a);const r=this._editor.getLayoutInfo(),s=this._lineNumbers.slice(n);for(const[a,l]of s.entries()){const c=this._renderChildNode(a+n,l,t,r);c&&(this._linesDomNode.appendChild(c.lineDomNode),this._lineNumbersDomNode.appendChild(c.lineNumberDomNode),this._renderedStickyLines.push(c))}t&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));const o=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${o}px`,this._linesDomNodeScrollable.style.height=`${o}px`,this._rootDomNode.style.height=`${o}px`,this._rootDomNode.style.marginLeft="0px",this._minContentWidthInPx=Math.max(...this._renderedStickyLines.map(a=>a.scrollWidth))+r.verticalScrollbarWidth,this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(111)==="mouseover"&&(this._foldingIconStore.add(ae(this._lineNumbersDomNode,ke.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(ae(this._lineNumbersDomNode,ke.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,n,r){const s=this._editor._getViewModel();if(!s)return;const o=s.coordinatesConverter.convertModelPositionToViewPosition(new te(t,1)).lineNumber,a=s.getViewLineRenderingData(o),l=this._editor.getOption(68);let c;try{c=zs.filter(a.inlineDecorations,o,a.minColumn,a.maxColumn)}catch{c=[]}const u=new ff(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,c,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),d=new s0(2e3),h=F6(u,d);let f;j1e?f=j1e.createHTML(d.build()):f=d.build();const g=document.createElement("span");g.setAttribute(_V,String(e)),g.setAttribute(W1e,""),g.setAttribute("role","listitem"),g.tabIndex=0,g.className="sticky-line-content",g.classList.add(`stickyLine${t}`),g.style.lineHeight=`${this._lineHeight}px`,g.innerHTML=f;const p=document.createElement("span");p.setAttribute(_V,String(e)),p.setAttribute(dat,""),p.className="sticky-line-number",p.style.lineHeight=`${this._lineHeight}px`;const m=r.contentLeft;p.style.width=`${m}px`;const _=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?_.innerText=t.toString():l.renderType===2&&(_.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),_.className="sticky-line-number-inner",_.style.lineHeight=`${this._lineHeight}px`,_.style.width=`${r.lineNumbersWidth}px`,_.style.paddingLeft=`${r.lineNumbersLeft}px`,p.appendChild(_);const v=this._renderFoldingIconForLine(n,t);v&&p.appendChild(v.domNode),this._editor.applyFontInfo(g),this._editor.applyFontInfo(_),p.style.lineHeight=`${this._lineHeight}px`,g.style.lineHeight=`${this._lineHeight}px`,p.style.height=`${this._lineHeight}px`,g.style.height=`${this._lineHeight}px`;const w=new fat(e,t,g,p,v,h.characterMapping,g.scrollWidth);return this._updateTopAndZIndexOfStickyLine(w)}_updateTopAndZIndexOfStickyLine(e){var u;const t=e.index,n=e.lineDomNode,r=e.lineNumberDomNode,s=t===this._lineNumbers.length-1,o="0",a="1";n.style.zIndex=s?o:a,r.style.zIndex=s?o:a;const l=`${t*this._lineHeight+this._lastLineRelativePosition+((u=e.foldingIcon)!=null&&u.isCollapsed?1:0)}px`,c=`${t*this._lineHeight}px`;return n.style.top=s?l:c,r.style.top=s?l:c,e}_renderFoldingIconForLine(e,t){const n=this._editor.getOption(111);if(!e||n==="never")return;const r=e.regions,s=r.findRange(t),o=r.getStartLineNumber(s);if(!(t===o))return;const l=r.isCollapsed(s),c=new gat(l,o,r.getEndLineNumber(s),this._lineHeight);return c.setVisible(this._isOnGlyphMargin?!0:l||n==="always"),c.domNode.setAttribute(U1e,""),c}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:2,stackOridinal:10}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e<this._renderedStickyLines.length&&this._renderedStickyLines[e].lineDomNode.focus()}getEditorPositionFromNode(e){if(!e||e.children.length>0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const n=rI(t.characterMapping,e,0);return new te(t.lineNumber,n)}getLineNumberFromChildDomNode(e){var t;return((t=this._getRenderedStickyLineFromChildDomNode(e))==null?void 0:t.lineNumber)??null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._renderedStickyLines.length?null:this._renderedStickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,_V);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,W1e)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,U1e)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const n=e.getAttribute(t);if(n!==null)return n;e=e.parentElement}}}class fat{constructor(e,t,n,r,s,o,a){this.index=e,this.lineNumber=t,this.lineDomNode=n,this.lineNumberDomNode=r,this.foldingIcon=s,this.characterMapping=o,this.scrollWidth=a}}class gat{constructor(e,t,n,r){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=n,this.dimension=r,this.domNode=document.createElement("div"),this.domNode.style.width=`${r}px`,this.domNode.style.height=`${r}px`,this.domNode.className=ot.asClassName(e?t9:e9)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class __{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class Q9{constructor(e,t,n){this.range=e,this.children=t,this.parent=n}}class q1e{constructor(e,t,n,r){this.uri=e,this.version=t,this.element=n,this.outlineProviderId=r}}var K9=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},v_=function(i,e){return function(t,n){e(t,n,i)}},y_;(function(i){i.OUTLINE_MODEL="outlineModel",i.FOLDING_PROVIDER_MODEL="foldingProviderModel",i.INDENTATION_MODEL="indentationModel"})(y_||(y_={}));var Hf;(function(i){i[i.VALID=0]="VALID",i[i.INVALID=1]="INVALID",i[i.CANCELED=2]="CANCELED"})(Hf||(Hf={}));let vV=class extends re{constructor(e,t,n,r){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new $a(300)),this._updateOperation=this._register(new ge),this._editor.getOption(116).defaultModel){case y_.OUTLINE_MODEL:this._modelProviders.push(new yV(this._editor,r));case y_.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new SV(this._editor,t,r));case y_.INDENTATION_MODEL:this._modelProviders.push(new wV(this._editor,n));break}}dispose(){this._modelProviders.forEach(e=>e.dispose()),this._updateOperation.clear(),this._cancelModelPromise(),super.dispose()}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const t of this._modelProviders){const{statusPromise:n,modelPromise:r}=t.computeStickyModel(e);this._modelPromise=r;const s=await n;if(this._modelPromise!==r)return null;switch(s){case Hf.CANCELED:return this._updateOperation.clear(),null;case Hf.VALID:return t.stickyModel}}return null}).catch(t=>(bt(t),null))}};vV=K9([v_(2,Ke),v_(3,Be)],vV);class G1e extends re{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,Hf.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=er(n=>this.createModelFromProvider(n));return{statusPromise:t.then(n=>this.isModelValid(n)?e.isCancellationRequested?Hf.CANCELED:(this._stickyModel=this.createStickyModel(e,n),Hf.VALID):this._invalid()).then(void 0,n=>(bt(n),Hf.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let yV=class extends G1e{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return Jd.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){var o;const{stickyOutlineElement:n,providerID:r}=this._stickyModelFromOutlineModel(t,(o=this._stickyModel)==null?void 0:o.outlineProviderId),s=this._editor.getModel();return new q1e(s.uri,s.getVersionId(),n,r)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let n;if(jt.first(e.children.values())instanceof Nge){const a=jt.find(e.children.values(),l=>l.id===t);if(a)n=a.children;else{let l="",c=-1,u;for(const[d,h]of e.children.entries()){const f=this._findSumOfRangesOfGroup(h);f>c&&(u=h,c=f,l=h.id)}t=l,n=u.children}}else n=e.children;const r=[],s=Array.from(n.values()).sort((a,l)=>{const c=new __(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),u=new __(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(c,u)});for(const a of s)r.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new Q9(void 0,r,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const n=[];for(const s of e.children.values())if(s.symbol.selectionRange.startLineNumber!==s.symbol.range.endLineNumber)if(s.symbol.selectionRange.startLineNumber!==t)n.push(this._stickyModelFromOutlineElement(s,s.symbol.selectionRange.startLineNumber));else for(const o of s.children.values())n.push(this._stickyModelFromOutlineElement(o,s.symbol.selectionRange.startLineNumber));n.sort((s,o)=>this._comparator(s.range,o.range));const r=new __(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new Q9(r,n,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const n of e.children.values())t+=this._findSumOfRangesOfGroup(n);return e instanceof FR?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};yV=K9([v_(1,Be)],yV);class Z1e extends G1e{constructor(e){super(e),this._foldingLimitReporter=new Ege(e)}createStickyModel(e,t){const n=this._fromFoldingRegions(t),r=this._editor.getModel();return new q1e(r.uri,r.getVersionId(),n,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,n=[],r=new Q9(void 0,[],void 0);for(let s=0;s<t;s++){const o=e.getParentIndex(s);let a;o!==-1?a=n[o]:a=r;const l=new Q9(new __(e.getStartLineNumber(s),e.getEndLineNumber(s)+1),[],a);a.children.push(l),n.push(l)}return r}}let wV=class extends Z1e{constructor(e,t){super(e),this._languageConfigurationService=t,this.provider=this._register(new DR(e.getModel(),this._languageConfigurationService,this._foldingLimitReporter))}async createModelFromProvider(e){return this.provider.compute(e)}};wV=K9([v_(1,li)],wV);let SV=class extends Z1e{constructor(e,t,n){super(e),this._languageFeaturesService=n;const r=Pf.getFoldingRangeProviders(this._languageFeaturesService,e.getModel());r.length>0&&(this.provider=this._register(new MR(e.getModel(),r,t,this._foldingLimitReporter,void 0)))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){var t;return((t=this.provider)==null?void 0:t.compute(e))??null}};SV=K9([v_(2,Be)],SV);var pat=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Y1e=function(i,e){return function(t,n){e(t,n,i)}};class mat{constructor(e,t,n){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=n}}let CV=class extends re{constructor(e,t,n){super(),this._languageFeaturesService=t,this._languageConfigurationService=n,this._onDidChangeStickyScroll=this._register(new ie),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new ge),this._updateSoon=this._register(new yn(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(116)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(116).enabled&&(this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this.updateStickyModelProvider(),this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this._sessionStore.add(Qe(()=>{var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null})),this.updateStickyModelProvider(),this.update())}getVersionId(){var e;return(e=this._model)==null?void 0:e.version}updateStickyModelProvider(){var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null;const e=this._editor;e.hasModel()&&(this._stickyModelProvider=new vV(e,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){var e;(e=this._cts)==null||e.dispose(!0),this._cts=new oi,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=await this._stickyModelProvider.update(e);e.isCancellationRequested||(this._model=t)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,n,r,s){if(t.children.length===0)return;let o=s;const a=[];for(let u=0;u<t.children.length;u++){const d=t.children[u];d.range&&a.push(d.range.startLineNumber)}const l=this.updateIndex(k3(a,e.startLineNumber,(u,d)=>u-d)),c=this.updateIndex(k3(a,e.startLineNumber+r,(u,d)=>u-d));for(let u=l;u<=c;u++){const d=t.children[u];if(!d)return;if(d.range){const h=d.range.startLineNumber,f=d.range.endLineNumber;e.startLineNumber<=f+1&&h-1<=e.endLineNumber&&h!==o&&(o=h,n.push(new mat(h,f-1,r+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,n,r+1,h))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,n,r,s)}}getCandidateStickyLinesIntersecting(e){var r,s;if(!((r=this._model)!=null&&r.element))return[];let t=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,t,0,-1);const n=(s=this._editor._getViewModel())==null?void 0:s.getHiddenAreas();if(n)for(const o of n)t=t.filter(a=>!(a.startLineNumber>=o.startLineNumber&&a.endLineNumber<=o.endLineNumber+1));return t}};CV=pat([Y1e(1,Be),Y1e(2,li)],CV);var bat=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},w2=function(i,e){return function(t,n){e(t,n,i)}},xV;let rh=(Lm=class extends re{constructor(e,t,n,r,s,o,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=n,this._instaService=r,this._contextKeyService=a,this._sessionStore=new ge,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._stickyScrollWidget=new hat(this._editor),this._stickyLineCandidateProvider=new CV(this._editor,n,s),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=b_.Empty,this._onDidResize(),this._readConfiguration();const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(u=>{this._readConfigurationChange(u)})),this._register(ae(l,ke.CONTEXT_MENU,async u=>{this._onContextMenu(nt(l),u)})),this._stickyScrollFocusedContextKey=B.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=B.stickyScrollVisible.bindTo(this._contextKeyService);const c=this._register(sc(l));this._register(c.onDidBlur(u=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(c.onDidFocus(u=>{this.focus()})),this._registerMouseListeners(),this._register(ae(l,ke.MOUSE_DOWN,u=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(xV.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)==null||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new ge,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex<this._stickyScrollWidget.lineNumberCount-1&&this._focusNav(!0)}focusPrevious(){this._focusedStickyElementIndex>0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(M.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new ge),t=this._register(new NS(this._editor,{extractLineNumberFromMouseEvent:s=>{const o=this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);return o?o.lineNumber:0}})),n=s=>{if(!this._editor.hasModel()||s.target.type!==12||s.target.detail!==this._stickyScrollWidget.getId())return null;const o=s.target.element;if(!o||o.innerText!==o.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(o);return a?{range:new M(a.lineNumber,a.column,a.lineNumber,a.column+o.innerText.length),textElement:o}:null},r=this._stickyScrollWidget.getDomNode();this._register(pi(r,ke.CLICK,s=>{if(s.ctrlKey||s.altKey||s.metaKey||!s.leftButton)return;if(s.shiftKey){const c=this._stickyScrollWidget.getLineIndexFromChildDomNode(s.target);if(c===null)return;const u=new te(this._endLineNumbers[c],1);this._revealLineInCenterIfOutsideViewport(u);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(s.target)){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);this._toggleFoldingRegionForLine(c);return}if(!this._stickyScrollWidget.isInStickyLine(s.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(s.target);if(!l){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);if(c===null)return;l=new te(c,1)}this._revealPosition(l)})),this._register(pi(r,ke.MOUSE_MOVE,s=>{if(s.shiftKey){const o=this._stickyScrollWidget.getLineIndexFromChildDomNode(s.target);if(o===null||this._showEndForLine!==null&&this._showEndForLine===o)return;this._showEndForLine=o,this._renderStickyScroll();return}this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(ae(r,ke.MOUSE_LEAVE,s=>{this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([s,o])=>{const a=n(s);if(!a||!s.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:c}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(c.style.textDecoration==="underline")return;const u=new oi;e.add(Qe(()=>u.dispose(!0)));let d;Vb(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new te(l.startLineNumber,l.startColumn+1),!1,u.token).then(h=>{if(!u.token.isCancellationRequested)if(h.length!==0){this._candidateDefinitionsLength=h.length;const f=c;d!==f?(e.clear(),d=f,d.style.textDecoration="underline",e.add(Qe(()=>{d.style.textDecoration="none"}))):d||(d=f,d.style.textDecoration="underline",e.add(Qe(()=>{d.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async s=>{if(s.target.type!==12||s.target.detail!==this._stickyScrollWidget.getId())return;const o=this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);o&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:o.lineNumber,column:1})),this._instaService.invokeFunction(Wfe,s,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const n=new yl(e,t);this._contextMenuService.showContextMenu({menuId:je.StickyScrollContext,getAnchor:()=>n})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),n=t==null?void 0:t.foldingIcon;if(!n)return;TR(this._foldingModel,Number.MAX_VALUE,[e]),n.isCollapsed=!n.isCollapsed;const r=(n.isCollapsed?this._editor.getTopForLineNumber(n.foldingEndLine):this._editor.getTopForLineNumber(n.foldingStartLine))-this._editor.getOption(67)*t.index+1;this._editor.setScrollTop(r),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(116);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(n=>{n.scrollTopChanged&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(n=>this._onTokensChange(n))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=void 0,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(68).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=void 0,this._renderStickyScroll(0)}))}_readConfigurationChange(e){(e.hasChanged(116)||e.hasChanged(73)||e.hasChanged(67)||e.hasChanged(111)||e.hasChanged(68))&&this._readConfiguration(),e.hasChanged(68)&&this._renderStickyScroll(0)}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const n of t)for(const r of e.ranges)if(n>=r.fromLineNumber&&n<=r.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(0)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(67);this._maxStickyLines=Math.round(t*.25)}async _renderStickyScroll(e){const t=this._editor.getModel();if(!t||t.isTooLargeForTokenization()){this._resetState();return}const n=this._updateAndGetMinRebuildFromLine(e),r=this._stickyLineCandidateProvider.getVersionId();if(r===void 0||r===t.getVersionId())if(!this._focused)await this._updateState(n);else if(this._focusedStickyElementIndex===-1)await this._updateState(n),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const o=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(n),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(o)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}_updateAndGetMinRebuildFromLine(e){if(e!==void 0){const t=this._minRebuildFromLine!==void 0?this._minRebuildFromLine:1/0;this._minRebuildFromLine=Math.min(e,t)}return this._minRebuildFromLine}async _updateState(e){var n;this._minRebuildFromLine=void 0,this._foldingModel=await((n=Pf.get(this._editor))==null?void 0:n.getFoldingModel())??void 0,this._widgetState=this.findScrollWidgetState();const t=this._widgetState.startLineNumbers.length>0;this._stickyScrollVisibleContextKey.set(t),this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}async _resetState(){this._minRebuildFromLine=void 0,this._foldingModel=void 0,this._widgetState=b_.Empty,this._stickyScrollVisibleContextKey.set(!1),this._stickyScrollWidget.setState(void 0,void 0)}findScrollWidgetState(){const e=this._editor.getOption(67),t=Math.min(this._maxStickyLines,this._editor.getOption(116).maxLineCount),n=this._editor.getScrollTop();let r=0;const s=[],o=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new __(a[0].startLineNumber,a[a.length-1].endLineNumber),c=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const u of c){const d=u.startLineNumber,h=u.endLineNumber,f=u.nestingDepth;if(h-d>0){const g=(f-1)*e,p=f*e,m=this._editor.getBottomForLineNumber(d)-n,_=this._editor.getTopForLineNumber(h)-n,v=this._editor.getBottomForLineNumber(h)-n;if(g>_&&g<=v){s.push(d),o.push(h+1),r=v-p;break}else p>m&&p<=v&&(s.push(d),o.push(h+1));if(s.length===t)break}}}return this._endLineNumbers=o,new b_(s,o,r,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},xV=Lm,Lm.ID="store.contrib.stickyScrollController",Lm);rh=xV=bat([w2(1,Ao),w2(2,Be),w2(3,Ke),w2(4,li),w2(5,fa),w2(6,lt)],rh);class _at extends Ms{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...ut("toggleEditorStickyScroll","Toggle Editor Sticky Scroll"),mnemonicTitle:b({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Editor Sticky Scroll")},metadata:{description:ut("toggleEditorStickyScroll.description","Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:uat.View,toggled:{condition:pe.equals("config.editor.stickyScroll.enabled",!0),title:b("stickyScroll","Sticky Scroll"),mnemonicTitle:b({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:je.CommandPalette},{id:je.MenubarAppearanceMenu,group:"4_editor",order:3},{id:je.StickyScrollContext}]})}async run(e){const t=e.get(Lt),n=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",n)}}const J9=100;class vat extends lc{constructor(){super({id:"editor.action.focusStickyScroll",title:{...ut("focusStickyScroll","Focus on the editor sticky scroll"),mnemonicTitle:b({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll")},precondition:pe.and(pe.has("config.editor.stickyScroll.enabled"),B.stickyScrollVisible),menu:[{id:je.CommandPalette}]})}runEditorCommand(e,t){var n;(n=rh.get(t))==null||n.focus()}}class yat extends lc{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:ut("selectNextStickyScrollLine.title","Select the next editor sticky scroll line"),precondition:B.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:J9,primary:18}})}runEditorCommand(e,t){var n;(n=rh.get(t))==null||n.focusNext()}}class wat extends lc{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:ut("selectPreviousStickyScrollLine.title","Select the previous sticky scroll line"),precondition:B.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:J9,primary:16}})}runEditorCommand(e,t){var n;(n=rh.get(t))==null||n.focusPrevious()}}class Sat extends lc{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:ut("goToFocusedStickyScrollLine.title","Go to the focused sticky scroll line"),precondition:B.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:J9,primary:3}})}runEditorCommand(e,t){var n;(n=rh.get(t))==null||n.goToFocused()}}class Cat extends lc{constructor(){super({id:"editor.action.selectEditor",title:ut("selectEditor.title","Select Editor"),precondition:B.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:J9,primary:9}})}runEditorCommand(e,t){var n;(n=rh.get(t))==null||n.selectEditor()}}qt(rh.ID,rh,1),En(_at),En(vat),En(wat),En(yat),En(Sat),En(Cat);var X1e=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},w_=function(i,e){return function(t,n){e(t,n,i)}};class xat{constructor(e,t,n,r,s,o){this.range=e,this.insertText=t,this.filterText=n,this.additionalTextEdits=r,this.command=s,this.completion=o}}let OV=class extends eEe{constructor(e,t,n,r,s,o){super(s.disposable),this.model=e,this.line=t,this.word=n,this.completionModel=r,this._suggestMemoryService=o}canBeReused(e,t,n){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===n.startColumn&&this.word.endColumn<n.endColumn&&this.completionModel.getIncompleteProvider().size===0}get items(){const e=[],{items:t}=this.completionModel,n=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},t),r=jt.slice(t,n),s=jt.slice(t,0,n);let o=5;for(const a of jt.concat(r,s)){if(a.score===gc.Default)continue;const l=new M(a.editStart.lineNumber,a.editStart.column,a.editInsertEnd.lineNumber,a.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),c=a.completion.insertTextRules&&a.completion.insertTextRules&4?{snippet:a.completion.insertText}:a.completion.insertText;e.push(new xat(l,c,a.filterTextLow??a.labelLow,a.completion.additionalTextEdits,a.completion.command,a)),o-->=0&&a.resolve(St.None)}return e}};OV=X1e([w_(5,g9)],OV);let LV=class extends re{constructor(e,t,n,r){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=n,this._editorService=r,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,n,r){var f;if(n.selectedSuggestionInfo)return;let s;for(const g of this._editorService.listCodeEditors())if(g.getModel()===e){s=g;break}if(!s)return;const o=s.getOption(90);if(o2.isAllOff(o))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(o2.valueFor(o,l)!=="inline")return;let c=e.getWordAtPosition(t),u;if(c!=null&&c.word||(u=this._getTriggerCharacterInfo(e,t)),!(c!=null&&c.word)&&!u||(c||(c=e.getWordUntilPosition(t)),c.endColumn!==t.column))return;let d;const h=e.getValueInRange(new M(t.lineNumber,1,t.lineNumber,t.column));if(!u&&((f=this._lastResult)!=null&&f.canBeReused(e,t.lineNumber,c))){const g=new s1e(h,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=g,this._lastResult.acquire(),d=this._lastResult}else{const g=await jR(this._languageFeatureService.completionProvider,e,t,new Zb(void 0,_9.createSuggestFilter(s).itemKind,u==null?void 0:u.providers),u&&{triggerKind:1,triggerCharacter:u.ch},r);let p;g.needsClipboard&&(p=await this._clipboardService.readText());const m=new Df(g.items,t.column,new s1e(h,0),b9.None,s.getOption(119),s.getOption(113),{boostFullMatch:!1,firstMatchCanBeWeak:!1},p);d=new OV(e,t.lineNumber,c,m,g,this._suggestMemoryService)}return this._lastResult=d,d}handleItemDidShow(e,t){t.completion.resolve(St.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var s;const n=e.getValueInRange(M.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),r=new Set;for(const o of this._languageFeatureService.completionProvider.all(e))(s=o.triggerCharacters)!=null&&s.includes(n)&&r.add(o);if(r.size!==0)return{providers:r,ch:n}}};LV=X1e([w_(0,Be),w_(1,Hd),w_(2,g9),w_(3,Kt)],LV),c4(LV);class Oat extends Ve{constructor(){super({id:"editor.action.forceRetokenize",label:b("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getModel();n.tokenization.resetTokenization();const r=new lr;n.tokenization.forceTokenization(n.getLineCount()),r.stop(),console.log(`tokenization took ${r.elapsed()}`)}}we(Oat);const OO=class OO extends Ms{constructor(){super({id:OO.ID,title:ut({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},metadata:{description:ut("tabMovesFocusDescriptions","Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const t=!f4.getTabFocusMode();f4.setTabFocusMode(t),Vs(t?b("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):b("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}};OO.ID="editor.action.toggleTabFocusMode";let kV=OO;En(kV);var Lat=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Q1e=function(i,e){return function(t,n){e(t,n,i)}};let EV=class extends re{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,n={},r,s){super(),this._link=t,this._hoverService=r,this._enabled=!0,this.el=_e(e,Ee("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=n.hoverDelegate??Hs("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const o=this._register(new Ht(this.el,"click")),a=this._register(new Ht(this.el,"keypress")),l=Pe.chain(a.event,d=>d.map(h=>new kn(h)).filter(h=>h.keyCode===3)),c=this._register(new Ht(this.el,In.Tap)).event;this._register(Kr.addTarget(this.el));const u=Pe.any(o.event,l,c);this._register(u(d=>{this.enabled&&(zt.stop(d,!0),n!=null&&n.opener?n.opener(this._link.href):s.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){this.hoverDelegate.showNativeHover?this.el.title=e??"":!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};EV=Lat([Q1e(3,gu),Q1e(4,lo)],EV);var K1e=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},J1e=function(i,e){return function(t,n){e(t,n,i)}};const kat=26;let TV=class extends re{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(PV))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{var t;this.hide(),(t=e.onClose)==null||t.call(e)}}),this._editor.setBanner(this.banner.element,kat)}};TV=K1e([J1e(1,Ke)],TV);let PV=class extends re{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(Od,{}),this.element=Ee("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=Ee("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){br(this.element)}show(e){br(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const n=_e(this.element,Ee("div.icon-container"));n.setAttribute("aria-hidden","true"),e.icon&&n.appendChild(Ee(`div${ot.asCSSSelector(e.icon)}`));const r=_e(this.element,Ee("div.message-container"));if(r.setAttribute("aria-hidden","true"),r.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=_e(this.element,Ee("div.message-actions-container")),e.actions)for(const o of e.actions)this._register(this.instantiationService.createInstance(EV,this.messageActionsContainer,{...o,tabIndex:-1},{}));const s=_e(this.element,Ee("div.action-container"));this.actionBar=this._register(new ya(s)),this.actionBar.push(this._register(new Do("banner.close","Close Banner",ot.asClassName(Dce),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};PV=K1e([J1e(0,Ke)],PV);var NV=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},S2=function(i,e){return function(t,n){e(t,n,i)}};const Eat=Vn("extensions-warning-message",Le.warning,b("warningIcon","Icon shown with a warning message in the extensions editor."));let S_=(w3=class extends re{constructor(e,t,n,r){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=n,this._highlighter=null,this._bannerClosed=!1,this._updateState=s=>{if(s&&s.hasMore){if(this._bannerClosed)return;const o=Math.max(s.ambiguousCharacterCount,s.nonBasicAsciiCharacterCount,s.invisibleCharacterCount);let a;if(s.nonBasicAsciiCharacterCount>=o)a={message:b("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new x_};else if(s.ambiguousCharacterCount>=o)a={message:b("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new yp};else if(s.invisibleCharacterCount>=o)a={message:b("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new C_};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:Eat,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(r.createInstance(TV,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(126),this._register(n.onDidChangeTrust(s=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(s=>{s.hasChanged(126)&&(this._options=e.getOption(126),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=Tat(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(n=>n===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(n=>n.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(n=>n==="_os"?new Intl.NumberFormat().resolvedOptions().locale:n==="_vscode"?tke:n)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new DV(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new Pat(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},w3.ID="editor.contrib.unicodeHighlighter",w3);S_=NV([S2(1,ho),S2(2,$oe),S2(3,Ke)],S_);function Tat(i,e){return{nonBasicASCII:e.nonBasicASCII===ra?!i:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===ra?!i:e.includeComments,includeStrings:e.includeStrings===ra?!i:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let DV=class extends re{constructor(e,t,n,r){super(),this._editor=e,this._options=t,this._updateState=n,this._editorWorkerService=r,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new yn(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const n=[];if(!t.hasMore)for(const r of t.ranges)n.push({range:r,options:eC.instance.getDecorationFromOptions(this._options)});this._decorations.set(n)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!YI(t,e))return null;const n=t.getValueInRange(e.range);return{reason:tpe(n,this._options),inComment:XI(t,e),inString:QI(t,e)}}};DV=NV([S2(3,ho)],DV);class Pat extends re{constructor(e,t,n){super(),this._editor=e,this._options=t,this._updateState=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new yn(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],n={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const r of e){const s=NE.computeUnicodeHighlights(this._model,this._options,r);for(const o of s.ranges)n.ranges.push(o);n.ambiguousCharacterCount+=n.ambiguousCharacterCount,n.invisibleCharacterCount+=n.invisibleCharacterCount,n.nonBasicAsciiCharacterCount+=n.nonBasicAsciiCharacterCount,n.hasMore=n.hasMore||s.hasMore}if(!n.hasMore)for(const r of n.ranges)t.push({range:r,options:eC.instance.getDecorationFromOptions(this._options)});this._updateState(n),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),n=t.getValueInRange(e.range);return YI(t,e)?{reason:tpe(n,this._options),inComment:XI(t,e),inString:QI(t,e)}:null}}const epe=b("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options");let IV=class{constructor(e,t,n){this._editor=e,this._languageService=t,this._openerService=n,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const n=this._editor.getModel(),r=this._editor.getContribution(S_.ID);if(!r)return[];const s=[],o=new Set;let a=300;for(const l of t){const c=r.getDecorationInfo(l);if(!c)continue;const d=n.getValueInRange(l.range).codePointAt(0),h=MV(d);let f;switch(c.reason.kind){case 0:{j3(c.reason.confusableWith)?f=b("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",h,MV(c.reason.confusableWith.codePointAt(0))):f=b("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",h,MV(c.reason.confusableWith.codePointAt(0)));break}case 1:f=b("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",h);break;case 2:f=b("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",h);break}if(o.has(f))continue;o.add(f);const g={codePoint:d,reason:c.reason,inComment:c.inComment,inString:c.inString},p=b("unicodeHighlight.adjustSettings","Adjust settings"),m=`command:${tC.ID}?${encodeURIComponent(JSON.stringify(g))}`,_=new Jr("",!0).appendMarkdown(f).appendText(" ").appendLink(m,p,epe);s.push(new Al(this,l.range,[_],!1,a++))}return s}renderHoverParts(e,t){return ret(e,t,this._editor,this._languageService,this._openerService)}};IV=NV([S2(1,Jn),S2(2,lo)],IV);function AV(i){return`U+${i.toString(16).padStart(4,"0")}`}function MV(i){let e=`\`${AV(i)}\``;return Ag.isInvisibleCharacter(i)||(e+=` "${`${Nat(i)}`}"`),e}function Nat(i){return i===96?"`` ` ``":"`"+String.fromCodePoint(i)+"`"}function tpe(i,e){return NE.computeUnicodeHighlightReason(i,e)}const LO=class LO{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const n=`${e}${t}`;let r=this.map.get(n);return r||(r=vt.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(n,r)),r}};LO.instance=new LO;let eC=LO;class Dat extends Ve{constructor(){super({id:yp.ID,label:b("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=b("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}async run(e,t,n){const r=e==null?void 0:e.get(Lt);r&&this.runAction(r)}async runAction(e){await e.updateValue(to.includeComments,!1,2)}}class Iat extends Ve{constructor(){super({id:yp.ID,label:b("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=b("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}async run(e,t,n){const r=e==null?void 0:e.get(Lt);r&&this.runAction(r)}async runAction(e){await e.updateValue(to.includeStrings,!1,2)}}const kO=class kO extends Ve{constructor(){super({id:kO.ID,label:b("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=b("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}async run(e,t,n){const r=e==null?void 0:e.get(Lt);r&&this.runAction(r)}async runAction(e){await e.updateValue(to.ambiguousCharacters,!1,2)}};kO.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let yp=kO;const EO=class EO extends Ve{constructor(){super({id:EO.ID,label:b("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=b("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}async run(e,t,n){const r=e==null?void 0:e.get(Lt);r&&this.runAction(r)}async runAction(e){await e.updateValue(to.invisibleCharacters,!1,2)}};EO.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let C_=EO;const TO=class TO extends Ve{constructor(){super({id:TO.ID,label:b("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=b("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}async run(e,t,n){const r=e==null?void 0:e.get(Lt);r&&this.runAction(r)}async runAction(e){await e.updateValue(to.nonBasicASCII,!1,2)}};TO.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let x_=TO;const PO=class PO extends Ve{constructor(){super({id:PO.ID,label:b("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,n){const{codePoint:r,reason:s,inString:o,inComment:a}=n,l=String.fromCodePoint(r),c=e.get(Ja),u=e.get(Lt);function d(g){return Ag.isInvisibleCharacter(g)?b("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",AV(g)):b("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${AV(g)} "${l}"`)}const h=[];if(s.kind===0)for(const g of s.notAmbiguousInLocales)h.push({label:b("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',g),run:async()=>{Mat(u,[g])}});if(h.push({label:d(r),run:()=>Aat(u,[r])}),a){const g=new Dat;h.push({label:g.label,run:async()=>g.runAction(u)})}else if(o){const g=new Iat;h.push({label:g.label,run:async()=>g.runAction(u)})}if(s.kind===0){const g=new yp;h.push({label:g.label,run:async()=>g.runAction(u)})}else if(s.kind===1){const g=new C_;h.push({label:g.label,run:async()=>g.runAction(u)})}else if(s.kind===2){const g=new x_;h.push({label:g.label,run:async()=>g.runAction(u)})}else Rat(s);const f=await c.pick(h,{title:epe});f&&await f.run()}};PO.ID="editor.action.unicodeHighlight.showExcludeOptions";let tC=PO;async function Aat(i,e){const t=i.getValue(to.allowedCharacters);let n;typeof t=="object"&&t?n=t:n={};for(const r of e)n[String.fromCodePoint(r)]=!0;await i.updateValue(to.allowedCharacters,n,2)}async function Mat(i,e){var r;const t=(r=i.inspect(to.allowedLocales).user)==null?void 0:r.value;let n;typeof t=="object"&&t?n=Object.assign({},t):n={};for(const s of e)n[s]=!0;await i.updateValue(to.allowedLocales,n,2)}function Rat(i){throw new Error(`Unexpected value: ${i}`)}we(yp),we(C_),we(x_),we(tC),qt(S_.ID,S_,1),sp.register(IV);var Fat=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},npe=function(i,e){return function(t,n){e(t,n,i)}};const ipe="ignoreUnusualLineTerminators";function Vat(i,e,t){i.setModelProperty(e.uri,ipe,t)}function Hat(i,e){return i.getModelProperty(e.uri,ipe)}let nC=(S3=class extends re{constructor(e,t,n){super(),this._editor=e,this._dialogService=t,this._codeEditorService=n,this._isPresentingDialog=!1,this._config=this._editor.getOption(127),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(127)&&(this._config=this._editor.getOption(127),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(r=>{r.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||Hat(this._codeEditorService,e)===!0||this._editor.getOption(92))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let n;try{this._isPresentingDialog=!0,n=await this._dialogService.confirm({title:b("unusualLineTerminators.title","Unusual Line Terminators"),message:b("unusualLineTerminators.message","Detected unusual line terminators"),detail:b("unusualLineTerminators.detail","The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",Xa(e.uri)),primaryButton:b({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:b("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!n.confirmed){Vat(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},S3.ID="editor.contrib.unusualLineTerminatorsDetector",S3);nC=Fat([npe(1,_8),npe(2,Kt)],nC),qt(nC.ID,nC,1);var Bat=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},zat=function(i,e){return function(t,n){e(t,n,i)}};class rpe{constructor(){this.selector={language:"*"}}provideDocumentHighlights(e,t,n){const r=[],s=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return s?e.isDisposed()?void 0:e.findMatches(s.word,!0,!1,!0,Mv,!1).map(a=>({range:a.range,kind:Wm.Text})):Promise.resolve(r)}provideMultiDocumentHighlights(e,t,n,r){const s=new dr,o=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!o)return Promise.resolve(s);for(const a of[e,...n]){if(a.isDisposed())continue;const c=a.findMatches(o.word,!0,!1,!0,Mv,!1).map(u=>({range:u.range,kind:Wm.Text}));c&&s.set(a.uri,c)}return s}}let RV=class extends re{constructor(e){super(),this._register(e.documentHighlightProvider.register("*",new rpe)),this._register(e.multiDocumentHighlightProvider.register("*",new rpe))}};RV=Bat([zat(0,Be)],RV);var spe=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},iC=function(i,e){return function(t,n){e(t,n,i)}},Ii,FV;const VV=new Ae("hasWordHighlights",!1);function ope(i,e,t,n){const r=i.ordered(e);return kk(r.map(s=>()=>Promise.resolve(s.provideDocumentHighlights(e,t,n)).then(void 0,xi)),s=>s!=null).then(s=>{if(s){const o=new dr;return o.set(e.uri,s),o}return new dr})}function $at(i,e,t,n,r,s){const o=i.ordered(e);return kk(o.map(a=>()=>{const l=s.filter(c=>hre(c)).filter(c=>cT(a.selector,c.uri,c.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,l,r)).then(void 0,xi)}),a=>a!=null)}class ape{constructor(e,t,n){this._model=e,this._selection=t,this._wordSeparators=n,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=er(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const n=e.getWordAtPosition(t.getPosition());return n?new M(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):null}isValid(e,t,n){const r=t.startLineNumber,s=t.startColumn,o=t.endColumn,a=this._getCurrentWordRange(e,t);let l=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let c=0,u=n.length;!l&&c<u;c++){const d=n.getRange(c);d&&d.startLineNumber===r&&d.startColumn<=s&&d.endColumn>=o&&(l=!0)}return l}cancel(){this.result.cancel()}}class jat extends ape{constructor(e,t,n,r){super(e,t,n),this._providers=r}_compute(e,t,n,r){return ope(this._providers,e,t.getPosition(),r).then(s=>s||new dr)}}class Wat extends ape{constructor(e,t,n,r,s){super(e,t,n),this._providers=r,this._otherModels=s}_compute(e,t,n,r){return $at(this._providers,e,t.getPosition(),n,r,this._otherModels).then(s=>s||new dr)}}function Uat(i,e,t,n,r){return new jat(e,t,r,i)}function qat(i,e,t,n,r,s){return new Wat(e,t,r,i,s)}oo("_executeDocumentHighlights",async(i,e,t)=>{const n=i.get(Be),r=await ope(n.documentHighlightProvider,e,t,St.None);return r==null?void 0:r.get(e.uri)});let HV=(wg=class{constructor(e,t,n,r,s){this.toUnhook=new ge,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new dr,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.runDelayer=this.toUnhook.add(new $a(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=n,this.codeEditorService=s,this._hasWordHighlights=VV.bindTo(r),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(81),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(o=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this.runDelayer.trigger(()=>{this._onPositionChanged(o)})})),this.toUnhook.add(e.onDidFocusEditorText(o=>{this.occurrencesHighlight!=="off"&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}))})),this.toUnhook.add(e.onDidChangeModelContent(o=>{a5(this.model.uri,"output")||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(o=>{!o.newModelUrl&&o.oldModelUrl?this._stopSingular():Ii.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(o=>{var l,c;const a=this.editor.getOption(81);if(this.occurrencesHighlight!==a)switch(this.occurrencesHighlight=a,a){case"off":this._stopAll();break;case"singleFile":this._stopAll((c=(l=Ii.query)==null?void 0:l.modelInfo)==null?void 0:c.model);break;case"multiFile":Ii.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",a);break}})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,Ii.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&(this.runDelayer.cancel(),this._run())}_getSortedHighlights(){return this.decorations.getRanges().sort(M.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),n=(e.findIndex(s=>s.containsPosition(this.editor.getPosition()))+1)%e.length,r=e[n];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(r.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(r);const s=this._getWord();if(s){const o=this.editor.getModel().getLineContent(r.startLineNumber);Vs(`${o}, ${n+1} of ${e.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),n=(e.findIndex(s=>s.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,r=e[n];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(r.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(r);const s=this._getWord();if(s){const o=this.editor.getModel().getLineContent(r.startLineNumber);Vs(`${o}, ${n+1} of ${e.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=Ii.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),Ii.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){const t=this.codeEditorService.listCodeEditors(),n=[];for(const r of t){if(!r.hasModel()||R8(r.getModel().uri,e==null?void 0:e.uri))continue;const s=Ii.storedDecorationIDs.get(r.getModel().uri);if(!s)continue;r.removeDecorations(s),n.push(r.getModel().uri);const o=Bf.get(r);o!=null&&o.wordHighlighter&&o.wordHighlighter.decorations.length>0&&(o.wordHighlighter.decorations.clear(),o.wordHighlighter.workerRequest=null,o.wordHighlighter._hasWordHighlights.set(!1))}for(const r of n)Ii.storedDecorationIDs.delete(r)}_stopSingular(){var e,t,n,r;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((e=this.editor.getModel())==null?void 0:e.uri.scheme)!==_t.vscodeNotebookCell&&((n=(t=Ii.query)==null?void 0:t.modelInfo)==null?void 0:n.model.uri.scheme)!==_t.vscodeNotebookCell?(Ii.query=null,this._run()):(r=Ii.query)!=null&&r.modelInfo&&(Ii.query.modelInfo=null)),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(e){this._removeAllDecorations(e),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){var t;if(this.occurrencesHighlight==="off"){this._stopAll();return}if(e.reason!==3&&((t=this.editor.getModel())==null?void 0:t.uri.scheme)!==_t.vscodeNotebookCell){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,n=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:n})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===_t.vscodeNotebookCell){const s=[],o=this.codeEditorService.listCodeEditors();for(const a of o){const l=a.getModel();l&&l!==e&&l.uri.scheme===_t.vscodeNotebookCell&&s.push(l)}return s}const n=[],r=this.codeEditorService.listCodeEditors();for(const s of r){if(!BA(s))continue;const o=s.getModel();o&&e===o.modified&&n.push(o.modified)}if(n.length)return n;if(this.occurrencesHighlight==="singleFile")return[];for(const s of r){const o=s.getModel();o&&o!==e&&n.push(o)}return n}_run(e){var r,s;let t;if(this.editor.hasTextFocus()){const o=this.editor.getSelection();if(!o||o.startLineNumber!==o.endLineNumber){Ii.query=null,this._stopAll();return}const a=o.startColumn,l=o.endColumn,c=this._getWord();if(!c||c.startColumn>a||c.endColumn<l){Ii.query=null,this._stopAll();return}t=this.workerRequest&&this.workerRequest.isValid(this.model,o,this.decorations),Ii.query={modelInfo:{model:this.model,selection:o},word:c}}else if(!Ii.query){this._stopAll();return}if(this.lastCursorPositionChangeTime=new Date().getTime(),t)this.workerRequestCompleted&&this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else if(R8(this.editor.getModel().uri,(r=Ii.query.modelInfo)==null?void 0:r.model.uri)){if(!e){const l=this.decorations.getRanges();for(const c of l)if(c.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model:void 0);const o=++this.workerRequestTokenId;this.workerRequestCompleted=!1;const a=this.getOtherModelsToHighlight(this.editor.getModel());if(!Ii.query||!Ii.query.modelInfo||Ii.query.modelInfo.model.isDisposed())return;this.workerRequest=this.computeWithModel(Ii.query.modelInfo.model,Ii.query.modelInfo.selection,Ii.query.word,a),(s=this.workerRequest)==null||s.result.then(l=>{o===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=l||[],this._beginRenderDecorations())},bt)}}computeWithModel(e,t,n,r){return r.length?qat(this.multiDocumentProviders,e,t,n,this.editor.getOption(132),r):Uat(this.providers,e,t,n,this.editor.getOption(132))}_beginRenderDecorations(){const e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){var t,n,r;this.renderDecorationsTimer=-1;const e=this.codeEditorService.listCodeEditors();for(const s of e){const o=Bf.get(s);if(!o)continue;const a=[],l=(t=s.getModel())==null?void 0:t.uri;if(l&&this.workerRequestValue.has(l)){const c=Ii.storedDecorationIDs.get(l),u=this.workerRequestValue.get(l);if(u)for(const h of u)h.range&&a.push({range:h.range,options:Ast(h.kind)});let d=[];s.changeDecorations(h=>{d=h.deltaDecorations(c??[],a)}),Ii.storedDecorationIDs=Ii.storedDecorationIDs.set(l,d),a.length>0&&((n=o.wordHighlighter)==null||n.decorations.set(a),(r=o.wordHighlighter)==null||r._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}},Ii=wg,wg.storedDecorationIDs=new dr,wg.query=null,wg);HV=Ii=spe([iC(4,Kt)],HV);let Bf=(km=class extends re{static get(e){return e.getContribution(FV.ID)}constructor(e,t,n,r){super(),this._wordHighlighter=null;const s=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new HV(e,n.documentHighlightProvider,n.multiDocumentHighlightProvider,t,r))};this._register(e.onDidChangeModel(o=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),s()})),s()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)==null||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)==null||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},FV=km,km.ID="editor.contrib.wordHighlighter",km);Bf=FV=spe([iC(1,lt),iC(2,Be),iC(3,Kt)],Bf);class lpe extends Ve{constructor(e,t){super(t),this._isNext=e}run(e,t){const n=Bf.get(t);n&&(this._isNext?n.moveNext():n.moveBack())}}class Gat extends lpe{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:b("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:VV,kbOpts:{kbExpr:B.editorTextFocus,primary:65,weight:100}})}}class Zat extends lpe{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:b("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:VV,kbOpts:{kbExpr:B.editorTextFocus,primary:1089,weight:100}})}}class Yat extends Ve{constructor(){super({id:"editor.action.wordHighlight.trigger",label:b("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:void 0,kbOpts:{kbExpr:B.editorTextFocus,primary:0,weight:100}})}run(e,t,n){const r=Bf.get(t);r&&r.restoreViewState(!0)}}qt(Bf.ID,Bf,0),we(Gat),we(Zat),we(Yat),c4(RV);class rC extends Gi{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){if(!t.hasModel())return;const r=qa(t.getOption(132),t.getOption(131)),s=t.getModel(),o=t.getSelections(),a=o.length>1,l=o.map(c=>{const u=new te(c.positionLineNumber,c.positionColumn),d=this._move(r,s,u,this._wordNavigationType,a);return this._moveTo(c,d,this._inSelectionMode)});if(s.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,l.map(c=>Jt.fromModelSelection(c))),l.length===1){const c=new te(l[0].positionLineNumber,l[0].positionColumn);t.revealPosition(c,0)}}_moveTo(e,t,n){return n?new We(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new We(t.lineNumber,t.column,t.lineNumber,t.column)}}class zf extends rC{_move(e,t,n,r,s){return ln.moveWordLeft(e,t,n,r,s)}}class $f extends rC{_move(e,t,n,r,s){return ln.moveWordRight(e,t,n,r)}}class Xat extends zf{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class Qat extends zf{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class Kat extends zf{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:pe.and(B.textInputFocus,(e=pe.and(F8,Hy))==null?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class Jat extends zf{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class elt extends zf{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class tlt extends zf{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:pe.and(B.textInputFocus,(e=pe.and(F8,Hy))==null?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class nlt extends zf{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,n,r,s){return super._move(qa(Ql.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,s)}}class ilt extends zf{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,n,r,s){return super._move(qa(Ql.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,s)}}class rlt extends $f{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class slt extends $f{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:pe.and(B.textInputFocus,(e=pe.and(F8,Hy))==null?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class olt extends $f{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class alt extends $f{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class llt extends $f{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:pe.and(B.textInputFocus,(e=pe.and(F8,Hy))==null?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class clt extends $f{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class ult extends $f{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,n,r,s){return super._move(qa(Ql.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,s)}}class dlt extends $f{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,n,r,s){return super._move(qa(Ql.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,s)}}class sC extends Gi{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){const r=e.get(li);if(!t.hasModel())return;const s=qa(t.getOption(132),t.getOption(131)),o=t.getModel(),a=t.getSelections(),l=t.getOption(6),c=t.getOption(11),u=r.getLanguageConfiguration(o.getLanguageId()).getAutoClosingPairs(),d=t._getViewModel(),h=a.map(f=>{const g=this._delete({wordSeparators:s,model:o,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:u,autoClosedCharacters:d.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Rr(g,"")});t.pushUndoStop(),t.executeCommands(this.id,h),t.pushUndoStop()}}class BV extends sC{_delete(e,t){const n=ln.deleteWordLeft(e,t);return n||new M(1,1,1,1)}}class zV extends sC{_delete(e,t){const n=ln.deleteWordRight(e,t);if(n)return n;const r=e.model.getLineCount(),s=e.model.getLineMaxColumn(r);return new M(r,s,r,s)}}class hlt extends BV{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:B.writable})}}class flt extends BV{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:B.writable})}}class glt extends BV{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:B.writable,kbOpts:{kbExpr:B.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class plt extends zV{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:B.writable})}}class mlt extends zV{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:B.writable})}}class blt extends zV{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:B.writable,kbOpts:{kbExpr:B.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class _lt extends Ve{constructor(){super({id:"deleteInsideWord",precondition:B.writable,label:b("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,n){if(!t.hasModel())return;const r=qa(t.getOption(132),t.getOption(131)),s=t.getModel(),a=t.getSelections().map(l=>{const c=ln.deleteInsideWord(r,s,l);return new Rr(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}De(new Xat),De(new Qat),De(new Kat),De(new Jat),De(new elt),De(new tlt),De(new rlt),De(new slt),De(new olt),De(new alt),De(new llt),De(new clt),De(new nlt),De(new ilt),De(new ult),De(new dlt),De(new hlt),De(new flt),De(new glt),De(new plt),De(new mlt),De(new blt),we(_lt);class vlt extends sC{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:B.writable,kbOpts:{kbExpr:B.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const n=Ow.deleteWordPartLeft(e);return n||new M(1,1,1,1)}}class ylt extends sC{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:B.writable,kbOpts:{kbExpr:B.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const n=Ow.deleteWordPartRight(e);if(n)return n;const r=e.model.getLineCount(),s=e.model.getLineMaxColumn(r);return new M(r,s,r,s)}}class cpe extends rC{_move(e,t,n,r,s){return Ow.moveWordPartLeft(e,t,n,s)}}class wlt extends cpe{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:B.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}Wt.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class Slt extends cpe{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:B.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}Wt.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class upe extends rC{_move(e,t,n,r,s){return Ow.moveWordPartRight(e,t,n)}}class Clt extends upe{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:B.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class xlt extends upe{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:B.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}De(new vlt),De(new ylt),De(new wlt),De(new Slt),De(new Clt),De(new xlt);const Cte=class Cte extends re{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=Uo.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(93);t||(this.editor.isSimpleWidget?t=new Jr(b("editor.simple.readonly","Cannot edit in read-only input")):t=new Jr(b("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};Cte.ID="editor.contrib.readOnlyMessageController";let oC=Cte;qt(oC.ID,oC,2);var Olt=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},dpe=function(i,e){return function(t,n){e(t,n,i)}};let $V=class extends re{constructor(e,t,n){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=n,this._currentModel=kt(this,void 0);const r=Dr("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),s=Dr("_textModel.onDidChangeContent",Pe.debounce(o=>this._textModel.onDidChangeContent(o),()=>{},100));this._register(co(async(o,a)=>{r.read(o),s.read(o);const l=a.add(new uZe),c=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(c,void 0)}))}getBreadcrumbItems(e,t){const n=this._currentModel.read(t);if(!n)return[];const r=n.asListOfDocumentSymbols().filter(s=>e.contains(s.range.startLineNumber)&&!e.contains(s.range.endLineNumber));return r.sort(Rte(ks(s=>s.range.endLineNumber-s.range.startLineNumber,ml))),r.map(s=>({name:s.name,kind:s.kind,startLineNumber:s.range.startLineNumber}))}};$V=Olt([dpe(1,Be),dpe(2,qb)],$V),eS.setBreadcrumbsSourceFactory((i,e)=>e.createInstance($V,i));const xte=class xte extends re{constructor(e){super(),this.editor=e,this.widget=null,Xl&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(92);!this.widget&&e?this.widget=new jV(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};xte.ID="editor.contrib.iPadShowKeyboard";let aC=xte;const NO=class NO extends re{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(ae(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(ae(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return NO.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}};NO.ID="editor.contrib.ShowKeyboardWidget";let jV=NO;qt(aC.ID,aC,3);var Llt=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},hpe=function(i,e){return function(t,n){e(t,n,i)}},WV;let O_=(Em=class extends re{static get(e){return e.getContribution(WV.ID)}constructor(e,t,n){super(),this._editor=e,this._languageService=n,this._widget=null,this._register(this._editor.onDidChangeModel(r=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(r=>this.stop())),this._register(vi.onDidChange(r=>this.stop())),this._register(this._editor.onKeyUp(r=>r.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new UV(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}},WV=Em,Em.ID="editor.contrib.inspectTokens",Em);O_=WV=Llt([hpe(1,Oa),hpe(2,Jn)],O_);class klt extends Ve{constructor(){super({id:"editor.action.inspectTokens",label:vP.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const n=O_.get(t);n==null||n.launch()}}function Elt(i){let e="";for(let t=0,n=i.length;t<n;t++){const r=i.charCodeAt(t);switch(r){case 9:e+="→";break;case 32:e+="·";break;default:e+=String.fromCharCode(r)}}return e}function Tlt(i,e){const t=vi.get(e);if(t)return t;const n=i.encodeLanguageId(e);return{getInitialState:()=>E0,tokenize:(r,s,o)=>oP(e,o),tokenizeEncoded:(r,s,o)=>I7(n,o)}}const DO=class DO extends re{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=Tlt(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(n=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return DO._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let n=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){n=l;break}}let r=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){r=l;break}const s=this._model.getLineContent(e.lineNumber);let o="";if(n<t.tokens1.length){const l=t.tokens1[n].offset,c=n+1<t.tokens1.length?t.tokens1[n+1].offset:s.length;o=s.substring(l,c)}_r(this._domNode,Ee("h2.tm-token",void 0,Elt(o),Ee("span.tm-token-length",void 0,`${o.length} ${o.length===1?"char":"chars"}`))),_e(this._domNode,Ee("hr.tokens-inspect-separator",{style:"clear:both"}));const a=(r<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(r<<1)+1]):null;_e(this._domNode,Ee("table.tm-metadata-table",void 0,Ee("tbody",void 0,Ee("tr",void 0,Ee("td.tm-metadata-key",void 0,"language"),Ee("td.tm-metadata-value",void 0,`${a?a.languageId:"-?-"}`)),Ee("tr",void 0,Ee("td.tm-metadata-key",void 0,"token type"),Ee("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),Ee("tr",void 0,Ee("td.tm-metadata-key",void 0,"font style"),Ee("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),Ee("tr",void 0,Ee("td.tm-metadata-key",void 0,"foreground"),Ee("td.tm-metadata-value",void 0,`${a?be.Format.CSS.formatHex(a.foreground):"-?-"}`)),Ee("tr",void 0,Ee("td.tm-metadata-key",void 0,"background"),Ee("td.tm-metadata-value",void 0,`${a?be.Format.CSS.formatHex(a.background):"-?-"}`))))),_e(this._domNode,Ee("hr.tokens-inspect-separator")),n<t.tokens1.length&&_e(this._domNode,Ee("span.tm-token-type",void 0,t.tokens1[n].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const t=vi.getColorMap(),n=ao.getLanguageId(e),r=ao.getTokenType(e),s=ao.getFontStyle(e),o=ao.getForeground(e),a=ao.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(n),tokenType:r,fontStyle:s,foreground:t[o],background:t[a]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return e&1&&(t+="italic "),e&2&&(t+="bold "),e&4&&(t+="underline "),e&8&&(t+="strikethrough "),t.length===0&&(t="---"),t}_getTokensAtLine(e){const t=this._getStateBeforeLine(e),n=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),r=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:n.tokens,tokens2:r.tokens,endState:n.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let n=1;n<e;n++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(n),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}};DO._ID="editor.contrib.inspectTokensWidget";let UV=DO;qt(O_.ID,O_,4),we(klt);var Plt=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},fpe=function(i,e){return function(t,n){e(t,n,i)}},L_;let qV=(Tm=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=ai.as(C1.Quickaccess)}provide(e){const t=new ge;return t.add(e.onDidAccept(()=>{const[n]=e.selectedItems;n&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(n=>{const r=this.registry.getQuickAccessProvider(n.substr(L_.PREFIX.length));r&&r.prefix&&r.prefix!==L_.PREFIX&&this.quickInputService.quickAccess.show(r.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(n=>n.prefix!==L_.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,n)=>t.prefix.localeCompare(n.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const n=t.prefix||e.prefix,r=n||"…";return{prefix:n,label:r,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:b("helpPickAriaLabel","{0}, {1}",r,t.description),description:t.description}})}},L_=Tm,Tm.PREFIX="?",Tm);qV=L_=Plt([fpe(0,Ja),fpe(1,an)],qV),ai.as(C1.Quickaccess).registerQuickAccessProvider({ctor:qV,prefix:"",helpEntries:[{description:yP.helpQuickAccessActionLabel}]});class gpe{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,n){var o;const r=new ge;e.canAcceptInBackground=!!((o=this.options)!=null&&o.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const s=r.add(new Ki);return s.value=this.doProvide(e,t,n),r.add(this.onDidActiveTextEditorControlChange(()=>{s.value=void 0,s.value=this.doProvide(e,t)})),r}doProvide(e,t,n){const r=new ge,s=this.activeTextEditorControl;if(s&&this.canProvideWithTextEditor(s)){const o={editor:s},a=zde(s);if(a){let l=s.saveViewState()??void 0;r.add(a.onDidChangeCursorPosition(()=>{l=s.saveViewState()??void 0})),o.restoreViewState=()=>{l&&s===this.activeTextEditorControl&&s.restoreViewState(l)},r.add(kh(t.onCancellationRequested)(()=>{var c;return(c=o.restoreViewState)==null?void 0:c.call(o)}))}r.add(Qe(()=>this.clearDecorations(s))),r.add(this.provideWithTextEditor(o,e,t,n))}else r.add(this.provideWithoutTextEditor(e,t));return r}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,"code.jump"),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const n=e.getModel();n&&"getLineContent"in n&&bu(`${n.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return BA(e)?(t=e.getModel())==null?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(n=>{const r=[];this.rangeHighlightDecorationId&&(r.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),r.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const s=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:yi(Tae),position:ua.Full}}}],[o,a]=n.deltaDecorations(r,s);this.rangeHighlightDecorationId={rangeHighlightId:o,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(n=>{n.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const IO=class IO extends gpe{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=b("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,re.None}provideWithTextEditor(e,t,n){const r=e.editor,s=new ge;s.add(t.onDidAccept(l=>{const[c]=t.selectedItems;if(c){if(!this.isValidLineNumber(r,c.lineNumber))return;this.gotoLocation(e,{range:this.toRange(c.lineNumber,c.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));const o=()=>{const l=this.parsePosition(r,t.value.trim().substr(IO.PREFIX.length)),c=this.getPickLabel(r,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:c}],t.ariaLabel=c,!this.isValidLineNumber(r,l.lineNumber)){this.clearDecorations(r);return}const u=this.toRange(l.lineNumber,l.column);r.revealRangeInCenter(u,0),this.addDecorations(r,u)};o(),s.add(t.onDidChangeValue(()=>o()));const a=zde(r);return a&&a.getOptions().get(68).renderType===2&&(a.updateOptions({lineNumbers:"on"}),s.add(Qe(()=>a.updateOptions({lineNumbers:"relative"})))),s}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const n=t.split(/,|:|#/).map(s=>parseInt(s,10)).filter(s=>!isNaN(s)),r=this.lineCount(e)+1;return{lineNumber:n[0]>0?n[0]:r+n[0],column:n[1]}}getPickLabel(e,t,n){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,n)?b("gotoLineColumnLabel","Go to line {0} and character {1}.",t,n):b("gotoLineLabel","Go to line {0}.",t);const r=e.getPosition()||{lineNumber:1,column:1},s=this.lineCount(e);return s>1?b("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",r.lineNumber,r.column,s):b("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",r.lineNumber,r.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,n){if(!n||typeof n!="number")return!1;const r=this.getModel(e);if(!r)return!1;const s={lineNumber:t,column:n};return r.validatePosition(s).equals(s)}lineCount(e){var t;return((t=this.getModel(e))==null?void 0:t.getLineCount())??0}};IO.PREFIX=":";let GV=IO;var Nlt=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Dlt=function(i,e){return function(t,n){e(t,n,i)}};let k_=class extends GV{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=Pe.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};k_=Nlt([Dlt(0,Kt)],k_);let ppe=(Pm=class extends Ve{constructor(){super({id:Pm.ID,label:U7.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:B.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Ja).quickAccess.show(k_.PREFIX)}},Pm.ID="editor.action.gotoLine",Pm);we(ppe),ai.as(C1.Quickaccess).registerQuickAccessProvider({ctor:k_,prefix:k_.PREFIX,helpEntries:[{description:U7.gotoLineActionLabel,commandId:ppe.ID}]});const mpe=[void 0,[]];function ZV(i,e,t=0,n=0){const r=e;return r.values&&r.values.length>1?Ilt(i,r.values,t,n):bpe(i,e,t,n)}function Ilt(i,e,t,n){let r=0;const s=[];for(const o of e){const[a,l]=bpe(i,o,t,n);if(typeof a!="number")return mpe;r+=a,s.push(...l)}return[r,Alt(s)]}function bpe(i,e,t,n){const r=s1(e.original,e.originalLowercase,t,i,i.toLowerCase(),n,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?[r[0],I8(r)]:mpe}function Alt(i){const e=i.sort((r,s)=>r.start-s.start),t=[];let n;for(const r of e)!n||!Mlt(n,r)?(n=r,t.push(r)):(n.start=Math.min(n.start,r.start),n.end=Math.max(n.end,r.end));return t}function Mlt(i,e){return!(i.end<e.start||e.end<i.start)}function _pe(i){return i.startsWith('"')&&i.endsWith('"')}const vpe=" ";function YV(i){typeof i!="string"&&(i="");const e=i.toLowerCase(),{pathNormalized:t,normalized:n,normalizedLowercase:r}=ype(i),s=t.indexOf(Kl)>=0,o=_pe(i);let a;const l=i.split(vpe);if(l.length>1)for(const c of l){const u=_pe(c),{pathNormalized:d,normalized:h,normalizedLowercase:f}=ype(c);h&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:d,normalized:h,normalizedLowercase:f,expectContiguousMatch:u}))}return{original:i,originalLowercase:e,pathNormalized:t,normalized:n,normalizedLowercase:r,values:a,containsPathSeparator:s,expectContiguousMatch:o}}function ype(i){let e;Er?e=i.replace(/\//g,Kl):e=i.replace(/\\/g,Kl);const t=GEe(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function wpe(i){return Array.isArray(i)?YV(i.map(e=>e.original).join(vpe)):YV(i.original)}var Rlt=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},Spe=function(i,e){return function(t,n){e(t,n,i)}},lC;let wp=(qc=class extends gpe{constructor(e,t,n=Object.create(null)){super(n),this._languageFeaturesService=e,this._outlineModelService=t,this.options=n,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,b("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),re.None}provideWithTextEditor(e,t,n,r){const s=e.editor,o=this.getModel(s);return o?this._languageFeaturesService.documentSymbolProvider.has(o)?this.doProvideWithEditorSymbols(e,o,t,n,r):this.doProvideWithoutEditorSymbols(e,o,t,n):re.None}doProvideWithoutEditorSymbols(e,t,n,r){const s=new ge;return this.provideLabelPick(n,b("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,s)||r.isCancellationRequested||s.add(this.doProvideWithEditorSymbols(e,t,n,r)))(),s}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const n=new Ym,r=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(r.dispose(),n.complete(!0))}));return t.add(Qe(()=>n.complete(!1))),n.p}doProvideWithEditorSymbols(e,t,n,r,s){var d;const o=e.editor,a=new ge;a.add(n.onDidAccept(h=>{var g;const[f]=n.selectedItems;f&&f.range&&(this.gotoLocation(e,{range:f.range.selection,keyMods:n.keyMods,preserveFocus:h.inBackground}),(g=s==null?void 0:s.handleAccept)==null||g.call(s,f),h.inBackground||n.hide())})),a.add(n.onDidTriggerItemButton(({item:h})=>{h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:n.keyMods,forceSideBySide:!0}),n.hide())}));const l=this.getDocumentSymbols(t,r);let c;const u=async h=>{c==null||c.dispose(!0),n.busy=!1,c=new oi(r),n.busy=!0;try{const f=YV(n.value.substr(lC.PREFIX.length).trim()),g=await this.doGetSymbolPicks(l,f,void 0,c.token,t);if(r.isCancellationRequested)return;if(g.length>0){if(n.items=g,h&&f.original.length===0){const p=u8(g,m=>!!(m.type!=="separator"&&m.range&&M.containsPosition(m.range.decoration,h)));p&&(n.activeItems=[p])}}else f.original.length>0?this.provideLabelPick(n,b("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(n,b("noSymbolResults","No editor symbols"))}finally{r.isCancellationRequested||(n.busy=!1)}};return a.add(n.onDidChangeValue(()=>u(void 0))),u((d=o.getSelection())==null?void 0:d.getPosition()),a.add(n.onDidChangeActive(()=>{const[h]=n.activeItems;h&&h.range&&(o.revealRangeInCenter(h.range.selection,0),this.addDecorations(o,h.range.decoration))})),a}async doGetSymbolPicks(e,t,n,r,s){var m,_;const o=await e;if(r.isCancellationRequested)return[];const a=t.original.indexOf(lC.SCOPE_PREFIX)===0,l=a?1:0;let c,u;t.values&&t.values.length>1?(c=wpe(t.values[0]),u=wpe(t.values.slice(1))):c=t;let d;const h=(_=(m=this.options)==null?void 0:m.openSideBySideDirection)==null?void 0:_.call(m);h&&(d=[{iconClass:h==="right"?ot.asClassName(Le.splitHorizontal):ot.asClassName(Le.splitVertical),tooltip:h==="right"?b("openToSide","Open to the Side"):b("openToBottom","Open to the Bottom")}]);const f=[];for(let v=0;v<o.length;v++){const w=o[v],y=UEe(w.name),S=`$(${Zv.toIcon(w.kind).id}) ${y}`,x=S.length-y.length;let O=w.containerName;n!=null&&n.extraContainerLabel&&(O?O=`${n.extraContainerLabel} • ${O}`:O=n.extraContainerLabel);let L,T,N,E;if(t.original.length>l){let I=!1;if(c!==t&&([L,T]=ZV(S,{...t,values:void 0},l,x),typeof L=="number"&&(I=!0)),typeof L!="number"&&([L,T]=ZV(S,c,l,x),typeof L!="number"))continue;if(!I&&u){if(O&&u.original.length>0&&([N,E]=ZV(O,u)),typeof N!="number")continue;typeof L=="number"&&(L+=N)}}const P=w.tags&&w.tags.indexOf(1)>=0;f.push({index:v,kind:w.kind,score:L,label:S,ariaLabel:VEe(w.name,w.kind),description:O,highlights:P?void 0:{label:T,description:E},range:{selection:M.collapseToStart(w.selectionRange),decoration:w.range},uri:s.uri,symbolName:y,strikethrough:P,buttons:d})}const g=f.sort((v,w)=>a?this.compareByKindAndScore(v,w):this.compareByScore(v,w));let p=[];if(a){let S=function(){w&&typeof v=="number"&&y>0&&(w.label=Dg(QV[v]||XV,y))},v,w,y=0;for(const x of g)v!==x.kind?(S(),v=x.kind,y=1,w={type:"separator"},p.push(w)):y++,p.push(x);S()}else g.length>0&&(p=[{label:b("symbols","symbols ({0})",f.length),type:"separator"},...g]);return p}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){const n=QV[e.kind]||XV,r=QV[t.kind]||XV,s=n.localeCompare(r);return s===0?this.compareByScore(e,t):s}async getDocumentSymbols(e,t){const n=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:n.asListOfDocumentSymbols()}},lC=qc,qc.PREFIX="@",qc.SCOPE_PREFIX=":",qc.PREFIX_BY_CATEGORY=`${qc.PREFIX}${qc.SCOPE_PREFIX}`,qc);wp=lC=Rlt([Spe(0,Be),Spe(1,qb)],wp);const XV=b("property","properties ({0})"),QV={5:b("method","methods ({0})"),11:b("function","functions ({0})"),8:b("_constructor","constructors ({0})"),12:b("variable","variables ({0})"),4:b("class","classes ({0})"),22:b("struct","structs ({0})"),23:b("event","events ({0})"),24:b("operator","operators ({0})"),10:b("interface","interfaces ({0})"),2:b("namespace","namespaces ({0})"),3:b("package","packages ({0})"),25:b("typeParameter","type parameters ({0})"),1:b("modules","modules ({0})"),6:b("property","properties ({0})"),9:b("enum","enumerations ({0})"),21:b("enumMember","enumeration members ({0})"),14:b("string","strings ({0})"),0:b("file","files ({0})"),17:b("array","arrays ({0})"),15:b("number","numbers ({0})"),16:b("boolean","booleans ({0})"),18:b("object","objects ({0})"),19:b("key","keys ({0})"),7:b("field","fields ({0})"),13:b("constant","constants ({0})")};var Flt=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},KV=function(i,e){return function(t,n){e(t,n,i)}};let JV=class extends wp{constructor(e,t,n){super(t,n),this.editorService=e,this.onDidActiveTextEditorControlChange=Pe.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};JV=Flt([KV(0,Kt),KV(1,Be),KV(2,qb)],JV);const AO=class AO extends Ve{constructor(){super({id:AO.ID,label:U8.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:B.hasDocumentSymbolProvider,kbOpts:{kbExpr:B.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Ja).quickAccess.show(wp.PREFIX,{itemActivation:wc.NONE})}};AO.ID="editor.action.quickOutline";let cC=AO;we(cC),ai.as(C1.Quickaccess).registerQuickAccessProvider({ctor:JV,prefix:wp.PREFIX,helpEntries:[{description:U8.quickOutlineActionLabel,prefix:wp.PREFIX,commandId:cC.ID},{description:U8.quickOutlineByCategoryActionLabel,prefix:wp.PREFIX_BY_CATEGORY}]});function Vlt(i){const e=new Map;for(const t of i)e.set(t,(e.get(t)??0)+1);return e}class E_{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const n=this.computeEmbedding(e),r=new Map,s=[];for(const[o,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,n,r);c>0&&s.push({key:o,score:c})}}return s}static termFrequencies(e){return Vlt(E_.splitTerms(e))}static*splitTerms(e){const t=n=>n.toLowerCase();for(const[n]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield t(n);const r=n.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(r.length>1)for(const s of r)s.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(s)&&(yield t(s))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const n=[];for(const r of t.textChunks){const s=E_.termFrequencies(r);for(const o of s.keys())this.chunkOccurrences.set(o,(this.chunkOccurrences.get(o)??0)+1);n.push({text:r,tf:s})}this.chunkCount+=n.length,this.documents.set(t.key,{chunks:n})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const n of t.chunks)for(const r of n.tf.keys()){const s=this.chunkOccurrences.get(r);if(typeof s=="number"){const o=s-1;o<=0?this.chunkOccurrences.delete(r):this.chunkOccurrences.set(r,o)}}}}computeSimilarityScore(e,t,n){let r=0;for(const[s,o]of Object.entries(t)){const a=e.tf.get(s);if(!a)continue;let l=n.get(s);typeof l!="number"&&(l=this.computeIdf(s),n.set(s,l));const c=a*l;r+=c*o}return r}computeEmbedding(e){const t=E_.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[n,r]of e){const s=this.computeIdf(n);s>0&&(t[n]=r*s)}return t}}function Hlt(i){var n;const e=i.slice(0);e.sort((r,s)=>s.score-r.score);const t=((n=e[0])==null?void 0:n.score)??0;if(t>0)for(const r of e)r.score/=t;return e}var C2;(function(i){i[i.NO_ACTION=0]="NO_ACTION",i[i.CLOSE_PICKER=1]="CLOSE_PICKER",i[i.REFRESH_PICKER=2]="REFRESH_PICKER",i[i.REMOVE_ITEM=3]="REMOVE_ITEM"})(C2||(C2={}));function eH(i){const e=i;return Array.isArray(e.items)}function Cpe(i){const e=i;return!!e.picks&&e.additionalPicks instanceof Promise}class Blt extends re{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,n){var c;const r=new ge;e.canAcceptInBackground=!!((c=this.options)!=null&&c.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let s;const o=r.add(new Ki),a=async()=>{var m;const u=o.value=new ge;s==null||s.dispose(!0),e.busy=!1,s=new oi(t);const d=s.token;let h=e.value.substring(this.prefix.length);(m=this.options)!=null&&m.shouldSkipTrimPickFilter||(h=h.trim());const f=this._getPicks(h,u,d,n),g=(_,v)=>{var S;let w,y;if(eH(_)?(w=_.items,y=_.active):w=_,w.length===0){if(v)return!1;(h.length>0||e.hideInput)&&((S=this.options)!=null&&S.noResultsPick)&&(T3(this.options.noResultsPick)?w=[this.options.noResultsPick(h)]:w=[this.options.noResultsPick])}return e.items=w,y&&(e.activeItems=[y]),!0},p=async _=>{let v=!1,w=!1;await Promise.all([(async()=>{typeof _.mergeDelay=="number"&&(await ud(_.mergeDelay),d.isCancellationRequested)||w||(v=g(_.picks,!0))})(),(async()=>{e.busy=!0;try{const y=await _.additionalPicks;if(d.isCancellationRequested)return;let S,x;eH(_.picks)?(S=_.picks.items,x=_.picks.active):S=_.picks;let O,L;if(eH(y)?(O=y.items,L=y.active):O=y,O.length>0||!v){let T;if(!x&&!L){const N=e.activeItems[0];N&&S.indexOf(N)!==-1&&(T=N)}g({items:[...S,...O],active:x||L||T})}}finally{d.isCancellationRequested||(e.busy=!1),w=!0}})()])};if(f!==null)if(Cpe(f))await p(f);else if(!(f instanceof Promise))g(f);else{e.busy=!0;try{const _=await f;if(d.isCancellationRequested)return;Cpe(_)?await p(_):g(_)}finally{d.isCancellationRequested||(e.busy=!1)}}};r.add(e.onDidChangeValue(()=>a())),a(),r.add(e.onDidAccept(u=>{var h;if(n!=null&&n.handleAccept){u.inBackground||e.hide(),(h=n.handleAccept)==null||h.call(n,e.activeItems[0]);return}const[d]=e.selectedItems;typeof(d==null?void 0:d.accept)=="function"&&(u.inBackground||e.hide(),d.accept(e.keyMods,u))}));const l=async(u,d)=>{var f;if(typeof d.trigger!="function")return;const h=((f=d.buttons)==null?void 0:f.indexOf(u))??-1;if(h>=0){const g=d.trigger(h,e.keyMods),p=typeof g=="number"?g:await g;if(t.isCancellationRequested)return;switch(p){case C2.NO_ACTION:break;case C2.CLOSE_PICKER:e.hide();break;case C2.REFRESH_PICKER:a();break;case C2.REMOVE_ITEM:{const m=e.items.indexOf(d);if(m!==-1){const _=e.items.slice(),v=_.splice(m,1),w=e.activeItems.filter(S=>S!==v[0]),y=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=_,w&&(e.activeItems=w),e.keepScrollPosition=y}break}}}};return r.add(e.onDidTriggerItemButton(({button:u,item:d})=>l(u,d))),r.add(e.onDidTriggerSeparatorButton(({button:u,separator:d})=>l(u,d))),r}}var xpe=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},jf=function(i,e){return function(t,n){e(t,n,i)}},Sp,Ui;let tH=(ed=class extends Blt{constructor(e,t,n,r,s,o){super(Sp.PREFIX,e),this.instantiationService=t,this.keybindingService=n,this.commandService=r,this.telemetryService=s,this.dialogService=o,this.commandsHistory=this._register(this.instantiationService.createInstance(nH)),this.options=e}async _getPicks(e,t,n,r){var f,g;const s=await this.getCommandPicks(n);if(n.isCancellationRequested)return[];const o=kh(()=>{const p=new E_;p.updateDocuments(s.map(_=>({key:_.commandId,textChunks:[this.getTfIdfChunk(_)]})));const m=p.calculateScores(e,n);return Hlt(m).filter(_=>_.score>Sp.TFIDF_THRESHOLD).slice(0,Sp.TFIDF_MAX_RESULTS)}),a=[];for(const p of s){const m=Sp.WORD_FILTER(e,p.label)??void 0,_=p.commandAlias?Sp.WORD_FILTER(e,p.commandAlias)??void 0:void 0;if(m||_)p.highlights={label:m,detail:this.options.showAlias?_:void 0},a.push(p);else if(e===p.commandId)a.push(p);else if(e.length>=3){const v=o();if(n.isCancellationRequested)return[];const w=v.find(y=>y.key===p.commandId);w&&(p.tfIdfScore=w.score,a.push(p))}}const l=new Map;for(const p of a){const m=l.get(p.label);m?(p.description=p.commandId,m.description=m.commandId):l.set(p.label,p)}a.sort((p,m)=>{if(p.tfIdfScore&&m.tfIdfScore)return p.tfIdfScore===m.tfIdfScore?p.label.localeCompare(m.label):m.tfIdfScore-p.tfIdfScore;if(p.tfIdfScore)return 1;if(m.tfIdfScore)return-1;const _=this.commandsHistory.peek(p.commandId),v=this.commandsHistory.peek(m.commandId);if(_&&v)return _>v?-1:1;if(_)return-1;if(v)return 1;if(this.options.suggestedCommandIds){const w=this.options.suggestedCommandIds.has(p.commandId),y=this.options.suggestedCommandIds.has(m.commandId);if(w&&y)return 0;if(w)return-1;if(y)return 1}return p.label.localeCompare(m.label)});const c=[];let u=!1,d=!0,h=!!this.options.suggestedCommandIds;for(let p=0;p<a.length;p++){const m=a[p];p===0&&this.commandsHistory.peek(m.commandId)&&(c.push({type:"separator",label:b("recentlyUsed","recently used")}),u=!0),d&&m.tfIdfScore!==void 0&&(c.push({type:"separator",label:b("suggested","similar commands")}),d=!1),h&&m.tfIdfScore===void 0&&!this.commandsHistory.peek(m.commandId)&&((f=this.options.suggestedCommandIds)!=null&&f.has(m.commandId))&&(c.push({type:"separator",label:b("commonlyUsed","commonly used")}),u=!0,h=!1),u&&m.tfIdfScore===void 0&&!this.commandsHistory.peek(m.commandId)&&!((g=this.options.suggestedCommandIds)!=null&&g.has(m.commandId))&&(c.push({type:"separator",label:b("morecCommands","other commands")}),u=!1),c.push(this.toCommandPick(m,r))}return this.hasAdditionalCommandPicks(e,n)?{picks:c,additionalPicks:(async()=>{var _;const p=await this.getAdditionalCommandPicks(s,a,e,n);if(n.isCancellationRequested)return[];const m=p.map(v=>this.toCommandPick(v,r));return d&&((_=m[0])==null?void 0:_.type)!=="separator"&&m.unshift({type:"separator",label:b("suggested","similar commands")}),m})()}:c}toCommandPick(e,t){if(e.type==="separator")return e;const n=this.keybindingService.lookupKeybinding(e.commandId),r=n?b("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,n.getAriaLabel()):e.label;return{...e,ariaLabel:r,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:n,accept:async()=>{var s;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(t==null?void 0:t.from)??"quick open"});try{(s=e.args)!=null&&s.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(o){Ha(o)||this.dialogService.error(b("canNotRun","Command '{0}' resulted in an error",e.label),_S(o))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:n}){let r=e;return t&&t!==e&&(r+=` - ${t}`),n&&n.value!==e&&(r+=` - ${n.value===n.original?n.value:`${n.value} (${n.original})`}`),r}},Sp=ed,ed.PREFIX=">",ed.TFIDF_THRESHOLD=.5,ed.TFIDF_MAX_RESULTS=5,ed.WORD_FILTER=FT(D8,rRe,ooe),ed);tH=Sp=xpe([jf(1,Ke),jf(2,an),jf(3,Dn),jf(4,Qr),jf(5,_8)],tH);let nH=(Gc=class extends re{constructor(e,t,n){super(),this.storageService=e,this.configurationService=t,this.logService=n,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===s6.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Ui.getConfiguredCommandHistoryLength(this.configurationService),Ui.cache&&Ui.cache.limit!==this.configuredCommandsHistoryLength&&(Ui.cache.limit=this.configuredCommandsHistoryLength,Ui.hasChanges=!0))}load(){const e=this.storageService.get(Ui.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(r){this.logService.error(`[CommandsHistory] invalid data: ${r}`)}const n=Ui.cache=new au(this.configuredCommandsHistoryLength,1);if(t){let r;t.usesLRU?r=t.entries:r=t.entries.sort((s,o)=>s.value-o.value),r.forEach(s=>n.set(s.key,s.value))}Ui.counter=this.storageService.getNumber(Ui.PREF_KEY_COUNTER,0,Ui.counter)}push(e){Ui.cache&&(Ui.cache.set(e,Ui.counter++),Ui.hasChanges=!0)}peek(e){var t;return(t=Ui.cache)==null?void 0:t.peek(e)}saveState(){if(!Ui.cache||!Ui.hasChanges)return;const e={usesLRU:!0,entries:[]};Ui.cache.forEach((t,n)=>e.entries.push({key:n,value:t})),this.storageService.store(Ui.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(Ui.PREF_KEY_COUNTER,Ui.counter,0,0),Ui.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var r,s;const n=(s=(r=e.getValue().workbench)==null?void 0:r.commandPalette)==null?void 0:s.history;return typeof n=="number"?n:Ui.DEFAULT_COMMANDS_HISTORY_LENGTH}},Ui=Gc,Gc.DEFAULT_COMMANDS_HISTORY_LENGTH=50,Gc.PREF_KEY_CACHE="commandPalette.mru.cache",Gc.PREF_KEY_COUNTER="commandPalette.mru.counter",Gc.counter=1,Gc.hasChanges=!1,Gc);nH=Ui=xpe([jf(0,Nl),jf(1,Lt),jf(2,Pr)],nH);class zlt extends tH{constructor(e,t,n,r,s,o){super(e,t,n,r,s,o)}getCodeEditorCommandPicks(){var n;const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const r of e.getSupportedActions()){let s;(n=r.metadata)!=null&&n.description&&(eHe(r.metadata.description)?s=r.metadata.description:s={original:r.metadata.description,value:r.metadata.description}),t.push({commandId:r.id,commandAlias:r.alias,commandDescription:s,label:ZT(r.label)||r.id})}return t}}var $lt=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},x2=function(i,e){return function(t,n){e(t,n,i)}};let T_=class extends zlt{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,n,r,s,o){super({showAlias:!1},e,n,r,s,o),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};T_=$lt([x2(0,Ke),x2(1,Kt),x2(2,an),x2(3,Dn),x2(4,Qr),x2(5,_8)],T_);const MO=class MO extends Ve{constructor(){super({id:MO.ID,label:q7.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:B.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Ja).quickAccess.show(T_.PREFIX)}};MO.ID="editor.action.quickCommand";let uC=MO;we(uC),ai.as(C1.Quickaccess).registerQuickAccessProvider({ctor:T_,prefix:T_.PREFIX,helpEntries:[{description:q7.quickCommandHelp,commandId:uC.ID}]});var jlt=function(i,e,t,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},O2=function(i,e){return function(t,n){e(t,n,i)}};let iH=class extends lp{constructor(e,t,n,r,s,o,a){super(!0,e,t,n,r,s,o,a)}};iH=jlt([O2(1,lt),O2(2,Kt),O2(3,Ni),O2(4,Ke),O2(5,Nl),O2(6,Lt)],iH),qt(lp.ID,iH,4);class Wlt extends Ve{constructor(){super({id:"editor.action.toggleHighContrast",label:SP.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const n=e.get(Oa),r=n.getColorTheme();dc(r.type)?(n.setTheme(this._originalThemeName||(b0(r.type)?s4:Vd)),this._originalThemeName=null):(n.setTheme(b0(r.type)?N1:D1),this._originalThemeName=r.themeName)}}we(Wlt);function Ult(i){return new Worker("/assets/json.worker-D1dAtg0Q.js",{name:i==null?void 0:i.name})}const Cr=(i,e)=>{const t=i.__vccOpts||i;for(const[n,r]of e)t[n]=r;return t};self.MonacoEnvironment={getWorker(){return new Ult}};const qlt={name:"PaasCodeEditor",props:{modelValue:{default:""},height:{default:400},scrollEnd:{default:!1},config:{}},setup(i,{emit:e}){let t;const{proxy:n}=C.getCurrentInstance();return C.watch(()=>i.modelValue,r=>{r!==(t==null?void 0:t.getValue())&&t.setValue(r)}),C.onMounted(()=>{t=zA.create(n.$refs.editContainer,{value:i.modelValue,...i.config}),t.onDidChangeModelContent(()=>{const r=t==null?void 0:t.getValue();if(e("update:modelValue",r),i.scrollEnd){var s=t.getModel().getLineCount();console.log(s),t.revealLine(s,zA.ScrollType.Immediate)}}),window.addEventListener("resize",function(){t.layout()})}),{}}};function Glt(i,e,t,n,r,s){return C.openBlock(),C.createElementBlock("div",{ref:"editContainer",style:C.normalizeStyle("width: 100%;height:"+this.height+"px;")},null,4)}const Zlt=Cr(qlt,[["render",Glt]]),Ylt={name:"PaasDate",props:{type:{type:String,default:"date"},icon:String,readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},modelValue:{type:[String,Array,Date]},showTime:{type:Boolean,default:!1},format:{type:String,default:null}},data(){return{}},methods:{handleChange(i){this.$emit("update:modelValue",i)}}};function Xlt(i,e,t,n,r,s){const o=C.resolveComponent("a-date-picker");return C.openBlock(),C.createBlock(o,{"show-time":t.showTime,readonly:t.readonly,disabled:t.disabled,value:t.modelValue,format:t.format,picker:t.type,onChange:s.handleChange},null,8,["show-time","readonly","disabled","value","format","picker","onChange"])}const Qlt=Cr(Ylt,[["render",Xlt]]),Klt={name:"PaasMenu",components:{AMenu:Qn.Menu,ASubMenu:Qn.Menu.SubMenu,AMenuItem:Qn.Menu.Item},props:{url:String,disabled:{type:Boolean,default:!1},theme:{type:String,default:"light"},value:String,format:{type:String,default:"YYYY-MM-DD"},type:{type:String,default:"date"},selected:{type:String,default:""}},computed:{current(){return this.$store.menus.current},openKeys(){return this.$store.menus.openKeys},data(){return this.$store.menus.data}},watch:{selected(i){this.selectedKeys=i},url(i){this.$post(i).then(e=>{this.$store.setMenuData(e.data.data)})}},mounted(){this.$store.loginFlag&&this.data.length===0&&this.$post(this.url).then(i=>{this.$store.setMenuData(i.data.data)})},data(){return{selectedKeys:""}},methods:{onOpenChange(i){const e=i.find(t=>this.openKeys.indexOf(t)===-1);this.$store.setOpenKeys(e?[e]:[])},menuSelect(i){this.$store.setCurrent(i.key),this.$store.setTitle(i.item.title),this.$store.setMenuId(i.item.id),this.$router.push(i.key),this.$store.setMenuCache({key:i.key,title:i.item.title})}}};function Jlt(i,e,t,n,r,s){const o=C.resolveComponent("paas-icon"),a=C.resolveComponent("a-menu-item"),l=C.resolveComponent("a-sub-menu"),c=C.resolveComponent("a-menu");return C.openBlock(),C.createBlock(c,{ref:"menus",theme:t.theme,selectedKeys:[r.selectedKeys],"open-keys":s.openKeys,onOpenChange:s.onOpenChange,onSelect:s.menuSelect,mode:"inline"},{default:C.withCtx(()=>[(C.openBlock(!0),C.createElementBlock(C.Fragment,null,C.renderList(s.data,u=>(C.openBlock(),C.createElementBlock(C.Fragment,{key:u.id},[u.children&&u.children.length?(C.openBlock(),C.createBlock(l,{key:u.key,id:u.id},{title:C.withCtx(()=>[C.createVNode(o,{icon:u.icon},null,8,["icon"]),C.createTextVNode(" "+C.toDisplayString(u.title),1)]),default:C.withCtx(()=>[(C.openBlock(!0),C.createElementBlock(C.Fragment,null,C.renderList(u.children,d=>(C.openBlock(),C.createBlock(a,{key:d.key,id:d.id,title:d.title},{default:C.withCtx(()=>[C.createVNode(o,{icon:d.icon},null,8,["icon"]),C.createTextVNode(" "+C.toDisplayString(d.title),1)]),_:2},1032,["id","title"]))),128))]),_:2},1032,["id"])):(C.openBlock(),C.createBlock(a,{key:u.key||"",id:u.id,title:u.title},{default:C.withCtx(()=>[C.createTextVNode(C.toDisplayString(u.title),1)]),_:2},1032,["id","title"]))],64))),128))]),_:1},8,["theme","selectedKeys","open-keys","onOpenChange","onSelect"])}const ect=Cr(Klt,[["render",Jlt]]),tct={name:"PaasPageTable",inject:{parentMethods:{from:"parentMethods",default:()=>{}}},props:{showButton:{default:1},checkbox:{default:!1},height:{default:0},radio:{default:!1},border:{default:!0},stripe:{default:!1},params:{},columns:{type:Array,default:()=>[]},id:{default:"id"},path:"",module:"",noPage:{default:!1}},computed:{queryData(){return this.$store.queryData},current(){return this.$store.menus.current},menuData(){return this.$store.menus.data},menuId(){return this.$store.menus.menuId},buttonProxy(){return this.$store.buttonProxy}},watch:{menuId(i){this.getMenuButtons()}},mounted(){this.$store.setSee(!1),this.url=this.module?`${this.module}/page`:`${this.$route.path}/page`,this.menuId&&this.getMenuButtons(),this.$bus.on("loadData",()=>{this.loadData()}),this.loadData()},beforeUnmount(){this.$bus.off("loadData")},data(){return{url:"",colors:["default","blue","green","yellow","dark"],headerButtons:[],columnButtons:[],loading:!1,datas:[],searchKey:"",searchVal:"",selectData:[],page:{current:1,pageSize:10,total:0,showQuickJumper:!0,pageSizeOptions:["10","20","50","100","200","500","1000"]}}},methods:{pageClick(i,e,t,n,r){this.page=i,this.loadData()},async getMenuButtons(){let i=this.$store.buttons;if(!i[this.menuId])if(i=(await this.$post(`${this.buttonProxy}/sysbuttons/getButtons/${this.menuId}`)).data.data,i.length>0){let t={};t[this.menuId]=i,this.$store.setButtons(t)}else return;i.forEach(e=>{e.state==1?this.headerButtons.push(e):this.columnButtons.push(e)})},loadData(){this.loading||(this.loading=!0,this.datas=[],this.$post(this.url,{page:{current:this.page.current,size:this.page.pageSize},...this.$store.queryData[this.current],...this.params}).then(i=>{var e;this.loading=!1,(e=i.data)!=null&&e.data?(this.datas=i.data.data.rows||[],this.page.total=i.data.data.total||0):(this.datas=[],this.page.total=0)}))},handle(i,e,t){this.selectData=t,this.$store.setAction(i),this.$store.setSee(!1);var n=this.$parent[i];if(n||(n=this.parentMethods&&this.parentMethods[i]),n&&n instanceof Function){n(this.selectData);return}else this[i]?this[i]():console.error("按钮事件方法未找到:",i)},query(){this.$store.setSee(!1),this.$store.setAction("query"),this.$store.setSubTitle("查询"),this.$router.push(this.current+"/query")},add(){let i=this.getColumnId();this.$store.setSee(!1),this.$store.setSubTitle("创建"),i?this.$router.push({path:this.current+"/form",query:{id:i}}):this.$router.push(this.current+"/form")},edit(){let i=this.getColumnId();i!=null&&(this.$store.setSee(!1),this.$store.setSubTitle("编辑"),this.$router.push({path:this.current+"/form",query:{id:i}}))},del(){let i=this.getColumnId();if(i==null)return;let e=this;Qn.Modal.confirm({title:"确定删除?",okText:"确定",cancelText:"取消",onOk(){let t=e.$store.menus.current+"/"+i;e.module&&(t=e.module+"/"+i),e.$delete(t).then(n=>{let r=n.data;e.$dyAlert(r,!1)})},onCancel(){}})},see(){let i=this.getColumnId();i!=null&&(this.$store.setSubTitle("查看"),this.$store.setSee(!0),this.$router.push({path:this.current+"/form",query:{id:i}}))},getColumnId(){let i=this.selectData;if(this.checkbox&&(i=this.selectData[0]),i==null||i.length==0)return this.$store.forms.action!="add"&&Qn.message.warn("请选中任意列表数据"),null;let e="";return this.id?this.id instanceof Array?(this.id.forEach(t=>{e+=i[t]+"&"}),e=e.substring(0,e.length-1)):e+=i[this.id]:e=i[this.columns[0].dataIndex],e}}},nct=["onClick"];function ict(i,e,t,n,r,s){const o=C.resolveComponent("paas-icon"),a=C.resolveComponent("a-button"),l=C.resolveComponent("a-flex"),c=C.resolveComponent("a-divider"),u=C.resolveComponent("a-space"),d=C.resolveComponent("a-table");return C.openBlock(),C.createElementBlock("div",null,[C.createVNode(l,{gap:"middle",justify:"flex-end"},{default:C.withCtx(()=>[(C.openBlock(!0),C.createElementBlock(C.Fragment,null,C.renderList(r.headerButtons,(h,f)=>(C.openBlock(),C.createBlock(a,{type:h.type||"primary",key:f,onClick:g=>s.handle(h.tag||h.click,h.title)},{default:C.withCtx(()=>[C.createVNode(o,{icon:h.icon},null,8,["icon"]),C.createTextVNode(C.toDisplayString(h.title),1)]),_:2},1032,["type","onClick"]))),128))]),_:1}),C.createVNode(c,{style:{"margin-top":"12px","margin-bottom":"8px"}}),C.createElementVNode("div",null,[C.createVNode(d,{ref:"table",bordered:"","data-source":r.datas,columns:t.columns,loading:r.loading,onChange:s.pageClick,pagination:r.page,scroll:{x:"max-content"},"row-key":t.id},{bodyCell:C.withCtx(({column:h,record:f})=>[h.key==="action"?(C.openBlock(),C.createBlock(u,{key:0,warp:""},{default:C.withCtx(()=>[(C.openBlock(!0),C.createElementBlock(C.Fragment,null,C.renderList(r.columnButtons,(g,p)=>(C.openBlock(),C.createElementBlock("a",{type:"link",key:p,block:"",onClick:m=>s.handle(g.tag||g.click,g.title,f)},C.toDisplayString(g.title),9,nct))),128))]),_:2},1024)):C.createCommentVNode("",!0)]),_:1},8,["data-source","columns","loading","onChange","pagination","row-key"])])])}const rct=Cr(tct,[["render",ict]]),sct={name:"PaasSelect",props:{multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},modelValue:{type:[String,Array,Number],default:null},params:{type:String,default:""}},mounted(){this.data=this.$store.dicts[this.params]||[],this.modelValue?typeof this.modelValue=="string"&&this.modelValue.includes(",")?this.value=this.modelValue.split(","):this.value=Array.isArray(this.modelValue)?this.modelValue:[this.modelValue]:this.value=this.modelValue},data(){return{value:null,data:[]}},watch:{modelValue(i){i==null&&(i="");let e=new Array;Array.isArray(i)?(i.forEach(t=>{t!=""&&e.push(String(t))}),this.value=e):i instanceof String&&(i!=null&&i.includes(","))?(i.spit(",").forEach(t=>{t!=""&&e.push(String(t))}),this.value=e):this.multiple&&i?this.value=[String(i)]:this.value=String(i)},value(i){console.log(i),this.$emit("update:modelValue",i),this.$emit("change",i)}}};function oct(i,e,t,n,r,s){const o=C.resolveComponent("a-select");return C.openBlock(),C.createBlock(o,{options:r.data,mode:t.multiple?"multiple":void 0,value:r.value,"onUpdate:value":e[0]||(e[0]=a=>r.value=a),disabled:t.disabled,class:"paas-select",allowClear:!0},null,8,["options","mode","value","disabled"])}const act=Cr(sct,[["render",oct]]),lct={name:"PaasTree",props:{multiple:{default:!1},fieldNames:{type:Object,default:{children:"children",title:"label",key:"value"}},disabled:{default:!1},open:{type:Boolean,default:!1},modelValue:{},params:{},url:"",listToTree:{type:Boolean,default:!0}},data(){return{value:null,datas:[]}},mounted(){this.getTreeData(),this.modelValue?typeof this.modelValue=="string"&&this.modelValue.includes(",")?this.value=this.modelValue.split(","):this.value=Array.isArray(this.modelValue)?this.modelValue:[this.modelValue]:this.value=this.modelValue},computed:{see(){return this.$store.forms.see}},watch:{modelValue(i){i==null&&(i="");let e=new Array;Array.isArray(i)?(i.forEach(t=>{t!=""&&e.push(String(t))}),this.value=e):i instanceof String&&(i!=null&&i.includes(","))?(i.spit(",").forEach(t=>{t!=""&&e.push(String(t))}),this.value=e):this.multiple&&i?this.value=[String(i)]:this.value=String(i),this.$emit("update:modelValue",this.value)}},methods:{async getTreeData(){let i=await this.$post(this.url,{page:{current:1,size:1e6},...this.params});this.listToTree?this.datas=this.$listToTree(i.data.data.rows):this.datas=i.data.data.rows}}};function cct(i,e,t,n,r,s){const o=C.resolveComponent("a-tree-select");return C.openBlock(),C.createBlock(o,{"show-search":!0,"allow-clear":!0,"tree-data":r.datas,value:r.value,"onUpdate:value":e[0]||(e[0]=a=>r.value=a),mode:t.multiple?"multiple":void 0,disabled:s.see||t.disabled,"tree-node-filter-prop":"label",treeLine:!0,fieldNames:t.fieldNames,class:"paas-select","tree-default-expand-all":t.open},null,8,["tree-data","value","mode","disabled","fieldNames","tree-default-expand-all"])}const uct=Cr(lct,[["render",cct]]),dct={name:"PaasUploadModal",props:{open:{type:Boolean,required:!0},url:{type:String,required:!0},params:{type:Object,default:()=>({})},title:{type:String,default:"文件上传"},multiple:{type:Boolean,default:!1},types:{type:String,default:""},success:{type:Function,default:i=>{}},templateUrl:{type:String,default:""}},data(){return{isOpen:this.open,fileList:[]}},watch:{open(i){this.isOpen=i}},methods:{customRequest(){const i=new FormData;this.multiple?this.fileList.forEach(e=>{i.append("files[]",e)}):i.append("file",this.fileList[0]),Object.keys(this.params).forEach(e=>{i.append(e,this.params[e])}),this.$upload(this.url,i).then(e=>{e.data.code==this.$success&&(this.fileList=[],Qn.message.success(e.data.msg),this.success(e.data.data),this.closeModal())}).catch(()=>{Qn.message.error("文件上传失败!")})},beforeUpload(i){return this.fileList.push(i),!1},closeModal(){this.isOpen=!1,this.$emit("update:open",!1),this.fileList=[]},downloadTemplate(){this.templateUrl&&window.open(this.templateUrl,"_blank")}}};function hct(i,e,t,n,r,s){const o=C.resolveComponent("a-upload-dragger"),a=C.resolveComponent("a-button"),l=C.resolveComponent("a-modal");return C.openBlock(),C.createBlock(l,{open:r.isOpen,"onUpdate:open":e[0]||(e[0]=c=>r.isOpen=c),title:t.title,closable:!1},{footer:C.withCtx(()=>[t.templateUrl?(C.openBlock(),C.createBlock(a,{key:0,onClick:s.downloadTemplate},{default:C.withCtx(()=>e[2]||(e[2]=[C.createTextVNode("下载模板")])),_:1},8,["onClick"])):C.createCommentVNode("",!0),C.createVNode(a,{onClick:s.closeModal},{default:C.withCtx(()=>e[3]||(e[3]=[C.createTextVNode("关闭")])),_:1},8,["onClick"]),C.createVNode(a,{type:"primary",onClick:s.customRequest},{default:C.withCtx(()=>e[4]||(e[4]=[C.createTextVNode("上传")])),_:1},8,["onClick"])]),default:C.withCtx(()=>[C.createVNode(o,{"before-upload":s.beforeUpload,name:t.multiple?"files":"file"},{default:C.withCtx(()=>e[1]||(e[1]=[C.createElementVNode("p",{class:"ant-upload-drag-icon"},[C.createElementVNode("i",{class:"anticon anticon-inbox"})],-1),C.createElementVNode("p",{class:"ant-upload-text"},"点击或拖拽文件到此区域上传",-1)])),_:1},8,["before-upload","name"])]),_:1},8,["open","title"])}const fct=Cr(dct,[["render",hct],["__scopeId","data-v-d10e2841"]]),gct={name:"FormDate",props:{label:String,name:String,size:{type:Number,default:2},labelWidth:{type:Number,default:null},type:{type:String,default:"date"},icon:String,readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},modelValue:{type:[String,Array,Date]},showTime:{type:Boolean,default:!1},format:{type:String,default:null}},methods:{handleChange(i){this.$emit("update:modelValue",i)}}};function pct(i,e,t,n,r,s){const o=C.resolveComponent("a-date-picker"),a=C.resolveComponent("a-form-item"),l=C.resolveComponent("a-col");return C.openBlock(),C.createBlock(l,{span:24/t.size},{default:C.withCtx(()=>[C.createVNode(a,C.mergeProps({label:t.label,name:t.name},t.labelWidth?{labelCol:{span:t.labelWidth}}:{}),{default:C.withCtx(()=>[C.createVNode(o,{"show-time":t.showTime,readonly:t.readonly,disabled:t.disabled,value:t.modelValue,format:t.format,picker:t.type,onChange:s.handleChange},null,8,["show-time","readonly","disabled","value","format","picker","onChange"])]),_:1},16,["label","name"])]),_:1},8,["span"])}const mct=Cr(gct,[["render",pct]]),bct={name:"FormInput",props:{label:{type:String,default:""},labelWidth:{type:Number,default:null},name:{type:String,default:""},type:{type:String,default:"text"},modelValue:{type:[String,Number,Object],default:""},size:{type:Number,default:2},icon:{type:String,default:""},readonly:{type:Boolean,default:!1}},computed:{see(){return this.$store.forms.see}},methods:{updateValue(i){this.$emit("update:modelValue",i.target.value)}}};function _ct(i,e,t,n,r,s){const o=C.resolveComponent("a-input"),a=C.resolveComponent("a-form-item"),l=C.resolveComponent("a-col");return C.openBlock(),C.createBlock(l,{span:24/t.size},{default:C.withCtx(()=>[C.createVNode(a,C.mergeProps({label:t.label,name:t.name,icon:t.icon},t.labelWidth?{labelCol:{span:t.labelWidth}}:{}),{default:C.withCtx(()=>[C.createVNode(o,{type:t.type,value:t.modelValue,onInput:s.updateValue,disabled:s.see||t.readonly},null,8,["type","value","onInput","disabled"])]),_:1},16,["label","name","icon"])]),_:1},8,["span"])}const vct=Cr(bct,[["render",_ct]]),yct={name:"FormNumber",mounted(){},props:{label:String,name:String,size:{type:Number,default:2},value:{},modelValue:{},readonly:{default:!1},precision:{default:null},max:{},min:{}},computed:{see(){return this.$store.forms.see}},methods:{updateValue(i){this.$emit("update:modelValue",i)}}};function wct(i,e,t,n,r,s){const o=C.resolveComponent("a-input-number"),a=C.resolveComponent("FormItem"),l=C.resolveComponent("a-col");return C.openBlock(),C.createBlock(l,{span:24/t.size},{default:C.withCtx(()=>[C.createVNode(a,{label:t.label,name:t.name},{default:C.withCtx(()=>[C.createVNode(o,{type:i.type,precision:t.precision,max:t.max,min:t.min,value:t.modelValue,onChange:s.updateValue,readonly:s.see||t.readonly},null,8,["type","precision","max","min","value","onChange","readonly"])]),_:1},8,["label","name"])]),_:1},8,["span"])}const Sct=Cr(yct,[["render",wct]]);var Cct={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zM648.3 426.8l-87.7 161.1h45.7c5.5 0 10 4.5 10 10v21.3c0 5.5-4.5 10-10 10h-63.4v29.7h63.4c5.5 0 10 4.5 10 10v21.3c0 5.5-4.5 10-10 10h-63.4V752c0 5.5-4.5 10-10 10h-41.3c-5.5 0-10-4.5-10-10v-51.8h-63.1c-5.5 0-10-4.5-10-10v-21.3c0-5.5 4.5-10 10-10h63.1v-29.7h-63.1c-5.5 0-10-4.5-10-10v-21.3c0-5.5 4.5-10 10-10h45.2l-88-161.1c-2.6-4.8-.9-10.9 4-13.6 1.5-.8 3.1-1.2 4.8-1.2h46c3.8 0 7.2 2.1 8.9 5.5l72.9 144.3 73.2-144.3a10 10 0 018.9-5.5h45c5.5 0 10 4.5 10 10 .1 1.7-.3 3.3-1.1 4.8z"}}]},name:"account-book",theme:"filled"};function Vl(i,e){xct(i)&&(i="100%");var t=Oct(i);return i=e===360?i:Math.min(e,Math.max(0,parseFloat(i))),t&&(i=parseInt(String(i*e),10)/100),Math.abs(i-e)<1e-6?1:(e===360?i=(i<0?i%e+e:i%e)/parseFloat(String(e)):i=i%e/parseFloat(String(e)),i)}function xct(i){return typeof i=="string"&&i.indexOf(".")!==-1&&parseFloat(i)===1}function Oct(i){return typeof i=="string"&&i.indexOf("%")!==-1}function Lct(i){return i=parseFloat(i),(isNaN(i)||i<0||i>1)&&(i=1),i}function dC(i){return i<=1?"".concat(Number(i)*100,"%"):i}function rH(i){return i.length===1?"0"+i:String(i)}function kct(i,e,t){return{r:Vl(i,255)*255,g:Vl(e,255)*255,b:Vl(t,255)*255}}function sH(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*(6*t):t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function Ect(i,e,t){var n,r,s;if(i=Vl(i,360),e=Vl(e,100),t=Vl(t,100),e===0)r=t,s=t,n=t;else{var o=t<.5?t*(1+e):t+e-t*e,a=2*t-o;n=sH(a,o,i+1/3),r=sH(a,o,i),s=sH(a,o,i-1/3)}return{r:n*255,g:r*255,b:s*255}}function Tct(i,e,t){i=Vl(i,255),e=Vl(e,255),t=Vl(t,255);var n=Math.max(i,e,t),r=Math.min(i,e,t),s=0,o=n,a=n-r,l=n===0?0:a/n;if(n===r)s=0;else{switch(n){case i:s=(e-t)/a+(e<t?6:0);break;case e:s=(t-i)/a+2;break;case t:s=(i-e)/a+4;break}s/=6}return{h:s,s:l,v:o}}function Pct(i,e,t){i=Vl(i,360)*6,e=Vl(e,100),t=Vl(t,100);var n=Math.floor(i),r=i-n,s=t*(1-e),o=t*(1-r*e),a=t*(1-(1-r)*e),l=n%6,c=[t,o,s,s,a,t][l],u=[a,t,t,o,s,s][l],d=[s,s,a,t,t,o][l];return{r:c*255,g:u*255,b:d*255}}function Nct(i,e,t,n){var r=[rH(Math.round(i).toString(16)),rH(Math.round(e).toString(16)),rH(Math.round(t).toString(16))];return r.join("")}function Ope(i){return ol(i)/255}function ol(i){return parseInt(i,16)}var Lpe={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function P_(i){var e={r:0,g:0,b:0},t=1,n=null,r=null,s=null,o=!1,a=!1;return typeof i=="string"&&(i=Act(i)),typeof i=="object"&&(sh(i.r)&&sh(i.g)&&sh(i.b)?(e=kct(i.r,i.g,i.b),o=!0,a=String(i.r).substr(-1)==="%"?"prgb":"rgb"):sh(i.h)&&sh(i.s)&&sh(i.v)?(n=dC(i.s),r=dC(i.v),e=Pct(i.h,n,r),o=!0,a="hsv"):sh(i.h)&&sh(i.s)&&sh(i.l)&&(n=dC(i.s),s=dC(i.l),e=Ect(i.h,n,s),o=!0,a="hsl"),Object.prototype.hasOwnProperty.call(i,"a")&&(t=i.a)),t=Lct(t),{ok:o,format:i.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var Dct="[-\\+]?\\d+%?",Ict="[-\\+]?\\d*\\.\\d+%?",Wf="(?:".concat(Ict,")|(?:").concat(Dct,")"),oH="[\\s|\\(]+(".concat(Wf,")[,|\\s]+(").concat(Wf,")[,|\\s]+(").concat(Wf,")\\s*\\)?"),aH="[\\s|\\(]+(".concat(Wf,")[,|\\s]+(").concat(Wf,")[,|\\s]+(").concat(Wf,")[,|\\s]+(").concat(Wf,")\\s*\\)?"),Rc={CSS_UNIT:new RegExp(Wf),rgb:new RegExp("rgb"+oH),rgba:new RegExp("rgba"+aH),hsl:new RegExp("hsl"+oH),hsla:new RegExp("hsla"+aH),hsv:new RegExp("hsv"+oH),hsva:new RegExp("hsva"+aH),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Act(i){if(i=i.trim().toLowerCase(),i.length===0)return!1;var e=!1;if(Lpe[i])i=Lpe[i],e=!0;else if(i==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=Rc.rgb.exec(i);return t?{r:t[1],g:t[2],b:t[3]}:(t=Rc.rgba.exec(i),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Rc.hsl.exec(i),t?{h:t[1],s:t[2],l:t[3]}:(t=Rc.hsla.exec(i),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Rc.hsv.exec(i),t?{h:t[1],s:t[2],v:t[3]}:(t=Rc.hsva.exec(i),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Rc.hex8.exec(i),t?{r:ol(t[1]),g:ol(t[2]),b:ol(t[3]),a:Ope(t[4]),format:e?"name":"hex8"}:(t=Rc.hex6.exec(i),t?{r:ol(t[1]),g:ol(t[2]),b:ol(t[3]),format:e?"name":"hex"}:(t=Rc.hex4.exec(i),t?{r:ol(t[1]+t[1]),g:ol(t[2]+t[2]),b:ol(t[3]+t[3]),a:Ope(t[4]+t[4]),format:e?"name":"hex8"}:(t=Rc.hex3.exec(i),t?{r:ol(t[1]+t[1]),g:ol(t[2]+t[2]),b:ol(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function sh(i){return!!Rc.CSS_UNIT.exec(String(i))}var hC=2,kpe=.16,Mct=.05,Rct=.05,Fct=.15,Epe=5,Tpe=4,Vct=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function Ppe(i){var e=i.r,t=i.g,n=i.b,r=Tct(e,t,n);return{h:r.h*360,s:r.s,v:r.v}}function fC(i){var e=i.r,t=i.g,n=i.b;return"#".concat(Nct(e,t,n))}function Hct(i,e,t){var n=t/100,r={r:(e.r-i.r)*n+i.r,g:(e.g-i.g)*n+i.g,b:(e.b-i.b)*n+i.b};return r}function Npe(i,e,t){var n;return Math.round(i.h)>=60&&Math.round(i.h)<=240?n=t?Math.round(i.h)-hC*e:Math.round(i.h)+hC*e:n=t?Math.round(i.h)+hC*e:Math.round(i.h)-hC*e,n<0?n+=360:n>=360&&(n-=360),n}function Dpe(i,e,t){if(i.h===0&&i.s===0)return i.s;var n;return t?n=i.s-kpe*e:e===Tpe?n=i.s+kpe:n=i.s+Mct*e,n>1&&(n=1),t&&e===Epe&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function Ipe(i,e,t){var n;return t?n=i.v+Rct*e:n=i.v-Fct*e,n>1&&(n=1),Number(n.toFixed(2))}function lH(i){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[],n=P_(i),r=Epe;r>0;r-=1){var s=Ppe(n),o=fC(P_({h:Npe(s,r,!0),s:Dpe(s,r,!0),v:Ipe(s,r,!0)}));t.push(o)}t.push(fC(n));for(var a=1;a<=Tpe;a+=1){var l=Ppe(n),c=fC(P_({h:Npe(l,a),s:Dpe(l,a),v:Ipe(l,a)}));t.push(c)}return e.theme==="dark"?Vct.map(function(u){var d=u.index,h=u.opacity,f=fC(Hct(P_(e.backgroundColor||"#141414"),P_(t[d]),h*100));return f}):t}var cH={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},gC={},uH={};Object.keys(cH).forEach(function(i){gC[i]=lH(cH[i]),gC[i].primary=gC[i][5],uH[i]=lH(cH[i],{theme:"dark",backgroundColor:"#141414"}),uH[i].primary=uH[i][5]});var Bct=gC.blue,zct=Symbol("iconContext"),dH=function(){return C.inject(zct,{prefixCls:C.ref("anticon"),rootClassName:C.ref(""),csp:C.ref()})};function hH(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function $ct(i,e){return i&&i.contains?i.contains(e):!1}var Ape="data-vc-order",jct="vc-icon-key",fH=new Map;function Mpe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=i.mark;return e?e.startsWith("data-")?e:"data-".concat(e):jct}function gH(i){if(i.attachTo)return i.attachTo;var e=document.querySelector("head");return e||document.body}function Wct(i){return i==="queue"?"prependQueue":i?"prepend":"append"}function Rpe(i){return Array.from((fH.get(i)||i).children).filter(function(e){return e.tagName==="STYLE"})}function Fpe(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!hH())return null;var t=e.csp,n=e.prepend,r=document.createElement("style");r.setAttribute(Ape,Wct(n)),t&&t.nonce&&(r.nonce=t.nonce),r.innerHTML=i;var s=gH(e),o=s.firstChild;if(n){if(n==="queue"){var a=Rpe(s).filter(function(l){return["prepend","prependQueue"].includes(l.getAttribute(Ape))});if(a.length)return s.insertBefore(r,a[a.length-1].nextSibling),r}s.insertBefore(r,o)}else s.appendChild(r);return r}function Uct(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=gH(e);return Rpe(t).find(function(n){return n.getAttribute(Mpe(e))===i})}function qct(i,e){var t=fH.get(i);if(!t||!$ct(document,t)){var n=Fpe("",e),r=n.parentNode;fH.set(i,r),i.removeChild(n)}}function Gct(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=gH(t);qct(n,t);var r=Uct(e,t);if(r)return t.csp&&t.csp.nonce&&r.nonce!==t.csp.nonce&&(r.nonce=t.csp.nonce),r.innerHTML!==i&&(r.innerHTML=i),r;var s=Fpe(i,t);return s.setAttribute(Mpe(t),e),s}function Vpe(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.forEach(function(r){Zct(i,r,t[r])})}return i}function Zct(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Yct(i,e){process.env.NODE_ENV!=="production"&&!i&&console!==void 0&&console.error("Warning: ".concat(e))}function pH(i,e){Yct(i,"[@ant-design/icons-vue] ".concat(e))}function Hpe(i){return typeof i=="object"&&typeof i.name=="string"&&typeof i.theme=="string"&&(typeof i.icon=="object"||typeof i.icon=="function")}function mH(i,e,t){return t?C.h(i.tag,Vpe({key:e},t,i.attrs),(i.children||[]).map(function(n,r){return mH(n,"".concat(e,"-").concat(i.tag,"-").concat(r))})):C.h(i.tag,Vpe({key:e},i.attrs),(i.children||[]).map(function(n,r){return mH(n,"".concat(e,"-").concat(i.tag,"-").concat(r))}))}function Bpe(i){return lH(i)[0]}function zpe(i){return i?Array.isArray(i)?i:[i]:[]}var Xct={width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false"},Qct=`
|
|
1156
1156
|
.anticon {
|
|
1157
1157
|
display: inline-block;
|
|
1158
1158
|
color: inherit;
|