/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{$k as m}from"./YCOWKBW5.js";function p(r,t){let o=globalThis.MonacoEnvironment;if(o?.createTrustedTypesPolicy)try{return o.createTrustedTypesPolicy(r,t)}catch(e){console.error(e);return}try{return globalThis.trustedTypes?.createPolicy(r,t)}catch(e){console.error(e);return}}var i;typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"&&globalThis.workerttPolicy!==void 0?i=globalThis.workerttPolicy:i=p("defaultWorkerFactory",{createScriptURL:r=>r});function n(r){let t=r.label,o=globalThis.MonacoEnvironment;if(o){if(typeof o.getWorker=="function")return o.getWorker("workerMain.js",t);if(typeof o.getWorkerUrl=="function"){let e=o.getWorkerUrl("workerMain.js",t);return new Worker(i?i.createScriptURL(e):e,{name:t,type:"module"})}}if(r.createWorker)return r.createWorker();throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function Ur(r){let t=Promise.resolve(n({label:r.label??"monaco-editor-worker",moduleId:r.moduleId,createWorker:r.createWorker})).then(o=>(o.postMessage("ignore"),o.postMessage(r.createData),o));return m.createWebWorker({worker:t,host:r.host,keepIdleModels:r.keepIdleModels})}export{Ur as a};
