text: import { a as t$2, e as e$6, s as s$4 } from './config-b3bf08ce.js';
  import { h as h$2, ae as m$4, e as e$4, y as y$3, i as i$2, u as u$3, n as n$2, aB as e$5, aC as n$3, J as t$1, aD as U$1, P as r$4, s as s$2, aE as d$3, a9 as s$3, V as a$3, S as S$1, B as g$4, aA as r$5, aF as t$3, aG as r$6, aH as T$1, R as c$2, Q as a$4, aI as o$2 } from './Identifiable-c8406192.js';
  import { d as d$2 } from './watchUtils-880dbce7.js';
  
  /*
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  See https://js.arcgis.com/4.19/esri/copyright.txt for details.
  */
  const d$1="20210423",f$4="33983ad14c009689ffdf09d4145a0b9e63420892";
  
  /*
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  See https://js.arcgis.com/4.19/esri/copyright.txt for details.
  */
  class e$3{constructor(){this._tasks=new Array;}get length(){return this._tasks.length}push(t,s){return new Promise(((e,n)=>this._tasks.push(new r$3(e,n,t,s))))}unshift(t,s){return new Promise(((e,n)=>this._tasks.unshift(new r$3(e,n,t,s))))}process(){if(0===this._tasks.length)return !1;const s=this._tasks.shift();try{h$2(s.signal);const e=s.callback();e&&"object"==typeof e&&"then"in e&&"function"==typeof e.then?e.then(s.resolve,s.reject):s.resolve(e);}catch(e){s.reject(e);}return !0}cancelAll(){const t=m$4();for(const s of this._tasks)s.reject(t);this._tasks.length=0;}}class r$3{constructor(t,s,e,r){this.resolve=t,this.reject=s,this.callback=e,this.signal=r;}}
  
  /*
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  See https://js.arcgis.com/4.19/esri/copyright.txt for details.
  */
  let t=class extends u$3{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1;}};e$4([y$3()],t.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),e$4([y$3()],t.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),t=e$4([i$2("esri.views.support.DebugFlags")],t);const p$3=new t;
  
  /*
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  See https://js.arcgis.com/4.19/esri/copyright.txt for details.
  */
  const l$2=n$2.getLogger("esri.views.support.Scheduler");var c$1;!function(e){e.REMOTE_CLIENT="worker messages",e.SLIDE="slide",e.STAGE="stage",e.STREAM_DATA_LOADER="stream loader",e.ELEVATION_QUERY="elevation query",e.TERRAIN_SURFACE="terrain",e.SURFACE_GEOMETRY_UPDATES="surface geometry updates",e.GRAPHICS_CORE="Graphics3D",e.I3S_CONTROLLER="I3S",e.POINT_CLOUD_LAYER="point cloud",e.FEATURE_TILE_FETCHER="feature fetcher",e.LABELER="labeler",e.GRAPHICS_DECONFLICTOR="graphics deconflictor",e.FILTER_VISIBILITY="Graphics3D filter visibility",e.FEATURE_QUERY_ENGINE="feature query",e.SCALE_VISIBILITY="Graphics3D scale visibility",e.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",e.POINT_OF_INTEREST_FREQUENT="POI frequent",e.POINT_OF_INTEREST_INFREQUENT="POI infrequent",e.FEATURE_TILE_TREE="feature tile tree",e.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",e.ELEVATION_ALIGNMENT="elevation alignment",e.TEXT_TEXTURE_ATLAS="text texture atlas",e.TEXTURE_UNLOAD="texture unload",e.OVERLAY_MANAGER="overlay manager",e.LINE_OF_SIGHT_TOOL="line of sight tool",e.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",e.ELEVATION_PROFILE="elevation profile",e.SNAPPING="snapping",e[e.TEST_PRIO=1]="TEST_PRIO";}(c$1||(c$1={}));const T=0,p$2={[c$1.REMOTE_CLIENT]:T,[c$1.SLIDE]:T,[c$1.STREAM_DATA_LOADER]:T,[c$1.ELEVATION_QUERY]:T,[c$1.STAGE]:1,[c$1.TERRAIN_SURFACE]:1,[c$1.SURFACE_GEOMETRY_UPDATES]:1,[c$1.GRAPHICS_CORE]:2,[c$1.I3S_CONTROLLER]:2,[c$1.POINT_CLOUD_LAYER]:2,[c$1.FEATURE_TILE_FETCHER]:2,[c$1.LABELER]:8,[c$1.GRAPHICS_DECONFLICTOR]:4,[c$1.FILTER_VISIBILITY]:4,[c$1.FEATURE_QUERY_ENGINE]:8,[c$1.SCALE_VISIBILITY]:4,[c$1.FRUSTUM_VISIBILITY]:4,[c$1.POINT_OF_INTEREST_FREQUENT]:6,[c$1.POINT_OF_INTEREST_INFREQUENT]:30,[c$1.FEATURE_TILE_TREE]:16,[c$1.FEATURE_TILE_TREE_ACTIVE]:T,[c$1.ELEVATION_ALIGNMENT]:12,[c$1.TEXT_TEXTURE_ATLAS]:12,[c$1.TEXTURE_UNLOAD]:12,[c$1.OVERLAY_MANAGER]:12,[c$1.LINE_OF_SIGHT_TOOL]:16,[c$1.LINE_OF_SIGHT_TOOL_INTERACTIVE]:T,[c$1.SNAPPING]:T};function g$3(e){return e in p$2?p$2[e]:"number"==typeof e?e:1}const m$3=6.5,I$1=1,R=30,A=1e3/30,f$3=100,S=.9;var L,b$2;!function(s){let u=class extends u$3{constructor(e){super(e),this.updating=!0,this.performanceInfo={total:new e$5("total"),tasks:new Array},this._budget=null,this._state=1,this._tasks=new n$3,this._runQueue=new n$3,this._load=0,this._idleStateCallbacks=new n$3,this._idleUpdatesStartFired=!1,this._maxReschedule=k$2,this._forceTask=!1,this._debug=!1,this._debugHandle=d$2(p$3,"SCHEDULER_LOG_SLOW_TASKS",(e=>this._debug=e)),this._budget=new p(e.nowFunc),y$2.length=0;for(const t in c$1)F.set(c$1[t],this.performanceInfo.tasks.length),this.performanceInfo.tasks.push(new e$5(c$1[t])),y$2.push(0);let s;const r=this;this._test={get state(){return t$1(s)?r._state:s},set state(e){s=e;},FRAME_SAFETY_BUDGET:m$3,INTERACTING_BUDGET:A,IDLE_BUDGET:f$3,get budget(){return r._budget.budget},usedBudget:0,updateTask:e=>this._updateTask(e),getState:e=>this._getState(e),getRuntime:e=>this._getRuntime(e),resetRuntimes:()=>this._resetRuntimes(),getRunning:()=>this._getRunning()};}destroy(){this._debugHandle&&this._debugHandle.remove();}registerTask(e,t,s){const r=g$3(e),i=new E(this,e,t,s,r);return this._tasks.push(i),i}registerIdleStateCallbacks(e,t){const s={idleBegin:e,idleEnd:t};this._idleStateCallbacks.push(s),2===this.state&&this._idleUpdatesStartFired&&s.idleBegin();const r=this;return {remove:()=>this._removeIdleStateCallbacks(s),set idleBegin(e){r._idleUpdatesStartFired&&(s.idleEnd(),2===r._state&&e()),s.idleBegin=e;},set idleEnd(e){s.idleEnd=e;}}}get now(){return this.nowFunc()}get load(){return this._load}set state(e){this._state!==e&&(this._state=e,2!==this.state&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll((e=>e.idleEnd()))));}get state(){return t$1(this._test.state)?this._state:this._test.state}updateBudget(e){this._test.usedBudget=0;let t=m$3,s=e.frameDuration,r=I$1;switch(this.state){case 2:t=0,s=Math.max(f$3,e.frameDuration),r=R;break;case 1:s=Math.max(A,e.frameDuration);}return s-=e.elapsedFrameTime+t,2!==this.state&&s<I$1&&!this._forceTask?(this._forceTask=!0,!1):(s=Math.max(s,r),this._budget.reset(s,this.state),this._maxReschedule=k$2,this._updateLoad(),this._schedule())}frame(){switch(this._forceTask=!1,this.state){case 2:this._idleUpdatesStartFired||(this._idleUpdatesStartFired=!0,this._idleStateCallbacks.forAll((e=>e.idleBegin()))),this._runIdle();break;case 1:this._runInteracting();break;default:this._runAnimating();}this._test.usedBudget=this._budget.elapsed;}_removeIdleStateCallbacks(e){this._idleUpdatesStartFired&&e.idleEnd(),this._idleStateCallbacks.removeUnordered(e);}removeTask(e){this._tasks.removeUnordered(e),this._runQueue.removeUnordered(e);}_updateTask(e){this._tasks.forAll((t=>{t.name===e&&t.setPriority(e);}));}_getState(e){if(this._runQueue.some((t=>t.name===e)))return b$2.SCHEDULED;let t=b$2.IDLE;return this._tasks.forAll((s=>{s.name===e&&s.needsUpdate&&(s.schedulePriority<=1?t=b$2.READY:t!==b$2.READY&&(t=b$2.WAITING));})),t}_getRuntime(e){let t=0;return this._tasks.forAll((s=>{s.name===e&&(t+=s.runtime);})),t}_resetRuntimes(){this._tasks.forAll((e=>e.runtime=0));}_getRunning(){const e=new Map;if(this._tasks.forAll((t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1);})),0===e.size)return null;let t="";return e.forEach(((e,s)=>{t+=e>1?` ${e}x ${s}`:` ${s}`;})),t}_runIdle(){this._run();}_runInteracting(){this._run();}_runAnimating(){this._run();}_updateLoad(){const e=this._tasks.reduce(((e,t)=>t.needsUpdate?++e:e),0);this._load=this._load*S+e*(1-S);}_schedule(){if(this._maxReschedule<=0)return !1;for(this._runQueue.filterInPlace((e=>!!e.needsUpdate||(e.schedulePriority=e.priority,!1))),this._tasks.forAll((e=>{e.priority===T&&e.needsUpdate&&!this._runQueue.some((t=>t===e))&&this._runQueue.unshift(e);}));0===this._runQueue.length;){let e=!1,t=0;if(this._tasks.forAll((s=>{if(s.needsUpdate&&0!==s.schedulePriority&&s.priority!==T)switch(e=!0,t=Math.max(t,s.priority),s.schedulePriority){case 1:s.schedulePriority=0,this._runQueue.push(s);break;default:--s.schedulePriority;}})),!e)return this.updating=!1,!1;this._maxReschedule===k$2&&(this._maxReschedule=t),--this._maxReschedule;}return this.updating=!0,!0}_run(){const e=this._budget.now();for(let s=0;s<y$2.length;++s)y$2[s]=0;do{for(;this._runQueue.length>0;){const s=this._budget.now(),r=this._runQueue.pop();this._budget.resetProgress();try{r.update(this._budget);}catch(t){l$2.error(`Exception in task "${r.name}"`,t);}r.schedulePriority=r.priority;const i=this._budget.now()-s;if(r.runtime+=i,y$2[F.get(r.task)]+=i,this._debug&&this._budget.elapsed>2*this._budget.budget&&console.log("Task",r.name,"used",this._budget.elapsed,"of max",this._budget.budget,"ms"),this._budget.remaining<=0)return void this._recordFrameTaskTimes(y$2,this._budget.now()-e)}}while(this._schedule());this._recordFrameTaskTimes(y$2,this._budget.now()-e);}_recordFrameTaskTimes(e,t){for(let s=0;s<e.length;++s)this.performanceInfo.tasks[s].record(e[s]);this.performanceInfo.total.record(t);}get test(){return this._test}};e$4([y$3()],u.prototype,"updating",void 0),e$4([y$3()],u.prototype,"nowFunc",void 0),u=e$4([i$2("esri.views.support.Scheduler")],u),s.Scheduler=u;let E=class extends u$3{constructor(e,t,s,r,i){super({}),this._scheduler=e,this.name=t,this.update=s,this._needsUpdateCB=r,this._priority=i,this.runtime=0,this._queue=new e$3,this.updating=!1,this.schedulePriority=this._priority;}normalizeCtorArgs(){return {}}remove(){this.processQueue(U),this._scheduler.removeTask(this),this.schedule=O.schedule,this.reschedule=O.reschedule;}get priority(){return this._priority}setPriority(e){this.name=e;const t=g$3(e);this._priority!==T&&0===this.schedulePriority||(this.schedulePriority=t),this._priority=t;}get task(){return this.name}set task(e){this.setPriority(e);}get needsUpdate(){return this.updating||this._needsUpdateCB()}schedule(e,t){return this.updating=!0,this._queue.push(e,t)}reschedule(e,t){return this.updating=!0,this._queue.unshift(e,t)}processQueue(e){for(;!e.done&&this._queue.process();)e.madeProgress();this.updating=this._queue.length>0;}};e$4([y$3()],E.prototype,"updating",void 0),E=e$4([i$2("esri.views.support.SchedulerTask")],E);class p{constructor(e){this.now=e,this._begin=0,this._budget=0,this._state=2,this._didWork=!1,this._enabled=!0;}run(e){return !this.done&&(!0===e()&&(this._didWork=!0),!0)}get done(){return this._didWork&&this.elapsed>=this._budget&&this._enabled}get budget(){return this._budget}madeProgress(){this._didWork=!0;}get state(){return this._state}get enabled(){return this._enabled}set enabled(e){this._enabled=e;}reset(e,t){this._begin=this.now(),this._budget=e,this._state=t,this._didWork=!1;}get remaining(){return Math.max(this._budget-this.elapsed,0)}get elapsed(){return this.now()-this._begin}resetProgress(){this._didWork=!1;}get hasProgressed(){return this._didWork}}s.Budget=p;}(L||(L={})),function(e){e.SCHEDULED="s",e.READY="r",e.WAITING="w",e.IDLE="i";}(b$2||(b$2={}));const U=(()=>{const e=new L.Budget((()=>performance.now()));return e.enabled=!1,e})();class N{remove(){}processQueue(){}schedule(e){return U$1(e())}reschedule(e){return U$1(e())}}const O=new N,k$2=Number.MAX_SAFE_INTEGER,F=new Map,y$2=new Array;
  
  /*
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  See https://js.arcgis.com/4.19/esri/copyright.txt for details.
  */
  const e$2={geometryEngineWorker:()=>import('./geometryEngineWorker-c21a78e3.js'),CSVSourceWorker:()=>import('./CSVSourceWorker-94b16184.js'),EdgeProcessingWorker:()=>import('./EdgeProcessingWorker-fc709562.js'),ElevationSamplerWorker:()=>import('./ElevationSamplerWorker-87fdfb4d.js'),GeoJSONSourceWorker:()=>import('./GeoJSONSourceWorker-6024778e.js'),LercWorker:()=>import('./LercWorker-ccf4eae6.js'),MemorySourceWorker:()=>import('./MemorySourceWorker-762ab4d6.js'),PBFDecoderWorker:()=>import('./PBFDecoderWorker-65317891.js'),Pipeline:()=>import('./Pipeline-8d6c11db.js'),PointCloudWorker:()=>import('./PointCloudWorker-bebd9ce3.js'),RasterWorker:()=>import('./RasterWorker-aa1a22be.js'),SceneLayerWorker:()=>import('./SceneLayerWorker-a80c24fb.js'),WorkerTileHandler:()=>import('./WorkerTileHandler-0462fe9e.js'),FeatureServiceSnappingSourceWorker:()=>import('./FeatureServiceSnappingSourceWorker-2df8e3cc.js')};
  
  /*
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  See https://js.arcgis.com/4.19/esri/copyright.txt for details.
  */
  var e$1;!function(t){t[t.HANDSHAKE=0]="HANDSHAKE",t[t.OPEN=1]="OPEN",t[t.OPENED=2]="OPENED",t[t.RESPONSE=3]="RESPONSE",t[t.INVOKE=4]="INVOKE",t[t.ABORT=5]="ABORT",t[t.CLOSE=6]="CLOSE",t[t.OPEN_PORT=7]="OPEN_PORT",t[t.ON=8]="ON";}(e$1||(e$1={}));let r$2=0;function n$1(){return r$2++}function s$1(t){return t&&"object"==typeof t&&("result"in t||"transferList"in t)}function a$2(t){return t?"string"==typeof t?JSON.stringify({name:"message",message:t}):t.toJSON?JSON.stringify(t):JSON.stringify({name:t.name,message:t.message,details:t.details||{stack:t.stack}}):null}function i$1(t,r,n,a){if(r.type===e$1.OPEN_PORT)return void t.postMessage(r,[r.port]);if(r.type!==e$1.INVOKE&&r.type!==e$1.RESPONSE)return void t.postMessage(r);let i;s$1(n)?(i=o$1(n.transferList),r.data=n.result):(i=o$1(a),r.data=n),i?t.postMessage(r,i):t.postMessage(r);}function f$2(t){if(!t)return null;const e=t.data;return e?"string"==typeof e?JSON.parse(e):e:null}function o$1(e){if(!e||!e.length)return null;if(t$2("esri-workers-arraybuffer-transfer"))return e;const r=e.filter((t=>!u$2(t)));return r.length?r:null}function u$2(t){return t instanceof ArrayBuffer||t&&t.constructor&&"ArrayBuffer"===t.constructor.name}
  
  /*
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  See https://js.arcgis.com/4.19/esri/copyright.txt for details.
  */
  const{CLOSE:v$1,ABORT:M,INVOKE:k$1,RESPONSE:y$1,OPEN_PORT:j$1,ON:I}=e$1;class w$1{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this);}push(e){e.type===e$1.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),null===this._timer&&(this._timer=setTimeout(this._process,0)));}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null;}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0;}}class J{constructor(e,s){this._port=e,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new w$1((e=>this._onInvokeMessage(e))),this._messageQueue=new Array,this._client=s.client,this._onMessage=this._onMessage.bind(this),this._channel=s.channel,r$4(s.scheduler)&&(this._frameTask=s.scheduler.registerTask(c$1.REMOTE_CLIENT,(e=>this._update(e)),(()=>this._messageQueue.length>0))),this._port.addEventListener("message",this._onMessage),this._port.start();}static connect(e){const s=new MessageChannel;let t;t="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const o=new J(s.port1,{channel:s,client:t});return "object"==typeof t&&"remoteClient"in t&&(t.remoteClient=o),J.clients.set(o,t),s.port2}static loadWorker(e){const s=e$2[e];return s?s():Promise.resolve(null)}close(){this._post({type:v$1}),this._close();}isBusy(){return this._outJobs.size>0}invoke(e,s,t){const o=t&&t.signal,r=t&&t.transferList;if(!this._port)return Promise.reject(new s$2("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:s}));const l=n$1();return new Promise(((t,n)=>{const h=d$3(o,(()=>{var e;const s=this._outJobs.get(l);s&&(this._outJobs.delete(l),null==(e=s.abortHandle)||e.remove(),this._post({type:M,jobId:l}),n(m$4()));})),c={resolve:t,reject:n,abortHandle:h,debugInfo:e};this._outJobs.set(l,c),this._post({type:k$1,jobId:l,methodName:e,abortable:null!=o},s,r);}))}on(e,s){const t=new MessageChannel;function o(e){s(e.data);}return this._port.postMessage({type:e$1.ON,eventType:e,port:t.port2},[t.port2]),t.port1.addEventListener("message",o),t.port1.start(),{remove(){t.port1.postMessage({type:e$1.CLOSE}),t.port1.close(),t.port1.removeEventListener("message",o);}}}openPort(){const e=new MessageChannel;return this._post({type:j$1,port:e.port2}),e.port1}_close(){this._channel&&(this._channel=null),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{var s;null==(s=e.abortHandle)||s.remove(),e.reject(m$4(`Worker closing, aborting job calling '${e.debugInfo}'`));})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=this._client=null,this._frameTask=s$3(this._frameTask);}_onMessage(e){r$4(this._frameTask)?this._messageQueue.push(e):this._processMessage(e);}_processMessage(e){const s=f$2(e);if(s)switch(s.type){case y$1:this._onResponseMessage(s);break;case k$1:this._invokeQueue.push(s);break;case M:this._onAbortMessage(s);break;case v$1:this._onCloseMessage();break;case j$1:this._onOpenPortMessage(s);break;case I:this._onOnMessage(s);}}_onAbortMessage(e){const s=this._inJobs,t=e.jobId,o=s.get(t);this._invokeQueue.push(e),o&&(o.controller&&o.controller.abort(),s.delete(t));}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&J.clients.get(this)===e&&e.destroy(),J.clients.delete(this),e&&e.remoteClient&&(e.remoteClient=null);}_onInvokeMessage(e){const{methodName:s,jobId:t,data:o,abortable:n}=e,r=n?a$3():null,i=this._inJobs;let a,_=this._client,p=_[s];try{if(!p&&s&&-1!==s.indexOf(".")){const e=s.split(".");for(let s=0;s<e.length-1;s++)_=_[e[s]],p=_[e[s+1]];}if("function"!=typeof p)throw new TypeError(`${s} is not a function`);a=p.call(_,o,{client:this,signal:r?r.signal:null});}catch(u){return void this._post({type:y$1,jobId:t,error:a$2(u)})}S$1(a)?(i.set(t,{controller:r,promise:a}),a.then((e=>{i.has(t)&&(i.delete(t),this._post({type:y$1,jobId:t},e));}),(e=>{i.has(t)&&(i.delete(t),g$4(e)||this._post({type:y$1,jobId:t,error:a$2(e||{message:`Error encountered at method ${s}`})}));}))):this._post({type:y$1,jobId:t},a);}_onOpenPortMessage(e){new J(e.port,{client:this._client});}_onOnMessage(e){const{port:s}=e,t=this._client.on(e.eventType,(e=>{s.postMessage(e);})),o=r$5(e.port,"message",(e=>{f$2(e).type===e$1.CLOSE&&(o.remove(),t.remove(),s.close());}));}_onResponseMessage(e){var s;const{jobId:t,error:o,data:r}=e,i=this._outJobs;if(!i.has(t))return;const a=i.get(t);i.delete(t),null==(s=a.abortHandle)||s.remove(),o?a.reject(s$2.fromJSON(JSON.parse(o))):a.resolve(r);}_update(e){for(;!e.done&&this._messageQueue.length>0;)this._processMessage(this._messageQueue.shift()),e.madeProgress();}_post(e,s,t){return i$1(this._port,e,s,t)}}J.kernelInfo={revision:f$4,version:t$3,buildDate:d$1},J.clients=new Map;
  
  /*
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  See https://js.arcgis.com/4.19/esri/copyright.txt for details.
  */
  const r$1=n$2.getLogger("esri.core.workers.Connection");class l$1{constructor(){this._clients=new Array,this._clientPromises=new Array,this._clientIdx=0;}destroy(){this.close();}get closed(){return !this._clients||!this._clients.length}open(e,t){return new Promise(((r,l)=>{let o=!0;const h=e=>{h$2(t.signal),o&&(o=!1,e());};this._clients.length=e.length,this._clientPromises.length=e.length;for(let i=0;i<e.length;++i){const o=e[i];S$1(o)?this._clientPromises[i]=o.then((e=>(this._clients[i]=new J(e,t),h(r),this._clients[i])),(()=>(h(l),null))):(this._clients[i]=new J(o,t),this._clientPromises[i]=Promise.resolve(this._clients[i]),h(r));}}))}broadcast(e,t,s){const i=new Array(this._clientPromises.length);for(let n=0;n<this._clientPromises.length;++n){const r=this._clientPromises[n];i[n]=r.then((i=>i.invoke(e,t,s)));}return i}close(){for(const e of this._clientPromises)e.then((e=>e.close()));this._clients.length=0,this._clientPromises.length=0;}getAvailableClient(){let e;for(let t=0;t<this._clients.length;++t){const s=this._clients[t];if(s){if(!s.isBusy())return Promise.resolve(s)}else e=e||[],e.push(this._clientPromises[t]);}return e?Promise.race(e):(this._clientIdx=(this._clientIdx+1)%this._clients.length,Promise.resolve(this._clients[this._clientIdx]))}invoke(e,t,s){let i=null;if(Array.isArray(s)?(r$1.warn("invoke()","The transferList parameter is deprecated, use the options object instead"),i={transferList:s}):i=s,this.closed)return Promise.reject(new Error("Connection closed"));return this.getAvailableClient().then((s=>s.invoke(e,t,i)))}on(e,s){return Promise.all(this._clientPromises).then((()=>r$6(this._clients.map((t=>t.on(e,s))))))}openPorts(){return new Promise((e=>{const t=new Array(this._clientPromises.length);let s=t.length;for(let i=0;i<this._clientPromises.length;++i){this._clientPromises[i].then((n=>{t[i]=n.openPort(),0==--s&&e(t);}));}}))}get test(){return {numClients:this._clients.length}}}
  
  /*
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  See https://js.arcgis.com/4.19/esri/copyright.txt for details.
  */
  const s={};function e(a,s){for(const e of a)if(e.name===s.name)return;a.push(s);}function r(a){var r;const t={async:a.async,isDebug:a.isDebug,locale:a.locale,baseUrl:a.baseUrl,has:{...a.has},map:{...a.map},packages:a.packages&&a.packages.concat()||[],paths:{...a.paths}};return a.hasOwnProperty("async")||(t.async=!0),a.hasOwnProperty("isDebug")||(t.isDebug=!1),a.baseUrl||(t.baseUrl=s.baseUrl),null==(r=s.packages)||r.forEach((a=>{e(t.packages,a);})),t}
  
  /*
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  See https://js.arcgis.com/4.19/esri/copyright.txt for details.
  */
  class n{constructor(){const e=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach((t=>{this[t]=(...r)=>e[t](...r);}));}}const o=e$6.MutationObserver||e$6.WebKitMutationObserver,a$1=function(){let t;if(e$6.process&&e$6.process.nextTick)t=t=>{e$6.process.nextTick(t);};else if(e$6.Promise)t=t=>{e$6.Promise.resolve().then(t);};else if(o){const e=[],r=document.createElement("div");new o((()=>{for(;e.length>0;)e.shift()();})).observe(r,{attributes:!0}),t=t=>{e.push(t),r.setAttribute("queueStatus","1");};}return t}(),i=(()=>{const t=e$6.MessageEvent;try{new t("message",{data:null});}catch{return (e,t={})=>{const{data:r,bubbles:s=!1,cancelable:n=!1}=t,o=document.createEvent("Event");return o.initEvent(e,s,n),o.data=r,o}}return (e,r)=>new t(e,r)})();class d{constructor(){this._dispatcher=new n,this._workerPostMessage({type:e$1.HANDSHAKE});}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(e){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=e,e&&this.addEventListener("message",e);}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(e){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=e,e&&this.addEventListener("messageerror",e);}get onerror(){return this._onerrorHandler}set onerror(e){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=e,e&&this.addEventListener("error",e);}postMessage(e){a$1((()=>{this._workerMessageHandler(i("message",{data:e}));}));}dispatchEvent(e){return this._dispatcher.dispatchEvent(e)}addEventListener(e,t,r){this._dispatcher.addEventListener(e,t,r);}removeEventListener(e,t,r){this._dispatcher.removeEventListener(e,t,r);}_workerPostMessage(e){a$1((()=>{this.dispatchEvent(i("message",{data:e}));}));}async _workerMessageHandler(e){const n=f$2(e);if(n&&n.type===e$1.OPEN){const{modulePath:e,jobId:r}=n;let o=await J.loadWorker(e);o||(o=await import(
  /* @vite-ignore */
  /* webpackIgnore: true */
  e));const a=J.connect(o);this._workerPostMessage({type:e$1.OPENED,jobId:r,data:a});}}}
  
  /*
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  See https://js.arcgis.com/4.19/esri/copyright.txt for details.
  */
  const g$2=n$2.getLogger("esri.core.workers");t$2.add("esri-workers-arraybuffer-transfer",!t$2("safari")||t$2("safari")>=12);const{HANDSHAKE:m$2}=e$1,p$1='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,i)=>{if(t){if(t.aborted)return i(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,buildDate:r,version:t}=configuration.kernelInfo,{revision:n,buildDate:i,version:s}=e.kernelInfo;o!==n&&console.warn(`[esri.core.workers] Version mismatch detected between ArcGIS API for JavaScript and assets:\nAPI version: ${t} [Date: ${r}, Revision: ${o.slice(0,8)}]\nAssets version: ${s} [Date: ${i}, Revision: ${n.slice(0,8)}]`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let e;function t(o){const t=e.connect(o);self.postMessage({type:2,jobId:r,data:t},[t])}"function"==typeof define&&define.amd?require([workerPath],(r=>{e=r.default||r,checkWorkerRevision(e),e.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((r=>(e=r.default,checkWorkerRevision(e),e.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):(self.RemoteClient||importScripts(workerPath),e=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(e),e.loadWorker(o.modulePath).then(t));break;case 3:if(outgoing.has(r)){const e=outgoing.get(r);outgoing.delete(r),o.error?e.reject(JSON.parse(o.error)):e.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});';let k,h$1;const w="Failed to create Worker. Fallback to execute module in main thread";async function v(){if(!t$2("esri-workers"))return b$1(new d);if(!k&&!h$1)try{const e=p$1.replace('"{CONFIGURATION}"',`'${y()}'`);k=URL.createObjectURL(new Blob([e],{type:"text/javascript"}));}catch(o){h$1=o||{};}let r;if(k)try{r=new Worker(k,{name:"esri-worker-"+P++});}catch(o){g$2.warn(w,h$1),r=new d;}else g$2.warn(w,h$1),r=new d;return b$1(r)}async function b$1(e){return new Promise((r=>{function o(s){const n=f$2(s);n&&n.type===m$2&&(e.removeEventListener("message",o),e.removeEventListener("error",t),r(e));}function t(r){r.preventDefault(),e.removeEventListener("message",o),e.removeEventListener("error",t),g$2.warn("Failed to create Worker. Fallback to execute module in main thread",r),(e=new d).addEventListener("message",o),e.addEventListener("error",t);}e.addEventListener("message",o),e.addEventListener("error",t);}))}function y(){let s;if(null!=s$4.default){const e={...s$4};delete e.default,s=JSON.parse(JSON.stringify(e));}else s=JSON.parse(JSON.stringify(s$4));s.assetsPath=T$1(s.assetsPath),s.request.interceptors=[],s.log.interceptors=[],s.locale=c$2(),s.has={"csp-restrictions":t$2("csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":t$2("esri-2d-update-debug"),"esri-2d-query-centroid-enabled":t$2("esri-2d-query-centroid-enabled"),"featurelayer-pbf":t$2("featurelayer-pbf"),"featurelayer-snapshot-point-threshold":t$2("featurelayer-snapshot-point-threshold"),"esri-atomics":t$2("esri-atomics"),"esri-shared-array-buffer":t$2("esri-shared-array-buffer"),"esri-tiles-debug":t$2("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":t$2("esri-workers-arraybuffer-transfer"),"host-webworker":1},s.workers.loaderUrl&&(s.workers.loaderUrl=T$1(s.workers.loaderUrl)),s.workers.workerPath?s.workers.workerPath=T$1(s.workers.workerPath):s.workers.workerPath=T$1(a$4("esri/core/workers/RemoteClient.js"));const f=s$4.workers.loaderConfig,c=r({baseUrl:null==f?void 0:f.baseUrl,locale:c$2(),has:{"csp-restrictions":t$2("csp-restrictions"),"dojo-test-sniff":0,"host-webworker":1,...null==f?void 0:f.has},map:{...null==f?void 0:f.map},paths:{...null==f?void 0:f.paths},packages:(null==f?void 0:f.packages)||[]}),u={version:t$3,buildDate:d$1,revision:f$4};return JSON.stringify({esriConfig:s,loaderConfig:c,kernelInfo:u})}let P=0;
  
  /*
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  See https://js.arcgis.com/4.19/esri/copyright.txt for details.
  */
  const b=n$2.getLogger("esri.core.workers"),{ABORT:m$1,INVOKE:_,OPEN:u$1,OPENED:g$1,RESPONSE:j}=e$1;class f$1{constructor(e,t){this._outJobs=new Map,this._inJobs=new Map,this.worker=e,this.id=t,e.addEventListener("message",this._onMessage.bind(this)),e.addEventListener("error",(e=>{e.preventDefault(),b.error(e);}));}static async create(e){const t=await v();return new f$1(t,e)}terminate(){this.worker.terminate();}async open(e,t={}){const{signal:s}=t,r=n$1();return new Promise(((t,n)=>{const a={resolve:t,reject:n,abortHandle:d$3(s,(()=>{this._outJobs.delete(r),this._post({type:m$1,jobId:r});}))};this._outJobs.set(r,a),this._post({type:u$1,jobId:r,modulePath:e});}))}_onMessage(e){const t=f$2(e);if(t)switch(t.type){case g$1:this._onOpenedMessage(t);break;case j:this._onResponseMessage(t);break;case m$1:this._onAbortMessage(t);break;case _:this._onInvokeMessage(t);}}_onAbortMessage(e){const t=this._inJobs,o=e.jobId,s=t.get(o);s&&(s.controller&&s.controller.abort(),t.delete(o));}_onInvokeMessage(e){const{methodName:t,jobId:o,data:i,abortable:l}=e,h=l?a$3():null,c=this._inJobs,p=o$2[t];let b;try{if("function"!=typeof p)throw new TypeError(`${t} is not a function`);b=p.call(null,i,{signal:h?h.signal:null});}catch(m){return void this._post({type:j,jobId:o,error:a$2(m)})}S$1(b)?(c.set(o,{controller:h,promise:b}),b.then((e=>{c.has(o)&&(c.delete(o),this._post({type:j,jobId:o},e));}),(e=>{c.has(o)&&(c.delete(o),e||(e={message:"Error encountered at method"+t}),g$4(e)||this._post({type:j,jobId:o,error:a$2(e||{message:`Error encountered at method ${t}`})}));}))):this._post({type:j,jobId:o},b);}_onOpenedMessage(e){var t;const{jobId:o,data:s}=e,r=this._outJobs.get(o);r&&(this._outJobs.delete(o),null==(t=r.abortHandle)||t.remove(),r.resolve(s));}_onResponseMessage(e){var o;const{jobId:s,error:r,data:n}=e,a=this._outJobs.get(s);a&&(this._outJobs.delete(s),null==(o=a.abortHandle)||o.remove(),r?a.reject(s$2.fromJSON(JSON.parse(r))):a.resolve(n));}_post(e,t,o){return i$1(this.worker,e,t,o)}}
  
  /*
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  See https://js.arcgis.com/4.19/esri/copyright.txt for details.
  */
  let a=t$2("esri-workers-debug")?1:t$2("host-browser")?navigator.hardwareConcurrency-1:0;a||(a=t$2("safari")&&t$2("mac")||t$2("trident")?7:2);let l=0;const c=[];function m(){g();}function f(t,r){return u(t,{client:r})}async function u(t,r){const e=new l$1;return await e.open(t,r),e}async function p(o,i={}){if("string"!=typeof o)throw new s$2("workers:undefined-module","modulePath is missing");let s=i.strategy||"distributed";if(t$2("host-webworker")&&!t$2("esri-workers")&&(s="local"),"local"===s){let t=await J.loadWorker(o);t||(t=await import(
  /* @vite-ignore */
  /* webpackIgnore: true */
  o)),h$2(i.signal);const r=i.client||t;return u([J.connect(t)],{...i,client:r})}if(await g(),h$2(i.signal),"dedicated"===s){const t=l++%a;return u([await c[t].open(o,i)],i)}if(i.maxNumWorkers&&i.maxNumWorkers>0){const t=Math.min(i.maxNumWorkers,a);if(t<a){const r=new Array(t);for(let e=0;e<t;++e){const t=l++%a;r[e]=c[t].open(o,i);}return u(r,i)}}return u(c.map((t=>t.open(o,i))),i)}let h=null;async function g(){if(h)return h;a$3();const t=[];for(let r=0;r<a;r++){const e=f$1.create(r).then((t=>(c[r]=t,t)));t.push(e);}return h=Promise.all(t),h}
  
  export { e$3 as e, f, m, p };
  