@arcgis/core 4.27.0-next.20230430 → 4.27.0-next.20230501

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={88277:(e,t,r)=>{r.p=self.esriConfig.assetsPath+"/esri/core/workers/"},68773:(e,t,r)=>{"use strict";r.d(t,{default:()=>s}),r(80442);var n=r(78286),o=r(17202);const s={analysisTheme:{accentColor:[255,128,0],textColor:"white"},apiKey:void 0,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:!1,portalUrl:"https://www.arcgis.com",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:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,n.RH)(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.27.0";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}-next.${o.r}/assets`}s.defaultAssetsPath=s.assetsPath}},20102:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(22974),o=r(92604),s=r(58896);class i extends s.Z{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.d9)(t)}catch(e){return"[object]"}})))}}catch(e){throw o.Z.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"},92604:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(68773),o=(r(80442),r(19153));const s={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[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(){const e=this;return{loggedMessages:e._loggedMessages,clearLoggedWarnings:()=>e._loggedMessages.warn.clear()}}static get testSingleton(){return{resetLoggers(e={}){const t=i._loggers;return i._loggers=e,t},set throttlingDisabled(e){i._throttlingDisabled=e}}}static getLogger(e){let t=i._loggers[e];return t||(t=new i({module:e})),t}_log(e,t,...r){if(this._matchLevel(e)){if("always"!==t&&!i._throttlingDisabled){const n=this._argsToKey(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.default.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",this._consoleWriter)}_consoleWriter(e,t,...r){console[e](`[${t}]`,...r)}_matchLevel(e){const t=n.default.log.level||"warn";return s[this._parentWithMember("level",t)]<=s[e]}_argsToKey(...e){return(0,o.hP)(JSON.stringify(e,((e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]")))}static _scheduleTickCounterIncrement(){i._tickCounterScheduled||(i._tickCounterScheduled=!0,Promise.resolve().then((()=>{i._tickCounter++,i._tickCounterScheduled=!1})))}}i._loggers={},i._tickCounter=0,i._tickCounterScheduled=!1,i._throttlingDisabled=!1},58896:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(78286);class o{constructor(e,t,r){this.name=e,this.details=r,this.message=(t&&function(e,t){return e.replace(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,((e,r)=>{if(""===r)return"$";const o=(0,n.hS)(r,t)??"";if(void 0===o)throw new Error(`could not find key "${r}" in template`);return o.toString()}))}(t,r))??""}toString(){return"["+this.name+"]: "+this.message}}},77734:(e,t,r)=>{"use strict";r.d(t,{Z:()=>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},67676:(e,t,r)=>{"use strict";r.d(t,{FY:()=>g,Od:()=>m,SO:()=>f,Vx:()=>s,a9:()=>l,cq:()=>h,e$:()=>p,e5:()=>i,fS:()=>o,pC:()=>y,w6:()=>u,zG:()=>a});var n=r(77734);function o(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 s(e,t){let r=e.length!==t.length;r&&(e.length=t.length);for(let n=0;n<t.length;++n)e[n]!==t[n]&&(e[n]=t[n],r=!0);return r}function i(e,t,r){let n,o;return r?(n=t.filter((t=>!e.some((e=>r(e,t))))),o=e.filter((e=>!t.some((t=>r(t,e)))))):(n=t.filter((t=>!e.includes(t))),o=e.filter((e=>!t.includes(e)))),{added:n,removed:o}}function a(e){return e&&"number"==typeof e.length}const c=!!Array.prototype.fill;function l(e,t){if(c)return new Array(e).fill(t);const r=new Array(e);for(let n=0;n<e;n++)r[n]=t;return r}function u(e,t){void 0===t&&(t=e,e=0);const r=new Array(t-e);for(let n=e;n<t;n++)r[n-e]=n;return r}class f{constructor(){this.last=0}}const d=new f;function h(e,t,r,n){n=n||d;const o=Math.max(0,n.last-10);for(let s=o;s<r;++s)if(e[s]===t)return n.last=s,s;const s=Math.min(o,r);for(let r=0;r<s;++r)if(e[r]===t)return n.last=r,r;return-1}function p(e,t,r,n){const o=r??e.length,s=h(e,t,o,n);if(-1!==s)return e[s]=e[o-1],null==r&&e.pop(),t}const b=new Set;function g(e,t,r=e.length,n=t.length,o,s){if(0===n||0===r)return r;b.clear();for(let e=0;e<n;++e)b.add(t[e]);o=o||d;const i=Math.max(0,o.last-10);for(let t=i;t<r;++t)if(b.has(e[t])&&(s&&s.push(e[t]),b.delete(e[t]),e[t]=e[r-1],--r,--t,0===b.size||0===r))return b.clear(),r;for(let t=0;t<i;++t)if(b.has(e[t])&&(s&&s.push(e[t]),b.delete(e[t]),e[t]=e[r-1],--r,--t,0===b.size||0===r))return b.clear(),r;return b.clear(),r}function m(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}function y(e,t){return null!=e}new n.Z},91460:(e,t,r)=>{"use strict";function n(e){return e&&("function"==typeof e.on||"function"==typeof e.addEventListener)}function o(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("on"in e)return e.on(t,r);if(Array.isArray(t)){const n=t.slice();for(const t of n)e.addEventListener(t,r);return{remove(){for(const t of n)e.removeEventListener(t,r)}}}return e.addEventListener(t,r),{remove(){e.removeEventListener(t,r)}}}function s(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,r);const s=o(e,t,(t=>{s.remove(),r.call(e,t)}));return{remove(){s.remove()}}}r.d(t,{IH:()=>s,on:()=>o,vT:()=>n})},80442:(e,t,r)=>{"use strict";let n;function o(e){return"function"==typeof n[e]?n[e]=n[e](globalThis):n[e]}r.d(t,{Z:()=>o}),n=globalThis.dojoConfig?.has||globalThis.esriConfig?.has?{...globalThis.dojoConfig?.has,...globalThis.esriConfig?.has}:{},o.add=(e,t,r,s)=>((s||void 0===n[e])&&(n[e]=t),r&&o(e)),o.cache=n,o.add("esri-deprecation-warnings",!0),o.add("esri-force-fullscreen-debug",!1),(()=>{o.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(o.add("host-browser",e),o.add("host-node","object"==typeof globalThis.process&&globalThis.process.versions?.node&&globalThis.process.versions.v8),o.add("dom",e),o("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(o.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),o.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),o.add("khtml",r.includes("Konqueror")?n:void 0),o.add("edge",parseFloat(t.split("Edge/")[1])||void 0),o.add("opr",parseFloat(t.split("OPR/")[1])||void 0),o.add("webkit",!o("wp")&&!o("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),o.add("chrome",!o("edge")&&!o("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),o.add("android",!o("wp")&&parseFloat(t.split("Android ")[1])||void 0),o.add("safari",!r.includes("Safari")||o("wp")||o("chrome")||o("android")||o("edge")||o("opr")?void 0:parseFloat(r.split("Version/")[1])),o.add("mac",r.includes("Macintosh")),!o("wp")&&t.match(/(iPhone|iPod|iPad)/)){const e=RegExp.$1.replace(/P/,"p"),r=t.match(/OS ([\d_]+)/)?RegExp.$1:"1",n=parseFloat(r.replace(/_/,".").replace(/_/g,""));o.add(e,n),o.add("ios",n)}o("webkit")||(!t.includes("Gecko")||o("wp")||o("khtml")||o("edge")||o.add("mozilla",n),o("mozilla")&&o.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&&o.add("esri-mobile",t),r&&o.add("esri-iPhone",r),o.add("esri-geolocation",!!navigator.geolocation)}o.add("esri-wasm","WebAssembly"in globalThis),o.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),o.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])))),o.add("esri-atomics","Atomics"in globalThis),o.add("esri-workers","Worker"in globalThis),o.add("web-feat:cache","caches"in globalThis),o.add("esri-workers-arraybuffer-transfer",!o("safari")||Number(o("safari"))>=12),o.add("workers-pool-size",8),o.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),o.add("featurelayer-simplify-payload-size-factors",[1,1,4]),o.add("featurelayer-animation-enabled",!0),o.add("featurelayer-snapshot-enabled",!0),o.add("featurelayer-snapshot-point-min-threshold",8e4),o.add("featurelayer-snapshot-point-max-threshold",4e5),o.add("featurelayer-snapshot-point-coverage",.1),o.add("featurelayer-advanced-symbols",!1),o.add("featurelayer-pbf",!0),o.add("featurelayer-pbf-statistics",!1),o.add("feature-layers-workers",!0),o.add("feature-polyline-generalization-factor",1),o.add("mapview-transitions-duration",200),o.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),o.add("mapserver-pbf-version-support",10.81),o.add("mapservice-popup-identify-max-tolerance",20),o.add("heatmap-allow-raster-fallback",!1),o.add("heatmap-force-raster",!1),o("host-webworker")||o("host-browser")&&(o.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),o.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((()=>{o.add("esri-image-decode",!0,!0,!0)})).catch((()=>{o.add("esri-image-decode",!1,!0,!0)}))}return!1})),o.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})()},22974:(e,t,r)=>{"use strict";r.d(t,{Vo:()=>a,d9:()=>i,fS:()=>h,tZ:()=>c,y7:()=>p,yd:()=>s});var n=r(67676),o=r(1533);function s(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&s(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))return e.clone();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)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const r of Object.getOwnPropertyNames(e)){const n=e[r],o=a(n);if(null!=n&&null==o)return null;t[r]=o}return t}return null}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,o.W0)(e)||(0,o.lq)(e)||(0,o.KZ)(e)||(0,o.z3)(e)||(0,o.Uc)(e)||(0,o.Hx)(e)||(0,o.ZY)(e)||(0,o.xZ)(e)||(0,o.fS)(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.fS)(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))}},70586:(e,t,r)=>{"use strict";function n(e,t){return null!=e?t(e):null}function o(e,t){return s(e,t),e}function s(e,t){if(null==e)throw new Error(t??"value is None")}function i(e){return e?.destroy(),null}function a(e){return e?.dispose(),null}function c(e){return e?.remove(),null}function l(e){return e?.abort(),null}function u(e){return e?.release(),null}function f(e,t,r){return null!=e&&null!=t?null!=r?r(e,t):e.equals(t):e===t}function d(e){return null}function h(e,t){const r=new Array;for(const n of e)r.push(null!=n?t(n):null);return r}function p(e,t){for(const r of e)n(r,t)}function b(e){return e}r.d(t,{Fd:()=>h,IM:()=>l,JR:()=>p,M2:()=>a,O3:()=>s,RY:()=>u,SC:()=>i,_W:()=>f,hw:()=>c,j0:()=>b,s3:()=>o,wN:()=>d,yw:()=>n})},78286:(e,t,r)=>{"use strict";r.d(t,{RB:()=>i,RH:()=>o,hS:()=>s});var n=r(22974);function o(e,t,r=!1){return c(e,t,r)}function s(e,t){if(null!=t)return t[e]||a(e.split("."),!1,t)}function i(e,t,r){const n=e.split("."),o=n.pop(),s=a(n,!0,r);s&&o&&(s[o]=t)}function a(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 c(e,t,r){return t?Object.keys(t).reduce(((e,o)=>{let s=e[o],i=t[o];return s===i?e:void 0===s?(e[o]=(0,n.d9)(i),e):(Array.isArray(i)||Array.isArray(e)?(s=s?Array.isArray(s)?e[o]=s.concat():e[o]=[s]:e[o]=[],i&&(Array.isArray(i)||(i=[i]),r?i.forEach((e=>{s.includes(e)||s.push(e)})):e[o]=i.concat())):i&&"object"==typeof i?e[o]=c(s,i,r):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=i),e)}),e||{}):e}},95330:(e,t,r)=>{"use strict";r.d(t,{e4:()=>_,zE:()=>c,hh:()=>P,Ds:()=>S,as:()=>w,WW:()=>v,R8:()=>y,D_:()=>m,Hc:()=>f,y8:()=>O,fu:()=>p,$F:()=>b,r9:()=>d,k_:()=>l,H9:()=>h,Yn:()=>x,gx:()=>k,Hl:()=>g});const n=(o=globalThis,{setTimeout:(e,t)=>{const r=o.setTimeout(e,t);return{remove:()=>o.clearTimeout(r)}}});var o,s=r(20102),i=r(91460),a=(r(92604),r(70586));function c(e="Aborted"){return new s.Z("AbortError",e)}function l(e,t="Aborted"){if(f(e))throw c(t)}function u(e){return null!=e?"aborted"in e?e:e.signal:e}function f(e){const t=u(e);return null!=t&&t.aborted}function d(e){if(m(e))throw e}function h(e){if(!m(e))throw e}function p(e,t){const r=u(e);if(null!=r){if(!r.aborted)return(0,i.IH)(r,"abort",(()=>t()));t()}}function b(e,t){const r=u(e);if(null!=r)return l(r),(0,i.IH)(r,"abort",(()=>t(c())))}function g(e,t){return null==u(t)?e:new Promise(((r,n)=>{let o=p(t,(()=>n(c())));const s=()=>o=(0,a.hw)(o);e.then(s,s),e.then(r,n)}))}function m(e){return"AbortError"===e?.name}async function y(e){try{return await e}catch(e){if(!m(e))throw e;return}}async function w(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e),r=t.map((t=>e[t])),n=await w(r),o={};return t.map(((e,t)=>o[e]=n[t])),o}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 v(e){return(await w(e)).filter((e=>!!e.value)).map((e=>e.value))}function _(e,t=void 0,r){const n=new AbortController;return p(r,(()=>n.abort())),new Promise(((r,o)=>{let s=setTimeout((()=>{s=0,r(t)}),e);p(n,(()=>{s&&(clearTimeout(s),o(c()))}))}))}function O(e){return e&&"function"==typeof e.then}function k(e){return O(e)?e:Promise.resolve(e)}function S(e,t=-1){let r,n,o,s,i=null;const l=(...u)=>{if(r){n=u,s&&s.reject(c()),s=P();const e=(0,a.j0)(s.promise);if(i){const e=i;i=null,e.abort()}return e}if(o=s||P(),s=null,t>0){const n=new AbortController;r=k(e(...u,n.signal));const o=r;_(t).then((()=>{r===o&&(s?n.abort():i=n)}))}else r=1,r=k(e(...u));const f=()=>{const e=n;n=o=r=i=null,null!=e&&l(...e)},d=r,h=o;return d.then(f,f),d.then(h.resolve,h.reject),(0,a.j0)(h.promise)};return l}function P(){let e,t;const r=new Promise(((r,n)=>{e=r,t=n})),o=t=>{e(t)};return o.resolve=t=>e(t),o.reject=e=>t(e),o.timeout=(e,t)=>n.setTimeout((()=>o.reject(t)),e),o.promise=r,o}async function x(e){await Promise.resolve(),l(e)}},19153:(e,t,r)=>{"use strict";r.d(t,{Cb:()=>l,Qs:()=>a,gx:()=>i,hP:()=>c});var n=r(78286);const o=/\{([^\}]+)\}/g;function s(e){return e??""}function i(e,t){return e.replace(o,"object"==typeof t?(e,r)=>s((0,n.hS)(r,t)):(e,r)=>s(t(r)))}function a(e,t){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,(e=>t&&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}function l(e){return(new DOMParser).parseFromString(e||"","text/html").body.innerText||""}},1533:(e,t,r)=>{"use strict";function n(e){return e instanceof ArrayBuffer}function o(e){return"Int8Array"===e?.constructor?.name}function s(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)}function p(e){return null!=e?h(e)?8*e.length+12:e.byteLength+145:0}r.d(t,{B3:()=>g,DB:()=>b,Hx:()=>l,KZ:()=>i,Op:()=>y,Q7:()=>m,Uc:()=>c,W0:()=>o,Xw:()=>p,ZY:()=>u,eP:()=>n,fS:()=>d,kJ:()=>h,lq:()=>s,xZ:()=>f,z3:()=>a}),r(80442);const b=1024;function g(e){return d(e)||f(e)||l(e)||a(e)||o(e)}function m(e){return d(e)||f(e)}function y(e){return d(e)?179769e303:f(e)?3402823e32:u(e)?4294967295:c(e)?65535:s(e)||i(e)?255:l(e)?2147483647:a(e)?32767:o(e)?127:256}},17452:(e,t,r)=>{"use strict";r.d(t,{$U:()=>ae,AH:()=>Y,B7:()=>C,D6:()=>q,Fv:()=>D,HK:()=>G,Hu:()=>ge,IR:()=>_e,Ie:()=>pe,L:()=>P,Ml:()=>we,P$:()=>K,PF:()=>Z,Qj:()=>he,R9:()=>v,TI:()=>S,YP:()=>Q,Yd:()=>fe,ZN:()=>me,Zo:()=>U,_l:()=>re,b7:()=>E,ed:()=>I,fZ:()=>ve,fl:()=>ye,fw:()=>ne,hF:()=>F,hO:()=>ce,io:()=>oe,jc:()=>V,kl:()=>B,mN:()=>x,oC:()=>se,oh:()=>J,qg:()=>M,rS:()=>X,sJ:()=>te,tD:()=>R,tm:()=>L,u0:()=>T,v_:()=>z,vt:()=>de});var n=r(68773),o=r(67676),s=r(20102),i=r(92604),a=r(70586),c=r(19745);const l=i.Z.getLogger("esri.core.urlUtils"),u=n.default.request,f="esri/config: esriConfig.request.proxyUrl is not set.",d=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,h=/^\s*http:/i,p=/^\s*https:/i,b=/^\s*file:/i,g=/:\d+$/,m=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,y=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),w=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class v{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=(0,a.j0)(this.uri.match(y));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=(0,a.j0)(this.authority.match(w)),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 _={};let O=new v(n.default.applicationUrl);let k=function(){const e=(0,a.j0)(O.path),t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${O.scheme}://${O.host}${null!=O.port?`:${O.port}`:""}${t}`}();const S=()=>O,P=()=>k;function x(e){if(!e)return null;const t={path:null,query:null},r=new v(e),n=e.indexOf("?");return null===r.query?t.path=e:(t.path=e.substring(0,n),t.query=T(r.query)),r.fragment&&(t.hash=r.fragment,null===r.query&&(t.path=t.path.substring(0,t.path.length-(r.fragment.length+1)))),t}function T(e){const t=e.split("&"),r={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let n,o;t<0?(n=decodeURIComponent(e),o=""):(n=decodeURIComponent(e.slice(0,t)),o=decodeURIComponent(e.slice(t+1)));let s=r[n];"string"==typeof s&&(s=r[n]=[s]),Array.isArray(s)?s.push(o):r[n]=o}return r}function j(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}function C(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 o=encodeURIComponent(r)+"=",s=t&&t[r];return s?o+encodeURIComponent(s(n)):Array.isArray(n)?n.map((e=>j(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e))).join("&"):j(n)?o+encodeURIComponent(JSON.stringify(n)):o+encodeURIComponent(n)})).filter((e=>e)).join("&"):""}function E(e=!1){let t,r=u.proxyUrl;if("string"==typeof e){t=ae(e);const n=I(e);n&&(r=n.proxyUrl)}else t=!!e;if(!r)throw l.warn(f),new s.Z("urlutils:proxy-not-set",f);return t&&le()&&(r=ce(r)),x(r)}function M(e){const t=I(e);let r,n;if(t){const e=N(t.proxyUrl);r=e.path,n=e.query?T(e.query):null}if(r){const t=x(e);e=r+"?"+t.path;const o=C({...n,...t.query});o&&(e=`${e}?${o}`)}return e}const A={path:"",query:""};function N(e){const t=e.indexOf("?");return-1!==t?(A.path=e.slice(0,t),A.query=e.slice(t+1)):(A.path=e,A.query=null),A}function $(e){return(e=ue(e=function(e){return e&&"/"===e[e.length-1]?e:`${e}/`}(e=N(e).path),!0)).toLowerCase()}function R(e){const t={proxyUrl:e.proxyUrl,urlPrefix:$(e.urlPrefix)},r=u.proxyRules,n=t.urlPrefix;let o=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;o=e;break}0===t.indexOf(n)&&(o=e+1)}return r.splice(o,0,t),o}function I(e){const t=u.proxyRules,r=$(e);for(let e=0;e<t.length;e++)if(0===r.indexOf(t[e].urlPrefix))return t[e]}function U(e,t){if(!e||!t)return!1;e=W(e),t=W(t);const r=(0,c.a)(e),n=(0,c.a)(t);return null!=r&&null!=n?r.portalHostname===n.portalHostname:null==r&&null==n&&q(e,t,!0)}function L(e,t){return e=W(e),t=W(t),ue(e)===ue(t)}function W(e){const t=(e=D(e)).indexOf("/sharing");return t>0?e.substring(0,t):e.replace(/\/+$/,"")}function J(e){const t=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t),r=u.interceptors;if(r)for(const e of r)if(Array.isArray(e.urls)){if(e.urls.some(t))return e}else if(t(e.urls))return e;return null}function q(e,t,r=!1){if(!e||!t)return!1;const n=be(e),o=be(t);return!(!r&&n.scheme!==o.scheme)&&null!=n.host&&null!=o.host&&n.host.toLowerCase()===o.host.toLowerCase()&&n.port===o.port}function B(e){if("string"==typeof e){if(!Q(e))return!0;e=be(e)}if(q(e,O))return!0;const t=u.trustedServers||[];for(let r=0;r<t.length;r++){const n=H(t[r]);for(let t=0;t<n.length;t++)if(q(e,n[t]))return!0}return!1}function H(e){return _[e]||(ie(e)||se(e)?_[e]=[new v(F(e))]:_[e]=[new v(`http://${e}`),new v(`https://${e}`)]),_[e]}function F(e,t=k,r){return se(e)?r&&r.preserveProtocolRelative?e:"http"===O.scheme&&O.authority===K(e).slice(2)?`http:${e}`:`https:${e}`:ie(e)?e:(0,a.j0)(z("/"===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 Z(e,t=k,r){if(null==e||!Q(e))return e;const n=D(e),o=n.toLowerCase(),s=D(t).toLowerCase().replace(/\/+$/,""),i=r?D(r).toLowerCase().replace(/\/+$/,""):null;if(i&&0!==s.indexOf(i))return e;const a=(e,t,r)=>-1===(r=e.indexOf(t,r))?e.length:r;let c=a(o,"/",o.indexOf("//")+2),l=-1;for(;o.slice(0,c+1)===s.slice(0,c)+"/"&&(l=c+1,c!==o.length);)c=a(o,"/",c+1);if(-1===l)return e;if(i&&l<i.length)return e;e=n.slice(l);const u=s.slice(l-1).replace(/[^/]+/g,"").length;if(u>0)for(let t=0;t<u;t++)e=`../${e}`;else e=`./${e}`;return e}function D(e){return function(e){const t=u.httpsDomains;if(!function(e){return null!=e&&h.test(e)||"http"===O.scheme&&se(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),g.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()&&!I(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=N(e);e=(e=t.path.replace(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=F(e=e.trim()))))}function z(...e){const t=e.filter(o.pC);if(!t||!t.length)return;const r=[];if(Q(t[0])){const e=t[0],n=e.indexOf("//");-1!==n&&(r.push(e.slice(0,n+1)),function(e){return null!=e&&b.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 K(e,t=!1){if(null==e||V(e)||G(e))return null;let r=e.indexOf("://");if(-1===r&&se(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 Q(e){return se(e)||ie(e)}function V(e){return null!=e&&"blob:"===e.slice(0,5)}function G(e){return null!=e&&"data:"===e.slice(0,5)}function Y(e){const t=te(e);if(!t||!t.isBase64)return null;const r=atob(t.data),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n.buffer}function X(e){return btoa(String.fromCharCode.apply(null,e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const ee=/^data:(.*?)(;base64)?,(.*)$/;function te(e){const t=e.match(ee);if(!t)return null;const[,r,n,o]=t;return{mediaType:r,isBase64:!!n,data:o}}function re(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}function ne(e){const t=Y(e);if(!t)return null;const r=te(e);return new Blob([t],{type:r.mediaType})}function oe(e,t){!function(e,t){if(!e)return!1;const r=document.createElement("a");if(!("download"in r))return!1;const n=URL.createObjectURL(e);r.download=t,r.href=n,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}(e,t)}function se(e){return null!=e&&"/"===e[0]&&"/"===e[1]}function ie(e){return null!=e&&d.test(e)}function ae(e){return null!=e&&p.test(e)||"https"===O.scheme&&se(e)}function ce(e){return se(e)?`https:${e}`:e.replace(h,"https:")}function le(){return"https"===O.scheme}function ue(e,t=!1){return se(e)?e.slice(2):(e=e.replace(d,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function fe(e){let t=0;if(Q(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=x(e).path.replace(/\/+$/,""),n=r.substring(r.lastIndexOf("/")+1);if(!t?.length)return n;const o=new RegExp(`.(${t.join("|")})$`,"ig");return n.replace(o,"")}function he(e){return e.replace(/\/+$/,"")}function pe(e,t,r){if(!(t&&r&&e&&Q(e)))return e;const n=e.indexOf("//"),o=e.indexOf("/",n+2),s=e.indexOf(":",n+2),i=Math.min(o<0?e.length:o,s<0?e.length:s);return e.slice(n+2,i).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,n+2)}${r}${e.slice(i)}`}function be(e){return"string"==typeof e?new v(F(e)):(e.scheme||(e.scheme=O.scheme),e)}function ge(e,t){const r=x(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=x(e),o=n.query||{};return o[t]=String(r),`${n.path}?${C(o)}`}function ye(e,t){const r=x(e),n=r.query||{};for(const e in t)n[e]=t[e];const o=C(n);return o?`${r.path}?${o}`:r.path}function we(e){if(null==e)return null;const t=e.match(Oe);return t?t[2]:null}function ve(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 _e(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=/([^.]*)\.([^\/]*)$/},728:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var n=r(40330),o=r(20102),s=r(91460),i=r(70586),a=r(95330);const c={statsWorker:()=>Promise.all([r.e(9255),r.e(1400),r.e(3215),r.e(3847),r.e(6841)]).then(r.bind(r,36841)),geometryEngineWorker:()=>Promise.all([r.e(5837),r.e(8228)]).then(r.bind(r,48227)),CSVSourceWorker:()=>Promise.all([r.e(7126),r.e(4547),r.e(9255),r.e(1534),r.e(1400),r.e(3215),r.e(8732),r.e(3847),r.e(1965),r.e(9372),r.e(142)]).then(r.bind(r,27793)),EdgeProcessingWorker:()=>Promise.all([r.e(6481),r.e(7681),r.e(6314),r.e(9594)]).then(r.bind(r,49594)),ElevationSamplerWorker:()=>Promise.all([r.e(4547),r.e(9255),r.e(1400),r.e(3215),r.e(6481),r.e(6459),r.e(7628)]).then(r.bind(r,61787)),FeatureServiceSnappingSourceWorker:()=>Promise.all([r.e(7126),r.e(4165),r.e(4547),r.e(9255),r.e(1534),r.e(1400),r.e(3215),r.e(4599),r.e(8732),r.e(3847),r.e(1965),r.e(9372),r.e(3660)]).then(r.bind(r,65967)),GeoJSONSourceWorker:()=>Promise.all([r.e(7126),r.e(4547),r.e(9255),r.e(1534),r.e(1400),r.e(3215),r.e(8732),r.e(3847),r.e(1965),r.e(9372),r.e(3594),r.e(7845)]).then(r.bind(r,97845)),LercWorker:()=>r.e(3027).then(r.bind(r,23027)),MemorySourceWorker:()=>Promise.all([r.e(7126),r.e(4547),r.e(9255),r.e(1534),r.e(1400),r.e(3215),r.e(8732),r.e(3847),r.e(1965),r.e(9372),r.e(3594),r.e(639)]).then(r.bind(r,30639)),PBFDecoderWorker:()=>Promise.all([r.e(9255),r.e(1400),r.e(3215),r.e(8732),r.e(1916)]).then(r.bind(r,61916)),Pipeline:()=>Promise.all([r.e(7126),r.e(1223),r.e(4165),r.e(4547),r.e(9255),r.e(1534),r.e(1400),r.e(3215),r.e(4599),r.e(8732),r.e(3847),r.e(1965),r.e(9372),r.e(4325),r.e(1482),r.e(7303)]).then(r.bind(r,16142)),PointCloudWorker:()=>Promise.all([r.e(4547),r.e(9255),r.e(1400),r.e(3215),r.e(4266),r.e(7519)]).then(r.bind(r,90447)),RasterWorker:()=>Promise.all([r.e(4547),r.e(9255),r.e(1400),r.e(3215),r.e(6610),r.e(5604),r.e(2038)]).then(r.bind(r,61576)),SceneLayerSnappingSourceWorker:()=>Promise.all([r.e(9255),r.e(6481),r.e(7681),r.e(6314),r.e(3248)]).then(r.bind(r,73248)),SceneLayerWorker:()=>r.e(1412).then(r.bind(r,31412)),WFSSourceWorker:()=>Promise.all([r.e(7126),r.e(4547),r.e(9255),r.e(1534),r.e(1400),r.e(3215),r.e(8732),r.e(3847),r.e(1965),r.e(9372),r.e(3594),r.e(3230)]).then(r.bind(r,43230)),WorkerTileHandler:()=>Promise.all([r.e(4325),r.e(9805),r.e(4982),r.e(6188)]).then(r.bind(r,56456))};var l=r(94362),u=r(17202);const{CLOSE:f,ABORT:d,INVOKE:h,RESPONSE:p,OPEN_PORT:b,ON:g}=l.MessageType;class m{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===l.MessageType.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 y{static connect(e){const t=new MessageChannel;let r;r="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const n=new y(t.port1,{channel:t,client:r},(()=>null));return"object"==typeof r&&"remoteClient"in r&&(r.remoteClient=n),y.clients.set(n,r),t.port2}static loadWorker(e){const t=c[e];return t?t():Promise.resolve(null)}constructor(e,t,r){this._port=e,this._getNextJob=r,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new m((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:f}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,r){const n=r?.signal,s=r?.transferList;if(!this._port)return Promise.reject(new o.Z("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const c=(0,l.jt)();return new Promise(((r,o)=>{if((0,a.Hc)(n))return this._processWork(),void o((0,a.zE)());const l=(0,a.fu)(n,(()=>{const e=this._outJobs.get(c);e&&(this._outJobs.delete(c),this._processWork(),(0,i.hw)(e.abortHandle),this._post({type:d,jobId:c}),o((0,a.zE)()))})),u={resolve:r,reject:o,abortHandle:l,debugInfo:e};this._outJobs.set(c,u),this._post({type:h,jobId:c,methodName:e,abortable:null!=n},t,s)}))}on(e,t){const r=new MessageChannel;function n(e){t(e.data)}return this._port.postMessage({type:l.MessageType.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),{remove(){r.port1.postMessage({type:l.MessageType.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._getNextJob();if(!e)return;const{methodName:t,data:r,invokeOptions:n,resolver:o}=e;this.invoke(t,r,n).then((e=>o.resolve(e))).catch((e=>o.reject(e)))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{(0,i.hw)(e.abortHandle),e.reject((0,a.zE)(`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))):this._processMessage(e)}_processMessage(e){const t=(0,l.QM)(e);if(t)switch(t.type){case p:this._onResponseMessage(t);break;case h:this._invokeQueue.push(t);break;case d:this._onAbortMessage(t);break;case f:this._onCloseMessage();break;case b:this._onOpenPortMessage(t);break;case g:this._onOnMessage(t)}}_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&&y.clients.get(this)===e&&e.destroy(),y.clients.delete(this),e?.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:o}=e,s=o?new AbortController:null,i=this._inJobs;let c,u=this._client,f=u[t];try{if(!f&&t&&t.includes(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)u=u[e[t]],f=u[e[t+1]]}if("function"!=typeof f)throw new TypeError(`${t} is not a function`);c=f.call(u,n,{client:this,signal:s?s.signal:null})}catch(e){return void this._post({type:p,jobId:r,error:(0,l.AB)(e)})}(0,a.y8)(c)?(i.set(r,{controller:s,promise:c}),c.then((e=>{i.has(r)&&(i.delete(r),this._post({type:p,jobId:r},e))}),(e=>{i.has(r)&&(i.delete(r),(0,a.D_)(e)||this._post({type:p,jobId:r,error:(0,l.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:p,jobId:r},c)}_onOpenPortMessage(e){new y(e.port,{client:this._client},(()=>null))}_onOnMessage(e){const{port:t}=e,r=this._client.on(e.eventType,(e=>{t.postMessage(e)})),n=(0,s.on)(e.port,"message",(e=>{const o=(0,l.QM)(e);o?.type===l.MessageType.CLOSE&&(n.remove(),r.remove(),t.close())}))}_onResponseMessage(e){const{jobId:t,error:r,data:n}=e,s=this._outJobs;if(!s.has(t))return;const a=s.get(t);s.delete(t),this._processWork(),(0,i.hw)(a.abortHandle),r?a.reject(o.Z.fromJSON(JSON.parse(r))):a.resolve(n)}_post(e,t,r){return(0,l.oi)(this._port,e,t,r)}}y.kernelInfo={buildDate:u.r,fullVersion:n.bR,revision:u.$},y.clients=new Map},94362:(e,t,r)=>{"use strict";r.d(t,{AB:()=>a,MessageType:()=>n,QM:()=>l,jt:()=>i,oi:()=>c});var n,o=r(80442);!function(e){e[e.HANDSHAKE=0]="HANDSHAKE",e[e.OPEN=1]="OPEN",e[e.OPENED=2]="OPENED",e[e.RESPONSE=3]="RESPONSE",e[e.INVOKE=4]="INVOKE",e[e.ABORT=5]="ABORT",e[e.CLOSE=6]="CLOSE",e[e.OPEN_PORT=7]="OPEN_PORT",e[e.ON=8]="ON"}(n||(n={}));let s=0;function i(){return s++}function a(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 c(e,t,r,s){if(t.type===n.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==n.INVOKE&&t.type!==n.RESPONSE)return void e.postMessage(t);let i;if(function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(r)?(i=u(r.transferList),t.data=r.result):(i=u(s),t.data=r),i){if((0,o.Z)("ff"))for(const r of i)if("byteLength"in r&&r.byteLength>267386880){const r="Worker call with large ArrayBuffer would crash Firefox";switch(t.type){case n.INVOKE:throw r;case n.RESPONSE:return void c(e,{type:n.RESPONSE,jobId:t.jobId,error:a(r)})}}e.postMessage(t,i)}else e.postMessage(t)}function l(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function u(e){if(!e||!e.length)return null;if((0,o.Z)("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}},40330:(e,t,r)=>{"use strict";r.d(t,{Dp:()=>f,Nv:()=>c,bR:()=>a,i8:()=>i,id:()=>l,qh:()=>u});var n=r(80442),o=r(17452),s=r(17202);const i="4.27";let a=i;a=`4.27.0-next.${s.r}`;const c={async request(e,t){const{default:n}=await r.e(3172).then(r.bind(r,3172)),s=e.options,i=s.responseType;s.signal=t?.signal,s.responseType="native"===i||"native-request-init"===i?"native-request-init":i&&["blob","json","text"].includes(i)&&(0,o.oh)(e.url)?.after?i:"array-buffer";const a=await n(e.url,s),c={data:a.data,httpStatus:a.httpStatus,ssl:a.ssl};switch(a.requestOptions?.responseType){case"native-request-init":return delete c.data.signal,c;case"blob":c.data=await c.data.arrayBuffer();break;case"json":c.data=(new TextEncoder).encode(JSON.stringify(c.data)).buffer;break;case"text":c.data=(new TextEncoder).encode(c.data).buffer}return{result:c,transferList:[c.data]}}};let l;function u(e){l=e}function f(e){const t=l?.findCredential(e);return t?.token?(0,o.ZN)(e,"token",t.token):e}(0,n.Z)("host-webworker")},19745:(e,t,r)=>{"use strict";r.d(t,{P:()=>i,a:()=>s});const n=/^https:\/\/([a-z\d-]+)(\.maps([^.]*))?\.arcgis\.com/i,o={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 s(e){const t=e?.match(n);if(!t)return null;const[,r,s,i]=t;if(!r)return null;let a=null,c=null,l=null;const{devext:u,qaext:f,www:d}=o;if(s)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)}},17202:(e,t,r)=>{"use strict";r.d(t,{$:()=>o,r:()=>n});const n="20230430",o="668a9336b0160b727a2d4dc1e61779782e9c727b"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.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/"+{24:"af905cda88053394013e",81:"fc07f6e103d7f69a9909",142:"3dace5994b2ba0e89637",163:"3dc2658836cc7733da61",223:"c1114660f60af1920969",237:"3bfcf5759217b5685c3a",247:"a9f83bbccf3b5f229262",450:"92862a36f4d84e16e8de",540:"fcec1e27531633cfc99c",565:"f5b6d2b8c8a333bbebdc",576:"c5c56b6d99db96a6755a",632:"6412be94b716e8ec5dc1",639:"efb96aefe979a0f5c632",723:"1b733719e205fc4b0d35",739:"74882423dac664e4b2cc",819:"d1ead6e8aa7e8e21fbc6",837:"78a76867e78b426a7717",908:"085e9a46ee3a8a1a5e20",911:"1cf75e69a71e273d26a4",1073:"d0d9dcf9a06762087f08",1074:"fa059d94d5051ded85b3",1158:"803e81ff317e3082ebd5",1194:"3f0a97b6072a15f1dd05",1223:"ff30e2230de91e2e7f70",1227:"2014f2cf5f4cb070f59c",1400:"670a08616a7a3f3e2000",1412:"21ddfbc8243b8a097d5b",1421:"93e17ab3bc56ceea928d",1423:"9c1b2f82877ff79969f5",1433:"4d5bdf18feeb9c8cb6ff",1444:"9a9cb6e7212ab18f0586",1482:"56a343f7dbac311917d2",1534:"fa169378e2352266f2e7",1537:"5f476dbaa2c314037f8a",1790:"a8f094ca487bd794f766",1916:"2640204c4655aa535ccb",1965:"bad3549ded35929ac863",2038:"8e2a73194de3c7b9cbd1",2134:"c9e10bb18e8e9147ce63",2156:"8cf07f77d1ca555310cf",2462:"5193317f52aec830f80b",2651:"65976ebffe10de33f875",2664:"cc102c8571da3756bc1b",2763:"d2d96fc03939b0628399",2855:"33a814bbdc0ee50330de",3027:"293315442f5afe8069dc",3172:"2611eb82cf4f18b794a7",3215:"17268cffc901b38838e2",3230:"33125f2080faf74cccdb",3248:"3a3c10cce4be0c57951b",3381:"5f3899efbb967c6e8422",3529:"bbbdb82e3902389fb8ac",3594:"0f52e49eb552fbd8cec0",3660:"07ca4bb8507c293f1316",3668:"46090b69e9161bc05141",3847:"25fc1850a0e4f5c3e6f8",3852:"f0c62bb406bb93b1408a",3974:"6adb58f1bffc5d1c03bd",3992:"b68f207f29808c1d8eb4",4165:"a6ece91e6b3343f133a0",4166:"4593074fa99693133908",4266:"88fdd288ef799a7ac48a",4286:"1e7a877c4437e0700cdb",4325:"e7e7f6046cf1286365ca",4358:"4a2a0091cd830b6a1729",4371:"bedb5d399dbeff7526ba",4475:"cf7676fdc09ad4835680",4499:"2acf79a7011348764684",4547:"69242c66492717c7388c",4599:"812cba53143565a825f1",4609:"308f3811dfa71f619279",4695:"9eebe182ec56486beacb",4720:"89431e2019d20a04ed4f",4828:"9af7179bcbdcfb3c3a6e",4982:"740dc67038f554431f1b",5004:"f952a504b076c71e10ae",5115:"2b68a68e045dfe4d0719",5159:"80c95f43f982eab0e2ae",5235:"a7ce02c50d0c42b90007",5329:"0e21e5b4d065567a6a91",5334:"80bf6cf1bef17215bca4",5428:"afe206c2d48e99d0de3f",5481:"bf5ad7627991f4d46b83",5546:"3125061c8dfd69e1ae3b",5587:"6047bdaf4855506f8fdb",5590:"50f929d9453fb058cf47",5604:"d9290ecbbaac23db6922",5642:"d6b6bb8aecc85d2a3f6b",5653:"0ffbf37be42f0bdb21c9",5660:"1216e939d363f96b6cc6",5732:"83f7e22a12d90ef93e62",5837:"277a477446d6644aada6",5853:"6eae9babd221195f0d85",5935:"60a08ce29d09cb07ef06",6188:"9ee0671827bf221acbb7",6233:"766f397dfdfbc0eb72d1",6237:"8a7fa4e8b0d14da7c9eb",6261:"ef141014ed21a7fd1ff3",6314:"e8db7303b2f63c0ec0c9",6368:"a58343ad9f2c88c2ebbf",6459:"52d02021e858820bc4fa",6481:"f6c39edd04cb96d98240",6502:"49e5e6e459843f3db235",6565:"2a1a5a1969e80a10dcca",6584:"4f8a09b61267e5e26712",6610:"166d74ecd1e269c5a2bb",6695:"0d805fd9cd9ff3a636ca",6710:"6053a78aef54b4a5b172",6748:"c727d38f71e52bee17e1",6774:"0f04978e8342d9a35e59",6841:"8f027f5a1f4438cb2b3c",6935:"6f44e537fd307a0f60bf",7126:"e0499f45b098450b80b4",7202:"ef3baacc7f96ff05ab17",7277:"2b533c9cdfef77be371f",7303:"1f202e82ac0970e6b8c8",7316:"8cf33863b778a6312ed4",7374:"4c175664eb97689d66b0",7391:"869bb7cf9a70b64f598e",7476:"3590f268d451f58de679",7483:"6267f0327a5f02d323dc",7519:"a9dc5d6bdfa2d5a50b01",7628:"0bac1f62ac4b77549687",7681:"808206f87b9f0ab13bf7",7697:"6642286348c668e0fdaa",7845:"945015f35ab7d2d55d2d",7873:"c4eb3bd0e9cba4b20510",8008:"cdf6c503f87be165ecac",8024:"78af07e8ef8bb691b838",8062:"797c4f8b31a62d49a6b6",8079:"39c0b0279d170197c127",8092:"f1b26b73101210b8f29c",8096:"0eb26c0191d624b9a128",8153:"d5c8119d6d34628d3126",8228:"e5352dc8983d06d4ee0f",8244:"47bf38d910e71ac39bb8",8510:"d610a89ea9b1c19520a7",8598:"c97dd52fb06a8bf62b6f",8636:"2691a53125d7855ec0ee",8732:"eb3cbfe51627f89c347f",8758:"61a843d4b8382d763d23",8828:"d244e50c981146f018d2",8865:"8f5474355f44ad0bb9ad",9037:"5c64fd3bf057a1a5527f",9157:"d399b1b9cbf0737d1735",9169:"cfad34c949cbe8a31ef8",9238:"aa5dc08b2eaec43de5aa",9243:"6c519c5a474f51f37af0",9255:"9db6306f32e9adae6e71",9291:"514346a7831c08ec7c1e",9296:"34695a176f0074b3fd18",9372:"6718ebca33c3d0e1f285",9393:"a50d1ef8d9e8d1623ff1",9594:"1535423349f7eee694bc",9675:"477a69e55ce6f7111ae7",9771:"a4a78fcd76113e9a73fd",9790:"6ce95929a21586d8b6c0",9805:"d0ff496834686dbfe29f",9880:"38ebd270e6ffa60791bb",9884:"8cc8d88e5dd1e586eb04",9904:"e8df43c1af128522b2e0",9942:"46ed1a1b3b98959ad7d6",9971:"7231f2c2f138996aa022"}[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&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&!e;)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={134: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[o,s,i]=t;for(var a in s)r.o(s,a)&&(r.m[a]=s[a]);for(i&&i(r);o.length;)e[o.pop()]=1;n(t)}})(),r(88277);var n=r(728);RemoteClient=n})();
1
+ var RemoteClient;(()=>{var e={88277:(e,t,r)=>{r.p=self.esriConfig.assetsPath+"/esri/core/workers/"},68773:(e,t,r)=>{"use strict";r.d(t,{default:()=>s}),r(80442);var n=r(78286),o=r(17202);const s={analysisTheme:{accentColor:[255,128,0],textColor:"white"},apiKey:void 0,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:!1,portalUrl:"https://www.arcgis.com",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:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,n.RH)(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.27.0";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}-next.${o.r}/assets`}s.defaultAssetsPath=s.assetsPath}},20102:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(22974),o=r(92604),s=r(58896);class i extends s.Z{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.d9)(t)}catch(e){return"[object]"}})))}}catch(e){throw o.Z.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"},92604:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(68773),o=(r(80442),r(19153));const s={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[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(){const e=this;return{loggedMessages:e._loggedMessages,clearLoggedWarnings:()=>e._loggedMessages.warn.clear()}}static get testSingleton(){return{resetLoggers(e={}){const t=i._loggers;return i._loggers=e,t},set throttlingDisabled(e){i._throttlingDisabled=e}}}static getLogger(e){let t=i._loggers[e];return t||(t=new i({module:e})),t}_log(e,t,...r){if(this._matchLevel(e)){if("always"!==t&&!i._throttlingDisabled){const n=this._argsToKey(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.default.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",this._consoleWriter)}_consoleWriter(e,t,...r){console[e](`[${t}]`,...r)}_matchLevel(e){const t=n.default.log.level||"warn";return s[this._parentWithMember("level",t)]<=s[e]}_argsToKey(...e){return(0,o.hP)(JSON.stringify(e,((e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]")))}static _scheduleTickCounterIncrement(){i._tickCounterScheduled||(i._tickCounterScheduled=!0,Promise.resolve().then((()=>{i._tickCounter++,i._tickCounterScheduled=!1})))}}i._loggers={},i._tickCounter=0,i._tickCounterScheduled=!1,i._throttlingDisabled=!1},58896:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(78286);class o{constructor(e,t,r){this.name=e,this.details=r,this.message=(t&&function(e,t){return e.replace(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,((e,r)=>{if(""===r)return"$";const o=(0,n.hS)(r,t)??"";if(void 0===o)throw new Error(`could not find key "${r}" in template`);return o.toString()}))}(t,r))??""}toString(){return"["+this.name+"]: "+this.message}}},77734:(e,t,r)=>{"use strict";r.d(t,{Z:()=>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},67676:(e,t,r)=>{"use strict";r.d(t,{FY:()=>g,Od:()=>m,SO:()=>f,Vx:()=>s,a9:()=>l,cq:()=>h,e$:()=>p,e5:()=>i,fS:()=>o,pC:()=>y,w6:()=>u,zG:()=>a});var n=r(77734);function o(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 s(e,t){let r=e.length!==t.length;r&&(e.length=t.length);for(let n=0;n<t.length;++n)e[n]!==t[n]&&(e[n]=t[n],r=!0);return r}function i(e,t,r){let n,o;return r?(n=t.filter((t=>!e.some((e=>r(e,t))))),o=e.filter((e=>!t.some((t=>r(t,e)))))):(n=t.filter((t=>!e.includes(t))),o=e.filter((e=>!t.includes(e)))),{added:n,removed:o}}function a(e){return e&&"number"==typeof e.length}const c=!!Array.prototype.fill;function l(e,t){if(c)return new Array(e).fill(t);const r=new Array(e);for(let n=0;n<e;n++)r[n]=t;return r}function u(e,t){void 0===t&&(t=e,e=0);const r=new Array(t-e);for(let n=e;n<t;n++)r[n-e]=n;return r}class f{constructor(){this.last=0}}const d=new f;function h(e,t,r,n){n=n||d;const o=Math.max(0,n.last-10);for(let s=o;s<r;++s)if(e[s]===t)return n.last=s,s;const s=Math.min(o,r);for(let r=0;r<s;++r)if(e[r]===t)return n.last=r,r;return-1}function p(e,t,r,n){const o=r??e.length,s=h(e,t,o,n);if(-1!==s)return e[s]=e[o-1],null==r&&e.pop(),t}const b=new Set;function g(e,t,r=e.length,n=t.length,o,s){if(0===n||0===r)return r;b.clear();for(let e=0;e<n;++e)b.add(t[e]);o=o||d;const i=Math.max(0,o.last-10);for(let t=i;t<r;++t)if(b.has(e[t])&&(s&&s.push(e[t]),b.delete(e[t]),e[t]=e[r-1],--r,--t,0===b.size||0===r))return b.clear(),r;for(let t=0;t<i;++t)if(b.has(e[t])&&(s&&s.push(e[t]),b.delete(e[t]),e[t]=e[r-1],--r,--t,0===b.size||0===r))return b.clear(),r;return b.clear(),r}function m(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}function y(e,t){return null!=e}new n.Z},91460:(e,t,r)=>{"use strict";function n(e){return e&&("function"==typeof e.on||"function"==typeof e.addEventListener)}function o(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("on"in e)return e.on(t,r);if(Array.isArray(t)){const n=t.slice();for(const t of n)e.addEventListener(t,r);return{remove(){for(const t of n)e.removeEventListener(t,r)}}}return e.addEventListener(t,r),{remove(){e.removeEventListener(t,r)}}}function s(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,r);const s=o(e,t,(t=>{s.remove(),r.call(e,t)}));return{remove(){s.remove()}}}r.d(t,{IH:()=>s,on:()=>o,vT:()=>n})},80442:(e,t,r)=>{"use strict";let n;function o(e){return"function"==typeof n[e]?n[e]=n[e](globalThis):n[e]}r.d(t,{Z:()=>o}),n=globalThis.dojoConfig?.has||globalThis.esriConfig?.has?{...globalThis.dojoConfig?.has,...globalThis.esriConfig?.has}:{},o.add=(e,t,r,s)=>((s||void 0===n[e])&&(n[e]=t),r&&o(e)),o.cache=n,o.add("esri-deprecation-warnings",!0),o.add("esri-force-fullscreen-debug",!1),(()=>{o.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(o.add("host-browser",e),o.add("host-node","object"==typeof globalThis.process&&globalThis.process.versions?.node&&globalThis.process.versions.v8),o.add("dom",e),o("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(o.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),o.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),o.add("khtml",r.includes("Konqueror")?n:void 0),o.add("edge",parseFloat(t.split("Edge/")[1])||void 0),o.add("opr",parseFloat(t.split("OPR/")[1])||void 0),o.add("webkit",!o("wp")&&!o("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),o.add("chrome",!o("edge")&&!o("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),o.add("android",!o("wp")&&parseFloat(t.split("Android ")[1])||void 0),o.add("safari",!r.includes("Safari")||o("wp")||o("chrome")||o("android")||o("edge")||o("opr")?void 0:parseFloat(r.split("Version/")[1])),o.add("mac",r.includes("Macintosh")),!o("wp")&&t.match(/(iPhone|iPod|iPad)/)){const e=RegExp.$1.replace(/P/,"p"),r=t.match(/OS ([\d_]+)/)?RegExp.$1:"1",n=parseFloat(r.replace(/_/,".").replace(/_/g,""));o.add(e,n),o.add("ios",n)}o("webkit")||(!t.includes("Gecko")||o("wp")||o("khtml")||o("edge")||o.add("mozilla",n),o("mozilla")&&o.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&&o.add("esri-mobile",t),r&&o.add("esri-iPhone",r),o.add("esri-geolocation",!!navigator.geolocation)}o.add("esri-wasm","WebAssembly"in globalThis),o.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),o.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])))),o.add("esri-atomics","Atomics"in globalThis),o.add("esri-workers","Worker"in globalThis),o.add("web-feat:cache","caches"in globalThis),o.add("esri-workers-arraybuffer-transfer",!o("safari")||Number(o("safari"))>=12),o.add("workers-pool-size",8),o.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),o.add("featurelayer-simplify-payload-size-factors",[1,1,4]),o.add("featurelayer-animation-enabled",!0),o.add("featurelayer-snapshot-enabled",!0),o.add("featurelayer-snapshot-point-min-threshold",8e4),o.add("featurelayer-snapshot-point-max-threshold",4e5),o.add("featurelayer-snapshot-point-coverage",.1),o.add("featurelayer-advanced-symbols",!1),o.add("featurelayer-pbf",!0),o.add("featurelayer-pbf-statistics",!1),o.add("feature-layers-workers",!0),o.add("feature-polyline-generalization-factor",1),o.add("mapview-transitions-duration",200),o.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),o.add("mapserver-pbf-version-support",10.81),o.add("mapservice-popup-identify-max-tolerance",20),o.add("heatmap-allow-raster-fallback",!1),o.add("heatmap-force-raster",!1),o("host-webworker")||o("host-browser")&&(o.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),o.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((()=>{o.add("esri-image-decode",!0,!0,!0)})).catch((()=>{o.add("esri-image-decode",!1,!0,!0)}))}return!1})),o.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})()},22974:(e,t,r)=>{"use strict";r.d(t,{Vo:()=>a,d9:()=>i,fS:()=>h,tZ:()=>c,y7:()=>p,yd:()=>s});var n=r(67676),o=r(1533);function s(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&s(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))return e.clone();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)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const r of Object.getOwnPropertyNames(e)){const n=e[r],o=a(n);if(null!=n&&null==o)return null;t[r]=o}return t}return null}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,o.W0)(e)||(0,o.lq)(e)||(0,o.KZ)(e)||(0,o.z3)(e)||(0,o.Uc)(e)||(0,o.Hx)(e)||(0,o.ZY)(e)||(0,o.xZ)(e)||(0,o.fS)(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.fS)(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))}},70586:(e,t,r)=>{"use strict";function n(e,t){return null!=e?t(e):null}function o(e,t){return s(e,t),e}function s(e,t){if(null==e)throw new Error(t??"value is None")}function i(e){return e?.destroy(),null}function a(e){return e?.dispose(),null}function c(e){return e?.remove(),null}function l(e){return e?.abort(),null}function u(e){return e?.release(),null}function f(e,t,r){return null!=e&&null!=t?null!=r?r(e,t):e.equals(t):e===t}function d(e){return null}function h(e,t){const r=new Array;for(const n of e)r.push(null!=n?t(n):null);return r}function p(e,t){for(const r of e)n(r,t)}function b(e){return e}r.d(t,{Fd:()=>h,IM:()=>l,JR:()=>p,M2:()=>a,O3:()=>s,RY:()=>u,SC:()=>i,_W:()=>f,hw:()=>c,j0:()=>b,s3:()=>o,wN:()=>d,yw:()=>n})},78286:(e,t,r)=>{"use strict";r.d(t,{RB:()=>i,RH:()=>o,hS:()=>s});var n=r(22974);function o(e,t,r=!1){return c(e,t,r)}function s(e,t){if(null!=t)return t[e]||a(e.split("."),!1,t)}function i(e,t,r){const n=e.split("."),o=n.pop(),s=a(n,!0,r);s&&o&&(s[o]=t)}function a(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 c(e,t,r){return t?Object.keys(t).reduce(((e,o)=>{let s=e[o],i=t[o];return s===i?e:void 0===s?(e[o]=(0,n.d9)(i),e):(Array.isArray(i)||Array.isArray(e)?(s=s?Array.isArray(s)?e[o]=s.concat():e[o]=[s]:e[o]=[],i&&(Array.isArray(i)||(i=[i]),r?i.forEach((e=>{s.includes(e)||s.push(e)})):e[o]=i.concat())):i&&"object"==typeof i?e[o]=c(s,i,r):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=i),e)}),e||{}):e}},95330:(e,t,r)=>{"use strict";r.d(t,{e4:()=>_,zE:()=>c,hh:()=>P,Ds:()=>S,as:()=>w,WW:()=>v,R8:()=>y,D_:()=>m,Hc:()=>f,y8:()=>O,fu:()=>p,$F:()=>b,r9:()=>d,k_:()=>l,H9:()=>h,Yn:()=>x,gx:()=>k,Hl:()=>g});const n=(o=globalThis,{setTimeout:(e,t)=>{const r=o.setTimeout(e,t);return{remove:()=>o.clearTimeout(r)}}});var o,s=r(20102),i=r(91460),a=(r(92604),r(70586));function c(e="Aborted"){return new s.Z("AbortError",e)}function l(e,t="Aborted"){if(f(e))throw c(t)}function u(e){return null!=e?"aborted"in e?e:e.signal:e}function f(e){const t=u(e);return null!=t&&t.aborted}function d(e){if(m(e))throw e}function h(e){if(!m(e))throw e}function p(e,t){const r=u(e);if(null!=r){if(!r.aborted)return(0,i.IH)(r,"abort",(()=>t()));t()}}function b(e,t){const r=u(e);if(null!=r)return l(r),(0,i.IH)(r,"abort",(()=>t(c())))}function g(e,t){return null==u(t)?e:new Promise(((r,n)=>{let o=p(t,(()=>n(c())));const s=()=>o=(0,a.hw)(o);e.then(s,s),e.then(r,n)}))}function m(e){return"AbortError"===e?.name}async function y(e){try{return await e}catch(e){if(!m(e))throw e;return}}async function w(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e),r=t.map((t=>e[t])),n=await w(r),o={};return t.map(((e,t)=>o[e]=n[t])),o}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 v(e){return(await w(e)).filter((e=>!!e.value)).map((e=>e.value))}function _(e,t=void 0,r){const n=new AbortController;return p(r,(()=>n.abort())),new Promise(((r,o)=>{let s=setTimeout((()=>{s=0,r(t)}),e);p(n,(()=>{s&&(clearTimeout(s),o(c()))}))}))}function O(e){return e&&"function"==typeof e.then}function k(e){return O(e)?e:Promise.resolve(e)}function S(e,t=-1){let r,n,o,s,i=null;const l=(...u)=>{if(r){n=u,s&&s.reject(c()),s=P();const e=(0,a.j0)(s.promise);if(i){const e=i;i=null,e.abort()}return e}if(o=s||P(),s=null,t>0){const n=new AbortController;r=k(e(...u,n.signal));const o=r;_(t).then((()=>{r===o&&(s?n.abort():i=n)}))}else r=1,r=k(e(...u));const f=()=>{const e=n;n=o=r=i=null,null!=e&&l(...e)},d=r,h=o;return d.then(f,f),d.then(h.resolve,h.reject),(0,a.j0)(h.promise)};return l}function P(){let e,t;const r=new Promise(((r,n)=>{e=r,t=n})),o=t=>{e(t)};return o.resolve=t=>e(t),o.reject=e=>t(e),o.timeout=(e,t)=>n.setTimeout((()=>o.reject(t)),e),o.promise=r,o}async function x(e){await Promise.resolve(),l(e)}},19153:(e,t,r)=>{"use strict";r.d(t,{Cb:()=>l,Qs:()=>a,gx:()=>i,hP:()=>c});var n=r(78286);const o=/\{([^\}]+)\}/g;function s(e){return e??""}function i(e,t){return e.replace(o,"object"==typeof t?(e,r)=>s((0,n.hS)(r,t)):(e,r)=>s(t(r)))}function a(e,t){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,(e=>t&&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}function l(e){return(new DOMParser).parseFromString(e||"","text/html").body.innerText||""}},1533:(e,t,r)=>{"use strict";function n(e){return e instanceof ArrayBuffer}function o(e){return"Int8Array"===e?.constructor?.name}function s(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)}function p(e){return null!=e?h(e)?8*e.length+12:e.byteLength+145:0}r.d(t,{B3:()=>g,DB:()=>b,Hx:()=>l,KZ:()=>i,Op:()=>y,Q7:()=>m,Uc:()=>c,W0:()=>o,Xw:()=>p,ZY:()=>u,eP:()=>n,fS:()=>d,kJ:()=>h,lq:()=>s,xZ:()=>f,z3:()=>a}),r(80442);const b=1024;function g(e){return d(e)||f(e)||l(e)||a(e)||o(e)}function m(e){return d(e)||f(e)}function y(e){return d(e)?179769e303:f(e)?3402823e32:u(e)?4294967295:c(e)?65535:s(e)||i(e)?255:l(e)?2147483647:a(e)?32767:o(e)?127:256}},17452:(e,t,r)=>{"use strict";r.d(t,{$U:()=>ae,AH:()=>Y,B7:()=>C,D6:()=>q,Fv:()=>D,HK:()=>G,Hu:()=>ge,IR:()=>_e,Ie:()=>pe,L:()=>P,Ml:()=>we,P$:()=>K,PF:()=>Z,Qj:()=>he,R9:()=>v,TI:()=>S,YP:()=>Q,Yd:()=>fe,ZN:()=>me,Zo:()=>U,_l:()=>re,b7:()=>E,ed:()=>I,fZ:()=>ve,fl:()=>ye,fw:()=>ne,hF:()=>F,hO:()=>ce,io:()=>oe,jc:()=>V,kl:()=>B,mN:()=>x,oC:()=>se,oh:()=>J,qg:()=>M,rS:()=>X,sJ:()=>te,tD:()=>R,tm:()=>L,u0:()=>T,v_:()=>z,vt:()=>de});var n=r(68773),o=r(67676),s=r(20102),i=r(92604),a=r(70586),c=r(19745);const l=i.Z.getLogger("esri.core.urlUtils"),u=n.default.request,f="esri/config: esriConfig.request.proxyUrl is not set.",d=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,h=/^\s*http:/i,p=/^\s*https:/i,b=/^\s*file:/i,g=/:\d+$/,m=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,y=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),w=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class v{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=(0,a.j0)(this.uri.match(y));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=(0,a.j0)(this.authority.match(w)),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 _={};let O=new v(n.default.applicationUrl);let k=function(){const e=(0,a.j0)(O.path),t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${O.scheme}://${O.host}${null!=O.port?`:${O.port}`:""}${t}`}();const S=()=>O,P=()=>k;function x(e){if(!e)return null;const t={path:null,query:null},r=new v(e),n=e.indexOf("?");return null===r.query?t.path=e:(t.path=e.substring(0,n),t.query=T(r.query)),r.fragment&&(t.hash=r.fragment,null===r.query&&(t.path=t.path.substring(0,t.path.length-(r.fragment.length+1)))),t}function T(e){const t=e.split("&"),r={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let n,o;t<0?(n=decodeURIComponent(e),o=""):(n=decodeURIComponent(e.slice(0,t)),o=decodeURIComponent(e.slice(t+1)));let s=r[n];"string"==typeof s&&(s=r[n]=[s]),Array.isArray(s)?s.push(o):r[n]=o}return r}function j(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}function C(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 o=encodeURIComponent(r)+"=",s=t&&t[r];return s?o+encodeURIComponent(s(n)):Array.isArray(n)?n.map((e=>j(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e))).join("&"):j(n)?o+encodeURIComponent(JSON.stringify(n)):o+encodeURIComponent(n)})).filter((e=>e)).join("&"):""}function E(e=!1){let t,r=u.proxyUrl;if("string"==typeof e){t=ae(e);const n=I(e);n&&(r=n.proxyUrl)}else t=!!e;if(!r)throw l.warn(f),new s.Z("urlutils:proxy-not-set",f);return t&&le()&&(r=ce(r)),x(r)}function M(e){const t=I(e);let r,n;if(t){const e=N(t.proxyUrl);r=e.path,n=e.query?T(e.query):null}if(r){const t=x(e);e=r+"?"+t.path;const o=C({...n,...t.query});o&&(e=`${e}?${o}`)}return e}const A={path:"",query:""};function N(e){const t=e.indexOf("?");return-1!==t?(A.path=e.slice(0,t),A.query=e.slice(t+1)):(A.path=e,A.query=null),A}function $(e){return(e=ue(e=function(e){return e&&"/"===e[e.length-1]?e:`${e}/`}(e=N(e).path),!0)).toLowerCase()}function R(e){const t={proxyUrl:e.proxyUrl,urlPrefix:$(e.urlPrefix)},r=u.proxyRules,n=t.urlPrefix;let o=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;o=e;break}0===t.indexOf(n)&&(o=e+1)}return r.splice(o,0,t),o}function I(e){const t=u.proxyRules,r=$(e);for(let e=0;e<t.length;e++)if(0===r.indexOf(t[e].urlPrefix))return t[e]}function U(e,t){if(!e||!t)return!1;e=W(e),t=W(t);const r=(0,c.a)(e),n=(0,c.a)(t);return null!=r&&null!=n?r.portalHostname===n.portalHostname:null==r&&null==n&&q(e,t,!0)}function L(e,t){return e=W(e),t=W(t),ue(e)===ue(t)}function W(e){const t=(e=D(e)).indexOf("/sharing");return t>0?e.substring(0,t):e.replace(/\/+$/,"")}function J(e){const t=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t),r=u.interceptors;if(r)for(const e of r)if(Array.isArray(e.urls)){if(e.urls.some(t))return e}else if(t(e.urls))return e;return null}function q(e,t,r=!1){if(!e||!t)return!1;const n=be(e),o=be(t);return!(!r&&n.scheme!==o.scheme)&&null!=n.host&&null!=o.host&&n.host.toLowerCase()===o.host.toLowerCase()&&n.port===o.port}function B(e){if("string"==typeof e){if(!Q(e))return!0;e=be(e)}if(q(e,O))return!0;const t=u.trustedServers||[];for(let r=0;r<t.length;r++){const n=H(t[r]);for(let t=0;t<n.length;t++)if(q(e,n[t]))return!0}return!1}function H(e){return _[e]||(ie(e)||se(e)?_[e]=[new v(F(e))]:_[e]=[new v(`http://${e}`),new v(`https://${e}`)]),_[e]}function F(e,t=k,r){return se(e)?r&&r.preserveProtocolRelative?e:"http"===O.scheme&&O.authority===K(e).slice(2)?`http:${e}`:`https:${e}`:ie(e)?e:(0,a.j0)(z("/"===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 Z(e,t=k,r){if(null==e||!Q(e))return e;const n=D(e),o=n.toLowerCase(),s=D(t).toLowerCase().replace(/\/+$/,""),i=r?D(r).toLowerCase().replace(/\/+$/,""):null;if(i&&0!==s.indexOf(i))return e;const a=(e,t,r)=>-1===(r=e.indexOf(t,r))?e.length:r;let c=a(o,"/",o.indexOf("//")+2),l=-1;for(;o.slice(0,c+1)===s.slice(0,c)+"/"&&(l=c+1,c!==o.length);)c=a(o,"/",c+1);if(-1===l)return e;if(i&&l<i.length)return e;e=n.slice(l);const u=s.slice(l-1).replace(/[^/]+/g,"").length;if(u>0)for(let t=0;t<u;t++)e=`../${e}`;else e=`./${e}`;return e}function D(e){return function(e){const t=u.httpsDomains;if(!function(e){return null!=e&&h.test(e)||"http"===O.scheme&&se(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),g.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()&&!I(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=N(e);e=(e=t.path.replace(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=F(e=e.trim()))))}function z(...e){const t=e.filter(o.pC);if(!t||!t.length)return;const r=[];if(Q(t[0])){const e=t[0],n=e.indexOf("//");-1!==n&&(r.push(e.slice(0,n+1)),function(e){return null!=e&&b.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 K(e,t=!1){if(null==e||V(e)||G(e))return null;let r=e.indexOf("://");if(-1===r&&se(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 Q(e){return se(e)||ie(e)}function V(e){return null!=e&&"blob:"===e.slice(0,5)}function G(e){return null!=e&&"data:"===e.slice(0,5)}function Y(e){const t=te(e);if(!t||!t.isBase64)return null;const r=atob(t.data),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n.buffer}function X(e){return btoa(String.fromCharCode.apply(null,e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const ee=/^data:(.*?)(;base64)?,(.*)$/;function te(e){const t=e.match(ee);if(!t)return null;const[,r,n,o]=t;return{mediaType:r,isBase64:!!n,data:o}}function re(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}function ne(e){const t=Y(e);if(!t)return null;const r=te(e);return new Blob([t],{type:r.mediaType})}function oe(e,t){!function(e,t){if(!e)return!1;const r=document.createElement("a");if(!("download"in r))return!1;const n=URL.createObjectURL(e);r.download=t,r.href=n,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}(e,t)}function se(e){return null!=e&&"/"===e[0]&&"/"===e[1]}function ie(e){return null!=e&&d.test(e)}function ae(e){return null!=e&&p.test(e)||"https"===O.scheme&&se(e)}function ce(e){return se(e)?`https:${e}`:e.replace(h,"https:")}function le(){return"https"===O.scheme}function ue(e,t=!1){return se(e)?e.slice(2):(e=e.replace(d,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function fe(e){let t=0;if(Q(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=x(e).path.replace(/\/+$/,""),n=r.substring(r.lastIndexOf("/")+1);if(!t?.length)return n;const o=new RegExp(`.(${t.join("|")})$`,"ig");return n.replace(o,"")}function he(e){return e.replace(/\/+$/,"")}function pe(e,t,r){if(!(t&&r&&e&&Q(e)))return e;const n=e.indexOf("//"),o=e.indexOf("/",n+2),s=e.indexOf(":",n+2),i=Math.min(o<0?e.length:o,s<0?e.length:s);return e.slice(n+2,i).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,n+2)}${r}${e.slice(i)}`}function be(e){return"string"==typeof e?new v(F(e)):(e.scheme||(e.scheme=O.scheme),e)}function ge(e,t){const r=x(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=x(e),o=n.query||{};return o[t]=String(r),`${n.path}?${C(o)}`}function ye(e,t){const r=x(e),n=r.query||{};for(const e in t)n[e]=t[e];const o=C(n);return o?`${r.path}?${o}`:r.path}function we(e){if(null==e)return null;const t=e.match(Oe);return t?t[2]:null}function ve(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 _e(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=/([^.]*)\.([^\/]*)$/},728:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var n=r(40330),o=r(20102),s=r(91460),i=r(70586),a=r(95330);const c={statsWorker:()=>Promise.all([r.e(9255),r.e(1400),r.e(3215),r.e(3847),r.e(6841)]).then(r.bind(r,36841)),geometryEngineWorker:()=>Promise.all([r.e(5837),r.e(8228)]).then(r.bind(r,48227)),CSVSourceWorker:()=>Promise.all([r.e(7126),r.e(4547),r.e(9255),r.e(1534),r.e(1400),r.e(3215),r.e(8732),r.e(3847),r.e(1965),r.e(9372),r.e(142)]).then(r.bind(r,27793)),EdgeProcessingWorker:()=>Promise.all([r.e(6481),r.e(7681),r.e(6314),r.e(9594)]).then(r.bind(r,49594)),ElevationSamplerWorker:()=>Promise.all([r.e(4547),r.e(9255),r.e(1400),r.e(3215),r.e(6481),r.e(6459),r.e(7628)]).then(r.bind(r,61787)),FeatureServiceSnappingSourceWorker:()=>Promise.all([r.e(7126),r.e(4165),r.e(4547),r.e(9255),r.e(1534),r.e(1400),r.e(3215),r.e(4599),r.e(8732),r.e(3847),r.e(1965),r.e(9372),r.e(3660)]).then(r.bind(r,65967)),GeoJSONSourceWorker:()=>Promise.all([r.e(7126),r.e(4547),r.e(9255),r.e(1534),r.e(1400),r.e(3215),r.e(8732),r.e(3847),r.e(1965),r.e(9372),r.e(3594),r.e(7845)]).then(r.bind(r,97845)),LercWorker:()=>r.e(3027).then(r.bind(r,23027)),MemorySourceWorker:()=>Promise.all([r.e(7126),r.e(4547),r.e(9255),r.e(1534),r.e(1400),r.e(3215),r.e(8732),r.e(3847),r.e(1965),r.e(9372),r.e(3594),r.e(639)]).then(r.bind(r,30639)),PBFDecoderWorker:()=>Promise.all([r.e(9255),r.e(1400),r.e(3215),r.e(8732),r.e(1916)]).then(r.bind(r,61916)),Pipeline:()=>Promise.all([r.e(7126),r.e(1223),r.e(4165),r.e(4547),r.e(9255),r.e(1534),r.e(1400),r.e(3215),r.e(4599),r.e(8732),r.e(3847),r.e(1965),r.e(9372),r.e(4325),r.e(1482),r.e(7303)]).then(r.bind(r,16142)),PointCloudWorker:()=>Promise.all([r.e(4547),r.e(9255),r.e(1400),r.e(3215),r.e(4266),r.e(7519)]).then(r.bind(r,90447)),RasterWorker:()=>Promise.all([r.e(4547),r.e(9255),r.e(1400),r.e(3215),r.e(6610),r.e(5604),r.e(2038)]).then(r.bind(r,61576)),SceneLayerSnappingSourceWorker:()=>Promise.all([r.e(9255),r.e(6481),r.e(7681),r.e(6314),r.e(3248)]).then(r.bind(r,73248)),SceneLayerWorker:()=>r.e(1412).then(r.bind(r,31412)),WFSSourceWorker:()=>Promise.all([r.e(7126),r.e(4547),r.e(9255),r.e(1534),r.e(1400),r.e(3215),r.e(8732),r.e(3847),r.e(1965),r.e(9372),r.e(3594),r.e(3230)]).then(r.bind(r,43230)),WorkerTileHandler:()=>Promise.all([r.e(4325),r.e(9805),r.e(4982),r.e(6188)]).then(r.bind(r,56456))};var l=r(94362),u=r(17202);const{CLOSE:f,ABORT:d,INVOKE:h,RESPONSE:p,OPEN_PORT:b,ON:g}=l.MessageType;class m{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===l.MessageType.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 y{static connect(e){const t=new MessageChannel;let r;r="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const n=new y(t.port1,{channel:t,client:r},(()=>null));return"object"==typeof r&&"remoteClient"in r&&(r.remoteClient=n),y.clients.set(n,r),t.port2}static loadWorker(e){const t=c[e];return t?t():Promise.resolve(null)}constructor(e,t,r){this._port=e,this._getNextJob=r,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new m((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:f}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,r){const n=r?.signal,s=r?.transferList;if(!this._port)return Promise.reject(new o.Z("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const c=(0,l.jt)();return new Promise(((r,o)=>{if((0,a.Hc)(n))return this._processWork(),void o((0,a.zE)());const l=(0,a.fu)(n,(()=>{const e=this._outJobs.get(c);e&&(this._outJobs.delete(c),this._processWork(),(0,i.hw)(e.abortHandle),this._post({type:d,jobId:c}),o((0,a.zE)()))})),u={resolve:r,reject:o,abortHandle:l,debugInfo:e};this._outJobs.set(c,u),this._post({type:h,jobId:c,methodName:e,abortable:null!=n},t,s)}))}on(e,t){const r=new MessageChannel;function n(e){t(e.data)}return this._port.postMessage({type:l.MessageType.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),{remove(){r.port1.postMessage({type:l.MessageType.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._getNextJob();if(!e)return;const{methodName:t,data:r,invokeOptions:n,resolver:o}=e;this.invoke(t,r,n).then((e=>o.resolve(e))).catch((e=>o.reject(e)))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{(0,i.hw)(e.abortHandle),e.reject((0,a.zE)(`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))):this._processMessage(e)}_processMessage(e){const t=(0,l.QM)(e);if(t)switch(t.type){case p:this._onResponseMessage(t);break;case h:this._invokeQueue.push(t);break;case d:this._onAbortMessage(t);break;case f:this._onCloseMessage();break;case b:this._onOpenPortMessage(t);break;case g:this._onOnMessage(t)}}_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&&y.clients.get(this)===e&&e.destroy(),y.clients.delete(this),e?.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:o}=e,s=o?new AbortController:null,i=this._inJobs;let c,u=this._client,f=u[t];try{if(!f&&t&&t.includes(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)u=u[e[t]],f=u[e[t+1]]}if("function"!=typeof f)throw new TypeError(`${t} is not a function`);c=f.call(u,n,{client:this,signal:s?s.signal:null})}catch(e){return void this._post({type:p,jobId:r,error:(0,l.AB)(e)})}(0,a.y8)(c)?(i.set(r,{controller:s,promise:c}),c.then((e=>{i.has(r)&&(i.delete(r),this._post({type:p,jobId:r},e))}),(e=>{i.has(r)&&(i.delete(r),(0,a.D_)(e)||this._post({type:p,jobId:r,error:(0,l.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:p,jobId:r},c)}_onOpenPortMessage(e){new y(e.port,{client:this._client},(()=>null))}_onOnMessage(e){const{port:t}=e,r=this._client.on(e.eventType,(e=>{t.postMessage(e)})),n=(0,s.on)(e.port,"message",(e=>{const o=(0,l.QM)(e);o?.type===l.MessageType.CLOSE&&(n.remove(),r.remove(),t.close())}))}_onResponseMessage(e){const{jobId:t,error:r,data:n}=e,s=this._outJobs;if(!s.has(t))return;const a=s.get(t);s.delete(t),this._processWork(),(0,i.hw)(a.abortHandle),r?a.reject(o.Z.fromJSON(JSON.parse(r))):a.resolve(n)}_post(e,t,r){return(0,l.oi)(this._port,e,t,r)}}y.kernelInfo={buildDate:u.r,fullVersion:n.bR,revision:u.$},y.clients=new Map},94362:(e,t,r)=>{"use strict";r.d(t,{AB:()=>a,MessageType:()=>n,QM:()=>l,jt:()=>i,oi:()=>c});var n,o=r(80442);!function(e){e[e.HANDSHAKE=0]="HANDSHAKE",e[e.OPEN=1]="OPEN",e[e.OPENED=2]="OPENED",e[e.RESPONSE=3]="RESPONSE",e[e.INVOKE=4]="INVOKE",e[e.ABORT=5]="ABORT",e[e.CLOSE=6]="CLOSE",e[e.OPEN_PORT=7]="OPEN_PORT",e[e.ON=8]="ON"}(n||(n={}));let s=0;function i(){return s++}function a(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 c(e,t,r,s){if(t.type===n.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==n.INVOKE&&t.type!==n.RESPONSE)return void e.postMessage(t);let i;if(function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(r)?(i=u(r.transferList),t.data=r.result):(i=u(s),t.data=r),i){if((0,o.Z)("ff"))for(const r of i)if("byteLength"in r&&r.byteLength>267386880){const r="Worker call with large ArrayBuffer would crash Firefox";switch(t.type){case n.INVOKE:throw r;case n.RESPONSE:return void c(e,{type:n.RESPONSE,jobId:t.jobId,error:a(r)})}}e.postMessage(t,i)}else e.postMessage(t)}function l(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function u(e){if(!e||!e.length)return null;if((0,o.Z)("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}},40330:(e,t,r)=>{"use strict";r.d(t,{Dp:()=>f,Nv:()=>c,bR:()=>a,i8:()=>i,id:()=>l,qh:()=>u});var n=r(80442),o=r(17452),s=r(17202);const i="4.27";let a=i;a=`4.27.0-next.${s.r}`;const c={async request(e,t){const{default:n}=await r.e(3172).then(r.bind(r,3172)),s=e.options,i=s.responseType;s.signal=t?.signal,s.responseType="native"===i||"native-request-init"===i?"native-request-init":i&&["blob","json","text"].includes(i)&&(0,o.oh)(e.url)?.after?i:"array-buffer";const a=await n(e.url,s),c={data:a.data,httpStatus:a.httpStatus,ssl:a.ssl};switch(a.requestOptions?.responseType){case"native-request-init":return delete c.data.signal,c;case"blob":c.data=await c.data.arrayBuffer();break;case"json":c.data=(new TextEncoder).encode(JSON.stringify(c.data)).buffer;break;case"text":c.data=(new TextEncoder).encode(c.data).buffer}return{result:c,transferList:[c.data]}}};let l;function u(e){l=e}function f(e){const t=l?.findCredential(e);return t?.token?(0,o.ZN)(e,"token",t.token):e}(0,n.Z)("host-webworker")},19745:(e,t,r)=>{"use strict";r.d(t,{P:()=>i,a:()=>s});const n=/^https:\/\/([a-z\d-]+)(\.maps([^.]*))?\.arcgis\.com/i,o={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 s(e){const t=e?.match(n);if(!t)return null;const[,r,s,i]=t;if(!r)return null;let a=null,c=null,l=null;const{devext:u,qaext:f,www:d}=o;if(s)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)}},17202:(e,t,r)=>{"use strict";r.d(t,{$:()=>o,r:()=>n});const n="20230501",o="2d6ce8487c47144e9928e502d45693f5c4881625"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.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/"+{24:"af905cda88053394013e",81:"fc07f6e103d7f69a9909",142:"3dace5994b2ba0e89637",163:"3dc2658836cc7733da61",223:"c1114660f60af1920969",237:"3bfcf5759217b5685c3a",247:"a9f83bbccf3b5f229262",450:"92862a36f4d84e16e8de",540:"fcec1e27531633cfc99c",565:"f5b6d2b8c8a333bbebdc",576:"c5c56b6d99db96a6755a",632:"6412be94b716e8ec5dc1",639:"efb96aefe979a0f5c632",723:"1b733719e205fc4b0d35",739:"74882423dac664e4b2cc",819:"d1ead6e8aa7e8e21fbc6",837:"78a76867e78b426a7717",908:"085e9a46ee3a8a1a5e20",911:"1cf75e69a71e273d26a4",1073:"d0d9dcf9a06762087f08",1074:"fa059d94d5051ded85b3",1158:"803e81ff317e3082ebd5",1194:"3f0a97b6072a15f1dd05",1223:"ff30e2230de91e2e7f70",1227:"2014f2cf5f4cb070f59c",1400:"670a08616a7a3f3e2000",1412:"21ddfbc8243b8a097d5b",1421:"93e17ab3bc56ceea928d",1423:"9c1b2f82877ff79969f5",1433:"4d5bdf18feeb9c8cb6ff",1444:"9a9cb6e7212ab18f0586",1482:"56a343f7dbac311917d2",1534:"fa169378e2352266f2e7",1537:"5f476dbaa2c314037f8a",1790:"a8f094ca487bd794f766",1916:"2640204c4655aa535ccb",1965:"bad3549ded35929ac863",2038:"8e2a73194de3c7b9cbd1",2134:"c9e10bb18e8e9147ce63",2156:"8cf07f77d1ca555310cf",2462:"5193317f52aec830f80b",2651:"65976ebffe10de33f875",2664:"cc102c8571da3756bc1b",2763:"d2d96fc03939b0628399",2855:"33a814bbdc0ee50330de",3027:"293315442f5afe8069dc",3172:"2611eb82cf4f18b794a7",3215:"17268cffc901b38838e2",3230:"33125f2080faf74cccdb",3248:"3a3c10cce4be0c57951b",3381:"5f3899efbb967c6e8422",3529:"bbbdb82e3902389fb8ac",3594:"0f52e49eb552fbd8cec0",3660:"07ca4bb8507c293f1316",3668:"46090b69e9161bc05141",3847:"25fc1850a0e4f5c3e6f8",3852:"f0c62bb406bb93b1408a",3974:"6adb58f1bffc5d1c03bd",3992:"b68f207f29808c1d8eb4",4165:"a6ece91e6b3343f133a0",4166:"4593074fa99693133908",4266:"88fdd288ef799a7ac48a",4286:"1e7a877c4437e0700cdb",4325:"e7e7f6046cf1286365ca",4358:"4a2a0091cd830b6a1729",4371:"bedb5d399dbeff7526ba",4475:"cf7676fdc09ad4835680",4499:"2acf79a7011348764684",4547:"69242c66492717c7388c",4599:"812cba53143565a825f1",4609:"308f3811dfa71f619279",4695:"9eebe182ec56486beacb",4720:"89431e2019d20a04ed4f",4828:"9af7179bcbdcfb3c3a6e",4982:"740dc67038f554431f1b",5004:"f952a504b076c71e10ae",5115:"2b68a68e045dfe4d0719",5159:"80c95f43f982eab0e2ae",5235:"a7ce02c50d0c42b90007",5329:"0e21e5b4d065567a6a91",5334:"80bf6cf1bef17215bca4",5428:"afe206c2d48e99d0de3f",5481:"bf5ad7627991f4d46b83",5546:"3125061c8dfd69e1ae3b",5587:"6047bdaf4855506f8fdb",5590:"50f929d9453fb058cf47",5604:"d9290ecbbaac23db6922",5642:"d6b6bb8aecc85d2a3f6b",5653:"0ffbf37be42f0bdb21c9",5660:"1216e939d363f96b6cc6",5732:"83f7e22a12d90ef93e62",5837:"277a477446d6644aada6",5853:"6eae9babd221195f0d85",5935:"60a08ce29d09cb07ef06",6188:"9ee0671827bf221acbb7",6233:"766f397dfdfbc0eb72d1",6237:"8a7fa4e8b0d14da7c9eb",6261:"ef141014ed21a7fd1ff3",6314:"e8db7303b2f63c0ec0c9",6368:"a58343ad9f2c88c2ebbf",6459:"52d02021e858820bc4fa",6481:"f6c39edd04cb96d98240",6502:"49e5e6e459843f3db235",6565:"2a1a5a1969e80a10dcca",6584:"4f8a09b61267e5e26712",6610:"166d74ecd1e269c5a2bb",6695:"0d805fd9cd9ff3a636ca",6710:"6053a78aef54b4a5b172",6748:"c727d38f71e52bee17e1",6774:"0f04978e8342d9a35e59",6841:"8f027f5a1f4438cb2b3c",6935:"6f44e537fd307a0f60bf",7126:"e0499f45b098450b80b4",7202:"ef3baacc7f96ff05ab17",7277:"2b533c9cdfef77be371f",7303:"1f202e82ac0970e6b8c8",7316:"8cf33863b778a6312ed4",7374:"4c175664eb97689d66b0",7391:"869bb7cf9a70b64f598e",7476:"3590f268d451f58de679",7483:"6267f0327a5f02d323dc",7519:"a9dc5d6bdfa2d5a50b01",7628:"0bac1f62ac4b77549687",7681:"808206f87b9f0ab13bf7",7697:"6642286348c668e0fdaa",7845:"945015f35ab7d2d55d2d",7873:"c4eb3bd0e9cba4b20510",8008:"cdf6c503f87be165ecac",8024:"78af07e8ef8bb691b838",8062:"797c4f8b31a62d49a6b6",8079:"39c0b0279d170197c127",8092:"f1b26b73101210b8f29c",8096:"0eb26c0191d624b9a128",8153:"d5c8119d6d34628d3126",8228:"e5352dc8983d06d4ee0f",8244:"47bf38d910e71ac39bb8",8510:"d610a89ea9b1c19520a7",8598:"c97dd52fb06a8bf62b6f",8636:"2691a53125d7855ec0ee",8732:"eb3cbfe51627f89c347f",8758:"61a843d4b8382d763d23",8828:"d244e50c981146f018d2",8865:"8f5474355f44ad0bb9ad",9037:"5c64fd3bf057a1a5527f",9157:"d399b1b9cbf0737d1735",9169:"cfad34c949cbe8a31ef8",9238:"aa5dc08b2eaec43de5aa",9243:"6c519c5a474f51f37af0",9255:"9db6306f32e9adae6e71",9291:"514346a7831c08ec7c1e",9296:"34695a176f0074b3fd18",9372:"6718ebca33c3d0e1f285",9393:"a50d1ef8d9e8d1623ff1",9594:"1535423349f7eee694bc",9675:"477a69e55ce6f7111ae7",9771:"a4a78fcd76113e9a73fd",9790:"6ce95929a21586d8b6c0",9805:"d0ff496834686dbfe29f",9880:"38ebd270e6ffa60791bb",9884:"8cc8d88e5dd1e586eb04",9904:"e8df43c1af128522b2e0",9942:"46ed1a1b3b98959ad7d6",9971:"7231f2c2f138996aa022"}[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&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&!e;)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={134: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[o,s,i]=t;for(var a in s)r.o(s,a)&&(r.m[a]=s[a]);for(i&&i(r);o.length;)e[o.pop()]=1;n(t)}})(),r(88277);var n=r(728);RemoteClient=n})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.27.0-next.20230430",
3
+ "version": "4.27.0-next.20230501",
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.27/esri/copyright.txt for details.
4
4
  */
5
- const b="20230430",c="668a9336b0160b727a2d4dc1e61779782e9c727b";export{b as buildDate,c as commitHash};
5
+ const c="20230501",e="2d6ce8487c47144e9928e502d45693f5c4881625";export{c as buildDate,e 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.27/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Error.js";import{on as t}from"../../../core/events.js";import has from"../../../core/has.js";import{removeMaybe as r}from"../../../core/maybe.js";import{addFrameTask as s}from"../../../core/scheduling.js";import{c as i}from"../../../chunks/mat3f32.js";import n from"../../../symbols/cim/CIMResourceManager.js";import{Container as a}from"./Container.js";import{BufferPool as o}from"./webgl/BufferPool.js";import{WGLDrawPhase as h}from"./webgl/enums.js";import d from"./webgl/Painter.js";import{Profiler as l}from"./webgl/Profiler.js";import{Timeline as c}from"../support/Timeline.js";import{resampleHermite as p}from"../../support/screenshotUtils.js";import{createContextForView as u}from"../../webgl/contextUtils.js";import{RenderbufferFormat as m,PixelFormat as f,PixelType as _}from"../../webgl/enums.js";import{FramebufferObject as g}from"../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as b}from"../../webgl/RenderbufferDescriptor.js";import{RenderingContext as w}from"../../webgl/RenderingContext.js";import{TextureDescriptor as R}from"../../webgl/TextureDescriptor.js";import{createEmptyImageData as y}from"../../../core/imageUtils.js";const x=2e3;class P extends a{constructor(r,i){super(),this._trash=new Set,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this.renderRequested=!1,this.stage=this,this._stationary=!0;const{canvas:a=document.createElement("canvas"),alpha:h=!0,stencil:p=!0,contextOptions:m={}}=i;this._canvas=a;const f=u("2d",a,{alpha:h,antialias:!1,depth:!0,stencil:p});this.context=new w(f??null,m),this.resourceManager=new n,this.painter=new d(this.context,this,this.resourceManager),has("esri-2d-profiler")&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),r.appendChild(this._debugOutput));const _=()=>this._highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:i.timeline||new c,renderingOptions:i.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new l(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return _()}},this._taskHandle=s({render:e=>this.renderFrame(e)}),this._taskHandle.pause(),this._lostWebGLContextHandle=t(a,"webglcontextlost",(t=>{this.emit("webgl-error",{error:new e("webgl-context-lost",t.statusMessage)})})),this._bufferPool=new o,a.setAttribute("style","width: 100%; height:100%; display:block;"),r.appendChild(a)}destroy(){this.removeAllChildren(),this._emptyTrash(),this._taskHandle=r(this._taskHandle),this._lostWebGLContextHandle=r(this._lostWebGLContextHandle),this._canvas.parentNode?.removeChild(this._canvas),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.resourceManager.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get background(){return this._background}set background(e){this._background=e,this.requestRender()}get bufferPool(){return this._bufferPool}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get state(){return this._state}set state(e){this._state=e,this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=x,this.renderRequested||(this.renderRequested=!0,this.emit("will-render"),this._taskHandle.resume())}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this.renderRequested=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash(),this.emit("post-render")}_createTransforms(){return{dvs:i()}}renderChildren(e){for(const t of this.children)t.beforeRender(e);this._renderChildren(this.children,e);for(const t of this.children)t.afterRender(e)}_renderChildren(e,t){const r=this.context;this.painter.textureUploadManager.upload(),r.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,t.drawPhase=h.MAP,this.painter.beforeRenderLayers(r,this.background);for(const s of e)s.processRender(t);this.painter.prepareDisplay(t,this.background,this.state.padding),this.painter.renderLayers(r),t.drawPhase=h.HIGHLIGHT,this.painter.beforeRenderLayers(r);for(const s of e)s.processRender(t);this.painter.renderLayers(r);if(this._isLabelDrawPhaseRequired(e)){t.drawPhase=h.LABEL,this.painter.beforeRenderLayers(r);for(const r of e)r.processRender(t);this.painter.renderLayers(r)}if(has("esri-tiles-debug")){t.drawPhase=h.DEBUG,this.painter.beforeRenderLayers(r);for(const r of e)r.processRender(t);this.painter.renderLayers(r)}t.profiler.recordEnd("drawLayers"),r.logInfo()}doRender(e){const t=this.context,{state:r,pixelRatio:s}=e;this._resizeCanvas(e),t.setViewport(0,0,s*r.size[0],s*r.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),super.doRender(e)}async takeScreenshot(e){const t=Math.round(this.state.size[0]*e.resolutionScale),r=Math.round(this.state.size[1]*e.resolutionScale),s=e.resolutionScale,i=this.context,n=this._state.clone();if(null!=e.rotation){const t=n.viewpoint;n.viewpoint.rotation=e.rotation,n.viewpoint=t}const a={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:n,pixelRatio:s,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1},o=new g(i,new R(t,r),new b(m.DEPTH_STENCIL,t,r)),h=i.getBoundFramebufferObject(),d=i.getViewport();i.bindFramebuffer(o),i.setViewport(0,0,t,r),this._renderChildren(e.children,a);const l=this._readbackScreenshot(o,{...e.cropArea,y:r-(e.cropArea.y+e.cropArea.height)});i.bindFramebuffer(h),i.setViewport(d.x,d.y,d.width,d.height),this.requestRender();const c=await l;let u;return 1===e.outputScale?u=c:(u=new ImageData(Math.round(c.width*e.outputScale),Math.round(c.height*e.outputScale)),p(c,u,!0)),u}async _readbackScreenshot(e,t){const r=y(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,f.RGBA,_.UNSIGNED_BYTE,new Uint8Array(r.data.buffer)),r}_resizeCanvas(e){const t=this._canvas,r=t.style,{state:{size:s},pixelRatio:i}=e,n=s[0],a=s[1],o=Math.round(n*i),h=Math.round(a*i);t.width===o&&t.height===h||(t.width=o,t.height=h),r.width=n+"px",r.height=a+"px"}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}_isLabelDrawPhaseRequired(e){let t=!1;for(const r of e){if(!(r instanceof a)){t=t||!1;break}if("hasLabels"in r&&r.hasLabels)return!0;t=t||this._isLabelDrawPhaseRequired(r.children)}return t}}export{x as EXTRA_RENDER_TIME,P as Stage};
5
+ import e from"../../../core/Error.js";import{on as t}from"../../../core/events.js";import has from"../../../core/has.js";import{removeMaybe as r}from"../../../core/maybe.js";import{addFrameTask as s}from"../../../core/scheduling.js";import{c as i}from"../../../chunks/mat3f32.js";import n from"../../../symbols/cim/CIMResourceManager.js";import{Container as a}from"./Container.js";import{BufferPool as o}from"./webgl/BufferPool.js";import{WGLDrawPhase as h}from"./webgl/enums.js";import d from"./webgl/Painter.js";import{Profiler as l}from"./webgl/Profiler.js";import{Timeline as c}from"../support/Timeline.js";import{resampleHermite as p}from"../../support/screenshotUtils.js";import{createContextForView as m}from"../../webgl/contextUtils.js";import{TextureWrapMode as u,SizedPixelFormat as f,PixelFormat as _,RenderbufferFormat as g,PixelType as b}from"../../webgl/enums.js";import{FramebufferObject as w}from"../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as R}from"../../webgl/RenderbufferDescriptor.js";import{RenderingContext as y}from"../../webgl/RenderingContext.js";import{TextureDescriptor as x}from"../../webgl/TextureDescriptor.js";import P from"../../webgl/capabilities/isWebGL2Context.js";import{createEmptyImageData as j}from"../../../core/imageUtils.js";const T=2e3;class L extends a{constructor(r,i){super(),this._trash=new Set,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this.renderRequested=!1,this.stage=this,this._stationary=!0;const{canvas:a=document.createElement("canvas"),alpha:h=!0,stencil:p=!0,contextOptions:u={}}=i;this._canvas=a;const f=m("2d",a,{alpha:h,antialias:!1,depth:!0,stencil:p});this.context=new y(f??null,u),this.resourceManager=new n,this.painter=new d(this.context,this,this.resourceManager),has("esri-2d-profiler")&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),r.appendChild(this._debugOutput));const _=()=>this._highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:i.timeline||new c,renderingOptions:i.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new l(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return _()}},this._taskHandle=s({render:e=>this.renderFrame(e)}),this._taskHandle.pause(),this._lostWebGLContextHandle=t(a,"webglcontextlost",(t=>{this.emit("webgl-error",{error:new e("webgl-context-lost",t.statusMessage)})})),this._bufferPool=new o,a.setAttribute("style","width: 100%; height:100%; display:block;"),r.appendChild(a)}destroy(){this.removeAllChildren(),this._emptyTrash(),this._taskHandle=r(this._taskHandle),this._lostWebGLContextHandle=r(this._lostWebGLContextHandle),this._canvas.parentNode?.removeChild(this._canvas),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.resourceManager.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get background(){return this._background}set background(e){this._background=e,this.requestRender()}get bufferPool(){return this._bufferPool}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get state(){return this._state}set state(e){this._state=e,this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=T,this.renderRequested||(this.renderRequested=!0,this.emit("will-render"),this._taskHandle.resume())}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this.renderRequested=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash(),this.emit("post-render")}_createTransforms(){return{dvs:i()}}renderChildren(e){for(const t of this.children)t.beforeRender(e);this._renderChildren(this.children,e);for(const t of this.children)t.afterRender(e)}_renderChildren(e,t){const r=this.context;this.painter.textureUploadManager.upload(),r.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,t.drawPhase=h.MAP,this.painter.beforeRenderLayers(r,this.background);for(const s of e)s.processRender(t);this.painter.prepareDisplay(t,this.background,this.state.padding),this.painter.renderLayers(r),t.drawPhase=h.HIGHLIGHT,this.painter.beforeRenderLayers(r);for(const s of e)s.processRender(t);this.painter.renderLayers(r);if(this._isLabelDrawPhaseRequired(e)){t.drawPhase=h.LABEL,this.painter.beforeRenderLayers(r);for(const r of e)r.processRender(t);this.painter.renderLayers(r)}if(has("esri-tiles-debug")){t.drawPhase=h.DEBUG,this.painter.beforeRenderLayers(r);for(const r of e)r.processRender(t);this.painter.renderLayers(r)}t.profiler.recordEnd("drawLayers"),r.logInfo()}doRender(e){const t=this.context,{state:r,pixelRatio:s}=e;this._resizeCanvas(e),t.setViewport(0,0,s*r.size[0],s*r.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),super.doRender(e)}async takeScreenshot(e){const t=Math.round(this.state.size[0]*e.resolutionScale),r=Math.round(this.state.size[1]*e.resolutionScale),s=e.resolutionScale,i=this.context,n=this._state.clone();if(null!=e.rotation){const t=n.viewpoint;n.viewpoint.rotation=e.rotation,n.viewpoint=t}const a={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:n,pixelRatio:s,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1},o=P(i.gl),h=new x(t,r);h.wrapMode=u.CLAMP_TO_EDGE,h.internalFormat=o?f.RGBA8:_.RGBA,h.isImmutable=o;const d=new w(i,h,new R(g.DEPTH_STENCIL,t,r)),l=i.getBoundFramebufferObject(),c=i.getViewport();i.bindFramebuffer(d),i.setViewport(0,0,t,r),this._renderChildren(e.children,a);const m=this._readbackScreenshot(d,{...e.cropArea,y:r-(e.cropArea.y+e.cropArea.height)});i.bindFramebuffer(l),i.setViewport(c.x,c.y,c.width,c.height),this.requestRender();const b=await m;let y;return 1===e.outputScale?y=b:(y=new ImageData(Math.round(b.width*e.outputScale),Math.round(b.height*e.outputScale)),p(b,y,!0)),d.dispose(),y}async _readbackScreenshot(e,t){const r=j(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,_.RGBA,b.UNSIGNED_BYTE,new Uint8Array(r.data.buffer)),r}_resizeCanvas(e){const t=this._canvas,r=t.style,{state:{size:s},pixelRatio:i}=e,n=s[0],a=s[1],o=Math.round(n*i),h=Math.round(a*i);t.width===o&&t.height===h||(t.width=o,t.height=h),r.width=n+"px",r.height=a+"px"}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}_isLabelDrawPhaseRequired(e){let t=!1;for(const r of e){if(!(r instanceof a)){t=t||!1;break}if("hasLabels"in r&&r.hasLabels)return!0;t=t||this._isLabelDrawPhaseRequired(r.children)}return t}}export{T as EXTRA_RENDER_TIME,L as Stage};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import t from"./RectangleBinPack.js";import e from"../webgl/Rect.js";import{PixelFormat as i}from"../../../webgl/enums.js";import{Texture as s}from"../../../webgl/Texture.js";import{TextureDescriptor as h}from"../../../webgl/TextureDescriptor.js";class r{constructor(e,i,s){this.width=0,this.height=0,this._dirties=[],this._glyphData=[],this._currentPage=0,this._glyphIndex={},this._textures=[],this._rangePromises=new Map,this.width=e,this.height=i,this._glyphSource=s,this._binPack=new t(e-4,i-4),this._glyphData.push(new Uint8Array(e*i)),this._dirties.push(!0),this._textures.push(void 0)}getGlyphItems(i,s){const h=[],r=this._glyphSource,n=new Set,o=1/256;for(const t of s){const e=Math.floor(t*o);n.add(e)}const a=[];return n.forEach((t=>{if(t<=256){const e=i+t;if(this._rangePromises.has(e))a.push(this._rangePromises.get(e));else{const s=r.getRange(i,t).then((()=>{this._rangePromises.delete(e)}),(()=>{this._rangePromises.delete(e)}));this._rangePromises.set(e,s),a.push(s)}}})),Promise.all(a).then((()=>{let n=this._glyphIndex[i];n||(n={},this._glyphIndex[i]=n);for(const o of s){const s=n[o];if(s){h[o]={sdf:!0,rect:s.rect,metrics:s.metrics,page:s.page,code:o};continue}const a=r.getGlyph(i,o);if(!a||!a.metrics)continue;const c=a.metrics;let l;if(0===c.width)l=new e(0,0,0,0);else{const e=3,i=c.width+2*e,s=c.height+2*e;let h=i%4?4-i%4:4,r=s%4?4-s%4:4;1===h&&(h=5),1===r&&(r=5),l=this._binPack.allocate(i+h,s+r),l.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(void 0),this._binPack=new t(this.width-4,this.height-4),l=this._binPack.allocate(i+h,s+r));const n=this._glyphData[this._currentPage],o=a.bitmap;let g,_;if(o)for(let t=0;t<s;t++){g=i*t,_=this.width*(l.y+t+1)+l.x;for(let t=0;t<i;t++)n[_+t+1]=o[g+t]}}n[o]={rect:l,metrics:c,tileIDs:null,page:this._currentPage},h[o]={sdf:!0,rect:l,metrics:c,page:this._currentPage,code:o},this._dirties[this._currentPage]=!0}return h}))}removeGlyphs(t){for(const e in this._glyphIndex){const i=this._glyphIndex[e];if(!i)continue;let s;for(const e in i)if(s=i[e],s.tileIDs.delete(t),0===s.tileIDs.size){const t=this._glyphData[s.page],h=s.rect;let r,n;for(let e=0;e<h.height;e++)for(r=this.width*(h.y+e)+h.x,n=0;n<h.width;n++)t[r+n]=0;delete i[e],this._dirties[s.page]=!0}}}bind(t,e,r,n=0){if(!this._textures[r]){const e=new h;e.pixelFormat=i.ALPHA,e.width=this.width,e.height=this.height,this._textures[r]=new s(t,e,new Uint8Array(this.width*this.height))}const o=this._textures[r];o.setSamplingMode(e),this._dirties[r]&&o.setData(this._glyphData[r]),t.bindTexture(o,n),this._dirties[r]=!1}dispose(){this._binPack=null;for(const t of this._textures)t&&t.dispose();this._textures.length=0}}export{r as default};
5
+ import t from"./RectangleBinPack.js";import e from"../webgl/Rect.js";import{PixelFormat as i,TextureWrapMode as s}from"../../../webgl/enums.js";import{Texture as h}from"../../../webgl/Texture.js";import{TextureDescriptor as r}from"../../../webgl/TextureDescriptor.js";class n{constructor(e,i,s){this.width=0,this.height=0,this._dirties=[],this._glyphData=[],this._currentPage=0,this._glyphIndex={},this._textures=[],this._rangePromises=new Map,this.width=e,this.height=i,this._glyphSource=s,this._binPack=new t(e-4,i-4),this._glyphData.push(new Uint8Array(e*i)),this._dirties.push(!0),this._textures.push(void 0)}getGlyphItems(i,s){const h=[],r=this._glyphSource,n=new Set,o=1/256;for(const t of s){const e=Math.floor(t*o);n.add(e)}const a=[];return n.forEach((t=>{if(t<=256){const e=i+t;if(this._rangePromises.has(e))a.push(this._rangePromises.get(e));else{const s=r.getRange(i,t).then((()=>{this._rangePromises.delete(e)}),(()=>{this._rangePromises.delete(e)}));this._rangePromises.set(e,s),a.push(s)}}})),Promise.all(a).then((()=>{let n=this._glyphIndex[i];n||(n={},this._glyphIndex[i]=n);for(const o of s){const s=n[o];if(s){h[o]={sdf:!0,rect:s.rect,metrics:s.metrics,page:s.page,code:o};continue}const a=r.getGlyph(i,o);if(!a||!a.metrics)continue;const c=a.metrics;let l;if(0===c.width)l=new e(0,0,0,0);else{const e=3,i=c.width+2*e,s=c.height+2*e;let h=i%4?4-i%4:4,r=s%4?4-s%4:4;1===h&&(h=5),1===r&&(r=5),l=this._binPack.allocate(i+h,s+r),l.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(void 0),this._binPack=new t(this.width-4,this.height-4),l=this._binPack.allocate(i+h,s+r));const n=this._glyphData[this._currentPage],o=a.bitmap;let g,_;if(o)for(let t=0;t<s;t++){g=i*t,_=this.width*(l.y+t+1)+l.x;for(let t=0;t<i;t++)n[_+t+1]=o[g+t]}}n[o]={rect:l,metrics:c,tileIDs:null,page:this._currentPage},h[o]={sdf:!0,rect:l,metrics:c,page:this._currentPage,code:o},this._dirties[this._currentPage]=!0}return h}))}removeGlyphs(t){for(const e in this._glyphIndex){const i=this._glyphIndex[e];if(!i)continue;let s;for(const e in i)if(s=i[e],s.tileIDs.delete(t),0===s.tileIDs.size){const t=this._glyphData[s.page],h=s.rect;let r,n;for(let e=0;e<h.height;e++)for(r=this.width*(h.y+e)+h.x,n=0;n<h.width;n++)t[r+n]=0;delete i[e],this._dirties[s.page]=!0}}}bind(t,e,n,o=0){if(!this._textures[n]){const e=new r;e.pixelFormat=i.ALPHA,e.wrapMode=s.CLAMP_TO_EDGE,e.width=this.width,e.height=this.height,this._textures[n]=new h(t,e,new Uint8Array(this.width*this.height))}const a=this._textures[n];a.setSamplingMode(e),this._dirties[n]&&a.setData(this._glyphData[n]),t.bindTexture(a,o),this._dirties[n]=!1}dispose(){this._binPack=null;for(const t of this._textures)t&&t.dispose();this._textures.length=0}}export{n as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import{throwIfNotAbortError as t}from"../../../../core/promiseUtils.js";import e from"./Rect.js";import i from"./RectangleBinPack.js";import{PixelFormat as h}from"../../../webgl/enums.js";import{Texture as s}from"../../../webgl/Texture.js";import{TextureDescriptor as r}from"../../../webgl/TextureDescriptor.js";const a=256,n=t=>Math.floor(t/256);function o(t){const e=new Set;for(const i of t)e.add(n(i));return e}function c(e,i,h){return e.has(i)||e.set(i,h().then((()=>{e.delete(i)})).catch((h=>{e.delete(i),t(h)}))),e.get(i)}const l=t=>({rect:new e(0,0,0,0),page:0,metrics:{left:0,width:0,height:0,advance:0,top:0},code:t,sdf:!0});class g{constructor(t,e,h){this.width=0,this.height=0,this._dirties=[],this._glyphData=[],this._currentPage=0,this._glyphCache={},this._textures=[],this._rangePromises=new Map,this._preloadCache={},this.width=t,this.height=e,this._glyphSource=h,this._binPack=new i(t-4,e-4),this._glyphData.push(new Uint8Array(t*e)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs()}dispose(){this._binPack=null;for(const t of this._textures)t&&t.dispose();this._textures.length=0,this._glyphData.length=0}_initDecorationGlyphs(){const t=[117,149,181,207,207,181,149,117],e=[],i=[];for(let r=0;r<t.length;r++){const h=t[r];for(let t=0;t<11;t++){const s=r>=3&&r<5&&t>=3&&t<8?255:0;e.push(h),i.push(s)}}const h={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(e)},s={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(i)};this._recordGlyph(h),this._recordGlyph(s)}async getGlyphItems(t,e,i){const h=this._getGlyphCache(t);return await this._fetchRanges(t,e,i),e.map((e=>this._getMosaicItem(h,t,e)))}bind(t,e,i,h){const s=this._getTexture(t,i);s.setSamplingMode(e),this._dirties[i]&&(s.setData(this._glyphData[i]),this._dirties[i]=!1),t.bindTexture(s,h)}preloadASCIIGlyphCache(t){const e=this._preloadCache[t];if(null!=e)return e;const i=this._glyphSource.preloadASCIIRange(t).then((()=>{const e=this._getGlyphCache(t);for(let i=0;i<256;i++)this._getMosaicItem(e,t,i)}));return this._preloadCache[t]=i,i}_getGlyphCache(t){return this._glyphCache[t]||(this._glyphCache[t]={}),this._glyphCache[t]}_getTexture(t,e){if(!this._textures[e]){const i=new r;i.pixelFormat=h.ALPHA,i.width=this.width,i.height=this.height,this._textures[e]=new s(t,i,new Uint8Array(this.width*this.height))}return this._textures[e]}_invalidate(){this._dirties[this._currentPage]=!0}async _fetchRanges(t,e,i){const h=o(e),s=[];h.forEach((e=>{s.push(this._fetchRange(t,e,i))})),await Promise.all(s)}async _fetchRange(t,e,i){if(e>a)return;const h=t+e;return c(this._rangePromises,h,(()=>this._glyphSource.getRange(t,e,i)))}_getMosaicItem(t,e,i){if(!t[i]){const h=this._glyphSource.getGlyph(e,i);if(!h||!h.metrics)return l(i);const s=this._recordGlyph(h),r=this._currentPage,a=h.metrics;t[i]={rect:s,page:r,metrics:a,code:i,sdf:!0},this._invalidate()}return t[i]}_recordGlyph(t){const h=t.metrics;let s;if(0===h.width)s=new e(0,0,0,0);else{const e=3,r=h.width+2*e,a=h.height+2*e;s=this._binPack.allocate(r,a),s.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs(),this._binPack=new i(this.width-4,this.height-4),s=this._binPack.allocate(r,a));const n=this._glyphData[this._currentPage],o=t.bitmap;let c,l;if(o)for(let t=0;t<a;t++){c=r*t,l=this.width*(s.y+t)+s.x;for(let t=0;t<r;t++)n[l+t]=o[c+t]}has("esri-glyph-debug")&&this._showDebugPage(n)}return s}_showDebugPage(t){const e=document.createElement("canvas"),i=e.getContext("2d"),h=new ImageData(this.width,this.height),s=h.data;e.width=this.width,e.height=this.height,e.style.border="1px solid black";for(let r=0;r<t.length;++r)s[4*r]=t[r],s[4*r+1]=0,s[4*r+2]=0,s[4*r+3]=255;i.putImageData(h,0,0),document.body.appendChild(e)}}export{g as default};
5
+ import has from"../../../../core/has.js";import{throwIfNotAbortError as t}from"../../../../core/promiseUtils.js";import e from"./Rect.js";import i from"./RectangleBinPack.js";import{PixelFormat as h,TextureWrapMode as s}from"../../../webgl/enums.js";import{Texture as r}from"../../../webgl/Texture.js";import{TextureDescriptor as a}from"../../../webgl/TextureDescriptor.js";const n=256,o=t=>Math.floor(t/256);function c(t){const e=new Set;for(const i of t)e.add(o(i));return e}function l(e,i,h){return e.has(i)||e.set(i,h().then((()=>{e.delete(i)})).catch((h=>{e.delete(i),t(h)}))),e.get(i)}const g=t=>({rect:new e(0,0,0,0),page:0,metrics:{left:0,width:0,height:0,advance:0,top:0},code:t,sdf:!0});class p{constructor(t,e,h){this.width=0,this.height=0,this._dirties=[],this._glyphData=[],this._currentPage=0,this._glyphCache={},this._textures=[],this._rangePromises=new Map,this._preloadCache={},this.width=t,this.height=e,this._glyphSource=h,this._binPack=new i(t-4,e-4),this._glyphData.push(new Uint8Array(t*e)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs()}dispose(){this._binPack=null;for(const t of this._textures)t&&t.dispose();this._textures.length=0,this._glyphData.length=0}_initDecorationGlyphs(){const t=[117,149,181,207,207,181,149,117],e=[],i=[];for(let r=0;r<t.length;r++){const h=t[r];for(let t=0;t<11;t++){const s=r>=3&&r<5&&t>=3&&t<8?255:0;e.push(h),i.push(s)}}const h={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(e)},s={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(i)};this._recordGlyph(h),this._recordGlyph(s)}async getGlyphItems(t,e,i){const h=this._getGlyphCache(t);return await this._fetchRanges(t,e,i),e.map((e=>this._getMosaicItem(h,t,e)))}bind(t,e,i,h){const s=this._getTexture(t,i);s.setSamplingMode(e),this._dirties[i]&&(s.setData(this._glyphData[i]),this._dirties[i]=!1),t.bindTexture(s,h)}preloadASCIIGlyphCache(t){const e=this._preloadCache[t];if(null!=e)return e;const i=this._glyphSource.preloadASCIIRange(t).then((()=>{const e=this._getGlyphCache(t);for(let i=0;i<256;i++)this._getMosaicItem(e,t,i)}));return this._preloadCache[t]=i,i}_getGlyphCache(t){return this._glyphCache[t]||(this._glyphCache[t]={}),this._glyphCache[t]}_getTexture(t,e){if(!this._textures[e]){const i=new a;i.pixelFormat=h.ALPHA,i.wrapMode=s.CLAMP_TO_EDGE,i.width=this.width,i.height=this.height,this._textures[e]=new r(t,i,new Uint8Array(this.width*this.height))}return this._textures[e]}_invalidate(){this._dirties[this._currentPage]=!0}async _fetchRanges(t,e,i){const h=c(e),s=[];h.forEach((e=>{s.push(this._fetchRange(t,e,i))})),await Promise.all(s)}async _fetchRange(t,e,i){if(e>n)return;const h=t+e;return l(this._rangePromises,h,(()=>this._glyphSource.getRange(t,e,i)))}_getMosaicItem(t,e,i){if(!t[i]){const h=this._glyphSource.getGlyph(e,i);if(!h||!h.metrics)return g(i);const s=this._recordGlyph(h),r=this._currentPage,a=h.metrics;t[i]={rect:s,page:r,metrics:a,code:i,sdf:!0},this._invalidate()}return t[i]}_recordGlyph(t){const h=t.metrics;let s;if(0===h.width)s=new e(0,0,0,0);else{const e=3,r=h.width+2*e,a=h.height+2*e;s=this._binPack.allocate(r,a),s.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs(),this._binPack=new i(this.width-4,this.height-4),s=this._binPack.allocate(r,a));const n=this._glyphData[this._currentPage],o=t.bitmap;let c,l;if(o)for(let t=0;t<a;t++){c=r*t,l=this.width*(s.y+t)+s.x;for(let t=0;t<r;t++)n[l+t]=o[c+t]}has("esri-glyph-debug")&&this._showDebugPage(n)}return s}_showDebugPage(t){const e=document.createElement("canvas"),i=e.getContext("2d"),h=new ImageData(this.width,this.height),s=h.data;e.width=this.width,e.height=this.height,e.style.border="1px solid black";for(let r=0;r<t.length;++r)s[4*r]=t[r],s[4*r+1]=0,s[4*r+2]=0,s[4*r+3]=255;i.putImageData(h,0,0),document.body.appendChild(e)}}export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import{SPRITE_PADDING as e}from"./definitions.js";import{log2 as i}from"./GeometryUtils.js";import s from"./Rect.js";import a from"./RectangleBinPack.js";import{Texture as o}from"../../../webgl/Texture.js";import{TextureDescriptor as r}from"../../../webgl/TextureDescriptor.js";function h(t){return t&&"static"===t.type}class c{constructor(t,e,i=0){this._mosaicPages=[],this._maxItemSize=0,this._currentPage=0,this._pageWidth=0,this._pageHeight=0,this._mosaicRects=new Map,this._spriteCopyQueue=[],this.pixelRatio=1,(t<=0||e<=0)&&console.error("Sprites mosaic defaultWidth and defaultHeight must be greater than zero!"),this._pageWidth=t,this._pageHeight=e,i>0&&(this._maxItemSize=i),this.pixelRatio=window.devicePixelRatio||1,this._binPack=new a(this._pageWidth,this._pageHeight);const s=Math.floor(this._pageWidth),o=Math.floor(this._pageHeight);this._mosaicPages.push({mosaicsData:{type:"static",data:new Uint32Array(s*o)},size:[this._pageWidth,this._pageHeight],dirty:!0,texture:void 0})}getWidth(t){return t>=this._mosaicPages.length?-1:this._mosaicPages[t].size[0]}getHeight(t){return t>=this._mosaicPages.length?-1:this._mosaicPages[t].size[1]}getPageTexture(t){return t<this._mosaicPages.length?this._mosaicPages[t].texture:null}has(t){return this._mosaicRects.has(t)}get itemCount(){return this._mosaicRects.size}getSpriteItem(t){return this._mosaicRects.get(t)}addSpriteItem(t,i,a,o,r,c,n=1){if(this._mosaicRects.has(t))return this._mosaicRects.get(t);let g,p,m;if(h(a))[g,p,m]=this._allocateImage(i[0],i[1]);else{g=new s(0,0,i[0],i[1]),p=this._mosaicPages.length;const t=void 0;this._mosaicPages.push({mosaicsData:a,size:[i[0]+2*e,i[1]+2*e],dirty:!0,texture:t})}if(g.width<=0||g.height<=0)return null;const d={rect:g,width:i[0],height:i[1],sdf:r,simplePattern:c,pixelRatio:n,page:p};return this._mosaicRects.set(t,d),h(a)&&(has("esri-mosaic-debug")&&this._showDebugSprite(i,a.data),this._copy({rect:g,spriteSize:i,spriteData:a.data,page:p,pageSize:m,repeat:o,sdf:r})),d}hasItemsToProcess(){return 0!==this._spriteCopyQueue.length}processNextItem(){const t=this._spriteCopyQueue.pop();t&&this._copy(t)}getSpriteItems(t){const e={};for(const i of t)e[i]=this.getSpriteItem(i);return e}getMosaicItemPosition(t){const i=this.getSpriteItem(t),s=i&&i.rect;if(!s)return null;s.width=i.width,s.height=i.height;const a=i.width,o=i.height,r=e,h=this._mosaicPages[i.page].size;return{size:[i.width,i.height],tl:[(s.x+r)/h[0],(s.y+r)/h[1]],br:[(s.x+r+a)/h[0],(s.y+r+o)/h[1]],page:i.page}}bind(t,e,i=0,s=0){const a=this._mosaicPages[i],o=a.mosaicsData;let r=a.texture;if(r||(r=g(t,a.size),a.texture=r),r.setSamplingMode(e),h(o))t.bindTexture(r,s),a.dirty&&(r.setData(new Uint8Array(o.data.buffer)),r.generateMipmap(),has("esri-mosaic-debug")&&this._showDebugPage(i));else{o.data.bindFrame(t,r,s),r.generateMipmap()}a.dirty=!1}dispose(){this._binPack=null;for(const t of this._mosaicPages){const e=t.texture;e&&e.dispose();const i=t.mosaicsData;if(!h(i)){i.data.destroy()}}this._mosaicPages=null,this._mosaicRects.clear()}static _copyBits(t,e,i,s,a,o,r,h,c,n,g){let p=s*e+i,m=h*o+r;if(g){m-=o;for(let r=-1;r<=n;r++,p=((r+n)%n+s)*e+i,m+=o)for(let e=-1;e<=c;e++)a[m+e]=t[p+(e+c)%c]}else for(let d=0;d<n;d++){for(let e=0;e<c;e++)a[m+e]=t[p+e];p+=e,m+=o}}_copy(i){if(i.page>=this._mosaicPages.length)return;const s=this._mosaicPages[i.page],a=s.mosaicsData;if(!h(s.mosaicsData))throw new t("mapview-invalid-resource","unsuitable data type!");const o=i.spriteData,r=a.data;r&&o||console.error("Source or target images are uninitialized!"),c._copyBits(o,i.spriteSize[0],0,0,r,i.pageSize[0],i.rect.x+e,i.rect.y+e,i.spriteSize[0],i.spriteSize[1],i.repeat),s.dirty=!0}_allocateImage(t,o){t+=2*e,o+=2*e;const r=Math.max(t,o);if(this._maxItemSize&&this._maxItemSize<r){const e=2**Math.ceil(i(t)),a=2**Math.ceil(i(o)),r=new s(0,0,t,o);return this._mosaicPages.push({mosaicsData:{type:"static",data:new Uint32Array(e*a)},size:[e,a],dirty:!0,texture:void 0}),[r,this._mosaicPages.length-1,[e,a]]}const c=this._binPack.allocate(t,o);if(c.width<=0){const e=this._mosaicPages[this._currentPage];return!e.dirty&&h(e.mosaicsData)&&(e.mosaicsData.data=null),this._currentPage=this._mosaicPages.length,this._mosaicPages.push({mosaicsData:{type:"static",data:new Uint32Array(this._pageWidth*this._pageHeight)},size:[this._pageWidth,this._pageHeight],dirty:!0,texture:void 0}),this._binPack=new a(this._pageWidth,this._pageHeight),this._allocateImage(t,o)}return[c,this._currentPage,[this._pageWidth,this._pageHeight]]}_showDebugSprite([t,e],i){const s=document.createElement("canvas");s.width=t,s.height=e,s.setAttribute("style",`position: absolute; top: ${4+204*n++}px; right: 208px; width: 200px; height: 200px; border: 1px solid black;`);const a=s.getContext("2d"),o=new ImageData(t,e);o.data.set(new Uint8Array(i.buffer)),a.putImageData(o,0,0),document.body.appendChild(s)}_showDebugPage(t){const e=this._mosaicPages[t],{size:[i,s],mosaicsData:a}=e;if(!h(a))return void console.error("Could not show sprite mosaic debug for non-static resource");const o=`mosaicDebugPage${t}`,r=document.getElementById(o)??document.createElement("canvas");r.id=o,r.width=i,r.height=s,r.setAttribute("style",`position: absolute; top: ${4+204*t}px; right: 4px; width: 200px; height: 200px; border: 1px solid black;`);const c=r.getContext("2d"),n=new ImageData(i,s);n.data.set(new Uint8Array(a.data.buffer)),c.putImageData(n,0,0),document.body.appendChild(r)}}let n=0;function g(t,e){const i=new r;return i.width=e[0],i.height=e[1],new o(t,i,null)}export{c as default};
5
+ import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import{SPRITE_PADDING as e}from"./definitions.js";import{log2 as i}from"./GeometryUtils.js";import s from"./Rect.js";import a from"./RectangleBinPack.js";import{TextureWrapMode as o}from"../../../webgl/enums.js";import{Texture as r}from"../../../webgl/Texture.js";import{TextureDescriptor as h}from"../../../webgl/TextureDescriptor.js";function c(t){return t&&"static"===t.type}class n{constructor(t,e,i=0){this._mosaicPages=[],this._maxItemSize=0,this._currentPage=0,this._pageWidth=0,this._pageHeight=0,this._mosaicRects=new Map,this._spriteCopyQueue=[],this.pixelRatio=1,(t<=0||e<=0)&&console.error("Sprites mosaic defaultWidth and defaultHeight must be greater than zero!"),this._pageWidth=t,this._pageHeight=e,i>0&&(this._maxItemSize=i),this.pixelRatio=window.devicePixelRatio||1,this._binPack=new a(this._pageWidth,this._pageHeight);const s=Math.floor(this._pageWidth),o=Math.floor(this._pageHeight);this._mosaicPages.push({mosaicsData:{type:"static",data:new Uint32Array(s*o)},size:[this._pageWidth,this._pageHeight],dirty:!0,texture:void 0})}getWidth(t){return t>=this._mosaicPages.length?-1:this._mosaicPages[t].size[0]}getHeight(t){return t>=this._mosaicPages.length?-1:this._mosaicPages[t].size[1]}getPageTexture(t){return t<this._mosaicPages.length?this._mosaicPages[t].texture:null}has(t){return this._mosaicRects.has(t)}get itemCount(){return this._mosaicRects.size}getSpriteItem(t){return this._mosaicRects.get(t)}addSpriteItem(t,i,a,o,r,h,n=1){if(this._mosaicRects.has(t))return this._mosaicRects.get(t);let g,p,m;if(c(a))[g,p,m]=this._allocateImage(i[0],i[1]);else{g=new s(0,0,i[0],i[1]),p=this._mosaicPages.length;const t=void 0;this._mosaicPages.push({mosaicsData:a,size:[i[0]+2*e,i[1]+2*e],dirty:!0,texture:t})}if(g.width<=0||g.height<=0)return null;const d={rect:g,width:i[0],height:i[1],sdf:r,simplePattern:h,pixelRatio:n,page:p};return this._mosaicRects.set(t,d),c(a)&&(has("esri-mosaic-debug")&&this._showDebugSprite(i,a.data),this._copy({rect:g,spriteSize:i,spriteData:a.data,page:p,pageSize:m,repeat:o,sdf:r})),d}hasItemsToProcess(){return 0!==this._spriteCopyQueue.length}processNextItem(){const t=this._spriteCopyQueue.pop();t&&this._copy(t)}getSpriteItems(t){const e={};for(const i of t)e[i]=this.getSpriteItem(i);return e}getMosaicItemPosition(t){const i=this.getSpriteItem(t),s=i&&i.rect;if(!s)return null;s.width=i.width,s.height=i.height;const a=i.width,o=i.height,r=e,h=this._mosaicPages[i.page].size;return{size:[i.width,i.height],tl:[(s.x+r)/h[0],(s.y+r)/h[1]],br:[(s.x+r+a)/h[0],(s.y+r+o)/h[1]],page:i.page}}bind(t,e,i=0,s=0){const a=this._mosaicPages[i],o=a.mosaicsData;let r=a.texture;if(r||(r=p(t,a.size),a.texture=r),r.setSamplingMode(e),c(o))t.bindTexture(r,s),a.dirty&&(r.setData(new Uint8Array(o.data.buffer)),r.generateMipmap(),has("esri-mosaic-debug")&&this._showDebugPage(i));else{o.data.bindFrame(t,r,s),r.generateMipmap()}a.dirty=!1}dispose(){this._binPack=null;for(const t of this._mosaicPages){const e=t.texture;e&&e.dispose();const i=t.mosaicsData;if(!c(i)){i.data.destroy()}}this._mosaicPages=null,this._mosaicRects.clear()}static _copyBits(t,e,i,s,a,o,r,h,c,n,g){let p=s*e+i,m=h*o+r;if(g){m-=o;for(let r=-1;r<=n;r++,p=((r+n)%n+s)*e+i,m+=o)for(let e=-1;e<=c;e++)a[m+e]=t[p+(e+c)%c]}else for(let d=0;d<n;d++){for(let e=0;e<c;e++)a[m+e]=t[p+e];p+=e,m+=o}}_copy(i){if(i.page>=this._mosaicPages.length)return;const s=this._mosaicPages[i.page],a=s.mosaicsData;if(!c(s.mosaicsData))throw new t("mapview-invalid-resource","unsuitable data type!");const o=i.spriteData,r=a.data;r&&o||console.error("Source or target images are uninitialized!"),n._copyBits(o,i.spriteSize[0],0,0,r,i.pageSize[0],i.rect.x+e,i.rect.y+e,i.spriteSize[0],i.spriteSize[1],i.repeat),s.dirty=!0}_allocateImage(t,o){t+=2*e,o+=2*e;const r=Math.max(t,o);if(this._maxItemSize&&this._maxItemSize<r){const e=2**Math.ceil(i(t)),a=2**Math.ceil(i(o)),r=new s(0,0,t,o);return this._mosaicPages.push({mosaicsData:{type:"static",data:new Uint32Array(e*a)},size:[e,a],dirty:!0,texture:void 0}),[r,this._mosaicPages.length-1,[e,a]]}const h=this._binPack.allocate(t,o);if(h.width<=0){const e=this._mosaicPages[this._currentPage];return!e.dirty&&c(e.mosaicsData)&&(e.mosaicsData.data=null),this._currentPage=this._mosaicPages.length,this._mosaicPages.push({mosaicsData:{type:"static",data:new Uint32Array(this._pageWidth*this._pageHeight)},size:[this._pageWidth,this._pageHeight],dirty:!0,texture:void 0}),this._binPack=new a(this._pageWidth,this._pageHeight),this._allocateImage(t,o)}return[h,this._currentPage,[this._pageWidth,this._pageHeight]]}_showDebugSprite([t,e],i){const s=document.createElement("canvas");s.width=t,s.height=e,s.setAttribute("style",`position: absolute; top: ${4+204*g++}px; right: 208px; width: 200px; height: 200px; border: 1px solid black;`);const a=s.getContext("2d"),o=new ImageData(t,e);o.data.set(new Uint8Array(i.buffer)),a.putImageData(o,0,0),document.body.appendChild(s)}_showDebugPage(t){const e=this._mosaicPages[t],{size:[i,s],mosaicsData:a}=e;if(!c(a))return void console.error("Could not show sprite mosaic debug for non-static resource");const o=`mosaicDebugPage${t}`,r=document.getElementById(o)??document.createElement("canvas");r.id=o,r.width=i,r.height=s,r.setAttribute("style",`position: absolute; top: ${4+204*t}px; right: 4px; width: 200px; height: 200px; border: 1px solid black;`);const h=r.getContext("2d"),n=new ImageData(i,s);n.data.set(new Uint8Array(a.data.buffer)),h.putImageData(n,0,0),document.body.appendChild(r)}}let g=0;function p(t,e){const i=new h;return i.width=e[0],i.height=e[1],i.wrapMode=o.CLAMP_TO_EDGE,new r(t,i,null)}export{n as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{f as t}from"../../../../../chunks/vec4f32.js";import{Pos2b as e}from"../DefaultVertexAttributeLayouts.js";import r from"./WGLBrush.js";import{background as i}from"../shaders/BackgroundPrograms.js";import{tileInfo as o}from"../shaders/TileInfoPrograms.js";import{BufferObject as s}from"../../../../webgl/BufferObject.js";import{BlendFactor as n,PrimitiveType as a,Usage as l,TextureWrapMode as u,TextureSamplingMode as m}from"../../../../webgl/enums.js";import{createProgram as _}from"../../../../webgl/ProgramTemplate.js";import{Texture as f}from"../../../../webgl/Texture.js";import{TextureDescriptor as c}from"../../../../webgl/TextureDescriptor.js";import{VertexArrayObject as d}from"../../../../webgl/VertexArrayObject.js";const g=300,h=32;class p extends r{constructor(){super(...arguments),this._color=t(1,0,0,1)}dispose(){this._outlineProgram?.dispose(),this._outlineProgram=null,this._tileInfoProgram?.dispose(),this._tileInfoProgram=null,this._outlineVertexArrayObject?.dispose(),this._outlineVertexArrayObject=null,this._tileInfoVertexArrayObject?.dispose(),this._tileInfoVertexArrayObject=null,this._canvas=null}prepareState({context:t}){t.setBlendingEnabled(!0),t.setBlendFunctionSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0),t.setStencilWriteMask(0),t.setStencilTestEnabled(!1)}draw(t,e){const{context:r,requestRender:i,allowDelayedRender:o}=t;if(!e.isReady)return;if(this._loadWGLResources(r),o&&null!=i&&(!this._outlineProgram.compiled||!this._tileInfoProgram.compiled))return void i();r.bindVAO(this._outlineVertexArrayObject),r.useProgram(this._outlineProgram),this._outlineProgram.setUniformMatrix3fv("u_dvsMat3",e.transforms.dvs),this._outlineProgram.setUniform2f("u_coord_range",e.rangeX,e.rangeY),this._outlineProgram.setUniform1f("u_depth",0),this._outlineProgram.setUniform4fv("u_color",this._color),r.drawArrays(a.LINE_STRIP,0,4);const s=this._getTexture(r,e);s?(r.bindVAO(this._tileInfoVertexArrayObject),r.useProgram(this._tileInfoProgram),r.bindTexture(s,0),this._tileInfoProgram.setUniformMatrix3fv("u_dvsMat3",e.transforms.dvs),this._tileInfoProgram.setUniform1f("u_depth",0),this._tileInfoProgram.setUniform2f("u_coord_ratio",e.rangeX/e.width,e.rangeY/e.height),this._tileInfoProgram.setUniform2f("u_delta",8,8),this._tileInfoProgram.setUniform2f("u_dimensions",s.descriptor.width,s.descriptor.height),r.drawArrays(a.TRIANGLE_STRIP,0,4),r.bindVAO()):r.bindVAO()}_loadWGLResources(t){if(this._outlineProgram&&this._tileInfoProgram)return;const r=_(t,i),n=_(t,o),a=new Int8Array([0,0,1,0,1,1,0,1]),u=s.createVertex(t,l.STATIC_DRAW,a),m=new d(t,i.attributes,e,{geometry:u}),f=new Int8Array([0,0,1,0,0,1,1,1]),c=s.createVertex(t,l.STATIC_DRAW,f),g=new d(t,o.attributes,e,{geometry:c});this._outlineProgram=r,this._tileInfoProgram=n,this._outlineVertexArrayObject=m,this._tileInfoVertexArrayObject=g}_getTexture(t,e){if(e.texture&&e.triangleCountReportedInDebug===e.triangleCount)return e.texture;e.triangleCountReportedInDebug=e.triangleCount,this._canvas||(this._canvas=document.createElement("canvas"),this._canvas.setAttribute("id","canvas2d"),this._canvas.setAttribute("width",`${g}`),this._canvas.setAttribute("height",`${h}`),this._canvas.setAttribute("style","display:none"));const r=e.triangleCount;let i=e.key.id;e.triangleCount>0&&(i+=`, ${r}`);const o=this._canvas,s=o.getContext("2d");s.font="24px sans-serif",s.textAlign="left",s.textBaseline="top",s.clearRect(0,0,g,h),r>1e5?(s.fillStyle="red",s.fillRect(0,0,g,h),s.fillStyle="black"):(s.clearRect(0,0,g,h),s.fillStyle="blue"),s.fillText(i,0,0);const n=new c;return n.wrapMode=u.CLAMP_TO_EDGE,n.samplingMode=m.NEAREST,e.texture=new f(t,n,o),e.texture}}export{p as default};
5
+ import{f as t}from"../../../../../chunks/vec4f32.js";import{Pos2b as e}from"../DefaultVertexAttributeLayouts.js";import r from"./WGLBrush.js";import{background as i}from"../shaders/BackgroundPrograms.js";import{tileInfo as s}from"../shaders/TileInfoPrograms.js";import{BufferObject as o}from"../../../../webgl/BufferObject.js";import{BlendFactor as n,PrimitiveType as a,Usage as l,TextureWrapMode as u,TextureSamplingMode as m}from"../../../../webgl/enums.js";import{createProgram as f}from"../../../../webgl/ProgramTemplate.js";import{Texture as _}from"../../../../webgl/Texture.js";import{TextureDescriptor as c}from"../../../../webgl/TextureDescriptor.js";import{VertexArrayObject as g}from"../../../../webgl/VertexArrayObject.js";import d from"../../../../webgl/capabilities/isWebGL2Context.js";const h=300,b=32;class p extends r{constructor(){super(...arguments),this._color=t(1,0,0,1)}dispose(){this._outlineProgram?.dispose(),this._outlineProgram=null,this._tileInfoProgram?.dispose(),this._tileInfoProgram=null,this._outlineVertexArrayObject?.dispose(),this._outlineVertexArrayObject=null,this._tileInfoVertexArrayObject?.dispose(),this._tileInfoVertexArrayObject=null,this._canvas=null}prepareState({context:t}){t.setBlendingEnabled(!0),t.setBlendFunctionSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0),t.setStencilWriteMask(0),t.setStencilTestEnabled(!1)}draw(t,e){const{context:r,requestRender:i,allowDelayedRender:s}=t;if(!e.isReady)return;if(this._loadWGLResources(r),s&&null!=i&&(!this._outlineProgram.compiled||!this._tileInfoProgram.compiled))return void i();r.bindVAO(this._outlineVertexArrayObject),r.useProgram(this._outlineProgram),this._outlineProgram.setUniformMatrix3fv("u_dvsMat3",e.transforms.dvs),this._outlineProgram.setUniform2f("u_coord_range",e.rangeX,e.rangeY),this._outlineProgram.setUniform1f("u_depth",0),this._outlineProgram.setUniform4fv("u_color",this._color),r.drawArrays(a.LINE_STRIP,0,4);const o=this._getTexture(r,e);o?(r.bindVAO(this._tileInfoVertexArrayObject),r.useProgram(this._tileInfoProgram),r.bindTexture(o,0),this._tileInfoProgram.setUniformMatrix3fv("u_dvsMat3",e.transforms.dvs),this._tileInfoProgram.setUniform1f("u_depth",0),this._tileInfoProgram.setUniform2f("u_coord_ratio",e.rangeX/e.width,e.rangeY/e.height),this._tileInfoProgram.setUniform2f("u_delta",8,8),this._tileInfoProgram.setUniform2f("u_dimensions",o.descriptor.width,o.descriptor.height),r.drawArrays(a.TRIANGLE_STRIP,0,4),r.bindVAO()):r.bindVAO()}_loadWGLResources(t){if(this._outlineProgram&&this._tileInfoProgram)return;const r=f(t,i),n=f(t,s),a=new Int8Array([0,0,1,0,1,1,0,1]),u=o.createVertex(t,l.STATIC_DRAW,a),m=new g(t,i.attributes,e,{geometry:u}),_=new Int8Array([0,0,1,0,0,1,1,1]),c=o.createVertex(t,l.STATIC_DRAW,_),d=new g(t,s.attributes,e,{geometry:c});this._outlineProgram=r,this._tileInfoProgram=n,this._outlineVertexArrayObject=m,this._tileInfoVertexArrayObject=d}_getTexture(t,e){if(e.texture&&e.triangleCountReportedInDebug===e.triangleCount)return e.texture;e.triangleCountReportedInDebug=e.triangleCount,this._canvas||(this._canvas=document.createElement("canvas"),this._canvas.setAttribute("id","canvas2d"),this._canvas.setAttribute("width",`${h}`),this._canvas.setAttribute("height",`${b}`),this._canvas.setAttribute("style","display:none"));const r=e.triangleCount;let i=e.key.id;e.triangleCount>0&&(i+=`, ${r}`);const s=this._canvas,o=s.getContext("2d");o.font="24px sans-serif",o.textAlign="left",o.textBaseline="top",o.clearRect(0,0,h,b),r>1e5?(o.fillStyle="red",o.fillRect(0,0,h,b),o.fillStyle="black"):(o.clearRect(0,0,h,b),o.fillStyle="blue"),o.fillText(i,0,0);const n=new c;return n.wrapMode=u.CLAMP_TO_EDGE,n.samplingMode=m.NEAREST,n.isImmutable=d(t.gl),e.texture=new _(t,n,s),e.texture}}export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as t}from"../../../../../../core/maybe.js";import e from"../../VertexStream.js";import{BlendFactor as s,PixelFormat as i,TextureWrapMode as r}from"../../../../../webgl/enums.js";import{FramebufferObject as o}from"../../../../../webgl/FramebufferObject.js";import{TextureDescriptor as n}from"../../../../../webgl/TextureDescriptor.js";const a=5,u=[1,0],l=[0,1],m=[1,.8,.6,.4,.2],_=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];class h{constructor(){this._intensityFBO=null,this._compositeFBO=null,this._mipsFBOs=new Array(a),this._nMips=a,this._kernelSizeArray=[3,5,7,9,11],this._size=[0,0],this._programDesc={luminosityHighPass:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/luminosityHighPass",attributes:new Map([["a_position",0]])},gaussianBlur:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/gaussianBlur",attributes:new Map([["a_position",0]])},composite:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/composite",attributes:new Map([["a_position",0]])},blit:{vsPath:"post-processing/pp",fsPath:"post-processing/blit",attributes:new Map([["a_position",0]])}}}dispose(){if(this._quad=t(this._quad),this._intensityFBO=t(this._intensityFBO),this._compositeFBO=t(this._compositeFBO),this._mipsFBOs){for(let t=0;t<this._nMips;t++)this._mipsFBOs[t]&&(this._mipsFBOs[t].horizontal.dispose(),this._mipsFBOs[t].vertical.dispose());this._mipsFBOs=null}}draw(t,i,r){const{width:o,height:n}=i,{context:h,painter:p}=t,{materialManager:c}=p,d=h.gl,f=this._programDesc,{strength:b,radius:F,threshold:O}=r;this._quad||(this._quad=new e(h,[-1,-1,1,-1,-1,1,1,1])),this._createOrResizeResources(t,o,n),h.setStencilTestEnabled(!1),h.setBlendingEnabled(!0),h.setBlendFunction(s.ONE,s.ONE_MINUS_SRC_ALPHA),h.setStencilWriteMask(0);const B=this._quad;B.bind(),h.bindFramebuffer(this._intensityFBO);const g=c.getProgram(f.luminosityHighPass);h.useProgram(g),h.bindTexture(i.colorTexture,0),g.setUniform1i("u_texture",0),g.setUniform3fv("u_defaultColor",[0,0,0]),g.setUniform1f("u_defaultOpacity",0),g.setUniform1f("u_luminosityThreshold",O),g.setUniform1f("u_smoothWidth",.01);const x=[Math.round(o/2),Math.round(n/2)];h.setViewport(0,0,x[0],x[1]),h.setClearColor(0,0,0,0),h.clear(d.COLOR_BUFFER_BIT),B.draw(),h.setBlendingEnabled(!1);let T=this._intensityFBO.colorTexture;for(let e=0;e<this._nMips;e++){const t=c.getProgram(f.gaussianBlur,[{name:"radius",value:this._kernelSizeArray[e]}]);h.useProgram(t),h.bindTexture(T,e+1),t.setUniform1i("u_colorTexture",e+1),t.setUniform2fv("u_texSize",x),t.setUniform2fv("u_direction",u),h.setViewport(0,0,x[0],x[1]);const s=this._mipsFBOs[e];h.bindFramebuffer(s.horizontal),B.draw(),T=s.horizontal.colorTexture,h.bindFramebuffer(s.vertical),h.bindTexture(T,e+1),t.setUniform2fv("u_direction",l),B.draw(),T=s.vertical.colorTexture,x[0]=Math.round(x[0]/2),x[1]=Math.round(x[1]/2)}h.setViewport(0,0,o,n);const w=c.getProgram(f.composite,[{name:"nummips",value:a}]);h.bindFramebuffer(this._compositeFBO),h.useProgram(w),w.setUniform1f("u_bloomStrength",b),w.setUniform1f("u_bloomRadius",F),w.setUniform1fv("u_bloomFactors",m),w.setUniform3fv("u_bloomTintColors",_),h.bindTexture(this._mipsFBOs[0].vertical.colorTexture,1),w.setUniform1i("u_blurTexture1",1),h.bindTexture(this._mipsFBOs[1].vertical.colorTexture,2),w.setUniform1i("u_blurTexture2",2),h.bindTexture(this._mipsFBOs[2].vertical.colorTexture,3),w.setUniform1i("u_blurTexture3",3),h.bindTexture(this._mipsFBOs[3].vertical.colorTexture,4),w.setUniform1i("u_blurTexture4",4),h.bindTexture(this._mipsFBOs[4].vertical.colorTexture,5),w.setUniform1i("u_blurTexture5",5),B.draw(),h.bindFramebuffer(i),h.setBlendingEnabled(!0);const M=c.getProgram(f.blit);h.useProgram(M),h.bindTexture(this._compositeFBO.colorTexture,6),M.setUniform1i("u_texture",6),h.setBlendFunction(s.ONE,s.ONE),B.draw(),B.unbind(),h.setBlendFunction(s.ONE,s.ONE_MINUS_SRC_ALPHA),h.setStencilTestEnabled(!0)}_createOrResizeResources(t,e,s){const{context:a}=t;if(this._compositeFBO&&this._size[0]===e&&this._size[1]===s)return;this._size[0]=e,this._size[1]=s;const u=[Math.round(e/2),Math.round(s/2)];if(this._compositeFBO?this._compositeFBO.resize(e,s):this._compositeFBO=new o(a,new n(e,s)),this._intensityFBO)this._intensityFBO.resize(u[0],u[1]);else{const t=new n(u[0],u[1]);t.internalFormat=i.RGBA,t.wrapMode=r.CLAMP_TO_EDGE,this._intensityFBO=new o(a,t)}for(let l=0;l<this._nMips;l++){if(this._mipsFBOs[l])this._mipsFBOs[l].horizontal.resize(u[0],u[1]),this._mipsFBOs[l].vertical.resize(u[0],u[1]);else{const t=new n(u[0],u[1]);t.internalFormat=i.RGBA,t.wrapMode=r.CLAMP_TO_EDGE,this._mipsFBOs[l]={horizontal:new o(a,t),vertical:new o(a,t)}}u[0]=Math.round(u[0]/2),u[1]=Math.round(u[1]/2)}}}export{h as Bloom};
5
+ import{disposeMaybe as t}from"../../../../../../core/maybe.js";import e from"../../VertexStream.js";import{BlendFactor as s,PixelFormat as i,TextureWrapMode as r}from"../../../../../webgl/enums.js";import{FramebufferObject as o}from"../../../../../webgl/FramebufferObject.js";import{TextureDescriptor as n}from"../../../../../webgl/TextureDescriptor.js";const a=5,u=[1,0],l=[0,1],m=[1,.8,.6,.4,.2],_=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];class h{constructor(){this._intensityFBO=null,this._compositeFBO=null,this._mipsFBOs=new Array(a),this._nMips=a,this._kernelSizeArray=[3,5,7,9,11],this._size=[0,0],this._programDesc={luminosityHighPass:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/luminosityHighPass",attributes:new Map([["a_position",0]])},gaussianBlur:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/gaussianBlur",attributes:new Map([["a_position",0]])},composite:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/composite",attributes:new Map([["a_position",0]])},blit:{vsPath:"post-processing/pp",fsPath:"post-processing/blit",attributes:new Map([["a_position",0]])}}}dispose(){if(this._quad=t(this._quad),this._intensityFBO=t(this._intensityFBO),this._compositeFBO=t(this._compositeFBO),this._mipsFBOs){for(let t=0;t<this._nMips;t++)this._mipsFBOs[t]&&(this._mipsFBOs[t].horizontal.dispose(),this._mipsFBOs[t].vertical.dispose());this._mipsFBOs=null}}draw(t,i,r){const{width:o,height:n}=i,{context:h,painter:p}=t,{materialManager:c}=p,d=h.gl,f=this._programDesc,{strength:b,radius:F,threshold:O}=r;this._quad||(this._quad=new e(h,[-1,-1,1,-1,-1,1,1,1])),this._createOrResizeResources(t,o,n),h.setStencilTestEnabled(!1),h.setBlendingEnabled(!0),h.setBlendFunction(s.ONE,s.ONE_MINUS_SRC_ALPHA),h.setStencilWriteMask(0);const B=this._quad;B.bind(),h.bindFramebuffer(this._intensityFBO);const g=c.getProgram(f.luminosityHighPass);h.useProgram(g),h.bindTexture(i.colorTexture,0),g.setUniform1i("u_texture",0),g.setUniform3fv("u_defaultColor",[0,0,0]),g.setUniform1f("u_defaultOpacity",0),g.setUniform1f("u_luminosityThreshold",O),g.setUniform1f("u_smoothWidth",.01);const T=[Math.round(o/2),Math.round(n/2)];h.setViewport(0,0,T[0],T[1]),h.setClearColor(0,0,0,0),h.clear(d.COLOR_BUFFER_BIT),B.draw(),h.setBlendingEnabled(!1);let x=this._intensityFBO.colorTexture;for(let e=0;e<this._nMips;e++){const t=c.getProgram(f.gaussianBlur,[{name:"radius",value:this._kernelSizeArray[e]}]);h.useProgram(t),h.bindTexture(x,e+1),t.setUniform1i("u_colorTexture",e+1),t.setUniform2fv("u_texSize",T),t.setUniform2fv("u_direction",u),h.setViewport(0,0,T[0],T[1]);const s=this._mipsFBOs[e];h.bindFramebuffer(s.horizontal),B.draw(),x=s.horizontal.colorTexture,h.bindFramebuffer(s.vertical),h.bindTexture(x,e+1),t.setUniform2fv("u_direction",l),B.draw(),x=s.vertical.colorTexture,T[0]=Math.round(T[0]/2),T[1]=Math.round(T[1]/2)}h.setViewport(0,0,o,n);const w=c.getProgram(f.composite,[{name:"nummips",value:a}]);h.bindFramebuffer(this._compositeFBO),h.useProgram(w),w.setUniform1f("u_bloomStrength",b),w.setUniform1f("u_bloomRadius",F),w.setUniform1fv("u_bloomFactors",m),w.setUniform3fv("u_bloomTintColors",_),h.bindTexture(this._mipsFBOs[0].vertical.colorTexture,1),w.setUniform1i("u_blurTexture1",1),h.bindTexture(this._mipsFBOs[1].vertical.colorTexture,2),w.setUniform1i("u_blurTexture2",2),h.bindTexture(this._mipsFBOs[2].vertical.colorTexture,3),w.setUniform1i("u_blurTexture3",3),h.bindTexture(this._mipsFBOs[3].vertical.colorTexture,4),w.setUniform1i("u_blurTexture4",4),h.bindTexture(this._mipsFBOs[4].vertical.colorTexture,5),w.setUniform1i("u_blurTexture5",5),B.draw(),h.bindFramebuffer(i),h.setBlendingEnabled(!0);const M=c.getProgram(f.blit);h.useProgram(M),h.bindTexture(this._compositeFBO.colorTexture,6),M.setUniform1i("u_texture",6),h.setBlendFunction(s.ONE,s.ONE),B.draw(),B.unbind(),h.setBlendFunction(s.ONE,s.ONE_MINUS_SRC_ALPHA),h.setStencilTestEnabled(!0)}_createOrResizeResources(t,e,s){const{context:a}=t;if(this._compositeFBO&&this._size[0]===e&&this._size[1]===s)return;this._size[0]=e,this._size[1]=s;const u=[Math.round(e/2),Math.round(s/2)];if(this._compositeFBO)this._compositeFBO.resize(e,s);else{const t=new n(e,s);t.internalFormat=i.RGBA,t.wrapMode=r.CLAMP_TO_EDGE,this._compositeFBO=new o(a,t)}if(this._intensityFBO)this._intensityFBO.resize(u[0],u[1]);else{const t=new n(u[0],u[1]);t.internalFormat=i.RGBA,t.wrapMode=r.CLAMP_TO_EDGE,this._intensityFBO=new o(a,t)}for(let l=0;l<this._nMips;l++){if(this._mipsFBOs[l])this._mipsFBOs[l].horizontal.resize(u[0],u[1]),this._mipsFBOs[l].vertical.resize(u[0],u[1]);else{const t=new n(u[0],u[1]);t.internalFormat=i.RGBA,t.wrapMode=r.CLAMP_TO_EDGE,this._mipsFBOs[l]={horizontal:new o(a,t),vertical:new o(a,t)}}u[0]=Math.round(u[0]/2),u[1]=Math.round(u[1]/2)}}}export{h as Bloom};