@arcgis/core 4.26.0-next.20230113 → 4.26.0-next.20230115

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.
Files changed (47) hide show
  1. package/WebMap.js +1 -1
  2. package/WebScene.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/05679a6529421d546fe0.js +1 -0
  5. package/assets/esri/core/workers/chunks/2e5b61ee21fa6287cc65.js +1 -0
  6. package/assets/esri/core/workers/chunks/2e7e8b035673d90deefd.js +1 -0
  7. package/assets/esri/core/workers/chunks/4e13f84441f0b149f32e.js +1 -0
  8. package/assets/esri/core/workers/chunks/5605de870cfc1498a393.js +1 -0
  9. package/assets/esri/core/workers/chunks/5ad3a3d15831b759e758.js +1 -0
  10. package/assets/esri/core/workers/chunks/633a86e8e8ad2ab866f4.js +1 -0
  11. package/assets/esri/core/workers/chunks/86491e6269e25b1766ed.js +1 -0
  12. package/assets/esri/core/workers/chunks/c3fda4056c5eeaef1339.js +1 -0
  13. package/assets/esri/core/workers/chunks/{399c453397a1f10408bf.js → c7b23f664a2707b96daf.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{dd2e9206133d6888f33d.js → dc6bad8c0a09393834a1.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{bc3564689bd42cba97f9.js → f34c607e73757f6024eb.js} +1 -1
  16. package/core/accessorSupport/decorators/persistable.js +1 -1
  17. package/core/accessorSupport/write.js +1 -1
  18. package/layers/mixins/ArcGISImageService.js +1 -1
  19. package/layers/mixins/ImageryTileMixin.js +1 -1
  20. package/layers/mixins/SceneService.js +1 -1
  21. package/layers/support/PixelBlock.js +1 -1
  22. package/layers/support/imageryRendererUtils.js +1 -1
  23. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  24. package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
  25. package/layers/support/rasterDatasets/multidimensionalUtils.js +1 -1
  26. package/layers/support/rasterFormats/Lerc.js +1 -1
  27. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  28. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  29. package/layers/support/rasterFormats/pixelRangeUtils.js +5 -0
  30. package/layers/support/rasterFunctions/ConvolutionFunction.js +1 -1
  31. package/layers/support/rasterFunctions/stretchUtils.js +1 -1
  32. package/package.json +1 -1
  33. package/renderers/support/rasterRendererHelper.js +1 -1
  34. package/support/revision.js +1 -1
  35. package/views/2d/engine/Stage.js +1 -1
  36. package/views/MapView.js +1 -1
  37. package/widgets/FeatureTable/FieldColumn.js +1 -1
  38. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  39. package/assets/esri/core/workers/chunks/1363e647f3b0bca07e09.js +0 -1
  40. package/assets/esri/core/workers/chunks/2541edeae4b1a53b8723.js +0 -1
  41. package/assets/esri/core/workers/chunks/3b689bb038ebc301c3b2.js +0 -1
  42. package/assets/esri/core/workers/chunks/6216cd8134703fd9d9b4.js +0 -1
  43. package/assets/esri/core/workers/chunks/64f137358100a1c818f0.js +0 -1
  44. package/assets/esri/core/workers/chunks/6fba07833345b2d8d373.js +0 -1
  45. package/assets/esri/core/workers/chunks/78fd609f334a29ef39dc.js +0 -1
  46. package/assets/esri/core/workers/chunks/798cd875d64182741364.js +0 -1
  47. package/assets/esri/core/workers/chunks/8bd26c71e78698c16778.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5202],{8168:(t,e,n)=>{n.d(e,{Ue:()=>pn});var s=n(3892),r=n(20102),o=n(43697),i=n(70586),a=n(5600),u=(n(75215),n(67676),n(52011)),l=(n(92604),n(80442),n(96674));let c=class extends l.wq{constructor(){super(...arguments),this.raster=void 0}};(0,o._)([(0,a.Cb)({json:{write:!0}})],c.prototype,"raster",void 0),c=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.AspectFunctionArguments")],c);const p=c;var f;let h=f=class extends p{clone(){return new f({raster:this.raster})}};h=f=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.AspectFunctionArguments")],h);const m=h;var d=n(90578);let g=class extends l.wq{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}bind(t,e=!1,n=-1){this.id=n+1;const s=this._getRasterValues();let r=!0;for(let n=0;n<s.length;n++){const o=s[n];if((0,i.pC)(o)&&this._isRasterFunctionValue(o)){const s=o.bind(t,e,this.id+n);if(!s.success)return this._bindingResult=s,s;r=r&&s.supportsGPU}}return!this.rasterInfo||e?(this.sourceRasterInfos=this._getSourceRasterInfos(t),this._bindingResult=this._bindSourceRasters(),this._bindingResult.supportsGPU=r&&this._bindingResult.supportsGPU,this.processInputBandIds(),this._bindingResult):(this._bindingResult={success:!0,supportsGPU:!0},this.processInputBandIds(),this._bindingResult)}process(t){const e=this._getRasterValues().map((e=>this._readRasterValue(e,t)));return this._processPixels({...t,pixelBlocks:e})}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);let e;if(t.length>1){const e=t.map((t=>t.processInputBandIds()[0]));this.rawInputBandIds=e,this.isInputBandIdsSwizzled=this.rawInputBandIds.some(((t,e)=>t!==e));const n=t.filter((t=>"ExtractBand"===t.functionName));return n.length&&n.forEach(((t,e)=>{t.isInputBandIdsSwizzled=!0,t.swizzledBandSelection=[e,e,e]})),this.rawInputBandIds}const n=t[0];if(n){if(e=n.processInputBandIds(),n.isInputBandIdsSwizzled)return e}else{e=[];const{bandCount:t}=this.sourceRasterInfos[0];for(let n=0;n<t;n++)e.push(n)}const s=this._getInputBandIds(e);return this.isInputBandIdsSwizzled=s.some(((t,e)=>t!==e)),this.rawInputBandIds=s,this.rawInputBandIds}getPrimaryRasters(){const t=[],e=[];return this._getPrimaryRasters(this,t,e),{rasters:t,rasterIds:e}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:e,rasters:n}=this.functionArguments;return n&&Array.isArray(n)&&n.length?(t.rasters=n.map((t=>this._isRasterFunctionValue(t)?t.getWebGLProcessorDefinition():"number"==typeof t?{name:"Constant",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1})),t.rasters.some((t=>null!=t))||(t.rasters=null)):this._isRasterFunctionValue(e)&&(t.raster=e.getWebGLProcessorDefinition()),{name:this.functionName,parameters:t,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getFlatWebGLFunctionChain(){const t=this.getWebGLProcessorDefinition();if(!t)return null;const e=[t],{parameters:n}=t;let s=n.rasters||n.raster&&[n.raster];for(;s?.length;){e.unshift(...s);const t=[];for(let e=0;e<s.length;e++){const{parameters:n}=s[e],r=n.rasters||n.raster&&[n.raster];r?.length&&t.push(...r)}s=t}for(let t=e.length-1;t>=0;t--)e[t].isNoopProcess&&e.splice(t,1);let r=!1;for(let t=0;t<e.length;t++){const n=e[t];n.id=e.length-t-1;const{rasters:s}=n.parameters;r=r||null!=s&&s.length>1}return{hasBranches:r,functions:e}}_getOutputPixelType(t){return"unknown"===this.outputPixelType?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_getRasterValues(){const{rasterArgumentNames:t}=this;return"rasters"===t[0]&&Array.isArray(this.functionArguments.rasters)?this.functionArguments.rasters:t.map((t=>this.functionArguments[t]))}_getSourceRasterInfos(t){const e=this._getRasterValues(),{rasterInfos:n,rasterIds:s}=t;return e.map((t=>t&&"object"==typeof t&&"bind"in t&&t.rasterInfo?t.rasterInfo:"string"==typeof t&&s.includes(t)?n[s.indexOf(t)]:n[0]))}_getPrimaryRasterId(t){return t?.url}_getPrimaryRasters(t,e=[],n=[]){for(let s=0;s<t.sourceRasters.length;s++){const r=t.sourceRasters[s];if("number"!=typeof r)if("bind"in r)this._getPrimaryRasters(r,e,n);else{const t=r,s=this._getPrimaryRasterId(t);if(null==s)continue;n.includes(s)||(this.mainPrimaryRasterId===s?(e.unshift(t),n.unshift(s)):(e.push(t),n.push(s)))}}}_isRasterFunctionValue(t){return null!=t&&"object"==typeof t&&"getWebGLProcessorDefinition"in t}_readRasterValue(t,e){const{primaryPixelBlocks:n}=e;if((0,i.Wi)(t)||"$$"===t){const t=n[0];return(0,i.Wi)(t)?null:t.clone()}if("string"==typeof t){const s=e.primaryRasterIds.indexOf(t);return-1===s?null:n[s]}if("number"==typeof t){const e=n[0];if((0,i.Wi)(e))return null;const s=new Float32Array(e.width*e.height);s.fill(t);const r=e.clone();return r.pixels=r.pixels.map((()=>s)),r}return t.process(e)}};(0,o._)([(0,a.Cb)({json:{write:!0}})],g.prototype,"functionName",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],g.prototype,"functionArguments",void 0),(0,o._)([(0,a.Cb)()],g.prototype,"rasterArgumentNames",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}}),(0,d.p)((t=>t?.toLowerCase()))],g.prototype,"outputPixelType",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],g.prototype,"mainPrimaryRasterId",void 0),(0,o._)([(0,a.Cb)()],g.prototype,"sourceRasters",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],g.prototype,"sourceRasterInfos",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],g.prototype,"rasterInfo",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],g.prototype,"readingBufferSize",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],g.prototype,"id",void 0),(0,o._)([(0,a.Cb)()],g.prototype,"isNoopProcess",void 0),(0,o._)([(0,a.Cb)()],g.prototype,"supportsGPU",null),(0,o._)([(0,a.Cb)()],g.prototype,"rawInputBandIds",void 0),(0,o._)([(0,a.Cb)()],g.prototype,"isInputBandIdsSwizzled",void 0),(0,o._)([(0,a.Cb)()],g.prototype,"swizzledBandSelection",void 0),(0,o._)([(0,a.Cb)()],g.prototype,"isBranch",void 0),(0,o._)([(0,a.Cb)()],g.prototype,"_bindingResult",void 0),g=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.BaseRasterFunction")],g);const y=g;var x=n(63342);let b=class extends y{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.isGCS=t.spatialReference?.isGeographic??!1,this.outputPixelType=this._getOutputPixelType("f32");const e=t.clone();return e.pixelType=this.outputPixelType,e.statistics=[{min:0,max:360,avg:180,stddev:30}],e.histograms=null,e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if((0,i.Wi)(e))return null;const{extent:n}=t,s=n?{x:n.width/e.width,y:n.height/e.height}:{x:1,y:1};return(0,x.M_)(e,{resolution:s})}};(0,o._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],b.prototype,"functionName",void 0),(0,o._)([(0,a.Cb)({type:m,json:{write:!0,name:"rasterFunctionArguments"}})],b.prototype,"functionArguments",void 0),(0,o._)([(0,a.Cb)()],b.prototype,"rasterArgumentNames",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],b.prototype,"isGCS",void 0),b=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.AspectFunction")],b);const w=b;var v=n(22974),C=n(36030),_=n(35454),A=n(5847);const S=new Set(["+","-","*","/","(",")"]);function N(t,e,n,s){if("number"==typeof n&&"number"==typeof s)return n+s;let r;if("number"==typeof n){r=s.length;const t=n;(n=new Float32Array(r)).fill(t)}else if(r=n.length,s.constructor===Number){const t=s;(s=new Float32Array(r)).fill(t)}const o=new Float32Array(r);switch(e){case"+":for(let e=0;e<r;e++)(null==t||t[e])&&(o[e]=n[e]+s[e]);break;case"-":for(let e=0;e<r;e++)(null==t||t[e])&&(o[e]=n[e]-s[e]);break;case"*":for(let e=0;e<r;e++)(null==t||t[e])&&(o[e]=n[e]*s[e]);break;case"/":for(let e=0;e<r;e++)(null==t||t[e])&&s[e]&&(o[e]=n[e]/s[e]);break;case"(":case")":throw new Error("encountered error with custom band index equation")}return o}function R(t,e){t.splice(e,1);let n=0,s=0;do{n=0,s=0;for(let e=0;e<t.length;e++)if("("===t[e])n=e;else if(")"===t[e]){s=e;break}s===n+1&&t.splice(n,2)}while(s===n+1);return t}function P(t){if(1===t.length)return{opIndex:0,numIndex:0};let e=0,n=0;for(let s=0;s<t.length;s++)if("("===t[s])e=s;else if(")"===t[s]){n=s;break}const s=0===n?t:t.slice(e+1,n);let r=-1;for(let t=0;t<s.length;t++)if("*"===s[t]||"/"===s[t]){r=t;break}if(r>-1)n>0&&(r+=e+1);else{for(let t=0;t<s.length;t++)if("+"===s[t]||"-"===s[t]){r=t;break}n>0&&(r+=e+1)}let o=0;for(let e=0;e<r;e++)"("===t[e]&&o++;return{opIndex:r,numIndex:r-o}}function I(t,e,n){let s,{ops:r,nums:o}=function(t,e){(t=t.replace(/ /g,"")).startsWith("-")&&(t="0"+t),t.startsWith("+")&&(t=t.slice(1,t.length));const n=t.split(""),s=[],r=[];let o="";for(let t=0;t<n.length;t++){const i=n[t];if(S.has(i))""!==o&&r.push(parseFloat(o)),s.push(i),o="";else{if("b"===i.toLowerCase()){t++,o=i.concat(n[t]),r.push(e[parseInt(o[1],10)-1]),o="";continue}o=o.concat(i),t===n.length-1&&r.push(parseFloat(o))}}return{ops:s,nums:r}}(n,e);if(0===r.length){const t=1===o.length?o[0]:e[0];if(t instanceof Float32Array)return[t];const n=new Float32Array(e[0].length);return"number"==typeof t?n.fill(t):n.set(t),[n]}for(;r.length>0;){const{numIndex:e,opIndex:n}=P(r);if(s=N(t,r[n],o[e],o[e+1]),1===r.length)break;r=R(r,n),o.splice(e,2,s)}return[s]}var F=n(55914);const T=new _.X({0:"custom",1:"ndvi",2:"savi",3:"tsavi",4:"msavi",5:"gemi",6:"pvi",7:"gvitm",8:"sultan",9:"vari",10:"gndvi",11:"sr",12:"ndvi-re",13:"sr-re",14:"mtvi2",15:"rtvi-core",16:"ci-re",17:"ci-g",18:"ndwi",19:"evi",20:"iron-oxide",21:"ferrous-minerals",22:"clay-minerals",23:"wndwi",24:"bai",25:"nbr",26:"ndbi",27:"ndmi",28:"ndsi",29:"mndwi"},{useNumericKeys:!0});function M(t){const e=new Float32Array(9);return e[3*t[0]]=1,e[3*t[1]+1]=1,e[3*t[2]+2]=1,e}function B(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=e[o],s=n[o],i=t+s;i&&(r[o]=(t-s)/i)}return[r]}var k;let j=k=class extends p{constructor(){super(...arguments),this.method="custom"}clone(){return new k({method:this.method,bandIndexes:this.bandIndexes,raster:(0,v.d9)(this.raster)})}};(0,o._)([(0,a.Cb)({json:{type:String,write:!0}})],j.prototype,"bandIndexes",void 0),(0,o._)([(0,C.J)(T)],j.prototype,"method",void 0),j=k=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.BandArithmeticFunctionArguments")],j);const G=j,D=new Set(["vari","mtvi2","rtvi-core","evi"]);let E=class extends y{constructor(){super(...arguments),this.functionName="BandArithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0],e=t.clone();return e.pixelType=this.outputPixelType,e.statistics=null,e.histograms=null,e.bandCount="sultan"===this.functionArguments.method?t.bandCount:1,this.rasterInfo=e,{success:!0,supportsGPU:!["custom","gvitm","sultan"].includes(this.functionArguments.method)}}_processPixels(t){const e=t.pixelBlocks?.[0];if((0,i.Wi)(e))return e;const{method:n,bandIndexes:s}=this.functionArguments,r=s.split(" ").map((t=>parseFloat(t)));return function(t,e){if(!(0,F.nk)(t))return t;const{equation:n,method:s}=e,r=e.bandIndexes.map((t=>t-1)),{pixels:o,mask:a}=t;let u;switch(s){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":u=B(a,o[r[0]],o[r[1]]);break;case"ndwi":u=B(a,o[r[1]],o[r[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":u=function(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=e[o],s=n[o];s&&(r[o]=t/s)}return[r]}(a,o[r[0]],o[r[1]]);break;case"ci-g":case"ci-re":u=function(t,e,n){const s=e.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=e[o],s=n[o];s&&(r[o]=t/s-1)}return[r]}(a,o[r[0]],o[r[1]]);break;case"savi":u=function(t,e,n,s){const r=n.length,o=new Float32Array(r);for(let i=0;i<r;i++)if(null==t||t[i]){const t=n[i],r=e[i],a=r+t+s;a&&(o[i]=(r-t)/a*(1+s))}return[o]}(a,o[r[0]],o[r[1]],r[2]+1);break;case"tsavi":u=function(t,e,n,s,r,o){const i=n.length,a=new Float32Array(i),u=-r*s+o*(1+s*s);for(let o=0;o<i;o++)if(null==t||t[o]){const t=n[o],i=e[o],l=r*i+t+u;l&&(a[o]=s*(i-s*t-r)/l)}return[a]}(a,o[r[0]],o[r[1]],r[2]+1,r[3]+1,r[4]+1);break;case"msavi":u=function(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=n[o],s=e[o];r[o]=.5*(2*(s+1)-Math.sqrt((2*s+1)**2-8*(s-t)))}return[r]}(a,o[r[0]],o[r[1]]);break;case"gemi":u=function(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=n[o],s=e[o];if(1!==t){const e=(2*(s*s-t*t)+1.5*s+.5*t)/(s+t+.5);r[o]=e*(1-.25*e)-(t-.125)/(1-t)}}return[r]}(a,o[r[0]],o[r[1]]);break;case"pvi":u=function(t,e,n,s,r){const o=n.length,i=new Float32Array(o),a=Math.sqrt(1+s*s);for(let u=0;u<o;u++)if(null==t||t[u]){const t=n[u],o=e[u];i[u]=(o-s*t-r)/a}return[i]}(a,o[r[0]],o[r[1]],r[2]+1,r[3]+1);break;case"gvitm":u=function(t,e){const[n,s,r,o,i,a]=e,u=n.length,l=new Float32Array(u);for(let e=0;e<u;e++)(null==t||t[e])&&(l[e]=-.2848*n[e]-.2435*s[e]-.5436*r[e]+.7243*o[e]+.084*i[e]-1.18*a[e]);return[l]}(a,[o[r[0]],o[r[1]],o[r[2]],o[r[3]],o[r[4]],o[r[5]]]);break;case"sultan":u=function(t,e){const[n,,s,r,o,i]=e,a=n.length,u=new Float32Array(a),l=new Float32Array(a),c=new Float32Array(a);for(let e=0;e<a;e++)(null==t||t[e])&&(u[e]=i[e]?o[e]/i[e]*100:0,l[e]=n[e]?o[e]/n[e]*100:0,c[e]=r[e]?s[e]/r[e]*(o[e]/r[e])*100:0);return[u,l,c]}(a,[o[r[0]],o[r[1]],o[r[2]],o[r[3]],o[r[4]],o[r[5]]]);break;case"vari":u=function(t,e){const[n,s,r]=e,o=n.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=n[e],o=s[e],a=o+t-r[e];a&&(i[e]=(o-t)/a)}return[i]}(a,[o[r[0]],o[r[1]],o[r[2]]]);break;case"mtvi2":u=function(t,e){const[n,s,r]=e,o=n.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=n[e],o=s[e],a=r[e],u=Math.sqrt((2*t+1)**2-6*t-5*Math.sqrt(o)-.5);i[e]=1.5*(1.2*(t-a)-2.5*(o-a))*u}return[i]}(a,[o[r[0]],o[r[1]],o[r[2]]]);break;case"rtvi-core":u=function(t,e){const[n,s,r]=e,o=n.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=n[e],o=s[e],a=r[e];i[e]=100*(t-o)-10*(t-a)}return[i]}(a,[o[r[0]],o[r[1]],o[r[2]]]);break;case"evi":u=function(t,e){const[n,s,r]=e,o=n.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=n[e],o=s[e],a=t+6*o-7.5*r[e]+1;a&&(i[e]=2.5*(t-o)/a)}return[i]}(a,[o[r[0]],o[r[1]],o[r[2]]]);break;case"wndwi":u=function(t,e,n=.5){const[s,r,o]=e,i=r.length,a=new Float32Array(i);for(let e=0;e<i;e++)if(null==t||t[e])for(e=0;e<i;e++){const t=s[e],i=r[e],u=o[e],l=t+n*i+(1-n)*u;l&&(a[e]=(t-n*i-(1-n)*u)/l)}return[a]}(a,[o[r[0]],o[r[1]],o[r[2]]],r[3]?r[3]+1:.5);break;case"bai":u=function(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o])for(o=0;o<s;o++){const t=(.1-e[o])**2+(.06-n[o])**2;t&&(r[o]=1/t)}return[r]}(a,o[r[0]],o[r[1]]);break;case"custom":u=I(a,o,n);break;default:return t}const l=(0,i.pC)(a)?new Uint8Array(a.length):null;(0,i.pC)(a)&&(0,i.pC)(l)&&l.set(a);const c=new A.Z({width:t.width,height:t.height,pixelType:"f32",pixels:u,mask:l});return c.updateStatistics(),c}(e,{method:n,bandIndexes:r,equation:s})}_getWebGLParameters(){const t=this.functionArguments.bandIndexes.split(" ").map((t=>parseFloat(t)-1));2===t.length&&t.push(0);const e=this.isInputBandIdsSwizzled?[0,1,2]:t;let n,s;const r=new Float32Array(3),{method:o}=this.functionArguments;switch(o){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":n=M([e[0],e[1],0]),s="ndxi";break;case"ndwi":n=M([e[1],e[0],0]),s="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":n=M([e[0],e[1],0]),s="sr";break;case"ci-g":case"ci-re":n=M([e[0],e[1],0]),s="ci";break;case"savi":n=M([e[0],e[1],0]),s="savi",r[0]=t[2]+1;break;case"tsavi":n=M([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1,r[2]=t[4]+1;break;case"msavi":n=M([e[0],e[1],0]),s="msavi";break;case"gemi":n=M([e[0],e[1],0]),s="gemi";break;case"pvi":n=M([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1;break;case"vari":n=M([e[0],e[1],e[2]]),s="vari";break;case"mtvi2":n=M([e[0],e[1],e[2]]),s="mtvi2";break;case"rtvi-core":n=M([e[0],e[1],e[2]]),s="rtvicore";break;case"evi":n=M([e[0],e[1],e[2]]),s="evi";break;case"wndwi":n=M([e[0],e[1],0]),s="wndwi",r[0]=t[3]?t[3]+1:.5;break;case"bai":n=M([e[1],e[0],0]),s="bai";break;default:n=M([0,1,2]),s="custom"}return{bandIndexMat3:n,indexType:s,adjustments:r}}_getInputBandIds(t){if("custom"===this.functionArguments.method)return t;const e=this.functionArguments.bandIndexes.split(" ").map((t=>parseFloat(t)-1)),n=t.length,s=e.map((t=>t>=n?n-1:t)),r=D.has(this.functionArguments.method)?3:2,o=s.slice(0,r).map((e=>t[e]));return 2===o.length&&o.push(0),o}};(0,o._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],E.prototype,"functionName",void 0),(0,o._)([(0,a.Cb)({type:G,json:{write:!0,name:"rasterFunctionArguments"}})],E.prototype,"functionArguments",void 0),(0,o._)([(0,a.Cb)()],E.prototype,"rasterArgumentNames",void 0),E=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.BandArithmeticFunction")],E);const z=E;var O,L=n(71715),Z=n(93010),V=n(94593);let W=O=class extends p{castColormapName(t){if(!t)return null;const e=t.toLowerCase();return Z.Oi.includes(e)?e:null}readColorRamp(t){return(0,V.i)(t)}readColorRampName(t,e){if(!t)return null;const n=Z.H0.jsonValues.find((e=>e.toLowerCase()===t.toLowerCase()));return n?Z.H0.fromJSON(n):null}clone(){return new O({colormap:(0,v.d9)(this.colormap),colormapName:this.colormapName,colorRamp:this.colorRamp?.clone(),colorRampName:this.colorRampName})}};(0,o._)([(0,a.Cb)({type:[[Number]],json:{write:!0}})],W.prototype,"colormap",void 0),(0,o._)([(0,a.Cb)({type:String,json:{write:!0}})],W.prototype,"colormapName",void 0),(0,o._)([(0,d.p)("colormapName")],W.prototype,"castColormapName",null),(0,o._)([(0,a.Cb)({types:V.V,json:{write:!0}})],W.prototype,"colorRamp",void 0),(0,o._)([(0,L.r)("colorRamp")],W.prototype,"readColorRamp",null),(0,o._)([(0,a.Cb)({type:Z.H0.apiValues,json:{type:Z.H0.jsonValues,write:Z.H0.write}})],W.prototype,"colorRampName",void 0),(0,o._)([(0,L.r)("colorRampName")],W.prototype,"readColorRampName",null),W=O=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],W);const U=W,H=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],q=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];function X(t,e){const n=[],s=[];for(let e=0;e<t.length-1;e++)n.push({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:t[e].slice(1),toColor:t[e+1].slice(1)}),s.push(t[e+1][0]-t[e][0]);const r=t[t.length-1][0];return(0,Z.XL)({type:"multipart",colorRamps:n},{numColors:r,weights:e=e??s})}let J=class extends y{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let{colormap:e,colormapName:n,colorRamp:s,colorRampName:r}=this.functionArguments;if(!e?.length)if(s)e=(0,Z.Jw)(s,{interpolateAlpha:!0});else if(r){const t=(0,Z.B4)(r);t&&(e=(0,Z.Jw)(t))}else n&&(e=function(t){let e;switch(t){case"elevation":e=X([[0,0,191,191],[51,0,255,0],[102,255,255,0],[153,255,127,0],[204,191,127,63],[256,20,20,20]]);break;case"gray":e=(0,Z.XL)({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:[0,0,0],toColor:[255,255,255]});break;case"hillshade":e=X([[0,38,54,41],[69,79,90,82],[131,156,156,156],[256,253,241,253]],[.268,.238,.495]);break;case"ndvi":e=H;break;case"ndvi2":e=function(){const t=X([[0,255,255,255],[70,0,0,255],[80,205,193,173],[100,150,150,150],[110,120,100,51],[130,120,200,100],[140,28,144,3],[160,6,55,0],[180,10,30,25],[201,6,27,7]]);for(let e=t.length;e<256;e++)t.push([6,27,7]);return t}();break;case"ndvi3":e=q;break;case"random":e=function(){const t=[];for(let e=0;e<256;e++){const e=[];for(let t=0;t<3;t++)e.push(Math.round(255*Math.random()));t.push(e)}return t}()}return e?(e=e.map(((t,e)=>[e,...t])),e):null}(n));if(!e?.length)return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};this.outputPixelType=this._getOutputPixelType("u8");const o=t.clone();return o.pixelType=this.outputPixelType,o.colormap=e,o.bandCount=1,this.rasterInfo=o,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};(0,o._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],J.prototype,"functionName",void 0),(0,o._)([(0,a.Cb)({type:U,json:{write:!0,name:"rasterFunctionArguments"}})],J.prototype,"functionArguments",void 0),(0,o._)([(0,a.Cb)()],J.prototype,"rasterArgumentNames",void 0),(0,o._)([(0,a.Cb)()],J.prototype,"isNoopProcess",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],J.prototype,"indexedColormap",void 0),J=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.ColormapFunction")],J);const Y=J;var $,K=n(30556);let Q=$=class extends p{writeRasters(t,e){e.rasters=t.map((t=>"number"==typeof t||"string"==typeof t?t:t.toJSON()))}clone(){return new $({rasters:(0,v.d9)(this.rasters)})}};(0,o._)([(0,a.Cb)({json:{write:!0}})],Q.prototype,"rasters",void 0),(0,o._)([(0,K.c)("rasters")],Q.prototype,"writeRasters",null),Q=$=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],Q);const tt=Q;let et=class extends y{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const n=e.clone();if(n.attributeTable=null,n.colormap=null,n.pixelType=this.outputPixelType,n.bandCount=t.map((({bandCount:t})=>t)).reduce(((t,e)=>t+e)),t.every((({statistics:t})=>(0,i.pC)(t)&&t.length))){const e=[];t.forEach((({statistics:t})=>(0,i.pC)(t)&&e.push(...t))),n.statistics=e}if(t.every((({histograms:t})=>(0,i.pC)(t)&&t.length))){const e=[];t.forEach((({histograms:t})=>(0,i.pC)(t)&&e.push(...t))),n.histograms=e}return this.rasterInfo=n,{success:!0,supportsGPU:n.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;if(!e)return null;const n=e?.[0];return(0,i.Wi)(n)?null:(0,F.Gd)(e)}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};(0,o._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],et.prototype,"functionName",void 0),(0,o._)([(0,a.Cb)({type:tt,json:{write:!0,name:"rasterFunctionArguments"}})],et.prototype,"functionArguments",void 0),(0,o._)([(0,a.Cb)()],et.prototype,"rasterArgumentNames",void 0),et=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.CompositeBandFunction")],et);const nt=et;var st,rt=n(81578);!function(t){t[t.UserDefined=-1]="UserDefined",t[t.LineDetectionHorizontal=0]="LineDetectionHorizontal",t[t.LineDetectionVertical=1]="LineDetectionVertical",t[t.LineDetectionLeftDiagonal=2]="LineDetectionLeftDiagonal",t[t.LineDetectionRightDiagonal=3]="LineDetectionRightDiagonal",t[t.GradientNorth=4]="GradientNorth",t[t.GradientWest=5]="GradientWest",t[t.GradientEast=6]="GradientEast",t[t.GradientSouth=7]="GradientSouth",t[t.GradientNorthEast=8]="GradientNorthEast",t[t.GradientNorthWest=9]="GradientNorthWest",t[t.SmoothArithmeticMean=10]="SmoothArithmeticMean",t[t.Smoothing3x3=11]="Smoothing3x3",t[t.Smoothing5x5=12]="Smoothing5x5",t[t.Sharpening3x3=13]="Sharpening3x3",t[t.Sharpening5x5=14]="Sharpening5x5",t[t.Laplacian3x3=15]="Laplacian3x3",t[t.Laplacian5x5=16]="Laplacian5x5",t[t.SobelHorizontal=17]="SobelHorizontal",t[t.SobelVertical=18]="SobelVertical",t[t.Sharpen=19]="Sharpen",t[t.Sharpen2=20]="Sharpen2",t[t.PointSpread=21]="PointSpread",t[t.None=255]="None"}(st||(st={}));const ot=new Map;function it(t,e,n,s,r,o,i){const a=new Float32Array(e*n),u=o.length,l=i?0:s,c=i?s:0,p=i?1:e;for(let i=l;i<n-l;i++){const n=i*e;for(let i=c;i<e-c;i++){if(r&&!r[n+i])continue;let e=0;for(let r=0;r<u;r++)e+=t[n+i+(r-s)*p]*o[r];a[n+i]=e}}return a}function at(t,e,n,s,r,o,i){const a=new Float32Array(e*n),u=Math.floor(s/2),l=Math.floor(r/2);for(let c=u;c<n-u;c++){const n=c*e;for(let c=l;c<e-l;c++){if(o&&!o[n+c])continue;let p=0;for(let o=0;o<s;o++)for(let s=0;s<r;s++)p+=t[n+c+(o-u)*e+s-l]*i[o*r+s];a[n+c]=p}}return a}function ut(t,e,n,s,r){const o=Math.floor(s/2);for(let s=0;s<o;s++)for(let o=0;o<e;o++)t[s*e+o]=t[(r-1-s)*e+o],t[(n-1-s)*e+o]=t[(n-r+s)*e+o];const i=Math.floor(r/2);for(let s=0;s<n;s++){const n=s*e;for(let s=0;s<i;s++)t[n+s]=t[n+r-1-s],t[n+e-s-1]=t[n+e+s-r]}}var lt;ot.set(st.None,[0,0,0,0,1,0,0,0,0]),ot.set(st.LineDetectionHorizontal,[-1,-1,-1,2,2,2,-1,-1,-1]),ot.set(st.LineDetectionVertical,[-1,2,-1,-1,2,-1,-1,2,-1]),ot.set(st.LineDetectionLeftDiagonal,[2,-1,-1,-1,2,-1,-1,-1,2]),ot.set(st.LineDetectionRightDiagonal,[-1,-1,2,-1,2,-1,2,-1,-1]),ot.set(st.GradientNorth,[-1,-2,-1,0,0,0,1,2,1]),ot.set(st.GradientWest,[-1,0,1,-2,0,2,-1,0,1]),ot.set(st.GradientEast,[1,0,-1,2,0,-2,1,0,-1]),ot.set(st.GradientSouth,[1,2,1,0,0,0,-1,-2,-1]),ot.set(st.GradientNorthEast,[0,-1,-2,1,0,-1,2,1,0]),ot.set(st.GradientNorthWest,[-2,-1,0,-1,0,1,0,1,2]),ot.set(st.SmoothArithmeticMean,[.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111]),ot.set(st.Smoothing3x3,[.0625,.125,.0625,.125,.25,.125,.0625,.125,.0625]),ot.set(st.Smoothing5x5,[1,1,1,1,1,1,4,4,4,1,1,4,12,4,1,1,4,4,4,1,1,1,1,1,1]),ot.set(st.Sharpening3x3,[-1,-1,-1,-1,9,-1,-1,-1,-1]),ot.set(st.Sharpening5x5,[-1,-3,-4,-3,-1,-3,0,6,0,-3,-4,6,21,6,-4,-3,0,6,0,-3,-1,-3,-4,-3,-1]),ot.set(st.Laplacian3x3,[0,-1,0,-1,4,-1,0,-1,0]),ot.set(st.Laplacian5x5,[0,0,-1,0,0,0,-1,-2,-1,0,-1,-2,17,-2,-1,0,-1,-2,-1,0,0,0,-1,0,0]),ot.set(st.SobelHorizontal,[-1,-2,-1,0,0,0,1,2,1]),ot.set(st.SobelVertical,[-1,0,1,-2,0,2,-1,0,1]),ot.set(st.Sharpen,[0,-.25,0,-.25,2,-.25,0,-.25,0]),ot.set(st.Sharpen2,[-.25,-.25,-.25,-.25,3,-.25,-.25,-.25,-.25]),ot.set(st.PointSpread,[-.627,.352,-.627,.352,2.923,.352,-.627,.352,-.627]);let ct=lt=class extends p{constructor(){super(...arguments),this.rows=3,this.cols=3,this.kernel=[0,0,0,0,1,0,0,0,0]}set convolutionType(t){this._set("convolutionType",t);const e=ot.get(t);if(!e||t===st.UserDefined||t===st.None)return;const n=Math.sqrt(e.length);this._set("kernel",e),this._set("cols",n),this._set("rows",n)}clone(){return new lt({cols:this.cols,rows:this.rows,kernel:[...this.kernel],convolutionType:this.convolutionType,raster:(0,v.d9)(this.raster)})}};(0,o._)([(0,a.Cb)({json:{type:Number,write:!0}})],ct.prototype,"rows",void 0),(0,o._)([(0,a.Cb)({json:{type:Number,write:!0}})],ct.prototype,"cols",void 0),(0,o._)([(0,a.Cb)({json:{name:"type",type:Number,write:!0}})],ct.prototype,"convolutionType",null),(0,o._)([(0,a.Cb)({json:{type:[Number],write:!0}})],ct.prototype,"kernel",void 0),ct=lt=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.ConvolutionFunctionArguments")],ct);const pt=ct;let ft=class extends y{constructor(){super(...arguments),this.functionName="Convolution",this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{convolutionType:t,rows:e,cols:n,kernel:s}=this.functionArguments;if(!st[t])return{success:!1,supportsGPU:!1,error:`convolution-function: the specified kernel type is not supported ${t}`};if(t!==st.None&&e*n!==s.length)return{success:!1,supportsGPU:!1,error:"convolution-function: the specified rows and cols do not match the length of the kernel"};const r=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(r.pixelType);const o=r.clone();o.pixelType=this.outputPixelType;const i=[st.None,st.Sharpen,st.Sharpen2,st.Sharpening3x3,st.Sharpening5x5];return"u8"===this.outputPixelType||i.includes(t)||(o.statistics=null,o.histograms=null),this.rasterInfo=o,{success:!0,supportsGPU:s.length<=25}}_processPixels(t){const e=t.pixelBlocks?.[0];if((0,i.Wi)(e)||this.functionArguments.convolutionType===st.None)return e;let{kernel:n,rows:s,cols:r}=this.functionArguments;const o=n.reduce(((t,e)=>t+e));return 0!==o&&1!==o&&(n=n.map((t=>t/o))),function(t,e){const n=function(t){const e=Math.sqrt(t.length),n=t.slice(0,e),s=[1];for(let n=1;n<e;n++){let r=null;for(let s=0;s<e;s++){const o=t[s+n*e],i=t[s];if(null==r)if(0===i){if(o)return{separable:!1,row:null,col:null}}else r=o/i;else if(o/i!==r)return{separable:!1,row:null,col:null}}if(null==r)return{separable:!1,row:null,col:null};s.push(r)}return{separable:!0,row:n,col:s}}(e.kernel),s=!1!==e.mirrorEdges,r=n.separable?function(t,e,n,s=!0){const{pixels:r,width:o,height:i,pixelType:a,mask:u}=t,l=r.length,c=[],p=e.length,f=n.length,h=Math.floor(p/2),m=Math.floor(f/2);for(let t=0;t<l;t++){let a=it(r[t],o,i,h,u,e,!0);a=it(a,o,i,m,u,n,!1),s&&ut(a,o,i,p,f),c.push(a)}return new A.Z({width:o,height:i,pixelType:a,pixels:c,mask:u})}(t,n.row,n.col,s):function(t,e,n=!0){const{pixels:s,width:r,height:o,pixelType:i,mask:a}=t,u=s.length,l=[],{kernel:c,rows:p,cols:f}=e;for(let t=0;t<u;t++){const e=at(s[t],r,o,p,f,a,c);n&&ut(e,r,o,p,f),l.push(e)}return new A.Z({width:r,height:o,pixelType:i,pixels:l,mask:a})}(t,e,s),{outputPixelType:o}=e;return o&&r.clamp(o),r}(e,{kernel:n,rows:s,cols:r,outputPixelType:this.outputPixelType})}_getWebGLParameters(){let{kernel:t}=this.functionArguments;const e=t.reduce(((t,e)=>t+e));0!==e&&1!==e&&(t=t.map((t=>t/e)));const n=new Float32Array(25);return n.set(t),{kernelRows:this.functionArguments.rows,kernelCols:this.functionArguments.cols,kernel:n,clampRange:(0,rt.r)(this.outputPixelType)}}};(0,o._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],ft.prototype,"functionName",void 0),(0,o._)([(0,a.Cb)({type:pt,json:{write:!0,name:"rasterFunctionArguments"}})],ft.prototype,"functionArguments",void 0),(0,o._)([(0,a.Cb)()],ft.prototype,"rasterArgumentNames",void 0),ft=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.ConvolutionFunction")],ft);const ht=ft;var mt;let dt=mt=class extends p{constructor(){super(...arguments),this.bandIds=[],this.missingBandAction=F.CD.bestMatch}clone(){return new mt({bandIds:[...this.bandIds],missingBandAction:this.missingBandAction})}};(0,o._)([(0,a.Cb)({json:{write:!0}})],dt.prototype,"bandIds",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],dt.prototype,"missingBandAction",void 0),dt=mt=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],dt);const gt=dt;let yt=class extends y{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0],{bandCount:n}=e,{bandIds:s,missingBandAction:r}=this.functionArguments;if(r===F.CD.fail&&s.some((t=>t<0||t>=n)))return{success:!1,supportsGPU:!1,error:"extract-band-function: invalid bandIds"};this.outputPixelType=this._getOutputPixelType("f32");const o=e.clone();o.pixelType=this.outputPixelType,o.bandCount=s.length;const{statistics:a,histograms:u}=o;return(0,i.pC)(a)&&a.length&&(o.statistics=s.map((t=>a[t]||a[a.length-1]))),(0,i.pC)(u)&&u.length&&(o.histograms=s.map((t=>u[t]||u[u.length-1]))),this.rasterInfo=o,{success:!0,supportsGPU:o.bandCount<=3}}_processPixels(t){const e=t.pixelBlocks?.[0];if((0,i.Wi)(e))return null;const n=e.pixels.length,s=this.functionArguments.bandIds.map((t=>t>=n?n-1:t));return e.extractBands(s)}_getWebGLParameters(){let t;if(this.isInputBandIdsSwizzled)t=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{t=[...this.functionArguments.bandIds],0===t.length?t=[0,1,2]:t.length<3&&(t[1]=t[1]??t[0],t[2]=t[2]??t[1]);for(let e=0;e<3;e++)t[e]=Math.min(t[e],2)}return{bandIndexMat3:M(t)}}_getInputBandIds(t){const e=t.length;return this.functionArguments.bandIds.map((t=>t>=e?e-1:t)).map((e=>t[e]))}};(0,o._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],yt.prototype,"functionName",void 0),(0,o._)([(0,a.Cb)({type:gt,json:{write:!0,name:"rasterFunctionArguments"}})],yt.prototype,"functionArguments",void 0),(0,o._)([(0,a.Cb)()],yt.prototype,"rasterArgumentNames",void 0),yt=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.ExtractBandFunction")],yt);const xt=yt;var bt;let wt=bt=class extends p{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!1}writeRasters(t,e){e.rasters=t.map((t=>"number"==typeof t||"string"==typeof t?t:t.toJSON()))}clone(){return new bt({method:this.operation,processAsMultiband:this.processAsMultiband,rasters:(0,v.d9)(this.rasters)})}};(0,o._)([(0,a.Cb)({json:{write:!0}})],wt.prototype,"operation",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],wt.prototype,"rasters",void 0),(0,o._)([(0,K.c)("rasters")],wt.prototype,"writeRasters",null),(0,o._)([(0,a.Cb)({json:{write:!0}})],wt.prototype,"processAsMultiband",void 0),wt=bt=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.LocalFunctionArguments")],wt);const vt=wt;var Ct;!function(t){t[t.Plus=1]="Plus",t[t.Minus=2]="Minus",t[t.Times=3]="Times",t[t.SquareRoot=4]="SquareRoot",t[t.Power=5]="Power",t[t.ACos=6]="ACos",t[t.ASin=7]="ASin",t[t.ATan=8]="ATan",t[t.ATanH=9]="ATanH",t[t.Abs=10]="Abs",t[t.BitwiseAnd=11]="BitwiseAnd",t[t.BitwiseLeftShift=12]="BitwiseLeftShift",t[t.BitwiseNot=13]="BitwiseNot",t[t.BitwiseOr=14]="BitwiseOr",t[t.BitwiseRightShift=15]="BitwiseRightShift",t[t.BitwiseXOr=16]="BitwiseXOr",t[t.BooleanAnd=17]="BooleanAnd",t[t.BooleanNot=18]="BooleanNot",t[t.BooleanOr=19]="BooleanOr",t[t.BooleanXOr=20]="BooleanXOr",t[t.Cos=21]="Cos",t[t.CosH=22]="CosH",t[t.Divide=23]="Divide",t[t.EqualTo=24]="EqualTo",t[t.Exp=25]="Exp",t[t.Exp10=26]="Exp10",t[t.Exp2=27]="Exp2",t[t.GreaterThan=28]="GreaterThan",t[t.GreaterThanEqual=29]="GreaterThanEqual",t[t.Int=30]="Int",t[t.IsNull=31]="IsNull",t[t.Float=32]="Float",t[t.LessThan=33]="LessThan",t[t.LessThanEqual=34]="LessThanEqual",t[t.Ln=35]="Ln",t[t.Log10=36]="Log10",t[t.Log2=37]="Log2",t[t.Majority=38]="Majority",t[t.Max=39]="Max",t[t.Mean=40]="Mean",t[t.Med=41]="Med",t[t.Min=42]="Min",t[t.Minority=43]="Minority",t[t.Mod=44]="Mod",t[t.Negate=45]="Negate",t[t.NotEqual=46]="NotEqual",t[t.Range=47]="Range",t[t.RoundDown=48]="RoundDown",t[t.RoundUp=49]="RoundUp",t[t.SetNull=50]="SetNull",t[t.Sin=51]="Sin",t[t.SinH=52]="SinH",t[t.Square=53]="Square",t[t.Std=54]="Std",t[t.Sum=55]="Sum",t[t.Tan=56]="Tan",t[t.TanH=57]="TanH",t[t.Variety=58]="Variety",t[t.ACosH=59]="ACosH",t[t.ASinH=60]="ASinH",t[t.ATan2=61]="ATan2",t[t.FloatDivide=64]="FloatDivide",t[t.FloorDivide=65]="FloorDivide",t[t.MajorityIgnoreNoData=66]="MajorityIgnoreNoData",t[t.MaxIgnoreNoData=67]="MaxIgnoreNoData",t[t.MeanIgnoreNoData=68]="MeanIgnoreNoData",t[t.MedIgnoreNoData=69]="MedIgnoreNoData",t[t.MinIgnoreNoData=70]="MinIgnoreNoData",t[t.MinorityIgnoreNoData=71]="MinorityIgnoreNoData",t[t.RangeIgnoreNoData=72]="RangeIgnoreNoData",t[t.StdIgnoreNoData=73]="StdIgnoreNoData",t[t.SumIgnoreNoData=74]="SumIgnoreNoData",t[t.VarietyIgnoreNoData=75]="VarietyIgnoreNoData",t[t.Con=76]="Con"}(Ct||(Ct={}));const _t=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,1,1,1,1,999,999,1,1,999,1,1,2,2,2,999,999,999,999,999,999,999,999,999,999,3];function At(t,e,n){const[s,r]=t,o=s.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]+r[t]);return i}function St(t,e,n){const[s]=t,r=s.length,o=A.Z.createEmptyBand("f32",r);return o.set(s),o}function Nt(t,e,n){const[s,r]=t,o=s.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]-r[t]);return i}function Rt(t,e,n){const[s,r]=t,o=s.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]*r[t]);return i}function Pt(t,e,n){const[s]=t,r=s.length,o=A.Z.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=Math.sign(s[t])*Math.floor(Math.abs(s[t])));return o}function It(t,e,n){const[s,r]=t,o=s.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=0===r[t]?0:s[t]/r[t]);return i}function Ft(t,e,n){return It(t,e,"f32")}function Tt(t,e,n){const[s,r]=t,o=s.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=0===r[t]?0:Math.floor(s[t]/r[t]));return i}function Mt(t,e,n,s){const[r]=t,o=r.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s(r[t]));return i}function Bt(t,e,n,s){const[r,o]=t,i=r.length,a=A.Z.createEmptyBand(n,i);for(let t=0;t<i;t++)e&&!e[t]||(a[t]=s(r[t],o[t]));return a}function kt(t,e,n){const[s,r]=t,o=s.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]&r[t]);return i}function jt(t,e,n){const[s,r]=t,o=s.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]<<r[t]);return i}function Gt(t,e,n){const[s]=t,r=s.length,o=A.Z.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=~s[t]);return o}function Dt(t,e,n){const[s,r]=t,o=s.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]|r[t]);return i}function Et(t,e,n){const[s,r]=t,o=s.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]>>r[t]);return i}function zt(t,e,n){const[s,r]=t,o=s.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]^r[t]);return i}function Ot(t,e,n){const[s,r]=t,o=s.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]&&r[t]?1:0);return i}function Lt(t,e,n){const[s]=t,r=s.length,o=A.Z.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=s[t]?0:1);return o}function Zt(t,e,n){const[s,r]=t,o=s.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]||r[t]?1:0);return i}function Vt(t,e,n){const[s,r]=t,o=s.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=(s[t]?1:0)^(r[t]?1:0));return i}function Wt(t,e,n){const[s,r]=t,o=s.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]===r[t]?1:0);return i}function Ut(t,e,n,s){const[r]=t,o=r.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s**r[t]);return i}function Ht(t,e,n){return Ut(t,e,n,10)}function qt(t,e,n){return Ut(t,e,n,2)}function Xt(t,e,n){const[s,r]=t,o=s.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]>r[t]?1:0);return i}function Jt(t,e,n){const[s,r]=t,o=s.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]>=r[t]?1:0);return i}function Yt(t,e,n){const[s,r]=t,o=s.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]<r[t]?1:0);return i}function $t(t,e,n){const[s,r]=t,o=s.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]<=r[t]?1:0);return i}function Kt(t,e,n){const[s]=t,r=s.length,o=A.Z.createEmptyBand(n,r);if(!e)return o;for(let t=0;t<r;t++)o[t]=e[t]?0:1;return o}function Qt(t,e,n){const[s,r]=t,o=s.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]%r[t]);return i}function te(t,e,n){const[s]=t,r=s.length,o=A.Z.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=-s[t]);return o}function ee(t,e,n){const[s,r]=t,o=s.length,i=A.Z.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]===r[t]?0:1);return i}function ne(t,e,n){const[s,r]=t,o=s.length,i=A.Z.createEmptyBand(n,o),a=new Uint8Array(o);for(let t=0;t<o;t++)null!=e&&!e[t]||0!==s[t]||(i[t]=r[t],a[t]=255);return{band:i,mask:a}}function se(t,e,n){const[s,r,o]=t,i=s.length,a=A.Z.createEmptyBand(n,i);for(let t=0;t<i;t++)e&&!e[t]||(a[t]=s[t]?r[t]:o[t]);return a}function re(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=A.Z.createEmptyBand(n,o);i.set(r);for(let n=0;n<o;n++)if(!e||e[n])for(let e=1;e<s;e++){const s=t[e];i[n]<s[n]&&(i[n]=s[n])}return i}function oe(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=A.Z.createEmptyBand(n,o);i.set(r);for(let n=0;n<o;n++)if(!e||e[n])for(let e=1;e<s;e++){const s=t[e];i[n]>s[n]&&(i[n]=s[n])}return i}function ie(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=A.Z.createEmptyBand(n,o);i.set(r);for(let n=0;n<o;n++)if(!e||e[n]){let e=i[n];for(let r=1;r<s;r++){const s=t[r];i[n]<s[n]&&(i[n]=s[n]),e>s[n]&&(e=s[n])}i[n]-=e}return i}function ae(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=A.Z.createEmptyBand(n,o);i.set(r);for(let n=0;n<o;n++)if(!e||e[n]){for(let e=1;e<s;e++){const s=t[e];i[n]+=s[n]}i[n]/=s}return i}function ue(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=A.Z.createEmptyBand(n,o);i.set(r);for(let n=0;n<o;n++)if(!e||e[n])for(let e=1;e<s;e++){const s=t[e];i[n]+=s[n]}return i}function le(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=A.Z.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n]){const e=new Float32Array(s);let r=0;for(let o=0;o<s;o++){const s=t[o];r+=s[n],e[o]=s[n]}r/=s;let o=0;for(let t=0;t<s;t++)o+=(e[t]-r)*e[t]-r;i[n]=Math.sqrt(o/s-1)}return i}function ce(t,e,n){const s=t.length;if(s<2)return t[0];const r=Math.floor(s/2),[o]=t,i=o.length,a=A.Z.createEmptyBand(n,i),u=new Float32Array(s);for(let n=0;n<i;n++)if(!e||e[n]){for(let e=0;e<s;e++)u[e]=t[e][n];u.sort(),a[n]=u[r]}return a}function pe(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=A.Z.createEmptyBand(n,o),a=new Map;for(let n=0;n<o;n++)if(!e||e[n]){let e;a.clear();for(let r=0;r<s;r++)e=t[r][n],a.set(e,a.has(e)?a.get(e)+1:1);let r=0,o=0;for(const t of a.keys())r=a.get(t),r>o&&(o=r,e=t);i[n]=e}return i}function fe(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=A.Z.createEmptyBand(n,o),a=new Map;for(let n=0;n<o;n++)if(!e||e[n]){let e;a.clear();for(let r=0;r<s;r++)e=t[r][n],a.set(e,a.has(e)?a.get(e)+1:1);let r=0,o=t.length;for(const t of a.keys())r=a.get(t),r<o&&(o=r,e=t);i[n]=e}return i}function he(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=A.Z.createEmptyBand(n,o),a=new Set;for(let n=0;n<o;n++)if(!e||e[n]){let e;a.clear();for(let r=0;r<s;r++)e=t[r][n],a.add(e);i[n]=a.size}return i}function me(t,e,n){return pe(t,null,n)}function de(t,e,n){return fe(t,null,n)}function ge(t,e,n){return he(t,null,n)}function ye(t,e,n){return re(t,null,n)}function xe(t,e,n){return oe(t,null,n)}function be(t,e,n){return le(t,null,n)}function we(t,e,n){return ue(t,null,n)}function ve(t,e,n){return ae(t,null,n)}function Ce(t,e,n){return ce(t,null,n)}function _e(t,e,n){return ie(t,null,n)}const Ae=new Map,Se=new Map,Ne=new Map;let Re=class extends y{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0],{bandCount:n}=e,{processAsMultiband:s}=this.functionArguments;if(s&&t.some((t=>t.bandCount!==n)))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};this.outputPixelType=this._getOutputPixelType("f32");const r=e.clone();r.pixelType=this.outputPixelType,r.statistics=null,r.histograms=null,r.attributeTable=null,s||(r.bandCount=1),this.rasterInfo=r;const{operation:o}=this.functionArguments;return{success:!0,supportsGPU:o<66||76===o}}_processPixels(t){const{pixelBlocks:e}=t;return(0,i.Wi)(e)||e.some((t=>(0,i.Wi)(t)))?null:function(t,e,n={}){Ae.size||(Ae.set(4,Math.sqrt),Ae.set(6,Math.acos),Ae.set(7,Math.asin),Ae.set(8,Math.atan),Ae.set(9,Math.atanh),Ae.set(10,Math.abs),Ae.set(21,Math.cos),Ae.set(22,Math.cosh),Ae.set(25,Math.exp),Ae.set(35,Math.log),Ae.set(36,Math.log10),Ae.set(37,Math.log2),Ae.set(48,Math.floor),Ae.set(49,Math.ceil),Ae.set(51,Math.sin),Ae.set(52,Math.sinh),Ae.set(56,Math.tan),Ae.set(57,Math.tanh),Ae.set(59,Math.acosh),Ae.set(60,Math.asinh),Ae.set(65,Math.floor),Se.set(5,Math.pow),Se.set(61,Math.atan2),Ne.set(1,At),Ne.set(2,Nt),Ne.set(3,Rt),Ne.set(11,kt),Ne.set(12,jt),Ne.set(12,jt),Ne.set(13,Gt),Ne.set(14,Dt),Ne.set(15,Et),Ne.set(16,zt),Ne.set(17,Ot),Ne.set(18,Lt),Ne.set(19,Zt),Ne.set(20,Vt),Ne.set(23,It),Ne.set(24,Wt),Ne.set(26,Ht),Ne.set(27,qt),Ne.set(28,Xt),Ne.set(29,Jt),Ne.set(30,Pt),Ne.set(31,Kt),Ne.set(32,St),Ne.set(33,Yt),Ne.set(34,$t),Ne.set(44,Qt),Ne.set(45,te),Ne.set(46,ee),Ne.set(64,Ft),Ne.set(65,Tt),Ne.set(76,se),Ne.set(38,pe),Ne.set(39,re),Ne.set(40,ae),Ne.set(41,ce),Ne.set(42,oe),Ne.set(43,fe),Ne.set(47,ie),Ne.set(54,le),Ne.set(55,ue),Ne.set(58,he),Ne.set(66,me),Ne.set(67,ye),Ne.set(68,ve),Ne.set(69,Ce),Ne.set(70,xe),Ne.set(71,de),Ne.set(72,_e),Ne.set(73,be),Ne.set(74,we),Ne.set(75,ge));const s=(0,i.Wg)(function(t){const e=t.map((t=>t.mask)).filter((t=>(0,i.pC)(t)));if(0===e.length)return null;const n=e[0].length,s=new Uint8Array(n);if(1===e.length)return s.set(e[0]),s;let r,o=e[0];for(let t=1;t<e.length;t++){r=e[t];for(let t=0;t<n;t++)s[t]=o[t]|r[t];o=r}return s}(t)),{processAsMultiband:r,outputPixelType:o="f32"}=n,a=r?t[0].pixels.length:1,u=[];let l;for(let n=0;n<a;n++){const r=t.map((t=>t.pixels[n]));let i;if(e===Ct.SetNull){const t=ne(r,s,o);i=t.band,l=t.mask}else Ne.has(e)?i=Ne.get(e)(r,s,o):Ae.has(e)?i=Mt(r,s,o,Ae.get(e)):Se.has(e)&&(i=Bt(r,s,o,Se.get(e)));if(null==i)return null;u.push(i)}l||e===Ct.IsNull||(l=s);const c=t[0];return new A.Z({width:c.width,height:c.height,pixelType:o,mask:l,pixels:u})}(e,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){const{operation:t}=this.functionArguments;return{imageCount:_t[t],operationName:Ct[t]}}};(0,o._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],Re.prototype,"functionName",void 0),(0,o._)([(0,a.Cb)({type:vt,json:{write:!0,name:"rasterFunctionArguments"}})],Re.prototype,"functionArguments",void 0),(0,o._)([(0,a.Cb)()],Re.prototype,"rasterArgumentNames",void 0),Re=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.LocalFunction")],Re);const Pe=Re;var Ie,Fe=n(22021);let Te=Ie=class extends p{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=F.DX.matchAny}clone(){return new Ie({includedRanges:this.includedRanges?.slice()??[],noDataValues:this.noDataValues?.slice()??[],noDataInterpretation:this.noDataInterpretation})}};(0,o._)([(0,a.Cb)({json:{write:!0}})],Te.prototype,"includedRanges",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],Te.prototype,"noDataValues",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],Te.prototype,"noDataInterpretation",void 0),Te=Ie=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.MaskFunctionArguments")],Te);const Me=Te;let Be=class extends y{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{includedRanges:n,noDataValues:s}=this.functionArguments;return n?.length||s?.length?(this.lookup=(0,F.nA)(e,n,s),{success:!0,supportsGPU:(!n||n.length<=2*F.hd)&&(!s||s.length<=F.hd)}):{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"}}_processPixels(t){const e=t.pixelBlocks?.[0];if((0,i.Wi)(e))return null;const{outputPixelType:n,lookup:s}=this,{includedRanges:r,noDataValues:o,noDataInterpretation:a}=this.functionArguments,u=a===F.DX.matchAll;return(0,F.sS)(e,{includedRanges:r,noDataValues:o,outputPixelType:n,matchAll:u,lookup:s})}_getWebGLParameters(){const{noDataValues:t,includedRanges:e}=this.functionArguments,n=new Float32Array(F.hd);n.fill(Fe._3),t&&t.length&&n.set(t);const s=new Float32Array(2*F.hd);for(let t=0;t<s.length;t+=2)s[t]=e?.[t]??-Fe._3,s[t+1]=e?.[t+1]??Fe._3;return e&&e.length&&s.set(e),{bandCount:this.sourceRasterInfos[0].bandCount,noDataValues:n,includedRanges:s}}};(0,o._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],Be.prototype,"functionName",void 0),(0,o._)([(0,a.Cb)({type:Me,json:{write:!0,name:"rasterFunctionArguments"}})],Be.prototype,"functionArguments",void 0),(0,o._)([(0,a.Cb)()],Be.prototype,"rasterArgumentNames",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],Be.prototype,"lookup",void 0),Be=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.MaskFunction")],Be);const ke=Be;var je;let Ge=je=class extends p{constructor(){super(...arguments),this.visibleBandID=0,this.infraredBandID=1,this.scientificOutput=!1}clone(){const{visibleBandID:t,infraredBandID:e,scientificOutput:n}=this;return new je({visibleBandID:t,infraredBandID:e,scientificOutput:n})}};(0,o._)([(0,a.Cb)({json:{write:!0}})],Ge.prototype,"visibleBandID",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],Ge.prototype,"infraredBandID",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],Ge.prototype,"scientificOutput",void 0),Ge=je=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.NDVIFunctionArguments")],Ge);const De=Ge;let Ee=class extends y{constructor(){super(...arguments),this.functionName="NDVI",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{scientificOutput:t}=this.functionArguments;this.outputPixelType=this._getOutputPixelType(t?"f32":"u8");const e=this.sourceRasterInfos[0].clone();e.pixelType=this.outputPixelType,e.colormap=null,e.histograms=null,e.bandCount=1;const[n,s,r,o]=t?[-1,1,0,.1]:[0,200,100,10];return e.statistics=[{min:n,max:s,avg:r,stddev:o}],this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if((0,i.Wi)(e))return null;const{visibleBandID:n,infraredBandID:s,scientificOutput:r}=this.functionArguments;return function(t,e,n,s){const{mask:r,pixels:o,width:i,height:a}=t,u=o[n],l=o[e],c=l.length,p=s?new Uint8Array(c):new Float32Array(c),f=s?100:1,h=s?100:0;for(let t=0;t<c;t++)if(null==r||r[t]){const e=u[t],n=l[t],s=e+n;s&&(p[t]=(e-n)/s*f+h)}const m=new A.Z({width:i,height:a,mask:r,pixelType:s?"u8":"f32",pixels:[p]});return m.updateStatistics(),m}(e,n,s,!r)}_getWebGLParameters(){const{visibleBandID:t,infraredBandID:e,scientificOutput:n}=this.functionArguments;return{bandIndexMat3:M(this.isInputBandIdsSwizzled?[0,1,2]:[e,t,0]),scaled:!n}}_getInputBandIds(t){const{visibleBandID:e,infraredBandID:n}=this.functionArguments;return[n,e,0].map((e=>t[e]))}};(0,o._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],Ee.prototype,"functionName",void 0),(0,o._)([(0,a.Cb)({type:De,json:{write:!0,name:"rasterFunctionArguments"}})],Ee.prototype,"functionArguments",void 0),(0,o._)([(0,a.Cb)()],Ee.prototype,"rasterArgumentNames",void 0),Ee=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.NDVIFunction")],Ee);const ze=Ee;var Oe;let Le=Oe=class extends p{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1}clone(){return new Oe({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched})}};(0,o._)([(0,a.Cb)({json:{write:!0}})],Le.prototype,"inputRanges",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],Le.prototype,"outputValues",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],Le.prototype,"noDataRanges",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],Le.prototype,"allowUnmatched",void 0),Le=Oe=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.RemapFunctionArguments")],Le);const Ze=Le;let Ve=class extends y{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,t.colormap=null,t.histograms=null,t.bandCount=1,t.attributeTable=null;const{statistics:n}=t,{allowUnmatched:s,outputValues:r,noDataRanges:o}=this.functionArguments;if((0,i.pC)(n)&&n.length&&!s){let t=r[0],e=t;for(let n=0;n<r.length;n++)t=t>r[n]?r[n]:t,e=e>r[n]?e:r[n];for(let s=0;s<n.length;s++)n[s]={...n[s],min:t,max:e}}return this.rasterInfo=t,this.lookup=s?null:(0,F.oB)(e,this.functionArguments.inputRanges,r),{success:!0,supportsGPU:(!r||r.length<=F.hd)&&(!o||o.length<=F.hd)}}_processPixels(t){const e=t.pixelBlocks?.[0];if((0,i.Wi)(e))return null;const{lookup:n,outputPixelType:s}=this;if(n)return(0,F.XV)(e,{lut:[n.lut],offset:n.offset,outputPixelType:s});const{inputRanges:r,outputValues:o,noDataRanges:a,allowUnmatched:u}=this.functionArguments;return(0,F.a2)(e,{inputRanges:r,outputValues:o,noDataRanges:a,allowUnmatched:u,outputPixelType:s})}_getWebGLParameters(){const{inputRanges:t,outputValues:e,noDataRanges:n}=this.functionArguments,s=new Float32Array(3*F.hd);if(t?.length){let n=0,r=0;for(let o=0;o<s.length;o+=3)s[o]=t[n++]??Fe._3-1,s[o+1]=t[n++]??Fe._3,s[o+2]=e[r++]??0}const r=new Float32Array(2*F.hd);return r.fill(Fe._3),n?.length&&r.set(n),{rangeMaps:s,noDataRanges:r}}};(0,o._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],Ve.prototype,"functionName",void 0),(0,o._)([(0,a.Cb)({type:Ze,json:{write:!0,name:"rasterFunctionArguments"}})],Ve.prototype,"functionArguments",void 0),(0,o._)([(0,a.Cb)()],Ve.prototype,"rasterArgumentNames",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],Ve.prototype,"lookup",void 0),Ve=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.RemapFunction")],Ve);const We=Ve;var Ue;const He=new _.X({1:"degree",2:"percent-rise",3:"adjusted"},{useNumericKeys:!0});let qe=Ue=class extends p{constructor(){super(...arguments),this.slopeType="degree",this.zFactor=1,this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.removeEdgeEffect=!1}clone(){return new Ue({slopeType:this.slopeType,zFactor:this.zFactor,pixelSizePower:this.pixelSizePower,pixelSizeFactor:this.pixelSizeFactor,raster:this.raster})}};(0,o._)([(0,C.J)(He)],qe.prototype,"slopeType",void 0),(0,o._)([(0,a.Cb)({type:Number,json:{write:!0}})],qe.prototype,"zFactor",void 0),(0,o._)([(0,a.Cb)({type:Number,json:{name:"psPower",write:!0}})],qe.prototype,"pixelSizePower",void 0),(0,o._)([(0,a.Cb)({type:Number,json:{name:"psZFactor",write:!0}})],qe.prototype,"pixelSizeFactor",void 0),(0,o._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],qe.prototype,"removeEdgeEffect",void 0),qe=Ue=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.SlopeFunctionArguments")],qe);const Xe=qe;let Je=class extends y{constructor(){super(...arguments),this.functionName="Slope",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,t.statistics="percent-rise"!==this.functionArguments.slopeType?[{min:0,max:90,avg:1,stddev:1}]:null,t.histograms=null,t.bandCount=1,this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if((0,i.Wi)(e))return null;const{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:o}=this.functionArguments,{isGCS:a}=this,{extent:u}=t,l=u?{x:u.width/e.width,y:u.height/e.height}:{x:1,y:1};return(0,x.yg)(e,{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:o,isGCS:a,resolution:l})}_getWebGLParameters(){const{zFactor:t,slopeType:e,pixelSizeFactor:n,pixelSizePower:s}=this.functionArguments;return{zFactor:this.isGCS&&t>=1?900900900900901e-20*t:t,slopeType:e,pixelSizeFactor:n??0,pixelSizePower:s??0}}};(0,o._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],Je.prototype,"functionName",void 0),(0,o._)([(0,a.Cb)({type:Xe,json:{write:!0,name:"rasterFunctionArguments"}})],Je.prototype,"functionArguments",void 0),(0,o._)([(0,a.Cb)()],Je.prototype,"rasterArgumentNames",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],Je.prototype,"isGCS",void 0),Je=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.SlopeFunction")],Je);const Ye=Je;var $e;let Ke=$e=class extends p{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(t,e){if(!t?.length)return null;const n=[];return t.forEach((t=>{const e={min:t.min,max:t.max,avg:t.avg??t.mean,stddev:t.stddev??t.standardDeviation};n.push(e)})),n}writeStatistics(t,e,n){if(!t?.length)return;const s=[];t.forEach((t=>{const e={...t,mean:t.avg,standardDeviation:t.stddev};delete e.avg,delete e.stddev,s.push(e)})),e[n]=s}clone(){return new $e({statistics:(0,v.d9)(this.statistics),histograms:(0,v.d9)(this.histograms)})}};(0,o._)([(0,a.Cb)({json:{write:!0}})],Ke.prototype,"statistics",void 0),(0,o._)([(0,L.r)("statistics")],Ke.prototype,"readStatistics",null),(0,o._)([(0,K.c)("statistics")],Ke.prototype,"writeStatistics",null),(0,o._)([(0,a.Cb)({json:{write:!0}})],Ke.prototype,"histograms",void 0),Ke=$e=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.StatisticsHistogramFunctionArguments")],Ke);const Qe=Ke;let tn=class extends y{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone(),{statistics:n,histograms:s}=this.functionArguments;return s&&(e.histograms=s),n&&(e.statistics=n),this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};(0,o._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],tn.prototype,"functionName",void 0),(0,o._)([(0,a.Cb)({type:Qe,json:{write:!0,name:"rasterFunctionArguments"}})],tn.prototype,"functionArguments",void 0),(0,o._)([(0,a.Cb)()],tn.prototype,"rasterArgumentNames",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],tn.prototype,"indexedColormap",void 0),(0,o._)([(0,a.Cb)()],tn.prototype,"isNoopProcess",void 0),tn=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.StatisticsHistogramFunction")],tn);const en=tn;var nn;const sn=new _.X({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let rn=nn=class extends p{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(t,e,n){t?.length&&(Array.isArray(t[0])||(t=t.map((t=>[t.min,t.max,t.avg,t.stddev]))),e[n]=t)}clone(){return new nn({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:(0,v.d9)(this.statistics),gamma:(0,v.d9)(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:(0,v.d9)(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};(0,o._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],rn.prototype,"computeGamma",void 0),(0,o._)([(0,a.Cb)({type:Boolean,json:{name:"dra",write:!0}})],rn.prototype,"dynamicRangeAdjustment",void 0),(0,o._)([(0,a.Cb)({type:[Number],json:{write:!0}})],rn.prototype,"gamma",void 0),(0,o._)([(0,a.Cb)()],rn.prototype,"histograms",void 0),(0,o._)([(0,a.Cb)({type:Number,json:{write:!0}})],rn.prototype,"maxPercent",void 0),(0,o._)([(0,a.Cb)({type:Number,json:{write:!0}})],rn.prototype,"minPercent",void 0),(0,o._)([(0,a.Cb)({type:Number,json:{write:!0}})],rn.prototype,"numberOfStandardDeviations",void 0),(0,o._)([(0,a.Cb)({type:Number,json:{name:"max",write:!0}})],rn.prototype,"outputMax",void 0),(0,o._)([(0,a.Cb)({type:Number,json:{name:"min",write:!0}})],rn.prototype,"outputMin",void 0),(0,o._)([(0,a.Cb)({type:Number,json:{write:!0}})],rn.prototype,"sigmoidStrengthLevel",void 0),(0,o._)([(0,a.Cb)({json:{type:[[Number]],write:!0}})],rn.prototype,"statistics",void 0),(0,o._)([(0,K.c)("statistics")],rn.prototype,"writeStatistics",null),(0,o._)([(0,C.J)(sn)],rn.prototype,"stretchType",void 0),(0,o._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],rn.prototype,"useGamma",void 0),rn=nn=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.StretchFunctionArguments")],rn);const on=rn;var an=n(15612);let un=class extends y{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;const t=this.sourceRasterInfos[0],{pixelType:e}=t,{functionArguments:n}=this,{dynamicRangeAdjustment:s,gamma:r,useGamma:o}=n;if(!s&&["u8","u16","s8","s16"].includes(e)){const s=(0,an.AV)(n.toJSON(),{rasterInfo:t});this.lookup=(0,an.hE)({pixelType:e,...s,gamma:o?r:null}),this.cutOffs=s}else s||(this.cutOffs=(0,an.AV)(n.toJSON(),{rasterInfo:t}));this.outputPixelType=this._getOutputPixelType(e);const i=t.clone();return i.pixelType=this.outputPixelType,i.statistics=null,i.histograms=null,"u8"===this.outputPixelType&&(i.keyProperties.DataType="processed"),this.rasterInfo=i,{success:!0,supportsGPU:!s}}_processPixels(t){const e=t.pixelBlocks?.[0];if((0,i.Wi)(e))return e;const{lookup:n}=this;if(n)return(0,F.XV)(e,{...n,outputPixelType:this.rasterInfo.pixelType});const{functionArguments:s}=this,r=this.cutOffs||(0,an.AV)(s.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:e}),o=s.useGamma?s.gamma:null;return(0,an.dy)(e,{...r,gamma:o,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const{outputMin:t=0,outputMax:e=255,gamma:n,useGamma:s}=this.functionArguments,r=this.rasterInfo.bandCount>=2?3:1,o=s&&n&&n.length?(0,an.um)(r,n):[1,1,1],{minCutOff:i,maxCutOff:a}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};1===i.length&&(i[1]=i[2]=i[0],a[1]=a[2]=a[0]);const u=new Float32Array(r);let l;for(l=0;l<r;l++)u[l]=(e-t)/(a[l]-i[l]);return{bandCount:r,outMin:t,outMax:e,minCutOff:i,maxCutOff:a,factor:u,useGamma:s,gamma:s&&n?n:[1,1,1],gammaCorrection:s&&o?o:[1,1,1],stretchType:this.functionArguments.stretchType,type:"stretch"}}};(0,o._)([(0,a.Cb)({json:{write:!0,name:"rasterFunction"}})],un.prototype,"functionName",void 0),(0,o._)([(0,a.Cb)({type:on,json:{write:!0,name:"rasterFunctionArguments"}})],un.prototype,"functionArguments",void 0),(0,o._)([(0,a.Cb)()],un.prototype,"rasterArgumentNames",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],un.prototype,"lookup",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],un.prototype,"cutOffs",void 0),un=(0,o._)([(0,u.j)("esri.layers.support.rasterFunctions.StretchFunction")],un);const ln=un,cn=new Map;function pn(t,e){if(e=e??{},"function"in t&&"arguments"in t&&t.arguments&&(t=function(t,e){e&&mn(t,e);const n={};return yn(t,n),n}(t,e)),"rasterFunction"in t)return hn(t=fn(t),e);throw new r.Z("raster-function-helper","unsupported raster function json.")}function fn(t){const{rasterFunctionArguments:e}=t,n={};for(const t in e){let s=e[t];switch(s&&"object"==typeof s&&s.rasterFunction&&s.rasterFunctionArguments&&(s=fn(s)),t.toLowerCase()){case"dra":n.dra=s;break;case"pspower":n.psPower=s;break;case"pszfactor":n.psZFactor=s;break;case"bandids":n.bandIds=s;break;default:n[t[0].toLowerCase()+t.slice(1)]=s}}return{...t,rasterFunctionArguments:n}}function hn(t,e){const{rasterFunction:n,rasterFunctionArguments:s}=t,o=t.outputPixelType?.toLowerCase();if(null==n||!cn.has(n))throw new r.Z("raster-function-helper",`unsupported raster function: ${n}`);const i=cn.get(n),a=("function"==typeof i.ctor?i.ctor:i.ctor.default).fromJSON({...t,outputPixelType:o}),{rasterArgumentNames:u}=a,l=[],c=function(t,e){return"rasters"===e[0]&&Array.isArray(t.rasters)?t.rasters:e.map((e=>t[e]))}(s,u),p="rasters"===u[0],f=[];for(let t=0;t<c.length;t++){const n=c[t];let s;null==n||"string"==typeof n&&n.startsWith("$")?l.push(e?.raster):"string"==typeof n?e[n]&&l.push(e[n]):"number"!=typeof n&&"rasterFunction"in n&&(s=hn(n,e),p||(a.functionArguments[u[t]]=s),l.push(s)),p&&f.push(s??n)}if(p&&(a.functionArguments.rasters=f),e){a.sourceRasters=l;const t=e.raster?.url;t&&(a.mainPrimaryRasterId=t)}return a}function mn(t,e){if(t&&e)for(const n in t){const s=t[n];s&&"object"==typeof s&&(s.function&&s.arguments?mn(s.arguments,e):"RasterFunctionVariable"===s.type&&null!=e[s.name]&&(s.value=e[s.name]))}}function dn(t){if(!t||"object"!=typeof t)return t;if(Array.isArray(t)&&0===t.length)return 0===t.length?null:["number","string"].includes(typeof t[0])?t:t.map((t=>dn(t)));if("value"in t&&["number","string","boolean"].includes(typeof t.value))return t.value;if(!("type"in t))return t;switch(t.type){case"Scalar":return t.value;case"AlgorithmicColorRamp":return gn(t);case"MultiPartColorRamp":return{type:"multipart",colorRamps:t.ArrayOfColorRamp.map(gn)};case"ArgumentArray":return t.elements?.length?"RasterStatistics"===t.elements[0].type?t.elements:"RasterFunctionVariable"===t.elements[0].type?t.elements.map((t=>null!=t.value?dn(t.value):t.name.toLowerCase().includes("raster")?"$$":null)):t:t.elements;default:return t}}function gn(t){const e=t.algorithm??"esriHSVAlgorithm";let{FromColor:n,ToColor:r}=t;if(!Array.isArray(n)){const{r:t,g:e,b:r}=(0,s.xr)({h:n.Hue,s:n.Saturation,v:n.Value});n=[t,e,r,n.AlphaValue]}if(!Array.isArray(r)){const{r:t,g:e,b:n}=(0,s.xr)({h:r.Hue,s:r.Saturation,v:r.Value});r=[t,e,n,r.AlphaValue]}return{type:"algorithmic",algorithm:e,fromColor:n,toColor:r}}function yn(t,e){if(!t||!e)return;const{function:n,arguments:s}=t;if(!n||!s)return;e.rasterFunction=n.type.replace("Function",""),e.outputPixelType=n.pixelType;const r={};e.rasterFunctionArguments=r;for(const t in s){const n=s[t];"object"==typeof n&&("function"in n&&n.function&&n.arguments?(e.rasterFunctionArguments[t]={},yn(n,e.rasterFunctionArguments[t])):"value"in n&&(r[t]=dn(n.value)))}switch(r.DEM&&!r.Raster&&(r.Raster=r.DEM,delete r.DEM),e.rasterFunction){case"Stretch":!function(t){t.Statistics?.length&&"object"==typeof t.Statistics&&(t.Statistics=t.Statistics.map((t=>[t.min,t.max,t.mean,t.standardDeviation]))),null!=t.NumberOfStandardDeviation&&(t.NumberOfStandardDeviations=t.NumberOfStandardDeviation,delete t.NumberOfStandardDeviation)}(r);break;case"Colormap":!function(t){"randomcolorramp"===t.ColorRamp?.type?.toLowerCase()&&(delete t.ColorRamp,t.ColormapName="Random"),0===t.ColorSchemeType&&delete t.ColorRamp}(r);break;case"Convolution":!function(t){null!=t.ConvolutionType&&(t.Type=t.ConvolutionType,delete t.ConvolutionType)}(r);break;case"Mask":!function(t){t.NoDataValues?.length&&"string"==typeof t.NoDataValues[0]&&(t.NoDataValues=t.NoDataValues.filter((t=>""!==t)).map((t=>Number(t))))}(r)}}cn.set("Aspect",{desc:"Aspect Function",ctor:w,rasterArgumentNames:["raster"]}),cn.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:z,rasterArgumentNames:["raster"]}),cn.set("Colormap",{desc:"Colormap Function",ctor:Y,rasterArgumentNames:["raster"]}),cn.set("CompositeBand",{desc:"CompositeBand Function",ctor:nt,rasterArgumentNames:["rasters"]}),cn.set("Convolution",{desc:"Convolution Function",ctor:ht,rasterArgumentNames:["raster"]}),cn.set("ExtractBand",{desc:"ExtractBand Function",ctor:xt,rasterArgumentNames:["raster"]}),cn.set("Local",{desc:"Local Function",ctor:Pe,rasterArgumentNames:["rasters"]}),cn.set("Mask",{desc:"Mask Function",ctor:ke,rasterArgumentNames:["raster"]}),cn.set("NDVI",{desc:"NDVI Function",ctor:ze,rasterArgumentNames:["raster"]}),cn.set("Remap",{desc:"Remap Function",ctor:We,rasterArgumentNames:["raster"]}),cn.set("Slope",{desc:"Slope Function",ctor:Ye,rasterArgumentNames:["raster"]}),cn.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:en,rasterArgumentNames:["raster"]}),cn.set("Stretch",{desc:"Stretch Function",ctor:ln,rasterArgumentNames:["raster"]})},73506:(t,e,n)=>{n.d(e,{Hq:()=>D,Mk:()=>m,P_:()=>E,Qp:()=>z,VO:()=>C,kZ:()=>Z,kr:()=>V,nF:()=>A,tB:()=>M,ut:()=>k,zD:()=>v}),n(66577);var s,r,o=n(20102),i=n(70586),a=n(67900),u=n(83305),l=n(44547),c=n(6570),p=n(94139),f=n(38913),h=n(82971);function m(t,e,n){return!(0,l.Up)(t,e,n)}function d(t,e,n){const s=m(t,e,n);if(s&&!(0,l.kR)())throw new o.Z("rasterprojectionhelper-project","projection engine is not loaded");return s}(r=s||(s={}))[r.None=0]="None",r[r.North=1]="North",r[r.South=2]="South",r[r.Both=3]="Both";const g=(t,e,n,s=0)=>{if(1===n[0])return[0,0];let r=1,o=-1,i=1,a=-1;for(let e=0;e<t.length;e+=2)isNaN(t[e])||(r=r>t[e]?t[e]:r,o=o>t[e]?o:t[e],i=i>t[e+1]?t[e+1]:i,a=a>t[e+1]?a:t[e+1]);const{cols:u,rows:l}=e,c=(o-r)/u/n[0],p=(a-i)/l/n[1],f=2*s;let h=0,m=!1,d=[0,0];for(let e=0;e<u-3;e++){for(let n=0;n<l-3;n++){const s=e*l*2+2*n,r=(t[s]+t[s+4]+t[s+4*l]+t[s+4*l+4])/4,o=(t[s+1]+t[s+5]+t[s+4*l+1]+t[s+4*l+5])/4,i=Math.abs((r-t[s+2*l+2])/c),a=Math.abs((o-t[s+2*l+3])/p);if(i+a>h&&(h=i+a,d=[i,a]),f&&h>f){m=!0;break}}if(m)break}return d},y={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},x=new Map,b=new Map,w=500;async function v(){(0,l.kR)()||await(0,l.zD)()}function C(t,e,n,s=null){const r=t.spatialReference;if(r.equals(e))return t;d(r,e,s);const o=n.center,u=new c.Z({xmin:o.x-t.x/2,xmax:o.x+t.x/2,ymin:o.y-t.y/2,ymax:o.y+t.y/2,spatialReference:r}),p=(0,l.iV)(u,e,s),f=k(e);let h;if((0,i.Wi)(p)||(0,i.pC)(f)&&p.width>=f){const n=(0,a.c9)(r)/(0,a.c9)(e);h={x:t.x*n,y:t.y*n}}else h={x:p.width,y:p.height};return h}function _(t,e=.01){return(0,a.c9)(t)?e/(0,a.c9)(t):0}function A(t,e,n=null,s=!0){const r=t.spatialReference;if(r.equals(e))return t;d(r,e,n);const o=(0,l.iV)(t,e,n);return s&&o?(S([t],[o],r,e),o):o}function S(t,e,n,s){const r=j(n,!0),o=j(s,!0),a=_(n,w),u=_(s,w);if(a&&(0,i.pC)(r)&&(0,i.pC)(o))for(let n=0;n<t.length;n++){const s=e[n];if(!s)continue;const{x:i}=t[n],{x:l}=s;l>=o[1]-u&&Math.abs(i-r[0])<a?s.x-=o[1]-o[0]:l<=o[0]+u&&Math.abs(i-r[1])<a&&(s.x+=o[1]-o[0])}}function N(t){const{inSR:e,outSR:n,datumTransformation:s,preferPE:r}=t;if(e.equals(n)){const{points:e}=F(t,null);return e}if(e.isWebMercator&&n.isWGS84||e.isWGS84&&n.isWebMercator)return function(t){const{cols:e,rows:n,xres:s,yres:r,usePixelCenter:o,inSR:i,outSR:a}=t;let{xmin:u,ymax:c}=t;o&&(u+=s/2,c-=r/2);const f=[],h=[],m=Math.max(e,n);for(let t=0;t<m;t++){const o=u+s*Math.min(e,t),m=c-r*Math.min(n,t),d=(0,l.iV)(new p.Z({x:o,y:m,spatialReference:i}),a);t<=e&&f.push(d.x),t<=n&&h.push(d.y)}const d=[];for(let t=0;t<e;t++)for(let e=0;e<n;e++)d.push([f[t],h[e]]);return d}(t);if(d(e,n,s)&&r){if(e.isGeographic)return R(t);const n=P(e);if((0,i.pC)(n))return R(t)}return function(t){const{points:e}=F(t,null),{inSR:n,outSR:s,datumTransformation:r}=t,o=e.map((t=>new p.Z(t[0],t[1],n))),i=(0,l.iV)(o,s,r);return r&&S(o,i,n,s),i.map((t=>t?[t.x,t.y]:[NaN,NaN]))}(t)}function R(t){const{inSR:e,outSR:n,datumTransformation:s}=t,r=P(e),{points:o,mask:a}=F(t,r);if(!e.isGeographic){const t=e.wkid?u.e.coordsys(e.wkid):u.e.fromString(e.isGeographic?u.f.PE_TYPE_GEOGCS:u.f.PE_TYPE_PROJCS,e.wkt);u.g.projToGeog(t,o.length,o)}if((0,i.pC)(s)&&s.steps.length){let t;const e=179.9955;if(n.isGeographic&&(t=o.map((([t])=>t>e?1:t<-e?-1:0))),s.steps.forEach((t=>{const e=t.wkid?u.e.geogtran(t.wkid):u.e.fromString(u.f.PE_TYPE_GEOGTRAN,t.wkt);u.h.geogToGeog(e,o.length,o,null,t.isInverse?u.f.PE_TRANSFORM_2_TO_1:u.f.PE_TRANSFORM_1_TO_2)})),t)for(let n=0;n<o.length;n++){const s=t[n],r=o[n][0],i=r>e?1:r<-e?-1:0;s&&i&&s!==i&&(o[n][0]=s>0?r+360:r-360)}}if(!n.isGeographic){const t=P(n,!0),e=(0,i.pC)(t)&&t.isEnvelope?[t.bbox[1],t.bbox[3]]:[-90,90];!function(t,e){const[n,s]=e;for(let e=0;e<t.length;e++){const r=t[e][1];(r<n||r>s)&&(t[e]=[NaN,NaN])}}(o,e);const s=n.wkid?u.e.coordsys(n.wkid):u.e.fromString(n.isGeographic?u.f.PE_TYPE_GEOGCS:u.f.PE_TYPE_PROJCS,n.wkt);u.g.geogToProj(s,o.length,o)}let l=o;if(a&&o.length!==a.length){l=[];for(let t=0,e=0;t<a.length;t++)a[t]?l.push(o[e++]):l.push([NaN,NaN])}return l}function P(t,e=!1){let n=t.wkid||t.wkt;if(!n||t.isGeographic)return null;if(n=String(n),x.has(n)){const t=x.get(n);return e?t?.gcs:t?.pcs}const s=t.wkid?u.e.coordsys(t.wkid):u.e.fromString(t.isGeographic?u.f.PE_TYPE_GEOGCS:u.f.PE_TYPE_PROJCS,t.wkt),r=I(s,_(t,1e-4)),o=I(s,0,!0);return x.set(n,{pcs:r,gcs:o}),e?o:r}function I(t,e=0,n=!1){const s=u.j.generate(t),r=n?t.horizonGcsGenerate():t.horizonPcsGenerate();if(!s||!r?.length)return null;let o=!1,i=r.find((t=>1===t.getInclusive()&&1===t.getKind()));if(!i){if(i=r.find((t=>1===t.getInclusive()&&0===t.getKind())),!i)return null;o=!0}const a=n?0:(2===s.getNorthPoleLocation()?1:0)|(2===s.getSouthPoleLocation()?2:0),l=s.isPannableRectangle(),c=i.getCoord();if(o)return{isEnvelope:o,isPannable:l,vertices:c,coef:null,bbox:[c[0][0]-e,c[0][1]-e,c[1][0]+e,c[1][1]+e],poleLocation:a};let p=0;const f=[];let[h,m]=c[0],[d,g]=c[0];for(let t=0,e=c.length;t<e;t++){p++,p===e&&(p=0);const[n,s]=c[t],[r,o]=c[p];if(o===s)f.push([n,r,s,o,2]);else{const t=(r-n)/(o-s||1e-4),e=n-t*s;s<o?f.push([t,e,s,o,0]):f.push([t,e,o,s,1])}h=h<n?h:n,m=m<s?m:s,d=d>n?d:n,g=g>s?g:s}return{isEnvelope:!1,isPannable:l,vertices:c,coef:f,bbox:[h,m,d,g],poleLocation:a}}function F(t,e){const n=[],{cols:s,rows:r,xres:o,yres:a,usePixelCenter:u}=t;let{xmin:l,ymax:c}=t;if(u&&(l+=o/2,c-=a/2),(0,i.Wi)(e)){for(let t=0;t<s;t++)for(let e=0;e<r;e++)n.push([l+o*t,c-a*e]);return{points:n}}const p=new Uint8Array(s*r);if(e.isEnvelope){const{bbox:[t,i,u,f]}=e;for(let h=0,m=0;h<s;h++){const s=l+o*h,d=e.isPannable||s>=t&&s<=u;for(let t=0;t<r;t++,m++){const e=c-a*t;d&&e>=i&&e<=f&&(n.push([s,e]),p[m]=1)}}return{points:n,mask:p}}const f=e.coef,h=[];for(let t=0;t<r;t++){const e=c-a*t,n=[],s=[];for(let t=0;t<f.length;t++){const[r,o,i,a,u]=f[t];if(e===i&&i===a)n.push(r),n.push(o),s.push(2),s.push(2);else if(e>=i&&e<=a){const t=r*e+o;n.push(t),s.push(u)}}let r=n;if(n.length>2){let t=2===s[0]?0:s[0],e=n[0];r=[];for(let o=1;o<s.length;o++)2===s[o]&&o!==s.length-1||(s[o]!==t&&(r.push(0===t?Math.min(e,n[o-1]):Math.max(e,n[o-1])),t=s[o],e=n[o]),o===s.length-1&&r.push(0===s[o]?Math.min(e,n[o]):Math.max(e,n[o])));r.sort(((t,e)=>t-e))}else n[0]>n[1]&&(r=[n[1],n[0]]);h.push(r)}for(let t=0,e=0;t<s;t++){const s=l+o*t;for(let t=0;t<r;t++,e++){const r=c-a*t,o=h[t];if(2===o.length)s>=o[0]&&s<=o[1]&&(n.push([s,r]),p[e]=1);else if(o.length>2){let t=!1;for(let e=0;e<o.length;e+=2)if(s>=o[e]&&s<=o[e+1]){t=!0;break}t&&(n.push([s,r]),p[e]=1)}}}return{points:n,mask:p}}function T(t){const e=k(t[0].spatialReference);if(t.length<2||(0,i.Wi)(e))return t[0];let{xmin:n,xmax:s,ymin:r,ymax:o}=t[0];for(let n=1;n<t.length;n++){const i=t[n];s=i.xmax+e*n,r=Math.min(r,i.ymin),o=Math.max(o,i.ymax)}return new c.Z({xmin:n,xmax:s,ymin:r,ymax:o,spatialReference:t[0].spatialReference})}function M(t,e,n=null,r=!0){const o=t.spatialReference;if(o.equals(e))return t;const a=D(t),u=k(o,!0),p=k(e);if(0===a||(0,i.Wi)(u)||(0,i.Wi)(p)){const a=B(t,e,n,r);if((0,i.Wi)(u)&&(0,i.pC)(p)&&Math.abs(a.width-p)<_(e)&&(0,l.kR)()){const n=P(o);if((0,i.pC)(n)&&n.poleLocation===s.None&&t.width<(n.bbox[2]-n.bbox[0])/2)return function(t,e){const n=k(e);if((0,i.Wi)(n))return null;let{xmin:s,ymin:r,xmax:o,ymax:a}=t;const u=t.spatialReference,p=new f.Z({spatialReference:u,rings:[[[s,r],[o,r],[o,a],[s,a],[s,r]]]}),h=(0,l.iV)(p,e);if(2!==h.rings.length||!h.rings[0].length||!h.rings[1].length)return null;const{rings:m}=h,d=_(u),g=new c.Z({spatialReference:e});for(let t=0;t<2;t++){s=o=m[t][0][0],r=a=m[t][0][1];for(let e=0;e<m[t].length;e++)s=s>m[t][e][0]?m[t][e][0]:s,o=o<m[t][e][0]?m[t][e][0]:o,r=r>m[t][e][1]?m[t][e][1]:r,a=a<m[t][e][1]?m[t][e][1]:a;if(0===t)g.ymin=r,g.ymax=a,g.xmin=s,g.xmax=o;else if(g.ymin=Math.min(g.ymin,r),g.ymax=Math.max(g.ymax,a),Math.abs(o-n/2)<d)g.xmin=s,g.xmax=g.xmax+n;else{if(!(Math.abs(s+n/2)<d))return null;g.xmax=o+n}}return g}(t,e)||a}return a}const h=t.clone().normalize();if(1===h.length&&t.xmax<u&&t.xmax-u/2>_(o)){const{xmin:e,xmax:n}=t;for(let s=0;s<=a;s++){const r=0===s?e:-u/2,i=s===a?n-u*s:u/2;h[s]=new c.Z({xmin:r,xmax:i,ymin:t.ymin,ymax:t.ymax,spatialReference:o})}}return T(h.map((t=>B(t,e,n,r))).filter(i.pC))}function B(t,e,n=null,s=!0,r=!0){const o=t.spatialReference;if(o.equals(e)||!e)return t;d(o,e,n);const a=(0,l.iV)(t,e,n);if(r&&e.isWebMercator&&a&&(a.ymax=Math.min(20037508.342787,a.ymax),a.ymin=Math.max(-20037508.342787,a.ymin),a.ymin>=a.ymax))return null;if(!s||!a)return a;const u=j(o,!0),c=j(e,!0);if((0,i.Wi)(u)||(0,i.Wi)(c))return a;const f=_(o,.001),h=_(o,w),m=_(e,.001);if(Math.abs(a.xmin-c[0])<m&&Math.abs(a.xmax-c[1])<m){const s=Math.abs(t.xmin-u[0]),r=Math.abs(u[1]-t.xmax);if(s<f&&r>h){a.xmin=c[0];const s=[];s.push(new p.Z(t.xmax,t.ymin,o)),s.push(new p.Z(t.xmax,(t.ymin+t.ymax)/2,o)),s.push(new p.Z(t.xmax,t.ymax,o));const r=s.map((t=>A(t,e,n))).filter((t=>!isNaN(t?.x))).map((t=>t.x));a.xmax=Math.max.apply(null,r)}if(r<f&&s>h){a.xmax=c[1];const s=[];s.push(new p.Z(t.xmin,t.ymin,o)),s.push(new p.Z(t.xmin,(t.ymin+t.ymax)/2,o)),s.push(new p.Z(t.xmin,t.ymax,o));const r=s.map((t=>A(t,e,n))).filter((t=>!isNaN(t?.x))).map((t=>t.x));a.xmin=Math.min.apply(null,r)}}else{const t=_(e,.001);Math.abs(a.xmin-c[0])<t&&(a.xmin=c[0]),Math.abs(a.xmax-c[1])<t&&(a.xmax=c[1])}return a}function k(t,e=!1){if(!t)return null;const n=e?20037508.342787:20037508.342788905;return t.isWebMercator?2*n:t.wkid&&t.isGeographic?360:2*y[t.wkid]||null}function j(t,e=!1){if(t.isGeographic)return[-180,180];const n=k(t,e);return(0,i.pC)(n)?[-n/2,n/2]:null}function G(t,e,n,s){let r=(t-e)/n;return r-Math.floor(r)!=0?r=Math.floor(r):s&&(r-=1),r}function D(t,e=!1){const n=k(t.spatialReference);if((0,i.Wi)(n))return 0;const s=e?0:-n/2,r=_(t.spatialReference),o=!e&&Math.abs(t.xmax-n/2)<r?n/2:t.xmax,a=!e&&Math.abs(t.xmin+n/2)<r?-n/2:t.xmin;return G(o,s,n,!0)-G(a,s,n,!1)}function E(t){const e=t.storageInfo.origin.x,n=k(t.spatialReference,!0);if((0,i.Wi)(n))return{originX:e,halfWorldWidth:null,pyramidsInfo:null};const s=n/2,{nativePixelSize:r,storageInfo:o,extent:a}=t,{maximumPyramidLevel:u,blockWidth:l,pyramidScalingFactor:c}=o;let p=r.x;const f=[],h=(0,i.pC)(t.transform)&&"gcs-shift"===t.transform.type,m=e+(h?0:s),d=h?n-e:s-e;for(let t=0;t<=u;t++){const t=(a.xmax-e)/p/l,n=t-Math.floor(t)==0?t:Math.ceil(t),s=d/p/l,r=s-Math.floor(s)==0?s:Math.ceil(s),o=Math.floor(m/p/l),i=Math.round(m/p)%l,u=(l-Math.round(d/p)%l)%l;f.push({resolutionX:p,blockWidth:l,datsetColumnCount:n,worldColumnCountFromOrigin:r,leftMargin:i,rightPadding:u,originColumnOffset:o}),p*=c}return{originX:e,halfWorldWidth:s,pyramidsInfo:f,hasGCSSShiftTransform:h}}function z(t){const e=t.isAdaptive&&null==t.spacing;let n=t.spacing||[32,32],s=O(t),r={cols:s.size[0]+1,rows:s.size[1]+1};const o=s.outofBoundPointCount>0&&s.outofBoundPointCount<s.offsets.length/2;let a=s.outofBoundPointCount===s.offsets.length/2||e&&o?[0,0]:g(s.offsets,r,n,4);const l=(a[0]+a[1])/2,c=t.projectedExtent.spatialReference,p=t.srcBufferExtent.spatialReference;if(e&&(o||l>4)&&(m(c,p,t.datumTransformation)&&(c.isGeographic||(0,i.pC)(P(c))),n=[4,4],s=O({...t,spacing:n}),r={cols:s.size[0]+1,rows:s.size[1]+1},a=g(s.offsets,r,n,4)),s.error=a,n[0]>1&&(s.coefficients=L(s.offsets,r,o)),t.includeGCSGrid&&!c.isGeographic&&!c.isWebMercator)if(p.isGeographic)s.gcsGrid={offsets:s.offsets,coefficients:s.coefficients,spacing:n};else{const e=P(c);if((0,i.pC)(e)&&!e.isEnvelope){const e=function(t){if(!t||t.isGeographic)return t;const e=String(t.wkid||t.wkt);let n;return b.has(e)?n=b.get(e):(n=(t.wkid?u.e.coordsys(t.wkid):u.e.fromString(u.f.PE_TYPE_PROJCS,t.wkt)).getGeogcs().getCode(),b.set(e,n)),new h.Z({wkid:n})}(c),i=M(t.projectedExtent,e),{offsets:a}=O({...t,srcBufferExtent:i,spacing:n}),l=L(a,r,o);s.gcsGrid={offsets:a,coefficients:l,spacing:n}}}return s}function O(t){const{projectedExtent:e,srcBufferExtent:n,pixelSize:s,datumTransformation:r,rasterTransform:o}=t,a=e.spatialReference,u=n.spatialReference,l=d(a,u),{xmin:c,ymin:f,xmax:h,ymax:m}=e,g=k(u),y=(0,i.pC)(g)&&(t.hasWrapAround||"gcs-shift"===o?.type),x=t.spacing||[32,32],b=x[0]*s.x,v=x[1]*s.y,C=1===x[0],A=Math.ceil((h-c)/b-.1/x[0])+(C?0:1),S=Math.ceil((m-f)/v-.1/x[1])+(C?0:1),R=N({cols:A,rows:S,xmin:c,ymax:m,xres:b,yres:v,inSR:a,outSR:u,datumTransformation:r,preferPE:x[0]<=4,usePixelCenter:C}),I=[];let F,T=0;const M=C?-1:NaN,{xmin:B,xmax:j,ymax:G,width:D,height:E}=n,z=_(u,w),O=(0,i.pC)(g)&&B>0&&j>g/2;let L=!1;if(l){const t=P(a);L=(0,i.pC)(t)&&t.poleLocation>0}for(let t=0;t<A;t++){const e=[];for(let n=0;n<S;n++){let s=R[t*S+n];if(y&&s[0]>j&&s[0]>g/2-z?s[0]-=g:y&&0===t&&s[0]<0&&O&&!o&&(s[0]+=g),!s||isNaN(s[0])||isNaN(s[1]))I.push(M),I.push(M),e.push(null),T++;else{if(o){const t=o.inverseTransform(new p.Z({x:s[0],y:s[1],spatialReference:u}));s=[t.x,t.y]}e.push(s),t>0&&y&&F[n]&&s[0]<F[n][0]&&(s[0]+=g,L&&s[0]>j&&s[0]>g&&(s[0]-=g)),I.push((s[0]-B)/D),I.push((G-s[1])/E)}}F=e}return{offsets:I,error:null,coefficients:null,outofBoundPointCount:T,spacing:x,size:C?[A,S]:[A-1,S-1]}}function L(t,e,n){const{cols:s,rows:r}=e,o=new Float32Array((s-1)*(r-1)*2*6),i=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let e=0;e<s-1;e++){for(let n=0;n<r-1;n++){let u=e*r*2+2*n;const l=t[u],c=t[u+1],p=t[u+2],f=t[u+3];u+=2*r;const h=t[u],m=t[u+1],d=t[u+2],g=t[u+3];let y=0,x=12*(n*(s-1)+e);for(let t=0;t<3;t++)o[x++]=i[y++]*l+i[y++]*p+i[y++]*d;y=0;for(let t=0;t<3;t++)o[x++]=i[y++]*c+i[y++]*f+i[y++]*g;y=0;for(let t=0;t<3;t++)o[x++]=a[y++]*l+a[y++]*h+a[y++]*d;y=0;for(let t=0;t<3;t++)o[x++]=a[y++]*c+a[y++]*m+a[y++]*g}if(n)for(let t=0;t<o.length;t++)isNaN(o[t])&&(o[t]=-1)}return o}function Z(t){const e=t.clone().normalize();return 1===e.length?e[0]:T(e)}function V(t,e,n){const{storageInfo:s,pixelSize:r}=e;let o=0,u=!1;const{pyramidResolutions:l}=s;if((0,i.pC)(l)&&l.length){const s=(t.x+t.y)/2,i=l[l.length-1],c=(i.x+i.y)/2,f=(r.x+r.y)/2;if(s<=f)o=0;else if(s>=c)o=l.length,u=s/c>8;else{let t,e=f;for(let r=1;r<=l.length;r++){if(t=(l[r-1].x+l[r-1].y)/2,s<=t){s===t?o=r:"down"===n?(o=r-1,u=s/e>8):o="up"===n||s-e>t-s||s/e>2?r:r-1;break}e=t}}const h=0===o?r:l[o-1];return u&&Math.min(h.x,h.y)*(0,a.c9)(e.spatialReference)>19567&&(u=!1),{pyramidLevel:o,pyramidResolution:new p.Z({x:h.x,y:h.y,spatialReference:e.spatialReference}),excessiveReading:u}}const c=Math.log(t.x/r.x)/Math.LN2,f=Math.log(t.y/r.y)/Math.LN2,h=e.storageInfo.maximumPyramidLevel||0;o="down"===n?Math.floor(Math.min(c,f)):"up"===n?Math.ceil(Math.max(c,f)):Math.round((c+f)/2),o<0?o=0:o>h&&(u=o>h+3,o=h);const m=2**o;return{pyramidLevel:o,pyramidResolution:new p.Z({x:m*e.nativePixelSize.x,y:m*e.nativePixelSize.y,spatialReference:e.spatialReference}),excessiveReading:u}}},48700:(t,e,n)=>{n.d(e,{Z:()=>u});var s=n(43697),r=n(96674),o=n(5600),i=(n(75215),n(67676),n(52011));let a=class extends r.wq{get affectsPixelSize(){return!1}forwardTransform(t){return t}inverseTransform(t){return t}};(0,s._)([(0,o.Cb)()],a.prototype,"affectsPixelSize",null),(0,s._)([(0,o.Cb)({json:{write:!0}})],a.prototype,"spatialReference",void 0),a=(0,s._)([(0,i.j)("esri.layers.support.rasterTransforms.BaseRasterTransform")],a);const u=a},29680:(t,e,n)=>{n.d(e,{Z:()=>l});var s=n(43697),r=n(5600),o=(n(75215),n(67676),n(36030)),i=n(52011),a=n(48700);let u=class extends a.Z{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(t){return"point"===(t=t.clone()).type?(t.x>180+this.tolerance&&(t.x-=360),t):(t.xmin>=180-this.tolerance?(t.xmax-=360,t.xmin-=360):t.xmax>180+this.tolerance&&(t.xmin=-180,t.xmax=180),t)}inverseTransform(t){return"point"===(t=t.clone()).type?(t.x<-this.tolerance&&(t.x+=360),t):(t.xmin<-this.tolerance&&(t.xmin+=360,t.xmax+=360),t)}};(0,s._)([(0,o.J)({GCSShiftXform:"gcs-shift"})],u.prototype,"type",void 0),(0,s._)([(0,r.Cb)()],u.prototype,"tolerance",void 0),u=(0,s._)([(0,i.j)("esri.layers.support.rasterTransforms.GCSShiftTransform")],u);const l=u},87390:(t,e,n)=>{n.d(e,{Z:()=>d});var s=n(43697),r=(n(66577),n(5600)),o=(n(75215),n(67676),n(36030)),i=n(71715),a=n(52011),u=n(30556),l=n(48700),c=n(94139),p=n(6570);function f(t,e,n){const{x:s,y:r}=e;if(n<2)return{x:t[0]+s*t[2]+r*t[4],y:t[1]+s*t[3]+r*t[5]};if(2===n){const e=s*s,n=r*r,o=s*r;return{x:t[0]+s*t[2]+r*t[4]+e*t[6]+o*t[8]+n*t[10],y:t[1]+s*t[3]+r*t[5]+e*t[7]+o*t[9]+n*t[11]}}const o=s*s,i=r*r,a=s*r,u=o*s,l=o*r,c=s*i,p=r*i;return{x:t[0]+s*t[2]+r*t[4]+o*t[6]+a*t[8]+i*t[10]+u*t[12]+l*t[14]+c*t[16]+p*t[18],y:t[1]+s*t[3]+r*t[5]+o*t[7]+a*t[9]+i*t[11]+u*t[13]+l*t[15]+c*t[17]+p*t[19]}}function h(t,e,n){const{xmin:s,ymin:r,xmax:o,ymax:i,spatialReference:a}=e;let u=[];if(n<2)u.push({x:s,y:i}),u.push({x:o,y:i}),u.push({x:s,y:r}),u.push({x:o,y:r});else{let t=10;for(let e=0;e<t;e++)u.push({x:s,y:r+(i-r)*e/(t-1)}),u.push({x:o,y:r+(i-r)*e/(t-1)});t=8;for(let e=1;e<=t;e++)u.push({x:s+(o-s)*e/t,y:r}),u.push({x:s+(o-s)*e/t,y:i})}u=u.map((e=>f(t,e,n)));const l=u.map((t=>t.x)),c=u.map((t=>t.y));return new p.Z({xmin:Math.min.apply(null,l),xmax:Math.max.apply(null,l),ymin:Math.min.apply(null,c),ymax:Math.max.apply(null,c),spatialReference:a})}let m=class extends l.Z{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(t,e){const{coeffX:n,coeffY:s}=e;if(!n?.length||!s?.length||n.length!==s.length)return null;const r=[];for(let t=0;t<n.length;t++)r.push(n[t]),r.push(s[t]);return r}writeForwardCoefficients(t,e,n){const s=[],r=[];for(let e=0;e<t?.length;e++)e%2==0?s.push(t[e]):r.push(t[e]);e.coeffX=s,e.coeffY=r}get inverseCoefficients(){let t=this._get("inverseCoefficients");const e=this._get("forwardCoefficients");return!t&&e&&this.polynomialOrder<2&&(t=function(t){const[e,n,s,r,o,i]=t,a=s*i-o*r,u=o*r-s*i;return[(o*n-e*i)/a,(s*n-e*r)/u,i/a,r/u,-o/a,-s/u]}(e)),t}set inverseCoefficients(t){this._set("inverseCoefficients",t)}readInverseCoefficients(t,e){const{inverseCoeffX:n,inverseCoeffY:s}=e;if(!n?.length||!s?.length||n.length!==s.length)return null;const r=[];for(let t=0;t<n.length;t++)r.push(n[t]),r.push(s[t]);return r}writeInverseCoefficients(t,e,n){const s=[],r=[];for(let e=0;e<t?.length;e++)e%2==0?s.push(t[e]):r.push(t[e]);e.inverseCoeffX=s,e.inverseCoeffY=r}get affectsPixelSize(){return this.polynomialOrder>0}forwardTransform(t){if("point"===t.type){const e=f(this.forwardCoefficients,t,this.polynomialOrder);return new c.Z({x:e.x,y:e.y,spatialReference:t.spatialReference})}return h(this.forwardCoefficients,t,this.polynomialOrder)}inverseTransform(t){if("point"===t.type){const e=f(this.inverseCoefficients,t,this.polynomialOrder);return new c.Z({x:e.x,y:e.y,spatialReference:t.spatialReference})}return h(this.inverseCoefficients,t,this.polynomialOrder)}};(0,s._)([(0,r.Cb)({json:{write:!0}})],m.prototype,"polynomialOrder",void 0),(0,s._)([(0,r.Cb)()],m.prototype,"forwardCoefficients",void 0),(0,s._)([(0,i.r)("forwardCoefficients",["coeffX","coeffY"])],m.prototype,"readForwardCoefficients",null),(0,s._)([(0,u.c)("forwardCoefficients")],m.prototype,"writeForwardCoefficients",null),(0,s._)([(0,r.Cb)({json:{write:!0}})],m.prototype,"inverseCoefficients",null),(0,s._)([(0,i.r)("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],m.prototype,"readInverseCoefficients",null),(0,s._)([(0,u.c)("inverseCoefficients")],m.prototype,"writeInverseCoefficients",null),(0,s._)([(0,r.Cb)()],m.prototype,"affectsPixelSize",null),(0,s._)([(0,o.J)({PolynomialXform:"polynomial"})],m.prototype,"type",void 0),m=(0,s._)([(0,a.j)("esri.layers.support.rasterTransforms.PolynomialTransform")],m);const d=m},87521:(t,e,n)=>{n.d(e,{j:()=>h,c:()=>m});var s=n(29680),r=n(43697),o=(n(92604),n(75215),n(67676),n(20102),n(80442),n(36030)),i=n(52011),a=n(48700);let u=class extends a.Z{constructor(){super(...arguments),this.type="identity"}};(0,r._)([(0,o.J)({IdentityXform:"identity"})],u.prototype,"type",void 0),u=(0,r._)([(0,i.j)("esri.layers.support.rasterTransforms.IdentityTransform")],u);const l=u;var c=n(87390);const p={GCSShiftXform:s.Z,IdentityXform:l,PolynomialXform:c.Z},f=Object.keys(p);function h(t){const e=t?.type;return!t||f.includes(e)}function m(t){const e=t?.type;if(!e)return null;const n=p[t?.type];if(n){const e=new n;return e.read(t),e}return null}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3572,7873],{65845:(e,t,r)=>{r.d(t,{D:()=>s});var o=r(81153);function s(e){e&&e.writtenProperties&&e.writtenProperties.forEach((({target:e,propName:t,newOrigin:r})=>{(0,o.l)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)}))}},81153:(e,t,r)=>{function o(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{l:()=>o})},41123:(e,t,r)=>{r.d(t,{D:()=>s});const o="randomUUID"in crypto;function s(){if(o)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}},69285:(e,t,r)=>{r.d(t,{k:()=>a});var o=r(70586),s=r(67900),i=r(8744);function a(e,t,r){if((0,o.Wi)(t)||(0,o.Wi)(r)||r.vcsWkid||(0,i.fS)(t,r))return null;const a=(0,s._R)(t)/(0,s._R)(r);if(1===a)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){e&&null!=e.z&&(e.z*=t)}(e,a);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const r of e.paths)for(const e of r)e.length>2&&(e[2]*=t)}(e,a);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const r of e.rings)for(const e of r)e.length>2&&(e[2]*=t)}(e,a);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const r of e.points)r.length>2&&(r[2]*=t)}(e,a);case"extent":case"esriGeometryExtent":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,a);default:return null}}},54295:(e,t,r)=>{r.d(t,{V:()=>a});var o=r(43697),s=r(5600),i=(r(75215),r(67676),r(52011));const a=e=>{let t=class extends e{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,o._)([(0,s.Cb)({type:String})],t.prototype,"apiKey",null),t=(0,o._)([(0,i.j)("esri.layers.mixins.APIKeyMixin")],t),t}},17287:(e,t,r)=>{r.d(t,{Y:()=>p});var o=r(43697),s=r(92604),i=r(70586),a=r(5600),n=(r(75215),r(67676),r(52011)),l=r(66677);const p=e=>{let t=class extends e{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,l.Qc)(this.url);if((0,i.pC)(e)&&e.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,l.Nm)(e,s.Z.getLogger(this.declaredClass)))}};return(0,o._)([(0,a.Cb)()],t.prototype,"title",null),(0,o._)([(0,a.Cb)({type:String})],t.prototype,"url",null),t=(0,o._)([(0,n.j)("esri.layers.mixins.ArcGISService")],t),t}},32271:(e,t,r)=>{r.d(t,{xp:()=>k,Vt:()=>j});var o=r(43697),s=r(3172),i=r(20102),a=(r(80442),r(92604)),n=r(70586),l=r(95330),p=r(17452),u=r(5600),c=(r(75215),r(67676),r(71715)),d=r(52011),y=r(30556),h=r(65845),m=r(6570),f=r(79235),v=r(82971),g=r(66677),_=r(21506),b=r(61064),S=r(65587),w=r(15235),x=r(66643),I=r(41123),C=r(97873);async function R(e,t,r){if(!t||!t.resources)return;const o=t.portalItem===e.portalItem?new Set(e.paths):new Set;e.paths.length=0,e.portalItem=t.portalItem;const s=new Set(t.resources.toKeep.map((e=>e.resource.path))),a=new Set,n=[];s.forEach((t=>{o.delete(t),e.paths.push(t)}));for(const i of t.resources.toUpdate)if(o.delete(i.resource.path),s.has(i.resource.path)||a.has(i.resource.path)){const{resource:t,content:o,finish:s,error:a}=i,l=(0,C.getSiblingOfSameTypeI)(t,(0,I.D)());e.paths.push(l.path),n.push(T({resource:l,content:o,compress:i.compress,finish:s,error:a},r))}else e.paths.push(i.resource.path),n.push(N(i,r)),a.add(i.resource.path);for(const o of t.resources.toAdd)n.push(T(o,r)),e.paths.push(o.resource.path);if(o.forEach((e=>{if(t.portalItem){const r=t.portalItem.resourceFromPath(e);n.push(r.portalItem.removeResource(r).catch((()=>{})))}})),0===n.length)return;const p=await(0,l.as)(n);(0,l.k_)(r);const u=p.filter((e=>"error"in e)).map((e=>e.error));if(u.length>0)throw new i.Z("save:resources","Failed to save one or more resources",{errors:u})}async function T(e,t){const r={...(0,n.pC)(t)?t:{},compress:e.compress},o=await(0,x.q6)(e.resource.portalItem.addResource(e.resource,e.content,r));if(!0!==o.ok)throw e.error?.(o.error),o.error;e.finish?.(e.resource)}async function N(e,t){const r=await(0,x.q6)(e.resource.update(e.content,t));if(!0!==r.ok)throw e.error?.(r.error),r.error;e.finish?.(e.resource)}const P="esri.layers.mixins.SceneService",U=a.Z.getLogger(P),j=e=>{let t=class extends e{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.indexInfo=null,this._debouncedSaveOperations=(0,l.Ds)((async(e,t,r)=>{switch(e){case k.SAVE:return this._save(t);case k.SAVE_AS:return this._saveAs(r,t)}}))}readSpatialReference(e,t){return this._readSpatialReference(t)}_readSpatialReference(e){if(null!=e.spatialReference)return v.Z.fromJSON(e.spatialReference);{const t=e.store,r=t.indexCRS||t.geographicCRS,o=r&&parseInt(r.substring(r.lastIndexOf("/")+1,r.length),10);return null!=o?new v.Z(o):null}}readFullExtent(e,t,r){if(null!=e&&"object"==typeof e){const o=null==e.spatialReference?{...e,spatialReference:this._readSpatialReference(t)}:e;return m.Z.fromJSON(o,r)}const o=t.store,s=this._readSpatialReference(t);return null==s||null==o||null==o.extent||!Array.isArray(o.extent)||o.extent.some((e=>e<O))?null:new m.Z({xmin:o.extent[0],ymin:o.extent[1],xmax:o.extent[2],ymax:o.extent[3],spatialReference:s})}parseVersionString(e){const t={major:Number.NaN,minor:Number.NaN,versionString:e},r=e.split(".");return r.length>=2&&(t.major=parseInt(r[0],10),t.minor=parseInt(r[1],10)),t}readVersion(e,t){const r=t.store,o=null!=r.version?r.version.toString():"";return this.parseVersionString(o)}readTitlePortalItem(e){return"item-title"!==this.sublayerTitleMode?void 0:e}readTitleService(e,t){const r=this.portalItem&&this.portalItem.title;if("item-title"===this.sublayerTitleMode)return(0,g.a7)(this.url,t.name);let o=t.name;if(!o&&this.url){const e=(0,g.Qc)(this.url);(0,n.pC)(e)&&(o=e.title)}return"item-title-and-service-name"===this.sublayerTitleMode&&r&&(o=r+" - "+o),(0,g.ld)(o)}set url(e){const t=(0,g.XG)({layer:this,url:e,nonStandardUrlAllowed:!1,logger:U});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,o){(0,g.wH)(this,e,"layers",t,o)}get parsedUrl(){const e=this._get("url"),t=(0,p.mN)(e);return null!=this.layerId&&(t.path=`${t.path}/layers/${this.layerId}`),t}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=(0,b.T)(this.parsedUrl.path,this.rootNode,e,this.apiKey,U,t),null==this.fullExtent||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(e){if("page"===e?.type){const t=e.rootIndex%e.pageSize,r=e.rootPage?.nodes?.[t];if(null==r||null==r.obb||null==r.obb.center||null==r.obb.halfSize)throw new i.Z("sceneservice:invalid-node-page","Invalid node page.");if(r.obb.center[0]<O||null==this.fullExtent||this.fullExtent.hasZ)return;const o=r.obb.halfSize,s=r.obb.center[2],a=Math.sqrt(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]);this.fullExtent.zmin=s-a,this.fullExtent.zmax=s+a}else if("node"===e?.type){const t=e.rootNode?.mbs;if(!Array.isArray(t)||4!==t.length||t[0]<O)return;const r=t[2],o=t[3],{fullExtent:s}=this;s&&(s.zmin=r-o,s.zmax=r+o)}}async _fetchService(e){if(null==this.url)throw new i.Z("sceneservice:url-not-set","Scene service can not be loaded without valid portal item or url");if(null==this.layerId&&/SceneServer\/*$/i.test(this.url)){const t=await this._fetchFirstLayerId(e);null!=t&&(this.layerId=t)}return this._fetchServiceLayer(e)}async _fetchFirstLayerId(e){const t=await(0,s.default)(this.url,{query:{f:"json",token:this.apiKey},responseType:"json",signal:e});if(t.data&&Array.isArray(t.data.layers)&&t.data.layers.length>0)return t.data.layers[0].id}async _fetchServiceLayer(e){const t=await(0,s.default)(this.parsedUrl?.path??"",{query:{f:"json",token:this.apiKey},responseType:"json",signal:e});t.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));let r=!1;if(t.data.layerType&&"Voxel"===t.data.layerType&&(r=!0),r)return this._fetchVoxelServiceLayer();const o=t.data;this.read(o,this._getServiceContext()),this.validateLayer(o)}async _fetchVoxelServiceLayer(e){const t=(await(0,s.default)(this.parsedUrl?.path+"/layer",{query:{f:"json",token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,this._getServiceContext()),this.validateLayer(t)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&"function"==typeof this.beforeSave&&await this.beforeSave()}validateLayer(e){}_updateTypeKeywords(e,t,r){e.typeKeywords||(e.typeKeywords=[]);const o=t.getTypeKeywords();for(const t of o)e.typeKeywords.push(t);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)),r===q.newItem&&(e.typeKeywords=e.typeKeywords.filter((e=>"Hosted Service"!==e))))}async _saveAs(e,t){const r={...E,...t};let o=w.default.from(e);o||(U.error("_saveAs(): requires a portal item parameter"),await Promise.reject(new i.Z("sceneservice:portal-item-required","_saveAs() requires a portal item to save to"))),o.id&&(o=o.clone(),o.id=null);const s=o.portal||S.Z.getDefault();await this._ensureLoadBeforeSave(),o.type=F,o.portal=s;const a={origin:"portal-item",url:null,messages:[],portal:s,portalItem:o,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],propertyPendingOperations:[],pendingOperations:[]}},n={layers:[this.write({},a)]};return await Promise.all(a.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(n,a,r),o.url=this.url,o.title||(o.title=this.title),this._updateTypeKeywords(o,r,q.newItem),await s.signIn(),await(s.user?.addItem({item:o,folder:r&&r.folder,data:n})),await R(this.resourceReferences,a,null),this.portalItem=o,(0,h.D)(a),a.portalItem=o,o}async _save(e){const t={...E,...e};if(!this.portalItem)throw U.error("_save(): requires the .portalItem property to be set"),new i.Z("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==F)throw U.error("_save(): Non-matching portal item type. Got "+this.portalItem.type+", expected "+F),new i.Z("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${F}"`);await this._ensureLoadBeforeSave();const r={origin:"portal-item",url:this.portalItem.itemUrl&&(0,p.mN)(this.portalItem.itemUrl),messages:[],portal:this.portalItem.portal||S.Z.getDefault(),portalItem:this.portalItem,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],propertyPendingOperations:[],pendingOperations:[]}},o={layers:[this.write({},r)]};return await Promise.all(r.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(o,r,t),this.portalItem.url=this.url,this.portalItem.title||(this.portalItem.title=this.title),this._updateTypeKeywords(this.portalItem,t,q.existingItem),await this.portalItem.update({data:o}),await R(this.resourceReferences,r,null),(0,h.D)(r),this.portalItem}async _validateAgainstJSONSchema(e,t,o){let s=t.messages?.filter((e=>"error"===e.type)).map((e=>new i.Z(e.name,e.message,e.details)))??[];if(o&&o.validationOptions?.ignoreUnsupported&&(s=s.filter((e=>"layer:unsupported"!==e.name&&"symbol:unsupported"!==e.name&&"symbol-layer:unsupported"!==e.name&&"property:unsupported"!==e.name&&"url:unsupported"!==e.name&&"scenemodification:unsupported"!==e.name))),o.validationOptions?.enabled||A){const t=(await r.e(5015).then(r.bind(r,25015))).validate(e,o.portalItemLayerType);if(t.length>0){const e=`Layer item did not validate:\n${t.join("\n")}`;if(U.error(`_validateAgainstJSONSchema(): ${e}`),"throw"===o.validationOptions?.failPolicy){const e=t.map((e=>new i.Z("sceneservice:schema-validation",e))).concat(s);throw new i.Z("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{combined:e})}}}if(s.length>0)throw new i.Z("sceneservice:save","Failed to save SceneService due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:s})}};return(0,o._)([(0,u.Cb)(_.id)],t.prototype,"id",void 0),(0,o._)([(0,u.Cb)({type:v.Z})],t.prototype,"spatialReference",void 0),(0,o._)([(0,c.r)("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],t.prototype,"readSpatialReference",null),(0,o._)([(0,u.Cb)({type:m.Z})],t.prototype,"fullExtent",void 0),(0,o._)([(0,c.r)("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],t.prototype,"readFullExtent",null),(0,o._)([(0,u.Cb)({readOnly:!0,type:f.Z})],t.prototype,"heightModelInfo",void 0),(0,o._)([(0,u.Cb)({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],t.prototype,"minScale",void 0),(0,o._)([(0,u.Cb)({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],t.prototype,"maxScale",void 0),(0,o._)([(0,u.Cb)({readOnly:!0})],t.prototype,"version",void 0),(0,o._)([(0,c.r)("version",["store.version"])],t.prototype,"readVersion",null),(0,o._)([(0,u.Cb)({type:String,json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),(0,o._)([(0,u.Cb)({type:String,json:{read:!1}})],t.prototype,"sublayerTitleMode",void 0),(0,o._)([(0,u.Cb)({type:String})],t.prototype,"title",void 0),(0,o._)([(0,c.r)("portal-item","title")],t.prototype,"readTitlePortalItem",null),(0,o._)([(0,c.r)("service","title",["name"])],t.prototype,"readTitleService",null),(0,o._)([(0,u.Cb)({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],t.prototype,"layerId",void 0),(0,o._)([(0,u.Cb)(_.HQ)],t.prototype,"url",null),(0,o._)([(0,y.c)("url")],t.prototype,"writeUrl",null),(0,o._)([(0,u.Cb)()],t.prototype,"parsedUrl",null),(0,o._)([(0,u.Cb)({readOnly:!0})],t.prototype,"store",void 0),(0,o._)([(0,u.Cb)({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],t.prototype,"rootNode",void 0),t=(0,o._)([(0,d.j)(P)],t),t},O=-1e38,A=!1;var q,K;(K=q||(q={}))[K.existingItem=0]="existingItem",K[K.newItem=1]="newItem";const F="Scene Service",E={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}};var k;!function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(k||(k={}))},61064:(e,t,r)=>{r.d(t,{T:()=>a});var o=r(3172),s=r(20102),i=r(70586);async function a(e,t,r,a,n,l){let p=null;if((0,i.pC)(r)){const t=`${e}/nodepages/`,s=t+Math.floor(r.rootIndex/r.nodesPerPage);try{return{type:"page",rootPage:(await(0,o.default)(s,{query:{f:"json",token:a},responseType:"json",signal:l})).data,rootIndex:r.rootIndex,pageSize:r.nodesPerPage,lodMetric:r.lodSelectionMetricType,urlPrefix:t}}catch(e){(0,i.pC)(n)&&n.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",s,e),p=e}}if(!t)return null;const u=`${e}/nodes/`,c=u+(t&&t.split("/").pop());try{return{type:"node",rootNode:(await(0,o.default)(c,{query:{f:"json",token:a},responseType:"json",signal:l})).data,urlPrefix:u}}catch(e){throw new s.Z("sceneservice:root-node-missing","Root node missing.",{pageError:p,nodeError:e,url:c})}}},51161:(e,t,r)=>{r.d(t,{H3:()=>v,QI:()=>c,U4:()=>l,Yh:()=>y});var o=r(43697),s=r(96674),i=r(5600),a=(r(75215),r(67676),r(36030)),n=r(52011);let l=class extends s.wq{constructor(){super(...arguments),this.nodesPerPage=null,this.rootIndex=0,this.lodSelectionMetricType=null}};(0,o._)([(0,i.Cb)({type:Number})],l.prototype,"nodesPerPage",void 0),(0,o._)([(0,i.Cb)({type:Number})],l.prototype,"rootIndex",void 0),(0,o._)([(0,i.Cb)({type:String})],l.prototype,"lodSelectionMetricType",void 0),l=(0,o._)([(0,n.j)("esri.layer.support.I3SNodePageDefinition")],l);let p=class extends s.wq{constructor(){super(...arguments),this.factor=1}};(0,o._)([(0,i.Cb)({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],p.prototype,"id",void 0),(0,o._)([(0,i.Cb)({type:Number})],p.prototype,"factor",void 0),p=(0,o._)([(0,n.j)("esri.layer.support.I3SMaterialTexture")],p);let u=class extends s.wq{constructor(){super(...arguments),this.baseColorFactor=[1,1,1,1],this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.metallicFactor=1,this.roughnessFactor=1}};(0,o._)([(0,i.Cb)({type:[Number]})],u.prototype,"baseColorFactor",void 0),(0,o._)([(0,i.Cb)({type:p})],u.prototype,"baseColorTexture",void 0),(0,o._)([(0,i.Cb)({type:p})],u.prototype,"metallicRoughnessTexture",void 0),(0,o._)([(0,i.Cb)({type:Number})],u.prototype,"metallicFactor",void 0),(0,o._)([(0,i.Cb)({type:Number})],u.prototype,"roughnessFactor",void 0),u=(0,o._)([(0,n.j)("esri.layer.support.I3SMaterialPBRMetallicRoughness")],u);let c=class extends s.wq{constructor(){super(...arguments),this.alphaMode="opaque",this.alphaCutoff=.25,this.doubleSided=!1,this.cullFace="none",this.normalTexture=null,this.occlusionTexture=null,this.emissiveTexture=null,this.emissiveFactor=null,this.pbrMetallicRoughness=null}};(0,o._)([(0,a.J)({opaque:"opaque",mask:"mask",blend:"blend"})],c.prototype,"alphaMode",void 0),(0,o._)([(0,i.Cb)({type:Number})],c.prototype,"alphaCutoff",void 0),(0,o._)([(0,i.Cb)({type:Boolean})],c.prototype,"doubleSided",void 0),(0,o._)([(0,a.J)({none:"none",back:"back",front:"front"})],c.prototype,"cullFace",void 0),(0,o._)([(0,i.Cb)({type:p})],c.prototype,"normalTexture",void 0),(0,o._)([(0,i.Cb)({type:p})],c.prototype,"occlusionTexture",void 0),(0,o._)([(0,i.Cb)({type:p})],c.prototype,"emissiveTexture",void 0),(0,o._)([(0,i.Cb)({type:[Number]})],c.prototype,"emissiveFactor",void 0),(0,o._)([(0,i.Cb)({type:u})],c.prototype,"pbrMetallicRoughness",void 0),c=(0,o._)([(0,n.j)("esri.layer.support.I3SMaterialDefinition")],c);let d=class extends s.wq{};(0,o._)([(0,i.Cb)({type:String,json:{read:{source:["name","index"],reader:(e,t)=>null!=e?e:`${t.index}`}}})],d.prototype,"name",void 0),(0,o._)([(0,a.J)({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],d.prototype,"format",void 0),d=(0,o._)([(0,n.j)("esri.layer.support.I3STextureFormat")],d);let y=class extends s.wq{constructor(){super(...arguments),this.atlas=!1}};(0,o._)([(0,i.Cb)({type:[d]})],y.prototype,"formats",void 0),(0,o._)([(0,i.Cb)({type:Boolean})],y.prototype,"atlas",void 0),y=(0,o._)([(0,n.j)("esri.layer.support.I3STextureSetDefinition")],y);let h=class extends s.wq{};(0,o._)([(0,a.J)({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],h.prototype,"type",void 0),(0,o._)([(0,i.Cb)({type:Number})],h.prototype,"component",void 0),h=(0,o._)([(0,n.j)("esri.layer.support.I3SGeometryAttribute")],h);let m=class extends s.wq{};(0,o._)([(0,a.J)({draco:"draco"})],m.prototype,"encoding",void 0),(0,o._)([(0,i.Cb)({type:[String]})],m.prototype,"attributes",void 0),m=(0,o._)([(0,n.j)("esri.layer.support.I3SGeometryCompressedAttributes")],m);let f=class extends s.wq{constructor(){super(...arguments),this.offset=0}};(0,o._)([(0,i.Cb)({type:Number})],f.prototype,"offset",void 0),(0,o._)([(0,i.Cb)({type:h})],f.prototype,"position",void 0),(0,o._)([(0,i.Cb)({type:h})],f.prototype,"normal",void 0),(0,o._)([(0,i.Cb)({type:h})],f.prototype,"uv0",void 0),(0,o._)([(0,i.Cb)({type:h})],f.prototype,"color",void 0),(0,o._)([(0,i.Cb)({type:h})],f.prototype,"uvRegion",void 0),(0,o._)([(0,i.Cb)({type:h})],f.prototype,"featureId",void 0),(0,o._)([(0,i.Cb)({type:h})],f.prototype,"faceRange",void 0),(0,o._)([(0,i.Cb)({type:m})],f.prototype,"compressedAttributes",void 0),f=(0,o._)([(0,n.j)("esri.layer.support.I3SGeometryBuffer")],f);let v=class extends s.wq{};(0,o._)([(0,a.J)({triangle:"triangle"})],v.prototype,"topology",void 0),(0,o._)([(0,i.Cb)()],v.prototype,"geometryBuffers",void 0),v=(0,o._)([(0,n.j)("esri.layer.support.I3SGeometryDefinition")],v)},97873:(e,t,r)=>{r.r(t),r.d(t,{addOrUpdateResource:()=>l,contentToBlob:()=>y,fetchResources:()=>n,getSiblingOfSameType:()=>h,getSiblingOfSameTypeI:()=>m,removeAllResources:()=>u,removeResource:()=>p,splitPrefixFileNameAndExtension:()=>d});var o=r(3172),s=r(20102),i=r(70586),a=r(17452);async function n(e,t={},r){await e.load(r);const o=(0,a.v_)(e.itemUrl,"resources"),{start:s=1,num:n=10,sortOrder:l="asc",sortField:p="created"}=t,u={query:{start:s,num:n,sortOrder:l,sortField:p,token:e.apiKey},signal:(0,i.U2)(r,"signal")},c=await e.portal.request(o,u);return{total:c.total,nextStart:c.nextStart,resources:c.resources.map((({created:t,size:r,resource:o})=>({created:new Date(t),size:r,resource:e.resourceFromPath(o)})))}}async function l(e,t,r,o){if(!e.hasPath())throw new s.Z(`portal-item-resource-${t}:invalid-path`,"Resource does not have a valid path");const n=e.portalItem;await n.load(o);const l=(0,a.v_)(n.userItemUrl,"add"===t?"addResources":"updateResources"),[p,u]=c(e.path),d=await y(r),h=new FormData;return p&&"."!==p&&h.append("resourcesPrefix",p),(0,i.pC)(o)&&o.compress&&h.append("compress","true"),h.append("fileName",u),h.append("file",d,u),h.append("f","json"),(0,i.pC)(o)&&o.access&&h.append("access",o.access),await n.portal.request(l,{method:"post",body:h,signal:(0,i.U2)(o,"signal")}),e}async function p(e,t,r){if(!t.hasPath())throw new s.Z("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await e.load(r);const o=(0,a.v_)(e.userItemUrl,"removeResources");await e.portal.request(o,{method:"post",query:{resource:t.path},signal:(0,i.U2)(r,"signal")}),t.portalItem=null}async function u(e,t){await e.load(t);const r=(0,a.v_)(e.userItemUrl,"removeResources");return e.portal.request(r,{method:"post",query:{deleteAll:!0},signal:(0,i.U2)(t,"signal")})}function c(e){const t=e.lastIndexOf("/");return-1===t?[".",e]:[e.slice(0,t),e.slice(t+1)]}function d(e){const[t,r]=function(e){const t=(0,a.Ml)(e);return(0,i.Wi)(t)?[e,""]:[e.slice(0,e.length-t.length-1),`.${t}`]}(e),[o,s]=c(t);return[o,s,r]}async function y(e){return e instanceof Blob?e:(await(0,o.default)(e.url,{responseType:"blob"})).data}function h(e,t){if(!e.hasPath())return null;const[r,,o]=d(e.path);return e.portalItem.resourceFromPath((0,a.v_)(r,t+o))}function m(e,t){if(!e.hasPath())return null;const[r,,o]=d(e.path);return e.portalItem.resourceFromPath((0,a.v_)(r,t+o))}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5464,661,7873],{92835:(e,t,r)=>{r.d(t,{Z:()=>m});var i,s=r(43697),n=r(96674),o=r(70586),a=r(35463),l=r(5600),c=(r(75215),r(67676),r(71715)),u=r(52011),p=r(30556);let h=i=class extends n.wq{static get allTime(){return d}static get empty(){return y}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?e.getTime():null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?e.getTime():null}clone(){return new i({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=(0,o.pC)(this.start)?this.start.getTime():this.start,r=(0,o.pC)(this.end)?this.end.getTime():this.end,i=(0,o.pC)(e.start)?e.start.getTime():e.start,s=(0,o.pC)(e.end)?e.end.getTime():e.end;return t===i&&r===s}expandTo(e){if(this.isEmpty||this.isAllTime)return this.clone();const t=(0,o.yw)(this.start,(t=>(0,a.JE)(t,e))),r=(0,o.yw)(this.end,(t=>{const r=(0,a.JE)(t,e);return t.getTime()===r.getTime()?r:(0,a.Nm)(r,1,e)}));return new i({start:t,end:r})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return i.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=(0,o.R2)(this.start,-1/0,(e=>e.getTime())),r=(0,o.R2)(this.end,1/0,(e=>e.getTime())),s=(0,o.R2)(e.start,-1/0,(e=>e.getTime())),n=(0,o.R2)(e.end,1/0,(e=>e.getTime()));let a,l;if(s>=t&&s<=r?a=s:t>=s&&t<=n&&(a=t),r>=s&&r<=n?l=r:n>=t&&n<=r&&(l=n),null!=a&&null!=l&&!isNaN(a)&&!isNaN(l)){const e=new i;return e.start=a===-1/0?null:new Date(a),e.end=l===1/0?null:new Date(l),e}return i.empty}offset(e,t){if(this.isEmpty||this.isAllTime)return this.clone();const r=new i,{start:s,end:n}=this;return(0,o.pC)(s)&&(r.start=(0,a.Nm)(s,e,t)),(0,o.pC)(n)&&(r.end=(0,a.Nm)(n,e,t)),r}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return d.clone();const t=(0,o.pC)(this.start)&&(0,o.pC)(e.start)?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,r=(0,o.pC)(this.end)&&(0,o.pC)(e.end)?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new i({start:t,end:r})}};(0,s._)([(0,l.Cb)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"end",void 0),(0,s._)([(0,c.r)("end")],h.prototype,"readEnd",null),(0,s._)([(0,p.c)("end")],h.prototype,"writeEnd",null),(0,s._)([(0,l.Cb)({readOnly:!0,json:{read:!1}})],h.prototype,"isAllTime",null),(0,s._)([(0,l.Cb)({readOnly:!0,json:{read:!1}})],h.prototype,"isEmpty",null),(0,s._)([(0,l.Cb)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"start",void 0),(0,s._)([(0,c.r)("start")],h.prototype,"readStart",null),(0,s._)([(0,p.c)("start")],h.prototype,"writeStart",null),h=i=(0,s._)([(0,u.j)("esri.TimeExtent")],h);const d=new h,y=new h({start:void 0,end:void 0}),m=h},46521:(e,t,r)=>{function i(){return[1,0,0,0,1,0,0,0,1]}function s(e,t){return new Float64Array(e,t,9)}r.d(t,{a:()=>s,c:()=>i}),Object.freeze(Object.defineProperty({__proto__:null,clone:function(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},create:i,createView:s,fromValues:function(e,t,r,i,s,n,o,a,l){return[e,t,r,i,s,n,o,a,l]}},Symbol.toStringTag,{value:"Module"}))},51305:(e,t,r)=>{r.d(t,{c:()=>d,g:()=>u,j:()=>M,k:()=>m,m:()=>p,s:()=>c});var i=r(46521),s=r(94961),n=r(65617),o=r(46851),a=r(17896),l=r(98766);function c(e,t,r){r*=.5;const i=Math.sin(r);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(r),e}function u(e,t){const r=2*Math.acos(t[3]),i=Math.sin(r/2);return i>(0,o.g)()?(e[0]=t[0]/i,e[1]=t[1]/i,e[2]=t[2]/i):(e[0]=1,e[1]=0,e[2]=0),r}function p(e,t,r){const i=t[0],s=t[1],n=t[2],o=t[3],a=r[0],l=r[1],c=r[2],u=r[3];return e[0]=i*u+o*a+s*c-n*l,e[1]=s*u+o*l+n*a-i*c,e[2]=n*u+o*c+i*l-s*a,e[3]=o*u-i*a-s*l-n*c,e}function h(e,t,r,i){const s=t[0],n=t[1],a=t[2],l=t[3];let c,u,p,h,d,y=r[0],m=r[1],g=r[2],f=r[3];return u=s*y+n*m+a*g+l*f,u<0&&(u=-u,y=-y,m=-m,g=-g,f=-f),1-u>(0,o.g)()?(c=Math.acos(u),p=Math.sin(c),h=Math.sin((1-i)*c)/p,d=Math.sin(i*c)/p):(h=1-i,d=i),e[0]=h*s+d*y,e[1]=h*n+d*m,e[2]=h*a+d*g,e[3]=h*l+d*f,e}function d(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function y(e,t){const r=t[0]+t[4]+t[8];let i;if(r>0)i=Math.sqrt(r+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);const s=(r+1)%3,n=(r+2)%3;i=Math.sqrt(t[3*r+r]-t[3*s+s]-t[3*n+n]+1),e[r]=.5*i,i=.5/i,e[3]=(t[3*s+n]-t[3*n+s])*i,e[s]=(t[3*s+r]+t[3*r+s])*i,e[n]=(t[3*n+r]+t[3*r+n])*i}return e}function m(e,t,r,i){const s=.5*Math.PI/180;t*=s,r*=s,i*=s;const n=Math.sin(t),o=Math.cos(t),a=Math.sin(r),l=Math.cos(r),c=Math.sin(i),u=Math.cos(i);return e[0]=n*l*u-o*a*c,e[1]=o*a*u+n*l*c,e[2]=o*l*c-n*a*u,e[3]=o*l*u+n*a*c,e}const g=l.c,f=l.s,b=l.a,v=p,_=l.b,w=l.d,S=l.l,x=l.e,C=x,j=l.f,I=j,V=l.n,M=l.g,R=l.h,A=(0,n.c)(),N=(0,n.f)(1,0,0),T=(0,n.f)(0,1,0),q=(0,s.a)(),D=(0,s.a)(),E=(0,i.c)();Object.freeze(Object.defineProperty({__proto__:null,add:b,calculateW:function(e,t){const r=t[0],i=t[1],s=t[2];return e[0]=r,e[1]=i,e[2]=s,e[3]=Math.sqrt(Math.abs(1-r*r-i*i-s*s)),e},conjugate:d,copy:g,dot:w,equals:R,exactEquals:M,fromEuler:m,fromMat3:y,getAxisAngle:u,identity:function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},invert:function(e,t){const r=t[0],i=t[1],s=t[2],n=t[3],o=r*r+i*i+s*s+n*n,a=o?1/o:0;return e[0]=-r*a,e[1]=-i*a,e[2]=-s*a,e[3]=n*a,e},len:C,length:x,lerp:S,mul:v,multiply:p,normalize:V,random:function(e){const t=o.R,r=t(),i=t(),s=t(),n=Math.sqrt(1-r),a=Math.sqrt(r);return e[0]=n*Math.sin(2*Math.PI*i),e[1]=n*Math.cos(2*Math.PI*i),e[2]=a*Math.sin(2*Math.PI*s),e[3]=a*Math.cos(2*Math.PI*s),e},rotateX:function(e,t,r){r*=.5;const i=t[0],s=t[1],n=t[2],o=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=i*l+o*a,e[1]=s*l+n*a,e[2]=n*l-s*a,e[3]=o*l-i*a,e},rotateY:function(e,t,r){r*=.5;const i=t[0],s=t[1],n=t[2],o=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=i*l-n*a,e[1]=s*l+o*a,e[2]=n*l+i*a,e[3]=o*l-s*a,e},rotateZ:function(e,t,r){r*=.5;const i=t[0],s=t[1],n=t[2],o=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=i*l+s*a,e[1]=s*l-i*a,e[2]=n*l+o*a,e[3]=o*l-n*a,e},rotationTo:function(e,t,r){const i=(0,a.e)(t,r);return i<-.999999?((0,a.f)(A,N,t),(0,a.u)(A)<1e-6&&(0,a.f)(A,T,t),(0,a.n)(A,A),c(e,A,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):((0,a.f)(A,t,r),e[0]=A[0],e[1]=A[1],e[2]=A[2],e[3]=1+i,V(e,e))},scale:_,set:f,setAxes:function(e,t,r,i){const s=E;return s[0]=r[0],s[3]=r[1],s[6]=r[2],s[1]=i[0],s[4]=i[1],s[7]=i[2],s[2]=-t[0],s[5]=-t[1],s[8]=-t[2],V(e,y(e,s))},setAxisAngle:c,slerp:h,sqlerp:function(e,t,r,i,s,n){return h(q,t,s,n),h(D,r,i,n),h(e,q,D,2*n*(1-n)),e},sqrLen:I,squaredLength:j,str:function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}},Symbol.toStringTag,{value:"Module"}))},94961:(e,t,r)=>{function i(){return[0,0,0,1]}function s(e){return[e[0],e[1],e[2],e[3]]}function n(e,t){return new Float64Array(e,t,4)}r.d(t,{I:()=>o,a:()=>i,b:()=>s,c:()=>n});const o=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:o,clone:s,create:i,createView:n,fromValues:function(e,t,r,i){return[e,t,r,i]}},Symbol.toStringTag,{value:"Module"}))},35270:(e,t,r)=>{r.d(t,{B7:()=>l,St:()=>s,VL:()=>o,h$:()=>n,rW:()=>c});const i={transparent:[0,0,0,0],black:[0,0,0,1],silver:[192,192,192,1],gray:[128,128,128,1],white:[255,255,255,1],maroon:[128,0,0,1],red:[255,0,0,1],purple:[128,0,128,1],fuchsia:[255,0,255,1],green:[0,128,0,1],lime:[0,255,0,1],olive:[128,128,0,1],yellow:[255,255,0,1],navy:[0,0,128,1],blue:[0,0,255,1],teal:[0,128,128,1],aqua:[0,255,255,1],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],blanchedalmond:[255,235,205,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],oldlace:[253,245,230,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],rebeccapurple:[102,51,153,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],whitesmoke:[245,245,245,1],yellowgreen:[154,205,50,1]};function s(e){return i[e]||i[e.toLowerCase()]}function n(e){return i[e]??i[e.toLowerCase()]}function o(e){return[...n(e)]}function a(e,t,r){r<0&&++r,r>1&&--r;const i=6*r;return i<1?e+(t-e)*i:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}function l(e,t,r,i=1){const s=(e%360+360)%360/360,n=r<=.5?r*(t+1):r+t-r*t,o=2*r-n;return[Math.round(255*a(o,n,s+1/3)),Math.round(255*a(o,n,s)),Math.round(255*a(o,n,s-1/3)),i]}function c(e){const t=e.length>5,r=t?8:4,i=(1<<r)-1,s=t?1:17,n=t?9===e.length:5===e.length;let o=Number("0x"+e.substr(1));if(isNaN(o))return null;const a=[0,0,0,1];let l;return n&&(l=o&i,o>>=r,a[3]=s*l/255),l=o&i,o>>=r,a[2]=s*l,l=o&i,o>>=r,a[1]=s*l,l=o&i,o>>=r,a[0]=s*l,a}},2368:(e,t,r)=>{r.d(t,{J:()=>u,j:()=>p});var i=r(43697),s=r(15923),n=(r(80442),r(22974)),o=(r(92604),r(70586)),a=r(31263),l=r(1153),c=r(52011);const u=e=>{let t=class extends e{clone(){const e=(0,o.s3)((0,l.vw)(this),"unable to clone instance of non-accessor class"),t=e.metadatas,r=e.store,i={},s=new Map;for(const e in t){const o=t[e],l=r?.originOf(e),c=o.clonable;if(o.readOnly||!1===c||l!==a.s3.USER&&l!==a.s3.DEFAULTS&&l!==a.s3.WEB_MAP&&l!==a.s3.WEB_SCENE)continue;const u=this[e];let p=null;p="function"==typeof c?c(u):"reference"===c?u:(0,n.Vo)(u),null!=u&&null==p||(l===a.s3.DEFAULTS?s.set(e,p):i[e]=p)}const c=new(0,Object.getPrototypeOf(this).constructor)(i);if(s.size){const e=(0,l.vw)(c)?.store;if(e)for(const[t,r]of s)e.set(t,r,a.s3.DEFAULTS)}return c}};return t=(0,i._)([(0,c.j)("esri.core.Clonable")],t),t};let p=class extends(u(s.Z)){};p=(0,i._)([(0,c.j)("esri.core.Clonable")],p)},46791:(e,t,r)=>{r.d(t,{Z:()=>A});var i,s=r(43697),n=r(3894),o=r(32448),a=r(22974),l=r(70586),c=r(71143);!function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE",e[e.MOVE=4]="MOVE"}(i||(i={}));var u,p=r(1654),h=r(5600),d=r(75215),y=r(52421),m=r(52011),g=r(58971),f=r(10661);const b=new c.Z(class{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}},void 0,(e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1})),v=()=>{};function _(e){return e?e instanceof R?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function w(e){if(e&&e.length)return e[0]}function S(e,t,r,i){const s=Math.min(e.length-r,t.length-i);let n=0;for(;n<s&&e[r+n]===t[i+n];)n++;return n}function x(e,t,r,i){t&&t.forEach(((t,s,n)=>{e.push(t),x(e,r.call(i,t,s,n),r,i)}))}const C=new Set,j=new Set,I=new Set,V=new Map;let M=0,R=u=class extends o.Z.EventedAccessor{static isCollection(e){return null!=e&&e instanceof u}constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._timer=null,this._observable=new f.s,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:M++})}normalizeCtorArgs(e){return e?Array.isArray(e)||e instanceof u?{items:e}:e:{}}destroy(){this.removeAll()}*[Symbol.iterator](){yield*this.items}get items(){return(0,g.it)(this._observable),this._items}set items(e){this._emitBeforeChanges(i.ADD)||(this._splice(0,this.length,_(e)),this._emitAfterChanges(i.ADD))}hasEventListener(e){return"change"===e?this._chgListeners.length>0:this._emitter.hasEventListener(e)}on(e,t){if("change"===e){const e=this._chgListeners,r={removed:!1,callback:t};return e.push(r),this._notifications&&this._notifications.push({listeners:e.slice(),items:this._items.slice(),changes:[]}),{remove(){this.remove=v,r.removed=!0,e.splice(e.indexOf(r),1)}}}return this._emitter.on(e,t)}once(e,t){const r=this.on(e,t);return{remove(){r.remove()}}}add(e,t){if((0,g.it)(this._observable),this._emitBeforeChanges(i.ADD))return this;const r=this.getNextIndex(t??null);return this._splice(r,0,[e]),this._emitAfterChanges(i.ADD),this}addMany(e,t=this._items.length){if((0,g.it)(this._observable),!e||!e.length)return this;if(this._emitBeforeChanges(i.ADD))return this;const r=this.getNextIndex(t);return this._splice(r,0,_(e)),this._emitAfterChanges(i.ADD),this}at(e){if((0,g.it)(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if((0,g.it)(this._observable),!this.length||this._emitBeforeChanges(i.REMOVE))return[];const e=this._splice(0,this.length)||[];return this._emitAfterChanges(i.REMOVE),e}clone(){return(0,g.it)(this._observable),this._createNewInstance({items:this._items.map(a.d9)})}concat(...e){(0,g.it)(this._observable);const t=e.map(_);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if((0,g.it)(this._observable),!this.length||this._emitBeforeChanges(i.REMOVE))return;const r=(0,l.j0)(this._splice(0,this.length)),s=r.length;for(let i=0;i<s;i++)e.call(t,r[i],i,r);this._emitAfterChanges(i.REMOVE)}every(e,t){return(0,g.it)(this._observable),this._items.every(e,t)}filter(e,t){let r;return(0,g.it)(this._observable),r=2===arguments.length?this._items.filter(e,t):this._items.filter(e),this._createNewInstance({items:r})}find(e,t){return(0,g.it)(this._observable),this._items.find(e,t)}findIndex(e,t){return(0,g.it)(this._observable),this._items.findIndex(e,t)}flatten(e,t){(0,g.it)(this._observable);const r=[];return x(r,this,e,t),new u(r)}forEach(e,t){return(0,g.it)(this._observable),this._items.forEach(e,t)}getItemAt(e){return(0,g.it)(this._observable),this._items[e]}getNextIndex(e){(0,g.it)(this._observable);const t=this.length;return(e=e??t)<0?e=0:e>t&&(e=t),e}includes(e,t=0){return(0,g.it)(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return(0,g.it)(this._observable),this._items.indexOf(e,t)}join(e=","){return(0,g.it)(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return(0,g.it)(this._observable),this._items.lastIndexOf(e,t)}map(e,t){(0,g.it)(this._observable);const r=this._items.map(e,t);return new u({items:r})}reorder(e,t=this.length-1){(0,g.it)(this._observable);const r=this.indexOf(e);if(-1!==r){if(t<0?t=0:t>=this.length&&(t=this.length-1),r!==t){if(this._emitBeforeChanges(i.MOVE))return e;this._splice(r,1),this._splice(t,0,[e]),this._emitAfterChanges(i.MOVE)}return e}}pop(){if((0,g.it)(this._observable),!this.length||this._emitBeforeChanges(i.REMOVE))return;const e=w(this._splice(this.length-1,1));return this._emitAfterChanges(i.REMOVE),e}push(...e){return(0,g.it)(this._observable),this._emitBeforeChanges(i.ADD)||(this._splice(this.length,0,e),this._emitAfterChanges(i.ADD)),this.length}reduce(e,t){(0,g.it)(this._observable);const r=this._items;return 2===arguments.length?r.reduce(e,t):r.reduce(e)}reduceRight(e,t){(0,g.it)(this._observable);const r=this._items;return 2===arguments.length?r.reduceRight(e,t):r.reduceRight(e)}remove(e){return(0,g.it)(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if((0,g.it)(this._observable),e<0||e>=this.length||this._emitBeforeChanges(i.REMOVE))return;const t=w(this._splice(e,1));return this._emitAfterChanges(i.REMOVE),t}removeMany(e){if((0,g.it)(this._observable),!e||!e.length||this._emitBeforeChanges(i.REMOVE))return[];const t=e instanceof u?e.toArray():e,r=this._items,s=[],n=t.length;for(let e=0;e<n;e++){const i=t[e],n=r.indexOf(i);if(n>-1){const i=1+S(t,r,e+1,n+1),o=this._splice(n,i);o&&o.length>0&&s.push.apply(s,o),e+=i-1}}return this._emitAfterChanges(i.REMOVE),s}reverse(){if((0,g.it)(this._observable),this._emitBeforeChanges(i.MOVE))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(i.MOVE),this}shift(){if((0,g.it)(this._observable),!this.length||this._emitBeforeChanges(i.REMOVE))return;const e=w(this._splice(0,1));return this._emitAfterChanges(i.REMOVE),e}slice(e=0,t=this.length){return(0,g.it)(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return(0,g.it)(this._observable),this._items.some(e,t)}sort(e){if((0,g.it)(this._observable),!this.length||this._emitBeforeChanges(i.MOVE))return this;const t=(0,l.j0)(this._splice(0,this.length));return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(i.MOVE),this}splice(e,t,...r){(0,g.it)(this._observable);const s=(t?i.REMOVE:0)|(r.length?i.ADD:0);if(this._emitBeforeChanges(s))return[];const n=this._splice(e,t,r)||[];return this._emitAfterChanges(s),n}toArray(){return(0,g.it)(this._observable),this._items.slice()}toJSON(){return(0,g.it)(this._observable),this.toArray()}toLocaleString(){return(0,g.it)(this._observable),this._items.toLocaleString()}toString(){return(0,g.it)(this._observable),this._items.toString()}unshift(...e){return(0,g.it)(this._observable),!e.length||this._emitBeforeChanges(i.ADD)||(this._splice(0,0,e),this._emitAfterChanges(i.ADD)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,r){const i=this._items,s=this.itemType;let n,o;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._timer=(0,p.Os)((()=>this._dispatchChange()))),t){if(o=i.splice(e,t),this.hasEventListener("before-remove")){const t=b.acquire();t.target=this,t.cancellable=!0;for(let r=0,s=o.length;r<s;r++)n=o[r],t.reset(n),this.emit("before-remove",t),t.defaultPrevented&&(o.splice(r,1),i.splice(e,0,n),e+=1,r-=1,s-=1);b.release(t)}if(this.length=this._items.length,this.hasEventListener("after-remove")){const e=b.acquire();e.target=this,e.cancellable=!1;const t=o.length;for(let r=0;r<t;r++)e.reset(o[r]),this.emit("after-remove",e);b.release(e)}}if(r&&r.length){if(s){const e=[];for(const t of r){const r=s.ensureType(t);null==r&&null!=t||e.push(r)}r=e}const t=this.hasEventListener("before-add"),n=this.hasEventListener("after-add"),o=e===this.length;if(t||n){const s=b.acquire();s.target=this,s.cancellable=!0;const a=b.acquire();a.target=this,a.cancellable=!1;for(const l of r)t?(s.reset(l),this.emit("before-add",s),s.defaultPrevented||(o?i.push(l):i.splice(e++,0,l),this._set("length",i.length),n&&(a.reset(l),this.emit("after-add",a)))):(o?i.push(l):i.splice(e++,0,l),this._set("length",i.length),a.reset(l),this.emit("after-add",a));b.release(a),b.release(s)}else{if(o)for(const e of r)i.push(e);else i.splice(e,0,...r);this._set("length",i.length)}}return(r&&r.length||o&&o.length)&&this._notifyChangeEvent(r,o),o}_emitBeforeChanges(e){let t=!1;if(this.hasEventListener("before-changes")){const r=b.acquire();r.target=this,r.cancellable=!0,r.type=e,this.emit("before-changes",r),t=r.defaultPrevented,b.release(r)}return t}_emitAfterChanges(e){if(this.hasEventListener("after-changes")){const t=b.acquire();t.target=this,t.cancellable=!1,t.type=e,this.emit("after-changes",t),b.release(t)}this._observable.notify()}_notifyChangeEvent(e,t){this.hasEventListener("change")&&this._notifications&&this._notifications[this._notifications.length-1].changes.push({added:e,removed:t})}_dispatchChange(){if(this._timer&&(this._timer.remove(),this._timer=null),!this._notifications)return;const e=this._notifications;this._notifications=null;for(const t of e){const e=t.changes;C.clear(),j.clear(),I.clear();for(const{added:t,removed:r}of e){if(t)if(0===I.size&&0===j.size)for(const e of t)C.add(e);else for(const e of t)j.has(e)?(I.add(e),j.delete(e)):I.has(e)||C.add(e);if(r)if(0===I.size&&0===C.size)for(const e of r)j.add(e);else for(const e of r)C.has(e)?C.delete(e):(I.delete(e),j.add(e))}const r=n.Z.acquire();C.forEach((e=>{r.push(e)}));const i=n.Z.acquire();j.forEach((e=>{i.push(e)}));const s=this._items,o=t.items,a=n.Z.acquire();if(I.forEach((e=>{o.indexOf(e)!==s.indexOf(e)&&a.push(e)})),t.listeners&&(r.length||i.length||a.length)){const e={target:this,added:r,removed:i,moved:a},s=t.listeners.length;for(let r=0;r<s;r++){const i=t.listeners[r];i.removed||i.callback.call(this,e)}}n.Z.release(r),n.Z.release(i),n.Z.release(a)}C.clear(),j.clear(),I.clear()}};R.ofType=e=>{if(!e)return u;if(V.has(e))return V.get(e);let t=null;if("function"==typeof e)t=e.prototype.declaredClass;else if(e.base)t=e.base.prototype.declaredClass;else for(const r in e.typeMap){const i=e.typeMap[r].prototype.declaredClass;t?t+=` | ${i}`:t=i}let r=class extends u{};return(0,s._)([(0,y.c)({Type:e,ensureType:"function"==typeof e?(0,d.se)(e):(0,d.N7)(e)})],r.prototype,"itemType",void 0),r=(0,s._)([(0,m.j)(`esri.core.Collection<${t}>`)],r),V.set(e,r),r},(0,s._)([(0,h.Cb)()],R.prototype,"length",void 0),(0,s._)([(0,h.Cb)()],R.prototype,"items",null),R=u=(0,s._)([(0,m.j)("esri.core.Collection")],R);const A=R},68251:(e,t,r)=>{r.d(t,{BV:()=>o});var i=r(22021);class s{constructor(e,t){this.min=e,this.max=t,this.range=t-e}ndiff(e,t=0){return Math.ceil((e-t)/this.range)*this.range+t}_normalize(e,t,r,i=0,s=!1){return(r-=i)<e?r+=this.ndiff(e-r):r>t&&(r-=this.ndiff(r-t)),s&&r===t&&(r=e),r+i}normalize(e,t=0,r=!1){return this._normalize(this.min,this.max,e,t,r)}clamp(e,t=0){return(0,i.uZ)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+this.ndiff(e-t,r)}minimalMonotonic(e,t,r){return this._normalize(e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);const r=(t=this.normalize(t))-e,i=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(i)?r:i}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function n(e){for(const t in e){const r=e[t];r instanceof Function&&(e[t]=r.bind(e))}return e}n(new s(0,2*Math.PI)),n(new s(-Math.PI,Math.PI));const o=n(new s(0,360))},28659:(e,t,r)=>{r.d(t,{B:()=>m});var i=r(81153),s=r(17452),n=r(41123),o=r(7628),a=r(31263),l=r(5600);function c(e){return u[function(e){return e instanceof Blob?e.type:function(e){const t=(0,s.Ml)(e);return d[t]||p}(e.url)}(e)]||h}const u={},p="text/plain",h=u[p],d={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const e in d)u[d[e]]=e;var y=r(25929);function m(e){const t=e?.origins??[void 0];return(r,n)=>{const u=function(e,t,r){if("resource"===e?.type)return function(e,t,r){const n=(0,o.Oe)(t,r);return{type:String,read:(e,t,r)=>{const i=(0,y.r)(e,t,r);return n.type===String?i:"function"==typeof n.type?new n.type({url:i}):void 0},write:{writer(t,o,l,u){if(!u||!u.resources)return"string"==typeof t?void(o[l]=(0,y.t)(t,u)):void(o[l]=t.write({},u));const p=function(e){return null==e?null:"string"==typeof e?e:e.url}(t),h=(0,y.t)(p,{...u,verifyItemRelativeUrls:u&&u.verifyItemRelativeUrls?{writtenUrls:u.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},y.M.NO),d=n.type!==String&&(!(0,i.l)(this)||u&&u.origin&&this.originIdOf(r)>(0,a.M9)(u.origin)),m={object:this,propertyName:r,value:t,targetUrl:h,dest:o,targetPropertyName:l,context:u,params:e};u&&u.portalItem&&h&&!(0,s.YP)(h)?d?function(e){const{context:t,targetUrl:r,params:i,value:n,dest:o,targetPropertyName:a}=e;if(!t.portalItem)return;const l=t.portalItem.resourceFromPath(r),u=b(n,r,t),p=c(u),h=(0,s.Ml)(l.path),d=i?.compress??!1;p===h?(t.resources&&f({...e,resource:l,content:u,compress:d,updates:t.resources.toUpdate}),o[a]=r):g(e)}(m):function({context:e,targetUrl:t,dest:r,targetPropertyName:i}){e.portalItem&&e.resources&&(e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(t),compress:!1}),r[i]=t)}(m):u&&u.portalItem&&(null==h||null!=(0,y.i)(h)||(0,s.jc)(h)||d)?g(m):o[l]=h}}}}(e,t,r);switch(e?.type??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:e,write:t}=y.a;return{read:e,write:t}}}}(e,r,n);for(const e of t){const t=(0,l.CJ)(r,e,n);for(const e in u)t[e]=u[e]}}}function g(e){const{targetUrl:t,params:i,value:o,context:a,dest:l,targetPropertyName:u}=e;if(!a.portalItem)return;const p=(0,y.p)(t),h=p?.filename??(0,n.D)(),d=i?.prefix??p?.prefix,m=b(o,t,a),g=(0,s.v_)(d,h),v=`${g}.${c(m)}`,_=a.portalItem.resourceFromPath(v);(0,s.jc)(t)&&a.resources&&a.resources.propertyPendingOperations.push(async function(e){const t=(await Promise.resolve().then(r.bind(r,3172))).default,{data:i}=await t(e,{responseType:"blob"});return i}(t).then((e=>{_.path=`${g}.${c(e)}`,l[u]=_.itemRelativeUrl})).catch((()=>{})));const w=i?.compress??!1;a.resources&&f({...e,resource:_,content:m,compress:w,updates:a.resources.toAdd}),l[u]=_.itemRelativeUrl}function f({object:e,propertyName:t,updates:r,resource:i,content:s,compress:n}){r.push({resource:i,content:s,compress:n,finish:r=>{!function(e,t,r){"string"==typeof e[t]?e[t]=r.url:e[t].url=r.url}(e,t,r)}})}function b(e,t,r){return"string"==typeof e?{url:t}:new Blob([JSON.stringify(e.toJSON(r))],{type:"application/json"})}},52421:(e,t,r)=>{function i(e){return(t,r)=>{t[r]=e}}r.d(t,{c:()=>i})},65845:(e,t,r)=>{r.d(t,{D:()=>s});var i=r(81153);function s(e){e&&e.writtenProperties&&e.writtenProperties.forEach((({target:e,propName:t,newOrigin:r})=>{(0,i.l)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)}))}},10661:(e,t,r)=>{r.d(t,{s:()=>s});var i=r(42100);class s extends i.s{notify(){const e=this._observers;if(e&&e.length>0){const t=e.slice();for(const e of t)e.onInvalidated(),e.onCommitted()}}}},70921:(e,t,r)=>{r.d(t,{R:()=>n,Z:()=>s});var i=r(46791);function s(e,t,r=i.Z){return t||(t=new r),t===e||(t.removeAll(),(s=e)&&(Array.isArray(s)||"items"in s&&Array.isArray(s.items))?t.addMany(e):e&&t.add(e)),t;var s}function n(e){return e}},81153:(e,t,r)=>{function i(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{l:()=>i})},35463:(e,t,r)=>{r.d(t,{JE:()=>o,Nm:()=>n,rJ:()=>a}),r(80442);const i={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8},s={milliseconds:{getter:"getMilliseconds",setter:"setMilliseconds",multiplier:1},seconds:{getter:"getSeconds",setter:"setSeconds",multiplier:1},minutes:{getter:"getMinutes",setter:"setMinutes",multiplier:1},hours:{getter:"getHours",setter:"setHours",multiplier:1},days:{getter:"getDate",setter:"setDate",multiplier:1},weeks:{getter:"getDate",setter:"setDate",multiplier:7},months:{getter:"getMonth",setter:"setMonth",multiplier:1},years:{getter:"getFullYear",setter:"setFullYear",multiplier:1},decades:{getter:"getFullYear",setter:"setFullYear",multiplier:10},centuries:{getter:"getFullYear",setter:"setFullYear",multiplier:100}};function n(e,t,r){const i=new Date(e.getTime());if(t&&r){const e=s[r],{getter:n,setter:o,multiplier:a}=e;if("months"===r){const e=function(e,t){const r=new Date(e,t+1,1);return r.setDate(0),r.getDate()}(i.getFullYear(),i.getMonth()+t);i.getDate()>e&&i.setDate(e)}i[o](i[n]()+t*a)}return i}function o(e,t){switch(t){case"milliseconds":return new Date(e.getTime());case"seconds":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds());case"minutes":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes());case"hours":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours());case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate());case"weeks":return new Date(e.getFullYear(),e.getMonth(),e.getDate()-e.getDay());case"months":return new Date(e.getFullYear(),e.getMonth(),1);case"years":return new Date(e.getFullYear(),0,1);case"decades":return new Date(e.getFullYear()-e.getFullYear()%10,0,1);case"centuries":return new Date(e.getFullYear()-e.getFullYear()%100,0,1);default:return new Date}}function a(e,t,r){return 0===e?0:e*i[t]/i[r]}},41123:(e,t,r)=>{r.d(t,{D:()=>s});const i="randomUUID"in crypto;function s(){if(i)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}},79235:(e,t,r)=>{r.d(t,{Z:()=>v});var i,s=r(43697),n=r(67676),o=r(35454),a=r(96674),l=r(67900),c=r(20941),u=r(5600),p=(r(75215),r(71715)),h=r(52011),d=r(30556);const y=(0,o.w)()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),m=y.jsonValues.slice();(0,n.e$)(m,"orthometric");const g=(0,o.w)()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let f=i=class extends a.wq{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,r){return y.write(e,t,r)}readHeightModel(e,t,r){return y.read(e)||(r&&r.messages&&r.messages.push(function(e,t){return new c.Z("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}(e,{context:r})),null)}readHeightUnit(e,t,r){return g.read(e)||(r&&r.messages&&r.messages.push(b(e,{context:r})),null)}readHeightUnitService(e,t,r){return(0,l.$C)(e)||g.read(e)||(r&&r.messages&&r.messages.push(b(e,{context:r})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new i({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const r=(0,l.cM)(t);return new i({heightModel:e.heightModel,heightUnit:r,vertCRS:e.vertCRS})}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new i;return t.read(e,{origin:"web-scene"}),t}};function b(e,t){return new c.Z("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}(0,s._)([(0,u.Cb)({type:y.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:m,default:"ellipsoidal"}}}})],f.prototype,"heightModel",void 0),(0,s._)([(0,d.c)("web-scene","heightModel")],f.prototype,"writeHeightModel",null),(0,s._)([(0,p.r)(["web-scene","service"],"heightModel")],f.prototype,"readHeightModel",null),(0,s._)([(0,u.Cb)({type:g.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:g.jsonValues,write:g.write}}}})],f.prototype,"heightUnit",void 0),(0,s._)([(0,p.r)("web-scene","heightUnit")],f.prototype,"readHeightUnit",null),(0,s._)([(0,p.r)("service","heightUnit")],f.prototype,"readHeightUnitService",null),(0,s._)([(0,u.Cb)({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],f.prototype,"vertCRS",void 0),(0,s._)([(0,p.r)("service","vertCRS",["vertCRS","ellipsoid","geoid"])],f.prototype,"readVertCRS",null),f=i=(0,s._)([(0,h.j)("esri.geometry.HeightModelInfo")],f);const v=f},28865:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Je});var i=r(43697),s=r(46791),n=r(20102),o=r(92604),a=r(70586),l=r(16453),c=r(95330),u=r(5600),p=r(75215),h=(r(67676),r(71715)),d=r(52011),y=r(17896),m=r(65617),g=r(6570),f=r(87085),b=r(54295),v=r(17287),_=r(38009),w=r(16859),S=r(72965),x=r(32271),C=r(66677),j=r(21506),I=r(1231),V=r(2368),M=r(68251),R=r(96674),A=r(28659),N=r(51305),T=r(94961),q=r(46851);const D=(0,m.c)(),E=(0,T.a)(),z=(0,T.a)(),O=(0,T.a)(),Z=(0,m.f)(0,0,1),F=(0,m.f)(0,1,0),P=(0,m.f)(1,0,0);function L(e){(0,y.c)(D,e),(0,y.n)(D,D);const t=Math.atan2(D[1],D[0]),r=(0,N.s)((0,T.a)(),Z,-t);(0,y.q)(D,D,r);const i=-1*Math.atan2(D[2],D[0]);return[(0,q.a)(t)+270,(0,q.a)(i)+90]}function k(e,t){return(0,N.s)(z,Z,(0,q.t)(e-270)),(0,N.s)(O,F,(0,q.t)(t-90)),(0,N.m)(E,z,O),(0,y.c)(D,P),(0,y.q)(D,D,E),(0,y.n)(D,D),[D[0],D[1],D[2]]}var U=r(90578);let B=class extends((0,V.J)(R.wq)){constructor(e){super(e),this.enabled=!0,this.label="",this.normal=null,this.point=null}get orientation(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,t]=L(this.normal);return M.BV.normalize((0,p.q9)(e),0,!0)}set orientation(e){const t=k(e,this.tilt);this._set("normal",t),this._set("orientation",e)}get tilt(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,t]=L(this.normal);return M.BV.normalize((0,p.q9)(t),0,!0)}set tilt(e){const t=k(this.orientation,e);this._set("normal",t),this._set("tilt",e)}};(0,i._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],B.prototype,"enabled",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],B.prototype,"label",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),(0,U.p)((e=>M.BV.normalize((0,p.q9)(e),0,!0)))],B.prototype,"orientation",null),(0,i._)([(0,u.Cb)({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),(0,U.p)((e=>M.BV.normalize((0,p.q9)(e),0,!0)))],B.prototype,"tilt",null),(0,i._)([(0,u.Cb)({type:[Number],json:{write:!0}})],B.prototype,"normal",void 0),(0,i._)([(0,u.Cb)({type:[Number],json:{write:!0}})],B.prototype,"point",void 0),B=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelSlice")],B);const $=B;var K=r(25929);let J=class extends((0,V.J)(R.wq)){constructor(){super(...arguments),this.enabled=!0,this.href=null,this.id=null,this.label="",this.normal=null,this.point=null,this.sizeInPixel=null,this.slices=null,this.timeId=0,this.variableId=null}get orientation(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,t]=L(this.normal);return M.BV.normalize((0,p.q9)(e),0,!0)}get tilt(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,t]=L(this.normal);return M.BV.normalize((0,p.q9)(t),0,!0)}};(0,i._)([(0,u.Cb)({type:Boolean,json:{default:!0,write:!0}})],J.prototype,"enabled",void 0),(0,i._)([(0,u.Cb)({type:String,json:{origins:{service:{read:K.r}},write:{enabled:!0,isRequired:!0}}}),(0,A.B)({origins:["web-scene"],type:"resource",prefix:"sections",compress:!0})],J.prototype,"href",void 0),(0,i._)([(0,u.Cb)({type:p.z8,json:{write:{enabled:!0,isRequired:!0}}})],J.prototype,"id",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],J.prototype,"label",void 0),(0,i._)([(0,u.Cb)({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],J.prototype,"orientation",null),(0,i._)([(0,u.Cb)({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],J.prototype,"tilt",null),(0,i._)([(0,u.Cb)({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],J.prototype,"normal",void 0),(0,i._)([(0,u.Cb)({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],J.prototype,"point",void 0),(0,i._)([(0,u.Cb)({type:[p.z8],json:{write:{enabled:!0,isRequired:!0}}})],J.prototype,"sizeInPixel",void 0),(0,i._)([(0,u.Cb)({type:[$],json:{write:!0}})],J.prototype,"slices",void 0),(0,i._)([(0,u.Cb)({type:p.z8,json:{default:0,write:!0}})],J.prototype,"timeId",void 0),(0,i._)([(0,u.Cb)({type:p.z8,json:{write:{enabled:!0,isRequired:!0}}})],J.prototype,"variableId",void 0),J=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelSection")],J);const Y=J;let H=class extends R.wq{constructor(){super(...arguments),this.diffuseFactor=.5,this.specularFactor=.5}};(0,i._)([(0,u.Cb)({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],H.prototype,"diffuseFactor",void 0),(0,i._)([(0,u.Cb)({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],H.prototype,"specularFactor",void 0),H=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelSimpleShading")],H);const W=H;let G=class extends R.wq{constructor(){super(...arguments),this.continuity=null,this.hasNoData=!1,this.noData=0,this.offset=0,this.scale=1,this.type=null}};(0,i._)([(0,u.Cb)({type:["discrete","continuous"],json:{write:!0}})],G.prototype,"continuity",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],G.prototype,"hasNoData",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:!0}})],G.prototype,"noData",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:!0}})],G.prototype,"offset",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:!0}})],G.prototype,"scale",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:{enabled:!0,isRequired:!0}}})],G.prototype,"type",void 0),G=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelFormat")],G);const Q=G;let X=class extends R.wq{constructor(){super(...arguments),this.id=null,this.description="",this.name=null,this.originalFormat=null,this.renderingFormat=null,this.unit="",this.volumeId=0,this.type=null}};(0,i._)([(0,u.Cb)({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],X.prototype,"id",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],X.prototype,"description",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:{enabled:!0,isRequired:!0}}})],X.prototype,"name",void 0),(0,i._)([(0,u.Cb)({type:Q,json:{write:!0}})],X.prototype,"originalFormat",void 0),(0,i._)([(0,u.Cb)({type:Q,json:{write:{enabled:!0,isRequired:!0}}})],X.prototype,"renderingFormat",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],X.prototype,"unit",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:!0}})],X.prototype,"volumeId",void 0),(0,i._)([(0,u.Cb)({type:["stc-hot-spot-results","stc-cluster-outlier-results","stc-estimated-bin","generic-nearest-interpolated"],json:{write:!0}})],X.prototype,"type",void 0),X=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelVariable")],X);const ee=X;var te=r(22974),re=r(22303);let ie=class extends((0,V.J)(R.wq)){constructor(){super(...arguments),this.color=re.Z.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label="",this.colorLocked=!1}};(0,i._)([(0,u.Cb)({type:re.Z,json:{type:[p.z8],write:{enabled:!0,isRequired:!0}}})],ie.prototype,"color",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],ie.prototype,"value",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{default:!0,write:!0}})],ie.prototype,"enabled",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],ie.prototype,"label",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{default:!1}})],ie.prototype,"colorLocked",void 0),ie=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelIsosurface")],ie);const se=ie;var ne=r(70921),oe=r(22021);let ae=class extends((0,V.J)(R.wq)){constructor(){super(...arguments),this.color=null,this.position=0}};(0,i._)([(0,u.Cb)({type:re.Z,json:{type:[p.z8],write:{enabled:!0,isRequired:!0}}})],ae.prototype,"color",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],ae.prototype,"position",void 0),ae=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelColorStop")],ae);const le=ae;let ce=class extends((0,V.J)(R.wq)){constructor(){super(...arguments),this.opacity=1,this.position=0}};(0,i._)([(0,u.Cb)({type:Number,json:{name:"alpha",write:{enabled:!0,isRequired:!0}}})],ce.prototype,"opacity",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],ce.prototype,"position",void 0),ce=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelOpacityStop")],ce);const ue=ce;let pe=class extends((0,V.J)(R.wq)){constructor(){super(...arguments),this.enabled=!1,this.range=null}};(0,i._)([(0,u.Cb)({type:Boolean,json:{default:!1,write:!0}})],pe.prototype,"enabled",void 0),(0,i._)([(0,u.Cb)({type:[Number],json:{write:!0}})],pe.prototype,"range",void 0),pe=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelRangeFilter")],pe);const he=pe;var de,ye;(ye=de||(de={}))[ye.Color=1]="Color",ye[ye.Alpha=2]="Alpha",ye[ye.Both=3]="Both";let me=class extends((0,V.J)(R.wq)){constructor(e){super(e),this.interpolation=null,this.stretchRange=null,this.rangeFilter=null,this._colorMapSize=256,this.colorStops=new(s.Z.ofType(le)),this.opacityStops=new(s.Z.ofType(ue))}set colorStops(e){this._set("colorStops",(0,ne.Z)(e,this._get("colorStops"),s.Z.ofType(le)))}set opacityStops(e){this._set("opacityStops",(0,ne.Z)(e,this._get("opacityStops"),s.Z.ofType(ue)))}getPreviousNext(e,t,r){let i=e;for(;--i>0&&t[i].type!==r&&t[i].type!==de.Both;);let s=e;const n=t.length;for(;++s<n&&t[s].type!==r&&t[s].type!==de.Both;);return[i,s]}get rasterizedTransferFunction(){const e=[];if(this.colorStops.length<2)return e;const t=[],r=[];for(const t of this.colorStops){if(!t.color)return e;r.push({color:{r:t.color.r,g:t.color.g,b:t.color.b,a:Math.round(255*(1-t.color.a))},position:t.position,type:de.Color})}if(0===this.opacityStops.length)for(const e of r)t.push({color:e.color,position:e.position});else{for(const e of this.opacityStops){const t=(0,oe.uZ)(e.position,0,1),i=Math.round(255*(0,oe.uZ)(1-e.opacity,0,1));let s=!1;for(const e of r)if(e.type===de.Color&&Math.abs(e.position-t)<1e-5){e.color.a=i,e.type=de.Both,s=!0;break}s||r.push({color:{r:0,g:0,b:0,a:i},position:e.position,type:de.Alpha})}r.sort(((e,t)=>e.position<t.position?-1:1));const e=r.length;for(let t=0;t<e;++t){const i=r[t];if(i.type!==de.Both)if(i.type===de.Color){const[s,n]=this.getPreviousNext(t,r,de.Alpha);if(-1!==s&&n!==e){const e=(i.position-r[s].position)/(r[n].position-r[s].position);i.color.a=Math.round((0,oe.t7)(r[s].color.a,r[n].color.a,e))}else i.color.a=-1!==s?r[s].color.a:r[n].color.a}else{const[s,n]=this.getPreviousNext(t,r,de.Color);if(-1!==s&&n!==e){const e=(i.position-r[s].position)/(r[n].position-r[s].position),t=r[s].color,o=r[n].color;["r","g","b"].forEach((r=>{i.color[r]=Math.round((0,oe.t7)(t[r],o[r],e))}))}else["r","g","b"].forEach(-1!==s?e=>{i.color[e]=r[s][e]}:e=>{i.color[e]=r[n][e]})}}for(const e of r)t.push({color:e.color,position:e.position})}t[0].position=0,t[t.length-1].position=1;let i=0,s=1;for(let r=0;r<this._colorMapSize;++r){const n=r/this._colorMapSize;for(;n>t[s].position;)i=s++;const o=(n-t[i].position)/(t[s].position-t[i].position),a=t[i].color,l=t[s].color,c=new re.Z;["r","g","b"].forEach((e=>{c[e]=Math.round((0,oe.t7)(a[e],l[e],o))})),c.a=(0,oe.uZ)(1-(0,oe.t7)(a.a,l.a,o)/255,0,1),e.push(c)}return e}getColorForContinuousDataValue(e,t){const r=this.rasterizedTransferFunction;if(this.colorStops.length<2||!Array.isArray(this.stretchRange)||this.stretchRange.length<2||r.length<256)return null;let i=this.stretchRange[0],s=this.stretchRange[1];if(i>s){const e=i;i=s,s=e}e=(0,oe.uZ)(e,i,s);const n=r[Math.round((e-i)/(s-i)*(this._colorMapSize-1))].clone();return t||(n.a=1),n}};(0,i._)([(0,u.Cb)({type:["linear","nearest"],json:{write:!0}})],me.prototype,"interpolation",void 0),(0,i._)([(0,u.Cb)({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],me.prototype,"stretchRange",void 0),(0,i._)([(0,u.Cb)({type:s.Z.ofType(le),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.colorStops&&this.colorStops.length>0}}}}})],me.prototype,"colorStops",null),(0,i._)([(0,u.Cb)({type:s.Z.ofType(ue),json:{read:{source:"alphaStops"},write:{enabled:!0,target:"alphaStops",overridePolicy(){return{enabled:!!this.opacityStops&&this.opacityStops.length>0}}}}})],me.prototype,"opacityStops",null),(0,i._)([(0,u.Cb)({type:he,json:{write:!0}})],me.prototype,"rangeFilter",void 0),(0,i._)([(0,u.Cb)({type:[re.Z],clonable:!1,json:{read:!1}})],me.prototype,"rasterizedTransferFunction",null),me=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelTransferFunctionStyle")],me);const ge=me;let fe=class extends((0,V.J)(R.wq)){constructor(){super(...arguments),this.color=re.Z.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label=""}};(0,i._)([(0,u.Cb)({type:re.Z,json:{type:[p.z8],write:{enabled:!0,isRequired:!0}}})],fe.prototype,"color",void 0),(0,i._)([(0,u.Cb)({type:p.z8,json:{write:{enabled:!0,isRequired:!0}}})],fe.prototype,"value",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{default:!0,write:!0}})],fe.prototype,"enabled",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],fe.prototype,"label",void 0),fe=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelUniqueValue")],fe);const be=fe;var ve;let _e=ve=class extends R.wq{constructor(e){super(e),this.variableId=0,this.label="",this.transferFunction=null,this.uniqueValues=null,this.isosurfaces=null,this.uniqueValues=new(s.Z.ofType(be)),this.isosurfaces=new(s.Z.ofType(se))}clone(){return new ve({variableId:this.variableId,label:this.label,transferFunction:(0,te.d9)(this.transferFunction),uniqueValues:(0,te.d9)(this.uniqueValues),isosurfaces:(0,te.d9)(this.isosurfaces)})}};(0,i._)([(0,u.Cb)({type:p.z8,json:{write:{enabled:!0,isRequired:!0}}})],_e.prototype,"variableId",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],_e.prototype,"label",void 0),(0,i._)([(0,u.Cb)({type:ge,json:{write:{enabled:!0,overridePolicy(){return{enabled:!this.uniqueValues||this.uniqueValues.length<1}}}}})],_e.prototype,"transferFunction",void 0),(0,i._)([(0,u.Cb)({type:s.Z.ofType(be),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.uniqueValues&&this.uniqueValues.length>0}}}}})],_e.prototype,"uniqueValues",void 0),(0,i._)([(0,u.Cb)({type:s.Z.ofType(se),json:{write:{enabled:!0,overridePolicy(){const e=!this.uniqueValues||this.uniqueValues.length<1,t=!!this.isosurfaces&&this.isosurfaces.length>0;return{enabled:e&&t}}}}})],_e.prototype,"isosurfaces",void 0),_e=ve=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelVariableStyle")],_e);const we=_e;var Se=r(94139),xe=r(82971),Ce=r(8744);let je=class extends R.wq{constructor(){super(...arguments),this.values=null}};(0,i._)([(0,u.Cb)({type:[Number],json:{write:!0}})],je.prototype,"values",void 0),je=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelIrregularSpacing")],je);const Ie=je;let Ve=class extends R.wq{constructor(){super(...arguments),this.scale=1,this.offset=0}};(0,i._)([(0,u.Cb)({type:Number,json:{write:!0}})],Ve.prototype,"scale",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:!0}})],Ve.prototype,"offset",void 0),Ve=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelRegularSpacing")],Ve);const Me=Ve;let Re=class extends R.wq{constructor(){super(...arguments),this.irregularSpacing=null,this.isPositiveUp=!0,this.isWrappedDateLine=!1,this.label=null,this.name=null,this.quantity=null,this.regularSpacing=null,this.size=0,this.unit=null}get isRegular(){return(null==this.irregularSpacing||void 0===this.irregularSpacing)&&null!==this.regularSpacing}getRange(){return this.isRegular?[this.regularSpacing.offset,this.regularSpacing.offset+this.regularSpacing.scale*(this.size-1)]:Array.isArray(this.irregularSpacing?.values)&&this.irregularSpacing.values.length>1?[this.irregularSpacing.values[0],this.irregularSpacing.values[this.irregularSpacing.values.length-1]]:[0,0]}};(0,i._)([(0,u.Cb)({type:Ie,json:{write:!0}})],Re.prototype,"irregularSpacing",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],Re.prototype,"isPositiveUp",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],Re.prototype,"isWrappedDateLine",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],Re.prototype,"label",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],Re.prototype,"name",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],Re.prototype,"quantity",void 0),(0,i._)([(0,u.Cb)({type:Me,json:{write:!0}})],Re.prototype,"regularSpacing",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:!0}})],Re.prototype,"size",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],Re.prototype,"unit",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{read:!1}})],Re.prototype,"isRegular",null),Re=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelDimension")],Re);const Ae=Re,Ne="esri.layers.voxel.VoxelVolume",Te=o.Z.getLogger(Ne);let qe=class extends R.wq{constructor(e){super(e),this.id=0,this.dimensions=null,this.spatialReference=xe.Z.WGS84}get zDimension(){if(!this.dimensions)return-1;if(!Array.isArray(this.dimensions))return-1;if(4!==this.dimensions.length)return-1;for(let e=2;e<4;++e)if(this.dimensions[e].size>0)return e;return-1}get isValid(){return!(!this.dimensions||!Array.isArray(this.dimensions)||4!==this.dimensions.length||this.dimensions[0].size<1||this.dimensions[1].size<1||-1===this.zDimension||this.dimensions[this.zDimension].size<1)}get originInLayerSpace3D(){if(!this.isValid||"xyt"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),t=this.dimensions[1].getRange(),r=this.dimensions[2],i=r.isRegular?r.getRange():[0,r.size];return[e[0],t[0],i[0]]}get voxelSizeInLayerSpaceSigned(){if(!this.isValid||"xyt"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),t=this.dimensions[1].getRange(),r=this.dimensions[2],i=r.isRegular?r.getRange():[0,r.size],s=[this.sizeInVoxels[0],this.sizeInVoxels[1],this.sizeInVoxels[2]];for(let e=0;e<3;++e)s[e]<2?s[e]=1:s[e]-=1;return r.isRegular&&!r.isPositiveUp&&(s[2]*=-1),[(e[1]-e[0])/s[0],(t[1]-t[0])/s[1],(i[1]-i[0])/s[2]]}get volumeType(){if(this.isValid){const e=this.dimensions[2].size>0,t=this.dimensions[3].size>0;if(!e&&t)return"xyt";if(e&&t)return"xyzt"}return"xyz"}get sizeInVoxels(){if(!this.isValid)return[0,0,0];const e=this.zDimension;return[this.dimensions[0].size,this.dimensions[1].size,this.dimensions[e].size]}computeVoxelSpaceLocation(e){if(!this.isValid)return[0,0,0];if("xyt"===this.volumeType)return Te.error("computeVoxelSpacePosition cannot be used with XYT volumes."),[0,0,0];if(!(0,Ce.fS)(this.spatialReference,e.spatialReference))return Te.error("pos argument should have the same spatial reference as the VoxelLayer."),[0,0,0];const t=(0,m.f)(e.x,e.y,e.z??0);(0,y.b)(t,t,this.originInLayerSpace3D),(0,y.C)(t,t,this.voxelSizeInLayerSpaceSigned);const r=this.dimensions[this.zDimension];if(!r.isRegular&&Array.isArray(r.irregularSpacing?.values)&&r.irregularSpacing.values.length>1){const i=e.z??0,s=r.irregularSpacing.values,n=r.isPositiveUp?1:-1,o=s.reduce(((e,t)=>Math.abs(n*t-i)<Math.abs(n*e-i)?t:e));for(let e=0;e<s.length;++e)if(s[e]===o){t[2]=e;break}}return[t[0],t[1],t[2]]}computeLayerSpaceLocation(e){if(!this.isValid)return new Se.Z({x:0,y:0,spatialReference:this.spatialReference});const t=(0,m.d)(e);if((0,y.B)(t,t,this.voxelSizeInLayerSpaceSigned),(0,y.a)(t,t,this.originInLayerSpace3D),"xyt"===this.volumeType)return new Se.Z({x:t[0],y:t[1],spatialReference:this.spatialReference});const r=this.dimensions[this.zDimension];return r.isRegular||Array.isArray(r.irregularSpacing?.values)&&(e[2]<0?t[2]=r.irregularSpacing.values[0]:e[2]<r.irregularSpacing.values.length?t[2]=r.irregularSpacing.values[e[2]]:t[2]=r.irregularSpacing.values[r.irregularSpacing.values.length-1],r.isPositiveUp||(t[2]*=-1)),new Se.Z({x:t[0],y:t[1],z:t[2],spatialReference:this.spatialReference})}};(0,i._)([(0,u.Cb)({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],qe.prototype,"id",void 0),(0,i._)([(0,u.Cb)({type:[Ae],json:{write:{enabled:!0,isRequired:!0}}})],qe.prototype,"dimensions",void 0),(0,i._)([(0,u.Cb)({type:xe.Z,json:{read:{enabled:!1}}})],qe.prototype,"spatialReference",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{read:!1}})],qe.prototype,"zDimension",null),(0,i._)([(0,u.Cb)({type:[Boolean],json:{read:!1}})],qe.prototype,"isValid",null),(0,i._)([(0,u.Cb)({type:[Number],json:{read:!1}})],qe.prototype,"originInLayerSpace3D",null),(0,i._)([(0,u.Cb)({type:[Number],json:{read:!1}})],qe.prototype,"voxelSizeInLayerSpaceSigned",null),(0,i._)([(0,u.Cb)({type:["xyz","xyzt","xyt"],json:{read:{enabled:!1}}})],qe.prototype,"volumeType",null),(0,i._)([(0,u.Cb)({type:[Number],json:{read:!1}})],qe.prototype,"sizeInVoxels",null),qe=(0,i._)([(0,d.j)(Ne)],qe);const De=qe;var Ee;let ze=Ee=class extends R.wq{constructor(){super(...arguments),this.apronWidth=1,this.brickSize=[32,32,32],this.maxLodLevel=0,this.nodeSize=[4,4,4]}isValid(){const e=new Ee;return e.apronWidth===this.apronWidth&&e.maxLodLevel===this.maxLodLevel&&!!this.brickSize&&!!this.nodeSize&&!(!Array.isArray(this.brickSize)||!Array.isArray(this.nodeSize))&&3===this.brickSize.length&&3===this.nodeSize.length&&32===this.brickSize[0]&&32===this.brickSize[1]&&32===this.brickSize[2]&&4===this.nodeSize[0]&&4===this.nodeSize[1]&&4===this.nodeSize[2]}};(0,i._)([(0,u.Cb)({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],ze.prototype,"apronWidth",void 0),(0,i._)([(0,u.Cb)({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],ze.prototype,"brickSize",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],ze.prototype,"maxLodLevel",void 0),(0,i._)([(0,u.Cb)({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],ze.prototype,"nodeSize",void 0),ze=Ee=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelVolumeIndex")],ze);const Oe=ze;let Ze=class extends((0,V.J)(R.wq)){constructor(e){super(e),this.enabled=!0,this.label="",this.normal=null,this.point=null}get orientation(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,t]=L(this.normal);return M.BV.normalize((0,p.q9)(e),0,!0)}set orientation(e){const t=k(e,this.tilt);this._set("normal",t),this._set("orientation",e)}get tilt(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,t]=L(this.normal);return M.BV.normalize((0,p.q9)(t),0,!0)}set tilt(e){const t=k(this.orientation,e);this._set("normal",t),this._set("tilt",e)}};(0,i._)([(0,u.Cb)({type:Boolean,json:{default:!0,write:!0}})],Ze.prototype,"enabled",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],Ze.prototype,"label",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),(0,U.p)((e=>M.BV.normalize((0,p.q9)(e),0,!0)))],Ze.prototype,"orientation",null),(0,i._)([(0,u.Cb)({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),(0,U.p)((e=>M.BV.normalize((0,p.q9)(e),0,!0)))],Ze.prototype,"tilt",null),(0,i._)([(0,u.Cb)({type:[Number],json:{write:!0}})],Ze.prototype,"normal",void 0),(0,i._)([(0,u.Cb)({type:[Number],json:{write:!0}})],Ze.prototype,"point",void 0),Ze=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelDynamicSection")],Ze);const Fe=Ze;var Pe;let Le=Pe=class extends R.wq{constructor(e){super(e),this.volumeId=0,this.verticalExaggeration=1,this.exaggerationMode="scale-height",this.verticalOffset=0,this.slices=new(s.Z.ofType($)),this.dynamicSections=new(s.Z.ofType(Fe))}set slices(e){this._set("slices",(0,ne.Z)(e,this._get("slices"),s.Z.ofType($)))}set dynamicSections(e){this._set("dynamicSections",(0,ne.Z)(e,this._get("dynamicSections"),s.Z.ofType(Fe)))}clone(){return new Pe({volumeId:this.volumeId,verticalExaggeration:this.verticalExaggeration,exaggerationMode:this.exaggerationMode,verticalOffset:this.verticalOffset,slices:(0,te.d9)(this.slices),dynamicSections:(0,te.d9)(this.dynamicSections)})}};(0,i._)([(0,u.Cb)({type:p.z8,json:{write:{enabled:!0,isRequired:!0}}})],Le.prototype,"volumeId",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{default:1,write:!0}})],Le.prototype,"verticalExaggeration",void 0),(0,i._)([(0,u.Cb)({type:["scale-position","scale-height"],json:{default:"scale-height",write:!0}})],Le.prototype,"exaggerationMode",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{default:0,write:!0}})],Le.prototype,"verticalOffset",void 0),(0,i._)([(0,u.Cb)({type:s.Z.ofType($),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.slices&&this.slices.length>0}}}}})],Le.prototype,"slices",null),(0,i._)([(0,u.Cb)({type:s.Z.ofType(Fe),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.dynamicSections&&this.dynamicSections.length>0}}}}})],Le.prototype,"dynamicSections",null),Le=Pe=(0,i._)([(0,d.j)("esri.layers.voxel.VoxelVolumeStyle")],Le);const ke=Le;var Ue=r(32163);const Be="esri.layers.VoxelLayer",$e=o.Z.getLogger(Be);let Ke=class extends((0,x.Vt)((0,v.Y)((0,_.q)((0,w.I)((0,S.M)((0,l.R)((0,b.V)(f.Z)))))))){constructor(e){super(e),this.serviceRoot="",this.operationalLayerType="Voxel",this.legendEnabled=!0,this.title=null,this.sections=null,this.currentVariableId=0,this.volumeStyles=null,this.renderMode="volume",this.variableStyles=null,this.enableSlices=!0,this.enableSections=!0,this.enableDynamicSections=!0,this.enableIsosurfaces=!0,this.shading=new W,this.opacity=1,this.variables=new s.Z,this.volumes=new s.Z,this.index=null,this.minScale=0,this.maxScale=0,this.type="voxel",this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.fullExtent=null,this.popupEnabled=!0,this.popupTemplate=null,this.test=null,this.volumeStyles=new(s.Z.ofType(ke)),this.variableStyles=new(s.Z.ofType(we)),this.sections=new(s.Z.ofType(Y)),e?.constantUpscaling&&(this.test={constantUpscaling:!0})}set url(e){this._set("url",(0,C.Nm)(e,$e))}load(e){const t=(0,a.pC)(e)?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(c.r9).then((()=>this._fetchService(t))).then((()=>this.serviceRoot=this.url));return this.addResolvingPromise(r),Promise.resolve(this)}read(e,t){super.read(e,t);for(const e of this.volumes)e.spatialReference=this.spatialReference}readVersion(e,t){return super.parseVersionString(e)}validateLayer(e){if(e.layerType&&e.layerType!==this.operationalLayerType)throw new n.Z("voxel-layer:layer-type-not-supported","VoxelLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor)||this.version.major<3)throw new n.Z("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"});if(this.version.major>3)throw new n.Z("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"})}readFullExtent(e,t,r){if(null!=e&&"object"==typeof e){const i=g.Z.fromJSON(e,r);if(0===i.zmin&&0===i.zmax&&Array.isArray(t.volumes)){const e=De.fromJSON(t.volumes[0]);if(e.isValid&&"xyt"!==e.volumeType){const t=e.dimensions[2];if(t.isRegular){let e=t.regularSpacing.offset,r=t.regularSpacing.offset+t.regularSpacing.scale*(t.size-1);if(e>r){const t=e;e=r,r=t}i.zmin=e,i.zmax=r}}}return i}return null}get voxelFields(){const e=[new I.Z({name:"Voxel.ServiceValue",alias:"Value",domain:null,editable:!1,length:128,type:"string"}),new I.Z({name:"Voxel.ServiceVariableLabel",alias:"Variable",domain:null,editable:!1,length:128,type:"string"}),new I.Z({name:"Voxel.Position",alias:"Voxel Position",domain:null,editable:!1,length:128,type:"string"})],t=this.getVolume(null);if((0,a.pC)(t)){if("xyzt"===t.volumeType||"xyt"===t.volumeType){const t=new I.Z({name:"Voxel.ServiceLocalTime",alias:"Local Time",domain:null,editable:!1,length:128,type:"string"});e.push(t);const r=new I.Z({name:"Voxel.ServiceNativeTime",alias:"Native Time",domain:null,editable:!1,length:128,type:"string"});e.push(r)}if("xyt"!==t.volumeType){const t=new I.Z({name:"Voxel.ServiceDepth",alias:"Depth",domain:null,editable:!1,length:128,type:"string"});e.push(t)}}return e}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const t=this.voxelFields,r=this.title;return(0,Ue.eZ)({fields:t,title:r},e)}getConfiguration(){const e={layerType:this.operationalLayerType,version:this.version.versionString,name:this.title,spatialReference:this.spatialReference,fullExtent:this.fullExtent,volumes:this.volumes.toJSON(),variables:this.variables.toJSON(),index:this.index?.toJSON(),sections:this.getSections(),style:{volumeStyles:this.getVolumeStyles(),currentVariableId:this.currentVariableId,renderMode:this.renderMode,variableStyles:this.getVariableStyles(),enableSections:this.enableSections,enableDynamicSections:this.enableDynamicSections,enableIsosurfaces:this.enableIsosurfaces,enableSlices:this.enableSlices,shading:this.shading}};return e.index&&this.index?.isValid()?JSON.stringify(e):""}getVariableStyle(e){let t=-1;if(t=(0,a.pC)(e)?e:this.currentVariableId,!this.variableStyles||-1===t)return null;const r=this.variableStyles.findIndex((e=>e.variableId===t));return r<0?null:this.variableStyles.getItemAt(r)}getVariable(e){let t=-1;if(t=(0,a.pC)(e)?e:this.currentVariableId,!this.variables||-1===t)return null;const r=this.variables.findIndex((e=>e.id===t));return r<0?null:this.variables.getItemAt(r)}getVolume(e){const t=this.getVariable(e);return(0,a.pC)(t)?this.volumes.find((({id:e})=>e===t.volumeId)):null}getVolumeStyle(e){const t=this.getVariable(e);return(0,a.pC)(t)?this.volumeStyles.find((({volumeId:e})=>e===t.volumeId)):null}getColorForContinuousDataValue(e,t,r){const i=this.getVariable(e);if((0,a.Wi)(i)||"continuous"!==i.renderingFormat?.continuity)return null;if(!this.variableStyles)return null;const s=this.variableStyles.findIndex((t=>t.variableId===e));if(s<0)return null;const n=this.variableStyles.getItemAt(s);return n.transferFunction?n.transferFunction.getColorForContinuousDataValue(t,r):null}getSections(){const e=[];for(const t of this.sections)e.push(new Y({enabled:t.enabled,href:t.href,id:t.id,label:t.label,normal:t.normal,point:t.point,sizeInPixel:t.sizeInPixel,slices:t.slices,timeId:t.timeId,variableId:t.variableId}));return e}getVariableStyles(){const e=[];for(const t of this.variableStyles){const r=this._getVariable(t);if((0,a.pC)(r)){const i=t.clone();i.isosurfaces.length>4&&(i.isosurfaces=i.isosurfaces.slice(0,3),$e.error("A maximum of 4 isosurfaces are supported for Voxel Layers."));for(const e of i.isosurfaces)if(!e.colorLocked){const t=this.getColorForContinuousDataValue(i.variableId,e.value,!1);null===t||t.equals(e.color)||(e.color=t)}if("continuous"===r.renderingFormat.continuity)(null===i.transferFunction||i.transferFunction.colorStops.length<2)&&$e.error(`VoxelVariableStyle for variable ${r.id} is invalid. At least 2 color stops are required in the transferFunction for continuous Voxel Layer variables.`),null!==i.transferFunction&&(Array.isArray(i.transferFunction.stretchRange)&&2===i.transferFunction.stretchRange.length||($e.error(`VoxelVariableStyle for variable ${r.id} is invalid. The stretchRange of the transferFunction for continuous Voxel Layer variables must be of the form [minimumDataValue, maximumDataValue].`),i.transferFunction.stretchRange=[0,1],i.transferFunction.colorStops.removeAll()));else if("discrete"===r.renderingFormat.continuity)if(0===t.uniqueValues.length)$e.error(`VoxelVariableStyle for variable ${r.id} is invalid. Unique values are required for discrete Voxel Layer variables.`);else for(const e of t.uniqueValues)null!==e.label&&void 0!==e.label||null===e.value||void 0===e.value||(e.label=e.value.toString());e.push(i)}else $e.error(`VoxelVariable ID=${t.variableId} doesn't exist, VoxelVariableStyle for this VoxelVariable will be ignored.`)}return e}getVolumeStyles(){const e=[];for(const t of this.volumeStyles){const r=this._getVolumeFromVolumeId(t.volumeId);if((0,a.pC)(r)){const i=t.clone();for(const e of i.slices)this._isPlaneValid(e,[0,1,r.zDimension],r.dimensions)||(e.enabled=!1,e.label="invalid");for(const e of i.dynamicSections)this._isPlaneValid(e,[0,1,r.zDimension],r.dimensions)||(e.enabled=!1,e.label="invalid");e.push(i)}else $e.error(`VoxelVolume ID=${t.volumeId} doesn't exist, VoxelVolumeStyle for this VoxelVolume will be ignored.`)}return e}_getVariable(e){const t=e.variableId;for(const e of this.variables)if(e.id===t)return e;return null}_getVolumeFromVolumeId(e){for(const t of this.volumes)if(t.id===e)return t;return null}_isPlaneValid(e,t,r){if(!e.point)return!1;if(!Array.isArray(e.point)||3!==e.point.length)return!1;if(!e.normal)return!1;if(!Array.isArray(e.normal)||3!==e.normal.length)return!1;for(let i=0;i<3;++i){const s=e.point[i];if(s<0||s>=r[t[i]].size)return!1}const i=(0,m.f)(e.normal[0],e.normal[1],e.normal[2]);return(0,y.n)(i,i),!(Math.abs(i[0])+Math.abs(i[1])+Math.abs(i[2])<1e-6||(e.normal[0]=i[0],e.normal[1]=i[1],e.normal[2]=i[2],0))}};(0,i._)([(0,u.Cb)({type:["Voxel"]})],Ke.prototype,"operationalLayerType",void 0),(0,i._)([(0,u.Cb)(j.rn)],Ke.prototype,"legendEnabled",void 0),(0,i._)([(0,u.Cb)({json:{write:!0}})],Ke.prototype,"title",void 0),(0,i._)([(0,u.Cb)(j.HQ)],Ke.prototype,"url",null),(0,i._)([(0,u.Cb)({type:s.Z.ofType(Y),json:{origins:{"web-scene":{name:"layerDefinition.sections",write:!0}}}})],Ke.prototype,"sections",void 0),(0,i._)([(0,u.Cb)({type:p.z8,json:{origins:{"web-scene":{name:"layerDefinition.style.currentVariableId",write:{enabled:!0,isRequired:!0,ignoreOrigin:!0}},service:{name:"style.currentVariableId"}}}})],Ke.prototype,"currentVariableId",void 0),(0,i._)([(0,u.Cb)({type:s.Z.ofType(ke),json:{origins:{"web-scene":{name:"layerDefinition.style.volumeStyles",write:!0},service:{name:"style.volumeStyles"}}}})],Ke.prototype,"volumeStyles",void 0),(0,i._)([(0,u.Cb)({type:["volume","surfaces"],json:{origins:{"web-scene":{name:"layerDefinition.style.renderMode",write:!0},service:{name:"style.renderMode"}}}})],Ke.prototype,"renderMode",void 0),(0,i._)([(0,u.Cb)({type:s.Z.ofType(we),json:{origins:{"web-scene":{name:"layerDefinition.style.variableStyles",write:!0},service:{name:"style.variableStyles"}}}})],Ke.prototype,"variableStyles",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSlices",write:!0},service:{name:"style.enableSlices"}}}})],Ke.prototype,"enableSlices",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSections",write:!0},service:{name:"style.enableSections"}}}})],Ke.prototype,"enableSections",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableDynamicSections",write:!0},service:{name:"style.enableDynamicSections"}}}})],Ke.prototype,"enableDynamicSections",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableIsosurfaces",write:!0},service:{name:"style.enableIsosurfaces"}}}})],Ke.prototype,"enableIsosurfaces",void 0),(0,i._)([(0,u.Cb)({type:W,json:{origins:{"web-scene":{name:"layerDefinition.style.shading",write:!0},service:{name:"style.shading"}}}})],Ke.prototype,"shading",void 0),(0,i._)([(0,u.Cb)({type:["show","hide"]})],Ke.prototype,"listMode",void 0),(0,i._)([(0,u.Cb)({type:Number,range:{min:0,max:1},nonNullable:!0,json:{read:!1,write:!1,origins:{"web-scene":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],Ke.prototype,"opacity",void 0),(0,i._)([(0,u.Cb)({type:s.Z.ofType(ee)})],Ke.prototype,"variables",void 0),(0,i._)([(0,u.Cb)({type:s.Z.ofType(De)})],Ke.prototype,"volumes",void 0),(0,i._)([(0,u.Cb)({type:Oe})],Ke.prototype,"index",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{name:"layerDefinition.minScale",read:!1,write:!1,origins:{service:{read:!1,write:!1}}}})],Ke.prototype,"minScale",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{name:"layerDefinition.maxScale",read:!1,write:!1,origins:{service:{read:!1,write:!1}}}})],Ke.prototype,"maxScale",void 0),(0,i._)([(0,u.Cb)({json:{read:!1},readOnly:!0})],Ke.prototype,"type",void 0),(0,i._)([(0,u.Cb)({readOnly:!0,json:{name:"serviceVersion"}})],Ke.prototype,"version",void 0),(0,i._)([(0,h.r)("service","version")],Ke.prototype,"readVersion",null),(0,i._)([(0,u.Cb)({type:g.Z})],Ke.prototype,"fullExtent",void 0),(0,i._)([(0,h.r)("service","fullExtent",["fullExtent"])],Ke.prototype,"readFullExtent",null),(0,i._)([(0,u.Cb)({readOnly:!0,clonable:!1,json:{read:!1}})],Ke.prototype,"voxelFields",null),(0,i._)([(0,u.Cb)(j.C_)],Ke.prototype,"popupEnabled",void 0),(0,i._)([(0,u.Cb)({readOnly:!0})],Ke.prototype,"defaultPopupTemplate",null),Ke=(0,i._)([(0,d.j)(Be)],Ke);const Je=Ke},54295:(e,t,r)=>{r.d(t,{V:()=>o});var i=r(43697),s=r(5600),n=(r(75215),r(67676),r(52011));const o=e=>{let t=class extends e{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,i._)([(0,s.Cb)({type:String})],t.prototype,"apiKey",null),t=(0,i._)([(0,n.j)("esri.layers.mixins.APIKeyMixin")],t),t}},17287:(e,t,r)=>{r.d(t,{Y:()=>c});var i=r(43697),s=r(92604),n=r(70586),o=r(5600),a=(r(75215),r(67676),r(52011)),l=r(66677);const c=e=>{let t=class extends e{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,l.Qc)(this.url);if((0,n.pC)(e)&&e.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,l.Nm)(e,s.Z.getLogger(this.declaredClass)))}};return(0,i._)([(0,o.Cb)()],t.prototype,"title",null),(0,i._)([(0,o.Cb)({type:String})],t.prototype,"url",null),t=(0,i._)([(0,a.j)("esri.layers.mixins.ArcGISService")],t),t}},32271:(e,t,r)=>{r.d(t,{xp:()=>Z,Vt:()=>N});var i=r(43697),s=r(3172),n=r(20102),o=(r(80442),r(92604)),a=r(70586),l=r(95330),c=r(17452),u=r(5600),p=(r(75215),r(67676),r(71715)),h=r(52011),d=r(30556),y=r(65845),m=r(6570),g=r(79235),f=r(82971),b=r(66677),v=r(21506),_=r(61064),w=r(65587),S=r(15235),x=r(66643),C=r(41123),j=r(97873);async function I(e,t,r){if(!t||!t.resources)return;const i=t.portalItem===e.portalItem?new Set(e.paths):new Set;e.paths.length=0,e.portalItem=t.portalItem;const s=new Set(t.resources.toKeep.map((e=>e.resource.path))),o=new Set,a=[];s.forEach((t=>{i.delete(t),e.paths.push(t)}));for(const n of t.resources.toUpdate)if(i.delete(n.resource.path),s.has(n.resource.path)||o.has(n.resource.path)){const{resource:t,content:i,finish:s,error:o}=n,l=(0,j.getSiblingOfSameTypeI)(t,(0,C.D)());e.paths.push(l.path),a.push(V({resource:l,content:i,compress:n.compress,finish:s,error:o},r))}else e.paths.push(n.resource.path),a.push(M(n,r)),o.add(n.resource.path);for(const i of t.resources.toAdd)a.push(V(i,r)),e.paths.push(i.resource.path);if(i.forEach((e=>{if(t.portalItem){const r=t.portalItem.resourceFromPath(e);a.push(r.portalItem.removeResource(r).catch((()=>{})))}})),0===a.length)return;const c=await(0,l.as)(a);(0,l.k_)(r);const u=c.filter((e=>"error"in e)).map((e=>e.error));if(u.length>0)throw new n.Z("save:resources","Failed to save one or more resources",{errors:u})}async function V(e,t){const r={...(0,a.pC)(t)?t:{},compress:e.compress},i=await(0,x.q6)(e.resource.portalItem.addResource(e.resource,e.content,r));if(!0!==i.ok)throw e.error?.(i.error),i.error;e.finish?.(e.resource)}async function M(e,t){const r=await(0,x.q6)(e.resource.update(e.content,t));if(!0!==r.ok)throw e.error?.(r.error),r.error;e.finish?.(e.resource)}const R="esri.layers.mixins.SceneService",A=o.Z.getLogger(R),N=e=>{let t=class extends e{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.indexInfo=null,this._debouncedSaveOperations=(0,l.Ds)((async(e,t,r)=>{switch(e){case Z.SAVE:return this._save(t);case Z.SAVE_AS:return this._saveAs(r,t)}}))}readSpatialReference(e,t){return this._readSpatialReference(t)}_readSpatialReference(e){if(null!=e.spatialReference)return f.Z.fromJSON(e.spatialReference);{const t=e.store,r=t.indexCRS||t.geographicCRS,i=r&&parseInt(r.substring(r.lastIndexOf("/")+1,r.length),10);return null!=i?new f.Z(i):null}}readFullExtent(e,t,r){if(null!=e&&"object"==typeof e){const i=null==e.spatialReference?{...e,spatialReference:this._readSpatialReference(t)}:e;return m.Z.fromJSON(i,r)}const i=t.store,s=this._readSpatialReference(t);return null==s||null==i||null==i.extent||!Array.isArray(i.extent)||i.extent.some((e=>e<T))?null:new m.Z({xmin:i.extent[0],ymin:i.extent[1],xmax:i.extent[2],ymax:i.extent[3],spatialReference:s})}parseVersionString(e){const t={major:Number.NaN,minor:Number.NaN,versionString:e},r=e.split(".");return r.length>=2&&(t.major=parseInt(r[0],10),t.minor=parseInt(r[1],10)),t}readVersion(e,t){const r=t.store,i=null!=r.version?r.version.toString():"";return this.parseVersionString(i)}readTitlePortalItem(e){return"item-title"!==this.sublayerTitleMode?void 0:e}readTitleService(e,t){const r=this.portalItem&&this.portalItem.title;if("item-title"===this.sublayerTitleMode)return(0,b.a7)(this.url,t.name);let i=t.name;if(!i&&this.url){const e=(0,b.Qc)(this.url);(0,a.pC)(e)&&(i=e.title)}return"item-title-and-service-name"===this.sublayerTitleMode&&r&&(i=r+" - "+i),(0,b.ld)(i)}set url(e){const t=(0,b.XG)({layer:this,url:e,nonStandardUrlAllowed:!1,logger:A});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,i){(0,b.wH)(this,e,"layers",t,i)}get parsedUrl(){const e=this._get("url"),t=(0,c.mN)(e);return null!=this.layerId&&(t.path=`${t.path}/layers/${this.layerId}`),t}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=(0,_.T)(this.parsedUrl.path,this.rootNode,e,this.apiKey,A,t),null==this.fullExtent||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(e){if("page"===e?.type){const t=e.rootIndex%e.pageSize,r=e.rootPage?.nodes?.[t];if(null==r||null==r.obb||null==r.obb.center||null==r.obb.halfSize)throw new n.Z("sceneservice:invalid-node-page","Invalid node page.");if(r.obb.center[0]<T||null==this.fullExtent||this.fullExtent.hasZ)return;const i=r.obb.halfSize,s=r.obb.center[2],o=Math.sqrt(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]);this.fullExtent.zmin=s-o,this.fullExtent.zmax=s+o}else if("node"===e?.type){const t=e.rootNode?.mbs;if(!Array.isArray(t)||4!==t.length||t[0]<T)return;const r=t[2],i=t[3],{fullExtent:s}=this;s&&(s.zmin=r-i,s.zmax=r+i)}}async _fetchService(e){if(null==this.url)throw new n.Z("sceneservice:url-not-set","Scene service can not be loaded without valid portal item or url");if(null==this.layerId&&/SceneServer\/*$/i.test(this.url)){const t=await this._fetchFirstLayerId(e);null!=t&&(this.layerId=t)}return this._fetchServiceLayer(e)}async _fetchFirstLayerId(e){const t=await(0,s.default)(this.url,{query:{f:"json",token:this.apiKey},responseType:"json",signal:e});if(t.data&&Array.isArray(t.data.layers)&&t.data.layers.length>0)return t.data.layers[0].id}async _fetchServiceLayer(e){const t=await(0,s.default)(this.parsedUrl?.path??"",{query:{f:"json",token:this.apiKey},responseType:"json",signal:e});t.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));let r=!1;if(t.data.layerType&&"Voxel"===t.data.layerType&&(r=!0),r)return this._fetchVoxelServiceLayer();const i=t.data;this.read(i,this._getServiceContext()),this.validateLayer(i)}async _fetchVoxelServiceLayer(e){const t=(await(0,s.default)(this.parsedUrl?.path+"/layer",{query:{f:"json",token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,this._getServiceContext()),this.validateLayer(t)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&"function"==typeof this.beforeSave&&await this.beforeSave()}validateLayer(e){}_updateTypeKeywords(e,t,r){e.typeKeywords||(e.typeKeywords=[]);const i=t.getTypeKeywords();for(const t of i)e.typeKeywords.push(t);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)),r===D.newItem&&(e.typeKeywords=e.typeKeywords.filter((e=>"Hosted Service"!==e))))}async _saveAs(e,t){const r={...O,...t};let i=S.default.from(e);i||(A.error("_saveAs(): requires a portal item parameter"),await Promise.reject(new n.Z("sceneservice:portal-item-required","_saveAs() requires a portal item to save to"))),i.id&&(i=i.clone(),i.id=null);const s=i.portal||w.Z.getDefault();await this._ensureLoadBeforeSave(),i.type=z,i.portal=s;const o={origin:"portal-item",url:null,messages:[],portal:s,portalItem:i,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],propertyPendingOperations:[],pendingOperations:[]}},a={layers:[this.write({},o)]};return await Promise.all(o.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(a,o,r),i.url=this.url,i.title||(i.title=this.title),this._updateTypeKeywords(i,r,D.newItem),await s.signIn(),await(s.user?.addItem({item:i,folder:r&&r.folder,data:a})),await I(this.resourceReferences,o,null),this.portalItem=i,(0,y.D)(o),o.portalItem=i,i}async _save(e){const t={...O,...e};if(!this.portalItem)throw A.error("_save(): requires the .portalItem property to be set"),new n.Z("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==z)throw A.error("_save(): Non-matching portal item type. Got "+this.portalItem.type+", expected "+z),new n.Z("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${z}"`);await this._ensureLoadBeforeSave();const r={origin:"portal-item",url:this.portalItem.itemUrl&&(0,c.mN)(this.portalItem.itemUrl),messages:[],portal:this.portalItem.portal||w.Z.getDefault(),portalItem:this.portalItem,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],propertyPendingOperations:[],pendingOperations:[]}},i={layers:[this.write({},r)]};return await Promise.all(r.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(i,r,t),this.portalItem.url=this.url,this.portalItem.title||(this.portalItem.title=this.title),this._updateTypeKeywords(this.portalItem,t,D.existingItem),await this.portalItem.update({data:i}),await I(this.resourceReferences,r,null),(0,y.D)(r),this.portalItem}async _validateAgainstJSONSchema(e,t,i){let s=t.messages?.filter((e=>"error"===e.type)).map((e=>new n.Z(e.name,e.message,e.details)))??[];if(i&&i.validationOptions?.ignoreUnsupported&&(s=s.filter((e=>"layer:unsupported"!==e.name&&"symbol:unsupported"!==e.name&&"symbol-layer:unsupported"!==e.name&&"property:unsupported"!==e.name&&"url:unsupported"!==e.name&&"scenemodification:unsupported"!==e.name))),i.validationOptions?.enabled||q){const t=(await r.e(5015).then(r.bind(r,25015))).validate(e,i.portalItemLayerType);if(t.length>0){const e=`Layer item did not validate:\n${t.join("\n")}`;if(A.error(`_validateAgainstJSONSchema(): ${e}`),"throw"===i.validationOptions?.failPolicy){const e=t.map((e=>new n.Z("sceneservice:schema-validation",e))).concat(s);throw new n.Z("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{combined:e})}}}if(s.length>0)throw new n.Z("sceneservice:save","Failed to save SceneService due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:s})}};return(0,i._)([(0,u.Cb)(v.id)],t.prototype,"id",void 0),(0,i._)([(0,u.Cb)({type:f.Z})],t.prototype,"spatialReference",void 0),(0,i._)([(0,p.r)("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],t.prototype,"readSpatialReference",null),(0,i._)([(0,u.Cb)({type:m.Z})],t.prototype,"fullExtent",void 0),(0,i._)([(0,p.r)("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],t.prototype,"readFullExtent",null),(0,i._)([(0,u.Cb)({readOnly:!0,type:g.Z})],t.prototype,"heightModelInfo",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],t.prototype,"minScale",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],t.prototype,"maxScale",void 0),(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"version",void 0),(0,i._)([(0,p.r)("version",["store.version"])],t.prototype,"readVersion",null),(0,i._)([(0,u.Cb)({type:String,json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),(0,i._)([(0,u.Cb)({type:String,json:{read:!1}})],t.prototype,"sublayerTitleMode",void 0),(0,i._)([(0,u.Cb)({type:String})],t.prototype,"title",void 0),(0,i._)([(0,p.r)("portal-item","title")],t.prototype,"readTitlePortalItem",null),(0,i._)([(0,p.r)("service","title",["name"])],t.prototype,"readTitleService",null),(0,i._)([(0,u.Cb)({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],t.prototype,"layerId",void 0),(0,i._)([(0,u.Cb)(v.HQ)],t.prototype,"url",null),(0,i._)([(0,d.c)("url")],t.prototype,"writeUrl",null),(0,i._)([(0,u.Cb)()],t.prototype,"parsedUrl",null),(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"store",void 0),(0,i._)([(0,u.Cb)({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],t.prototype,"rootNode",void 0),t=(0,i._)([(0,h.j)(R)],t),t},T=-1e38,q=!1;var D,E;(E=D||(D={}))[E.existingItem=0]="existingItem",E[E.newItem=1]="newItem";const z="Scene Service",O={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}};var Z;!function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(Z||(Z={}))},61064:(e,t,r)=>{r.d(t,{T:()=>o});var i=r(3172),s=r(20102),n=r(70586);async function o(e,t,r,o,a,l){let c=null;if((0,n.pC)(r)){const t=`${e}/nodepages/`,s=t+Math.floor(r.rootIndex/r.nodesPerPage);try{return{type:"page",rootPage:(await(0,i.default)(s,{query:{f:"json",token:o},responseType:"json",signal:l})).data,rootIndex:r.rootIndex,pageSize:r.nodesPerPage,lodMetric:r.lodSelectionMetricType,urlPrefix:t}}catch(e){(0,n.pC)(a)&&a.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",s,e),c=e}}if(!t)return null;const u=`${e}/nodes/`,p=u+(t&&t.split("/").pop());try{return{type:"node",rootNode:(await(0,i.default)(p,{query:{f:"json",token:o},responseType:"json",signal:l})).data,urlPrefix:u}}catch(e){throw new s.Z("sceneservice:root-node-missing","Root node missing.",{pageError:c,nodeError:e,url:p})}}},97873:(e,t,r)=>{r.r(t),r.d(t,{addOrUpdateResource:()=>l,contentToBlob:()=>d,fetchResources:()=>a,getSiblingOfSameType:()=>y,getSiblingOfSameTypeI:()=>m,removeAllResources:()=>u,removeResource:()=>c,splitPrefixFileNameAndExtension:()=>h});var i=r(3172),s=r(20102),n=r(70586),o=r(17452);async function a(e,t={},r){await e.load(r);const i=(0,o.v_)(e.itemUrl,"resources"),{start:s=1,num:a=10,sortOrder:l="asc",sortField:c="created"}=t,u={query:{start:s,num:a,sortOrder:l,sortField:c,token:e.apiKey},signal:(0,n.U2)(r,"signal")},p=await e.portal.request(i,u);return{total:p.total,nextStart:p.nextStart,resources:p.resources.map((({created:t,size:r,resource:i})=>({created:new Date(t),size:r,resource:e.resourceFromPath(i)})))}}async function l(e,t,r,i){if(!e.hasPath())throw new s.Z(`portal-item-resource-${t}:invalid-path`,"Resource does not have a valid path");const a=e.portalItem;await a.load(i);const l=(0,o.v_)(a.userItemUrl,"add"===t?"addResources":"updateResources"),[c,u]=p(e.path),h=await d(r),y=new FormData;return c&&"."!==c&&y.append("resourcesPrefix",c),(0,n.pC)(i)&&i.compress&&y.append("compress","true"),y.append("fileName",u),y.append("file",h,u),y.append("f","json"),(0,n.pC)(i)&&i.access&&y.append("access",i.access),await a.portal.request(l,{method:"post",body:y,signal:(0,n.U2)(i,"signal")}),e}async function c(e,t,r){if(!t.hasPath())throw new s.Z("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await e.load(r);const i=(0,o.v_)(e.userItemUrl,"removeResources");await e.portal.request(i,{method:"post",query:{resource:t.path},signal:(0,n.U2)(r,"signal")}),t.portalItem=null}async function u(e,t){await e.load(t);const r=(0,o.v_)(e.userItemUrl,"removeResources");return e.portal.request(r,{method:"post",query:{deleteAll:!0},signal:(0,n.U2)(t,"signal")})}function p(e){const t=e.lastIndexOf("/");return-1===t?[".",e]:[e.slice(0,t),e.slice(t+1)]}function h(e){const[t,r]=function(e){const t=(0,o.Ml)(e);return(0,n.Wi)(t)?[e,""]:[e.slice(0,e.length-t.length-1),`.${t}`]}(e),[i,s]=p(t);return[i,s,r]}async function d(e){return e instanceof Blob?e:(await(0,i.default)(e.url,{responseType:"blob"})).data}function y(e,t){if(!e.hasPath())return null;const[r,,i]=h(e.path);return e.portalItem.resourceFromPath((0,o.v_)(r,t+i))}function m(e,t){if(!e.hasPath())return null;const[r,,i]=h(e.path);return e.portalItem.resourceFromPath((0,o.v_)(r,t+i))}},32163:(e,t,r)=>{r.d(t,{eZ:()=>p});var i=r(51773),s=r(35671),n=r(84649),o=(r(63801),r(48074),r(38745),r(9190)),a=(r(10214),r(71423),r(44951),r(422)),l=r(63061);const c=["oid","global-id"],u=["oid","global-id","guid"];function p({displayField:e,editFieldsInfo:t,fields:r,objectIdField:l,title:c},u){if(!r)return null;const p=function({editFieldsInfo:e,fields:t,objectIdField:r},i){return function(e,t){const r=e;return t&&(e=e.filter((e=>!t.includes(e.type)))),e===r&&(e=e.slice()),e.sort(y),e}(t??[],i?.ignoreFieldTypes||v).map((t=>new a.Z({fieldName:t.name,isEditable:g(t,e),label:t.alias,format:f(t),visible:d(t,{editFieldsInfo:e,objectIdField:r,visibleFieldNames:i?.visibleFieldNames})})))}({editFieldsInfo:t,fields:r,objectIdField:l},u);if(!p.length)return null;const h=function(e){const t=(0,s.O5)(e),{titleBase:r}=e;return t?`${r}: {${t.trim()}}`:r??""}({titleBase:c,fields:r,displayField:e}),m=[new o.Z,new n.Z];return new i.Z({title:h,content:m,fieldInfos:p})}const h=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/shape/i,/perimeter/i,/objectid/i,/_i$/i],d=(e,{editFieldsInfo:t,objectIdField:r,visibleFieldNames:i})=>i?i.has(e.name):!(m(e.name,t)||r&&e.name===r||c.includes(e.type)||h.some((t=>t.test(e.name))));function y(e,t){return"oid"===e.type?-1:"oid"===t.type?1:b(e)?-1:b(t)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((t.alias||t.name).toLocaleLowerCase())}function m(e,t){if(!e||!t)return!1;const{creationDateField:r,creatorField:i,editDateField:s,editorField:n}=t;return[r&&r.toLowerCase(),i&&i.toLowerCase(),s&&s.toLowerCase(),n&&n.toLowerCase()].includes(e.toLowerCase())}function g(e,t){return e.editable&&!u.includes(e.type)&&!m(e.name,t)}function f(e){switch(e.type){case"small-integer":case"integer":case"single":return new l.Z({digitSeparator:!0,places:0});case"double":return new l.Z({digitSeparator:!0,places:2});case"date":return new l.Z({dateFormat:"long-month-day-year"});default:return"string"===e.type&&(0,s.Ec)(e.name)?new l.Z({digitSeparator:!0,places:0}):null}}function b(e){return"name"===(e.name&&e.name.toLowerCase())||"name"===(e.alias&&e.alias.toLowerCase())}const v=["geometry","blob","raster","guid","xml"]}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[690],{28659:(e,t,r)=>{r.d(t,{B:()=>g});var n=r(81153),i=r(17452),o=r(41123),s=r(7628),a=r(31263),l=r(5600);function p(e){return u[function(e){return e instanceof Blob?e.type:function(e){const t=(0,i.Ml)(e);return d[t]||c}(e.url)}(e)]||y}const u={},c="text/plain",y=u[c],d={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const e in d)u[d[e]]=e;var f=r(25929);function g(e){const t=e?.origins??[void 0];return(r,o)=>{const u=function(e,t,r){if("resource"===e?.type)return function(e,t,r){const o=(0,s.Oe)(t,r);return{type:String,read:(e,t,r)=>{const n=(0,f.r)(e,t,r);return o.type===String?n:"function"==typeof o.type?new o.type({url:n}):void 0},write:{writer(t,s,l,u){if(!u||!u.resources)return"string"==typeof t?void(s[l]=(0,f.t)(t,u)):void(s[l]=t.write({},u));const c=function(e){return null==e?null:"string"==typeof e?e:e.url}(t),y=(0,f.t)(c,{...u,verifyItemRelativeUrls:u&&u.verifyItemRelativeUrls?{writtenUrls:u.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},f.M.NO),d=o.type!==String&&(!(0,n.l)(this)||u&&u.origin&&this.originIdOf(r)>(0,a.M9)(u.origin)),g={object:this,propertyName:r,value:t,targetUrl:y,dest:s,targetPropertyName:l,context:u,params:e};u&&u.portalItem&&y&&!(0,i.YP)(y)?d?function(e){const{context:t,targetUrl:r,params:n,value:o,dest:s,targetPropertyName:a}=e;if(!t.portalItem)return;const l=t.portalItem.resourceFromPath(r),u=v(o,r,t),c=p(u),y=(0,i.Ml)(l.path),d=n?.compress??!1;c===y?(t.resources&&b({...e,resource:l,content:u,compress:d,updates:t.resources.toUpdate}),s[a]=r):h(e)}(g):function({context:e,targetUrl:t,dest:r,targetPropertyName:n}){e.portalItem&&e.resources&&(e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(t),compress:!1}),r[n]=t)}(g):u&&u.portalItem&&(null==y||null!=(0,f.i)(y)||(0,i.jc)(y)||d)?h(g):s[l]=y}}}}(e,t,r);switch(e?.type??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:e,write:t}=f.a;return{read:e,write:t}}}}(e,r,o);for(const e of t){const t=(0,l.CJ)(r,e,o);for(const e in u)t[e]=u[e]}}}function h(e){const{targetUrl:t,params:n,value:s,context:a,dest:l,targetPropertyName:u}=e;if(!a.portalItem)return;const c=(0,f.p)(t),y=c?.filename??(0,o.D)(),d=n?.prefix??c?.prefix,g=v(s,t,a),h=(0,i.v_)(d,y),m=`${h}.${p(g)}`,C=a.portalItem.resourceFromPath(m);(0,i.jc)(t)&&a.resources&&a.resources.propertyPendingOperations.push(async function(e){const t=(await Promise.resolve().then(r.bind(r,3172))).default,{data:n}=await t(e,{responseType:"blob"});return n}(t).then((e=>{C.path=`${h}.${p(e)}`,l[u]=C.itemRelativeUrl})).catch((()=>{})));const I=n?.compress??!1;a.resources&&b({...e,resource:C,content:g,compress:I,updates:a.resources.toAdd}),l[u]=C.itemRelativeUrl}function b({object:e,propertyName:t,updates:r,resource:n,content:i,compress:o}){r.push({resource:n,content:i,compress:o,finish:r=>{!function(e,t,r){"string"==typeof e[t]?e[t]=r.url:e[t].url=r.url}(e,t,r)}})}function v(e,t,r){return"string"==typeof e?{url:t}:new Blob([JSON.stringify(e.toJSON(r))],{type:"application/json"})}},81153:(e,t,r)=>{function n(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{l:()=>n})},41123:(e,t,r)=>{r.d(t,{D:()=>i});const n="randomUUID"in crypto;function i(){if(n)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}},30690:(e,t,r)=>{r.r(t),r.d(t,{default:()=>E});var n=r(43697),i=r(4757),o=r(70586);function s(e,t){return a(e)===a(t)}function a(e){if((0,o.Wi)(e))return null;const t=null!=e.layer?e.layer.id:"";let r=null;return r=null!=e.objectId?e.objectId:null!=e.layer&&"objectIdField"in e.layer&&null!=e.layer.objectIdField&&null!=e.attributes?e.attributes[e.layer.objectIdField]:e.uid,null==r?null:`o-${t}-${r}`}const l={json:{write:{writer:function(e,t){(0,o.Wi)(e)||null==e.layer?.objectIdField||null==e.attributes||(t.feature={layerId:e.layer.id,objectId:e.attributes[e.layer.objectIdField]})},target:{"feature.layerId":{type:[Number,String]},"feature.objectId":{type:[Number,String]}}},origins:{"web-scene":{read:function(e){if(null!=e.layerId&&null!=e.objectId)return{uid:null,layer:{id:e.layerId,objectIdField:"ObjectId"},attributes:{ObjectId:e.objectId}}}}}}};var p=r(15923),u=r(2368),c=r(96674),y=r(5600),d=(r(75215),r(67676),r(52011)),f=r(28659),g=r(94139),h=r(86787);let b=class extends((0,c.eC)((0,u.J)(p.Z))){constructor(e){super(e),this.position=null,this.elevationInfo=null,this.feature=null}equals(e){return(0,o._W)(this.position,e.position)&&(0,o._W)(this.elevationInfo,e.elevationInfo)&&s(this.feature,e.feature)}};(0,n._)([(0,y.Cb)({type:g.Z}),(0,f.B)()],b.prototype,"position",void 0),(0,n._)([(0,y.Cb)({type:h.Z}),(0,f.B)()],b.prototype,"elevationInfo",void 0),(0,n._)([(0,y.Cb)(l)],b.prototype,"feature",void 0),b=(0,n._)([(0,d.j)("esri.analysis.LineOfSightAnalysisObserver")],b);const v=b;let m=class extends((0,c.eC)(u.j)){constructor(e){super(e),this.position=null,this.elevationInfo=null,this.feature=null}equals(e){return(0,o._W)(this.position,e.position)&&(0,o._W)(this.elevationInfo,e.elevationInfo)&&s(this.feature,e.feature)}};(0,n._)([(0,y.Cb)({type:g.Z}),(0,f.B)()],m.prototype,"position",void 0),(0,n._)([(0,y.Cb)({type:h.Z}),(0,f.B)()],m.prototype,"elevationInfo",void 0),(0,n._)([(0,y.Cb)(l)],m.prototype,"feature",void 0),m=(0,n._)([(0,d.j)("esri.analysis.LineOfSightAnalysisTarget")],m);const C=m;var I=r(46791),w=r(70921),j=r(17445),_=r(44547),x=r(60437);function O(e,t){return function(e,t){return(0,o.Wi)(t)||!t.mode?function(e){return e?R:P}(e).mode:t.mode}(!!(0,o.pC)(e)&&e.hasZ,t)}r(12541);const R={mode:"absolute-height",offset:0},P={mode:"on-the-ground",offset:null},U=I.Z.ofType(C);let S=class extends i.Z{constructor(e){super(e),this.type="line-of-sight",this.observer=null,this.extent=null}initialize(){this.addHandles((0,j.YP)((()=>this._computeExtent()),(e=>{((0,o.Wi)(e)||(0,o.Wi)(e.pending))&&this._set("extent",(0,o.pC)(e)?e.extent:null)}),j.tX))}get targets(){return this._get("targets")||new U}set targets(e){this._set("targets",(0,w.Z)(e,this.targets,U))}get spatialReference(){return(0,o.pC)(this.observer)&&(0,o.pC)(this.observer.position)?this.observer.position.spatialReference:null}get requiredPropertiesForEditing(){return[(0,o.yw)(this.observer,(e=>e.position))]}async waitComputeExtent(){const e=this._computeExtent();return(0,o.pC)(e)?(0,o.Wg)(e.pending):Promise.resolve()}_computeExtent(){const e=this.spatialReference;if((0,o.Wi)(this.observer)||(0,o.Wi)(this.observer.position)||(0,o.Wi)(e))return null;const t=e=>"absolute-height"===O(e.position,e.elevationInfo),r=this.observer.position,n=(0,x.al)(r.x,r.y,r.z,r.x,r.y,r.z);for(const t of this.targets)if((0,o.pC)(t.position)){const r=(0,_.dz)(t.position,e);if((0,o.pC)(r.pending))return{pending:r.pending,extent:null};if((0,o.pC)(r.geometry)){const{x:e,y:t,z:i}=r.geometry;(0,x.pp)(n,[e,t,i])}}const i=(0,x.HH)(n,e);return t(this.observer)&&this.targets.every(t)||(i.zmin=void 0,i.zmax=void 0),{pending:null,extent:i}}clear(){this.observer=null,this.targets.removeAll()}};(0,n._)([(0,y.Cb)({type:["line-of-sight"]})],S.prototype,"type",void 0),(0,n._)([(0,y.Cb)({type:v,json:{read:!0,write:!0}})],S.prototype,"observer",void 0),(0,n._)([(0,y.Cb)({cast:w.R,type:U,nonNullable:!0,json:{read:!0,write:!0}})],S.prototype,"targets",null),(0,n._)([(0,y.Cb)({value:null,readOnly:!0})],S.prototype,"extent",void 0),(0,n._)([(0,y.Cb)({readOnly:!0})],S.prototype,"spatialReference",null),(0,n._)([(0,y.Cb)({readOnly:!0})],S.prototype,"requiredPropertiesForEditing",null),S=(0,n._)([(0,d.j)("esri.analysis.LineOfSightAnalysis")],S);const W=S;var z=r(16453),N=r(87085),Z=r(38009);const F=I.Z.ofType(C);let L=class extends((0,Z.q)((0,z.R)(N.Z))){constructor(e){super(e),this.type="line-of-sight",this.operationalLayerType="LineOfSightLayer",this.analysis=new W,this.opacity=1}initialize(){this.addHandles((0,j.YP)((()=>this.analysis),((e,t)=>{(0,o.pC)(t)&&t.parent===this&&(t.parent=null),(0,o.pC)(e)&&(e.parent=this)}),j.tX))}async load(){return(0,o.pC)(this.analysis)&&this.addResolvingPromise(this.analysis.waitComputeExtent()),this}get observer(){return(0,o.yw)(this.analysis,(e=>e.observer))}set observer(e){(0,o.yw)(this.analysis,(t=>t.observer=e))}get targets(){return(0,o.pC)(this.analysis)?this.analysis.targets:new I.Z}set targets(e){(0,w.Z)(e,this.analysis?.targets)}get fullExtent(){return(0,o.pC)(this.analysis)?this.analysis.extent:null}get spatialReference(){return(0,o.pC)(this.analysis)?(0,o.Wg)(this.analysis.spatialReference):null}releaseAnalysis(e){this.analysis===e&&(this.analysis=new W)}};(0,n._)([(0,y.Cb)({json:{read:!1},readOnly:!0})],L.prototype,"type",void 0),(0,n._)([(0,y.Cb)({type:["LineOfSightLayer"]})],L.prototype,"operationalLayerType",void 0),(0,n._)([(0,y.Cb)({type:v,json:{read:!0,write:{ignoreOrigin:!0}}})],L.prototype,"observer",null),(0,n._)([(0,y.Cb)({type:F,json:{read:!0,write:{ignoreOrigin:!0}}})],L.prototype,"targets",null),(0,n._)([(0,y.Cb)({nonNullable:!0,json:{read:!1,write:!1}})],L.prototype,"analysis",void 0),(0,n._)([(0,y.Cb)({readOnly:!0})],L.prototype,"fullExtent",null),(0,n._)([(0,y.Cb)({readOnly:!0})],L.prototype,"spatialReference",null),(0,n._)([(0,y.Cb)({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],L.prototype,"opacity",void 0),(0,n._)([(0,y.Cb)({type:["show","hide"]})],L.prototype,"listMode",void 0),L=(0,n._)([(0,d.j)("esri.layers.LineOfSightLayer")],L);const E=L}}]);