/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
import{a as I,b as k,c as S,d as W,e as A,f as F,g,h as d,i as C,j as E,k as l,l as u,m as c,n as h,o as w,p as L,q as _,r as f}from"./M2XTTDCC.js";import{a as v}from"./GHSEU7VA.js";import"./4OSKRQ5X.js";import{al as t}from"./NG7S6FUK.js";import"./3TTFCHAA.js";var b=120*1e3,p=class{constructor(o){this._defaults=o,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>b&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=v({moduleId:"vs/language/html/htmlWorker",createWorker:()=>new Worker(new URL("html.worker.js",import.meta.url),{type:"module"}),createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...o){let e;return this._getClient().then(r=>{e=r}).then(r=>{if(this._worker)return this._worker.withSyncedResources(o)}).then(r=>e)}};var a=class extends k{constructor(o){super(o,[".",":","<",'"',"=","/"])}};function rt(i){let o=new p(i),e=(...n)=>o.getLanguageServiceWorker(...n),r=i.languageId;t.registerCompletionItemProvider(r,new a(e)),t.registerHoverProvider(r,new g(e)),t.registerDocumentHighlightProvider(r,new d(e)),t.registerLinkProvider(r,new c(e)),t.registerFoldingRangeProvider(r,new _(e)),t.registerDocumentSymbolProvider(r,new u(e)),t.registerSelectionRangeProvider(r,new f(e)),t.registerRenameProvider(r,new l(e)),r==="html"&&(t.registerDocumentFormattingEditProvider(r,new h(e)),t.registerDocumentRangeFormattingEditProvider(r,new w(e)))}function it(i){let o=[],e=[],r=new p(i);o.push(r);let n=(...s)=>r.getLanguageServiceWorker(...s);function R(){let{languageId:s,modeConfiguration:m}=i;D(e),m.completionItems&&e.push(t.registerCompletionItemProvider(s,new a(n))),m.hovers&&e.push(t.registerHoverProvider(s,new g(n))),m.documentHighlights&&e.push(t.registerDocumentHighlightProvider(s,new d(n))),m.links&&e.push(t.registerLinkProvider(s,new c(n))),m.documentSymbols&&e.push(t.registerDocumentSymbolProvider(s,new u(n))),m.rename&&e.push(t.registerRenameProvider(s,new l(n))),m.foldingRanges&&e.push(t.registerFoldingRangeProvider(s,new _(n))),m.selectionRanges&&e.push(t.registerSelectionRangeProvider(s,new f(n))),m.documentFormattingEdits&&e.push(t.registerDocumentFormattingEditProvider(s,new h(n))),m.documentRangeFormattingEdits&&e.push(t.registerDocumentRangeFormattingEditProvider(s,new w(n)))}return R(),o.push(P(e)),P(o)}function P(i){return{dispose:()=>D(i)}}function D(i){for(;i.length;)i.pop().dispose()}export{k as CompletionAdapter,C as DefinitionAdapter,I as DiagnosticsAdapter,L as DocumentColorAdapter,h as DocumentFormattingEditProvider,d as DocumentHighlightAdapter,c as DocumentLinkAdapter,w as DocumentRangeFormattingEditProvider,u as DocumentSymbolAdapter,_ as FoldingRangeAdapter,g as HoverAdapter,E as ReferenceAdapter,l as RenameAdapter,f as SelectionRangeAdapter,p as WorkerManager,S as fromPosition,W as fromRange,it as setupMode,rt as setupMode1,A as toRange,F as toTextEdit};
