@arcgis/core 4.32.0-next.20241227 → 4.32.0-next.20241228

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.
@@ -1 +1 @@
1
- var RemoteClient;(()=>{var e={2131:(e,t,r)=>{r.p=self.esriConfig.assetsPath+"/esri/core/workers/"},90237:(e,t,r)=>{"use strict";function n(e,t,r,n){var s,o=arguments.length,i=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(i=(o<3?s(i):o>3?s(t,r,i):s(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i}function s(e,t){return function(r,n){t(r,n,e)}}function o(e,t,r){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,s;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(s=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");s&&(n=function(){try{s.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}r.d(t,{_:()=>n,a:()=>s,b:()=>o,c:()=>a});var i="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function a(e){function t(t){e.error=e.hasError?new i(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var r,n=0;return function s(){for(;r=e.stack.pop();)try{if(!r.async&&1===n)return n=0,e.stack.push(r),Promise.resolve().then(s);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(o).then(s,(function(e){return t(e),s()}))}else n|=1}catch(e){t(e)}if(1===n)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}},92602:(e,t,r)=>{"use strict";r.d(t,{A:()=>o}),r(44208);var n=r(93637),s=r(18357);const o={apiKey:void 0,applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,n.$N)(o,globalThis.esriConfig,!0),delete o.has),!o.assetsPath){{const e="4.32.0";o.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}-next.${s.$}/assets`}o.defaultAssetsPath=o.assetsPath}},69622:(e,t,r)=>{"use strict";r.d(t,{A:()=>x});var n=r(51447),s=r(71511),o=r(53966),i=r(97768),a=r(56454),c=r(16649),l=r(45873),u=r(96156),f=(r(44208),r(4718)),d=r(93687),h=r(11406),p=r(35666),g=r(62788),y=r(47328),b=r(67867);class m extends h.T{constructor(e,t){super(),this.propertyName=e,this.metadata=t,this.trackingTarget=new b.R(this),this.flags=0,this.flags=y.i.Dirty|(t.nonNullable?y.i.NonNullable:0)|(t.hasOwnProperty("value")?y.i.HasDefaultValue:0)|(void 0===t.get?y.i.DepTrackingInitialized:0)|(void 0===t.dependsOn?y.i.AutoTracked:0)}destroy(){this.flags&y.i.Dirty&&this.onCommitted(),super.destroy(),this.trackingTarget.destroy()}getComputed(e){e.mutable&&(0,g.gc)(this);const t=e.store,r=this.propertyName,n=this.flags,s=t.get(r);if(n&y.i.Computing)return s;if(~n&y.i.Dirty&&t.has(r))return s;this.flags|=y.i.Computing;const o=e.host;let i;n&y.i.AutoTracked?i=(0,g.a)(this.trackingTarget,this.metadata.get,o):((0,g.Xr)(o,this),i=this.metadata.get.call(o)),this.flags|=y.i.DepTrackingInitialized,t.set(r,i,p.Gr.COMPUTED);const a=t.get(r);return a===s?this.flags&=~y.i.Dirty:(0,g.F_)(this.commit,this),this.flags&=~y.i.Computing,a}notifyChange(){this.onInvalidated(),this.onCommitted()}invalidate(){this.onInvalidated()}commit(){this.flags&=~y.i.Dirty,this.onCommitted()}onInvalidated(){~this.flags&y.i.Overridden&&(this.flags|=y.i.Dirty);const e=this._observers;if(e&&e.length>0)for(const t of e)t.onInvalidated()}onCommitted(){const e=this._observers;if(e&&e.length>0){const t=e.slice();for(const e of t)e.onCommitted()}}}class v{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(e){const t=new v;return this._values.forEach(((r,n)=>{e&&e.has(n)||t.set(n,(0,f.o8)(r))})),t}get(e){return this._values.get(e)}originOf(){return p.Gr.USER}keys(){return[...this._values.keys()]}set(e,t){this._values.set(e,t)}delete(e){this._values.delete(e)}has(e){return this._values.has(e)}forEach(e){this._values.forEach(e)}}function _(e,t,r){return void 0!==e}function w(e,t,r,n){return!(void 0===e||null==r&&e.flags&y.i.NonNullable&&(n.lifecycle,l.v.INITIALIZING,1))}class A{constructor(e){this.host=e,this.propertiesByName=new Map,this.ctorArgs=null,this.lifecycle=l.v.INITIALIZING,this.store=new v,this.mutable=!0,this._origin=p.Gr.USER;const t=this.host.constructor.__accessorMetadata__;for(const e in t){const r=new m(e,t[e]);this.propertiesByName.set(e,r)}this.metadata=t}initialize(){this.lifecycle=l.v.CONSTRUCTING}constructed(){this.lifecycle=l.v.CONSTRUCTED}destroy(){this.lifecycle=l.v.DESTROYED,this.propertiesByName.forEach((e=>e.destroy()))}get initialized(){return this.lifecycle!==l.v.INITIALIZING}get(e){const t=this.propertiesByName.get(e);if(t.metadata.get)return t.getComputed(this);this.mutable&&(0,g.gc)(t);const r=this.store;return r.has(e)?r.get(e):t.metadata.value}originOf(e){const t=this.store.originOf(e);if(void 0===t){const t=this.propertiesByName.get(e);if(void 0!==t&&t.flags&y.i.HasDefaultValue)return"defaults"}return(0,p.OL)(t)}has(e){return this.propertiesByName.has(e)&&this.store.has(e)}keys(){return[...this.propertiesByName.keys()]}internalGet(e){const t=this.propertiesByName.get(e);if(_(t))return this.store.has(e)?this.store.get(e):t.metadata.value}internalSet(e,t){const r=this.propertiesByName.get(e);_(r)&&this._internalSet(r,t)}getDependsInfo(e,t,r){const n=this.propertiesByName.get(t);if(!_(n))return"";const s=new b.R,o=(0,g.a)(s,(()=>n.metadata.get?.call(e)));let i=`${r}${e.declaredClass.split(".").pop()}.${t}: ${o}\n`;const a=s.accessed??new Set;if(0===a.size)return i;r+=" ";for(const e of a)e instanceof m&&(i+=`${r}${e.propertyName}: undefined\n`);return i}setAtOrigin(e,t,r){const n=this.propertiesByName.get(e);if(_(n))return this._setAtOrigin(n,t,r)}isOverridden(e){const t=this.propertiesByName.get(e);return void 0!==t&&!!(t.flags&y.i.Overridden)}clearOverride(e){const t=this.propertiesByName.get(e);t&&t.flags&y.i.Overridden&&(t.flags&=~y.i.Overridden,t.notifyChange())}override(e,t){const r=this.propertiesByName.get(e);if(!w(r,0,t,this))return;const n=r.metadata.cast;if(n){const e=this._cast(n,t),{valid:r,value:s}=e;if(O.release(e),!r)return;t=s}r.flags|=y.i.Overridden,this._internalSet(r,t)}set(e,t){const r=this.propertiesByName.get(e);if(!w(r,0,t,this))return;const n=r.metadata.cast;if(n){const e=this._cast(n,t),{valid:r,value:s}=e;if(O.release(e),!r)return;t=s}const s=r.metadata.set;s?s.call(this.host,t):this._internalSet(r,t)}setDefaultOrigin(e){this._origin=(0,p.aB)(e)}getDefaultOrigin(){return(0,p.OL)(this._origin)}notifyChange(e){const t=this.propertiesByName.get(e);void 0!==t&&t.notifyChange()}invalidate(e){const t=this.propertiesByName.get(e);void 0!==t&&t.invalidate()}commit(e){const t=this.propertiesByName.get(e);void 0!==t&&t.commit()}_internalSet(e,t){const r=this.lifecycle!==l.v.INITIALIZING?this._origin:p.Gr.DEFAULTS;this._setAtOrigin(e,t,r)}_setAtOrigin(e,t,r){const n=this.store,s=e.propertyName;n.has(s,r)&&(0,f.aI)(t,n.get(s))&&~e.flags&y.i.Overridden&&r===n.originOf(s)||(e.invalidate(),n.set(s,t,r),e.commit(),(0,g.fE)(this.host,e))}_cast(e,t){const r=O.acquire();return r.valid=!0,r.value=t,e&&(r.value=e.call(this.host,t,r)),r}}const O=new d.A(class{constructor(){this.value=null,this.valid=!0}acquire(){this.valid=!0}release(){this.value=null}});var S=r(47821);var k;!function(e){e[e.Ignore=0]="Ignore",e[e.Destroy=1]="Destroy",e[e.ThrowError=2]="ThrowError"}(k||(k={}));var E,T,N=r(14012),j=r(10107),P=r(40608);function C(e){if(null==e)return{value:e};if(Array.isArray(e))return{type:[e[0]],value:null};switch(typeof e){case"object":return e.constructor?.__accessorMetadata__||e instanceof Date?{type:e.constructor,value:e}:e;case"boolean":return{type:Boolean,value:e};case"string":return{type:String,value:e};case"number":return{type:Number,value:e};case"function":return{type:e,value:null};default:return}}const I=Symbol("Accessor-Handles"),M=Symbol("Accessor-Initialized");class x{static createSubclass(e={}){if(Array.isArray(e))throw new Error("Multi-inheritance unsupported since 4.16");const{properties:t,declaredClass:r,constructor:n}=e;delete e.declaredClass,delete e.properties,delete e.constructor;const s=this;class o extends s{constructor(...e){super(...e),this.inherited=null,n&&n.apply(this,e)}}(0,u.tD)(o.prototype);for(const t in e){const r=e[t];o.prototype[t]="function"==typeof r?function(...e){const n=this.inherited;let o;this.inherited=function(...e){if(s.prototype[t])return s.prototype[t].apply(this,e)};try{o=r.apply(this,e)}catch(e){throw this.inherited=n,e}return this.inherited=n,o}:e[t]}for(const e in t){const r=C(t[e]);(0,j.MZ)(r)(o.prototype,e)}return(0,P.$)(r)(o)}static freeze(e){return e instanceof x?e.__accessor__.mutable=!1:Object.freeze(e),e}static isFrozen(e){return e instanceof x?!e.__accessor__.mutable:Object.isFrozen(e)}constructor(...e){if(this[E]=null,this[T]=!1,this.constructor===x)throw new Error("[accessor] cannot instantiate Accessor. This can be fixed by creating a subclass of Accessor");const t=new A(this);Object.defineProperty(this,"__accessor__",{enumerable:!1,value:t}),e.length>0&&(t.ctorArgs=this.normalizeCtorArgs?.apply(this,e)??e[0])}postscript(){const e=this.__accessor__,t=e.ctorArgs;e.initialize(),t&&(this.set(t),e.ctorArgs=null),e.constructed(),this.initialize(),this[M]=!0}initialize(){}[a.G](){this[I]=(0,i.pR)(this[I])}destroy(){this.destroyed||((0,N.iS)(this),this.__accessor__.destroy())}[Symbol.dispose](){this.destroy()}get constructed(){return this.__accessor__&&this.__accessor__.initialized||!1}get initialized(){return this[M]}get destroyed(){return this.__accessor__?.lifecycle===l.v.DESTROYED||!1}commitProperty(e){(0,c.Jt)(this,e)}hasOwnProperty(e){return this.__accessor__?this.__accessor__.has(e):Object.prototype.hasOwnProperty.call(this,e)}keys(){return this.__accessor__?this.__accessor__.keys():[]}set(e,t){return(0,S.h)(this,e,t),this}watch(e,t,r){return(0,n.eO)(o.A.getLogger(this),"`watch` is deprecated in favor of reactiveUtils.watch",{replacement:"reactiveUtils.watch",version:"4.32",see:"https://developers.arcgis.com/javascript/latest/api-reference/esri-core-reactiveUtils.html#watch",warnOnce:!0}),(0,N.wB)(this,e,t,r)}addHandles(e,t){if(this.destroyed){const t=Array.isArray(e)?e:[e];for(const e of t)e.remove()}else(this[I]??=new s.A).add(e,t)}removeHandles(e){this[I]?.remove(e)}removeAllHandles(){this[I]?.removeAll()}removeHandlesReference(e){this[I]?.removeReference(e)}hasHandles(e){return!0===this[I]?.has(e)}_override(e,t){void 0===t?this.__accessor__.clearOverride(e):this.__accessor__.override(e,t)}_clearOverride(e){return this.__accessor__.clearOverride(e)}_overrideIfSome(e,t){null==t?this.__accessor__.clearOverride(e):this.__accessor__.override(e,t)}_isOverridden(e){return this.__accessor__.isOverridden(e)}notifyChange(e){this.__accessor__.notifyChange(e)}_get(e){return this.__accessor__.internalGet(e)}_set(e,t){return this.__accessor__.internalSet(e,t),this}}E=I,T=M},98291:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(93687);function s(e){e.length=0}class o{constructor(e=50,t=50){this._pool=new n.A(Array,void 0,s,t,e)}acquire(){return this._pool.acquire()}release(e){this._pool.release(e)}prune(){this._pool.prune(0)}static acquire(){return i.acquire()}static release(e){return i.release(e)}static prune(){i.prune()}}const i=new o(100)},49186:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(4718),s=r(53966),o=r(79907);class i extends o.A{constructor(e,t,r){super(e,t,r)}toJSON(){if(null!=this.details)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,((e,t)=>{if(t&&"object"==typeof t&&"function"==typeof t.toJSON)return t;try{return(0,n.o8)(t)}catch(e){return"[object]"}})))}}catch(e){throw s.A.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new i(e.name,e.message,e.details)}}i.prototype.type="error"},71511:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(5479);class s{constructor(){this._groups=new Map}destroy(){this.removeAll()}get size(){let e=0;return this._groups.forEach((t=>{e+=t.length})),e}add(e,t){if((0,n.xZ)(e)){const r=this._getOrCreateGroup(t);for(const t of e)a(t)&&r.push(t)}else a(e)&&this._getOrCreateGroup(t).push(e);return this}forEach(e,t){if("function"==typeof e)this._groups.forEach((t=>t.forEach(e)));else{const r=this._getGroup(e);r&&t&&r.forEach(t)}}has(e){return this._groups.has(o(e))}remove(e){if("string"!=typeof e&&(0,n.xZ)(e)){for(const t of e)this.remove(t);return this}return this.has(e)?(i(this._getGroup(e)),this._groups.delete(o(e)),this):this}removeAll(){return this._groups.forEach(i),this._groups.clear(),this}removeReference(e){return this._groups.delete(e),this}_getOrCreateGroup(e){if(this.has(e))return this._getGroup(e);const t=[];return this._groups.set(o(e),t),t}_getGroup(e){return this._groups.get(o(e))}}function o(e){return e||"_default_"}function i(e){for(const t of e)t instanceof s?t.removeAll():t.remove()}function a(e){return null!=e&&(!!e.remove||e instanceof s)}},25482:(e,t,r)=>{"use strict";r.d(t,{A:()=>m});var n=r(90237),s=r(69622),o=r(4718),i=r(35666);class a{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(e){const t=new a;return this._values.forEach(((r,n)=>{e&&e.has(n)||t.set(n,(0,o.o8)(r.value),r.origin)})),t}get(e,t){t=this._normalizeOrigin(t);const r=this._values.get(e);return null==t||r?.origin===t?r?.value:void 0}originOf(e){return this._values.get(e)?.origin??i.Gr.USER}keys(e){e=this._normalizeOrigin(e);const t=[...this._values.keys()];return null==e?t:t.filter((t=>this._values.get(t)?.origin===e))}set(e,t,r){if((r=this._normalizeOrigin(r))===i.Gr.DEFAULTS){const t=this._values.get(e);if(null!=t?.origin&&t.origin>r)return}this._values.set(e,new c(t,r))}delete(e,t){null!=(t=this._normalizeOrigin(t))&&this._values.get(e)?.origin!==t||this._values.delete(e)}has(e,t){return null!=(t=this._normalizeOrigin(t))?this._values.get(e)?.origin===t:this._values.has(e)}forEach(e){this._values.forEach((({value:t},r)=>e(t,r)))}_normalizeOrigin(e){if(null!=e)return e===i.Gr.DEFAULTS?e:i.Gr.USER}}class c{constructor(e,t){this.value=e,this.origin=t}}var l=r(76953),u=r(45917),f=r(88620),d=r(49422),h=r(40608);const p=e=>{let t=class extends e{constructor(...e){super(...e);const t=(0,f.oY)(this),r=t.store,n=new a;t.store=n,(0,l.k)(t,r,n)}read(e,t){(0,u.L)(this,e,t)}write(e,t){return(0,d.M)(this,e??{},t)}toJSON(e){return this.write({},e)}static fromJSON(e,t){return g.call(this,e,t)}};return t=(0,n._)([(0,h.$)("esri.core.JSONSupport")],t),t.prototype.toJSON.isDefaultToJSON=!0,t};function g(e,t){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");const r=new this;return r.read(e,t),r}let y=class extends(p(s.A)){};var b;y=(0,n._)([(0,h.$)("esri.core.JSONSupport")],y),(b=y||(y={})).JSONSupportMixin=p,b.isSerializable=function(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON};const m=y},53966:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(92602),s=(r(44208),r(799));const o={info:0,warn:1,error:2,none:3};class i{constructor(e){this.level=null,this._module="",this._parent=null,this.writer=null,this._loggedMessages={error:new Map,warn:new Map,info:new Map},null!=e.level&&(this.level=e.level),null!=e.writer&&(this.writer=e.writer),this._module=e.module,i._loggers.set(this.module,this);const t=this.module.lastIndexOf(".");-1!==t&&(this._parent=i.getLogger(this.module.slice(0,t)))}get module(){return this._module}get parent(){return this._parent}error(...e){this._log("error","always",...e)}warn(...e){this._log("warn","always",...e)}info(...e){this._log("info","always",...e)}errorOnce(...e){this._log("error","once",...e)}warnOnce(...e){this._log("warn","once",...e)}infoOnce(...e){this._log("info","once",...e)}errorOncePerTick(...e){this._log("error","oncePerTick",...e)}warnOncePerTick(...e){this._log("warn","oncePerTick",...e)}infoOncePerTick(...e){this._log("info","oncePerTick",...e)}get test(){}static get test(){}static getLogger(e){return e="string"!=typeof e?e.declaredClass:e,i._loggers.get(e)||new i({module:e})}_log(e,t,...r){if(this._matchLevel(e)){if("always"!==t&&!i._throttlingDisabled){const n=function(...e){return(0,s.Wm)(JSON.stringify(e,((e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]")))}(r),o=this._loggedMessages[e].get(n);if("once"===t&&null!=o||"oncePerTick"===t&&o&&o>=i._tickCounter)return;this._loggedMessages[e].set(n,i._tickCounter),i._scheduleTickCounterIncrement()}for(const t of n.A.log.interceptors)if(t(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,t){let r=this;for(;null!=r;){const t=r[e];if(null!=t)return t;r=r.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",a)}_matchLevel(e){const t=n.A.log.level||"warn";return o[this._parentWithMember("level",t)]<=o[e]}static _scheduleTickCounterIncrement(){i._tickCounterScheduled||(i._tickCounterScheduled=!0,Promise.resolve().then((()=>{i._tickCounter++,i._tickCounterScheduled=!1})))}}function a(e,t,...r){console[e](`[${t}]`,...r)}i._loggers=new Map,i._tickCounter=0,i._tickCounterScheduled=!1,i._throttlingDisabled=!1},91869:(e,t,r)=>{"use strict";function n(e,t){for(const r of e.values())if(t(r))return!0;return!1}function s(e,t,r){const n=e.get(t);if(void 0!==n)return n;const s=r();return e.set(t,s),s}function o(e){const t=new Map;return r=>(t.has(r)||t.set(r,e(r)),t.get(r))}r.d(t,{Bj:()=>o,Bs:()=>n,tE:()=>s})},79907:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(93637);class s{constructor(e,t,r=void 0){this.name=e,this.details=r,this.message=(t&&function(e,t){return e.replaceAll(/\$\{([^\s:}]*)(?::([^\s:}]+))?\}/g,((e,r)=>""===r?"$":((0,n.wc)(r,t)??"").toString()))}(t,r))??""}toString(){return"["+this.name+"]: "+this.message}}},93687:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});class n{constructor(e,t,r,n=1,s=0){this._ctor=e,this._acquireFunction=t,this._releaseFunction=r,this.allocationSize=n,this._pool=new Array(s),this._initialSize=s;for(let e=0;e<s;e++)this._pool[e]=new this._ctor;this.allocationSize=Math.max(n,1)}destroy(){this.prune(0)}acquire(...e){let t;if(n.test.disabled)t=new this._ctor;else{if(0===this._pool.length){const e=this.allocationSize;for(let t=0;t<e;t++)this._pool[t]=new this._ctor}t=this._pool.pop()}return this._acquireFunction?this._acquireFunction(t,...e):function(e){return e?.acquire&&"function"==typeof e.acquire}(t)&&t.acquire(...e),t}release(e){var t;e&&!n.test.disabled&&(this._releaseFunction?this._releaseFunction(e):(t=e,t?.release&&"function"==typeof t.release&&e.release()),this._pool.push(e))}prune(e=this._initialSize){if(!(e>=this._pool.length)){for(let t=e;t<this._pool.length;++t){const e=this._pool[t];this._dispose(e)}this._pool.length=e}}_dispose(e){e.dispose&&"function"==typeof e.dispose&&e.dispose()}}n.test={disabled:!1}},61604:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});class n{constructor(e,t=30){this.name=e,this._counter=0,this._samples=new Array(t)}push(e){null!=e&&(this._samples[++this._counter%this._samples.length]=e)}set(e){null!=e&&(this._samples[this._counter%this._samples.length]=e)}get median(){return this._samples.slice().sort(((e,t)=>e-t))[Math.floor(this._samples.length/2)]}get average(){return this._samples.reduce(((e,t)=>e+t),0)/this._samples.length}get last(){return this._samples[this._counter%this._samples.length]}}},3694:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n,s=r(4576);!function(e){const t=(e,t,r,n)=>{let s=t,o=t;const i=r>>>1,a=e[s-1];for(;o<=i;){o=s<<1,o<r&&n(e[o-1],e[o])<0&&++o;const t=e[o-1];if(n(t,a)<=0)break;e[s-1]=t,s=o}e[s-1]=a},r=(e,t)=>e<t?-1:e>t?1:0;e.sort=function(e,n,s,o){void 0===n&&(n=0),void 0===s&&(s=e.length),void 0===o&&(o=r);for(let r=s>>>1;r>n;r--)t(e,r,s,o);const i=n+1;for(let r=s-1;r>n;r--){const s=e[n];e[n]=e[r],e[r]=s,t(e,i,r,o)}},e.iterableSort=function*(e,n,s,o){void 0===n&&(n=0),void 0===s&&(s=e.length),void 0===o&&(o=r);for(let r=s>>>1;r>n;r--)t(e,r,s,o),yield;const i=n+1;for(let r=s-1;r>n;r--){const s=e[n];e[n]=e[r],e[r]=s,t(e,i,r,o),yield}}}(n||(n={}));const o=n;class i{constructor(e){this.data=[],this._length=0,this._allocator=void 0,this._deallocator=()=>null,this._shrink=()=>{},this._hint=new s.vW,e&&(e.initialSize&&(this.data=new Array(e.initialSize)),e.allocator&&(this._allocator=e.allocator),void 0!==e.deallocator&&(this._deallocator=e.deallocator),e.shrink&&(this._shrink=()=>a(this)))}toArray(){return this.data.slice(0,this.length)}filter(e){const t=new Array;for(let r=0;r<this._length;r++){const n=this.data[r];e(n)&&t.push(n)}return t}at(e){if((e=Math.trunc(e)||0)<0&&(e+=this._length),!(e<0||e>=this._length))return this.data[e]}includes(e,t){const r=this.data.indexOf(e,t);return-1!==r&&r<this.length}get length(){return this._length}set length(e){if(e>this._length){if(this._allocator){for(;this._length<e;)this.data[this._length++]=this._allocator(this.data[this._length]);return}this._length=e}else{if(this._deallocator)for(let t=e;t<this._length;++t)this.data[t]=this._deallocator(this.data[t]);this._length=e,this._shrink()}}clear(){this.length=0}prune(){this.clear(),this.data=[]}push(e){this.data[this._length++]=e}pushArray(e,t=e.length){for(let r=0;r<t;r++)this.data[this._length++]=e[r]}fill(e,t){for(let r=0;r<t;r++)this.data[this._length++]=e}pushNew(){this._allocator&&(this.data[this.length]=this._allocator(this.data[this.length]));const e=this.data[this._length];return++this._length,e}unshift(e){this.data.unshift(e),this._length++,a(this)}pop(){if(0===this.length)return;const e=this.data[this.length-1];return this.length=this.length-1,this._shrink(),e}remove(e){const t=(0,s.qh)(this.data,e,this.length,this._hint);if(-1!==t)return this.data.splice(t,1),this.length=this.length-1,e}removeUnordered(e){return this.removeUnorderedIndex((0,s.qh)(this.data,e,this.length,this._hint))}removeUnorderedIndex(e){if(!(e>=this.length||e<0))return this.swapElements(e,this.length-1),this.pop()}removeUnorderedMany(e,t=e.length,r){this.length=(0,s.mW)(this.data,e,this.length,t,this._hint,r),this._shrink()}front(){if(0!==this.length)return this.data[0]}back(){if(0!==this.length)return this.data[this.length-1]}swapElements(e,t){if(e>=this.length||t>=this.length||e===t)return;const r=this.data[e];this.data[e]=this.data[t],this.data[t]=r}sort(e){o.sort(this.data,0,this.length,e)}iterableSort(e){return o.iterableSort(this.data,0,this.length,e)}some(e,t){for(let r=0;r<this.length;++r)if(e.call(t,this.data[r],r,this.data))return!0;return!1}find(e,t){const{data:r,length:n}=this;for(let s=0;s<n;++s)if(e.call(t,r[s]))return r[s]}filterInPlace(e,t){let r=0;for(let n=0;n<this._length;++n){const s=this.data[n];e.call(t,s,n,this.data)&&(this.data[n]=this.data[r],this.data[r]=s,r++)}if(this._deallocator)for(let e=r;e<this._length;e++)this.data[e]=this._deallocator(this.data[e]);return this._length=r,this._shrink(),this}forAll(e,t){const{data:r,length:n}=this;for(let s=0;s<n;++s)e.call(t,r[s],s,r)}forEach(e,t){this.data.slice(0,this.length).forEach(e,t)}map(e,t){const r=new Array(this.length);for(let n=0;n<this.length;++n)r[n]=e.call(t,this.data[n],n,this.data);return r}reduce(e,t){let r=t;for(let t=0;t<this.length;++t)r=e(r,this.data[t],t,this.data);return r}has(e){const t=this.length,r=this.data;for(let n=0;n<t;++n)if(r[n]===e)return!0;return!1}*[Symbol.iterator](){for(let e=0;e<this.length;e++)yield this.data[e]}}function a(e){e.data.length>1.5*e.length&&(e.data.length=Math.floor(1.1*e.length))}},87811:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});class n{constructor(e=1){this._seed=e}set seed(e){this._seed=e??Math.random()*n._m}getInt(){return this._seed=(n._a*this._seed+n._c)%n._m,this._seed}getFloat(){return this.getInt()/(n._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const r=t-e;return e+this.getInt()/n._m*r}}n._m=2147483647,n._a=48271,n._c=0},67076:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(79907);class s extends n.A{constructor(e,t,r){super(e,t,r)}}s.prototype.type="warning"},11406:(e,t,r)=>{"use strict";r.d(t,{T:()=>i});var n=r(36563),s=r(4576);class o{constructor(e,t){this._observers=e,this._observer=t}remove(){(0,s.TF)(this._observers,this._observer)}}class i{constructor(){this._observers=null,this.destroyed=!1}observe(e){if(this.destroyed||e.destroyed)return a;null==this._observers&&(this._observers=[]);const t=this._observers;let r=!1,n=!1;const s=t.length;for(let o=0;o<s;++o){const s=t[o];if(s.destroyed)n=!0;else if(s===e){r=!0;break}}return r||(t.push(e),n&&this._removeDestroyedObservers()),new o(t,e)}_removeDestroyedObservers(){const e=this._observers;if(!e||0===e.length)return;const t=e.length;let r=0;for(let n=0;n<t;++n){for(;n+r<t&&e[n+r].destroyed;)++r;if(r>0){if(!(n+r<t))break;e[n]=e[n+r]}}e.length=t-r}destroy(){if(this.destroyed)return;this.destroyed=!0;const e=this._observers;if(null!=e){for(const t of e)t.onCommitted();this._observers=null}}}const a=(0,n.hA)()},35666:(e,t,r)=>{"use strict";var n;r.d(t,{AU:()=>s,Gr:()=>n,OL:()=>i,aB:()=>o,in:()=>a}),function(e){e[e.DEFAULTS=0]="DEFAULTS",e[e.COMPUTED=1]="COMPUTED",e[e.SERVICE=2]="SERVICE",e[e.PORTAL_ITEM=3]="PORTAL_ITEM",e[e.WEB_SCENE=4]="WEB_SCENE",e[e.WEB_MAP=5]="WEB_MAP",e[e.LINK_CHART=6]="LINK_CHART",e[e.USER=7]="USER"}(n||(n={}));const s=n.USER+1;function o(e){switch(e){case"defaults":return n.DEFAULTS;case"service":return n.SERVICE;case"portal-item":return n.PORTAL_ITEM;case"web-scene":return n.WEB_SCENE;case"web-map":return n.WEB_MAP;case"link-chart":return n.LINK_CHART;case"user":return n.USER;default:return null}}function i(e){switch(e){case n.DEFAULTS:return"defaults";case n.SERVICE:return"service";case n.PORTAL_ITEM:return"portal-item";case n.WEB_SCENE:return"web-scene";case n.WEB_MAP:return"web-map";case n.LINK_CHART:return"link-chart";case n.USER:return"user"}}function a(e){return i(e)}},56454:(e,t,r)=>{"use strict";r.d(t,{G:()=>n});const n=Symbol("Accessor-beforeDestroy")},10107:(e,t,r)=>{"use strict";r.d(t,{MZ:()=>c,rM:()=>l});var n=r(53966),s=r(56507),o=r(16649),i=r(96156),a=r(47821);function c(e={}){return(t,r)=>{if(t===Function.prototype)throw new Error(`Inappropriate use of @property() on a static field: ${t.name}.${r}. Accessor does not support static properties.`);const c=Object.getOwnPropertyDescriptor(t,r),l=(0,i.z4)(t,r);c&&(c.get||c.set?(l.get=c.get||l.get,l.set=c.set||l.set):"value"in c&&("value"in e&&n.A.getLogger("esri.core.accessorSupport.decorators.property").warn(`@property() will redefine the value of "${r}" on "${t.constructor.name}" already defined in the metadata`,e),l.value=e.value=c.value)),null!=e.readOnly&&(l.readOnly=e.readOnly);const u=e.aliasOf;if(u){const e="string"==typeof u?u:u.source,t="string"==typeof u?null:!0===u.overridable;let n;l.dependsOn=[e],l.get=function(){let t=(0,o.Jt)(this,e);if("function"==typeof t){n||(n=e.split(".").slice(0,-1).join("."));const r=(0,o.Jt)(this,n);r&&(t=t.bind(r))}return t},l.readOnly||(l.set=t?function(e){this._override(r,e)}:function(t){(0,a.h)(this,e,t)})}const f=e.type,d=e.types;if(!l.cast){let t;f?t=function(e){let t=0,r=e;if((0,s.Zu)(e))return(0,s.Nd)(e);for(;Array.isArray(r)&&1===r.length&&"string"!=typeof r[0]&&"number"!=typeof r[0];)r=r[0],t++;const n=r;if((0,s.EK)(n))return 0===t?(0,s.MB)(n):(0,s._e)((0,s.MB)(n),t);if(1===t)return(0,s.eC)(n);if(t>1)return(0,s.e6)(n,t);const o=e;return o.from?o.from:(0,s.dp)(o)}(f):d&&(t=Array.isArray(d)?(0,s.wB)((0,s.aq)(d[0])):(0,s.aq)(d)),e.cast=function(e,t){if(e||t)return e?t?(r,n)=>t(e(r,n),n):e:t}(e.cast,t)}(0,i.CX)(l,e),e.range&&(l.cast=(0,s.Qp)(l.cast,e.range))}}function l(e,t,r){const n=(0,i.z4)(e,r);n.json||(n.json={});let s=n.json;return void 0!==t&&(s.origins||(s.origins={}),s.origins[t]||(s.origins[t]={}),s=s.origins[t]),s}},40608:(e,t,r)=>{"use strict";r.d(t,{$:()=>f}),r(44208);var n=r(53966),s=r(56454),o=r(45873),i=r(96156),a=r(62788),c=r(51822);const l=new Set,u=new Set;function f(e){return t=>{e??="esri.core.Accessor",t.prototype.declaredClass=e,h(t);const r=[],n=[];let o=t.prototype;for(;o;)o.hasOwnProperty("initialize")&&!l.has(o.initialize)&&(l.add(o.initialize),r.push(o.initialize)),o.hasOwnProperty("destroy")&&!u.has(o.destroy)&&(u.add(o.destroy),n.push(o.destroy)),o=Object.getPrototypeOf(o);l.clear(),u.clear();const a=class extends t{constructor(...e){if(super(...e),this.constructor===a&&"function"==typeof this.postscript){if(r.length&&Object.defineProperty(this,"initialize",{enumerable:!1,configurable:!0,value(){for(let e=r.length-1;e>=0;e--)r[e].call(this)}}),n.length){let e=!1;const t=this[s.G];Object.defineProperty(this,"destroy",{enumerable:!1,configurable:!0,value(){if(!e){e=!0,t.call(this);for(let e=0;e<n.length;e++)n[e].call(this)}}})}Object.defineProperty(this,Symbol.dispose,{enumerable:!1,configurable:!0,value(){this.destroy()}}),this.postscript()}}};a.__accessorMetadata__=(0,i.tD)(t.prototype),a.prototype.declaredClass=e;const c=(e||"AccessorSubclass").split(".").slice(-1)[0];return Object.defineProperty(a,"name",{value:c,configurable:!0}),a}}function d(e,t){return null==t.get?function(){const t=this.__accessor__,r=t.propertiesByName.get(e);if(void 0===r)return;t.mutable&&(0,a.gc)(r);const n=t.store;return n.has(e)?n.get(e):r.metadata.value}:function(){const t=this.__accessor__,r=t.propertiesByName.get(e);if(void 0!==r)return r.getComputed(t)}}function h(e){const t=e.prototype,r=(0,i.tD)(t),n={};for(const e of Object.getOwnPropertyNames(r)){const t=r[e];(0,c.qk)(t),n[e]={enumerable:!0,configurable:!0,get:d(e,t),set(r){const n=this.__accessor__;if(void 0!==n){if(n.mutable)return n.initialized&&t.readOnly?p("read-only",e):n.lifecycle===o.v.CONSTRUCTED&&t.constructOnly?p("construct-only",e):void n.set(e,r)}else Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:r})}}}Object.defineProperties(e.prototype,n)}const p=(e,t)=>{n.A.getLogger("esri.core.Accessor").error(`cannot assign to ${e} property '${t}'`)}},76953:(e,t,r)=>{"use strict";r.d(t,{k:()=>s});var n=r(35666);function s(e,t,r){t.keys().forEach((e=>{r.set(e,t.get(e),n.Gr.DEFAULTS)}));const s=e.metadata;Object.keys(s).forEach((t=>{e.internalGet(t)&&r.set(t,e.internalGet(t),n.Gr.DEFAULTS)}))}},56507:(e,t,r)=>{"use strict";r.d(t,{EK:()=>T,GB:()=>l,GX:()=>c,MB:()=>N,Nd:()=>x,PZ:()=>m,Qp:()=>d,Uv:()=>C,Vr:()=>u,Zu:()=>M,_e:()=>k,aq:()=>j,dp:()=>w,e6:()=>E,eC:()=>O,gK:()=>I,jz:()=>P,wB:()=>A}),r(44208);var n=r(53966),s=r(91869);const o=()=>n.A.getLogger("esri.core.accessorSupport.ensureTypes");function i(e){return null==e?e:new Date(e)}function a(e){return null==e?e:!!e}function c(e){return null==e?e:e.toString()}function l(e,t=0){return null==e?e:(e=parseFloat(e),isNaN(e)?t:e)}function u(e){return null==e?e:Math.round(parseFloat(e))}function f(e){return null}function d(e,t){return r=>{let n=e(r);return null!=t.step&&(n=Math.round(n/t.step)*t.step),null!=t.min&&(n=Math.max(t.min,n)),null!=t.max&&(n=Math.min(t.max,n)),n}}function h(e){return e?.constructor&&void 0!==e.constructor.__accessorMetadata__}function p(e,t){return null!=t&&e&&!(t instanceof e)}function g(e){return e&&"isCollection"in e}function y(e){return e?.Type?"function"==typeof e.Type?e.Type:e.Type.base:null}function b(e,t){return!!h(t)&&(o().error("Accessor#set","Assigning an instance of '"+(t.declaredClass||"unknown")+"' which is not a subclass of '"+v(e)+"'"),!0)}function m(e,t){return null==t?t:g(e)?function(e,t){if(!t?.constructor||!g(t.constructor))return b(e,t)?t:new e(t);const r=y(e.prototype.itemType),n=y(t.constructor.prototype.itemType);return r?n?r===n?t:r.prototype.isPrototypeOf(n.prototype)?new e(t):(b(e,t),t):new e(t):t}(e,t):p(e,t)?b(e,t)?t:new e(t):t}function v(e){return e?.prototype?.declaredClass||"unknown"}const _=new WeakMap;function w(e,t){const r=function(e){switch(e){case Number:return e=>l(e);case P:return u;case Boolean:return a;case String:return c;case Date:return i;case C:return f;default:return(0,s.tE)(_,e,(()=>m.bind(null,e)))}}(e);return 1===arguments.length?r:r(t)}function A(e,t,r){return 1===arguments.length?A.bind(null,e):t?Array.isArray(t)?t.map((t=>e(t,r))):[e(t,r)]:t}function O(e,t){return 1===arguments.length?A((t=>w(e,t))):A((t=>w(e,t)),t)}function S(e,t,r){return 0!==t&&Array.isArray(r)?r.map((r=>S(e,t-1,r))):e(r)}function k(e,t,r){if(2===arguments.length)return r=>k(e,t,r);if(!r)return r;r=S(e,t,r);let n=t,s=r;for(;n>0&&Array.isArray(s);)n--,s=s[0];if(void 0!==s)for(let e=0;e<n;e++)r=[r];return r}function E(e,t,r){return 2===arguments.length?k((t=>w(e,t)),t):k((t=>w(e,t)),t,r)}function T(e){return!!Array.isArray(e)&&!e.some((t=>{const r=typeof t;return!("string"===r||"number"===r||"function"===r&&e.length>1)}))}function N(e,t){if(2===arguments.length)return N(e).call(null,t);const r=new Set,n=e.filter((e=>"function"!=typeof e)),s=e.filter((e=>"function"==typeof e));for(const t of e)"string"!=typeof t&&"number"!=typeof t||r.add(t);let i=null,a=null;return(e,t)=>{if(null==e)return e;const c=typeof e,l="string"===c||"number"===c;return l&&(r.has(e)||s.some((e=>"string"===c&&e===String||"number"===c&&e===Number)))||"object"===c&&s.some((t=>!p(e,t)))?e:(l&&n.length?(i||(i=n.map((e=>"string"==typeof e?`'${e}'`:`${e}`)).join(", ")),o().error("Accessor#set",`'${e}' is not a valid value for this property, only the following values are valid: ${i}`)):"object"==typeof e&&s.length?(a||(a=s.map((e=>v(e))).join(", ")),o().error("Accessor#set",`'${e}' is not a valid value for this property, value must be one of ${a}`)):o().error("Accessor#set",`'${e}' is not a valid value for this property`),t&&(t.valid=!1),null)}}function j(e,t){if(2===arguments.length)return j(e).call(null,t);const r={},n=[],s=[];for(const t in e.typeMap){const o=e.typeMap[t];r[t]=w(o),n.push(v(o)),s.push(t)}const i=()=>`'${n.join("', '")}'`,a=()=>`'${s.join("', '")}'`,c="string"==typeof e.key?t=>t[e.key]:e.key;return t=>{if(e.base&&!p(e.base,t))return t;if(null==t)return t;const n=c(t)||e.defaultKeyValue,s=r[n];if(!s)return o().error("Accessor#set",`Invalid property value, value needs to be one of ${i()}, or a plain object that can autocast (having .type = ${a()})`),null;if(!p(e.typeMap[n],t))return t;if("string"==typeof e.key&&!h(t)){const r={};for(const n in t)n!==e.key&&(r[n]=t[n]);return s(r)}return s(t)}}class P{}class C{}const I={native:e=>({type:"native",value:e}),array:e=>({type:"array",value:e}),oneOf:e=>({type:"one-of",values:e})};function M(e){if(!e||!("type"in e))return!1;switch(e.type){case"native":case"array":case"one-of":return!0}return!1}function x(e){switch(e.type){case"native":return w(e.value);case"array":return A(x(e.value));case"one-of":return function(e){let t=null;return(r,n)=>R(r,e)?r:(null==t&&(t=$(e)),o().error("Accessor#set",`Invalid property value, value needs to be of type ${t}`),n&&(n.valid=!1),null)}(e);default:return null}}function $(e){switch(e.type){case"native":switch(e.value){case Number:return"number";case String:return"string";case Boolean:return"boolean";case P:return"integer";case Date:return"date";case C:return"null";default:return v(e.value)}case"array":return`array of ${$(e.value)}`;case"one-of":{const t=e.values.map((e=>$(e)));return`one of ${t.slice(0,-1)} or ${t[t.length-1]}`}}return"unknown"}function R(e,t){if(null==e)return!0;switch(t.type){case"native":switch(t.value){case Number:case P:return"number"==typeof e;case Boolean:return"boolean"==typeof e;case String:return"string"==typeof e;case C:return null===e}return e instanceof t.value;case"array":return!!Array.isArray(e)&&!e.some((e=>!R(e,t.value)));case"one-of":return t.values.some((t=>R(e,t)))}}},51822:(e,t,r)=>{"use strict";r.d(t,{xF:()=>u,N5:()=>f,k4:()=>d,qk:()=>b});var n=r(56507),s=r(90360);function o(e){if(e.json||(e.json={}),a(e.json),c(e.json),i(e.json),e.json.origins)for(const t in e.json.origins)a(e.json.origins[t]),c(e.json.origins[t]),i(e.json.origins[t]);return!0}function i(e){e.name&&(e.read&&"object"==typeof e.read?void 0===e.read.source&&(e.read.source=e.name):e.read={source:e.name},e.write&&"object"==typeof e.write?void 0===e.write.target&&(e.write.target=e.name):e.write={target:e.name})}function a(e){"boolean"==typeof e.read?e.read={enabled:e.read}:"function"==typeof e.read?e.read={enabled:!0,reader:e.read}:e.read&&"object"==typeof e.read&&void 0===e.read.enabled&&(e.read.enabled=!0)}function c(e){"boolean"==typeof e.write?e.write={enabled:e.write}:"function"==typeof e.write?e.write={enabled:!0,writer:e.write}:e.write&&"object"==typeof e.write&&void 0===e.write.enabled&&(e.write.enabled=!0)}var l=r(67124);function u(e,t){return h(e,"any",t?.origin)}function f(e,t){return h(e,"read",t?.origin)}function d(e,t){return h(e,"write",t?.origin)}function h(e,t,r){let n=e?.json;if(n?.origins&&r){let e;e="link-chart"===r?n.origins[r]&&("any"===t||t in n.origins[r])?n.origins[r]:n.origins["web-map"]:n.origins[r],e&&("any"===t||t in e)&&(n=e)}return n}function p(e){return e.type?g(e):y(e)}function g(e){if(!e.type)return;let t=0,r=e.type;for(;Array.isArray(r)&&!(0,n.EK)(r);)r=r[0],t++;return{type:r,ndimArray:t}}function y(e){if(!e.types)return;let t=0,r=e.types;for(;Array.isArray(r);)r=r[0],t++;return{types:r,ndimArray:t}}function b(e){o(e)&&(function(e){if(e.json&&e.json.origins){const t=e.json.origins,r={"web-document":["web-scene","web-map"]};for(const e in r)if(t[e]){const n=t[e];r[e].forEach((e=>{t[e]=n})),delete t[e]}}}(e),function(e){const t=function(e){return e.json.types?y(e.json):e.type?g(e):y(e)}(e);if(e.json.origins)for(const r in e.json.origins){const n=e.json.origins[r],o=n.types?p(n):t;(0,s.v)(o,n,!1),n.types&&!n.write&&e.json.write?.enabled&&(n.write={...e.json.write}),(0,l.v)(o,n)}(0,s.v)(t,e.json,!0),(0,l.v)(t,e.json)}(e))}},90360:(e,t,r)=>{"use strict";r.d(t,{C:()=>u,v:()=>l});var n=r(53966),s=r(93637),o=r(67076),i=r(96156),a=r(15903);const c=()=>n.A.getLogger("esri.core.accessorSupport.extensions.serializableProperty.reader");function l(e,t,r){e&&(!r&&!t.read||t.read?.reader||!1===t.read?.enabled||function(e){return"types"in e?y(e.types):g(e.type)}(e)&&(0,s.sM)("read.reader",u(e),t))}function u(e){const t=e.ndimArray??0;if(t>1)return function(e){const t=f(e),r=d.bind(null,t),n=e.ndimArray??0;return(e,t,s)=>{if(null==e)return e;e=r(e,s,n);let o=n,i=e;for(;o>0&&Array.isArray(i);)o--,i=i[0];if(void 0!==i)for(let t=0;t<o;t++)e=[e];return e}}(e);if(1===t)return h(e);if("type"in e&&p(e.type)){const t=e.type.prototype?.itemType?.Type,r=h("function"==typeof t?{type:t}:{types:t});return(t,n,s)=>{const o=r(t,n,s);return o?new e.type(o):o}}return f(e)}function f(e){return"type"in e?function(e){return e.prototype.read?(t,r,n)=>{if(null==t)return t;const s=typeof t;if("object"!==s)return void c().error(`Expected JSON value of type 'object' to deserialize type '${e.prototype.declaredClass}', but got '${s}'`);const o=new e;return o.read(t,n),o}:e.fromJSON}(e.type):function(e){let t=null;const r=e.errorContext??"type",n=e.validate;return(s,a,l)=>{if(null==s)return s;const u=typeof s;if("object"!==u)return void c().error(`Expected JSON value of type 'object' to deserialize, but got '${u}'`);t||(t=function(e){const t={};for(const r in e.typeMap){const n=e.typeMap[r],s=(0,i.tD)(n.prototype);if("function"==typeof e.key)continue;const o=s[e.key];if(!o)continue;if(o.json?.type&&Array.isArray(o.json.type)&&1===o.json.type.length&&"string"==typeof o.json.type[0]){t[o.json.type[0]]=n;continue}const a=o.json?.write;if(!a?.writer){t[r]=n;continue}const c=a.target,l="string"==typeof c?c:e.key,u={};a.writer(r,u,l),u[l]&&(t[u[l]]=n)}return t}(e));const f=e.key;if("string"!=typeof f)return;const d=s[f],h=d?t[d]:e.defaultKeyValue?e.typeMap[e.defaultKeyValue]:void 0;if(!h){const e=`Type '${d||"unknown"}' is not supported`;return l?.messages&&s&&l.messages.push(new o.A(`${r}:unsupported`,e,{definition:s,context:l})),void c().error(e)}const p=new h;return p.read(s,l),n?n(p):p}}(e.types)}function d(e,t,r,n){return 0!==n&&Array.isArray(t)?t.map((t=>d(e,t,r,n-1))):e(t,void 0,r)}function h(e){const t=f(e);return(e,r,n)=>{if(null==e)return e;if(Array.isArray(e)){const r=[];for(const s of e){const e=t(s,void 0,n);void 0!==e&&r.push(e)}return r}const s=t(e,void 0,n);return void 0!==s?[s]:void 0}}function p(e){if(!(0,a.P)(e))return!1;const t=e.prototype.itemType;return!(!t||!t.Type)&&("function"==typeof t.Type?g(t.Type):y(t.Type))}function g(e){return!Array.isArray(e)&&!!e&&e.prototype&&("read"in e.prototype||"fromJSON"in e||p(e))}function y(e){for(const t in e.typeMap)if(!g(e.typeMap[t]))return!1;return!0}},15903:(e,t,r)=>{"use strict";function n(e){return!!e&&e.prototype?.declaredClass&&0===e.prototype.declaredClass.indexOf("esri.core.Collection")}r.d(t,{P:()=>n})},67124:(e,t,r)=>{"use strict";r.d(t,{B:()=>f,v:()=>a});var n=r(49186),s=r(53966),o=r(93637),i=r(15903);function a(e,t){if(!t.write||t.write.writer||!1===t.write.enabled&&!t.write.overridePolicy)return;const r=e?.ndimArray??0;e&&(1===r||"type"in e&&(0,i.P)(e.type))?t.write.writer=d:r>1?t.write.writer=function(e){return(t,r,n,s)=>{let i;if(null===t)i=null;else{i=h(t,s,e);let r=e,n=i;for(;r>0&&Array.isArray(n);)r--,n=n[0];if(void 0!==n)for(let e=0;e<r;e++)i=[i]}(0,o.sM)(n,i,r)}}(r):t.types?Array.isArray(t.types)?t.write.writer=function(e){return(t,r,n,s)=>t&&Array.isArray(t)?l(t.filter((t=>c(t,e,s))),r,n,s):l(t,r,n,s)}(t.types[0]):t.write.writer=function(e){return(t,r,n,s)=>t?c(t,e,s)?l(t,r,n,s):void 0:l(t,r,n,s)}(t.types):t.write.writer=l}function c(e,t,r){for(const r in t.typeMap)if(e instanceof t.typeMap[r])return!0;if(r?.messages){const o=t.errorContext??"type",i=`Values of type '${("function"!=typeof t.key?e[t.key]:e.declaredClass)??"Unknown"}' cannot be written`;r&&r.messages&&e&&r.messages.push(new n.A(`${o}:unsupported`,i,{definition:e,context:r})),s.A.getLogger("esri.core.accessorSupport.extensions.serializableProperty.writer").error(i)}return!1}function l(e,t,r,n){(0,o.sM)(r,u(e,n),t)}function u(e,t){return e&&"function"==typeof e.write?e.write({},t):e&&"function"==typeof e.toJSON?e.toJSON():"number"==typeof e?f(e):e}function f(e){return e===-1/0?-Number.MAX_VALUE:e===1/0?Number.MAX_VALUE:isNaN(e)?null:e}function d(e,t,r,n){let s;null===e?s=null:e&&"function"==typeof e.map?(s=e.map((e=>u(e,n))),"function"==typeof s.toArray&&(s=s.toArray())):s=[u(e,n)],(0,o.sM)(r,s,t)}function h(e,t,r){return 0!==r&&Array.isArray(e)?e.map((e=>h(e,t,r-1))):u(e,t)}},16649:(e,t,r)=>{"use strict";r.d(t,{Jt:()=>a,RP:()=>i,t2:()=>c});var n=r(88620);function s(e,t){const r="?"===e[e.length-1]?e.slice(0,-1):e;if(null!=t.getItemAt||Array.isArray(t)){const e=parseInt(r,10);if(!isNaN(e))return Array.isArray(t)?t[e]:t.at(e)}const s=(0,n.oY)(t);return(0,n.yh)(s,r)?s.get(r):t[r]}function o(e,t,r){if(null==e)return e;const n=s(t[r],e);return!n&&r<t.length-1?void 0:r===t.length-1?n:o(n,t,r+1)}function i(e,t,r=0){return"string"!=typeof t||t.includes(".")?o(e,(0,n.AH)(t),r):s(t,e)}function a(e,t){return i(e,t)}function c(e,t){return void 0!==i(t,e)}},45873:(e,t,r)=>{"use strict";var n;r.d(t,{v:()=>n}),function(e){e[e.INITIALIZING=0]="INITIALIZING",e[e.CONSTRUCTING=1]="CONSTRUCTING",e[e.CONSTRUCTED=2]="CONSTRUCTED",e[e.DESTROYED=3]="DESTROYED"}(n||(n={}))},96156:(e,t,r)=>{"use strict";r.d(t,{CX:()=>a,tD:()=>o,z4:()=>i});var n=r(4718),s=r(88620);function o(e){let t=e.constructor.__accessorMetadata__;const r=Object.prototype.hasOwnProperty.call(e.constructor,"__accessorMetadata__");if(t){if(!r){t=Object.create(t);for(const e in t)t[e]=(0,n.o8)(t[e]);Object.defineProperty(e.constructor,"__accessorMetadata__",{value:t,enumerable:!1,configurable:!0,writable:!0})}}else t={},Object.defineProperty(e.constructor,"__accessorMetadata__",{value:t,enumerable:!1,configurable:!0,writable:!0});return e.constructor.__accessorMetadata__}function i(e,t){const r=o(e);let n=r[t];return n||(n=r[t]={}),n}function a(e,t){return(0,s.h1)(e,t,l)}const c=/^(?:[^.]+\.)?(?:value|type|(?:json\.type|json\.origins\.[^.]\.type))$/;function l(e){return c.test(e)?"replace":"merge"}},45917:(e,t,r)=>{"use strict";r.d(t,{L:()=>u,t:()=>f});var n=r(16649),s=r(88620),o=r(51822);function i(e,t,r){if(!e?.read||!1===e.read.enabled||!e.read.source)return!1;const s=e.read.source;if("string"==typeof s){if(s===t)return!0;if(s.includes(".")&&0===s.indexOf(t)&&(0,n.t2)(s,r))return!0}else for(const e of s){if(e===t)return!0;if(e.includes(".")&&0===e.indexOf(t)&&(0,n.t2)(e,r))return!0}return!1}function a(e,t,r,n,s){let a=(0,o.N5)(t[r],s);(function(e){return e&&(!e.read||!1!==e.read.enabled&&!e.read.source)})(a)&&(e[r]=!0);for(const c of Object.getOwnPropertyNames(t))a=(0,o.N5)(t[c],s),i(a,r,n)&&(e[c]=!0)}function c(e,t,r,n){const s=r.metadata,i=(0,o.xF)(s[t],n),a=i?.default;if(void 0===a)return;const c="function"==typeof a?a.call(e,t,n):a;void 0!==c&&r.set(t,c)}const l={origin:"service"};function u(e,t,r=l){if(!t||"object"!=typeof t)return;const i=(0,s.oY)(e),u=i.metadata,f={};for(const e of Object.getOwnPropertyNames(t))a(f,u,e,t,r);i.setDefaultOrigin(r.origin);for(const s of Object.getOwnPropertyNames(f)){const a=(0,o.N5)(u[s],r).read,c=a?.source;let l;l=c&&"string"==typeof c?(0,n.RP)(t,c):t[s],a?.reader&&(l=a.reader.call(e,l,t,r)),void 0!==l&&i.set(s,l)}if(!r||!r.ignoreDefaults){i.setDefaultOrigin("defaults");for(const t of Object.getOwnPropertyNames(u))f[t]||c(e,t,i,r)}i.setDefaultOrigin("user")}function f(e,t,r,n=l){const s={...n,messages:[]};r(s),s.messages?.forEach((t=>{"warning"!==t.type||e.loaded?n?.messages&&n.messages.push(t):e.loadWarnings.push(t)}))}},47821:(e,t,r)=>{"use strict";r.d(t,{h:()=>i});var n=r(49186),s=r(44208),o=(r(53966),r(16649));function i(e,t,r){if(e&&t)if("object"==typeof t)for(const r of Object.getOwnPropertyNames(t))i(e,r,t[r]);else{if(t.includes(".")){const n=t.split("."),s=n.splice(-1,1)[0];return void i((0,o.Jt)(e,n),s,r)}const a=e.__accessor__;null!=a&&function(e,t){if((0,s.A)("esri-unknown-property-errors")&&!function(e,t){return null!=t.metadata[e]}(e,t))throw new n.A("set:unknown-property",function(e,t){return"setting unknown property '"+e+"' on instance of "+t.host.declaredClass}(e,t))}(t,a),e[t]=r}}},62788:(e,t,r)=>{"use strict";r.d(t,{F_:()=>h,Xr:()=>v,a:()=>d,fE:()=>b,gc:()=>l}),r(44208);var n=r(53966),s=r(88620),o=r(47328);const i=new(r(67867).R),a=[];let c=i;function l(e){c.onAccessed(e)}let u=!1,f=!1;function d(e,t,r){if(u)return p(e,t,r);let n=null;return g(e),n=t.call(r),y(),n}function h(e,t){return d(i,e,t)}function p(e,t,r){const s=u;u=!0,g(e);let o=null;try{o=t.call(r)}catch(e){f&&n.A.getLogger("esri.core.accessorSupport.tracking").error(e)}return y(),u=s,o}function g(e){c=e,a.push(e)}function y(){const e=a.length;if(e>1){const t=a.pop();c=a[e-2],t.onTrackingEnd()}else if(1===e){const e=a.pop();c=i,e.onTrackingEnd()}else c=i}function b(e,t){if(t.flags&o.i.DepTrackingInitialized)return;t.flags|=o.i.DepTrackingInitialized;const r=f;f=!1,t.flags&o.i.AutoTracked?p(t.trackingTarget,t.metadata.get,e):v(e,t),f=r}const m=[];function v(e,t){t.flags&o.i.ExplicitlyTracking||(t.flags|=o.i.ExplicitlyTracking,p(t.trackingTarget,(()=>{const r=t.metadata.dependsOn||m;for(const t of r)if("string"!=typeof t||t.includes(".")){const r=(0,s.AH)(t);for(let t=0,n=e;t<r.length&&null!=n&&"object"==typeof n;++t)n=_(n,r[t],t!==r.length-1)}else _(e,t,!1)})),t.flags&=~o.i.ExplicitlyTracking)}function _(e,t,r){const n="?"===t[t.length-1]?t.slice(0,-1):t;if(null!=e.getItemAt||Array.isArray(e)){const t=parseInt(n,10);if(!isNaN(t))return Array.isArray(e)?e[t]:e.at(t)}const o=(0,s.oY)(e);if(o){const t=o.propertiesByName.get(n);t&&(l(t),b(e,t))}return r?e[n]:void 0}},47328:(e,t,r)=>{"use strict";var n;r.d(t,{i:()=>n}),function(e){e[e.Dirty=1]="Dirty",e[e.Overridden=2]="Overridden",e[e.Computing=4]="Computing",e[e.NonNullable=8]="NonNullable",e[e.HasDefaultValue=16]="HasDefaultValue",e[e.DepTrackingInitialized=32]="DepTrackingInitialized",e[e.AutoTracked=64]="AutoTracked",e[e.ExplicitlyTracking=128]="ExplicitlyTracking"}(n||(n={}))},71429:(e,t,r)=>{"use strict";r.d(t,{r:()=>s});var n=r(67867);class s extends n.R{constructor(e){super(new o(e)),this._observer&&i.register(this,new WeakRef(this._observer),this)}destroy(){this._observer&&i.unregister(this._observer),this.accessed?.clear(),this.clear(),this._observer?.destroy()}}class o{constructor(e){this._notify=e,this._invalidCount=0,this.destroyed=!1}onInvalidated(){this._invalidCount++}onCommitted(){if(this.destroyed)return;const e=this._invalidCount;if(1===e)return this._invalidCount=0,void this._notify();this._invalidCount=e>0?e-1:0}destroy(){this.destroyed=!0,this._notify=a}}const i=new FinalizationRegistry((e=>{e.deref()?.destroy()}));function a(){}},67867:(e,t,r)=>{"use strict";r.d(t,{R:()=>n});class n{constructor(e){this.accessed=void 0,this._handles=void 0,this._observer=e}destroy(){this.accessed?.clear(),this.clear()}onAccessed(e){null!=this._observer&&e!==this._observer&&(null==this.accessed&&(this.accessed=new Set),this.accessed.add(e))}onTrackingEnd(){null!=this._observer&&(this.clear(),null!=this.accessed&&(null==this._handles&&(this._handles=[]),this.accessed.forEach((e=>{this._handles.push(e.observe(this._observer))})),this.accessed.clear()))}clear(){if(null!=this._handles){for(let e=0;e<this._handles.length;++e)this._handles[e].remove();this._handles.length=0}}}},80559:(e,t,r)=>{"use strict";r.d(t,{Df:()=>l,fm:()=>u,mJ:()=>c});var n=r(36563),s=r(62788),o=r(71429);let i=!1;const a=[];function c(e,t){let r=new o.r((function n(){if(!r||c)return;if(i)return void f(n);const o=a;r.clear(),i=!0,c=!0,a=(0,s.a)(r,e),c=!1,i=!1,t(a,o),d()})),a=null,c=!1;return c=!0,a=(0,s.a)(r,e),c=!1,(0,n.hA)((function(){r&&(r.destroy(),r=null,a=null)}))}function l(e,t){let r=new o.r((function(){t(i,a)})),i=null;function a(){return r?(r.clear(),i=(0,s.a)(r,e),i):null}return a(),(0,n.hA)((function(){r&&(r.destroy(),r=null),i=null}))}function u(e,t){let r=!1,a=!1;const c=!!t?.sync;let l=new o.r((()=>{r||a||(a=!0,c?u():queueMicrotask(u))}));function u(){a=!1,l&&!r&&(i?f(u):(l.clear(),i=!0,r=!0,(0,s.a)(l,e),r=!1,i=!1,d()))}return r=!0,(0,s.a)(l,e),r=!1,(0,n.hA)((function(){l&&(l.destroy(),l=null)}))}function f(e){a.includes(e)||a.unshift(e)}function d(){for(;a.length;)a.pop()()}},88620:(e,t,r)=>{"use strict";r.d(t,{AH:()=>l,h1:()=>a,oY:()=>o,qg:()=>f,yh:()=>i});var n=r(36563),s=r(4718);function o(e){return e.__accessor__??null}function i(e,t){return null!=e?.metadata?.[t]}function a(e,t,r){return c(e,t,r?{policy:r,path:""}:null)}function c(e,t,r){return t?Object.keys(t).reduce(((e,n)=>{const o=n;let i=null,a="merge";if(r&&(i=r.path?`${r.path}.${n}`:n,a=r.policy(i)),"replace"===a)return e[o]=t[o],e;if("replace-arrays"===a&&Array.isArray(e[o]))return e[o]=t[o],e;if(void 0===e[o])return e[o]=(0,s.o8)(t[o]),e;let l=e[o],u=t[o];if(l===u)return e;if(Array.isArray(u)||Array.isArray(e))l=l?Array.isArray(l)?e[o]=l.slice():e[o]=[l]:e[o]=[],u&&(Array.isArray(u)||(u=[u]),u.forEach((e=>{l.includes(e)||l.push(e)})));else if(u&&"object"==typeof u)if(r){const t=r.path;r.path=i,e[o]=c(l,u,r),r.path=t}else e[o]=c(l,u,null);else e.hasOwnProperty(n)&&!t.hasOwnProperty(n)||(e[o]=u);return e}),e||{}):e}function l(e){return Array.isArray(e)?e:e.split(".")}function u(e){return e.includes(",")?e.split(",").map((e=>e.trim())):[e.trim()]}function f(e,t,r,s){const o=function(e){if(Array.isArray(e)){const t=[];for(const r of e)t.push(...u(r));return t}return u(e)}(t);if(1!==o.length){const t=o.map((t=>s(e,t,r)));return(0,n.vE)(t)}return s(e,o[0],r)}},14012:(e,t,r)=>{"use strict";r.d(t,{iS:()=>A,wB:()=>E,Cn:()=>T});var n=r(98291),s=r(36563),o=r(4718),i=r(93687);class a extends i.A{constructor(){super(...arguments),this._set=new Set}destroy(){super.destroy(),this._set=null}acquire(...e){const t=super.acquire(...e);return this._set.delete(t),t}release(e){e&&!this._set.has(e)&&(super.release(e),this._set.add(e))}_dispose(e){this._set.delete(e),super._dispose(e)}}var c,l,u=r(11932),f=r(24326),d=r(16649),h=r(45873),p=r(80559),g=r(88620);(l=c||(c={}))[l.Untracked=0]="Untracked",l[l.Tracked=1]="Tracked";class y{constructor(){this.uid=(0,f.c)(),this.removed=!1,this.type=null,this.oldValue=null,this.callback=null,this.getValue=null,this.target=null,this.path=null,this.equals=null}static acquireUntracked(e,t,r,n,s){return this.pool.acquire(c.Untracked,e,t,r,n,s,o.aI)}static acquireTracked(e,t,r,n){return this.pool.acquire(c.Tracked,e,t,r,null,null,n)}notify(e,t){this.type===c.Untracked?this.callback.call(this.target,e,t,this.path,this.target):this.callback.call(null,e,t,void 0,void 0)}acquire(e,t,r,n,s,o,i){this.uid=(0,f.c)(),this.removed=!1,this.type=e,this.oldValue=t,this.callback=r,this.getValue=n,this.target=s,this.path=o,this.equals=i}release(){this.target=this.path=this.oldValue=this.callback=this.getValue=null,this.uid=(0,f.c)(),this.removed=!0}}y.pool=new a(y);const b=new n.A,m=new Set;let v;function _(e){m.delete(e),m.add(e),v||(v=(0,u._)(O))}function w(e){if(e.removed)return;const t=e.oldValue,r=e.getValue();e.equals(t,r)||(e.oldValue=r,e.notify(r,t))}function A(e){for(const t of m.values())t.target===e&&(t.removed=!0)}function O(){let e=10;for(;v&&e--;){v=null;const e=S(),t=b.acquire();for(const r of e){const e=r.uid;w(r),e===r.uid&&r.removed&&t.push(r)}for(const e of m)e.removed&&(t.push(e),m.delete(e));for(const e of t)y.pool.release(e);b.release(t),b.release(e),k.forEach((e=>e()))}}function S(){const e=b.acquire();e.length=m.size;let t=0;for(const r of m)e[t]=r,++t;return m.clear(),e}const k=new Set;function E(e,t,r,n=!1){return e.__accessor__&&e.__accessor__.lifecycle!==h.v.DESTROYED?n?function(e,t,r){const n=(0,g.qg)(e,t,r,((e,t,r)=>{let s=!1;return(0,p.mJ)((()=>(0,d.RP)(e,t)),((i,a)=>{e.__accessor__.lifecycle!==h.v.DESTROYED?s||(s=!0,(0,o.aI)(a,i)||r.call(e,i,a,t,e),s=!1):n.remove()}))}));return n}(e,t,r):function(e,t,r){let n=(0,g.qg)(e,t,r,((e,t,r)=>{let o,i,a=(0,p.Df)((()=>(0,d.RP)(e,t)),((s,a)=>{e.__accessor__?.lifecycle===h.v.DESTROYED||o&&o.uid!==i?n.remove():(o||(o=y.acquireUntracked(s,r,a,e,t),i=o.uid),_(o))}));return(0,s.hA)((()=>{a.remove(),o&&(o.uid!==i||o.removed||(o.removed=!0,_(o)),o=null),n=a=null}))}));return n}(e,t,r):(0,s.hA)()}function T(e,t,r=!1,n=o.gh){return r?function(e,t,r){let n=!1;return(0,p.mJ)(e,((e,s)=>{n||(n=!0,r(s,e)||t(e,s),n=!1)}))}(e,t,n):function(e,t,r){let n,o,i=(0,p.Df)(e,((e,s)=>{n&&n.uid!==o?i.remove():(n||(n=y.acquireTracked(e,t,s,r),o=n.uid),_(n))}));return(0,s.hA)((()=>{i.remove(),n&&(n.uid!==o||n.removed||(n.removed=!0,_(n)),n=null),i=null}))}(e,t,n)}},49422:(e,t,r)=>{"use strict";r.d(t,{M:()=>h,R:()=>d});var n=r(4576),s=r(49186),o=r(53966),i=r(16649),a=r(35666),c=r(88620),l=r(51822);function u(e,t,r,n,s){const o={};return t.write?.writer?.call(e,n,o,r,s),o}function f(e,t,r,c,l,u){if(!c?.write)return!1;const f=(0,i.Jt)(e,r);if(!l&&c.write.overridePolicy){const t=c.write.overridePolicy.call(e,f,r,u??void 0);void 0!==t&&(l=t)}if(l||(l=c.write),!l||!1===l.enabled)return!1;if(l.layerContainerTypes&&u?.layerContainerType&&!l.layerContainerTypes.includes(u.layerContainerType))return!1;if((null===f&&!l.allowNull&&!l.writerEnsuresNonNull||void 0===f)&&l.isRequired){const t=new s.A("web-document-write:property-required",`Missing value for required property '${r}' on '${e.declaredClass}'`,{propertyName:r,target:e});return t&&u?.messages?u.messages.push(t):t&&!u&&o.A.getLogger("esri.core.accessorSupport.write").error(t.name,t.message),!1}return!(void 0===f||null===f&&!l.allowNull&&!l.writerEnsuresNonNull||!(l.alwaysWriteDefaults||t.store.multipleOriginsSupported&&t.store.originOf(r)!==a.Gr.DEFAULTS)&&function(e,t,r,s,o){const i=s.default;if(void 0===i)return!1;if(null!=s.defaultEquals)return s.defaultEquals(o);if("function"==typeof i){if(Array.isArray(o)){const s=i.call(e,t,r??void 0);return(0,n.aI)(s,o)}return!1}return i===o}(e,r,u,c,f)||!l.ignoreOrigin&&u?.origin&&t.store.multipleOriginsSupported&&t.store.originOf(r)<(0,a.aB)(u.origin))}function d(e,t,r,n){const s=(0,c.oY)(e),o=s.metadata,i=(0,l.k4)(o[t],n);return!!i&&f(e,s,t,i,r,n)}function h(e,t,r){if(e&&"function"==typeof e.toJSON&&(!e.toJSON.isDefaultToJSON||!e.write))return(0,c.h1)(t,e.toJSON(r));const n=(0,c.oY)(e),s=n.metadata;for(const o in s){const d=(0,l.k4)(s[o],r);if(!f(e,n,o,d,void 0,r))continue;const h=(0,i.Jt)(e,o),p=u(e,d,d.write&&"string"==typeof d.write.target?d.write.target:o,h,r);Object.keys(p).length>0&&(t=(0,c.h1)(t,p),r?.resources?.pendingOperations?.length&&r.resources.pendingOperations.push(Promise.all(r.resources.pendingOperations).then((()=>(0,c.h1)(t,p,(()=>"replace-arrays"))))),r?.writtenProperties&&r.writtenProperties.push({target:e,propName:o,oldOrigin:(0,a.in)(n.store.originOf(o)),newOrigin:r.origin}))}return t}},4576:(e,t,r)=>{"use strict";r.d(t,{$U:()=>i,Am:()=>a,He:()=>o,Ji:()=>s,Mo:()=>b,Ru:()=>w,TF:()=>_,Xj:()=>u,Xy:()=>p,aI:()=>c,iv:()=>l,k4:()=>v,mW:()=>y,qh:()=>h,vW:()=>f});var n=r(87811);const s=1.5,o=1/s,i=.5;function a(e,t){return t?e.filter(((e,r,n)=>n.findIndex(t.bind(null,e))===r)):Array.from(new Set(e))}function c(e,t,r){if(null==e&&null==t)return!0;if(null==e||null==t||e.length!==t.length)return!1;if(r){for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function l(e,t,r){let n,s;return r?(n=t.filter((t=>!e.some((e=>r(e,t))))),s=e.filter((e=>!t.some((t=>r(t,e)))))):(n=t.filter((t=>!e.includes(t))),s=e.filter((e=>!t.includes(e)))),{added:n,removed:s}}function u(e){return e&&"number"==typeof e.length}class f{constructor(){this.last=0}}const d=new f;function h(e,t,r,n){n=n||d;const s=Math.max(0,n.last-10);for(let o=s;o<r;++o)if(e[o]===t)return n.last=o,o;const o=Math.min(s,r);for(let r=0;r<o;++r)if(e[r]===t)return n.last=r,r;return-1}function p(e,t,r,n){const s=r??e.length,o=h(e,t,s,n);if(-1!==o)return e[o]=e[s-1],null==r&&e.pop(),t}const g=new Set;function y(e,t,r=e.length,n=t.length,s,o){if(0===n||0===r)return r;g.clear();for(let e=0;e<n;++e)g.add(t[e]);s=s||d;const i=Math.max(0,s.last-10);for(let t=i;t<r;++t)if(g.has(e[t])&&(o?.push(e[t]),g.delete(e[t]),e[t]=e[r-1],--r,--t,0===g.size||0===r))return g.clear(),r;for(let t=0;t<i;++t)if(g.has(e[t])&&(o?.push(e[t]),g.delete(e[t]),e[t]=e[r-1],--r,--t,0===g.size||0===r))return g.clear(),r;return g.clear(),r}function b(e){return e?(m.seed=e,()=>m.getFloat()):Math.random}const m=new n.A;function v(e,t){const r=b(t);for(let t=e.length-1;t>0;t--){const n=Math.floor(r()*(t+1)),s=e[t];e[t]=e[n],e[n]=s}return e}function _(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}function w(e,t){return null!=e}},51447:(e,t,r)=>{"use strict";r.d(t,{Lx:()=>a,eF:()=>c,eO:()=>i,io:()=>l});var n=r(44208);const s=new WeakMap;function o(e,t,r=!1){const n=`🛑 DEPRECATED - ${t}`;if(!r)return void e.warn(n);let o=s.get(e);o||(o=new Set,s.set(e,o)),o.has(t)||(o.add(t),e.warn(n))}function i(e,t,r={}){if((0,n.A)("esri-deprecation-warnings")){const{moduleName:n}=r;l(e,"Function: "+(n?n+"::":"")+t+"()",r)}}function a(e,t,r={}){if((0,n.A)("esri-deprecation-warnings")){const{moduleName:n}=r;l(e,"Property: "+(n?n+"::":"")+t,r)}}function c(e,t,r={}){(0,n.A)("esri-deprecation-warnings")&&l(e,`Multiple argument constructor: ${t}`,{warnOnce:!0,replacement:`new ${t}({ <your properties here> })`,...r})}function l(e,t,r={}){if((0,n.A)("esri-deprecation-warnings")){const{replacement:n,version:s,see:i,warnOnce:a}=r;let c=t;n&&(c+=`\n\t🛠️ Replacement: ${n}`),s&&(c+=`\n\t⚙️ Version: ${s}`),i&&(c+=`\n\t🔗 See ${i} for more details.`),o(e,c,a)}}},37955:(e,t,r)=>{"use strict";r.d(t,{Oo:()=>a,on:()=>i,wb:()=>s});var n=r(36563);function s(e){return function(e){return null!=e&&"object"==typeof e&&"on"in e&&"function"==typeof e.on}(e)||o(e)}function o(e){return null!=e&&"object"==typeof e&&"addEventListener"in e&&"function"==typeof e.addEventListener}function i(e,t,r){if(!s(e))throw new TypeError("target is not a Evented or EventTarget object");return o(e)?function(e,t,r,s){if(Array.isArray(t)){const o=t.slice();for(const t of o)e.addEventListener(t,r,s);return(0,n.hA)((()=>{for(const t of o)e.removeEventListener(t,r,s)}))}return e.addEventListener(t,r,s),(0,n.hA)((()=>e.removeEventListener(t,r,s)))}(e,t,r):e.on(t,r)}function a(e,t,r){if(!s(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,r);const n=i(e,t,(t=>{n.remove(),r.call(e,t)}));return n}},36563:(e,t,r)=>{"use strict";r.d(t,{hA:()=>s,vE:()=>o});const n={remove:()=>{}};function s(e){return e?{remove(){e&&(e(),e=void 0)}}:n}function o(e){return s((()=>function(e){e.forEach((e=>e?.remove()))}(e)))}},44208:(e,t,r)=>{"use strict";let n;function s(e){return"function"==typeof n[e]?n[e]=n[e](globalThis):n[e]}r.d(t,{A:()=>s}),n=globalThis.dojoConfig?.has||globalThis.esriConfig?.has?{...globalThis.dojoConfig?.has,...globalThis.esriConfig?.has}:{},s.add=(e,t,r,o)=>{(o||void 0===n[e])&&(n[e]=t),r&&s(e)},s.cache=n,s.add("big-integer-warning-enabled",!0),s.add("esri-deprecation-warnings",!0),s.add("esri-tests-disable-screenshots",!1),s.add("esri-tests-use-full-window",!1),s.add("esri-tests-post-to-influx",!0),s.add("esri-cim-animations-enable-status","enabled"),s.add("esri-cim-animations-spotlight",!1),s.add("esri-cim-animations-freeze-time",!1),s.add("enable-feature:multiple-highlights",!1),(()=>{s.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const e="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(s.add("host-browser",e),s.add("host-node","object"==typeof globalThis.process&&globalThis.process.versions?.node&&globalThis.process.versions.v8),s.add("dom",e),s("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(s.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),s.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),s.add("khtml",r.includes("Konqueror")?n:void 0),s.add("edge",parseFloat(t.split("Edge/")[1])||void 0),s.add("opr",parseFloat(t.split("OPR/")[1])||void 0),s.add("webkit",!s("wp")&&!s("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),s.add("chrome",!s("edge")&&!s("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),s.add("android",!s("wp")&&parseFloat(t.split("Android ")[1])||void 0),s.add("safari",!r.includes("Safari")||s("wp")||s("chrome")||s("android")||s("edge")||s("opr")?void 0:parseFloat(r.split("Version/")[1])),s.add("mac",r.includes("Macintosh")),!s("wp")&&/(iPhone|iPod|iPad)/.test(t)){const e=RegExp.$1.replace(/P/,"p"),r=/OS ([\d_]+)/.test(t)?RegExp.$1:"1",n=parseFloat(r.replace(/_/,".").replaceAll("_",""));s.add(e,n),s.add("ios",n)}s("webkit")||(!t.includes("Gecko")||s("wp")||s("khtml")||s("edge")||s.add("mozilla",n),s("mozilla")&&s.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),r=/iPhone/i.test(e);t&&s.add("esri-mobile",t),r&&s.add("esri-iPhone",r),s.add("esri-geolocation",!!navigator.geolocation)}s.add("esri-wasm","WebAssembly"in globalThis),s.add("esri-performance-mode-frames-between-render",20),s.add("esri-force-performance-mode",!1),s.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),s.add("wasm-simd",(()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])))),s.add("esri-atomics","Atomics"in globalThis),s.add("esri-workers","Worker"in globalThis),s.add("web-feat:cache","caches"in globalThis),s.add("esri-workers-arraybuffer-transfer",!s("safari")||Number(s("safari"))>=12),s.add("workers-pool-size",8),s.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),s.add("featurelayer-simplify-payload-size-factors",[1,1,4]),s.add("featurelayer-fast-triangulation-enabled",!0),s.add("featurelayer-animation-enabled",!0),s.add("featurelayer-snapshot-enabled",!0),s.add("featurelayer-snapshot-point-min-threshold",8e4),s.add("featurelayer-snapshot-point-max-threshold",4e5),s.add("featurelayer-snapshot-point-coverage",.1),s.add("featurelayer-query-max-depth",4),s.add("featurelayer-query-pausing-enabled",!1),s.add("featurelayer-advanced-symbols",!1),s.add("featurelayer-pbf",!0),s.add("featurelayer-pbf-statistics",!1),s.add("feature-layers-workers",!0),s.add("feature-polyline-generalization-factor",1),s.add("mapview-transitions-duration",200),s.add("mapview-essential-goto-duration",200),s.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),s.add("mapserver-pbf-version-support",10.81),s.add("mapservice-popup-identify-max-tolerance",20),s("host-webworker")||s("host-browser")&&(s.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),s.add("esri-image-decode",(()=>{if("decode"in new Image){const e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>',void e.decode().then((()=>{s.add("esri-image-decode",!0,!0,!0)})).catch((()=>{s.add("esri-image-decode",!1,!0,!0)}))}return!1})),s.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})()},5479:(e,t,r)=>{"use strict";function n(e){const t=[];return function*(){yield*t;for(const r of e)t.push(r),yield r}}function s(e,t){for(const r of e)if(null!=r&&t(r))return r}function o(e){return null!=e&&"function"==typeof e[Symbol.iterator]}r.d(t,{I6:()=>s,PP:()=>n,xZ:()=>o})},4718:(e,t,r)=>{"use strict";r.d(t,{Nb:()=>c,TU:()=>a,aI:()=>h,gh:()=>p,o8:()=>i,oy:()=>o,zI:()=>g});var n=r(4576),s=r(34275);function o(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&o(e[r],!0));else for(r in e)e.hasOwnProperty(r)&&void 0===e[r]&&delete e[r];return e}function i(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=d(e);if(null!=t)return t;if(c(e))return e.clone();if(l(e))return e.map(i);if(u(e))throw new Error("Trying to clone an unclonable Accessor instance");const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=i(e[t]);return r}function a(e){if(!e||"object"!=typeof e||"function"==typeof e||"HTMLElement"in globalThis&&e instanceof HTMLElement)return e;const t=d(e);if(null!=t)return t;if(l(e)){let t=!0;const r=e.map((e=>{const r=a(e);return null!=e&&null==r&&(t=!1),r}));return t?r:null}if(c(e))return e.clone();if(e instanceof File||e instanceof Blob)return e;if(u(e))return null;const r=new(0,Object.getPrototypeOf(e).constructor);for(const t of Object.getOwnPropertyNames(e)){const n=e[t],s=a(n);if(null!=n&&null==s)return null;r[t]=s}return r}function c(e){return"function"==typeof e.clone}function l(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function u(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function f(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function d(e){if((0,s.dz)(e)||(0,s.mg)(e)||(0,s.UR)(e)||(0,s.IY)(e)||(0,s.jq)(e)||(0,s._G)(e)||(0,s.XJ)(e)||(0,s.vZ)(e)||(0,s.aI)(e))return e.slice();if(e instanceof Date)return new Date(e.getTime());if(e instanceof ArrayBuffer)return e.slice(0,e.byteLength);if(e instanceof Map){const t=new Map;for(const[r,n]of e)t.set(r,i(n));return t}if(e instanceof Set){const t=new Set;for(const r of e)t.add(i(r));return t}return null}function h(e,t){return e===t||"number"==typeof e&&isNaN(e)&&"number"==typeof t&&isNaN(t)||"function"==typeof e?.getTime&&"function"==typeof t?.getTime&&e.getTime()===t.getTime()||!1}function p(e,t){return e===t||(null==e||"string"==typeof e?e===t:"number"==typeof e?e===t||"number"==typeof t&&isNaN(e)&&isNaN(t):e instanceof Date?t instanceof Date&&e.getTime()===t.getTime():Array.isArray(e)?Array.isArray(t)&&(0,n.aI)(e,t):e instanceof Set?t instanceof Set&&function(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}(e,t):e instanceof Map?t instanceof Map&&function(e,t){if(e.size!==t.size)return!1;for(const[r,n]of e){const e=t.get(r);if(e!==n||void 0===e&&!t.has(r))return!1}return!0}(e,t):!!f(e)&&f(t)&&function(e,t){if(null===e||null===t)return!1;const r=Object.keys(e);if(null===t||Object.keys(t).length!==r.length)return!1;for(const n of r)if(e[n]!==t[n]||!Object.prototype.hasOwnProperty.call(t,n))return!1;return!0}(e,t))}function g(e){return e}},97768:(e,t,r)=>{"use strict";function n(e,t){if(null==e)throw new Error(t??"value is None")}function s(e){return e?.destroy(),null}function o(e){return e?.dispose(),null}function i(e){return e?.remove(),null}function a(e){return e?.abort(),null}function c(e){return e?.release(),null}function l(e,t,r){return null!=e&&null!=t?null!=r?r(e,t):e.equals(t):e===t}function u(e,t){let r;return e.some(((e,n)=>(r=t(e,n),null!=r))),r??void 0}r.d(t,{CM:()=>l,DC:()=>a,Gz:()=>c,Lw:()=>n,Pb:()=>u,WD:()=>o,pR:()=>s,xt:()=>i})},26390:(e,t,r)=>{"use strict";r.d(t,{d:()=>s});const n=[];function s(e){n.push(e),1===n.length&&queueMicrotask((()=>{const e=n.slice();n.length=0;for(const t of e)t()}))}},93637:(e,t,r)=>{"use strict";r.d(t,{$N:()=>s,i8:()=>a,sM:()=>i,wc:()=>o});var n=r(4718);function s(e,t,r=!1){return l(e,t,r)}function o(e,t){if(null!=t)return t[e]||c(e.split("."),!1,t)}function i(e,t,r){const n=e.split("."),s=n.pop(),o=c(n,!0,r);o&&s&&(o[s]=t)}function a(e,t){if(null==e&&null==t)return!1;if(null==e)return!0;if(null==t)return!0;if("object"==typeof e){if(Array.isArray(e)){const r=t;if(e.length!==r.length)return!0;for(let t=0;t<e.length;t++)if(a(e[t],r[t]))return!0;return!1}if(Object.keys(e).length!==Object.keys(t).length)return!0;for(const r in e)if(a(e[r],t[r]))return!0;return!1}return e!==t}function c(e,t,r){let n=r;for(const r of e){if(null==n)return;if(!(r in n)){if(!t)return;n[r]={}}n=n[r]}return n}function l(e,t,r){return t?Object.keys(t).reduce(((e,s)=>{let o=e[s],i=t[s];return o===i?e:void 0===o?(e[s]=(0,n.o8)(i),e):(Array.isArray(i)||Array.isArray(e)?(o=o?Array.isArray(o)?e[s]=o.slice():e[s]=[o]:e[s]=[],i&&(Array.isArray(i)||(i=[i]),r?i.forEach((e=>{o.includes(e)||o.push(e)})):e[s]=i.slice())):i&&"object"==typeof i?e[s]=l(o,i,r):e.hasOwnProperty(s)&&!t.hasOwnProperty(s)||(e[s]=i),e)}),e||{}):e}},74887:(e,t,r)=>{"use strict";r.d(t,{Pl:()=>O,Ol:()=>A,nA:()=>w,NK:()=>l,Tw:()=>T,sg:()=>E,Lx:()=>_,QZ:()=>v,zf:()=>m,G4:()=>d,$X:()=>S,u7:()=>g,NY:()=>y,Mq:()=>f,QP:()=>h,Te:()=>u,jH:()=>p,NO:()=>N,z7:()=>k,qr:()=>b});var n=r(36563);const s=(o=globalThis,{setTimeout:(e,t)=>{const r=o.setTimeout(e,t);return(0,n.hA)((()=>o.clearTimeout(r)))}});var o,i=r(49186),a=r(37955),c=(r(53966),r(97768));function l(e="Aborted"){return new i.A("AbortError",e)}function u(e,t="Aborted"){if(d(e))throw l(t)}function f(e){return e instanceof AbortSignal?e:e?.signal??void 0}function d(e){const t=f(e);return null!=t&&t.aborted}function h(e){if(m(e))throw e}function p(e){if(!m(e))throw e}function g(e,t){const r=f(e);if(null!=r){if(!r.aborted)return(0,a.Oo)(r,"abort",(()=>t()));t()}}function y(e,t){const r=f(e);if(null!=r)return u(r),(0,a.Oo)(r,"abort",(()=>t(l())))}function b(e,t){return null==f(t)?e:new Promise(((r,n)=>{let s=g(t,(()=>n(l())));const o=()=>{s=(0,c.xt)(s)};e.then(o,o),e.then(r,n)}))}function m(e){return"AbortError"===e?.name}async function v(e){try{return await e}catch(e){if(!m(e))throw e;return}}async function _(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e),r=t.map((t=>e[t])),n=await _(r),s={};return t.map(((e,t)=>s[e]=n[t])),s}const t=e;return Promise.allSettled(t).then((e=>Array.from(t,((t,r)=>{const n=e[r];return"fulfilled"===n.status?{promise:t,value:n.value}:{promise:t,error:n.reason}}))))}async function w(e){return(await Promise.allSettled(e)).filter((e=>"fulfilled"===e.status)).map((e=>e.value))}async function A(e){return(await Promise.allSettled(e)).filter((e=>"rejected"===e.status)).map((e=>e.reason))}function O(e,t=void 0,r){const n=new AbortController;return g(r,(()=>n.abort())),new Promise(((r,s)=>{let o=setTimeout((()=>{o=0,r(t)}),e);g(n,(()=>{o&&(clearTimeout(o),s(l()))}))}))}function S(e){return e&&"function"==typeof e.then}function k(e){return S(e)?e:Promise.resolve(e)}function E(e,t=-1){let r,n,s,o,i=null;const a=(...c)=>{if(r){n=c,o&&o.reject(l()),o=T();const e=o.promise;if(i){const e=i;i=null,e.abort()}return e}if(s=o||T(),o=null,t>0){const n=new AbortController;r=k(e(...c,n.signal));const s=r;O(t).then((()=>{r===s&&(o?n.abort():i=n)}))}else r=1,r=k(e(...c));const u=()=>{const e=n;n=s=r=i=null,null!=e&&a(...e)},f=r,d=s;return f.then(u,u),f.then(d.resolve,d.reject),d.promise};return a}function T(){let e,t;const r=new Promise(((r,n)=>{e=r,t=n})),n=t=>{e(t)};return n.resolve=t=>e(t),n.reject=e=>t(e),n.timeout=(e,t)=>s.setTimeout((()=>n.reject(t)),e),n.promise=r,n}async function N(e){await Promise.resolve(),u(e)}},11932:(e,t,r)=>{"use strict";r.d(t,{$m:()=>A,_:()=>g,md:()=>w});var n=r(26390),s=r(61604),o=r(3694),i=r(74887),a=r(78659);class c{constructor(e){this.callback=e,this.isActive=!0}remove(){this.isActive=!1}}let l=0;const u={time:(0,a.l5)(0),deltaTime:(0,a.l5)(0),elapsedFrameTime:(0,a.l5)(0),frameDuration:(0,a.l5)(0)},f=["prepare","preRender","render","postRender","update","finish"],d=[],h=new o.A,p={frameTasks:h,willDispatch:!1,clearFrameTasks:function(e=!1){h.forAll((e=>{e.removed=!0})),e&&v()},dispatch:_,executeFrameTasks:function(e){const t=(0,a.l5)(e-l);l=e;const r=1e3/60,n=Math.max(0,t-r);u.time=e,u.frameDuration=(0,a.l5)(r-n);for(let r=0;r<f.length;r++){const n=performance.now(),s=f[r];h.forAll((n=>{n.paused||n.removed||(0===r&&n.ticks++,n.phases[s]&&(u.elapsedFrameTime=(0,a.l5)(performance.now()-e),u.deltaTime=0===n.ticks?(0,a.l5)(0):t,n.phases[s]?.call(n,u)))})),O[r].push(performance.now()-n)}v(),S.push(performance.now()-e)},reschedule:function(){null!=y&&(cancelAnimationFrame(y),y=requestAnimationFrame(b))}};function g(e){const t=new c(e);return d.push(t),p.willDispatch||(p.willDispatch=!0,(0,n.d)(_)),t}let y=null;function b(){const e=performance.now();y=null;const t=h.some((e=>!e.paused&&!e.removed));y=t?requestAnimationFrame(b):null,p.executeFrameTasks(e)}const m=new o.A;function v(){h.forAll((e=>{e.removed&&m.push(e)})),h.removeUnorderedMany(m.data,m.length),m.clear()}function _(){for(;d.length;){const e=d.shift();e.isActive&&e.callback()}p.willDispatch=!1}function w(e=1,t){const r=(0,i.Tw)(),s=()=>{(0,i.G4)(t)?r.reject((0,i.NK)()):0===e?r():(--e,(0,n.d)((()=>s())))};return s(),r.promise}async function A(e){await function(e){return w(1,e)}(e),await new Promise((t=>requestAnimationFrame((()=>{e?.aborted||t()}))))}const O=f.map((e=>new s.A(e))),S=new s.A("total")},799:(e,t,r)=>{"use strict";r.d(t,{Cj:()=>a,HC:()=>i,Wm:()=>c,_e:()=>u});var n=r(93637);const s=/\{([^}]+)\}/g;function o(e){return e??""}function i(e,t){return t?e.replaceAll(s,"object"==typeof t?(e,r)=>o((0,n.wc)(r,t)):(e,r)=>o(t(r))):e}function a(e,t){return e.replaceAll(/([.$?*|{}()[\]\\/+\-^])/g,(e=>t?.includes(e)?e:`\\${e}`))}function c(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}let l;function u(e){return l??=new DOMParser,l.parseFromString(e||"","text/html").body.innerText||""}},78659:(e,t,r)=>{"use strict";function n(e){return e}function s(e){return 1e3*e}function o(e){return e}r.d(t,{Kp:()=>o,gr:()=>s,l5:()=>n})},34275:(e,t,r)=>{"use strict";function n(e){return e instanceof ArrayBuffer}function s(e){return"Int8Array"===e?.constructor?.name}function o(e){return"Uint8Array"===e?.constructor?.name}function i(e){return"Uint8ClampedArray"===e?.constructor?.name}function a(e){return"Int16Array"===e?.constructor?.name}function c(e){return"Uint16Array"===e?.constructor?.name}function l(e){return"Int32Array"===e?.constructor?.name}function u(e){return"Uint32Array"===e?.constructor?.name}function f(e){return"Float32Array"===e?.constructor?.name}function d(e){return"Float64Array"===e?.constructor?.name}function h(e){return"buffer"in e}r.d(t,{IY:()=>a,JI:()=>g,UR:()=>i,XJ:()=>u,_G:()=>l,a3:()=>b,aI:()=>d,dk:()=>y,dz:()=>s,iu:()=>h,jq:()=>c,mg:()=>o,mw:()=>n,vZ:()=>f,y9:()=>p}),r(44208);const p=1024;function g(e){return d(e)||f(e)||l(e)||a(e)||s(e)}function y(e){return d(e)||f(e)}function b(e){return d(e)?179769e303:f(e)?3402823e32:u(e)?4294967295:c(e)?65535:o(e)||i(e)?255:l(e)?2147483647:a(e)?32767:s(e)?127:256}},24326:(e,t,r)=>{"use strict";r.d(t,{c:()=>s});let n=0;function s(){return++n}},84952:(e,t,r)=>{"use strict";r.d(t,{$1:()=>Q,$z:()=>V,An:()=>T,BQ:()=>oe,DB:()=>Z,FL:()=>B,FX:()=>z,Hg:()=>re,Il:()=>he,N9:()=>se,S8:()=>G,T1:()=>ge,UC:()=>pe,V1:()=>W,Xq:()=>k,Zo:()=>_e,_0:()=>Ae,a6:()=>ve,b8:()=>D,e7:()=>de,fj:()=>H,gd:()=>E,lJ:()=>X,lM:()=>ce,m3:()=>ae,nM:()=>fe,oP:()=>K,oy:()=>$,r$:()=>te,rs:()=>me,s0:()=>w,s2:()=>J,sC:()=>q,s_:()=>P,tk:()=>ne,ut:()=>U,w8:()=>Y,x0:()=>j,xw:()=>we,yM:()=>C,zf:()=>N,zi:()=>be,zs:()=>R});var n=r(92602),s=r(4576),o=r(49186),i=r(25482),a=r(53966),c=r(39131),l=r(26306);const u=()=>a.A.getLogger("esri.core.urlUtils"),f=n.A.request,d="esri/config: esriConfig.request.proxyUrl is not set.",h=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,p=/^\s*http:/i,g=/^\s*https:/i,y=/^\s*file:/i,b=/:\d+$/,m=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,v=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),_=new RegExp("^((([^[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^[:]*))(:([0-9]+))?$");class w{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=this.uri.match(v);this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),null!=this.authority&&(t=this.authority.match(_),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const A={};let O=new w(n.A.applicationUrl);let S=function(){const e=O.path,t=e.slice(0,e.lastIndexOf("/")+1);return`${O.scheme}://${O.host}${null!=O.port?`:${O.port}`:""}${t}`}();const k=()=>O,E=()=>S;function T(e){if(!e)return null;const t={path:null,query:null},r=new w(e),n=e.indexOf("?");return null===r.query?t.path=e:(t.path=e.slice(0,n),t.query=N(r.query)),r.fragment&&(t.hash=r.fragment,null===r.query&&(t.path=t.path.slice(0,t.path.length-(r.fragment.length+1)))),t}function N(e){const t=e.split("&"),r={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let n,s;t<0?(n=decodeURIComponent(e),s=""):(n=decodeURIComponent(e.slice(0,t)),s=decodeURIComponent(e.slice(t+1)));let o=r[n];"string"==typeof o&&(o=r[n]=[o]),Array.isArray(o)?o.push(s):r[n]=s}return r}function j(e,t){return e?t&&"function"==typeof t?Object.keys(e).map((r=>encodeURIComponent(r)+"="+encodeURIComponent(t(r,e[r])))).join("&"):Object.keys(e).map((r=>{const n=e[r];if(null==n)return"";const s=encodeURIComponent(r)+"=",o=t?.[r];return o?s+encodeURIComponent(o(n)):Array.isArray(n)?n.map((e=>i.A.isSerializable(e)?s+encodeURIComponent(JSON.stringify(e)):s+encodeURIComponent(e))).join("&"):i.A.isSerializable(n)?s+encodeURIComponent(JSON.stringify(n)):s+encodeURIComponent(n)})).filter((e=>e)).join("&"):""}function P(e=!1){let t,r=f.proxyUrl;if("string"==typeof e){t=ae(e);const n=R(e);n&&(r=n.proxyUrl)}else t=!!e;if(!r)throw u().warn(d),new o.A("urlUtils:proxy-not-set",d);return t&&le()&&(r=ce(r)),T(r)}function C(e,t=!1){const r=R(e);let n,s;if(r){const e=M(r.proxyUrl);n=e.path,s=e.query?N(e.query):null}else if(t){const t=P(e);n=t.path,s=t.query}if(n){const t=T(e);e=n+"?"+t.path;const r=j({...s,...t.query});r&&(e=`${e}?${r}`)}return e}const I={path:"",query:""};function M(e){const t=e.indexOf("?");return-1!==t?(I.path=e.slice(0,t),I.query=e.slice(t+1)):(I.path=e,I.query=null),I}function x(e){return(e=ue(e=he(e=M(e).path),!0)).toLowerCase()}function $(e){const t={proxyUrl:e.proxyUrl,urlPrefix:x(e.urlPrefix)},r=f.proxyRules,n=t.urlPrefix;let s=r.length;for(let e=0;e<r.length;e++){const t=r[e].urlPrefix;if(0===n.indexOf(t)){if(n.length===t.length)return-1;s=e;break}0===t.indexOf(n)&&(s=e+1)}return r.splice(s,0,t),s}function R(e){const t=f.proxyRules,r=x(e);for(let e=0;e<t.length;e++)if(0===r.indexOf(t[e].urlPrefix))return t[e]}function D(e,t){if(!e||!t)return!1;e=L(e),t=L(t);const r=(0,c.py)(e),n=(0,c.py)(t);return null!=r&&null!=n?r.portalHostname===n.portalHostname:null==r&&null==n&&z(e,t,!0)}function U(e,t){return e=L(e),t=L(t),ue(e)===ue(t)}function L(e){const t=(e=G(e)).indexOf("/sharing");return t>0?e.slice(0,t):e.replace(/\/+$/,"")}function q(e,t=f.interceptors){const r=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t);if(t)for(const e of t)if(Array.isArray(e.urls)){if(e.urls.some(r))return e}else if(r(e.urls))return e;return null}function z(e,t,r=!1){if(!e||!t)return!1;const n=ye(e),s=ye(t);return!(!r&&n.scheme!==s.scheme)&&null!=n.host&&null!=s.host&&n.host.toLowerCase()===s.host.toLowerCase()&&n.port===s.port}function B(e){if("string"==typeof e){if(!K(e))return!0;e=ye(e)}if(z(e,O))return!0;const t=f.trustedServers||[];for(let r=0;r<t.length;r++){const n=F(t[r]);for(let t=0;t<n.length;t++)if(z(e,n[t]))return!0}return!1}function F(e){return A[e]||(ie(e)||oe(e)?A[e]=[new w(J(e))]:A[e]=[new w(`http://${e}`),new w(`https://${e}`)]),A[e]}function J(e,t=S,r){return oe(e)?r?.preserveProtocolRelative?e:"http"===O.scheme&&O.authority===V(e).slice(2)?`http:${e}`:`https:${e}`:ie(e)?e:H("/"===e[0]?function(e){const t=e.indexOf("//"),r=e.indexOf("/",t+2);return-1===r?e:e.slice(0,r)}(t):t,e)}function W(e,t=S,r){if(null==e||!K(e))return e;const n=G(e),s=n.toLowerCase(),o=G(t).toLowerCase().replace(/\/+$/,""),i=r?G(r).toLowerCase().replace(/\/+$/,""):null;if(i&&0!==o.indexOf(i))return e;const a=(e,t,r)=>-1===(r=e.indexOf(t,r))?e.length:r;let c=a(s,"/",s.indexOf("//")+2),l=-1;for(;s.slice(0,c+1)===o.slice(0,c)+"/"&&(l=c+1,c!==s.length);)c=a(s,"/",c+1);if(-1===l)return e;if(i&&l<i.length)return e;e=n.slice(l);const u=o.slice(l-1).replaceAll(/[^/]+/g,"").length;if(u>0)for(let t=0;t<u;t++)e=`../${e}`;else e=`./${e}`;return e}function G(e){return function(e){const t=f.httpsDomains;if(!function(e){return null!=e&&p.test(e)||"http"===O.scheme&&oe(e)}(e))return e;const r=e.indexOf("/",7);let n;if(n=-1===r?e:e.slice(0,r),n=n.toLowerCase().slice(7),b.test(n)){if(!n.endsWith(":80"))return e;n=n.slice(0,-3),e=e.replace(":80","")}return"http"===O.scheme&&n===O.authority&&!m.test(e)||(le()&&n===O.authority||t&&t.some((e=>n===e||n.endsWith(`.${e}`)))||le()&&!R(e))&&(e=ce(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=M(e);e=(e=t.path.replaceAll(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=J(e=e.trim()))))}function H(...e){const t=e.filter(s.Ru);if(!t?.length)return;const r=[];if(K(t[0])){const e=t[0],n=e.indexOf("//");-1!==n&&(r.push(e.slice(0,n+1)),function(e){return null!=e&&y.test(e)}(t[0])&&(r[0]+="/"),t[0]=e.slice(n+2))}else"/"===t[0][0]&&r.push("");const n=t.reduce(((e,t)=>t?e.concat(t.split("/")):e),[]);for(let e=0;e<n.length;e++){const t=n[e];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&e===n.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function V(e,t=!1){if(null==e||Y(e)||Z(e))return null;let r=e.indexOf("://");if(-1===r&&oe(e))r=2;else{if(-1===r)return null;r+=3}const n=e.indexOf("/",r);return-1!==n&&(e=e.slice(0,n)),t&&(e=ue(e,!0)),e}function K(e){return oe(e)||ie(e)}function Y(e){return null!=e&&"blob:"===e.slice(0,5)}function Z(e){return null!=e&&"data:"===e.slice(0,5)}function X(e){const t=te(e);return t?.isBase64?(0,l.M)(t.data):null}function Q(e){return(0,l.Y)(e).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}const ee=/^data:(.*?)(;base64)?,(.*)$/;function te(e){const t=e.match(ee);if(!t)return null;const[,r,n,s]=t;return{mediaType:r,isBase64:!!n,data:s}}function re(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}async function ne(e){return(await fetch(e)).blob()}function se(e){const t=X(e);if(!t)return null;const r=te(e);return new Blob([t],{type:r.mediaType})}function oe(e){return null!=e&&"/"===e[0]&&"/"===e[1]}function ie(e){return null!=e&&h.test(e)}function ae(e){return null!=e&&g.test(e)||"https"===O.scheme&&oe(e)}function ce(e){return oe(e)?`https:${e}`:e.replace(p,"https:")}function le(){return"https"===O.scheme}function ue(e,t=!1){return oe(e)?e.slice(2):(e=e.replace(h,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function fe(e){let t=0;if(K(e)){const r=e.indexOf("//");-1!==r&&(t=r+2)}const r=e.lastIndexOf("/");return r<t?e:e.slice(0,r+1)}function de(e,t){if(!e)return"";const r=T(e).path.replace(/\/+$/,""),n=r.slice(r.lastIndexOf("/")+1);if(!t?.length)return n;const s=new RegExp(`\\.(${t.join("|")})$`,"i");return n.replace(s,"")}function he(e){return e.endsWith("/")?e:`${e}/`}function pe(e){return e.replace(/\/+$/,"")}function ge(e,t,r){if(!(t&&r&&e&&K(e)))return e;const n=e.indexOf("//"),s=e.indexOf("/",n+2),o=e.indexOf(":",n+2),i=Math.min(s<0?e.length:s,o<0?e.length:o);return e.slice(n+2,i).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,n+2)}${r}${e.slice(i)}`}function ye(e){return"string"==typeof e?new w(J(e)):(e.scheme||(e.scheme=O.scheme),e)}function be(e,t){const r=T(e),n=Object.keys(r.query||{});return n.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${n.join(", ")}.`),r.path}function me(e,t,r){const n=T(e),s=n.query||{};return s[t]=String(r),`${n.path}?${j(s)}`}function ve(e,t){if(!t)return e;const r=T(e),n=r.query||{};for(const[e,r]of Object.entries(t))null!=r&&(n[e]=r);const s=j(n);return s?`${r.path}?${s}`:r.path}function _e(e){if(null==e)return null;const t=e.match(Oe);return t?t[2]:null}function we(e){if(null==e)return null;const t=e.match(Oe);return t?{path:t[1],extension:t[2]}:{path:e,extension:null}}async function Ae(e){return"string"==typeof e?te(e)??{data:e}:new Promise(((t,r)=>{const n=new FileReader;n.readAsDataURL(e),n.onload=()=>t(te(n.result)),n.onerror=e=>r(e)}))}const Oe=/([^.]*)\.([^/]*)$/},52268:(e,t,r)=>{"use strict";function n(e,t){return new Proxy({},{get:(r,n,s)=>(...r)=>{let s,o;const i=r[r.length-1];return function(e){return"object"==typeof e&&!Array.isArray(e)&&null!=e&&("signal"in e||"transferList"in e||0===Object.keys(e).length)}(i)&&(s=i.signal,o=i.transferList,r.pop()),e.apply(t?`${t}.${n.toString()}`:n.toString(),r,{transferList:o,signal:s})}})}r.d(t,{L:()=>n})},61322:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>_});var n=r(70333),s=r(49186),o=r(37955),i=r(36563),a=r(97768),c=r(74887),l=r(52268);const u={statsWorker:()=>Promise.all([r.e(6285),r.e(4996),r.e(8902),r.e(4080),r.e(7455),r.e(8417),r.e(201),r.e(3009)]).then(r.bind(r,33009)),geometryEngineWorker:()=>Promise.all([r.e(9930),r.e(6387)]).then(r.bind(r,68887)),CSVSourceWorker:()=>Promise.all([r.e(6285),r.e(7251),r.e(8368),r.e(4996),r.e(8902),r.e(4080),r.e(7455),r.e(7339),r.e(8417),r.e(708),r.e(201),r.e(8660),r.e(6781)]).then(r.bind(r,40752)),EdgeProcessingWorker:()=>Promise.all([r.e(3030),r.e(9899),r.e(7346)]).then(r.bind(r,71936)),ElevationSamplerWorker:()=>Promise.all([r.e(7251),r.e(4996),r.e(8902),r.e(4080),r.e(7455),r.e(3030),r.e(2324)]).then(r.bind(r,38419)),FeatureServiceSnappingSourceWorker:()=>Promise.all([r.e(6285),r.e(7251),r.e(8368),r.e(4996),r.e(8902),r.e(4080),r.e(7455),r.e(893),r.e(7339),r.e(8417),r.e(708),r.e(201),r.e(8660),r.e(3427)]).then(r.bind(r,12543)),GeoJSONSourceWorker:()=>Promise.all([r.e(6285),r.e(7251),r.e(8368),r.e(4996),r.e(8902),r.e(4080),r.e(7455),r.e(7339),r.e(8417),r.e(708),r.e(201),r.e(8660),r.e(629)]).then(r.bind(r,71202)),LercWorker:()=>r.e(7087).then(r.bind(r,57087)),MemorySourceWorker:()=>Promise.all([r.e(6285),r.e(7251),r.e(8368),r.e(4996),r.e(8902),r.e(4080),r.e(7455),r.e(7339),r.e(8417),r.e(708),r.e(201),r.e(8660),r.e(8985)]).then(r.bind(r,29432)),PBFDecoderWorker:()=>Promise.all([r.e(4996),r.e(8902),r.e(4080),r.e(708),r.e(9748)]).then(r.bind(r,97367)),FeaturePipelineWorker:()=>Promise.all([r.e(6285),r.e(587),r.e(6311),r.e(7251),r.e(8368),r.e(4996),r.e(8902),r.e(4080),r.e(7455),r.e(893),r.e(7339),r.e(8417),r.e(708),r.e(201),r.e(2626),r.e(9949),r.e(9423),r.e(5263),r.e(821),r.e(6020)]).then(r.bind(r,16020)),PointCloudWorker:()=>Promise.all([r.e(4996),r.e(7455),r.e(690),r.e(2944),r.e(7984),r.e(378)]).then(r.bind(r,34142)),RasterWorker:()=>Promise.all([r.e(7251),r.e(4996),r.e(8902),r.e(4080),r.e(984),r.e(6049),r.e(4055)]).then(r.bind(r,30139)),SceneLayerSnappingSourceWorker:()=>Promise.all([r.e(7455),r.e(690),r.e(3030),r.e(9899),r.e(6064)]).then(r.bind(r,46064)),SceneLayerWorker:()=>Promise.all([r.e(6285),r.e(7251),r.e(4996),r.e(8902),r.e(4080),r.e(7455),r.e(690),r.e(8417),r.e(2944),r.e(9868),r.e(4654),r.e(5456)]).then(r.bind(r,36233)),WFSSourceWorker:()=>Promise.all([r.e(6285),r.e(7251),r.e(8368),r.e(4996),r.e(8902),r.e(4080),r.e(7455),r.e(7339),r.e(8417),r.e(708),r.e(201),r.e(8660),r.e(4444)]).then(r.bind(r,33771)),WorkerTileHandler:()=>Promise.all([r.e(4996),r.e(8902),r.e(9949),r.e(5013),r.e(9423),r.e(3379)]).then(r.bind(r,11764)),Lyr3DWorker:()=>r.e(9234).then(r.bind(r,79234)),Feature3DPipelineWorker:()=>Promise.all([r.e(6285),r.e(3874),r.e(1147),r.e(587),r.e(7251),r.e(8368),r.e(4996),r.e(8902),r.e(4080),r.e(7455),r.e(893),r.e(690),r.e(7339),r.e(8417),r.e(708),r.e(3030),r.e(201),r.e(2944),r.e(9899),r.e(9868),r.e(2626),r.e(655),r.e(2728),r.e(5263),r.e(9855)]).then(r.bind(r,62025)),TextureCompressionWorker:()=>r.e(3308).then(r.bind(r,13308))};var f=r(8341),d=r(18357);const{CLOSE:h,ABORT:p,INVOKE:g,RESPONSE:y,OPEN_PORT:b,ON:m}=f.Go;class v{constructor(e){this._invoke=e,this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._timer=null,this._process=this._process.bind(this)}push(e){e.type===f.Go.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 _{static connect(e,t){const r=new MessageChannel;let n;n="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const s=new _(r.port1,{channel:r,client:n,schedule:t});return"object"==typeof n&&"remoteClient"in n&&(n.remoteClient=s),_.clients.set(s,n),r.port2}static loadWorker(e){const t=u[e];return t?t():Promise.resolve(null)}constructor(e,t,r){this._port=e,this._jobQueue=r,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new v((e=>this._onInvokeMessage(e))),this._client=t.client,this._onMessage=this._onMessage.bind(this),this._channel=t.channel,this._schedule=t.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}close(){this._post({type:h}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,r){return this.apply(e,[t],r)}apply(e,t,r){const n=r?.signal,o=r?.transferList;if(!this._port)return Promise.reject(new s.A(f.T,`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const i=(0,f.Jc)();return new Promise(((r,s)=>{if((0,c.G4)(n))return this._processWork(),void s((0,c.NK)());const l=(0,c.u7)(n,(()=>{const e=this._outJobs.get(i);e&&(this._outJobs.delete(i),this._processWork(),(0,a.xt)(e.abortHandle),this._post({type:p,jobId:i}),s((0,c.NK)()))})),u={resolve:r,reject:s,abortHandle:l,debugInfo:e};this._outJobs.set(i,u),this._post({type:g,jobId:i,methodName:e,abortable:null!=n},t,o)}))}createInvokeProxy(e){return(0,l.L)(this,e)}on(e,t){const r=new MessageChannel;function n(e){t(e.data)}return this._port.postMessage({type:f.Go.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),(0,i.hA)((()=>{r.port1.postMessage({type:f.Go.CLOSE}),r.port1.close(),r.port1.removeEventListener("message",n)}))}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:b,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=2)return;const e=this._jobQueue?.pop();if(!e)return;const{methodName:t,data:r,invokeOptions:n,resolver:s}=e;this.apply(t,r,n).then((e=>s.resolve(e))).catch((e=>s.reject(e)))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{(0,a.xt)(e.abortHandle),e.reject((0,c.NK)(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=null,this._client=null,this._schedule=null}_onMessage(e){null!=this._schedule?this._schedule((()=>this._processMessage(e,!0))):this._processMessage(e,!1)}_processMessage(e,t){const r=(0,f.VI)(e);if(r)switch(r.type){case y:this._onResponseMessage(r);break;case g:t?this._onInvokeMessage(r):this._invokeQueue.push(r);break;case p:this._onAbortMessage(r);break;case h:this._onCloseMessage();break;case b:this._onOpenPortMessage(r);break;case m:this._onOnMessage(r)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),t.delete(r))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&_.clients.get(this)===e&&e.destroy(),_.clients.delete(this),e?.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n=[],abortable:s}=e,o=s?new AbortController:null,i=this._inJobs;let a,l=this._client,u=l[t];try{if(!u&&t&&t.includes(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)l=l[e[t]],u=l[e[t+1]]}if("function"!=typeof u)throw new TypeError(`${t} is not a function`);n.push({client:this,signal:o?o.signal:null}),a=u.apply(l,n)}catch(e){return void this._post({type:y,jobId:r,error:(0,f.mF)(e)})}(0,c.$X)(a)?(i.set(r,{controller:o,promise:a}),a.then((e=>{i.has(r)&&(i.delete(r),this._post({type:y,jobId:r},e))}),(e=>{i.has(r)&&(i.delete(r),(0,c.zf)(e)||this._post({type:y,jobId:r,error:(0,f.mF)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:y,jobId:r},a)}_onOpenPortMessage(e){new _(e.port,{client:this._client})}_onOnMessage(e){const{port:t}=e,r=this._client.on(e.eventType,(e=>{t.postMessage(e)})),n=(0,o.on)(e.port,"message",(e=>{const s=(0,f.VI)(e);s?.type===f.Go.CLOSE&&(n.remove(),r.remove(),t.close())}))}_onResponseMessage(e){const{jobId:t,error:r,data:n}=e,o=this._outJobs;if(!o.has(t))return;const i=o.get(t);o.delete(t),this._processWork(),(0,a.xt)(i.abortHandle),r?i.reject(s.A.fromJSON(JSON.parse(r))):i.resolve(n)}_post(e,t,r){return(0,f.u1)(this._port,e,t,r)}}_.kernelInfo={buildDate:d.$,fullVersion:n.ol,revision:d.u},_.clients=new Map},8341:(e,t,r)=>{"use strict";r.d(t,{Go:()=>i,Jc:()=>l,T:()=>o,VI:()=>d,mF:()=>u,oV:()=>p,u1:()=>f});var n=r(44208),s=r(74887);const o="worker:port-closed";var i,a;(a=i||(i={}))[a.HANDSHAKE=0]="HANDSHAKE",a[a.OPEN=1]="OPEN",a[a.OPENED=2]="OPENED",a[a.RESPONSE=3]="RESPONSE",a[a.INVOKE=4]="INVOKE",a[a.ABORT=5]="ABORT",a[a.CLOSE=6]="CLOSE",a[a.OPEN_PORT=7]="OPEN_PORT",a[a.ON=8]="ON";let c=0;function l(){return c++}function u(e){return e?"string"==typeof e?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function f(e,t,r,s){if(t.type===i.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==i.INVOKE&&t.type!==i.RESPONSE)return void e.postMessage(t);let o;if(function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(r)?(o=h(r.transferList),t.data=r.result):(o=h(s),t.data=r),o){if((0,n.A)("ff"))for(const r of o)if("byteLength"in r&&r.byteLength>267386880){const r="Worker call with large ArrayBuffer would crash Firefox";switch(t.type){case i.INVOKE:throw r;case i.RESPONSE:return void f(e,{type:i.RESPONSE,jobId:t.jobId,error:u(r)})}}e.postMessage(t,o)}else e.postMessage(t)}function d(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function h(e){if(!e?.length)return null;if((0,n.A)("esri-workers-arraybuffer-transfer"))return e;const t=e.filter((e=>!function(e){return e instanceof ArrayBuffer||"ArrayBuffer"===e?.constructor?.name}(e)));return t.length?t:null}async function p(e){try{return await e}catch(e){const t=e?.name===o;if(!(0,s.zf)(e)&&!t)throw e;return}}},70333:(e,t,r)=>{"use strict";r.d(t,{Aq:()=>l,Y3:()=>u,id:()=>a,ol:()=>c,rE:()=>i});var n=r(44208),s=r(84952),o=r(18357);Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const i="4.32";let a,c=i;function l(e){a=e}function u(e){const t=a?.findCredential(e);return t?.token?(0,s.rs)(e,"token",t.token):e}c=`4.32.0-next.${o.$}`,(0,n.A)("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),(0,n.A)("host-webworker")},39131:(e,t,r)=>{"use strict";r.d(t,{$E:()=>i,py:()=>o,qG:()=>a});const n=/^https:\/\/([a-z\d-]+)(\.maps([^.]*))?\.arcgis\.com/i,s={devext:{customBaseUrl:"mapsdevext.arcgis.com",portalHostname:"devext.arcgis.com"},qaext:{customBaseUrl:"mapsqa.arcgis.com",portalHostname:"qaext.arcgis.com"},www:{customBaseUrl:"maps.arcgis.com",portalHostname:"www.arcgis.com"}};function o(e){const t=e?.match(n);if(!t)return null;const[,r,o,i]=t;if(!r)return null;let a=null,c=null,l=null;const{devext:u,qaext:f,www:d}=s;if(o)if(a=r,i)switch(i.toLowerCase()){case"devext":({customBaseUrl:c,portalHostname:l}=u);break;case"qa":({customBaseUrl:c,portalHostname:l}=f);break;default:return null}else({customBaseUrl:c,portalHostname:l}=d);else switch(r.toLowerCase()){case"devext":({customBaseUrl:c,portalHostname:l}=u);break;case"qaext":({customBaseUrl:c,portalHostname:l}=f);break;case"www":({customBaseUrl:c,portalHostname:l}=d);break;default:return null}return{customBaseUrl:c,isPortal:!1,portalHostname:l,urlKey:a}}function i(e){return/\/(sharing|usrsvcs)\/(appservices|servers)\//i.test(e)}function a(e){const t=/^https?:\/\/(?:cdn|[a-z\d-]+\.maps)\.arcgis\.com/i,r=/^https?:\/\/(?:cdndev|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,n=/^https?:\/\/(?:cdnqa|[a-z\d-]+\.mapsqa)\.arcgis\.com/i;return t.test(e)?e=e.replace(t,"https://www.arcgis.com"):r.test(e)?e=e.replace(r,"https://devext.arcgis.com"):n.test(e)&&(e=e.replace(n,"https://qaext.arcgis.com")),e}},26306:(e,t,r)=>{"use strict";function n(e){const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r.buffer}function s(e){const t=new Uint8Array(e);let r="";for(let e=0;e<t.length;e++)r+=String.fromCharCode(t[e]);return btoa(r)}r.d(t,{M:()=>n,Y:()=>s})},18357:(e,t,r)=>{"use strict";r.d(t,{$:()=>n,u:()=>s});const n="20241227",s="273132fb8aa762e1fa9260b678733e80c1c29619"}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.m=e,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"chunks/"+{13:"e5d55a35dace70239902",36:"6a737f056b2b95f09776",146:"a1a698b28d28afabc9f6",154:"e1913990f30d285b3b15",177:"78683f1aadc1377be5fd",191:"090697a2a46210da2111",201:"69efc716991a407c3d23",224:"756c2f7c8659deab6c96",309:"785610aa615198fd3815",349:"198d74db9631a66bd850",367:"816c9c81352cd0ca8ce8",369:"3871d2ecef5bcf6ac14f",378:"faf9063420262ea40fd8",382:"ad19e3eaa339b0d6cb44",475:"dd34df14eb4940e2497b",587:"29b610ff44708e044cbd",629:"9a498f2c007f4d78d4dd",655:"23fe65988dbc9e5d7842",690:"9a30ad773c22bde61c64",692:"59bf879b4802a5ba431e",708:"f2cdb7be3fd65f65c30b",812:"a1cd84b70030c94d7908",820:"339e7a900e2bba9d3647",821:"dce55e7f76adecc055c3",830:"f25c04cf1a4bc1d2636a",893:"94432e04de01ee7adc0e",980:"76fa5c7c87831ad25cde",984:"6e254e846e284223ef63",1e3:"943428cf643e87ccfaad",1053:"71bd94cc789a55910f92",1147:"d965090565a802cd2403",1204:"e8ae8a11d8439e2a66ad",1273:"4ffaa2c5ab47a599ee9f",1275:"4446888fbf1f864c3f93",1277:"993db7646a8fc60179eb",1346:"d14e4fc82ad772899336",1384:"d181447e2be06beaa23f",1402:"fa1c68f2ffcdff7986b6",1469:"d9e396adf3354ee68339",1493:"d56d77125798beb7e493",1528:"53e0ea2f7f642e553123",1598:"59455e2dd44b4c01cc76",1728:"127c82cdb229434883b6",1756:"c205e2310a367be57cc3",1761:"7ea3d652536e1d79dfc6",1867:"60b40b2319d1651dd150",1904:"6e9123d7b57a77347ec0",2018:"a776f71b4c7b8728a973",2029:"ecf317c6c790b3cc83bf",2083:"178f606c8896ae5f39de",2153:"d07da8b63d83af179a2c",2165:"a100fb789d72410f8d4f",2180:"243520d9f4a118e63bbc",2186:"9fde9309cb64f1a9301c",2324:"5ea6f9fa41485e5bdbba",2343:"57c1370b310768c0790a",2372:"f5958a67705b4428d7fa",2390:"6ee586c3ea7bb0341c75",2558:"5b32e881762686318a83",2593:"367af4aa7e170c8553e3",2626:"16530347bd78dc6c2fcd",2728:"0191142d5f55cc8cf37a",2731:"6b0baecbd35d26393dcf",2830:"31d9f0a37a5d0a1c450b",2935:"85983548e2d412d99b15",2944:"ef6afba80fa2086ec104",2958:"f717ca7c2581c31de7a6",2980:"263adfd1c2641ef5c0f5",3009:"c0af54cc5938176ce764",3029:"47745c4f74830f981fd4",3030:"5660f13d78e9e4240034",3091:"35f3eef81fac7924a487",3103:"a3cef3837f4df9ab022e",3166:"9b020c47ca9ff5de9bb8",3201:"da5fc368eb5b3592d05e",3209:"f5bf92c315c2944863d1",3308:"6332da54159d72a6ce66",3334:"aedff36d3fec86abb9fb",3359:"8249351daa45ca82ca0c",3379:"0d387baa64a89f88b1de",3390:"5c11e2e65b97565e5003",3427:"dea76ba18acf372beb42",3492:"87f33a60768801ca1ce8",3543:"a7a39a826ce944c15b77",3561:"ed3fb3ea29a2be226322",3582:"5a0eb9dfe668cf290462",3600:"4746b7afa90ea3641e60",3618:"f0adabf6d71a27f3183b",3656:"6592f6eee6bcdb1f3f08",3666:"eef2d94a73064f9bc085",3874:"4b5dbdcad438cb2dd4bf",3920:"3ed7c8138231de3a3b96",3930:"c1c216b0aebe86311fae",3937:"28dd172faa85080511c5",4022:"b1e4813f0c73fc2a483c",4055:"cebdf2f88c4d2ad8baab",4080:"9f7e1a653559fe3edd9a",4111:"0d2411a941c42acb8cc2",4196:"3bb94da29dac3367ecc6",4229:"0837a630e12a21fc2e50",4374:"2a8517b43f93b9d7b4a8",4399:"0f3912bca9fe25eea75c",4405:"66fb341dea20359d47d8",4444:"bff74200a0df0950cf08",4575:"801dbea20966806db1c9",4594:"1100d9d114287b6443e2",4612:"a90611cdc86190799560",4654:"955421ee2247965244f0",4727:"9f0ebeae8a3ba360284b",4796:"1a713cc601c6fcd97d2f",4948:"cc6160e8ab3cea4040c2",4996:"3600125c58d5d04c515a",5013:"048d296efa26ccd79056",5141:"3a2eaa334845cac4d497",5165:"369bfd374dad0b177d79",5178:"f81e63f79256f70ad1c0",5220:"8e60de347b209a753c73",5257:"f92d76b694ff0cdb212c",5263:"1d8609ba413e8a172719",5356:"f9af0473878d960a02f2",5367:"090cfc7f088a729afd47",5404:"a77aa86896bbb0e088df",5456:"cb3af81e1fe6405c4885",5494:"487659783c5154fa6cf5",5613:"88c68881cbdf4e911832",5664:"10fa211987b16fd71a1a",5740:"2427a01678f3d9fbf30b",5754:"fa331c8b556bb7fb8ae3",5804:"46f6a190e3c943b44095",5943:"f5bec71c070086a40ba7",5989:"2209278697ed1d9232ea",6020:"648d7d8fa19a2e772c89",6049:"07304287ed5244fa4e12",6052:"deffd56e39ce725ce377",6064:"71f6e5742cf0c482066b",6131:"111d95d460eab7ebddbb",6165:"0e0b978459d70b15acb5",6183:"cbf57abb537e86c1dd7f",6187:"762567124623f6d11e67",6247:"d45c406c051ab8b33196",6285:"f2a6287c8d28be24f71e",6298:"c6085784a47d8afb36de",6311:"a010c05a876baa0834f3",6343:"bd37c9cc720587665fd3",6387:"89150d12c66c555afacf",6650:"bd3589e49c37ed1a77d3",6676:"533a7fd64b17bb294545",6742:"b611f46835edcd6eefcc",6781:"3a90163b76b0bc7f21d2",6950:"200a5f1864c2c2f7536c",6986:"015285436ca965f94e17",7087:"d9c34e07627d93d4670b",7112:"e2f91098793b8742fae6",7136:"79f9310179c938f18367",7159:"45534f249dc850d34f1f",7251:"f5b57274c3f49ccbcf2e",7292:"e16d2521f006724697c2",7301:"388dc6d50e16930aa66f",7339:"250a810dd4e1ff293564",7346:"4086698137db0795187f",7367:"0b3e1e903120da297641",7375:"8be3a985e9a9de39c4fa",7455:"a6ec3665bde2af8a96e6",7546:"fdf49f8152eba2bb7f6d",7550:"8e42fb623f56942958d8",7561:"664aa401887b59abd7b7",7656:"0bff1b0b11fa2727a11c",7836:"ebf9caf2dc8af89afec2",7899:"66b411119b8ffb99b9dc",7982:"9ad7d095e614e7e8d7f5",7984:"9fc49968dea8e2b64f3e",8003:"210e3553bd91311c8dff",8018:"0673d811c496143fc3d4",8096:"bab541feca7ab4d3f993",8098:"bf0a0ca7fdac98f06a89",8153:"b48bc5a86164ef4c2dae",8219:"348d99b0d64df68a0a9a",8241:"b372a0aab338a5ecad7c",8256:"56ca9d525e63c8536bad",8301:"fdd8a5eb07466541f1f9",8330:"ddce265c46e4dfeb6c6d",8342:"56fc353421252f2d0a99",8368:"c98d90ad85b2582360c9",8392:"c80507443f896dbfaba6",8417:"9372d08ba8bf3342c48f",8463:"19d72185d50ba1ebff50",8480:"b8a6c836e1e90ceccfdb",8541:"b4d76d46661aba356ea3",8628:"1c60000b2888fd84d707",8660:"0e0ee4cb722f6e183bf6",8682:"457d4abc938d14f28e31",8692:"de5c1d54c581407262b2",8846:"b863951a5596d44dbeb2",8902:"0e735d01296d340b393e",8928:"3029354194f1a3030c5c",8958:"9f495ad57cdbfa90c5b8",8969:"7ce1f952f3a809fafb95",8985:"67c7bdc0c91a8f803ea8",9013:"6c1470dc0bd4389d1a2d",9035:"2cccaf50134c65944e0a",9062:"ea250d66089967976c05",9177:"7156d2ae914e1add0109",9186:"7b4c8b32af32a6d945a7",9234:"54eeae28c0d9b2515819",9239:"3d60da85bcca2a3177e9",9321:"c4e2b75b9135920babc3",9340:"0a3bf1b74cce1b6b7ed8",9384:"ec9d5af8887854e821c8",9423:"7b4880b2dc6b01d70ccc",9465:"23a697d48f6e45cc033e",9547:"7bf7aace72f81f5de4e4",9564:"a0b3d70a1b0360084593",9588:"a69e885336eb5d2729fd",9695:"a8ca37a9d5c9357aa1f8",9728:"9291508232b23f030178",9748:"c08cb75c3eef6c45f604",9838:"8f31fbb1d549230ee3db",9853:"4c56698cf1c669371865",9855:"2d908c115ea18e813b95",9868:"7de9c01849c4aa1940e7",9899:"fe817283bbcbca8fb296",9930:"9f312f7284e506a84ed7",9933:"e2be5e8e196784f00edc",9949:"401588b9d18866ed83e2"}[e]+".js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var s=n.length-1;s>-1&&(!e||!/^http(s?):/.test(e));)e=n[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={76:1};r.f.i=(t,n)=>{e[t]||importScripts(r.p+r.u(t))};var t=self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[],n=t.push.bind(t);t.push=t=>{var[s,o,i]=t;for(var a in o)r.o(o,a)&&(r.m[a]=o[a]);for(i&&i(r);s.length;)e[s.pop()]=1;n(t)}})(),r(2131);var n=r(61322);RemoteClient=n})();
1
+ var RemoteClient;(()=>{var e={2131:(e,t,r)=>{r.p=self.esriConfig.assetsPath+"/esri/core/workers/"},90237:(e,t,r)=>{"use strict";function n(e,t,r,n){var s,o=arguments.length,i=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(i=(o<3?s(i):o>3?s(t,r,i):s(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i}function s(e,t){return function(r,n){t(r,n,e)}}function o(e,t,r){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,s;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(s=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");s&&(n=function(){try{s.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}r.d(t,{_:()=>n,a:()=>s,b:()=>o,c:()=>a});var i="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function a(e){function t(t){e.error=e.hasError?new i(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var r,n=0;return function s(){for(;r=e.stack.pop();)try{if(!r.async&&1===n)return n=0,e.stack.push(r),Promise.resolve().then(s);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(o).then(s,(function(e){return t(e),s()}))}else n|=1}catch(e){t(e)}if(1===n)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}},92602:(e,t,r)=>{"use strict";r.d(t,{A:()=>o}),r(44208);var n=r(93637),s=r(18357);const o={apiKey:void 0,applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,n.$N)(o,globalThis.esriConfig,!0),delete o.has),!o.assetsPath){{const e="4.32.0";o.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}-next.${s.$}/assets`}o.defaultAssetsPath=o.assetsPath}},69622:(e,t,r)=>{"use strict";r.d(t,{A:()=>x});var n=r(51447),s=r(71511),o=r(53966),i=r(97768),a=r(56454),c=r(16649),l=r(45873),u=r(96156),f=(r(44208),r(4718)),d=r(93687),h=r(11406),p=r(35666),g=r(62788),y=r(47328),b=r(67867);class m extends h.T{constructor(e,t){super(),this.propertyName=e,this.metadata=t,this.trackingTarget=new b.R(this),this.flags=0,this.flags=y.i.Dirty|(t.nonNullable?y.i.NonNullable:0)|(t.hasOwnProperty("value")?y.i.HasDefaultValue:0)|(void 0===t.get?y.i.DepTrackingInitialized:0)|(void 0===t.dependsOn?y.i.AutoTracked:0)}destroy(){this.flags&y.i.Dirty&&this.onCommitted(),super.destroy(),this.trackingTarget.destroy()}getComputed(e){e.mutable&&(0,g.gc)(this);const t=e.store,r=this.propertyName,n=this.flags,s=t.get(r);if(n&y.i.Computing)return s;if(~n&y.i.Dirty&&t.has(r))return s;this.flags|=y.i.Computing;const o=e.host;let i;n&y.i.AutoTracked?i=(0,g.a)(this.trackingTarget,this.metadata.get,o):((0,g.Xr)(o,this),i=this.metadata.get.call(o)),this.flags|=y.i.DepTrackingInitialized,t.set(r,i,p.Gr.COMPUTED);const a=t.get(r);return a===s?this.flags&=~y.i.Dirty:(0,g.F_)(this.commit,this),this.flags&=~y.i.Computing,a}notifyChange(){this.onInvalidated(),this.onCommitted()}invalidate(){this.onInvalidated()}commit(){this.flags&=~y.i.Dirty,this.onCommitted()}onInvalidated(){~this.flags&y.i.Overridden&&(this.flags|=y.i.Dirty);const e=this._observers;if(e&&e.length>0)for(const t of e)t.onInvalidated()}onCommitted(){const e=this._observers;if(e&&e.length>0){const t=e.slice();for(const e of t)e.onCommitted()}}}class v{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(e){const t=new v;return this._values.forEach(((r,n)=>{e&&e.has(n)||t.set(n,(0,f.o8)(r))})),t}get(e){return this._values.get(e)}originOf(){return p.Gr.USER}keys(){return[...this._values.keys()]}set(e,t){this._values.set(e,t)}delete(e){this._values.delete(e)}has(e){return this._values.has(e)}forEach(e){this._values.forEach(e)}}function _(e,t,r){return void 0!==e}function w(e,t,r,n){return!(void 0===e||null==r&&e.flags&y.i.NonNullable&&(n.lifecycle,l.v.INITIALIZING,1))}class A{constructor(e){this.host=e,this.propertiesByName=new Map,this.ctorArgs=null,this.lifecycle=l.v.INITIALIZING,this.store=new v,this.mutable=!0,this._origin=p.Gr.USER;const t=this.host.constructor.__accessorMetadata__;for(const e in t){const r=new m(e,t[e]);this.propertiesByName.set(e,r)}this.metadata=t}initialize(){this.lifecycle=l.v.CONSTRUCTING}constructed(){this.lifecycle=l.v.CONSTRUCTED}destroy(){this.lifecycle=l.v.DESTROYED,this.propertiesByName.forEach((e=>e.destroy()))}get initialized(){return this.lifecycle!==l.v.INITIALIZING}get(e){const t=this.propertiesByName.get(e);if(t.metadata.get)return t.getComputed(this);this.mutable&&(0,g.gc)(t);const r=this.store;return r.has(e)?r.get(e):t.metadata.value}originOf(e){const t=this.store.originOf(e);if(void 0===t){const t=this.propertiesByName.get(e);if(void 0!==t&&t.flags&y.i.HasDefaultValue)return"defaults"}return(0,p.OL)(t)}has(e){return this.propertiesByName.has(e)&&this.store.has(e)}keys(){return[...this.propertiesByName.keys()]}internalGet(e){const t=this.propertiesByName.get(e);if(_(t))return this.store.has(e)?this.store.get(e):t.metadata.value}internalSet(e,t){const r=this.propertiesByName.get(e);_(r)&&this._internalSet(r,t)}getDependsInfo(e,t,r){const n=this.propertiesByName.get(t);if(!_(n))return"";const s=new b.R,o=(0,g.a)(s,(()=>n.metadata.get?.call(e)));let i=`${r}${e.declaredClass.split(".").pop()}.${t}: ${o}\n`;const a=s.accessed??new Set;if(0===a.size)return i;r+=" ";for(const e of a)e instanceof m&&(i+=`${r}${e.propertyName}: undefined\n`);return i}setAtOrigin(e,t,r){const n=this.propertiesByName.get(e);if(_(n))return this._setAtOrigin(n,t,r)}isOverridden(e){const t=this.propertiesByName.get(e);return void 0!==t&&!!(t.flags&y.i.Overridden)}clearOverride(e){const t=this.propertiesByName.get(e);t&&t.flags&y.i.Overridden&&(t.flags&=~y.i.Overridden,t.notifyChange())}override(e,t){const r=this.propertiesByName.get(e);if(!w(r,0,t,this))return;const n=r.metadata.cast;if(n){const e=this._cast(n,t),{valid:r,value:s}=e;if(O.release(e),!r)return;t=s}r.flags|=y.i.Overridden,this._internalSet(r,t)}set(e,t){const r=this.propertiesByName.get(e);if(!w(r,0,t,this))return;const n=r.metadata.cast;if(n){const e=this._cast(n,t),{valid:r,value:s}=e;if(O.release(e),!r)return;t=s}const s=r.metadata.set;s?s.call(this.host,t):this._internalSet(r,t)}setDefaultOrigin(e){this._origin=(0,p.aB)(e)}getDefaultOrigin(){return(0,p.OL)(this._origin)}notifyChange(e){const t=this.propertiesByName.get(e);void 0!==t&&t.notifyChange()}invalidate(e){const t=this.propertiesByName.get(e);void 0!==t&&t.invalidate()}commit(e){const t=this.propertiesByName.get(e);void 0!==t&&t.commit()}_internalSet(e,t){const r=this.lifecycle!==l.v.INITIALIZING?this._origin:p.Gr.DEFAULTS;this._setAtOrigin(e,t,r)}_setAtOrigin(e,t,r){const n=this.store,s=e.propertyName;n.has(s,r)&&(0,f.aI)(t,n.get(s))&&~e.flags&y.i.Overridden&&r===n.originOf(s)||(e.invalidate(),n.set(s,t,r),e.commit(),(0,g.fE)(this.host,e))}_cast(e,t){const r=O.acquire();return r.valid=!0,r.value=t,e&&(r.value=e.call(this.host,t,r)),r}}const O=new d.A(class{constructor(){this.value=null,this.valid=!0}acquire(){this.valid=!0}release(){this.value=null}});var S=r(47821);var k;!function(e){e[e.Ignore=0]="Ignore",e[e.Destroy=1]="Destroy",e[e.ThrowError=2]="ThrowError"}(k||(k={}));var E,T,N=r(14012),j=r(10107),P=r(40608);function C(e){if(null==e)return{value:e};if(Array.isArray(e))return{type:[e[0]],value:null};switch(typeof e){case"object":return e.constructor?.__accessorMetadata__||e instanceof Date?{type:e.constructor,value:e}:e;case"boolean":return{type:Boolean,value:e};case"string":return{type:String,value:e};case"number":return{type:Number,value:e};case"function":return{type:e,value:null};default:return}}const I=Symbol("Accessor-Handles"),M=Symbol("Accessor-Initialized");class x{static createSubclass(e={}){if(Array.isArray(e))throw new Error("Multi-inheritance unsupported since 4.16");const{properties:t,declaredClass:r,constructor:n}=e;delete e.declaredClass,delete e.properties,delete e.constructor;const s=this;class o extends s{constructor(...e){super(...e),this.inherited=null,n&&n.apply(this,e)}}(0,u.tD)(o.prototype);for(const t in e){const r=e[t];o.prototype[t]="function"==typeof r?function(...e){const n=this.inherited;let o;this.inherited=function(...e){if(s.prototype[t])return s.prototype[t].apply(this,e)};try{o=r.apply(this,e)}catch(e){throw this.inherited=n,e}return this.inherited=n,o}:e[t]}for(const e in t){const r=C(t[e]);(0,j.MZ)(r)(o.prototype,e)}return(0,P.$)(r)(o)}static freeze(e){return e instanceof x?e.__accessor__.mutable=!1:Object.freeze(e),e}static isFrozen(e){return e instanceof x?!e.__accessor__.mutable:Object.isFrozen(e)}constructor(...e){if(this[E]=null,this[T]=!1,this.constructor===x)throw new Error("[accessor] cannot instantiate Accessor. This can be fixed by creating a subclass of Accessor");const t=new A(this);Object.defineProperty(this,"__accessor__",{enumerable:!1,value:t}),e.length>0&&(t.ctorArgs=this.normalizeCtorArgs?.apply(this,e)??e[0])}postscript(){const e=this.__accessor__,t=e.ctorArgs;e.initialize(),t&&(this.set(t),e.ctorArgs=null),e.constructed(),this.initialize(),this[M]=!0}initialize(){}[a.G](){this[I]=(0,i.pR)(this[I])}destroy(){this.destroyed||((0,N.iS)(this),this.__accessor__.destroy())}[Symbol.dispose](){this.destroy()}get constructed(){return this.__accessor__&&this.__accessor__.initialized||!1}get initialized(){return this[M]}get destroyed(){return this.__accessor__?.lifecycle===l.v.DESTROYED||!1}commitProperty(e){(0,c.Jt)(this,e)}hasOwnProperty(e){return this.__accessor__?this.__accessor__.has(e):Object.prototype.hasOwnProperty.call(this,e)}keys(){return this.__accessor__?this.__accessor__.keys():[]}set(e,t){return(0,S.h)(this,e,t),this}watch(e,t,r){return(0,n.eO)(o.A.getLogger(this),"`watch` is deprecated in favor of reactiveUtils.watch",{replacement:"reactiveUtils.watch",version:"4.32",see:"https://developers.arcgis.com/javascript/latest/api-reference/esri-core-reactiveUtils.html#watch",warnOnce:!0}),(0,N.wB)(this,e,t,r)}addHandles(e,t){if(this.destroyed){const t=Array.isArray(e)?e:[e];for(const e of t)e.remove()}else(this[I]??=new s.A).add(e,t)}removeHandles(e){this[I]?.remove(e)}removeAllHandles(){this[I]?.removeAll()}removeHandlesReference(e){this[I]?.removeReference(e)}hasHandles(e){return!0===this[I]?.has(e)}_override(e,t){void 0===t?this.__accessor__.clearOverride(e):this.__accessor__.override(e,t)}_clearOverride(e){return this.__accessor__.clearOverride(e)}_overrideIfSome(e,t){null==t?this.__accessor__.clearOverride(e):this.__accessor__.override(e,t)}_isOverridden(e){return this.__accessor__.isOverridden(e)}notifyChange(e){this.__accessor__.notifyChange(e)}_get(e){return this.__accessor__.internalGet(e)}_set(e,t){return this.__accessor__.internalSet(e,t),this}}E=I,T=M},98291:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(93687);function s(e){e.length=0}class o{constructor(e=50,t=50){this._pool=new n.A(Array,void 0,s,t,e)}acquire(){return this._pool.acquire()}release(e){this._pool.release(e)}prune(){this._pool.prune(0)}static acquire(){return i.acquire()}static release(e){return i.release(e)}static prune(){i.prune()}}const i=new o(100)},49186:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(4718),s=r(53966),o=r(79907);class i extends o.A{constructor(e,t,r){super(e,t,r)}toJSON(){if(null!=this.details)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,((e,t)=>{if(t&&"object"==typeof t&&"function"==typeof t.toJSON)return t;try{return(0,n.o8)(t)}catch(e){return"[object]"}})))}}catch(e){throw s.A.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new i(e.name,e.message,e.details)}}i.prototype.type="error"},71511:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(5479);class s{constructor(){this._groups=new Map}destroy(){this.removeAll()}get size(){let e=0;return this._groups.forEach((t=>{e+=t.length})),e}add(e,t){if((0,n.xZ)(e)){const r=this._getOrCreateGroup(t);for(const t of e)a(t)&&r.push(t)}else a(e)&&this._getOrCreateGroup(t).push(e);return this}forEach(e,t){if("function"==typeof e)this._groups.forEach((t=>t.forEach(e)));else{const r=this._getGroup(e);r&&t&&r.forEach(t)}}has(e){return this._groups.has(o(e))}remove(e){if("string"!=typeof e&&(0,n.xZ)(e)){for(const t of e)this.remove(t);return this}return this.has(e)?(i(this._getGroup(e)),this._groups.delete(o(e)),this):this}removeAll(){return this._groups.forEach(i),this._groups.clear(),this}removeReference(e){return this._groups.delete(e),this}_getOrCreateGroup(e){if(this.has(e))return this._getGroup(e);const t=[];return this._groups.set(o(e),t),t}_getGroup(e){return this._groups.get(o(e))}}function o(e){return e||"_default_"}function i(e){for(const t of e)t instanceof s?t.removeAll():t.remove()}function a(e){return null!=e&&(!!e.remove||e instanceof s)}},25482:(e,t,r)=>{"use strict";r.d(t,{A:()=>m});var n=r(90237),s=r(69622),o=r(4718),i=r(35666);class a{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(e){const t=new a;return this._values.forEach(((r,n)=>{e&&e.has(n)||t.set(n,(0,o.o8)(r.value),r.origin)})),t}get(e,t){t=this._normalizeOrigin(t);const r=this._values.get(e);return null==t||r?.origin===t?r?.value:void 0}originOf(e){return this._values.get(e)?.origin??i.Gr.USER}keys(e){e=this._normalizeOrigin(e);const t=[...this._values.keys()];return null==e?t:t.filter((t=>this._values.get(t)?.origin===e))}set(e,t,r){if((r=this._normalizeOrigin(r))===i.Gr.DEFAULTS){const t=this._values.get(e);if(null!=t?.origin&&t.origin>r)return}this._values.set(e,new c(t,r))}delete(e,t){null!=(t=this._normalizeOrigin(t))&&this._values.get(e)?.origin!==t||this._values.delete(e)}has(e,t){return null!=(t=this._normalizeOrigin(t))?this._values.get(e)?.origin===t:this._values.has(e)}forEach(e){this._values.forEach((({value:t},r)=>e(t,r)))}_normalizeOrigin(e){if(null!=e)return e===i.Gr.DEFAULTS?e:i.Gr.USER}}class c{constructor(e,t){this.value=e,this.origin=t}}var l=r(76953),u=r(45917),f=r(88620),d=r(49422),h=r(40608);const p=e=>{let t=class extends e{constructor(...e){super(...e);const t=(0,f.oY)(this),r=t.store,n=new a;t.store=n,(0,l.k)(t,r,n)}read(e,t){(0,u.L)(this,e,t)}write(e,t){return(0,d.M)(this,e??{},t)}toJSON(e){return this.write({},e)}static fromJSON(e,t){return g.call(this,e,t)}};return t=(0,n._)([(0,h.$)("esri.core.JSONSupport")],t),t.prototype.toJSON.isDefaultToJSON=!0,t};function g(e,t){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");const r=new this;return r.read(e,t),r}let y=class extends(p(s.A)){};var b;y=(0,n._)([(0,h.$)("esri.core.JSONSupport")],y),(b=y||(y={})).JSONSupportMixin=p,b.isSerializable=function(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON};const m=y},53966:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(92602),s=(r(44208),r(799));const o={info:0,warn:1,error:2,none:3};class i{constructor(e){this.level=null,this._module="",this._parent=null,this.writer=null,this._loggedMessages={error:new Map,warn:new Map,info:new Map},null!=e.level&&(this.level=e.level),null!=e.writer&&(this.writer=e.writer),this._module=e.module,i._loggers.set(this.module,this);const t=this.module.lastIndexOf(".");-1!==t&&(this._parent=i.getLogger(this.module.slice(0,t)))}get module(){return this._module}get parent(){return this._parent}error(...e){this._log("error","always",...e)}warn(...e){this._log("warn","always",...e)}info(...e){this._log("info","always",...e)}errorOnce(...e){this._log("error","once",...e)}warnOnce(...e){this._log("warn","once",...e)}infoOnce(...e){this._log("info","once",...e)}errorOncePerTick(...e){this._log("error","oncePerTick",...e)}warnOncePerTick(...e){this._log("warn","oncePerTick",...e)}infoOncePerTick(...e){this._log("info","oncePerTick",...e)}get test(){}static get test(){}static getLogger(e){return e="string"!=typeof e?e.declaredClass:e,i._loggers.get(e)||new i({module:e})}_log(e,t,...r){if(this._matchLevel(e)){if("always"!==t&&!i._throttlingDisabled){const n=function(...e){return(0,s.Wm)(JSON.stringify(e,((e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]")))}(r),o=this._loggedMessages[e].get(n);if("once"===t&&null!=o||"oncePerTick"===t&&o&&o>=i._tickCounter)return;this._loggedMessages[e].set(n,i._tickCounter),i._scheduleTickCounterIncrement()}for(const t of n.A.log.interceptors)if(t(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,t){let r=this;for(;null!=r;){const t=r[e];if(null!=t)return t;r=r.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",a)}_matchLevel(e){const t=n.A.log.level||"warn";return o[this._parentWithMember("level",t)]<=o[e]}static _scheduleTickCounterIncrement(){i._tickCounterScheduled||(i._tickCounterScheduled=!0,Promise.resolve().then((()=>{i._tickCounter++,i._tickCounterScheduled=!1})))}}function a(e,t,...r){console[e](`[${t}]`,...r)}i._loggers=new Map,i._tickCounter=0,i._tickCounterScheduled=!1,i._throttlingDisabled=!1},91869:(e,t,r)=>{"use strict";function n(e,t){for(const r of e.values())if(t(r))return!0;return!1}function s(e,t,r){const n=e.get(t);if(void 0!==n)return n;const s=r();return e.set(t,s),s}function o(e){const t=new Map;return r=>(t.has(r)||t.set(r,e(r)),t.get(r))}r.d(t,{Bj:()=>o,Bs:()=>n,tE:()=>s})},79907:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(93637);class s{constructor(e,t,r=void 0){this.name=e,this.details=r,this.message=(t&&function(e,t){return e.replaceAll(/\$\{([^\s:}]*)(?::([^\s:}]+))?\}/g,((e,r)=>""===r?"$":((0,n.wc)(r,t)??"").toString()))}(t,r))??""}toString(){return"["+this.name+"]: "+this.message}}},93687:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});class n{constructor(e,t,r,n=1,s=0){this._ctor=e,this._acquireFunction=t,this._releaseFunction=r,this.allocationSize=n,this._pool=new Array(s),this._initialSize=s;for(let e=0;e<s;e++)this._pool[e]=new this._ctor;this.allocationSize=Math.max(n,1)}destroy(){this.prune(0)}acquire(...e){let t;if(n.test.disabled)t=new this._ctor;else{if(0===this._pool.length){const e=this.allocationSize;for(let t=0;t<e;t++)this._pool[t]=new this._ctor}t=this._pool.pop()}return this._acquireFunction?this._acquireFunction(t,...e):function(e){return e?.acquire&&"function"==typeof e.acquire}(t)&&t.acquire(...e),t}release(e){var t;e&&!n.test.disabled&&(this._releaseFunction?this._releaseFunction(e):(t=e,t?.release&&"function"==typeof t.release&&e.release()),this._pool.push(e))}prune(e=this._initialSize){if(!(e>=this._pool.length)){for(let t=e;t<this._pool.length;++t){const e=this._pool[t];this._dispose(e)}this._pool.length=e}}_dispose(e){e.dispose&&"function"==typeof e.dispose&&e.dispose()}}n.test={disabled:!1}},61604:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});class n{constructor(e,t=30){this.name=e,this._counter=0,this._samples=new Array(t)}push(e){null!=e&&(this._samples[++this._counter%this._samples.length]=e)}set(e){null!=e&&(this._samples[this._counter%this._samples.length]=e)}get median(){return this._samples.slice().sort(((e,t)=>e-t))[Math.floor(this._samples.length/2)]}get average(){return this._samples.reduce(((e,t)=>e+t),0)/this._samples.length}get last(){return this._samples[this._counter%this._samples.length]}}},3694:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n,s=r(4576);!function(e){const t=(e,t,r,n)=>{let s=t,o=t;const i=r>>>1,a=e[s-1];for(;o<=i;){o=s<<1,o<r&&n(e[o-1],e[o])<0&&++o;const t=e[o-1];if(n(t,a)<=0)break;e[s-1]=t,s=o}e[s-1]=a},r=(e,t)=>e<t?-1:e>t?1:0;e.sort=function(e,n,s,o){void 0===n&&(n=0),void 0===s&&(s=e.length),void 0===o&&(o=r);for(let r=s>>>1;r>n;r--)t(e,r,s,o);const i=n+1;for(let r=s-1;r>n;r--){const s=e[n];e[n]=e[r],e[r]=s,t(e,i,r,o)}},e.iterableSort=function*(e,n,s,o){void 0===n&&(n=0),void 0===s&&(s=e.length),void 0===o&&(o=r);for(let r=s>>>1;r>n;r--)t(e,r,s,o),yield;const i=n+1;for(let r=s-1;r>n;r--){const s=e[n];e[n]=e[r],e[r]=s,t(e,i,r,o),yield}}}(n||(n={}));const o=n;class i{constructor(e){this.data=[],this._length=0,this._allocator=void 0,this._deallocator=()=>null,this._shrink=()=>{},this._hint=new s.vW,e&&(e.initialSize&&(this.data=new Array(e.initialSize)),e.allocator&&(this._allocator=e.allocator),void 0!==e.deallocator&&(this._deallocator=e.deallocator),e.shrink&&(this._shrink=()=>a(this)))}toArray(){return this.data.slice(0,this.length)}filter(e){const t=new Array;for(let r=0;r<this._length;r++){const n=this.data[r];e(n)&&t.push(n)}return t}at(e){if((e=Math.trunc(e)||0)<0&&(e+=this._length),!(e<0||e>=this._length))return this.data[e]}includes(e,t){const r=this.data.indexOf(e,t);return-1!==r&&r<this.length}get length(){return this._length}set length(e){if(e>this._length){if(this._allocator){for(;this._length<e;)this.data[this._length++]=this._allocator(this.data[this._length]);return}this._length=e}else{if(this._deallocator)for(let t=e;t<this._length;++t)this.data[t]=this._deallocator(this.data[t]);this._length=e,this._shrink()}}clear(){this.length=0}prune(){this.clear(),this.data=[]}push(e){this.data[this._length++]=e}pushArray(e,t=e.length){for(let r=0;r<t;r++)this.data[this._length++]=e[r]}fill(e,t){for(let r=0;r<t;r++)this.data[this._length++]=e}pushNew(){this._allocator&&(this.data[this.length]=this._allocator(this.data[this.length]));const e=this.data[this._length];return++this._length,e}unshift(e){this.data.unshift(e),this._length++,a(this)}pop(){if(0===this.length)return;const e=this.data[this.length-1];return this.length=this.length-1,this._shrink(),e}remove(e){const t=(0,s.qh)(this.data,e,this.length,this._hint);if(-1!==t)return this.data.splice(t,1),this.length=this.length-1,e}removeUnordered(e){return this.removeUnorderedIndex((0,s.qh)(this.data,e,this.length,this._hint))}removeUnorderedIndex(e){if(!(e>=this.length||e<0))return this.swapElements(e,this.length-1),this.pop()}removeUnorderedMany(e,t=e.length,r){this.length=(0,s.mW)(this.data,e,this.length,t,this._hint,r),this._shrink()}front(){if(0!==this.length)return this.data[0]}back(){if(0!==this.length)return this.data[this.length-1]}swapElements(e,t){if(e>=this.length||t>=this.length||e===t)return;const r=this.data[e];this.data[e]=this.data[t],this.data[t]=r}sort(e){o.sort(this.data,0,this.length,e)}iterableSort(e){return o.iterableSort(this.data,0,this.length,e)}some(e,t){for(let r=0;r<this.length;++r)if(e.call(t,this.data[r],r,this.data))return!0;return!1}find(e,t){const{data:r,length:n}=this;for(let s=0;s<n;++s)if(e.call(t,r[s]))return r[s]}filterInPlace(e,t){let r=0;for(let n=0;n<this._length;++n){const s=this.data[n];e.call(t,s,n,this.data)&&(this.data[n]=this.data[r],this.data[r]=s,r++)}if(this._deallocator)for(let e=r;e<this._length;e++)this.data[e]=this._deallocator(this.data[e]);return this._length=r,this._shrink(),this}forAll(e,t){const{data:r,length:n}=this;for(let s=0;s<n;++s)e.call(t,r[s],s,r)}forEach(e,t){this.data.slice(0,this.length).forEach(e,t)}map(e,t){const r=new Array(this.length);for(let n=0;n<this.length;++n)r[n]=e.call(t,this.data[n],n,this.data);return r}reduce(e,t){let r=t;for(let t=0;t<this.length;++t)r=e(r,this.data[t],t,this.data);return r}has(e){const t=this.length,r=this.data;for(let n=0;n<t;++n)if(r[n]===e)return!0;return!1}*[Symbol.iterator](){for(let e=0;e<this.length;e++)yield this.data[e]}}function a(e){e.data.length>1.5*e.length&&(e.data.length=Math.floor(1.1*e.length))}},87811:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});class n{constructor(e=1){this._seed=e}set seed(e){this._seed=e??Math.random()*n._m}getInt(){return this._seed=(n._a*this._seed+n._c)%n._m,this._seed}getFloat(){return this.getInt()/(n._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const r=t-e;return e+this.getInt()/n._m*r}}n._m=2147483647,n._a=48271,n._c=0},67076:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(79907);class s extends n.A{constructor(e,t,r){super(e,t,r)}}s.prototype.type="warning"},11406:(e,t,r)=>{"use strict";r.d(t,{T:()=>i});var n=r(36563),s=r(4576);class o{constructor(e,t){this._observers=e,this._observer=t}remove(){(0,s.TF)(this._observers,this._observer)}}class i{constructor(){this._observers=null,this.destroyed=!1}observe(e){if(this.destroyed||e.destroyed)return a;null==this._observers&&(this._observers=[]);const t=this._observers;let r=!1,n=!1;const s=t.length;for(let o=0;o<s;++o){const s=t[o];if(s.destroyed)n=!0;else if(s===e){r=!0;break}}return r||(t.push(e),n&&this._removeDestroyedObservers()),new o(t,e)}_removeDestroyedObservers(){const e=this._observers;if(!e||0===e.length)return;const t=e.length;let r=0;for(let n=0;n<t;++n){for(;n+r<t&&e[n+r].destroyed;)++r;if(r>0){if(!(n+r<t))break;e[n]=e[n+r]}}e.length=t-r}destroy(){if(this.destroyed)return;this.destroyed=!0;const e=this._observers;if(null!=e){for(const t of e)t.onCommitted();this._observers=null}}}const a=(0,n.hA)()},35666:(e,t,r)=>{"use strict";var n;r.d(t,{AU:()=>s,Gr:()=>n,OL:()=>i,aB:()=>o,in:()=>a}),function(e){e[e.DEFAULTS=0]="DEFAULTS",e[e.COMPUTED=1]="COMPUTED",e[e.SERVICE=2]="SERVICE",e[e.PORTAL_ITEM=3]="PORTAL_ITEM",e[e.WEB_SCENE=4]="WEB_SCENE",e[e.WEB_MAP=5]="WEB_MAP",e[e.LINK_CHART=6]="LINK_CHART",e[e.USER=7]="USER"}(n||(n={}));const s=n.USER+1;function o(e){switch(e){case"defaults":return n.DEFAULTS;case"service":return n.SERVICE;case"portal-item":return n.PORTAL_ITEM;case"web-scene":return n.WEB_SCENE;case"web-map":return n.WEB_MAP;case"link-chart":return n.LINK_CHART;case"user":return n.USER;default:return null}}function i(e){switch(e){case n.DEFAULTS:return"defaults";case n.SERVICE:return"service";case n.PORTAL_ITEM:return"portal-item";case n.WEB_SCENE:return"web-scene";case n.WEB_MAP:return"web-map";case n.LINK_CHART:return"link-chart";case n.USER:return"user"}}function a(e){return i(e)}},56454:(e,t,r)=>{"use strict";r.d(t,{G:()=>n});const n=Symbol("Accessor-beforeDestroy")},10107:(e,t,r)=>{"use strict";r.d(t,{MZ:()=>c,rM:()=>l});var n=r(53966),s=r(56507),o=r(16649),i=r(96156),a=r(47821);function c(e={}){return(t,r)=>{if(t===Function.prototype)throw new Error(`Inappropriate use of @property() on a static field: ${t.name}.${r}. Accessor does not support static properties.`);const c=Object.getOwnPropertyDescriptor(t,r),l=(0,i.z4)(t,r);c&&(c.get||c.set?(l.get=c.get||l.get,l.set=c.set||l.set):"value"in c&&("value"in e&&n.A.getLogger("esri.core.accessorSupport.decorators.property").warn(`@property() will redefine the value of "${r}" on "${t.constructor.name}" already defined in the metadata`,e),l.value=e.value=c.value)),null!=e.readOnly&&(l.readOnly=e.readOnly);const u=e.aliasOf;if(u){const e="string"==typeof u?u:u.source,t="string"==typeof u?null:!0===u.overridable;let n;l.dependsOn=[e],l.get=function(){let t=(0,o.Jt)(this,e);if("function"==typeof t){n||(n=e.split(".").slice(0,-1).join("."));const r=(0,o.Jt)(this,n);r&&(t=t.bind(r))}return t},l.readOnly||(l.set=t?function(e){this._override(r,e)}:function(t){(0,a.h)(this,e,t)})}const f=e.type,d=e.types;if(!l.cast){let t;f?t=function(e){let t=0,r=e;if((0,s.Zu)(e))return(0,s.Nd)(e);for(;Array.isArray(r)&&1===r.length&&"string"!=typeof r[0]&&"number"!=typeof r[0];)r=r[0],t++;const n=r;if((0,s.EK)(n))return 0===t?(0,s.MB)(n):(0,s._e)((0,s.MB)(n),t);if(1===t)return(0,s.eC)(n);if(t>1)return(0,s.e6)(n,t);const o=e;return o.from?o.from:(0,s.dp)(o)}(f):d&&(t=Array.isArray(d)?(0,s.wB)((0,s.aq)(d[0])):(0,s.aq)(d)),e.cast=function(e,t){if(e||t)return e?t?(r,n)=>t(e(r,n),n):e:t}(e.cast,t)}(0,i.CX)(l,e),e.range&&(l.cast=(0,s.Qp)(l.cast,e.range))}}function l(e,t,r){const n=(0,i.z4)(e,r);n.json||(n.json={});let s=n.json;return void 0!==t&&(s.origins||(s.origins={}),s.origins[t]||(s.origins[t]={}),s=s.origins[t]),s}},40608:(e,t,r)=>{"use strict";r.d(t,{$:()=>f}),r(44208);var n=r(53966),s=r(56454),o=r(45873),i=r(96156),a=r(62788),c=r(51822);const l=new Set,u=new Set;function f(e){return t=>{e??="esri.core.Accessor",t.prototype.declaredClass=e,h(t);const r=[],n=[];let o=t.prototype;for(;o;)o.hasOwnProperty("initialize")&&!l.has(o.initialize)&&(l.add(o.initialize),r.push(o.initialize)),o.hasOwnProperty("destroy")&&!u.has(o.destroy)&&(u.add(o.destroy),n.push(o.destroy)),o=Object.getPrototypeOf(o);l.clear(),u.clear();const a=class extends t{constructor(...e){if(super(...e),this.constructor===a&&"function"==typeof this.postscript){if(r.length&&Object.defineProperty(this,"initialize",{enumerable:!1,configurable:!0,value(){for(let e=r.length-1;e>=0;e--)r[e].call(this)}}),n.length){let e=!1;const t=this[s.G];Object.defineProperty(this,"destroy",{enumerable:!1,configurable:!0,value(){if(!e){e=!0,t.call(this);for(let e=0;e<n.length;e++)n[e].call(this)}}})}Object.defineProperty(this,Symbol.dispose,{enumerable:!1,configurable:!0,value(){this.destroy()}}),this.postscript()}}};a.__accessorMetadata__=(0,i.tD)(t.prototype),a.prototype.declaredClass=e;const c=(e||"AccessorSubclass").split(".").slice(-1)[0];return Object.defineProperty(a,"name",{value:c,configurable:!0}),a}}function d(e,t){return null==t.get?function(){const t=this.__accessor__,r=t.propertiesByName.get(e);if(void 0===r)return;t.mutable&&(0,a.gc)(r);const n=t.store;return n.has(e)?n.get(e):r.metadata.value}:function(){const t=this.__accessor__,r=t.propertiesByName.get(e);if(void 0!==r)return r.getComputed(t)}}function h(e){const t=e.prototype,r=(0,i.tD)(t),n={};for(const e of Object.getOwnPropertyNames(r)){const t=r[e];(0,c.qk)(t),n[e]={enumerable:!0,configurable:!0,get:d(e,t),set(r){const n=this.__accessor__;if(void 0!==n){if(n.mutable)return n.initialized&&t.readOnly?p("read-only",e):n.lifecycle===o.v.CONSTRUCTED&&t.constructOnly?p("construct-only",e):void n.set(e,r)}else Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:r})}}}Object.defineProperties(e.prototype,n)}const p=(e,t)=>{n.A.getLogger("esri.core.Accessor").error(`cannot assign to ${e} property '${t}'`)}},76953:(e,t,r)=>{"use strict";r.d(t,{k:()=>s});var n=r(35666);function s(e,t,r){t.keys().forEach((e=>{r.set(e,t.get(e),n.Gr.DEFAULTS)}));const s=e.metadata;Object.keys(s).forEach((t=>{e.internalGet(t)&&r.set(t,e.internalGet(t),n.Gr.DEFAULTS)}))}},56507:(e,t,r)=>{"use strict";r.d(t,{EK:()=>T,GB:()=>l,GX:()=>c,MB:()=>N,Nd:()=>x,PZ:()=>m,Qp:()=>d,Uv:()=>C,Vr:()=>u,Zu:()=>M,_e:()=>k,aq:()=>j,dp:()=>w,e6:()=>E,eC:()=>O,gK:()=>I,jz:()=>P,wB:()=>A}),r(44208);var n=r(53966),s=r(91869);const o=()=>n.A.getLogger("esri.core.accessorSupport.ensureTypes");function i(e){return null==e?e:new Date(e)}function a(e){return null==e?e:!!e}function c(e){return null==e?e:e.toString()}function l(e,t=0){return null==e?e:(e=parseFloat(e),isNaN(e)?t:e)}function u(e){return null==e?e:Math.round(parseFloat(e))}function f(e){return null}function d(e,t){return r=>{let n=e(r);return null!=t.step&&(n=Math.round(n/t.step)*t.step),null!=t.min&&(n=Math.max(t.min,n)),null!=t.max&&(n=Math.min(t.max,n)),n}}function h(e){return e?.constructor&&void 0!==e.constructor.__accessorMetadata__}function p(e,t){return null!=t&&e&&!(t instanceof e)}function g(e){return e&&"isCollection"in e}function y(e){return e?.Type?"function"==typeof e.Type?e.Type:e.Type.base:null}function b(e,t){return!!h(t)&&(o().error("Accessor#set","Assigning an instance of '"+(t.declaredClass||"unknown")+"' which is not a subclass of '"+v(e)+"'"),!0)}function m(e,t){return null==t?t:g(e)?function(e,t){if(!t?.constructor||!g(t.constructor))return b(e,t)?t:new e(t);const r=y(e.prototype.itemType),n=y(t.constructor.prototype.itemType);return r?n?r===n?t:r.prototype.isPrototypeOf(n.prototype)?new e(t):(b(e,t),t):new e(t):t}(e,t):p(e,t)?b(e,t)?t:new e(t):t}function v(e){return e?.prototype?.declaredClass||"unknown"}const _=new WeakMap;function w(e,t){const r=function(e){switch(e){case Number:return e=>l(e);case P:return u;case Boolean:return a;case String:return c;case Date:return i;case C:return f;default:return(0,s.tE)(_,e,(()=>m.bind(null,e)))}}(e);return 1===arguments.length?r:r(t)}function A(e,t,r){return 1===arguments.length?A.bind(null,e):t?Array.isArray(t)?t.map((t=>e(t,r))):[e(t,r)]:t}function O(e,t){return 1===arguments.length?A((t=>w(e,t))):A((t=>w(e,t)),t)}function S(e,t,r){return 0!==t&&Array.isArray(r)?r.map((r=>S(e,t-1,r))):e(r)}function k(e,t,r){if(2===arguments.length)return r=>k(e,t,r);if(!r)return r;r=S(e,t,r);let n=t,s=r;for(;n>0&&Array.isArray(s);)n--,s=s[0];if(void 0!==s)for(let e=0;e<n;e++)r=[r];return r}function E(e,t,r){return 2===arguments.length?k((t=>w(e,t)),t):k((t=>w(e,t)),t,r)}function T(e){return!!Array.isArray(e)&&!e.some((t=>{const r=typeof t;return!("string"===r||"number"===r||"function"===r&&e.length>1)}))}function N(e,t){if(2===arguments.length)return N(e).call(null,t);const r=new Set,n=e.filter((e=>"function"!=typeof e)),s=e.filter((e=>"function"==typeof e));for(const t of e)"string"!=typeof t&&"number"!=typeof t||r.add(t);let i=null,a=null;return(e,t)=>{if(null==e)return e;const c=typeof e,l="string"===c||"number"===c;return l&&(r.has(e)||s.some((e=>"string"===c&&e===String||"number"===c&&e===Number)))||"object"===c&&s.some((t=>!p(e,t)))?e:(l&&n.length?(i||(i=n.map((e=>"string"==typeof e?`'${e}'`:`${e}`)).join(", ")),o().error("Accessor#set",`'${e}' is not a valid value for this property, only the following values are valid: ${i}`)):"object"==typeof e&&s.length?(a||(a=s.map((e=>v(e))).join(", ")),o().error("Accessor#set",`'${e}' is not a valid value for this property, value must be one of ${a}`)):o().error("Accessor#set",`'${e}' is not a valid value for this property`),t&&(t.valid=!1),null)}}function j(e,t){if(2===arguments.length)return j(e).call(null,t);const r={},n=[],s=[];for(const t in e.typeMap){const o=e.typeMap[t];r[t]=w(o),n.push(v(o)),s.push(t)}const i=()=>`'${n.join("', '")}'`,a=()=>`'${s.join("', '")}'`,c="string"==typeof e.key?t=>t[e.key]:e.key;return t=>{if(e.base&&!p(e.base,t))return t;if(null==t)return t;const n=c(t)||e.defaultKeyValue,s=r[n];if(!s)return o().error("Accessor#set",`Invalid property value, value needs to be one of ${i()}, or a plain object that can autocast (having .type = ${a()})`),null;if(!p(e.typeMap[n],t))return t;if("string"==typeof e.key&&!h(t)){const r={};for(const n in t)n!==e.key&&(r[n]=t[n]);return s(r)}return s(t)}}class P{}class C{}const I={native:e=>({type:"native",value:e}),array:e=>({type:"array",value:e}),oneOf:e=>({type:"one-of",values:e})};function M(e){if(!e||!("type"in e))return!1;switch(e.type){case"native":case"array":case"one-of":return!0}return!1}function x(e){switch(e.type){case"native":return w(e.value);case"array":return A(x(e.value));case"one-of":return function(e){let t=null;return(r,n)=>R(r,e)?r:(null==t&&(t=$(e)),o().error("Accessor#set",`Invalid property value, value needs to be of type ${t}`),n&&(n.valid=!1),null)}(e);default:return null}}function $(e){switch(e.type){case"native":switch(e.value){case Number:return"number";case String:return"string";case Boolean:return"boolean";case P:return"integer";case Date:return"date";case C:return"null";default:return v(e.value)}case"array":return`array of ${$(e.value)}`;case"one-of":{const t=e.values.map((e=>$(e)));return`one of ${t.slice(0,-1)} or ${t[t.length-1]}`}}return"unknown"}function R(e,t){if(null==e)return!0;switch(t.type){case"native":switch(t.value){case Number:case P:return"number"==typeof e;case Boolean:return"boolean"==typeof e;case String:return"string"==typeof e;case C:return null===e}return e instanceof t.value;case"array":return!!Array.isArray(e)&&!e.some((e=>!R(e,t.value)));case"one-of":return t.values.some((t=>R(e,t)))}}},51822:(e,t,r)=>{"use strict";r.d(t,{xF:()=>u,N5:()=>f,k4:()=>d,qk:()=>b});var n=r(56507),s=r(90360);function o(e){if(e.json||(e.json={}),a(e.json),c(e.json),i(e.json),e.json.origins)for(const t in e.json.origins)a(e.json.origins[t]),c(e.json.origins[t]),i(e.json.origins[t]);return!0}function i(e){e.name&&(e.read&&"object"==typeof e.read?void 0===e.read.source&&(e.read.source=e.name):e.read={source:e.name},e.write&&"object"==typeof e.write?void 0===e.write.target&&(e.write.target=e.name):e.write={target:e.name})}function a(e){"boolean"==typeof e.read?e.read={enabled:e.read}:"function"==typeof e.read?e.read={enabled:!0,reader:e.read}:e.read&&"object"==typeof e.read&&void 0===e.read.enabled&&(e.read.enabled=!0)}function c(e){"boolean"==typeof e.write?e.write={enabled:e.write}:"function"==typeof e.write?e.write={enabled:!0,writer:e.write}:e.write&&"object"==typeof e.write&&void 0===e.write.enabled&&(e.write.enabled=!0)}var l=r(67124);function u(e,t){return h(e,"any",t?.origin)}function f(e,t){return h(e,"read",t?.origin)}function d(e,t){return h(e,"write",t?.origin)}function h(e,t,r){let n=e?.json;if(n?.origins&&r){let e;e="link-chart"===r?n.origins[r]&&("any"===t||t in n.origins[r])?n.origins[r]:n.origins["web-map"]:n.origins[r],e&&("any"===t||t in e)&&(n=e)}return n}function p(e){return e.type?g(e):y(e)}function g(e){if(!e.type)return;let t=0,r=e.type;for(;Array.isArray(r)&&!(0,n.EK)(r);)r=r[0],t++;return{type:r,ndimArray:t}}function y(e){if(!e.types)return;let t=0,r=e.types;for(;Array.isArray(r);)r=r[0],t++;return{types:r,ndimArray:t}}function b(e){o(e)&&(function(e){if(e.json&&e.json.origins){const t=e.json.origins,r={"web-document":["web-scene","web-map"]};for(const e in r)if(t[e]){const n=t[e];r[e].forEach((e=>{t[e]=n})),delete t[e]}}}(e),function(e){const t=function(e){return e.json.types?y(e.json):e.type?g(e):y(e)}(e);if(e.json.origins)for(const r in e.json.origins){const n=e.json.origins[r],o=n.types?p(n):t;(0,s.v)(o,n,!1),n.types&&!n.write&&e.json.write?.enabled&&(n.write={...e.json.write}),(0,l.v)(o,n)}(0,s.v)(t,e.json,!0),(0,l.v)(t,e.json)}(e))}},90360:(e,t,r)=>{"use strict";r.d(t,{C:()=>u,v:()=>l});var n=r(53966),s=r(93637),o=r(67076),i=r(96156),a=r(15903);const c=()=>n.A.getLogger("esri.core.accessorSupport.extensions.serializableProperty.reader");function l(e,t,r){e&&(!r&&!t.read||t.read?.reader||!1===t.read?.enabled||function(e){return"types"in e?y(e.types):g(e.type)}(e)&&(0,s.sM)("read.reader",u(e),t))}function u(e){const t=e.ndimArray??0;if(t>1)return function(e){const t=f(e),r=d.bind(null,t),n=e.ndimArray??0;return(e,t,s)=>{if(null==e)return e;e=r(e,s,n);let o=n,i=e;for(;o>0&&Array.isArray(i);)o--,i=i[0];if(void 0!==i)for(let t=0;t<o;t++)e=[e];return e}}(e);if(1===t)return h(e);if("type"in e&&p(e.type)){const t=e.type.prototype?.itemType?.Type,r=h("function"==typeof t?{type:t}:{types:t});return(t,n,s)=>{const o=r(t,n,s);return o?new e.type(o):o}}return f(e)}function f(e){return"type"in e?function(e){return e.prototype.read?(t,r,n)=>{if(null==t)return t;const s=typeof t;if("object"!==s)return void c().error(`Expected JSON value of type 'object' to deserialize type '${e.prototype.declaredClass}', but got '${s}'`);const o=new e;return o.read(t,n),o}:e.fromJSON}(e.type):function(e){let t=null;const r=e.errorContext??"type",n=e.validate;return(s,a,l)=>{if(null==s)return s;const u=typeof s;if("object"!==u)return void c().error(`Expected JSON value of type 'object' to deserialize, but got '${u}'`);t||(t=function(e){const t={};for(const r in e.typeMap){const n=e.typeMap[r],s=(0,i.tD)(n.prototype);if("function"==typeof e.key)continue;const o=s[e.key];if(!o)continue;if(o.json?.type&&Array.isArray(o.json.type)&&1===o.json.type.length&&"string"==typeof o.json.type[0]){t[o.json.type[0]]=n;continue}const a=o.json?.write;if(!a?.writer){t[r]=n;continue}const c=a.target,l="string"==typeof c?c:e.key,u={};a.writer(r,u,l),u[l]&&(t[u[l]]=n)}return t}(e));const f=e.key;if("string"!=typeof f)return;const d=s[f],h=d?t[d]:e.defaultKeyValue?e.typeMap[e.defaultKeyValue]:void 0;if(!h){const e=`Type '${d||"unknown"}' is not supported`;return l?.messages&&s&&l.messages.push(new o.A(`${r}:unsupported`,e,{definition:s,context:l})),void c().error(e)}const p=new h;return p.read(s,l),n?n(p):p}}(e.types)}function d(e,t,r,n){return 0!==n&&Array.isArray(t)?t.map((t=>d(e,t,r,n-1))):e(t,void 0,r)}function h(e){const t=f(e);return(e,r,n)=>{if(null==e)return e;if(Array.isArray(e)){const r=[];for(const s of e){const e=t(s,void 0,n);void 0!==e&&r.push(e)}return r}const s=t(e,void 0,n);return void 0!==s?[s]:void 0}}function p(e){if(!(0,a.P)(e))return!1;const t=e.prototype.itemType;return!(!t||!t.Type)&&("function"==typeof t.Type?g(t.Type):y(t.Type))}function g(e){return!Array.isArray(e)&&!!e&&e.prototype&&("read"in e.prototype||"fromJSON"in e||p(e))}function y(e){for(const t in e.typeMap)if(!g(e.typeMap[t]))return!1;return!0}},15903:(e,t,r)=>{"use strict";function n(e){return!!e&&e.prototype?.declaredClass&&0===e.prototype.declaredClass.indexOf("esri.core.Collection")}r.d(t,{P:()=>n})},67124:(e,t,r)=>{"use strict";r.d(t,{B:()=>f,v:()=>a});var n=r(49186),s=r(53966),o=r(93637),i=r(15903);function a(e,t){if(!t.write||t.write.writer||!1===t.write.enabled&&!t.write.overridePolicy)return;const r=e?.ndimArray??0;e&&(1===r||"type"in e&&(0,i.P)(e.type))?t.write.writer=d:r>1?t.write.writer=function(e){return(t,r,n,s)=>{let i;if(null===t)i=null;else{i=h(t,s,e);let r=e,n=i;for(;r>0&&Array.isArray(n);)r--,n=n[0];if(void 0!==n)for(let e=0;e<r;e++)i=[i]}(0,o.sM)(n,i,r)}}(r):t.types?Array.isArray(t.types)?t.write.writer=function(e){return(t,r,n,s)=>t&&Array.isArray(t)?l(t.filter((t=>c(t,e,s))),r,n,s):l(t,r,n,s)}(t.types[0]):t.write.writer=function(e){return(t,r,n,s)=>t?c(t,e,s)?l(t,r,n,s):void 0:l(t,r,n,s)}(t.types):t.write.writer=l}function c(e,t,r){for(const r in t.typeMap)if(e instanceof t.typeMap[r])return!0;if(r?.messages){const o=t.errorContext??"type",i=`Values of type '${("function"!=typeof t.key?e[t.key]:e.declaredClass)??"Unknown"}' cannot be written`;r&&r.messages&&e&&r.messages.push(new n.A(`${o}:unsupported`,i,{definition:e,context:r})),s.A.getLogger("esri.core.accessorSupport.extensions.serializableProperty.writer").error(i)}return!1}function l(e,t,r,n){(0,o.sM)(r,u(e,n),t)}function u(e,t){return e&&"function"==typeof e.write?e.write({},t):e&&"function"==typeof e.toJSON?e.toJSON():"number"==typeof e?f(e):e}function f(e){return e===-1/0?-Number.MAX_VALUE:e===1/0?Number.MAX_VALUE:isNaN(e)?null:e}function d(e,t,r,n){let s;null===e?s=null:e&&"function"==typeof e.map?(s=e.map((e=>u(e,n))),"function"==typeof s.toArray&&(s=s.toArray())):s=[u(e,n)],(0,o.sM)(r,s,t)}function h(e,t,r){return 0!==r&&Array.isArray(e)?e.map((e=>h(e,t,r-1))):u(e,t)}},16649:(e,t,r)=>{"use strict";r.d(t,{Jt:()=>a,RP:()=>i,t2:()=>c});var n=r(88620);function s(e,t){const r="?"===e[e.length-1]?e.slice(0,-1):e;if(null!=t.getItemAt||Array.isArray(t)){const e=parseInt(r,10);if(!isNaN(e))return Array.isArray(t)?t[e]:t.at(e)}const s=(0,n.oY)(t);return(0,n.yh)(s,r)?s.get(r):t[r]}function o(e,t,r){if(null==e)return e;const n=s(t[r],e);return!n&&r<t.length-1?void 0:r===t.length-1?n:o(n,t,r+1)}function i(e,t,r=0){return"string"!=typeof t||t.includes(".")?o(e,(0,n.AH)(t),r):s(t,e)}function a(e,t){return i(e,t)}function c(e,t){return void 0!==i(t,e)}},45873:(e,t,r)=>{"use strict";var n;r.d(t,{v:()=>n}),function(e){e[e.INITIALIZING=0]="INITIALIZING",e[e.CONSTRUCTING=1]="CONSTRUCTING",e[e.CONSTRUCTED=2]="CONSTRUCTED",e[e.DESTROYED=3]="DESTROYED"}(n||(n={}))},96156:(e,t,r)=>{"use strict";r.d(t,{CX:()=>a,tD:()=>o,z4:()=>i});var n=r(4718),s=r(88620);function o(e){let t=e.constructor.__accessorMetadata__;const r=Object.prototype.hasOwnProperty.call(e.constructor,"__accessorMetadata__");if(t){if(!r){t=Object.create(t);for(const e in t)t[e]=(0,n.o8)(t[e]);Object.defineProperty(e.constructor,"__accessorMetadata__",{value:t,enumerable:!1,configurable:!0,writable:!0})}}else t={},Object.defineProperty(e.constructor,"__accessorMetadata__",{value:t,enumerable:!1,configurable:!0,writable:!0});return e.constructor.__accessorMetadata__}function i(e,t){const r=o(e);let n=r[t];return n||(n=r[t]={}),n}function a(e,t){return(0,s.h1)(e,t,l)}const c=/^(?:[^.]+\.)?(?:value|type|(?:json\.type|json\.origins\.[^.]\.type))$/;function l(e){return c.test(e)?"replace":"merge"}},45917:(e,t,r)=>{"use strict";r.d(t,{L:()=>u,t:()=>f});var n=r(16649),s=r(88620),o=r(51822);function i(e,t,r){if(!e?.read||!1===e.read.enabled||!e.read.source)return!1;const s=e.read.source;if("string"==typeof s){if(s===t)return!0;if(s.includes(".")&&0===s.indexOf(t)&&(0,n.t2)(s,r))return!0}else for(const e of s){if(e===t)return!0;if(e.includes(".")&&0===e.indexOf(t)&&(0,n.t2)(e,r))return!0}return!1}function a(e,t,r,n,s){let a=(0,o.N5)(t[r],s);(function(e){return e&&(!e.read||!1!==e.read.enabled&&!e.read.source)})(a)&&(e[r]=!0);for(const c of Object.getOwnPropertyNames(t))a=(0,o.N5)(t[c],s),i(a,r,n)&&(e[c]=!0)}function c(e,t,r,n){const s=r.metadata,i=(0,o.xF)(s[t],n),a=i?.default;if(void 0===a)return;const c="function"==typeof a?a.call(e,t,n):a;void 0!==c&&r.set(t,c)}const l={origin:"service"};function u(e,t,r=l){if(!t||"object"!=typeof t)return;const i=(0,s.oY)(e),u=i.metadata,f={};for(const e of Object.getOwnPropertyNames(t))a(f,u,e,t,r);i.setDefaultOrigin(r.origin);for(const s of Object.getOwnPropertyNames(f)){const a=(0,o.N5)(u[s],r).read,c=a?.source;let l;l=c&&"string"==typeof c?(0,n.RP)(t,c):t[s],a?.reader&&(l=a.reader.call(e,l,t,r)),void 0!==l&&i.set(s,l)}if(!r||!r.ignoreDefaults){i.setDefaultOrigin("defaults");for(const t of Object.getOwnPropertyNames(u))f[t]||c(e,t,i,r)}i.setDefaultOrigin("user")}function f(e,t,r,n=l){const s={...n,messages:[]};r(s),s.messages?.forEach((t=>{"warning"!==t.type||e.loaded?n?.messages&&n.messages.push(t):e.loadWarnings.push(t)}))}},47821:(e,t,r)=>{"use strict";r.d(t,{h:()=>i});var n=r(49186),s=r(44208),o=(r(53966),r(16649));function i(e,t,r){if(e&&t)if("object"==typeof t)for(const r of Object.getOwnPropertyNames(t))i(e,r,t[r]);else{if(t.includes(".")){const n=t.split("."),s=n.splice(-1,1)[0];return void i((0,o.Jt)(e,n),s,r)}const a=e.__accessor__;null!=a&&function(e,t){if((0,s.A)("esri-unknown-property-errors")&&!function(e,t){return null!=t.metadata[e]}(e,t))throw new n.A("set:unknown-property",function(e,t){return"setting unknown property '"+e+"' on instance of "+t.host.declaredClass}(e,t))}(t,a),e[t]=r}}},62788:(e,t,r)=>{"use strict";r.d(t,{F_:()=>h,Xr:()=>v,a:()=>d,fE:()=>b,gc:()=>l}),r(44208);var n=r(53966),s=r(88620),o=r(47328);const i=new(r(67867).R),a=[];let c=i;function l(e){c.onAccessed(e)}let u=!1,f=!1;function d(e,t,r){if(u)return p(e,t,r);let n=null;return g(e),n=t.call(r),y(),n}function h(e,t){return d(i,e,t)}function p(e,t,r){const s=u;u=!0,g(e);let o=null;try{o=t.call(r)}catch(e){f&&n.A.getLogger("esri.core.accessorSupport.tracking").error(e)}return y(),u=s,o}function g(e){c=e,a.push(e)}function y(){const e=a.length;if(e>1){const t=a.pop();c=a[e-2],t.onTrackingEnd()}else if(1===e){const e=a.pop();c=i,e.onTrackingEnd()}else c=i}function b(e,t){if(t.flags&o.i.DepTrackingInitialized)return;t.flags|=o.i.DepTrackingInitialized;const r=f;f=!1,t.flags&o.i.AutoTracked?p(t.trackingTarget,t.metadata.get,e):v(e,t),f=r}const m=[];function v(e,t){t.flags&o.i.ExplicitlyTracking||(t.flags|=o.i.ExplicitlyTracking,p(t.trackingTarget,(()=>{const r=t.metadata.dependsOn||m;for(const t of r)if("string"!=typeof t||t.includes(".")){const r=(0,s.AH)(t);for(let t=0,n=e;t<r.length&&null!=n&&"object"==typeof n;++t)n=_(n,r[t],t!==r.length-1)}else _(e,t,!1)})),t.flags&=~o.i.ExplicitlyTracking)}function _(e,t,r){const n="?"===t[t.length-1]?t.slice(0,-1):t;if(null!=e.getItemAt||Array.isArray(e)){const t=parseInt(n,10);if(!isNaN(t))return Array.isArray(e)?e[t]:e.at(t)}const o=(0,s.oY)(e);if(o){const t=o.propertiesByName.get(n);t&&(l(t),b(e,t))}return r?e[n]:void 0}},47328:(e,t,r)=>{"use strict";var n;r.d(t,{i:()=>n}),function(e){e[e.Dirty=1]="Dirty",e[e.Overridden=2]="Overridden",e[e.Computing=4]="Computing",e[e.NonNullable=8]="NonNullable",e[e.HasDefaultValue=16]="HasDefaultValue",e[e.DepTrackingInitialized=32]="DepTrackingInitialized",e[e.AutoTracked=64]="AutoTracked",e[e.ExplicitlyTracking=128]="ExplicitlyTracking"}(n||(n={}))},71429:(e,t,r)=>{"use strict";r.d(t,{r:()=>s});var n=r(67867);class s extends n.R{constructor(e){super(new o(e)),this._observer&&i.register(this,new WeakRef(this._observer),this)}destroy(){this._observer&&i.unregister(this._observer),this.accessed?.clear(),this.clear(),this._observer?.destroy()}}class o{constructor(e){this._notify=e,this._invalidCount=0,this.destroyed=!1}onInvalidated(){this._invalidCount++}onCommitted(){if(this.destroyed)return;const e=this._invalidCount;if(1===e)return this._invalidCount=0,void this._notify();this._invalidCount=e>0?e-1:0}destroy(){this.destroyed=!0,this._notify=a}}const i=new FinalizationRegistry((e=>{e.deref()?.destroy()}));function a(){}},67867:(e,t,r)=>{"use strict";r.d(t,{R:()=>n});class n{constructor(e){this.accessed=void 0,this._handles=void 0,this._observer=e}destroy(){this.accessed?.clear(),this.clear()}onAccessed(e){null!=this._observer&&e!==this._observer&&(null==this.accessed&&(this.accessed=new Set),this.accessed.add(e))}onTrackingEnd(){null!=this._observer&&(this.clear(),null!=this.accessed&&(null==this._handles&&(this._handles=[]),this.accessed.forEach((e=>{this._handles.push(e.observe(this._observer))})),this.accessed.clear()))}clear(){if(null!=this._handles){for(let e=0;e<this._handles.length;++e)this._handles[e].remove();this._handles.length=0}}}},80559:(e,t,r)=>{"use strict";r.d(t,{Df:()=>l,fm:()=>u,mJ:()=>c});var n=r(36563),s=r(62788),o=r(71429);let i=!1;const a=[];function c(e,t){let r=new o.r((function n(){if(!r||c)return;if(i)return void f(n);const o=a;r.clear(),i=!0,c=!0,a=(0,s.a)(r,e),c=!1,i=!1,t(a,o),d()})),a=null,c=!1;return c=!0,a=(0,s.a)(r,e),c=!1,(0,n.hA)((function(){r&&(r.destroy(),r=null,a=null)}))}function l(e,t){let r=new o.r((function(){t(i,a)})),i=null;function a(){return r?(r.clear(),i=(0,s.a)(r,e),i):null}return a(),(0,n.hA)((function(){r&&(r.destroy(),r=null),i=null}))}function u(e,t){let r=!1,a=!1;const c=!!t?.sync;let l=new o.r((()=>{r||a||(a=!0,c?u():queueMicrotask(u))}));function u(){a=!1,l&&!r&&(i?f(u):(l.clear(),i=!0,r=!0,(0,s.a)(l,e),r=!1,i=!1,d()))}return r=!0,(0,s.a)(l,e),r=!1,(0,n.hA)((function(){l&&(l.destroy(),l=null)}))}function f(e){a.includes(e)||a.unshift(e)}function d(){for(;a.length;)a.pop()()}},88620:(e,t,r)=>{"use strict";r.d(t,{AH:()=>l,h1:()=>a,oY:()=>o,qg:()=>f,yh:()=>i});var n=r(36563),s=r(4718);function o(e){return e.__accessor__??null}function i(e,t){return null!=e?.metadata?.[t]}function a(e,t,r){return c(e,t,r?{policy:r,path:""}:null)}function c(e,t,r){return t?Object.keys(t).reduce(((e,n)=>{const o=n;let i=null,a="merge";if(r&&(i=r.path?`${r.path}.${n}`:n,a=r.policy(i)),"replace"===a)return e[o]=t[o],e;if("replace-arrays"===a&&Array.isArray(e[o]))return e[o]=t[o],e;if(void 0===e[o])return e[o]=(0,s.o8)(t[o]),e;let l=e[o],u=t[o];if(l===u)return e;if(Array.isArray(u)||Array.isArray(e))l=l?Array.isArray(l)?e[o]=l.slice():e[o]=[l]:e[o]=[],u&&(Array.isArray(u)||(u=[u]),u.forEach((e=>{l.includes(e)||l.push(e)})));else if(u&&"object"==typeof u)if(r){const t=r.path;r.path=i,e[o]=c(l,u,r),r.path=t}else e[o]=c(l,u,null);else e.hasOwnProperty(n)&&!t.hasOwnProperty(n)||(e[o]=u);return e}),e||{}):e}function l(e){return Array.isArray(e)?e:e.split(".")}function u(e){return e.includes(",")?e.split(",").map((e=>e.trim())):[e.trim()]}function f(e,t,r,s){const o=function(e){if(Array.isArray(e)){const t=[];for(const r of e)t.push(...u(r));return t}return u(e)}(t);if(1!==o.length){const t=o.map((t=>s(e,t,r)));return(0,n.vE)(t)}return s(e,o[0],r)}},14012:(e,t,r)=>{"use strict";r.d(t,{iS:()=>A,wB:()=>E,Cn:()=>T});var n=r(98291),s=r(36563),o=r(4718),i=r(93687);class a extends i.A{constructor(){super(...arguments),this._set=new Set}destroy(){super.destroy(),this._set=null}acquire(...e){const t=super.acquire(...e);return this._set.delete(t),t}release(e){e&&!this._set.has(e)&&(super.release(e),this._set.add(e))}_dispose(e){this._set.delete(e),super._dispose(e)}}var c,l,u=r(11932),f=r(24326),d=r(16649),h=r(45873),p=r(80559),g=r(88620);(l=c||(c={}))[l.Untracked=0]="Untracked",l[l.Tracked=1]="Tracked";class y{constructor(){this.uid=(0,f.c)(),this.removed=!1,this.type=null,this.oldValue=null,this.callback=null,this.getValue=null,this.target=null,this.path=null,this.equals=null}static acquireUntracked(e,t,r,n,s){return this.pool.acquire(c.Untracked,e,t,r,n,s,o.aI)}static acquireTracked(e,t,r,n){return this.pool.acquire(c.Tracked,e,t,r,null,null,n)}notify(e,t){this.type===c.Untracked?this.callback.call(this.target,e,t,this.path,this.target):this.callback.call(null,e,t,void 0,void 0)}acquire(e,t,r,n,s,o,i){this.uid=(0,f.c)(),this.removed=!1,this.type=e,this.oldValue=t,this.callback=r,this.getValue=n,this.target=s,this.path=o,this.equals=i}release(){this.target=this.path=this.oldValue=this.callback=this.getValue=null,this.uid=(0,f.c)(),this.removed=!0}}y.pool=new a(y);const b=new n.A,m=new Set;let v;function _(e){m.delete(e),m.add(e),v||(v=(0,u._)(O))}function w(e){if(e.removed)return;const t=e.oldValue,r=e.getValue();e.equals(t,r)||(e.oldValue=r,e.notify(r,t))}function A(e){for(const t of m.values())t.target===e&&(t.removed=!0)}function O(){let e=10;for(;v&&e--;){v=null;const e=S(),t=b.acquire();for(const r of e){const e=r.uid;w(r),e===r.uid&&r.removed&&t.push(r)}for(const e of m)e.removed&&(t.push(e),m.delete(e));for(const e of t)y.pool.release(e);b.release(t),b.release(e),k.forEach((e=>e()))}}function S(){const e=b.acquire();e.length=m.size;let t=0;for(const r of m)e[t]=r,++t;return m.clear(),e}const k=new Set;function E(e,t,r,n=!1){return e.__accessor__&&e.__accessor__.lifecycle!==h.v.DESTROYED?n?function(e,t,r){const n=(0,g.qg)(e,t,r,((e,t,r)=>{let s=!1;return(0,p.mJ)((()=>(0,d.RP)(e,t)),((i,a)=>{e.__accessor__.lifecycle!==h.v.DESTROYED?s||(s=!0,(0,o.aI)(a,i)||r.call(e,i,a,t,e),s=!1):n.remove()}))}));return n}(e,t,r):function(e,t,r){let n=(0,g.qg)(e,t,r,((e,t,r)=>{let o,i,a=(0,p.Df)((()=>(0,d.RP)(e,t)),((s,a)=>{e.__accessor__?.lifecycle===h.v.DESTROYED||o&&o.uid!==i?n.remove():(o||(o=y.acquireUntracked(s,r,a,e,t),i=o.uid),_(o))}));return(0,s.hA)((()=>{a.remove(),o&&(o.uid!==i||o.removed||(o.removed=!0,_(o)),o=null),n=a=null}))}));return n}(e,t,r):(0,s.hA)()}function T(e,t,r=!1,n=o.gh){return r?function(e,t,r){let n=!1;return(0,p.mJ)(e,((e,s)=>{n||(n=!0,r(s,e)||t(e,s),n=!1)}))}(e,t,n):function(e,t,r){let n,o,i=(0,p.Df)(e,((e,s)=>{n&&n.uid!==o?i.remove():(n||(n=y.acquireTracked(e,t,s,r),o=n.uid),_(n))}));return(0,s.hA)((()=>{i.remove(),n&&(n.uid!==o||n.removed||(n.removed=!0,_(n)),n=null),i=null}))}(e,t,n)}},49422:(e,t,r)=>{"use strict";r.d(t,{M:()=>h,R:()=>d});var n=r(4576),s=r(49186),o=r(53966),i=r(16649),a=r(35666),c=r(88620),l=r(51822);function u(e,t,r,n,s){const o={};return t.write?.writer?.call(e,n,o,r,s),o}function f(e,t,r,c,l,u){if(!c?.write)return!1;const f=(0,i.Jt)(e,r);if(!l&&c.write.overridePolicy){const t=c.write.overridePolicy.call(e,f,r,u??void 0);void 0!==t&&(l=t)}if(l||(l=c.write),!l||!1===l.enabled)return!1;if(l.layerContainerTypes&&u?.layerContainerType&&!l.layerContainerTypes.includes(u.layerContainerType))return!1;if((null===f&&!l.allowNull&&!l.writerEnsuresNonNull||void 0===f)&&l.isRequired){const t=new s.A("web-document-write:property-required",`Missing value for required property '${r}' on '${e.declaredClass}'`,{propertyName:r,target:e});return t&&u?.messages?u.messages.push(t):t&&!u&&o.A.getLogger("esri.core.accessorSupport.write").error(t.name,t.message),!1}return!(void 0===f||null===f&&!l.allowNull&&!l.writerEnsuresNonNull||!(l.alwaysWriteDefaults||t.store.multipleOriginsSupported&&t.store.originOf(r)!==a.Gr.DEFAULTS)&&function(e,t,r,s,o){const i=s.default;if(void 0===i)return!1;if(null!=s.defaultEquals)return s.defaultEquals(o);if("function"==typeof i){if(Array.isArray(o)){const s=i.call(e,t,r??void 0);return(0,n.aI)(s,o)}return!1}return i===o}(e,r,u,c,f)||!l.ignoreOrigin&&u?.origin&&t.store.multipleOriginsSupported&&t.store.originOf(r)<(0,a.aB)(u.origin))}function d(e,t,r,n){const s=(0,c.oY)(e),o=s.metadata,i=(0,l.k4)(o[t],n);return!!i&&f(e,s,t,i,r,n)}function h(e,t,r){if(e&&"function"==typeof e.toJSON&&(!e.toJSON.isDefaultToJSON||!e.write))return(0,c.h1)(t,e.toJSON(r));const n=(0,c.oY)(e),s=n.metadata;for(const o in s){const d=(0,l.k4)(s[o],r);if(!f(e,n,o,d,void 0,r))continue;const h=(0,i.Jt)(e,o),p=u(e,d,d.write&&"string"==typeof d.write.target?d.write.target:o,h,r);Object.keys(p).length>0&&(t=(0,c.h1)(t,p),r?.resources?.pendingOperations?.length&&r.resources.pendingOperations.push(Promise.all(r.resources.pendingOperations).then((()=>(0,c.h1)(t,p,(()=>"replace-arrays"))))),r?.writtenProperties&&r.writtenProperties.push({target:e,propName:o,oldOrigin:(0,a.in)(n.store.originOf(o)),newOrigin:r.origin}))}return t}},4576:(e,t,r)=>{"use strict";r.d(t,{$U:()=>i,Am:()=>a,He:()=>o,Ji:()=>s,Mo:()=>b,Ru:()=>w,TF:()=>_,Xj:()=>u,Xy:()=>p,aI:()=>c,iv:()=>l,k4:()=>v,mW:()=>y,qh:()=>h,vW:()=>f});var n=r(87811);const s=1.5,o=1/s,i=.5;function a(e,t){return t?e.filter(((e,r,n)=>n.findIndex(t.bind(null,e))===r)):Array.from(new Set(e))}function c(e,t,r){if(null==e&&null==t)return!0;if(null==e||null==t||e.length!==t.length)return!1;if(r){for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function l(e,t,r){let n,s;return r?(n=t.filter((t=>!e.some((e=>r(e,t))))),s=e.filter((e=>!t.some((t=>r(t,e)))))):(n=t.filter((t=>!e.includes(t))),s=e.filter((e=>!t.includes(e)))),{added:n,removed:s}}function u(e){return e&&"number"==typeof e.length}class f{constructor(){this.last=0}}const d=new f;function h(e,t,r,n){n=n||d;const s=Math.max(0,n.last-10);for(let o=s;o<r;++o)if(e[o]===t)return n.last=o,o;const o=Math.min(s,r);for(let r=0;r<o;++r)if(e[r]===t)return n.last=r,r;return-1}function p(e,t,r,n){const s=r??e.length,o=h(e,t,s,n);if(-1!==o)return e[o]=e[s-1],null==r&&e.pop(),t}const g=new Set;function y(e,t,r=e.length,n=t.length,s,o){if(0===n||0===r)return r;g.clear();for(let e=0;e<n;++e)g.add(t[e]);s=s||d;const i=Math.max(0,s.last-10);for(let t=i;t<r;++t)if(g.has(e[t])&&(o?.push(e[t]),g.delete(e[t]),e[t]=e[r-1],--r,--t,0===g.size||0===r))return g.clear(),r;for(let t=0;t<i;++t)if(g.has(e[t])&&(o?.push(e[t]),g.delete(e[t]),e[t]=e[r-1],--r,--t,0===g.size||0===r))return g.clear(),r;return g.clear(),r}function b(e){return e?(m.seed=e,()=>m.getFloat()):Math.random}const m=new n.A;function v(e,t){const r=b(t);for(let t=e.length-1;t>0;t--){const n=Math.floor(r()*(t+1)),s=e[t];e[t]=e[n],e[n]=s}return e}function _(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}function w(e,t){return null!=e}},51447:(e,t,r)=>{"use strict";r.d(t,{Lx:()=>a,eF:()=>c,eO:()=>i,io:()=>l});var n=r(44208);const s=new WeakMap;function o(e,t,r=!1){const n=`🛑 DEPRECATED - ${t}`;if(!r)return void e.warn(n);let o=s.get(e);o||(o=new Set,s.set(e,o)),o.has(t)||(o.add(t),e.warn(n))}function i(e,t,r={}){if((0,n.A)("esri-deprecation-warnings")){const{moduleName:n}=r;l(e,"Function: "+(n?n+"::":"")+t+"()",r)}}function a(e,t,r={}){if((0,n.A)("esri-deprecation-warnings")){const{moduleName:n}=r;l(e,"Property: "+(n?n+"::":"")+t,r)}}function c(e,t,r={}){(0,n.A)("esri-deprecation-warnings")&&l(e,`Multiple argument constructor: ${t}`,{warnOnce:!0,replacement:`new ${t}({ <your properties here> })`,...r})}function l(e,t,r={}){if((0,n.A)("esri-deprecation-warnings")){const{replacement:n,version:s,see:i,warnOnce:a}=r;let c=t;n&&(c+=`\n\t🛠️ Replacement: ${n}`),s&&(c+=`\n\t⚙️ Version: ${s}`),i&&(c+=`\n\t🔗 See ${i} for more details.`),o(e,c,a)}}},37955:(e,t,r)=>{"use strict";r.d(t,{Oo:()=>a,on:()=>i,wb:()=>s});var n=r(36563);function s(e){return function(e){return null!=e&&"object"==typeof e&&"on"in e&&"function"==typeof e.on}(e)||o(e)}function o(e){return null!=e&&"object"==typeof e&&"addEventListener"in e&&"function"==typeof e.addEventListener}function i(e,t,r){if(!s(e))throw new TypeError("target is not a Evented or EventTarget object");return o(e)?function(e,t,r,s){if(Array.isArray(t)){const o=t.slice();for(const t of o)e.addEventListener(t,r,s);return(0,n.hA)((()=>{for(const t of o)e.removeEventListener(t,r,s)}))}return e.addEventListener(t,r,s),(0,n.hA)((()=>e.removeEventListener(t,r,s)))}(e,t,r):e.on(t,r)}function a(e,t,r){if(!s(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,r);const n=i(e,t,(t=>{n.remove(),r.call(e,t)}));return n}},36563:(e,t,r)=>{"use strict";r.d(t,{hA:()=>s,vE:()=>o});const n={remove:()=>{}};function s(e){return e?{remove(){e&&(e(),e=void 0)}}:n}function o(e){return s((()=>function(e){e.forEach((e=>e?.remove()))}(e)))}},44208:(e,t,r)=>{"use strict";let n;function s(e){return"function"==typeof n[e]?n[e]=n[e](globalThis):n[e]}r.d(t,{A:()=>s}),n=globalThis.dojoConfig?.has||globalThis.esriConfig?.has?{...globalThis.dojoConfig?.has,...globalThis.esriConfig?.has}:{},s.add=(e,t,r,o)=>{(o||void 0===n[e])&&(n[e]=t),r&&s(e)},s.cache=n,s.add("big-integer-warning-enabled",!0),s.add("esri-deprecation-warnings",!0),s.add("esri-tests-disable-screenshots",!1),s.add("esri-tests-use-full-window",!1),s.add("esri-tests-post-to-influx",!0),s.add("esri-cim-animations-enable-status","enabled"),s.add("esri-cim-animations-spotlight",!1),s.add("esri-cim-animations-freeze-time",!1),s.add("enable-feature:multiple-highlights",!1),(()=>{s.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const e="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(s.add("host-browser",e),s.add("host-node","object"==typeof globalThis.process&&globalThis.process.versions?.node&&globalThis.process.versions.v8),s.add("dom",e),s("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(s.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),s.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),s.add("khtml",r.includes("Konqueror")?n:void 0),s.add("edge",parseFloat(t.split("Edge/")[1])||void 0),s.add("opr",parseFloat(t.split("OPR/")[1])||void 0),s.add("webkit",!s("wp")&&!s("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),s.add("chrome",!s("edge")&&!s("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),s.add("android",!s("wp")&&parseFloat(t.split("Android ")[1])||void 0),s.add("safari",!r.includes("Safari")||s("wp")||s("chrome")||s("android")||s("edge")||s("opr")?void 0:parseFloat(r.split("Version/")[1])),s.add("mac",r.includes("Macintosh")),!s("wp")&&/(iPhone|iPod|iPad)/.test(t)){const e=RegExp.$1.replace(/P/,"p"),r=/OS ([\d_]+)/.test(t)?RegExp.$1:"1",n=parseFloat(r.replace(/_/,".").replaceAll("_",""));s.add(e,n),s.add("ios",n)}s("webkit")||(!t.includes("Gecko")||s("wp")||s("khtml")||s("edge")||s.add("mozilla",n),s("mozilla")&&s.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),r=/iPhone/i.test(e);t&&s.add("esri-mobile",t),r&&s.add("esri-iPhone",r),s.add("esri-geolocation",!!navigator.geolocation)}s.add("esri-wasm","WebAssembly"in globalThis),s.add("esri-performance-mode-frames-between-render",20),s.add("esri-force-performance-mode",!1),s.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),s.add("wasm-simd",(()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])))),s.add("esri-atomics","Atomics"in globalThis),s.add("esri-workers","Worker"in globalThis),s.add("web-feat:cache","caches"in globalThis),s.add("esri-workers-arraybuffer-transfer",!s("safari")||Number(s("safari"))>=12),s.add("workers-pool-size",8),s.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),s.add("featurelayer-simplify-payload-size-factors",[1,1,4]),s.add("featurelayer-fast-triangulation-enabled",!0),s.add("featurelayer-animation-enabled",!0),s.add("featurelayer-snapshot-enabled",!0),s.add("featurelayer-snapshot-point-min-threshold",8e4),s.add("featurelayer-snapshot-point-max-threshold",4e5),s.add("featurelayer-snapshot-point-coverage",.1),s.add("featurelayer-query-max-depth",4),s.add("featurelayer-query-pausing-enabled",!1),s.add("featurelayer-advanced-symbols",!1),s.add("featurelayer-pbf",!0),s.add("featurelayer-pbf-statistics",!1),s.add("feature-layers-workers",!0),s.add("feature-polyline-generalization-factor",1),s.add("mapview-transitions-duration",200),s.add("mapview-essential-goto-duration",200),s.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),s.add("mapserver-pbf-version-support",10.81),s.add("mapservice-popup-identify-max-tolerance",20),s("host-webworker")||s("host-browser")&&(s.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),s.add("esri-image-decode",(()=>{if("decode"in new Image){const e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>',void e.decode().then((()=>{s.add("esri-image-decode",!0,!0,!0)})).catch((()=>{s.add("esri-image-decode",!1,!0,!0)}))}return!1})),s.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})()},5479:(e,t,r)=>{"use strict";function n(e){const t=[];return function*(){yield*t;for(const r of e)t.push(r),yield r}}function s(e,t){for(const r of e)if(null!=r&&t(r))return r}function o(e){return null!=e&&"function"==typeof e[Symbol.iterator]}r.d(t,{I6:()=>s,PP:()=>n,xZ:()=>o})},4718:(e,t,r)=>{"use strict";r.d(t,{Nb:()=>c,TU:()=>a,aI:()=>h,gh:()=>p,o8:()=>i,oy:()=>o,zI:()=>g});var n=r(4576),s=r(34275);function o(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&o(e[r],!0));else for(r in e)e.hasOwnProperty(r)&&void 0===e[r]&&delete e[r];return e}function i(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=d(e);if(null!=t)return t;if(c(e))return e.clone();if(l(e))return e.map(i);if(u(e))throw new Error("Trying to clone an unclonable Accessor instance");const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=i(e[t]);return r}function a(e){if(!e||"object"!=typeof e||"function"==typeof e||"HTMLElement"in globalThis&&e instanceof HTMLElement)return e;const t=d(e);if(null!=t)return t;if(l(e)){let t=!0;const r=e.map((e=>{const r=a(e);return null!=e&&null==r&&(t=!1),r}));return t?r:null}if(c(e))return e.clone();if(e instanceof File||e instanceof Blob)return e;if(u(e))return null;const r=new(0,Object.getPrototypeOf(e).constructor);for(const t of Object.getOwnPropertyNames(e)){const n=e[t],s=a(n);if(null!=n&&null==s)return null;r[t]=s}return r}function c(e){return"function"==typeof e.clone}function l(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function u(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function f(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function d(e){if((0,s.dz)(e)||(0,s.mg)(e)||(0,s.UR)(e)||(0,s.IY)(e)||(0,s.jq)(e)||(0,s._G)(e)||(0,s.XJ)(e)||(0,s.vZ)(e)||(0,s.aI)(e))return e.slice();if(e instanceof Date)return new Date(e.getTime());if(e instanceof ArrayBuffer)return e.slice(0,e.byteLength);if(e instanceof Map){const t=new Map;for(const[r,n]of e)t.set(r,i(n));return t}if(e instanceof Set){const t=new Set;for(const r of e)t.add(i(r));return t}return null}function h(e,t){return e===t||"number"==typeof e&&isNaN(e)&&"number"==typeof t&&isNaN(t)||"function"==typeof e?.getTime&&"function"==typeof t?.getTime&&e.getTime()===t.getTime()||!1}function p(e,t){return e===t||(null==e||"string"==typeof e?e===t:"number"==typeof e?e===t||"number"==typeof t&&isNaN(e)&&isNaN(t):e instanceof Date?t instanceof Date&&e.getTime()===t.getTime():Array.isArray(e)?Array.isArray(t)&&(0,n.aI)(e,t):e instanceof Set?t instanceof Set&&function(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}(e,t):e instanceof Map?t instanceof Map&&function(e,t){if(e.size!==t.size)return!1;for(const[r,n]of e){const e=t.get(r);if(e!==n||void 0===e&&!t.has(r))return!1}return!0}(e,t):!!f(e)&&f(t)&&function(e,t){if(null===e||null===t)return!1;const r=Object.keys(e);if(null===t||Object.keys(t).length!==r.length)return!1;for(const n of r)if(e[n]!==t[n]||!Object.prototype.hasOwnProperty.call(t,n))return!1;return!0}(e,t))}function g(e){return e}},97768:(e,t,r)=>{"use strict";function n(e,t){if(null==e)throw new Error(t??"value is None")}function s(e){return e?.destroy(),null}function o(e){return e?.dispose(),null}function i(e){return e?.remove(),null}function a(e){return e?.abort(),null}function c(e){return e?.release(),null}function l(e,t,r){return null!=e&&null!=t?null!=r?r(e,t):e.equals(t):e===t}function u(e,t){let r;return e.some(((e,n)=>(r=t(e,n),null!=r))),r??void 0}r.d(t,{CM:()=>l,DC:()=>a,Gz:()=>c,Lw:()=>n,Pb:()=>u,WD:()=>o,pR:()=>s,xt:()=>i})},26390:(e,t,r)=>{"use strict";r.d(t,{d:()=>s});const n=[];function s(e){n.push(e),1===n.length&&queueMicrotask((()=>{const e=n.slice();n.length=0;for(const t of e)t()}))}},93637:(e,t,r)=>{"use strict";r.d(t,{$N:()=>s,i8:()=>a,sM:()=>i,wc:()=>o});var n=r(4718);function s(e,t,r=!1){return l(e,t,r)}function o(e,t){if(null!=t)return t[e]||c(e.split("."),!1,t)}function i(e,t,r){const n=e.split("."),s=n.pop(),o=c(n,!0,r);o&&s&&(o[s]=t)}function a(e,t){if(null==e&&null==t)return!1;if(null==e)return!0;if(null==t)return!0;if("object"==typeof e){if(Array.isArray(e)){const r=t;if(e.length!==r.length)return!0;for(let t=0;t<e.length;t++)if(a(e[t],r[t]))return!0;return!1}if(Object.keys(e).length!==Object.keys(t).length)return!0;for(const r in e)if(a(e[r],t[r]))return!0;return!1}return e!==t}function c(e,t,r){let n=r;for(const r of e){if(null==n)return;if(!(r in n)){if(!t)return;n[r]={}}n=n[r]}return n}function l(e,t,r){return t?Object.keys(t).reduce(((e,s)=>{let o=e[s],i=t[s];return o===i?e:void 0===o?(e[s]=(0,n.o8)(i),e):(Array.isArray(i)||Array.isArray(e)?(o=o?Array.isArray(o)?e[s]=o.slice():e[s]=[o]:e[s]=[],i&&(Array.isArray(i)||(i=[i]),r?i.forEach((e=>{o.includes(e)||o.push(e)})):e[s]=i.slice())):i&&"object"==typeof i?e[s]=l(o,i,r):e.hasOwnProperty(s)&&!t.hasOwnProperty(s)||(e[s]=i),e)}),e||{}):e}},74887:(e,t,r)=>{"use strict";r.d(t,{Pl:()=>O,Ol:()=>A,nA:()=>w,NK:()=>l,Tw:()=>T,sg:()=>E,Lx:()=>_,QZ:()=>v,zf:()=>m,G4:()=>d,$X:()=>S,u7:()=>g,NY:()=>y,Mq:()=>f,QP:()=>h,Te:()=>u,jH:()=>p,NO:()=>N,z7:()=>k,qr:()=>b});var n=r(36563);const s=(o=globalThis,{setTimeout:(e,t)=>{const r=o.setTimeout(e,t);return(0,n.hA)((()=>o.clearTimeout(r)))}});var o,i=r(49186),a=r(37955),c=(r(53966),r(97768));function l(e="Aborted"){return new i.A("AbortError",e)}function u(e,t="Aborted"){if(d(e))throw l(t)}function f(e){return e instanceof AbortSignal?e:e?.signal??void 0}function d(e){const t=f(e);return null!=t&&t.aborted}function h(e){if(m(e))throw e}function p(e){if(!m(e))throw e}function g(e,t){const r=f(e);if(null!=r){if(!r.aborted)return(0,a.Oo)(r,"abort",(()=>t()));t()}}function y(e,t){const r=f(e);if(null!=r)return u(r),(0,a.Oo)(r,"abort",(()=>t(l())))}function b(e,t){return null==f(t)?e:new Promise(((r,n)=>{let s=g(t,(()=>n(l())));const o=()=>{s=(0,c.xt)(s)};e.then(o,o),e.then(r,n)}))}function m(e){return"AbortError"===e?.name}async function v(e){try{return await e}catch(e){if(!m(e))throw e;return}}async function _(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e),r=t.map((t=>e[t])),n=await _(r),s={};return t.map(((e,t)=>s[e]=n[t])),s}const t=e;return Promise.allSettled(t).then((e=>Array.from(t,((t,r)=>{const n=e[r];return"fulfilled"===n.status?{promise:t,value:n.value}:{promise:t,error:n.reason}}))))}async function w(e){return(await Promise.allSettled(e)).filter((e=>"fulfilled"===e.status)).map((e=>e.value))}async function A(e){return(await Promise.allSettled(e)).filter((e=>"rejected"===e.status)).map((e=>e.reason))}function O(e,t=void 0,r){const n=new AbortController;return g(r,(()=>n.abort())),new Promise(((r,s)=>{let o=setTimeout((()=>{o=0,r(t)}),e);g(n,(()=>{o&&(clearTimeout(o),s(l()))}))}))}function S(e){return e&&"function"==typeof e.then}function k(e){return S(e)?e:Promise.resolve(e)}function E(e,t=-1){let r,n,s,o,i=null;const a=(...c)=>{if(r){n=c,o&&o.reject(l()),o=T();const e=o.promise;if(i){const e=i;i=null,e.abort()}return e}if(s=o||T(),o=null,t>0){const n=new AbortController;r=k(e(...c,n.signal));const s=r;O(t).then((()=>{r===s&&(o?n.abort():i=n)}))}else r=1,r=k(e(...c));const u=()=>{const e=n;n=s=r=i=null,null!=e&&a(...e)},f=r,d=s;return f.then(u,u),f.then(d.resolve,d.reject),d.promise};return a}function T(){let e,t;const r=new Promise(((r,n)=>{e=r,t=n})),n=t=>{e(t)};return n.resolve=t=>e(t),n.reject=e=>t(e),n.timeout=(e,t)=>s.setTimeout((()=>n.reject(t)),e),n.promise=r,n}async function N(e){await Promise.resolve(),u(e)}},11932:(e,t,r)=>{"use strict";r.d(t,{$m:()=>A,_:()=>g,md:()=>w});var n=r(26390),s=r(61604),o=r(3694),i=r(74887),a=r(78659);class c{constructor(e){this.callback=e,this.isActive=!0}remove(){this.isActive=!1}}let l=0;const u={time:(0,a.l5)(0),deltaTime:(0,a.l5)(0),elapsedFrameTime:(0,a.l5)(0),frameDuration:(0,a.l5)(0)},f=["prepare","preRender","render","postRender","update","finish"],d=[],h=new o.A,p={frameTasks:h,willDispatch:!1,clearFrameTasks:function(e=!1){h.forAll((e=>{e.removed=!0})),e&&v()},dispatch:_,executeFrameTasks:function(e){const t=(0,a.l5)(e-l);l=e;const r=1e3/60,n=Math.max(0,t-r);u.time=e,u.frameDuration=(0,a.l5)(r-n);for(let r=0;r<f.length;r++){const n=performance.now(),s=f[r];h.forAll((n=>{n.paused||n.removed||(0===r&&n.ticks++,n.phases[s]&&(u.elapsedFrameTime=(0,a.l5)(performance.now()-e),u.deltaTime=0===n.ticks?(0,a.l5)(0):t,n.phases[s]?.call(n,u)))})),O[r].push(performance.now()-n)}v(),S.push(performance.now()-e)},reschedule:function(){null!=y&&(cancelAnimationFrame(y),y=requestAnimationFrame(b))}};function g(e){const t=new c(e);return d.push(t),p.willDispatch||(p.willDispatch=!0,(0,n.d)(_)),t}let y=null;function b(){const e=performance.now();y=null;const t=h.some((e=>!e.paused&&!e.removed));y=t?requestAnimationFrame(b):null,p.executeFrameTasks(e)}const m=new o.A;function v(){h.forAll((e=>{e.removed&&m.push(e)})),h.removeUnorderedMany(m.data,m.length),m.clear()}function _(){for(;d.length;){const e=d.shift();e.isActive&&e.callback()}p.willDispatch=!1}function w(e=1,t){const r=(0,i.Tw)(),s=()=>{(0,i.G4)(t)?r.reject((0,i.NK)()):0===e?r():(--e,(0,n.d)((()=>s())))};return s(),r.promise}async function A(e){await function(e){return w(1,e)}(e),await new Promise((t=>requestAnimationFrame((()=>{e?.aborted||t()}))))}const O=f.map((e=>new s.A(e))),S=new s.A("total")},799:(e,t,r)=>{"use strict";r.d(t,{Cj:()=>a,HC:()=>i,Wm:()=>c,_e:()=>u});var n=r(93637);const s=/\{([^}]+)\}/g;function o(e){return e??""}function i(e,t){return t?e.replaceAll(s,"object"==typeof t?(e,r)=>o((0,n.wc)(r,t)):(e,r)=>o(t(r))):e}function a(e,t){return e.replaceAll(/([.$?*|{}()[\]\\/+\-^])/g,(e=>t?.includes(e)?e:`\\${e}`))}function c(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}let l;function u(e){return l??=new DOMParser,l.parseFromString(e||"","text/html").body.innerText||""}},78659:(e,t,r)=>{"use strict";function n(e){return e}function s(e){return 1e3*e}function o(e){return e}r.d(t,{Kp:()=>o,gr:()=>s,l5:()=>n})},34275:(e,t,r)=>{"use strict";function n(e){return e instanceof ArrayBuffer}function s(e){return"Int8Array"===e?.constructor?.name}function o(e){return"Uint8Array"===e?.constructor?.name}function i(e){return"Uint8ClampedArray"===e?.constructor?.name}function a(e){return"Int16Array"===e?.constructor?.name}function c(e){return"Uint16Array"===e?.constructor?.name}function l(e){return"Int32Array"===e?.constructor?.name}function u(e){return"Uint32Array"===e?.constructor?.name}function f(e){return"Float32Array"===e?.constructor?.name}function d(e){return"Float64Array"===e?.constructor?.name}function h(e){return"buffer"in e}r.d(t,{IY:()=>a,JI:()=>g,UR:()=>i,XJ:()=>u,_G:()=>l,a3:()=>b,aI:()=>d,dk:()=>y,dz:()=>s,iu:()=>h,jq:()=>c,mg:()=>o,mw:()=>n,vZ:()=>f,y9:()=>p}),r(44208);const p=1024;function g(e){return d(e)||f(e)||l(e)||a(e)||s(e)}function y(e){return d(e)||f(e)}function b(e){return d(e)?179769e303:f(e)?3402823e32:u(e)?4294967295:c(e)?65535:o(e)||i(e)?255:l(e)?2147483647:a(e)?32767:s(e)?127:256}},24326:(e,t,r)=>{"use strict";r.d(t,{c:()=>s});let n=0;function s(){return++n}},84952:(e,t,r)=>{"use strict";r.d(t,{$1:()=>Q,$z:()=>V,An:()=>T,BQ:()=>oe,DB:()=>Z,FL:()=>B,FX:()=>z,Hg:()=>re,Il:()=>he,N9:()=>se,S8:()=>G,T1:()=>ge,UC:()=>pe,V1:()=>W,Xq:()=>k,Zo:()=>_e,_0:()=>Ae,a6:()=>ve,b8:()=>D,e7:()=>de,fj:()=>H,gd:()=>E,lJ:()=>X,lM:()=>ce,m3:()=>ae,nM:()=>fe,oP:()=>K,oy:()=>$,r$:()=>te,rs:()=>me,s0:()=>w,s2:()=>J,sC:()=>q,s_:()=>P,tk:()=>ne,ut:()=>U,w8:()=>Y,x0:()=>j,xw:()=>we,yM:()=>C,zf:()=>N,zi:()=>be,zs:()=>R});var n=r(92602),s=r(4576),o=r(49186),i=r(25482),a=r(53966),c=r(39131),l=r(26306);const u=()=>a.A.getLogger("esri.core.urlUtils"),f=n.A.request,d="esri/config: esriConfig.request.proxyUrl is not set.",h=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,p=/^\s*http:/i,g=/^\s*https:/i,y=/^\s*file:/i,b=/:\d+$/,m=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,v=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),_=new RegExp("^((([^[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^[:]*))(:([0-9]+))?$");class w{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=this.uri.match(v);this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),null!=this.authority&&(t=this.authority.match(_),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const A={};let O=new w(n.A.applicationUrl);let S=function(){const e=O.path,t=e.slice(0,e.lastIndexOf("/")+1);return`${O.scheme}://${O.host}${null!=O.port?`:${O.port}`:""}${t}`}();const k=()=>O,E=()=>S;function T(e){if(!e)return null;const t={path:null,query:null},r=new w(e),n=e.indexOf("?");return null===r.query?t.path=e:(t.path=e.slice(0,n),t.query=N(r.query)),r.fragment&&(t.hash=r.fragment,null===r.query&&(t.path=t.path.slice(0,t.path.length-(r.fragment.length+1)))),t}function N(e){const t=e.split("&"),r={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let n,s;t<0?(n=decodeURIComponent(e),s=""):(n=decodeURIComponent(e.slice(0,t)),s=decodeURIComponent(e.slice(t+1)));let o=r[n];"string"==typeof o&&(o=r[n]=[o]),Array.isArray(o)?o.push(s):r[n]=s}return r}function j(e,t){return e?t&&"function"==typeof t?Object.keys(e).map((r=>encodeURIComponent(r)+"="+encodeURIComponent(t(r,e[r])))).join("&"):Object.keys(e).map((r=>{const n=e[r];if(null==n)return"";const s=encodeURIComponent(r)+"=",o=t?.[r];return o?s+encodeURIComponent(o(n)):Array.isArray(n)?n.map((e=>i.A.isSerializable(e)?s+encodeURIComponent(JSON.stringify(e)):s+encodeURIComponent(e))).join("&"):i.A.isSerializable(n)?s+encodeURIComponent(JSON.stringify(n)):s+encodeURIComponent(n)})).filter((e=>e)).join("&"):""}function P(e=!1){let t,r=f.proxyUrl;if("string"==typeof e){t=ae(e);const n=R(e);n&&(r=n.proxyUrl)}else t=!!e;if(!r)throw u().warn(d),new o.A("urlUtils:proxy-not-set",d);return t&&le()&&(r=ce(r)),T(r)}function C(e,t=!1){const r=R(e);let n,s;if(r){const e=M(r.proxyUrl);n=e.path,s=e.query?N(e.query):null}else if(t){const t=P(e);n=t.path,s=t.query}if(n){const t=T(e);e=n+"?"+t.path;const r=j({...s,...t.query});r&&(e=`${e}?${r}`)}return e}const I={path:"",query:""};function M(e){const t=e.indexOf("?");return-1!==t?(I.path=e.slice(0,t),I.query=e.slice(t+1)):(I.path=e,I.query=null),I}function x(e){return(e=ue(e=he(e=M(e).path),!0)).toLowerCase()}function $(e){const t={proxyUrl:e.proxyUrl,urlPrefix:x(e.urlPrefix)},r=f.proxyRules,n=t.urlPrefix;let s=r.length;for(let e=0;e<r.length;e++){const t=r[e].urlPrefix;if(0===n.indexOf(t)){if(n.length===t.length)return-1;s=e;break}0===t.indexOf(n)&&(s=e+1)}return r.splice(s,0,t),s}function R(e){const t=f.proxyRules,r=x(e);for(let e=0;e<t.length;e++)if(0===r.indexOf(t[e].urlPrefix))return t[e]}function D(e,t){if(!e||!t)return!1;e=L(e),t=L(t);const r=(0,c.py)(e),n=(0,c.py)(t);return null!=r&&null!=n?r.portalHostname===n.portalHostname:null==r&&null==n&&z(e,t,!0)}function U(e,t){return e=L(e),t=L(t),ue(e)===ue(t)}function L(e){const t=(e=G(e)).indexOf("/sharing");return t>0?e.slice(0,t):e.replace(/\/+$/,"")}function q(e,t=f.interceptors){const r=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t);if(t)for(const e of t)if(Array.isArray(e.urls)){if(e.urls.some(r))return e}else if(r(e.urls))return e;return null}function z(e,t,r=!1){if(!e||!t)return!1;const n=ye(e),s=ye(t);return!(!r&&n.scheme!==s.scheme)&&null!=n.host&&null!=s.host&&n.host.toLowerCase()===s.host.toLowerCase()&&n.port===s.port}function B(e){if("string"==typeof e){if(!K(e))return!0;e=ye(e)}if(z(e,O))return!0;const t=f.trustedServers||[];for(let r=0;r<t.length;r++){const n=F(t[r]);for(let t=0;t<n.length;t++)if(z(e,n[t]))return!0}return!1}function F(e){return A[e]||(ie(e)||oe(e)?A[e]=[new w(J(e))]:A[e]=[new w(`http://${e}`),new w(`https://${e}`)]),A[e]}function J(e,t=S,r){return oe(e)?r?.preserveProtocolRelative?e:"http"===O.scheme&&O.authority===V(e).slice(2)?`http:${e}`:`https:${e}`:ie(e)?e:H("/"===e[0]?function(e){const t=e.indexOf("//"),r=e.indexOf("/",t+2);return-1===r?e:e.slice(0,r)}(t):t,e)}function W(e,t=S,r){if(null==e||!K(e))return e;const n=G(e),s=n.toLowerCase(),o=G(t).toLowerCase().replace(/\/+$/,""),i=r?G(r).toLowerCase().replace(/\/+$/,""):null;if(i&&0!==o.indexOf(i))return e;const a=(e,t,r)=>-1===(r=e.indexOf(t,r))?e.length:r;let c=a(s,"/",s.indexOf("//")+2),l=-1;for(;s.slice(0,c+1)===o.slice(0,c)+"/"&&(l=c+1,c!==s.length);)c=a(s,"/",c+1);if(-1===l)return e;if(i&&l<i.length)return e;e=n.slice(l);const u=o.slice(l-1).replaceAll(/[^/]+/g,"").length;if(u>0)for(let t=0;t<u;t++)e=`../${e}`;else e=`./${e}`;return e}function G(e){return function(e){const t=f.httpsDomains;if(!function(e){return null!=e&&p.test(e)||"http"===O.scheme&&oe(e)}(e))return e;const r=e.indexOf("/",7);let n;if(n=-1===r?e:e.slice(0,r),n=n.toLowerCase().slice(7),b.test(n)){if(!n.endsWith(":80"))return e;n=n.slice(0,-3),e=e.replace(":80","")}return"http"===O.scheme&&n===O.authority&&!m.test(e)||(le()&&n===O.authority||t&&t.some((e=>n===e||n.endsWith(`.${e}`)))||le()&&!R(e))&&(e=ce(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=M(e);e=(e=t.path.replaceAll(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=J(e=e.trim()))))}function H(...e){const t=e.filter(s.Ru);if(!t?.length)return;const r=[];if(K(t[0])){const e=t[0],n=e.indexOf("//");-1!==n&&(r.push(e.slice(0,n+1)),function(e){return null!=e&&y.test(e)}(t[0])&&(r[0]+="/"),t[0]=e.slice(n+2))}else"/"===t[0][0]&&r.push("");const n=t.reduce(((e,t)=>t?e.concat(t.split("/")):e),[]);for(let e=0;e<n.length;e++){const t=n[e];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&e===n.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function V(e,t=!1){if(null==e||Y(e)||Z(e))return null;let r=e.indexOf("://");if(-1===r&&oe(e))r=2;else{if(-1===r)return null;r+=3}const n=e.indexOf("/",r);return-1!==n&&(e=e.slice(0,n)),t&&(e=ue(e,!0)),e}function K(e){return oe(e)||ie(e)}function Y(e){return null!=e&&"blob:"===e.slice(0,5)}function Z(e){return null!=e&&"data:"===e.slice(0,5)}function X(e){const t=te(e);return t?.isBase64?(0,l.M)(t.data):null}function Q(e){return(0,l.Y)(e).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}const ee=/^data:(.*?)(;base64)?,(.*)$/;function te(e){const t=e.match(ee);if(!t)return null;const[,r,n,s]=t;return{mediaType:r,isBase64:!!n,data:s}}function re(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}async function ne(e){return(await fetch(e)).blob()}function se(e){const t=X(e);if(!t)return null;const r=te(e);return new Blob([t],{type:r.mediaType})}function oe(e){return null!=e&&"/"===e[0]&&"/"===e[1]}function ie(e){return null!=e&&h.test(e)}function ae(e){return null!=e&&g.test(e)||"https"===O.scheme&&oe(e)}function ce(e){return oe(e)?`https:${e}`:e.replace(p,"https:")}function le(){return"https"===O.scheme}function ue(e,t=!1){return oe(e)?e.slice(2):(e=e.replace(h,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function fe(e){let t=0;if(K(e)){const r=e.indexOf("//");-1!==r&&(t=r+2)}const r=e.lastIndexOf("/");return r<t?e:e.slice(0,r+1)}function de(e,t){if(!e)return"";const r=T(e).path.replace(/\/+$/,""),n=r.slice(r.lastIndexOf("/")+1);if(!t?.length)return n;const s=new RegExp(`\\.(${t.join("|")})$`,"i");return n.replace(s,"")}function he(e){return e.endsWith("/")?e:`${e}/`}function pe(e){return e.replace(/\/+$/,"")}function ge(e,t,r){if(!(t&&r&&e&&K(e)))return e;const n=e.indexOf("//"),s=e.indexOf("/",n+2),o=e.indexOf(":",n+2),i=Math.min(s<0?e.length:s,o<0?e.length:o);return e.slice(n+2,i).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,n+2)}${r}${e.slice(i)}`}function ye(e){return"string"==typeof e?new w(J(e)):(e.scheme||(e.scheme=O.scheme),e)}function be(e,t){const r=T(e),n=Object.keys(r.query||{});return n.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${n.join(", ")}.`),r.path}function me(e,t,r){const n=T(e),s=n.query||{};return s[t]=String(r),`${n.path}?${j(s)}`}function ve(e,t){if(!t)return e;const r=T(e),n=r.query||{};for(const[e,r]of Object.entries(t))null!=r&&(n[e]=r);const s=j(n);return s?`${r.path}?${s}`:r.path}function _e(e){if(null==e)return null;const t=e.match(Oe);return t?t[2]:null}function we(e){if(null==e)return null;const t=e.match(Oe);return t?{path:t[1],extension:t[2]}:{path:e,extension:null}}async function Ae(e){return"string"==typeof e?te(e)??{data:e}:new Promise(((t,r)=>{const n=new FileReader;n.readAsDataURL(e),n.onload=()=>t(te(n.result)),n.onerror=e=>r(e)}))}const Oe=/([^.]*)\.([^/]*)$/},52268:(e,t,r)=>{"use strict";function n(e,t){return new Proxy({},{get:(r,n,s)=>(...r)=>{let s,o;const i=r[r.length-1];return function(e){return"object"==typeof e&&!Array.isArray(e)&&null!=e&&("signal"in e||"transferList"in e||0===Object.keys(e).length)}(i)&&(s=i.signal,o=i.transferList,r.pop()),e.apply(t?`${t}.${n.toString()}`:n.toString(),r,{transferList:o,signal:s})}})}r.d(t,{L:()=>n})},61322:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>_});var n=r(70333),s=r(49186),o=r(37955),i=r(36563),a=r(97768),c=r(74887),l=r(52268);const u={statsWorker:()=>Promise.all([r.e(6285),r.e(4996),r.e(8902),r.e(4080),r.e(7455),r.e(8417),r.e(201),r.e(3009)]).then(r.bind(r,33009)),geometryEngineWorker:()=>Promise.all([r.e(9930),r.e(6387)]).then(r.bind(r,68887)),CSVSourceWorker:()=>Promise.all([r.e(6285),r.e(7251),r.e(8368),r.e(4996),r.e(8902),r.e(4080),r.e(7455),r.e(7339),r.e(8417),r.e(708),r.e(201),r.e(8660),r.e(6781)]).then(r.bind(r,40752)),EdgeProcessingWorker:()=>Promise.all([r.e(3030),r.e(9899),r.e(7346)]).then(r.bind(r,71936)),ElevationSamplerWorker:()=>Promise.all([r.e(7251),r.e(4996),r.e(8902),r.e(4080),r.e(7455),r.e(3030),r.e(2324)]).then(r.bind(r,38419)),FeatureServiceSnappingSourceWorker:()=>Promise.all([r.e(6285),r.e(7251),r.e(8368),r.e(4996),r.e(8902),r.e(4080),r.e(7455),r.e(893),r.e(7339),r.e(8417),r.e(708),r.e(201),r.e(8660),r.e(3427)]).then(r.bind(r,12543)),GeoJSONSourceWorker:()=>Promise.all([r.e(6285),r.e(7251),r.e(8368),r.e(4996),r.e(8902),r.e(4080),r.e(7455),r.e(7339),r.e(8417),r.e(708),r.e(201),r.e(8660),r.e(629)]).then(r.bind(r,71202)),LercWorker:()=>r.e(7087).then(r.bind(r,57087)),MemorySourceWorker:()=>Promise.all([r.e(6285),r.e(7251),r.e(8368),r.e(4996),r.e(8902),r.e(4080),r.e(7455),r.e(7339),r.e(8417),r.e(708),r.e(201),r.e(8660),r.e(8985)]).then(r.bind(r,29432)),PBFDecoderWorker:()=>Promise.all([r.e(4996),r.e(8902),r.e(4080),r.e(708),r.e(9748)]).then(r.bind(r,97367)),FeaturePipelineWorker:()=>Promise.all([r.e(6285),r.e(587),r.e(6311),r.e(7251),r.e(8368),r.e(4996),r.e(8902),r.e(4080),r.e(7455),r.e(893),r.e(7339),r.e(8417),r.e(708),r.e(201),r.e(2626),r.e(9949),r.e(9423),r.e(5263),r.e(821),r.e(6020)]).then(r.bind(r,16020)),PointCloudWorker:()=>Promise.all([r.e(4996),r.e(7455),r.e(690),r.e(2944),r.e(7984),r.e(378)]).then(r.bind(r,34142)),RasterWorker:()=>Promise.all([r.e(7251),r.e(4996),r.e(8902),r.e(4080),r.e(984),r.e(6049),r.e(4055)]).then(r.bind(r,30139)),SceneLayerSnappingSourceWorker:()=>Promise.all([r.e(7455),r.e(690),r.e(3030),r.e(9899),r.e(6064)]).then(r.bind(r,46064)),SceneLayerWorker:()=>Promise.all([r.e(6285),r.e(7251),r.e(4996),r.e(8902),r.e(4080),r.e(7455),r.e(690),r.e(8417),r.e(2944),r.e(9868),r.e(4654),r.e(5456)]).then(r.bind(r,36233)),WFSSourceWorker:()=>Promise.all([r.e(6285),r.e(7251),r.e(8368),r.e(4996),r.e(8902),r.e(4080),r.e(7455),r.e(7339),r.e(8417),r.e(708),r.e(201),r.e(8660),r.e(4444)]).then(r.bind(r,33771)),WorkerTileHandler:()=>Promise.all([r.e(4996),r.e(8902),r.e(9949),r.e(5013),r.e(9423),r.e(3379)]).then(r.bind(r,11764)),Lyr3DWorker:()=>r.e(9234).then(r.bind(r,79234)),Feature3DPipelineWorker:()=>Promise.all([r.e(6285),r.e(3874),r.e(1147),r.e(587),r.e(7251),r.e(8368),r.e(4996),r.e(8902),r.e(4080),r.e(7455),r.e(893),r.e(690),r.e(7339),r.e(8417),r.e(708),r.e(3030),r.e(201),r.e(2944),r.e(9899),r.e(9868),r.e(2626),r.e(655),r.e(2728),r.e(5263),r.e(9855)]).then(r.bind(r,62025)),TextureCompressionWorker:()=>r.e(3308).then(r.bind(r,13308))};var f=r(8341),d=r(18357);const{CLOSE:h,ABORT:p,INVOKE:g,RESPONSE:y,OPEN_PORT:b,ON:m}=f.Go;class v{constructor(e){this._invoke=e,this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._timer=null,this._process=this._process.bind(this)}push(e){e.type===f.Go.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 _{static connect(e,t){const r=new MessageChannel;let n;n="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const s=new _(r.port1,{channel:r,client:n,schedule:t});return"object"==typeof n&&"remoteClient"in n&&(n.remoteClient=s),_.clients.set(s,n),r.port2}static loadWorker(e){const t=u[e];return t?t():Promise.resolve(null)}constructor(e,t,r){this._port=e,this._jobQueue=r,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new v((e=>this._onInvokeMessage(e))),this._client=t.client,this._onMessage=this._onMessage.bind(this),this._channel=t.channel,this._schedule=t.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}close(){this._post({type:h}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,r){return this.apply(e,[t],r)}apply(e,t,r){const n=r?.signal,o=r?.transferList;if(!this._port)return Promise.reject(new s.A(f.T,`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const i=(0,f.Jc)();return new Promise(((r,s)=>{if((0,c.G4)(n))return this._processWork(),void s((0,c.NK)());const l=(0,c.u7)(n,(()=>{const e=this._outJobs.get(i);e&&(this._outJobs.delete(i),this._processWork(),(0,a.xt)(e.abortHandle),this._post({type:p,jobId:i}),s((0,c.NK)()))})),u={resolve:r,reject:s,abortHandle:l,debugInfo:e};this._outJobs.set(i,u),this._post({type:g,jobId:i,methodName:e,abortable:null!=n},t,o)}))}createInvokeProxy(e){return(0,l.L)(this,e)}on(e,t){const r=new MessageChannel;function n(e){t(e.data)}return this._port.postMessage({type:f.Go.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),(0,i.hA)((()=>{r.port1.postMessage({type:f.Go.CLOSE}),r.port1.close(),r.port1.removeEventListener("message",n)}))}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:b,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=2)return;const e=this._jobQueue?.pop();if(!e)return;const{methodName:t,data:r,invokeOptions:n,resolver:s}=e;this.apply(t,r,n).then((e=>s.resolve(e))).catch((e=>s.reject(e)))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{(0,a.xt)(e.abortHandle),e.reject((0,c.NK)(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=null,this._client=null,this._schedule=null}_onMessage(e){null!=this._schedule?this._schedule((()=>this._processMessage(e,!0))):this._processMessage(e,!1)}_processMessage(e,t){const r=(0,f.VI)(e);if(r)switch(r.type){case y:this._onResponseMessage(r);break;case g:t?this._onInvokeMessage(r):this._invokeQueue.push(r);break;case p:this._onAbortMessage(r);break;case h:this._onCloseMessage();break;case b:this._onOpenPortMessage(r);break;case m:this._onOnMessage(r)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),t.delete(r))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&_.clients.get(this)===e&&e.destroy(),_.clients.delete(this),e?.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n=[],abortable:s}=e,o=s?new AbortController:null,i=this._inJobs;let a,l=this._client,u=l[t];try{if(!u&&t&&t.includes(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)l=l[e[t]],u=l[e[t+1]]}if("function"!=typeof u)throw new TypeError(`${t} is not a function`);n.push({client:this,signal:o?o.signal:null}),a=u.apply(l,n)}catch(e){return void this._post({type:y,jobId:r,error:(0,f.mF)(e)})}(0,c.$X)(a)?(i.set(r,{controller:o,promise:a}),a.then((e=>{i.has(r)&&(i.delete(r),this._post({type:y,jobId:r},e))}),(e=>{i.has(r)&&(i.delete(r),(0,c.zf)(e)||this._post({type:y,jobId:r,error:(0,f.mF)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:y,jobId:r},a)}_onOpenPortMessage(e){new _(e.port,{client:this._client})}_onOnMessage(e){const{port:t}=e,r=this._client.on(e.eventType,(e=>{t.postMessage(e)})),n=(0,o.on)(e.port,"message",(e=>{const s=(0,f.VI)(e);s?.type===f.Go.CLOSE&&(n.remove(),r.remove(),t.close())}))}_onResponseMessage(e){const{jobId:t,error:r,data:n}=e,o=this._outJobs;if(!o.has(t))return;const i=o.get(t);o.delete(t),this._processWork(),(0,a.xt)(i.abortHandle),r?i.reject(s.A.fromJSON(JSON.parse(r))):i.resolve(n)}_post(e,t,r){return(0,f.u1)(this._port,e,t,r)}}_.kernelInfo={buildDate:d.$,fullVersion:n.ol,revision:d.u},_.clients=new Map},8341:(e,t,r)=>{"use strict";r.d(t,{Go:()=>i,Jc:()=>l,T:()=>o,VI:()=>d,mF:()=>u,oV:()=>p,u1:()=>f});var n=r(44208),s=r(74887);const o="worker:port-closed";var i,a;(a=i||(i={}))[a.HANDSHAKE=0]="HANDSHAKE",a[a.OPEN=1]="OPEN",a[a.OPENED=2]="OPENED",a[a.RESPONSE=3]="RESPONSE",a[a.INVOKE=4]="INVOKE",a[a.ABORT=5]="ABORT",a[a.CLOSE=6]="CLOSE",a[a.OPEN_PORT=7]="OPEN_PORT",a[a.ON=8]="ON";let c=0;function l(){return c++}function u(e){return e?"string"==typeof e?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function f(e,t,r,s){if(t.type===i.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==i.INVOKE&&t.type!==i.RESPONSE)return void e.postMessage(t);let o;if(function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(r)?(o=h(r.transferList),t.data=r.result):(o=h(s),t.data=r),o){if((0,n.A)("ff"))for(const r of o)if("byteLength"in r&&r.byteLength>267386880){const r="Worker call with large ArrayBuffer would crash Firefox";switch(t.type){case i.INVOKE:throw r;case i.RESPONSE:return void f(e,{type:i.RESPONSE,jobId:t.jobId,error:u(r)})}}e.postMessage(t,o)}else e.postMessage(t)}function d(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function h(e){if(!e?.length)return null;if((0,n.A)("esri-workers-arraybuffer-transfer"))return e;const t=e.filter((e=>!function(e){return e instanceof ArrayBuffer||"ArrayBuffer"===e?.constructor?.name}(e)));return t.length?t:null}async function p(e){try{return await e}catch(e){const t=e?.name===o;if(!(0,s.zf)(e)&&!t)throw e;return}}},70333:(e,t,r)=>{"use strict";r.d(t,{Aq:()=>l,Y3:()=>u,id:()=>a,ol:()=>c,rE:()=>i});var n=r(44208),s=r(84952),o=r(18357);Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const i="4.32";let a,c=i;function l(e){a=e}function u(e){const t=a?.findCredential(e);return t?.token?(0,s.rs)(e,"token",t.token):e}c=`4.32.0-next.${o.$}`,(0,n.A)("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),(0,n.A)("host-webworker")},39131:(e,t,r)=>{"use strict";r.d(t,{$E:()=>i,py:()=>o,qG:()=>a});const n=/^https:\/\/([a-z\d-]+)(\.maps([^.]*))?\.arcgis\.com/i,s={devext:{customBaseUrl:"mapsdevext.arcgis.com",portalHostname:"devext.arcgis.com"},qaext:{customBaseUrl:"mapsqa.arcgis.com",portalHostname:"qaext.arcgis.com"},www:{customBaseUrl:"maps.arcgis.com",portalHostname:"www.arcgis.com"}};function o(e){const t=e?.match(n);if(!t)return null;const[,r,o,i]=t;if(!r)return null;let a=null,c=null,l=null;const{devext:u,qaext:f,www:d}=s;if(o)if(a=r,i)switch(i.toLowerCase()){case"devext":({customBaseUrl:c,portalHostname:l}=u);break;case"qa":({customBaseUrl:c,portalHostname:l}=f);break;default:return null}else({customBaseUrl:c,portalHostname:l}=d);else switch(r.toLowerCase()){case"devext":({customBaseUrl:c,portalHostname:l}=u);break;case"qaext":({customBaseUrl:c,portalHostname:l}=f);break;case"www":({customBaseUrl:c,portalHostname:l}=d);break;default:return null}return{customBaseUrl:c,isPortal:!1,portalHostname:l,urlKey:a}}function i(e){return/\/(sharing|usrsvcs)\/(appservices|servers)\//i.test(e)}function a(e){const t=/^https?:\/\/(?:cdn|[a-z\d-]+\.maps)\.arcgis\.com/i,r=/^https?:\/\/(?:cdndev|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,n=/^https?:\/\/(?:cdnqa|[a-z\d-]+\.mapsqa)\.arcgis\.com/i;return t.test(e)?e=e.replace(t,"https://www.arcgis.com"):r.test(e)?e=e.replace(r,"https://devext.arcgis.com"):n.test(e)&&(e=e.replace(n,"https://qaext.arcgis.com")),e}},26306:(e,t,r)=>{"use strict";function n(e){const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r.buffer}function s(e){const t=new Uint8Array(e);let r="";for(let e=0;e<t.length;e++)r+=String.fromCharCode(t[e]);return btoa(r)}r.d(t,{M:()=>n,Y:()=>s})},18357:(e,t,r)=>{"use strict";r.d(t,{$:()=>n,u:()=>s});const n="20241228",s="6f2aeabc77930f3507de4bdc256bc0a0494d2c3d"}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.m=e,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"chunks/"+{13:"e5d55a35dace70239902",36:"6a737f056b2b95f09776",146:"a1a698b28d28afabc9f6",154:"e1913990f30d285b3b15",177:"78683f1aadc1377be5fd",191:"090697a2a46210da2111",201:"69efc716991a407c3d23",224:"756c2f7c8659deab6c96",309:"785610aa615198fd3815",349:"198d74db9631a66bd850",367:"816c9c81352cd0ca8ce8",369:"3871d2ecef5bcf6ac14f",378:"faf9063420262ea40fd8",382:"ad19e3eaa339b0d6cb44",475:"dd34df14eb4940e2497b",587:"29b610ff44708e044cbd",629:"9a498f2c007f4d78d4dd",655:"23fe65988dbc9e5d7842",690:"9a30ad773c22bde61c64",692:"59bf879b4802a5ba431e",708:"f2cdb7be3fd65f65c30b",812:"a1cd84b70030c94d7908",820:"339e7a900e2bba9d3647",821:"dce55e7f76adecc055c3",830:"f25c04cf1a4bc1d2636a",893:"94432e04de01ee7adc0e",980:"76fa5c7c87831ad25cde",984:"6e254e846e284223ef63",1e3:"943428cf643e87ccfaad",1053:"71bd94cc789a55910f92",1147:"d965090565a802cd2403",1204:"e8ae8a11d8439e2a66ad",1273:"4ffaa2c5ab47a599ee9f",1275:"4446888fbf1f864c3f93",1277:"993db7646a8fc60179eb",1346:"d14e4fc82ad772899336",1384:"d181447e2be06beaa23f",1402:"fa1c68f2ffcdff7986b6",1469:"d9e396adf3354ee68339",1493:"d56d77125798beb7e493",1528:"53e0ea2f7f642e553123",1598:"59455e2dd44b4c01cc76",1728:"127c82cdb229434883b6",1756:"c205e2310a367be57cc3",1761:"7ea3d652536e1d79dfc6",1867:"60b40b2319d1651dd150",1904:"6e9123d7b57a77347ec0",2018:"a776f71b4c7b8728a973",2029:"ecf317c6c790b3cc83bf",2083:"178f606c8896ae5f39de",2153:"d07da8b63d83af179a2c",2165:"a100fb789d72410f8d4f",2180:"243520d9f4a118e63bbc",2186:"9fde9309cb64f1a9301c",2324:"5ea6f9fa41485e5bdbba",2343:"57c1370b310768c0790a",2372:"f5958a67705b4428d7fa",2390:"6ee586c3ea7bb0341c75",2558:"5b32e881762686318a83",2593:"367af4aa7e170c8553e3",2626:"16530347bd78dc6c2fcd",2728:"0191142d5f55cc8cf37a",2731:"6b0baecbd35d26393dcf",2830:"31d9f0a37a5d0a1c450b",2935:"85983548e2d412d99b15",2944:"ef6afba80fa2086ec104",2958:"f717ca7c2581c31de7a6",2980:"263adfd1c2641ef5c0f5",3009:"c0af54cc5938176ce764",3029:"47745c4f74830f981fd4",3030:"5660f13d78e9e4240034",3091:"35f3eef81fac7924a487",3103:"a3cef3837f4df9ab022e",3166:"9b020c47ca9ff5de9bb8",3201:"da5fc368eb5b3592d05e",3209:"f5bf92c315c2944863d1",3308:"6332da54159d72a6ce66",3334:"aedff36d3fec86abb9fb",3359:"8249351daa45ca82ca0c",3379:"0d387baa64a89f88b1de",3390:"5c11e2e65b97565e5003",3427:"dea76ba18acf372beb42",3492:"87f33a60768801ca1ce8",3543:"a7a39a826ce944c15b77",3561:"ed3fb3ea29a2be226322",3582:"5a0eb9dfe668cf290462",3600:"4746b7afa90ea3641e60",3618:"f0adabf6d71a27f3183b",3656:"6592f6eee6bcdb1f3f08",3666:"eef2d94a73064f9bc085",3874:"4b5dbdcad438cb2dd4bf",3920:"3ed7c8138231de3a3b96",3930:"c1c216b0aebe86311fae",3937:"28dd172faa85080511c5",4022:"b1e4813f0c73fc2a483c",4055:"cebdf2f88c4d2ad8baab",4080:"9f7e1a653559fe3edd9a",4111:"0d2411a941c42acb8cc2",4196:"3bb94da29dac3367ecc6",4229:"0837a630e12a21fc2e50",4374:"2a8517b43f93b9d7b4a8",4399:"0f3912bca9fe25eea75c",4405:"66fb341dea20359d47d8",4444:"bff74200a0df0950cf08",4575:"801dbea20966806db1c9",4594:"1100d9d114287b6443e2",4612:"a90611cdc86190799560",4654:"955421ee2247965244f0",4727:"9f0ebeae8a3ba360284b",4796:"1a713cc601c6fcd97d2f",4948:"cc6160e8ab3cea4040c2",4996:"3600125c58d5d04c515a",5013:"048d296efa26ccd79056",5141:"3a2eaa334845cac4d497",5165:"369bfd374dad0b177d79",5178:"f81e63f79256f70ad1c0",5220:"8e60de347b209a753c73",5257:"f92d76b694ff0cdb212c",5263:"1d8609ba413e8a172719",5356:"f9af0473878d960a02f2",5367:"090cfc7f088a729afd47",5404:"a77aa86896bbb0e088df",5456:"cb3af81e1fe6405c4885",5494:"487659783c5154fa6cf5",5613:"88c68881cbdf4e911832",5664:"10fa211987b16fd71a1a",5740:"2427a01678f3d9fbf30b",5754:"fa331c8b556bb7fb8ae3",5804:"46f6a190e3c943b44095",5943:"f5bec71c070086a40ba7",5989:"2209278697ed1d9232ea",6020:"648d7d8fa19a2e772c89",6049:"07304287ed5244fa4e12",6052:"deffd56e39ce725ce377",6064:"71f6e5742cf0c482066b",6131:"111d95d460eab7ebddbb",6165:"0e0b978459d70b15acb5",6183:"cbf57abb537e86c1dd7f",6187:"762567124623f6d11e67",6247:"d45c406c051ab8b33196",6285:"f2a6287c8d28be24f71e",6298:"c6085784a47d8afb36de",6311:"a010c05a876baa0834f3",6343:"bd37c9cc720587665fd3",6387:"89150d12c66c555afacf",6650:"bd3589e49c37ed1a77d3",6676:"533a7fd64b17bb294545",6742:"b611f46835edcd6eefcc",6781:"3a90163b76b0bc7f21d2",6950:"200a5f1864c2c2f7536c",6986:"015285436ca965f94e17",7087:"d9c34e07627d93d4670b",7112:"e2f91098793b8742fae6",7136:"79f9310179c938f18367",7159:"45534f249dc850d34f1f",7251:"f5b57274c3f49ccbcf2e",7292:"e16d2521f006724697c2",7301:"388dc6d50e16930aa66f",7339:"250a810dd4e1ff293564",7346:"4086698137db0795187f",7367:"0b3e1e903120da297641",7375:"8be3a985e9a9de39c4fa",7455:"a6ec3665bde2af8a96e6",7546:"fdf49f8152eba2bb7f6d",7550:"8e42fb623f56942958d8",7561:"664aa401887b59abd7b7",7656:"0bff1b0b11fa2727a11c",7836:"ebf9caf2dc8af89afec2",7899:"66b411119b8ffb99b9dc",7982:"9ad7d095e614e7e8d7f5",7984:"9fc49968dea8e2b64f3e",8003:"210e3553bd91311c8dff",8018:"0673d811c496143fc3d4",8096:"bab541feca7ab4d3f993",8098:"bf0a0ca7fdac98f06a89",8153:"b48bc5a86164ef4c2dae",8219:"348d99b0d64df68a0a9a",8241:"b372a0aab338a5ecad7c",8256:"56ca9d525e63c8536bad",8301:"fdd8a5eb07466541f1f9",8330:"ddce265c46e4dfeb6c6d",8342:"56fc353421252f2d0a99",8368:"c98d90ad85b2582360c9",8392:"c80507443f896dbfaba6",8417:"9372d08ba8bf3342c48f",8463:"19d72185d50ba1ebff50",8480:"b8a6c836e1e90ceccfdb",8541:"b4d76d46661aba356ea3",8628:"1c60000b2888fd84d707",8660:"0e0ee4cb722f6e183bf6",8682:"457d4abc938d14f28e31",8692:"de5c1d54c581407262b2",8846:"b863951a5596d44dbeb2",8902:"0e735d01296d340b393e",8928:"3029354194f1a3030c5c",8958:"9f495ad57cdbfa90c5b8",8969:"7ce1f952f3a809fafb95",8985:"67c7bdc0c91a8f803ea8",9013:"6c1470dc0bd4389d1a2d",9035:"2cccaf50134c65944e0a",9062:"ea250d66089967976c05",9177:"7156d2ae914e1add0109",9186:"7b4c8b32af32a6d945a7",9234:"54eeae28c0d9b2515819",9239:"3d60da85bcca2a3177e9",9321:"c4e2b75b9135920babc3",9340:"0a3bf1b74cce1b6b7ed8",9384:"ec9d5af8887854e821c8",9423:"7b4880b2dc6b01d70ccc",9465:"23a697d48f6e45cc033e",9547:"7bf7aace72f81f5de4e4",9564:"a0b3d70a1b0360084593",9588:"a69e885336eb5d2729fd",9695:"a8ca37a9d5c9357aa1f8",9728:"9291508232b23f030178",9748:"c08cb75c3eef6c45f604",9838:"8f31fbb1d549230ee3db",9853:"4c56698cf1c669371865",9855:"2d908c115ea18e813b95",9868:"7de9c01849c4aa1940e7",9899:"fe817283bbcbca8fb296",9930:"9f312f7284e506a84ed7",9933:"e2be5e8e196784f00edc",9949:"401588b9d18866ed83e2"}[e]+".js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var s=n.length-1;s>-1&&(!e||!/^http(s?):/.test(e));)e=n[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={76:1};r.f.i=(t,n)=>{e[t]||importScripts(r.p+r.u(t))};var t=self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[],n=t.push.bind(t);t.push=t=>{var[s,o,i]=t;for(var a in o)r.o(o,a)&&(r.m[a]=o[a]);for(i&&i(r);s.length;)e[s.pop()]=1;n(t)}})(),r(2131);var n=r(61322);RemoteClient=n})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.32.0-next.20241227",
3
+ "version": "4.32.0-next.20241228",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- const a="20241227",c="273132fb8aa762e1fa9260b678733e80c1c29619";export{a as buildDate,c as commitHash};
5
+ const c="20241228",d="6f2aeabc77930f3507de4bdc256bc0a0494d2c3d";export{c as buildDate,d as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{defaultFontFamily as t}from"../../core/fontUtils.js";import has from"../../core/has.js";import{clone as e}from"../../core/lang.js";import r from"../../core/Logger.js";import{deg2rad as i}from"../../core/mathUtils.js";import s from"../../core/ObjectPool.js";import{px2pt as o,pt2px as n}from"../../core/screenUtils.js";import{GeometryCursor as a}from"../../geometry/GeometryCursor.js";import{fromValues as l,create as h,expandPointInPlace as c,center as m,width as f,height as u,diagonal as d}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as g}from"../../geometry/support/boundsUtils.js";import{polygonCentroid as p}from"../../geometry/support/centroid.js";import{isPoint as _,isPolygon as y,isPolyline as P,isExtent as S,isMultipoint as w}from"../../geometry/support/jsonUtils.js";import{SimpleEffectCursor as x}from"./CIMEffects.js";import M from"./CIMImageColorSubstitutionHelper.js";import{getEffectOperator as b,getPlacementOperator as k}from"./CIMOperators.js";import{Placement as C}from"./CIMPlacements.js";import{defaultCIMValues as v}from"./defaultCIMValues.js";import{LineCapStyle as I,LineJoinStyle as T}from"./enums.js";import{getFirstFrame as R}from"./imageUtils.js";import{rotate as z}from"./mathUtils.js";import{addColorStops as L}from"./rasterizingUtils.js";import F from"./Rect.js";import U from"./TextRasterizer.js";import{getNumericValue as A,isCIMFill as j,getSize as G,isSVGImage as D,getRelativeGradientSize as H,fromCIMFontDecoration as B,fromCIMFontStyle as E,fromCIMHorizontalAlignment as X,fromCIMVerticalAlignment as J,getFillColor as N,getStrokeColor as O,getStrokeWidth as q,getFontStyle as V,getFontWeight as W}from"./utils.js";import{destroyHiddenSvg as Y,createHiddenSvg as $,createSvgElement as K}from"../../views/2d/engine/svgUtils.js";import{glyphSize as Q,magicLabelLineHeight as Z,hittestToleranceSmallSymbol as tt,hittestSmallSymbolThreshold as et}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as rt}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as it,getLineWidth as st}from"../../views/2d/layers/graphics/graphicsUtils.js";const ot=Math.PI/180,nt=.5,at=()=>r.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");class lt{constructor(t){this._t=t}static createIdentity(){return new lt([1,0,0,0,1,0])}clone(){const t=this._t;return new lt(t.slice())}transform(t){const e=this._t;return[e[0]*t[0]+e[1]*t[1]+e[2],e[3]*t[0]+e[4]*t[1]+e[5]]}static createScale(t,e){return new lt([t,0,0,0,e,0])}scale(t,e){const r=this._t;return r[0]*=t,r[1]*=t,r[2]*=t,r[3]*=e,r[4]*=e,r[5]*=e,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,e){return new lt([0,0,t,0,0,e])}translate(t,e){const r=this._t;return r[2]+=t,r[5]+=e,this}static createRotate(t){const e=Math.cos(t),r=Math.sin(t);return new lt([e,-r,0,r,e,0])}rotate(t){return lt.multiply(this,lt.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],r=Math.sqrt(t*t+e*e);return[t/r,e/r]}static multiply(t,e,r){const i=t._t,s=e._t,o=i[0]*s[0]+i[3]*s[1],n=i[1]*s[0]+i[4]*s[1],a=i[2]*s[0]+i[5]*s[1]+s[2],l=i[0]*s[3]+i[3]*s[4],h=i[1]*s[3]+i[4]*s[4],c=i[2]*s[3]+i[5]*s[4]+s[5],m=r._t;return m[0]=o,m[1]=n,m[2]=a,m[3]=l,m[4]=h,m[5]=c,r}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(0===e)return new lt([0,0,0,0,0,0]);e=1/e;const r=(t[1]*t[5]-t[2]*t[4])*e,i=(t[2]*t[3]-t[0]*t[5])*e,s=t[4]*e,o=-t[1]*e,n=-t[3]*e,a=t[0]*e;return new lt([s,o,r,n,a,i])}}class ht{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new s(C,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||lt.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||lt.createIdentity()],this._sizeTransfos=[e||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const r=e?t.scaleRatio():1;lt.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*r)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,r){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,r)}}drawMultiLayerSymbol(t,e){if(!t||!e)return;const r=t.symbolLayers;if(!r)return;const i=t.effects;if(i&&i.length>0){const t=this.executeEffects(i,e);if(t){let e=t.next();for(;e;)this.drawSymbolLayers(r,e.asJSON()),e=t.next()}}else this.drawSymbolLayers(r,e)}executeEffects(t,e){const r=this._resourceManager.geometryEngine;let i=new x(a.fromJSONCIM(e));for(const s of t){const t=b(s);t&&(i=t.execute(i,s,this.geomUnitsPerPoint(),null,r))}return i}drawSymbolLayers(t,e){let r=t.length;for(;r--;){const i=t[r];if(!i||!1===i.enable)continue;const s=i.effects;if(s&&s.length>0){const t=this.executeEffects(s,e);if(t){let e=null;for(;(e=t.next())&&(this.drawSymbolLayer(i,e.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(i,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color,t.path);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit,t.path);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const r=ut(e,t,this.geomUnitsPerPoint());r&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,r),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const r=t.markerPlacement;if(r){const i=k(r);if(i){const s="CIMMarkerPlacementInsidePolygon"===r.type||"CIMMarkerPlacementPolygonCenter"===r.type&&r.clipAtBoundary;s&&this.pushClipPath(e);const o=i.execute(a.fromJSONCIM(e),r,this.geomUnitsPerPoint(),null,this._resourceManager.geometryEngine);if(o){let e=null;for(;(e=o.next())&&(this.drawMarker(t,e),!this._earlyReturn););}s&&this.popClipPath()}}else{const r=this._placementPool.acquire();if(_(e))r.tx=e.x,r.ty=e.y,this.drawMarker(t,r);else if(y(e)){const i=p(e);i&&([r.tx,r.ty]=i,this.drawMarker(t,r))}else for(const i of e.points)if(r.tx=i[0],r.ty=i[1],this.drawMarker(t,r),this._earlyReturn)break;this._placementPool.release(r)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){if(!t)return;const r=this._resourceManager.getResource(t.url),i=A(t.size,v.CIMPictureMarker.size);if(null==r||i<=0)return;const s=r.width,o=r.height;if(!s||!o)return;const n=s/o,a=A(t.scaleX,1),l=lt.createIdentity(),h=t.anchorPoint;if(h){let e=h.x,r=h.y;"Absolute"!==t.anchorPointUnits&&(e*=i*n*a,r*=i),l.translate(-e,-r)}let c=A(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&l.rotate(c*ot);let m=A(t.offsetX),f=A(t.offsetY);if(m||f){if(this._mapRotation){const t=ot*this._mapRotation,e=Math.cos(t),r=Math.sin(t),i=m*r+f*e;m=m*e-f*r,f=i}l.translate(m,f)}const u=this.geomUnitsPerPoint();1!==u&&l.scale(u,u);const d=e.getAngle();d&&l.rotate(d),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,i),this.pop()}drawVectorMarker(t,e){if(!t)return;const r=t.markerGraphics;if(!r)return;const i=A(t.size,v.CIMVectorMarker.size),s=t.frame,o=s?s.ymax-s.ymin:0,n=i&&o?i/o:1,a=lt.createIdentity();s&&a.translate(.5*-(s.xmax+s.xmin),.5*-(s.ymax+s.ymin));const l=t.anchorPoint;if(l){let e=l.x,r=l.y;"Absolute"!==t.anchorPointUnits?s&&(e*=s.xmax-s.xmin,r*=s.ymax-s.ymin):(e/=n,r/=n),a.translate(-e,-r)}1!==n&&a.scale(n,n);let h=A(t.rotation);t.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&a.rotate(h*ot);let c=A(t.offsetX),m=A(t.offsetY);if(c||m){if(this._mapRotation){const t=ot*this._mapRotation,e=Math.cos(t),r=Math.sin(t),i=c*r+m*e;c=c*e-m*r,m=i}a.translate(c,m)}const f=this.geomUnitsPerPoint();1!==f&&a.scale(f,f);const u=e.getAngle();u&&a.rotate(u),a.translate(e.tx,e.ty),this.push(a,t.scaleSymbolsProportionally);for(const d of r){d?.symbol&&d.geometry||at().error("Invalid marker graphic",d);let t=d.textString;if("number"==typeof t&&(t=t.toString()),this.drawSymbol(d.symbol,d.geometry,t),this._earlyReturn)break}this.pop()}drawTextSymbol(t,e,r){if(!t)return;if(!_(e))return;if(A(t.height,v.CIMTextSymbol.height)<=0)return;const i=lt.createIdentity();let s=A(t.angle);s=-s,s&&i.rotate(s*ot);const o=A(t.offsetX),n=A(t.offsetY);(o||n)&&i.translate(o,n);const a=this.geomUnitsPerPoint();1!==a&&i.scale(a,a),i.translate(e.x,e.y),this.push(i,!1),this.drawText(t,r),this.pop()}}class ct extends ht{constructor(t,e){super(t,e),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new F(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return l(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(t){if(t&&!(this._clipCount>0))if(y(t))this._processPath(t.rings,0);else if(P(t))this._processPath(t.paths,0);else if(S(t)){const e=_t(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,r){if(!t||this._clipCount>0||null==r||r<=0)return;const i=Math.max(.5*this.transformSize(A(r,v.CIMSolidStroke.width)),.5*nt);if(y(t))this._processPath(t.rings,i);else if(P(t))this._processPath(t.paths,i);else if(S(t)){const e=_t(t);e&&this._processPath(e.rings,i)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){y(e)&&t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){const{url:r}=t,i=A(t.scaleX,1);let s=i*e,o=e;const n=this._resourceManager.getResource(r);if(null!=n){const t=n.height/n.width;s=i*(e?t>1?e:e/t:n.width),o=e?t>1?e*t:e:n.height}this._merge(this.transformPt([-s/2,-o/2]),0),this._merge(this.transformPt([-s/2,o/2]),0),this._merge(this.transformPt([s/2,-o/2]),0),this._merge(this.transformPt([s/2,o/2]),0)}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new U);const r=Pt(t);let[i,s]=this._textRasterizer.computeTextSize(e,r);i=o(i),s=o(s);const n=this.transformSize(1)*this.reverseTransformScalar(1);i*=n,s*=n;let a=0;switch(t.horizontalAlignment){case"Left":a=i/2;break;case"Right":a=-i/2}let l=0;switch(t.verticalAlignment){case"Bottom":l=s/2;break;case"Top":l=-s/2;break;case"Baseline":l=s/6}this._merge(this.transformPt([-i/2+a,-s/2+l]),0),this._merge(this.transformPt([-i/2+a,s/2+l]),0),this._merge(this.transformPt([i/2+a,-s/2+l]),0),this._merge(this.transformPt([i/2+a,s/2+l]),0)}_processPath(t,e){if(t)for(const r of t){const t=r?r.length:0;if(t>1){this._merge(this.transformPt(r[0]),e);for(let i=1;i<t;i++)this._merge(this.transformPt(r[i]),e)}}}_merge(t,e){t[0]-e<this._xmin&&(this._xmin=t[0]-e),t[0]+e>this._xmax&&(this._xmax=t[0]+e),t[1]-e<this._ymin&&(this._ymin=t[1]-e),t[1]+e>this._ymax&&(this._ymax=t[1]+e)}}class mt extends ht{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0,this._textInfo=null,this._svg=null,this._path=null,this._canvas=null}destroy(){this._svg=Y(this._svg),this._path=null,this._canvas=null}hitTest(t,e,r,i,s,a){const l=a*n(1);this.setTransform(),this.setGeomUnitsPerPoint(l),this._searchPoint=[(t[0]+t[2])/2,(t[1]+t[3])/2],this._searchDistPoint=(t[2]-t[0])/2/l,this._textInfo=i;const h=e&&("CIMPointSymbol"===e.type&&"Map"!==e.angleAlignment||"CIMTextSymbol"===e.type);if(this._mapRotation=h?s:0,!has("esri-mobile")){const t=o(tt*window.devicePixelRatio),r=o(et);!(("CIMLineSymbol"===e?.type||"CIMPolygonSymbol"===e?.type)&&e.symbolLayers?.some(j))&&"CIMMeshSymbol"!==e?.type&&(G(e)??0)<r&&(this._searchDistPoint=t)}return this._earlyReturn=!1,this.drawSymbol(e,r),this._earlyReturn}executeEffects(t,e){return"CIMGeometricEffectDashes"===t.at(-1)?.type&&(t=t.slice(0,-1)),super.executeEffects(t,e)}drawSolidFill(t,e,r){null!=r?this._hittestSvgPath(t,r,!0):this._hitTestFill(t)}drawHatchFill(t,e){this._hitTestFill(t)}drawPictureFill(t,e){this._hitTestFill(t)}drawGradientFill(t,e){this._hitTestFill(t)}drawSolidStroke(t,e,r,i,s,o,n){null!=n?this._hittestSvgPath(t,n,!1,r):this._hitTestStroke(t,r)}drawPictureStroke(t,e){this._hitTestStroke(t,e.width)}drawGradientStroke(t,e){this._hitTestStroke(t,e.width)}drawMarkerLayer(t,e){t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._hitTestFill(e):super.drawMarkerLayer(t,e)}pushClipPath(t){}popClipPath(){}drawImage(t,e){const{url:r}=t,i=A(t.scaleX,1),s=this._resourceManager.getResource(r);if(null==s||0===s.height||0===e)return;const o=e*this.geomUnitsPerPoint(),n=o*i*(s.width/s.height),a=this.reverseTransformPt(this._searchPoint),l=this._searchDistPoint;Math.abs(a[0])<n/2+l&&Math.abs(a[1])<o/2+l&&(this._earlyReturn=!0)}drawText(t,e){const r=this._textInfo;if(!r)return;const i=r.get(t);if(!i)return;if(!i.glyphMosaicItems.glyphs.length)return;const s=it(A(t.height,v.CIMTextSymbol.height)),{lineGapType:o,lineGap:n}=t,a=o?yt(o,A(n),s):0,l="CIMBackgroundCallout"===t.callout?.type,h=rt(i.glyphMosaicItems,{scale:s/Q,angle:0,xOffset:0,yOffset:0,horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:st(t.lineWidth),lineHeight:Z*Math.max(.25,Math.min(a||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:l}),c=this.reverseTransformPt(this._searchPoint),m=c[0],f=c[1];for(const u of h.glyphs)if(m>u.xTopLeft&&m<u.xBottomRight&&f>-u.yBottomRight&&f<-u.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(t){let e=null;if(S(t)){const r=t;e=[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]}else if(y(t))e=t.rings;else{if(!P(t))return;e=t.paths}const r=this.reverseTransformPt(this._searchPoint);if(dt(r,e)&&(this._earlyReturn=!0),!this._earlyReturn){gt(r,e,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}_getSvgPath(){return null!=this._svg&&null!=this._path||(this._svg??=$(),this._path??=K("path"),this._svg.appendChild(this._path)),this._path}_getCanvas(){return this._canvas??=document.createElement("canvas"),this._canvas}_hittestSvgPath(t,e,r,i){const s=h();g(s,t);const o={x:s[0],y:s[1],width:s[2]-s[0],height:s[3]-s[1]},n=this._getSvgPath();n.setAttribute("d",e);const a=n.getBBox(),l=a.width/o.width,c=a.height/o.height,m=this._getCanvas();m.width=a.width,m.height=a.height;const f=m.getContext("2d",{willReadFrequently:!0});f.setTransform(1,0,0,1,a.x,-a.y);const u=new Path2D(e);r?f.fill(u):(f.lineWidth=i*l,f.stroke(u));const d=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),p=this.reverseTransformPt(this._searchPoint),_=(p[0]-o.x-d)*l,y=(o.height-(p[1]-o.y)-d)*c,P=2*d*l,S=2*d*c,w=f.getImageData(_,y,P,S).data;for(let h=3;h<w.length;h+=4)if(w[h]>127.5)return void(this._earlyReturn=!0)}_hitTestStroke(t,e){let r=null;if(S(t)){const e=t;r=[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}else if(y(t))r=t.rings;else{if(!P(t))return;r=t.paths}gt(this.reverseTransformPt(this._searchPoint),r,A(e,v.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}class ft extends ht{constructor(t,e,r,i){super(e,r),this._applyAdditionalRenderProps=i,this._colorSubstitutionHelper=new M,this._ctx=t}drawSolidFill(t,e){if(!t)return;if(y(t))this._buildPath(t.rings,!0);else if(P(t))this._buildPath(t.paths,!0);else if(S(t))this._buildPath(_t(t).rings,!0);else{if(!w(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const r=this._ctx;r.fillStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",r.fill("evenodd")}drawSolidStroke(t,e,r,i,s,o){if(!t||!e||0===r)return;if(y(t))this._buildPath(t.rings,!0);else if(P(t))this._buildPath(t.paths,!1);else{if(!S(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(_t(t).rings,!0)}const n=this._ctx;n.strokeStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",n.lineWidth=Math.max(this.transformSize(r),nt),this._setCapStyle(i),this._setJoinStyle(s),n.miterLimit=o,n.stroke()}pushClipPath(t){if(this._ctx.save(),y(t))this._buildPath(t.rings,!0);else if(P(t))this._buildPath(t.paths,!0);else{if(!S(t))return;this._buildPath(_t(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,e){const{colorSubstitutions:r,url:i,tintColor:s}=t,o=A(t.scaleX,1),n=this._resourceManager.getResource(i);if(null==n)return;let a=e*(n.width/n.height),l=e;e||(a=n.width,l=n.height);const h=D(i)||"src"in n&&D(n.src);let c="getFrame"in n?R(n):n;r&&(c=this._colorSubstitutionHelper.applyColorSubstitution(c,r)),this._applyAdditionalRenderProps&&!h&&s&&(c=this._colorSubstitutionHelper.tintImageData(c,s));const m=this.transformPt([0,0]),[f,u]=this.getTransformAngle(),d=this.transformSize(1),g=this._ctx;g.save(),g.setTransform({m11:o*d*f,m12:o*d*u,m21:-d*u,m22:d*f,m41:m[0],m42:m[1]}),g.drawImage(c,-a/2,-l/2,a,l),g.restore()}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new U);const r=Pt(t,this.transformSize(o(1))),i=this._textRasterizer.rasterizeText(e,r);if(!i)return;const{size:s,anchorX:n,anchorY:a,canvas:l}=i,h=s[0]*(n+.5),c=s[1]*(a-.5),m=this._ctx,f=this.transformPt([0,0]),[u,d]=this.getTransformAngle(),g=1;m.save(),m.setTransform({m11:g*u,m12:g*d,m21:-g*d,m22:g*u,m41:f[0]-g*h,m42:f[1]+g*c}),m.drawImage(l,0,0),m.restore()}drawPictureFill(t,e){if(!t)return;let{colorSubstitutions:r,height:i,offsetX:s,offsetY:o,rotation:n,scaleX:a,tintColor:l,url:h}=e;const c=this._resourceManager.getResource(h);if(null==c)return;if(y(t))this._buildPath(t.rings,!0);else if(P(t))this._buildPath(t.paths,!0);else if(S(t))this._buildPath(_t(t).rings,!0);else{if(!w(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const m=this._ctx,f=D(h)||"src"in c&&D(c.src);let u,d="getFrame"in c?R(c):c;if(r&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,r)),this._applyAdditionalRenderProps){f||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)),u=m.createPattern(d,"repeat");const t=this.transformSize(1);n||(n=0),s?s*=t:s=0,o?o*=t:o=0,i&&(i*=t);const e=i?i/c.height:1,r=a&&i?a*i/c.width:1;if(0!==n||1!==e||1!==r||0!==s||0!==o){const t=new DOMMatrix;t.rotateSelf(0,0,-n).translateSelf(s,o).scaleSelf(r,e,1),u.setTransform(t)}}else u=m.createPattern(d,"repeat");m.save(),m.fillStyle=u,m.fill("evenodd"),m.restore()}drawPictureStroke(t,r){if(!t)return;let{colorSubstitutions:i,capStyle:s,joinStyle:o,miterLimit:a,tintColor:l,url:h,width:c}=r;const m=this._resourceManager.getResource(h);if(null==m)return;let f;if(y(t))f=t.rings;else if(P(t))f=t.paths;else{if(!S(t))return w(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;f=_t(t).rings}c||(c=m.width);const u=D(h)||"src"in m&&D(m.src);let d="getFrame"in m?R(m):m;i&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,i)),this._applyAdditionalRenderProps&&(u||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)));const g=Math.max(this.transformSize(n(c)),.5),p=g/d.width,_=this._ctx,x=_.createPattern(d,"repeat-y");let M,b;_.save(),this._setCapStyle(s),this._setJoinStyle(o),void 0!==a&&(_.miterLimit=a),_.lineWidth=g;for(let n of f)if(n=e(n),wt(n),n&&!(n.length<=1)){M=this.transformPt(n[0]);for(let t=1;t<n.length;t++){b=this.transformPt(n[t]);const e=pt(M,b),r=new DOMMatrix;r.translateSelf(0,M[1]-g/2).scaleSelf(p,p,1).rotateSelf(0,0,90-e),x.setTransform(r),_.strokeStyle=x,_.beginPath(),_.moveTo(M[0],M[1]),_.lineTo(b[0],b[1]),_.stroke(),M=b}}_.restore()}drawGradientFill(t,e){if(!t)return;let r;if(y(t))r=t.rings;else if(P(t))r=t.paths;else{if(!S(t))return void at().error("Unable to draw gradient fill");r=_t(t).rings}this._buildPath(r,!0);const{angle:s,gradientMethod:o,gradientSize:a,gradientSizeUnits:l}=e,g=v.CIMGradientFill,p=e.gradientType??g.gradientType,_=-i(s??0),w=h();for(const i of r){const t=i?i.length:0;if(t>1)for(let e=0;e<t;e++){let t=this.transformPt(i[e]);"Linear"!==o&&"Rectangular"!==o||(t=z(t,-_)),c(w,t)}}const[x,M,b,k]=w,C=this._ctx;switch(C.save(),o){case"Buffered":at().error(`Gradient method "${o}" currently unsupported.`);break;case"Linear":{const t=(M+k)/2,r="Absolute"===l?this.transformSize(n(a)):H(a,g.gradientSize)*(b-x),[i,s]="Discrete"===p?[b,b-r]:[x+r,x],o=z([i,t],_),h=z([s,t],_),c=C.createLinearGradient(o[0],o[1],h[0],h[1]);L(c,e),C.fillStyle=c,C.fill("evenodd");break}case"Circular":{const t=m(w),r=d(w)/2,i="Absolute"===l?this.transformSize(n(a)):H(a,g.gradientSize)*r,[s,o]="Discrete"===p?[r,r-i]:[i,0],h=C.createRadialGradient(t[0],t[1],s,t[0],t[1],o);L(h,e),C.fillStyle=h,C.fill("evenodd");break}case"Rectangular":{const r=m(w),i=r[0],s=r[1],o=z(r,_),h=(r,i,s,n,a,l,h,c)=>{C.save(),this.pushClipPath(t);const m=z([a,l],_),f=z([h,c],_);C.beginPath(),C.moveTo(o[0],o[1]),C.lineTo(m[0],m[1]),C.lineTo(f[0],f[1]),C.lineTo(o[0],o[1]),C.clip();const u=z([r,i],_),d=z([s,n],_),g=C.createLinearGradient(u[0],u[1],d[0],d[1]);L(g,e),C.fillStyle=g,C.fill("evenodd"),C.restore()};let c="Absolute"===l?this.transformSize(n(a)):H(a,g.gradientSize)*(f(w)/2),[d,y]="Discrete"===p?[b,b-c]:[i+c,i];h(d,s,y,s,b,M,b,k),[d,y]="Discrete"===p?[x,x+c]:[i-c,i],h(d,s,y,s,x,k,x,M),c="Absolute"===l?this.transformSize(n(a)):H(a,g.gradientSize)*(u(w)/2);let[P,S]="Discrete"===p?[k,k-c]:[s+c,s];h(i,P,i,S,b,k,x,k),[P,S]="Discrete"===p?[M,M+c]:[s-c,s],h(i,P,i,S,x,M,b,M);break}}C.restore()}drawGradientStroke(t,r){const{capStyle:i,gradientMethod:s,gradientSize:o,gradientSizeUnits:a,joinStyle:l,miterLimit:h,width:c}=r;if(!t||0===c)return;let m;if(y(t))m=t.rings;else if(P(t))m=t.paths;else{if(!S(t))return void at().error("Unable to draw gradient stroke");m=_t(t).rings}const f=r.gradientType??v.CIMGradientStroke.gradientType,u=Math.max(this.transformSize(n(c)),.5),d=this._ctx;let g,p;d.save(),this._setCapStyle(i),this._setJoinStyle(l),void 0!==h&&(d.miterLimit=h),d.lineWidth=u;for(let _ of m){if(_=e(_),wt(_),!_||_.length<=1)continue;let t=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const r=p[0]-g[0],i=p[1]-g[1];t+=Math.sqrt(r*r+i*i),g=p}const i="Absolute"===a?this.transformSize(n(o)):H(o,v.CIMGradientStroke.gradientSize)*("AcrossLine"===s?u:t);let l=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const o=p[0]-g[0],n=p[1]-g[1],a=Math.sqrt(o*o+n*n);let h,c,m,y;switch(s){case"AcrossLine":{const[t,e]=z([o/a,n/a],Math.PI/2),r=u/2,s="Discrete"===f?r:i-r;h=(g[0]+p[0])/2+t*s,c=(g[1]+p[1])/2+e*s,m=h-t*i,y=c-e*i;break}case"AlongLine":{const e=o/a,r=n/a;"Discrete"===f?(h=g[0]-e*l,c=g[1]-r*l,m=h+e*i,y=c+r*i):(m=g[0]+e*(t-l),y=g[1]+r*(t-l),h=m-e*i,c=y-r*i);break}default:return at().error("Unrecognized gradient method:",s),void d.restore()}const P=d.createLinearGradient(h,c,m,y);L(P,r),d.strokeStyle=P,d.beginPath(),d.moveTo(g[0],g[1]),d.lineTo(p[0],p[1]),d.stroke(),l+=a,g=p}}d.restore()}_buildPath(t,e){const r=this._ctx;if(r.beginPath(),t)for(const i of t){const t=i?i.length:0;if(t>1){let s=this.transformPt(i[0]);r.moveTo(s[0],s[1]);for(let e=1;e<t;e++)s=this.transformPt(i[e]),r.lineTo(s[0],s[1]);e&&r.closePath()}}}_setCapStyle(t){switch(t){case I.Butt:this._ctx.lineCap="butt";break;case I.Round:this._ctx.lineCap="round";break;case I.Square:this._ctx.lineCap="square"}}_setJoinStyle(t){switch(t){case T.Bevel:this._ctx.lineJoin="bevel";break;case T.Round:this._ctx.lineJoin="round";break;case T.Miter:this._ctx.lineJoin="miter"}}}function ut(t,e,r){let i=A(t.separation,v.CIMHatchFill.separation)*r,s=A(t.rotation);if(0===i)return null;i<0&&(i=-i);let o=0;const n=.5*i;for(;o>n;)o-=i;for(;o<-n;)o+=i;const a=h();g(a,e),a[0]-=n,a[1]-=n,a[2]+=n,a[3]+=n;const l=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;s>180;)s-=180;for(;s<0;)s+=180;const c=Math.cos(s*ot),m=Math.sin(s*ot),f=-i*m,u=i*c;let d,p,_,y;o=A(t.offsetX)*r*m-A(t.offsetY)*r*c,d=_=Number.MAX_VALUE,p=y=-Number.MAX_VALUE;for(const h of l){const t=h[0],e=h[1],r=c*t+m*e,i=-m*t+c*e;d=Math.min(d,r),_=Math.min(_,i),p=Math.max(p,r),y=Math.max(y,i)}_=Math.floor(_/i)*i;let P=c*d-m*_-f*o/i,S=m*d+c*_-u*o/i,w=c*p-m*_-f*o/i,x=m*p+c*_-u*o/i;const M=1+Math.round((y-_)/i),b=[];for(let h=0;h<M;h++)P+=f,S+=u,w+=f,x+=u,b.push([[P,S],[w,x]]);return{paths:b}}function dt(t,e){let r=0;for(const i of e){const e=i.length;for(let s=1;s<e;s++){const e=i[s-1],o=i[s];if(e[1]>t[1]==o[1]>t[1])continue;(o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0])>0?r++:r--}}return 0!==r}function gt(t,e,r){for(const i of e){const e=i.length;for(let s=1;s<e;s++){const e=i[s-1],o=i[s];let n=(o[0]-e[0])*(o[0]-e[0])+(o[1]-e[1])*(o[1]-e[1]);if(0===n)continue;n=Math.sqrt(n);const a=((o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0]))/n;if(Math.abs(a)<r){const i=((o[0]-e[0])*(t[0]-e[0])+(o[1]-e[1])*(t[1]-e[1]))/n;if(i>-r&&i<n+r)return!0}}}return!1}function pt(t,e){const r=e[0]-t[0],i=e[1]-t[1];return 180/Math.PI*Math.atan2(i,r)}const _t=t=>t?{spatialReference:t.spatialReference,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:null,yt=(t,e,r)=>{switch(t){case"ExtraLeading":return 1+e/r;case"Multiple":return e;case"Exact":return e/r}};function Pt(e,r=1){const i=B(e),s=E(e.fontStyleName),o=e.fontFamilyName??t,{weight:n,style:a}=s,l=r*(e.height||5),h=X(e.horizontalAlignment),c=J(e.verticalAlignment),m=N(e),f=N(e.haloSymbol),u=null!=f?r*(e.haloSize??0):0,d=O(e.symbol),g=r*(q(e.symbol)||0),p="CIMBackgroundCallout"===e.callout?.type?e.callout.backgroundSymbol:null,_=N(p),y=q(p),P=O(p);return{color:m,size:l,horizontalAlignment:h,verticalAlignment:c,font:{family:o,style:V(a),weight:W(n),decoration:i},outline:{size:g||0,color:d},halo:{size:u||0,color:f,style:a},backgroundColor:_,borderLine:null!=y&&null!=P?{size:y,color:P}:null,pixelRatio:1,premultiplyColors:!0}}const St=1e-4;function wt(t){let e,r,i,s,o,n=t[0],a=1;for(;a<t.length;)e=t[a][0]-n[0],r=t[a][1]-n[1],s=0!==e?r/e:Math.PI/2,void 0!==i&&Math.abs(s-i)<=St?(t.splice(a-1,1),n=o):(o=n,n=t[a],a++),i=s}export{ht as CIMSymbolDrawHelper,ft as CanvasDrawHelper,ct as EnvDrawHelper,mt as HittestDrawHelper,lt as Transformation,ot as cDegToRad,yt as lineGapType2LineHeight};
5
+ import{defaultFontFamily as t}from"../../core/fontUtils.js";import has from"../../core/has.js";import{clone as e}from"../../core/lang.js";import r from"../../core/Logger.js";import{deg2rad as i}from"../../core/mathUtils.js";import s from"../../core/ObjectPool.js";import{px2pt as o,pt2px as n}from"../../core/screenUtils.js";import{GeometryCursor as a}from"../../geometry/GeometryCursor.js";import{fromValues as l,create as h,expandPointInPlace as c,center as m,width as f,height as u,diagonal as d}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as g}from"../../geometry/support/boundsUtils.js";import{polygonCentroid as p}from"../../geometry/support/centroid.js";import{isPoint as _,isPolygon as y,isPolyline as P,isExtent as S,isMultipoint as w}from"../../geometry/support/jsonUtils.js";import{SimpleEffectCursor as x}from"./CIMEffects.js";import M from"./CIMImageColorSubstitutionHelper.js";import{getEffectOperator as b,getPlacementOperator as k}from"./CIMOperators.js";import{Placement as C}from"./CIMPlacements.js";import{defaultCIMValues as v}from"./defaultCIMValues.js";import{LineCapStyle as I,LineJoinStyle as T}from"./enums.js";import{getFirstFrame as R}from"./imageUtils.js";import{rotate as z}from"./mathUtils.js";import{addColorStops as L}from"./rasterizingUtils.js";import F from"./Rect.js";import U from"./TextRasterizer.js";import{getNumericValue as A,isCIMFill as j,getSize as G,isSVGImage as D,getRelativeGradientSize as H,fromCIMFontDecoration as B,fromCIMFontStyle as E,fromCIMHorizontalAlignment as X,fromCIMVerticalAlignment as J,getFillColor as N,getStrokeColor as O,getStrokeWidth as q,getFontStyle as V,getFontWeight as W}from"./utils.js";import{destroyHiddenSvg as Y,createHiddenSvg as $,createSvgElement as K}from"../../views/2d/engine/svgUtils.js";import{glyphSize as Q,magicLabelLineHeight as Z,hittestToleranceSmallSymbol as tt,hittestSmallSymbolThreshold as et}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as rt}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as it,getLineWidth as st}from"../../views/2d/layers/graphics/graphicsUtils.js";const ot=Math.PI/180,nt=.5,at=()=>r.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");class lt{constructor(t){this._t=t}static createIdentity(){return new lt([1,0,0,0,1,0])}clone(){const t=this._t;return new lt(t.slice())}transform(t){const e=this._t;return[e[0]*t[0]+e[1]*t[1]+e[2],e[3]*t[0]+e[4]*t[1]+e[5]]}static createScale(t,e){return new lt([t,0,0,0,e,0])}scale(t,e){const r=this._t;return r[0]*=t,r[1]*=t,r[2]*=t,r[3]*=e,r[4]*=e,r[5]*=e,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,e){return new lt([0,0,t,0,0,e])}translate(t,e){const r=this._t;return r[2]+=t,r[5]+=e,this}static createRotate(t){const e=Math.cos(t),r=Math.sin(t);return new lt([e,-r,0,r,e,0])}rotate(t){return lt.multiply(this,lt.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],r=Math.sqrt(t*t+e*e);return[t/r,e/r]}static multiply(t,e,r){const i=t._t,s=e._t,o=i[0]*s[0]+i[3]*s[1],n=i[1]*s[0]+i[4]*s[1],a=i[2]*s[0]+i[5]*s[1]+s[2],l=i[0]*s[3]+i[3]*s[4],h=i[1]*s[3]+i[4]*s[4],c=i[2]*s[3]+i[5]*s[4]+s[5],m=r._t;return m[0]=o,m[1]=n,m[2]=a,m[3]=l,m[4]=h,m[5]=c,r}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(0===e)return new lt([0,0,0,0,0,0]);e=1/e;const r=(t[1]*t[5]-t[2]*t[4])*e,i=(t[2]*t[3]-t[0]*t[5])*e,s=t[4]*e,o=-t[1]*e,n=-t[3]*e,a=t[0]*e;return new lt([s,o,r,n,a,i])}}class ht{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new s(C,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||lt.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||lt.createIdentity()],this._sizeTransfos=[e||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const r=e?t.scaleRatio():1;lt.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*r)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,r){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,r)}}drawMultiLayerSymbol(t,e){if(!t||!e)return;const r=t.symbolLayers;if(!r)return;const i=t.effects;if(i&&i.length>0){const t=this.executeEffects(i,e);if(t){let e=t.next();for(;e;)this.drawSymbolLayers(r,e.asJSON()),e=t.next()}}else this.drawSymbolLayers(r,e)}executeEffects(t,e){const r=this._resourceManager.geometryEngine;let i=new x(a.fromJSONCIM(e));for(const s of t){const t=b(s);t&&(i=t.execute(i,s,this.geomUnitsPerPoint(),null,r))}return i}drawSymbolLayers(t,e){let r=t.length;for(;r--;){const i=t[r];if(!i||!1===i.enable)continue;const s=i.effects;if(s&&s.length>0){const t=this.executeEffects(s,e);if(t){let e=null;for(;(e=t.next())&&(this.drawSymbolLayer(i,e.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(i,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color,t.path);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit,t.path);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const r=ut(e,t,this.geomUnitsPerPoint());r&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,r),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const r=t.markerPlacement;if(r){const i=k(r);if(i){const s="CIMMarkerPlacementInsidePolygon"===r.type||"CIMMarkerPlacementPolygonCenter"===r.type&&r.clipAtBoundary;s&&this.pushClipPath(e);const o=i.execute(a.fromJSONCIM(e),r,this.geomUnitsPerPoint(),null,this._resourceManager.geometryEngine);if(o){let e=null;for(;(e=o.next())&&(this.drawMarker(t,e),!this._earlyReturn););}s&&this.popClipPath()}}else{const r=this._placementPool.acquire();if(_(e))r.tx=e.x,r.ty=e.y,this.drawMarker(t,r);else if(y(e)){const i=p(e);i&&([r.tx,r.ty]=i,this.drawMarker(t,r))}else for(const i of e.points)if(r.tx=i[0],r.ty=i[1],this.drawMarker(t,r),this._earlyReturn)break;this._placementPool.release(r)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){if(!t)return;const r=this._resourceManager.getResource(t.url),i=A(t.size,v.CIMPictureMarker.size);if(null==r||i<=0)return;const s=r.width,o=r.height;if(!s||!o)return;const n=s/o,a=A(t.scaleX,1),l=lt.createIdentity(),h=t.anchorPoint;if(h){let e=h.x,r=h.y;"Absolute"!==t.anchorPointUnits&&(e*=i*n*a,r*=i),l.translate(-e,-r)}let c=A(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&l.rotate(c*ot);let m=A(t.offsetX),f=A(t.offsetY);if(m||f){if(this._mapRotation){const t=ot*this._mapRotation,e=Math.cos(t),r=Math.sin(t),i=m*r+f*e;m=m*e-f*r,f=i}l.translate(m,f)}const u=this.geomUnitsPerPoint();1!==u&&l.scale(u,u);const d=e.getAngle();d&&l.rotate(d),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,i),this.pop()}drawVectorMarker(t,e){if(!t)return;const r=t.markerGraphics;if(!r)return;const i=A(t.size,v.CIMVectorMarker.size),s=t.frame,o=s?s.ymax-s.ymin:0,n=i&&o?i/o:1,a=lt.createIdentity();s&&a.translate(.5*-(s.xmax+s.xmin),.5*-(s.ymax+s.ymin));const l=t.anchorPoint;if(l){let e=l.x,r=l.y;"Absolute"!==t.anchorPointUnits?s&&(e*=s.xmax-s.xmin,r*=s.ymax-s.ymin):(e/=n,r/=n),a.translate(-e,-r)}1!==n&&a.scale(n,n);let h=A(t.rotation);t.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&a.rotate(h*ot);let c=A(t.offsetX),m=A(t.offsetY);if(c||m){if(this._mapRotation){const t=ot*this._mapRotation,e=Math.cos(t),r=Math.sin(t),i=c*r+m*e;c=c*e-m*r,m=i}a.translate(c,m)}const f=this.geomUnitsPerPoint();1!==f&&a.scale(f,f);const u=e.getAngle();u&&a.rotate(u),a.translate(e.tx,e.ty),this.push(a,t.scaleSymbolsProportionally);for(const d of r){d?.symbol&&d.geometry||at().error("Invalid marker graphic",d);let t=d.textString;if("number"==typeof t&&(t=t.toString()),this.drawSymbol(d.symbol,d.geometry,t),this._earlyReturn)break}this.pop()}drawTextSymbol(t,e,r){if(!t)return;if(!_(e))return;if(A(t.height,v.CIMTextSymbol.height)<=0)return;const i=lt.createIdentity();let s=A(t.angle);s=-s,s&&i.rotate(s*ot);const o=A(t.offsetX),n=A(t.offsetY);(o||n)&&i.translate(o,n);const a=this.geomUnitsPerPoint();1!==a&&i.scale(a,a),i.translate(e.x,e.y),this.push(i,!1),this.drawText(t,r),this.pop()}}class ct extends ht{constructor(t,e){super(t,e),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new F(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return l(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(t){if(t&&!(this._clipCount>0))if(y(t))this._processPath(t.rings,0);else if(P(t))this._processPath(t.paths,0);else if(S(t)){const e=_t(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,r){if(!t||this._clipCount>0||null==r||r<=0)return;const i=Math.max(.5*this.transformSize(A(r,v.CIMSolidStroke.width)),.5*nt);if(y(t))this._processPath(t.rings,i);else if(P(t))this._processPath(t.paths,i);else if(S(t)){const e=_t(t);e&&this._processPath(e.rings,i)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){y(e)&&t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){const{url:r}=t,i=A(t.scaleX,1);let s=i*e,o=e;const n=this._resourceManager.getResource(r);if(null!=n){const t=n.height/n.width;s=i*(e?t>1?e:e/t:n.width),o=e?t>1?e*t:e:n.height}this._merge(this.transformPt([-s/2,-o/2]),0),this._merge(this.transformPt([-s/2,o/2]),0),this._merge(this.transformPt([s/2,-o/2]),0),this._merge(this.transformPt([s/2,o/2]),0)}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new U);const r=Pt(t);let[i,s]=this._textRasterizer.computeTextSize(e,r);i=o(i),s=o(s);const n=this.transformSize(1)*this.reverseTransformScalar(1);i*=n,s*=n;let a=0;switch(t.horizontalAlignment){case"Left":a=i/2;break;case"Right":a=-i/2}let l=0;switch(t.verticalAlignment){case"Bottom":l=s/2;break;case"Top":l=-s/2;break;case"Baseline":l=s/6}this._merge(this.transformPt([-i/2+a,-s/2+l]),0),this._merge(this.transformPt([-i/2+a,s/2+l]),0),this._merge(this.transformPt([i/2+a,-s/2+l]),0),this._merge(this.transformPt([i/2+a,s/2+l]),0)}_processPath(t,e){if(t)for(const r of t){const t=r?r.length:0;if(t>1){this._merge(this.transformPt(r[0]),e);for(let i=1;i<t;i++)this._merge(this.transformPt(r[i]),e)}}}_merge(t,e){t[0]-e<this._xmin&&(this._xmin=t[0]-e),t[0]+e>this._xmax&&(this._xmax=t[0]+e),t[1]-e<this._ymin&&(this._ymin=t[1]-e),t[1]+e>this._ymax&&(this._ymax=t[1]+e)}}class mt extends ht{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0,this._textInfo=null,this._svg=null,this._path=null,this._canvas=null}destroy(){this._svg=Y(this._svg),this._path=null,this._canvas=null}hitTest(t,e,r,i,s,a){const l=a*n(1);this.setTransform(),this.setGeomUnitsPerPoint(l),this._searchPoint=[(t[0]+t[2])/2,(t[1]+t[3])/2],this._searchDistPoint=(t[2]-t[0])/2/l,this._textInfo=i;const h=e&&("CIMPointSymbol"===e.type&&"Map"!==e.angleAlignment||"CIMTextSymbol"===e.type);if(this._mapRotation=h?s:0,!has("esri-mobile")){const t=o(tt*window.devicePixelRatio),r=o(et);!(("CIMLineSymbol"===e?.type||"CIMPolygonSymbol"===e?.type)&&e.symbolLayers?.some(j))&&"CIMMeshSymbol"!==e?.type&&(G(e)??0)<r&&(this._searchDistPoint=t)}return this._earlyReturn=!1,this.drawSymbol(e,r),this._earlyReturn}executeEffects(t,e){return"CIMGeometricEffectDashes"===t.at(-1)?.type&&(t=t.slice(0,-1)),super.executeEffects(t,e)}drawSolidFill(t,e,r){null!=r?this._hittestSvgPath(t,r,!0):this._hitTestFill(t)}drawHatchFill(t,e){this._hitTestFill(t)}drawPictureFill(t,e){this._hitTestFill(t)}drawGradientFill(t,e){this._hitTestFill(t)}drawSolidStroke(t,e,r,i,s,o,n){null!=n?this._hittestSvgPath(t,n,!1,r):this._hitTestStroke(t,r)}drawPictureStroke(t,e){this._hitTestStroke(t,e.width)}drawGradientStroke(t,e){this._hitTestStroke(t,e.width)}drawMarkerLayer(t,e){t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._hitTestFill(e):super.drawMarkerLayer(t,e)}pushClipPath(t){}popClipPath(){}drawImage(t,e){const{url:r}=t,i=A(t.scaleX,1),s=this._resourceManager.getResource(r);if(null==s||0===s.height||0===e)return;const o=e*this.geomUnitsPerPoint(),n=o*i*(s.width/s.height),a=this.reverseTransformPt(this._searchPoint),l=this._searchDistPoint;Math.abs(a[0])<n/2+l&&Math.abs(a[1])<o/2+l&&(this._earlyReturn=!0)}drawText(t,e){const r=this._textInfo;if(!r)return;const i=r.get(t);if(!i)return;if(!i.glyphMosaicItems.glyphs.length)return;const s=it(A(t.height,v.CIMTextSymbol.height)),{lineGapType:o,lineGap:n}=t,a=o?yt(o,A(n),s):0,l="CIMBackgroundCallout"===t.callout?.type,h=rt(i.glyphMosaicItems,{scale:s/Q,angle:0,xOffset:0,yOffset:0,horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:st(t.lineWidth),lineHeight:Z*Math.max(.25,Math.min(a||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:l}),c=this.reverseTransformPt(this._searchPoint),m=c[0],f=c[1];for(const u of h.glyphs)if(m>u.xTopLeft&&m<u.xBottomRight&&f>-u.yBottomRight&&f<-u.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(t){let e=null;if(S(t)){const r=t;e=[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]}else if(y(t))e=t.rings;else{if(!P(t))return;e=t.paths}const r=this.reverseTransformPt(this._searchPoint);if(dt(r,e)&&(this._earlyReturn=!0),!this._earlyReturn){gt(r,e,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}_getSvgPath(){return null!=this._svg&&null!=this._path||(this._svg??=$(),this._path??=K("path"),this._svg.appendChild(this._path)),this._path}_getCanvasContext(t,e){return this._canvas??=document.createElement("canvas"),this._canvas.width=t,this._canvas.height=e,this._canvas.getContext("2d",{willReadFrequently:!0})}_hittestSvgPath(t,e,r,i=0){const s=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),o=this.reverseTransformPt(this._searchPoint),n=h();g(n,t);const a={x:n[0],y:n[1],width:n[2]-n[0],height:n[3]-n[1]},l=this._getSvgPath();l.setAttribute("d",e);const c=l.getBBox();let m=Math.max(c.width/a.width,c.height/a.height),f=1;const u=2*s*m;u<1&&(f=2/u,m*=f,c.x*=f,c.y*=f,c.width*=f,c.height*=f);const d=1+i*m/2,p=this._getCanvasContext(c.width+2*d,c.height+2*d);p.setTransform(f,0,0,f,-c.x+d,-c.y+d);const _=new Path2D(e);r?p.fill(_):(p.lineWidth=i*(m/f),p.stroke(_));const y=(a.width*m-c.width)/2,P=(a.height*m-c.height)/2,S=Math.floor((o[0]-a.x-s)*m-y+d),w=Math.floor((a.height-(o[1]-a.y)-s)*m+P+d),x=Math.ceil(2*s*m),M=Math.ceil(2*s*m),b=p.getImageData(S,w,x,M).data;for(let h=3;h<b.length;h+=4)if(b[h]>127.5)return void(this._earlyReturn=!0)}_hitTestStroke(t,e){let r=null;if(S(t)){const e=t;r=[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}else if(y(t))r=t.rings;else{if(!P(t))return;r=t.paths}gt(this.reverseTransformPt(this._searchPoint),r,A(e,v.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}class ft extends ht{constructor(t,e,r,i){super(e,r),this._applyAdditionalRenderProps=i,this._colorSubstitutionHelper=new M,this._ctx=t}drawSolidFill(t,e){if(!t)return;if(y(t))this._buildPath(t.rings,!0);else if(P(t))this._buildPath(t.paths,!0);else if(S(t))this._buildPath(_t(t).rings,!0);else{if(!w(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const r=this._ctx;r.fillStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",r.fill("evenodd")}drawSolidStroke(t,e,r,i,s,o){if(!t||!e||0===r)return;if(y(t))this._buildPath(t.rings,!0);else if(P(t))this._buildPath(t.paths,!1);else{if(!S(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(_t(t).rings,!0)}const n=this._ctx;n.strokeStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",n.lineWidth=Math.max(this.transformSize(r),nt),this._setCapStyle(i),this._setJoinStyle(s),n.miterLimit=o,n.stroke()}pushClipPath(t){if(this._ctx.save(),y(t))this._buildPath(t.rings,!0);else if(P(t))this._buildPath(t.paths,!0);else{if(!S(t))return;this._buildPath(_t(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,e){const{colorSubstitutions:r,url:i,tintColor:s}=t,o=A(t.scaleX,1),n=this._resourceManager.getResource(i);if(null==n)return;let a=e*(n.width/n.height),l=e;e||(a=n.width,l=n.height);const h=D(i)||"src"in n&&D(n.src);let c="getFrame"in n?R(n):n;r&&(c=this._colorSubstitutionHelper.applyColorSubstitution(c,r)),this._applyAdditionalRenderProps&&!h&&s&&(c=this._colorSubstitutionHelper.tintImageData(c,s));const m=this.transformPt([0,0]),[f,u]=this.getTransformAngle(),d=this.transformSize(1),g=this._ctx;g.save(),g.setTransform({m11:o*d*f,m12:o*d*u,m21:-d*u,m22:d*f,m41:m[0],m42:m[1]}),g.drawImage(c,-a/2,-l/2,a,l),g.restore()}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new U);const r=Pt(t,this.transformSize(o(1))),i=this._textRasterizer.rasterizeText(e,r);if(!i)return;const{size:s,anchorX:n,anchorY:a,canvas:l}=i,h=s[0]*(n+.5),c=s[1]*(a-.5),m=this._ctx,f=this.transformPt([0,0]),[u,d]=this.getTransformAngle(),g=1;m.save(),m.setTransform({m11:g*u,m12:g*d,m21:-g*d,m22:g*u,m41:f[0]-g*h,m42:f[1]+g*c}),m.drawImage(l,0,0),m.restore()}drawPictureFill(t,e){if(!t)return;let{colorSubstitutions:r,height:i,offsetX:s,offsetY:o,rotation:n,scaleX:a,tintColor:l,url:h}=e;const c=this._resourceManager.getResource(h);if(null==c)return;if(y(t))this._buildPath(t.rings,!0);else if(P(t))this._buildPath(t.paths,!0);else if(S(t))this._buildPath(_t(t).rings,!0);else{if(!w(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const m=this._ctx,f=D(h)||"src"in c&&D(c.src);let u,d="getFrame"in c?R(c):c;if(r&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,r)),this._applyAdditionalRenderProps){f||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)),u=m.createPattern(d,"repeat");const t=this.transformSize(1);n||(n=0),s?s*=t:s=0,o?o*=t:o=0,i&&(i*=t);const e=i?i/c.height:1,r=a&&i?a*i/c.width:1;if(0!==n||1!==e||1!==r||0!==s||0!==o){const t=new DOMMatrix;t.rotateSelf(0,0,-n).translateSelf(s,o).scaleSelf(r,e,1),u.setTransform(t)}}else u=m.createPattern(d,"repeat");m.save(),m.fillStyle=u,m.fill("evenodd"),m.restore()}drawPictureStroke(t,r){if(!t)return;let{colorSubstitutions:i,capStyle:s,joinStyle:o,miterLimit:a,tintColor:l,url:h,width:c}=r;const m=this._resourceManager.getResource(h);if(null==m)return;let f;if(y(t))f=t.rings;else if(P(t))f=t.paths;else{if(!S(t))return w(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;f=_t(t).rings}c||(c=m.width);const u=D(h)||"src"in m&&D(m.src);let d="getFrame"in m?R(m):m;i&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,i)),this._applyAdditionalRenderProps&&(u||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)));const g=Math.max(this.transformSize(n(c)),.5),p=g/d.width,_=this._ctx,x=_.createPattern(d,"repeat-y");let M,b;_.save(),this._setCapStyle(s),this._setJoinStyle(o),void 0!==a&&(_.miterLimit=a),_.lineWidth=g;for(let n of f)if(n=e(n),wt(n),n&&!(n.length<=1)){M=this.transformPt(n[0]);for(let t=1;t<n.length;t++){b=this.transformPt(n[t]);const e=pt(M,b),r=new DOMMatrix;r.translateSelf(0,M[1]-g/2).scaleSelf(p,p,1).rotateSelf(0,0,90-e),x.setTransform(r),_.strokeStyle=x,_.beginPath(),_.moveTo(M[0],M[1]),_.lineTo(b[0],b[1]),_.stroke(),M=b}}_.restore()}drawGradientFill(t,e){if(!t)return;let r;if(y(t))r=t.rings;else if(P(t))r=t.paths;else{if(!S(t))return void at().error("Unable to draw gradient fill");r=_t(t).rings}this._buildPath(r,!0);const{angle:s,gradientMethod:o,gradientSize:a,gradientSizeUnits:l}=e,g=v.CIMGradientFill,p=e.gradientType??g.gradientType,_=-i(s??0),w=h();for(const i of r){const t=i?i.length:0;if(t>1)for(let e=0;e<t;e++){let t=this.transformPt(i[e]);"Linear"!==o&&"Rectangular"!==o||(t=z(t,-_)),c(w,t)}}const[x,M,b,k]=w,C=this._ctx;switch(C.save(),o){case"Buffered":at().error(`Gradient method "${o}" currently unsupported.`);break;case"Linear":{const t=(M+k)/2,r="Absolute"===l?this.transformSize(n(a)):H(a,g.gradientSize)*(b-x),[i,s]="Discrete"===p?[b,b-r]:[x+r,x],o=z([i,t],_),h=z([s,t],_),c=C.createLinearGradient(o[0],o[1],h[0],h[1]);L(c,e),C.fillStyle=c,C.fill("evenodd");break}case"Circular":{const t=m(w),r=d(w)/2,i="Absolute"===l?this.transformSize(n(a)):H(a,g.gradientSize)*r,[s,o]="Discrete"===p?[r,r-i]:[i,0],h=C.createRadialGradient(t[0],t[1],s,t[0],t[1],o);L(h,e),C.fillStyle=h,C.fill("evenodd");break}case"Rectangular":{const r=m(w),i=r[0],s=r[1],o=z(r,_),h=(r,i,s,n,a,l,h,c)=>{C.save(),this.pushClipPath(t);const m=z([a,l],_),f=z([h,c],_);C.beginPath(),C.moveTo(o[0],o[1]),C.lineTo(m[0],m[1]),C.lineTo(f[0],f[1]),C.lineTo(o[0],o[1]),C.clip();const u=z([r,i],_),d=z([s,n],_),g=C.createLinearGradient(u[0],u[1],d[0],d[1]);L(g,e),C.fillStyle=g,C.fill("evenodd"),C.restore()};let c="Absolute"===l?this.transformSize(n(a)):H(a,g.gradientSize)*(f(w)/2),[d,y]="Discrete"===p?[b,b-c]:[i+c,i];h(d,s,y,s,b,M,b,k),[d,y]="Discrete"===p?[x,x+c]:[i-c,i],h(d,s,y,s,x,k,x,M),c="Absolute"===l?this.transformSize(n(a)):H(a,g.gradientSize)*(u(w)/2);let[P,S]="Discrete"===p?[k,k-c]:[s+c,s];h(i,P,i,S,b,k,x,k),[P,S]="Discrete"===p?[M,M+c]:[s-c,s],h(i,P,i,S,x,M,b,M);break}}C.restore()}drawGradientStroke(t,r){const{capStyle:i,gradientMethod:s,gradientSize:o,gradientSizeUnits:a,joinStyle:l,miterLimit:h,width:c}=r;if(!t||0===c)return;let m;if(y(t))m=t.rings;else if(P(t))m=t.paths;else{if(!S(t))return void at().error("Unable to draw gradient stroke");m=_t(t).rings}const f=r.gradientType??v.CIMGradientStroke.gradientType,u=Math.max(this.transformSize(n(c)),.5),d=this._ctx;let g,p;d.save(),this._setCapStyle(i),this._setJoinStyle(l),void 0!==h&&(d.miterLimit=h),d.lineWidth=u;for(let _ of m){if(_=e(_),wt(_),!_||_.length<=1)continue;let t=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const r=p[0]-g[0],i=p[1]-g[1];t+=Math.sqrt(r*r+i*i),g=p}const i="Absolute"===a?this.transformSize(n(o)):H(o,v.CIMGradientStroke.gradientSize)*("AcrossLine"===s?u:t);let l=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const o=p[0]-g[0],n=p[1]-g[1],a=Math.sqrt(o*o+n*n);let h,c,m,y;switch(s){case"AcrossLine":{const[t,e]=z([o/a,n/a],Math.PI/2),r=u/2,s="Discrete"===f?r:i-r;h=(g[0]+p[0])/2+t*s,c=(g[1]+p[1])/2+e*s,m=h-t*i,y=c-e*i;break}case"AlongLine":{const e=o/a,r=n/a;"Discrete"===f?(h=g[0]-e*l,c=g[1]-r*l,m=h+e*i,y=c+r*i):(m=g[0]+e*(t-l),y=g[1]+r*(t-l),h=m-e*i,c=y-r*i);break}default:return at().error("Unrecognized gradient method:",s),void d.restore()}const P=d.createLinearGradient(h,c,m,y);L(P,r),d.strokeStyle=P,d.beginPath(),d.moveTo(g[0],g[1]),d.lineTo(p[0],p[1]),d.stroke(),l+=a,g=p}}d.restore()}_buildPath(t,e){const r=this._ctx;if(r.beginPath(),t)for(const i of t){const t=i?i.length:0;if(t>1){let s=this.transformPt(i[0]);r.moveTo(s[0],s[1]);for(let e=1;e<t;e++)s=this.transformPt(i[e]),r.lineTo(s[0],s[1]);e&&r.closePath()}}}_setCapStyle(t){switch(t){case I.Butt:this._ctx.lineCap="butt";break;case I.Round:this._ctx.lineCap="round";break;case I.Square:this._ctx.lineCap="square"}}_setJoinStyle(t){switch(t){case T.Bevel:this._ctx.lineJoin="bevel";break;case T.Round:this._ctx.lineJoin="round";break;case T.Miter:this._ctx.lineJoin="miter"}}}function ut(t,e,r){let i=A(t.separation,v.CIMHatchFill.separation)*r,s=A(t.rotation);if(0===i)return null;i<0&&(i=-i);let o=0;const n=.5*i;for(;o>n;)o-=i;for(;o<-n;)o+=i;const a=h();g(a,e),a[0]-=n,a[1]-=n,a[2]+=n,a[3]+=n;const l=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;s>180;)s-=180;for(;s<0;)s+=180;const c=Math.cos(s*ot),m=Math.sin(s*ot),f=-i*m,u=i*c;let d,p,_,y;o=A(t.offsetX)*r*m-A(t.offsetY)*r*c,d=_=Number.MAX_VALUE,p=y=-Number.MAX_VALUE;for(const h of l){const t=h[0],e=h[1],r=c*t+m*e,i=-m*t+c*e;d=Math.min(d,r),_=Math.min(_,i),p=Math.max(p,r),y=Math.max(y,i)}_=Math.floor(_/i)*i;let P=c*d-m*_-f*o/i,S=m*d+c*_-u*o/i,w=c*p-m*_-f*o/i,x=m*p+c*_-u*o/i;const M=1+Math.round((y-_)/i),b=[];for(let h=0;h<M;h++)P+=f,S+=u,w+=f,x+=u,b.push([[P,S],[w,x]]);return{paths:b}}function dt(t,e){let r=0;for(const i of e){const e=i.length;for(let s=1;s<e;s++){const e=i[s-1],o=i[s];if(e[1]>t[1]==o[1]>t[1])continue;(o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0])>0?r++:r--}}return 0!==r}function gt(t,e,r){for(const i of e){const e=i.length;for(let s=1;s<e;s++){const e=i[s-1],o=i[s];let n=(o[0]-e[0])*(o[0]-e[0])+(o[1]-e[1])*(o[1]-e[1]);if(0===n)continue;n=Math.sqrt(n);const a=((o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0]))/n;if(Math.abs(a)<r){const i=((o[0]-e[0])*(t[0]-e[0])+(o[1]-e[1])*(t[1]-e[1]))/n;if(i>-r&&i<n+r)return!0}}}return!1}function pt(t,e){const r=e[0]-t[0],i=e[1]-t[1];return 180/Math.PI*Math.atan2(i,r)}const _t=t=>t?{spatialReference:t.spatialReference,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:null,yt=(t,e,r)=>{switch(t){case"ExtraLeading":return 1+e/r;case"Multiple":return e;case"Exact":return e/r}};function Pt(e,r=1){const i=B(e),s=E(e.fontStyleName),o=e.fontFamilyName??t,{weight:n,style:a}=s,l=r*(e.height||5),h=X(e.horizontalAlignment),c=J(e.verticalAlignment),m=N(e),f=N(e.haloSymbol),u=null!=f?r*(e.haloSize??0):0,d=O(e.symbol),g=r*(q(e.symbol)||0),p="CIMBackgroundCallout"===e.callout?.type?e.callout.backgroundSymbol:null,_=N(p),y=q(p),P=O(p);return{color:m,size:l,horizontalAlignment:h,verticalAlignment:c,font:{family:o,style:V(a),weight:W(n),decoration:i},outline:{size:g||0,color:d},halo:{size:u||0,color:f,style:a},backgroundColor:_,borderLine:null!=y&&null!=P?{size:y,color:P}:null,pixelRatio:1,premultiplyColors:!0}}const St=1e-4;function wt(t){let e,r,i,s,o,n=t[0],a=1;for(;a<t.length;)e=t[a][0]-n[0],r=t[a][1]-n[1],s=0!==e?r/e:Math.PI/2,void 0!==i&&Math.abs(s-i)<=St?(t.splice(a-1,1),n=o):(o=n,n=t[a],a++),i=s}export{ht as CIMSymbolDrawHelper,ft as CanvasDrawHelper,ct as EnvDrawHelper,mt as HittestDrawHelper,lt as Transformation,ot as cDegToRad,yt as lineGapType2LineHeight};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as t}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ColorFormat as n}from"../../../webgl/formats.js";import i from"../../../webgl/RenderNode.js";import{alphaCutoff as s}from"../../core/shaderLibrary/util/AlphaCutoff.js";import{If as a,glsl as c}from"../../core/shaderModules/interfaces.js";import{Default3D as l}from"../../lib/DefaultVertexAttributeLocations.js";import{FramebufferBit as u,ColorAttachment as p,BlendFactor as d,SizedPixelFormat as f,PixelFormat as h,DataType as m}from"../../../../webgl/enums.js";let T=class extends i{constructor(e){super(e),this.destroyedCB=null,this.produces="final-color",this.consumes={required:["final-color"]},this.clearColor=t,this._focusedFBOType=0,this._program=new Map}destroy(){this._program.forEach((e=>e.dispose())),this._program.clear(),this.destroyedCB()}render(e){const r=e.find((({name:e})=>"final-color"===e));if(!this._focusedFBO)return r;const o=this.renderingContext;o.bindFramebuffer(r.fbo),o.setClearColor(0,0,0,0),o.clear(u.COLOR);const t=this._ensureShader(o,!1,0);return o.useProgram(t),o.bindTexture(this._focusedFBO.getTexture(),0),t.setUniform1i("colorTex",0),t.setUniform1i("inputType",this._focusedFBOType),3===this._focusedFBOType&&t.setUniform2fv("nearFar",this.camera.nearFar),o.screen.draw(),r}getDownscaledFBO(e,r,o,t,i,s){o===v.ON&&(i=e.width,s=e.height);const a=this.renderingContext,{colorTexture:c,depthStencilTexture:l}=e,h=c?.descriptor,m=this._ensureShader(a,null!=l,r),T=this.fboCache.acquire(i,s,"fbo visualizer"),g=!h?.hasMipmap&&!h?.isImmutable;g&&c?.generateMipmap(),a.useProgram(m),a.bindFramebuffer(T.fbo);let F=0;const x=[p.COLOR_ATTACHMENT0],C=null!=l;if(a.bindTexture(c,F),m.setUniform1i("colorTex",F),l){F++,a.bindTexture(l,F),m.setUniform1i("depthTex",F);const e=p.COLOR_ATTACHMENT0+F;T.acquireColor(e,n.RGBA,"depth to color"),x.push(e)}for(let u=0;u<r;u++){F++;const r=p.COLOR_ATTACHMENT0+F,o=C?1:0;a.bindTexture(e.getColorTexture(r-o),F),m.setUniform1i("colorTex"+(F-o-1),F),T.acquireColor(r,n.RGBA),x.push(r)}a.gl.drawBuffers(x);const b=a.getViewport();a.setViewport(0,0,i,s),a.setClearColor(0,0,0,0),a.clear(u.COLOR),a.setBlendingEnabled(!0),a.setBlendFunction(d.ONE,d.ONE_MINUS_SRC_ALPHA);const O="linear-depth"===t||t.includes("shadow"),_=h?.internalFormat,y=O?3:_===f.R16F||_===f.R32F||_===f.R8?1:_===f.RG8?2:_===f.RGBA16F?4:0;return m.setUniform1i("inputType",y),O&&m.setUniform2fv("nearFar",this.camera.nearFar),a.screen.draw(),a.bindFramebuffer(null),a.setViewport(b.x,b.y,b.width,b.height),o===v.ON&&(this._focusedFBO=T,this._focusedFBOType=y),g&&e.colorTexture?.clearMipmap(),T}clearFocusedFBO(){this._focusedFBO=null}getPreviewContent(e,r,o,t){if(!o)return null;const n=this.renderingContext,i=this.fboCache.acquire(e,r,"fbo visualizer");n.bindFramebuffer(i?.fbo),n.setClearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),n.clear(u.COLOR),n.setBlendingEnabled(!0),n.setBlendFunction(d.ONE,d.ONE_MINUS_SRC_ALPHA),n.setViewport(0,0,e,r);const s=this._ensureShader(n,!1,0);n.useProgram(s),n.bindTexture(o.getColorTexture(t),0),s.setUniform1i("colorTex",0),s.setUniform1i("inputType",0),n.screen.draw();const a=new ImageData(new Uint8ClampedArray(e*r*4),e,r);return n.gl.readPixels(0,0,e,r,h.RGBA,m.UNSIGNED_BYTE,new Uint8Array(a.data.buffer)),n.bindFramebuffer(null),i?.release(),a}_ensureShader(e,r,o){const t={hasDepth:r,attachments:o},n=this._program.get(t);if(n)return n;const i="#version 300 es\n in vec2 position;\n out vec2 uv;\n\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n uv = position * 0.5 + vec2(0.5);\n }",u=(e,r)=>{let o="";const t=e?2:1;for(let n=0;n<r;n++)o+=`layout(location = ${c.int(t+n)}) out vec4 fragColor${c.int(n)};\n uniform sampler2D colorTex${c.int(n)};`;return o},p=e=>{let r="";for(let o=0;o<e;o++)r+=`fragColor${c.int(o)} = texture(colorTex${c.int(o)}, uv);`;return r},d=`#version 300 es\n precision highp float;\n\n in vec2 uv;\n uniform sampler2D colorTex;\n layout(location = 0) out vec4 fragColor;\n ${a(r,"layout(location = 1) out vec4 fragDepth;\n uniform sampler2D depthTex;")}\n ${u(r,o)}\n uniform int inputType;\n uniform vec2 nearFar;\n\n // Factors to convert rgba back to float\n const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n 255.0 / (256.0),\n 255.0 / (256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n );\n\n\n float rgbaTofloat(vec4 rgba) {\n // Convert components from 0->1 back to 0->255 and then add the components together with their corresponding\n // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n return dot(rgba, RGBA_2_FLOAT_FACTORS);\n }\n\n float linearDepthFromFloat(float depth) {\n depth = pow(depth, 0.2);\n return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n }\n\n float linearDepthFromRGBA(vec4 depth) {\n return linearDepthFromFloat(rgbaTofloat(depth));\n }\n\n float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0));\n }\n\n void main() {\n vec4 color;\n if(inputType == 1) {\n color = vec4(vec3(texture(colorTex, uv).r), 1.0);\n } else if(inputType == 2) {\n color = vec4(texture(colorTex, uv).rg, 0.0, 1.0);\n } else if(inputType == 3) {\n float depth = 1.0 - (-linearDepthFromTexture(colorTex, uv) / (nearFar[1] - nearFar[0]));\n color = vec4(vec3(depth), depth >= 0.999 ? 0.0 : 1.0);\n } else if(inputType == 4) {\n color = texture(colorTex, uv);\n color = vec4(color.rgb / color.a, color.a);\n } else {\n color = texture(colorTex, uv);\n }\n\n\n if(color.a < ${c.float(s)})\n discard;\n else {\n fragColor = color;\n ${a(r,"float depth = 1.0 - pow(texture(depthTex, uv).r, 10.0);\n fragDepth = vec4(vec3(depth), depth < 0.000001 ? 0.0 : 1.0);")}\n ${a(o>0,p(o))}\n }\n }`;return this._program.set(t,e.programCache.acquire(i,d,l)),this._program.get(t)}};var v;e([r()],T.prototype,"destroyedCB",void 0),e([r()],T.prototype,"produces",void 0),e([r()],T.prototype,"consumes",void 0),e([r()],T.prototype,"clearColor",void 0),T=e([o("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizerNode")],T),function(e){e[e.ON=0]="ON",e[e.OFF=1]="OFF"}(v||(v={}));export{v as FocusState,T as RenderNodeVisualizerNode};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as t}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderCategory as n}from"../../../webgl.js";import{ColorFormat as i}from"../../../webgl/formats.js";import s from"../../../webgl/RenderNode.js";import{alphaCutoff as a}from"../../core/shaderLibrary/util/AlphaCutoff.js";import{If as c,glsl as l}from"../../core/shaderModules/interfaces.js";import{Default3D as u}from"../../lib/DefaultVertexAttributeLocations.js";import{FramebufferBit as p,ColorAttachment as d,BlendFactor as f,SizedPixelFormat as h,PixelFormat as m,DataType as T}from"../../../../webgl/enums.js";let v=class extends s{constructor(e){super(e),this.destroyedCB=null,this.produces=n.FINAL,this.consumes={required:[n.FINAL]},this.clearColor=t,this._focusedFBOType=0,this._program=new Map}destroy(){this._program.forEach((e=>e.dispose())),this._program.clear(),this.destroyedCB()}render(e){const r=e.find((({name:e})=>e===n.FINAL));if(!this._focusedFBO)return r;const o=this.renderingContext;o.bindFramebuffer(r.fbo),o.setClearColor(0,0,0,0),o.clear(p.COLOR);const t=this._ensureShader(o,!1,0);return o.useProgram(t),o.bindTexture(this._focusedFBO.getTexture(),0),t.setUniform1i("colorTex",0),t.setUniform1i("inputType",this._focusedFBOType),3===this._focusedFBOType&&t.setUniform2fv("nearFar",this.camera.nearFar),o.screen.draw(),r}getDownscaledFBO(e,r,o,t,n,s){o===g.ON&&(n=e.width,s=e.height);const a=this.renderingContext,{colorTexture:c,depthStencilTexture:l}=e,u=c?.descriptor,m=this._ensureShader(a,null!=l,r),T=this.fboCache.acquire(n,s,"fbo visualizer"),v=!u?.hasMipmap&&!u?.isImmutable;v&&c?.generateMipmap(),a.useProgram(m),a.bindFramebuffer(T.fbo);let F=0;const x=[d.COLOR_ATTACHMENT0],C=null!=l;if(a.bindTexture(c,F),m.setUniform1i("colorTex",F),l){F++,a.bindTexture(l,F),m.setUniform1i("depthTex",F);const e=d.COLOR_ATTACHMENT0+F;T.acquireColor(e,i.RGBA,"depth to color"),x.push(e)}for(let p=0;p<r;p++){F++;const r=d.COLOR_ATTACHMENT0+F,o=C?1:0;a.bindTexture(e.getColorTexture(r-o),F),m.setUniform1i("colorTex"+(F-o-1),F),T.acquireColor(r,i.RGBA),x.push(r)}a.gl.drawBuffers(x);const b=a.getViewport();a.setViewport(0,0,n,s),a.setClearColor(0,0,0,0),a.clear(p.COLOR),a.setBlendingEnabled(!0),a.setBlendFunction(f.ONE,f.ONE_MINUS_SRC_ALPHA);const O="linear-depth"===t||t.includes("shadow"),_=u?.internalFormat,A=O?3:_===h.R16F||_===h.R32F||_===h.R8?1:_===h.RG8?2:_===h.RGBA16F?4:0;return m.setUniform1i("inputType",A),O&&m.setUniform2fv("nearFar",this.camera.nearFar),a.screen.draw(),a.bindFramebuffer(null),a.setViewport(b.x,b.y,b.width,b.height),o===g.ON&&(this._focusedFBO=T,this._focusedFBOType=A),v&&e.colorTexture?.clearMipmap(),T}clearFocusedFBO(){this._focusedFBO=null}getPreviewContent(e,r,o,t){if(!o)return null;const n=this.renderingContext,i=this.fboCache.acquire(e,r,"fbo visualizer");n.bindFramebuffer(i?.fbo),n.setClearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),n.clear(p.COLOR),n.setBlendingEnabled(!0),n.setBlendFunction(f.ONE,f.ONE_MINUS_SRC_ALPHA),n.setViewport(0,0,e,r);const s=this._ensureShader(n,!1,0);n.useProgram(s),n.bindTexture(o.getColorTexture(t),0),s.setUniform1i("colorTex",0),s.setUniform1i("inputType",0),n.screen.draw();const a=new ImageData(new Uint8ClampedArray(e*r*4),e,r);return n.gl.readPixels(0,0,e,r,m.RGBA,T.UNSIGNED_BYTE,new Uint8Array(a.data.buffer)),n.bindFramebuffer(null),i?.release(),a}_ensureShader(e,r,o){const t={hasDepth:r,attachments:o},n=this._program.get(t);if(n)return n;const i="#version 300 es\n in vec2 position;\n out vec2 uv;\n\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n uv = position * 0.5 + vec2(0.5);\n }",s=(e,r)=>{let o="";const t=e?2:1;for(let n=0;n<r;n++)o+=`layout(location = ${l.int(t+n)}) out vec4 fragColor${l.int(n)};\n uniform sampler2D colorTex${l.int(n)};`;return o},p=e=>{let r="";for(let o=0;o<e;o++)r+=`fragColor${l.int(o)} = texture(colorTex${l.int(o)}, uv);`;return r},d=`#version 300 es\n precision highp float;\n\n in vec2 uv;\n uniform sampler2D colorTex;\n layout(location = 0) out vec4 fragColor;\n ${c(r,"layout(location = 1) out vec4 fragDepth;\n uniform sampler2D depthTex;")}\n ${s(r,o)}\n uniform int inputType;\n uniform vec2 nearFar;\n\n // Factors to convert rgba back to float\n const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n 255.0 / (256.0),\n 255.0 / (256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n );\n\n\n float rgbaTofloat(vec4 rgba) {\n // Convert components from 0->1 back to 0->255 and then add the components together with their corresponding\n // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n return dot(rgba, RGBA_2_FLOAT_FACTORS);\n }\n\n float linearDepthFromFloat(float depth) {\n depth = pow(depth, 0.2);\n return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n }\n\n float linearDepthFromRGBA(vec4 depth) {\n return linearDepthFromFloat(rgbaTofloat(depth));\n }\n\n float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0));\n }\n\n void main() {\n vec4 color;\n if(inputType == 1) {\n color = vec4(vec3(texture(colorTex, uv).r), 1.0);\n } else if(inputType == 2) {\n color = vec4(texture(colorTex, uv).rg, 0.0, 1.0);\n } else if(inputType == 3) {\n float depth = 1.0 - (-linearDepthFromTexture(colorTex, uv) / (nearFar[1] - nearFar[0]));\n color = vec4(vec3(depth), depth >= 0.999 ? 0.0 : 1.0);\n } else if(inputType == 4) {\n color = texture(colorTex, uv);\n color = vec4(color.rgb / color.a, color.a);\n } else {\n color = texture(colorTex, uv);\n }\n\n\n if(color.a < ${l.float(a)})\n discard;\n else {\n fragColor = color;\n ${c(r,"float depth = 1.0 - pow(texture(depthTex, uv).r, 10.0);\n fragDepth = vec4(vec3(depth), depth < 0.000001 ? 0.0 : 1.0);")}\n ${c(o>0,p(o))}\n }\n }`;return this._program.set(t,e.programCache.acquire(i,d,u)),this._program.get(t)}};var g;e([r()],v.prototype,"destroyedCB",void 0),e([r()],v.prototype,"produces",void 0),e([r()],v.prototype,"consumes",void 0),e([r()],v.prototype,"clearColor",void 0),v=e([o("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizerNode")],v),function(e){e[e.ON=0]="ON",e[e.OFF=1]="OFF"}(g||(g={}));export{g as FocusState,v as RenderNodeVisualizerNode};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ColorFormat as r}from"../../../webgl/formats.js";import o from"../../../webgl/RenderNode.js";import{FocusAreaColorTechnique as i}from"./FocusAreaColorTechnique.js";import{FocusAreaMaskTechnique as a}from"./FocusAreaMaskTechnique.js";import{Default3D as n}from"../../lib/DefaultVertexAttributeLocations.js";import{Pos3 as c}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as l}from"../../lib/VertexArrayObject.js";import{F as h}from"../../../../../chunks/FocusAreaColor.glsl.js";import{F as u}from"../../../../../chunks/FocusAreaMask.glsl.js";import{BufferObject as p}from"../../../../webgl/BufferObject.js";import{FramebufferBit as m,CompareFunction as f,Face as d,StencilOperation as g,PrimitiveType as A,Usage as _}from"../../../../webgl/enums.js";let E=class extends o{constructor(e){super(e),this.consumes={required:["final-color"]},this.produces="final-color",this.focusAreaGeometries=new Array,this._vaos=Array(),this._count=new Array,this._origins=new Array,this._colorParameters=new h,this._maskParameters=new u,e.techniques.precompile(a),e.techniques.precompile(i)}initialize(){this.setExtrudedVolume()}destroy(){this._vaos.forEach((e=>e.dispose())),this._vaos=[],this._count=[],this._origins=[]}render(e){const t=this.techniques.acquire(a),s=this.techniques.acquire(i),o=this.bindParameters,n=e.find((({name:e})=>"final-color"===e)),c=n?.getTexture(),l=o.camera,h=l.fullViewport[2],u=l.fullViewport[3],p=this.fboCache.acquire(h,u,"focusArea",r.RGBA),_=this.fboCache.acquire(h,u,this.produces);if(!t.compiled||!s.compiled||!this._vaos||this.effect===b.NONE)return this.requestRender(),t.release(),s.release(),_.release(),p.release(),n;const E=this.renderingContext;p.attachDepth(n.getAttachment(this.gl.DEPTH_STENCIL_ATTACHMENT)),E.bindFramebuffer(p.fbo),E.clear(m.COLOR|m.STENCIL),E.setViewport(0,0,h,u),E.gl.clearStencil(0),E.gl.clear(E.gl.STENCIL_BUFFER_BIT),E.setClearStencil(0);for(let r=0;r<this._vaos.length;r++){const e=this._vaos[r],s=this._count[r];e&&(this._maskParameters.origin=this._origins[r],E.bindTechnique(t,o,this._maskParameters),E.setFaceCullingEnabled(!1),E.setStencilTestEnabled(!0),E.setStencilWriteMask(255),E.setStencilFunction(f.ALWAYS,0,255),E.setStencilOpSeparate(d.FRONT,g.KEEP,g.INCR_WRAP,g.KEEP),E.setStencilOpSeparate(d.BACK,g.KEEP,g.DECR_WRAP,g.KEEP),E.setDepthWriteEnabled(!1),E.setColorMask(!1,!1,!1,!1),E.bindVAO(e),E.drawArrays(A.TRIANGLES,0,s),E.setFaceCullingEnabled(!1),E.setDepthTestEnabled(!1),E.setStencilFunction(f.NOTEQUAL,0,255),E.setStencilWriteMask(0),E.setColorMask(!0,!0,!0,!0),E.drawArrays(A.TRIANGLES,0,s))}return t.release(),E.gl.clear(E.gl.STENCIL_BUFFER_BIT),E.bindFramebuffer(_.fbo),this._colorParameters.color=c,this._colorParameters.focusArea=p.getTexture(),this._colorParameters.effect=this.effect,E.bindTechnique(s,o,this._colorParameters),E.screen.draw(),p.release(),s.release(),_.attachDepth(n.getAttachment(this.gl.DEPTH_STENCIL_ATTACHMENT)),_}setExtrudedVolume(){const e=this.focusAreaGeometries;this._vaos=[],this._count=[],this._origins=[];for(let t=0;t<e.length;t++){const s=e[t],r=new Array,o=s.indicesBottom;this._origins.push(s.origin);for(let e=0;e<o.length;e++)r.push(s.positions[3*(o[e]-1)]),r.push(s.positions[3*(o[e]-1)+1]),r.push(s.positions[3*(o[e]-1)+2]);const i=s.indicesExtruded;for(let e=0;e<i.length;e++)r.push(s.positions[3*i[e]]),r.push(s.positions[3*i[e]+1]),r.push(s.positions[3*i[e]+2]);const a=new Float32Array(r),h=new l(this.renderingContext,n,new Map([["geometry",c]]),new Map([["geometry",p.createVertex(this.renderingContext,_.STATIC_DRAW,a)]]));this._vaos?.push(h),this._count.push(o.length+i.length)}}};e([t()],E.prototype,"consumes",void 0),e([t()],E.prototype,"produces",void 0),e([t({constructOnly:!0})],E.prototype,"techniques",void 0),e([t()],E.prototype,"focusAreaGeometries",void 0),e([t()],E.prototype,"effect",void 0),E=e([s("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaRenderNode")],E);class T{constructor(e,t,s,r,o){this.positions=e,this.indicesBottom=t,this.indicesExtruded=s,this.height=r,this.origin=o}}var b;!function(e){e[e.NONE=0]="NONE",e[e.BRIGHT=1]="BRIGHT",e[e.DARK=2]="DARK"}(b||(b={}));export{b as FocusAreaEffect,T as FocusAreaGeometry,E as FocusAreaRenderNode};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{RenderCategory as r}from"../../../webgl.js";import{ColorFormat as o}from"../../../webgl/formats.js";import i from"../../../webgl/RenderNode.js";import{FocusAreaColorTechnique as a}from"./FocusAreaColorTechnique.js";import{FocusAreaMaskTechnique as n}from"./FocusAreaMaskTechnique.js";import{Default3D as c}from"../../lib/DefaultVertexAttributeLocations.js";import{Pos3 as h}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as l}from"../../lib/VertexArrayObject.js";import{F as u}from"../../../../../chunks/FocusAreaColor.glsl.js";import{F as p}from"../../../../../chunks/FocusAreaMask.glsl.js";import{BufferObject as m}from"../../../../webgl/BufferObject.js";import{FramebufferBit as f,CompareFunction as d,Face as g,StencilOperation as A,PrimitiveType as _,Usage as E}from"../../../../webgl/enums.js";let b=class extends i{constructor(e){super(e),this.consumes={required:[r.FINAL]},this.produces=r.FINAL,this.focusAreaGeometries=new Array,this._vaos=Array(),this._count=new Array,this._origins=new Array,this._colorParameters=new u,this._maskParameters=new p,e.techniques.precompile(n),e.techniques.precompile(a)}initialize(){this.setExtrudedVolume()}destroy(){this._vaos.forEach((e=>e.dispose())),this._vaos=[],this._count=[],this._origins=[]}render(e){const t=this.techniques.acquire(n),s=this.techniques.acquire(a),i=this.bindParameters,c=e.find((({name:e})=>e===r.FINAL)),h=c?.getTexture(),l=i.camera,u=l.fullViewport[2],p=l.fullViewport[3],m=this.fboCache.acquire(u,p,"focusArea",o.RGBA),E=this.fboCache.acquire(u,p,this.produces);if(!t.compiled||!s.compiled||!this._vaos||this.effect===C.NONE)return this.requestRender(),t.release(),s.release(),E.release(),m.release(),c;const b=this.renderingContext;m.attachDepth(c.getAttachment(this.gl.DEPTH_STENCIL_ATTACHMENT)),b.bindFramebuffer(m.fbo),b.clear(f.COLOR|f.STENCIL),b.setViewport(0,0,u,p),b.gl.clearStencil(0),b.gl.clear(b.gl.STENCIL_BUFFER_BIT),b.setClearStencil(0);for(let r=0;r<this._vaos.length;r++){const e=this._vaos[r],s=this._count[r];e&&(this._maskParameters.origin=this._origins[r],b.bindTechnique(t,i,this._maskParameters),b.setFaceCullingEnabled(!1),b.setStencilTestEnabled(!0),b.setStencilWriteMask(255),b.setStencilFunction(d.ALWAYS,0,255),b.setStencilOpSeparate(g.FRONT,A.KEEP,A.INCR_WRAP,A.KEEP),b.setStencilOpSeparate(g.BACK,A.KEEP,A.DECR_WRAP,A.KEEP),b.setDepthWriteEnabled(!1),b.setColorMask(!1,!1,!1,!1),b.bindVAO(e),b.drawArrays(_.TRIANGLES,0,s),b.setFaceCullingEnabled(!1),b.setDepthTestEnabled(!1),b.setStencilFunction(d.NOTEQUAL,0,255),b.setStencilWriteMask(0),b.setColorMask(!0,!0,!0,!0),b.drawArrays(_.TRIANGLES,0,s))}return t.release(),b.gl.clear(b.gl.STENCIL_BUFFER_BIT),b.bindFramebuffer(E.fbo),this._colorParameters.color=h,this._colorParameters.focusArea=m.getTexture(),this._colorParameters.effect=this.effect,b.bindTechnique(s,i,this._colorParameters),b.screen.draw(),m.release(),s.release(),E.attachDepth(c.getAttachment(this.gl.DEPTH_STENCIL_ATTACHMENT)),E}setExtrudedVolume(){const e=this.focusAreaGeometries;this._vaos=[],this._count=[],this._origins=[];for(let t=0;t<e.length;t++){const s=e[t],r=new Array,o=s.indicesBottom;this._origins.push(s.origin);for(let e=0;e<o.length;e++)r.push(s.positions[3*(o[e]-1)]),r.push(s.positions[3*(o[e]-1)+1]),r.push(s.positions[3*(o[e]-1)+2]);const i=s.indicesExtruded;for(let e=0;e<i.length;e++)r.push(s.positions[3*i[e]]),r.push(s.positions[3*i[e]+1]),r.push(s.positions[3*i[e]+2]);const a=new Float32Array(r),n=new l(this.renderingContext,c,new Map([["geometry",h]]),new Map([["geometry",m.createVertex(this.renderingContext,E.STATIC_DRAW,a)]]));this._vaos?.push(n),this._count.push(o.length+i.length)}}};e([t()],b.prototype,"consumes",void 0),e([t()],b.prototype,"produces",void 0),e([t({constructOnly:!0})],b.prototype,"techniques",void 0),e([t()],b.prototype,"focusAreaGeometries",void 0),e([t()],b.prototype,"effect",void 0),b=e([s("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaRenderNode")],b);class T{constructor(e,t,s,r,o){this.positions=e,this.indicesBottom=t,this.indicesExtruded=s,this.height=r,this.origin=o}}var C;!function(e){e[e.NONE=0]="NONE",e[e.BRIGHT=1]="BRIGHT",e[e.DARK=2]="DARK"}(C||(C={}));export{C as FocusAreaEffect,T as FocusAreaGeometry,b as FocusAreaRenderNode};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{unitRGBAFromColor as i}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{removeMaybe as s,abortMaybe as a,destroyMaybe as n,releaseMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as _,initial as l,sync as p}from"../../../../core/reactiveUtils.js";import{signal as u}from"../../../../core/signal.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/interfaces.js";import"../../../../core/accessorSupport/tracking/Flags.js";import"../../../../core/Warning.js";import"../../../../core/Error.js";import{equals as c,invert as f,multiply as g}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as b,create as T}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as E}from"../../../../chunks/vec42.js";import{fromValues as A,ZEROS as P}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as R}from"../../../../geometry/support/Indices.js";import{InternalRenderCategory as S,RenderCategory as w}from"../../webgl.js";import{debugFlags as C}from"../../support/debugFlags.js";import{DepthFormat as I,ColorFormat as D}from"../../webgl/formats.js";import{FBOCache as N,defaultWebGLFBO as O}from"../core/FBOCache.js";import{RenderPassManager as y}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as H,isColorOrColorEmission as x}from"../core/shaderLibrary/ShaderOutput.js";import{HUDRenderStyle as M}from"../core/shaderLibrary/hud/HUDRenderStyle.js";import{distanceFadeEnd as L}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as U}from"../effects/RenderNodes.js";import{releaseTechniques as v}from"../effects/RenderPlugin.js";import{RenderPluginManager as F}from"../effects/RenderPluginManager.js";import{Blit as G}from"../effects/blit/Blit.js";import{renderHighlightBuffer as q}from"../effects/highlight/Highlight.js";import{OITBlend as V}from"../effects/transparency/OITBlend.js";import{AnimationTimer as j}from"./AnimationTimer.js";import{AnimationTimeStep as B}from"./AnimationTimeStep.js";import{RenderRequestType as Q}from"./basicInterfaces.js";import{BoundingInfo as W}from"./BoundingInfo.js";import{DepthRange as k}from"./DepthRange.js";import{depthRangeFromScene as z}from"./depthRangeUtils.js";import{MainFramebuffer as X}from"./MainFramebuffer.js";import{RenderOccludedFlag as Y}from"./Material.js";import{OITPass as K}from"./OITPass.js";import{RenderContext as J,defaultRenderOccludedMask as $}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as Z,RendererTarget as ee}from"./rendererUtils.js";import{setupFeatureDefaults as te,RenderFeature as re}from"./RenderFeature.js";import{RenderPluginInput as ie}from"./RenderPluginInput.js";import{RenderSlot as se}from"./RenderSlot.js";import{ShadowAccumulator as ae}from"./ShadowAccumulator.js";import{ShadowMap as ne,SnapshotSlot as he}from"./ShadowMap.js";import oe from"./SliceHelper.js";import{Transparency as de}from"./edgeRendering/interfaces.js";import{MergedRenderer as _e}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as le}from"../parts/renderUtils.js";import{RendererPerformanceInfo as pe,PerformanceCategory as ue}from"../statistics/RendererPerformanceInfo.js";import{RenderState as me}from"../../../support/RenderState.js";import{PixelFormat as ce,PixelType as fe,DepthStencilAttachment as ge,FramebufferBit as be,ColorAttachment as Te}from"../../../webgl/enums.js";class Ee{constructor(e,t,r,s,a,n){this._stage=e,this._techniques=r,this._rctx=s,this._compositingHelper=a,this._requestRender=n,this._pluginsHas={hudElements:!1,water:!1},this._renderers=new Map,this.renderPassManager=new y,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=A(0,0,0,1),this._sliceHelper=new oe,this._blit=null,this._oitblend=null,this._state=u(me.IDLE),this._highQualityTransparencyEnabled=!0,this._ssrEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new B,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=u(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new ie,this._releaseNormals=e=>{e.some((({name:e})=>"normals"===e))&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this.fboCache=new N(s),this._renderStateFeatures=u(te(!has("disable-feature:high-quality-idle"),e.view.qualityProfile)),this._framebuffer=new X(this.fboCache),this.performanceInfo=new pe(this._rctx),this._shadowMap=new ne(this.fboCache,e.viewingMode),this._shadowAccumulator=new ae(this.fboCache,r,e,(e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t}),((e,t,r)=>{const i=this._stage.view.qualitySettings.maximumPixelRatio;e.shadowMap.start(e.camera,t,r,!0,i),this._renderShadowCascades(H.Shadow,e.shadowMap),e.shadowMap.finish(),e.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(e.camera,e.contentCamera)}),n),this._renderContext=new J(this._rctx,this._shadowMap,r),this._nodes=new U(this._renderContext),this._plugins=new F({renderContext:this._renderContext,techniques:r,materials:t,requestRender:n,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this._handles=[d((()=>this._stage.view.state.camera),(()=>n()),_),d((()=>C.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(de.TRANSPARENT):()=>{},n()}),l),d((()=>this._stage.view.environment.background?.color),(e=>{const t=e?i(e):P;E(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()}),_),d((()=>this._stage.view.state.camera.relativeElevation),(e=>this._inGlobeView=(e??1/0)>=L),_),d((()=>this._bindParameters.clouds.fadeFactor),(()=>this._bindParameters.fadeLighting()),p),d((()=>this._bindParameters.clouds.data?.state),(()=>n()),p),d((()=>this._stage.view.state.highlights),(e=>{this._bindParameters.highlights=e,this._updateHighlights(),n()}),l)]}destroy(){this._handles.forEach((e=>e.remove())),this._gpuTimerHandle=s(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.dispose(),this._loadEdgeViewTask=a(this._loadEdgeViewTask),this._edgeView=n(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.fboCache.destroy(),this._plugins.destroy(),this._renderers.clear(),this._blit=null,this._oitblend=null,W.prune(),_e.prune(),R()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _framebufferSize(){return this._framebuffer.size}updateRenderFeatures(e=null,t=!has("disable-feature:high-quality-idle")){this._renderStateFeatures.value=te(t,e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate((i=>i.set(t,e,r))),this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(re.HighQualityTransparency)}get hasReflections(){return this._pluginsHas.water&&(this._ssrEnabled||this.isFeatureEnabled(re.WaterReflection))}get _hasHighlights(){return this._plugins.produces(H.Highlight,se.OPAQUE_MATERIAL,se.TRANSPARENT_MATERIAL,se.DRAPED_MATERIAL,se.HUD_MATERIAL,se.LABEL_MATERIAL)}get _hasHUDHighlights(){return this._plugins.produces(H.Highlight,se.HUD_MATERIAL,se.LABEL_MATERIAL)}get hasSSAO(){return(this._stage.view.qualitySettings.ambientOcclusion||this.isFeatureEnabled(re.SSAO))&&!this._inGlobeView}get hasSMAA(){return this._stage.view.qualitySettings.antialiasingEnabled||this.isFeatureEnabled(re.Antialiasing)}get fullResolutionAtmosphere(){return this._stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(re.HighResolutionAtmosphere)}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=h(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=h(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=h(this._bindParameters.geometryDepth)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.depth=h(this._bindParameters.depth),this._bindParameters.hudVisibility=h(this._bindParameters.hudVisibility)}get updating(){return null!=this._edgeView&&this._edgeView.updating||this._shadowAccumulator.running||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r((async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");o(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this._stage.view.renderSpatialReference,viewingMode:this._stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:xe(this._stage.view.resourceController)});return this._handles.push(d((()=>r.updating),(()=>this._requestRender()),p)),this._requestRender(),this._edgeViewCallbacks.forEach((e=>e(r))),this._edgeViewCallbacks.length=0,r}))),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&c(this._bindParameters.ssr.reprojectionMatrix,b)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),null!=e.environment){null!=e.environment.weather&&(this._bindParameters.weather=e.environment.weather,this._bindParameters.weatherVisible=!!e.weatherVisible);const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slicePlane(e){this._sliceHelper.plane!==e&&(this._sliceHelper.plane=e,this._requestRender())}get plugins(){return this._plugins}getMaterialRenderer(e){return this._renderers.get(e)}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}modify(e,t){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:r,removes:i,updates:s}=e;if(0===r.length&&0===i.length&&0===s.length)return;Z(e).forEach(((r,i)=>{if(t.done)return;let s=this._renderers.get(i);null==s&&r.adds.length>0&&(s=new _e({material:i,highlightOrderMap:this._stage.view.state.highlightOrderMap}),s.initializeRenderContext(this._plugins.context),this._plugins.add(s),this._renderers.set(i,s)),s&&(s.modify(r),0===s.numGeometries&&(this._renderers.delete(s.material),this._plugins.remove(s),s.destroy())),r.removes.forEach((t=>e.removes.removeUnordered(t))),r.adds.forEach((t=>e.adds.removeUnordered(t))),r.updates.forEach((t=>e.updates.removeUnordered(t))),t.madeProgress()})),this.updateHasFlags()}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(H.Color,...Ie),has.water=this._plugins.produces(H.Normal,se.DRAPED_WATER),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new j(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation),null!=e.forcedAnimationTime&&this._animationTimer.forceTime(e.forcedAnimationTime);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations=this.overlay?.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?s(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r=ee.Default,i=!1){try{return this._isRendering=!0,this._render(e,t,r,i)}catch(s){console.error(`Exception during rendering: ${s}`)}finally{this._isRendering=!1}return new le(this._pluginInput.get("final-color"),null)}_render(e,t,r=ee.Default,i){this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r===ee.Default,this._disposeBindBuffers();const s=this._framebuffer,{camera:a,contentCamera:n,mode:o,alignPixelEnabled:d}=e;this._state.value=o,this._bindParameters.overlay=this.overlay?.render(t),this._bindParameters.overlay&&this.performanceInfo.advance(ue.OVERLAY),this._renderContext.time=t,this._bindParameters.oitPass=K.NONE,this._bindParameters.alignPixelEnabled=d,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null,this._bindParameters.viewshedEnabled=this._nodes.produces(S.VIEWSHED);const _=this._nodes.produces("magnifier-color"),l=this._nodes.produces("final-color");this._bindParameters.slicePlane=this._sliceHelper.plane,a.setGLViewport(this._rctx);const p=this._nodes.require("emissive")>0&&this._plugins.hasEmissions,u=p?H.ColorEmission:H.Color,m=s.initialize(a.fullWidth,a.fullHeight,this._backgroundColor,p);this.hasReflections?(m?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=m):m?.release(),this._ensureBindParametersCamera(a,n),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!i;const c=this._highQualityTransparency&&this._hasTransparentTerrain,f=this._plugins.produces(H.Color,...we);this._precompilePrepasses(),this.performanceInfo.advance(ue.PREPARE);const g=this._computeDepthRange(a);this._renderShadowMap(a,this._bindParameters.lighting.mainLight.direction,g),this._ensureBindParametersCamera(a,n),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(g,a,n),this._ensureBindParametersSSR(t),this._precompileShaders(c,f,u),this._renderContext.output=u,s.bind(),this._bindParameters.mainDepth=s.depth.attachment;const b=this.plugins.produces(H.Color,...Se);b&&this._renderOpaqueGeometry(),s.update((e=>this._renderNodes(w.OPAQUE,e,b))),this.fboCache.debugCallback?.("opaque-color",s.color.fbo),s.update((e=>this._renderNodes(S.OPAQUE_ENVIRONMENT,e))),this.fboCache.debugCallback?.(S.OPAQUE_ENVIRONMENT,s.color.fbo),this._renderTerrainDepth(c),this._renderEdges(de.OPAQUE),s.bind(),this._renderPlugins(se.VOXEL,ue.VOXEL),this._renderHiddenTransparentEdges(),f&&(this._oitEnabled?this._renderOIT(Ae.Geometry,u):this._renderTransparentGeometry()),s.update((e=>this._renderNodes(w.TRANSPARENT,e,f))),this.fboCache.debugCallback?.("transparent-color",s.color.fbo),this._renderGeometryDepth(c),this._renderHUDVisibility(),c||this._plugins.render(this._pluginInput,se.LINE_CALLOUTS);const T=r===ee.ObjectAndLayerID?this._renderObjectAndLayerIdColor():null;this._renderEdges(de.TRANSPARENT);const E=this._hasTransparentTerrain?this._renderTransparentTerrain():null;E&&(this.performanceInfo.advance(ue.TRANSPARENT_TERRAIN),this._bindParameters.hudVisibility&&(c?this._renderLineCallouts(M.Occluded):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,E.getTexture())),this._renderHUD(M.Occluded,s.color,u))),this._bindParameters.cullAboveTerrain=!1,E&&(s.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,E.getTexture()),E.release(),c&&(this._renderEdges(de.OPAQUE),f&&(this._oitEnabled?this._renderOIT(Ae.Geometry,u):this._renderTransparentGeometry(),this.performanceInfo.advance(ue.TRANSPARENT)),this._renderEdges(de.TRANSPARENT))),this._bindParameters.ssao=h(this._bindParameters.ssao),c&&this._renderLineCallouts(M.NotOccluded),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment(),this._pluginInput.set("focusArea",this._renderFocusAreaGeometry()),s.update((e=>this._renderNodes(S.TRANSPARENT_ENVIRONMENT,e))),s.update((e=>this._renderNodes(S.VIEWSHED,e))),s.update((e=>this._renderNodes(S.LASERLINES,e))),s.update((e=>this._renderNodes(S.OCCLUDED,e))),this._pluginInput.set("highlights",this._renderHighlightPrepass()),s.update((e=>this._renderNodes(w.COMPOSITE,e)));const A=!(r!==ee.Default||l||_&&!i&&r===ee.Default),P=this._pluginInput.get(w.COMPOSITE),R=A?O:this.fboCache.acquire(P.fbo.width,P.fbo.height,S.ANTIALIASING),C=this._nodes.produces(S.ANTIALIASING)?this._renderNodes(S.ANTIALIASING,R):this._blitFBO(P,R,!1);let I;this._pluginInput.set(S.ANTIALIASING,C),this._hasHUDHighlights?(this._renderHUD(M.NotOccluded,C,u),I=this._renderNodes(S.HIGHLIGHTS,C)):(I=this._renderNodes(S.HIGHLIGHTS,C),this._renderHUD(M.NotOccluded,I,u));const D=this._renderNodes(S.MAGNIFIER,I);return _&&!i&&r===ee.Default&&!l&&this._blitFBO(D),l?(D.attachDepth(s.depth),this._blitFBO(this._renderNodes(w.FINAL,D)),D.detachDepth()):this._pluginInput.set(w.FINAL,D),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),s.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),r!==ee.Default&&(this._releaseFBOs(),this._disposeOffscreenBuffers()),new le(this._pluginInput.get("final-color"),T)}_precompileShaders(e,t,r){if(++this._plugins.context.techniques.precompiling,this._renderContext.output=r,this._precompileOpaqueGeometry(),this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,this._renderContext.output=H.Depth,this._plugins.precompile(se.TRANSPARENT_TERRAIN),e&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=r,this._plugins.precompile(se.TRANSPARENT_TERRAIN),t&&(this._precompileTransparentGeometry(),this._hasTransparentTerrain&&(this._bindParameters.cullAboveTerrain=!1,this._precompileTransparentGeometry(),this._bindParameters.cullAboveTerrain=e)),this._needsHUDVisibility&&this._plugins.precompile(se.OCCLUSION_PIXELS),this._plugins.precompile(se.LINE_CALLOUTS),this._precompileHUD(M.Occluded),this._bindParameters.terrainDepthTest=!1,this._bindParameters.cullAboveTerrain=!1,this._nodes.precompile(S.VIEWSHED,S.LASERLINES,S.OCCLUDED),this._precompileHUD(M.NotOccluded),this._hasHighlights){const e=this._bindParameters;e.highlights.forEach(((t,r)=>{e.highlightLevel=r,this._precompileAllGeometry(H.Highlight)})),e.highlightLevel=null}this._nodes.precompile(w.COMPOSITE,S.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(se.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),--this._plugins.context.techniques.precompiling}_updateHighlights(){const e=this._stage.view.state;this._renderers.forEach((t=>t.updateHighlights(e.highlightOrderMap)))}_renderFocusAreaGeometry(){if(this._nodes.produces("focusArea")){const e=this._framebufferSize;let t=this.fboCache.acquire(e.width,e.height,"focusArea");return t=this._nodes.render(t,this._pluginInput),this.performanceInfo.advance(ue.FOCUS_AREA_MASK),t}return null}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;++this._techniques.precompiling;const e=this._framebufferSize;let t=this.fboCache.acquire(e.width,e.height,"olid");return t.acquireDepth(I.DEPTH_STENCIL_TEXTURE),t=this._nodes.render(t,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(ue.OBJECT_AND_LAYER_ID_COLOR),t}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=e===Q.BACKGROUND;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const s=Math.max(e,i);this._animationTimestep.frame(s,r)}}readMainDepth(e,t){const{mainDepth:r,camera:i}=this._bindParameters;if(!r)return;const s=this.fboCache.acquire(this._framebufferSize.width,this._framebufferSize.height,"linear-depth");this._rctx.bindFramebuffer(s.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(P),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),s.fbo?.readPixels(e[0],e[1],e[2],e[3],ce.RGBA,fe.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,ce.RGBA,fe.UNSIGNED_BYTE,s)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"edges"),s=()=>t.render(this._bindParameters,e),a=this._bindParameters.geometryDepth;this.renderToTargets(s,i,a??this._framebuffer.depth,P),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(e===de.OPAQUE?ue.OPAQUE_EDGES:ue.TRANSPARENT_EDGES)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const i=this._shadowMap;i.start(e,t,r,this.isFeatureEnabled(re.HighResolutionShadows),this._stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(H.ShadowHighlight,this._shadowMap),i.moveSnapshot(he.Highlight),this._renderShadowCascades(H.ShadowExcludeHighlight,this._shadowMap),i.copySnapshot(he.ExcludeHighlight),this._renderShadowCascades(H.ShadowHighlight,this._shadowMap)):this._renderShadowCascades(H.Shadow),i.finish(),e.setGLViewport(this._rctx),this.performanceInfo.advance(ue.SHADOW_MAP)}_precompileShadowCascades(e){for(const t of this._shadowMap.cascades)t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.camera),this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._shadowMap){for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(H.Depth)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._needsShadowAccumulation||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");if(e){const t=this._needsDepth?e.getAttachment(ge):null;t?.retain(),this._pluginInput.set(S.SSAO,this._renderSSAO()),this._renderGeometryWithoutNormalsDepth(t)}else this._renderAllGeometryDepth()}_renderGeometryWithoutNormalsDepth(e){if(!this._needsDepth||!e)return void(this._bindParameters.depth=h(this._bindParameters.depth));const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"depth");r.attachDepth(e),e.release(),this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(be.STENCIL),this._renderGeometryWithoutNormals(H.Depth),h(this._bindParameters.depth),this._bindParameters.depth=r.obtainDepthTexture(),r.release(),this.performanceInfo.advance(ue.DEPTH)}_renderAllGeometryDepth(){if(!this._needsDepth)return void(this._bindParameters.depth=h(this._bindParameters.depth));const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"depth").acquireDepth(I.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(be.DEPTH|be.STENCIL),this.renderAllGeometry(H.Depth),h(this._bindParameters.depth),this._bindParameters.depth=t.obtainDepthTexture(),t.release(),this.performanceInfo.advance(ue.DEPTH)}_renderTerrainDepth(e){if(this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,!e)return void(this._bindParameters.terrainDepth=h(this._bindParameters.terrainDepth));const t=this._renderContext.output;this._renderContext.output=H.Depth;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"terrain depth").acquireDepth(I.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(be.DEPTH|be.STENCIL),this._renderTransparentTerrain(),h(this._bindParameters.terrainDepth),this._bindParameters.terrainDepth=i.obtainDepthTexture(),this._renderContext.output=t,i.release()}_renderGeometryDepth(e){if(!e)return void(this._bindParameters.geometryDepth=h(this._bindParameters.geometryDepth));const t=this._renderContext.output,{width:r,height:i}=this._framebufferSize,s=this.fboCache.acquire(r,i,"geometry depth").acquireDepth(I.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(be.DEPTH|be.STENCIL),this._renderOpaqueAndTransparentGeometry(H.Depth),this._renderContext.output=t,h(this._bindParameters.geometryDepth),this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowAccumulation}_computeDepthRange(e){if(!this._needsDepthRange)return k.zero;const t=z(e,this._plugins.plugins,this._stage.layers);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}get _normalsRequired(){const e=this._nodes.require("normals","final-color",w.COMPOSITE,"opaque-color","transparent-color","laserline-color");return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(H.Normal),this._needsDepth&&this._precompileAllGeometry(H.Depth),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(H.ShadowHighlight),this._precompileShadowCascades(H.ShadowExcludeHighlight),this._precompileShadowCascades(H.ShadowHighlight)):this._precompileShadowCascades(H.Shadow)),this._needsShadowAccumulation&&this._precompileAllGeometry(H.Shadow)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",D.RGBA);r.acquireDepth(I.DEPTH_STENCIL_TEXTURE),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(P,!0,!0),this._renderGeometryWithNormals(H.Normal);const i=this._nodes.optional("normals","final-color",w.COMPOSITE,"opaque-color","transparent-color","viewshed-color");return r.retain(e+i-1),this.performanceInfo.advance(ue.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return void e?.detachDepth();O.setName(S.SSAO);const t=this._nodes.render(O,this._pluginInput);return this._bindParameters.ssao=t,e.detachDepth(),this._pluginInput.release("normals"),this.performanceInfo.advance(ue.SSAO),t}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(se.TRANSPARENT_TERRAIN),this._renderContext.output=t}renderAllGeometry(e){this._renderContext.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentTerrain()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...Ce);this._renderContext.renderOccludedMask=$}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll((e=>{const t=e.acquireTechniques(this._renderContext);t&&(e.render(this._renderContext,t,this._pluginInput),v(t))}))}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>Y.Occlude&&this._plugins.render(this._pluginInput,se.OCCLUDED_TERRAIN),this.renderSlots(e,...Ce),this._renderContext.renderOccludedMask=$}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(this._pluginInput,se.HUD_MATERIAL)}precompileViewshedShadowMap(){this._precompileAllGeometry(H.ViewshedShadow)}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(H.ViewshedShadow),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=i}_renderOpaqueAndTransparentGeometry(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithNormals(e){this._renderContext.output=e,this._plugins.render(this._pluginInput,...Pe),this._renderTransparentTerrain()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(this._pluginInput,...Re)}_precompileOpaqueGeometry(){this._plugins.precompile(...Se)}_renderOpaqueGeometry(){this._plugins.render(this._pluginInput,...Se)}_renderTransparentGeometry(){this._plugins.render(this._pluginInput,...we)}get _hasTransparentTerrain(){return this._plugins.produces(H.Color,se.TRANSPARENT_TERRAIN)}_renderTransparentTerrain(){const e=()=>this._plugins.render(this._pluginInput,se.TRANSPARENT_TERRAIN);if(!x(this._renderContext.output))return void e();const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"transparent terrain");return this.renderToTargets(e,r,this._framebuffer.depth,P),r}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,se.OCCLUSION_PIXELS)}_renderHUDVisibility(){if(!this._needsHUDVisibility)return void(this._bindParameters.hudVisibility=h(this._bindParameters.hudVisibility));const{width:e,height:t}=this._framebufferSize;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",D.RGBA4),this._bindParameters.hudVisibility=r);const i=this._bindParameters.geometryDepth;r.attachDepth(i||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(this._pluginInput,se.OCCLUSION_PIXELS),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(ue.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,e===M.Occluded){const e=()=>this._plugins.render(this._pluginInput,se.LINE_CALLOUTS),t=this._framebufferSize,r=this.fboCache.acquireDepth(I.DEPTH16_BUFFER,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(this._pluginInput,se.LINE_CALLOUTS)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=H.Highlight,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._oitEnabled&&x(this._renderContext.output)?(this._bindParameters.oitPass=K.ColorAlpha,this._plugins.precompile(...Ie),this._bindParameters.oitPass=K.FrontFace,this._plugins.precompile(...Ie),this._bindParameters.oitPass=K.NONE):this._plugins.precompile(...Ie),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t,r){if(this._pluginsHas.hudElements){if(this._oitEnabled){const i=this._renderOIT(Ae.HUD,r,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,i.getTexture()),i.release()}else if(this._renderContext.output=r,e===M.Occluded){const t=()=>this._renderHUDElements(e),r=this._framebufferSize,i=this.fboCache.acquireDepth(I.DEPTH16_BUFFER,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(I.DEPTH16_BUFFER),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(e===M.Occluded?ue.HUD_OCCLUDED:ue.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(this._pluginInput,...Ie)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(H.ShadowHighlight,se.OPAQUE_MATERIAL)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize,s=e.acquire(i.width,i.height,"highlights",D.RG);return s.acquireDepth(I.DEPTH_STENCIL_TEXTURE),t.bindFramebuffer(s.fbo),t.clearFramebuffer(P,!0),this._renderContext.output=H.Highlight,t.bindFramebuffer(s.fbo),q(t,e,i,r,(()=>this._renderHighlightGeometries()),0),this.performanceInfo.advance(ue.HIGHLIGHTS),s}_renderHighlightGeometries(){const e=0===this._bindParameters.highlightLevel?Ne:De;this._plugins.render(this._pluginInput,...e),this._rctx.clear(be.DEPTH),this._renderHUDElements(M.Both)}get _needsShadowAccumulation(){return this._shadowAccumulator.isAccumulating}_renderShadowAccumulation(e,t,r){this._needsShadowAccumulation&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,e,t,r)&&this.performanceInfo.advance(ue.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this._oitEnabled&&x(this._renderContext.output)?(this._bindParameters.oitPass=K.ColorAlpha,this._plugins.precompile(...we),this._bindParameters.oitPass=K.FrontFace,this._plugins.precompile(...we),this._bindParameters.oitPass=K.NONE):this._plugins.precompile(...we)}_renderOIT(e,t,r=M.Both){const i=e===Ae.HUD,s=this._framebufferSize,a=i?this.fboCache.acquire(s.width,s.height,"oit hud composite"):null,n=i?()=>this._renderHUDElements(r):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=this._renderContext.output;this._renderContext.output=t,h.oitPass=K.ColorAlpha;const d=a?"oit hud color alpha":"oit color alpha",_=this.fboCache.acquire(s.width,s.height,d,D.RGBA16F),l=t===H.ColorEmission;_.acquireColor(Te.COLOR_ATTACHMENT1,D.R16F),a||_.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(_.fbo),this._rctx.clearFramebuffer([0,0,0,1]),n(),_.detachDepth(),h.oitPass=K.FrontFace;const p=this.fboCache.acquire(s.width,s.height,a?"oit hud front":"oit front");return a?p.acquireDepth(I.DEPTH16_BUFFER):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(P,!!a),n(),p.detachDepth(),h.oitPass=K.NONE,a?(this._rctx.bindFramebuffer(a.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(be.COLOR)):this._framebuffer.bind(),this._oitblend??=new V(this._techniques),this._oitblend.blend(this._rctx,_,p,h,l),a?.detachDepth(),p.release(),_.release(),this._renderContext.output=o,a}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(ue.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(this._pluginInput,se.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),this.performanceInfo.advance(ue.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(this._pluginInput,e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNormals);return this.performanceInfo.advance(e),i}_blitFBO(e,t=O,r=!0){return this._blit??=new G(this._techniques),this._blit.blit(this._rctx,e,t,this._bindParameters),this._pluginInput.set(e.name,t),r&&e.release(),t}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=b:(f(ye,this._bindParameters.camera.viewMatrix),f(Oe,this._bindParameters.camera.projectionMatrix),g(He,ye,Oe),g(He,this._renderContext.lastFrameCamera.viewMatrix,He),g(He,this._renderContext.lastFrameCamera.projectionMatrix,He),this._reprojectionMatrix=He);const t=this._stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=b,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,i){this._bindParameters.updateLighting(e,t,r,i),this._requestRender(Q.UPDATE)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}renderToTargets(e,t,r,i,s=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(i,s,a),e(),t.detachDepth()}get test(){}}var Ae;e([m({readOnly:!0})],Ee.prototype,"fullResolutionAtmosphere",null),e([m()],Ee.prototype,"_edgeView",void 0),e([m()],Ee.prototype,"updating",null),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(Ae||(Ae={}));const Pe=[se.INTEGRATED_MESH,se.OPAQUE_TERRAIN,se.OPAQUE_MATERIAL,se.TRANSPARENT_MATERIAL],Re=[se.OPAQUE_MATERIAL_WITHOUT_NORMALS,se.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],Se=[se.INTEGRATED_MESH,se.OPAQUE_TERRAIN,se.OPAQUE_MATERIAL,se.OPAQUE_MATERIAL_WITHOUT_NORMALS],we=[se.TRANSPARENT_MATERIAL,se.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],Ce=[se.OPAQUE_MATERIAL,se.TRANSPARENT_MATERIAL,se.TRANSPARENT_MATERIAL_WITHOUT_DEPTH],Ie=[se.LINE_CALLOUTS_HUD_DEPTH,se.HUD_MATERIAL,se.LABEL_MATERIAL],De=[se.TRANSPARENT_MATERIAL,se.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,se.OPAQUE_MATERIAL,se.OPAQUE_MATERIAL_WITHOUT_NORMALS],Ne=[...De,se.TRANSPARENT_TERRAIN,se.INTEGRATED_MESH,se.OPAQUE_TERRAIN],Oe=T(),ye=T(),He=T();function xe(e){return t=>e.immediate.schedule(t)}export{Ee as Renderer};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{unitRGBAFromColor as i}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{removeMaybe as s,abortMaybe as a,destroyMaybe as n,releaseMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as _,initial as l,sync as p}from"../../../../core/reactiveUtils.js";import{signal as u}from"../../../../core/signal.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/interfaces.js";import"../../../../core/accessorSupport/tracking/Flags.js";import"../../../../core/Warning.js";import"../../../../core/Error.js";import{equals as c,invert as g,multiply as f}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as b,create as T}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as A}from"../../../../chunks/vec42.js";import{fromValues as E,ZEROS as P}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as R}from"../../../../geometry/support/Indices.js";import{RenderCategory as S,InternalRenderCategory as I}from"../../webgl.js";import{debugFlags as w}from"../../support/debugFlags.js";import{DepthFormat as C,ColorFormat as D}from"../../webgl/formats.js";import{FBOCache as N,defaultWebGLFBO as O}from"../core/FBOCache.js";import{RenderPassManager as y}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as H,isColorOrColorEmission as x}from"../core/shaderLibrary/ShaderOutput.js";import{HUDRenderStyle as L}from"../core/shaderLibrary/hud/HUDRenderStyle.js";import{distanceFadeEnd as M}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as v}from"../effects/RenderNodes.js";import{releaseTechniques as U}from"../effects/RenderPlugin.js";import{RenderPluginManager as F}from"../effects/RenderPluginManager.js";import{Blit as G}from"../effects/blit/Blit.js";import{renderHighlightBuffer as q}from"../effects/highlight/Highlight.js";import{OITBlend as V}from"../effects/transparency/OITBlend.js";import{AnimationTimer as j}from"./AnimationTimer.js";import{AnimationTimeStep as B}from"./AnimationTimeStep.js";import{RenderRequestType as Q}from"./basicInterfaces.js";import{BoundingInfo as W}from"./BoundingInfo.js";import{DepthRange as k}from"./DepthRange.js";import{depthRangeFromScene as z}from"./depthRangeUtils.js";import{MainFramebuffer as X}from"./MainFramebuffer.js";import{RenderOccludedFlag as Y}from"./Material.js";import{OITPass as K}from"./OITPass.js";import{RenderContext as J,defaultRenderOccludedMask as $}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as Z,RendererTarget as ee}from"./rendererUtils.js";import{setupFeatureDefaults as te,RenderFeature as re}from"./RenderFeature.js";import{RenderPluginInput as ie}from"./RenderPluginInput.js";import{RenderSlot as se}from"./RenderSlot.js";import{ShadowAccumulator as ae}from"./ShadowAccumulator.js";import{ShadowMap as ne,SnapshotSlot as he}from"./ShadowMap.js";import oe from"./SliceHelper.js";import{Transparency as de}from"./edgeRendering/interfaces.js";import{MergedRenderer as _e}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as le}from"../parts/renderUtils.js";import{RendererPerformanceInfo as pe,PerformanceCategory as ue}from"../statistics/RendererPerformanceInfo.js";import{RenderState as me}from"../../../support/RenderState.js";import{PixelFormat as ce,PixelType as ge,DepthStencilAttachment as fe,FramebufferBit as be,ColorAttachment as Te}from"../../../webgl/enums.js";class Ae{constructor(e,t,r,s,a,n){this._stage=e,this._techniques=r,this._rctx=s,this._compositingHelper=a,this._requestRender=n,this._pluginsHas={hudElements:!1,water:!1},this._renderers=new Map,this.renderPassManager=new y,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=E(0,0,0,1),this._sliceHelper=new oe,this._blit=null,this._oitblend=null,this._state=u(me.IDLE),this._highQualityTransparencyEnabled=!0,this._ssrEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new B,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=u(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new ie,this._releaseNormals=e=>{e.some((({name:e})=>"normals"===e))&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this.fboCache=new N(s),this._renderStateFeatures=u(te(!has("disable-feature:high-quality-idle"),e.view.qualityProfile)),this._framebuffer=new X(this.fboCache),this.performanceInfo=new pe(this._rctx),this._shadowMap=new ne(this.fboCache,e.viewingMode),this._shadowAccumulator=new ae(this.fboCache,r,e,(e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t}),((e,t,r)=>{const i=this._stage.view.qualitySettings.maximumPixelRatio;e.shadowMap.start(e.camera,t,r,!0,i),this._renderShadowCascades(H.Shadow,e.shadowMap),e.shadowMap.finish(),e.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(e.camera,e.contentCamera)}),n),this._renderContext=new J(this._rctx,this._shadowMap,r),this._nodes=new v(this._renderContext),this._plugins=new F({renderContext:this._renderContext,techniques:r,materials:t,requestRender:n,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this._handles=[d((()=>this._stage.view.state.camera),(()=>n()),_),d((()=>w.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(de.TRANSPARENT):()=>{},n()}),l),d((()=>this._stage.view.environment.background?.color),(e=>{const t=e?i(e):P;A(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()}),_),d((()=>this._stage.view.state.camera.relativeElevation),(e=>this._inGlobeView=(e??1/0)>=M),_),d((()=>this._bindParameters.clouds.fadeFactor),(()=>this._bindParameters.fadeLighting()),p),d((()=>this._bindParameters.clouds.data?.state),(()=>n()),p),d((()=>this._stage.view.state.highlights),(e=>{this._bindParameters.highlights=e,this._updateHighlights(),n()}),l)]}destroy(){this._handles.forEach((e=>e.remove())),this._gpuTimerHandle=s(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.dispose(),this._loadEdgeViewTask=a(this._loadEdgeViewTask),this._edgeView=n(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.fboCache.destroy(),this._plugins.destroy(),this._renderers.clear(),this._blit=null,this._oitblend=null,W.prune(),_e.prune(),R()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _framebufferSize(){return this._framebuffer.size}updateRenderFeatures(e=null,t=!has("disable-feature:high-quality-idle")){this._renderStateFeatures.value=te(t,e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate((i=>i.set(t,e,r))),this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(re.HighQualityTransparency)}get hasReflections(){return this._pluginsHas.water&&(this._ssrEnabled||this.isFeatureEnabled(re.WaterReflection))}get _hasHighlights(){return this._plugins.produces(H.Highlight,se.OPAQUE_MATERIAL,se.TRANSPARENT_MATERIAL,se.DRAPED_MATERIAL,se.HUD_MATERIAL,se.LABEL_MATERIAL)}get _hasHUDHighlights(){return this._plugins.produces(H.Highlight,se.HUD_MATERIAL,se.LABEL_MATERIAL)}get hasSSAO(){return(this._stage.view.qualitySettings.ambientOcclusion||this.isFeatureEnabled(re.SSAO))&&!this._inGlobeView}get hasSMAA(){return this._stage.view.qualitySettings.antialiasingEnabled||this.isFeatureEnabled(re.Antialiasing)}get fullResolutionAtmosphere(){return this._stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(re.HighResolutionAtmosphere)}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=h(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=h(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=h(this._bindParameters.geometryDepth)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.depth=h(this._bindParameters.depth),this._bindParameters.hudVisibility=h(this._bindParameters.hudVisibility)}get updating(){return null!=this._edgeView&&this._edgeView.updating||this._shadowAccumulator.running||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r((async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");o(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this._stage.view.renderSpatialReference,viewingMode:this._stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:xe(this._stage.view.resourceController)});return this._handles.push(d((()=>r.updating),(()=>this._requestRender()),p)),this._requestRender(),this._edgeViewCallbacks.forEach((e=>e(r))),this._edgeViewCallbacks.length=0,r}))),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&c(this._bindParameters.ssr.reprojectionMatrix,b)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),null!=e.environment){null!=e.environment.weather&&(this._bindParameters.weather=e.environment.weather,this._bindParameters.weatherVisible=!!e.weatherVisible);const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slicePlane(e){this._sliceHelper.plane!==e&&(this._sliceHelper.plane=e,this._requestRender())}get plugins(){return this._plugins}getMaterialRenderer(e){return this._renderers.get(e)}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}modify(e,t){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:r,removes:i,updates:s}=e;if(0===r.length&&0===i.length&&0===s.length)return;Z(e).forEach(((r,i)=>{if(t.done)return;let s=this._renderers.get(i);null==s&&r.adds.length>0&&(s=new _e({material:i,highlightOrderMap:this._stage.view.state.highlightOrderMap}),s.initializeRenderContext(this._plugins.context),this._plugins.add(s),this._renderers.set(i,s)),s&&(s.modify(r),0===s.numGeometries&&(this._renderers.delete(s.material),this._plugins.remove(s),s.destroy())),r.removes.forEach((t=>e.removes.removeUnordered(t))),r.adds.forEach((t=>e.adds.removeUnordered(t))),r.updates.forEach((t=>e.updates.removeUnordered(t))),t.madeProgress()})),this.updateHasFlags()}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(H.Color,...Ce),has.water=this._plugins.produces(H.Normal,se.DRAPED_WATER),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new j(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation),null!=e.forcedAnimationTime&&this._animationTimer.forceTime(e.forcedAnimationTime);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations=this.overlay?.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?s(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r=ee.Default,i=!1){try{return this._isRendering=!0,this._render(e,t,r,i)}catch(s){console.error(`Exception during rendering: ${s}`)}finally{this._isRendering=!1}return new le(this._pluginInput.get(S.FINAL),null)}_render(e,t,r=ee.Default,i){this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r===ee.Default,this._disposeBindBuffers();const s=this._framebuffer,{camera:a,contentCamera:n,mode:o,alignPixelEnabled:d}=e;this._state.value=o,this._bindParameters.overlay=this.overlay?.render(t),this._bindParameters.overlay&&this.performanceInfo.advance(ue.OVERLAY),this._renderContext.time=t,this._bindParameters.oitPass=K.NONE,this._bindParameters.alignPixelEnabled=d,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null,this._bindParameters.viewshedEnabled=this._nodes.produces(I.VIEWSHED);const _=this._nodes.produces("magnifier-color"),l=this._nodes.produces(S.FINAL);this._bindParameters.slicePlane=this._sliceHelper.plane,a.setGLViewport(this._rctx);const p=this._emissiveRequired,u=p?H.ColorEmission:H.Color,m=s.initialize(a.fullWidth,a.fullHeight,this._backgroundColor,p);this.hasReflections?(m?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=m):m?.release(),this._ensureBindParametersCamera(a,n),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!i;const c=this._highQualityTransparency&&this._hasTransparentTerrain,g=this._plugins.produces(H.Color,...Ie);this._precompilePrepasses(),this.performanceInfo.advance(ue.PREPARE);const f=this._computeDepthRange(a);this._renderShadowMap(a,this._bindParameters.lighting.mainLight.direction,f),this._ensureBindParametersCamera(a,n),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(f,a,n),this._ensureBindParametersSSR(t),this._precompileShaders(c,g,u),this._renderContext.output=u,s.bind(),this._bindParameters.mainDepth=s.depth.attachment;const b=this.plugins.produces(H.Color,...Se);b&&this._renderOpaqueGeometry(),s.update((e=>this._renderNodes(S.OPAQUE,e,b))),this.fboCache.debugCallback?.("opaque-color",s.color.fbo),s.update((e=>this._renderNodes(I.OPAQUE_ENVIRONMENT,e))),this.fboCache.debugCallback?.(I.OPAQUE_ENVIRONMENT,s.color.fbo),this._renderTerrainDepth(c),this._renderEdges(de.OPAQUE),s.bind(),this._renderPlugins(se.VOXEL,ue.VOXEL),this._renderHiddenTransparentEdges(),g&&(this._oitEnabled?this._renderOIT(Ee.Geometry,u):this._renderTransparentGeometry()),s.update((e=>this._renderNodes(S.TRANSPARENT,e,g))),this.fboCache.debugCallback?.("transparent-color",s.color.fbo),this._renderGeometryDepth(c),this._renderHUDVisibility(),c||this._plugins.render(this._pluginInput,se.LINE_CALLOUTS);const T=r===ee.ObjectAndLayerID?this._renderObjectAndLayerIdColor():null;this._renderEdges(de.TRANSPARENT);const A=this._hasTransparentTerrain?this._renderTransparentTerrain():null;A&&(this.performanceInfo.advance(ue.TRANSPARENT_TERRAIN),this._bindParameters.hudVisibility&&(c?this._renderLineCallouts(L.Occluded):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,A.getTexture())),this._renderHUD(L.Occluded,s.color,u))),this._bindParameters.cullAboveTerrain=!1,A&&(s.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,A.getTexture()),A.release(),c&&(this._renderEdges(de.OPAQUE),g&&(this._oitEnabled?this._renderOIT(Ee.Geometry,u):this._renderTransparentGeometry(),this.performanceInfo.advance(ue.TRANSPARENT)),this._renderEdges(de.TRANSPARENT))),this._bindParameters.ssao=h(this._bindParameters.ssao),c&&this._renderLineCallouts(L.NotOccluded),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment(),this._pluginInput.set("focusArea",this._renderFocusAreaGeometry()),s.update((e=>this._renderNodes(I.TRANSPARENT_ENVIRONMENT,e))),s.update((e=>this._renderNodes(I.VIEWSHED,e))),s.update((e=>this._renderNodes(I.LASERLINES,e))),s.update((e=>this._renderNodes(I.OCCLUDED,e))),this._pluginInput.set("highlights",this._renderHighlightPrepass()),s.update((e=>this._renderNodes(S.COMPOSITE,e)));const E=!(r!==ee.Default||l||_&&!i&&r===ee.Default),P=this._pluginInput.get(S.COMPOSITE),R=E?O:this.fboCache.acquire(P.fbo.width,P.fbo.height,I.ANTIALIASING),w=this._nodes.produces(I.ANTIALIASING)?this._renderNodes(I.ANTIALIASING,R):this._blitFBO(P,R,!1);let C;this._pluginInput.set(I.ANTIALIASING,w),this._hasHUDHighlights?(this._renderHUD(L.NotOccluded,w,u),C=this._renderNodes(I.HIGHLIGHTS,w)):(C=this._renderNodes(I.HIGHLIGHTS,w),this._renderHUD(L.NotOccluded,C,u));const D=this._renderNodes(I.MAGNIFIER,C);return _&&!i&&r===ee.Default&&!l&&this._blitFBO(D),l?(D.attachDepth(s.depth),this._blitFBO(this._renderNodes(S.FINAL,D)),D.detachDepth()):this._pluginInput.set(S.FINAL,D),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),s.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),r!==ee.Default&&(this._releaseFBOs(),this._disposeOffscreenBuffers()),new le(this._pluginInput.get(S.FINAL),T)}_precompileShaders(e,t,r){if(++this._plugins.context.techniques.precompiling,this._renderContext.output=r,this._precompileOpaqueGeometry(),this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,this._renderContext.output=H.Depth,this._plugins.precompile(se.TRANSPARENT_TERRAIN),e&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=r,this._plugins.precompile(se.TRANSPARENT_TERRAIN),t&&(this._precompileTransparentGeometry(),this._hasTransparentTerrain&&(this._bindParameters.cullAboveTerrain=!1,this._precompileTransparentGeometry(),this._bindParameters.cullAboveTerrain=e)),this._needsHUDVisibility&&this._plugins.precompile(se.OCCLUSION_PIXELS),this._plugins.precompile(se.LINE_CALLOUTS),this._precompileHUD(L.Occluded),this._bindParameters.terrainDepthTest=!1,this._bindParameters.cullAboveTerrain=!1,this._nodes.precompile(I.VIEWSHED,I.LASERLINES,I.OCCLUDED),this._precompileHUD(L.NotOccluded),this._hasHighlights){const e=this._bindParameters;e.highlights.forEach(((t,r)=>{e.highlightLevel=r,this._precompileAllGeometry(H.Highlight)})),e.highlightLevel=null}this._nodes.precompile(S.COMPOSITE,I.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(se.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),--this._plugins.context.techniques.precompiling}_updateHighlights(){const e=this._stage.view.state;this._renderers.forEach((t=>t.updateHighlights(e.highlightOrderMap)))}_renderFocusAreaGeometry(){if(this._nodes.produces("focusArea")){const e=this._framebufferSize;let t=this.fboCache.acquire(e.width,e.height,"focusArea");return t=this._nodes.render(t,this._pluginInput),this.performanceInfo.advance(ue.FOCUS_AREA_MASK),t}return null}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;++this._techniques.precompiling;const e=this._framebufferSize;let t=this.fboCache.acquire(e.width,e.height,"olid");return t.acquireDepth(C.DEPTH_STENCIL_TEXTURE),t=this._nodes.render(t,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(ue.OBJECT_AND_LAYER_ID_COLOR),t}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=e===Q.BACKGROUND;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const s=Math.max(e,i);this._animationTimestep.frame(s,r)}}readMainDepth(e,t){const{mainDepth:r,camera:i}=this._bindParameters;if(!r)return;const s=this.fboCache.acquire(this._framebufferSize.width,this._framebufferSize.height,"linear-depth");this._rctx.bindFramebuffer(s.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(P),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),s.fbo?.readPixels(e[0],e[1],e[2],e[3],ce.RGBA,ge.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,ce.RGBA,ge.UNSIGNED_BYTE,s)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"edges"),s=()=>t.render(this._bindParameters,e),a=this._bindParameters.geometryDepth;this.renderToTargets(s,i,a??this._framebuffer.depth,P),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(e===de.OPAQUE?ue.OPAQUE_EDGES:ue.TRANSPARENT_EDGES)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const i=this._shadowMap;i.start(e,t,r,this.isFeatureEnabled(re.HighResolutionShadows),this._stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(H.ShadowHighlight,this._shadowMap),i.moveSnapshot(he.Highlight),this._renderShadowCascades(H.ShadowExcludeHighlight,this._shadowMap),i.copySnapshot(he.ExcludeHighlight),this._renderShadowCascades(H.ShadowHighlight,this._shadowMap)):this._renderShadowCascades(H.Shadow),i.finish(),e.setGLViewport(this._rctx),this.performanceInfo.advance(ue.SHADOW_MAP)}_precompileShadowCascades(e){for(const t of this._shadowMap.cascades)t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.camera),this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._shadowMap){for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(H.Depth)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._needsShadowAccumulation||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");if(e){const t=this._needsDepth?e.getAttachment(fe):null;t?.retain(),this._pluginInput.set(I.SSAO,this._renderSSAO()),this._renderGeometryWithoutNormalsDepth(t)}else this._renderAllGeometryDepth()}_renderGeometryWithoutNormalsDepth(e){if(!this._needsDepth||!e)return void(this._bindParameters.depth=h(this._bindParameters.depth));const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"depth");r.attachDepth(e),e.release(),this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(be.STENCIL),this._renderGeometryWithoutNormals(H.Depth),h(this._bindParameters.depth),this._bindParameters.depth=r.obtainDepthTexture(),r.release(),this.performanceInfo.advance(ue.DEPTH)}_renderAllGeometryDepth(){if(!this._needsDepth)return void(this._bindParameters.depth=h(this._bindParameters.depth));const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"depth").acquireDepth(C.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(be.DEPTH|be.STENCIL),this.renderAllGeometry(H.Depth),h(this._bindParameters.depth),this._bindParameters.depth=t.obtainDepthTexture(),t.release(),this.performanceInfo.advance(ue.DEPTH)}_renderTerrainDepth(e){if(this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,!e)return void(this._bindParameters.terrainDepth=h(this._bindParameters.terrainDepth));const t=this._renderContext.output;this._renderContext.output=H.Depth;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"terrain depth").acquireDepth(C.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(be.DEPTH|be.STENCIL),this._renderTransparentTerrain(),h(this._bindParameters.terrainDepth),this._bindParameters.terrainDepth=i.obtainDepthTexture(),this._renderContext.output=t,i.release()}_renderGeometryDepth(e){if(!e)return void(this._bindParameters.geometryDepth=h(this._bindParameters.geometryDepth));const t=this._renderContext.output,{width:r,height:i}=this._framebufferSize,s=this.fboCache.acquire(r,i,"geometry depth").acquireDepth(C.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(be.DEPTH|be.STENCIL),this._renderOpaqueAndTransparentGeometry(H.Depth),this._renderContext.output=t,h(this._bindParameters.geometryDepth),this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowAccumulation}_computeDepthRange(e){if(!this._needsDepthRange)return k.zero;const t=z(e,this._plugins.plugins,this._stage.layers);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}get _emissiveRequired(){return this._nodes.require("emissive",S.FINAL,S.COMPOSITE)>0&&this._plugins.hasEmissions}get _normalsRequired(){const e=this._nodes.require("normals",S.FINAL,S.COMPOSITE,"opaque-color","transparent-color","laserline-color");return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(H.Normal),this._needsDepth&&this._precompileAllGeometry(H.Depth),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(H.ShadowHighlight),this._precompileShadowCascades(H.ShadowExcludeHighlight),this._precompileShadowCascades(H.ShadowHighlight)):this._precompileShadowCascades(H.Shadow)),this._needsShadowAccumulation&&this._precompileAllGeometry(H.Shadow)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",D.RGBA);r.acquireDepth(C.DEPTH_STENCIL_TEXTURE),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(P,!0,!0),this._renderGeometryWithNormals(H.Normal);const i=this._nodes.optional("normals",S.FINAL,S.COMPOSITE,"opaque-color","transparent-color","viewshed-color");return r.retain(e+i-1),this.performanceInfo.advance(ue.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return void e?.detachDepth();O.setName(I.SSAO);const t=this._nodes.render(O,this._pluginInput);return this._bindParameters.ssao=t,e.detachDepth(),this._pluginInput.release("normals"),this.performanceInfo.advance(ue.SSAO),t}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(se.TRANSPARENT_TERRAIN),this._renderContext.output=t}renderAllGeometry(e){this._renderContext.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentTerrain()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...we);this._renderContext.renderOccludedMask=$}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll((e=>{const t=e.acquireTechniques(this._renderContext);t&&(e.render(this._renderContext,t,this._pluginInput),U(t))}))}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>Y.Occlude&&this._plugins.render(this._pluginInput,se.OCCLUDED_TERRAIN),this.renderSlots(e,...we),this._renderContext.renderOccludedMask=$}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(this._pluginInput,se.HUD_MATERIAL)}precompileViewshedShadowMap(){this._precompileAllGeometry(H.ViewshedShadow)}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(H.ViewshedShadow),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=i}_renderOpaqueAndTransparentGeometry(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithNormals(e){this._renderContext.output=e,this._plugins.render(this._pluginInput,...Pe),this._renderTransparentTerrain()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(this._pluginInput,...Re)}_precompileOpaqueGeometry(){this._plugins.precompile(...Se)}_renderOpaqueGeometry(){this._plugins.render(this._pluginInput,...Se)}_renderTransparentGeometry(){this._plugins.render(this._pluginInput,...Ie)}get _hasTransparentTerrain(){return this._plugins.produces(H.Color,se.TRANSPARENT_TERRAIN)}_renderTransparentTerrain(){const e=()=>this._plugins.render(this._pluginInput,se.TRANSPARENT_TERRAIN);if(!x(this._renderContext.output))return void e();const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"transparent terrain");return this.renderToTargets(e,r,this._framebuffer.depth,P),r}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,se.OCCLUSION_PIXELS)}_renderHUDVisibility(){if(!this._needsHUDVisibility)return void(this._bindParameters.hudVisibility=h(this._bindParameters.hudVisibility));const{width:e,height:t}=this._framebufferSize;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",D.RGBA4),this._bindParameters.hudVisibility=r);const i=this._bindParameters.geometryDepth;r.attachDepth(i||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(this._pluginInput,se.OCCLUSION_PIXELS),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(ue.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,e===L.Occluded){const e=()=>this._plugins.render(this._pluginInput,se.LINE_CALLOUTS),t=this._framebufferSize,r=this.fboCache.acquireDepth(C.DEPTH16_BUFFER,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(this._pluginInput,se.LINE_CALLOUTS)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=H.Highlight,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._oitEnabled&&x(this._renderContext.output)?(this._bindParameters.oitPass=K.ColorAlpha,this._plugins.precompile(...Ce),this._bindParameters.oitPass=K.FrontFace,this._plugins.precompile(...Ce),this._bindParameters.oitPass=K.NONE):this._plugins.precompile(...Ce),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t,r){if(this._pluginsHas.hudElements){if(this._oitEnabled){const i=this._renderOIT(Ee.HUD,r,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,i.getTexture()),i.release()}else if(this._renderContext.output=r,e===L.Occluded){const t=()=>this._renderHUDElements(e),r=this._framebufferSize,i=this.fboCache.acquireDepth(C.DEPTH16_BUFFER,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(C.DEPTH16_BUFFER),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(e===L.Occluded?ue.HUD_OCCLUDED:ue.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(this._pluginInput,...Ce)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(H.ShadowHighlight,se.OPAQUE_MATERIAL)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize,s=e.acquire(i.width,i.height,"highlights",D.RG);return s.acquireDepth(C.DEPTH_STENCIL_TEXTURE),t.bindFramebuffer(s.fbo),t.clearFramebuffer(P,!0),this._renderContext.output=H.Highlight,t.bindFramebuffer(s.fbo),q(t,e,i,r,(()=>this._renderHighlightGeometries()),0),this.performanceInfo.advance(ue.HIGHLIGHTS),s}_renderHighlightGeometries(){const e=0===this._bindParameters.highlightLevel?Ne:De;this._plugins.render(this._pluginInput,...e),this._rctx.clear(be.DEPTH),this._renderHUDElements(L.Both)}get _needsShadowAccumulation(){return this._shadowAccumulator.isAccumulating}_renderShadowAccumulation(e,t,r){this._needsShadowAccumulation&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,e,t,r)&&this.performanceInfo.advance(ue.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this._oitEnabled&&x(this._renderContext.output)?(this._bindParameters.oitPass=K.ColorAlpha,this._plugins.precompile(...Ie),this._bindParameters.oitPass=K.FrontFace,this._plugins.precompile(...Ie),this._bindParameters.oitPass=K.NONE):this._plugins.precompile(...Ie)}_renderOIT(e,t,r=L.Both){const i=e===Ee.HUD,s=this._framebufferSize,a=i?this.fboCache.acquire(s.width,s.height,"oit hud composite"):null,n=i?()=>this._renderHUDElements(r):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=this._renderContext.output;this._renderContext.output=t,h.oitPass=K.ColorAlpha;const d=a?"oit hud color alpha":"oit color alpha",_=this.fboCache.acquire(s.width,s.height,d,D.RGBA16F),l=t===H.ColorEmission;_.acquireColor(Te.COLOR_ATTACHMENT1,D.R16F),a||_.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(_.fbo),this._rctx.clearFramebuffer([0,0,0,1]),n(),_.detachDepth(),h.oitPass=K.FrontFace;const p=this.fboCache.acquire(s.width,s.height,a?"oit hud front":"oit front");return a?p.acquireDepth(C.DEPTH16_BUFFER):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(P,!!a),n(),p.detachDepth(),h.oitPass=K.NONE,a?(this._rctx.bindFramebuffer(a.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(be.COLOR)):this._framebuffer.bind(),this._oitblend??=new V(this._techniques),this._oitblend.blend(this._rctx,_,p,h,l),a?.detachDepth(),p.release(),_.release(),this._renderContext.output=o,a}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(ue.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(this._pluginInput,se.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),this.performanceInfo.advance(ue.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(this._pluginInput,e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNormals);return this.performanceInfo.advance(e),i}_blitFBO(e,t=O,r=!0){return this._blit??=new G(this._techniques),this._blit.blit(this._rctx,e,t,this._bindParameters),this._pluginInput.set(e.name,t),r&&e.release(),t}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=b:(g(ye,this._bindParameters.camera.viewMatrix),g(Oe,this._bindParameters.camera.projectionMatrix),f(He,ye,Oe),f(He,this._renderContext.lastFrameCamera.viewMatrix,He),f(He,this._renderContext.lastFrameCamera.projectionMatrix,He),this._reprojectionMatrix=He);const t=this._stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=b,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,i){this._bindParameters.updateLighting(e,t,r,i),this._requestRender(Q.UPDATE)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}renderToTargets(e,t,r,i,s=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(i,s,a),e(),t.detachDepth()}get test(){}}var Ee;e([m({readOnly:!0})],Ae.prototype,"fullResolutionAtmosphere",null),e([m()],Ae.prototype,"_edgeView",void 0),e([m()],Ae.prototype,"updating",null),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(Ee||(Ee={}));const Pe=[se.INTEGRATED_MESH,se.OPAQUE_TERRAIN,se.OPAQUE_MATERIAL,se.TRANSPARENT_MATERIAL],Re=[se.OPAQUE_MATERIAL_WITHOUT_NORMALS,se.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],Se=[se.INTEGRATED_MESH,se.OPAQUE_TERRAIN,se.OPAQUE_MATERIAL,se.OPAQUE_MATERIAL_WITHOUT_NORMALS],Ie=[se.TRANSPARENT_MATERIAL,se.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],we=[se.OPAQUE_MATERIAL,se.TRANSPARENT_MATERIAL,se.TRANSPARENT_MATERIAL_WITHOUT_DEPTH],Ce=[se.LINE_CALLOUTS_HUD_DEPTH,se.HUD_MATERIAL,se.LABEL_MATERIAL],De=[se.TRANSPARENT_MATERIAL,se.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,se.OPAQUE_MATERIAL,se.OPAQUE_MATERIAL_WITHOUT_NORMALS],Ne=[...De,se.TRANSPARENT_TERRAIN,se.INTEGRATED_MESH,se.OPAQUE_TERRAIN],Oe=T(),ye=T(),He=T();function xe(e){return t=>e.immediate.schedule(t)}export{Ae as Renderer};