// 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/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,H,B,v,I,L,U,D,R,T,M,t,A){B=class extends B{constructor(){super(...arguments); this._loadImagery=(J,q,r,p,y)=>M.loadImagery(this.layer,J,q,r,p,y);this._createFlowMesh=(J,q,r,p)=>this.layer.createFlowMesh({meshType:J,flowData:r,simulationSettings:q},{signal:p});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:J}=this,q=()=>{this._loadImagery=(r,p,y,Q,a)=>M.loadImagery(J,r,p,y,Q,a);this._updateVisualization()};"multidimensionalDefinition"in J?this.addHandles(v.watch(()=>J.multidimensionalDefinition,q)):this.addHandles([v.watch(()=>J.mosaicRule,q),v.watch(()=>J.rasterFunction,q),v.watch(()=>J.definitionExpression,q)]);this.container=new t;this._strategy=new A({flowContainer:this.container});this._updateVisualization()}detach(){this._strategy.destroy();this.container?.removeAllChildren();this.container=null;this.removeHandles()}update(J){J.stationary?this._strategy.update(J):this.layerView.requestUpdate()}hitTest(J){return new H({attributes:{}, geometry:J.clone(),layer:this.layer})}moveEnd(){}async doRefresh(){}_updateVisualization(){var J=this.layer.renderer;null!=J&&"flow"===J.type&&(J=T(J,{loadImagery:this._loadImagery,createFlowMesh:this._createFlowMesh,timeExtent:this.timeExtent}),this.container.flowStyle=J,this.layerView.requestUpdate())}};m.__decorate([I.property()],B.prototype,"_strategy",void 0);m.__decorate([I.property()],B.prototype,"attached",void 0);m.__decorate([I.property()],B.prototype,"container",void 0);m.__decorate([I.property()], B.prototype,"layer",void 0);m.__decorate([I.property()],B.prototype,"layerView",void 0);m.__decorate([I.property()],B.prototype,"type",void 0);m.__decorate([I.property()],B.prototype,"updating",null);m.__decorate([I.property()],B.prototype,"timeExtent",void 0);return B=m.__decorate([R.subclass("esri.views.2d.engine.flow.FlowView2D")],B)})},"esri/views/2d/engine/flow/createFlowStyle":function(){define(["./utils","./styles/Imagery","./styles/Particles","./styles/Stack","./styles/Streamlines"],function(m, H,B,v,I){return function(L,U){const {flowSpeed:D,trailLength:R}=L,T=m.getFlowSimulationSettings(L);let M=null;const t={opacity:m.getOpacity(L),size:m.getSize(L)};let A=m.getColor(L);"none"===L.background?t.color=A:("constant"===A.kind&&(A={kind:"ramp",stops:[0,1],values:[0,0,0,1,A.value[0],A.value[1],A.value[2],A.value[3]],count:2}),M=new H.Imagery({loadImagery:U.loadImagery,timeExtent:U.timeExtent,color:A,opacity:{kind:"constant",value:[1]}}),t.color=m.getForegroundColor());U={loadImagery:U.loadImagery, createFlowMesh:U.createFlowMesh,simulationSettings:T,timeExtent:U.timeExtent,trailLength:R,flowSpeed:D,featheringSize:1,featheringOffset:.5,introFade:!0,fadeToZero:!0,decayRate:2.3,color:t.color,opacity:t.opacity,size:t.size};L="butt"===L.trailCap||4>=m.getMax(m.getSize(L))?new I(U):new B.Particles(U);return null!=M?new v.Stack([M,L]):L}})},"esri/views/2d/engine/flow/utils":function(){define(["exports","../../../../core/screenUtils"],function(m,H){function B(D){return"constant"===D.kind?D.value[0]: D.values[D.values.length-1]}function v(D){D=D.toRgba();return[D[0]/255,D[1]/255,D[2]/255,D[3]]}function I(D){if(!D.hasVisualVariables("size"))return{kind:"constant",value:[H.pt2px(D.trailWidth)]};const R=D.getVisualVariablesForType("size")[0];D=[];const T=[];if(R.stops){for(M of R.stops)D.push(M.value),T.push(H.pt2px(M.size));var M=R.stops.length}else D.push(R.minDataValue,R.maxDataValue),T.push(H.pt2px(R.minSize),H.pt2px(R.maxSize)),M=2;return{kind:"ramp",stops:D,values:T,count:M}}function L(D,R, T,M){switch(R){case "int":D.setUniform1iv(T,M);break;case "float":D.setUniform1fv(T,M);break;case "vec2":D.setUniform2fv(T,M);break;case "vec3":D.setUniform3fv(T,M);break;case "vec4":D.setUniform4fv(T,M)}}function U(D,R){return D===R?!0:null!=D&&null!=R?D.equals(R):!1}m.areStreamlinesCompatible=function(D,R){var T=D.simulationSettings,M=R.simulationSettings;let t;t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=T.collisions===M.collisions)&&T.density===M.density)&&T.interpolate===M.interpolate)&&T.lineCollisionWidth=== M.lineCollisionWidth)&&T.lineSpacing===M.lineSpacing)&&T.maxTurnAngle===M.maxTurnAngle)&&T.minSpeedThreshold===M.minSpeedThreshold)&&T.segmentLength===M.segmentLength)&&T.smoothing===M.smoothing)&&T.velocityScale===M.velocityScale)&&T.verticesPerLine===M.verticesPerLine;return t&&U(D.timeExtent,R.timeExtent)?T=(T=(T=(T=(T=D.loadImagery===R.loadImagery)&&D.createFlowMesh===R.createFlowMesh)&&D.color.kind===R.color.kind)&&D.opacity.kind===R.opacity.kind)&&D.size.kind===R.size.kind:!1};m.getColor=function(D){if(!D.hasVisualVariables("color"))return{kind:"constant", value:v(D.color)};D=D.getVisualVariablesForType("color")[0];const R=[],T=[];for(const M of D.stops)R.push(M.value),Array.prototype.push.apply(T,v(M.color));return{kind:"ramp",stops:R,values:T,count:D.stops.length}};m.getFlowSimulationSettings=function(D){var R=I(D);R=B(R);const T=Math.max(R/2,5),M=Math.round(H.pt2px(D.maxPathLength)/T)+1,{density:t}=D;return{smoothing:H.pt2px(D.smoothing),interpolate:!0,velocityScale:"flow-from"===D.flowRepresentation?1:-1,verticesPerLine:M,minSpeedThreshold:.001, segmentLength:T,maxTurnAngle:1,collisions:!0,lineCollisionWidth:R,lineSpacing:10,density:t}};m.getForegroundColor=function(D){return{kind:"constant",value:[.1,.1,.1,1]}};m.getMax=B;m.getOpacity=function(D){if(!D.hasVisualVariables("opacity"))return{kind:"constant",value:[1]};D=D.getVisualVariablesForType("opacity")[0];const R=[],T=[];for(const M of D.stops)R.push(M.value),T.push(M.opacity);return{kind:"ramp",stops:R,values:T,count:D.stops.length}};m.getSize=I;m.setUniform=L;m.setUniforms=function(D, R,T,M){"constant"===M.kind?L(D,T,`u_${R}`,M.value):(L(D,"float",`u_${R}_stops`,M.stops),L(D,T,`u_${R}_values`,M.values),D.setUniform1i(`u_${R}_count`,M.count))};m.timeExtentsEqual=U;m.toRgba=v;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,H,B,v,I,L,U,D,R){class T{constructor(q){this._params=q;this.animated=!1}isCompatible(q){if(!(q instanceof T&&B.timeExtentsEqual(this._params.timeExtent,q._params.timeExtent)))return!1;let r;return r=(r=(r=this._params.loadImagery===q._params.loadImagery)&&this._params.color.kind===q._params.color.kind)&&this._params.opacity.kind===q._params.opacity.kind}async load(q,r){const {extent:p,size:y}=q;H.throwIfAborted(r);q=await this._params.loadImagery(p,y[0],y[1],this._params.timeExtent,r); return new J(q,{color:this._params.color,opacity:this._params.opacity})}render(q,r,p){({context:q}=q);const {program:y}=p;q.setFaceCullingEnabled(!1);q.setBlendingEnabled(!0);q.setBlendFunction(I.BlendFactor.ONE,I.BlendFactor.ONE_MINUS_SRC_ALPHA);q.useProgram(y);y.setUniformMatrix3fv("u_dvsMat3",r.dvsMat3);q.bindTexture(p.texture,0);y.setUniform1i("u_texture",0);y.setUniform1f("u_Min",p.min);y.setUniform1f("u_Max",p.max);B.setUniforms(y,"color","vec4",this._params.color);B.setUniforms(y,"opacity", "float",this._params.opacity);q.bindVAO(p.vertexArray);q.drawArrays(I.PrimitiveType.TRIANGLE_STRIP,0,4)}}const M=new Map;M.set("a_position",0);M.set("a_texcoord",1);const t={geometry:[new R.VertexElementDescriptor("a_position",2,I.DataType.UNSIGNED_SHORT,0,8),new R.VertexElementDescriptor("a_texcoord",2,I.DataType.UNSIGNED_SHORT,4,8)]},A={vsPath:"raster/flow/imagery",fsPath:"raster/flow/imagery",attributes:M};class J{constructor(q,r){this._flowData=q;this._values=r}attach(q){var {context:r}=q;const {width:p, height:y}=this._flowData;var Q={geometry:v.BufferObject.createVertex(r,I.Usage.STATIC_DRAW,new Uint16Array([0,0,0,1,p,0,1,1,0,y,0,0,p,y,1,0]))};Q=new D.VertexArrayObject(r,M,t,Q);var a=[];"ramp"===this._values.color.kind&&a.push("vvColor");"ramp"===this._values.opacity.kind&&a.push("vvOpacity");q=q.painter.materialManager.getProgram(A,a);a=1E6;let b=-1E6;for(var d=0;dv||I.animated,!1)}isCompatible(v){if(!(v instanceof H)||this._styles.length!== v._styles.length)return!1;const I=this._styles.length;for(let L=0;LU.load(v,I)));return new B(L)}render(v,I,L){for(let U=0;Uv&&I.ready,!0)}}m.Stack=H;m.StackResources=B;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,H,B,v,I,L){class U{constructor(t){this._params=t}get animated(){return 0{const f=Math.floor(g),h=Math.floor(e);if(0>f||f>=b.width||0>h|| h>=b.height)return[0,0];g-=f;e-=h;const k=f{g=Math.round(g);e=Math.round(e);return 0>g||g>=b.width||0>e||e>=b.height?[0,0]:[d[2*(e*b.width+g)],d[2*(e*b.width+g)+1]]}}function M(a,b,d,g,e,f,h,k,n){const u=[];let x=0,[w,C]=b(d,g);w*= a.velocityScale;C*=a.velocityScale;u.push({x:d,y:g,t:x,speed:Math.sqrt(w*w+C*C)});for(let S=0;Sa.maxTurnAngle)break;if(a.collisions){var E=Math.round(d*n);var O=Math.round(g*n);if(0>E||E>h-1||0>O||O>k-1)break;const aa=f[O*h+E];if(-1!==aa&&aa!==e)break;f[O* h+E]=e}u.push({x:d,y:g,t:x,speed:X});E=da;O=ba}return u}function t(a,b,d,g){const e=[],f=new U,h=1/Math.max(a.lineCollisionWidth,1),k=Math.round(d*h),n=Math.round(g*h),u=new Int32Array(k*n);for(var x=0;xw.sort-C.sort);for(const {x:w,y:C}of x)f.getFloat()d.length||e.push(d));return e}function A(a,b,d,g){if(0===g)return a; const e=Math.round(3*g),f=Array(2*e+1);var h=0;for(var k=-e;k<=e;k++){var n=Math.exp(-k*k/(g*g));f[k+e]=n;h+=n}for(g=-e;g<=e;g++)f[g+e]/=h;h=new Float32Array(a.length);for(g=0;gk+x||k+x>=b)){var w=f[x+e];n+=w*a[2*(g*b+(k+x))];u+=w*a[2*(g*b+(k+x))+1]}h[2*(g*b+k)]=n;h[2*(g*b+k)+1]=u}a=new Float32Array(a.length);for(g=0;gk+x||k+x>=d||(w=f[x+e],n+=w*h[2*((k+x)*b+g)],u+=w*h[2*((k+x)*b+g)+1]); a[2*(k*b+g)]=n;a[2*(k*b+g)+1]=u}return a}function J(a,b){const d=new U;var g=a.reduce((k,n)=>k+n.length,0);g=new Float32Array(4*g);const e=Array(a.length);let f=0,h=0;for(const k of a){a=f;for(const n of k)g[4*f]=n.x,g[4*f+1]=n.y,g[4*f+2]=n.t,g[4*f+3]=n.speed,f++;e[h++]={startVertex:a,numberOfVertices:k.length,totalTime:k[k.length-1].t,timeSeed:b?d.getFloat():0}}return{lineVertices:g,lineDescriptors:e}}function q(a,b){function d(E,O,S,N,Y,X,da,ba){const aa=9*n;let ea=0;k[aa+ea++]=E;k[aa+ea++]=O;k[aa+ ea++]=1;k[aa+ea++]=S;k[aa+ea++]=X;k[aa+ea++]=da;k[aa+ea++]=N/2;k[aa+ea++]=Y/2;k[aa+ea++]=ba;n++;k[aa+ea++]=E;k[aa+ea++]=O;k[aa+ea++]=-1;k[aa+ea++]=S;k[aa+ea++]=X;k[aa+ea++]=da;k[aa+ea++]=-N/2;k[aa+ea++]=-Y/2;k[aa+ea++]=ba;n++}const {lineVertices:g,lineDescriptors:e}=a;var f=a=0;for(var h of e)a+=2*h.numberOfVertices,f+=6*(h.numberOfVertices-1);const k=new Float32Array(9*a);h=new Uint32Array(f);let n=0;a=0;for(const E of e){const {totalTime:O,timeSeed:S}=E;let N=f=null,Y=null;var u=null,x=null,w=null; for(let X=0;Xv.getLogger("esri.views.2d.engine.flow.dataUtils");m.createAnimatedLinesData=J;m.createFlowMesh=async function(a, b,d,g){const e=performance.now();var f=T(b,d);const h=performance.now();d=t(b,f,d.width,d.height);b=performance.now();f=J(d,!0);d=performance.now();a="Streamlines"===a?q(f,10):r(f);f=performance.now();B("esri-2d-profiler")&&(Q().info("I.1","_createFlowFieldFromData (ms)",Math.round(h-e)),Q().info("I.2","_getStreamlines (ms)",Math.round(b-h)),Q().info("I.3","createAnimatedLinesData (ms)",Math.round(d-b)),Q().info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(f-d)),Q().info("I.5","createFlowMesh (ms)", Math.round(f-e)),Q().info("I.6","Mesh size (bytes)",a.vertexData.buffer.byteLength+a.indexData.buffer.byteLength));await Promise.resolve();L.throwIfAborted(g);return a};m.createParticlesMesh=r;m.createStreamlinesMesh=q;m.loadImagery=async function(a,b,d,g,e,f){const h=performance.now();var k=D.getInfo(b.spatialReference);if(!k)return d=await y(a,b,d,g,e,f),B("esri-2d-profiler")&&Q().info("I.7","loadImagery, early exit (ms)",Math.round(performance.now()-h)),B("esri-2d-profiler")&&Q().info("I.9","Number of parts", 1),d;const [n,u]=k.valid,x=Math.ceil(b.width/(u-n)),w=b.width/x,C=Math.round(d/x);let E=b.xmin;const O=[];k=performance.now();for(let S=0;S=d||(g.data[2*(a*d+b+e)]=S.data[2*(a*S.width+e)],g.data[2*(a*d+b+e)+1]=S.data[2*(a*S.width+e)+1],g.mask[a*d+b+e]=S.mask[a*S.width+e]);b+=S.width}B("esri-2d-profiler")&&Q().info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-h));return g};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/flow/FlowContainer":function(){define(["./BrushFlow","../webgl/enums", "../webgl/WGLContainer"],function(m,H,B){class v extends B{constructor(){super(...arguments);this.flowStyle=null}doRender(I){super.doRender(I)}prepareRenderPasses(I){const L=I.registerRenderPass({name:"flow",brushes:[m],target:()=>this.children,drawPhase:H.WGLDrawPhase.MAP});return[...super.prepareRenderPasses(I),L]}}return v})},"esri/views/2d/engine/flow/BrushFlow":function(){define(["../../../../core/libs/gl-matrix-2/factories/mat3f32","../webgl/brushes/WGLBrush","../../../webgl/enums"],function(m, H,B){class v extends H{constructor(){super(...arguments);this._visualState={time:0,dvsMat3:m.create(),displayViewMat3:m.create()}}dispose(){}prepareState(I){({context:I}=I);I.setColorMask(!0,!0,!0,!0);I.setStencilFunction(B.CompareFunction.EQUAL,0,255)}draw(I,L){const {requestRender:U,allowDelayedRender:D}=I,{displayData:R}=L;if(null!=R&&("loaded"===R.state.name&&R.attach(I),"attached"===R.state.name)){var T=R.state.resources;D&&!T.ready&&null!=U?U():(this._visualState.time=I.time/1E3,this._visualState.dvsMat3= L.transforms.displayViewScreenMat3,this._visualState.displayViewMat3=I.state.displayViewMat3,R.flowStyle.render(I,this._visualState,T),R.flowStyle.animated&&null!=U&&U())}}}return v})},"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,H,B,v,I,L,U,D,R,T,M,t,A,J){function q(r,p){const y=new M({x:(r.xmax+r.xmin)/2,y:(r.ymax+r.ymin)/2,spatialReference:r.spatialReference});var Q=r.xmax-r.xmin;const a=r.ymax-r.ymin,b=Math.abs(Math.cos(I.deg2rad(p))),d=Math.abs(Math.sin(I.deg2rad(p)));p=b*Q+d*a;Q=d*Q+b*a;r=new J({xmin:y.x-p/2,ymin:y.y-Q/2,xmax:y.x+p/2,ymax:y.y+Q/2,spatialReference:r.spatialReference});r.centerAt(y);return r}H=class extends B{constructor(r){super(r);this._flowDisplayObject=new A.FlowDisplayObject;this._loading= null}initialize(){this.flowContainer.addChild(this._flowDisplayObject)}destroy(){this._clear();this.flowContainer.removeAllChildren()}get updating(){return null!=this._loading}update(r){var {flowStyle:p}=this.flowContainer;if(null==p)this._clear();else{var {extent:y,rotation:Q,resolution:a,pixelRatio:b}=r.state;r=q(y,Q);r.expand(1.15);p=new t(p,r,[Math.round((r.xmax-r.xmin)/a),Math.round((r.ymax-r.ymin)/a)],b);if(null!=this._loading){if(this._loading.update(p))return;this._loading.detach();this._loading= null}null!=this._flowDisplayObject.displayData&&this._flowDisplayObject.displayData.update(p)||(p.load().then(()=>{this._flowDisplayObject.clear();this._flowDisplayObject.displayData=this._loading;this._loading=null},d=>{L.isAbortError(d)||(v.getLogger(this).error("A resource failed to load.",d),this._loading=null)}),this._loading=p)}}_clear(){this._flowDisplayObject.clear();null!=this._loading&&(this._loading.detach(),this._loading=null)}};m.__decorate([U.property()],H.prototype,"_loading",void 0); m.__decorate([U.property()],H.prototype,"flowContainer",void 0);m.__decorate([U.property()],H.prototype,"updating",null);return H=m.__decorate([T.subclass("esri.views.2d.engine.flow.FlowStrategy")],H)})},"esri/views/2d/engine/flow/FlowDisplayData":function(){define(["../../../../core/Logger"],function(m){class H{constructor(B,v,I,L){this.state={name:"created"};this.flowStyle=B;this.extent=v;this.size=I;this.pixelRatio=L}async load(){const B=new AbortController;this.state={name:"loading",abortController:B}; this.state={name:"loaded",resources:await this.flowStyle.load({extent:this.extent,size:this.size,pixelRatio:this.pixelRatio},B.signal)}}attach(B){if("loaded"!==this.state.name)m.getLogger("esri.views.2d.engine.flow.FlowDisplayData").error("Only loaded resources can be attached.");else{var v=this.state.resources;v.attach(B);this.state={name:"attached",resources:v}}}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(B){if(!this.flowStyle.isCompatible(B.flowStyle)||!this.extent.equals(B.extent)||this.size[0]!==B.size[0]||this.size[1]!==B.size[1]||this.pixelRatio!==B.pixelRatio)return!1;this.flowStyle=B.flowStyle;return!0}}return H})},"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,H,B,v,I){class L extends I.DisplayObject{constructor(){super(...arguments); this._displayData=null}get displayData(){return this._displayData}set displayData(U){this._displayData=U;this.requestRender()}clear(){null!=this._displayData&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(U){var {displayData:D}=this;if(null!=D){var R=[0,0];U.toScreen(R,[D.extent.xmin,D.extent.ymax]);D=(D.extent.xmax-D.extent.xmin)/D.size[0]/U.resolution;var T=H.deg2rad(U.rotation),{displayViewScreenMat3:M}=this.transforms;B.fromTranslation(M,[-1,1,0]);B.scale(M, M,[2/(U.size[0]*U.pixelRatio),-2/(U.size[1]*U.pixelRatio),1]);B.translate(M,M,[R[0],R[1],0]);B.rotate(M,M,T);B.scale(M,M,[D*U.pixelRatio,D*U.pixelRatio,1])}}_createTransforms(){return{displayViewScreenMat3:v.create()}}}m.FlowDisplayObject=L;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,H,B,v,I,L,U,D,R,T,M,t,A,J,q,r,p){const y=B.ofType({key:"type",base:null,typeMap:{rect:J,path:r,geometry:q}});m.LayerView2DMixin=Q=>{Q=class extends Q{constructor(){super(...arguments);this.attached=!1;this.clips=new y;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 I("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 t.Container),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([L.watch(()=>this.suspended,b=>{this.container&&(this.container.visible=!b)},L.syncAndInitial),L.watch(()=>this.updateSuspended,b=>{this.view&&!b&&this.updateRequested&&this.view.requestUpdate()},L.syncAndInitial),L.watch(()=>this.layer?.opacity?? 1,b=>{this.container&&(this.container.opacity=b)},L.syncAndInitial),L.watch(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",b=>{this.container&&(this.container.blendMode=b)},L.syncAndInitial),L.watch(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,b=>{this.container&&(this.container.effect=b)},L.syncAndInitial),L.watch(()=>this.highlightOptions,b=>this.container.highlightOptions=b,L.syncAndInitial),L.on(()=>this.clips,"change",()=>{this.container&&(this.container.clips= this.clips)},L.syncAndInitial),L.watch(()=>({scale:this.view?.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}),({scale:b,scaleRange:d})=>{b=p.isInEffectiveScaleRange(d,b);b!==this._visibleAtCurrentScale&&(this._visibleAtCurrentScale=b)},L.syncAndInitial)],"constructor"),this.view?.whenLayerView?this.view.whenLayerView(this.layer).then(b=>{b===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,b){return Promise.resolve(null)}supportsSpatialReference(a){return!0}canResume(){return this.spatialReferenceSupported? super.canResume()?this.visibleAtCurrentScale:!1:!1}getSuspendInfo(){const a=super.getSuspendInfo(),b=!this.spatialReferenceSupported;b&&(a.spatialReferenceNotSupported=b);return a}addAttachHandles(a){this.addHandles(a,"attach")}};H.__decorate([U.property()],Q.prototype,"attached",void 0);H.__decorate([U.property({type:y,set(a){a=v.referenceSetter(a,this._get("clips"),y);this._set("clips",a)}})],Q.prototype,"clips",void 0);H.__decorate([U.property()],Q.prototype,"container",void 0);H.__decorate([U.property({type:A})], Q.prototype,"highlightOptions",void 0);H.__decorate([U.property()],Q.prototype,"moving",void 0);H.__decorate([U.property({readOnly:!0})],Q.prototype,"spatialReferenceSupported",null);H.__decorate([U.property({readOnly:!0})],Q.prototype,"updateParameters",void 0);H.__decorate([U.property()],Q.prototype,"updateRequested",void 0);H.__decorate([U.property()],Q.prototype,"updating",null);H.__decorate([U.property()],Q.prototype,"view",void 0);H.__decorate([U.property()],Q.prototype,"_visibleAtCurrentScale", void 0);H.__decorate([U.property({readOnly:!0})],Q.prototype,"visibleAtCurrentScale",null);return Q=H.__decorate([M.subclass("esri.views.2d.layers.LayerView2D")],Q)};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, H,B,v,I,L,U){var D;B=D=class extends U{constructor(R){super(R);this.type="rect";this.bottom=this.top=this.right=this.left=null}clone(){return new D({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([H.property({type:[Number,String],json:{write:!0}})],B.prototype,"left",void 0);m.__decorate([H.property({type:[Number,String],json:{write:!0}})], B.prototype,"right",void 0);m.__decorate([H.property({type:[Number,String],json:{write:!0}})],B.prototype,"top",void 0);m.__decorate([H.property({type:[Number,String],json:{write:!0}})],B.prototype,"bottom",void 0);return B=D=m.__decorate([L.subclass("esri.views.layers.support.ClipRect")],B)})},"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,H,B,v,I,L,U){H=class extends H.JSONSupport{get version(){this.commitVersionProperties();return(this._get("version")||0)+1}};m.__decorate([B.property({readOnly:!0})],H.prototype,"version",null);return H=m.__decorate([U.subclass("esri.views.layers.support.ClipArea")],H)})},"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,H,B,v,I,L,U,D,R,T,M,t){var A;H={base:D,key:"type",typeMap:{extent:M,polygon:t}};T=A=class extends T{constructor(J){super(J);this.type="geometry";this.geometry=null}clone(){return new A({geometry:this.geometry?.clone()??null})}commitVersionProperties(){this.commitProperty("geometry")}};m.__decorate([B.property({types:H,json:{read:R.fromJSON,write:!0}})],T.prototype,"geometry",void 0);return T=A=m.__decorate([U.subclass("esri.views.layers.support.Geometry")],T)})},"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,H,B,v,I,L,U){B=class extends U{constructor(D){super(D);this.type="path";this.path=[]}commitVersionProperties(){this.commitProperty("path")}};m.__decorate([H.property({type:[[[Number]]],json:{write:!0}})],B.prototype,"path",void 0);return B=m.__decorate([L.subclass("esri.views.layers.support.Path")],B)})},"esri/views/2d/layers/graphics/HighlightGraphicContainer":function(){define("../../../../chunks/tslib.es6 ../../../../core/Logger ../../../../core/has ../../../../core/RandomLCG ../../../../core/Error ../../../../core/accessorSupport/decorators/subclass ../../engine/webgl/enums ./AGraphicContainer ../support/util".split(" "), function(m,H,B,v,I,L,U,D,R){H=class extends D.AGraphicContainer{get hasHighlight(){return this.children.some(T=>T.hasData)}renderChildren(T){this.attributeView.update();T.drawPhase===U.WGLDrawPhase.HIGHLIGHT&&this.children.some(M=>M.hasData)&&(super.renderChildren(T),T.context.setColorMask(!0,!0,!0,!0),R.renderHighlight(T,!0,M=>{this._renderChildren(M,U.FeatureSelection.All)}))}};return H=m.__decorate([L.subclass("esri.views.2d.layers.graphics.HighlightGraphicContainer")],H)})},"esri/views/2d/layers/imagery/ImageryView2D":function(){define("../../../../chunks/tslib.es6 ../../../../Graphic ../../../../core/Accessor ../../../../core/Logger ../../../../core/promiseUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../layers/support/rasterFunctions/pixelUtils ../../engine/BitmapContainer ../../engine/Container ../../engine/ImageryBitmapSource ../support/ExportStrategy".split(" "), function(m,H,B,v,I,L,U,D,R,T,M,t,A,J){B=class extends B{constructor(){super(...arguments);this.attached=!1;this.container=new t.Container;this.updateRequested=!1;this.type="imagery";this._bitmapView=new M.BitmapContainer}destroy(){this.attached&&(this.detach(),this.attached=!1);this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(q){this.strategy.update(q).catch(r=>{I.isAbortError(r)||v.getLogger(this).error(r)})}hitTest(q){return new H({attributes:{},geometry:q.clone(), layer:this.layer})}attach(){this.container.addChild(this._bitmapView);this.strategy=new J({container:this._bitmapView,imageNormalizationSupported:10<=this.layer.version,imageMaxHeight:10.1<=this.layer.version?this.layer.imageMaxHeight:2048,imageMaxWidth:10.1<=this.layer.version?this.layer.imageMaxWidth:2048,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy();this._bitmapView.removeAllChildren();this.container.removeAllChildren();this.updateRequested= !1}redraw(){this.strategy.updateExports(async q=>{const {source:r}=q;if(r&&!(r instanceof ImageBitmap)){var p=await this.layer.applyRenderer({extent:r.extent,pixelBlock:r.originalPixelBlock??r.pixelBlock});r.filter=y=>this.layer.pixelFilter?this.layer.applyFilter(y):{...p,extent:r.extent}}}).catch(q=>{I.isAbortError(q)||v.getLogger(this).error(q)})}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null; var q=this.strategy.bitmaps;if(1===q.length&&q[0].source)return{extent:q[0].source.extent,pixelBlock:q[0].source.originalPixelBlock};if(1p.source).filter(p=>p.extent&&p.extent.intersects(r)).map(p=>({extent:p.extent,pixelBlock:p.originalPixelBlock}));q=T.mosaicPixelData(q,r);return null!=q?{extent:q.extent,pixelBlock:q.pixelBlock}:null}return null}async _fetchImage(q,r,p,y){y=y||{};y.timeExtent=this.timeExtent;y.requestAsImageElement=!0;y.returnImageBitmap= !0;q=await this.layer.fetchImage(q,r,p,y);if(q.imageBitmap)return q.imageBitmap;y=await this.layer.applyRenderer(q.pixelData,{signal:y.signal});y=new A(y.pixelBlock,y.extent?.clone(),q.pixelData.pixelBlock);y.filter=Q=>this.layer.applyFilter(Q);return y}};m.__decorate([L.property()],B.prototype,"attached",void 0);m.__decorate([L.property()],B.prototype,"container",void 0);m.__decorate([L.property()],B.prototype,"layer",void 0);m.__decorate([L.property()],B.prototype,"strategy",void 0);m.__decorate([L.property()], B.prototype,"timeExtent",void 0);m.__decorate([L.property()],B.prototype,"view",void 0);m.__decorate([L.property()],B.prototype,"updateRequested",void 0);m.__decorate([L.property()],B.prototype,"updating",null);m.__decorate([L.property()],B.prototype,"type",void 0);return B=m.__decorate([R.subclass("esri.views.2d.layers.imagery.ImageryView2D")],B)})},"esri/layers/support/rasterFunctions/pixelUtils":function(){define(["exports","../PixelBlock","../rasterFormats/pixelRangeUtils"],function(m,H,B){function v(a){return null!= a&&"esri.layers.support.PixelBlock"===a.declaredClass&&a.pixels&&0=b[u]&&k<=b[u+1]){n=!0;break}n||(g[h]=0)}g[h]&&(k===d|| e?.has(k))&&(g[h]=0)}}function U(a,b){const d=a[0].length;for(let g=0;gO?E=f.rightPadding:N>=O&&(C=f.leftMargin-f.rightPadding,E=0)}d.xmax-=E;if("number"===typeof b)for(f=d.ymin;fv(da));if(null==k)return null;d=e?e.width:b.width;const n=e?e.height:b.height;var u=k.width,x=k.height;const w=b.width/u,C=b.height/x;b={offset:g||{x:0,y:0},mosaic:e||b,block:{width:u,height:x}};u=k.pixelType;var E=H.getPixelArrayConstructor(u);k=k.pixels.length;x=[];for(var O=0;Onull==da||null!=da.mask&&0da?.bandMasks&&1null!=N);if(null==g)return null;var e=a.some(N=>null!=N?!!N.mask:!0);const {width:f,height:h}=b;b=e?new Uint8Array(f*h):null;({blockWidths:d}=d);const k=[],n=g.getPlaneCount(),u=H.getPixelArrayConstructor(g.pixelType);if(e)for(let N=0,Y=0;NN?.bandMasks&&1n;n++){const w=k*d+n;r(x,f[w],a?a[w]:1)}h[u*d]=J(x);h[u*d+1]=h[u*d+2]=h[u*d];for(k=3;kb&&(d=f.value,b=g),f=e.next();return d}function q(a,b,d){0!==d&&(d=a.get(b),1===d?a.delete(b):a.set(b,d-1))}function r(a,b,d){0!==d&&a.set(b,a.has(b)?a.get(b)+1:1)}function p(a,b, d){let {x:g,y:e}=b;const {width:f,height:h}=d;if(0===g&&0===e&&h===a.height&&f===a.width)return a;const {width:k,height:n}=a;b=Math.max(0,e);const u=Math.max(0,g),x=Math.min(g+f,k),w=Math.min(e+h,n);if(0>x||0>w||!v(a))return null;g=Math.max(0,-g);e=Math.max(0,-e);var {pixels:C}=a,E=f*h,O=C.length;const S=[];for(var N=0;N{const F=ka instanceof Float32Array||ka instanceof Float64Array?0:.5;for(let P=0;PN[aa]||0>Y[aa])ka[P*E+G]=0;else if(z)ka[P*E+G]=c[X[aa]+da[aa]*u];else{const V=Math.floor(N[aa]),W=Math.floor(Y[aa]),K=Math.ceil(N[aa]),ca=Math.ceil(Y[aa]),Z=N[aa]-V,ja=Y[aa]-W;ka[P*E+G]=!l||l[V+W*u]&&l[K+W*u]&&l[V+ca*u]&&l[K+ca*u]?(1-ja)*((1-Z)*c[V+W*u]+Z*c[K+W*u])+ja*((1-Z)*c[V+ca*u]+Z*c[K+ca*u])+F:c[X[aa]+da[aa]*u]}aa++}}};d=[];g=k?.length===C;x=[];for(S=0;SN[a]||0>Y[a]?0:1;e.updateStatistics();return e};m.clip=p;m.clipTile=function(a){const {pixelBlock:b,tileSize:d,level:g,row:e,col:f,useBilinear:h}=a;if(!v(b))return null;const {width:k,height:n}=d;var u= 2**g;a=u*k;u*=n;a=p(b,{y:e*u,x:f*a},{width:a,height:u});if(!a)return null;for(u=g;0E?e[a]=0:(b[a]=h[C],x[a]=h[C+1],w[a]=h[C+2],e[a]=h[C+3]));else{e=new Uint8Array(f);for(a=0;aE?e[a]=0:(b[a]=h[C],x[a]=h[C+1],w[a]=h[C+2],e[a]=h[C+3]);d.mask=e}}else if(k)if(null!=e)for(a=0;a!v(n)))return null;if(1===a.length)return a[0]?.clone()??null;const {width:b,height:d,pixelType:g}=a[0];if(a.some(n=>n.width!==b||n.height!==d))return null;const e=a.map(({mask:n})=>n).filter(n=>null!=n);let f=null;e.length&&(f=new Uint8Array(b*d),f.set(e[0]),1h.push(...n));const k=[];a.map(({statistics:n})=>n).filter(n=>n?.length).forEach(n=>k.push(...n));return new H({pixelType:g, width:b,height:d,mask:f,pixels:h,statistics:k.length?k:null})};m.createColormapLUT=function(a){if(a){var b=a.colormap;if(b&&0!==b.length){b=b.sort((u,x)=>u[0]-x[0]);var d=0;0>b[0][0]&&(d=b[0][0]);var g=Math.max(256,b[b.length-1][0]-d+1),e=new Uint8Array(4*g),f=[],h=0,k=0,n=5===b[0].length;if(65536{f[u[0]-d]=n?u.slice(1):u.slice(1).concat([255])}),{indexed2DColormap:f,offset:d,alphaSpecified:n};if(a.fillUnspecified)for(a=b[k],h=a[0]-d;hN-1E-6);C[0]=d[0];h&& (C[C.length-1]=d[d.length-1]);for(var E=0;Ew?w:g[E]f));const k=[];b=b.outputPixelType||"u8";for(let n=0;nw.pixelBlock);if(null==d?.pixelBlock)return null; var g=(d.extent.xmax-d.extent.xmin)/d.pixelBlock.width;const e=(d.extent.ymax-d.extent.ymin)/d.pixelBlock.height,f=.01*Math.min(g,e),h=a.sort((w,C)=>Math.abs(w.extent.ymax-C.extent.ymax)>f?C.extent.ymax-w.extent.ymax:Math.abs(w.extent.xmin-C.extent.xmin)>f?w.extent.xmin-C.extent.xmin:0);var k=Math.min.apply(null,h.map(w=>w.extent.xmin));const n=Math.min.apply(null,h.map(w=>w.extent.ymin)),u=Math.max.apply(null,h.map(w=>w.extent.xmax)),x=Math.max.apply(null,h.map(w=>w.extent.ymax));a={x:Math.round((b.xmin- k)/g),y:Math.round((x-b.ymax)/e)};k={width:Math.round((u-k)/g),height:Math.round((x-n)/e)};g={width:Math.round((b.xmax-b.xmin)/g),height:Math.round((b.ymax-b.ymin)/e)};if(Math.round(k.width/d.pixelBlock.width)*Math.round(k.height/d.pixelBlock.height)!==h.length||0>a.x||0>a.y||k.widthw.pixelBlock);d=M(d,k,{clipOffset:a,clipSize:g});return{extent:b,pixelBlock:d}};m.remap=function(a,b){if(!v(a))return null;const {width:d,height:g}=a,{inputRanges:e,outputValues:f, outputPixelType:h,noDataRanges:k,allowUnmatched:n,isLastInputRangeInclusive:u}=b;b=a.pixels[0];const x=H.createEmptyBand(h,b.length),w=a.mask,C=new Uint8Array(d*g);w?C.set(w):C.fill(255);const E=a.pixelType.startsWith("f")?1E-6:0;a=e.map(aa=>aa-E);a[0]=e[0];a[a.length-1]=e[e.length-1]+(u?1E-6:0);var O=e.length/2;const [S,N]=B.getPixelValueRange(h);for(var Y=0;Ya[2*ea]&&baN?N:ba=k[ba]&&da<=k[ba+1]){x[X]=0;C[X]=0;break}return new H({width:d,height:g,pixelType:h,pixels:[x],mask:C})};m.remapColor=function(a,b){if(!v(a))return null;a=a.clone();var {pixels:d}=a;const g=a.width*a.height,e=b.length,f=Math.floor(e/2),h=b[Math.floor(f)];d=d[0];let k,n,u,x,w,C,E=!1;const O=new Uint8Array(g),S=new Uint8Array(g),N=new Uint8Array(g); let Y=a.mask;const X=4===b[0].mappedColor.length;Y||(Y=new Uint8Array(g),Y.fill(X?255:1),a.mask=Y);for(w=0;wn.value?u=C:x=C;C=Math.floor((u+x)/2);n=b[Math.floor(C)]}E||(k===b[u].value?(n=b[u],E=!0):k===b[x].value?(n=b[x],E=!0):kb[u].value&&(kf||0>b||h>g||d>e||0===f&&0===b&&h===g&&d===e)return a;a.mask||(a.mask=new Uint8Array(g*e));const k=a.mask;for(let n=0;n=d||x=h?0:1}a.updateStatistics();return a};m.split=function(a,b,d=0,g=!0){if(!v(a))return null; const {width:e,height:f}=b;let {width:h,height:k}=a;const n=new Map,u={x:0,y:0};d=1+d;for(let x=0;xt.length)return t[0];const A=t[0].length,J=(new Uint8Array(A)).fill(255);for(let q=0;q{var q=this.mask;let r=Infinity,p=-Infinity;const y=J.length;let Q,a=0;if(null!=q)for(Q=0;Qp?a:p);else for(Q=0;Qp?a:p;return new R.SimpleBandStatistics(r,p)});var t=this.mask,A=0;if(null!=t)for(let J= 0;JJ?J:bd>=A.length),p=q===t.length&&!t.some((d,g)=>d!==g);if(r||p)return this;q=this.bandMasks?.length===q?t.map(d=>this.bandMasks[d]):void 0;let {mask:y,validPixelCount:Q}=this;const {width:a,height:b}=this;q?.length&&(y=M.combineBandMasks(q),Q=y.filter(d=>!!d).length);return new M({pixelType:this.pixelType,width:a,height:b,mask:y,bandMasks:q,validPixelCount:Q,maskIsAlpha:this.maskIsAlpha,pixels:t.map(d=>A[d]),statistics:J&&t.map(d=>J[d])})}clone(){const t=new M({width:this.width,height:this.height, pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});null!=this.mask&&(t.mask=new Uint8Array(this.mask));this.bandMasks&&(t.bandMasks=this.bandMasks.map(q=>new Uint8Array(q)));let A;const J=M.getPixelArrayConstructor(this.pixelType);if(this.pixels&&0y+Number.EPSILON||qv?-128<=v&&128>I?"s8":-32768<=v&&32768>I?"s16":"s32":256>I?"u8":65536>I?"u16":"u32"};m.getPixelValueRange=H;m.isIntegerPixelType=function(v){return(v?.startsWith("s")||v?.startsWith("u"))??!1};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/support/ExportStrategy":function(){define("../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/has ../../../../core/promiseUtils ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/spatialReferenceUtils ../../../../layers/support/TileInfo ../../viewStateUtils ../../engine/Bitmap ../../tiling/TileInfoView ../../tiling/TileKey".split(" "), function(m,H,B,v,I,L,U,D,R,T,M,t,A,J,q){const r=R.create(),p=[0,0],y=new q(0,0,0,0);H=class extends H{constructor(Q){super(Q);this._imagePromise=null;this.bitmaps=[];this.hidpi=!1;this.imageMaxHeight=this.imageMaxWidth=2048;this.imageNormalizationSupported=this.imageRotationSupported=!1;this.update=v.debounce(async(a,b)=>{v.throwIfAborted(b);if(a.stationary&&!this.destroyed){var d=a.state,g=T.getInfo(d.spatialReference);a=this.hidpi?a.pixelRatio:1;var e=0g.valid[1]);g=!this.imageNormalizationSupported&&g;var n=!(Math.floor(p[0])>h||Math.floor(p[1])>k)&&!g,u=this.imageRotationSupported?d.rotation:0;g=this.container.children.slice();n?this._imagePromise=this._singleExport(d, p,f?d.paddedViewState.center:d.center,d.resolution,u,a,b):(f=Math.min(h,k),e&&(f=Math.min(d.worldScreenWidth,f),f=Math.round(d.worldScreenWidth/Math.ceil(d.worldScreenWidth/f))),this._imagePromise=this._tiledExport(d,f,a,b));try{const x=await this._imagePromise??[];v.throwIfAborted(b);b=[];this._imagePromise=null;if(!this.destroyed){this.bitmaps=x;for(const w of g)x.includes(w)||b.push(w.fadeOut().then(()=>{w.remove();w.destroy()}));for(const w of x)b.push(w.fadeIn());await Promise.all(b)}}catch(x){this._imagePromise= null,v.throwIfAbortError(x)}}},5E3);this.updateExports=v.debounce(async a=>{const b=[];for(const d of this.container.children){if(!d.visible||!d.stage)return;b.push(a(d).then(()=>{d.invalidateTexture();d.requestRender()}))}this._imagePromise=v.eachAlways(b).then(()=>this._imagePromise=null);await this._imagePromise})}destroy(){this.bitmaps.forEach(Q=>Q.destroy());this.bitmaps=[]}get updating(){return!this.destroyed&&null!==this._imagePromise}async _export(Q,a,b,d,g,e){b=await this.fetchSource(Q,Math.floor(a* g),Math.floor(b*g),{rotation:d,pixelRatio:g,signal:e});v.throwIfAborted(e);const f=new A.Bitmap(null,!0);f.x=Q.xmin;f.y=Q.ymax;f.resolution=Q.width/a;f.rotation=d;f.pixelRatio=g;f.opacity=0;this.container.addChild(f);await f.setSourceAsync(b,e);v.throwIfAborted(e);return f}async _singleExport(Q,a,b,d,g,e,f){t.getBBox(r,b,d,a);Q=R.toExtent(r,Q.spatialReference);return[await this._export(Q,a[0],a[1],g,e,f)]}_tiledExport(Q,a,b,d){var g=M.create({size:a,spatialReference:Q.spatialReference,scales:[Q.scale]}); const e=new J(g);g=e.getTileCoverage(Q);if(!g)return null;const f=[];g.forEach((h,k,n,u)=>{y.set(h,k,n,0);e.getTileBounds(r,y);const x=R.toExtent(r,Q.spatialReference);f.push(this._export(x,a,a,0,b,d).then(w=>{0!==u&&(y.set(h,k,n,u),e.getTileBounds(r,y),w.x=r[0],w.y=r[3]);return w}))});return Promise.all(f)}};m.__decorate([I.property()],H.prototype,"_imagePromise",void 0);m.__decorate([I.property()],H.prototype,"bitmaps",void 0);m.__decorate([I.property()],H.prototype,"container",void 0);m.__decorate([I.property()], H.prototype,"fetchSource",void 0);m.__decorate([I.property()],H.prototype,"hidpi",void 0);m.__decorate([I.property()],H.prototype,"imageMaxWidth",void 0);m.__decorate([I.property()],H.prototype,"imageMaxHeight",void 0);m.__decorate([I.property()],H.prototype,"imageRotationSupported",void 0);m.__decorate([I.property()],H.prototype,"imageNormalizationSupported",void 0);m.__decorate([I.property()],H.prototype,"requestUpdate",void 0);m.__decorate([I.property()],H.prototype,"updating",null);return H=m.__decorate([D.subclass("esri.views.2d.layers.support.ExportStrategy")], H)})},"esri/views/2d/viewStateUtils":function(){define(["exports"],function(m){const H=Math.PI/180;m.getBBox=function(B,v,I,L){const [U,D]=v,[R,T]=L;v=.5*I;B[0]=U-v*R;B[1]=D-v*T;B[2]=U+v*R;B[3]=D+v*T;return B};m.getOuterSize=function(B,v){var I=v.rotation*H;const L=Math.abs(Math.cos(I));I=Math.abs(Math.sin(I));const [U,D]=v.size;B[0]=Math.round(D*I+U*L);B[1]=Math.round(D*L+U*I);return B};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/imagery/VectorFieldView2D":function(){define("../../../../chunks/tslib.es6 ../../../../Graphic ../../../../request ../../../../core/Accessor ../../../../core/Logger ../../../../core/promiseUtils ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/Extent ../../../../geometry/support/spatialReferenceUtils ../../../../layers/support/rasterFunctions/rasterProjectionHelper ../../../../layers/support/rasterFunctions/vectorFieldUtils ../../engine/imagery/RasterVFContainer ./ImageryVFStrategy".split(" "), function(m,H,B,v,I,L,U,D,R,T,M,t,A,J,q,r,p){v=class extends v{constructor(){super(...arguments);this.attached=!1;this.container=new r.RasterVFContainer;this.type="imageryVF";this._dataParameters={exportParametersVersion:0,bbox:"",symbolTileSize:0,time:""};this._fetchpixels=async(y,Q,a,b)=>{const d=await this._projectFullExtentPromise,{symbolTileSize:g}=this.layer.renderer,{extent:e,width:f,height:h}=q.snapImageToSymbolTile(y,Q,a,g,d);if(null!=d&&!d.intersects(y))return{extent:e,pixelBlock:null};y= {bbox:`${e.xmin}, ${e.ymin}, ${e.xmax}, ${e.ymax}`,exportParametersVersion:this.layer.exportImageServiceParameters.version,symbolTileSize:g,time:JSON.stringify(this.timeExtent||"")};if(this._canReuseVectorFieldData(y)&&(Q=this.getPixelData(),null!=Q&&`${Q.extent.xmin}, ${Q.extent.ymin}, ${Q.extent.xmax}, ${Q.extent.ymax}`===y.bbox))return Q;({pixelData:b}=await this.layer.fetchImage(e,f,h,{timeExtent:this.timeExtent,requestAsImageElement:!1,signal:b}));this._dataParameters=y;b=b?.pixelBlock;if(null== b)return{extent:e,pixelBlock:null};b="vector-uv"===this.layer.rasterInfo.dataType?q.convertVectorFieldData(b,"vector-uv"):b;return{extent:e,pixelBlock:b}}}get updating(){return!this.attached||this._strategy.updating}attach(){this._projectFullExtentPromise=this._getProjectedFullExtent(this.view.spatialReference);this._strategy=new p({container:this.container,fetchPixels:this._fetchpixels});this.addHandles(U.watch(()=>this.layer.renderer,y=>this._updateSymbolizerParams(y),U.syncAndInitial),"attach")}detach(){this._strategy.destroy(); this.container.children.forEach(y=>y.destroy());this.container.removeAllChildren();this.removeHandles("attach");this._strategy=this.container=this._projectFullExtentPromise=null}getPixelData(){const y=this.container.children[0]?.rawPixelData;if(this.updating||!y)return null;const {extent:Q,pixelBlock:a}=y;return{extent:Q,pixelBlock:a}}hitTest(y){return new H({attributes:{},geometry:y.clone(),layer:this.layer})}update(y){this._strategy.update(y,this._symbolizerParams).catch(Q=>{L.isAbortError(Q)|| I.getLogger(this).error(Q)})}redraw(){const {renderer:y}=this.layer;y&&(this._updateSymbolizerParams(y),this._strategy.redraw(this._symbolizerParams))}_canReuseVectorFieldData(y){const Q=this._dataParameters.time===y.time,a=this._dataParameters.symbolTileSize===y.symbolTileSize,b=this._dataParameters.bbox===y.bbox;return this._dataParameters.exportParametersVersion===y.exportParametersVersion&&Q&&a&&b}async _getProjectedFullExtent(y){try{return J.projectExtent(this.layer.fullExtent,y)}catch(Q){try{const a= (await B(this.layer.url,{query:{option:"footprints",outSR:A.srToRESTValue(y),f:"json"}})).data.featureCollection.layers[0].layerDefinition.extent;return a?t.fromJSON(a):null}catch{return null}}}_updateSymbolizerParams(y){"vector-field"===y.type&&(this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null}))}};m.__decorate([D.property()],v.prototype,"attached",void 0);m.__decorate([D.property()],v.prototype,"container",void 0);m.__decorate([D.property()],v.prototype,"layer", void 0);m.__decorate([D.property()],v.prototype,"timeExtent",void 0);m.__decorate([D.property()],v.prototype,"type",void 0);m.__decorate([D.property()],v.prototype,"view",void 0);m.__decorate([D.property()],v.prototype,"updating",null);return v=m.__decorate([M.subclass("esri.views.2d.layers.imagery.VectorFieldView2D")],v)})},"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,H,B,v,I,L,U,D,R,T,M,t){function A(c,l,z){return!U.canProjectWithoutEngine(c,l,z)}function J(c,l,z){if((c=A(c,l,z))&&!U.isLoaded())throw new v("rasterprojectionhelper-project","projection engine is not loaded");return c}function q(c,l,z){J(c.spatialReference,l);return z?U.getTransformation(l,c.spatialReference,c):U.getTransformation(c.spatialReference,l,c)}function r(c,l,z,F=null){const P=c.spatialReference;if(P.equals(l))return c;J(P,l,F);z=z.center;z=new R({xmin:z.x-c.x/2,xmax:z.x+c.x/ 2,ymin:z.y-c.y/2,ymax:z.y+c.y/2,spatialReference:P});F=U.project(z,l,F);z=w(l);null==F||null!=z&&F.width>=z?(l=I.getMetersPerUnitForSR(P)/I.getMetersPerUnitForSR(l),c={x:c.x*l,y:c.y*l}):c={x:F.width,y:F.height};return c}function p(c,l=.01){return I.getMetersPerUnitForSR(c)?l/I.getMetersPerUnitForSR(c):0}function y(c,l,z=null,F=!0){const P=c.spatialReference;if(P.equals(l))return c;J(P,l,z);z=U.project(c,l,z);if(!F||!z)return z;Q([c],[z],P,l);return z}function Q(c,l,z,F){const P=C(z,!0),G=C(F,!0); z=p(z,500);F=p(F,500);if(z&&null!=P&&null!=G)for(let V=0;V=G[1]-F&&Math.abs(K-P[0])new T(G[0],G[1],z));l=U.project(c,F,P);P&&Q(c,l,z,F);return l.map(G=> G?[G.x,G.y]:[NaN,NaN])}function d(c){const {inSR:l,outSR:z,datumTransformation:F}=c;var P=g(l);const {points:G,mask:V}=f(c,P);l.isGeographic||(c=l.wkid?L.PeFactory.coordsys(l.wkid):L.PeFactory.fromString(l.isGeographic?L.PeDefs.PE_TYPE_GEOGCS:L.PeDefs.PE_TYPE_PROJCS,l.wkt2||l.wkt),L.PeCSTransformations.projToGeog(c,G.length,G));if(null!=F&&F.steps.length){var W;z.isGeographic&&(W=G.map(([K])=>179.9955K?-1:0));F.steps.forEach(K=>{const ca=K.wkid?L.PeFactory.geogtran(K.wkid):L.PeFactory.fromString(L.PeDefs.PE_TYPE_GEOGTRAN, K.wkt);L.PeGTTransformations.geogToGeog(ca,G.length,G,null,K.isInverse?L.PeDefs.PE_TRANSFORM_2_TO_1:L.PeDefs.PE_TRANSFORM_1_TO_2)});if(W)for(c=0;cK?-1:0;P&&ca&&P!==ca&&(G[c][0]=01===Z.getInclusive()&&1===Z.getKind());if(!G){G=P.find(Z=>1===Z.getInclusive()&&0===Z.getKind());if(!G)return null;c=!0}z=z?0:(2===F.getNorthPoleLocation()?1:0)|(2===F.getSouthPoleLocation()?2:0);F=F.isPannableRectangle();G=G.getCoord();if(c)return{isEnvelope:c,isPannable:F,vertices:G,coef:null,bbox:[G[0][0]-l,G[0][1]-l,G[1][0]+l,G[1][1]+l],poleLocation:z};l=0;c=[]; let [V,W]=G[0],[K,ca]=G[0];for(let Z=0,ja=G.length;Zia?K:ia;ca=ca>ha?ca:ha}return{isEnvelope:!1,isPannable:F,vertices:G,coef:c,bbox:[V,W,K,ca],poleLocation:z}}function f(c,l){const z=[],{cols:F,rows:P,xres:G,yres:V,usePixelCenter:W}=c;let {xmin:K,ymax:ca}=c;W&&(K+=G/2,ca-=V/2);if(null== l){for(c=0;c=na&&Z<=pa;for(var ia=0;ia=fa&&ha<=qa&&(z.push([Z,ha]),c[sa]=1)}}return{points:z,mask:c}}Z=l.coef;l=[];for(ja=0;ja=pa&&la<=qa&&(ia.push(na*la+fa),ha.push(ra))}la=ia;if(2fa-pa)}else ia[0]>ia[1]&&(la=[ia[1],ia[0]]);l.push(la)}for(let na=0,fa=0;na=ha[0]&&Z<=ha[1]&&(z.push([Z,ia]),c[fa]=1);else if(2=ha[ma]&&Z<=ha[ma+1]){la=!0;break}la&&(z.push([Z,ia]),c[fa]=1)}return{points:z,mask:c}}function h(c,l){const [z,F]=l;for(l=0;lF)c[l]=[NaN,NaN]}}function k(c,l){const z=w(c[0].spatialReference);if(2>c.length||null==z)return c[0];l=l??p(c[0].spatialReference);c=c.filter(W=>W.width>l);if(1===c.length)return c[0];let {xmin:F,xmax:P, ymin:G,ymax:V}=c[0];for(let W=1;Wp(P)){const {xmin:K,xmax:ca}=c;for(let Z=0;Z<=G;Z++)W[Z]=new R({xmin:0===Z?K:-V/2,xmax:Z===G?ca-V*Z:V/2,ymin:c.ymin,ymax:c.ymax,spatialReference:P})}c=W.map(K=>x(K,l,z,F));return k(c.filter(B.isSome))}function u(c,l){const z=w(l);if(null==z)return null;let {xmin:F,ymin:P,xmax:G,ymax:V}=c;var W=c.spatialReference;c=new M({spatialReference:W,rings:[[[F,P],[G,P],[G,V],[F,V],[F,P]]]});c=U.project(c,l);if(2!==c.rings.length||!c.rings[0].length|| !c.rings[1].length)return null;({rings:c}=c);W=p(W);l=new R({spatialReference:l});for(let K=0;2>K;K++){F=G=c[K][0][0];P=V=c[K][0][1];for(let ca=0;cac[K][ca][0]?c[K][ca][0]:F,G=Gc[K][ca][1]?c[K][ca][1]:P,V=V=V.ymax))return null;if(!F||!V)return V;var W=C(G,!0);F=C(l,!0);if(null==W||null==F)return V;P=p(G,.001);const K=p(G,500);var ca=p(l,.001);if(Math.abs(V.xmin-F[0])K){V.xmin=F[0];var Z= [];Z.push(new T(c.xmax,c.ymin,G));Z.push(new T(c.xmax,(c.ymin+c.ymax)/2,G));Z.push(new T(c.xmax,c.ymax,G));Z=Z.map(ja=>y(ja,l,z)).filter(ja=>!isNaN(ja?.x)).map(ja=>ja.x);V.xmax=Math.max.apply(null,Z)}WK&&(V.xmax=F[1],F=[],F.push(new T(c.xmin,c.ymin,G)),F.push(new T(c.xmin,(c.ymin+c.ymax)/2,G)),F.push(new T(c.xmin,c.ymax,G)),c=F.map(ja=>y(ja,l,z)).filter(ja=>!isNaN(ja?.x)).map(ja=>ja.x),V.xmin=Math.min.apply(null,c))}else c=p(l,.001),Math.abs(V.xmin-F[0])=c[0],usePixelCenter:fa});na=[];let ra,sa=0;const wa=fa?-1:NaN,{xmin:xa,xmax:va,ymax:ya,width:za,height:Aa}=z,Ba=p(W,500),Ca=null!=ha&&0ha/2;var ta=!1;K&&(ta=g(V),ta=null!=ta&&0va&&oa[0]>ha/2-Ba?oa[0]-=ha:la&&0===V&&0>oa[0]&&Ca&&!G&&(oa[0]+=ha);!oa||isNaN(oa[0])||isNaN(oa[1])?(na.push(wa),na.push(wa),K.push(null), sa++):(G&&(oa=G.inverseTransform(new T({x:oa[0],y:oa[1],spatialReference:W})),oa=[oa.x,oa.y]),K.push(oa),0va&&oa[0]>ha&&(oa[0]-=ha)),na.push((oa[0]-xa)/za),na.push((ya-oa[1])/Aa))}ra=K}return{offsets:na,error:null,coefficients:null,outofBoundPointCount:sa,spacing:c,size:fa?[pa,qa]:[pa-1,qa-1]}}function N(c,l,z){const {cols:F,rows:P}=l;l=new Float32Array((F-1)*(P-1)*12);const G=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;iaqa;qa++)l[pa++]=G[fa++]*ca+G[fa++]*Z+G[fa++]*na;fa=0;for(Z=0;3>Z;Z++)l[pa++]=G[fa++]*ha+G[fa++]*ja+G[fa++]*K;fa=0;for(ja=0;3>ja;ja++)l[pa++]=V[fa++]*ca+V[fa++]*la+V[fa++]*na;fa=0;for(ca=0;3>ca;ca++)l[pa++]=V[fa++]*ha+V[fa++]*ma+V[fa++]*K}if(z)for(W=0;W{if(1===z[0])return[0,0];var P=1,G=-1,V=1,W=-1;for(var K=0;Kc[K]?c[K]:P,G=G>c[K]?G:c[K],V=V>c[K+1]?c[K+1]:V,W=W>c[K+1]?W:c[K+1]);const {cols:ca, rows:Z}=l;l=(G-P)/ca/z[0];z=(W-V)/Z/z[1];F*=2;V=0;W=!1;P=[0,0];for(G=0;GV&&(V=ia+ja,P=[ia,ja]);if(F&&V>F){W=!0;break}}if(W)break}return P},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(c,l,z){var F=z?.tileSize??512,P=z?.alignGlobalDatasetWithAGOL??!0,G=!!z?.limitToSrcResolution;const {extent:V,spatialReference:W,pixelSize:K}=c;z=r(new T({x:K.x,y:K.y,spatialReference:W}),l,V);if(null==z)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const ca=(z.x+z.y)/2,Z=I.getMetersPerUnitForSR(l);var ja=ca*Z*96*39.37,ia=l.isGeographic?256/F*2.958287637958547E8: 256/F*5.91657527591555E8,ha="vector-magdir"===c.dataType||"vector-uv"===c.dataType,la=X(c,l),ma=Math.min(Math.ceil(Math.log(Math.min(c.width,c.height)/32)/Math.LN2),Math.ceil(Math.log(ia/2/ja)/Math.LN2));if(!ha&&P&&(l.isGeographic||l.isWebMercator)&&(P=w(l),ha=0P/4,!ha&&null!=P)){ha=-1;if(3>ma)ha=2**ma*ca*F;else if(c.storageInfo){const {maximumPyramidLevel:na=0,pyramidScalingFactor:fa=2}=c.storageInfo;ha=fa**na*ca*F}F=Math.ceil(P/ha);ha=1===F||2===F&&P/2-la.xmax=Math.max(F,ia)/Math.min(F,ia)&&(F=ia)}ia=[F];la=[{x:l.x,y:l.y}];for(ja=Math.min(70.5310735,ja)/1.001;F>=ja;)F/=c,l.x/=c,l.y/=c,ia.push(F),la.push({x:l.x,y:l.y});if(G){const na= .001*K.x;G=la.findIndex(fa=>fa.x>=K.x-na&&fa.x<=K.x+na);-1fa.x<=K.x+na),0F&&(P=-Math.ceil((c.xmin-F)/l)); return new R({spatialReference:c.spatialReference,xmin:c.xmin+P*l,ymin:c.ymin,xmax:c.xmax+P*l,ymax:c.ymax})};m.snapExtent=Y;m.snapPyramid=function(c,l,z){const {storageInfo:F,pixelSize:P}=l;var G=0;let V=!1;var {pyramidResolutions:W}=F,K="mixed"===F.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,F.tileInfo.dpi/96)):1;K=(c.x+c.y)/2/K;if(null!=W&&W.length){c=W[W.length-1];c=(c.x+c.y)/2;var ca=(P.x+P.y)/2;if(K<=ca)G=0;else if(K>=c)G=W.length,V=8ca-K||2G?G=0:G>W&&(V=G>W+3,G=W);z=2**G;l=new T({x:z*l.nativePixelSize.x,y:z*l.nativePixelSize.y,spatialReference:l.spatialReference});return{pyramidLevel:G,pyramidResolution:l,excessiveReading:V}};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFunctions/vectorFieldUtils":function(){define(["exports","../../../core/jsonMap","../PixelBlock","./pixelUtils"],function(m,H,B,v){function I(e,f){return r.get(e)/r.get(f)||1}function L(e,f="geographic"){const [h, k]=e;e=Math.sqrt(h*h+k*k);let n=Math.atan2(k,h)*p;n=(360+n)%360;"geographic"===f&&(n=(450-n)%360);return[e,n]}function U(e,f="geographic"){let h=e[1];"geographic"===f&&(h=(450-h)%360);h%=360;e=e[0];return[e*Math.cos(h/p),e*Math.sin(h/p)]}function D(e,f,h="geographic",k=1){if(!v.isValidPixelBlock(e))return e;const {pixels:n,width:u,height:x}=e;var w=u*x;const C=n[0],E=n[1],O=e.pixelType.startsWith("f")?e.pixelType:"f32",S=B.createEmptyBand(O,w);w=B.createEmptyBand(O,w);let N=0;for(let Y=0;Y=ka&&1===ea%2&&ca===(ea-1)/2&&(X=0,ba=X+0*w,da=(da+E)/2,aa=da-k); const [Z,ja]=M(X,da,f,45);if(00Y;Y++)w[h++]=(N+.5)/n,w[h++]=(S+.5)/u,w[h++]=2>Y?-.5:.5,w[h++]=0===Y%2?-.5:.5,w[h++]=0,w[h++]=O;O=4*(h/24-1);C[k++]=O;C[k++]=O+1;C[k++]=O+2;C[k++]=O+1;C[k++]=O+2;C[k++]=O+3}}return{vertexData:new Float32Array(w),indexData:new Uint32Array(C)}}const r=new Map;r.set("meter-per-second", 1);r.set("kilometer-per-hour",.277778);r.set("knots",.514444);r.set("feet-per-second",.3048);r.set("mile-per-hour",.44704);const p=180/Math.PI,y=new H.JSONMap({esriMetersPerSecond:"meter-per-second",esriKilometersPerHour:"kilometer-per-hour",esriKnots:"knots",esriFeetPerSecond:"feet-per-second",esriMilesPerHour:"mile-per-hour"}),Q=R(0,0,0),a=[0,1,3,6,10,16,21,27,33,40,47,55,63],b=[0,.5,1,1.5,2],d=[0,.25,.5,1,1.5,2,2.5,3,3.5,4],g=[];m.convertToLocalDirections=function(e,f,h,k="geographic"){if(!v.isValidPixelBlock(e)|| null==h)return e;e="vector-magdir"===f?e.clone():D(e,f);const n=e.pixels[1];for(let u=0;uh;h++)g.push(T(5*h,0,!f.invertDirection));f=y.fromJSON(f.inputUnit);f=I(f,"knots");const {width:x,height:w,mask:C}=e;h=e.pixels[0];e=e.pixels[1];const E=[],O=[];let S=0,N=0;for(let Y=0;Y=(z-c)*(F-l)*(1-n)){N[ka]=1;const [P,G]=L([Y[ka]/ea,X[ka]/ea]);Y[ka]=P;X[ka]=G}else N[ka]=0,Y[ka]=0,X[ka]=0}h=new B({width:e,height:k,pixels:[Y,X],mask:N});h.updateStatistics();return h};m.snapImageToSymbolTile=function(e, f,h,k,n){if(null==n||!n.spatialReference.equals(e.spatialReference))return{extent:e,width:Math.round(f/k),height:Math.round(h/k),resolution:e.width/f};const u=n.xmin;n=n.ymax;f=(e.xmax-e.xmin)/f*k;h=(e.ymax-e.ymin)/h*k;e.xmin=u+Math.floor((e.xmin-u)/f)*f;e.xmax=u+Math.ceil((e.xmax-u)/f)*f;e.ymin=n+Math.floor((e.ymin-n)/h)*h;e.ymax=n+Math.ceil((e.ymax-n)/h)*h;return{extent:e,width:Math.round(e.width/f),height:Math.round(e.height/h),resolution:(f+h)/2}};m.unitKebabDict=y;m.uvComponentToVector=L;Object.defineProperty(m, Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/imagery/RasterVFContainer":function(){define(["exports","./BrushVectorField","../webgl/enums","../webgl/WGLContainer"],function(m,H,B,v){class I extends v{constructor(){super(...arguments);this.symbolTypes=["triangle"]}prepareRenderPasses(L){const U=L.registerRenderPass({name:"imagery (vf)",brushes:[H],target:()=>this.children,drawPhase:B.WGLDrawPhase.MAP});return[...super.prepareRenderPasses(L),U]}doRender(L){this.visible&&L.drawPhase=== B.WGLDrawPhase.MAP&&this.symbolTypes.forEach(U=>{L.renderPass=U;super.doRender(L)})}}m.RasterVFContainer=I;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/imagery/BrushVectorField":function(){define(["../webgl/brushes/WGLBrush","../../../webgl/enums"],function(m,H){const B=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]),v=new Float32Array([0,92/255,230/255,1]),I={beaufort_ft:B,beaufort_m:B,beaufort_km:B, beaufort_mi:B,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:v,single_arrow:v,wind_speed:new Float32Array([0,0,0,1])},L=[0,20];class U 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:D}){D.setBlendingEnabled(!0);D.setBlendFunctionSeparate(H.BlendFactor.ONE, H.BlendFactor.ONE_MINUS_SRC_ALPHA,H.BlendFactor.ONE,H.BlendFactor.ONE_MINUS_SRC_ALPHA);D.setColorMask(!0,!0,!0,!0);D.setStencilWriteMask(0);D.setStencilTestEnabled(!0);D.setStencilOp(H.StencilOperation.KEEP,H.StencilOperation.KEEP,H.StencilOperation.REPLACE)}draw(D,R){if(null!=R.source&&0!==R.source.validPixelCount){var {context:T,timeline:M}=D;M.begin(this.name);T.setStencilFunction(H.CompareFunction.EQUAL,R.stencilRef,255);R.updateVectorFieldVAO(D);if("scalar"===D.renderPass){var t=R.vaoData.scalar; t&&this._drawScalars(D,R,t.vao,t.elementCount)}else(t=R.vaoData.magdir)&&this._drawTriangles(D,R,t.vao,t.elementCount);M.end(this.name)}}_drawTriangles(D,R,T,M){const {context:t,painter:A,requestRender:J,allowDelayedRender:q}=D,{symbolizerParameters:r}=R;var p=r.dataRange?["dataRange"]:[];"geographic"===r.rotationType&&p.push("rotationGeographic");p=A.materialManager.getProgram(this._desc.magdir,p);if(q&&null!=J&&!p.compiled)J();else{t.useProgram(p);var {coordScale:y,opacity:Q,transforms:a}=R;p.setUniform2fv("u_coordScale", y);p.setUniform1f("u_opacity",Q);p.setUniformMatrix3fv("u_dvsMat3",a.displayViewScreenMat3);var {style:b,dataRange:d,rotation:g,symbolPercentRange:e}=r;p.setUniform4fv("u_colors",I[b]);p.setUniform2fv("u_dataRange",d||L);p.setUniform1f("u_rotation",g);p.setUniform2fv("u_symbolPercentRange",e);D=this._getSymbolSize(D,R);p.setUniform2fv("u_symbolSize",D);t.bindVAO(T);t.drawElements(H.PrimitiveType.TRIANGLES,M,H.DataType.UNSIGNED_INT,0)}}_drawScalars(D,R,T,M){const {context:t,painter:A,requestRender:J, allowDelayedRender:q}=D,{symbolizerParameters:r}=R;var p=[];"wind_speed"===r.style?p.push("innerCircle"):r.dataRange&&p.push("dataRange");"geographic"===r.rotationType&&p.push("rotationGeographic");p=A.materialManager.getProgram(this._desc.scalar,p);if(q&&null!=J&&!p.compiled)J();else{t.useProgram(p);var {coordScale:y,opacity:Q,transforms:a}=R;p.setUniform2fv("u_coordScale",y);p.setUniform1f("u_opacity",Q);p.setUniformMatrix3fv("u_dvsMat3",a.displayViewScreenMat3);var {dataRange:b,symbolPercentRange:d}= r;p.setUniform2fv("u_dataRange",b||L);p.setUniform2fv("u_symbolPercentRange",d);D=this._getSymbolSize(D,R);p.setUniform2fv("u_symbolSize",D);t.bindVAO(T);t.drawElements(H.PrimitiveType.TRIANGLES,M,H.DataType.UNSIGNED_INT,0)}}_getSymbolSize(D,R){D=R.key?2**(D.displayLevel-R.key.level):R.resolution/D.state.resolution;const {symbolTileSize:T}=R.symbolizerParameters;return[T/(Math.round((R.width-R.offset[0])/T)*T)/D,T/(Math.round((R.height-R.offset[1])/T)*T)/D]}}return U})},"esri/views/2d/layers/imagery/ImageryVFStrategy":function(){define("../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Logger ../../../../core/promiseUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/Extent ../../engine/imagery/RasterVFDisplayObject".split(" "), function(m,H,B,v,I,L,U,D,R,T){H=class extends H{constructor(M){super(M);this._loading=null;this.update=v.debounce((t,A)=>this._update(t,A).catch(J=>{v.isAbortError(J)||B.getLogger(this).error(J)}))}get updating(){return!!this._loading}redraw(M){if(this.container.children.length){var t=this.container.children[0];t.symbolizerParameters=M;t.invalidateVAO();this.container.symbolTypes="wind_speed"===M.style?["scalar","triangle"]:"simple_scalar"===M.style?["scalar"]:["triangle"];this.container.requestRender()}}async _update(M, t,A){if(M.stationary){var {extent:J,spatialReference:q}=M.state,r=new R({xmin:J.xmin,ymin:J.ymin,xmax:J.xmax,ymax:J.ymax,spatialReference:q}),[p,y]=M.state.size;this._loading=this.fetchPixels(r,p,y,A);A=await this._loading;this._addToDisplay(A,t,M.state);this._loading=null}}_addToDisplay(M,t,A){if(null==M.pixelBlock)this.container.children.forEach(p=>p.destroy()),this.container.removeAllChildren();else{var {extent:J,pixelBlock:q}=M,r=new T.RasterVFDisplayObject(q);r.offset=[0,0];r.symbolizerParameters= t;r.rawPixelData=M;r.invalidateVAO();r.x=J.xmin;r.y=J.ymax;r.pixelRatio=A.pixelRatio;r.rotation=A.rotation;r.resolution=A.resolution;r.width=q.width*t.symbolTileSize;r.height=q.height*t.symbolTileSize;this.container.children.forEach(p=>p.destroy());this.container.removeAllChildren();this.container.symbolTypes="wind_speed"===t.style?["scalar","triangle"]:"simple_scalar"===t.style?["scalar"]:["triangle"];this.container.addChild(r)}}};m.__decorate([I.property()],H.prototype,"fetchPixels",void 0);m.__decorate([I.property()], H.prototype,"container",void 0);m.__decorate([I.property()],H.prototype,"_loading",void 0);m.__decorate([I.property()],H.prototype,"updating",null);return H=m.__decorate([D.subclass("esri.views.2d.layers.imagery.ImageryVFStrategy")],H)})},"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,H,B,v,I,L,U,D,R,T,M){class t extends U.DisplayObject{constructor(A=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=A}destroy(){null!=this.vaoData&&(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(A){JSON.stringify(this._symbolizerParameters)!== JSON.stringify(A)&&(this._symbolizerParameters=A,this.invalidateVAO())}get source(){return this._source}set source(A){this._source=A;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(A){if(this._vaoInvalidated){this._vaoInvalidated=!1;if(null!=this.source&&null==this.vaoData){var {style:J}=this.symbolizerParameters; switch(J){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":J=L.createVFMesh(this.source,this.symbolizerParameters);this.vaoData={magdir:this._createVectorFieldVAO(A.context,J)};break;case "simple_scalar":J=L.createVFMeshScalar(this.source,this.symbolizerParameters);this.vaoData={scalar:this._createVectorFieldVAO(A.context,J)};break;case "wind_speed":J=L.createVFMesh(this.source, this.symbolizerParameters);J=this._createVectorFieldVAO(A.context,J);const q=L.createVFMeshScalar(this.source,this.symbolizerParameters);A=this._createVectorFieldVAO(A.context,q);this.vaoData={magdir:J,scalar:A}}}this.ready();this.requestRender()}}_createTransforms(){return{displayViewScreenMat3:v.create()}}setTransform(A){const J=B.identity(this.transforms.displayViewScreenMat3),[q,r]=A.toScreenNoRotation([0,0],[this.x,this.y]);var p=this.resolution/this.pixelRatio/A.resolution;const y=p*this.width; p*=this.height;const Q=Math.PI*this.rotation/180;B.translate(J,J,I.fromValues(q,r));B.translate(J,J,I.fromValues(y/2,p/2));B.rotate(J,J,-Q);B.translate(J,J,I.fromValues(-y/2,-p/2));B.scaleByVec2(J,J,I.fromValues(y,p));B.multiply(this.transforms.displayViewScreenMat3,A.displayViewMat3,J)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(A,J){const {vertexData:q,indexData:r}=J;J=R.BufferObject.createVertex(A,T.Usage.STATIC_DRAW,new Float32Array(q));const p=R.BufferObject.createIndex(A, T.Usage.STATIC_DRAW,new Uint32Array(r)),y=D.createProgramDescriptor("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:T.DataType.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:T.DataType.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:T.DataType.FLOAT,normalized:!1}]});return{vao:new M.VertexArrayObject(A,y.attributes,y.bufferLayouts,{geometry:J},p),elementCount:r.length}}}m.RasterVFDisplayObject=t;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})}, "esri/views/layers/ImageryLayerView":function(){define("../../chunks/tslib.es6 ../../core/Error ../../core/promiseUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../../geometry/Point ../../layers/support/timeSupport ../../rest/support/Query ./support/popupUtils".split(" "),function(m,H,B,v,I,L,U,D,R,T,M,t){return A=>{A=class extends A{constructor(){super(...arguments);this.view=null}get timeExtent(){return T.combineTimeExtent(this.layer, this.view?.timeExtent,this._get("timeExtent"))}async fetchPopupFeaturesAtLocation(J,q){const {layer:r}=this;if(!J)throw new H("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:r});var {popupEnabled:p}=r;const y=t.getFetchPopupTemplate(r,q);if(!p||null==y)return[];const Q=await y.getRequiredFields();B.throwIfAborted(q);p=new M;p.timeExtent=this.timeExtent;p.geometry=J;p.outFields=Q;p.outSpatialReference=J.spatialReference;const {resolution:a,spatialReference:b}=this.view; J="2d"===this.view.type?new R(a,a,b):new R(.5*a,.5*a,b);const {returnTopmostRaster:d,showNoDataRecords:g}=y.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1};return r.queryVisibleRasters(p,{returnDomainValues:!0,returnTopmostRaster:d,pixelSize:J,showNoDataRecords:g,signal:q?.signal}).then(e=>e)}canResume(){return!super.canResume()||this.timeExtent?.isEmpty?!1:!0}};m.__decorate([v.property()],A.prototype,"layer",void 0);m.__decorate([v.property()],A.prototype,"suspended",void 0);m.__decorate([v.property({readOnly:!0})], A.prototype,"timeExtent",null);m.__decorate([v.property()],A.prototype,"view",void 0);return A=m.__decorate([D.subclass("esri.views.layers.ImageryLayerView")],A)}})},"esri/layers/support/timeSupport":function(){define(["exports","../../support/timeUtils"],function(m,H){m.combineTimeExtent=function(B,v,I){if(null==B?.timeInfo)return null;const {datesInUnknownTimezone:L=!1,timeOffset:U,useViewTime:D}=B;B=B.timeExtent;L&&(B=H.toLocalTimeExtent(B));v=D?v&&B?v.intersection(B):v||B:B;if(!v||v.isEmpty|| v.isAllTime)return v;U&&(v=v.offset(-U.value,U.unit));L&&(v=H.toUTCTimeExtent(v));return v.equals(I)?I:v};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,H,B,v,I,L,U,D,R){function T(q){return void 0!==q.timeInfo}async function M(q,r){return q.widgets?.timeSlider?.fullTimeExtent?? t(q.allLayers,r)}async function t(q,r){if(0===q.length)return H.allTime;await Promise.all(q.map(a=>a.load({signal:r})));var p=q.filter(T),y=q.filter(a=>!T(a)&&null!=a.visibilityTimeExtent);if(0===p.length&&0===y.length)return H.allTime;q=[];const Q=[];for(const a of p)"feature"!==a?.type&&"map-image"!==a?.type||!a.timeInfo?.hasLiveData?Q.push(a):q.push(a);p=a=>null==a||a.isAllTime;y=[...Q.map(a=>{const b=a.timeInfo?.fullTimeExtent;({visibilityTimeExtent:a}=a);return b?.intersection(a)??a}),...y.map(a=> a.visibilityTimeExtent)];if(y.some(p))return H.allTime;q=q.map(async a=>{const b=(await a.fetchRecomputedExtents({signal:r}))?.timeExtent??a.timeInfo?.fullTimeExtent;({visibilityTimeExtent:a}=a);return b?.intersection(a)??a});q=(await Promise.allSettled(q)).map(a=>"fulfilled"===a.status?a.value:null);if(q.some(p))return H.allTime;q=[...q,...y].filter(B.isSome);return 0===q.length?H.allTime:q.reduce((a,b)=>a.union(b))}function A(q,r){q=q.currentTimeExtent;if(!q)return null;const {start:p,end:y}=q; q=p??y??null;switch(r){case "time-window":return new H({start:p,end:y});case "cumulative-from-start":return new H({start:null,end:q});case "cumulative-from-end":return new H({start:q,end:null});case "instant":return new H({start:q,end:q})}}async function J(q,r){if(!D.isWebMap(q)&&!R.isWebScene(q))return null;await q.load({signal:r});var p=q?.widgets?.timeSlider;if(!p)return null;q=await M(q,r);r=p.loop;var y=p.numThumbs??2;var Q=p.currentTimeExtent;if(Q){const {start:b,end:d}=Q;y=null!=b&&null!=d&& b.getTime()===d.getTime()?"instant":2===y?"time-window":null==b||0===b.getTime()?"cumulative-from-start":"cumulative-from-end"}else y=2===y?"time-window":"cumulative-from-start";Q=p.stopDelay??2E3;{const {numStops:b,stopInterval:d,stops:g}=p;var a=g?{dates:I.clone(g)}:d?{interval:d.clone()}:{count:b??5}}p=A(p,y);return{fullTimeExtent:q,loop:r,mode:y,playRate:Q,stops:a,timeExtent:p}}m.getTimeExtentFromLayers=t;m.getTimeSliderSettingsFromWebDocument=J;m.getTimeSliderSettingsFromWebMap=async function(q, r){v.deprecatedFunction(L.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!=q&&D.isWebMap(q)?await J(q,r):null};m.toLocalTimeExtent= function(q){if(!q)return q;const {start:r,end:p}=q;return new H({start:null!=r?U.offsetDate(r,r.getTimezoneOffset(),"minutes"):r,end:null!=p?U.offsetDate(p,p.getTimezoneOffset(),"minutes"):p})};m.toUTCTimeExtent=function(q){if(!q)return q;const {start:r,end:p}=q;return new H({start:null!=r?U.offsetDate(r,-r.getTimezoneOffset(),"minutes"):r,end:null!=p?U.offsetDate(p,-p.getTimezoneOffset(),"minutes"):p})};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/webscene/utils":function(){define(["exports", "../support/tagSymbols"],function(m,H){m.isWebScene=function(B){return null!=B&&"object"===typeof B&&H.WebSceneTag in B};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/support/tagSymbols":function(){define(["exports"],function(m){const H=Symbol("WebScene");m.WebSceneTag=H;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/layers/support/popupUtils":function(){define(["exports","../../../layers/support/fieldUtils"],function(m,H){function B(v,I){return v.popupTemplate? v.popupTemplate:null!=I&&I.defaultPopupTemplateEnabled&&null!=v.defaultPopupTemplate?v.defaultPopupTemplate:null}m.getFetchPopupTemplate=B;m.getRequiredFields=async function(v,I=v.popupTemplate){if(null==I)return[];const L=await I.getRequiredFields(v.fieldsIndex);({lastEditInfoEnabled:I}=I);const {objectIdField:U,typeIdField:D,globalIdField:R,relationships:T}=v;if(L.includes("*"))return["*"];I=I?H.getFeatureEditFields(v):[];const M=H.fixFields(v.fieldsIndex,[...L,...I]);D&&M.push(D);M&&U&&v.fieldsIndex?.has(U)&& !M.includes(U)&&M.push(U);M&&R&&v.fieldsIndex?.has(R)&&!M.includes(R)&&M.push(R);T&&T.forEach(t=>{({keyField:t}=t);M&&t&&v.fieldsIndex?.has(t)&&!M.includes(t)&&M.push(t)});return M};m.hasPopupTemplate=function(v,I){return null!=B(v,{defaultPopupTemplateEnabled:I})};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,H,B,v,I,L,U,D){return R=>{R=class extends R{initialize(){this.addHandles(v.on(()=>this.layer,"refresh",T=>{this.doRefresh(T.dataChanged).catch(M=>{B.isAbortError(M)||H.getLogger(this).error(M)})}),"RefreshableLayerView")}};return R=m.__decorate([D.subclass("esri.views.layers.RefreshableLayerView")],R)}})},"*noref":1}}); define("../../../chunks/tslib.es6 ../../../Graphic ../../../core/Collection ../../../core/handleUtils ../../../core/has ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../support/GraphicsCollection ../engine/flow/FlowView2D ./LayerView2D ./graphics/GraphicsView2D ./graphics/HighlightGraphicContainer ./imagery/ImageryView2D ./imagery/VectorFieldView2D ../../layers/ImageryLayerView ../../layers/LayerView ../../layers/RefreshableLayerView".split(" "),function(m, H,B,v,I,L,U,D,R,T,M,t,A,J,q,r,p,y,Q,a){D=class extends y(a(A.LayerView2DMixin(Q))){constructor(){super(...arguments);this._exportImageVersion=-1;this._highlightGraphics=new M.GraphicsCollection;this._highlightView=void 0;this.subview=this.layer=null}get pixelData(){const {subview:b}=this;return this.updating||!b?null:"getPixelData"in b?b.getPixelData():null}update(b){this.subview?.update(b)}attach(){this.layer.increaseRasterJobHandlerUsage();this._setSubView();this.view&&(this._highlightView=new J({view:this.view, graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new q(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container));this.addAttachHandles([L.watch(()=>this.layer.exportImageServiceParameters.version,b=>{b&&this._exportImageVersion!==b&&(this._exportImageVersion=b,this.requestUpdate())},L.sync),L.watch(()=>this.timeExtent,b=>{const {subview:d}=this;d&&(d.timeExtent=b,"redraw"in d?this.requestUpdate():d.redrawOrRefetch())},L.sync), this.layer.on("redraw",()=>{const {subview:b}=this;b&&("redraw"in b?b.redraw():b.redrawOrRefetch())}),L.watch(()=>this.layer.renderer,()=>this._setSubView())])}detach(){this.layer.decreaseRasterJobHandlerUsage();this.container.removeAllChildren();this._detachSubview(this.subview);this.subview?.destroy();this.subview=null;this._highlightView?.destroy();this._exportImageVersion=-1}viewChange(){}moveEnd(){this.requestUpdate()}highlight(b,d){if(!((Array.isArray(b)?b[0]:B.isCollection(b)?b.at(0):b)instanceof H))return v.makeHandle();let g=[];Array.isArray(b)||B.isCollection(b)?g=b.map(e=>e.clone()):b instanceof H&&(g=[b.clone()]);this._highlightGraphics.addMany(g);return v.makeHandle(()=>this._highlightGraphics.removeMany(g))}async doRefresh(){this.requestUpdate()}isUpdating(){const b=!this.subview||this.subview.updating||!!this._highlightView?.updating;I("esri-2d-log-updating")&&console.log(`Updating ImageryLayerView2D (${this.layer.id}): ${b}\n-> subview ${!this.subview||this.subview.updating}\n-> higlightView ${this._highlightView?.updating}\n`); return b}_setSubView(){if(this.view){var b=this.layer.renderer?.type,d="imagery";"vector-field"===b?d="imageryVF":"flow"===b&&(d="flow");if(this.subview){({type:b}=this.subview);if(b===d){this._attachSubview(this.subview);"flow"===b?this.subview.redrawOrRefetch():"imagery"===b&&"lerc"===this.layer.format?this.subview.redraw():this.requestUpdate();return}this._detachSubview(this.subview);this.subview?.destroy()}this.subview="imagery"===d?new r({layer:this.layer,view:this.view,timeExtent:this.timeExtent}): "imageryVF"===d?new p({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new t({layer:this.layer,layerView:this});this._attachSubview(this.subview);this.requestUpdate()}}_attachSubview(b){b&&!b.attached&&(b.attach(),b.attached=!0,this.container.addChildAt(b.container,0))}_detachSubview(b){b?.attached&&(this.container.removeChild(b.container),b.detach(),b.attached=!1)}};m.__decorate([U.property()],D.prototype,"pixelData",null);m.__decorate([U.property()],D.prototype,"subview",void 0);return D= m.__decorate([T.subclass("esri.views.2d.layers.ImageryLayerView2D")],D)});