Custom Gis Application with Arcgis Javascript API with modern layouting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

359 lines
182 KiB

// All material copyright Esri, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.30/esri/copyright.txt for details.
//>>built
require({cache:{"esri/layers/support/rasterDatasets/multidimensionalUtils":function(){define(["exports","../../../core/arrayUtils","../DimensionalDefinition"],function(m,C,k){function l(q,g,u){const z=g.shift();0===u.length&&u.push({sliceId:-1,multidimensionalDefinition:[]});const A=u.length;for(let I=0;I<A;I++){const a=u.shift().multidimensionalDefinition;z.values?.forEach(d=>{u.push({sliceId:-1,multidimensionalDefinition:[...a,{variableName:q,dimensionName:z.name,values:[d]}]})})}g.length&&l(q,
g,u)}function y(q,g){return Array.isArray(q)?g[0]===g[1]?q[0]===g[0]||q[1]===g[0]:q[0]>=g[0]&&q[0]<=g[1]&&q[1]>=g[0]&&q[1]<=g[1]:q>=g[0]&&q<=g[1]}function x(q,g){return q[0]<=g[0]&&q[1]>=g[0]||q[0]<=g[1]&&q[1]>=g[1]||q[0]>=g[0]&&q[1]<=g[1]}function E(q){return 1===q.length?[q[0],q[0]]:[q[0],q[q.length-1]]}function F(q,g,u){if(!g?.subsetDefinitions?.length)return q;if(u){const {variables:A}=g;if(A.length&&!A.includes(u))return null;g=g.subsetDefinitions.find(I=>I.dimensionName===q.name&&I.variableName===
u);if(!g?.values?.length)return q;g=E(g.values)}else g=g.dimensions.find(({name:A})=>A===q.name)?.extent;const z=g;if(!z?.length)return q;g=q.values.filter(A=>y(A,z));return{...q,extent:[...z],values:g}}function w(q,g,u){if(!g?.subsetDefinitions?.length)return!1;const {variables:z}=g;if(z.length&&q.some(({variableName:A})=>A&&!z.includes(A)))return!0;for(let A=0;A<q.length;A++){const I=q[A],a=g.subsetDefinitions.find(d=>(""===I.variableName||d.variableName===I.variableName)&&d.dimensionName===I.dimensionName);
if(a?.values.length){const d=E(a.values);if(!I.isSlice&&2===I.values.length&&!Array.isArray(I.values[0])&&I.values[0]!==I.values[1]&&u){if(!x(I.values,d))return!0}else if(I.values.some(e=>!y(e,d)))return!0}}return!1}function D(q,g){var u=q.dimensions.find(({name:a})=>"StdTime"===a);if(null==u||null==g.start&&null==g.end)return g;g=g.clone();const {start:z,end:A}=g.toJSON(),I=z===A?[z]:null!=z&&null!=A?[z,A]:[z??A];if(2===I.length&&u?.extent.length&&(I[0]=Math.max(I[0],u.extent[0]),I[1]=Math.min(I[1],
u.extent[1]??u.extent[0]),I[1]<I[0]))return null;u=new k({variableName:"",dimensionName:"StdTime",isSlice:1===I.length,values:I});if(w([u],q,!0))return null;g.start=new Date(I[0]);g.end=new Date(I[1]??I[0]);return g}function p(q,g={}){const {multidimensionalInfo:u,keyProperties:z}=q;if(null==u)return null;const {variableName:A,multidimensionalSubset:I,multidimensionalDefinition:a}=g;q=null!=a?a[0]?.variableName:null;const d=A||q||z?.DefaultVariable;({variables:q}=u);I?.variables?.length&&(q=q.filter(({name:e})=>
I.variables.includes(e)));return d?q.find(({name:e})=>e===d)??q[0]:q[0]}function b(q,g){var {values:u}=g;if(u?.length){g=Array.isArray(u[0]);var z=Array.isArray(q);return g!==z?-1:g&&z?u.findIndex(I=>I[0]===q[0]&&I[1]===q[1]):u.indexOf(q)}({extent:z}=g);if(Array.isArray(q)||!z||q<z[0]||q>z[1])return-1;u=g.interval||1;if("ISO8601"!==g.unit)return Math.round((q-z[0])/u);z=z[0];let A=-1;switch(g.intervalUnit?.toLowerCase()||"seconds"){case "seconds":A=Math.round((q-z)/1E3/u);break;case "minutes":A=Math.round((q-
z)/6E4/u);break;case "hours":A=Math.round((q-z)/36E5/u);break;case "days":A=Math.round((q-z)/864E5/u);break;case "months":g=(new Date(q)).getUTCFullYear()-(new Date(z)).getUTCFullYear();u=(new Date(z)).getUTCMonth();z=(new Date(q)).getUTCMonth();A=0===g?z-u:z+11-u+12*(g-1);break;case "years":A=Math.round(((new Date(q)).getUTCFullYear()-(new Date(z)).getUTCFullYear())/u);break;case "decades":A=Math.round(((new Date(q)).getUTCFullYear()-(new Date(z)).getUTCFullYear())/10/u)}return A}function t(q){var g=
q.values?.length;if(g)return g;const {extent:u,unit:z}=q;g=q.interval||1;var A=u?u[1]-u[0]:0;if("ISO8601"!==z)return Math.round(A/g);switch(q.intervalUnit?.toLowerCase()??"seconds"){case "seconds":g=Math.round(A/1E3/g);break;case "minutes":g=Math.round(A/6E4/g);break;case "hours":g=Math.round(A/36E5/g);break;case "days":g=Math.round(A/864E5/g);break;case "months":u?(q=(new Date(u[1])).getUTCFullYear()-(new Date(u[0])).getUTCFullYear(),g=(new Date(u[0])).getUTCMonth(),A=(new Date(u[1])).getUTCMonth(),
g=0===q?A-g+1:A+11-g+12*(q-1)+1):g=0;break;case "years":g=u?Math.round(((new Date(u[1])).getUTCFullYear()-(new Date(u[0])).getUTCFullYear())/g):0;break;case "decades":g=u?Math.round(((new Date(u[1])).getUTCFullYear()-(new Date(u[0])).getUTCFullYear())/10/g):0;break;default:g=0}return g}m.createSlices=function(q,g){const u=[];let z=0;(g?q.variables.filter(A=>A.name.toLowerCase()===g.toLowerCase()):[...q.variables].sort((A,I)=>A.name>I.name?1:-1)).forEach(A=>{const I=[],a=[...A.dimensions].sort((d,
e)=>d.name>e.name?-1:1);l(A.name,a,I);I.forEach(d=>{u.push({...d,sliceId:z++})})});return u};m.getDefaultMultidimensionalDefinition=function(q,g={}){var u=p(q,g);if(!u)return null;q=[];const {dimensions:z,name:A}=u;if(0===z.length)return[new k({variableName:A,dimensionName:"",values:[],isSlice:!0})];for(u=0;u<z.length;u++){const I=F(z[u],g.multidimensionalSubset,A);if(!I)return null;const {values:a,extent:d}=I;let e=a?.[0]??d?.[0];"stdz"===I.name.toLowerCase()&&!I.hasRanges&&d&&Math.abs(d[1])<=Math.abs(d[0])&&
(e=a?.length?a[a.length-1]:d[1]);q.push(new k({variableName:A,dimensionName:I.name,values:[e],isSlice:g.useRangeForRangedDimensionInfo?!!I.hasRanges:!0}))}return q};m.getDefaultVariableInfo=p;m.getSliceIds=function(q,g,u){let z=q;g&&(g=[...g].sort((A,I)=>A.dimensionName<I.dimensionName?-1:1),g.forEach(({dimensionName:A,values:I,isSlice:a})=>{I.length&&(z=z.filter(d=>{d=d.multidimensionalDefinition.find(n=>n.dimensionName===A);if(null==d)return!1;const e=d.values[0];return"number"===typeof e?"number"===
typeof I[0]?I.includes(e):I.some(n=>n[0]<=e&&n[1]>=e):"number"===typeof I[0]?I.some(n=>e[0]<=n&&e[1]>=n):a?I.some(n=>n[0]===e[0]&&n[0]===e[1]):I.some(n=>n[0]>=e[0]&&n[0]<=e[1]||n[1]>=e[0]&&n[1]<=e[1]||n[0]<e[0]&&n[1]>e[1])}))}));if(z.length&&null!=u?.start&&null!=u.end){const A=u.start.getTime(),I=u.end.getTime(),a=z[0].multidimensionalDefinition.findIndex(d=>"StdTime"===d.dimensionName);-1<a&&(z=z.filter(d=>{d=d.multidimensionalDefinition[a].values[0];return A<=d&&I>=d}))}return z.map(A=>A.sliceId)};
m.getSliceIndex=function(q,g){let u=0;var z=q[0].variableName;g=[...g.variables].sort((I,a)=>I.name>a.name?1:-1);for(var A=0;A<g.length;A++){const I=g[A],a=[...I.dimensions].sort((d,e)=>d.name>e.name?-1:1);if(I.name!==z)u+=a.map(d=>t(d)).reduce((d,e)=>d*e);else{z=a.map(d=>t(d));g=a.length;for(let d=0;d<g;d++){A=q.find(e=>e.dimensionName===a[d].name);if(null==A)return null;A=b(A.values[0],a[d]);if(-1===A)return null;z.shift();u=d===g-1?u+A:u+A*z.reduce((e,n)=>e*n)}break}}return u};m.getSubsetVariablesFromMdInfo=
function(q,g){if(null==g||null==q)return null;g=g.variables.map(u=>({...u}));q?.variables?.length&&(g=g.filter(({name:u})=>q.variables.includes(u)),g.forEach(u=>{u.dimensions=u.dimensions.map(z=>F(z,q,u.name)).filter(C.isSome)}));return g};m.hasExcludedVariableOrDimension=w;m.intersectMultimensionalSubset=function(q,g){if(null==q)return{isOutside:!1};const {geometry:u,timeExtent:z,multidimensionalDefinition:A}=g;g=null;if(null!=z&&(g=D(q,z),null==g))return{isOutside:!0};const {areaOfInterest:I}=q;
if(I&&u){const a="point"===u.type?u:"extent"===u.type?u.center:"polygon"===u.type?u.centroid:null;if(a&&!I.contains(a))return{isOutside:!0}}return null!=A&&A.length&&w(A,q,!0)?{isOutside:!0}:{isOutside:!1,intersection:{geometry:u,timeExtent:g,multidimensionalDefinition:A}}};m.isMultiSliceOrRangeDefinition=function(q){return q?.length?q.some(g=>{if(null==g.values)return!0;const u=g.values.length;return 0===u||1<u||!g.isSlice&&Array.isArray(g.values[0])}):!1};Object.defineProperty(m,Symbol.toStringTag,
{value:"Module"})})},"esri/layers/support/DimensionalDefinition":function(){define("../../chunks/tslib.es6 ../../core/JSONSupport ../../core/lang ../../core/accessorSupport/decorators/property ../../core/accessorSupport/ensureType ../../core/accessorSupport/decorators/subclass".split(" "),function(m,C,k,l,y,x){var E;C=E=class extends C.JSONSupport{constructor(F){super(F);this.dimensionName=this.variableName=null;this.values=[];this.isSlice=!1}clone(){return new E({variableName:this.variableName,dimensionName:this.dimensionName,
values:k.clone(this.values),isSlice:this.isSlice})}};m.__decorate([l.property({type:String,json:{write:!0}})],C.prototype,"variableName",void 0);m.__decorate([l.property({type:String,json:{write:!0}})],C.prototype,"dimensionName",void 0);m.__decorate([l.property({type:y.types.array(y.types.oneOf([y.types.native(Number),y.types.array(y.types.native(Number))])),json:{write:!0}})],C.prototype,"values",void 0);m.__decorate([l.property({type:Boolean,json:{write:!0}})],C.prototype,"isSlice",void 0);return C=
E=m.__decorate([x.subclass("esri.layers.support.DimensionalDefinition")],C)})},"esri/views/2d/engine/flow/FlowView2D":function(){define("../../../../chunks/tslib.es6 ../../../../Graphic ../../../../core/Accessor ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ./createFlowStyle ./dataUtils ./FlowContainer ./FlowStrategy".split(" "),function(m,
C,k,l,y,x,E,F,w,D,p,b,t){k=class extends k{constructor(){super(...arguments);this._loadImagery=(q,g,u,z,A)=>p.loadImagery(this.layer,q,g,u,z,A);this._createFlowMesh=(q,g,u,z)=>this.layer.createFlowMesh({meshType:q,flowData:u,simulationSettings:g},{signal:z});this.attached=!1;this.type="flow";this.timeExtent=null;this.redrawOrRefetch=async()=>{this._updateVisualization()}}get updating(){return!this.attached||this._strategy.updating}attach(){const {layer:q}=this,g=()=>{this._loadImagery=(u,z,A,I,a)=>
p.loadImagery(q,u,z,A,I,a);this._updateVisualization()};"multidimensionalDefinition"in q?this.addHandles(l.watch(()=>q.multidimensionalDefinition,g)):this.addHandles([l.watch(()=>q.mosaicRule,g),l.watch(()=>q.rasterFunction,g),l.watch(()=>q.definitionExpression,g)]);this.container=new b;this._strategy=new t({flowContainer:this.container});this._updateVisualization()}detach(){this._strategy.destroy();this.container?.removeAllChildren();this.container=null;this.removeHandles()}update(q){q.stationary?
this._strategy.update(q):this.layerView.requestUpdate()}hitTest(q){return new C({attributes:{},geometry:q.clone(),layer:this.layer})}moveEnd(){}async doRefresh(){}_updateVisualization(){var q=this.layer.renderer;null!=q&&"flow"===q.type&&(q=D(q,{loadImagery:this._loadImagery,createFlowMesh:this._createFlowMesh,timeExtent:this.timeExtent}),this.container.flowStyle=q,this.layerView.requestUpdate())}};m.__decorate([y.property()],k.prototype,"_strategy",void 0);m.__decorate([y.property()],k.prototype,
"attached",void 0);m.__decorate([y.property()],k.prototype,"container",void 0);m.__decorate([y.property()],k.prototype,"layer",void 0);m.__decorate([y.property()],k.prototype,"layerView",void 0);m.__decorate([y.property()],k.prototype,"type",void 0);m.__decorate([y.property()],k.prototype,"updating",null);m.__decorate([y.property()],k.prototype,"timeExtent",void 0);return k=m.__decorate([w.subclass("esri.views.2d.engine.flow.FlowView2D")],k)})},"esri/views/2d/engine/flow/createFlowStyle":function(){define(["./utils",
"./styles/Imagery","./styles/Particles","./styles/Stack","./styles/Streamlines"],function(m,C,k,l,y){return function(x,E){const {flowSpeed:F,trailLength:w}=x,D=m.getFlowSimulationSettings(x);let p=null;const b={opacity:m.getOpacity(x),size:m.getSize(x)};let t=m.getColor(x);"none"===x.background?b.color=t:("constant"===t.kind&&(t={kind:"ramp",stops:[0,1],values:[0,0,0,1,t.value[0],t.value[1],t.value[2],t.value[3]],count:2}),p=new C.Imagery({loadImagery:E.loadImagery,timeExtent:E.timeExtent,color:t,
opacity:{kind:"constant",value:[1]}}),b.color=m.getForegroundColor());E={loadImagery:E.loadImagery,createFlowMesh:E.createFlowMesh,simulationSettings:D,timeExtent:E.timeExtent,trailLength:w,flowSpeed:F,featheringSize:1,featheringOffset:.5,introFade:!0,fadeToZero:!0,decayRate:2.3,color:b.color,opacity:b.opacity,size:b.size};x="butt"===x.trailCap||4>=m.getMax(m.getSize(x))?new y(E):new k.Particles(E);return null!=p?new l.Stack([p,x]):x}})},"esri/views/2d/engine/flow/utils":function(){define(["exports",
"../../../../core/screenUtils"],function(m,C){function k(F){return"constant"===F.kind?F.value[0]:F.values[F.values.length-1]}function l(F){F=F.toRgba();return[F[0]/255,F[1]/255,F[2]/255,F[3]]}function y(F){if(!F.hasVisualVariables("size"))return{kind:"constant",value:[C.pt2px(F.trailWidth)]};const w=F.getVisualVariablesForType("size")[0];F=[];const D=[];if(w.stops){for(p of w.stops)F.push(p.value),D.push(C.pt2px(p.size));var p=w.stops.length}else F.push(w.minDataValue,w.maxDataValue),D.push(C.pt2px(w.minSize),
C.pt2px(w.maxSize)),p=2;return{kind:"ramp",stops:F,values:D,count:p}}function x(F,w,D,p){switch(w){case "int":F.setUniform1iv(D,p);break;case "float":F.setUniform1fv(D,p);break;case "vec2":F.setUniform2fv(D,p);break;case "vec3":F.setUniform3fv(D,p);break;case "vec4":F.setUniform4fv(D,p)}}function E(F,w){return F===w?!0:null!=F&&null!=w?F.equals(w):!1}m.areStreamlinesCompatible=function(F,w){var D=F.simulationSettings,p=w.simulationSettings;let b;b=(b=(b=(b=(b=(b=(b=(b=(b=(b=(b=D.collisions===p.collisions)&&
D.density===p.density)&&D.interpolate===p.interpolate)&&D.lineCollisionWidth===p.lineCollisionWidth)&&D.lineSpacing===p.lineSpacing)&&D.maxTurnAngle===p.maxTurnAngle)&&D.minSpeedThreshold===p.minSpeedThreshold)&&D.segmentLength===p.segmentLength)&&D.smoothing===p.smoothing)&&D.velocityScale===p.velocityScale)&&D.verticesPerLine===p.verticesPerLine;return b&&E(F.timeExtent,w.timeExtent)?D=(D=(D=(D=(D=F.loadImagery===w.loadImagery)&&F.createFlowMesh===w.createFlowMesh)&&F.color.kind===w.color.kind)&&
F.opacity.kind===w.opacity.kind)&&F.size.kind===w.size.kind:!1};m.getColor=function(F){if(!F.hasVisualVariables("color"))return{kind:"constant",value:l(F.color)};F=F.getVisualVariablesForType("color")[0];const w=[],D=[];for(const p of F.stops)w.push(p.value),Array.prototype.push.apply(D,l(p.color));return{kind:"ramp",stops:w,values:D,count:F.stops.length}};m.getFlowSimulationSettings=function(F){var w=y(F);w=k(w);const D=Math.max(w/2,5),p=Math.round(C.pt2px(F.maxPathLength)/D)+1,{density:b}=F;return{smoothing:C.pt2px(F.smoothing),
interpolate:!0,velocityScale:"flow-from"===F.flowRepresentation?1:-1,verticesPerLine:p,minSpeedThreshold:.001,segmentLength:D,maxTurnAngle:1,collisions:!0,lineCollisionWidth:w,lineSpacing:10,density:b}};m.getForegroundColor=function(F){return{kind:"constant",value:[.1,.1,.1,1]}};m.getMax=k;m.getOpacity=function(F){if(!F.hasVisualVariables("opacity"))return{kind:"constant",value:[1]};F=F.getVisualVariablesForType("opacity")[0];const w=[],D=[];for(const p of F.stops)w.push(p.value),D.push(p.opacity);
return{kind:"ramp",stops:w,values:D,count:F.stops.length}};m.getSize=y;m.setUniform=x;m.setUniforms=function(F,w,D,p){"constant"===p.kind?x(F,D,`u_${w}`,p.value):(x(F,"float",`u_${w}_stops`,p.stops),x(F,D,`u_${w}_values`,p.values),F.setUniform1i(`u_${w}_count`,p.count))};m.timeExtentsEqual=E;m.toRgba=l;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/flow/styles/Imagery":function(){define("exports ../../../../../core/promiseUtils ../utils ../../../../webgl/BufferObject ../../../../webgl/enums ../../../../webgl/Texture ../../../../webgl/TextureDescriptor ../../../../webgl/VertexArrayObject ../../../../webgl/VertexElementDescriptor".split(" "),
function(m,C,k,l,y,x,E,F,w){class D{constructor(g){this._params=g;this.animated=!1}isCompatible(g){if(!(g instanceof D&&k.timeExtentsEqual(this._params.timeExtent,g._params.timeExtent)))return!1;let u;return u=(u=(u=this._params.loadImagery===g._params.loadImagery)&&this._params.color.kind===g._params.color.kind)&&this._params.opacity.kind===g._params.opacity.kind}async load(g,u){const {extent:z,size:A}=g;C.throwIfAborted(u);g=await this._params.loadImagery(z,A[0],A[1],this._params.timeExtent,u);
return new q(g,{color:this._params.color,opacity:this._params.opacity})}render(g,u,z){({context:g}=g);const {program:A}=z;g.setFaceCullingEnabled(!1);g.setBlendingEnabled(!0);g.setBlendFunction(y.BlendFactor.ONE,y.BlendFactor.ONE_MINUS_SRC_ALPHA);g.useProgram(A);A.setUniformMatrix3fv("u_dvsMat3",u.dvsMat3);g.bindTexture(z.texture,0);A.setUniform1i("u_texture",0);A.setUniform1f("u_Min",z.min);A.setUniform1f("u_Max",z.max);k.setUniforms(A,"color","vec4",this._params.color);k.setUniforms(A,"opacity",
"float",this._params.opacity);g.bindVAO(z.vertexArray);g.drawArrays(y.PrimitiveType.TRIANGLE_STRIP,0,4)}}const p=new Map;p.set("a_position",0);p.set("a_texcoord",1);const b={geometry:[new w.VertexElementDescriptor("a_position",2,y.DataType.UNSIGNED_SHORT,0,8),new w.VertexElementDescriptor("a_texcoord",2,y.DataType.UNSIGNED_SHORT,4,8)]},t={vsPath:"raster/flow/imagery",fsPath:"raster/flow/imagery",attributes:p};class q{constructor(g,u){this._flowData=g;this._values=u}attach(g){var {context:u}=g;const {width:z,
height:A}=this._flowData;var I={geometry:l.BufferObject.createVertex(u,y.Usage.STATIC_DRAW,new Uint16Array([0,0,0,1,z,0,1,1,0,A,0,0,z,A,1,0]))};I=new F.VertexArrayObject(u,p,b,I);var a=[];"ramp"===this._values.color.kind&&a.push("vvColor");"ramp"===this._values.opacity.kind&&a.push("vvOpacity");g=g.painter.materialManager.getProgram(t,a);a=1E6;let d=-1E6;for(var e=0;e<A;e++)for(var n=0;n<z;n++)if(0!==this._flowData.mask[e*z+n]){var h=this._flowData.data[2*(e*z+n)],c=this._flowData.data[2*(e*z+n)+
1];h=Math.sqrt(h*h+c*c);a=Math.min(a,h);d=Math.max(d,h)}e=new Uint8Array(4*z*A);for(n=0;n<A;n++)for(h=0;h<z;h++)if(0!==this._flowData.mask[n*z+h]){c=this._flowData.data[2*(n*z+h)];const r=this._flowData.data[2*(n*z+h)+1];e[4*(n*z+h)]=(Math.sqrt(c*c+r*r)-a)/(d-a)*255;e[4*(n*z+h)+1]=0;e[4*(n*z+h)+2]=0;e[4*(n*z+h)+3]=255}else e[4*(n*z+h)]=0,e[4*(n*z+h)+1]=0,e[4*(n*z+h)+2]=0,e[4*(n*z+h)+3]=0;n=new E.TextureDescriptor;n.internalFormat=y.PixelFormat.RGBA;n.wrapMode=y.TextureWrapMode.CLAMP_TO_EDGE;n.flipped=
!0;n.width=z;n.height=A;u=new x.Texture(u,n,e);this.vertexArray=I;this.program=g;this.texture=u;this.min=a;this.max=d;this._flowData=null}detach(){this.vertexArray.dispose();this.texture.dispose()}get ready(){return this.program.compiled}}m.Imagery=D;m.ImageryResources=q;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/flow/styles/Particles":function(){define("exports ../../../../../core/promiseUtils ../utils ../../../../webgl/BufferObject ../../../../webgl/enums ../../../../webgl/VertexArrayObject ../../../../webgl/VertexElementDescriptor".split(" "),
function(m,C,k,l,y,x,E){class F{constructor(t){this._params=t}get animated(){return 0<this._params.flowSpeed}isCompatible(t){return t instanceof F?k.areStreamlinesCompatible(this._params,t._params):!1}async load(t,q){const {extent:g,size:u}=t;C.throwIfAborted(q);t=await this._params.loadImagery(g,u[0],u[1],this._params.timeExtent,q);const {vertexData:z,indexData:A}=await this._params.createFlowMesh("Particles",this._params.simulationSettings,t,q);return new b(z,A,{color:this._params.color,opacity:this._params.opacity,
size:this._params.size})}render(t,q,g){({context:t}=t);const {program:u}=g;t.setFaceCullingEnabled(!1);t.setBlendingEnabled(!0);t.setBlendFunction(y.BlendFactor.ONE,y.BlendFactor.ONE_MINUS_SRC_ALPHA);t.useProgram(u);u.setUniform1f("u_time",q.time);u.setUniform1f("u_trailLength",this._params.trailLength);u.setUniform1f("u_flowSpeed",this._params.flowSpeed);u.setUniform1f("u_featheringSize",this._params.featheringSize);u.setUniform1f("u_featheringOffset",this._params.featheringOffset);u.setUniform1f("u_introFade",
this._params.introFade?1:0);u.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0);u.setUniform1f("u_decayRate",this._params.decayRate);u.setUniformMatrix3fv("u_dvsMat3",q.dvsMat3);u.setUniformMatrix3fv("u_displayViewMat3",q.displayViewMat3);k.setUniforms(u,"color","vec4",this._params.color);k.setUniforms(u,"opacity","float",this._params.opacity);k.setUniforms(u,"size","float",this._params.size);t.bindVAO(g.vertexArray);t.drawElements(y.PrimitiveType.TRIANGLES,g.indexCount,y.DataType.UNSIGNED_INT,
0)}}const w=new Map;w.set("a_xyts0",0);w.set("a_xyts1",1);w.set("a_typeIdDurationSeed",2);w.set("a_extrudeInfo",3);const D={geometry:[new E.VertexElementDescriptor("a_xyts0",4,y.DataType.FLOAT,0,64),new E.VertexElementDescriptor("a_xyts1",4,y.DataType.FLOAT,16,64),new E.VertexElementDescriptor("a_typeIdDurationSeed",4,y.DataType.FLOAT,32,64),new E.VertexElementDescriptor("a_extrudeInfo",4,y.DataType.FLOAT,48,64)]},p={vsPath:"raster/flow/particles",fsPath:"raster/flow/particles",attributes:w};class b{constructor(t,
q,g){this._vertexData=t;this._indexData=q;this._values=g}attach(t){var {context:q}=t,g=l.BufferObject.createVertex(q,y.Usage.STATIC_DRAW,this._vertexData);const u=l.BufferObject.createIndex(q,y.Usage.STATIC_DRAW,this._indexData);q=new x.VertexArrayObject(q,w,D,{geometry:g},u);g=[];"ramp"===this._values.color.kind&&g.push("vvColor");"ramp"===this._values.opacity.kind&&g.push("vvOpacity");"ramp"===this._values.size.kind&&g.push("vvSize");t=t.painter.materialManager.getProgram(p,g);this.vertexArray=
q;this.program=t;this.indexCount=this._indexData.length;this._indexData=this._vertexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}}m.Particles=F;m.ParticlesResources=b;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/flow/styles/Stack":function(){define(["exports"],function(m){class C{constructor(l){this._styles=l}get animated(){return this._styles.reduce((l,y)=>l||y.animated,!1)}isCompatible(l){if(!(l instanceof C)||this._styles.length!==
l._styles.length)return!1;const y=this._styles.length;for(let x=0;x<y;x++)if(!this._styles[x].isCompatible(l._styles[x]))return!1;return!0}async load(l,y){const x=await Promise.all(this._styles.map(E=>E.load(l,y)));return new k(x)}render(l,y,x){for(let E=0;E<this._styles.length;E++)this._styles[E].render(l,y,x.resources[E])}}class k{constructor(l){this.resources=l}attach(l){for(const y of this.resources)y.attach(l)}detach(){for(const l of this.resources)l.detach()}get ready(){return this.resources.reduce((l,
y)=>l&&y.ready,!0)}}m.Stack=C;m.StackResources=k;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/flow/styles/Streamlines":function(){define("../../../../../core/promiseUtils ../utils ../../../../webgl/BufferObject ../../../../webgl/enums ../../../../webgl/VertexArrayObject ../../../../webgl/VertexElementDescriptor".split(" "),function(m,C,k,l,y,x){class E{constructor(b){this._params=b}get animated(){return 0<this._params.flowSpeed}isCompatible(b){return b instanceof
E?C.areStreamlinesCompatible(this._params,b._params):!1}async load(b,t){const {extent:q,size:g}=b;m.throwIfAborted(t);b=await this._params.loadImagery(q,g[0],g[1],this._params.timeExtent,t);const {vertexData:u,indexData:z}=await this._params.createFlowMesh("Streamlines",this._params.simulationSettings,b,t);return new p(u,z,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(b,t,q){({context:b}=b);const {program:g}=q;b.setFaceCullingEnabled(!1);b.setBlendingEnabled(!0);
b.setBlendFunction(l.BlendFactor.ONE,l.BlendFactor.ONE_MINUS_SRC_ALPHA);b.useProgram(g);g.setUniform1f("u_time",t.time);g.setUniform1f("u_trailLength",this._params.trailLength);g.setUniform1f("u_flowSpeed",this._params.flowSpeed);g.setUniform1f("u_featheringSize",this._params.featheringSize);g.setUniform1f("u_featheringOffset",this._params.featheringOffset);g.setUniform1f("u_introFade",this._params.introFade?1:0);g.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0);g.setUniform1f("u_decayRate",
this._params.decayRate);g.setUniformMatrix3fv("u_dvsMat3",t.dvsMat3);g.setUniformMatrix3fv("u_displayViewMat3",t.displayViewMat3);C.setUniforms(g,"color","vec4",this._params.color);C.setUniforms(g,"opacity","float",this._params.opacity);C.setUniforms(g,"size","float",this._params.size);b.bindVAO(q.vertexArray);b.drawElements(l.PrimitiveType.TRIANGLES,q.indexCount,l.DataType.UNSIGNED_INT,0)}}const F=new Map;F.set("a_positionAndSide",0);F.set("a_timeInfo",1);F.set("a_extrude",2);F.set("a_speed",3);
const w={geometry:[new x.VertexElementDescriptor("a_positionAndSide",3,l.DataType.FLOAT,0,36),new x.VertexElementDescriptor("a_timeInfo",3,l.DataType.FLOAT,12,36),new x.VertexElementDescriptor("a_extrude",2,l.DataType.FLOAT,24,36),new x.VertexElementDescriptor("a_speed",1,l.DataType.FLOAT,32,36)]},D={vsPath:"raster/flow/streamlines",fsPath:"raster/flow/streamlines",attributes:F};class p{constructor(b,t,q){this._vertexData=b;this._indexData=t;this._values=q}attach(b){var {context:t}=b,q=k.BufferObject.createVertex(t,
l.Usage.STATIC_DRAW,this._vertexData);const g=k.BufferObject.createIndex(t,l.Usage.STATIC_DRAW,this._indexData);t=new y.VertexArrayObject(t,F,w,{geometry:q},g);q=[];"ramp"===this._values.color.kind&&q.push("vvColor");"ramp"===this._values.opacity.kind&&q.push("vvOpacity");"ramp"===this._values.size.kind&&q.push("vvSize");b=b.painter.materialManager.getProgram(D,q);this.vertexArray=t;this.program=b;this.indexCount=this._indexData.length;this._indexData=this._vertexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}}
return E})},"esri/views/2d/engine/flow/dataUtils":function(){define("exports ../../../../geometry ../../../../core/has ../../../../core/Logger ../../../../core/mathUtils ../../../../core/promiseUtils ../../../../core/RandomLCG ../../../../geometry/support/spatialReferenceUtils ../../../../geometry/Extent".split(" "),function(m,C,k,l,y,x,E,F,w){function D(a,d){const e=t(d.data,d.width,d.height,a.smoothing);return a.interpolate?(n,h)=>{const c=Math.floor(n),r=Math.floor(h);if(0>c||c>=d.width||0>r||
r>=d.height)return[0,0];n-=c;h-=r;const v=c<d.width-1?c+1:c,B=r<d.height-1?r+1:r;return[(e[2*(r*d.width+c)]*(1-h)+e[2*(B*d.width+c)]*h)*(1-n)+(e[2*(r*d.width+v)]*(1-h)+e[2*(B*d.width+v)]*h)*n,(e[2*(r*d.width+c)+1]*(1-h)+e[2*(B*d.width+c)+1]*h)*(1-n)+(e[2*(r*d.width+v)+1]*(1-h)+e[2*(B*d.width+v)+1]*h)*n]}:(n,h)=>{n=Math.round(n);h=Math.round(h);return 0>n||n>=d.width||0>h||h>=d.height?[0,0]:[e[2*(h*d.width+n)],e[2*(h*d.width+n)+1]]}}function p(a,d,e,n,h,c,r,v,B){const H=[];let J=0,[K,L]=d(e,n);K*=
a.velocityScale;L*=a.velocityScale;H.push({x:e,y:n,t:J,speed:Math.sqrt(K*K+L*L)});for(let U=0;U<a.verticesPerLine;U++){let [R,Y]=d(e,n);R*=a.velocityScale;Y*=a.velocityScale;const X=Math.sqrt(R*R+Y*Y);if(X<a.minSpeedThreshold)break;const da=R/X,ba=Y/X;e+=da*a.segmentLength;n+=ba*a.segmentLength;J+=a.segmentLength/X;if(Math.acos(da*N+ba*S)>a.maxTurnAngle)break;if(a.collisions){var N=Math.round(e*B);var S=Math.round(n*B);if(0>N||N>r-1||0>S||S>v-1)break;const aa=c[S*r+N];if(-1!==aa&&aa!==h)break;c[S*
r+N]=h}H.push({x:e,y:n,t:J,speed:X});N=da;S=ba}return H}function b(a,d,e,n){const h=[],c=new E,r=1/Math.max(a.lineCollisionWidth,1),v=Math.round(e*r),B=Math.round(n*r),H=new Int32Array(v*B);for(var J=0;J<H.length;J++)H[J]=-1;J=[];for(let K=0;K<n;K+=a.lineSpacing)for(let L=0;L<e;L+=a.lineSpacing)J.push({x:L,y:K,sort:c.getFloat()});J.sort((K,L)=>K.sort-L.sort);for(const {x:K,y:L}of J)c.getFloat()<a.density&&(e=p(a,d,K,L,h.length,H,v,B,r),2>e.length||h.push(e));return h}function t(a,d,e,n){if(0===n)return a;
const h=Math.round(3*n),c=Array(2*h+1);var r=0;for(var v=-h;v<=h;v++){var B=Math.exp(-v*v/(n*n));c[v+h]=B;r+=B}for(n=-h;n<=h;n++)c[n+h]/=r;r=new Float32Array(a.length);for(n=0;n<e;n++)for(v=0;v<d;v++){var H=B=0;for(var J=-h;J<=h;J++)if(!(0>v+J||v+J>=d)){var K=c[J+h];B+=K*a[2*(n*d+(v+J))];H+=K*a[2*(n*d+(v+J))+1]}r[2*(n*d+v)]=B;r[2*(n*d+v)+1]=H}a=new Float32Array(a.length);for(n=0;n<d;n++)for(v=0;v<e;v++){H=B=0;for(J=-h;J<=h;J++)0>v+J||v+J>=e||(K=c[J+h],B+=K*r[2*((v+J)*d+n)],H+=K*r[2*((v+J)*d+n)+1]);
a[2*(v*d+n)]=B;a[2*(v*d+n)+1]=H}return a}function q(a,d){const e=new E;var n=a.reduce((v,B)=>v+B.length,0);n=new Float32Array(4*n);const h=Array(a.length);let c=0,r=0;for(const v of a){a=c;for(const B of v)n[4*c]=B.x,n[4*c+1]=B.y,n[4*c+2]=B.t,n[4*c+3]=B.speed,c++;h[r++]={startVertex:a,numberOfVertices:v.length,totalTime:v[v.length-1].t,timeSeed:d?e.getFloat():0}}return{lineVertices:n,lineDescriptors:h}}function g(a,d){function e(N,S,U,R,Y,X,da,ba){const aa=9*B;let ea=0;v[aa+ea++]=N;v[aa+ea++]=S;v[aa+
ea++]=1;v[aa+ea++]=U;v[aa+ea++]=X;v[aa+ea++]=da;v[aa+ea++]=R/2;v[aa+ea++]=Y/2;v[aa+ea++]=ba;B++;v[aa+ea++]=N;v[aa+ea++]=S;v[aa+ea++]=-1;v[aa+ea++]=U;v[aa+ea++]=X;v[aa+ea++]=da;v[aa+ea++]=-R/2;v[aa+ea++]=-Y/2;v[aa+ea++]=ba;B++}const {lineVertices:n,lineDescriptors:h}=a;var c=a=0;for(var r of h)a+=2*r.numberOfVertices,c+=6*(r.numberOfVertices-1);const v=new Float32Array(9*a);r=new Uint32Array(c);let B=0;a=0;for(const N of h){const {totalTime:S,timeSeed:U}=N;let R=c=null,Y=null;var H=null,J=null,K=null;
for(let X=0;X<N.numberOfVertices;X++){H=n[4*(N.startVertex+X)];const da=n[4*(N.startVertex+X)+1],ba=n[4*(N.startVertex+X)+2],aa=n[4*(N.startVertex+X)+3];let ea=null,ka=null;var L=null;let f=null;0<X&&(ea=H-c,ka=da-R,L=Math.sqrt(ea*ea+ka*ka),ea/=L,ka/=L,1<X?(J=ea+J,K=ka+K,L=Math.sqrt(J*J+K*K),J/=L,K/=L,L=Math.min(1/(J*ea+K*ka),d),J*=L,K*=L,L=-K,f=J):(L=-ka,f=ea),null!==L&&null!==f&&(e(c,R,Y,L,f,S,U,aa),r[a++]=B-2,r[a++]=B,r[a++]=B-1,r[a++]=B,r[a++]=B+1,r[a++]=B-1));c=H;R=da;Y=ba;J=ea;K=ka;H=aa}e(c,
R,Y,-K,J,S,U,H)}return{vertexData:v,indexData:r}}function u(a){function d(M,O){var T=ba+ea,P=aa+ka,V=Math.sqrt(T*T+P*P);T/=V;P/=V;var W=ba*T+aa*P,Q=ea+f,ca=ka+G;V=Math.sqrt(Q*Q+ca*ca);Q/=V;ca/=V;var Z=ea*Q+ka*ca;V=L;var ja=N,ia=S,ha=U;P=-(P/W);T/=W;W=R;var la=Y,ma=X,na=da;ca=-(ca/Z);Q/=Z;Z=16*J;let fa=0;for(const pa of[1,2])for(const qa of[1,2,3,4])B[Z+fa++]=V,B[Z+fa++]=ja,B[Z+fa++]=ia,B[Z+fa++]=ha,B[Z+fa++]=W,B[Z+fa++]=la,B[Z+fa++]=ma,B[Z+fa++]=na,B[Z+fa++]=pa,B[Z+fa++]=qa,B[Z+fa++]=M,B[Z+fa++]=
O,B[Z+fa++]=P/2,B[Z+fa++]=T/2,B[Z+fa++]=ca/2,B[Z+fa++]=Q/2,J++;H[K++]=J-8;H[K++]=J-7;H[K++]=J-6;H[K++]=J-7;H[K++]=J-5;H[K++]=J-6;H[K++]=J-4;H[K++]=J-3;H[K++]=J-2;H[K++]=J-3;H[K++]=J-1;H[K++]=J-2}function e(M,O,T,P,V,W){ba=ea;aa=ka;ea=f;ka=G;null==ba&&null==aa&&(ba=ea,aa=ka);if(null!=R&&null!=Y){f=M-R;G=O-Y;const Q=Math.sqrt(f*f+G*G);f/=Q;G/=Q}null!=ba&&null!=aa&&d(V,W);L=R;N=Y;S=X;U=da;R=M;Y=O;X=T;da=P}function n(M,O){ba=ea;aa=ka;ea=f;ka=G;null==ba&&null==aa&&(ba=ea,aa=ka);null!=ba&&null!=aa&&d(M,
O)}const {lineVertices:h,lineDescriptors:c}=a;let r=a=0;for(var v of c){const M=v.numberOfVertices-1;a+=8*M;r+=12*M}const B=new Float32Array(16*a),H=new Uint32Array(r);let J=0,K=0,L,N,S,U,R,Y,X,da,ba,aa,ea,ka,f,G;for(const M of c){G=f=ka=ea=aa=ba=da=X=Y=R=U=S=N=L=null;const {totalTime:O,timeSeed:T}=M;for(v=0;v<M.numberOfVertices;v++)e(h[4*(M.startVertex+v)],h[4*(M.startVertex+v)+1],h[4*(M.startVertex+v)+2],h[4*(M.startVertex+v)+3],O,T);n(O,T)}return{vertexData:B,indexData:H}}function z(a,d){const e=
d.pixels,{width:n,height:h}=d,c=new Float32Array(n*h*2),r=d.mask||new Uint8Array(n*h*2);d.mask||r.fill(255);if("vector-uv"===a)for(a=0;a<n*h;a++)c[2*a]=e[0][a],c[2*a+1]=-e[1][a];else if("vector-magdir"===a)for(a=0;a<n*h;a++){d=e[0][a];const v=y.deg2rad(e[1][a]),B=Math.sin(v-Math.PI/2);c[2*a]=Math.cos(v-Math.PI/2)*d;c[2*a+1]=B*d}return{data:c,mask:r,width:n,height:h}}async function A(a,d,e,n,h,c){const r={requestProjectedLocalDirections:!0,signal:c};null!=h&&(r.timeExtent=h);if("imagery"===a.type)return await a.load({signal:c}),
h=a.rasterInfo.dataType,a=await a.fetchImage(d,e,n,r),null==a?.pixelData?.pixelBlock?{data:new Float32Array(e*n*2),mask:new Uint8Array(e*n),width:e,height:n}:z(h,a.pixelData.pixelBlock);await a.load({signal:c});h=a.serviceRasterInfo.dataType;a=await a.fetchPixels(d,e,n,r);return null==a?.pixelBlock?{data:new Float32Array(e*n*2),mask:new Uint8Array(e*n),width:e,height:n}:z(h,a.pixelBlock)}const I=()=>l.getLogger("esri.views.2d.engine.flow.dataUtils");m.createAnimatedLinesData=q;m.createFlowMesh=async function(a,
d,e,n){const h=performance.now();var c=D(d,e);const r=performance.now();e=b(d,c,e.width,e.height);d=performance.now();c=q(e,!0);e=performance.now();a="Streamlines"===a?g(c,10):u(c);c=performance.now();k("esri-2d-profiler")&&(I().info("I.1","_createFlowFieldFromData (ms)",Math.round(r-h)),I().info("I.2","_getStreamlines (ms)",Math.round(d-r)),I().info("I.3","createAnimatedLinesData (ms)",Math.round(e-d)),I().info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(c-e)),I().info("I.5","createFlowMesh (ms)",
Math.round(c-h)),I().info("I.6","Mesh size (bytes)",a.vertexData.buffer.byteLength+a.indexData.buffer.byteLength));await Promise.resolve();x.throwIfAborted(n);return a};m.createParticlesMesh=u;m.createStreamlinesMesh=g;m.loadImagery=async function(a,d,e,n,h,c){const r=performance.now();var v=F.getInfo(d.spatialReference);if(!v)return e=await A(a,d,e,n,h,c),k("esri-2d-profiler")&&I().info("I.7","loadImagery, early exit (ms)",Math.round(performance.now()-r)),k("esri-2d-profiler")&&I().info("I.9","Number of parts",
1),e;const [B,H]=v.valid,J=Math.ceil(d.width/(H-B)),K=d.width/J,L=Math.round(e/J);let N=d.xmin;const S=[];v=performance.now();for(let U=0;U<J;U++){const R=new w({xmin:N,xmax:N+K,ymin:d.ymin,ymax:d.ymax,spatialReference:d.spatialReference});S.push(A(a,R,L,n,h,c));N+=K}a=await Promise.all(S);k("esri-2d-profiler")&&I().info("I.8","All calls to _fetchPart (ms)",Math.round(performance.now()-v));k("esri-2d-profiler")&&I().info("I.9","Number of parts",a.length);n={data:new Float32Array(e*n*2),mask:new Uint8Array(e*
n),width:e,height:n};d=0;for(const U of a){for(a=0;a<U.height;a++)for(h=0;h<U.width;h++)d+h>=e||(n.data[2*(a*e+d+h)]=U.data[2*(a*U.width+h)],n.data[2*(a*e+d+h)+1]=U.data[2*(a*U.width+h)+1],n.mask[a*e+d+h]=U.mask[a*U.width+h]);d+=U.width}k("esri-2d-profiler")&&I().info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-r));return n};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/flow/FlowContainer":function(){define(["./BrushFlow","../webgl/enums",
"../webgl/WGLContainer"],function(m,C,k){class l extends k{constructor(){super(...arguments);this.flowStyle=null}doRender(y){super.doRender(y)}prepareRenderPasses(y){const x=y.registerRenderPass({name:"flow",brushes:[m],target:()=>this.children,drawPhase:C.WGLDrawPhase.MAP});return[...super.prepareRenderPasses(y),x]}}return l})},"esri/views/2d/engine/flow/BrushFlow":function(){define(["../../../../core/libs/gl-matrix-2/factories/mat3f32","../webgl/brushes/WGLBrush","../../../webgl/enums"],function(m,
C,k){class l extends C{constructor(){super(...arguments);this._visualState={time:0,dvsMat3:m.create(),displayViewMat3:m.create()}}dispose(){}prepareState(y){({context:y}=y);y.setColorMask(!0,!0,!0,!0);y.setStencilFunction(k.CompareFunction.EQUAL,0,255)}draw(y,x){const {requestRender:E,allowDelayedRender:F}=y,{displayData:w}=x;if(null!=w&&("loaded"===w.state.name&&w.attach(y),"attached"===w.state.name)){var D=w.state.resources;F&&!D.ready&&null!=E?E():(this._visualState.time=y.time/1E3,this._visualState.dvsMat3=
x.transforms.displayViewScreenMat3,this._visualState.displayViewMat3=y.state.displayViewMat3,w.flowStyle.render(y,this._visualState,D),w.flowStyle.animated&&null!=E&&E())}}}return l})},"esri/views/2d/engine/flow/FlowStrategy":function(){define("../../../../chunks/tslib.es6 ../../../../geometry ../../../../core/Accessor ../../../../core/Logger ../../../../core/mathUtils ../../../../core/promiseUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/Point ./FlowDisplayData ./FlowDisplayObject ../../../../geometry/Extent".split(" "),
function(m,C,k,l,y,x,E,F,w,D,p,b,t,q){function g(u,z){const A=new p({x:(u.xmax+u.xmin)/2,y:(u.ymax+u.ymin)/2,spatialReference:u.spatialReference});var I=u.xmax-u.xmin;const a=u.ymax-u.ymin,d=Math.abs(Math.cos(y.deg2rad(z))),e=Math.abs(Math.sin(y.deg2rad(z)));z=d*I+e*a;I=e*I+d*a;u=new q({xmin:A.x-z/2,ymin:A.y-I/2,xmax:A.x+z/2,ymax:A.y+I/2,spatialReference:u.spatialReference});u.centerAt(A);return u}C=class extends k{constructor(u){super(u);this._flowDisplayObject=new t.FlowDisplayObject;this._loading=
null}initialize(){this.flowContainer.addChild(this._flowDisplayObject)}destroy(){this._clear();this.flowContainer.removeAllChildren()}get updating(){return null!=this._loading}update(u){var {flowStyle:z}=this.flowContainer;if(null==z)this._clear();else{var {extent:A,rotation:I,resolution:a,pixelRatio:d}=u.state;u=g(A,I);u.expand(1.15);z=new b(z,u,[Math.round((u.xmax-u.xmin)/a),Math.round((u.ymax-u.ymin)/a)],d);if(null!=this._loading){if(this._loading.update(z))return;this._loading.detach();this._loading=
null}null!=this._flowDisplayObject.displayData&&this._flowDisplayObject.displayData.update(z)||(z.load().then(()=>{this._flowDisplayObject.clear();this._flowDisplayObject.displayData=this._loading;this._loading=null},e=>{x.isAbortError(e)||(l.getLogger(this).error("A resource failed to load.",e),this._loading=null)}),this._loading=z)}}_clear(){this._flowDisplayObject.clear();null!=this._loading&&(this._loading.detach(),this._loading=null)}};m.__decorate([E.property()],C.prototype,"_loading",void 0);
m.__decorate([E.property()],C.prototype,"flowContainer",void 0);m.__decorate([E.property()],C.prototype,"updating",null);return C=m.__decorate([D.subclass("esri.views.2d.engine.flow.FlowStrategy")],C)})},"esri/views/2d/engine/flow/FlowDisplayData":function(){define(["../../../../core/Logger"],function(m){class C{constructor(k,l,y,x){this.state={name:"created"};this.flowStyle=k;this.extent=l;this.size=y;this.pixelRatio=x}async load(){const k=new AbortController;this.state={name:"loading",abortController:k};
this.state={name:"loaded",resources:await this.flowStyle.load({extent:this.extent,size:this.size,pixelRatio:this.pixelRatio},k.signal)}}attach(k){if("loaded"!==this.state.name)m.getLogger("esri.views.2d.engine.flow.FlowDisplayData").error("Only loaded resources can be attached.");else{var l=this.state.resources;l.attach(k);this.state={name:"attached",resources:l}}}detach(){"loading"===this.state.name?(this.state.abortController.abort(),this.state={name:"detached"}):"attached"===this.state.name&&(this.state.resources.detach(),
this.state={name:"detached"})}update(k){if(!this.flowStyle.isCompatible(k.flowStyle)||!this.extent.equals(k.extent)||this.size[0]!==k.size[0]||this.size[1]!==k.size[1]||this.pixelRatio!==k.pixelRatio)return!1;this.flowStyle=k.flowStyle;return!0}}return C})},"esri/views/2d/engine/flow/FlowDisplayObject":function(){define(["exports","../../../../core/mathUtils","../../../../core/libs/gl-matrix-2/math/mat3","../../../../core/libs/gl-matrix-2/factories/mat3f32","../DisplayObject"],function(m,C,k,l,y){class x extends y.DisplayObject{constructor(){super(...arguments);
this._displayData=null}get displayData(){return this._displayData}set displayData(E){this._displayData=E;this.requestRender()}clear(){null!=this._displayData&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(E){var {displayData:F}=this;if(null!=F){var w=[0,0];E.toScreen(w,[F.extent.xmin,F.extent.ymax]);F=(F.extent.xmax-F.extent.xmin)/F.size[0]/E.resolution;var D=C.deg2rad(E.rotation),{displayViewScreenMat3:p}=this.transforms;k.fromTranslation(p,[-1,1,0]);k.scale(p,
p,[2/(E.size[0]*E.pixelRatio),-2/(E.size[1]*E.pixelRatio),1]);k.translate(p,p,[w[0],w[1],0]);k.rotate(p,p,D);k.scale(p,p,[F*E.pixelRatio,F*E.pixelRatio,1])}}_createTransforms(){return{displayViewScreenMat3:l.create()}}}m.FlowDisplayObject=x;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/LayerView2D":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Collection ../../../core/collectionUtils ../../../core/Error ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../engine/Container ../support/HighlightOptions ../../layers/support/ClipRect ../../layers/support/Geometry ../../layers/support/Path ../../support/layerViewUtils".split(" "),
function(m,C,k,l,y,x,E,F,w,D,p,b,t,q,g,u,z){const A=k.ofType({key:"type",base:null,typeMap:{rect:q,path:u,geometry:g}});m.LayerView2DMixin=I=>{I=class extends I{constructor(){super(...arguments);this.attached=!1;this.clips=new A;this.highlightOptions=null;this.lastUpdateId=-1;this.updateRequested=this.moving=!1;this._visibleAtCurrentScale=!0}initialize(){const a=this.view?.spatialReferenceLocked??!0;this.view?.spatialReference&&a&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new y("layerview:spatial-reference-incompatible",
"The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new b.Container),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([x.watch(()=>this.suspended,d=>{this.container&&(this.container.visible=!d)},x.syncAndInitial),x.watch(()=>this.updateSuspended,d=>{this.view&&!d&&this.updateRequested&&this.view.requestUpdate()},x.syncAndInitial),x.watch(()=>this.layer?.opacity??
1,d=>{this.container&&(this.container.opacity=d)},x.syncAndInitial),x.watch(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",d=>{this.container&&(this.container.blendMode=d)},x.syncAndInitial),x.watch(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,d=>{this.container&&(this.container.effect=d)},x.syncAndInitial),x.watch(()=>this.highlightOptions,d=>this.container.highlightOptions=d,x.syncAndInitial),x.on(()=>this.clips,"change",()=>{this.container&&(this.container.clips=
this.clips)},x.syncAndInitial),x.watch(()=>({scale:this.view?.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}),({scale:d,scaleRange:e})=>{d=z.isInEffectiveScaleRange(e,d);d!==this._visibleAtCurrentScale&&(this._visibleAtCurrentScale=d)},x.syncAndInitial)],"constructor"),this.view?.whenLayerView?this.view.whenLayerView(this.layer).then(d=>{d===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}destroy(){this.processDetach();
this.updateRequested=!1}get spatialReferenceSupported(){const a=this.view?.spatialReference;return null==a||this.supportsSpatialReference(a)}get updating(){return this.spatialReferenceSupported&&(!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!!this._updatingHandles?.updating)}get visibleAtCurrentScale(){return this._visibleAtCurrentScale}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,
this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.removeHandles("attach"),this.detach(),this.updateRequested=!1)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.updateSuspended||this.view.requestUpdate())}processUpdate(a){this.isFulfilled()&&!this.isResolved()?this.updateRequested=!1:(this._set("updateParameters",a),this.updateRequested&&!this.updateSuspended&&(this.updateRequested=!1,this.update(a)))}hitTest(a,d){return Promise.resolve(null)}supportsSpatialReference(a){return!0}canResume(){return this.spatialReferenceSupported?
super.canResume()?this.visibleAtCurrentScale:!1:!1}getSuspendInfo(){const a=super.getSuspendInfo(),d=!this.spatialReferenceSupported;d&&(a.spatialReferenceNotSupported=d);return a}addAttachHandles(a){this.addHandles(a,"attach")}};C.__decorate([E.property()],I.prototype,"attached",void 0);C.__decorate([E.property({type:A,set(a){a=l.referenceSetter(a,this._get("clips"),A);this._set("clips",a)}})],I.prototype,"clips",void 0);C.__decorate([E.property()],I.prototype,"container",void 0);C.__decorate([E.property({type:t})],
I.prototype,"highlightOptions",void 0);C.__decorate([E.property()],I.prototype,"moving",void 0);C.__decorate([E.property({readOnly:!0})],I.prototype,"spatialReferenceSupported",null);C.__decorate([E.property({readOnly:!0})],I.prototype,"updateParameters",void 0);C.__decorate([E.property()],I.prototype,"updateRequested",void 0);C.__decorate([E.property()],I.prototype,"updating",null);C.__decorate([E.property()],I.prototype,"view",void 0);C.__decorate([E.property()],I.prototype,"_visibleAtCurrentScale",
void 0);C.__decorate([E.property({readOnly:!0})],I.prototype,"visibleAtCurrentScale",null);return I=C.__decorate([p.subclass("esri.views.2d.layers.LayerView2D")],I)};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/layers/support/ClipRect":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./ClipArea".split(" "),function(m,
C,k,l,y,x,E){var F;k=F=class extends E{constructor(w){super(w);this.type="rect";this.bottom=this.top=this.right=this.left=null}clone(){return new F({left:this.left,right:this.right,top:this.top,bottom:this.bottom})}commitVersionProperties(){this.commitProperty("left");this.commitProperty("right");this.commitProperty("top");this.commitProperty("bottom")}};m.__decorate([C.property({type:[Number,String],json:{write:!0}})],k.prototype,"left",void 0);m.__decorate([C.property({type:[Number,String],json:{write:!0}})],
k.prototype,"right",void 0);m.__decorate([C.property({type:[Number,String],json:{write:!0}})],k.prototype,"top",void 0);m.__decorate([C.property({type:[Number,String],json:{write:!0}})],k.prototype,"bottom",void 0);return k=F=m.__decorate([x.subclass("esri.views.layers.support.ClipRect")],k)})},"esri/views/layers/support/ClipArea":function(){define("../../../chunks/tslib.es6 ../../../core/JSONSupport ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass".split(" "),
function(m,C,k,l,y,x,E){C=class extends C.JSONSupport{get version(){this.commitVersionProperties();return(this._get("version")||0)+1}};m.__decorate([k.property({readOnly:!0})],C.prototype,"version",null);return C=m.__decorate([E.subclass("esri.views.layers.support.ClipArea")],C)})},"esri/views/layers/support/Geometry":function(){define("../../../chunks/tslib.es6 ../../../geometry ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../geometry/Geometry ../../../geometry/support/jsonUtils ./ClipArea ../../../geometry/Extent ../../../geometry/Polygon".split(" "),
function(m,C,k,l,y,x,E,F,w,D,p,b){var t;C={base:F,key:"type",typeMap:{extent:p,polygon:b}};D=t=class extends D{constructor(q){super(q);this.type="geometry";this.geometry=null}clone(){return new t({geometry:this.geometry?.clone()??null})}commitVersionProperties(){this.commitProperty("geometry")}};m.__decorate([k.property({types:C,json:{read:w.fromJSON,write:!0}})],D.prototype,"geometry",void 0);return D=t=m.__decorate([E.subclass("esri.views.layers.support.Geometry")],D)})},"esri/views/layers/support/Path":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./ClipArea".split(" "),
function(m,C,k,l,y,x,E){k=class extends E{constructor(F){super(F);this.type="path";this.path=[]}commitVersionProperties(){this.commitProperty("path")}};m.__decorate([C.property({type:[[[Number]]],json:{write:!0}})],k.prototype,"path",void 0);return k=m.__decorate([x.subclass("esri.views.layers.support.Path")],k)})},"esri/views/2d/layers/imagery/ImageryTileView2D":function(){define("../../../../chunks/tslib.es6 ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../engine/imagery/RasterTileContainer ./BaseImageryTileSubView2D ../support/util ../../../layers/support/Geometry".split(" "),
function(m,C,k,l,y,x,E,F,w,D){k=class extends F.BaseImageryTileSubView2D{constructor(){super(...arguments);this.type="raster"}attach(){super.attach();this.container=new E.RasterTileContainer(this._tileInfoView);this.container.isCustomTilingScheme=this._isCustomTilingScheme;this.updateRasterFunctionParameters()}detach(){super.detach();this.container.removeAllChildren();this.container=null}canUseWebGLForProcessing(){const {symbolizer:p}=this.layer;var b=p.lookup?.colormapLut?.indexedColormap;b=b&&b.length>
this._maxIndexedColormapSize;return this.useWebGLForProcessing&&p.canRenderInWebGL&&!b&&!("majority"===this.layer.interpolation&&w.canUseMajorityInterpolationOnDataSource(this.layer))}fetchTile(p,b){return this.layer.fetchTile(p.level,p.row,p.col,b)}updateRasterFunctionParameters(){const {clips:p,view:b}=this.layerView;null!=this._geometry&&p.remove(this._geometry);const {raster:t,type:q}=this.layer;if("Function"===t.datasetFormat){var g=t.getClippingGeometry(b.spatialReference);g&&(g=new D({geometry:g}),
p.add(g),this._geometry=g)}({container:g}=this);if("Function"!==t.datasetFormat||"wcs"===q)g.rasterFunctionChain=null,g.children.forEach(n=>{({bitmap:n}=n);n&&(n.suspended=!0,n.processed=!1,n.projected&&(n.invalidateTexture(),n.rasterTexture=null))}),this._rasterFunctionState="na";else{var u=this._rasterFunctionState,{rasterFunction:z,primaryRasters:A}=t,I=z.supportsGPU&&(!A||1>=A.rasters.length),a=I?z.flatWebGLFunctionChain:null,{renderer:d}=this.layer;I=!I||!a?.functions.length||"raster-stretch"===
d?.type&&d.dynamicRangeAdjustment||!this.canUseWebGLForProcessing();g.rasterFunctionChain=I?null:a;var e=null==z?"na":g.rasterFunctionChain?"gpu":"cpu";g.children.forEach(n=>{({bitmap:n}=n);n&&(n.suspended=u!==e,n.processed=!1,n.processedTexture=null)});this._rasterFunctionState=e}}async updateTileSource(p,b){const t=this._getBandIds(),q=this._getLayerInterpolation(),g=this.canUseWebGLForProcessing(),{source:u,globalSymbolizerParams:z,suspended:A,coords:I,resolution:a}=b;b=this.layerView.hasTilingEffects?
z:b.symbolizerParams;({bitmap:p}=p);[p.x,p.y]=I;p.resolution=a;if(null!=u?.pixelBlock){var d={extent:u.extent,pixelBlock:u.pixelBlock,srcPixelSize:u.srcTilePixelSize};p.rawPixelData=d;g?(p.source=u.pixelBlock,p.isRendereredSource=!1):(d=await this.layer.applyRenderer(d,"stretch"===z?.type?z:void 0),p.source=d,p.isRendereredSource=!0);p.symbolizerParameters=g?b:null;p.transformGrid=g?u.transformGrid:null}else d=this.createEmptyTilePixelBlock(),p.source=d,p.symbolizerParameters=g?b:null,p.transformGrid=
null;p.bandIds=g?t:null;p.width=this._tileInfoView.tileInfo.size[0];p.height=this._tileInfoView.tileInfo.size[1];p.interpolation=q;p.suspended=A;p.invalidateTexture()}async updateTileSymbolizerParameters(p,b){const {local:t,global:q}=b;b=this._getBandIds();const g=this._getLayerInterpolation(),u=this.canUseWebGLForProcessing();({bitmap:p}=p);const {rawPixelData:z}=p;u||null==z?(p.isRendereredSource&&null!=z&&(p.source=z.pixelBlock),p.isRendereredSource=!1):(p.source=await this.layer.applyRenderer(z,
"stretch"===q?.type?q:void 0),p.isRendereredSource=!0);p.symbolizerParameters=u?this.layerView.hasTilingEffects?q:t:null;p.bandIds=u?b:null;p.interpolation=g;p.suspended=!1}_getLayerInterpolation(){const {interpolation:p,renderer:b}=this.layer;if(!b)return p;const t=b.type;return"raster-colormap"===t||"unique-value"===t||"class-breaks"===t?"nearest":"raster-stretch"===b.type&&null!=b.colorRamp?"bilinear"===p||"cubic"===p?"bilinear":"nearest":p}};m.__decorate([C.property()],k.prototype,"container",
void 0);m.__decorate([C.property()],k.prototype,"layer",void 0);m.__decorate([C.property()],k.prototype,"type",void 0);return k=m.__decorate([x.subclass("esri.views.2d.layers.imagery.ImageryTileView2D")],k)})},"esri/views/2d/engine/imagery/RasterTileContainer":function(){define("exports ../../../../geometry/support/aaBoundingRect ../../viewpointUtils ./BrushRasterBitmap ./RasterTile ../webgl/enums ../webgl/TileContainer".split(" "),function(m,C,k,l,y,x,E){class F extends E{constructor(){super(...arguments);
this.isCustomTilingScheme=!1}createTile(w){const D=this._getTileBounds(w),[p,b]=this._tileInfoView.tileInfo.size,t=this._tileInfoView.getTileResolution(w.level);return new y.RasterTile(w,t,D[0],D[3],p,b)}prepareRenderPasses(w){const D=w.registerRenderPass({name:"imagery (tile)",brushes:[l],target:()=>this.children.map(p=>p.bitmap),drawPhase:x.WGLDrawPhase.MAP});return[...super.prepareRenderPasses(w),D]}doRender(w){if(this.visible&&w.drawPhase===x.WGLDrawPhase.MAP){var {rasterFunctionChain:D}=this;
if(D){if(!D.hasFocalFunction){const [p,b]=this._tileInfoView.tileInfo.size;w.renderPass="raster";w.rasterFunction={name:"Reproject",parameters:{targetImageSize:[p,b],requireNNEdge:D.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1};super.doRender(w)}if(D?.functions.length){const {functions:p,hasBranches:b}=D;for(D=0;D<p.length;D++){const t=p[D];"Constant"!==t.name&&"Identity"!==t.name&&(w.renderPass="raster",w.rasterFunction=t,w.hasBranches=b,super.doRender(w))}}w.rasterFunction=null;w.renderPass=
"bitmap"}else w.renderPass="raster-bitmap";super.doRender(w)}}_getTileBounds(w){const D=this._tileInfoView.getTileBounds(C.create(),w);if(this.isCustomTilingScheme&&w.world){var {tileInfo:p}=this._tileInfoView,b=k.getWorldWidth(p.spatialReference);if(b){var t=p.lodAt(w.level);if(!t)return D;({resolution:t}=t);p=(b=b/t%p.size[0])?(p.size[0]-b)*t:0;D[0]-=p*w.world;D[2]-=p*w.world}}return D}}m.RasterTileContainer=F;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/imagery/BrushRasterBitmap":function(){define("../../../../core/maybe ./RasterBitmap ./colorizer/rasterColorizer ./processor/rasterProcessor ../webgl/definitions ../webgl/VertexStream ../webgl/brushes/WGLBrush ../../../webgl/enums ../../../webgl/FramebufferObject ../../../webgl/rasterUtils".split(" "),
function(m,C,k,l,y,x,E,F,w,D){class p extends E{constructor(){super(...arguments);this.name="raster";this._quad=null;this._rendererUniformInfos=new Map;this._fbo=null}dispose(){m.disposeMaybe(this._quad);m.disposeMaybe(this._fbo)}prepareState(b){const {context:t,renderPass:q}=b;b="raster"===q;t.setBlendingEnabled(!b);t.setBlendFunctionSeparate(F.BlendFactor.ONE,F.BlendFactor.ONE_MINUS_SRC_ALPHA,F.BlendFactor.ONE,F.BlendFactor.ONE_MINUS_SRC_ALPHA);t.setColorMask(!0,!0,!0,!0);t.setStencilWriteMask(0);
t.setStencilTestEnabled(!b)}draw(b,t){if(C.hasSource(t)&&!t.suspended){var {renderPass:q}=b;if("raster-bitmap"===q)this._drawBitmap(b,t);else{if("raster"===q)return this._process(b,t);this._drawBitmap(b,t,!0)}}}_process(b,t){var {rasterFunction:q}=b;q="Reproject"===q.name;if(!(q?t.rasterTexture&&t.projected:t.processed)){var {timeline:g,context:u}=b;g.begin(this.name);var z=u.getBoundFramebufferObject(),A=u.getViewport();q||(t.processedTexture=m.disposeMaybe(t.processedTexture));u.setStencilFunction(F.CompareFunction.EQUAL,
t.stencilRef,255);t.updateTexture(b);this._initQuad(u);var [I,a]=t.getRasterTextureSize(q),{isStandardRasterTileSize:d,fbo:e}=this._getRasterFBO(u,I,a);l.process(b,this._quad,e,t);d||e.dispose();u.bindFramebuffer(z);u.setViewport(A.x,A.y,A.width,A.height);g.end(this.name)}}_drawBitmap(b,t,q=!1){const {timeline:g,context:u}=b;g.begin(this.name);u.setStencilFunction(F.CompareFunction.EQUAL,t.stencilRef,255);t.updateTexture(b);if(q&&!t.processedTexture){t.updateProcessedTexture();if(!t.processedTexture){g.end(this.name);
return}t.processed=!0}this._initBitmapCommonUniforms(t);var z=t.symbolizerParameters.type;const A=k.getColorizer(z),{requestRender:I,allowDelayedRender:a}=b,{defines:d,program:e}=A.createProgram(b,t,t.projected&&q);a&&null!=I&&!e.compiled?I():(u.useProgram(e),z=this._getUniformInfos(z,u,e,d),this._quad||(this._quad=new x(u,[0,0,1,0,0,1,1,1])),A.bindTextureAndUniforms(b,e,t,z,q),this._quad.draw(),g.end(this.name))}_initBitmapCommonUniforms(b){if(!b.commonUniforms){const t=D.getBasicGridUniforms(1,
[0,0]),{transformGrid:q,width:g,height:u}=b,z=D.getCommonUniforms(q,[g,u],[b.source.width,b.source.height],1,!1);b.commonUniforms={...t,...z,u_coordScale:b.coordScale}}}_getRasterFBO(b,t,q){const g=t===y.tileSize&&q===y.tileSize;return g?(this._fbo||(this._fbo=this._createNewFBO(b,t,q)),{isStandardRasterTileSize:g,fbo:this._fbo}):{isStandardRasterTileSize:g,fbo:this._createNewFBO(b,t,q)}}_createNewFBO(b,t,q){t=l.createTextureDescriptor(t,q);return new w.FramebufferObject(b,t)}_initQuad(b){this._quad||
(this._quad=new x(b,[0,0,1,0,0,1,1,1]))}_getUniformInfos(b,t,q,g){b=0<g.length?b+"-"+g.join("-"):b;if(this._rendererUniformInfos.has(b))return this._rendererUniformInfos.get(b);t=D.getUniformLocationInfos(t,q);this._rendererUniformInfos.set(b,t);return t}}return p})},"esri/views/2d/engine/imagery/RasterBitmap":function(){define("exports ../../../../core/maybe ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f32 ../../../../core/libs/gl-matrix-2/factories/vec2f32 ../DisplayObject ../../../webgl/enums ../../../webgl/rasterUtils".split(" "),
function(m,C,k,l,y,x,E,F){const w={bandCount:3,outMin:0,outMax:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class D extends x.DisplayObject{constructor(b=null,t=null,q=null){super();this._colormapTextureInvalidated=this._textureInvalidated=!0;this._colormap=this._colormapTexture=this._transformGridTexture=this._rasterTextureBandIds=this._rasterTexture=null;
this._supportsBilinearTexture=!0;this._processedTexture=null;this.functionTextures=[];this.projected=!1;this.stencilRef=0;this.coordScale=[1,1];this._processed=!1;this.height=this._symbolizerParameters=null;this.isRendereredSource=!1;this.pixelRatio=1;this.rotation=this.resolution=0;this.rawPixelData=this._source=null;this._suspended=!1;this.width=this._transformGrid=this._interpolation=this._bandIds=null;this.y=this.x=0;this.source=b;this.transformGrid=t;this.interpolation=q}destroy(){this._disposeTextures()}get processedTexture(){return this._processedTexture}set processedTexture(b){this._processedTexture!==
b&&(this._disposeTextures(!0),this._processedTexture=b)}get rasterTexture(){return this._rasterTexture}set rasterTexture(b){this._rasterTexture!==b&&(this._rasterTexture?.dispose(),this._rasterTexture=b);null==b&&(this.projected=!1)}get processed(){return this._processed}set processed(b){this._processed=b;b||(C.disposeMaybe(this.processedTexture),this.invalidateTexture())}get symbolizerParameters(){return this._symbolizerParameters||w}set symbolizerParameters(b){this._symbolizerParameters!==b&&(this._symbolizerParameters=
b,this._colormapTextureInvalidated=!0,this.commonUniforms=null)}get source(){return this._source}set source(b){this._source!==b&&(this._source=b,this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=this._rasterTexture=null),this.commonUniforms=null,this.projected=!1,this.invalidateTexture())}get suspended(){return this._suspended}set suspended(b){this._suspended&&!b&&this.stage&&(this.ready(),this.requestRender());this._suspended=b}get bandIds(){return this._bandIds}set bandIds(b){this._bandIds=
b;this._isBandIdsChanged(b)&&(this.projected=!1,this.invalidateTexture())}get interpolation(){return this._interpolation||"nearest"}set interpolation(b){this._interpolation=b;this._rasterTexture&&this._rasterTexture.setSamplingMode("bilinear"===this._getTextureSamplingMethod(b||"nearest")?E.TextureSamplingMode.LINEAR:E.TextureSamplingMode.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(b){this._transformGrid!==b&&(this._transformGrid=b,this._transformGridTexture=C.disposeMaybe(this._transformGridTexture))}invalidateTexture(){this._textureInvalidated||
(this._textureInvalidated=!0,this.requestRender())}getRasterTextureSize(b=!1){b=b||this.projected;return[b?this.width:this.source?.width||this.width,b?this.height:this.source?.height||this.height]}getRasterCellSize(){const b=this.rawPixelData?.srcPixelSize,{projected:t,resolution:q}=this;return b&&!t?[b.x,b.y]:[q,q]}_createTransforms(){return{displayViewScreenMat3:l.create()}}setTransform(b){const t=k.identity(this.transforms.displayViewScreenMat3),[q,g]=b.toScreenNoRotation([0,0],[this.x,this.y]);
var u=this.resolution/this.pixelRatio/b.resolution;const z=u*this.width;u*=this.height;const A=Math.PI*this.rotation/180;k.translate(t,t,y.fromValues(q,g));k.translate(t,t,y.fromValues(z/2,u/2));k.rotate(t,t,-A);k.translate(t,t,y.fromValues(-z/2,-u/2));k.scaleByVec2(t,t,y.fromValues(z,u));k.multiply(this.transforms.displayViewScreenMat3,b.displayViewMat3,t)}getTextures({forProcessing:b=!1,useProcessedTexture:t=!1}={}){const q=t?this._processedTexture??this._rasterTexture:this._rasterTexture,g=[],
u=[];if(!q)return{names:g,textures:u};this._transformGridTexture&&!this.projected&&(u.push(this._transformGridTexture),g.push("u_transformGrid"));if(t)return u.push(q),g.push("u_image"),this._colormapTexture&&(u.push(this._colormapTexture),g.push("u_colormap")),{names:g,textures:u};u.push(q);g.push("u_image");this._colormapTexture&&!b&&(u.push(this._colormapTexture),g.push("u_colormap"));return{names:g,textures:u}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:b}){if(this.stage){var t=
this._isValidSource(this.source);t&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(b));this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(b),this._rasterTexture&&(t?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=F.createTransformTexture(b,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}else this._disposeTextures()}updateProcessedTexture(){const {functionTextures:b}=
this;0!==b.length&&(this.processedTexture=b.shift(),b.forEach(t=>t?.dispose()),b.length=0)}_createOrDestroyRasterTexture(b){const t=this.source?.extractBands(this.bandIds);if(this._isValidSource(t)){var q=!this._isBandIdsChanged(this.bandIds);if(this._rasterTexture){if(q)return;this._rasterTexture.dispose();this._rasterTexture=this._rasterTextureBandIds=null}this._supportsBilinearTexture=!!b.capabilities.textureFloatLinear;q=this._getTextureSamplingMethod(this.interpolation);this._rasterTexture=F.createRasterTexture(b,
t,q,this.isRendereredSource);this._processed=this.projected=!1;this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}else this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=this._rasterTextureBandIds=null)}_isBandIdsChanged(b){const t=this._rasterTextureBandIds;return!(null==t&&null==b||t&&b&&t.join("")===b.join(""))}_isValidSource(b){return null!=b&&0<b.pixels?.length}_getTextureSamplingMethod(b){var {type:t}=this.symbolizerParameters;t="lut"===t||"hillshade"===t||"stretch"===
t&&1===this.symbolizerParameters.bandCount;return!this._supportsBilinearTexture||t||"bilinear"!==b&&"cubic"!==b?"nearest":"bilinear"}_updateColormapTexture(b){const t=this._colormap,q=this.symbolizerParameters.colormap;if(!q)this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormap=null;else if(!t)this._colormapTexture=F.createColormapTexture(b,q),this._colormap=q;else if(q.length!==t.length||q.some((g,u)=>g!==t[u]))this._colormapTexture&&(this._colormapTexture.dispose(),
this._colormapTexture=null),this._colormapTexture=F.createColormapTexture(b,q),this._colormap=q}_disposeTextures(b=!1){!this._transformGridTexture||b&&!this.projected||(this._transformGridTexture.dispose(),this._transformGridTexture=null);!b&&this._colormapTexture&&(this._colormapTexture.dispose(),this._colormap=this._colormapTexture=null,this._colormapTextureInvalidated=!0);!b&&this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=this._rasterTexture=null);this._processedTexture&&
(this._processedTexture.dispose(),this._processedTexture=null)}}class p extends D{get source(){return this._source}}m.RasterBitmap=D;m.RasterBitmapWithSource=p;m.hasSource=function(b){return null!=b.source};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/rasterUtils":function(){define(["exports","../../core/libs/gl-matrix-2/factories/vec2f64","./enums","./Texture","./TextureDescriptor"],function(m,C,k,l,y){m.createColormapTexture=function(x,E){const F=new y.TextureDescriptor;
F.internalFormat=k.PixelFormat.RGBA;F.width=E.length/4;F.height=1;F.samplingMode=k.TextureSamplingMode.NEAREST;F.wrapMode=k.TextureWrapMode.CLAMP_TO_EDGE;return new l.Texture(x,F,E)};m.createRasterTexture=function(x,E,F="nearest",w=!1){const D=(w=!(w&&"u8"===E.pixelType))?k.PixelType.FLOAT:k.PixelType.UNSIGNED_BYTE,p=null==E.pixels||0===E.pixels.length?null:w?E.getAsRGBAFloat():E.getAsRGBA(),b=x.capabilities.textureFloatLinear,t=new y.TextureDescriptor;t.width=E.width;t.height=E.height;t.internalFormat=
w?k.SizedPixelFormat.RGBA32F:k.PixelFormat.RGBA;t.samplingMode=!b||"bilinear"!==F&&"cubic"!==F?k.TextureSamplingMode.NEAREST:k.TextureSamplingMode.LINEAR;t.dataType=D;t.wrapMode=k.TextureWrapMode.CLAMP_TO_EDGE;return new l.Texture(x,t,p)};m.createTransformTexture=function(x,E){const {spacing:F,offsets:w,coefficients:D,size:[p,b]}=E;var t=1<F[0];E=new y.TextureDescriptor;E.width=t?4*p:p;E.height=b;E.internalFormat=k.SizedPixelFormat.RGBA32F;E.dataType=k.PixelType.FLOAT;E.samplingMode=k.TextureSamplingMode.NEAREST;
E.wrapMode=k.TextureWrapMode.CLAMP_TO_EDGE;const q=new Float32Array(t?p*b*16:2*w.length);if(t&&null!=D)for(let g=0,u=0;g<D.length;g++)q[u++]=D[g],2===g%3&&(q[u++]=1);else for(t=0;t<b;t++)for(let g=0;g<p;g++){const u=4*(t*p+g),z=2*(g*b+t);q[u]=w[z];q[u+1]=w[z+1];q[u+3]=-1===w[z]?0:1}return new l.Texture(x,E,q)};m.getBasicGridUniforms=function(x,E){return{u_scale:x,u_offset:E}};m.getColormapUniforms=function(x,E){return{u_colormapOffset:E||0,u_colormapMaxIndex:x?x.length/4-1:0}};m.getCommonUniforms=
function(x,E,F,w=1,D=!0){return{u_flipY:D,u_applyTransform:!!x,u_opacity:w,u_transformSpacing:x?x.spacing:C.ZEROS,u_transformGridSize:x?x.size:C.ZEROS,u_targetImageSize:E,u_srcImageSize:F}};m.getShadedReliefUniforms=function(x){return{u_hillshadeType:x.hillshadeType,u_sinZcosAs:x.sinZcosAs,u_sinZsinAs:x.sinZsinAs,u_cosZs:x.cosZs,u_weights:x.weights,u_factor:x.factor,u_minValue:x.minValue,u_maxValue:x.maxValue}};m.getStretchUniforms=function(x){return{u_bandCount:x.bandCount,u_minOutput:x.outMin,u_maxOutput:x.outMax,
u_minCutOff:x.minCutOff,u_maxCutOff:x.maxCutOff,u_factor:x.factor,u_useGamma:x.useGamma,u_gamma:x.gamma,u_gammaCorrection:x.gammaCorrection}};m.getUniformLocationInfos=function(x,E){x=x.gl;E=E.glName;const F=new Map;if(null==E)return F;const w=x.getProgramParameter(E,x.ACTIVE_UNIFORMS);let D;for(let p=0;p<w;p++)(D=x.getActiveUniform(E,p))&&F.set(D.name,{location:x.getUniformLocation(E,D.name),info:D});return F};m.setTextures=function(x,E,F,w){F.length===w.length&&(w.some(D=>null==D)||F.some(D=>null==
D)||F.forEach((D,p)=>{E.setUniform1i(D,p);x.bindTexture(w[p],p)}))};m.setUniforms=function(x,E,F){Object.keys(F).forEach(w=>{var D=E.get(w)||E.get(w+"[0]");if(D){var p=F[w];if(null!==D&&null!=p)switch({info:D}=D,D.type){case k.UniformType.FLOAT:1<D.size?x.setUniform1fv(w,p):x.setUniform1f(w,p);break;case k.UniformType.FLOAT_VEC2:x.setUniform2fv(w,p);break;case k.UniformType.FLOAT_VEC3:x.setUniform3fv(w,p);break;case k.UniformType.FLOAT_VEC4:x.setUniform4fv(w,p);break;case k.UniformType.FLOAT_MAT3:x.setUniformMatrix3fv(w,
p);break;case k.UniformType.FLOAT_MAT4:x.setUniformMatrix4fv(w,p);break;case k.UniformType.INT:1<D.size?x.setUniform1iv(w,p):x.setUniform1i(w,p);break;case k.UniformType.BOOL:x.setUniform1i(w,p?1:0);break;case k.UniformType.INT_VEC2:case k.UniformType.BOOL_VEC2:x.setUniform2iv(w,p);break;case k.UniformType.INT_VEC3:case k.UniformType.BOOL_VEC3:x.setUniform3iv(w,p);break;case k.UniformType.INT_VEC4:case k.UniformType.BOOL_VEC4:x.setUniform4iv(w,p)}}})};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},
"esri/views/2d/engine/imagery/colorizer/rasterColorizer":function(){define(["exports","./lut","./shadedrelief","./stretch"],function(m,C,k,l){const y=new Map;y.set("lut",C);y.set("hillshade",k);y.set("stretch",l);m.getColorizer=function(x){return y.get(x)};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/imagery/colorizer/lut":function(){define(["./utils","../../../../webgl/rasterUtils"],function(m,C){const k={vsPath:"raster/common",fsPath:"raster/lut",attributes:new Map([["a_position",
0],["a_texcoord",1]])};return{createProgram:function(l,y,x){y=x?[]:m.getProjectionDefines(y.transformGrid);l=l.painter.materialManager.getProgram(k,y);return{defines:y,program:l}},bindTextureAndUniforms:function(l,y,x,E,F=!1){const {names:w,textures:D}=x.getTextures({useProcessedTexture:F});C.setTextures(l.context,y,w,D);C.setUniforms(y,E,x.commonUniforms);y.setUniformMatrix3fv("u_dvsMat3",x.transforms.displayViewScreenMat3);const {colormap:p,colormapOffset:b}=x.symbolizerParameters;l=C.getColormapUniforms(p,
b);C.setUniforms(y,E,l)}}})},"esri/views/2d/engine/imagery/colorizer/utils":function(){define(["exports"],function(m){m.getInterpolationDefines=function(C,k,l){l=!l.capabilities.textureFloatLinear;const y=[];"cubic"===C?y.push("bicubic"):"bilinear"===C&&(k?(y.push("bilinear"),y.push("nnedge")):l&&y.push("bilinear"));return y};m.getProjectionDefines=function(C){const k=[];C&&(k.push("applyProjection"),1===C.spacing[0]&&k.push("lookupProjection"));return k};Object.defineProperty(m,Symbol.toStringTag,
{value:"Module"})})},"esri/views/2d/engine/imagery/colorizer/shadedrelief":function(){define(["./utils","../../../../webgl/rasterUtils"],function(m,C){const k={vsPath:"raster/common",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};return{createProgram:function(l,y,x){const {colormap:E}=y.symbolizerParameters;x=x?[]:m.getProjectionDefines(y.transformGrid);y=m.getInterpolationDefines(y.interpolation,!0,l.context);y=[...x,...y];null!=E&&y.push("applyColormap");l=l.painter.materialManager.getProgram(k,
y);return{defines:y,program:l}},bindTextureAndUniforms:function(l,y,x,E,F=!1){const {names:w,textures:D}=x.getTextures({useProcessedTexture:F});C.setTextures(l.context,y,w,D);C.setUniforms(y,E,x.commonUniforms);y.setUniformMatrix3fv("u_dvsMat3",x.transforms.displayViewScreenMat3);l=x.symbolizerParameters;const {colormap:p,colormapOffset:b}=l;null!=p&&(x=C.getColormapUniforms(p,b),C.setUniforms(y,E,x));l=C.getShadedReliefUniforms(l);C.setUniforms(y,E,l)}}})},"esri/views/2d/engine/imagery/colorizer/stretch":function(){define(["./utils",
"../../../../webgl/rasterUtils"],function(m,C){const k={vsPath:"raster/common",fsPath:"raster/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};return{createProgram:function(l,y,x){const {colormap:E,bandCount:F}=y.symbolizerParameters;var w=x?[]:m.getProjectionDefines(y.transformGrid);const D=m.getInterpolationDefines(y.interpolation,1===F,l.context);w=[...w,...D];y.isRendereredSource&&!x?w.push("noop"):null!=E&&w.push("applyColormap");l=l.painter.materialManager.getProgram(k,w);return{defines:w,
program:l}},bindTextureAndUniforms:function(l,y,x,E,F=!1){const {names:w,textures:D}=x.getTextures({useProcessedTexture:F});C.setTextures(l.context,y,w,D);C.setUniforms(y,E,x.commonUniforms);y.setUniformMatrix3fv("u_dvsMat3",x.transforms.displayViewScreenMat3);l=x.symbolizerParameters;const {colormap:p,colormapOffset:b}=l;null!=p&&(x=C.getColormapUniforms(p,b),C.setUniforms(y,E,x));l=C.getStretchUniforms(l);C.setUniforms(y,E,l)}}})},"esri/views/2d/engine/imagery/processor/rasterProcessor":function(){define("exports ./aspectProcessor ./bandArithmeticProcessor ./compositeBandProcessor ./computeChangeProcessor ./contrastProcessor ./convolutionProcessor ./curvatureProcessor ./extractBandProcessor ./focalStatisticsProcessor ./grayscaleProcessor ./localProcessor ./maskProcessor ./ndviProcessor ./remapProcessor ./reprojectProcessor ./slopeProcessor ./stretchProcessor ../../../../webgl/enums ../../../../webgl/Texture ../../../../webgl/TextureDescriptor".split(" "),
function(m,C,k,l,y,x,E,F,w,D,p,b,t,q,g,u,z,A,I,a,d){function e(h,c){const r=new d.TextureDescriptor;r.width=h;r.height=c;r.internalFormat=I.SizedPixelFormat.RGBA32F;r.samplingMode=I.TextureSamplingMode.NEAREST;r.dataType=I.PixelType.FLOAT;r.isImmutable=!0;r.wrapMode=I.TextureWrapMode.CLAMP_TO_EDGE;return r}const n=new Map;n.set("arithmetic",b);n.set("aspect",C);n.set("bandarithmetic",k);n.set("computechange",y);n.set("compositeband",l);n.set("convolution",E);n.set("contrastbrightness",x);n.set("curvature",
F);n.set("extractband",w);n.set("statistics",D);n.set("grayscale",p);n.set("local",b);n.set("mask",t);n.set("ndvi",q);n.set("remap",g);n.set("slope",z);n.set("stretch",A);m.createTextureDescriptor=e;m.process=function(h,c,r,v){const B=h.rasterFunction.name.toLowerCase();var H="reproject"===B?u:n.get(B.toLowerCase());if(null!=H){{const {context:N,requestRender:S,allowDelayedRender:U}=h;var J=H.createProgram(h,v);U&&null!=S&&!J.compiled?(S(),J=null):(N.bindFramebuffer(r),N.setViewport(0,0,r.width,r.height),
N.useProgram(J))}if(J){H.bindTextureAndUniforms(h,J,v);({interpolation:H}=v);"reproject"===B&&(v.interpolation="nearest");c.draw();var [K,L]=v.getRasterTextureSize("reproject"===B);c=e(K,L);c=new a.Texture(h.context,c);r.copyToTexture(0,0,K,L,0,0,c);"reproject"===B?(v.rasterTexture=c,v.projected=!0,v.interpolation=H):v.functionTextures[h.hasBranches?h.rasterFunction.id:0]=c}}};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/imagery/processor/aspectProcessor":function(){define(["./utils"],
function(m){const C={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/aspect",attributes:new Map([["a_position",0],["a_texcoord",1]])};return{createProgram:function(k,l){return k.painter.materialManager.getProgram(C,[])},bindTextureAndUniforms:function(k,l,y){m.setSingleImageTextures(k,l,y);m.setCoordsAndTransforms(l);k=y.getRasterTextureSize();l.setUniform2fv("u_srcImageSize",k);y=y.getRasterCellSize();l.setUniform2fv("u_cellSize",y)}}})},"esri/views/2d/engine/imagery/processor/utils":function(){define(["exports",
"../../../../webgl/rasterUtils"],function(m,C){function k(x,E,F){const {context:w,rasterFunction:D,hasBranches:p}=x;({raster:x}=D.parameters);C.setTextures(w,E,["u_image"],[F.functionTextures[p?x?.id??-1:0]??F.rasterTexture])}const l=[1,1],y=[2,0,0,0,2,0,-1,-1,0];m.setCoordsAndTransforms=function(x){x.setUniform2fv("u_coordScale",l);x.setUniformMatrix3fv("u_dvsMat3",y)};m.setMultipleImageTextures=function(x,E,F){var {rasters:w}=x.rasterFunction.parameters;if(w){if(2>w.length)return k(x,E,F);var D=
w.filter(p=>"Constant"!==p.name).map(p=>null!=p.id&&"Identity"!==p.name?F.functionTextures[p.id]:F.rasterTexture);C.setTextures(x.context,E,["u_image","u_image1","u_image2"].slice(0,D.length),D);if(D.length!==w.length)if(2===w.length)D=w.findIndex(p=>"Constant"===p.name),x=0===D?[0,1,0,1,0,0,0,0,0]:[1,0,0,0,1,0,0,0,0],{value:w}=w[D].parameters,E.setUniform1f("u_image1Const",w),E.setUniformMatrix3fv("u_imageSwap",x);else if(3===w.length){const p=[];w.forEach((b,t)=>"Constant"===b.name&&p.push(t));
1===p.length?({value:w}=w[p[0]].parameters,E.setUniform1f("u_image1Const",w),E.setUniformMatrix3fv("u_imageSwap",0===p[0]?[0,1,0,0,0,1,1,0,0]:1===p[0]?[1,0,0,0,0,1,0,1,0]:[1,0,0,0,1,0,0,0,1])):2===p.length&&({value:x}=w[p[0]].parameters,E.setUniform1f("u_image1Const",x),{value:x}=w[p[1]].parameters,E.setUniform1f("u_image2Const",x),w=w.findIndex(b=>"Constant"!==b.name),E.setUniformMatrix3fv("u_imageSwap",0===w?[1,0,0,0,1,0,0,0,1]:1===w?[0,1,0,1,0,0,0,0,1]:[0,0,1,1,0,0,0,1,0]))}}};m.setSingleImageTextures=
k;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/imagery/processor/bandArithmeticProcessor":function(){define(["./utils"],function(m){const C={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/bandarithmetic",attributes:new Map([["a_position",0],["a_texcoord",1]])};return{createProgram:function(k,l){const {painter:y,rasterFunction:x}=k;({indexType:k}=x.parameters);return y.materialManager.getProgram(C,[k])},bindTextureAndUniforms:function(k,l,y){m.setSingleImageTextures(k,
l,y);m.setCoordsAndTransforms(l);({bandIndexMat3:k}=k.rasterFunction.parameters);l.setUniformMatrix3fv("u_bandIndexMat3",k)}}})},"esri/views/2d/engine/imagery/processor/compositeBandProcessor":function(){define(["./utils"],function(m){const C={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/compositeband",attributes:new Map([["a_position",0],["a_texcoord",1]])};return{createProgram:function(k,l){l=k.rasterFunction.parameters.rasters.filter(x=>"Constant"===x.name);const y=[];l.length&&(y.push("oneConstant"),
2===l.length&&y.push("twoConstant"));return k.painter.materialManager.getProgram(C,y)},bindTextureAndUniforms:function(k,l,y){m.setMultipleImageTextures(k,l,y);m.setCoordsAndTransforms(l)}}})},"esri/views/2d/engine/imagery/processor/computeChangeProcessor":function(){define(["./utils"],function(m){const C={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/computechange",attributes:new Map([["a_position",0],["a_texcoord",1]])};return{createProgram:function(k){const {painter:l,rasterFunction:y}=k,{method:x,
rasters:E,isOutputRounded:F}=y.parameters;k=[x.includes("-")?x.slice(0,x.indexOf("-")):x];E.filter(w=>"Constant"===w.name).length&&k.push("oneConstant");F&&k.push("roundOutput");return l.materialManager.getProgram(C,k)},bindTextureAndUniforms:function(k,l,y){m.setMultipleImageTextures(k,l,y);m.setCoordsAndTransforms(l);({domainRange:k}=k.rasterFunction.parameters);l.setUniform2fv("u_domainRange",k)}}})},"esri/views/2d/engine/imagery/processor/contrastProcessor":function(){define(["./utils"],function(m){const C=
{vsPath:"raster/rfx/vs",fsPath:"raster/rfx/contrast",attributes:new Map([["a_position",0],["a_texcoord",1]])};return{createProgram:function(k,l){return k.painter.materialManager.getProgram(C,[])},bindTextureAndUniforms:function(k,l,y){m.setSingleImageTextures(k,l,y);m.setCoordsAndTransforms(l);const {contrastOffset:x,brightnessOffset:E}=k.rasterFunction.parameters;l.setUniform1f("u_contrastOffset",x);l.setUniform1f("u_brightnessOffset",E)}}})},"esri/views/2d/engine/imagery/processor/convolutionProcessor":function(){define(["./utils"],
function(m){const C={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/convolution",attributes:new Map([["a_position",0],["a_texcoord",1]])};return{createProgram:function(k,l){const {painter:y,rasterFunction:x}=k,{kernelRows:E,kernelCols:F}=x.parameters;return y.materialManager.getProgram(C,[{name:"rows",value:E},{name:"cols",value:F}])},bindTextureAndUniforms:function(k,l,y){m.setSingleImageTextures(k,l,y);m.setCoordsAndTransforms(l);l.setUniform2fv("u_srcImageSize",[y.width,y.height]);const {kernel:x,clampRange:E}=
k.rasterFunction.parameters;l.setUniform1fv("u_kernel",x);l.setUniform2fv("u_clampRange",E)}}})},"esri/views/2d/engine/imagery/processor/curvatureProcessor":function(){define(["./utils"],function(m){const C={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/curvature",attributes:new Map([["a_position",0],["a_texcoord",1]])};return{createProgram:function(k,l){const {painter:y,rasterFunction:x}=k;({curvatureType:k}=x.parameters);return y.materialManager.getProgram(C,[k])},bindTextureAndUniforms:function(k,
l,y){m.setSingleImageTextures(k,l,y);m.setCoordsAndTransforms(l);const x=y.getRasterTextureSize();l.setUniform2fv("u_srcImageSize",x);({zFactor:k}=k.rasterFunction.parameters);y=y.getRasterCellSize();l.setUniform1f("u_zlFactor",200*k/y[0]/y[1])}}})},"esri/views/2d/engine/imagery/processor/extractBandProcessor":function(){define(["./utils"],function(m){const C={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/extractband",attributes:new Map([["a_position",0],["a_texcoord",1]])};return{createProgram:function(k,
l){return k.painter.materialManager.getProgram(C,[])},bindTextureAndUniforms:function(k,l,y){m.setSingleImageTextures(k,l,y);m.setCoordsAndTransforms(l);({bandIndexMat3:k}=k.rasterFunction.parameters);l.setUniformMatrix3fv("u_bandIndexMat3",k)}}})},"esri/views/2d/engine/imagery/processor/focalStatisticsProcessor":function(){define(["./utils"],function(m){const C={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/focalstatistics",attributes:new Map([["a_position",0],["a_texcoord",1]])};return{createProgram:function(k,
l){const {painter:y,rasterFunction:x}=k,{kernelRows:E,kernelCols:F,fillNoDataOnly:w,statisticsType:D}=x.parameters;k=[{name:"rows",value:E},{name:"cols",value:F},D];w&&k.push("fill");return y.materialManager.getProgram(C,k)},bindTextureAndUniforms:function(k,l,y){m.setSingleImageTextures(k,l,y);m.setCoordsAndTransforms(l);l.setUniform2fv("u_srcImageSize",[y.width,y.height]);({clampRange:k}=k.rasterFunction.parameters);l.setUniform2fv("u_clampRange",k)}}})},"esri/views/2d/engine/imagery/processor/grayscaleProcessor":function(){define(["./utils"],
function(m){const C={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/grayscale",attributes:new Map([["a_position",0],["a_texcoord",1]])};return{createProgram:function(k,l){return k.painter.materialManager.getProgram(C,[])},bindTextureAndUniforms:function(k,l,y){m.setSingleImageTextures(k,l,y);m.setCoordsAndTransforms(l);({weights:k}=k.rasterFunction.parameters);l.setUniform3fv("u_weights",k)}}})},"esri/views/2d/engine/imagery/processor/localProcessor":function(){define(["./utils"],function(m){const C={vsPath:"raster/rfx/vs",
fsPath:"raster/rfx/local",attributes:new Map([["a_position",0],["a_texcoord",1]])};return{createProgram:function(k){const {painter:l,rasterFunction:y}=k,{imageCount:x,operationName:E,rasters:F,isOutputRounded:w}=y.parameters;k=[E.toLowerCase()];2===x&&k.push("twoImages");const D=F.filter(p=>"Constant"===p.name);D.length&&(k.push("oneConstant"),2===D.length&&k.push("twoConstant"));w&&k.push("roundOutput");return l.materialManager.getProgram(C,k)},bindTextureAndUniforms:function(k,l,y){m.setMultipleImageTextures(k,
l,y);m.setCoordsAndTransforms(l);({domainRange:k}=k.rasterFunction.parameters);l.setUniform2fv("u_domainRange",k)}}})},"esri/views/2d/engine/imagery/processor/maskProcessor":function(){define(["./utils"],function(m){const C={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/mask",attributes:new Map([["a_position",0],["a_texcoord",1]])};return{createProgram:function(k,l){const {painter:y,rasterFunction:x}=k;return y.materialManager.getProgram(C,1<x.parameters.bandCount?["multiBand"]:[])},bindTextureAndUniforms:function(k,
l,y){m.setSingleImageTextures(k,l,y);m.setCoordsAndTransforms(l);const {includedRanges:x,noDataValues:E}=k.rasterFunction.parameters;l.setUniform1fv("u_includedRanges",x);l.setUniform1fv("u_noDataValues",E)}}})},"esri/views/2d/engine/imagery/processor/ndviProcessor":function(){define(["./utils"],function(m){const C={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/ndvi",attributes:new Map([["a_position",0],["a_texcoord",1]])};return{createProgram:function(k,l){const {painter:y,rasterFunction:x}=k;return y.materialManager.getProgram(C,
x.parameters.scaled?["scaled"]:[])},bindTextureAndUniforms:function(k,l,y){m.setSingleImageTextures(k,l,y);m.setCoordsAndTransforms(l);({bandIndexMat3:k}=k.rasterFunction.parameters);l.setUniformMatrix3fv("u_bandIndexMat3",k)}}})},"esri/views/2d/engine/imagery/processor/remapProcessor":function(){define(["./utils"],function(m){const C={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/remap",attributes:new Map([["a_position",0],["a_texcoord",1]])};return{createProgram:function(k,l){return k.painter.materialManager.getProgram(C,
[])},bindTextureAndUniforms:function(k,l,y){m.setSingleImageTextures(k,l,y);m.setCoordsAndTransforms(l);const {noDataRanges:x,rangeMaps:E,allowUnmatched:F,clampRange:w}=k.rasterFunction.parameters;l.setUniform1fv("u_noDataRanges",x);l.setUniform1fv("u_rangeMaps",E);l.setUniform1f("u_unmatchMask",F?1:0);l.setUniform2fv("u_clampRange",w)}}})},"esri/views/2d/engine/imagery/processor/reprojectProcessor":function(){define(["../../../../../core/libs/gl-matrix-2/factories/vec2f64","../../../../webgl/rasterUtils"],
function(m,C){const k={vsPath:"raster/common",fsPath:"raster/reproject",attributes:new Map([["a_position",0],["a_texcoord",1]])};return{createProgram:function(l,y){const {painter:x}=l,E=[],{interpolation:F,transformGrid:w}=y;l=l.rasterFunction?.parameters;"cubic"===F?E.push("bicubic"):"bilinear"===F&&(E.push("bilinear"),l?.requireNNEdge&&E.push("nnedge"));w&&(E.push("applyProjection"),1===w.spacing[0]&&E.push("lookupProjection"));return x.materialManager.getProgram(k,E)},bindTextureAndUniforms:function(l,
y,x){const {names:E,textures:F}=x.getTextures({forProcessing:!0});C.setTextures(l.context,y,E,F);y.setUniform1f("u_scale",1);y.setUniform2fv("u_offset",[0,0]);y.setUniform2fv("u_coordScale",[1,1]);y.setUniformMatrix3fv("u_dvsMat3",[2,0,0,0,2,0,-1,-1,0]);y.setUniform1i("u_flipY",0);y.setUniform1f("u_opacity",1);const {width:w,height:D,source:p,transformGrid:b}=x;y.setUniform2fv("u_srcImageSize",[p.width,p.height]);y.setUniform2fv("u_targetImageSize",[w,D]);y.setUniform2fv("u_transformSpacing",b?b.spacing:
m.ZEROS);y.setUniform2fv("u_transformGridSize",b?b.size:m.ZEROS)}}})},"esri/views/2d/engine/imagery/processor/slopeProcessor":function(){define(["./utils"],function(m){const C={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/slope",attributes:new Map([["a_position",0],["a_texcoord",1]])};return{createProgram:function(k,l){const {painter:y,rasterFunction:x}=k;({slopeType:k}=x.parameters);return y.materialManager.getProgram(C,"percent-rise"===k?["percentRise"]:[])},bindTextureAndUniforms:function(k,l,y){m.setSingleImageTextures(k,
l,y);m.setCoordsAndTransforms(l);const x=y.getRasterTextureSize();l.setUniform2fv("u_srcImageSize",x);y=y.getRasterCellSize();l.setUniform2fv("u_cellSize",y);const {zFactor:E,slopeType:F,pixelSizePower:w,pixelSizeFactor:D}=k.rasterFunction.parameters;l.setUniform1f("u_zFactor",E);l.setUniform1f("u_pixelSizePower","adjusted"===F?w:0);l.setUniform1f("u_pixelSizeFactor","adjusted"===F?D:0)}}})},"esri/views/2d/engine/imagery/processor/stretchProcessor":function(){define(["./utils"],function(m){const C=
{vsPath:"raster/rfx/vs",fsPath:"raster/rfx/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};return{createProgram:function(k,l){const {useGamma:y,bandCount:x,isOutputRounded:E}=k.rasterFunction.parameters;l=[];y&&l.push("useGamma");1<x&&l.push("multiBand");E&&l.push("roundOutput");return k.painter.materialManager.getProgram(C,l)},bindTextureAndUniforms:function(k,l,y){m.setSingleImageTextures(k,l,y);m.setCoordsAndTransforms(l);const {width:x,height:E}=y;k=k.rasterFunction.parameters;
l.setUniform2fv("u_srcImageSize",[x,E]);l.setUniform1f("u_minOutput",k.outMin);l.setUniform1f("u_maxOutput",k.outMax);l.setUniform1fv("u_factor",k.factor);l.setUniform1fv("u_minCutOff",k.minCutOff);l.setUniform1fv("u_maxCutOff",k.maxCutOff);l.setUniform1fv("u_gamma",k.gamma);l.setUniform1fv("u_gammaCorrection",k.gammaCorrection)}}})},"esri/views/2d/engine/imagery/RasterTile":function(){define(["exports","../../../../core/libs/gl-matrix-2/factories/mat3f32","./RasterBitmap","../webgl/TiledDisplayObject"],
function(m,C,k,l){class y extends l.TiledDisplayObject{constructor(x,E,F,w,D,p,b=null){super(x,E,F,w,D,p);this.bitmap=null;this.bitmap=new k.RasterBitmap(b,null,null);this.bitmap.coordScale=[D,p];this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy();this.bitmap.destroy();this.stage=this.bitmap=null}set stencilRef(x){this.bitmap.stencilRef=x}get stencilRef(){return this.bitmap.stencilRef}setTransform(x){super.setTransform(x);this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}_createTransforms(){return{displayViewScreenMat3:C.create(),
tileMat3:C.create()}}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap.stage=null}}m.RasterTile=y;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/imagery/BaseImageryTileSubView2D":function(){define("exports ../../../../chunks/tslib.es6 ../../../../geometry ../../../../core/Accessor ../../../../core/Logger ../../../../core/promiseUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/support/UpdatingHandles ../../../../geometry/Point ../../../../layers/support/PixelBlock ../../../../layers/support/TileInfo ../../../../layers/support/rasterDatasets/RawBlockCache ../../../../layers/support/rasterFunctions/rasterProjectionHelper ../../tiling/TileInfoView ../../tiling/TileKey ../../tiling/TileQueue ../../tiling/TileStrategy ../../engine/webgl/definitions ../../../webgl/capabilities ../../../../geometry/Extent".split(" "),
function(m,C,k,l,y,x,E,F,w,D,p,b,t,q,g,u,z,A,I,a,d,e,n){const h=[0,0];m.BaseImageryTileSubView2D=class extends l{constructor(){super(...arguments);this._updatingHandles=new p.UpdatingHandles;this._blockCacheRegistryId=this._blockCacheRegistryUrl=this._fetchQueue=this._tileInfoView=this._tileStrategy=this._emptyTilePixelBlock=null;this._srcResolutions=[];this.previousLOD=null;this._needBlockCacheUpdate=!1;this._abortController=this._symbolizerParams=this._globalSymbolizerParams=null;this._isCustomTilingScheme=
!1;this._maxIndexedColormapSize=0;this._rasterFunctionState="na";this.attached=this._globalUpdateRequested=!1;this.timeExtent=null;this.redrawOrRefetch=x.debounce(async(c={})=>{const r=this._rasterFunctionState;c.reprocess&&(await this._updatingHandles.addPromise(this.layer.updateRasterFunction()),this.updateRasterFunctionParameters());if(this.previousLOD&&!this.layerView.suspended){var v=this._rasterFunctionState,{type:B}=this;return c.refetch||"raster"!==B&&c.reprocess||"cpu"===v||"cpu"===r?this._updatingHandles.addPromise(this.doRefresh()):
this._updatingHandles.addPromise(this._redrawImage(c.signal))}})}destroy(){this._updatingHandles.destroy()}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(c){this._set("useWebGLForProcessing",c)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")??!0}set useProgressiveUpdate(c){if(this._tileStrategy&&this.useProgressiveUpdate!==c){this._tileStrategy.destroy();this.container.removeAllChildren();const r=this._getCacheSize(c);this._tileStrategy=
new a({cachePolicy:"purge",acquireTile:v=>this.acquireTile(v),releaseTile:v=>this.releaseTile(v),cacheSize:r,tileInfoView:this._tileInfoView});this._set("useProgressiveUpdate",c);this.layerView.requestUpdate()}}update(c){this._fetchQueue.pause();this._fetchQueue.state=c.state;this._tileStrategy.update(c);this._fetchQueue.resume();const {extent:r,resolution:v,scale:B}=c.state;c=this._tileInfoView.getClosestInfoForScale(B);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const H=
this._srcResolutions[c.level],J=r.toJSON?r:n.fromJSON(r);g.update(this._blockCacheRegistryUrl,this._blockCacheRegistryId,J,v,H,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1;this.previousLOD?.level!==c.level&&(this.previousLOD=c,null==this._symbolizerParams||this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){if(this.layerView.hasTilingEffects||!this.useProgressiveUpdate)this._abortController&&this._abortController.abort(),
this._abortController=new AbortController,0===this._fetchQueue.length&&this._redrawImage(this._abortController.signal).then(()=>{this._globalUpdateRequested=!1;this.layerView.requestUpdate()});const c=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(c);this.layerView.requestUpdate()}get updating(){return this._globalUpdateRequested||this._updatingHandles?.updating}attach(){this._maxIndexedColormapSize=4*(e.getWebGLCapabilities().maxTextureSize||4096);this._initializeTileInfo();
this._tileInfoView=new z(this.layerView.tileInfo,this.layerView.fullExtent);var c=this._computeFetchConcurrency();this._fetchQueue=new I({tileInfoView:this._tileInfoView,concurrency:c,process:(r,v)=>this._fetchTile(r,v)});c=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new a({cachePolicy:"purge",acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),cacheSize:c,tileInfoView:this._tileInfoView});this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy();
this._fetchQueue.clear();this.container.removeAllChildren();this._fetchQueue=this._tileStrategy=this._tileInfoView=null;g.unregister(this._blockCacheRegistryUrl,this._blockCacheRegistryId);this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}acquireTile(c){c=this.container.createTile(c);this._updatingHandles.addPromise(this._enqueueTileFetch(c));this.layerView.requestUpdate();this._needBlockCacheUpdate=!0;this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate;
return c}releaseTile(c){this._fetchQueue.abort(c.key.id);this.container.removeChild(c);c.once("detach",()=>{c.destroy();this.layerView.requestUpdate()});this.layerView.requestUpdate()}createEmptyTilePixelBlock(c=null){const r=null==c||c.join(",")===this._tileInfoView.tileInfo.size.join(",");if(r&&null!=this._emptyTilePixelBlock)return this._emptyTilePixelBlock;c=c||this._tileInfoView.tileInfo.size;const [v,B]=c;c=new t({width:v,height:B,pixels:[new Uint8Array(v*B)],mask:new Uint8Array(v*B),pixelType:"u8"});
r&&(this._emptyTilePixelBlock=c);return c}_getBandIds(){if(!("rasterFunctionChain"in this.container&&this.container.rasterFunctionChain))return this.layer.bandIds;const {bandIds:c,raster:r}=this.layer,v="rasterFunction"in r?r.rasterFunction.rawInputBandIds:null;return c?.length&&v?.length&&1!==r.rasterInfo.bandCount?c.map(B=>v[Math.min(B,v.length-1)]):c||v}updateRasterFunctionParameters(){}_fetchTile(c,r){r=this._getFetchOptions(c.level,r.signal);return this.fetchTile(c,r)}_getFetchOptions(c,r){const v=
this.canUseWebGLForProcessing(),{layerView:B}=this,{tileInfo:H}=B,J=!H.isWrappable&&null!=u.getWorldWidth(B.view.spatialReference);return{allowPartialFill:!0,datumTransformation:B.datumTransformation,interpolation:v?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:v&&this.layer.raster.hasUniqueSourceStorageInfo,skipRasterFunction:"raster"===this.type&&null!=this.container.rasterFunctionChain,signal:r,srcResolution:this._srcResolutions[c],timeExtent:B.timeExtent,
tileInfo:H,disableWrapAround:J}}_getCacheSize(c){return c?40:0}_initializeTileInfo(){const {layerView:c}=this;var r=c.view.spatialReference;if(this._canUseLayerLODs()){const {origin:S,lods:U}=this.layer.tileInfo;var v=U.map(({scale:R})=>R);r=q.create({spatialReference:r,size:d.tileSize,scales:v,origin:S});c.set("tileInfo",r);this._srcResolutions=U.map(({resolution:R})=>({x:R,y:R}))}else{var {scales:B,srcResolutions:H,isCustomTilingScheme:J}=u.computeProjectedScales(this.layer.serviceRasterInfo,r,
{tileSize:d.tileSize,alignGlobalDatasetWithAGOL:!0,limitToSrcResolution:!1});v=q.create({spatialReference:r,size:d.tileSize,scales:B});var K=0===v.origin.x,{xmin:L,ymax:N}=c.fullExtent;if(K||J&&v.origin.x>L)v.origin=new b({x:L,y:N,spatialReference:r});this._isCustomTilingScheme=J;c.set("tileInfo",v);this._srcResolutions=H??[]}}_canUseLayerLODs(){const {layer:c,layerView:r}=this;if("Map"!==c.raster.tileType)return!1;const {lods:v}=c.tileInfo,B=r.view.constraints?.effectiveLODs;return B?.length===v.length&&
B.every(({scale:H},J)=>.001>Math.abs(H-v[J].scale))}_computeFetchConcurrency(){var {blockBoundary:c}=this.layer.serviceRasterInfo.storageInfo;c=c[c.length-1];return 64<(c.maxCol-c.minCol+1)*(c.maxRow-c.minRow+1)?2:10}async _enqueueTileFetch(c,r){if(!this._fetchQueue.has(c.key.id)){try{const v=await this._fetchQueue.push(c.key),B=this._getBandIds();let H=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&
0===this._fetchQueue.length){H=!1;try{await this._redrawImage(this._abortController?.signal)}catch(L){x.isAbortError(L)&&y.getLogger(this).error(L)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&"rasterVF"!==this.type||this.layerView.hasTilingEffects||null!=this._symbolizerParams||this._updateSymbolizerParams();const J=this._tileInfoView.getTileCoords(h,c.key),K=this._tileInfoView.getTileResolution(c.key);await this.updateTileSource(c,{source:v,symbolizerParams:this._symbolizerParams,
globalSymbolizerParams:this._globalSymbolizerParams,suspended:H,bandIds:B,coords:J,resolution:K});c.once("attach",()=>this.layerView.requestUpdate());this.container.addChild(c)}catch(v){x.isAbortError(v)||y.getLogger(this).error(v)}this.layerView.requestUpdate()}}async _redrawImage(c){0!==this.container.children.length&&(await this.layer.updateRenderer(),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(c):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null),c=
this.container.children.map(async r=>this.updateTileSymbolizerParameters(r,{local:this._symbolizerParams,global:this._globalSymbolizerParams})),await Promise.allSettled(c),this.container.requestRender())}async _updateGlobalSymbolizerParams(c){c=this._getFetchOptions(this.previousLOD.level,c);c=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,{...c,interpolation:"nearest",requestRawData:!1,skipRasterFunction:!1});if(c?.pixelBlock){var {resolution:r}=
this.previousLOD,v=this._getBandIds();c=this.layer.symbolizer.generateWebGLParameters({pixelBlock:c.pixelBlock.extractBands(v),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:r,y:r},bandIds:v});!this.canUseWebGLForProcessing()&&c&&"stretch"===c.type&&this.layer.renderer&&"raster-stretch"===this.layer.renderer.type&&(c.factor=c.factor.map(B=>255*B),c.outMin=Math.round(255*c.outMin),c.outMax=Math.round(255*c.outMax));this._globalSymbolizerParams=c}}_updateSymbolizerParams(){const {resolution:c}=
this.previousLOD,r=this._getBandIds();this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:c,y:c},bandIds:r})}_updateBlockCacheRegistry(c=!1){const {layer:r,layerView:v}=this,{raster:B}=r;var {multidimensionalDefinition:H}=r.normalizeRasterFetchOptions({multidimensionalDefinition:r.multidimensionalDefinition,timeExtent:v.timeExtent});H=B.rasterInfo.multidimensionalInfo?B.getSliceIndex(H):null;H=
g.getRasterId(B.rasterId,H);if(H!==this._blockCacheRegistryUrl){null!=this._blockCacheRegistryUrl&&g.unregister(this._blockCacheRegistryUrl,this._blockCacheRegistryId);this._blockCacheRegistryId=g.register(H,B.rasterInfo);if(c){({view:c}=v);const J=this._tileInfoView.getClosestInfoForScale(c.scale);g.update(H,this._blockCacheRegistryId,c.extent,c.resolution,this._srcResolutions[J.level],B.ioConfig.sampling)}this._blockCacheRegistryUrl=H}}async doRefresh(){if(this.attached&&this.previousLOD&&!this.layerView.suspended){await this.layer.updateRenderer();
this.layerView.hasTilingEffects||this._updateSymbolizerParams();this._updateBlockCacheRegistry(!0);this._fetchQueue.reset();var c=[];this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate;this._tileStrategy.refresh(r=>c.push(this._enqueueTileFetch(r)));await this._updatingHandles.addPromise(Promise.allSettled(c))}}};C.__decorate([E.property()],m.BaseImageryTileSubView2D.prototype,"_globalUpdateRequested",void 0);C.__decorate([E.property()],m.BaseImageryTileSubView2D.prototype,
"attached",void 0);C.__decorate([E.property()],m.BaseImageryTileSubView2D.prototype,"container",void 0);C.__decorate([E.property()],m.BaseImageryTileSubView2D.prototype,"layer",void 0);C.__decorate([E.property()],m.BaseImageryTileSubView2D.prototype,"layerView",void 0);C.__decorate([E.property()],m.BaseImageryTileSubView2D.prototype,"type",void 0);C.__decorate([E.property()],m.BaseImageryTileSubView2D.prototype,"useWebGLForProcessing",null);C.__decorate([E.property()],m.BaseImageryTileSubView2D.prototype,
"useProgressiveUpdate",null);C.__decorate([E.property()],m.BaseImageryTileSubView2D.prototype,"timeExtent",void 0);C.__decorate([E.property()],m.BaseImageryTileSubView2D.prototype,"updating",null);m.BaseImageryTileSubView2D=C.__decorate([D.subclass("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],m.BaseImageryTileSubView2D);Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/PixelBlock":function(){define("../../chunks/tslib.es6 ../../core/Error ../../core/JSONSupport ../../core/lang ../../core/Logger ../../core/accessorSupport/decorators/property ../../core/accessorSupport/decorators/cast ../../core/accessorSupport/decorators/subclass ./SimpleBandStatistics ./rasterFormats/pixelRangeUtils".split(" "),
function(m,C,k,l,y,x,E,F,w,D){var p;k=p=class extends k.JSONSupport{static createEmptyBand(b,t){return new (p.getPixelArrayConstructor(b))(t)}static combineBandMasks(b){if(2>b.length)return b[0];const t=b[0].length,q=(new Uint8Array(t)).fill(255);for(let g=0;g<b.length;g++){const u=b[g];for(let z=0;z<t;z++)u[z]||(q[z]=0)}return q}static getPixelArrayConstructor(b){let t;switch(b){case "u1":case "u2":case "u4":case "u8":t=Uint8Array;break;case "u16":t=Uint16Array;break;case "u32":t=Uint32Array;break;
case "s8":t=Int8Array;break;case "s16":t=Int16Array;break;case "s32":t=Int32Array;break;case "f32":t=Float32Array;break;case "f64":t=Float64Array;break;case "c64":case "c128":case "unknown":t=Float32Array}return t}constructor(b){super(b);this.height=this.width=null;this.pixelType="f32";this.mask=this.validPixelCount=null;this.premultiplyAlpha=this.maskIsAlpha=!1;this.statistics=null;this.depthCount=1}castPixelType(b){if(!b)return"f32";b=b.toLowerCase();["u1","u2","u4"].includes(b)?b="u8":"unknown u8 s8 u16 s16 u32 s32 f32 f64".split(" ").includes(b)||
(b="f32");return b}getPlaneCount(){return this.pixels?.length}addData(b){if(!b.pixels||b.pixels.length!==this.width*this.height)throw new C("pixelblock:invalid-or-missing-pixels","add data requires valid pixels array that has same length defined by pixel block width * height");this.pixels||(this.pixels=[]);this.statistics||(this.statistics=[]);this.pixels.push(b.pixels);this.statistics.push(b.statistics??new w.SimpleBandStatistics)}getAsRGBA(){const b=new ArrayBuffer(this.width*this.height*4);switch(this.pixelType){case "s8":case "s16":case "u16":case "s32":case "u32":case "f32":case "f64":this._fillFromNon8Bit(b);
break;default:this._fillFrom8Bit(b)}return new Uint8ClampedArray(b)}getAsRGBAFloat(){const b=new Float32Array(this.width*this.height*4);this._fillFrom32Bit(b);return b}updateStatistics(){if(this.pixels){this.statistics=this.pixels.map(q=>{var g=this.mask;let u=Infinity,z=-Infinity;const A=q.length;let I,a=0;if(null!=g)for(I=0;I<A;I++)g[I]&&(a=q[I],u=a<u?a:u,z=a>z?a:z);else for(I=0;I<A;I++)a=q[I],u=a<u?a:u,z=a>z?a:z;return new w.SimpleBandStatistics(u,z)});var b=this.mask,t=0;if(null!=b)for(let q=
0;q<b.length;q++)b[q]&&t++;else t=this.width*this.height;this.validPixelCount=t}}clamp(b){if(b&&"f64"!==b&&"f32"!==b&&this.pixels){var [t,q]=D.getPixelValueRange(b),g=this.pixels,u=this.width*this.height,z=g.length,A=[];for(let e=0;e<z;e++){var I=p.createEmptyBand(b,u);var a=g[e];for(let n=0;n<u;n++){var d=a[n];I[n]=d>q?q:d<t?t:d}A.push(I)}this.pixels=A;this.pixelType=b}}extractBands(b){const {pixels:t,statistics:q}=this;if(null==b||0===b.length||!t||0===t.length)return this;var g=t.length;const u=
b.some(e=>e>=t.length),z=g===b.length&&!b.some((e,n)=>e!==n);if(u||z)return this;g=this.bandMasks?.length===g?b.map(e=>this.bandMasks[e]):void 0;let {mask:A,validPixelCount:I}=this;const {width:a,height:d}=this;g?.length&&(A=p.combineBandMasks(g),I=A.filter(e=>!!e).length);return new p({pixelType:this.pixelType,width:a,height:d,mask:A,bandMasks:g,validPixelCount:I,maskIsAlpha:this.maskIsAlpha,pixels:b.map(e=>t[e]),statistics:q&&b.map(e=>q[e])})}clone(){const b=new p({width:this.width,height:this.height,
pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});null!=this.mask&&(b.mask=new Uint8Array(this.mask));this.bandMasks&&(b.bandMasks=this.bandMasks.map(g=>new Uint8Array(g)));let t;const q=p.getPixelArrayConstructor(this.pixelType);if(this.pixels&&0<this.pixels.length){b.pixels=[];const g=!!this.pixels[0].slice;for(t=0;t<this.pixels.length;t++)b.pixels[t]=g?this.pixels[t].slice(0,this.pixels[t].length):new q(this.pixels[t])}if(this.statistics)for(b.statistics=
[],t=0;t<this.statistics.length;t++)b.statistics[t]=l.clone(this.statistics[t]);b.premultiplyAlpha=this.premultiplyAlpha;return b}_fillFrom8Bit(b){const {mask:t,maskIsAlpha:q,premultiplyAlpha:g,pixels:u}=this;if(b&&u?.length){var z,A;var I=z=A=u[0];3<=u.length?(z=u[1],A=u[2]):2===u.length&&(z=u[1]);var a=new Uint32Array(b),d=this.width*this.height;if(I.length!==d)y.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");else if(null!=t&&t.length===d)if(q)for(b=
0;b<d;b++){const e=t[b];if(e){const n=e/255;a[b]=g?e<<24|A[b]*n<<16|z[b]*n<<8|I[b]*n:e<<24|A[b]<<16|z[b]<<8|I[b]}}else for(b=0;b<d;b++)t[b]&&(a[b]=-16777216|A[b]<<16|z[b]<<8|I[b]);else for(b=0;b<d;b++)a[b]=-16777216|A[b]<<16|z[b]<<8|I[b]}else y.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The input pixel block is empty.")}_fillFromNon8Bit(b){const {pixels:t,mask:q,statistics:g}=this;if(b&&t?.length){var u=this.pixelType,z=1,A=0;z=1;if(g&&0<g.length){for(var I of g)null!=I.minValue&&
(A=Math.min(A,I.minValue)),null!=I.maxValue&&null!=I.minValue&&(z=Math.max(z,I.maxValue-I.minValue));z=255/z}else z=255,"s8"===u?(A=-128,z=127):"u16"===u?z=65535:"s16"===u?(A=-32768,z=32767):"u32"===u?z=4294967295:"s32"===u?(A=-2147483648,z=2147483647):"f32"===u?(A=-3.4*1E39,z=3.4*1E39):"f64"===u&&(A=-Number.MAX_VALUE,z=Number.MAX_VALUE),z=255/(z-A);b=new Uint32Array(b);u=this.width*this.height;var a,d,e;I=a=d=t[0];if(I.length!==u)return y.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");
if(2<=t.length)if(a=t[1],3<=t.length&&(d=t[2]),null!=q&&q.length===u)for(e=0;e<u;e++)q[e]&&(b[e]=-16777216|(d[e]-A)*z<<16|(a[e]-A)*z<<8|(I[e]-A)*z);else for(e=0;e<u;e++)b[e]=-16777216|(d[e]-A)*z<<16|(a[e]-A)*z<<8|(I[e]-A)*z;else if(null!=q&&q.length===u)for(e=0;e<u;e++)a=(I[e]-A)*z,q[e]&&(b[e]=-16777216|a<<16|a<<8|a);else for(e=0;e<u;e++)a=(I[e]-A)*z,b[e]=-16777216|a<<16|a<<8|a}else y.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The input pixel block is empty.")}_fillFrom32Bit(b){const {pixels:t,
mask:q}=this;if(!b||!t?.length)return y.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The input pixel block is empty.");let g,u,z,A;g=u=z=t[0];3<=t.length?(u=t[1],z=t[2]):2===t.length&&(u=t[1]);const I=this.width*this.height;if(g.length!==I)return y.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let a=0;if(null!=q&&q.length===I)for(A=0;A<I;A++)b[a++]=g[A],b[a++]=u[A],b[a++]=z[A],b[a++]=q[A]&1;else for(A=0;A<I;A++)b[a++]=g[A],
b[a++]=u[A],b[a++]=z[A],b[a++]=1}};m.__decorate([x.property({json:{write:!0}})],k.prototype,"width",void 0);m.__decorate([x.property({json:{write:!0}})],k.prototype,"height",void 0);m.__decorate([x.property({json:{write:!0}})],k.prototype,"pixelType",void 0);m.__decorate([E.cast("pixelType")],k.prototype,"castPixelType",null);m.__decorate([x.property({json:{write:!0}})],k.prototype,"validPixelCount",void 0);m.__decorate([x.property({json:{write:!0}})],k.prototype,"mask",void 0);m.__decorate([x.property({json:{write:!0}})],
k.prototype,"maskIsAlpha",void 0);m.__decorate([x.property({json:{write:!0}})],k.prototype,"pixels",void 0);m.__decorate([x.property()],k.prototype,"premultiplyAlpha",void 0);m.__decorate([x.property({json:{write:!0}})],k.prototype,"statistics",void 0);m.__decorate([x.property({json:{write:!0}})],k.prototype,"depthCount",void 0);m.__decorate([x.property({json:{write:!0}})],k.prototype,"noDataValues",void 0);m.__decorate([x.property({json:{write:!0}})],k.prototype,"bandMasks",void 0);return k=p=m.__decorate([F.subclass("esri.layers.support.PixelBlock")],
k)})},"esri/layers/support/SimpleBandStatistics":function(){define(["exports"],function(m){class C{constructor(k=null,l=null,y=null){this.minValue=k;this.maxValue=l;this.noDataValue=y}}m.SimpleBandStatistics=C;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFormats/pixelRangeUtils":function(){define(["exports"],function(m){function C(l){return k[l]??[-3.4028234663852886E38,3.4028234663852886E38]}const k={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],
u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-3.4028234663852886E38,3.4028234663852886E38],f64:[-Number.MAX_VALUE,Number.MAX_VALUE],unknown:void 0,c64:void 0,c128:void 0};m.convertNoDataToMask=function(l,y,x){if(!(l.depthCount&&1<l.depthCount)){var {pixels:E,statistics:F,pixelType:w}=l,D=E[0].length,p=l.bandMasks??[];D=l.mask??(new Uint8Array(D)).fill(255);var b="f32"===w||"f64"===w,t=C(w),q=!1;for(let z=0;z<E.length;z++){const A="number"===typeof y?y:y[z];
if(null==A)continue;var g=F?.[z]?.maxValue??t[1];if((F?.[z]?.minValue??t[0])>A+Number.EPSILON||g<A-Number.EPSILON)continue;g=p[z]||D.slice();const I=E[z];var u=x?.customFloatTolerance;if(b&&0!==u){u||=9.999999E37<=Math.abs(A)?2E-7*Math.abs(A):"f32"===w?2**-23:Number.EPSILON;for(let a=0;a<I.length;a++)g[a]&&Math.abs(I[a]-A)<u&&(I[a]=0,g[a]=0,D[a]=0,q=!0)}else for(u=0;u<I.length;u++)g[u]&&I[u]===A&&(I[u]=0,g[u]=0,D[u]=0,q=!0);p[z]=g}q&&(l.bandMasks=l.bandMasks||1<l.pixels.length?p:null,l.mask=D);q&&
"updateStatistics"in l&&l.updateStatistics()}};m.getIntegerPixelType=function(l,y){return null==l||null==y?"s32":0>l?-128<=l&&128>y?"s8":-32768<=l&&32768>y?"s16":"s32":256>y?"u8":65536>y?"u16":"u32"};m.getPixelValueRange=C;m.isIntegerPixelType=function(l){return(l?.startsWith("s")||l?.startsWith("u"))??!1};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterDatasets/RawBlockCache":function(){define(["exports","../../../geometry","./EphemeralBlockCache","../rasterFunctions/rasterProjectionHelper",
"../../../geometry/Point"],function(m,C,k,l,y){function x(w,D){return(w=E.get(w))?w[D]??null:null}const E=new Map,F=new k;m.decreaseRefCount=function(w,D,p){const b=E.get(w);if(!b)return null==D?F.decreaseRefCount(w,p):0;if(null==D||null==b[D])return F.decreaseRefCount(w,p);D=b[D]?.cache;w=D?.get(p);if(D&&w){w.refCount--;if(0===w.refCount){D.delete(p);for(D=0;D<b.length;D++)b[D]?.cache.delete(p);w.controller&&w.controller.abort()}return w.refCount}return 0};m.deleteBlock=function(w,D,p){const b=E.get(w);
b?null==D||null==b[D]?F.deleteBlock(w,p):b[D]?.cache.delete(p):null==D&&F.deleteBlock(w,p)};m.deleteRaster=function(w){E.delete(w)};m.getBlock=function(w,D,p){const b=E.get(w);if(!b)return null==D?F.getBlock(w,p):null;if(null==D||null==b[D]){for(D=0;D<b.length;D++){var t=b[D]?.cache.get(p);if(t)return t.refCount++,t.block}return F.getBlock(w,p)}if(w=b[D]?.cache.get(p))return w.refCount++,w.block;for(w=0;w<b.length;w++){if(w===D||!b[w])continue;t=b[w]?.cache;const q=t?.get(p);if(t&&q)return q.refCount++,
t.set(p,q),q.block}return null};m.getRasterId=function(w,D){return null==D?w:`${w}?sliceId=${D}`};m.putBlock=function(w,D,p,b,t=null){const q=E.get(w);if(q)if(null==D||null==q[D])F.putBlock(w,p,b,t);else{var g={refCount:1,block:b,isResolved:!1,isRejected:!1,controller:t};b.then(()=>g.isResolved=!0).catch(()=>g.isRejected=!0);q[D]?.cache.set(p,g)}else null==D&&F.putBlock(w,p,b,t)};m.register=function(w,D){D={extent:null,rasterInfo:D,cache:new Map};const p=E.get(w);if(p)return p.push(D),p.length-1;
E.set(w,[D]);return 0};m.unregister=function(w,D){const p=E.get(w);p&&(p[D]=null,p.some(b=>null!=b)||E.delete(w))};m.update=function(w,D,p,b,t,q,g=null){if(w=x(w,D)){D=w.extent;var {cache:u,rasterInfo:z}=w;if(!D||D.xmin!==p.xmin||D.xmax!==p.xmax||D.ymin!==p.ymin||D.ymax!==p.ymax){b=b??0;D=p.clone().normalize();var {spatialReference:A,transform:I}=z,a=new Set;for(let r=0;r<D.length;r++){var d=D[r];if(d.xmax-d.xmin<=b||d.ymax-d.ymin<=b)continue;var e=l.projectExtent(d,A,g);null!=I&&(e=I.inverseTransform(e));
var n=new y({x:b,y:b,spatialReference:d.spatialReference});if(null==t&&(t=l.projectResolution(n,A,d,g),!t))return;const {pyramidLevel:v,pyramidResolution:B,excessiveReading:H}=l.snapPyramid(t,z,q||"closest");if(H)return;({storageInfo:d}=z);var {origin:h}=d;n=Math.max(0,Math.floor((e.xmin-h.x)/B.x));h=Math.max(0,Math.floor((h.y-e.ymax)/B.y));const J=0<v?d.pyramidBlockWidth:d.blockWidth,K=0<v?d.pyramidBlockHeight:d.blockHeight;d=Math.max(0,Math.floor(n/J)-1);var c=Math.max(0,Math.floor(h/K)-1);n=Math.floor((n+
Math.ceil((e.xmax-e.xmin)/B.x-.1)-1)/J)+1;e=Math.floor((h+Math.ceil((e.ymax-e.ymin)/B.y-.1)-1)/K)+1;for(h=c;h<=e;h++)for(c=d;c<=n;c++)a.add(`${v}/${h}/${c}`)}u.forEach((r,v)=>{a.has(v)||(r=u.get(v),(null==r||r.isResolved||r.isRejected)&&u.delete(v))});w.extent={xmin:p.xmin,ymin:p.ymin,xmax:p.xmax,ymax:p.ymax}}}};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterDatasets/EphemeralBlockCache":function(){define(function(){class m{constructor(C=15E3,k=5E3){this._timer=
null;this._cachedBlocks=new Map;this._size=-1;this._duration=C;this._interval=Math.min(C,k)}decreaseRefCount(C,k){C=C+"/"+k;k=this._cachedBlocks;if(k.has(C)){const l=k.get(C);l.refCount--;0>=l.refCount&&(k.delete(C),l.controller&&l.controller.abort());return l.refCount}return 0}getBlock(C,k){C=C+"/"+k;k=this._cachedBlocks;if(k.has(C)){const l=k.get(C);l.ts=Date.now();l.refCount++;k.delete(C);k.set(C,l);return l.block}return null}putBlock(C,k,l,y){const x=this._cachedBlocks;C=C+"/"+k;x.has(C)?(l=x.get(C),
l.ts=Date.now(),l.refCount++):x.set(C,{block:l,ts:Date.now(),refCount:1,controller:y});this._trim();this._updateTimer()}deleteBlock(C,k){const l=this._cachedBlocks;C=C+"/"+k;l.has(C)&&l.delete(C)}updateMaxSize(C){this._size=C;this._trim()}empty(){this._cachedBlocks.clear();this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null==this._timer){var C=this._cachedBlocks;this._timer=setInterval(()=>{const k=Array.from(C),l=Date.now();for(let y=0;y<k.length;y++)if(k[y][1].ts<=
l-this._duration)C.delete(k[y][0]);else break;0===C.size&&this._clearTimer()},this._interval)}}_trim(){const C=this._cachedBlocks;if(!(-1===this._size||this._size>=C.size)){var k=Array.from(C);for(let l=0;l<k.length-this._size;l++)C.delete(k[l][0])}}_clearTimer(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)}}return m})},"esri/layers/support/rasterFunctions/rasterProjectionHelper":function(){define("exports ../../../geometry ../../../core/arrayUtils ../../../core/Error ../../../core/unitUtils ../../../chunks/pe ../../../geometry/projection ../../../geometry/support/spatialReferenceUtils ../../../geometry/Extent ../../../geometry/Point ../../../geometry/Polygon ../../../geometry/SpatialReference".split(" "),
function(m,C,k,l,y,x,E,F,w,D,p,b){function t(f,G,M){return!E.canProjectWithoutEngine(f,G,M)}function q(f,G,M){if((f=t(f,G,M))&&!E.isLoaded())throw new l("rasterprojectionhelper-project","projection engine is not loaded");return f}function g(f,G,M){q(f.spatialReference,G);return M?E.getTransformation(G,f.spatialReference,f):E.getTransformation(f.spatialReference,G,f)}function u(f,G,M,O=null){const T=f.spatialReference;if(T.equals(G))return f;q(T,G,O);M=M.center;M=new w({xmin:M.x-f.x/2,xmax:M.x+f.x/
2,ymin:M.y-f.y/2,ymax:M.y+f.y/2,spatialReference:T});O=E.project(M,G,O);M=K(G);null==O||null!=M&&O.width>=M?(G=y.getMetersPerUnitForSR(T)/y.getMetersPerUnitForSR(G),f={x:f.x*G,y:f.y*G}):f={x:O.width,y:O.height};return f}function z(f,G=.01){return y.getMetersPerUnitForSR(f)?G/y.getMetersPerUnitForSR(f):0}function A(f,G,M=null,O=!0){const T=f.spatialReference;if(T.equals(G))return f;q(T,G,M);M=E.project(f,G,M);if(!O||!M)return M;I([f],[M],T,G);return M}function I(f,G,M,O){const T=L(M,!0),P=L(O,!0);
M=z(M,500);O=z(O,500);if(M&&null!=T&&null!=P)for(let V=0;V<f.length;V++){const W=G[V];if(!W)continue;const {x:Q}=f[V],{x:ca}=W;ca>=P[1]-O&&Math.abs(Q-T[0])<M?W.x-=P[1]-P[0]:ca<=P[0]+O&&Math.abs(Q-T[1])<M&&(W.x+=P[1]-P[0])}}function a(f){const {inSR:G,outSR:M,datumTransformation:O,preferPE:T}=f;if(G.equals(M))return{points:f}=c(f,null),f;if(G.isWebMercator&&M.isWGS84||G.isWGS84&&M.isWebMercator){const {cols:Q,rows:ca,xres:Z,yres:ja,usePixelCenter:ia,inSR:ha,outSR:la}=f;let {xmin:ma,ymax:na}=f;ia&&
(ma+=Z/2,na-=ja/2);f=[];const fa=[];var P=Math.max(Q,ca);for(var V=0;V<P;V++){var W=E.project(new D({x:ma+Z*Math.min(Q,V),y:na-ja*Math.min(ca,V),spatialReference:ha}),la);V<=Q&&f.push(W.x);V<=ca&&fa.push(W.y)}P=[];for(V=0;V<Q;V++)for(W=0;W<ca;W++)P.push([f[V],fa[W]]);return P}return q(G,M,O)&&T&&(G.isGeographic||null!=n(G))?e(f):d(f)}function d(f){var {points:G}=c(f,null);const {inSR:M,outSR:O,datumTransformation:T}=f;f=G.map(P=>new D(P[0],P[1],M));G=E.project(f,O,T);T&&I(f,G,M,O);return G.map(P=>
P?[P.x,P.y]:[NaN,NaN])}function e(f){const {inSR:G,outSR:M,datumTransformation:O}=f;var T=n(G);const {points:P,mask:V}=c(f,T);G.isGeographic||(f=G.wkid?x.PeFactory.coordsys(G.wkid):x.PeFactory.fromString(G.isGeographic?x.PeDefs.PE_TYPE_GEOGCS:x.PeDefs.PE_TYPE_PROJCS,G.wkt2||G.wkt),x.PeCSTransformations.projToGeog(f,P.length,P));if(null!=O&&O.steps.length){var W;M.isGeographic&&(W=P.map(([Q])=>179.9955<Q?1:-179.9955>Q?-1:0));O.steps.forEach(Q=>{const ca=Q.wkid?x.PeFactory.geogtran(Q.wkid):x.PeFactory.fromString(x.PeDefs.PE_TYPE_GEOGTRAN,
Q.wkt);x.PeGTTransformations.geogToGeog(ca,P.length,P,null,Q.isInverse?x.PeDefs.PE_TRANSFORM_2_TO_1:x.PeDefs.PE_TRANSFORM_1_TO_2)});if(W)for(f=0;f<P.length;f++){T=W[f];const Q=P[f][0],ca=179.9955<Q?1:-179.9955>Q?-1:0;T&&ca&&T!==ca&&(P[f][0]=0<T?Q+360:Q-360)}}M.isGeographic||(W=n(M,!0),r(P,null!=W&&W.isEnvelope?[W.bbox[1],W.bbox[3]]:[-90,90]),W=M.wkid?x.PeFactory.coordsys(M.wkid):x.PeFactory.fromString(M.isGeographic?x.PeDefs.PE_TYPE_GEOGCS:x.PeDefs.PE_TYPE_PROJCS,M.wkt2||M.wkt),x.PeCSTransformations.geogToProj(W,
P.length,P));W=P;if(V&&P.length!==V.length){W=[];for(let Q=0,ca=0;Q<V.length;Q++)V[Q]?W.push(P[ca++]):W.push([NaN,NaN])}return W}function n(f,G=!1){var M=f.wkid||f.wkt2||f.wkt;if(!M||f.isGeographic)return null;M=String(M);if(ea.has(M))return M=ea.get(M),G?M?.gcs:M?.pcs;var O=f.wkid?x.PeFactory.coordsys(f.wkid):x.PeFactory.fromString(f.isGeographic?x.PeDefs.PE_TYPE_GEOGCS:x.PeDefs.PE_TYPE_PROJCS,f.wkt2||f.wkt);f=z(f,1E-4);f=h(O,f);O=h(O,0,!0);ea.set(M,{pcs:f,gcs:O});return G?O:f}function h(f,G=0,M=
!1){var O=x.PePCSInfo.generate(f),T=M?f.horizonGcsGenerate():f.horizonPcsGenerate();if(!O||!T?.length)return null;f=!1;var P=T.find(Z=>1===Z.getInclusive()&&1===Z.getKind());if(!P){P=T.find(Z=>1===Z.getInclusive()&&0===Z.getKind());if(!P)return null;f=!0}M=M?0:(2===O.getNorthPoleLocation()?1:0)|(2===O.getSouthPoleLocation()?2:0);O=O.isPannableRectangle();P=P.getCoord();if(f)return{isEnvelope:f,isPannable:O,vertices:P,coef:null,bbox:[P[0][0]-G,P[0][1]-G,P[1][0]+G,P[1][1]+G],poleLocation:M};G=0;f=[];
let [V,W]=P[0],[Q,ca]=P[0];for(let Z=0,ja=P.length;Z<ja;Z++){G++;G===ja&&(G=0);const [ia,ha]=P[Z],[la,ma]=P[G];if(ma===ha)f.push([ia,la,ha,ma,2]);else{T=(la-ia)/(ma-ha||1E-4);const na=ia-T*ha;ha<ma?f.push([T,na,ha,ma,0]):f.push([T,na,ma,ha,1])}V=V<ia?V:ia;W=W<ha?W:ha;Q=Q>ia?Q:ia;ca=ca>ha?ca:ha}return{isEnvelope:!1,isPannable:O,vertices:P,coef:f,bbox:[V,W,Q,ca],poleLocation:M}}function c(f,G){const M=[],{cols:O,rows:T,xres:P,yres:V,usePixelCenter:W}=f;let {xmin:Q,ymax:ca}=f;W&&(Q+=P/2,ca-=V/2);if(null==
G){for(f=0;f<O;f++)for(G=0;G<T;G++)M.push([Q+P*f,ca-V*G]);return{points:M}}f=new Uint8Array(O*T);if(G.isEnvelope){const {bbox:[na,fa,pa,qa]}=G;for(let ra=0,sa=0;ra<O;ra++){var Z=Q+P*ra,ja=G.isPannable||Z>=na&&Z<=pa;for(var ia=0;ia<T;ia++,sa++){var ha=ca-V*ia;ja&&ha>=fa&&ha<=qa&&(M.push([Z,ha]),f[sa]=1)}}return{points:M,mask:f}}Z=G.coef;G=[];for(ja=0;ja<T;ja++){var la=ca-V*ja;ia=[];ha=[];for(var ma=0;ma<Z.length;ma++){const [na,fa,pa,qa,ra]=Z[ma];la===pa&&pa===qa?(ia.push(na),ia.push(fa),ha.push(2),
ha.push(2)):la>=pa&&la<=qa&&(ia.push(na*la+fa),ha.push(ra))}la=ia;if(2<ia.length){ma=2===ha[0]?0:ha[0];let na=ia[0];la=[];for(let fa=1;fa<ha.length;fa++)if(2!==ha[fa]||fa===ha.length-1)ha[fa]!==ma&&(la.push(0===ma?Math.min(na,ia[fa-1]):Math.max(na,ia[fa-1])),ma=ha[fa],na=ia[fa]),fa===ha.length-1&&la.push(0===ha[fa]?Math.min(na,ia[fa]):Math.max(na,ia[fa]));la.sort((fa,pa)=>fa-pa)}else ia[0]>ia[1]&&(la=[ia[1],ia[0]]);G.push(la)}for(let na=0,fa=0;na<O;na++)for(Z=Q+P*na,ja=0;ja<T;ja++,fa++)if(ia=ca-V*
ja,ha=G[ja],2===ha.length)Z>=ha[0]&&Z<=ha[1]&&(M.push([Z,ia]),f[fa]=1);else if(2<ha.length){la=!1;for(ma=0;ma<ha.length;ma+=2)if(Z>=ha[ma]&&Z<=ha[ma+1]){la=!0;break}la&&(M.push([Z,ia]),f[fa]=1)}return{points:M,mask:f}}function r(f,G){const [M,O]=G;for(G=0;G<f.length;G++){const T=f[G][1];if(T<M||T>O)f[G]=[NaN,NaN]}}function v(f,G){const M=K(f[0].spatialReference);if(2>f.length||null==M)return f[0];G=G??z(f[0].spatialReference);f=f.filter(W=>W.width>G);if(1===f.length)return f[0];let {xmin:O,xmax:T,
ymin:P,ymax:V}=f[0];for(let W=1;W<f.length;W++){const Q=f[W];T=Q.xmax+M*W;P=Math.min(P,Q.ymin);V=Math.max(V,Q.ymax)}return new w({xmin:O,xmax:T,ymin:P,ymax:V,spatialReference:f[0].spatialReference})}function B(f,G,M=null,O=!0){var T=f.spatialReference;if(T.equals(G))return f;var P=S(f);const V=K(T,!0);var W=K(G);if(0===P||null==V||null==W)return P=J(f,G,M,O),null==V&&null!=W&&Math.abs(P.width-W)<z(G)&&E.isLoaded()&&(T=n(T),null!=T&&T.poleLocation===da.None&&f.width<(T.bbox[2]-T.bbox[0])/2)?H(f,G)||
P:P;W=f.clone().normalize();if(1===W.length&&f.xmax<V&&f.xmax-V/2>z(T)){const {xmin:Q,xmax:ca}=f;for(let Z=0;Z<=P;Z++)W[Z]=new w({xmin:0===Z?Q:-V/2,xmax:Z===P?ca-V*Z:V/2,ymin:f.ymin,ymax:f.ymax,spatialReference:T})}f=W.map(Q=>J(Q,G,M,O));return v(f.filter(k.isSome))}function H(f,G){const M=K(G);if(null==M)return null;let {xmin:O,ymin:T,xmax:P,ymax:V}=f;var W=f.spatialReference;f=new p({spatialReference:W,rings:[[[O,T],[P,T],[P,V],[O,V],[O,T]]]});f=E.project(f,G);if(2!==f.rings.length||!f.rings[0].length||
!f.rings[1].length)return null;({rings:f}=f);W=z(W);G=new w({spatialReference:G});for(let Q=0;2>Q;Q++){O=P=f[Q][0][0];T=V=f[Q][0][1];for(let ca=0;ca<f[Q].length;ca++)O=O>f[Q][ca][0]?f[Q][ca][0]:O,P=P<f[Q][ca][0]?f[Q][ca][0]:P,T=T>f[Q][ca][1]?f[Q][ca][1]:T,V=V<f[Q][ca][1]?f[Q][ca][1]:V;if(0===Q)G.ymin=T,G.ymax=V,G.xmin=O,G.xmax=P;else if(G.ymin=Math.min(G.ymin,T),G.ymax=Math.max(G.ymax,V),Math.abs(P-M/2)<W)G.xmin=O,G.xmax+=M;else if(Math.abs(O+M/2)<W)G.xmax=P+M;else return null}return G}function J(f,
G,M=null,O=!0,T=!0){const P=f.spatialReference;if(P.equals(G)||!G)return f;q(P,G,M);const V=E.project(f,G,M);if(T&&G.isWebMercator&&V&&(V.ymax=Math.min(2.0037508342787E7,V.ymax),V.ymin=Math.max(-2.0037508342787E7,V.ymin),V.ymin>=V.ymax))return null;if(!O||!V)return V;var W=L(P,!0);O=L(G,!0);if(null==W||null==O)return V;T=z(P,.001);const Q=z(P,500);var ca=z(G,.001);if(Math.abs(V.xmin-O[0])<ca&&Math.abs(V.xmax-O[1])<ca){ca=Math.abs(f.xmin-W[0]);W=Math.abs(W[1]-f.xmax);if(ca<T&&W>Q){V.xmin=O[0];var Z=
[];Z.push(new D(f.xmax,f.ymin,P));Z.push(new D(f.xmax,(f.ymin+f.ymax)/2,P));Z.push(new D(f.xmax,f.ymax,P));Z=Z.map(ja=>A(ja,G,M)).filter(ja=>!isNaN(ja?.x)).map(ja=>ja.x);V.xmax=Math.max.apply(null,Z)}W<T&&ca>Q&&(V.xmax=O[1],O=[],O.push(new D(f.xmin,f.ymin,P)),O.push(new D(f.xmin,(f.ymin+f.ymax)/2,P)),O.push(new D(f.xmin,f.ymax,P)),f=O.map(ja=>A(ja,G,M)).filter(ja=>!isNaN(ja?.x)).map(ja=>ja.x),V.xmin=Math.min.apply(null,f))}else f=z(G,.001),Math.abs(V.xmin-O[0])<f&&(V.xmin=O[0]),Math.abs(V.xmax-O[1])<
f&&(V.xmax=O[1]);return V}function K(f,G=!1){return f?f.isWebMercator?2*(G?2.0037508342787E7:2.0037508342788905E7):f.wkid&&f.isGeographic?360:2*aa[f.wkid]||null:null}function L(f,G=!1){if(f.isGeographic)return[-180,180];f=K(f,G);return null!=f?[-f/2,f/2]:null}function N(f,G,M,O){f=(f-G)/M;0!==f-Math.floor(f)?f=Math.floor(f):O&&--f;return f}function S(f,G=!1){var M=K(f.spatialReference);if(null==M)return 0;const O=G?0:-(M/2),T=z(f.spatialReference),P=!G&&Math.abs(f.xmin+M/2)<T?-M/2:f.xmin;f=N(!G&&
Math.abs(f.xmax-M/2)<T?M/2:f.xmax,O,M,!0);M=N(P,O,M,!1);return f-M}function U(f){const {projectedExtent:G,srcBufferExtent:M,pixelSize:O,datumTransformation:T,rasterTransform:P}=f;var V=G.spatialReference;const W=M.spatialReference;var Q=q(V,W);const {xmin:ca,ymin:Z,xmax:ja,ymax:ia}=G,ha=K(W),la=null!=ha&&(f.hasWrapAround||"gcs-shift"===P?.type);f=f.spacing||[32,32];var ma=f[0]*O.x,na=f[1]*O.y;const fa=1===f[0],pa=Math.ceil((ja-ca)/ma-.1/f[0])+(fa?0:1),qa=Math.ceil((ia-Z)/na-.1/f[1])+(fa?0:1);ma=a({cols:pa,
rows:qa,xmin:ca,ymax:ia,xres:ma,yres:na,inSR:V,outSR:W,datumTransformation:T,preferPE:4>=f[0],usePixelCenter:fa});na=[];let ra,sa=0;const wa=fa?-1:NaN,{xmin:xa,xmax:va,ymax:ya,width:za,height:Aa}=M,Ba=z(W,500),Ca=null!=ha&&0<xa&&va>ha/2;var ta=!1;Q&&(ta=n(V),ta=null!=ta&&0<ta.poleLocation);for(V=0;V<pa;V++){Q=[];for(let ua=0;ua<qa;ua++){var oa=ma[V*qa+ua];la&&oa[0]>va&&oa[0]>ha/2-Ba?oa[0]-=ha:la&&0===V&&0>oa[0]&&Ca&&!P&&(oa[0]+=ha);!oa||isNaN(oa[0])||isNaN(oa[1])?(na.push(wa),na.push(wa),Q.push(null),
sa++):(P&&(oa=P.inverseTransform(new D({x:oa[0],y:oa[1],spatialReference:W})),oa=[oa.x,oa.y]),Q.push(oa),0<V&&la&&ra[ua]&&oa[0]<ra[ua][0]&&(oa[0]+=ha,ta&&oa[0]>va&&oa[0]>ha&&(oa[0]-=ha)),na.push((oa[0]-xa)/za),na.push((ya-oa[1])/Aa))}ra=Q}return{offsets:na,error:null,coefficients:null,outofBoundPointCount:sa,spacing:f,size:fa?[pa,qa]:[pa-1,qa-1]}}function R(f,G,M){const {cols:O,rows:T}=G;G=new Float32Array((O-1)*(T-1)*12);const P=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),V=new Float32Array([-1,
1,0,0,-1,1,1,0,0]);for(let ia=0;ia<O-1;ia++){for(var W=0;W<T-1;W++){var Q=ia*T*2+2*W,ca=f[Q];const ha=f[Q+1];var Z=f[Q+2],ja=f[Q+3];Q+=2*T;const la=f[Q],ma=f[Q+1],na=f[Q+2];Q=f[Q+3];let fa=0,pa=12*(W*(O-1)+ia);for(let qa=0;3>qa;qa++)G[pa++]=P[fa++]*ca+P[fa++]*Z+P[fa++]*na;fa=0;for(Z=0;3>Z;Z++)G[pa++]=P[fa++]*ha+P[fa++]*ja+P[fa++]*Q;fa=0;for(ja=0;3>ja;ja++)G[pa++]=V[fa++]*ca+V[fa++]*la+V[fa++]*na;fa=0;for(ca=0;3>ca;ca++)G[pa++]=V[fa++]*ha+V[fa++]*ma+V[fa++]*Q}if(M)for(W=0;W<G.length;W++)isNaN(G[W])&&
(G[W]=-1)}return G}function Y(f,G){f=f.clone().normalize();return 1===f.length?f[0]:v(f,G)}function X(f,G){const {pixelSize:M,extent:O}=f;f=g(O,G,!1);const T=Y(O,(M.x+M.y)/16);return B(T,G,f)}var da;(function(f){f[f.None=0]="None";f[f.North=1]="North";f[f.South=2]="South";f[f.Both=3]="Both"})(da||={});const ba=(f,G,M,O=0)=>{if(1===M[0])return[0,0];var T=1,P=-1,V=1,W=-1;for(var Q=0;Q<f.length;Q+=2)isNaN(f[Q])||(T=T>f[Q]?f[Q]:T,P=P>f[Q]?P:f[Q],V=V>f[Q+1]?f[Q+1]:V,W=W>f[Q+1]?W:f[Q+1]);const {cols:ca,
rows:Z}=G;G=(P-T)/ca/M[0];M=(W-V)/Z/M[1];O*=2;V=0;W=!1;T=[0,0];for(P=0;P<ca-3;P++){for(Q=0;Q<Z-3;Q++){var ja=P*Z*2+2*Q;const ia=Math.abs(((f[ja]+f[ja+4]+f[ja+4*Z]+f[ja+4*Z+4])/4-f[ja+2*Z+2])/G);ja=Math.abs(((f[ja+1]+f[ja+5]+f[ja+4*Z+1]+f[ja+4*Z+5])/4-f[ja+2*Z+3])/M);ia+ja>V&&(V=ia+ja,T=[ia,ja]);if(O&&V>O){W=!0;break}}if(W)break}return T},aa={3395:2.0037508342789244E7,3410:1.7334193943686873E7,3857:2.0037508342788905E7,3975:1.7367530445161372E7,4087:2.0037508342789244E7,4088:2.0015108787169147E7,6933:1.7367530445161372E7,
32662:2.0037508342789244E7,53001:2.001508679602057E7,53002:1.000754339801029E7,53003:2.001508679602057E7,53004:2.001508679602057E7,53016:1.4152803599503474E7,53017:1.7333573624304302E7,53034:2.001508679602057E7,53079:2.0015114352186374E7,53080:2.0015114352186374E7,54001:2.0037508342789244E7,54002:1.0018754171394624E7,54003:2.0037508342789244E7,54004:2.0037508342789244E7,54016:1.4168658027268292E7,54017:1.736753044516137E7,54034:2.0037508342789244E7,54079:2.0037508342789244E7,54080:2.0037508342789244E7,
54100:2.0037508342789244E7,54101:2.0037508342789244E7},ea=new Map,ka=new Map;m.computeProjectedScales=function(f,G,M){var O=M?.tileSize??512,T=M?.alignGlobalDatasetWithAGOL??!0,P=!!M?.limitToSrcResolution;const {extent:V,spatialReference:W,pixelSize:Q}=f;M=u(new D({x:Q.x,y:Q.y,spatialReference:W}),G,V);if(null==M)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const ca=(M.x+M.y)/2,Z=y.getMetersPerUnitForSR(G);var ja=ca*Z*96*39.37,ia=G.isGeographic?256/O*2.958287637958547E8:
256/O*5.91657527591555E8,ha="vector-magdir"===f.dataType||"vector-uv"===f.dataType,la=X(f,G),ma=Math.min(Math.ceil(Math.log(Math.min(f.width,f.height)/32)/Math.LN2),Math.ceil(Math.log(ia/2/ja)/Math.LN2));if(!ha&&T&&(G.isGeographic||G.isWebMercator)&&(T=K(G),ha=0<S(la)||null!=T&&la.width>T/4,!ha&&null!=T)){ha=-1;if(3>ma)ha=2**ma*ca*O;else if(f.storageInfo){const {maximumPyramidLevel:na=0,pyramidScalingFactor:fa=2}=f.storageInfo;ha=fa**na*ca*O}O=Math.ceil(T/ha);ha=1===O||2===O&&T/2-la.xmax<ha}O=ja;
f=Math.min(2,Math.max(1.414,f.storageInfo?.pyramidScalingFactor||2));if(ha)O=ia,ia=G.isGeographic?1.341104507446289E-6:.29858214164761665,ma=96*ia*Z*39.37,G=u(new D({x:ia,y:ia,spatialReference:{wkid:G.isGeographic?4326:3857}}),W,la),G.x*=O/ma,G.y*=O/ma;else{G={x:Q.x,y:Q.y};for(la=0;O<.5005*ia&&la<ma;)la++,O*=f,G.x*=f,G.y*=f;1.001>=Math.max(O,ia)/Math.min(O,ia)&&(O=ia)}ia=[O];la=[{x:G.x,y:G.y}];for(ja=Math.min(70.5310735,ja)/1.001;O>=ja;)O/=f,G.x/=f,G.y/=f,ia.push(O),la.push({x:G.x,y:G.y});if(P){const na=
.001*Q.x;P=la.findIndex(fa=>fa.x>=Q.x-na&&fa.x<=Q.x+na);-1<P?(la.length=P+1,ia.length=P+1):(P=la.findIndex(fa=>fa.x<=Q.x+na),0<P&&(la.length=P,ia.length=P))}return{projectedPixelSize:M,scales:ia,srcResolutions:la,isCustomTilingScheme:!ha}};m.defaultGridSpacing=32;m.defaultProjectionToleranceInPixels=4;m.getDefaultDatumTransformationForDataset=g;m.getProjectedGridPoints=a;m.getProjectionOffsetGrid=function(f){var G=f.isAdaptive&&null==f.spacing;let M=f.spacing||[32,32],O=U(f);var T={cols:O.size[0]+
1,rows:O.size[1]+1};const P=0<O.outofBoundPointCount&&O.outofBoundPointCount<O.offsets.length/2;let V=O.outofBoundPointCount===O.offsets.length/2||G&&P?[0,0]:ba(O.offsets,T,M,4);const W=(V[0]+V[1])/2;var Q=f.projectedExtent.spatialReference;const ca=f.srcBufferExtent.spatialReference;G&&(P||4<W)&&(t(Q,ca,f.datumTransformation)&&(Q.isGeographic||null!=n(Q)),M=[4,4],O=U({...f,spacing:M}),T={cols:O.size[0]+1,rows:O.size[1]+1},V=ba(O.offsets,T,M,4));O.error=V;1<M[0]&&(O.coefficients=R(O.offsets,T,P));
!f.includeGCSGrid||Q.isGeographic||Q.isWebMercator||(ca.isGeographic?O.gcsGrid={offsets:O.offsets,coefficients:O.coefficients,spacing:M}:(G=n(Q),null==G||G.isEnvelope||(Q&&!Q.isGeographic&&(G=String(Q.wkid||Q.wkt2||Q.wkt),ka.has(G)?Q=ka.get(G):(Q=(Q.wkid?x.PeFactory.coordsys(Q.wkid):x.PeFactory.fromString(x.PeDefs.PE_TYPE_PROJCS,Q.wkt2||Q.wkt)).getGeogcs().getCode(),ka.set(G,Q)),Q=new b({wkid:Q})),Q=B(f.projectedExtent,Q),{offsets:f}=U({...f,srcBufferExtent:Q,spacing:M}),T=R(f,T,P),O.gcsGrid={offsets:f,
coefficients:T,spacing:M})));return O};m.getRasterDatasetAlignmentInfo=function(f){const G=f.storageInfo.origin.x;var M=K(f.spatialReference,!0);if(null==M)return{originX:G,halfWorldWidth:null,pyramidsInfo:null};const O=M/2,{nativePixelSize:T,storageInfo:P,extent:V}=f,{maximumPyramidLevel:W,blockWidth:Q,pyramidScalingFactor:ca}=P;let Z=T.x;const ja=[];f=null!=f.transform&&"gcs-shift"===f.transform.type;const ia=G+(f?0:O);M=f?M-G:O-G;for(let ha=0;ha<=W;ha++){const la=(V.xmax-G)/Z/Q,ma=M/Z/Q;ja.push({resolutionX:Z,
blockWidth:Q,datasetColumnCount:0===la-Math.floor(la)?la:Math.ceil(la),worldColumnCountFromOrigin:0===ma-Math.floor(ma)?ma:Math.ceil(ma),leftMargin:Math.round(ia/Z)%Q,rightPadding:(Q-Math.round(M/Z)%Q)%Q,originColumnOffset:Math.floor(ia/Z/Q)});Z*=ca}return{originX:G,halfWorldWidth:O,pyramidsInfo:ja,hasGCSSShiftTransform:f}};m.getWorldWidth=K;m.getWorldWrapCount=S;m.load=async function(){E.isLoaded()||await E.load()};m.minimumGridSpacing=4;m.projectDatasetExtent=X;m.projectExtent=B;m.projectPoint=
A;m.projectPolygon=function(f,G,M){if("extent"===f.type){const {xmin:O,ymin:T,xmax:P,ymax:V,spatialReference:W}=f;f=new p({rings:[[[O,V],[P,V],[P,T],[O,T],[O,V]]],spatialReference:W})}if(f.spatialReference.equals(G))return f;q(f.spatialReference,G,M);return E.project(f,G,M)};m.projectResolution=u;m.requirePE=t;m.shiftExtent=function(f){var {spatialReference:G}=f;G=F.getInfo(G);if(!G)return f;const [M,O]=G.valid;G=O-M;let T=0;f.xmin<M?T=Math.ceil((M-f.xmin)/G):f.xmin>O&&(T=-Math.ceil((f.xmin-O)/G));
return new w({spatialReference:f.spatialReference,xmin:f.xmin+T*G,ymin:f.ymin,xmax:f.xmax+T*G,ymax:f.ymax})};m.snapExtent=Y;m.snapPyramid=function(f,G,M){const {storageInfo:O,pixelSize:T}=G;var P=0;let V=!1;var {pyramidResolutions:W}=O,Q="mixed"===O.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,O.tileInfo.dpi/96)):1;Q=(f.x+f.y)/2/Q;if(null!=W&&W.length){f=W[W.length-1];f=(f.x+f.y)/2;var ca=(T.x+T.y)/2;if(Q<=ca)P=0;else if(Q>=f)P=W.length,V=8<Q/f;else{f=ca;for(let Z=1;Z<=W.length;Z++){ca=(W[Z-
1].x+W[Z-1].y)/2;if(Q<=ca){Q===ca?P=Z:"down"===M?(P=Z-1,V=8<Q/f):P="up"===M?Z:Q-f>ca-Q||2<Q/f?Z:Z-1;break}f=ca}}M=0===P?T:W[P-1];V&&(W=Math.min(M.x,M.y),Q=y.getMetersPerUnitForSR(G.spatialReference),19567<W*Q&&(V=!1));return{pyramidLevel:P,pyramidResolution:new D({x:M.x,y:M.y,spatialReference:G.spatialReference}),excessiveReading:V}}P=Math.log(f.x/T.x)/Math.LN2;Q=Math.log(f.y/T.y)/Math.LN2;W=G.storageInfo.maximumPyramidLevel||0;P="down"===M?Math.floor(Math.min(P,Q)):"up"===M?Math.ceil(Math.max(P,
Q)):Math.round((P+Q)/2);0>P?P=0:P>W&&(V=P>W+3,P=W);M=2**P;G=new D({x:M*G.nativePixelSize.x,y:M*G.nativePixelSize.y,spatialReference:G.spatialReference});return{pyramidLevel:P,pyramidResolution:G,excessiveReading:V}};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/imagery/VectorFieldTileView2D":function(){define("../../../../chunks/tslib.es6 ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../layers/support/rasterFunctions/vectorFieldUtils ../../engine/imagery/RasterVFTileContainer ./BaseImageryTileSubView2D".split(" "),
function(m,C,k,l,y,x,E,F,w,D){l=class extends D.BaseImageryTileSubView2D{constructor(){super(...arguments);this._handle=null;this.type="rasterVF"}canUseWebGLForProcessing(){return!1}async fetchTile(p,b){b={...b,interpolation:"nearest",requestProjectedLocalDirections:!0};p=await this.layer.fetchTile(p.level,p.row,p.col,b);"vector-magdir"===this.layer.serviceRasterInfo?.dataType&&p?.pixelBlock&&(p.pixelBlock=await this.layer.convertVectorFieldData(p.pixelBlock,b));return p}updateTileSource(p,b){const t=
b.symbolizerParams,{tileData:q}=p;q.key=p.key;q.width=this._tileInfoView.tileInfo.size[0];q.height=this._tileInfoView.tileInfo.size[1];({symbolTileSize:p}=t);({source:b}=b);q.offset=this._getTileSymbolOffset(q.key,p);null!=b?.pixelBlock?(q.rawPixelData={extent:b.extent,pixelBlock:b.pixelBlock},q.symbolizerParameters=t,q.source=this._sampleVectorFieldData(b.pixelBlock,t,q.offset)):(b=this.createEmptyTilePixelBlock([Math.round((this._tileInfoView.tileInfo.size[0]-q.offset[0])/p),Math.round((this._tileInfoView.tileInfo.size[1]-
q.offset[1])/p)]),q.source=b,q.symbolizerParameters=t);q.invalidateVAO();return Promise.resolve()}updateTileSymbolizerParameters(p,b){var t=b.local;({symbolTileSize:b}=t);({tileData:p}=p);p.offset=this._getTileSymbolOffset(p.key,b);const q=p.symbolizerParameters.symbolTileSize;p.symbolizerParameters=t;t=p.rawPixelData?.pixelBlock;null!=t&&q!==b&&(p.source=this._sampleVectorFieldData(t,p.symbolizerParameters,p.offset));return Promise.resolve()}attach(){super.attach();this.container=new w.RasterVFTileContainer(this._tileInfoView);
this.container.isCustomTilingScheme=this._isCustomTilingScheme;this._updateSymbolType(this.layer.renderer);this._handle=C.watch(()=>this.layer.renderer,p=>this._updateSymbolType(p))}detach(){super.detach();this.container.removeAllChildren();this._handle?.remove();this.container=this._handle=null}_getTileSymbolOffset(p,b){const t=p.col*this._tileInfoView.tileInfo.size[0]%b;p=p.row*this._tileInfoView.tileInfo.size[1]%b;return[t>b/2?b-t:-t,p>b/2?b-p:-p]}_sampleVectorFieldData(p,b,t){({symbolTileSize:b}=
b);return F.sampleVectorField(p,"vector-uv",b,t)}_updateSymbolType(p){"vector-field"===p.type&&(this.container.symbolTypes="wind-barb"===p.style?["scalar","triangle"]:"simple-scalar"===p.style?["scalar"]:["triangle"])}};m.__decorate([k.property()],l.prototype,"container",void 0);m.__decorate([k.property()],l.prototype,"layer",void 0);m.__decorate([k.property()],l.prototype,"type",void 0);return l=m.__decorate([E.subclass("esri.views.2d.layers.imagery.VectorFieldTileView2D")],l)})},"esri/layers/support/rasterFunctions/vectorFieldUtils":function(){define(["exports",
"../../../core/jsonMap","../PixelBlock","./pixelUtils"],function(m,C,k,l){function y(h,c){return u.get(h)/u.get(c)||1}function x(h,c="geographic"){const [r,v]=h;h=Math.sqrt(r*r+v*v);let B=Math.atan2(v,r)*z;B=(360+B)%360;"geographic"===c&&(B=(450-B)%360);return[h,B]}function E(h,c="geographic"){let r=h[1];"geographic"===c&&(r=(450-r)%360);r%=360;h=h[0];return[h*Math.cos(r/z),h*Math.sin(r/z)]}function F(h,c,r="geographic",v=1){if(!l.isValidPixelBlock(h))return h;const {pixels:B,width:H,height:J}=h;
var K=H*J;const L=B[0],N=B[1],S=h.pixelType.startsWith("f")?h.pixelType:"f32",U=k.createEmptyBand(S,K);K=k.createEmptyBand(S,K);let R=0;for(let Y=0;Y<J;Y++)for(let X=0;X<H;X++)"vector-uv"===c?([U[R],K[R]]=x([L[R],N[R]],r),U[R]*=v):([U[R],K[R]]=E([L[R],N[R]],r),U[R]*=v,K[R]*=v),R++;h=new k({pixelType:S,width:h.width,height:h.height,mask:h.mask,validPixelCount:h.validPixelCount,maskIsAlpha:h.maskIsAlpha,pixels:[U,K]});h.updateStatistics();return h}function w(h=0,c=0,r=Math.PI,v=!0){v&&(r=(2*Math.PI-
r)%(2*Math.PI));v=v?-1:1;const B=-7*v,H=-2*v,J=-16*v,[K,L]=p(0,c+13*v,r,21.75),[N,S]=p(h-5.5,c+B,r,21.75),[U,R]=p(h+5.5,c+B,r,21.75),[Y,X]=p(h-1.5,c+H,r,21.75),[da,ba]=p(h+1.5,c+H,r,21.75),[aa,ea]=p(h-1.5,c+J,r,21.75),[ka,f]=p(h+1.5,c+J,r,21.75);return[K,L,N,S,Y,X,da,ba,U,R,aa,ea,ka,f]}function D(h=0,c=Math.PI,r=!0){r&&(c=(2*Math.PI-c)%(2*Math.PI));var v=r?-1:1,B=5*v;const H=20*v,J=25*v;v*=2;const K=r?1:-1;r=5*K;let [L,N]=[0+r,0-H],[S,U]=[L+2*K,N],[R,Y]=[S-0*K,U+v],[X,da]=[0-r,0-J],[ba,aa]=[X+0*K,
da-v],ea=Math.ceil(h/5),ka=Math.floor(ea/10);ea-=8*ka;h=[];const f=[];for(let ca=0;ca<ea/2;ca++,ka--){0>=ka&&1===ea%2&&ca===(ea-1)/2&&(X=0,ba=X+0*K,da=(da+N)/2,aa=da-v);const [Z,ja]=p(X,da,c,45);if(0<ka){const [ia,ha]=p(S,da,c,45),[la,ma]=p(L,N,c,45);h.push(ia);h.push(ha);h.push(Z);h.push(ja);h.push(la);h.push(ma)}else{const [ia,ha]=p(S,U,c,45),[la,ma]=p(R,Y,c,45),[na,fa]=p(ba,aa,c,45);f.push(Z);f.push(ja);f.push(na);f.push(fa);f.push(la);f.push(ma);f.push(ia);f.push(ha)}da+=B;N+=B;U+=B;Y+=B;aa+=
B}const [G,M]=p(0+r,0+H,c,45);B=7*K;const [O,T]=p(0+B,0+H,c,45),[P,V]=p(0+r,0-J,c,45),[W,Q]=p(0+B,0-J,c,45);return{pennants:h,barbs:f,shaft:[G,M,O,T,P,V,W,Q]}}function p(h,c,r,v=1){return[Math.sqrt(h*h+c*c)/v,(2*Math.PI+(2*Math.PI+Math.atan2(c,h))%(2*Math.PI)-r)%(2*Math.PI)]}function b(h,c,r,v){r=y(v||"knots",r);for(v=1;v<c.length;v++)if(v===c.length-1){if(h<c[v]*r)break}else if(h<=c[v]*r)break;return Math.min(v-1,c.length-2)}function t(h,c,r,v,B){let H=0;switch(c){case "beaufort_kn":H=b(h,a,"knots",
r);break;case "beaufort_km":H=b(h,a,"kilometer-per-hour",r);break;case "beaufort_ft":H=b(h,a,"feet-per-second",r);break;case "beaufort_m":H=b(h,a,"meter-per-second",r);break;case "classified_arrow":H=b(h,B??[],v,r);break;case "ocean_current_m":H=b(h,d,"meter-per-second",r);break;case "ocean_current_kn":H=b(h,e,"knots",r)}return H}function q(h,c){const {style:r,inputUnit:v,outputUnit:B,breakValues:H}=c,J=A.fromJSON(v),K=A.fromJSON(B);let L=0,N=0;const {width:S,height:U,mask:R}=h,Y=h.pixels[0];h=h.pixels[1];
var X=null!=R?R.filter(aa=>0<aa).length:S*U;const da=new Float32Array(42*X);X=new Uint32Array(15*X);c=c.invertDirection?w(0,0,0,!1):I;for(let aa=0;aa<U;aa++)for(let ea=0;ea<S;ea++){var ba=aa*S+ea;if(!R||R[aa*S+ea]){const ka=(h[ba]+360)%360/180*Math.PI,f=t(Y[ba],r,J,K,H);for(let G=0;G<c.length;G+=2)da[L++]=(ea+.5)/S,da[L++]=(aa+.5)/U,da[L++]=c[G],da[L++]=c[G+1]+ka,da[L++]=f,da[L++]=Y[ba];ba=7*(L/42-1);X[N++]=ba;X[N++]=ba+1;X[N++]=ba+2;X[N++]=ba+0;X[N++]=ba+4;X[N++]=ba+3;X[N++]=ba+0;X[N++]=ba+2;X[N++]=
ba+3;X[N++]=ba+2;X[N++]=ba+5;X[N++]=ba+3;X[N++]=ba+5;X[N++]=ba+6;X[N++]=ba+3}}return{vertexData:da,indexData:X}}function g(h,c){let r=0,v=0;const {width:B,height:H,mask:J}=h;h=h.pixels[0];const K=[],L=[];var N=A.fromJSON(c.inputUnit);N=y(N,"knots");c="wind_speed"===c.style?5:Number.MAX_VALUE;for(let U=0;U<H;U++)for(let R=0;R<B;R++){var S=h[U*B+R]*N;if((!J||J[U*B+R])&&S<c){for(let Y=0;4>Y;Y++)K[r++]=(R+.5)/B,K[r++]=(U+.5)/H,K[r++]=2>Y?-.5:.5,K[r++]=0===Y%2?-.5:.5,K[r++]=0,K[r++]=S;S=4*(r/24-1);L[v++]=
S;L[v++]=S+1;L[v++]=S+2;L[v++]=S+1;L[v++]=S+2;L[v++]=S+3}}return{vertexData:new Float32Array(K),indexData:new Uint32Array(L)}}const u=new Map;u.set("meter-per-second",1);u.set("kilometer-per-hour",.277778);u.set("knots",.514444);u.set("feet-per-second",.3048);u.set("mile-per-hour",.44704);const z=180/Math.PI,A=new C.JSONMap({esriMetersPerSecond:"meter-per-second",esriKilometersPerHour:"kilometer-per-hour",esriKnots:"knots",esriFeetPerSecond:"feet-per-second",esriMilesPerHour:"mile-per-hour"}),I=w(0,
0,0),a=[0,1,3,6,10,16,21,27,33,40,47,55,63],d=[0,.5,1,1.5,2],e=[0,.25,.5,1,1.5,2,2.5,3,3.5,4],n=[];m.convertToLocalDirections=function(h,c,r,v="geographic"){if(!l.isValidPixelBlock(h)||null==r)return h;h="vector-magdir"===c?h.clone():F(h,c);const B=h.pixels[1];for(let H=0;H<B.length;H++)B[H]="geographic"===v?(B[H]+r[H]+270)%360:(B[H]+360-r[H])%360;return"vector-magdir"===c?h:F(h,"vector-magdir")};m.convertVectorFieldData=F;m.convertVectorFieldUnit=function(h,c,r=1){if(1===r||!l.isValidPixelBlock(h))return h;
h=h.clone();const {pixels:v,width:B,height:H}=h,J=v[0],K=v[1];let L=0;for(let N=0;N<H;N++)for(let S=0;S<B;S++)"vector-uv"===c?(J[L]*=r,K[L]*=r):J[L]*=r,L++;h.updateStatistics();return h};m.createVFMesh=function(h,c){if("simple_scalar"===c.style)c=g(h,c);else if("wind_speed"===c.style){if(0===n.length)for(var r=0;30>r;r++)n.push(D(5*r,0,!c.invertDirection));c=A.fromJSON(c.inputUnit);c=y(c,"knots");const {width:J,height:K,mask:L}=h;r=h.pixels[0];h=h.pixels[1];const N=[],S=[];let U=0,R=0;for(let Y=0;Y<
K;Y++)for(let X=0;X<J;X++){var v=Y*J+X,B=r[v]*c;if((!L||L[Y*J+X])&&5<=B){const da=(h[v]+360)%360/180*Math.PI,{pennants:ba,barbs:aa,shaft:ea}=n[Math.min(Math.floor(B/5),29)];if(0===ba.length+aa.length)continue;v=N.length/6;const ka=(X+.5)/J,f=(Y+.5)/K;for(var H=0;H<ba.length;H+=2)N[U++]=ka,N[U++]=f,N[U++]=ba[H],N[U++]=ba[H+1]+da,N[U++]=0,N[U++]=B;for(H=0;H<aa.length;H+=2)N[U++]=ka,N[U++]=f,N[U++]=aa[H],N[U++]=aa[H+1]+da,N[U++]=0,N[U++]=B;for(H=0;H<ea.length;H+=2)N[U++]=ka,N[U++]=f,N[U++]=ea[H],N[U++]=
ea[H+1]+da,N[U++]=0,N[U++]=B;for(B=0;B<ba.length/6;B++)S[R++]=v,S[R++]=v+1,S[R++]=v+2,v+=3;for(B=0;B<aa.length/8;B++)S[R++]=v,S[R++]=v+1,S[R++]=v+2,S[R++]=v+1,S[R++]=v+2,S[R++]=v+3,v+=4;S[R++]=v+0;S[R++]=v+1;S[R++]=v+2;S[R++]=v+1;S[R++]=v+3;S[R++]=v+2;v+=4}}c={vertexData:new Float32Array(N),indexData:new Uint32Array(S)}}else c=q(h,c);return c};m.createVFMeshScalar=g;m.getUnitConversionFactor=y;m.sampleVectorField=function(h,c,r,v=[0,0],B=.5){const {width:H,height:J,mask:K}=h,[L,N]=h.pixels,[S,U]=
v;h=Math.round((H-S)/r);v=Math.round((J-U)/r);var R=h*v;const Y=new Float32Array(R),X=new Float32Array(R);R=new Uint8Array(R);c="vector-uv"===c;for(let ba=0;ba<v;ba++)for(let aa=0;aa<h;aa++){let ea=0;const ka=ba*h+aa,f=Math.max(0,ba*r+U),G=Math.max(0,aa*r+S),M=Math.min(J,f+r),O=Math.min(H,G+r);for(let T=f;T<M;T++)for(let P=G;P<O;P++){var da=T*H+P;if(!K||K[da]){ea++;da=c?[L[da],N[da]]:[L[da],(360+N[da])%360];const [V,W]=c?da:E(da);Y[ka]+=V;X[ka]+=W}}if(ea>=(M-f)*(O-G)*(1-B)){R[ka]=1;const [T,P]=x([Y[ka]/
ea,X[ka]/ea]);Y[ka]=T;X[ka]=P}else R[ka]=0,Y[ka]=0,X[ka]=0}r=new k({width:h,height:v,pixels:[Y,X],mask:R});r.updateStatistics();return r};m.snapImageToSymbolTile=function(h,c,r,v,B){if(null==B||!B.spatialReference.equals(h.spatialReference))return{extent:h,width:Math.round(c/v),height:Math.round(r/v),resolution:h.width/c};const H=B.xmin;B=B.ymax;c=(h.xmax-h.xmin)/c*v;r=(h.ymax-h.ymin)/r*v;h.xmin=H+Math.floor((h.xmin-H)/c)*c;h.xmax=H+Math.ceil((h.xmax-H)/c)*c;h.ymin=B+Math.floor((h.ymin-B)/r)*r;h.ymax=
B+Math.ceil((h.ymax-B)/r)*r;return{extent:h,width:Math.round(h.width/c),height:Math.round(h.height/r),resolution:(c+r)/2}};m.unitKebabDict=A;m.uvComponentToVector=x;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFunctions/pixelUtils":function(){define(["exports","../PixelBlock","../rasterFormats/pixelRangeUtils"],function(m,C,k){function l(a){return null!=a&&"esri.layers.support.PixelBlock"===a.declaredClass&&a.pixels&&0<a.pixels.length}function y(a,d,e,
n,h){const c=a.length;h=C.createEmptyBand(h,c);if(d)for(let r=0;r<c;r++)d[r]&&(h[r]=e[a[r]-n]);else for(d=0;d<c;d++)h[d]=e[a[d]-n];return h}function x(a,d,e,n){const h=null!=e&&2<=e.length?new Set(e):null;e=1===e?.length?e[0]:null;const c=!!d?.length;for(let r=0;r<a.length;r++)if(n[r]){const v=a[r];if(c){let B=!1;for(let H=0;H<d.length;H+=2)if(v>=d[H]&&v<=d[H+1]){B=!0;break}B||(n[r]=0)}n[r]&&(v===e||h?.has(v))&&(n[r]=0)}}function E(a,d){const e=a[0].length;for(let n=0;n<e;n++)if(d[n]){let h=!1;for(let c=
0;c<a.length;c++)if(a[c][n]){h=!0;break}h||(d[n]=0)}}function F(a,d){const e=a[0].length;for(let n=0;n<e;n++)if(d[n]){let h=!1;for(let c=0;c<a.length;c++)if(0===a[c][n]){h=!0;break}h&&(d[n]=0)}}function w(a,d,e,n,h,c,r,v){return{xmin:h<=e*a?0:h<e*a+a?h-e*a:a,ymin:c<=n*d?0:c<n*d+d?c-n*d:d,xmax:h+r<=e*a?0:h+r<e*a+a?h+r-e*a:a,ymax:c+v<=n*d?0:c+v<n*d+d?c+v-n*d:d}}function D(a,d,e,n,h,c){const {width:r,height:v}=e.block,{x:B,y:H}=e.offset,{width:J,height:K}=e.mosaic;e=w(r,v,n,h,B,H,J,K);let L=0;var N=
0;if(c){var S=c.hasGCSSShiftTransform?360:c.halfWorldWidth??0,U=r*c.resolutionX;const R=c.startX+n*U;R<S&&R+U>S?N=c.rightPadding:R>=S&&(L=c.leftMargin-c.rightPadding,N=0)}e.xmax-=N;if("number"===typeof d)for(c=e.ymin;c<e.ymax;c++)for(N=(h*v+c-H)*J+(n*r-B)+L,S=e.xmin;S<e.xmax;S++)a[N+S]=d;else for(c=e.ymin;c<e.ymax;c++)for(N=(h*v+c-H)*J+(n*r-B)+L,S=c*r,U=e.xmin;U<e.xmax;U++)a[N+U]=d[S+U]}function p(a,d,e={}){const {clipOffset:n,clipSize:h,alignmentInfo:c,blockWidths:r}=e;if(r)return b(a,d,{blockWidths:r});
var v=a.find(da=>l(da));if(null==v)return null;e=h?h.width:d.width;const B=h?h.height:d.height;var H=v.width,J=v.height;const K=d.width/H,L=d.height/J;d={offset:n||{x:0,y:0},mosaic:h||d,block:{width:H,height:J}};H=v.pixelType;var N=C.getPixelArrayConstructor(H);v=v.pixels.length;J=[];for(var S=0;S<v;S++){var U=new N(e*B);for(var R=0;R<L;R++)for(var Y=0;Y<K;Y++){var X=a[R*K+Y];l(X)&&(X=X.pixels[S],D(U,X,d,Y,R,c))}J.push(U)}N=a.some(da=>null==da||null!=da.mask&&0<da.mask.length);U=a.some(da=>da?.bandMasks&&
1<da.bandMasks.length);N=N?new Uint8Array(e*B):void 0;U=U?[]:void 0;if(N){for(S=0;S<L;S++)for(R=0;R<K;R++)Y=a[S*K+R],X=null!=Y?Y.mask:null,null!=X?D(N,X,d,R,S,c):Y?D(N,255,d,R,S,c):D(N,0,d,R,S,c);if(U)for(S=0;S<v;S++){R=new Uint8Array(e*B);for(Y=0;Y<L;Y++)for(X=0;X<K;X++){const da=a[Y*K+X],ba=da?.bandMasks?.[S]??da?.mask;null!=ba?D(R,ba,d,X,Y,c):da?D(R,255,d,X,Y,c):D(R,0,d,X,Y,c)}U.push(R)}}a=new C({width:e,height:B,pixels:J,pixelType:H,bandMasks:U,mask:N});a.updateStatistics();return a}function b(a,
d,e){const n=a.find(R=>null!=R);if(null==n)return null;var h=a.some(R=>null!=R?!!R.mask:!0);const {width:c,height:r}=d;d=h?new Uint8Array(c*r):null;({blockWidths:e}=e);const v=[],B=n.getPlaneCount(),H=C.getPixelArrayConstructor(n.pixelType);if(h)for(let R=0,Y=0;R<a.length;Y+=e[R],R++)if(h=a[R],l(h)){var J=h.mask;for(var K=0;K<r;K++)for(var L=0;L<e[R];L++)d[K*c+L+Y]=null==J?255:J[K*h.width+L]}J=(h=a.some(R=>R?.bandMasks&&1<R.bandMasks.length))?[]:void 0;K=c*r;for(L=0;L<B;L++){const R=new H(K),Y=h?
new Uint8Array(K):void 0;for(let X=0,da=0;X<a.length;da+=e[X],X++){const ba=a[X];if(l(ba)){var N=ba.pixels[L];if(null!=N){for(var S=0;S<r;S++)for(var U=0;U<e[X];U++)R[S*c+U+da]=N[S*ba.width+U];if(Y)for(N=ba.bandMasks?.[L]??ba.mask,S=0;S<r;S++)for(U=0;U<e[X];U++)Y[S*c+U+da]=N?N[S*ba.width+U]:255}}}v.push(R);J&&Y&&J.push(Y)}a=new C({width:c,height:r,mask:d,bandMasks:J,pixels:v,pixelType:n.pixelType});a.updateStatistics();return a}function t(a){if(!l(a))return null;const d=a.clone(),{width:e,height:n,
pixels:h}=a;var c=h[0];const r=d.pixels[0];a=a.mask;for(let H=2;H<n-1;H++){const J=new Map;for(var v=H-2;v<H+2;v++)for(var B=0;4>B;B++){const K=v*e+B;u(J,c[K],a?a[K]:1)}r[H*e]=q(J);r[H*e+1]=r[H*e+2]=r[H*e];for(v=3;v<e-1;v++)B=(H-2)*e+v+1,u(J,c[B],a?a[B]:1),B=(H-1)*e+v+1,u(J,c[B],a?a[B]:1),B=H*e+v+1,u(J,c[B],a?a[B]:1),B=(H+1)*e+v+1,u(J,c[B],a?a[B]:1),B=(H-2)*e+v-3,g(J,c[B],a?a[B]:1),B=(H-1)*e+v-3,g(J,c[B],a?a[B]:1),B=H*e+v-3,g(J,c[B],a?a[B]:1),B=(H+1)*e+v-3,g(J,c[B],a?a[B]:1),r[H*e+v]=q(J);r[H*e+v+
1]=r[H*e+v]}for(c=0;c<e;c++)r[c]=r[e+c]=r[2*e+c],r[(n-1)*e+c]=r[(n-2)*e+c];d.updateStatistics();return d}function q(a){if(0===a.size)return 0;let d=0,e=-1,n=0;const h=a.keys();let c=h.next();for(;!c.done;)n=a.get(c.value),n>d&&(e=c.value,d=n),c=h.next();return e}function g(a,d,e){0!==e&&(e=a.get(d),1===e?a.delete(d):a.set(d,e-1))}function u(a,d,e){0!==e&&a.set(d,a.has(d)?a.get(d)+1:1)}function z(a,d,e){let {x:n,y:h}=d;const {width:c,height:r}=e;if(0===n&&0===h&&r===a.height&&c===a.width)return a;
const {width:v,height:B}=a;d=Math.max(0,h);const H=Math.max(0,n),J=Math.min(n+c,v),K=Math.min(h+r,B);if(0>J||0>K||!l(a))return null;n=Math.max(0,-n);h=Math.max(0,-h);var {pixels:L}=a,N=c*r,S=L.length;const U=[];for(var R=0;R<S;R++){var Y=L[R],X=C.createEmptyBand(a.pixelType,N);for(let da=d;da<K;da++){const ba=da*v;let aa=(da+h-d)*c+n;for(let ea=H;ea<J;ea++)X[aa++]=Y[ba+ea]}U.push(X)}L=new Uint8Array(N);N=a.mask;for(S=d;S<K;S++)for(R=S*v,Y=(S+h-d)*c+n,X=H;X<J;X++)L[Y++]=N?N[R+X]:1;a=new C({width:e.width,
height:e.height,pixelType:a.pixelType,pixels:U,mask:L});a.updateStatistics();return a}function A(a,d=!0){if(!l(a))return null;const {pixels:e,width:n,height:h,mask:c,pixelType:r}=a;a=[];const v=Math.round(n/2),B=Math.round(h/2),H=h-1,J=n-1;for(var K=0;K<e.length;K++){var L=e[K],N=C.createEmptyBand(r,v*B),S=0;for(var U=0;U<h;U+=2)for(var R=0;R<n;R+=2){var Y=L[U*n+R];if(d){var X=R===J?Y:L[U*n+R+1];const da=U===H?Y:L[U*n+R+n],ba=R===J?da:U===H?X:L[U*n+R+n+1];N[S++]=(Y+X+da+ba)/4}else N[S++]=Y}a.push(N)}K=
null;if(null!=c)for(K=new Uint8Array(v*B),L=0,N=0;N<h;N+=2)for(S=0;S<n;S+=2)U=c[N*n+S],d?(R=S===J?U:c[N*n+S+1],Y=N===H?U:c[N*n+S+n],X=S===J?Y:N===H?R:c[N*n+S+n+1],K[L++]=U*R*Y*X?1:0):K[L++]=U;return new C({width:v,height:B,pixelType:r,pixels:a,mask:K})}function I(a,d,e,n,h=0){const {width:c,height:r}=a,{width:v,height:B}=d;a=n.cols;n=n.rows;d=Math.ceil(v/a-.1/a);const H=Math.ceil(B/n-.1/n);let J,K,L,N,S;const U=d*a;var R=U*H*n;const Y=new Float32Array(R),X=new Float32Array(R),da=new Uint32Array(R),
ba=new Uint32Array(R);let aa=0,ea,ka;for(let M=0;M<H;M++)for(let O=0;O<d;O++){var f=12*(M*d+O);R=e[f];J=e[f+1];K=e[f+2];L=e[f+3];N=e[f+4];S=e[f+5];for(var G=0;G<n;G++){aa=(M*n+G)*U+O*a;ka=(G+.5)/n;for(let T=0;T<G;T++)ea=(T+.5)/a,Y[aa+T]=(R*ea+J*ka+K)*c+h,X[aa+T]=(L*ea+N*ka+S)*r+h,da[aa+T]=Math.floor(Y[aa+T]),ba[aa+T]=Math.floor(X[aa+T])}f+=6;R=e[f];J=e[f+1];K=e[f+2];L=e[f+3];N=e[f+4];S=e[f+5];for(f=0;f<n;f++)for(aa=(M*n+f)*U+O*a,ka=(f+.5)/n,G=f;G<a;G++)ea=(G+.5)/a,Y[aa+G]=(R*ea+J*ka+K)*c+h,X[aa+G]=
(L*ea+N*ka+S)*r+h,da[aa+G]=Math.floor(Y[aa+G]),ba[aa+G]=Math.floor(X[aa+G])}return{offsets_x:Y,offsets_y:X,offsets_xi:da,offsets_yi:ba,gridWidth:U}}m.NoDataInterpretation=void 0;(function(a){a[a.matchAny=0]="matchAny";a[a.matchAll=1]="matchAll"})(m.NoDataInterpretation||(m.NoDataInterpretation={}));m.MissingBandAction=void 0;(function(a){a[a.bestMatch=0]="bestMatch";a[a.fail=1]="fail"})(m.MissingBandAction||(m.MissingBandAction={}));m.approximateTransform=function(a,d,e,n,h="nearest"){if(!l(a))return null;
"majority"===h&&(a=t(a));const {pixels:c,mask:r,bandMasks:v,pixelType:B}=a,H=a.width;var J=a.height;const K=C.getPixelArrayConstructor(B),L=c.length,{width:N,height:S}=d;a=!1;for(var U=0;U<e.length;U+=3)-1===e[U]&&-1===e[U+1]&&-1===e[U+2]&&(a=!0);const {offsets_x:R,offsets_y:Y,offsets_xi:X,offsets_yi:da,gridWidth:ba}=I({width:H,height:J},d,e,n,"majority"===h?.5:0);let aa;d=(ka,f,G,M)=>{const O=ka instanceof Float32Array||ka instanceof Float64Array?0:.5;for(let T=0;T<S;T++){aa=T*ba;for(let P=0;P<N;P++){if(0>
R[aa]||0>Y[aa])ka[T*N+P]=0;else if(M)ka[T*N+P]=f[X[aa]+da[aa]*H];else{const V=Math.floor(R[aa]),W=Math.floor(Y[aa]),Q=Math.ceil(R[aa]),ca=Math.ceil(Y[aa]),Z=R[aa]-V,ja=Y[aa]-W;ka[T*N+P]=!G||G[V+W*H]&&G[Q+W*H]&&G[V+ca*H]&&G[Q+ca*H]?(1-ja)*((1-Z)*f[V+W*H]+Z*f[Q+W*H])+ja*((1-Z)*f[V+ca*H]+Z*f[Q+ca*H])+O:f[X[aa]+da[aa]*H]}aa++}}};e=[];n=v?.length===L;J=[];for(U=0;U<L;U++){if(n){var ea=new Uint8Array(N*S);d(ea,v[U],v[U],!0);J.push(ea)}ea=new K(N*S);d(ea,c[U],n?v[U]:r,"nearest"===h||"majority"===h);e.push(ea)}h=
new C({width:N,height:S,pixelType:B,pixels:e,bandMasks:n?J:void 0});if(null!=r)h.mask=new Uint8Array(N*S),d(h.mask,r,r,!0);else if(a)for(h.mask=new Uint8Array(N*S),a=0;a<N*S;a++)h.mask[a]=0>R[a]||0>Y[a]?0:1;h.updateStatistics();return h};m.clip=z;m.clipTile=function(a){const {pixelBlock:d,tileSize:e,level:n,row:h,col:c,useBilinear:r}=a;if(!l(d))return null;const {width:v,height:B}=e;var H=2**n;a=H*v;H*=B;a=z(d,{y:h*H,x:c*a},{width:a,height:H});if(!a)return null;for(H=n;0<H;H--)a=A(a,r);return a};
m.colorize=function(a,d){if(!l(a)||!d||!d.indexedColormap&&!d.indexed2DColormap)return a;const e=a.clone();var n=e.pixels;let h=e.mask;const c=e.width*e.height;if(1!==n.length)return a;const {indexedColormap:r,indexed2DColormap:v,offset:B,alphaSpecified:H}=d;a=0;n=n[0];d=new Uint8Array(n.length);const J=new Uint8Array(n.length),K=new Uint8Array(n.length);var L=0;if(r){const N=r.length-1;if(null!=h)for(a=0;a<c;a++)h[a]&&(L=4*(n[a]-B),L<B||L>N?h[a]=0:(d[a]=r[L],J[a]=r[L+1],K[a]=r[L+2],h[a]=r[L+3]));
else{h=new Uint8Array(c);for(a=0;a<c;a++)L=4*(n[a]-B),L<B||L>N?h[a]=0:(d[a]=r[L],J[a]=r[L+1],K[a]=r[L+2],h[a]=r[L+3]);e.mask=h}}else if(v)if(null!=h)for(a=0;a<c;a++)h[a]&&(L=v[n[a]],d[a]=L[0],J[a]=L[1],K[a]=L[2],h[a]=L[3]);else{h=new Uint8Array(c);for(a=0;a<c;a++)L=v[n[a]],d[a]=L[0],J[a]=L[1],K[a]=L[2],h[a]=L[3];e.mask=h}e.pixels=[d,J,K];e.statistics=null;e.pixelType="u8";e.maskIsAlpha=H;return e};m.compositeBands=function(a){if(!a?.length||a.some(B=>!l(B)))return null;if(1===a.length)return a[0]?.clone()??
null;const {width:d,height:e,pixelType:n}=a[0];if(a.some(B=>B.width!==d||B.height!==e))return null;const h=a.map(({mask:B})=>B).filter(B=>null!=B);let c=null;h.length&&(c=new Uint8Array(d*e),c.set(h[0]),1<h.length&&F(h.slice(1),c));const r=[];a.forEach(({pixels:B})=>r.push(...B));const v=[];a.map(({statistics:B})=>B).filter(B=>B?.length).forEach(B=>v.push(...B));return new C({pixelType:n,width:d,height:e,mask:c,pixels:r,statistics:v.length?v:null})};m.createColormapLUT=function(a){if(a){var d=a.colormap;
if(d&&0!==d.length){d=d.sort((H,J)=>H[0]-J[0]);var e=0;0>d[0][0]&&(e=d[0][0]);var n=Math.max(256,d[d.length-1][0]-e+1),h=new Uint8Array(4*n),c=[],r=0,v=0,B=5===d[0].length;if(65536<n)return d.forEach(H=>{c[H[0]-e]=B?H.slice(1):H.slice(1).concat([255])}),{indexed2DColormap:c,offset:e,alphaSpecified:B};if(a.fillUnspecified)for(a=d[v],r=a[0]-e;r<n;r++)h[4*r]=a[1],h[4*r+1]=a[2],h[4*r+2]=a[3],h[4*r+3]=B?a[4]:255,r===a[0]-e&&(a=v===d.length-1?a:d[++v]);else for(r=0;r<d.length;r++)a=d[r],v=4*(a[0]-e),h[v]=
a[1],h[v+1]=a[2],h[v+2]=a[3],h[v+3]=B?a[4]:255;return{indexedColormap:h,offset:e,alphaSpecified:B}}}};m.createMaskLUT=function(a,d,e){if("u8"!==a&&"s8"!==a&&"u16"!==a&&"s16"!==a)return null;var n=a.includes("16")?65536:256;a=a.includes("s")?-n/2:0;n=new Uint8Array(n);if(d)for(let c=0;c<d.length;c++){var h=Math.ceil(d[2*c]-a);const r=Math.floor(d[2*c+1]-a);for(;h<=r;h++)n[h]=255}else n.fill(255);if(e)for(d=0;d<e.length;d++)n[e[d]-a]=0;return{lut:n,offset:a}};m.createRemapLUT=function(a){const {srcPixelType:d,
inputRanges:e,outputValues:n,allowUnmatched:h,noDataRanges:c,isLastInputRangeInclusive:r,outputPixelType:v}=a;if("u8"!==d&&"s8"!==d&&"u16"!==d&&"s16"!==d)return null;var B=d.includes("16")?65536:256;a=d.includes("s")?-B/2:0;const H=C.createEmptyBand(v,B);B=new Uint8Array(B);h&&B.fill(255);const [J,K]=k.getPixelValueRange(v);if(e?.length&&n?.length){var L=e.map(R=>R-1E-6);L[0]=e[0];r&&(L[L.length-1]=e[e.length-1]);for(var N=0;N<L.length;N++){var S=n[N]>K?K:n[N]<J?J:n[N],U=Math.ceil(L[2*N]-a);const R=
Math.floor(L[2*N+1]-a);for(;U<=R;U++)H[U]=S,B[U]=255}}if(c?.length)for(L=0;L<c.length;L++)for(S=Math.ceil(c[2*L]-a),N=Math.floor(c[2*L+1]-a);S<=N;S++)B[S]=0;return{lut:H,offset:a,mask:B}};m.extractBands=function(a,d){return d?.length&&l(a)?a.extractBands(d):a};m.getClipBounds=w;m.getLocalArithmeticNorthRotations=function(a,d){const {coefficients:e,spacing:n}=d,{offsets_x:h,offsets_y:c,gridWidth:r}=I(a,a,e,{rows:n[0],cols:n[1]}),{width:v,height:B}=a;a=new Float32Array(v*B);d=180/Math.PI;for(let K=
0;K<B;K++)for(let L=0;L<v;L++){var H=K*r+L,J=0===K?H:H-r;const N=K===B-1?H:H+r;H=h[J]-h[N];J=c[N]-c[J];isNaN(H)||isNaN(J)?a[K*v+L]=90:(J=Math.atan2(J,H)*d,J=(360+J)%360,a[K*v+L]=J)}return a};m.interpolateOffsets=I;m.isValidPixelBlock=l;m.lookupBandValues=y;m.lookupPixels=function(a,d){if(!l(a))return null;const {pixels:e,mask:n}=a,h=e.length;let c=d.lut;const {offset:r}=d;c&&1===c[0].length&&(c=e.map(()=>c));const v=[];d=d.outputPixelType||"u8";for(let B=0;B<h;B++){const H=y(e[B],n,c[B],r||0,d);v.push(H)}a=
new C({width:a.width,height:a.height,pixels:v,mask:n,pixelType:d});a.updateStatistics();return a};m.mask=function(a,d){if(!l(a))return null;const {width:e,height:n,pixels:h}=a;var c=e*n;const r=new Uint8Array(c);a.mask?r.set(a.mask):r.fill(255);a=h.length;const {includedRanges:v,noDataValues:B,outputPixelType:H,matchAll:J,lookups:K}=d;if(K){c=[];for(d=0;d<a;d++){var L=K[d];L=y(h[d],r,L.lut,L.offset||0,"u8");c.push(L)}1===c.length?r.set(c[0]):J?E(c,r):F(c,r)}else if(J){d=[];for(L=0;L<a;L++){const N=
new Uint8Array(c);N.set(r);x(h[L],v?.slice(2*L,2*L+2),B?.[L],N);d.push(N)}1===d.length?r.set(d[0]):E(d,r)}else for(c=0;c<a;c++)x(h[c],v?.slice(2*c,2*c+2),B?.[c],r);return new C({width:e,height:n,pixelType:H,pixels:h,mask:r})};m.maxMapSizeGpu=6;m.mosaic=p;m.mosaicPixelData=function(a,d){if(!a||0===a.length)return null;var e=a.find(K=>K.pixelBlock);if(null==e?.pixelBlock)return null;var n=(e.extent.xmax-e.extent.xmin)/e.pixelBlock.width;const h=(e.extent.ymax-e.extent.ymin)/e.pixelBlock.height,c=.01*
Math.min(n,h),r=a.sort((K,L)=>Math.abs(K.extent.ymax-L.extent.ymax)>c?L.extent.ymax-K.extent.ymax:Math.abs(K.extent.xmin-L.extent.xmin)>c?K.extent.xmin-L.extent.xmin:0);var v=Math.min.apply(null,r.map(K=>K.extent.xmin));const B=Math.min.apply(null,r.map(K=>K.extent.ymin)),H=Math.max.apply(null,r.map(K=>K.extent.xmax)),J=Math.max.apply(null,r.map(K=>K.extent.ymax));a={x:Math.round((d.xmin-v)/n),y:Math.round((J-d.ymax)/h)};v={width:Math.round((H-v)/n),height:Math.round((J-B)/h)};n={width:Math.round((d.xmax-
d.xmin)/n),height:Math.round((d.ymax-d.ymin)/h)};if(Math.round(v.width/e.pixelBlock.width)*Math.round(v.height/e.pixelBlock.height)!==r.length||0>a.x||0>a.y||v.width<n.width||v.height<n.height)return null;e=r.map(K=>K.pixelBlock);e=p(e,v,{clipOffset:a,clipSize:n});return{extent:d,pixelBlock:e}};m.remap=function(a,d){if(!l(a))return null;const {width:e,height:n}=a,{inputRanges:h,outputValues:c,outputPixelType:r,noDataRanges:v,allowUnmatched:B,isLastInputRangeInclusive:H}=d;d=a.pixels[0];const J=C.createEmptyBand(r,
d.length),K=a.mask,L=new Uint8Array(e*n);K?L.set(K):L.fill(255);const N=a.pixelType.startsWith("f")?1E-6:0;a=h.map(aa=>aa-N);a[0]=h[0];a[a.length-1]=h[h.length-1]+(H?1E-6:0);var S=h.length/2;const [U,R]=k.getPixelValueRange(r);for(var Y=0;Y<n;Y++)for(var X=0;X<e;X++){var da=Y*e+X;if(L[da]){var ba=d[da];let aa=!1;for(let ea=S-1;0<=ea;ea--)if(ba===a[2*ea]||ba>a[2*ea]&&ba<a[2*ea+1]){J[da]=c[ea];aa=!0;break}aa||(B?J[da]=ba>R?R:ba<U?U:ba:L[da]=0)}}if(a=v?.length)for(S=0;S<n;S++)for(Y=0;Y<e;Y++)if(X=S*
e+Y,!K||K[X])for(da=d[X],ba=0;ba<a;ba+=2)if(da>=v[ba]&&da<=v[ba+1]){J[X]=0;L[X]=0;break}return new C({width:e,height:n,pixelType:r,pixels:[J],mask:L})};m.remapColor=function(a,d){if(!l(a))return null;a=a.clone();var {pixels:e}=a;const n=a.width*a.height,h=d.length,c=Math.floor(h/2),r=d[Math.floor(c)];e=e[0];let v,B,H,J,K,L,N=!1;const S=new Uint8Array(n),U=new Uint8Array(n),R=new Uint8Array(n);let Y=a.mask;const X=4===d[0].mappedColor.length;Y||(Y=new Uint8Array(n),Y.fill(X?255:1),a.mask=Y);for(K=
0;K<n;K++)if(Y[K]){v=e[K];N=!1;L=c;B=r;H=0;for(J=h-1;1<J-H;){if(v===B.value){N=!0;break}v>B.value?H=L:J=L;L=Math.floor((H+J)/2);B=d[Math.floor(L)]}N||(v===d[H].value?(B=d[H],N=!0):v===d[J].value?(B=d[J],N=!0):v<d[H].value?(N=!1,B=null):v>d[H].value&&(v<d[J].value?(B=d[H],N=!0):J===h-1?(N=!1,B=null):(B=d[J],N=!0)));N?(S[K]=B.mappedColor[0],U[K]=B.mappedColor[1],R[K]=B.mappedColor[2],Y[K]=B.mappedColor[3]):S[K]=U[K]=R[K]=Y[K]=0}a.pixels=[S,U,R];a.mask=Y;a.pixelType="u8";a.maskIsAlpha=X;return a};m.resampleByMajority=
t;m.setValidBoundary=function(a,d,e){if(!l(a))return null;const {width:n,height:h}=a,c=d.x;d=d.y;const r=e.width+c;e=e.height+d;if(0>c||0>d||r>n||e>h||0===c&&0===d&&r===n&&e===h)return a;a.mask||(a.mask=new Uint8Array(n*h));const v=a.mask;for(let B=0;B<h;B++){const H=B*n;for(let J=0;J<n;J++)v[H+J]=B<d||B>=e||J<c||J>=r?0:1}a.updateStatistics();return a};m.split=function(a,d,e=0,n=!0){if(!l(a))return null;const {width:h,height:c}=d;let {width:r,height:v}=a;const B=new Map,H={x:0,y:0};e=1+e;for(let J=
0;J<e;J++){const K=Math.ceil(r/h),L=Math.ceil(v/c);for(let N=0;N<L;N++){H.y=N*c;for(let S=0;S<K;S++){H.x=S*h;const U=z(a,H,d);B.set(`${J}/${N}/${S}`,U)}}J<e-1&&(a=A(a,n));r=Math.round(r/2);v=Math.round(v/2)}return B};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/imagery/RasterVFTileContainer":function(){define("exports ../../../../geometry/support/aaBoundingRect ./BrushVectorField ./RasterVFTile ../webgl/enums ../webgl/TileContainer".split(" "),function(m,C,
k,l,y,x){class E extends x{constructor(){super(...arguments);this.isCustomTilingScheme=!1;this.symbolTypes=["triangle"]}createTile(F){const w=this._tileInfoView.getTileBounds(C.create(),F),[D,p]=this._tileInfoView.tileInfo.size,b=this._tileInfoView.getTileResolution(F.level);return new l.RasterVFTile(F,b,w[0],w[3],D,p)}prepareRenderPasses(F){const w=F.registerRenderPass({name:"imagery (vf tile)",brushes:[k],target:()=>this.children.map(D=>D.tileData),drawPhase:y.WGLDrawPhase.MAP});return[...super.prepareRenderPasses(F),
w]}doRender(F){this.visible&&F.drawPhase===y.WGLDrawPhase.MAP&&this.symbolTypes.forEach(w=>{F.renderPass=w;super.doRender(F)})}}m.RasterVFTileContainer=E;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/imagery/BrushVectorField":function(){define(["../webgl/brushes/WGLBrush","../../../webgl/enums"],function(m,C){const k=new Float32Array([.27058823529411763,.4588235294117647,.7098039215686275,1,.396078431372549,.5372549019607843,.7215686274509804,1,.5176470588235295,
.6196078431372549,.7294117647058823,1,.6352941176470588,.7058823529411765,.7411764705882353,1,.7529411764705882,.8,.7450980392156863,1,.8705882352941177,.8901960784313725,.7490196078431373,1,1,1,.7490196078431373,1,1,.8627450980392157,.6313725490196078,1,.9803921568627451,.7254901960784313,.5176470588235295,1,.9607843137254902,.596078431372549,.4117647058823529,1,.9294117647058824,.4588235294117647,.3176470588235294,1,.9098039215686274,.08235294117647059,.08235294117647059,1]),l=new Float32Array([0,
92/255,230/255,1]),y={beaufort_ft:k,beaufort_m:k,beaufort_km:k,beaufort_mi:k,beaufort_kn:new Float32Array([.1568627450980392,.5725490196078431,.7803921568627451,1,.34901960784313724,.6352941176470588,.7294117647058823,1,.5058823529411764,.7019607843137254,.6705882352941176,1,.6274509803921569,.7607843137254902,.6078431372549019,1,.7490196078431373,.8313725490196079,.5411764705882353,1,.8549019607843137,.9019607843137255,.4666666666666667,1,.9803921568627451,.9803921568627451,.39215686274509803,1,
.9882352941176471,.8352941176470589,.3254901960784314,1,.9882352941176471,.7019607843137254,.4,1,.9803921568627451,.5529411764705883,.20392156862745098,1,.9686274509803922,.43137254901960786,.16470588235294117,1,.9411764705882353,.2784313725490196,.11372549019607843,1]),classified_arrow:new Float32Array([.2196078431372549,.6588235294117647,0,1,.5450980392156862,1.2117647058823529,0,1,1,1,0,1,1,.5019607843137255,0,1,1,0,0,1]),ocean_current_m:new Float32Array([.3058823529411765,.10196078431372549,.6,
1,.7019607843137254,.10588235294117647,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),ocean_current_kn:new Float32Array([0,0,0,1,0,.1450980392156863,.39215686274509803,1,.3058823529411765,.10196078431372549,.6,1,.592156862745098,0,.39215686274509803,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.6941176470588235,.3058823529411765,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,
1,.6941176470588235,.7019607843137254,.20392156862745098,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),simple_scalar:l,single_arrow:l,wind_speed:new Float32Array([0,0,0,1])},x=[0,20];class E extends m{constructor(){super(...arguments);this._desc={magdir:{vsPath:"raster/magdir",fsPath:"raster/magdir",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])},scalar:{vsPath:"raster/scalar",fsPath:"raster/scalar",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])}}}dispose(){}prepareState({context:F}){F.setBlendingEnabled(!0);
F.setBlendFunctionSeparate(C.BlendFactor.ONE,C.BlendFactor.ONE_MINUS_SRC_ALPHA,C.BlendFactor.ONE,C.BlendFactor.ONE_MINUS_SRC_ALPHA);F.setColorMask(!0,!0,!0,!0);F.setStencilWriteMask(0);F.setStencilTestEnabled(!0);F.setStencilOp(C.StencilOperation.KEEP,C.StencilOperation.KEEP,C.StencilOperation.REPLACE)}draw(F,w){if(null!=w.source&&0!==w.source.validPixelCount){var {context:D,timeline:p}=F;p.begin(this.name);D.setStencilFunction(C.CompareFunction.EQUAL,w.stencilRef,255);w.updateVectorFieldVAO(F);if("scalar"===
F.renderPass){var b=w.vaoData.scalar;b&&this._drawScalars(F,w,b.vao,b.elementCount)}else(b=w.vaoData.magdir)&&this._drawTriangles(F,w,b.vao,b.elementCount);p.end(this.name)}}_drawTriangles(F,w,D,p){const {context:b,painter:t,requestRender:q,allowDelayedRender:g}=F,{symbolizerParameters:u}=w;var z=u.dataRange?["dataRange"]:[];"geographic"===u.rotationType&&z.push("rotationGeographic");z=t.materialManager.getProgram(this._desc.magdir,z);if(g&&null!=q&&!z.compiled)q();else{b.useProgram(z);var {coordScale:A,
opacity:I,transforms:a}=w;z.setUniform2fv("u_coordScale",A);z.setUniform1f("u_opacity",I);z.setUniformMatrix3fv("u_dvsMat3",a.displayViewScreenMat3);var {style:d,dataRange:e,rotation:n,symbolPercentRange:h}=u;z.setUniform4fv("u_colors",y[d]);z.setUniform2fv("u_dataRange",e||x);z.setUniform1f("u_rotation",n);z.setUniform2fv("u_symbolPercentRange",h);F=this._getSymbolSize(F,w);z.setUniform2fv("u_symbolSize",F);b.bindVAO(D);b.drawElements(C.PrimitiveType.TRIANGLES,p,C.DataType.UNSIGNED_INT,0)}}_drawScalars(F,
w,D,p){const {context:b,painter:t,requestRender:q,allowDelayedRender:g}=F,{symbolizerParameters:u}=w;var z=[];"wind_speed"===u.style?z.push("innerCircle"):u.dataRange&&z.push("dataRange");"geographic"===u.rotationType&&z.push("rotationGeographic");z=t.materialManager.getProgram(this._desc.scalar,z);if(g&&null!=q&&!z.compiled)q();else{b.useProgram(z);var {coordScale:A,opacity:I,transforms:a}=w;z.setUniform2fv("u_coordScale",A);z.setUniform1f("u_opacity",I);z.setUniformMatrix3fv("u_dvsMat3",a.displayViewScreenMat3);
var {dataRange:d,symbolPercentRange:e}=u;z.setUniform2fv("u_dataRange",d||x);z.setUniform2fv("u_symbolPercentRange",e);F=this._getSymbolSize(F,w);z.setUniform2fv("u_symbolSize",F);b.bindVAO(D);b.drawElements(C.PrimitiveType.TRIANGLES,p,C.DataType.UNSIGNED_INT,0)}}_getSymbolSize(F,w){F=w.key?2**(F.displayLevel-w.key.level):w.resolution/F.state.resolution;const {symbolTileSize:D}=w.symbolizerParameters;return[D/(Math.round((w.width-w.offset[0])/D)*D)/F,D/(Math.round((w.height-w.offset[1])/D)*D)/F]}}
return E})},"esri/views/2d/engine/imagery/RasterVFTile":function(){define(["exports","../../../../core/libs/gl-matrix-2/math/mat3","../../../../core/libs/gl-matrix-2/factories/mat3f32","./RasterVFDisplayObject","../webgl/TiledDisplayObject"],function(m,C,k,l,y){class x extends y.TiledDisplayObject{constructor(E,F,w,D,p,b,t=null){super(E,F,w,D,p,b);this.tileData=new l.RasterVFDisplayObject(t);this.tileData.coordScale=[p,b];this.tileData.once("isReady",()=>this.ready())}destroy(){super.destroy();this.tileData.destroy();
this.stage=this.tileData=null}set stencilRef(E){this.tileData.stencilRef=E}get stencilRef(){return this.tileData.stencilRef}_createTransforms(){return{displayViewScreenMat3:k.create(),tileMat3:k.create()}}setTransform(E){super.setTransform(E);const F=this.resolution/(E.resolution*E.pixelRatio),w=this.transforms.tileMat3,[D,p]=this.tileData.offset,[b,t]=E.toScreenNoRotation([0,0],[this.x+D*this.resolution,this.y-p*this.resolution]),{symbolTileSize:q}=this.tileData.symbolizerParameters;C.set(w,Math.round((this.width-
this.tileData.offset[0])/q)*q/this.rangeX*F,0,0,0,Math.round((this.height-this.tileData.offset[1])/q)*q/this.rangeY*F,0,b,t,1);C.multiply(this.transforms.displayViewScreenMat3,E.displayViewMat3,w);this.tileData.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.tileData.stage=this.stage}onDetach(){this.tileData.stage=null}}m.RasterVFTile=x;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/imagery/RasterVFDisplayObject":function(){define("exports ../../../../core/has ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f32 ../../../../core/libs/gl-matrix-2/factories/vec2f32 ../../../../layers/support/rasterFunctions/vectorFieldUtils ../DisplayObject ../webgl/Utils ../../../webgl/BufferObject ../../../webgl/enums ../../../webgl/VertexArrayObject".split(" "),
function(m,C,k,l,y,x,E,F,w,D,p){class b extends E.DisplayObject{constructor(t=null){super();this._symbolizerParameters=this._source=null;this._vaoInvalidated=!0;this.coordScale=[1,1];this.offset=this.key=this.height=null;this.stencilRef=0;this.resolution=null;this.pixelRatio=1;this.rotation=this.y=this.x=0;this.width=this.vaoData=this.rawPixelData=null;this.source=t}destroy(){null!=this.vaoData&&(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(t){JSON.stringify(this._symbolizerParameters)!==
JSON.stringify(t)&&(this._symbolizerParameters=t,this.invalidateVAO())}get source(){return this._source}set source(t){this._source=t;this.invalidateVAO()}invalidateVAO(){this._vaoInvalidated||null==this.vaoData||(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(t){if(this._vaoInvalidated){this._vaoInvalidated=!1;if(null!=this.source&&null==this.vaoData){var {style:q}=this.symbolizerParameters;
switch(q){case "beaufort_ft":case "beaufort_km":case "beaufort_kn":case "beaufort_m":case "beaufort_mi":case "classified_arrow":case "ocean_current_kn":case "ocean_current_m":case "single_arrow":q=x.createVFMesh(this.source,this.symbolizerParameters);this.vaoData={magdir:this._createVectorFieldVAO(t.context,q)};break;case "simple_scalar":q=x.createVFMeshScalar(this.source,this.symbolizerParameters);this.vaoData={scalar:this._createVectorFieldVAO(t.context,q)};break;case "wind_speed":q=x.createVFMesh(this.source,
this.symbolizerParameters);q=this._createVectorFieldVAO(t.context,q);const g=x.createVFMeshScalar(this.source,this.symbolizerParameters);t=this._createVectorFieldVAO(t.context,g);this.vaoData={magdir:q,scalar:t}}}this.ready();this.requestRender()}}_createTransforms(){return{displayViewScreenMat3:l.create()}}setTransform(t){const q=k.identity(this.transforms.displayViewScreenMat3),[g,u]=t.toScreenNoRotation([0,0],[this.x,this.y]);var z=this.resolution/this.pixelRatio/t.resolution;const A=z*this.width;
z*=this.height;const I=Math.PI*this.rotation/180;k.translate(q,q,y.fromValues(g,u));k.translate(q,q,y.fromValues(A/2,z/2));k.rotate(q,q,-I);k.translate(q,q,y.fromValues(-A/2,-z/2));k.scaleByVec2(q,q,y.fromValues(A,z));k.multiply(this.transforms.displayViewScreenMat3,t.displayViewMat3,q)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(t,q){const {vertexData:g,indexData:u}=q;q=w.BufferObject.createVertex(t,D.Usage.STATIC_DRAW,new Float32Array(g));const z=w.BufferObject.createIndex(t,
D.Usage.STATIC_DRAW,new Uint32Array(u)),A=F.createProgramDescriptor("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:D.DataType.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:D.DataType.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:D.DataType.FLOAT,normalized:!1}]});return{vao:new p.VertexArrayObject(t,A.attributes,A.bufferLayouts,{geometry:q},z),elementCount:u.length}}}m.RasterVFDisplayObject=b;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},
"esri/views/layers/ImageryTileLayerView":function(){define("../../chunks/tslib.es6 ../../Graphic ../../core/Error ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../../layers/support/timeSupport ../../layers/support/rasterFunctions/rasterProjectionHelper ./support/popupUtils".split(" "),function(m,C,k,l,y,x,E,F,w,D,p){return b=>{b=class extends b{constructor(){super(...arguments);this._rasterFieldPrefix=
"Raster.";this.tileInfo=this.view=this.layer=null}get fullExtent(){return this._getfullExtent()}get timeExtent(){return w.combineTimeExtent(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){return D.getDefaultDatumTransformationForDataset(this.layer.fullExtent,this.view.spatialReference,!0)}supportsSpatialReference(t){return!!D.projectDatasetExtent(this.layer.serviceRasterInfo,
t)}async fetchPopupFeaturesAtLocation(t,q){const {layer:g}=this;if(!t)throw new k("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:g});var {popupEnabled:u}=g,z=p.getFetchPopupTemplate(g,q);if(!u||null==z)return[];u=[];const {value:A,magdirValue:I,processedValue:a}=await g.identify(t,{timeExtent:this.timeExtent,signal:q?.signal});q="";if(A?.length){q="imagery-tile"===g.type&&g.hasStandardTime()&&null!=A[0]?A.map(e=>g.getStandardTimeValue(e)).join(", "):A.join(", ");
t={ObjectId:0};t["Raster.ServicePixelValue"]="imagery-tile"===g.type&&"Function"===g.raster.datasetFormat?a?.join(", "):q;t["Raster.ServicePixelValue.Raw"]=q;q=g.raster?.rasterInfo??g.serviceRasterInfo;z=q?.attributeTable;if(null!=z){const {fields:e,features:n}=z,h=e.find(({name:r})=>"value"===r.toLowerCase()),c=t["Raster.ServicePixelValue"];if(z=h?n.find(r=>String(r.attributes[h.name])===c):null)for(var d in z.attributes)z.attributes.hasOwnProperty(d)&&(t[this._rasterFieldPrefix+d]=z.attributes[d])}d=
q?.dataType;if("vector-magdir"===d||"vector-uv"===d)t["Raster.Magnitude"]=I?.[0],t["Raster.Direction"]=I?.[1];d=new C({geometry:this.fullExtent.clone(),attributes:t,layer:g,sourceLayer:g});u.push(d)}return u}_getfullExtent(){return D.projectDatasetExtent(this.layer.serviceRasterInfo,this.view.spatialReference)}};m.__decorate([l.property()],b.prototype,"fullExtent",null);m.__decorate([l.property()],b.prototype,"layer",void 0);m.__decorate([l.property({readOnly:!0})],b.prototype,"timeExtent",null);
m.__decorate([l.property()],b.prototype,"view",void 0);m.__decorate([l.property()],b.prototype,"tileInfo",void 0);m.__decorate([l.property({readOnly:!0})],b.prototype,"hasTilingEffects",null);m.__decorate([l.property()],b.prototype,"datumTransformation",null);return b=m.__decorate([F.subclass("esri.views.layers.ImageryTileLayerView")],b)}})},"esri/layers/support/timeSupport":function(){define(["exports","../../support/timeUtils"],function(m,C){m.combineTimeExtent=function(k,l,y){if(null==k?.timeInfo)return null;
const {datesInUnknownTimezone:x=!1,timeOffset:E,useViewTime:F}=k;k=k.timeExtent;x&&(k=C.toLocalTimeExtent(k));l=F?l&&k?l.intersection(k):l||k:k;if(!l||l.isEmpty||l.isAllTime)return l;E&&(l=l.offset(-E.value,E.unit));x&&(l=C.toUTCTimeExtent(l));return l.equals(y)?y:l};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/support/timeUtils":function(){define("exports ../TimeExtent ../core/arrayUtils ../core/deprecate ../core/lang ../core/Logger ../core/timeUtils ../webmap/utils ../webscene/utils".split(" "),
function(m,C,k,l,y,x,E,F,w){function D(g){return void 0!==g.timeInfo}async function p(g,u){return g.widgets?.timeSlider?.fullTimeExtent??b(g.allLayers,u)}async function b(g,u){if(0===g.length)return C.allTime;await Promise.all(g.map(a=>a.load({signal:u})));var z=g.filter(D),A=g.filter(a=>!D(a)&&null!=a.visibilityTimeExtent);if(0===z.length&&0===A.length)return C.allTime;g=[];const I=[];for(const a of z)"feature"!==a?.type&&"map-image"!==a?.type||!a.timeInfo?.hasLiveData?I.push(a):g.push(a);z=a=>null==
a||a.isAllTime;A=[...I.map(a=>{const d=a.timeInfo?.fullTimeExtent;({visibilityTimeExtent:a}=a);return d?.intersection(a)??a}),...A.map(a=>a.visibilityTimeExtent)];if(A.some(z))return C.allTime;g=g.map(async a=>{const d=(await a.fetchRecomputedExtents({signal:u}))?.timeExtent??a.timeInfo?.fullTimeExtent;({visibilityTimeExtent:a}=a);return d?.intersection(a)??a});g=(await Promise.allSettled(g)).map(a=>"fulfilled"===a.status?a.value:null);if(g.some(z))return C.allTime;g=[...g,...A].filter(k.isSome);
return 0===g.length?C.allTime:g.reduce((a,d)=>a.union(d))}function t(g,u){g=g.currentTimeExtent;if(!g)return null;const {start:z,end:A}=g;g=z??A??null;switch(u){case "time-window":return new C({start:z,end:A});case "cumulative-from-start":return new C({start:null,end:g});case "cumulative-from-end":return new C({start:g,end:null});case "instant":return new C({start:g,end:g})}}async function q(g,u){if(!F.isWebMap(g)&&!w.isWebScene(g))return null;await g.load({signal:u});var z=g?.widgets?.timeSlider;
if(!z)return null;g=await p(g,u);u=z.loop;var A=z.numThumbs??2;var I=z.currentTimeExtent;if(I){const {start:d,end:e}=I;A=null!=d&&null!=e&&d.getTime()===e.getTime()?"instant":2===A?"time-window":null==d||0===d.getTime()?"cumulative-from-start":"cumulative-from-end"}else A=2===A?"time-window":"cumulative-from-start";I=z.stopDelay??2E3;{const {numStops:d,stopInterval:e,stops:n}=z;var a=n?{dates:y.clone(n)}:e?{interval:e.clone()}:{count:d??5}}z=t(z,A);return{fullTimeExtent:g,loop:u,mode:A,playRate:I,
stops:a,timeExtent:z}}m.getTimeExtentFromLayers=b;m.getTimeSliderSettingsFromWebDocument=q;m.getTimeSliderSettingsFromWebMap=async function(g,u){l.deprecatedFunction(x.getLogger("esri.support.timeUtils.getTimeSliderSettingsFromWebMap"),"`timeUtils.getTimeSliderSettingsFromWebMap` is deprecated in favor of 'timeUtils.getTimeSliderSettingsFromWebDocument'",{replacement:"timeUtils.getTimeSliderSettingsFromWebDocument",version:"4.30",see:"https://developers.arcgis.com/javascript/latest/api-reference/esri-support-timeUtils.html#getTimeSliderSettingsFromWebDocument",
warnOnce:!0});return null!=g&&F.isWebMap(g)?await q(g,u):null};m.toLocalTimeExtent=function(g){if(!g)return g;const {start:u,end:z}=g;return new C({start:null!=u?E.offsetDate(u,u.getTimezoneOffset(),"minutes"):u,end:null!=z?E.offsetDate(z,z.getTimezoneOffset(),"minutes"):z})};m.toUTCTimeExtent=function(g){if(!g)return g;const {start:u,end:z}=g;return new C({start:null!=u?E.offsetDate(u,-u.getTimezoneOffset(),"minutes"):u,end:null!=z?E.offsetDate(z,-z.getTimezoneOffset(),"minutes"):z})};Object.defineProperty(m,
Symbol.toStringTag,{value:"Module"})})},"esri/webscene/utils":function(){define(["exports","../support/tagSymbols"],function(m,C){m.isWebScene=function(k){return null!=k&&"object"===typeof k&&C.WebSceneTag in k};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/support/tagSymbols":function(){define(["exports"],function(m){const C=Symbol("WebScene");m.WebSceneTag=C;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/layers/support/popupUtils":function(){define(["exports",
"../../../layers/support/fieldUtils"],function(m,C){function k(l,y){return l.popupTemplate?l.popupTemplate:null!=y&&y.defaultPopupTemplateEnabled&&null!=l.defaultPopupTemplate?l.defaultPopupTemplate:null}m.getFetchPopupTemplate=k;m.getRequiredFields=async function(l,y=l.popupTemplate){if(null==y)return[];const x=await y.getRequiredFields(l.fieldsIndex);({lastEditInfoEnabled:y}=y);const {objectIdField:E,typeIdField:F,globalIdField:w,relationships:D}=l;if(x.includes("*"))return["*"];y=y?C.getFeatureEditFields(l):
[];const p=C.fixFields(l.fieldsIndex,[...x,...y]);F&&p.push(F);p&&E&&l.fieldsIndex?.has(E)&&!p.includes(E)&&p.push(E);p&&w&&l.fieldsIndex?.has(w)&&!p.includes(w)&&p.push(w);D&&D.forEach(b=>{({keyField:b}=b);p&&b&&l.fieldsIndex?.has(b)&&!p.includes(b)&&p.push(b)});return p};m.hasPopupTemplate=function(l,y){return null!=k(l,{defaultPopupTemplateEnabled:y})};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/layers/RefreshableLayerView":function(){define("../../chunks/tslib.es6 ../../core/Logger ../../core/promiseUtils ../../core/reactiveUtils ../../core/has ../../core/RandomLCG ../../core/Error ../../core/accessorSupport/decorators/subclass".split(" "),
function(m,C,k,l,y,x,E,F){return w=>{w=class extends w{initialize(){this.addHandles(l.on(()=>this.layer,"refresh",D=>{this.doRefresh(D.dataChanged).catch(p=>{k.isAbortError(p)||C.getLogger(this).error(p)})}),"RefreshableLayerView")}};return w=m.__decorate([F.subclass("esri.views.layers.RefreshableLayerView")],w)}})},"*noref":1}});
define("../../../chunks/tslib.es6 ../../../core/Logger ../../../core/promiseUtils ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../layers/support/rasterDatasets/multidimensionalUtils ../engine/flow/FlowView2D ./LayerView2D ./imagery/ImageryTileView2D ./imagery/VectorFieldTileView2D ./support/util ../../layers/ImageryTileLayerView ../../layers/LayerView ../../layers/RefreshableLayerView".split(" "),function(m,
C,k,l,y,x,E,F,w,D,p,b,t,q,g,u,z){x=class extends g(z(p.LayerView2DMixin(u))){constructor(){super(...arguments);this._useProgressiveUpdate=this._useWebGLForProcessing=!0;this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(A){this._useWebGLForProcessing=A;this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=A)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(A){this._useProgressiveUpdate=
A;this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=A)}get displayParameters(){const {layer:A}=this,I=this._get("displayParameters");return A.renderer?{bandIds:A.bandIds,renderer:A.renderer,interpolation:A.interpolation,multidimensionalDefinition:A.multidimensionalDefinition,rasterFunction:"imagery-tile"===A.type?A.rasterFunction:null}:I}update(A){this.subview?.update(A);this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage();
this._updateSubview();this.addAttachHandles([l.watch(()=>this.displayParameters,(A,I)=>{const a=A.interpolation!==I?.interpolation&&("majority"===A.interpolation||"majority"===I?.interpolation)&&q.canUseMajorityInterpolationOnDataSource(this.layer),d=A.renderer!==I?.renderer&&this._getSubviewType(I?.renderer)!==this._getSubviewType(A.renderer);d&&this._updateSubview();const e=A.rasterFunction!==I?.rasterFunction,n=e&&!this._useWebGLForProcessing;this.subview.redrawOrRefetch({refetch:A.multidimensionalDefinition!==
I?.multidimensionalDefinition||a||d||n,reprocess:e}).catch(h=>{k.isAbortError(h)||C.getLogger(this).error(h)});this.notifyChange("updating")}),l.watch(()=>this.layer.multidimensionalSubset??null,(A,I)=>{const {multidimensionalDefinition:a}=this.layer;null!=a&&w.hasExcludedVariableOrDimension(a,A)!==w.hasExcludedVariableOrDimension(a,I)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(d=>{k.isAbortError(d)||C.getLogger(this).error(d)}),this.notifyChange("updating"))},l.sync),l.watch(()=>this.timeExtent,
()=>{this.subview.timeExtent=this.timeExtent;this.subview.redrawOrRefetch({refetch:!0}).catch(A=>{k.isAbortError(A)||C.getLogger(this).error(A)})},l.initial)])}detach(){this.layer.decreaseRasterJobHandlerUsage();this._detachSubview(this.subview);this.subview?.destroy();this.subview=null}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){var {renderer:A}=this.layer;if(A){A=this._getSubviewType(A);
if(this.subview){if(this.subview.type===A){this._attachSubview(this.subview);return}this._detachSubview(this.subview);this.subview?.destroy();this.subview=null}var {layer:I}=this;A="rasterVF"===A?new t({layer:I,layerView:this}):"flow"===A?new D({layer:I,layerView:this}):new b({layer:I,layerView:this});"useWebGLForProcessing"in A&&(A.useWebGLForProcessing=this._useWebGLForProcessing);"useProgressiveUpdate"in A&&(A.useProgressiveUpdate=this._useProgressiveUpdate);"previousLOD"in A&&({subview:I}=this,
A.previousLOD=I&&"previousLOD"in I?I.previousLOD:null);this._attachSubview(A);this.subview=A;this.requestUpdate()}}_attachSubview(A){A&&!A.attached&&(A.attach(),A.attached=!0,this.container.addChildAt(A.container,0))}_detachSubview(A){A?.attached&&(this.container.removeChild(A.container),A.detach(),A.attached=!1)}_getSubviewType(A){A=A?.type;return"vector-field"===A?"rasterVF":"flow"===A?"flow":"raster"}};m.__decorate([y.property()],x.prototype,"subview",void 0);m.__decorate([y.property()],x.prototype,
"useWebGLForProcessing",null);m.__decorate([y.property()],x.prototype,"useProgressiveUpdate",null);m.__decorate([y.property({readOnly:!0})],x.prototype,"displayParameters",null);return x=m.__decorate([F.subclass("esri.views.2d.layers.ImageryTileLayerView2D")],x)});