@arcgis/core 4.26.0-next.20221224 → 4.26.0-next.20221225
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,{Z:()=>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",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.26.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){if(super(e,t,r),!(this instanceof i))return new i(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:()=>a});var n=r(68773),o=(r(80442),r(70586)),s=r(19153);const i={info:0,warn:1,error:2,none:3};class a{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,a._loggers[this.module]=this;const t=this.module.lastIndexOf(".");-1!==t&&(this._parent=a.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=a._loggers;return a._loggers=e,t},set throttlingDisabled(e){a._throttlingDisabled=e}}}static getLogger(e){let t=a._loggers[e];return t||(t=new a({module:e})),t}_log(e,t,...r){if(this._matchLevel(e)){if("always"!==t&&!a._throttlingDisabled){const n=this._argsToKey(r),o=this._loggedMessages[e].get(n);if("once"===t&&null!=o||"oncePerTick"===t&&o&&o>=a._tickCounter)return;this._loggedMessages[e].set(n,a._tickCounter),a._scheduleTickCounterIncrement()}for(const t of n.Z.log.interceptors)if(t(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,t){let r=this;for(;(0,o.pC)(r);){const t=r[e];if((0,o.pC)(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.Z.log.level?n.Z.log.level:"warn";return i[this._parentWithMember("level",t)]<=i[e]}_argsToKey(...e){return(0,s.hP)(JSON.stringify(e,((e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]")))}static _scheduleTickCounterIncrement(){a._tickCounterScheduled||(a._tickCounterScheduled=!0,Promise.resolve().then((()=>{a._tickCounter++,a._tickCounterScheduled=!1})))}}a._loggers={},a._tickCounter=0,a._tickCounterScheduled=!1,a._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 instanceof o&&(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:()=>m,Od:()=>y,SO:()=>d,Vx:()=>i,a9:()=>u,cq:()=>p,e$:()=>b,e5:()=>a,fS:()=>s,w6:()=>f,zG:()=>c});var n=r(70586),o=r(77734);function s(e,t,r){if((0,n.Wi)(e)&&(0,n.Wi)(t))return!0;if((0,n.Wi)(e)||(0,n.Wi)(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 i(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 a(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 c(e){return e&&"number"==typeof e.length}const l=!!Array.prototype.fill;function u(e,t){if(l)return new Array(e).fill(t);const r=new Array(e);for(let n=0;n<e;n++)r[n]=t;return r}function f(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 d{constructor(){this.last=0}}const h=new d;function p(e,t,r,n){n=n||h;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 b(e,t,r,n){const o=r??e.length,s=p(e,t,o,n);if(-1!==s)return e[s]=e[o-1],null==r&&e.pop(),t}const g=new Set;function m(e,t,r=e.length,n=t.length,o,s){if(0===n||0===r)return r;g.clear();for(let e=0;e<n;++e)g.add(t[e]);o=o||h;const i=Math.max(0,o.last-10);for(let t=i;t<r;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[r-1],--r,--t,0===g.size||0===r))return g.clear(),r;for(let t=0;t<i;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[r-1],--r,--t,0===g.size||0===r))return g.clear(),r;return g.clear(),r}function y(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}new o.Z},60235:(e,t,r)=>{"use strict";r.d(t,{Mr:()=>i,x9:()=>a});var n=r(80442);const o=new Set;function s(e,t,r=!1){r&&o.has(t)||(r&&o.add(t),e.warn(`🛑 DEPRECATED - ${t}`))}function i(e,t,r={}){if((0,n.Z)("esri-deprecation-warnings")){const{moduleName:n}=r;a(e,"Property: "+(n?n+"::":"")+t,r)}}function a(e,t,r={}){if((0,n.Z)("esri-deprecation-warnings")){const{replacement:n,version:o,see:i,warnOnce:a}=r;let c=t;n&&(c+=`\n\t🛠️ Replacement: ${n}`),o&&(c+=`\n\t⚙️ Version: ${o}`),i&&(c+=`\n\t🔗 See ${i} for more details.`),s(e,c,a)}}},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("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("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),o.add("featurelayer-simplify-payload-size-factors",[1,1,4]),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("mapimagelayer-popup-identify-max-tolerance",20),o.add("heatmap-allow-raster-fallback",!0),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:()=>c,d9:()=>a,fS:()=>p,y7:()=>b,yd:()=>i});var n=r(67676),o=r(70586),s=r(1533);function i(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&i(e[r],!0));else for(r in e)e.hasOwnProperty(r)&&void 0===e[r]&&delete e[r];return e}function a(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=h(e);if((0,o.pC)(t))return t;if(l(e))return e.clone();if(u(e))return e.map(a);if(f(e))return e.clone();const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=a(e[t]);return r}function c(e){if(!e||"object"!=typeof e||"function"==typeof e||"HTMLElement"in globalThis&&e instanceof HTMLElement)return e;const t=h(e);if((0,o.pC)(t))return t;if(u(e)){let t=!0;const r=e.map((e=>{const r=c(e);return null!=e&&null==r&&(t=!1),r}));return t?r:null}if(l(e))return e.clone();if(!f(e)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const r of Object.getOwnPropertyNames(e)){const n=e[r],o=c(n);if(null!=n&&null==o)return null;t[r]=o}return t}return null}function l(e){return"function"==typeof e.clone}function u(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function f(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function d(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function h(e){if((0,s.W0)(e)||(0,s.lq)(e)||(0,s.KZ)(e)||(0,s.z3)(e)||(0,s.Uc)(e)||(0,s.Hx)(e)||(0,s.ZY)(e)||(0,s.xZ)(e)||(0,s.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,a(n));return t}if(e instanceof Set){const t=new Set;for(const r of e)t.add(a(r));return t}return null}function p(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 b(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):!!d(e)&&d(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){return null!=e}function o(e){return null==e}function s(e,t){return n(e)?t(e):null}function i(e){return e}function a(e,t){return c(e,t),e}function c(e,t){if(o(e))throw new Error(t??"value is None")}function l(e,t){return n(e)?e:"function"==typeof t?t():t}function u(e,t){return n(e)?e:t}function f(e){return n(e)&&e.destroy(),null}function d(e){return n(e)&&e.dispose(),null}function h(e){return n(e)&&e.remove(),null}function p(e){return n(e)&&e.abort(),null}function b(e){return n(e)&&e.release(),null}function g(e,t,r){return n(e)&&n(t)?n(r)?r(e,t):e.equals(t):e===t}function m(e){return null}function y(e,t){const r=new Array;for(const n of e)r.push(v(n,null,t));return r}function w(e,t){for(const r of e)s(r,t)}function v(e,t,r){return n(e)?r(e):t}function _(e){return e.filter((e=>n(e)))}function O(e,...t){let r=e;for(let e=0;e<t.length&&r;++e)r=r[t[e]];return r}function k(e){return e}r.d(t,{Fd:()=>y,IM:()=>p,JR:()=>w,M2:()=>d,O3:()=>c,Pt:()=>l,R2:()=>v,RY:()=>b,SC:()=>f,U2:()=>O,Wg:()=>i,Wi:()=>o,_W:()=>g,hw:()=>h,j0:()=>k,lV:()=>_,pC:()=>n,s3:()=>a,wN:()=>m,yl:()=>u,yw:()=>s})},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:()=>O,zE:()=>c,dD:()=>w,hh:()=>C,Ds:()=>P,as:()=>v,WW:()=>_,R8:()=>y,D_:()=>m,Hc:()=>f,y8:()=>k,fu:()=>p,$F:()=>b,r9:()=>d,k_:()=>l,H9:()=>h,Yn:()=>j,gx:()=>S,Hl:()=>g});const n=(o=globalThis,{setTimeout:(e,t)=>{const r=o.setTimeout(e,t);return{remove:()=>o.clearTimeout(r)}}});var o;r(60235);var 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(0,a.pC)(e)?"aborted"in e?e:e.signal:e}function f(e){const t=u(e);return(0,a.pC)(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(!(0,a.Wi)(r)){if(!r.aborted)return(0,i.IH)(r,"abort",(()=>t()));t()}}function b(e,t){const r=u(e);if(!(0,a.Wi)(r))return l(r),(0,i.IH)(r,"abort",(()=>t(c())))}function g(e,t){const r=u(t);return(0,a.Wi)(r)?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}}function w(){let e=null;const t=new Promise(((t,r)=>{e={promise:void 0,resolve:t,reject:r}}));return e.promise=t,e}async function v(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e),r=t.map((t=>e[t])),n=await v(r),o={};return t.map(((e,t)=>o[e]=n[t])),o}const t=e;return new Promise((e=>{const r=[];let n=t.length;0===n&&e(r),t.forEach((t=>{const o={promise:t||Promise.resolve(t)};r.push(o),o.promise.then((e=>{o.value=e})).catch((e=>{o.error=e})).then((()=>{--n,0===n&&e(r)}))}))}))}async function _(e){return(await v(e)).filter((e=>!!e.value)).map((e=>e.value))}function O(e,t,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 k(e){return e&&"function"==typeof e.then}function S(e){return k(e)?e:Promise.resolve(e)}function P(e,t=-1){let r,n,o,s,i=null;const l=(...u)=>{if(r){n=u,s&&s.reject(c()),s=w();const e=(0,a.j0)(s.promise);if(i){const e=i;i=null,e.abort()}return e}if(o=s||w(),s=null,t>0){const n=new AbortController;r=S(e(...u,n.signal));const o=r;O(t).then((()=>{r===o&&(s?n.abort():i=n)}))}else r=1,r=S(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 C(){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 j(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 e&&e.constructor&&"Int8Array"===e.constructor.name}function s(e){return e&&e.constructor&&"Uint8Array"===e.constructor.name}function i(e){return e&&e.constructor&&"Uint8ClampedArray"===e.constructor.name}function a(e){return e&&e.constructor&&"Int16Array"===e.constructor.name}function c(e){return e&&e.constructor&&"Uint16Array"===e.constructor.name}function l(e){return e&&e.constructor&&"Int32Array"===e.constructor.name}function u(e){return e&&e.constructor&&"Uint32Array"===e.constructor.name}function f(e){return e&&e.constructor&&"Float32Array"===e.constructor.name}function d(e){return e&&e.constructor&&"Float64Array"===e.constructor.name}r.d(t,{DB:()=>h,Hx:()=>l,KZ:()=>i,Uc:()=>c,W0:()=>o,ZY:()=>u,eP:()=>n,fS:()=>d,lq:()=>s,xZ:()=>f,z3:()=>a});const h=1024},17452:(e,t,r)=>{"use strict";r.d(t,{$U:()=>ne,AH:()=>V,B7:()=>j,D6:()=>L,Fv:()=>F,HK:()=>K,Hu:()=>de,Ie:()=>ue,L:()=>k,Ml:()=>be,P$:()=>B,PF:()=>Z,Qj:()=>le,R9:()=>y,TI:()=>O,YP:()=>H,Yd:()=>ae,ZN:()=>he,_l:()=>X,b7:()=>E,ed:()=>N,fZ:()=>ge,fl:()=>pe,hF:()=>q,hO:()=>oe,io:()=>ee,jc:()=>z,kl:()=>U,mN:()=>S,oC:()=>te,oh:()=>W,qg:()=>T,rS:()=>Q,sJ:()=>Y,tD:()=>$,tm:()=>I,u0:()=>P,v_:()=>D,vt:()=>ce});var n=r(68773),o=r(20102),s=r(92604),i=r(70586);const a=s.Z.getLogger("esri.core.urlUtils"),c=n.Z.request,l="esri/config: esriConfig.request.proxyUrl is not set.",u=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,d=/^\s*https:/i,h=/^\s*file:/i,p=/:\d+$/,b=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),m=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class y{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,i.j0)(this.uri.match(g));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,i.j0)(this.authority.match(m)),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 w={};let v=new y(n.Z.applicationUrl);let _=function(){const e=(0,i.j0)(v.path),t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${v.scheme}://${v.host}${null!=v.port?`:${v.port}`:""}${t}`}();const O=()=>v,k=()=>_;function S(e){if(!e)return null;const t={path:null,query:null},r=new y(e),n=e.indexOf("?");return null===r.query?t.path=e:(t.path=e.substring(0,n),t.query=P(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 P(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 C(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}function j(e,t){return e?t&&"function"==typeof t?Object.keys(e).map((r=>encodeURIComponent(r)+"="+encodeURIComponent(t(r,e[r])))).join("&"):Object.keys(e).map((r=>{const n=e[r];if(null==n)return"";const o=encodeURIComponent(r)+"=",s=t&&t[r];return s?o+encodeURIComponent(s(n)):Array.isArray(n)?n.map((e=>C(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e))).join("&"):C(n)?o+encodeURIComponent(JSON.stringify(n)):o+encodeURIComponent(n)})).filter((e=>e)).join("&"):""}function E(e=!1){let t,r=c.proxyUrl;if("string"==typeof e){t=ne(e);const n=N(e);n&&(r=n.proxyUrl)}else t=!!e;if(!r)throw a.warn(l),new o.Z("urlutils:proxy-not-set",l);return t&&se()&&(r=oe(r)),S(r)}function T(e){const t=N(e);let r,n;if(t){const e=A(t.proxyUrl);r=e.path,n=e.query?P(e.query):null}if(r){const t=S(e);e=r+"?"+t.path;const o=j({...n,...t.query});o&&(e=`${e}?${o}`)}return e}const x={path:"",query:""};function A(e){const t=e.indexOf("?");return-1!==t?(x.path=e.slice(0,t),x.query=e.slice(t+1)):(x.path=e,x.query=null),x}function M(e){return(e=ie(e=function(e){return e&&"/"===e[e.length-1]?e:`${e}/`}(e=A(e).path),!0)).toLowerCase()}function $(e){const t={proxyUrl:e.proxyUrl,urlPrefix:M(e.urlPrefix)},r=c.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 N(e){const t=c.proxyRules,r=M(e);for(let e=0;e<t.length;e++)if(0===r.indexOf(t[e].urlPrefix))return t[e]}function I(e,t){return e=R(e),t=R(t),ie(e)===ie(t)}function R(e){const t=(e=F(e)).indexOf("/sharing");return t>0?e.substring(0,t):e.replace(/\/+$/,"")}function W(e){const t=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t),r=c.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 L(e,t,r=!1){if(!e||!t)return!1;const n=fe(e),o=fe(t);return!(!r&&n.scheme!==o.scheme)&&null!=n.host&&null!=o.host&&n.host.toLowerCase()===o.host.toLowerCase()&&n.port===o.port}function U(e){if("string"==typeof e){if(!H(e))return!0;e=fe(e)}if(L(e,v))return!0;const t=c.trustedServers||[];for(let r=0;r<t.length;r++){const n=J(t[r]);for(let t=0;t<n.length;t++)if(L(e,n[t]))return!0}return!1}function J(e){return w[e]||(re(e)||te(e)?w[e]=[new y(q(e))]:w[e]=[new y(`http://${e}`),new y(`https://${e}`)]),w[e]}function q(e,t=_,r){return te(e)?r&&r.preserveProtocolRelative?e:"http"===v.scheme&&v.authority===B(e).slice(2)?`http:${e}`:`https:${e}`:re(e)?e:(0,i.j0)(D("/"===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=_,r){if(null==e||!H(e))return e;const n=F(e),o=n.toLowerCase(),s=F(t).toLowerCase().replace(/\/+$/,""),i=r?F(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 F(e){return function(e){const t=c.httpsDomains;if(!function(e){return null!=e&&f.test(e)||"http"===v.scheme&&te(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),p.test(n)){if(!n.endsWith(":80"))return e;n=n.slice(0,-3),e=e.replace(":80","")}return"http"===v.scheme&&n===v.authority&&!b.test(e)||(se()&&n===v.authority||t&&t.some((e=>n===e||n.endsWith(`.${e}`)))||se()&&!N(e))&&(e=oe(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=A(e);e=(e=t.path.replace(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=q(e=e.trim()))))}function D(...e){const t=e.filter(i.pC);if(!t||!t.length)return;const r=[];if(H(t[0])){const e=t[0],n=e.indexOf("//");-1!==n&&(r.push(e.slice(0,n+1)),function(e){return null!=e&&h.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 B(e,t=!1){if(null==e||z(e)||K(e))return null;let r=e.indexOf("://");if(-1===r&&te(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=ie(e,!0)),e}function H(e){return te(e)||re(e)}function z(e){return null!=e&&"blob:"===e.slice(0,5)}function K(e){return null!=e&&"data:"===e.slice(0,5)}function V(e){const t=Y(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 Q(e){return btoa(String.fromCharCode.apply(null,e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const G=/^data:(.*?)(;base64)?,(.*)$/;function Y(e){const t=e.match(G);if(!t)return null;const[,r,n,o]=t;return{mediaType:r,isBase64:!!n,data:o}}function X(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}function ee(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);return r.download=t,r.href=n,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n),!0})(e,t)||function(e,t){!!window.navigator.msSaveOrOpenBlob&&window.navigator.msSaveOrOpenBlob(e,t)}(e,t)}function te(e){return null!=e&&"/"===e[0]&&"/"===e[1]}function re(e){return null!=e&&u.test(e)}function ne(e){return null!=e&&d.test(e)||"https"===v.scheme&&te(e)}function oe(e){return te(e)?`https:${e}`:e.replace(f,"https:")}function se(){return"https"===v.scheme}function ie(e,t=!1){return te(e)?e.slice(2):(e=e.replace(u,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function ae(e){let t=0;if(H(e)){const r=e.indexOf("//");-1!==r&&(t=r+2)}const r=e.lastIndexOf("/");return r<t?e:e.slice(0,r+1)}function ce(e,t){if(!e)return"";const r=S(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 le(e){return e.replace(/\/+$/,"")}function ue(e,t,r){if(!(t&&r&&e&&H(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 fe(e){return"string"==typeof e?new y(q(e)):(e.scheme||(e.scheme=v.scheme),e)}function de(e,t){const r=S(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 he(e,t,r){const n=S(e),o=n.query||{};return o[t]=String(r),`${n.path}?${j(o)}`}function pe(e,t){const r=S(e),n=r.query||{};for(const e in t)n[e]=t[e];const o=j(n);return o?`${r.path}?${o}`:r.path}function be(e){if((0,i.Wi)(e))return null;const t=e.match(me);return t?t[2]:null}function ge(e){if((0,i.Wi)(e))return null;const t=e.match(me);return t?{path:t[1],extension:t[2]}:{path:e,extension:null}}const me=/([^.]*)\.([^\/]*)$/},25045:(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),c=r(94362),l=r(17202);const u={statsWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(3847),r.e(6841)]).then(r.bind(r,36841)),geometryEngineWorker:()=>Promise.all([r.e(5837),r.e(8227)]).then(r.bind(r,48227)),CSVSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1534),r.e(1562),r.e(5886),r.e(3847),r.e(9777),r.e(8833),r.e(4807),r.e(7154)]).then(r.bind(r,27793)),EdgeProcessingWorker:()=>Promise.all([r.e(6481),r.e(212),r.e(2062)]).then(r.bind(r,49594)),ElevationSamplerWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(4807),r.e(6481),r.e(6459),r.e(98)]).then(r.bind(r,61787)),FeatureServiceSnappingSourceWorker:()=>Promise.all([r.e(4547),r.e(5795),r.e(1400),r.e(1534),r.e(1562),r.e(4599),r.e(5886),r.e(3847),r.e(9777),r.e(8833),r.e(4807),r.e(3660)]).then(r.bind(r,65967)),GeoJSONSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1534),r.e(1562),r.e(5886),r.e(3847),r.e(9777),r.e(8833),r.e(4807),r.e(7774),r.e(7845)]).then(r.bind(r,97845)),LercWorker:()=>r.e(3027).then(r.bind(r,23027)),MemorySourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1534),r.e(1562),r.e(5886),r.e(3847),r.e(9777),r.e(8833),r.e(4807),r.e(7774),r.e(639)]).then(r.bind(r,30639)),PBFDecoderWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(5886),r.e(1916)]).then(r.bind(r,61916)),Pipeline:()=>Promise.all([r.e(4547),r.e(4321),r.e(5795),r.e(1400),r.e(1534),r.e(1562),r.e(4599),r.e(5886),r.e(3847),r.e(9777),r.e(8833),r.e(4325),r.e(7483)]).then(r.bind(r,37138)),PointCloudWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(9324)]).then(r.bind(r,90447)),RasterWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(8363),r.e(3645),r.e(4370)]).then(r.bind(r,61576)),SceneLayerSnappingSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1534),r.e(1562),r.e(5886),r.e(3847),r.e(9777),r.e(6481),r.e(212),r.e(1391)]).then(r.bind(r,73248)),SceneLayerWorker:()=>r.e(1412).then(r.bind(r,31412)),WFSSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1534),r.e(1562),r.e(5886),r.e(3847),r.e(9777),r.e(8833),r.e(4807),r.e(7774),r.e(3230)]).then(r.bind(r,43230)),WorkerTileHandler:()=>Promise.all([r.e(4325),r.e(1785),r.e(6810),r.e(3388)]).then(r.bind(r,56456))},{CLOSE:f,ABORT:d,INVOKE:h,RESPONSE:p,OPEN_PORT:b,ON:g}=c.Cs;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===c.Cs.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=u[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&&r.signal,s=r&&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 l=(0,c.jt)();return new Promise(((r,o)=>{if((0,a.Hc)(n))return this._processWork(),void o((0,a.zE)());const c=(0,a.fu)(n,(()=>{const e=this._outJobs.get(l);e&&(this._outJobs.delete(l),this._processWork(),(0,i.hw)(e.abortHandle),this._post({type:d,jobId:l}),o((0,a.zE)()))})),u={resolve:r,reject:o,abortHandle:c,debugInfo:e};this._outJobs.set(l,u),this._post({type:h,jobId:l,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:c.Cs.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),{remove(){r.port1.postMessage({type:c.Cs.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,deferred: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=this._client=this._schedule=null}_onMessage(e){(0,i.pC)(this._schedule)?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const t=(0,c.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&&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 l,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`);l=f.call(u,n,{client:this,signal:s?s.signal:null})}catch(e){return void this._post({type:p,jobId:r,error:(0,c.AB)(e)})}(0,a.y8)(l)?(i.set(r,{controller:s,promise:l}),l.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,c.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:p,jobId:r},l)}_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=>{(0,c.QM)(e)?.type===c.Cs.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,c.oi)(this._port,e,t,r)}}y.kernelInfo={revision:l.$,version:n.i8,buildDate:l.r},y.clients=new Map},94362:(e,t,r)=>{"use strict";r.d(t,{AB:()=>a,Cs:()=>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||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}(e)));return t.length?t:null}},40330:(e,t,r)=>{"use strict";r.d(t,{Dp:()=>l,Nv:()=>i,i8:()=>s,id:()=>a,qh:()=>c});var n=r(80442),o=r(17452);const s="4.26",i={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,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 a;function c(e){a=e}function l(e){const t=a&&a.findCredential(e);return t&&t.token?(0,o.ZN)(e,"token",t.token):e}(0,n.Z)("host-webworker")},17202:(e,t,r)=>{"use strict";r.d(t,{$:()=>o,r:()=>n});const n="20221224",o="c16aa57174c1c6e489a1c0f9ee01201b4db67928"}},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/"+{9:"cd14babd690c96985b05",81:"74d86e7e5ec52a2f6018",98:"74ff8c8f40d2e9c3868b",212:"f3f2759b39ab76cde66c",223:"acf800382cbcd4875865",247:"9d9e3a38c54c41f7764c",402:"1cbffa96ea6683e5f3ec",540:"96536f507bc6e501a4f7",565:"e967ffca641947212992",576:"5ec4fedbbcbb0053cf74",632:"efc9030af5aac27055a1",639:"e048641971aef9dd4da9",661:"0419bb1a147a2c464980",690:"ee91401507833875facc",739:"5983c9f28b7f63c7e1e0",759:"1b0a306176cc184e6926",819:"d1ead6e8aa7e8e21fbc6",837:"38d8d7e5ae339230dd99",908:"a80a9c725c06154ba415",911:"2187672a72e776b9b153",1070:"d9bc849d04147471aa31",1073:"7bc7b6cf75771687d81f",1074:"fa059d94d5051ded85b3",1158:"3714482f3a829d122da1",1227:"89003e387684af5ebeac",1391:"7e4a136131693bd4f77b",1400:"87579d06ffd2a491f7e2",1412:"b78e50c03cd33623eb62",1421:"106329846470141953ad",1423:"d431821ed03a6e7f4fd3",1433:"4d5bdf18feeb9c8cb6ff",1534:"1cf86638f8e097d8e6e2",1545:"c2c288d42129354dc218",1562:"a082bd3e6c6cbae3dba4",1612:"42f2ba5a86c10e50e94e",1761:"1039cd48a12e88baa97a",1773:"6ecca49fdba2618fb972",1785:"c815d4e0fa4f3ad201b6",1790:"3a00f94f8f0d49c60969",1916:"0b8dc54801a7aa5e6be3",1932:"d0807ae56d1e9d187af3",2062:"072f5a672171424668eb",2133:"9b1034ae5cd818ed279c",2134:"edc08ffed2d5bb161c8d",2422:"43f6aa5c6f6a2bf316ef",2592:"3a306358d1e76659f4ca",2664:"06ef2a1a43b2b0b66086",2710:"719ee5c4a064ea9bdfcf",2855:"0877bab7c03a1de2e713",3027:"c1ef0d8977c5c19b135f",3055:"a51c2c5d3e7f764f44d5",3172:"52b6711572ac7e058ce6",3230:"e3fd383aee378cbb0dae",3388:"f45ea484e96f44d69b20",3529:"b1bc79cc01b572f05ca1",3572:"3b689bb038ebc301c3b2",3645:"c9d57014385bff9d0b06",3660:"7f3ac66cee7e68ce945e",3668:"80c7726743baf9f54079",3743:"3c505cf66d538f84ce4b",3810:"6b589f47cb4731df1639",3847:"937a39fa2b24ab80fd13",3852:"d4338bc4a99b71c44dc2",3929:"ccbd36c83dc087b07f1c",3992:"4a2b4574b87be7b98481",4046:"ceb1770ed82fcbf72531",4166:"5f61db625e7f836f96c3",4242:"25f51196669db91dc5fc",4268:"7142779efc4ddba0fb82",4321:"21cc98b592871d141f97",4325:"e95e449c3fab1a03498c",4358:"eab47a18717478014e03",4370:"036384bab7511be0d209",4371:"4b56a15d904a64747e64",4475:"365372b903d5715bf9b7",4499:"423955dd5f10692daf3b",4547:"f2e5c6b7894793b8bd7d",4599:"bb8a670d4a1eaa458bef",4695:"247bc54f3553e91eee66",4807:"3c570c5936252956d795",5004:"faea681c279486b7a5e7",5015:"d75f1c8f8dcabdf32021",5132:"3326536d183a858a2a4d",5159:"ee50d5d0afe9bdccc84d",5179:"8f5ff4eb9d71b36a0036",5235:"7227df502cacbb6d0529",5329:"0e21e5b4d065567a6a91",5468:"7c6427767c26ef2bdf2c",5546:"52d1496c5b224690da1c",5587:"c11d857dca43de2229fc",5590:"f9d01ca95849d589b00b",5732:"83f7e22a12d90ef93e62",5795:"13da7d992cbeb39cc2c7",5837:"c419a26e2b7d20d99cef",5853:"a7bd0f0fe942973e9a22",5886:"c010210770a67a5a0429",5935:"60a08ce29d09cb07ef06",6233:"acfde5a4cce3a4589f15",6237:"1aaf284ce0ee24053bd1",6261:"43b2e17ffd5ffcbcf269",6459:"296cf6c6f3f48665a93e",6481:"2e3a4fc59789013185f4",6502:"78ff7a0a6422df4d9b4c",6584:"4c0d7a074083aa9614bb",6636:"6f7500c4f2b5776cc665",6710:"c860891552d6d886394b",6748:"7bef95b168303bdc4bf1",6774:"22677d246a80195507e6",6785:"3fb4ae8d6e8563a1c255",6794:"51b298a6f0550feb44e7",6810:"f19e2fa3af43966cdc3b",6841:"31de71018575457155e5",6904:"697787ffcb6a2b2125c2",6925:"bad2ec88d0ed090daf56",7035:"46fbfb2f815f4a543d5f",7066:"e9dd3a5c61bae6235f8e",7126:"21396e5788a07a159d77",7154:"75ce17cf13aab0440572",7202:"e9c81eee503c1b112bad",7269:"02497309e0f848bf2879",7277:"ad65c24558098f21bbf3",7374:"96e2589668159601db7e",7386:"eed89430c7bece3e752a",7476:"7a54c711fea397105ebf",7483:"e3ba96417fd75a5d2feb",7541:"190c9feab5f80e586d84",7663:"0b9c53e01d6ac1e7d5ca",7774:"1f742c3b11c76814fa4d",7845:"f8ab6e354834b9c0e857",7873:"21f7d3400c070aa45596",8092:"f1b26b73101210b8f29c",8096:"22a990a8d4d4587866a5",8227:"ee04b1c0c42cb1b18b24",8244:"be3a99c767bf3e613fc5",8363:"7ebc4be4ffe1b37f2792",8383:"e9e64936f01505bb1c1e",8636:"e0b40a4bd4b096db7a33",8691:"8335123c048fcca54808",8758:"803492088780e18de801",8828:"2eb2d49c549e53934b8b",8833:"d447ebc944a9867f5a99",8880:"eee3fb92c649ef45c900",8882:"9c6d64dc3fc89edabac4",9070:"038dc3f9ef06ef3c960c",9169:"ac4c10194e904840a4ad",9230:"df8963df0766e26d20a0",9238:"c6adbf6c29594d4ade80",9243:"d15dd77b6ac668647ab6",9291:"179efcf889111d2576c5",9296:"f86ee9fd7ac176f86796",9300:"1ec2964714528de56607",9324:"692f73ba846b8afa6b67",9513:"fa07f9d9abff17559117",9675:"078a0b134210167b629d",9771:"8914f5e72a51636a59d3",9777:"83c7c2500839c79ae9d4",9880:"1b5bdd80db9a1a410ff8",9884:"356db8b8297282c77291",9903:"6be5edf3c8e21c3ec360",9904:"05bba3ba2f9ee02f52b5"}[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");n.length&&(e=n[n.length-1].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(25045);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,{Z:()=>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",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.26.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){if(super(e,t,r),!(this instanceof i))return new i(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:()=>a});var n=r(68773),o=(r(80442),r(70586)),s=r(19153);const i={info:0,warn:1,error:2,none:3};class a{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,a._loggers[this.module]=this;const t=this.module.lastIndexOf(".");-1!==t&&(this._parent=a.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=a._loggers;return a._loggers=e,t},set throttlingDisabled(e){a._throttlingDisabled=e}}}static getLogger(e){let t=a._loggers[e];return t||(t=new a({module:e})),t}_log(e,t,...r){if(this._matchLevel(e)){if("always"!==t&&!a._throttlingDisabled){const n=this._argsToKey(r),o=this._loggedMessages[e].get(n);if("once"===t&&null!=o||"oncePerTick"===t&&o&&o>=a._tickCounter)return;this._loggedMessages[e].set(n,a._tickCounter),a._scheduleTickCounterIncrement()}for(const t of n.Z.log.interceptors)if(t(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,t){let r=this;for(;(0,o.pC)(r);){const t=r[e];if((0,o.pC)(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.Z.log.level?n.Z.log.level:"warn";return i[this._parentWithMember("level",t)]<=i[e]}_argsToKey(...e){return(0,s.hP)(JSON.stringify(e,((e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]")))}static _scheduleTickCounterIncrement(){a._tickCounterScheduled||(a._tickCounterScheduled=!0,Promise.resolve().then((()=>{a._tickCounter++,a._tickCounterScheduled=!1})))}}a._loggers={},a._tickCounter=0,a._tickCounterScheduled=!1,a._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 instanceof o&&(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:()=>m,Od:()=>y,SO:()=>d,Vx:()=>i,a9:()=>u,cq:()=>p,e$:()=>b,e5:()=>a,fS:()=>s,w6:()=>f,zG:()=>c});var n=r(70586),o=r(77734);function s(e,t,r){if((0,n.Wi)(e)&&(0,n.Wi)(t))return!0;if((0,n.Wi)(e)||(0,n.Wi)(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 i(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 a(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 c(e){return e&&"number"==typeof e.length}const l=!!Array.prototype.fill;function u(e,t){if(l)return new Array(e).fill(t);const r=new Array(e);for(let n=0;n<e;n++)r[n]=t;return r}function f(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 d{constructor(){this.last=0}}const h=new d;function p(e,t,r,n){n=n||h;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 b(e,t,r,n){const o=r??e.length,s=p(e,t,o,n);if(-1!==s)return e[s]=e[o-1],null==r&&e.pop(),t}const g=new Set;function m(e,t,r=e.length,n=t.length,o,s){if(0===n||0===r)return r;g.clear();for(let e=0;e<n;++e)g.add(t[e]);o=o||h;const i=Math.max(0,o.last-10);for(let t=i;t<r;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[r-1],--r,--t,0===g.size||0===r))return g.clear(),r;for(let t=0;t<i;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[r-1],--r,--t,0===g.size||0===r))return g.clear(),r;return g.clear(),r}function y(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}new o.Z},60235:(e,t,r)=>{"use strict";r.d(t,{Mr:()=>i,x9:()=>a});var n=r(80442);const o=new Set;function s(e,t,r=!1){r&&o.has(t)||(r&&o.add(t),e.warn(`🛑 DEPRECATED - ${t}`))}function i(e,t,r={}){if((0,n.Z)("esri-deprecation-warnings")){const{moduleName:n}=r;a(e,"Property: "+(n?n+"::":"")+t,r)}}function a(e,t,r={}){if((0,n.Z)("esri-deprecation-warnings")){const{replacement:n,version:o,see:i,warnOnce:a}=r;let c=t;n&&(c+=`\n\t🛠️ Replacement: ${n}`),o&&(c+=`\n\t⚙️ Version: ${o}`),i&&(c+=`\n\t🔗 See ${i} for more details.`),s(e,c,a)}}},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("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("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),o.add("featurelayer-simplify-payload-size-factors",[1,1,4]),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("mapimagelayer-popup-identify-max-tolerance",20),o.add("heatmap-allow-raster-fallback",!0),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:()=>c,d9:()=>a,fS:()=>p,y7:()=>b,yd:()=>i});var n=r(67676),o=r(70586),s=r(1533);function i(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&i(e[r],!0));else for(r in e)e.hasOwnProperty(r)&&void 0===e[r]&&delete e[r];return e}function a(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=h(e);if((0,o.pC)(t))return t;if(l(e))return e.clone();if(u(e))return e.map(a);if(f(e))return e.clone();const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=a(e[t]);return r}function c(e){if(!e||"object"!=typeof e||"function"==typeof e||"HTMLElement"in globalThis&&e instanceof HTMLElement)return e;const t=h(e);if((0,o.pC)(t))return t;if(u(e)){let t=!0;const r=e.map((e=>{const r=c(e);return null!=e&&null==r&&(t=!1),r}));return t?r:null}if(l(e))return e.clone();if(!f(e)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const r of Object.getOwnPropertyNames(e)){const n=e[r],o=c(n);if(null!=n&&null==o)return null;t[r]=o}return t}return null}function l(e){return"function"==typeof e.clone}function u(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function f(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function d(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function h(e){if((0,s.W0)(e)||(0,s.lq)(e)||(0,s.KZ)(e)||(0,s.z3)(e)||(0,s.Uc)(e)||(0,s.Hx)(e)||(0,s.ZY)(e)||(0,s.xZ)(e)||(0,s.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,a(n));return t}if(e instanceof Set){const t=new Set;for(const r of e)t.add(a(r));return t}return null}function p(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 b(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):!!d(e)&&d(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){return null!=e}function o(e){return null==e}function s(e,t){return n(e)?t(e):null}function i(e){return e}function a(e,t){return c(e,t),e}function c(e,t){if(o(e))throw new Error(t??"value is None")}function l(e,t){return n(e)?e:"function"==typeof t?t():t}function u(e,t){return n(e)?e:t}function f(e){return n(e)&&e.destroy(),null}function d(e){return n(e)&&e.dispose(),null}function h(e){return n(e)&&e.remove(),null}function p(e){return n(e)&&e.abort(),null}function b(e){return n(e)&&e.release(),null}function g(e,t,r){return n(e)&&n(t)?n(r)?r(e,t):e.equals(t):e===t}function m(e){return null}function y(e,t){const r=new Array;for(const n of e)r.push(v(n,null,t));return r}function w(e,t){for(const r of e)s(r,t)}function v(e,t,r){return n(e)?r(e):t}function _(e){return e.filter((e=>n(e)))}function O(e,...t){let r=e;for(let e=0;e<t.length&&r;++e)r=r[t[e]];return r}function k(e){return e}r.d(t,{Fd:()=>y,IM:()=>p,JR:()=>w,M2:()=>d,O3:()=>c,Pt:()=>l,R2:()=>v,RY:()=>b,SC:()=>f,U2:()=>O,Wg:()=>i,Wi:()=>o,_W:()=>g,hw:()=>h,j0:()=>k,lV:()=>_,pC:()=>n,s3:()=>a,wN:()=>m,yl:()=>u,yw:()=>s})},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:()=>O,zE:()=>c,dD:()=>w,hh:()=>C,Ds:()=>P,as:()=>v,WW:()=>_,R8:()=>y,D_:()=>m,Hc:()=>f,y8:()=>k,fu:()=>p,$F:()=>b,r9:()=>d,k_:()=>l,H9:()=>h,Yn:()=>j,gx:()=>S,Hl:()=>g});const n=(o=globalThis,{setTimeout:(e,t)=>{const r=o.setTimeout(e,t);return{remove:()=>o.clearTimeout(r)}}});var o;r(60235);var 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(0,a.pC)(e)?"aborted"in e?e:e.signal:e}function f(e){const t=u(e);return(0,a.pC)(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(!(0,a.Wi)(r)){if(!r.aborted)return(0,i.IH)(r,"abort",(()=>t()));t()}}function b(e,t){const r=u(e);if(!(0,a.Wi)(r))return l(r),(0,i.IH)(r,"abort",(()=>t(c())))}function g(e,t){const r=u(t);return(0,a.Wi)(r)?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}}function w(){let e=null;const t=new Promise(((t,r)=>{e={promise:void 0,resolve:t,reject:r}}));return e.promise=t,e}async function v(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e),r=t.map((t=>e[t])),n=await v(r),o={};return t.map(((e,t)=>o[e]=n[t])),o}const t=e;return new Promise((e=>{const r=[];let n=t.length;0===n&&e(r),t.forEach((t=>{const o={promise:t||Promise.resolve(t)};r.push(o),o.promise.then((e=>{o.value=e})).catch((e=>{o.error=e})).then((()=>{--n,0===n&&e(r)}))}))}))}async function _(e){return(await v(e)).filter((e=>!!e.value)).map((e=>e.value))}function O(e,t,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 k(e){return e&&"function"==typeof e.then}function S(e){return k(e)?e:Promise.resolve(e)}function P(e,t=-1){let r,n,o,s,i=null;const l=(...u)=>{if(r){n=u,s&&s.reject(c()),s=w();const e=(0,a.j0)(s.promise);if(i){const e=i;i=null,e.abort()}return e}if(o=s||w(),s=null,t>0){const n=new AbortController;r=S(e(...u,n.signal));const o=r;O(t).then((()=>{r===o&&(s?n.abort():i=n)}))}else r=1,r=S(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 C(){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 j(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 e&&e.constructor&&"Int8Array"===e.constructor.name}function s(e){return e&&e.constructor&&"Uint8Array"===e.constructor.name}function i(e){return e&&e.constructor&&"Uint8ClampedArray"===e.constructor.name}function a(e){return e&&e.constructor&&"Int16Array"===e.constructor.name}function c(e){return e&&e.constructor&&"Uint16Array"===e.constructor.name}function l(e){return e&&e.constructor&&"Int32Array"===e.constructor.name}function u(e){return e&&e.constructor&&"Uint32Array"===e.constructor.name}function f(e){return e&&e.constructor&&"Float32Array"===e.constructor.name}function d(e){return e&&e.constructor&&"Float64Array"===e.constructor.name}r.d(t,{DB:()=>h,Hx:()=>l,KZ:()=>i,Uc:()=>c,W0:()=>o,ZY:()=>u,eP:()=>n,fS:()=>d,lq:()=>s,xZ:()=>f,z3:()=>a});const h=1024},17452:(e,t,r)=>{"use strict";r.d(t,{$U:()=>ne,AH:()=>V,B7:()=>j,D6:()=>L,Fv:()=>F,HK:()=>K,Hu:()=>de,Ie:()=>ue,L:()=>k,Ml:()=>be,P$:()=>B,PF:()=>Z,Qj:()=>le,R9:()=>y,TI:()=>O,YP:()=>H,Yd:()=>ae,ZN:()=>he,_l:()=>X,b7:()=>E,ed:()=>N,fZ:()=>ge,fl:()=>pe,hF:()=>q,hO:()=>oe,io:()=>ee,jc:()=>z,kl:()=>U,mN:()=>S,oC:()=>te,oh:()=>W,qg:()=>T,rS:()=>Q,sJ:()=>Y,tD:()=>$,tm:()=>I,u0:()=>P,v_:()=>D,vt:()=>ce});var n=r(68773),o=r(20102),s=r(92604),i=r(70586);const a=s.Z.getLogger("esri.core.urlUtils"),c=n.Z.request,l="esri/config: esriConfig.request.proxyUrl is not set.",u=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,d=/^\s*https:/i,h=/^\s*file:/i,p=/:\d+$/,b=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),m=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class y{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,i.j0)(this.uri.match(g));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,i.j0)(this.authority.match(m)),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 w={};let v=new y(n.Z.applicationUrl);let _=function(){const e=(0,i.j0)(v.path),t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${v.scheme}://${v.host}${null!=v.port?`:${v.port}`:""}${t}`}();const O=()=>v,k=()=>_;function S(e){if(!e)return null;const t={path:null,query:null},r=new y(e),n=e.indexOf("?");return null===r.query?t.path=e:(t.path=e.substring(0,n),t.query=P(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 P(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 C(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}function j(e,t){return e?t&&"function"==typeof t?Object.keys(e).map((r=>encodeURIComponent(r)+"="+encodeURIComponent(t(r,e[r])))).join("&"):Object.keys(e).map((r=>{const n=e[r];if(null==n)return"";const o=encodeURIComponent(r)+"=",s=t&&t[r];return s?o+encodeURIComponent(s(n)):Array.isArray(n)?n.map((e=>C(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e))).join("&"):C(n)?o+encodeURIComponent(JSON.stringify(n)):o+encodeURIComponent(n)})).filter((e=>e)).join("&"):""}function E(e=!1){let t,r=c.proxyUrl;if("string"==typeof e){t=ne(e);const n=N(e);n&&(r=n.proxyUrl)}else t=!!e;if(!r)throw a.warn(l),new o.Z("urlutils:proxy-not-set",l);return t&&se()&&(r=oe(r)),S(r)}function T(e){const t=N(e);let r,n;if(t){const e=A(t.proxyUrl);r=e.path,n=e.query?P(e.query):null}if(r){const t=S(e);e=r+"?"+t.path;const o=j({...n,...t.query});o&&(e=`${e}?${o}`)}return e}const x={path:"",query:""};function A(e){const t=e.indexOf("?");return-1!==t?(x.path=e.slice(0,t),x.query=e.slice(t+1)):(x.path=e,x.query=null),x}function M(e){return(e=ie(e=function(e){return e&&"/"===e[e.length-1]?e:`${e}/`}(e=A(e).path),!0)).toLowerCase()}function $(e){const t={proxyUrl:e.proxyUrl,urlPrefix:M(e.urlPrefix)},r=c.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 N(e){const t=c.proxyRules,r=M(e);for(let e=0;e<t.length;e++)if(0===r.indexOf(t[e].urlPrefix))return t[e]}function I(e,t){return e=R(e),t=R(t),ie(e)===ie(t)}function R(e){const t=(e=F(e)).indexOf("/sharing");return t>0?e.substring(0,t):e.replace(/\/+$/,"")}function W(e){const t=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t),r=c.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 L(e,t,r=!1){if(!e||!t)return!1;const n=fe(e),o=fe(t);return!(!r&&n.scheme!==o.scheme)&&null!=n.host&&null!=o.host&&n.host.toLowerCase()===o.host.toLowerCase()&&n.port===o.port}function U(e){if("string"==typeof e){if(!H(e))return!0;e=fe(e)}if(L(e,v))return!0;const t=c.trustedServers||[];for(let r=0;r<t.length;r++){const n=J(t[r]);for(let t=0;t<n.length;t++)if(L(e,n[t]))return!0}return!1}function J(e){return w[e]||(re(e)||te(e)?w[e]=[new y(q(e))]:w[e]=[new y(`http://${e}`),new y(`https://${e}`)]),w[e]}function q(e,t=_,r){return te(e)?r&&r.preserveProtocolRelative?e:"http"===v.scheme&&v.authority===B(e).slice(2)?`http:${e}`:`https:${e}`:re(e)?e:(0,i.j0)(D("/"===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=_,r){if(null==e||!H(e))return e;const n=F(e),o=n.toLowerCase(),s=F(t).toLowerCase().replace(/\/+$/,""),i=r?F(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 F(e){return function(e){const t=c.httpsDomains;if(!function(e){return null!=e&&f.test(e)||"http"===v.scheme&&te(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),p.test(n)){if(!n.endsWith(":80"))return e;n=n.slice(0,-3),e=e.replace(":80","")}return"http"===v.scheme&&n===v.authority&&!b.test(e)||(se()&&n===v.authority||t&&t.some((e=>n===e||n.endsWith(`.${e}`)))||se()&&!N(e))&&(e=oe(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=A(e);e=(e=t.path.replace(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=q(e=e.trim()))))}function D(...e){const t=e.filter(i.pC);if(!t||!t.length)return;const r=[];if(H(t[0])){const e=t[0],n=e.indexOf("//");-1!==n&&(r.push(e.slice(0,n+1)),function(e){return null!=e&&h.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 B(e,t=!1){if(null==e||z(e)||K(e))return null;let r=e.indexOf("://");if(-1===r&&te(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=ie(e,!0)),e}function H(e){return te(e)||re(e)}function z(e){return null!=e&&"blob:"===e.slice(0,5)}function K(e){return null!=e&&"data:"===e.slice(0,5)}function V(e){const t=Y(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 Q(e){return btoa(String.fromCharCode.apply(null,e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const G=/^data:(.*?)(;base64)?,(.*)$/;function Y(e){const t=e.match(G);if(!t)return null;const[,r,n,o]=t;return{mediaType:r,isBase64:!!n,data:o}}function X(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}function ee(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);return r.download=t,r.href=n,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n),!0})(e,t)||function(e,t){!!window.navigator.msSaveOrOpenBlob&&window.navigator.msSaveOrOpenBlob(e,t)}(e,t)}function te(e){return null!=e&&"/"===e[0]&&"/"===e[1]}function re(e){return null!=e&&u.test(e)}function ne(e){return null!=e&&d.test(e)||"https"===v.scheme&&te(e)}function oe(e){return te(e)?`https:${e}`:e.replace(f,"https:")}function se(){return"https"===v.scheme}function ie(e,t=!1){return te(e)?e.slice(2):(e=e.replace(u,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function ae(e){let t=0;if(H(e)){const r=e.indexOf("//");-1!==r&&(t=r+2)}const r=e.lastIndexOf("/");return r<t?e:e.slice(0,r+1)}function ce(e,t){if(!e)return"";const r=S(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 le(e){return e.replace(/\/+$/,"")}function ue(e,t,r){if(!(t&&r&&e&&H(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 fe(e){return"string"==typeof e?new y(q(e)):(e.scheme||(e.scheme=v.scheme),e)}function de(e,t){const r=S(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 he(e,t,r){const n=S(e),o=n.query||{};return o[t]=String(r),`${n.path}?${j(o)}`}function pe(e,t){const r=S(e),n=r.query||{};for(const e in t)n[e]=t[e];const o=j(n);return o?`${r.path}?${o}`:r.path}function be(e){if((0,i.Wi)(e))return null;const t=e.match(me);return t?t[2]:null}function ge(e){if((0,i.Wi)(e))return null;const t=e.match(me);return t?{path:t[1],extension:t[2]}:{path:e,extension:null}}const me=/([^.]*)\.([^\/]*)$/},25045:(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),c=r(94362),l=r(17202);const u={statsWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(3847),r.e(6841)]).then(r.bind(r,36841)),geometryEngineWorker:()=>Promise.all([r.e(5837),r.e(8227)]).then(r.bind(r,48227)),CSVSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1534),r.e(1562),r.e(5886),r.e(3847),r.e(9777),r.e(8833),r.e(4807),r.e(7154)]).then(r.bind(r,27793)),EdgeProcessingWorker:()=>Promise.all([r.e(6481),r.e(212),r.e(2062)]).then(r.bind(r,49594)),ElevationSamplerWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(4807),r.e(6481),r.e(6459),r.e(98)]).then(r.bind(r,61787)),FeatureServiceSnappingSourceWorker:()=>Promise.all([r.e(4547),r.e(5795),r.e(1400),r.e(1534),r.e(1562),r.e(4599),r.e(5886),r.e(3847),r.e(9777),r.e(8833),r.e(4807),r.e(3660)]).then(r.bind(r,65967)),GeoJSONSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1534),r.e(1562),r.e(5886),r.e(3847),r.e(9777),r.e(8833),r.e(4807),r.e(7774),r.e(7845)]).then(r.bind(r,97845)),LercWorker:()=>r.e(3027).then(r.bind(r,23027)),MemorySourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1534),r.e(1562),r.e(5886),r.e(3847),r.e(9777),r.e(8833),r.e(4807),r.e(7774),r.e(639)]).then(r.bind(r,30639)),PBFDecoderWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(5886),r.e(1916)]).then(r.bind(r,61916)),Pipeline:()=>Promise.all([r.e(4547),r.e(4321),r.e(5795),r.e(1400),r.e(1534),r.e(1562),r.e(4599),r.e(5886),r.e(3847),r.e(9777),r.e(8833),r.e(4325),r.e(7483)]).then(r.bind(r,37138)),PointCloudWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(9324)]).then(r.bind(r,90447)),RasterWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(8363),r.e(3645),r.e(4370)]).then(r.bind(r,61576)),SceneLayerSnappingSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1534),r.e(1562),r.e(5886),r.e(3847),r.e(9777),r.e(6481),r.e(212),r.e(1391)]).then(r.bind(r,73248)),SceneLayerWorker:()=>r.e(1412).then(r.bind(r,31412)),WFSSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1534),r.e(1562),r.e(5886),r.e(3847),r.e(9777),r.e(8833),r.e(4807),r.e(7774),r.e(3230)]).then(r.bind(r,43230)),WorkerTileHandler:()=>Promise.all([r.e(4325),r.e(1785),r.e(6810),r.e(3388)]).then(r.bind(r,56456))},{CLOSE:f,ABORT:d,INVOKE:h,RESPONSE:p,OPEN_PORT:b,ON:g}=c.Cs;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===c.Cs.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=u[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&&r.signal,s=r&&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 l=(0,c.jt)();return new Promise(((r,o)=>{if((0,a.Hc)(n))return this._processWork(),void o((0,a.zE)());const c=(0,a.fu)(n,(()=>{const e=this._outJobs.get(l);e&&(this._outJobs.delete(l),this._processWork(),(0,i.hw)(e.abortHandle),this._post({type:d,jobId:l}),o((0,a.zE)()))})),u={resolve:r,reject:o,abortHandle:c,debugInfo:e};this._outJobs.set(l,u),this._post({type:h,jobId:l,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:c.Cs.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),{remove(){r.port1.postMessage({type:c.Cs.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,deferred: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=this._client=this._schedule=null}_onMessage(e){(0,i.pC)(this._schedule)?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const t=(0,c.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&&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 l,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`);l=f.call(u,n,{client:this,signal:s?s.signal:null})}catch(e){return void this._post({type:p,jobId:r,error:(0,c.AB)(e)})}(0,a.y8)(l)?(i.set(r,{controller:s,promise:l}),l.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,c.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:p,jobId:r},l)}_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=>{(0,c.QM)(e)?.type===c.Cs.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,c.oi)(this._port,e,t,r)}}y.kernelInfo={revision:l.$,version:n.i8,buildDate:l.r},y.clients=new Map},94362:(e,t,r)=>{"use strict";r.d(t,{AB:()=>a,Cs:()=>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||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}(e)));return t.length?t:null}},40330:(e,t,r)=>{"use strict";r.d(t,{Dp:()=>l,Nv:()=>i,i8:()=>s,id:()=>a,qh:()=>c});var n=r(80442),o=r(17452);const s="4.26",i={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,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 a;function c(e){a=e}function l(e){const t=a&&a.findCredential(e);return t&&t.token?(0,o.ZN)(e,"token",t.token):e}(0,n.Z)("host-webworker")},17202:(e,t,r)=>{"use strict";r.d(t,{$:()=>o,r:()=>n});const n="20221225",o="d7ceb58d38c1544ee9978cd1ad87671544b012dc"}},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/"+{9:"cd14babd690c96985b05",81:"74d86e7e5ec52a2f6018",98:"74ff8c8f40d2e9c3868b",212:"f3f2759b39ab76cde66c",223:"acf800382cbcd4875865",247:"9d9e3a38c54c41f7764c",402:"1cbffa96ea6683e5f3ec",540:"96536f507bc6e501a4f7",565:"e967ffca641947212992",576:"5ec4fedbbcbb0053cf74",632:"efc9030af5aac27055a1",639:"e048641971aef9dd4da9",661:"0419bb1a147a2c464980",690:"ee91401507833875facc",739:"5983c9f28b7f63c7e1e0",759:"1b0a306176cc184e6926",819:"d1ead6e8aa7e8e21fbc6",837:"38d8d7e5ae339230dd99",908:"a80a9c725c06154ba415",911:"2187672a72e776b9b153",1070:"d9bc849d04147471aa31",1073:"7bc7b6cf75771687d81f",1074:"fa059d94d5051ded85b3",1158:"3714482f3a829d122da1",1227:"89003e387684af5ebeac",1391:"7e4a136131693bd4f77b",1400:"87579d06ffd2a491f7e2",1412:"b78e50c03cd33623eb62",1421:"106329846470141953ad",1423:"d431821ed03a6e7f4fd3",1433:"4d5bdf18feeb9c8cb6ff",1534:"1cf86638f8e097d8e6e2",1545:"c2c288d42129354dc218",1562:"a082bd3e6c6cbae3dba4",1612:"42f2ba5a86c10e50e94e",1761:"1039cd48a12e88baa97a",1773:"6ecca49fdba2618fb972",1785:"c815d4e0fa4f3ad201b6",1790:"3a00f94f8f0d49c60969",1916:"0b8dc54801a7aa5e6be3",1932:"d0807ae56d1e9d187af3",2062:"072f5a672171424668eb",2133:"9b1034ae5cd818ed279c",2134:"edc08ffed2d5bb161c8d",2422:"43f6aa5c6f6a2bf316ef",2592:"3a306358d1e76659f4ca",2664:"06ef2a1a43b2b0b66086",2710:"719ee5c4a064ea9bdfcf",2855:"0877bab7c03a1de2e713",3027:"c1ef0d8977c5c19b135f",3055:"a51c2c5d3e7f764f44d5",3172:"52b6711572ac7e058ce6",3230:"e3fd383aee378cbb0dae",3388:"f45ea484e96f44d69b20",3529:"b1bc79cc01b572f05ca1",3572:"3b689bb038ebc301c3b2",3645:"c9d57014385bff9d0b06",3660:"7f3ac66cee7e68ce945e",3668:"80c7726743baf9f54079",3743:"3c505cf66d538f84ce4b",3810:"6b589f47cb4731df1639",3847:"937a39fa2b24ab80fd13",3852:"d4338bc4a99b71c44dc2",3929:"ccbd36c83dc087b07f1c",3992:"4a2b4574b87be7b98481",4046:"ceb1770ed82fcbf72531",4166:"5f61db625e7f836f96c3",4242:"25f51196669db91dc5fc",4268:"7142779efc4ddba0fb82",4321:"21cc98b592871d141f97",4325:"e95e449c3fab1a03498c",4358:"eab47a18717478014e03",4370:"036384bab7511be0d209",4371:"4b56a15d904a64747e64",4475:"365372b903d5715bf9b7",4499:"423955dd5f10692daf3b",4547:"f2e5c6b7894793b8bd7d",4599:"bb8a670d4a1eaa458bef",4695:"247bc54f3553e91eee66",4807:"3c570c5936252956d795",5004:"faea681c279486b7a5e7",5015:"d75f1c8f8dcabdf32021",5132:"3326536d183a858a2a4d",5159:"ee50d5d0afe9bdccc84d",5179:"8f5ff4eb9d71b36a0036",5235:"7227df502cacbb6d0529",5329:"0e21e5b4d065567a6a91",5468:"7c6427767c26ef2bdf2c",5546:"52d1496c5b224690da1c",5587:"c11d857dca43de2229fc",5590:"f9d01ca95849d589b00b",5732:"83f7e22a12d90ef93e62",5795:"13da7d992cbeb39cc2c7",5837:"c419a26e2b7d20d99cef",5853:"a7bd0f0fe942973e9a22",5886:"c010210770a67a5a0429",5935:"60a08ce29d09cb07ef06",6233:"acfde5a4cce3a4589f15",6237:"1aaf284ce0ee24053bd1",6261:"43b2e17ffd5ffcbcf269",6459:"296cf6c6f3f48665a93e",6481:"2e3a4fc59789013185f4",6502:"78ff7a0a6422df4d9b4c",6584:"4c0d7a074083aa9614bb",6636:"6f7500c4f2b5776cc665",6710:"c860891552d6d886394b",6748:"7bef95b168303bdc4bf1",6774:"22677d246a80195507e6",6785:"3fb4ae8d6e8563a1c255",6794:"51b298a6f0550feb44e7",6810:"f19e2fa3af43966cdc3b",6841:"31de71018575457155e5",6904:"697787ffcb6a2b2125c2",6925:"bad2ec88d0ed090daf56",7035:"46fbfb2f815f4a543d5f",7066:"e9dd3a5c61bae6235f8e",7126:"21396e5788a07a159d77",7154:"75ce17cf13aab0440572",7202:"e9c81eee503c1b112bad",7269:"02497309e0f848bf2879",7277:"ad65c24558098f21bbf3",7374:"96e2589668159601db7e",7386:"eed89430c7bece3e752a",7476:"7a54c711fea397105ebf",7483:"e3ba96417fd75a5d2feb",7541:"190c9feab5f80e586d84",7663:"0b9c53e01d6ac1e7d5ca",7774:"1f742c3b11c76814fa4d",7845:"f8ab6e354834b9c0e857",7873:"21f7d3400c070aa45596",8092:"f1b26b73101210b8f29c",8096:"22a990a8d4d4587866a5",8227:"ee04b1c0c42cb1b18b24",8244:"be3a99c767bf3e613fc5",8363:"7ebc4be4ffe1b37f2792",8383:"e9e64936f01505bb1c1e",8636:"e0b40a4bd4b096db7a33",8691:"8335123c048fcca54808",8758:"803492088780e18de801",8828:"2eb2d49c549e53934b8b",8833:"d447ebc944a9867f5a99",8880:"eee3fb92c649ef45c900",8882:"9c6d64dc3fc89edabac4",9070:"038dc3f9ef06ef3c960c",9169:"ac4c10194e904840a4ad",9230:"df8963df0766e26d20a0",9238:"c6adbf6c29594d4ade80",9243:"d15dd77b6ac668647ab6",9291:"179efcf889111d2576c5",9296:"f86ee9fd7ac176f86796",9300:"1ec2964714528de56607",9324:"692f73ba846b8afa6b67",9513:"fa07f9d9abff17559117",9675:"078a0b134210167b629d",9771:"8914f5e72a51636a59d3",9777:"83c7c2500839c79ae9d4",9880:"1b5bdd80db9a1a410ff8",9884:"356db8b8297282c77291",9903:"6be5edf3c8e21c3ec360",9904:"05bba3ba2f9ee02f52b5"}[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");n.length&&(e=n[n.length-1].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(25045);RemoteClient=n})();
|
package/package.json
CHANGED
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const c="
|
|
5
|
+
const c="20221225",d="d7ceb58d38c1544ee9978cd1ad87671544b012dc";export{c as buildDate,d as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import i from"../../../Graphic.js";import{removeUnordered as s}from"../../../core/arrayUtils.js";import{ByteSizeUnit as r}from"../../../core/byteSizeEstimations.js";import o from"../../../core/Collection.js";import has from"../../../core/has.js";import a from"../../../core/Logger.js";import{someMap as n}from"../../../core/MapUtils.js";import{unwrapOr as l,destroyMaybe as d,isSome as h,isNone as c,applySome as u}from"../../../core/maybe.js";import _ from"../../../core/PooledArray.js";import{isAbortError as m,throwIfAborted as g,createResolver as p}from"../../../core/promiseUtils.js";import{initial as f,watch as y}from"../../../core/reactiveUtils.js";import{schedule as b}from"../../../core/scheduling.js";import{isArrayBuffer as v}from"../../../core/typedArrayUtil.js";import{getMetersPerVerticalUnitForSR as I}from"../../../core/unitUtils.js";import{property as M}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as C}from"../../../core/accessorSupport/decorators/subclass.js";import{f as x}from"../../../chunks/mat3.js";import{c as O}from"../../../chunks/mat3f32.js";import{m as E,D as S}from"../../../chunks/mat4.js";import{b as T,c as j}from"../../../chunks/mat4f64.js";import{m as w,s as A,t as D,a as R,c as N,g as P,b as F}from"../../../chunks/vec3.js";import{c as V}from"../../../chunks/vec3f64.js";import{s as U}from"../../../chunks/vec4.js";import{f as H}from"../../../chunks/vec4f64.js";import{projectBuffer as G,getProjectorName as L,localLinearScaleFactors as k,projectVectorToVector as B,projectBoundingSphere as q}from"../../../geometry/projection.js";import{create as z,empty as K,expandWithBuffer as W,toRect as $}from"../../../geometry/support/aaBoundingBox.js";import{create as X,intersects as Y}from"../../../geometry/support/aaBoundingRect.js";import{fallbackObjectIDAttribute as Q}from"../../../layers/LayerConstants.js";import J from"../../../layers/graphics/controllers/I3SOnDemandController.js";import{fixFields as Z}from"../../../layers/support/fieldUtils.js";import ee from"../../../layers/support/SceneModification.js";import{getColor as te,getOpacity as ie}from"../../../renderers/visualVariables/support/visualVariableUtils.js";import{loadArcade as se}from"../../../support/arcadeOnDemand.js";import re from"../../../symbols/Symbol3D.js";import{getMetersPerUnit as oe}from"../../../symbols/support/unitConversionUtils.js";import ae from"./I3SMeshViewLabeler.js";import{I3SMeshWorkerHandle as ne,toWasmModification as le}from"./I3SMeshWorkerHandle.js";import{ForAllFeaturesVisibilityMode as de,ForAllFeaturesReturnType as he}from"./II3SMeshView3D.js";import{initialize as ce,setModificationsSync as ue,filterObbsForModificationsSync as _e,interpretObbModificationResults as me}from"./SceneLayerWorker.js";import{overrideColor as ge}from"./graphics/graphicUtils.js";import{areLabelsVisible as pe}from"./graphics/Labeler.js";import{TextureUsage as fe,TextureEncoding as ye}from"./i3s/enums.js";import be from"./i3s/Highlights.js";import{I3SAsyncElevationUpdater as ve}from"./i3s/I3SAsyncElevationUpdater.js";import{I3SCrossfadeHelper as Ie,NodeCrossfadeMetaData as Me}from"./i3s/I3SCrossfadeHelper.js";import Ce from"./i3s/I3SElevationProvider.js";import{boundingBoxCornerPoints as xe}from"./i3s/I3SGeometryUtil.js";import{I3SIntersectionHandler as Oe}from"./i3s/I3SIntersectionHandler.js";import{getSupportedEncodings as Ee,selectEncoding as Se,defaultMaterial as Te,createTexture as je,configureMaterial as we}from"./i3s/I3SMaterialUtil.js";import{NodeIMModificationImpact as Ae,NodeState as De}from"./i3s/I3SNode.js";import{I3SOverrides as Re}from"./i3s/I3SOverrides.js";import{computeGlobalTransformation as Ne,getLocalOrigin as Pe}from"./i3s/I3SProjectionUtil.js";import{rendererNeedsTextures as Fe,checkSceneLayerValid as Ve,checkSceneLayerCompatibleWithView as Ue,getCacheKeySuffix as He,whenGraphicAttributes as Ge,computeVisibilityObb as Le,filterInPlace as ke,getCachedAttributeValue as Be,intersectBoundingRectWithMbs as qe,MbsIntersectResult as ze,addWraparound as Ke,getSymbolInfo as We,transparentEdgeMaterial as $e,getClipRect as Xe}from"./i3s/I3SUtil.js";import{IDBCache as Ye}from"./i3s/IDBCache.js";import{IDBMockCache as Qe}from"./i3s/IDBMockCache.js";import{attributeLookup as Je}from"./support/attributeUtils.js";import{ColorMixModeEnum as Ze}from"./support/symbolColorUtils.js";import et from"../support/debugFlags.js";import{toBoundingRect as tt}from"../support/extentUtils.js";import{create as it,clone as st}from"../support/orientedBoundingBox.js";import{updatingProgress as rt}from"../support/updatingProperties.js";import{glLayout as ot}from"../support/buffer/glUtil.js";import{State as at}from"../webgl-engine/collections/Component/ComponentObject.js";import{createVertexBufferLayout as nt}from"../webgl-engine/collections/Component/SourceGeometry.js";import{TextureCoordinateAttributeType as lt}from"../webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{loadBasis as dt}from"../webgl-engine/lib/BasisUtil.js";import{Transparency as ht}from"../webgl-engine/lib/edgeRendering/interfaces.js";const ct="esri.views.3d.layers.I3SMeshView3D",ut=a.getLogger(ct),_t=[1,1,1,1];class mt extends Me{constructor(e,t,i,s,r,o,a){super(),this.node=e,this.featureIds=t,this.objectHandle=i,this.cachedRendererVersion=s,this.attributeInfo=r,this.material=o,this.textures=a,this.cachedMidsTerrainSR=null,this.cachedEdgeMaterials=new Array,this.edgeMemoryUsage=0,this.cachedSymbology=null}}var gt;!function(e){e[e.CastShadows=4]="CastShadows",e[e.Pickable=5]="Pickable"}(gt||(gt={}));const pt=19,ft=100*r.MEGABYTES,yt=t=>{let r=class extends t{constructor(...e){super(e),this._elevationProvider=null,this._intersectionHandler=null,this._nodeId2Meta=new Map,this._nodeId2MetaReloading=new Map,this._i3sWasmLoaded=!1,this._snappingSourcesTrackers=[],this._hasLoadedPBRTextures=!1,this._asyncModuleLoading=0,this._addTasks=new Map,this._rendererVersion=0,this._colorVariable=null,this._opacityVariable=null,this._rendererFields=null,this._symbologyFields=null,this._symbologyOverride=null,this._symbologyOverrideFields=null,this._symbolInfos=new Map,this._idbCache=has("enable-feature:idb-mock-cache")?new Qe:new Ye("esri-scenelayer-cache","geometries"),this.holeFilling="auto",this._hasColors=!1,this._hasTextures=!1,this._hasData=!1,this.slicePlaneEnabled=!1,this._modifications=new Array,this._layerUrl="",this._cacheKeySuffix=null,this._elevationTask=null,this._filters=[],this._arcade=null,this._tmpAttributeOnlyGraphic=new i(null,null,{}),this._crossfadeHelper=new Ie(this)}get lodCrossfadeoutDuration(){return 0}get lodCrossfadeinDuration(){return 0}get lodCrossfadeUncoveredDuration(){return 0}get layerUid(){return this.i3slayer&&this.i3slayer.uid}get sublayerUid(){return null}get layerId(){return this.i3slayer&&this.i3slayer.id}get sublayerId(){return null}get updatingProgressValue(){return this._controller?.updatingProgress??0}get hasTexturesOrVertexColors(){return this._hasData?this._hasTextures||this._hasColors?"yes":"probably-not":"unknown"}get rendererTextureUsage(){return Fe(this._currentRenderer)?this._usePBR||this._hasLoadedPBRTextures?fe.AllTexturesPBR:fe.AllTextures:this._usePBR||this._hasLoadedPBRTextures?fe.GeometryTexturesPBR:fe.GeometryTextures}get elevationOffset(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;if(null!=e&&"absolute-height"===e.mode){const t=I(this.i3slayer.spatialReference),i=oe(e.unit);return l(e.offset,0)*i/t}return 0}get elevationInfo(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;if(null==e)return{mode:Ft.Absolute,offset:0};const t=I(this.i3slayer.spatialReference),i=oe(e.unit),s=l(e.offset,0)*i/t;switch(e.mode){case"absolute-height":return{mode:Ft.Absolute,offset:s};case"relative-to-ground":return{mode:Ft.RelativeToGround,offset:s};case"on-the-ground":return{mode:Ft.OnTheGround,offset:0};default:return{mode:Ft.Absolute,offset:0}}}get supportedTextureEncodings(){return Ee(this.view._stage.renderView.capabilities)}get uncompressedTextureDownsamplingEnabled(){const e=this.view?.qualitySettings.sceneService.uncompressedTextureDownsamplingEnabled,t=0==(this.supportedTextureEncodings&ye.DDS_S3TC);return e&&t}initialize(){this._preLoadBasis(),this.addResolvingPromise(this.i3slayer.indexInfo);const e=this.view.resourceController;if(this.i3sOverrides=new Re({view:this.view,layer:this.i3slayer,memoryController:e.memoryController}),this._worker=new ne((t=>e.immediate.schedule(t))),this.addResolvingPromise(this._worker.promise),this._worker.setLegacySchema(this.layerUid,this.i3slayer.store.defaultGeometrySchema),Ve(this.i3slayer),Ue(this.i3slayer,this.view),this._layerUrl=this.i3slayer.parsedUrl.path,this._controller=new J({layerView:this}),this._gpuMemoryEstimate=0,this._texMemoryEstimate=0,this._geoMemoryEstimate=0,this._stage=this.view._stage,this._collection=this._stage.renderView.componentObjectCollection,this._highlights=new be({collection:this._collection,forAllFeatures:e=>this._forAllFeatures(e,null,de.ALL),forAllFeaturesOfNode:(e,t)=>this._forAllFeaturesOfNode(e,t)}),this._isIntegratedMesh||!this.i3slayer.store.defaultGeometrySchema)this._hasComponentData=!1;else{const e=this.i3slayer.store.defaultGeometrySchema.featureAttributes;this._hasComponentData=!!(e&&e.faceRange&&e.id)}this._hasVertexColors=null!=this.i3slayer.store.defaultGeometrySchema.vertexAttributes.color&&(null==this.i3slayer.cachedDrawingInfo||!this.i3slayer.cachedDrawingInfo.color),this._isIntegratedMesh||(this._edgeView=this._stage.renderer.ensureEdgeView());const t=this.view.resourceController.memoryController.newCache(this.i3slayer.uid,(e=>this._deleteComponentObject(e)));this._memCache=t;const i=e=>h(this._controller.index)&&h(this._controller.index.rootNode)?this._controller.index.traverse(this._controller.index.rootNode,(t=>{const i=t.index,s=this._nodeId2Meta.get(i)||this._nodeId2MetaReloading.get(i);return e(t,h(s)?s.objectHandle:null)})):()=>{};this._intersectionHandler=new Oe({layerUid:this.layerUid,sublayerUid:this.sublayerUid,collection:this._collection,slicePlaneEnabled:this.slicePlaneEnabled,isGround:this._isIntegratedMesh,traverseNodeHierarchy:i}),this._elevationProvider=new Ce({layerView:this,intersectionHandler:this._intersectionHandler}),this._hasLoadedPBRTextures=this._usePBR,this.updatingHandles.add((()=>this.view.clippingArea),(()=>this._clippingAreaChanged()),f),this.updatingHandles.add((()=>this.fullOpacity),(e=>this._opacityChange(e))),this.updatingHandles.add((()=>this.slicePlaneEnabled),(e=>this._slicePlaneEnabledChange(e))),this.updatingHandles.add((()=>this.elevationOffset),((e,t)=>{this._reloadAll(t),this._controller.invalidateVisibilityObbs()})),this.updatingHandles.add((()=>this.elevationInfo),((e,t)=>this._elevationInfoChanged(e,t)),f),this.updatingHandles.add((()=>!this.suspended&&this.elevationInfo.mode!==Ft.Absolute),((e,t)=>{e?this.handles.add(this.view.basemapTerrain.on("elevation-change",(({extent:e})=>this._ensureElevationTask().addExtent(e))),Ht):t&&this.handles.remove(Ht)}),f),this.updatingHandles.add((()=>this._usePBR),(e=>this._updatePBR(e)));const s=()=>{this._reloadAll(),this.clearMemCache()};this.updatingHandles.add((()=>this.rendererTextureUsage),s),this.updatingHandles.add((()=>this.uncompressedTextureDownsamplingEnabled),s),this.updatingHandles.add((()=>this.suspended),(e=>this._suspendedChange(e)),f),this.updatingHandles.add((()=>this.i3slayer.labelsVisible),(()=>this._labelingChanged()),f),this.updatingHandles.add((()=>this.i3slayer.labelingInfo),(()=>this._labelingChanged()),f),this.updatingHandles.add((()=>this._modifications),(()=>this._modificationsChanged()),f),this.handles.add([y((()=>et.I3S_TREE_SHOW_TILES),(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&et.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||et.I3S_TREE_SHOW_TILES||(this._treeDebugger=d(this._treeDebugger))}),f),y((()=>et.I3S_SHOW_MODIFICATIONS),(()=>this._showModifications()),f)]),this._cacheKeySuffix=He(this.i3slayer.spatialReference,this.view.renderSpatialReference),this._idbCache.init().catch((e=>ut.warn(`Failed to initialize IndexedDB cache: ${e}`)))}destroy(){this._clearAddTasks(),this._elevationTask=d(this._elevationTask),this.i3sOverrides=d(this.i3sOverrides),this._elevationProvider&&(this._elevationProvider.layerChanged(),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._intersectionHandler&&(this._stage.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null);const e=this._worker;e&&(e.destroyContext(this.i3slayer.uid).then((()=>e.destroy())),this._worker=null),this._removeAllNodeDataFromStage(),this._memCache=d(this._memCache),this._collection=null,this._stage=null,this._edgeView=null,this._labeler=d(this._labeler),this._treeDebugger=d(this._treeDebugger),this._controller=d(this._controller),this._highlights.destroy(),this._nodeId2Meta.clear(),this._nodeId2MetaReloading.clear(),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null)}_memEstimateTextureAdded(e){const t=e.estimatedTexMemRequired;return this._gpuMemoryEstimate+=t,this._texMemoryEstimate+=t,t}_memEstimateTextureRemoved(e){if(h(e)){const t=e.estimatedTexMemRequired;this._gpuMemoryEstimate-=t,this._texMemoryEstimate-=t}}_memEstimateGeometryAdded(e){const t=this._collection.getObjectGPUMemoryUsage(e);return this._gpuMemoryEstimate+=t,this._geoMemoryEstimate+=t,t}_memEstimateGeometryRemoved(e){const t=this._collection.getObjectGPUMemoryUsage(e);this._gpuMemoryEstimate-=t,this._geoMemoryEstimate-=t}isNodeLoaded(e){return this._nodeId2Meta.has(e)}isNodeReloading(e){return this._nodeId2MetaReloading.has(e)}getUsedMemory(){let e=h(this._labeler)?this._labeler.usedMemory:0;return this._nodeId2Meta.forEach((t=>e+=h(t)?t.node.memory:0)),this._nodeId2MetaReloading.forEach((t=>e+=h(t)?t.node.memory:0)),e}getUnloadedMemory(){return(h(this._controller)?this._controller.unloadedMemoryEstimate:0)+(h(this._labeler)?this._labeler.unloadedMemoryEstimate:0)}ignoresMemoryFactor(){return!1}_labelingChanged(){if(!(pe(this.i3slayer)&&this._supportsLabeling))return void(h(this._labeler)&&(this._labeler.destroy(),this._labeler=null));if(h(this._labeler))return;const e=new ae({view:this.view,layer:this.i3slayer,collection:this._collection});this._nodeId2Meta.forEach((t=>h(t)&&this._addMetaToLabeler(e,t))),this._labeler=e}_loadAsyncModule(e){return++this._asyncModuleLoading,e.then((e=>(--this._asyncModuleLoading,e)),(e=>{throw--this._asyncModuleLoading,e}))}_modificationsChanged(){if(!this._i3sWasmLoaded&&this.hasModifications)return this._i3sWasmLoaded=ce().then((()=>{this._i3sWasmLoaded=!0,this._modificationsChanged(),this.notifyUpdate()})),void this.notifyUpdate();if(!0!==this._i3sWasmLoaded)return;const e=this.i3slayer.uid,t=this.i3slayer.spatialReference;this._worker.setModifications(e,this._layerClippingArea,this._modifications,t);const i=le(this._layerClippingArea,this._modifications,t);ue({context:e,modifications:i,isGeodetic:t.isGeographic}),this._controller.modificationsChanged();const s=this.hasModifications?new _:null;this._nodeId2Meta.forEach(((e,t)=>{c(e)?(this._nodeId2Meta.delete(t),this._controller.updateLoadStatus(t,!1)):e.node.hasModifications?(this._nodeId2Meta.delete(t),this._nodeId2MetaReloading.set(t,e)):h(s)&&s.push(e.node)})),h(s)&&this._nodeId2MetaReloading.forEach((e=>s.push(e.node))),h(s)&&s.length>0&&(this.updateNodeModificationStatus(s),s.forAll((e=>{if(e.imModificationImpact!==Ae.Culled){const t=this._nodeId2Meta.get(e.index);this._controller.invalidateGeometryVisibility(e.index),h(t)?(this._nodeId2Meta.delete(e.index),this._nodeId2MetaReloading.set(e.index,t)):this._nodeId2Meta.has(e.index)&&(this._nodeId2Meta.delete(e.index),this._controller.updateLoadStatus(e.index,!1))}}))),this.clearMemCache(),this._controller.restartNodeLoading(),this._showModifications()}_showModifications(){if(h(this._modificationGraphics)&&(this.view.graphics.removeMany(this._modificationGraphics),this._modificationGraphics=null),!et.I3S_SHOW_MODIFICATIONS||0===this._modifications.length)return;const e={clip:[227,227,79,.8],mask:[227,139,79,.8],replace:[139,227,79,.8]},t={type:"simple-fill",outline:{color:[255,255,255],width:1}};this._modificationGraphics=new Array;for(const s of this._modifications){s.geometry.spatialReference=this.i3slayer.spatialReference;const r={...t,color:e[s.type]};this._modificationGraphics.push(new i({geometry:s.geometry,symbol:r}))}this.view.graphics.addMany(this._modificationGraphics)}_addMetaToLabeler(e,t){e.addNodeMeta(t,((e,t)=>this._createAttributes(e,t)))}_suspendedChange(e){e?(this._removeAllNodeDataFromStage(),this.view.elevationProvider&&this.view.elevationProvider.unregister(this._elevationProvider),this._stage.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler)):(this.view.elevationProvider.register(this._elevationContext,this._elevationProvider),this._stage.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler))}getLoadedAttributes(e){const t=this._nodeId2Meta.get(e);if(h(t)&&h(t.attributeInfo))return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodeId2Meta.get(e);if(h(t)&&h(t.attributeInfo))return t.attributeInfo.attributeData}setAttributeData(e,t){const i=this._nodeId2Meta.get(e);h(i)&&h(i.attributeInfo)&&(i.attributeInfo.attributeData=t,this._attributeValuesChanged(i))}async updateAttributes(e,t,i){const s=this._nodeId2Meta.get(e);h(s)&&(await this.i3sOverrides.apply(s.featureIds,t,i),s.attributeInfo=t,this._controller.reschedule((()=>this._attributeValuesChanged(s)),i).catch((e=>{m(e)||ut.warn("Error while updating attribute values. Layer might not display correctly.",e)})))}_attributeValuesChanged(e){e.cachedRendererVersion=this._getInvalidRendererVersion(),e.filteredIds=null,h(this._labeler)&&this._labeler.setNodeMetaAttributes(e,((e,t)=>this._createAttributes(e,t))),this._updateEngineObject(e)}clearMemCache(){h(this._memCache)&&this._memCache.clear()}getVisibleNodes(){const e=new Array;return this._nodeId2Meta.forEach((t=>h(t)&&e.push(t.node))),e}getNodeComponentObb(e){const t=this._nodeId2Meta.get(e.index)??this._nodeId2MetaReloading.get(e.index);return h(t)?this._collection.getComponentObb(t.objectHandle):null}getLoadedNodeIndices(e){this._nodeId2Meta.forEach(((t,i)=>e.push(i))),this._nodeId2MetaReloading.forEach(((t,i)=>e.push(i)))}_preLoadBasis(){!has("disable-feature:i3s-basis")&&0!=(this.supportedTextureEncodings&ye.Basis)&&u(this.i3slayer.textureSetDefinitions,(e=>e.some((e=>e.formats.some((e=>"basis"===e.format||"ktx2"===e.format))))))&&dt()}_getVertexBufferLayout(e,t){const i={hasTexture:Tt(e.params.material),hasNormals:t.normal,hasRegions:t.uvRegion};return ot(nt(this._getGeometryParameters(i)))}_getObjectIdField(){return this.i3slayer.objectIdField||Q}_findGraphicNodeAndIndex(e){const t=Je(this.i3slayer.fieldsIndex,e.attributes,this._getObjectIdField());let i=null;return n(this._nodeId2Meta,(e=>{if(c(e))return!1;const s=e.featureIds.indexOf(t);return-1!==s&&(i={node:e.node,index:s},!0)})),i}_getGraphicIndices(e,t){const i=this._nodeId2Meta.get(e.index);if(c(i))return[];const s=[],r=this._getObjectIdField(),o=this.i3slayer.fieldsIndex;for(const a of t){const e=Je(o,a.attributes,r),t=i.featureIds.indexOf(e);-1!==t&&s.push(t)}return s}whenGraphicBounds(e){const t=this._findGraphicNodeAndIndex(e);if(!t)return Promise.reject();const i=this._getAABB(t.node.index,t.index);return c(i)?Promise.reject():Promise.resolve({boundingBox:i,screenSpaceObjects:[]})}getAABBFromIntersectorTarget(e){return null==e.nodeIndex||null==e.componentIndex?null:this._getAABB(e.nodeIndex,e.componentIndex)}_getAABB(e,t){const i=this._nodeId2Meta.get(e);if(c(i)||null==i.featureIds||t>=i.featureIds.length)return null;const s=i.objectHandle,r=xe(t,this._collection,s,new Float64Array(24)),o=this.view.renderSpatialReference,a=this.view.spatialReference;if(!G(r,o,0,r,a,0,8))return null;const n=K();return W(n,r,0,8),n}whenGraphicAttributes(e,t){return Ge(this.i3slayer,e,this._getObjectIdField(),t,(()=>[...this._nodeId2Meta.values()].filter(h)))}getGraphicFromIntersectorTarget(e){if(null==e.nodeIndex||null==e.componentIndex)return null;const t=this._nodeId2Meta.get(e.nodeIndex);return c(t)||null==t.featureIds||e.componentIndex>=t.featureIds.length?null:this._createGraphic(e.componentIndex,t)}_getCacheKey(e){return`${this._layerUrl}/v${pt}/${e.id}${this._cacheKeySuffix}`}_getMemCacheKey(e,t=this.elevationOffset){return e+"#"+t}get _idbCacheEnabled(){return!this._controller.disableIDBCache&&!this.hasModifications&&0===this.elevationOffset&&null!=this._cacheKeySuffix}loadCachedGPUData(e){return h(this._memCache)?this._memCache.pop(this._getMemCacheKey(e.index)):null}deleteCachedGPUData(e){h(e)&&this._deleteComponentObject(e)}_cacheGPUData(e,t=this.elevationOffset){if(c(this._memCache))return void this._deleteComponentObject(e);const i=this._controller.indexDepth-e.node.level;this._memCache.put(this._getMemCacheKey(e.node.index,t),e,e.node.memory,i)}loadMissingTextures(e,t,i,s){const r=e?.filter(((e,i)=>{if(0==(e.usage&this.rendererTextureUsage))return!1;if(c(t))return!0;const s=Se(e.encodings,this.supportedTextureEncodings),r=t[i];return!!(c(r)||null==r.data||s&&r.encoding!==s.encoding)}))??[];return 0===r.length?Promise.resolve(!1):i(r,s).then((i=>{let s=0;for(let r=0;r<e.length;r++)s<i.length&&i[s].id===e[r].id&&(t[r]=i[s],s++);return!0}))}loadCachedNodeData(e,t,i){return this._idbCacheEnabled?this._idbCache.get(this._getCacheKey(e),t).then((s=>null==s?null:s.nodeVersion!==e.version?(this._idbCache.remove(this._getCacheKey(e)),null):(this.elevationInfo.mode===Ft.Absolute&&(e.geometryObb=s.geometryObb),this.loadMissingTextures(s.requiredTextures,s.textureData,i,t).then((i=>(i&&this._idbCache.initialized&&h(s.textureData)&&(s.byteSize=At(s.transformedGeometry,s.textureData),s.textureData.every(wt)&&Dt(e,s)&&this._idbCache.put(this._getCacheKey(e),s).catch((t=>ut.warn(`Failed to update node with textures in IndexedDB cache: ${e.id}: ${t}`)))),g(t),s)))))):Promise.resolve(null)}addNode(e,t,i){return jt(t)?null==t.geometryBuffer?(this._addNodeMeta(e.index,null),Promise.resolve()):this._addData(e,t.attributeDataInfo,(()=>this._transformNode(e,t,i).then((s=>this._safeReschedule((()=>{if(c(s))return e.hasModifications=!1,this._addCachedNodeData(e,null,i);e.hasModifications=s.transformedGeometry.hasModifications;const{obb:r,componentOffsets:o,featureIds:a,transformedGeometry:n}=s,l=this._controller.crsIndex,d=this.view.renderSpatialReference,u=Ne(e.mbs,this.elevationOffset,l,d),_=it([r.center.x,r.center.y,r.center.z],[r.extents.x,r.extents.y,r.extents.z],[r.orientation.x,r.orientation.y,r.orientation.z,r.orientation.w]);w(_.center,_.center,u),this.elevationInfo.mode===Ft.Absolute&&(e.geometryObb=_),t.geometryData.componentOffsets=o,a&&(t.geometryData.featureIds=Array.from(a));const m={nodeVersion:e.version,geometryData:t.geometryData,requiredTextures:t.requiredTextures,textureData:t.textureData,transformedGeometry:n,globalTrafo:u,geometryObb:_,byteSize:At(n,t.textureData)};if(this._idbCacheEnabled&&this._idbCache.initialized&&Dt(e,m)){const t=h(m.textureData)?m.textureData.map((e=>wt(e)?e:null)):null;this._idbCache.put(this._getCacheKey(e),{...m,textureData:t}).catch((t=>ut.warn(`Failed to store node in IndexedDB cache: ${e.id}: ${t}`)))}return this._addCachedNodeData(e,m,i)}),i))))):Promise.reject()}computeVisibilityObb(e){return Le(e,this.view.renderSpatialReference,this._controller.crsIndex,this.i3slayer.spatialReference,this.elevationOffset,this._modifications)}_transformNode(e,t,i){const s=t.geometryData.geometries,r=new Array(s.length);for(let c=0;c<s.length;++c)r[c]=this._getVertexBufferLayout(s[c],t.geometryDescriptor);const o=e.mbs,a=this.elevationOffset,n=this._controller.crsIndex,l=this._controller.crsVertex,d=this.view.renderSpatialReference,h=Pe(o,a,n),u=Ne(o,a,n,d),_=L(n,l),m=L(l,d);if(c(_)||c(m))return Promise.resolve(null);const g={context:this.i3slayer.uid,geometryBuffer:t.geometryBuffer,geometryData:t.geometryData,geometryDescriptor:t.geometryDescriptor,layouts:r,localOrigin:h,globalTrafo:u,mbs:o,obb:e.serviceObb,elevationOffset:a,needNormals:!this._isIntegratedMesh&&this._controller.isMeshPyramid,normalReferenceFrame:this.i3slayer.normalReferenceFrame||"none",indexToVertexProjector:_,vertexToRenderProjector:m};return this._worker.invoke(g,i)}get _supportsNodeCrossFading(){return!this.view?._stage?.renderer.shadowsEnabled}get nodeCrossfadingEnabled(){return this._supportsNodeCrossFading&&(this.lodCrossfadeinDuration>0||this.lodCrossfadeoutDuration>0||this.lodCrossfadeUncoveredDuration>0)}get nodeFadeoutEnabled(){return this._supportsNodeCrossFading&&this.lodCrossfadeoutDuration>0}_setNewNodeOpacity(e){const t=this.nodeCrossfadingEnabled?0:this.fullOpacity;this._setNodeOpacity(e,t)}addCachedGPUData(e,t,i){if(this.elevationInfo.mode===Ft.Absolute&&(e.geometryObb=st(this._collection.getComponentObb(t.objectHandle))),!this._controller.isGeometryVisible(e))return void this._cacheGPUData(t);h(this._labeler)&&this._addMetaToLabeler(this._labeler,t);const s=e.index;this._addNodeMeta(s,t),this.updateNodeState(s,i),this._collection.setObjectVisibility(t.objectHandle,at.Visible),this._updateMaterial(t),this._setNewNodeOpacity(t),this.elevationInfo.mode!==Ft.Absolute&&this._ensureElevationTask().schedule(s),this._updateEngineObject(t),this._highlights.objectCreated(t),h(this._treeDebugger)&&this._treeDebugger.update()}addCachedNodeData(e,t,i,s){return this._addData(e,i,(()=>this._addCachedNodeData(e,t,s)))}async _addCachedNodeData(e,t,i){if(this.suspended||!this._controller.isGeometryVisible(e))return void this._removeNodeStageData(e.index,this.elevationOffset,this._nodeId2MetaReloading);if(c(t))return void this._addNodeMeta(e.index,null);const s=this._addTasks.get(e.index),{geometryData:r,transformedGeometry:o,globalTrafo:a}=t;await this.i3sOverrides.apply(r.featureIds,s.attributeInfo,i);const n=h(t.textureData)?t.textureData.filter((e=>h(e)&&0!=(e.usage&this.rendererTextureUsage))):[];!has("disable-feature:i3s-basis")&&n.some((e=>h(e)&&(e.encoding===ye.Basis||e.encoding===ye.KTX2)))&&await dt(),e.memory=0;const{componentOffsets:l,geometries:d,featureIds:u}=r,_=this._collection,m=d[0],{layout:g,indices:p,interleavedVertexData:f,positionData:y,hasColors:b}=o,v=this._materialParameters(m,g),I=l||new Uint32Array([0,p?p.length:f.byteLength/g[0].stride]),M={vertices:{data:f,count:f.byteLength/g[0].stride,layoutParameters:v.geometryParams},positionData:{positions:y.data,indices:y.indices},indices:p,componentOffsets:I},C=m.transformation?T(m.transformation):j();E(C,a,C);const w=S(V(),C),A=x(O(),C),D=this.view.renderSpatialReference,R=this.view.basemapTerrain.spatialReference,N=V(),P=[1,1,1];k(w,D,P,R)||ut.errorOnce("Unsupported coordinate system for IM overlay"),B(w,D,N,R);const F=_.createObject({toMapSpace:H(N[0],N[1],P[0],P[1]),geometry:M,obb:t.geometryObb,transform:{position:w,rotationScale:A}}),U=v.geometryParams.textureCoordinates===lt.Atlas,{textures:G,texturePromise:L}=this._initMaterialAndTextures(F,v.material,n,U);e.memory+=this._memEstimateGeometryAdded(F),e.memory+=G.reduce(((e,t)=>e+(h(t)?this._memEstimateTextureAdded(t):0)),0);const q=!!v.material.hasParametersFromSource,z="blend"!==v.material.alphaMode&&v.material.metallicRoughness.baseColorFactor[3]>=1,K=new mt(e,u,F,this._getInvalidRendererVersion(),s.attributeInfo,{hasParametersFromSource:q,isOpaque:z},G);s.meta=K,!this._hasTextures&&t.requiredTextures?.some((({usage:e})=>0!=(e&fe.ColorTextures)))&&(this._hasTextures=!0),this._hasData=!0,this._hasColors=this._hasColors||b,this._hasTextures=this._hasTextures||!!e.resources.texture,this.notifyChange("hasTexturesOrVertexColors");const W=this.slicePlaneEnabled;return Promise.all([this._addOrUpdateEdgeRendering(K),L]).then((([t,s])=>(h(t)&&t.updateObjectVisibility(K.objectHandle,!1).catch((e=>bt(e,this.i3slayer.title))),this._safeReschedule((()=>{const i=this._addTasks.get(e.index);if(!i)return;if(this._addNodeMeta(e.index,K),i.meta=null,this.suspended)return void this._removeNodeStageData(e.index,this.elevationOffset);_.setObjectVisibility(F,at.Visible),h(t)&&t.updateObjectVisibility(K.objectHandle,!0).catch((e=>bt(e,this.i3slayer.title))),K.attributeInfo=i.attributeInfo;const s=K.cachedRendererVersion!==this._rendererVersion,r=W!==this.slicePlaneEnabled;this._updateElevationOffsets(K);const o=K.elevationOffsets;this._updateComponentData(K);const a=this._applyFiltersToNode(K);(s||h(t)&&(r||a||o))&&this._addOrUpdateEdgeRendering(K),h(this._labeler)&&this._addMetaToLabeler(this._labeler,K),this._visibleGeometryChanged(K,vt.ADD),this._highlights.objectCreated(K),this._updateMaterial(K),this._setNewNodeOpacity(K),h(this._treeDebugger)&&this._treeDebugger.update()}),i)))).catch((e=>{throw h(s.meta)&&(this._cacheGPUData(s.meta),s.meta=null),e}))}_addNodeMeta(e,t){if(this._removeNodeStageData(e,this.elevationOffset,this._nodeId2MetaReloading),this._nodeId2Meta.has(e)){ut.error("Removing duplicated node");const t=this._nodeId2Meta.get(e);h(t)&&this._deleteComponentObject(t)}else this._controller.updateLoadStatus(e,!0);h(t)&&(t.lodCrossfadeProgress=null,this.nodeCrossfadingEnabled&&Pt(t.cachedEdgeMaterials,0)),this._nodeId2Meta.set(e,t)}_updateElevationOffsets(e){const t=this.view.renderSpatialReference,i=this.elevationInfo,s=this.view.basemapTerrain,r=s.spatialReference,o=i.mode;if(c(t)||c(r)||o===Ft.Absolute)return void(e.elevationOffsets=null);const a=this._collection.getObjectTransform(e.objectHandle);e.elevationOffsets=e.elevationOffsets??[];const n=Vt,l=Ut,d=o===Ft.OnTheGround,u=this.view.renderCoordsHelper,_=!!e.cachedMidsTerrainSR,m=e.featureIds.length;if(!_){e.cachedMidsTerrainSR=new Float64Array(3*m);const i=e.cachedMidsTerrainSR;for(let s=0;s<m;s++){this._collection.getComponentAabb(e.objectHandle,s,l,!0),A(n,(l[0]+l[3])/2,(l[1]+l[4])/2,l[2]),D(n,n,a.rotationScale),R(n,n,a.position);const o=3*s;i[o+2]=u.getAltitude(n),B(n,t,n,r),i[o+0]=n[0],i[o+1]=n[1]}}const g=e.cachedMidsTerrainSR,p=i.offset,f=e.elevationOffsets,y=(e,t)=>{const i=d?g[3*e+2]:0;f[e]=p+(h(t)?t-i:0)};s.getElevations(g,m,y)}_ensureElevationTask(){return h(this._elevationTask)||(this._elevationTask=new ve(this.view.resourceController.scheduler,(e=>{const t=this._controller.updateElevationChanged(e,this.view.basemapTerrain.spatialReference);return h(t)?t.filterInPlace((e=>h(this._nodeId2Meta.get(e)))):null}),(e=>{const t=this._nodeId2Meta.get(e);this._nodeElevationAlignmentChanged(t)}))),this._elevationTask}_elevationInfoChanged(e,t){const i=e.mode!==Ft.Absolute,s=null!=t&&t!==e&&t.mode!==Ft.Absolute;this._intersectionHandler.updateElevationAlignState(i,this.view.state.viewingMode),i&&!s&&this._controller.removeAllGeometryObbs(),this._nodeId2Meta.forEach((e=>this._nodeElevationAlignmentChanged(e)))}_nodeElevationAlignmentChanged(e){c(e)||(this._updateElevationOffsets(e),this._updateComponentData(e),this._updateEdgeRendering(e),h(this._labeler)&&this._labeler.updateLabelPositions(e),this._updateSnappingSources(e,vt.UPDATE))}_safeReschedule(e,t){return g(t),this._controller.reschedule(e,t)}_materialParameters(e,t){const i=h(e.params.material)?e.params.material:Te(),s=t.some((e=>"uvRegion"===e.name)),r=t.some((e=>"normalCompressed"===e.name)),o=Tt(i);return{geometryParams:this._getGeometryParameters({hasTexture:o,hasNormals:r,hasRegions:s}),material:i}}_initMaterialAndTextures(e,t,i,s){const r=this._stage.renderView,o=i.map((e=>je(e,t,s,r)));this._stage.addMany(o);let a=null;return this._collection.updateMaterial(e,(e=>{a=we(e,t,o,i,this.view._stage.renderView.textureRepository,{rendererTextureUsage:this.rendererTextureUsage,usePBR:this._usePBR,isIntegratedMesh:this._isIntegratedMesh,slicePlaneEnabled:this.slicePlaneEnabled,viewSpatialReference:this.view.spatialReference}),this._updateMaterialOverlay(e)})),{textures:o,texturePromise:a}}_getGeometryParameters(e){return{textureCoordinates:e.hasTexture?e.hasRegions?lt.Atlas:lt.Default:lt.None,colors:this._hasVertexColors,normals:e.hasNormals&&!this._isIntegratedMesh}}_addData(e,t,i){let s=this._addTasks.get(e.index);return s?s.attributeInfo=t:(s={...p(),attributeInfo:t,meta:null},this._addTasks.set(e.index,s),i().then(s.resolve,s.reject).then((()=>this._addTasks.delete(e.index))).catch((t=>{throw this._addTasks.delete(e.index),t}))),s.promise}_clearAddTasks(){this._addTasks.forEach((e=>{h(e.meta)&&(this._cacheGPUData(e.meta),e.meta=null)})),this._addTasks.clear()}_clippingAreaChanged(){const e=this.view.renderSpatialReference,t=this.i3slayer.spatialReference,i=X();this._renderClippingArea=tt(this.view.clippingArea,i,e)?i:null;const s=X();this._layerClippingArea=tt(this.view.clippingArea,s,t)?s:null,this._filterChange(),this._controller&&this._controller.updateClippingArea(this.view.clippingArea),this._isIntegratedMesh&&this._modificationsChanged()}get hasGeometryFilter(){return!1}_geometryFilterChange(){const e=this.hasGeometryFilter;this._controller.geometryFilterChanged(e),this._applyFilters(e)}_filterChange(){this._applyFilters(this.hasGeometryFilter)}_applyFilters(e){this._filters=this.getFilters(),e?this._controller&&this._controller.requestUpdate():this._nodeId2Meta.forEach((e=>{h(e)&&this._applyFiltersToNode(e)&&(this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,vt.UPDATE))}))}getFilters(){const e=[],t=this._renderClippingArea;return h(t)&&e.push(((e,i)=>this._boundingRectFilter(e,i,t))),e}addSqlFilter(e,t,i){if(h(t)){const s=t.fieldNames;e.push(((e,r)=>this._sqlFilter(e,r,t,s,i)))}}_sqlFilter(e,t,i,s,r){const o={},a=this._createLayerGraphic(o),n=this.i3slayer.objectIdField,l=t.featureIds,d=h(t.attributeInfo)&&t.attributeInfo.attributeData;s.every((e=>null!=d[e]||e===n))&&ke(e,l,(e=>{o[n]=l[e];for(const i of s)i!==n&&(o[i]=Be(d[i],e));try{return i.testFeature(a)}catch(t){return r(t),!1}}))}_boundingRectNodeTest(e,t){return q(e.node.mbs,this._controller.crsIndex,St,this.view.renderSpatialReference),qe(t,St)}_boundingRectFeatureTest(e,t,i){return this._collection.getComponentAabb(e.objectHandle,t,It),$(It,Mt),Y(i,Mt)}_boundingRectFilter(e,t,i){const s=this._collection,r=this._boundingRectNodeTest(t,i);if(r===ze.INSIDE)return;if(r===ze.OUTSIDE)return void(e.length=0);const o=s.getComponentCount(t.objectHandle);if(o.invisible+o.visible!==t.featureIds.length)return;const a=this._transformClippingArea(Ct,i,t.objectHandle);ke(e,t.featureIds,(e=>this._boundingRectFeatureTest(t,e,a)))}_transformClippingArea(e,t,i){const s=this._collection.getObjectTransform(i),r=s.position,o=s.rotationScale;return e[0]=(t[0]-r[0])/o[0],e[1]=(t[1]-r[1])/o[4],e[2]=(t[2]-r[0])/o[0],e[3]=(t[3]-r[1])/o[4],e}_addOrUpdateEdgeRendering(e,t=!0){const i=this._edgeView;if(c(i))return Promise.resolve(null);const s=e.objectHandle,r=i.hasObject(s),{hasEdges:o,perFeatureEdgeMaterials:a}=this._getFilteredEdgeMaterials(e),n={hasSlicePlane:this.slicePlaneEnabled};if(o&&r){if(this.nodeCrossfadingEnabled){Pt(a,this.getNodeOpacity(e))}return i.updateAllComponentMaterials(s,a,n,t).catch((e=>bt(e,this.i3slayer.title))),i.updateObjectVisibility(s,!0).catch((e=>bt(e,this.i3slayer.title))),i.updateAllVerticalOffsets(s,e.elevationOffsets).catch((e=>bt(e,this.i3slayer.title))),Promise.resolve(i)}return o&&!r?this._collection.addEdges(s,i,a,n).then((t=>(e.edgeMemoryUsage=t,e.node.memory+=t,i.updateAllVerticalOffsets(s,e.elevationOffsets).catch((e=>bt(e,this.i3slayer.title))),i))):(!o&&r&&(e.node.memory-=e.edgeMemoryUsage,e.edgeMemoryUsage=0,i.removeObject(s)),Promise.resolve(null))}_applyFiltersToNode(e){return!!this._applyFiltersToNodeComponents(e)&&(h(this._labeler)&&this._labeler.applyFilterChange(e),!0)}_applyFiltersToNodeComponents(e){const t=this._collection,i=0===t.getComponentCount(e.objectHandle).invisible;if(t.setAllComponentVisibilities(e.objectHandle,"all"),0===this._filters.length)return e.filteredIds=null,!i;if(this._updateCachedFilteredIds(e),e.filteredIds===e.featureIds)return!i;const s=this._computeFilteredComponentIndices(e);return t.setAllComponentVisibilities(e.objectHandle,s),!0}_updateCachedFilteredIds(e){null!=e.filteredIds&&e.appliedFilters===this._filters||(e.filteredIds=this._computeFilteredIds(e),e.appliedFilters=this._filters)}_computeFilteredIds(e){const t=e.featureIds.slice();for(const i of this._filters)if(i(t,e),0===t.length)break;return t.length===e.featureIds.length?e.featureIds:t}_computeFilteredComponentIndices(e){const t=new Array;return e.featureIds.forEach(((i,s)=>{e.filteredIds[t.length]===i&&t.push(s)})),t}_removeAllNodeDataFromStage(e=this.elevationOffset){this._nodeId2Meta.forEach(((t,i)=>this._removeNodeStageData(i,e))),this._nodeId2MetaReloading.forEach(((t,i)=>this._removeNodeStageData(i,e,this._nodeId2MetaReloading))),this._elevationTask=d(this._elevationTask)}removeNode(e){const t=this.elevationOffset;this._removeNodeStageData(e,t),this._removeNodeStageData(e,t,this._nodeId2MetaReloading),h(this._elevationTask)&&this._elevationTask.remove(e)}_removeNodeStageData(e,t,i=this._nodeId2Meta){i.has(e)&&this._controller.updateLoadStatus(e,!1);const s=i.get(e);c(s)?i.delete(e):(this._collection.setObjectVisibility(s.objectHandle,at.Hidden),h(this._edgeView)&&this._edgeView.hasObject(s.objectHandle)&&this._edgeView.updateObjectVisibility(s.objectHandle,!1).catch((e=>bt(e,this.i3slayer.title))),this._visibleGeometryChanged(s,vt.REMOVE),h(this._labeler)&&this._labeler.removeNodeMeta(s),i.delete(e),this._highlights.objectDeleted(s),i===this._nodeId2Meta?(this._cacheGPUData(s,t),this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopNodeFading(s)):this._deleteComponentObject(s),h(this._treeDebugger)&&this._treeDebugger.update())}_deleteComponentObject(e){if(h(this._edgeView)&&this._edgeView.removeObject(e.objectHandle),this._memEstimateGeometryRemoved(e.objectHandle),this._collection.destroyObject(e.objectHandle),e.textures)for(const t of e.textures)this._memEstimateTextureRemoved(t),this._stage.remove(t)}updateNodeState(e,t){const i=this._nodeId2Meta.get(e);h(i)&&this._collection.updateMaterial(i.objectHandle,(e=>e.polygonOffsetEnabled=t===De.Hole))}_invalidateAllSymbols(){this._rendererVersion=Ke(this._rendererVersion,1),this._controller&&this._controller.requestUpdate()}_getInvalidRendererVersion(){return Ke(this._rendererVersion,-1)}async _rendererChange(e){if(this._currentRenderer=e,this.notifyChange("rendererTextureUsage"),this._rendererVersion=Ke(this._rendererVersion,1),this._rendererFields=null,this._colorVariable=null,this._opacityVariable=null,this._invalidateAllSymbols(),e&&(this._rendererFields=await e.getRequiredFields(this.i3slayer.fieldsIndex)),this._updateSymbologyFields(),!this._arcade&&e&&"arcadeRequired"in e&&e.arcadeRequired&&(this._arcade=await se()),e&&"visualVariables"in e&&e.visualVariables)for(const t of e.visualVariables)"color"===t.type?this._colorVariable=t:"opacity"===t.type?this._opacityVariable=t:ut.warn(`Unsupported visual variable type for 3D Object Scene Services: ${t.type}`);if(e)for(const t of e.getSymbols())"mesh-3d"!==t.type&&ut.error(`Symbols of type '${t.type}' are not supported for 3D Object Scene Services.`);this._controller&&this._controller.requestUpdate()}_getCachedEdgeMaterials(e){return this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e),e.cachedEdgeMaterials}_getComponentParameters(e){this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e);const t=e.cachedSymbology;return(i,s)=>{const r=5*i;if(U(s.externalColor,t[r+0]/255,t[r+1]/255,t[r+2]/255,t[r+3]/255),h(this._stage.renderView.objectAndLayerIdRenderHelper)){const t=e.featureIds[i];this._stage.renderView.objectAndLayerIdRenderHelper.setUidToObjectAndLayerId(t,t,this.layerId,this.layerUid,this.layerPopupEnabled,e.node.resources.attributes,i,this.sublayerId),s.objectAndLayerIdColor=this._stage.renderView.getObjectAndLayerIdColor({graphicUid:t,layerUid:this.layerUid})}s.externalColorMixMode=t[r+4]&(1<<gt.CastShadows)-1,s.castShadows=0!=(t[r+4]&1<<gt.CastShadows),s.pickable=0!=(t[r+4]&1<<gt.Pickable),s.elevationOffset=e.elevationOffsets?.[i]??0}}_getSymbolInfo(e,t){const i=e&&e.getSymbol(t,{arcade:this._arcade});if(!(i instanceof re))return null;const s=i.id;if(this._symbolInfos.has(s))return this._symbolInfos.get(s);const r=We(i);return this._symbolInfos.set(s,r),r}_setSymbologyOverride(e,t){this._symbologyOverride!==e&&(this._symbologyOverride=e,this._symbologyOverrideFields=t,this._invalidateAllSymbols(),this._updateSymbologyFields())}_updateSymbologyFields(){this._symbologyFields=h(this._symbologyOverrideFields)&&this._symbologyOverrideFields.length>0?h(this._rendererFields)&&this._rendererFields.length>0?Z(this.i3slayer.fieldsIndex,[...this._rendererFields,...this._symbologyOverrideFields]):this._symbologyOverrideFields:this._rendererFields}_updateCachedRendererData(e){if(e.cachedRendererVersion=this._rendererVersion,!this._hasComponentData)return;const t=this._tmpAttributeOnlyGraphic,i={};t.attributes=i;const s=this._currentRenderer,r=h(e.attributeInfo)&&e.attributeInfo.attributeData,o=null!=e.featureIds?this.i3slayer.objectIdField:null,a=null!=r&&h(this._symbologyFields)&&this._symbologyFields.length>0,n=a?[]:null,l=a?[]:null;if(a&&h(this._symbologyFields))for(const h of this._symbologyFields){const e=r[h];e&&(n.push(h),l.push(e))}e.cachedSymbology||(e.cachedSymbology=new Uint8Array(5*e.featureIds.length));const d={color:Ot,castShadows:!0,pickable:!0,colorMixMode:Ze.Multiply,edgeMaterial:null},u=this.fullOpacity,_=this.nodeCrossfadingEnabled?this.getNodeOpacity(e):u;let m=null,g=ht.OPAQUE,p=$e,f=0;for(let y=0;y<e.featureIds.length;y++){if(null!=o&&(i[o]=e.featureIds[y]),a)for(let e=0;e<n.length;e++)i[n[e]]=Be(l[e],y);const r=this._getSymbolInfo(s,t);let u=null,b=null;if(s&&"visualVariables"in s){if(this._colorVariable){const e=te(this._colorVariable,t,{color:Et,arcade:this._arcade});e&&(u=Ot,u[0]=e.r/255,u[1]=e.g/255,u[2]=e.b/255,this._opacityVariable||null===e.a||(b=e.a))}this._opacityVariable&&(b=ie(this._opacityVariable,t,{arcade:this._arcade}))}if(r&&r.material){const e=r.material;u=c(u)||c(b)?ge(u,b,e.color,e.alpha,_t,Ot):ge(u,b,null,null,_t,Ot)}if(c(u)&&(u=Ot,u[0]=1,u[1]=1,u[2]=1,u[3]=1),d.pickable=!0,d.castShadows=!r||r.castShadows,d.colorMixMode=r&&r.material?r.material.colorMixMode:Ze.Multiply,d.edgeMaterial=r?r.edgeMaterial:null,h(this._symbologyOverride)&&(d.color=u,this._symbologyOverride(t,d),u=d.color),h(d.edgeMaterial)){const t=u[3]<=0?ht.INVISIBLE:u[3]>=1&&(e.material.isOpaque||d.colorMixMode===Ze.Replace)?ht.OPAQUE:ht.TRANSPARENT;d.edgeMaterial===m&&t===g||(p={...d.edgeMaterial,opacity:_,objectTransparency:t},m=d.edgeMaterial,g=t),e.cachedEdgeMaterials[y]=p}else e.cachedEdgeMaterials[y]=$e;e.cachedSymbology[f+0]=Math.round(255*u[0]),e.cachedSymbology[f+1]=Math.round(255*u[1]),e.cachedSymbology[f+2]=Math.round(255*u[2]),e.cachedSymbology[f+3]=Math.round(255*u[3]),e.cachedSymbology[f+4]=d.colorMixMode|+d.castShadows<<gt.CastShadows|+d.pickable<<gt.Pickable,f+=5}}_getFilteredEdgeMaterials(e){const t=this._getCachedEdgeMaterials(e);if(this.nodeCrossfadingEnabled||Pt(t,this.fullOpacity),c(e.filteredIds)){return{hasEdges:t.some((e=>e!==$e)),perFeatureEdgeMaterials:t}}let i=0,s=!1;const r=t.map(((t,r)=>e.featureIds[r]!==e.filteredIds[i]?$e:(s=s||t!==$e,i++,t)));return{hasEdges:s,perFeatureEdgeMaterials:r}}_updateComponentData(e){if(!this._hasComponentData)return;const t=e.objectHandle,i=this._getComponentParameters(e);this._collection.setComponentData(t,i),this._stage.renderView.requestRender()}_reloadAll(e=this.elevationOffset){this._removeAllNodeDataFromStage(e),null!=this._controller&&this._controller.restartNodeLoading()}_opacityChange(e){this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopAllNodeFading(),this._nodeId2Meta.forEach((t=>{c(t)||(this._collection.updateMaterial(t.objectHandle,(t=>t.objectOpacity=e)),Pt(t.cachedEdgeMaterials,e),this._updateEdgeRendering(t))}))}_updateMaterial(e){this._collection.updateMaterial(e.objectHandle,(e=>{e.commonMaterialParameters.hasSlicePlane=this.slicePlaneEnabled,e.usePBR=this._usePBR,this._updateMaterialOverlay(e)}))}_updateMaterialOverlay(e){}_updateEngineObject(e){this._updateComponentData(e),this._applyFiltersToNode(e),this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,vt.UPDATE)}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),h(this._labeler)&&(this._labeler.slicePlaneEnabled=e),this._nodeId2Meta.forEach((t=>{c(t)||(this._collection.updateMaterial(t.objectHandle,(t=>t.commonMaterialParameters.hasSlicePlane=e)),this._updateEdgeRendering(t,!1))}))}_updatePBR(e){this._nodeId2Meta.forEach((t=>{c(t)||this._collection.updateMaterial(t.objectHandle,(t=>t.usePBR=e))})),this._hasLoadedPBRTextures=!0}get _usePBR(){return!this._isIntegratedMesh&&this.view.qualitySettings.physicallyBasedRenderingEnabled}_updateEdgeRendering(e,t=!0){h(this._edgeView)&&this._edgeView.hasObject(e.objectHandle)&&this._addOrUpdateEdgeRendering(e,t)}_forAllNodes(e){this._nodeId2Meta.forEach(e)}_forAllFeatures(e,t,i=de.VISIBLE_ONLY){n(this._nodeId2Meta,(s=>{if(c(s))return!1;if(h(t)){switch(t(s)){case he.EXIT:return!0;case he.SKIP:return!1}}let r=he.CONTINUE;switch(i){case de.ALL:r=this._forAllFeaturesOfNode(s,e);break;case de.VISIBLE_ONLY:r=this._forVisibleFeaturesOfNode(s,e);break;case de.ALL_IN_CLIPPING_AREA:r=this._forAllFeaturesOfNodeInClippingArea(s,e)}return r===he.EXIT}))}_forAllFeaturesOfNode(e,t){let i=he.CONTINUE;const s=e.featureIds;for(let r=0;r<s.length;r++)if(i=t(s[r],r,e),i===he.EXIT)return i;return i}_forVisibleFeaturesOfNode(e,t){let i=he.CONTINUE;const s=e.featureIds;return this._collection.forEachVisibleComponent(e.objectHandle,(r=>(i=t(s[r],r,e),i===he.CONTINUE))),i}_forAllFeaturesOfNodeInClippingArea(e,t){if(c(this._renderClippingArea))return this._forAllFeaturesOfNode(e,t);const i=this._boundingRectNodeTest(e,this._renderClippingArea);if(i===ze.OUTSIDE)return he.CONTINUE;if(i===ze.INSIDE)return this._forAllFeaturesOfNode(e,t);const s=he.CONTINUE,r=e.featureIds,o=e.objectHandle,a=Xe(this._renderClippingArea,this._collection.getObjectTransform(o));for(let n=0;n<r.length;n++){if(!this._boundingRectFeatureTest(e,n,a))continue;const i=t(r[n],n,e);if(i===he.EXIT)return i}return s}_createAttributes(e,t){const i={};null!=t.featureIds&&(i[this._getObjectIdField()]=t.featureIds[e]);const s=h(t.attributeInfo)&&t.attributeInfo.attributeData;if(h(s))for(const r of Object.keys(s))i[r]=Be(s[r],e);return i}_createGraphic(e,t){return this._createLayerGraphic(this._createAttributes(e,t))}highlight(e){const t=this._highlights;if("number"==typeof e||e instanceof i?e=[e]:e instanceof o&&(e=e.toArray()),Array.isArray(e)&&e.length>0){if(e[0]instanceof i){const i=e,s=this.i3slayer.fieldsIndex,r=this._getObjectIdField(),o=i.map((e=>Je(s,e.attributes,r))),{set:a,handle:n}=t.acquireSet();return t.setFeatureIds(a,o),n}if("number"==typeof e[0]){const i=e,{set:s,handle:r}=t.acquireSet();return t.setFeatureIds(s,i),r}}return Nt}_visibleGeometryChanged(e,t){this._elevationProvider&&(this._elevationProvider.objectChanged(e.node),null==this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle=b((()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null}))),this._updateSnappingSources(e,t))}get performanceInfo(){const e={displayedNumberOfFeatures:0,maximumNumberOfFeatures:0,totalNumberOfFeatures:0,core:null,index:0,nodes:this._nodeId2Meta.size,"Total GPU Memory Estimate":(this._gpuMemoryEstimate/1048576).toFixed(1)+"MB","Geometry Memory Estimate":(this._geoMemoryEstimate/1048576).toFixed(1)+"MB","Texture Memory Estimate":(this._texMemoryEstimate/1048576).toFixed(1)+"MB","Unloaded Memory Estimate":(this.getUnloadedMemory()/1048576).toFixed(1)+"MB"};return h(this._memCache)&&(e.MemCache=Math.round(100*this._memCache.hitRate)+"% hit"),this._controller&&(this._idbCacheEnabled&&(e.IDBCache=Math.round(100*this._idbCache.getHitRate())+"% hit"),this._controller.updateStats(e)),e}get test(){const e=this;return{controller:this._controller,labeler:this._labeler,get visibleObjectIds(){const t=[];return e._forAllFeatures((e=>(t.push(e),he.CONTINUE)),null,de.VISIBLE_ONLY),t.sort(((e,t)=>e-t)),t},get numNodes(){return e._nodeId2Meta.size},get loadedNodes(){return Array.from(e._nodeId2Meta.keys()).sort(((e,t)=>e-t))}}}getNodeOpacityByIndex(e){const t=this._nodeId2Meta.get(e);return this.getNodeOpacity(t)}getNodeOpacity(e){return h(e)?this._collection.getMaterial(e.objectHandle).objectOpacity:0}isNodeFullyFadedIn(e){return this._crossfadeHelper.isNodeFullyFadedIn(e)}getNodeCrossfadeMetaData(e){return this._nodeId2Meta.get(e)}markNodeToRemove(e){this._controller&&this._controller.markNodeToRemove(e)}removeMarkedNodes(){this._controller&&this._controller.removeMarkedNodes()}foreachCrossfadeNode(e){this._nodeId2Meta.forEach(((t,i)=>e(i,t)))}fadeNode(e,t,i){if(!this.nodeCrossfadingEnabled)return;const s=this._nodeId2Meta.get(e);h(s)&&this._crossfadeHelper.fadeNode(e,s,t,i)}setNodeOpacityByIndex(e,t){const i=this._nodeId2Meta.get(e);h(i)&&this._setNodeOpacity(i,t)}_setNodeOpacity(e,t){this._collection.updateMaterial(e.objectHandle,(e=>e.objectOpacity=t)),this._setNodeEdgeOpacity(e,t)}_setNodeEdgeOpacity(e,t){if(c(this._edgeView)||!e.cachedEdgeMaterials)return;Pt(e.cachedEdgeMaterials,t);const i=e.objectHandle;this._edgeView.hasObject(i)&&this._edgeView.updateAllComponentOpacities(i,t).catch((e=>bt(e,this.i3slayer.title)))}get hasModifications(){return this._isIntegratedMesh&&h(this._layerClippingArea)||this._modifications&&this._modifications.length>0}updateNodeModificationStatus(e){const t=e.length;if(!this.hasModifications||t<=0||!0!==this._i3sWasmLoaded)return;const i=this.i3slayer.uid,s=Rt(e);if(h(s)){const t={context:i,buffer:s.buffer};_e(t);const r=new Float64Array(s.buffer);e.forAll(((e,t)=>{const i=r[t],s=me(i);e.imModificationImpact=s,s!==Ae.Unmodified&&this._controller.invalidateGeometryVisibility(e.index)}))}}notifyUpdate(){this.notifyChange("updating")}notifyLODUpdate(){this._controller.notifyLODUpdate()}isUpdating(){return!(!this._controller||!this._controller.updating)||!!this._visibleGeometryChangedSchedulerHandle||h(this._labeler)&&this._labeler.updating||this._crossfadeHelper.updating||this._i3sWasmLoaded instanceof Promise||this._asyncModuleLoading>0||h(this._elevationTask)&&this._elevationTask.running}trackSnappingSources(e){const t={events:e,fetchEdgeLocations:async(e,t,i)=>{const s=this._nodeId2Meta.get(e);if(c(s))throw new Error("invalid-node");const{origin:r,buffer:o}=await this._collection.extractEdgeInformation(s.objectHandle,t,i);return this._snappingLocationsApplyElevation(s,o,r),{type:"components",objectIds:s.featureIds,locations:o,origin:r}},remove:()=>{s(this._snappingSourcesTrackers,t)}};return this._snappingSourcesTrackers.push(t),this._nodeId2Meta.forEach(((t,i)=>{if(c(t))return;const s=this._controller.getRenderMbs(t.node);h(s)&&e.add(i,s)})),t}_snappingLocationsApplyElevation(e,t,i){if(!e.elevationOffsets||this.elevationInfo.mode===Ft.Absolute)return;const s=t.position0,r=t.position1,o=t.componentIndex,a=V(),n=V(),l=(e,t)=>{R(e,e,i),this.view.renderCoordsHelper.worldUpAtPosition(e,n),R(e,e,P(n,n,t)),F(e,e,i)};for(let d=0;d<s.count;d++){const t=e.elevationOffsets[o.get(d)];s.getVec(d,a),l(a,t),s.setVec(d,a),r.getVec(d,a),l(a,t),r.setVec(d,a)}}_updateSnappingSources(e,t){const{index:i}=e.node,s=this._controller.getRenderMbs(e.node);if(!c(s))for(const r of this._snappingSourcesTrackers)t!==vt.REMOVE&&t!==vt.UPDATE||r.events.remove(i),t!==vt.ADD&&t!==vt.UPDATE||r.events.add(i,s)}};return e([M()],r.prototype,"_hasLoadedPBRTextures",void 0),e([M()],r.prototype,"_asyncModuleLoading",void 0),e([M()],r.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([M()],r.prototype,"view",void 0),e([M()],r.prototype,"i3slayer",void 0),e([M()],r.prototype,"_controller",void 0),e([M()],r.prototype,"_labeler",void 0),e([M()],r.prototype,"updating",void 0),e([M()],r.prototype,"suspended",void 0),e([M()],r.prototype,"holeFilling",void 0),e([M(rt)],r.prototype,"updatingProgress",void 0),e([M()],r.prototype,"updatingProgressValue",null),e([M()],r.prototype,"hasTexturesOrVertexColors",null),e([M()],r.prototype,"rendererTextureUsage",null),e([M()],r.prototype,"elevationOffset",null),e([M()],r.prototype,"elevationInfo",null),e([M({type:Boolean})],r.prototype,"slicePlaneEnabled",void 0),e([M()],r.prototype,"supportedTextureEncodings",null),e([M()],r.prototype,"uncompressedTextureDownsamplingEnabled",null),e([M({type:[ee]})],r.prototype,"_modifications",void 0),e([M()],r.prototype,"_elevationTask",void 0),e([M({readOnly:!0})],r.prototype,"_usePBR",null),r=e([C(ct)],r),r};function bt(e,t){m(e)||ut.warn("Error while processing edges. Edges on this layer might not display correctly",t,e)}var vt;!function(e){e[e.ADD=0]="ADD",e[e.REMOVE=1]="REMOVE",e[e.UPDATE=2]="UPDATE"}(vt||(vt={}));const It=z(),Mt=X(),Ct=X(),xt=it(),Ot=[0,0,0,0],Et=new t([0,0,0,0]),St=[0,0,0,0];function Tt(e){if(c(e))return!1;const t=e.metallicRoughness;return t&&t.baseColorTextureId>=0||t&&t.metallicRoughnessTextureId>=0||e.normalTextureId>=0||e.emissiveTextureId>=0||e.occlusionTextureId>=0}function jt(e){return"geometryData"in e}function wt(e){return h(e)&&v(e.data)}function At(e,t){let i=1024+e.interleavedVertexData.byteLength+(e.indices?e.indices.byteLength:0)+e.positionData.data.byteLength+e.positionData.indices.byteLength;if(h(t))for(const s of t)h(s)&&v(s.data)&&(i+=s.data.byteLength);return i}function Dt(e,t){return t.byteSize>ft?(ut.warn(`Node is too big to store in IndexedDB cache: ${e.id} (${t.byteSize} bytes)`),!1):t.byteSize>0}function Rt(e){if(0===e.length)return null;const t=10*e.length,i=new Float64Array(t);return e.forAll(((e,t)=>{let s=e.serviceObb;c(s)&&(s=xt,N(s.center,e.mbs),s.halfSize[0]=s.halfSize[1]=s.halfSize[2]=e.mbs[3]);const r=10*t;i[r+0]=s.center[0],i[r+1]=s.center[1],i[r+2]=s.center[2],i[r+3]=s.halfSize[0],i[r+4]=s.halfSize[1],i[r+5]=s.halfSize[2],i[r+6]=s.quaternion[0],i[r+7]=s.quaternion[1],i[r+8]=s.quaternion[2],i[r+9]=s.quaternion[3]})),i}const Nt={remove(){},pause(){},resume(){}};function Pt(e,t){e.forEach((e=>e.opacity=t))}var Ft;!function(e){e[e.Absolute=0]="Absolute",e[e.RelativeToGround=1]="RelativeToGround",e[e.OnTheGround=2]="OnTheGround"}(Ft||(Ft={}));const Vt=V(),Ut=z(),Ht="elevation-change";export{Ft as ElevationMode,yt as I3SMeshView3D};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import i from"../../../Graphic.js";import{removeUnordered as s}from"../../../core/arrayUtils.js";import{ByteSizeUnit as r}from"../../../core/byteSizeEstimations.js";import o from"../../../core/Collection.js";import has from"../../../core/has.js";import a from"../../../core/Logger.js";import{someMap as n}from"../../../core/MapUtils.js";import{unwrapOr as l,destroyMaybe as d,isSome as h,isNone as c,applySome as u}from"../../../core/maybe.js";import _ from"../../../core/PooledArray.js";import{isAbortError as m,throwIfAborted as g,createResolver as p}from"../../../core/promiseUtils.js";import{initial as f,watch as b}from"../../../core/reactiveUtils.js";import{schedule as y}from"../../../core/scheduling.js";import{isArrayBuffer as v}from"../../../core/typedArrayUtil.js";import{getMetersPerVerticalUnitForSR as I}from"../../../core/unitUtils.js";import{property as M}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as C}from"../../../core/accessorSupport/decorators/subclass.js";import{f as x}from"../../../chunks/mat3.js";import{c as O}from"../../../chunks/mat3f32.js";import{m as E,D as S}from"../../../chunks/mat4.js";import{b as T,c as j}from"../../../chunks/mat4f64.js";import{m as w,s as A,t as D,a as R,c as N,g as F,b as P}from"../../../chunks/vec3.js";import{c as V}from"../../../chunks/vec3f64.js";import{s as U}from"../../../chunks/vec4.js";import{f as H}from"../../../chunks/vec4f64.js";import{projectBuffer as G,getProjectorName as L,localLinearScaleFactors as k,projectVectorToVector as B,projectBoundingSphere as q}from"../../../geometry/projection.js";import{create as z,empty as K,expandWithBuffer as W,toRect as $}from"../../../geometry/support/aaBoundingBox.js";import{create as X,intersects as Y}from"../../../geometry/support/aaBoundingRect.js";import{fallbackObjectIDAttribute as Q}from"../../../layers/LayerConstants.js";import J from"../../../layers/graphics/controllers/I3SOnDemandController.js";import{fixFields as Z}from"../../../layers/support/fieldUtils.js";import ee from"../../../layers/support/SceneModification.js";import{getColor as te,getOpacity as ie}from"../../../renderers/visualVariables/support/visualVariableUtils.js";import{loadArcade as se}from"../../../support/arcadeOnDemand.js";import re from"../../../symbols/Symbol3D.js";import{getMetersPerUnit as oe}from"../../../symbols/support/unitConversionUtils.js";import ae from"./I3SMeshViewLabeler.js";import{I3SMeshWorkerHandle as ne,toWasmModification as le}from"./I3SMeshWorkerHandle.js";import{ForAllFeaturesVisibilityMode as de,ForAllFeaturesReturnType as he}from"./II3SMeshView3D.js";import{initialize as ce,setModificationsSync as ue,filterObbsForModificationsSync as _e,interpretObbModificationResults as me}from"./SceneLayerWorker.js";import{overrideColor as ge}from"./graphics/graphicUtils.js";import{areLabelsVisible as pe}from"./graphics/Labeler.js";import{TextureUsage as fe,TextureEncoding as be}from"./i3s/enums.js";import ye from"./i3s/Highlights.js";import{I3SAsyncElevationUpdater as ve}from"./i3s/I3SAsyncElevationUpdater.js";import{I3SCrossfadeHelper as Ie,NodeCrossfadeMetaData as Me}from"./i3s/I3SCrossfadeHelper.js";import Ce from"./i3s/I3SElevationProvider.js";import{boundingBoxCornerPoints as xe}from"./i3s/I3SGeometryUtil.js";import{I3SIntersectionHandler as Oe}from"./i3s/I3SIntersectionHandler.js";import{getSupportedEncodings as Ee,selectEncoding as Se,defaultMaterial as Te,createTexture as je,configureMaterial as we}from"./i3s/I3SMaterialUtil.js";import{NodeIMModificationImpact as Ae,NodeState as De}from"./i3s/I3SNode.js";import{I3SOverrides as Re}from"./i3s/I3SOverrides.js";import{computeGlobalTransformation as Ne,getLocalOrigin as Fe}from"./i3s/I3SProjectionUtil.js";import{rendererNeedsTextures as Pe,checkSceneLayerValid as Ve,checkSceneLayerCompatibleWithView as Ue,getCacheKeySuffix as He,whenGraphicAttributes as Ge,computeVisibilityObb as Le,filterInPlace as ke,getCachedAttributeValue as Be,intersectBoundingRectWithMbs as qe,MbsIntersectResult as ze,addWraparound as Ke,getSymbolInfo as We,transparentEdgeMaterial as $e,getClipRect as Xe}from"./i3s/I3SUtil.js";import{IDBCache as Ye}from"./i3s/IDBCache.js";import{IDBMockCache as Qe}from"./i3s/IDBMockCache.js";import{attributeLookup as Je}from"./support/attributeUtils.js";import{ColorMixModeEnum as Ze}from"./support/symbolColorUtils.js";import et from"../support/debugFlags.js";import{toBoundingRect as tt}from"../support/extentUtils.js";import{create as it,clone as st}from"../support/orientedBoundingBox.js";import{updatingProgress as rt}from"../support/updatingProperties.js";import{glLayout as ot}from"../support/buffer/glUtil.js";import{State as at}from"../webgl-engine/collections/Component/ComponentObject.js";import{createVertexBufferLayout as nt}from"../webgl-engine/collections/Component/SourceGeometry.js";import{TextureCoordinateAttributeType as lt}from"../webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{loadBasis as dt}from"../webgl-engine/lib/BasisUtil.js";import{Transparency as ht}from"../webgl-engine/lib/edgeRendering/interfaces.js";const ct="esri.views.3d.layers.I3SMeshView3D",ut=a.getLogger(ct),_t=[1,1,1,1];class mt extends Me{constructor(e,t,i,s,r,o,a){super(),this.node=e,this.featureIds=t,this.objectHandle=i,this.cachedRendererVersion=s,this.attributeInfo=r,this.material=o,this.textures=a,this.cachedMidsTerrainSR=null,this.cachedEdgeMaterials=new Array,this.edgeMemoryUsage=0,this.cachedSymbology=null}}var gt;!function(e){e[e.CastShadows=4]="CastShadows",e[e.Pickable=5]="Pickable"}(gt||(gt={}));const pt=19,ft=100*r.MEGABYTES,bt=t=>{let r=class extends t{constructor(...e){super(e),this._nodeId2Meta=new Map,this._nodeId2MetaReloading=new Map,this._i3sWasmLoaded=!1,this._snappingSourcesTrackers=[],this._hasLoadedPBRTextures=!1,this._asyncModuleLoading=0,this._addTasks=new Map,this._currentRenderer=null,this._rendererVersion=0,this._colorVariable=null,this._opacityVariable=null,this._rendererFields=null,this._symbologyFields=null,this._symbologyOverride=null,this._symbologyOverrideFields=null,this._symbolInfos=new Map,this._visibleGeometryChangedSchedulerHandle=null,this._idbCache=has("enable-feature:idb-mock-cache")?new Qe:new Ye("esri-scenelayer-cache","geometries"),this._hasComponentData=!1,this._hasVertexColors=!1,this.holeFilling="auto",this._hasColors=!1,this._hasTextures=!1,this._hasData=!1,this.slicePlaneEnabled=!1,this._modifications=new Array,this._layerUrl="",this._cacheKeySuffix=null,this._elevationTask=null,this._filters=[],this._arcade=null,this._tmpAttributeOnlyGraphic=new i(null,null,{}),this._crossfadeHelper=new Ie(this)}get lodCrossfadeoutDuration(){return 0}get lodCrossfadeinDuration(){return 0}get lodCrossfadeUncoveredDuration(){return 0}get layerUid(){return this.i3slayer&&this.i3slayer.uid}get sublayerUid(){return null}get layerId(){return this.i3slayer&&this.i3slayer.id}get sublayerId(){return null}get updatingProgressValue(){return this._controller?.updatingProgress??0}get hasTexturesOrVertexColors(){return this._hasData?this._hasTextures||this._hasColors?"yes":"probably-not":"unknown"}get rendererTextureUsage(){return Pe(this._currentRenderer)?this._usePBR||this._hasLoadedPBRTextures?fe.AllTexturesPBR:fe.AllTextures:this._usePBR||this._hasLoadedPBRTextures?fe.GeometryTexturesPBR:fe.GeometryTextures}get elevationOffset(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;if(null!=e&&"absolute-height"===e.mode){const t=I(this.i3slayer.spatialReference),i=oe(e.unit);return l(e.offset,0)*i/t}return 0}get elevationInfo(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;if(null==e)return{mode:Pt.Absolute,offset:0};const t=I(this.i3slayer.spatialReference),i=oe(e.unit),s=l(e.offset,0)*i/t;switch(e.mode){case"absolute-height":return{mode:Pt.Absolute,offset:s};case"relative-to-ground":return{mode:Pt.RelativeToGround,offset:s};case"on-the-ground":return{mode:Pt.OnTheGround,offset:0};default:return{mode:Pt.Absolute,offset:0}}}get supportedTextureEncodings(){return Ee(this.view._stage.renderView.capabilities)}get uncompressedTextureDownsamplingEnabled(){const e=this.view?.qualitySettings.sceneService.uncompressedTextureDownsamplingEnabled,t=0==(this.supportedTextureEncodings&be.DDS_S3TC);return e&&t}initialize(){this._preLoadBasis(),this.addResolvingPromise(this.i3slayer.indexInfo);const e=this.view.resourceController;this.i3sOverrides=new Re({view:this.view,layer:this.i3slayer,memoryController:e.memoryController}),this._worker=new ne((t=>e.immediate.schedule(t))),this.addResolvingPromise(this._worker.promise);const t=this.i3slayer.store;this._worker.setLegacySchema(this.layerUid,t.defaultGeometrySchema),Ve(this.i3slayer),Ue(this.i3slayer,this.view),this._layerUrl=this.i3slayer.parsedUrl.path,this._controller=new J({layerView:this}),this._gpuMemoryEstimate=0,this._texMemoryEstimate=0,this._geoMemoryEstimate=0,this._stage=this.view._stage,this._collection=this._stage.renderView.componentObjectCollection,this._highlights=new ye({collection:this._collection,forAllFeatures:e=>this._forAllFeatures(e,null,de.ALL),forAllFeaturesOfNode:(e,t)=>this._forAllFeaturesOfNode(e,t)});const i=t.defaultGeometrySchema;if(this._isIntegratedMesh||!i)this._hasComponentData=!1;else{const e=i.featureAttributes;this._hasComponentData=!!(e&&e.faceRange&&e.id)}this._hasVertexColors=null!=(i?.vertexAttributes.color??null)&&(null==this.i3slayer.cachedDrawingInfo||!this.i3slayer.cachedDrawingInfo.color),this._isIntegratedMesh||(this._edgeView=this._stage.renderer.ensureEdgeView());const s=this.view.resourceController.memoryController.newCache(this.i3slayer.uid,(e=>this._deleteComponentObject(e)));this._memCache=s;const r=e=>h(this._controller.index)&&h(this._controller.index.rootNode)?this._controller.index.traverse(this._controller.index.rootNode,(t=>{const i=t.index,s=this._nodeId2Meta.get(i)||this._nodeId2MetaReloading.get(i);return e(t,h(s)?s.objectHandle:null)})):()=>{};this._intersectionHandler=new Oe({layerUid:this.layerUid,sublayerUid:this.sublayerUid,collection:this._collection,slicePlaneEnabled:this.slicePlaneEnabled,isGround:this._isIntegratedMesh,traverseNodeHierarchy:r}),this._elevationProvider=new Ce({layerView:this,intersectionHandler:this._intersectionHandler}),this._hasLoadedPBRTextures=this._usePBR,this.updatingHandles.add((()=>this.view.clippingArea),(()=>this._clippingAreaChanged()),f),this.updatingHandles.add((()=>this.fullOpacity),(e=>this._opacityChange(e))),this.updatingHandles.add((()=>this.slicePlaneEnabled),(e=>this._slicePlaneEnabledChange(e))),this.updatingHandles.add((()=>this.elevationOffset),((e,t)=>{this._reloadAll(t),this._controller.invalidateVisibilityObbs()})),this.updatingHandles.add((()=>this.elevationInfo),((e,t)=>this._elevationInfoChanged(e,t)),f),this.updatingHandles.add((()=>!this.suspended&&this.elevationInfo.mode!==Pt.Absolute),((e,t)=>{e?this.handles.add(this.view.basemapTerrain.on("elevation-change",(({extent:e})=>this._ensureElevationTask().addExtent(e))),Ht):t&&this.handles.remove(Ht)}),f),this.updatingHandles.add((()=>this._usePBR),(e=>this._updatePBR(e)));const o=()=>{this._reloadAll(),this.clearMemCache()};this.updatingHandles.add((()=>this.rendererTextureUsage),o),this.updatingHandles.add((()=>this.uncompressedTextureDownsamplingEnabled),o),this.updatingHandles.add((()=>this.suspended),(e=>this._suspendedChange(e)),f),this.updatingHandles.add((()=>this.i3slayer.labelsVisible),(()=>this._labelingChanged()),f),this.updatingHandles.add((()=>this.i3slayer.labelingInfo),(()=>this._labelingChanged()),f),this.updatingHandles.add((()=>this._modifications),(()=>this._modificationsChanged()),f),this.handles.add([b((()=>et.I3S_TREE_SHOW_TILES),(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&et.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||et.I3S_TREE_SHOW_TILES||(this._treeDebugger=d(this._treeDebugger))}),f),b((()=>et.I3S_SHOW_MODIFICATIONS),(()=>this._showModifications()),f)]),this._cacheKeySuffix=He(this.i3slayer.spatialReference,this.view.renderSpatialReference),this._idbCache.init().catch((e=>ut.warn(`Failed to initialize IndexedDB cache: ${e}`)))}destroy(){this._clearAddTasks(),this._elevationTask=d(this._elevationTask),this.i3sOverrides=d(this.i3sOverrides),this._elevationProvider&&(this._elevationProvider.layerChanged(),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._intersectionHandler&&(this._stage.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null);const e=this._worker;e&&(e.destroyContext(this.i3slayer.uid).then((()=>e.destroy())),this._worker=null),this._removeAllNodeDataFromStage(),this._memCache=d(this._memCache),this._collection=null,this._stage=null,this._edgeView=null,this._labeler=d(this._labeler),this._treeDebugger=d(this._treeDebugger),this._controller=d(this._controller),this._highlights.destroy(),this._nodeId2Meta.clear(),this._nodeId2MetaReloading.clear(),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null)}_memEstimateTextureAdded(e){const t=e.estimatedTexMemRequired;return this._gpuMemoryEstimate+=t,this._texMemoryEstimate+=t,t}_memEstimateTextureRemoved(e){if(h(e)){const t=e.estimatedTexMemRequired;this._gpuMemoryEstimate-=t,this._texMemoryEstimate-=t}}_memEstimateGeometryAdded(e){const t=this._collection.getObjectGPUMemoryUsage(e);return this._gpuMemoryEstimate+=t,this._geoMemoryEstimate+=t,t}_memEstimateGeometryRemoved(e){const t=this._collection.getObjectGPUMemoryUsage(e);this._gpuMemoryEstimate-=t,this._geoMemoryEstimate-=t}isNodeLoaded(e){return this._nodeId2Meta.has(e)}isNodeReloading(e){return this._nodeId2MetaReloading.has(e)}getUsedMemory(){let e=h(this._labeler)?this._labeler.usedMemory:0;return this._nodeId2Meta.forEach((t=>e+=h(t)?t.node.memory:0)),this._nodeId2MetaReloading.forEach((t=>e+=h(t)?t.node.memory:0)),e}getUnloadedMemory(){return(h(this._controller)?this._controller.unloadedMemoryEstimate:0)+(h(this._labeler)?this._labeler.unloadedMemoryEstimate:0)}ignoresMemoryFactor(){return!1}_labelingChanged(){if(!(pe(this.i3slayer)&&this._supportsLabeling))return void(h(this._labeler)&&(this._labeler.destroy(),this._labeler=null));if(h(this._labeler))return;const e=new ae({view:this.view,layer:this.i3slayer,collection:this._collection});this._nodeId2Meta.forEach((t=>h(t)&&this._addMetaToLabeler(e,t))),this._labeler=e}_loadAsyncModule(e){return++this._asyncModuleLoading,e.then((e=>(--this._asyncModuleLoading,e)),(e=>{throw--this._asyncModuleLoading,e}))}_modificationsChanged(){if(!this._i3sWasmLoaded&&this.hasModifications)return this._i3sWasmLoaded=ce().then((()=>{this._i3sWasmLoaded=!0,this._modificationsChanged(),this.notifyUpdate()})),void this.notifyUpdate();if(!0!==this._i3sWasmLoaded)return;const e=this.i3slayer.uid,t=this.i3slayer.spatialReference;this._worker.setModifications(e,this._layerClippingArea,this._modifications,t);const i=le(this._layerClippingArea,this._modifications,t);ue({context:e,modifications:i,isGeodetic:t.isGeographic}),this._controller.modificationsChanged();const s=this.hasModifications?new _:null;this._nodeId2Meta.forEach(((e,t)=>{c(e)?(this._nodeId2Meta.delete(t),this._controller.updateLoadStatus(t,!1)):e.node.hasModifications?(this._nodeId2Meta.delete(t),this._nodeId2MetaReloading.set(t,e)):h(s)&&s.push(e.node)})),h(s)&&this._nodeId2MetaReloading.forEach((e=>s.push(e.node))),h(s)&&s.length>0&&(this.updateNodeModificationStatus(s),s.forAll((e=>{if(e.imModificationImpact!==Ae.Culled){const t=this._nodeId2Meta.get(e.index);this._controller.invalidateGeometryVisibility(e.index),h(t)?(this._nodeId2Meta.delete(e.index),this._nodeId2MetaReloading.set(e.index,t)):this._nodeId2Meta.has(e.index)&&(this._nodeId2Meta.delete(e.index),this._controller.updateLoadStatus(e.index,!1))}}))),this.clearMemCache(),this._controller.restartNodeLoading(),this._showModifications()}_showModifications(){if(h(this._modificationGraphics)&&(this.view.graphics.removeMany(this._modificationGraphics),this._modificationGraphics=null),!et.I3S_SHOW_MODIFICATIONS||0===this._modifications.length)return;const e={clip:[227,227,79,.8],mask:[227,139,79,.8],replace:[139,227,79,.8]},t={type:"simple-fill",outline:{color:[255,255,255],width:1}};this._modificationGraphics=new Array;for(const s of this._modifications){const r=s.geometry;r.spatialReference=this.i3slayer.spatialReference;const o={...t,color:e[s.type]};this._modificationGraphics.push(new i({geometry:r,symbol:o}))}this.view.graphics.addMany(this._modificationGraphics)}_addMetaToLabeler(e,t){e.addNodeMeta(t,((e,t)=>this._createAttributes(e,t)))}_suspendedChange(e){e?(this._removeAllNodeDataFromStage(),this.view.elevationProvider&&this.view.elevationProvider.unregister(this._elevationProvider),this._stage.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler)):(this.view.elevationProvider.register(this._elevationContext,this._elevationProvider),this._stage.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler))}getLoadedAttributes(e){const t=this._nodeId2Meta.get(e);if(h(t)&&h(t.attributeInfo))return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodeId2Meta.get(e);if(h(t)&&h(t.attributeInfo))return t.attributeInfo.attributeData}setAttributeData(e,t){const i=this._nodeId2Meta.get(e);h(i)&&h(i.attributeInfo)&&(i.attributeInfo.attributeData=t,this._attributeValuesChanged(i))}async updateAttributes(e,t,i){const s=this._nodeId2Meta.get(e);h(s)&&(await this.i3sOverrides.apply(s.featureIds,t,i),s.attributeInfo=t,this._controller.reschedule((()=>this._attributeValuesChanged(s)),i).catch((e=>{m(e)||ut.warn("Error while updating attribute values. Layer might not display correctly.",e)})))}_attributeValuesChanged(e){e.cachedRendererVersion=this._getInvalidRendererVersion(),e.filteredIds=null,h(this._labeler)&&this._labeler.setNodeMetaAttributes(e,((e,t)=>this._createAttributes(e,t))),this._updateEngineObject(e)}clearMemCache(){h(this._memCache)&&this._memCache.clear()}getVisibleNodes(){const e=new Array;return this._nodeId2Meta.forEach((t=>h(t)&&e.push(t.node))),e}getNodeComponentObb(e){const t=this._nodeId2Meta.get(e.index)??this._nodeId2MetaReloading.get(e.index);return h(t)?this._collection.getComponentObb(t.objectHandle):null}getLoadedNodeIndices(e){this._nodeId2Meta.forEach(((t,i)=>e.push(i))),this._nodeId2MetaReloading.forEach(((t,i)=>e.push(i)))}_preLoadBasis(){!has("disable-feature:i3s-basis")&&0!=(this.supportedTextureEncodings&be.Basis)&&u(this.i3slayer.textureSetDefinitions,(e=>e.some((e=>e.formats.some((e=>"basis"===e.format||"ktx2"===e.format))))))&&dt()}_getVertexBufferLayout(e,t){const i={hasTexture:Tt(e.params.material),hasNormals:t.normal,hasRegions:t.uvRegion};return ot(nt(this._getGeometryParameters(i)))}_getObjectIdField(){return this.i3slayer.objectIdField||Q}_findGraphicNodeAndIndex(e){const t=Je(this.i3slayer.fieldsIndex,e.attributes,this._getObjectIdField());let i=null;return n(this._nodeId2Meta,(e=>{if(c(e))return!1;const s=e.featureIds.indexOf(t);return-1!==s&&(i={node:e.node,index:s},!0)})),i}_getGraphicIndices(e,t){const i=this._nodeId2Meta.get(e.index);if(c(i))return[];const s=[],r=this._getObjectIdField(),o=this.i3slayer.fieldsIndex;for(const a of t){const e=Je(o,a.attributes,r),t=i.featureIds.indexOf(e);-1!==t&&s.push(t)}return s}whenGraphicBounds(e){const t=this._findGraphicNodeAndIndex(e);if(!t)return Promise.reject();const i=this._getAABB(t.node.index,t.index);return c(i)?Promise.reject():Promise.resolve({boundingBox:i,screenSpaceObjects:[]})}getAABBFromIntersectorTarget(e){return null==e.nodeIndex||null==e.componentIndex?null:this._getAABB(e.nodeIndex,e.componentIndex)}_getAABB(e,t){const i=this._nodeId2Meta.get(e);if(c(i)||null==i.featureIds||t>=i.featureIds.length)return null;const s=i.objectHandle,r=xe(t,this._collection,s,new Float64Array(24)),o=this.view.renderSpatialReference,a=this.view.spatialReference;if(!G(r,o,0,r,a,0,8))return null;const n=K();return W(n,r,0,8),n}whenGraphicAttributes(e,t){return Ge(this.i3slayer,e,this._getObjectIdField(),t,(()=>[...this._nodeId2Meta.values()].filter(h)))}getGraphicFromIntersectorTarget(e){if(null==e.nodeIndex||null==e.componentIndex)return null;const t=this._nodeId2Meta.get(e.nodeIndex);return c(t)||null==t.featureIds||e.componentIndex>=t.featureIds.length?null:this._createGraphic(e.componentIndex,t)}_getCacheKey(e){return`${this._layerUrl}/v${pt}/${e.id}${this._cacheKeySuffix}`}_getMemCacheKey(e,t=this.elevationOffset){return e+"#"+t}get _idbCacheEnabled(){return!this._controller.disableIDBCache&&!this.hasModifications&&0===this.elevationOffset&&null!=this._cacheKeySuffix}loadCachedGPUData(e){return h(this._memCache)?this._memCache.pop(this._getMemCacheKey(e.index)):null}deleteCachedGPUData(e){h(e)&&this._deleteComponentObject(e)}_cacheGPUData(e,t=this.elevationOffset){if(c(this._memCache))return void this._deleteComponentObject(e);const i=this._controller.indexDepth-e.node.level;this._memCache.put(this._getMemCacheKey(e.node.index,t),e,e.node.memory,i)}loadMissingTextures(e,t,i,s){const r=e?.filter(((e,i)=>{if(0==(e.usage&this.rendererTextureUsage))return!1;if(c(t))return!0;const s=Se(e.encodings,this.supportedTextureEncodings),r=t[i];return!!(c(r)||null==r.data||s&&r.encoding!==s.encoding)}))??[];return 0===r.length?Promise.resolve(!1):i(r,s).then((i=>{let s=0;for(let r=0;r<e.length;r++)s<i.length&&i[s].id===e[r].id&&(t[r]=i[s],s++);return!0}))}loadCachedNodeData(e,t,i){return this._idbCacheEnabled?this._idbCache.get(this._getCacheKey(e),t).then((s=>null==s?null:s.nodeVersion!==e.version?(this._idbCache.remove(this._getCacheKey(e)),null):(this.elevationInfo.mode===Pt.Absolute&&(e.geometryObb=s.geometryObb),this.loadMissingTextures(s.requiredTextures,s.textureData,i,t).then((i=>(i&&this._idbCache.initialized&&h(s.textureData)&&(s.byteSize=At(s.transformedGeometry,s.textureData),s.textureData.every(wt)&&Dt(e,s)&&this._idbCache.put(this._getCacheKey(e),s).catch((t=>ut.warn(`Failed to update node with textures in IndexedDB cache: ${e.id}: ${t}`)))),g(t),s)))))):Promise.resolve(null)}addNode(e,t,i){return jt(t)?null==t.geometryBuffer?(this._addNodeMeta(e.index,null),Promise.resolve()):this._addData(e,t.attributeDataInfo,(()=>this._transformNode(e,t,i).then((s=>this._safeReschedule((()=>{if(c(s))return e.hasModifications=!1,this._addCachedNodeData(e,null,i);e.hasModifications=s.transformedGeometry.hasModifications;const{obb:r,componentOffsets:o,featureIds:a,transformedGeometry:n}=s,l=this._controller.crsIndex,d=this.view.renderSpatialReference,u=Ne(e.mbs,this.elevationOffset,l,d),_=it([r.center.x,r.center.y,r.center.z],[r.extents.x,r.extents.y,r.extents.z],[r.orientation.x,r.orientation.y,r.orientation.z,r.orientation.w]);w(_.center,_.center,u),this.elevationInfo.mode===Pt.Absolute&&(e.geometryObb=_),t.geometryData.componentOffsets=o,a&&(t.geometryData.featureIds=Array.from(a));const m={nodeVersion:e.version,geometryData:t.geometryData,requiredTextures:t.requiredTextures,textureData:t.textureData,transformedGeometry:n,globalTrafo:u,geometryObb:_,byteSize:At(n,t.textureData)};if(this._idbCacheEnabled&&this._idbCache.initialized&&Dt(e,m)){const t=h(m.textureData)?m.textureData.map((e=>wt(e)?e:null)):null;this._idbCache.put(this._getCacheKey(e),{...m,textureData:t}).catch((t=>ut.warn(`Failed to store node in IndexedDB cache: ${e.id}: ${t}`)))}return this._addCachedNodeData(e,m,i)}),i))))):Promise.reject()}computeVisibilityObb(e){return Le(e,this.view.renderSpatialReference,this._controller.crsIndex,this.i3slayer.spatialReference,this.elevationOffset,this._modifications)}_transformNode(e,t,i){const s=t.geometryData.geometries,r=new Array(s.length);for(let c=0;c<s.length;++c)r[c]=this._getVertexBufferLayout(s[c],t.geometryDescriptor);const o=e.mbs,a=this.elevationOffset,n=this._controller.crsIndex,l=this._controller.crsVertex,d=this.view.renderSpatialReference,h=Fe(o,a,n),u=Ne(o,a,n,d),_=L(n,l),m=L(l,d);if(c(_)||c(m))return Promise.resolve(null);const g={context:this.i3slayer.uid,geometryBuffer:t.geometryBuffer,geometryData:t.geometryData,geometryDescriptor:t.geometryDescriptor,layouts:r,localOrigin:h,globalTrafo:u,mbs:o,obb:e.serviceObb,elevationOffset:a,needNormals:!this._isIntegratedMesh&&this._controller.isMeshPyramid,normalReferenceFrame:this.i3slayer.normalReferenceFrame||"none",indexToVertexProjector:_,vertexToRenderProjector:m};return this._worker.invoke(g,i)}get _supportsNodeCrossFading(){return!this.view?._stage?.renderer.shadowsEnabled}get nodeCrossfadingEnabled(){return this._supportsNodeCrossFading&&(this.lodCrossfadeinDuration>0||this.lodCrossfadeoutDuration>0||this.lodCrossfadeUncoveredDuration>0)}get nodeFadeoutEnabled(){return this._supportsNodeCrossFading&&this.lodCrossfadeoutDuration>0}_setNewNodeOpacity(e){const t=this.nodeCrossfadingEnabled?0:this.fullOpacity;this._setNodeOpacity(e,t)}addCachedGPUData(e,t,i){if(this.elevationInfo.mode===Pt.Absolute&&(e.geometryObb=st(this._collection.getComponentObb(t.objectHandle))),!this._controller.isGeometryVisible(e))return void this._cacheGPUData(t);h(this._labeler)&&this._addMetaToLabeler(this._labeler,t);const s=e.index;this._addNodeMeta(s,t),this.updateNodeState(s,i),this._collection.setObjectVisibility(t.objectHandle,at.Visible),this._updateMaterial(t),this._setNewNodeOpacity(t),this.elevationInfo.mode!==Pt.Absolute&&this._ensureElevationTask().schedule(s),this._updateEngineObject(t),this._highlights.objectCreated(t),h(this._treeDebugger)&&this._treeDebugger.update()}addCachedNodeData(e,t,i,s){return this._addData(e,i,(()=>this._addCachedNodeData(e,t,s)))}async _addCachedNodeData(e,t,i){if(this.suspended||!this._controller.isGeometryVisible(e))return void this._removeNodeStageData(e.index,this.elevationOffset,this._nodeId2MetaReloading);if(c(t))return void this._addNodeMeta(e.index,null);const s=this._addTasks.get(e.index),{geometryData:r,transformedGeometry:o,globalTrafo:a}=t;await this.i3sOverrides.apply(r.featureIds,s.attributeInfo,i);const n=h(t.textureData)?t.textureData.filter((e=>h(e)&&0!=(e.usage&this.rendererTextureUsage))):[];!has("disable-feature:i3s-basis")&&n.some((e=>h(e)&&(e.encoding===be.Basis||e.encoding===be.KTX2)))&&await dt(),e.memory=0;const{componentOffsets:l,geometries:d,featureIds:u}=r,_=this._collection,m=d[0],{layout:g,indices:p,interleavedVertexData:f,positionData:b,hasColors:y}=o,v=this._materialParameters(m,g),I=l||new Uint32Array([0,p?p.length:f.byteLength/g[0].stride]),M={vertices:{data:f,count:f.byteLength/g[0].stride,layoutParameters:v.geometryParams},positionData:{positions:b.data,indices:b.indices},indices:p,componentOffsets:I},C=m.transformation?T(m.transformation):j();E(C,a,C);const w=S(V(),C),A=x(O(),C),D=this.view.renderSpatialReference,R=this.view.basemapTerrain.spatialReference,N=V(),F=[1,1,1];k(w,D,F,R)||ut.errorOnce("Unsupported coordinate system for IM overlay"),B(w,D,N,R);const P=_.createObject({toMapSpace:H(N[0],N[1],F[0],F[1]),geometry:M,obb:t.geometryObb,transform:{position:w,rotationScale:A}}),U=v.geometryParams.textureCoordinates===lt.Atlas,{textures:G,texturePromise:L}=this._initMaterialAndTextures(P,v.material,n,U);e.memory+=this._memEstimateGeometryAdded(P),e.memory+=G.reduce(((e,t)=>e+(h(t)?this._memEstimateTextureAdded(t):0)),0);const q=!!v.material.hasParametersFromSource,z="blend"!==v.material.alphaMode&&v.material.metallicRoughness.baseColorFactor[3]>=1,K=new mt(e,u,P,this._getInvalidRendererVersion(),s.attributeInfo,{hasParametersFromSource:q,isOpaque:z},G);s.meta=K,!this._hasTextures&&t.requiredTextures?.some((({usage:e})=>0!=(e&fe.ColorTextures)))&&(this._hasTextures=!0),this._hasData=!0,this._hasColors=this._hasColors||y,this._hasTextures=this._hasTextures||!!e.resources.texture,this.notifyChange("hasTexturesOrVertexColors");const W=this.slicePlaneEnabled;return Promise.all([this._addOrUpdateEdgeRendering(K),L]).then((([t,s])=>(h(t)&&t.updateObjectVisibility(K.objectHandle,!1).catch((e=>yt(e,this.i3slayer.title))),this._safeReschedule((()=>{const i=this._addTasks.get(e.index);if(!i)return;if(this._addNodeMeta(e.index,K),i.meta=null,this.suspended)return void this._removeNodeStageData(e.index,this.elevationOffset);_.setObjectVisibility(P,at.Visible),h(t)&&t.updateObjectVisibility(K.objectHandle,!0).catch((e=>yt(e,this.i3slayer.title))),K.attributeInfo=i.attributeInfo;const s=K.cachedRendererVersion!==this._rendererVersion,r=W!==this.slicePlaneEnabled;this._updateElevationOffsets(K);const o=K.elevationOffsets;this._updateComponentData(K);const a=this._applyFiltersToNode(K);(s||h(t)&&(r||a||o))&&this._addOrUpdateEdgeRendering(K),h(this._labeler)&&this._addMetaToLabeler(this._labeler,K),this._visibleGeometryChanged(K,vt.ADD),this._highlights.objectCreated(K),this._updateMaterial(K),this._setNewNodeOpacity(K),h(this._treeDebugger)&&this._treeDebugger.update()}),i)))).catch((e=>{throw h(s.meta)&&(this._cacheGPUData(s.meta),s.meta=null),e}))}_addNodeMeta(e,t){if(this._removeNodeStageData(e,this.elevationOffset,this._nodeId2MetaReloading),this._nodeId2Meta.has(e)){ut.error("Removing duplicated node");const t=this._nodeId2Meta.get(e);h(t)&&this._deleteComponentObject(t)}else this._controller.updateLoadStatus(e,!0);h(t)&&(t.lodCrossfadeProgress=null,this.nodeCrossfadingEnabled&&Ft(t.cachedEdgeMaterials,0)),this._nodeId2Meta.set(e,t)}_updateElevationOffsets(e){const t=this.view.renderSpatialReference,i=this.elevationInfo,s=this.view.basemapTerrain,r=s.spatialReference,o=i.mode;if(c(t)||c(r)||o===Pt.Absolute)return void(e.elevationOffsets=null);const a=this._collection.getObjectTransform(e.objectHandle);e.elevationOffsets=e.elevationOffsets??[];const n=Vt,l=Ut,d=o===Pt.OnTheGround,u=this.view.renderCoordsHelper,_=!!e.cachedMidsTerrainSR,m=e.featureIds.length;if(!_){e.cachedMidsTerrainSR=new Float64Array(3*m);const i=e.cachedMidsTerrainSR;for(let s=0;s<m;s++){this._collection.getComponentAabb(e.objectHandle,s,l,!0),A(n,(l[0]+l[3])/2,(l[1]+l[4])/2,l[2]),D(n,n,a.rotationScale),R(n,n,a.position);const o=3*s;i[o+2]=u.getAltitude(n),B(n,t,n,r),i[o+0]=n[0],i[o+1]=n[1]}}const g=e.cachedMidsTerrainSR,p=i.offset,f=e.elevationOffsets,b=(e,t)=>{const i=d?g[3*e+2]:0;f[e]=p+(h(t)?t-i:0)};s.getElevations(g,m,b)}_ensureElevationTask(){return h(this._elevationTask)||(this._elevationTask=new ve(this.view.resourceController.scheduler,(e=>{const t=this._controller.updateElevationChanged(e,this.view.basemapTerrain.spatialReference);return h(t)?t.filterInPlace((e=>h(this._nodeId2Meta.get(e)))):null}),(e=>{const t=this._nodeId2Meta.get(e);this._nodeElevationAlignmentChanged(t)}))),this._elevationTask}_elevationInfoChanged(e,t){const i=e.mode!==Pt.Absolute,s=!!t&&t!==e&&t.mode!==Pt.Absolute;this._intersectionHandler.updateElevationAlignState(i,this.view.state.viewingMode),i&&!s&&this._controller.removeAllGeometryObbs(),this._nodeId2Meta.forEach((e=>this._nodeElevationAlignmentChanged(e)))}_nodeElevationAlignmentChanged(e){c(e)||(this._updateElevationOffsets(e),this._updateComponentData(e),this._updateEdgeRendering(e),h(this._labeler)&&this._labeler.updateLabelPositions(e),this._updateSnappingSources(e,vt.UPDATE))}_safeReschedule(e,t){return g(t),this._controller.reschedule(e,t)}_materialParameters(e,t){const i=h(e.params.material)?e.params.material:Te(),s=t.some((e=>"uvRegion"===e.name)),r=t.some((e=>"normalCompressed"===e.name)),o=Tt(i);return{geometryParams:this._getGeometryParameters({hasTexture:o,hasNormals:r,hasRegions:s}),material:i}}_initMaterialAndTextures(e,t,i,s){const r=this._stage.renderView,o=i.map((e=>je(e,t,s,r)));this._stage.addMany(o);let a=null;return this._collection.updateMaterial(e,(e=>{a=we(e,t,o,i,this.view._stage.renderView.textureRepository,{rendererTextureUsage:this.rendererTextureUsage,usePBR:this._usePBR,isIntegratedMesh:this._isIntegratedMesh,slicePlaneEnabled:this.slicePlaneEnabled,viewSpatialReference:this.view.spatialReference}),this._updateMaterialOverlay(e)})),{textures:o,texturePromise:a}}_getGeometryParameters(e){return{textureCoordinates:e.hasTexture?e.hasRegions?lt.Atlas:lt.Default:lt.None,colors:this._hasVertexColors,normals:e.hasNormals&&!this._isIntegratedMesh}}_addData(e,t,i){let s=this._addTasks.get(e.index);return s?s.attributeInfo=t:(s={...p(),attributeInfo:t,meta:null},this._addTasks.set(e.index,s),i().then(s.resolve,s.reject).then((()=>this._addTasks.delete(e.index))).catch((t=>{throw this._addTasks.delete(e.index),t}))),s.promise}_clearAddTasks(){this._addTasks.forEach((e=>{h(e.meta)&&(this._cacheGPUData(e.meta),e.meta=null)})),this._addTasks.clear()}_clippingAreaChanged(){const e=this.view.renderSpatialReference,t=this.i3slayer.spatialReference,i=X();this._renderClippingArea=tt(this.view.clippingArea,i,e)?i:null;const s=X();this._layerClippingArea=tt(this.view.clippingArea,s,t)?s:null,this._filterChange(),this._controller&&this._controller.updateClippingArea(this.view.clippingArea),this._isIntegratedMesh&&this._modificationsChanged()}get hasGeometryFilter(){return!1}_geometryFilterChange(){const e=this.hasGeometryFilter;this._controller.geometryFilterChanged(e),this._applyFilters(e)}_filterChange(){this._applyFilters(this.hasGeometryFilter)}_applyFilters(e){this._filters=this.getFilters(),e?this._controller&&this._controller.requestUpdate():this._nodeId2Meta.forEach((e=>{h(e)&&this._applyFiltersToNode(e)&&(this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,vt.UPDATE))}))}getFilters(){const e=[],t=this._renderClippingArea;return h(t)&&e.push(((e,i)=>this._boundingRectFilter(e,i,t))),e}addSqlFilter(e,t,i){if(h(t)){const s=t.fieldNames;e.push(((e,r)=>this._sqlFilter(e,r,t,s,i)))}}_sqlFilter(e,t,i,s,r){const o={},a=this._createLayerGraphic(o),n=this.i3slayer.objectIdField,l=t.featureIds,d=h(t.attributeInfo)&&t.attributeInfo.attributeData;s.every((e=>e===n||d&&null!=d[e]))&&ke(e,l,(e=>{o[n]=l[e];for(const i of s)i!==n&&(o[i]=d?Be(d[i],e):null);try{return i.testFeature(a)}catch(t){return r(t),!1}}))}_boundingRectNodeTest(e,t){return q(e.node.mbs,this._controller.crsIndex,St,this.view.renderSpatialReference),qe(t,St)}_boundingRectFeatureTest(e,t,i){return this._collection.getComponentAabb(e.objectHandle,t,It),$(It,Mt),Y(i,Mt)}_boundingRectFilter(e,t,i){const s=this._collection,r=this._boundingRectNodeTest(t,i);if(r===ze.INSIDE)return;if(r===ze.OUTSIDE)return void(e.length=0);const o=s.getComponentCount(t.objectHandle);if(o.invisible+o.visible!==t.featureIds.length)return;const a=this._transformClippingArea(Ct,i,t.objectHandle);ke(e,t.featureIds,(e=>this._boundingRectFeatureTest(t,e,a)))}_transformClippingArea(e,t,i){const s=this._collection.getObjectTransform(i),r=s.position,o=s.rotationScale;return e[0]=(t[0]-r[0])/o[0],e[1]=(t[1]-r[1])/o[4],e[2]=(t[2]-r[0])/o[0],e[3]=(t[3]-r[1])/o[4],e}_addOrUpdateEdgeRendering(e,t=!0){const i=this._edgeView;if(c(i))return Promise.resolve(null);const s=e.objectHandle,r=i.hasObject(s),{hasEdges:o,perFeatureEdgeMaterials:a}=this._getFilteredEdgeMaterials(e),n={hasSlicePlane:this.slicePlaneEnabled};if(o&&r){if(this.nodeCrossfadingEnabled){Ft(a,this.getNodeOpacity(e))}return i.updateAllComponentMaterials(s,a,n,t).catch((e=>yt(e,this.i3slayer.title))),i.updateObjectVisibility(s,!0).catch((e=>yt(e,this.i3slayer.title))),i.updateAllVerticalOffsets(s,e.elevationOffsets).catch((e=>yt(e,this.i3slayer.title))),Promise.resolve(i)}return o&&!r?this._collection.addEdges(s,i,a,n).then((t=>(e.edgeMemoryUsage=t,e.node.memory+=t,i.updateAllVerticalOffsets(s,e.elevationOffsets).catch((e=>yt(e,this.i3slayer.title))),i))):(!o&&r&&(e.node.memory-=e.edgeMemoryUsage,e.edgeMemoryUsage=0,i.removeObject(s)),Promise.resolve(null))}_applyFiltersToNode(e){return!!this._applyFiltersToNodeComponents(e)&&(h(this._labeler)&&this._labeler.applyFilterChange(e),!0)}_applyFiltersToNodeComponents(e){const t=this._collection,i=0===t.getComponentCount(e.objectHandle).invisible;if(t.setAllComponentVisibilities(e.objectHandle,"all"),0===this._filters.length)return e.filteredIds=null,!i;if(this._updateCachedFilteredIds(e),e.filteredIds===e.featureIds)return!i;const s=this._computeFilteredComponentIndices(e);return t.setAllComponentVisibilities(e.objectHandle,s),!0}_updateCachedFilteredIds(e){null!=e.filteredIds&&e.appliedFilters===this._filters||(e.filteredIds=this._computeFilteredIds(e),e.appliedFilters=this._filters)}_computeFilteredIds(e){const t=e.featureIds.slice();for(const i of this._filters)if(i(t,e),0===t.length)break;return t.length===e.featureIds.length?e.featureIds:t}_computeFilteredComponentIndices(e){const t=new Array,i=e.filteredIds;return h(i)&&e.featureIds.forEach(((e,s)=>{i[t.length]===e&&t.push(s)})),t}_removeAllNodeDataFromStage(e=this.elevationOffset){this._nodeId2Meta.forEach(((t,i)=>this._removeNodeStageData(i,e))),this._nodeId2MetaReloading.forEach(((t,i)=>this._removeNodeStageData(i,e,this._nodeId2MetaReloading))),this._elevationTask=d(this._elevationTask)}removeNode(e){const t=this.elevationOffset;this._removeNodeStageData(e,t),this._removeNodeStageData(e,t,this._nodeId2MetaReloading),h(this._elevationTask)&&this._elevationTask.remove(e)}_removeNodeStageData(e,t,i=this._nodeId2Meta){i.has(e)&&this._controller.updateLoadStatus(e,!1);const s=i.get(e);c(s)?i.delete(e):(this._collection.setObjectVisibility(s.objectHandle,at.Hidden),h(this._edgeView)&&this._edgeView.hasObject(s.objectHandle)&&this._edgeView.updateObjectVisibility(s.objectHandle,!1).catch((e=>yt(e,this.i3slayer.title))),this._visibleGeometryChanged(s,vt.REMOVE),h(this._labeler)&&this._labeler.removeNodeMeta(s),i.delete(e),this._highlights.objectDeleted(s),i===this._nodeId2Meta?(this._cacheGPUData(s,t),this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopNodeFading(s)):this._deleteComponentObject(s),h(this._treeDebugger)&&this._treeDebugger.update())}_deleteComponentObject(e){if(h(this._edgeView)&&this._edgeView.removeObject(e.objectHandle),this._memEstimateGeometryRemoved(e.objectHandle),this._collection.destroyObject(e.objectHandle),e.textures)for(const t of e.textures)this._memEstimateTextureRemoved(t),this._stage.remove(t)}updateNodeState(e,t){const i=this._nodeId2Meta.get(e);h(i)&&this._collection.updateMaterial(i.objectHandle,(e=>e.polygonOffsetEnabled=t===De.Hole))}_invalidateAllSymbols(){this._rendererVersion=Ke(this._rendererVersion,1),this._controller&&this._controller.requestUpdate()}_getInvalidRendererVersion(){return Ke(this._rendererVersion,-1)}async _rendererChange(e){if(this._currentRenderer=e,this.notifyChange("rendererTextureUsage"),this._rendererVersion=Ke(this._rendererVersion,1),this._rendererFields=null,this._colorVariable=null,this._opacityVariable=null,this._invalidateAllSymbols(),e&&(this._rendererFields=await e.getRequiredFields(this.i3slayer.fieldsIndex)),this._updateSymbologyFields(),!this._arcade&&e&&"arcadeRequired"in e&&e.arcadeRequired&&(this._arcade=await se()),e&&"visualVariables"in e&&e.visualVariables)for(const t of e.visualVariables)"color"===t.type?this._colorVariable=t:"opacity"===t.type?this._opacityVariable=t:ut.warn(`Unsupported visual variable type for 3D Object Scene Services: ${t.type}`);if(e)for(const t of e.getSymbols())"mesh-3d"!==t.type&&ut.error(`Symbols of type '${t.type}' are not supported for 3D Object Scene Services.`);this._controller&&this._controller.requestUpdate()}_getCachedEdgeMaterials(e){return this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e),e.cachedEdgeMaterials}_getComponentParameters(e){this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e);const t=e.cachedSymbology;return(i,s)=>{const r=5*i;if(U(s.externalColor,t[r+0]/255,t[r+1]/255,t[r+2]/255,t[r+3]/255),h(this._stage.renderView.objectAndLayerIdRenderHelper)){const t=e.featureIds[i];this._stage.renderView.objectAndLayerIdRenderHelper.setUidToObjectAndLayerId(t,t,this.layerId,this.layerUid,this.layerPopupEnabled,e.node.resources.attributes,i,this.sublayerId),s.objectAndLayerIdColor=this._stage.renderView.getObjectAndLayerIdColor({graphicUid:t,layerUid:this.layerUid})}s.externalColorMixMode=t[r+4]&(1<<gt.CastShadows)-1,s.castShadows=0!=(t[r+4]&1<<gt.CastShadows),s.pickable=0!=(t[r+4]&1<<gt.Pickable),s.elevationOffset=e.elevationOffsets?.[i]??0}}_getSymbolInfo(e,t){const i=e&&e.getSymbol(t,{arcade:this._arcade});if(!(i instanceof re))return null;const s=i.id;if(this._symbolInfos.has(s))return this._symbolInfos.get(s);const r=We(i);return this._symbolInfos.set(s,r),r}_setSymbologyOverride(e,t){this._symbologyOverride!==e&&(this._symbologyOverride=e,this._symbologyOverrideFields=t,this._invalidateAllSymbols(),this._updateSymbologyFields())}_updateSymbologyFields(){this._symbologyFields=h(this._symbologyOverrideFields)&&this._symbologyOverrideFields.length>0?h(this._rendererFields)&&this._rendererFields.length>0?Z(this.i3slayer.fieldsIndex,[...this._rendererFields,...this._symbologyOverrideFields]):this._symbologyOverrideFields:this._rendererFields}_updateCachedRendererData(e){if(e.cachedRendererVersion=this._rendererVersion,!this._hasComponentData)return;const t=this._tmpAttributeOnlyGraphic,i={};t.attributes=i;const s=this._currentRenderer,r=h(e.attributeInfo)&&e.attributeInfo.attributeData,o=null!=e.featureIds?this.i3slayer.objectIdField:null,a=null!=r&&h(this._symbologyFields)&&this._symbologyFields.length>0;let n=null,l=null;if(a&&h(this._symbologyFields)){n=[],l=[];for(const e of this._symbologyFields){const t=r[e];t&&(n.push(e),l.push(t))}}e.cachedSymbology||(e.cachedSymbology=new Uint8Array(5*e.featureIds.length));const d={color:Ot,castShadows:!0,pickable:!0,colorMixMode:Ze.Multiply,edgeMaterial:null},u=this.fullOpacity,_=this.nodeCrossfadingEnabled?this.getNodeOpacity(e):u;let m=null,g=ht.OPAQUE,p=$e,f=0;for(let b=0;b<e.featureIds.length;b++){if(null!=o&&(i[o]=e.featureIds[b]),a&&n)for(let e=0;e<n.length;e++)i[n[e]]=Be(l[e],b);const r=s?this._getSymbolInfo(s,t):null;let u=null,y=null;if(s&&"visualVariables"in s){if(this._colorVariable){const e=te(this._colorVariable,t,{color:Et,arcade:this._arcade});e&&(u=Ot,u[0]=e.r/255,u[1]=e.g/255,u[2]=e.b/255,this._opacityVariable||null===e.a||(y=e.a))}this._opacityVariable&&(y=ie(this._opacityVariable,t,{arcade:this._arcade}))}if(r&&r.material){const e=r.material;u=c(u)||c(y)?ge(u,y,e.color,e.alpha,_t,Ot):ge(u,y,null,null,_t,Ot)}if(c(u)&&(u=Ot,u[0]=1,u[1]=1,u[2]=1,u[3]=1),d.pickable=!0,d.castShadows=!r||r.castShadows,d.colorMixMode=r&&r.material?r.material.colorMixMode:Ze.Multiply,d.edgeMaterial=r?r.edgeMaterial:null,h(this._symbologyOverride)&&(d.color=u,this._symbologyOverride(t,d),u=d.color),h(d.edgeMaterial)){const t=u[3]<=0?ht.INVISIBLE:u[3]>=1&&(e.material.isOpaque||d.colorMixMode===Ze.Replace)?ht.OPAQUE:ht.TRANSPARENT;d.edgeMaterial===m&&t===g||(p={...d.edgeMaterial,opacity:_,objectTransparency:t},m=d.edgeMaterial,g=t),e.cachedEdgeMaterials[b]=p}else e.cachedEdgeMaterials[b]=$e;e.cachedSymbology[f+0]=Math.round(255*u[0]),e.cachedSymbology[f+1]=Math.round(255*u[1]),e.cachedSymbology[f+2]=Math.round(255*u[2]),e.cachedSymbology[f+3]=Math.round(255*u[3]),e.cachedSymbology[f+4]=d.colorMixMode|+d.castShadows<<gt.CastShadows|+d.pickable<<gt.Pickable,f+=5}}_getFilteredEdgeMaterials(e){const t=this._getCachedEdgeMaterials(e);this.nodeCrossfadingEnabled||Ft(t,this.fullOpacity);const i=e.filteredIds;if(c(i)){return{hasEdges:t.some((e=>e!==$e)),perFeatureEdgeMaterials:t}}let s=0,r=!1;const o=t.map(((t,o)=>e.featureIds[o]!==i[s]?$e:(r=r||t!==$e,s++,t)));return{hasEdges:r,perFeatureEdgeMaterials:o}}_updateComponentData(e){if(!this._hasComponentData)return;const t=e.objectHandle,i=this._getComponentParameters(e);this._collection.setComponentData(t,i),this._stage.renderView.requestRender()}_reloadAll(e=this.elevationOffset){this._removeAllNodeDataFromStage(e),null!=this._controller&&this._controller.restartNodeLoading()}_opacityChange(e){this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopAllNodeFading(),this._nodeId2Meta.forEach((t=>{c(t)||(this._collection.updateMaterial(t.objectHandle,(t=>t.objectOpacity=e)),Ft(t.cachedEdgeMaterials,e),this._updateEdgeRendering(t))}))}_updateMaterial(e){this._collection.updateMaterial(e.objectHandle,(e=>{e.commonMaterialParameters.hasSlicePlane=this.slicePlaneEnabled,e.usePBR=this._usePBR,this._updateMaterialOverlay(e)}))}_updateMaterialOverlay(e){}_updateEngineObject(e){this._updateComponentData(e),this._applyFiltersToNode(e),this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,vt.UPDATE)}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),h(this._labeler)&&(this._labeler.slicePlaneEnabled=e),this._nodeId2Meta.forEach((t=>{c(t)||(this._collection.updateMaterial(t.objectHandle,(t=>t.commonMaterialParameters.hasSlicePlane=e)),this._updateEdgeRendering(t,!1))}))}_updatePBR(e){this._nodeId2Meta.forEach((t=>{c(t)||this._collection.updateMaterial(t.objectHandle,(t=>t.usePBR=e))})),this._hasLoadedPBRTextures=!0}get _usePBR(){return!this._isIntegratedMesh&&this.view.qualitySettings.physicallyBasedRenderingEnabled}_updateEdgeRendering(e,t=!0){h(this._edgeView)&&this._edgeView.hasObject(e.objectHandle)&&this._addOrUpdateEdgeRendering(e,t)}_forAllNodes(e){this._nodeId2Meta.forEach(e)}_forAllFeatures(e,t,i=de.VISIBLE_ONLY){n(this._nodeId2Meta,(s=>{if(c(s))return!1;if(h(t)){switch(t(s)){case he.EXIT:return!0;case he.SKIP:return!1}}let r=he.CONTINUE;switch(i){case de.ALL:r=this._forAllFeaturesOfNode(s,e);break;case de.VISIBLE_ONLY:r=this._forVisibleFeaturesOfNode(s,e);break;case de.ALL_IN_CLIPPING_AREA:r=this._forAllFeaturesOfNodeInClippingArea(s,e)}return r===he.EXIT}))}_forAllFeaturesOfNode(e,t){let i=he.CONTINUE;const s=e.featureIds;for(let r=0;r<s.length;r++)if(i=t(s[r],r,e),i===he.EXIT)return i;return i}_forVisibleFeaturesOfNode(e,t){let i=he.CONTINUE;const s=e.featureIds;return this._collection.forEachVisibleComponent(e.objectHandle,(r=>(i=t(s[r],r,e),i===he.CONTINUE))),i}_forAllFeaturesOfNodeInClippingArea(e,t){if(c(this._renderClippingArea))return this._forAllFeaturesOfNode(e,t);const i=this._boundingRectNodeTest(e,this._renderClippingArea);if(i===ze.OUTSIDE)return he.CONTINUE;if(i===ze.INSIDE)return this._forAllFeaturesOfNode(e,t);const s=he.CONTINUE,r=e.featureIds,o=e.objectHandle,a=Xe(this._renderClippingArea,this._collection.getObjectTransform(o));for(let n=0;n<r.length;n++){if(!this._boundingRectFeatureTest(e,n,a))continue;const i=t(r[n],n,e);if(i===he.EXIT)return i}return s}_createAttributes(e,t){const i={};null!=t.featureIds&&(i[this._getObjectIdField()]=t.featureIds[e]);const s=h(t.attributeInfo)&&t.attributeInfo.attributeData;if(h(s))for(const r of Object.keys(s))i[r]=Be(s[r],e);return i}_createGraphic(e,t){return this._createLayerGraphic(this._createAttributes(e,t))}highlight(e){const t=this._highlights;if("number"==typeof e||e instanceof i?e=[e]:e instanceof o&&(e=e.toArray()),Array.isArray(e)&&e.length>0){if(e[0]instanceof i){const i=e,s=this.i3slayer.fieldsIndex,r=this._getObjectIdField(),o=i.map((e=>Je(s,e.attributes,r))),{set:a,handle:n}=t.acquireSet();return t.setFeatureIds(a,o),n}if("number"==typeof e[0]){const i=e,{set:s,handle:r}=t.acquireSet();return t.setFeatureIds(s,i),r}}return Nt}_visibleGeometryChanged(e,t){this._elevationProvider&&(this._elevationProvider.objectChanged(e.node),null==this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle=y((()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null}))),this._updateSnappingSources(e,t))}get performanceInfo(){const e={displayedNumberOfFeatures:0,maximumNumberOfFeatures:0,totalNumberOfFeatures:0,core:null,index:0,nodes:this._nodeId2Meta.size,"Total GPU Memory Estimate":(this._gpuMemoryEstimate/1048576).toFixed(1)+"MB","Geometry Memory Estimate":(this._geoMemoryEstimate/1048576).toFixed(1)+"MB","Texture Memory Estimate":(this._texMemoryEstimate/1048576).toFixed(1)+"MB","Unloaded Memory Estimate":(this.getUnloadedMemory()/1048576).toFixed(1)+"MB"};return h(this._memCache)&&(e.MemCache=Math.round(100*this._memCache.hitRate)+"% hit"),this._controller&&(this._idbCacheEnabled&&(e.IDBCache=Math.round(100*this._idbCache.getHitRate())+"% hit"),this._controller.updateStats(e)),e}get test(){const e=this;return{controller:this._controller,labeler:this._labeler,get visibleObjectIds(){const t=[];return e._forAllFeatures((e=>(t.push(e),he.CONTINUE)),null,de.VISIBLE_ONLY),t.sort(((e,t)=>e-t)),t},get numNodes(){return e._nodeId2Meta.size},get loadedNodes(){return Array.from(e._nodeId2Meta.keys()).sort(((e,t)=>e-t))}}}getNodeOpacityByIndex(e){const t=this._nodeId2Meta.get(e);return this.getNodeOpacity(t)}getNodeOpacity(e){return h(e)?this._collection.getMaterial(e.objectHandle).objectOpacity:0}isNodeFullyFadedIn(e){return this._crossfadeHelper.isNodeFullyFadedIn(e)}getNodeCrossfadeMetaData(e){return this._nodeId2Meta.get(e)}markNodeToRemove(e){this._controller&&this._controller.markNodeToRemove(e)}removeMarkedNodes(){this._controller&&this._controller.removeMarkedNodes()}foreachCrossfadeNode(e){this._nodeId2Meta.forEach(((t,i)=>e(i,t)))}fadeNode(e,t,i){if(!this.nodeCrossfadingEnabled)return;const s=this._nodeId2Meta.get(e);h(s)&&this._crossfadeHelper.fadeNode(e,s,t,i)}setNodeOpacityByIndex(e,t){const i=this._nodeId2Meta.get(e);h(i)&&this._setNodeOpacity(i,t)}_setNodeOpacity(e,t){this._collection.updateMaterial(e.objectHandle,(e=>e.objectOpacity=t)),this._setNodeEdgeOpacity(e,t)}_setNodeEdgeOpacity(e,t){if(c(this._edgeView)||!e.cachedEdgeMaterials)return;Ft(e.cachedEdgeMaterials,t);const i=e.objectHandle;this._edgeView.hasObject(i)&&this._edgeView.updateAllComponentOpacities(i,t).catch((e=>yt(e,this.i3slayer.title)))}get hasModifications(){return this._isIntegratedMesh&&h(this._layerClippingArea)||this._modifications&&this._modifications.length>0}updateNodeModificationStatus(e){const t=e.length;if(!this.hasModifications||t<=0||!0!==this._i3sWasmLoaded)return;const i=this.i3slayer.uid,s=Rt(e);if(h(s)){const t={context:i,buffer:s.buffer};_e(t);const r=new Float64Array(s.buffer);e.forAll(((e,t)=>{const i=r[t],s=me(i);e.imModificationImpact=s,s!==Ae.Unmodified&&this._controller.invalidateGeometryVisibility(e.index)}))}}notifyUpdate(){this.notifyChange("updating")}notifyLODUpdate(){this._controller.notifyLODUpdate()}isUpdating(){return!(!this._controller||!this._controller.updating)||!!this._visibleGeometryChangedSchedulerHandle||h(this._labeler)&&this._labeler.updating||this._crossfadeHelper.updating||this._i3sWasmLoaded instanceof Promise||this._asyncModuleLoading>0||h(this._elevationTask)&&this._elevationTask.running}trackSnappingSources(e){const t={events:e,fetchEdgeLocations:async(e,t,i)=>{const s=this._nodeId2Meta.get(e);if(c(s))throw new Error("invalid-node");const{origin:r,buffer:o}=await this._collection.extractEdgeInformation(s.objectHandle,t,i);return this._snappingLocationsApplyElevation(s,o,r),{type:"components",objectIds:s.featureIds,locations:o,origin:r}},remove:()=>{s(this._snappingSourcesTrackers,t)}};return this._snappingSourcesTrackers.push(t),this._nodeId2Meta.forEach(((t,i)=>{if(c(t))return;const s=this._controller.getRenderMbs(t.node);h(s)&&e.add(i,s)})),t}_snappingLocationsApplyElevation(e,t,i){if(!e.elevationOffsets||this.elevationInfo.mode===Pt.Absolute)return;const s=t.position0,r=t.position1,o=t.componentIndex,a=V(),n=V(),l=(e,t)=>{R(e,e,i),this.view.renderCoordsHelper.worldUpAtPosition(e,n),R(e,e,F(n,n,t)),P(e,e,i)};for(let d=0;d<s.count;d++){const t=e.elevationOffsets[o.get(d)];s.getVec(d,a),l(a,t),s.setVec(d,a),r.getVec(d,a),l(a,t),r.setVec(d,a)}}_updateSnappingSources(e,t){const{index:i}=e.node,s=this._controller.getRenderMbs(e.node);if(!c(s))for(const r of this._snappingSourcesTrackers)t!==vt.REMOVE&&t!==vt.UPDATE||r.events.remove(i),t!==vt.ADD&&t!==vt.UPDATE||r.events.add(i,s)}};return e([M()],r.prototype,"_hasLoadedPBRTextures",void 0),e([M()],r.prototype,"_asyncModuleLoading",void 0),e([M()],r.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([M()],r.prototype,"view",void 0),e([M()],r.prototype,"i3slayer",void 0),e([M()],r.prototype,"_controller",void 0),e([M()],r.prototype,"_labeler",void 0),e([M()],r.prototype,"updating",void 0),e([M()],r.prototype,"suspended",void 0),e([M()],r.prototype,"holeFilling",void 0),e([M(rt)],r.prototype,"updatingProgress",void 0),e([M()],r.prototype,"updatingProgressValue",null),e([M()],r.prototype,"hasTexturesOrVertexColors",null),e([M()],r.prototype,"rendererTextureUsage",null),e([M()],r.prototype,"elevationOffset",null),e([M()],r.prototype,"elevationInfo",null),e([M({type:Boolean})],r.prototype,"slicePlaneEnabled",void 0),e([M()],r.prototype,"supportedTextureEncodings",null),e([M()],r.prototype,"uncompressedTextureDownsamplingEnabled",null),e([M({type:[ee]})],r.prototype,"_modifications",void 0),e([M()],r.prototype,"_elevationTask",void 0),e([M({readOnly:!0})],r.prototype,"_usePBR",null),r=e([C(ct)],r),r};function yt(e,t){m(e)||ut.warn("Error while processing edges. Edges on this layer might not display correctly",t,e)}var vt;!function(e){e[e.ADD=0]="ADD",e[e.REMOVE=1]="REMOVE",e[e.UPDATE=2]="UPDATE"}(vt||(vt={}));const It=z(),Mt=X(),Ct=X(),xt=it(),Ot=[0,0,0,0],Et=new t([0,0,0,0]),St=[0,0,0,0];function Tt(e){if(c(e))return!1;const t=e.metallicRoughness;return t&&t.baseColorTextureId>=0||t&&t.metallicRoughnessTextureId>=0||e.normalTextureId>=0||e.emissiveTextureId>=0||e.occlusionTextureId>=0}function jt(e){return"geometryData"in e}function wt(e){return h(e)&&v(e.data)}function At(e,t){let i=1024+e.interleavedVertexData.byteLength+(e.indices?e.indices.byteLength:0)+e.positionData.data.byteLength+e.positionData.indices.byteLength;if(h(t))for(const s of t)h(s)&&v(s.data)&&(i+=s.data.byteLength);return i}function Dt(e,t){return t.byteSize>ft?(ut.warn(`Node is too big to store in IndexedDB cache: ${e.id} (${t.byteSize} bytes)`),!1):t.byteSize>0}function Rt(e){if(0===e.length)return null;const t=10*e.length,i=new Float64Array(t);return e.forAll(((e,t)=>{let s=e.serviceObb;c(s)&&(s=xt,N(s.center,e.mbs),s.halfSize[0]=s.halfSize[1]=s.halfSize[2]=e.mbs[3]);const r=10*t;i[r+0]=s.center[0],i[r+1]=s.center[1],i[r+2]=s.center[2],i[r+3]=s.halfSize[0],i[r+4]=s.halfSize[1],i[r+5]=s.halfSize[2],i[r+6]=s.quaternion[0],i[r+7]=s.quaternion[1],i[r+8]=s.quaternion[2],i[r+9]=s.quaternion[3]})),i}const Nt={remove(){},pause(){},resume(){}};function Ft(e,t){e.forEach((e=>e.opacity=t))}var Pt;!function(e){e[e.Absolute=0]="Absolute",e[e.RelativeToGround=1]="RelativeToGround",e[e.OnTheGround=2]="OnTheGround"}(Pt||(Pt={}));const Vt=V(),Ut=z(),Ht="elevation-change";export{Pt as ElevationMode,bt as I3SMeshView3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../request.js";import{binaryIndexOf as t,splitIntoChunks as r}from"../../../../core/arrayUtils.js";import n from"../../../../core/Error.js";import has from"../../../../core/has.js";import{isSome as o,isNone as a}from"../../../../core/maybe.js";import{eachAlways as i}from"../../../../core/promiseUtils.js";import{isInt16Array as s,isInt32Array as c}from"../../../../core/typedArrayUtil.js";import{c as l}from"../../../../chunks/mat3.js";import{c as u}from"../../../../chunks/mat3f64.js";import{a as f}from"../../../../chunks/mat4.js";import{c as p}from"../../../../chunks/mat4f64.js";import{a as m,m as h,c as d}from"../../../../chunks/quat.js";import{c as y}from"../../../../chunks/quatf32.js";import{s as b,c as g,w as S,q as w,g as T,a as E,m as v}from"../../../../chunks/vec3.js";import{c as M}from"../../../../chunks/vec3f64.js";import{canProjectWithoutEngine as I,projectBuffer as R,computeTranslationToOriginAndRotation as x,projectVectorToVector as j}from"../../../../geometry/projection.js";import{getSphericalPCPF as q,getReferenceEllipsoid as k}from"../../../../geometry/projectionEllipsoid.js";import C from"../../../../geometry/SpatialReference.js";import{create as N,empty as U,expandPointInPlace as z,intersects as W}from"../../../../geometry/support/aaBoundingRect.js";import{isPlateCarree as A}from"../../../../geometry/support/spatialReferenceUtils.js";import D from"../../../../rest/support/Query.js";import{readBinaryAttribute as F}from"./I3SBinaryReader.js";import{computeGlobalTransformation as _}from"./I3SProjectionUtil.js";import{createSolidEdgeMaterial as O,createMaterialFromEdges as G}from"../support/edgeUtils.js";import{parseColorMixMode as K,ColorMixModeEnum as L}from"../support/symbolColorUtils.js";import{create as B,compute as P,corners as $}from"../../support/orientedBoundingBox.js";import{Attribute as Q}from"../../webgl-engine/lib/Attribute.js";function Z(e){return e?parseInt(e.substring(e.lastIndexOf("/")+1,e.length),10):void 0}function H(e){if(has("disable-feature:i3s-draco")||!e)return!1;for(const t of e)for(const e of t.geometryBuffers)if("draco"===e.compressedAttributes?.encoding)return!0;return!1}function J(e,t,r,n){r.traverse(t,(t=>{const r=t.mbs;return(null!=r&&re(e,r))!==te.OUTSIDE&&(n(t),!0)}))}function V(e,t,r){let n=0,o=0;for(let a=0;a<t.length&&n<e.length;a++)e[n]===t[a]&&(r(a)&&(e[o]=e[n],o++),n++);e.length=o}function X(e,r,n){let o=0,a=0;for(;o<n.length;){t(e,n[o])>=0===r&&(n[a]=n[o],a++),o++}n.length=a}const Y=N();function ee(e,t){if(0===t.rotationScale[1]&&0===t.rotationScale[2]&&0===t.rotationScale[3]&&0===t.rotationScale[5]&&0===t.rotationScale[6]&&0===t.rotationScale[7])return Y[0]=(e[0]-t.position[0])/t.rotationScale[0],Y[1]=(e[1]-t.position[1])/t.rotationScale[4],Y[2]=(e[2]-t.position[0])/t.rotationScale[0],Y[3]=(e[3]-t.position[1])/t.rotationScale[4],Y}var te;function re(e,t){const r=t[0],n=t[1],o=t[3],a=e[0]-r,i=r-e[2],s=e[1]-n,c=n-e[3],l=Math.max(a,i,0),u=Math.max(s,c,0),f=l*l+u*u;if(f>o*o)return te.OUTSIDE;if(f>0)return te.INTERSECTS_CENTER_OUTSIDE;return-Math.max(a,i,s,c)>o?te.INSIDE:te.INTERSECTS_CENTER_INSIDE}function ne(e,t,r){const n=[],o=r&&r.missingFields,a=r&&r.originalFields;for(const i of e){const e=i.toLowerCase();let r=!1;for(const o of t)if(e===o.name.toLowerCase()){n.push(o.name),r=!0,a&&a.push(i);break}!r&&o&&o.push(i)}return n}async function oe(e,t,r,i,s){if(0===t.length)return[];const c=e.attributeStorageInfo;if(o(e.associatedLayer))try{return await ie(e.associatedLayer,t,r,i)}catch(l){if(e.associatedLayer.loaded)throw l}if(c){const o=ae(t,r,s);if(a(o))throw new n("scenelayer:features-not-loaded","Tried to query attributes for unloaded features");const l=e.parsedUrl.path;return(await Promise.all(o.map((e=>ce(l,c,e.node,e.indices,i).then((t=>{for(let r=0;r<e.graphics.length;r++){const n=e.graphics[r],o=t[r];if(n.attributes)for(const e in n.attributes)e in o||(o[e]=n.attributes[e]);n.attributes=o}return e.graphics})))))).flat()}throw new n("scenelayer:no-attribute-source","This scene layer does not have a source for attributes available")}function ae(e,t,r){const n=new Map,o=[],a=r();for(const i of e){const e=i.attributes[t];for(let t=0;t<a.length;t++){const r=a[t],s=r.featureIds.indexOf(e);if(s>=0){let e=n.get(r.node);e||(e={node:r.node,indices:[],graphics:[]},o.push(e),n.set(r.node,e)),e.indices.push(s),e.graphics.push(i);for(let r=t;r>0;r--)a[r]=a[r-1];a[0]=r;break}}}return o}async function ie(e,t,r,n){t.sort(((e,t)=>e.attributes[r]-t.attributes[r]));const o=t.map((e=>e.attributes[r])),a=[],i=ne(n,e.fields,{originalFields:a}),s=await se(e,o,i);for(let c=0;c<t.length;c++){const e=t[c],r=s[c],n={};if(e.attributes)for(const t in e.attributes)n[t]=e.attributes[t];for(let t=0;t<a.length;t++)n[a[t]]=r[i[t]];e.attributes=n}return t}function se(e,t,o){const a=e.capabilities.query.maxRecordCount;if(null!=a&&t.length>a){const n=r(t,a);return Promise.all(n.map((t=>se(e,t,o)))).then((e=>e.flat()))}const i=new D({objectIds:t,outFields:o,orderByFields:[e.objectIdField]});return e.queryFeatures(i).then((e=>{if(e&&e.features&&e.features.length===t.length)return e.features.map((e=>e.attributes));throw new n("scenelayer:feature-not-in-associated-layer","Feature not found in associated feature layer")}))}function ce(e,t,r,n,o){return le(e,t,r.resources.attributes,n,o)}function le(t,r,n,o,a){const s=[];for(const e of r)if(e&&a.includes(e.name)){const r=`${t}/nodes/${n}/attributes/${e.key}/0`;s.push({url:r,storageInfo:e})}return i(s.map((t=>e(t.url,{responseType:"array-buffer"}).then((e=>F(t.storageInfo,e.data)))))).then((e=>{const t=[];for(const r of o){const n={};for(let t=0;t<e.length;t++){const o=e[t].value;null!=o&&(n[s[t].storageInfo.name]=pe(o,r))}t.push(n)}return t}))}!function(e){e[e.OUTSIDE=0]="OUTSIDE",e[e.INTERSECTS_CENTER_OUTSIDE=1]="INTERSECTS_CENTER_OUTSIDE",e[e.INTERSECTS_CENTER_INSIDE=2]="INTERSECTS_CENTER_INSIDE",e[e.INSIDE=3]="INSIDE"}(te||(te={}));const ue=-32768,fe=-(2**31);function pe(e,t){if(!e)return null;const r=e[t];if(s(e))return r===ue?null:r;if(c(e))return r===fe?null:r;return r!=r?null:r}function me(e){const t=e.store?.indexCRS||e.store?.geographicCRS,r=void 0===t?e.store?.indexWKT:void 0;if(r){if(!e.spatialReference)throw new n("layerview:no-store-spatial-reference-wkt-index-and-no-layer-spatial-reference","Found indeWKT in the scene layer store but no layer spatial reference",{});if(r!==e.spatialReference.wkt)throw new n("layerview:store-spatial-reference-wkt-index-incompatible","The indeWKT of the scene layer store does not match the WKT of the layer spatial reference",{})}const o=t?new C(Z(t)):e.spatialReference;return o.equals(e.spatialReference)?e.spatialReference:o}function he(e){const t=e.store?.vertexCRS||e.store?.projectedCRS,r=void 0===t?e.store?.vertexWKT:void 0;if(r){if(!e.spatialReference)throw new n("layerview:no-store-spatial-reference-wkt-vertex-and-no-layer-spatial-reference","Found vertexWKT in the scene layer store but no layer spatial reference",{});if(r!==e.spatialReference.wkt)throw new n("layerview:store-spatial-reference-wkt-vertex-incompatible","The vertexWKT of the scene layer store does not match the WKT of the layer spatial reference",{})}const o=t?new C(Z(t)):e.spatialReference;return o.equals(e.spatialReference)?e.spatialReference:o}function de(e,t){return a(t)?"@null":t===q(t)?"@ECEF":e.equals(t)?"":null!=t.wkid?"@"+t.wkid:null}function ye(e,t,r){if(!I(e,t))throw new n("layerview:spatial-reference-incompatible","The spatial reference of this scene layer is incompatible with the spatial reference of the view",{});if("local"===r&&!be(e,t))throw new n("layerview:spatial-reference-incompatible","The spatial reference of this scene layer is incompatible with the spatial reference of the view",{})}function be(e,t){return e.equals(t)||e.isWGS84&&t.isWebMercator||e.isWebMercator&&t.isWGS84}function ge(e,t,r){const n=me(e),o=he(e);ye(n,t,r),ye(o,t,r)}function Se(e){return(null==e.geometryType||"triangles"===e.geometryType)&&((null==e.topology||"PerAttributeArray"===e.topology)&&(null!=e.vertexAttributes&&null!=e.vertexAttributes.position))}function we(e){if(null==e.store||null==e.store.defaultGeometrySchema||!Se(e.store.defaultGeometrySchema))throw new n("scenelayer:unsupported-geometry-schema","The geometry schema of this scene layer is not supported.",{url:e.parsedUrl.path})}function Te(e,t){ge(e,t.spatialReference,t.viewingMode)}function Ee(e){return null!=e.geometryType&&"points"===e.geometryType&&((null==e.topology||"PerAttributeArray"===e.topology)&&((null==e.encoding||""===e.encoding||"lepcc-xyz"===e.encoding)&&(null!=e.vertexAttributes&&null!=e.vertexAttributes.position)))}function ve(e){if(null==e.store||null==e.store.defaultGeometrySchema||!Ee(e.store.defaultGeometrySchema))throw new n("pointcloud:unsupported-geometry-schema","The geometry schema of this point cloud scene layer is not supported.",{})}function Me(e,t){ye(e.spatialReference,t.spatialReference,t.viewingMode)}function Ie(e){return"simple"===e.type||"class-breaks"===e.type||"unique-value"===e.type}function Re(e){return"mesh-3d"===e.type}function xe(e){if(null==e||!Ie(e))return!0;if(("unique-value"===e.type||"class-breaks"===e.type)&&null==e.defaultSymbol)return!0;const t=e.getSymbols();if(0===t.length)return!0;for(const r of t){if(!Re(r)||0===r.symbolLayers.length)return!0;for(const e of r.symbolLayers.items)if("fill"!==e.type||a(e.material)||a(e.material.color)||"replace"!==e.material.colorMixMode)return!0}return!1}const je=O({color:[0,0,0,0],opacity:0});class qe{constructor(){this.edgeMaterial=null,this.material=null,this.castShadows=!0}}function ke(e){const t=new qe;let r=!1,n=!1;for(const a of e.symbolLayers.items)if("fill"===a.type&&a.enabled){const e=a.material,i=a.edges;if(o(e)&&!r){const n=e.color,i=K(e.colorMixMode);o(n)?t.material={color:[n.r/255,n.g/255,n.b/255],alpha:n.a,colorMixMode:i}:t.material={color:[1,1,1],alpha:1,colorMixMode:L.Multiply},t.castShadows=a.castShadows,r=!0}o(i)&&!n&&(t.edgeMaterial=G(i,{}),n=!0)}return t.material||(t.material={color:[1,1,1],alpha:1,colorMixMode:L.Multiply}),t}function Ce(e,t){return(0|e)+(0|t)|0}function Ne(e,t,r,n,o=0){n===q(n)?t.isGeographic?Ke(e,r,t,o):Ge(e,r,t,o):t.isWGS84&&(n.isWebMercator||A(n))?Ue(t,e,n,r,o):t.isWebMercator&&A(n)?_e(t,e,n,r,o):e===r?(r.center[2]+=o,R(r.center,t,0,r.center,n,0,1)):(b(r.center,e.center[0],e.center[1],e.center[2]+o),R(r.center,t,0,r.center,n,0,1),m(r.quaternion,e.quaternion),g(r.halfSize,e.halfSize))}function Ue(e,t,r,n,o){g(De,t.center),De[2]+=o;const a=q(r);R(De,e,0,De,a,0,1),Oe(a,t,De,r,n)}const ze=new Array(24),We=new Q(ze,3,!0),Ae=M(),De=M(),Fe=u();function _e(e,t,r,n,o){g(De,t.center),De[2]+=o,Oe(e,t,De,r,n)}function Oe(e,t,r,n,o){const a=l(Fe,t.quaternion);for(let i=0;i<8;++i){for(let e=0;e<3;++e)Ae[e]=t.halfSize[e]*(0!=(i&1<<e)?-1:1);for(let e=0;e<3;++e){let t=r[e];for(let r=0;r<3;++r)t+=Ae[r]*a[3*r+e];ze[3*i+e]=t}}R(ze,e,0,ze,n,0,8),P(We,o)}function Ge(e,t,r,n){$(e,Je),b(t.center,e.center[0],e.center[1],e.center[2]+n),x(r,t.center,Ze,q(r)),b(t.center,Ze[12],Ze[13],Ze[14]);const o=2*Math.sqrt(1+Ze[0]+Ze[5]+Ze[10]);He[0]=(Ze[6]-Ze[9])/o,He[1]=(Ze[8]-Ze[2])/o,He[2]=(Ze[1]-Ze[4])/o,He[3]=.25*o,h(t.quaternion,He,e.quaternion),d(He,t.quaternion);let a=0,i=0,s=0;for(const c of Je)c[2]+=n,R(c,r,0,c,q(r),0,1),S(et,c,t.center),w(et,et,He),a=Math.max(a,Math.abs(et[0])),i=Math.max(i,Math.abs(et[1])),s=Math.max(s,Math.abs(et[2]));b(t.halfSize,a,i,s)}function Ke(e,t,r,n){const o=k(r),a=1+Math.max(0,n)/(o.radius+e.center[2]);b(t.center,e.center[0],e.center[1],e.center[2]+n),R(t.center,r,0,t.center,q(r),0,1),m(t.quaternion,e.quaternion),d(He,e.quaternion),b(et,0,0,1),w(et,et,He),b(et,e.halfSize[0]*Math.abs(et[0]),e.halfSize[1]*Math.abs(et[1]),e.halfSize[2]*Math.abs(et[2])),T(et,et,o.inverseFlattening),E(t.halfSize,e.halfSize,et),T(t.halfSize,t.halfSize,a)}function Le(e,t,r,n,i,s){if(!s||0===s.length||a(t)||!e.mbs)return null;const c=_(e.mbs,i,r,t);let l;f(rt,c);const u=()=>{if(!l)if(l=Je,U(Xe),o(e.serviceObb)){Ne(e.serviceObb,r,Ye,t,i),$(Ye,l);for(const e of l)v(e,e,rt),z(Xe,e)}else{const n=e.mbs;if(!n)return;const o=n[3];j(n,r,et,t),v(et,et,rt),et[2]+=i;for(let e=0;e<8;++e){const t=1&e?o:-o,r=2&e?o:-o,n=4&e?o:-o,a=l[e];g(a,[et[0]+t,et[1]+r,et[2]+n]),z(Xe,a)}}};let p=1/0,m=-1/0;const h=e=>{if("replace"!==e.type)return;const r=e.geometry;if(!r?.hasZ)return;U(Ve);const o=r.spatialReference||n,a=r.rings.reduce(((e,r)=>r.reduce(((e,r)=>(j(r,o,et,t),v(et,et,rt),z(Ve,et),Math.min(et[2],e))),e)),1/0);u(),W(Xe,Ve)&&(p=Math.min(p,a),m=Math.max(m,a))};if(s.forEach((e=>h(e))),p===1/0)return null;const d=(e,t,r)=>{v(et,r,c),e[t+0]=et[0],e[t+1]=et[1],e[t+2]=et[2],t+=24,r[2]=p,v(et,r,c),e[t+0]=et[0],e[t+1]=et[1],e[t+2]=et[2],t+=24,r[2]=m,v(et,r,c),e[t+0]=et[0],e[t+1]=et[1],e[t+2]=et[2]};for(let o=0;o<8;++o)d(tt.data,3*o,l[o]);return P(tt)}function Be(e){return o(e)&&e.halfSize[0]>=0}function Pe(e){return e[3]>=0}function $e(e){o(e)&&(e.halfSize[0]=-1)}function Qe(e){o(e)&&(e[3]=-1)}const Ze=p(),He=y(),Je=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],Ve=N(),Xe=N(),Ye=B(),et=M(),tt={data:new Array(72),size:3,exclusive:!0,stride:3},rt=p();export{te as MbsIntersectResult,qe as SymbolInfo,Ce as addWraparound,Me as checkPointCloudLayerCompatibleWithView,ve as checkPointCloudLayerValid,Te as checkSceneLayerCompatibleWithView,we as checkSceneLayerValid,ye as checkSpatialReference,ge as checkSpatialReferences,Le as computeVisibilityObb,H as containsDraco,V as filterInPlace,ne as findFieldsCaseInsensitive,J as findIntersectingNodes,de as getCacheKeySuffix,pe as getCachedAttributeValue,ee as getClipRect,me as getIndexCrs,ke as getSymbolInfo,he as getVertexCrs,re as intersectBoundingRectWithMbs,Qe as invalidateMbs,$e as invalidateObb,be as isSupportedLocalModeProjection,Pe as isValidMbs,Be as isValidObb,X as objectIdFilter,le as queryAttributesFromCachedAttributesId,xe as rendererNeedsTextures,Ne as transformObb,je as transparentEdgeMaterial,oe as whenGraphicAttributes};
|
|
5
|
+
import e from"../../../../request.js";import{binaryIndexOf as t,splitIntoChunks as r}from"../../../../core/arrayUtils.js";import n from"../../../../core/Error.js";import has from"../../../../core/has.js";import{isSome as o,isNone as a}from"../../../../core/maybe.js";import{eachAlways as i}from"../../../../core/promiseUtils.js";import{isInt16Array as s,isInt32Array as c}from"../../../../core/typedArrayUtil.js";import{c as l}from"../../../../chunks/mat3.js";import{c as u}from"../../../../chunks/mat3f64.js";import{a as f}from"../../../../chunks/mat4.js";import{c as p}from"../../../../chunks/mat4f64.js";import{a as m,m as h,c as d}from"../../../../chunks/quat.js";import{c as y}from"../../../../chunks/quatf32.js";import{s as b,c as g,w as S,q as w,g as T,a as E,m as v}from"../../../../chunks/vec3.js";import{c as M}from"../../../../chunks/vec3f64.js";import{canProjectWithoutEngine as I,projectBuffer as R,computeTranslationToOriginAndRotation as x,projectVectorToVector as j}from"../../../../geometry/projection.js";import{getSphericalPCPF as q,getReferenceEllipsoid as k}from"../../../../geometry/projectionEllipsoid.js";import C from"../../../../geometry/SpatialReference.js";import{create as N,empty as U,expandPointInPlace as z,intersects as W}from"../../../../geometry/support/aaBoundingRect.js";import{isPlateCarree as A}from"../../../../geometry/support/spatialReferenceUtils.js";import D from"../../../../rest/support/Query.js";import{readBinaryAttribute as F}from"./I3SBinaryReader.js";import{computeGlobalTransformation as _}from"./I3SProjectionUtil.js";import{createSolidEdgeMaterial as O,createMaterialFromEdges as G}from"../support/edgeUtils.js";import{parseColorMixMode as K,ColorMixModeEnum as L}from"../support/symbolColorUtils.js";import{create as B,compute as P,corners as $}from"../../support/orientedBoundingBox.js";import{Attribute as Q}from"../../webgl-engine/lib/Attribute.js";function Z(e){return e?parseInt(e.substring(e.lastIndexOf("/")+1,e.length),10):void 0}function H(e){if(has("disable-feature:i3s-draco")||!e)return!1;for(const t of e)for(const e of t.geometryBuffers)if("draco"===e.compressedAttributes?.encoding)return!0;return!1}function J(e,t,r,n){r.traverse(t,(t=>{const r=t.mbs;return(null!=r&&re(e,r))!==te.OUTSIDE&&(n(t),!0)}))}function V(e,t,r){let n=0,o=0;for(let a=0;a<t.length&&n<e.length;a++)e[n]===t[a]&&(r(a)&&(e[o]=e[n],o++),n++);e.length=o}function X(e,r,n){let o=0,a=0;for(;o<n.length;){t(e,n[o])>=0===r&&(n[a]=n[o],a++),o++}n.length=a}const Y=N();function ee(e,t){if(0===t.rotationScale[1]&&0===t.rotationScale[2]&&0===t.rotationScale[3]&&0===t.rotationScale[5]&&0===t.rotationScale[6]&&0===t.rotationScale[7])return Y[0]=(e[0]-t.position[0])/t.rotationScale[0],Y[1]=(e[1]-t.position[1])/t.rotationScale[4],Y[2]=(e[2]-t.position[0])/t.rotationScale[0],Y[3]=(e[3]-t.position[1])/t.rotationScale[4],Y}var te;function re(e,t){const r=t[0],n=t[1],o=t[3],a=e[0]-r,i=r-e[2],s=e[1]-n,c=n-e[3],l=Math.max(a,i,0),u=Math.max(s,c,0),f=l*l+u*u;if(f>o*o)return te.OUTSIDE;if(f>0)return te.INTERSECTS_CENTER_OUTSIDE;return-Math.max(a,i,s,c)>o?te.INSIDE:te.INTERSECTS_CENTER_INSIDE}function ne(e,t,r){const n=[],o=r&&r.missingFields,a=r&&r.originalFields;for(const i of e){const e=i.toLowerCase();let r=!1;for(const o of t)if(e===o.name.toLowerCase()){n.push(o.name),r=!0,a&&a.push(i);break}!r&&o&&o.push(i)}return n}async function oe(e,t,r,i,s){if(0===t.length)return[];const c=e.attributeStorageInfo;if(o(e.associatedLayer))try{return await ie(e.associatedLayer,t,r,i)}catch(l){if(e.associatedLayer.loaded)throw l}if(c){const o=ae(t,r,s);if(a(o))throw new n("scenelayer:features-not-loaded","Tried to query attributes for unloaded features");const l=e.parsedUrl.path;return(await Promise.all(o.map((e=>ce(l,c,e.node,e.indices,i).then((t=>{for(let r=0;r<e.graphics.length;r++){const n=e.graphics[r],o=t[r];if(n.attributes)for(const e in n.attributes)e in o||(o[e]=n.attributes[e]);n.attributes=o}return e.graphics})))))).flat()}throw new n("scenelayer:no-attribute-source","This scene layer does not have a source for attributes available")}function ae(e,t,r){const n=new Map,o=[],a=r();for(const i of e){const e=i.attributes[t];for(let t=0;t<a.length;t++){const r=a[t],s=r.featureIds.indexOf(e);if(s>=0){let e=n.get(r.node);e||(e={node:r.node,indices:[],graphics:[]},o.push(e),n.set(r.node,e)),e.indices.push(s),e.graphics.push(i);for(let r=t;r>0;r--)a[r]=a[r-1];a[0]=r;break}}}return o}async function ie(e,t,r,n){t.sort(((e,t)=>e.attributes[r]-t.attributes[r]));const o=t.map((e=>e.attributes[r])),a=[],i=ne(n,e.fields,{originalFields:a}),s=await se(e,o,i);for(let c=0;c<t.length;c++){const e=t[c],r=s[c],n={};if(e.attributes)for(const t in e.attributes)n[t]=e.attributes[t];for(let t=0;t<a.length;t++)n[a[t]]=r[i[t]];e.attributes=n}return t}function se(e,t,o){const a=e.capabilities.query.maxRecordCount;if(null!=a&&t.length>a){const n=r(t,a);return Promise.all(n.map((t=>se(e,t,o)))).then((e=>e.flat()))}const i=new D({objectIds:t,outFields:o,orderByFields:[e.objectIdField]});return e.queryFeatures(i).then((e=>{if(e&&e.features&&e.features.length===t.length)return e.features.map((e=>e.attributes));throw new n("scenelayer:feature-not-in-associated-layer","Feature not found in associated feature layer")}))}function ce(e,t,r,n,o){return le(e,t,r.resources.attributes,n,o)}function le(t,r,n,o,a){const s=[];for(const e of r)if(e&&a.includes(e.name)){const r=`${t}/nodes/${n}/attributes/${e.key}/0`;s.push({url:r,storageInfo:e})}return i(s.map((t=>e(t.url,{responseType:"array-buffer"}).then((e=>F(t.storageInfo,e.data)))))).then((e=>{const t=[];for(const r of o){const n={};for(let t=0;t<e.length;t++){const o=e[t].value;null!=o&&(n[s[t].storageInfo.name]=pe(o,r))}t.push(n)}return t}))}!function(e){e[e.OUTSIDE=0]="OUTSIDE",e[e.INTERSECTS_CENTER_OUTSIDE=1]="INTERSECTS_CENTER_OUTSIDE",e[e.INTERSECTS_CENTER_INSIDE=2]="INTERSECTS_CENTER_INSIDE",e[e.INSIDE=3]="INSIDE"}(te||(te={}));const ue=-32768,fe=-(2**31);function pe(e,t){if(!e)return null;const r=e[t];if(s(e))return r===ue?null:r;if(c(e))return r===fe?null:r;return r!=r?null:r}function me(e){const t=e.store,r=t.indexCRS||t.geographicCRS,o=void 0===r?t.indexWKT:void 0;if(o){if(!e.spatialReference)throw new n("layerview:no-store-spatial-reference-wkt-index-and-no-layer-spatial-reference","Found indeWKT in the scene layer store but no layer spatial reference",{});if(o!==e.spatialReference.wkt)throw new n("layerview:store-spatial-reference-wkt-index-incompatible","The indeWKT of the scene layer store does not match the WKT of the layer spatial reference",{})}const a=r?new C(Z(r)):e.spatialReference;return a.equals(e.spatialReference)?e.spatialReference:a}function he(e){const t=e.store,r=t.vertexCRS||t.projectedCRS,o=void 0===r?t.vertexWKT:void 0;if(o){if(!e.spatialReference)throw new n("layerview:no-store-spatial-reference-wkt-vertex-and-no-layer-spatial-reference","Found vertexWKT in the scene layer store but no layer spatial reference",{});if(o!==e.spatialReference.wkt)throw new n("layerview:store-spatial-reference-wkt-vertex-incompatible","The vertexWKT of the scene layer store does not match the WKT of the layer spatial reference",{})}const a=r?new C(Z(r)):e.spatialReference;return a.equals(e.spatialReference)?e.spatialReference:a}function de(e,t){return a(t)?"@null":t===q(t)?"@ECEF":e.equals(t)?"":null!=t.wkid?"@"+t.wkid:null}function ye(e,t,r){if(!I(e,t))throw new n("layerview:spatial-reference-incompatible","The spatial reference of this scene layer is incompatible with the spatial reference of the view",{});if("local"===r&&!be(e,t))throw new n("layerview:spatial-reference-incompatible","The spatial reference of this scene layer is incompatible with the spatial reference of the view",{})}function be(e,t){return e.equals(t)||e.isWGS84&&t.isWebMercator||e.isWebMercator&&t.isWGS84}function ge(e,t,r){const n=me(e),o=he(e);ye(n,t,r),ye(o,t,r)}function Se(e){return(null==e.geometryType||"triangles"===e.geometryType)&&((null==e.topology||"PerAttributeArray"===e.topology)&&(null!=e.vertexAttributes&&null!=e.vertexAttributes.position))}function we(e){if(null==e.store||null==e.store.defaultGeometrySchema||!Se(e.store.defaultGeometrySchema))throw new n("scenelayer:unsupported-geometry-schema","The geometry schema of this scene layer is not supported.",{url:e.parsedUrl.path})}function Te(e,t){ge(e,t.spatialReference,t.viewingMode)}function Ee(e){return null!=e.geometryType&&"points"===e.geometryType&&((null==e.topology||"PerAttributeArray"===e.topology)&&((null==e.encoding||""===e.encoding||"lepcc-xyz"===e.encoding)&&(null!=e.vertexAttributes&&null!=e.vertexAttributes.position)))}function ve(e){if(null==e.store||null==e.store.defaultGeometrySchema||!Ee(e.store.defaultGeometrySchema))throw new n("pointcloud:unsupported-geometry-schema","The geometry schema of this point cloud scene layer is not supported.",{})}function Me(e,t){ye(e.spatialReference,t.spatialReference,t.viewingMode)}function Ie(e){return"simple"===e.type||"class-breaks"===e.type||"unique-value"===e.type}function Re(e){return"mesh-3d"===e.type}function xe(e){if(null==e||!Ie(e))return!0;if(("unique-value"===e.type||"class-breaks"===e.type)&&null==e.defaultSymbol)return!0;const t=e.getSymbols();if(0===t.length)return!0;for(const r of t){if(!Re(r)||0===r.symbolLayers.length)return!0;for(const e of r.symbolLayers.items)if("fill"!==e.type||a(e.material)||a(e.material.color)||"replace"!==e.material.colorMixMode)return!0}return!1}const je=O({color:[0,0,0,0],opacity:0});class qe{constructor(){this.edgeMaterial=null,this.material=null,this.castShadows=!0}}function ke(e){const t=new qe;let r=!1,n=!1;for(const a of e.symbolLayers.items)if("fill"===a.type&&a.enabled){const e=a.material,i=a.edges;if(o(e)&&!r){const n=e.color,i=K(e.colorMixMode);o(n)?t.material={color:[n.r/255,n.g/255,n.b/255],alpha:n.a,colorMixMode:i}:t.material={color:[1,1,1],alpha:1,colorMixMode:L.Multiply},t.castShadows=a.castShadows,r=!0}o(i)&&!n&&(t.edgeMaterial=G(i,{}),n=!0)}return t.material||(t.material={color:[1,1,1],alpha:1,colorMixMode:L.Multiply}),t}function Ce(e,t){return(0|e)+(0|t)|0}function Ne(e,t,r,n,o=0){n===q(n)?t.isGeographic?Ke(e,r,t,o):Ge(e,r,t,o):t.isWGS84&&(n.isWebMercator||A(n))?Ue(t,e,n,r,o):t.isWebMercator&&A(n)?_e(t,e,n,r,o):e===r?(r.center[2]+=o,R(r.center,t,0,r.center,n,0,1)):(b(r.center,e.center[0],e.center[1],e.center[2]+o),R(r.center,t,0,r.center,n,0,1),m(r.quaternion,e.quaternion),g(r.halfSize,e.halfSize))}function Ue(e,t,r,n,o){g(De,t.center),De[2]+=o;const a=q(r);R(De,e,0,De,a,0,1),Oe(a,t,De,r,n)}const ze=new Array(24),We=new Q(ze,3,!0),Ae=M(),De=M(),Fe=u();function _e(e,t,r,n,o){g(De,t.center),De[2]+=o,Oe(e,t,De,r,n)}function Oe(e,t,r,n,o){const a=l(Fe,t.quaternion);for(let i=0;i<8;++i){for(let e=0;e<3;++e)Ae[e]=t.halfSize[e]*(0!=(i&1<<e)?-1:1);for(let e=0;e<3;++e){let t=r[e];for(let r=0;r<3;++r)t+=Ae[r]*a[3*r+e];ze[3*i+e]=t}}R(ze,e,0,ze,n,0,8),P(We,o)}function Ge(e,t,r,n){$(e,Je),b(t.center,e.center[0],e.center[1],e.center[2]+n),x(r,t.center,Ze,q(r)),b(t.center,Ze[12],Ze[13],Ze[14]);const o=2*Math.sqrt(1+Ze[0]+Ze[5]+Ze[10]);He[0]=(Ze[6]-Ze[9])/o,He[1]=(Ze[8]-Ze[2])/o,He[2]=(Ze[1]-Ze[4])/o,He[3]=.25*o,h(t.quaternion,He,e.quaternion),d(He,t.quaternion);let a=0,i=0,s=0;for(const c of Je)c[2]+=n,R(c,r,0,c,q(r),0,1),S(et,c,t.center),w(et,et,He),a=Math.max(a,Math.abs(et[0])),i=Math.max(i,Math.abs(et[1])),s=Math.max(s,Math.abs(et[2]));b(t.halfSize,a,i,s)}function Ke(e,t,r,n){const o=k(r),a=1+Math.max(0,n)/(o.radius+e.center[2]);b(t.center,e.center[0],e.center[1],e.center[2]+n),R(t.center,r,0,t.center,q(r),0,1),m(t.quaternion,e.quaternion),d(He,e.quaternion),b(et,0,0,1),w(et,et,He),b(et,e.halfSize[0]*Math.abs(et[0]),e.halfSize[1]*Math.abs(et[1]),e.halfSize[2]*Math.abs(et[2])),T(et,et,o.inverseFlattening),E(t.halfSize,e.halfSize,et),T(t.halfSize,t.halfSize,a)}function Le(e,t,r,n,i,s){if(!s||0===s.length||a(t)||!e.mbs)return null;const c=_(e.mbs,i,r,t);f(rt,c);let l=null;const u=()=>{if(!l)if(l=Je,U(Xe),o(e.serviceObb)){Ne(e.serviceObb,r,Ye,t,i),$(Ye,l);for(const e of l)v(e,e,rt),z(Xe,e)}else{const n=e.mbs;if(!n)return;const o=n[3];j(n,r,et,t),v(et,et,rt),et[2]+=i;for(let e=0;e<8;++e){const t=1&e?o:-o,r=2&e?o:-o,n=4&e?o:-o,a=l[e];g(a,[et[0]+t,et[1]+r,et[2]+n]),z(Xe,a)}}};let p=1/0,m=-1/0;const h=e=>{if("replace"!==e.type)return;const r=e.geometry;if(!r?.hasZ)return;U(Ve);const o=r.spatialReference||n,a=r.rings.reduce(((e,r)=>r.reduce(((e,r)=>(j(r,o,et,t),v(et,et,rt),z(Ve,et),Math.min(et[2],e))),e)),1/0);u(),W(Xe,Ve)&&(p=Math.min(p,a),m=Math.max(m,a))};if(s.forEach((e=>h(e))),p===1/0)return null;const d=(e,t,r)=>{v(et,r,c),e[t+0]=et[0],e[t+1]=et[1],e[t+2]=et[2],t+=24,r[2]=p,v(et,r,c),e[t+0]=et[0],e[t+1]=et[1],e[t+2]=et[2],t+=24,r[2]=m,v(et,r,c),e[t+0]=et[0],e[t+1]=et[1],e[t+2]=et[2]};for(let o=0;o<8;++o)d(tt.data,3*o,l[o]);return P(tt)}function Be(e){return o(e)&&e.halfSize[0]>=0}function Pe(e){return e[3]>=0}function $e(e){o(e)&&(e.halfSize[0]=-1)}function Qe(e){o(e)&&(e[3]=-1)}const Ze=p(),He=y(),Je=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],Ve=N(),Xe=N(),Ye=B(),et=M(),tt={data:new Array(72),size:3,exclusive:!0,stride:3},rt=p();export{te as MbsIntersectResult,qe as SymbolInfo,Ce as addWraparound,Me as checkPointCloudLayerCompatibleWithView,ve as checkPointCloudLayerValid,Te as checkSceneLayerCompatibleWithView,we as checkSceneLayerValid,ye as checkSpatialReference,ge as checkSpatialReferences,Le as computeVisibilityObb,H as containsDraco,Z as extractWkid,V as filterInPlace,ne as findFieldsCaseInsensitive,J as findIntersectingNodes,de as getCacheKeySuffix,pe as getCachedAttributeValue,ee as getClipRect,me as getIndexCrs,ke as getSymbolInfo,he as getVertexCrs,re as intersectBoundingRectWithMbs,Qe as invalidateMbs,$e as invalidateObb,be as isSupportedLocalModeProjection,Pe as isValidMbs,Be as isValidObb,X as objectIdFilter,le as queryAttributesFromCachedAttributesId,xe as rendererNeedsTextures,Ne as transformObb,je as transparentEdgeMaterial,oe as whenGraphicAttributes};
|