@arcgis/core 5.0.0-next.32 → 5.0.0-next.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/22f745539ca54d8cd30d.js +1 -0
- package/assets/esri/core/workers/chunks/2613e482450b57f2d4f5.js +1 -0
- package/assets/esri/core/workers/chunks/{1dfca37f95f2b968aa54.js → 39d2b540738431adec98.js} +1 -1
- package/assets/esri/core/workers/chunks/446f76356fc116204ec3.js +1 -0
- package/assets/esri/core/workers/chunks/44b6b7418cbf7f778bef.js +1 -0
- package/assets/esri/core/workers/chunks/4675ed3ca3e0104d00bf.js +1 -0
- package/assets/esri/core/workers/chunks/4df7cc3477bc46fc39af.js +1 -0
- package/assets/esri/core/workers/chunks/52ecbaa2d32692d6d8df.js +1 -0
- package/assets/esri/core/workers/chunks/{3777b41b4fa2f1418402.js → 55818fe7a7aa1e5c8bbd.js} +1 -1
- package/assets/esri/core/workers/chunks/{7e6fae3660e7a6a0fa16.js → 5f781ef46ce7c4048c2f.js} +1 -1
- package/assets/esri/core/workers/chunks/63933cbcb5c12df09715.js +1 -0
- package/assets/esri/core/workers/chunks/706423d801fa9cbf2e90.js +1 -0
- package/assets/esri/core/workers/chunks/{e6df4327ac1d9b65b80d.js → 71dd80231ea656a6380c.js} +1 -1
- package/assets/esri/core/workers/chunks/725819839434c59102f3.js +1 -0
- package/assets/esri/core/workers/chunks/72cebf18da5ec5eeb666.js +1 -0
- package/assets/esri/core/workers/chunks/{bd58c027408dc858f23c.js → 77b45957cfe42523c1c8.js} +1 -1
- package/assets/esri/core/workers/chunks/852de585a72d902344a6.js +1 -0
- package/assets/esri/core/workers/chunks/{25fd0884dd14973c89f5.js → 866a608d489bf56bc371.js} +1 -1
- package/assets/esri/core/workers/chunks/871dd5e1f016a04b8d98.js +1 -0
- package/assets/esri/core/workers/chunks/892c417f5130b003889d.js +1 -0
- package/assets/esri/core/workers/chunks/907083c427d7fb4354e9.js +1 -0
- package/assets/esri/core/workers/chunks/{3bacd904cd93c8013f6a.js → ae793d814cf32db9fbde.js} +1 -1
- package/assets/esri/core/workers/chunks/{e0b70652da4a7f672cfc.js → b21cf62652ca772108c8.js} +1 -1
- package/assets/esri/core/workers/chunks/c2596f48b37092dd566c.js +1 -0
- package/assets/esri/core/workers/chunks/c82a974c8448407885e6.js +1 -0
- package/assets/esri/core/workers/chunks/c9c2e00fed979c21e2f0.js +1 -0
- package/assets/esri/core/workers/chunks/{94005916d321c879bea1.js → cb500d673ca7ec1ef945.js} +1 -1
- package/assets/esri/core/workers/chunks/d239a4ef60e348cfb05a.js +1 -0
- package/assets/esri/core/workers/chunks/d6d03f22c91f528b97e5.js +1 -0
- package/assets/esri/core/workers/chunks/{4ab89c990a82c745c0fd.js → d764b6273974f4bca31b.js} +1 -1
- package/assets/esri/core/workers/chunks/d86e59da76eea888ba86.js +1 -0
- package/assets/esri/core/workers/chunks/dc3a4ad62bc041a4f899.js +1 -0
- package/assets/esri/core/workers/chunks/df458ad51be27df3d79d.js +1 -0
- package/assets/esri/core/workers/chunks/{01b8e680befff83e7d3e.js → e093e745708f722bc1b9.js} +1 -1
- package/assets/esri/core/workers/chunks/e32fc0b2c6530d28ce85.js +1 -0
- package/assets/esri/core/workers/chunks/e3a994587f9b2e88db85.js +1 -0
- package/assets/esri/core/workers/chunks/ea5bf896acfcc3106bf5.js +1 -0
- package/assets/esri/core/workers/chunks/{a74e6d505a55ed27f004.js → f11453f24c0b728669d2.js} +1 -1
- package/assets/esri/core/workers/chunks/f2ebd6471e1259a6eac0.js +1 -0
- package/assets/esri/core/workers/chunks/f3c232fc56a29d51196a.js +1 -0
- package/chunks/Envelope.js +1 -1
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/chunks/Geometry.js +1 -1
- package/chunks/GlowComposition.glsl.js +5 -5
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/UnitFactory.js +1 -1
- package/config.js +1 -1
- package/geometry/SpatialReference.js +1 -1
- package/geometry/operators/support/apiConverter.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/spatialReferenceUtils.js +1 -1
- package/interfaces.d.ts +497 -0
- package/kernel.js +1 -1
- package/layers/catalog/CatalogDynamicGroupLayer.js +1 -1
- package/layers/graphics/data/AttributesBuilder.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/package.json +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/rest/query/operations/query.js +1 -1
- package/rest/support/LocateSetting.d.ts +4 -0
- package/rest/support/LocateSetting.js +5 -0
- package/rest/support/LocateSettingBase.d.ts +4 -0
- package/rest/support/LocateSettingBase.js +5 -0
- package/rest/support/LocateSettingSource.d.ts +4 -0
- package/rest/support/LocateSettingSource.js +5 -0
- package/rest/support/LocateSettings.d.ts +4 -0
- package/rest/support/LocateSettings.js +5 -0
- package/rest/support/LocateSettingsOverrides.d.ts +4 -0
- package/rest/support/LocateSettingsOverrides.js +5 -0
- package/rest/support/RouteParameters.js +1 -1
- package/statistics/utils.js +1 -1
- package/support/revision.js +1 -1
- package/views/3d/GroundView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
- package/views/3d/state/ConstraintsManager.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/support/CombinedElevationProvider.js +1 -1
- package/views/3d/support/ElevationRange.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +5 -0
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +5 -0
- package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
- package/views/3d/terrain/ElevationBounds.js +1 -1
- package/views/3d/terrain/ElevationData.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +12 -12
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentDataConstants.js +5 -0
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +10 -13
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +7 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowCompositionTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowPresets.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/BufferManager.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFields.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +24 -31
- package/views/Attribution.js +1 -1
- package/views/DOMContainer.js +1 -1
- package/views/View.js +1 -1
- package/views/support/GroundElevationSampler.js +1 -1
- package/assets/esri/core/workers/chunks/0a1df5a724fe253b3866.js +0 -1
- package/assets/esri/core/workers/chunks/155d74b9c0ef31dc2316.js +0 -1
- package/assets/esri/core/workers/chunks/2c8c48433b380da59831.js +0 -1
- package/assets/esri/core/workers/chunks/31b5747a254d13acc58e.js +0 -1
- package/assets/esri/core/workers/chunks/3ac84e324d212815e252.js +0 -1
- package/assets/esri/core/workers/chunks/41a00c77e6f7ce61e476.js +0 -1
- package/assets/esri/core/workers/chunks/45729d006db6a569715f.js +0 -1
- package/assets/esri/core/workers/chunks/50cf3cbcad2be1c1e210.js +0 -1
- package/assets/esri/core/workers/chunks/565358ea8d1bdc4d1ebc.js +0 -1
- package/assets/esri/core/workers/chunks/592afe1a41bed3b0cc31.js +0 -1
- package/assets/esri/core/workers/chunks/5aeda8a1f2ccabfdf40f.js +0 -1
- package/assets/esri/core/workers/chunks/657d9e5145da1306ace8.js +0 -1
- package/assets/esri/core/workers/chunks/7f7a81ed8893ab649af7.js +0 -1
- package/assets/esri/core/workers/chunks/7ffef8a19166f6b564d8.js +0 -1
- package/assets/esri/core/workers/chunks/819781a209608dcdd678.js +0 -1
- package/assets/esri/core/workers/chunks/8d57e3a0e5687ce15557.js +0 -1
- package/assets/esri/core/workers/chunks/8e9a5d38da40702def80.js +0 -1
- package/assets/esri/core/workers/chunks/aac313257a8b1ae75b75.js +0 -1
- package/assets/esri/core/workers/chunks/be06c8a58c217a17451b.js +0 -1
- package/assets/esri/core/workers/chunks/d56548a994753b08403c.js +0 -1
- package/assets/esri/core/workers/chunks/dd95e679618b7b21a7b1.js +0 -1
- package/assets/esri/core/workers/chunks/e08a1934d98e7324776d.js +0 -1
- package/assets/esri/core/workers/chunks/e5deb72df8b2505fd325.js +0 -1
- package/assets/esri/core/workers/chunks/e689a4849f5af3f2f641.js +0 -1
- package/assets/esri/core/workers/chunks/f259ad785ce3aa970792.js +0 -1
- package/assets/esri/core/workers/chunks/f4919950a9a3703d9da3.js +0 -1
- package/assets/esri/core/workers/chunks/f6ce485c082d0d640b01.js +0 -1
- package/assets/esri/core/workers/chunks/fd9ef4b8c969962cf72b.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{equals as r,binaryIndexOf as s}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import n from"../../../../../core/Logger.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as o,destroyMaybe as a}from"../../../../../core/maybe.js";import{isAbortError as l,onAbortOrThrow as c}from"../../../../../core/promiseUtils.js";import{property as d,subclass as h}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as u,transpose as g,invert as m}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as p}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{h as _,d as y,a as b,g as w}from"../../../../../chunks/vec32.js";import{create as j,clone as O}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as E}from"../../../../../core/support/UpdatingHandles.js";import{c as v}from"../../../../../chunks/vec33.js";import{maxElevationOffset as x}from"../../collections/Component/Material/shader/ComponentData.glsl.js";import{TwoVectorPosition as M}from"../../core/util/TwoVectorPosition.js";import{Attribute as T}from"../Attribute.js";import{GridLocalOriginFactory as R}from"../GridLocalOriginFactory.js";import{applyToModelMatrix as C}from"../localOriginHelper.js";import{LocalOriginManager as A}from"../LocalOriginManager.js";import{Object3D as P}from"../Object3D.js";import{VertexArrayObject as D}from"../VertexArrayObject.js";import{VertexLayout as k,glVertexLayout as L,EdgeInputBufferLayout as S,RegularEdgeInstancesGLLayout as U,SilhouetteEdgeInstancesGLLayout as q}from"./bufferLayouts.js";import{EdgeRenderer as H,lineWidthFractionFactor as V,extensionLengthOffset as B}from"./EdgeRenderer.js";import{EdgePassParameters as I}from"./EdgeShaderParameters.js";import{EdgeWorkerHandle as F}from"./EdgeWorkerHandle.js";import{generateStrokesTexture as N}from"./strokes.js";import{determineRendererType as W,determineEdgeTransparency as z,determineObjectTransparency as G,fillComponentBufferIndices as K}from"./util.js";import{BufferManager as J}from"../TextureBackedBuffer/BufferManager.js";import{VertexBuffer as Q}from"../../../../webgl/VertexBuffer.js";const X=128;let Y=class extends t{constructor(e){super(e),this._updatingHandles=new E,this._objectEntries=new Map,this._pendingDeletions=new Map,this._renderers=new Map,this._gpuMemoryUsage=0,this._workerAbort=new AbortController,this._tmpModelPosition=j(),this._localOrigins=new A(new R(e.renderSR));const t=k.createBuffer(4);for(let r=0;r<4;r++)t.sideness.set(r,0,0===r||3===r?0:1),t.sideness.set(r,1,0===r||1===r?0:1);this._vertexBuffer=new Q(e.rctx,L,t.buffer)}initialize(){this._workerHandle=new F(this.schedule),this._componentColorManager=new J(this.rctx,fe)}destroy(){this.destroyed||(this._objectEntries.forEach(e=>this._discardObjectEntry(e)),this._objectEntries.clear(),this._pendingDeletions.forEach(e=>this._discardObjectEntry(e)),this._pendingDeletions.clear(),this._strokesTexture=o(this._strokesTexture),this._componentColorManager=a(this._componentColorManager),this._workerAbort.abort(),this._workerHandle.destroy(),this._vertexBuffer.dispose(),this._renderers.clear(),this._updatingHandles.destroy(),this._set("schedule",pe))}get updating(){return this._updatingHandles.updating}get usedMemory(){return this._gpuMemoryUsage}shouldRender(){return this._renderers.size>0}async addComponentObject(e,t,r,s,n,i,o){if(this.hasObject(e))return this._getObjectMemoryUsage(e);let a;const l=new ee(null,new Promise(e=>a=e),e.obb.center,e.obb.radius);this._objectEntries.set(e,l);const c=await this._updatingHandles.addPromise(this._addComponentGeometry(e.transform,l,t,r,s,n,i,o));return this.setNeedsRender(),a(),c}async addOrUpdateObject3D(e,t,r,s){if(this.destroyed)return void n.getLogger(this).warn("Attempt to add an object to a destroyed instance");const i=new AbortController;let o;const{center:a,radius:c}=e.boundingVolumeWorldSpace.bounds,d=new ee(i,new Promise(e=>o=e),a,c),h=this._objectEntries.get(e);h&&(this._pendingDeletions.has(e)?this._discardObjectEntry(h):this._pendingDeletions.set(e,h)),this._objectEntries.set(e,d);try{const n=new Array;if(e.geometries.length>1&&$(e))n.push(this._addObjectMergedGeometries(e,d,t,r,s));else for(const i of e.geometries)i.material.supportsEdges&&n.push(this._addGeometry(e,d,i,t,r,s));await this._updatingHandles.addPromise(Promise.all(n)),this._removePendingDeletion(e)}catch(u){l(u)?this._discardObjectEntry(d):this._removePendingDeletion(e)}finally{this.setNeedsRender(),o()}}removeObject(e){const t=this._objectEntries.get(e);this._objectEntries.delete(e),this._discardObjectEntry(t),this._removePendingDeletion(e)}_removePendingDeletion(e){const t=this._pendingDeletions.get(e);this._pendingDeletions.delete(e),this._discardObjectEntry(t)}async _getObjectEntry(e){const t=this._objectEntries.get(e);if(!t)throw new Error("no object");return await t.loaded,null==t.loaded?null:t}fastUpdateObject3DEdgesTransform(e){if(this.destroyed)return!1;const t=this._objectEntries.get(e);if(!t)return!1;const{geometries:r}=e,{renderables:s}=t;if(0===r.length||0===s.length)return!0;if(s.length>1)return!1;const[n]=s,i=n.transform;if(!(i instanceof se))return!1;const[o]=r;if(o.localOrigin!==i.origin.origin)return!1;const a=f(),l=this._computeModelTransformWithLocalOrigin(e,o,a);return n.transform=new se(a,l),this.setNeedsRender(),!0}_discardObjectEntry(e){e&&(e.abort?.abort(),e.renderables.length&&(e.renderables.forEach(e=>this._removeRenderable(e)),this.setNeedsRender()),e.loaded=null)}hasObject(e){return this._objectEntries.has(e)}async updateAllComponentOpacities(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));if(null==r)return;const s=Array.isArray(t)?e=>t[e]:()=>t;r.renderables.forEach(e=>{const{meta:t,buffer:r}=e.components,n=t.length,i=r.textureBuffer.getScalarField("opacity");for(let o=0;o<n;o++){const e=s(o),r=t[o],n=r.index;r.material.opacity=e,i.set(n,255*e)}this._updateTransparency(e)}),this.setNeedsRender()}async _getObjectMemoryUsage(e){const t=await this._getObjectEntry(e);return t?t.renderables.reduce((e,t)=>e+t.statistics.gpuMemoryUsage,0):0}async updateAllComponentMaterials(e,t,r,s){const n=e instanceof P,i=W(t),o=H.getKey(i,r,n),a=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=a&&(a.renderables.forEach(e=>{if(o!==e.rendererKey){const t=this._renderers.get(e.rendererKey),s=this._acquireRenderer(i,r,n);t.removeRenderable(e),--t.refCount,e.rendererKey=o,s.addRenderable(e)}if(Array.isArray(t))for(let r=0;r<t.length;r++)e.components.meta[r].material=t[r];else e.components.meta[0].material=t;s&&oe(e.components),this._updateTransparency(e)}),this.setNeedsRender())}async updateAllVerticalOffsets(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=r&&this._updateAllVerticalOffsets(r,t)}_updateAllVerticalOffsets(e,t){e.renderables.forEach(e=>{const r=e.components.meta;for(let s=0;s<r.length;s++)e.components.meta[s].verticalOffset=t?.[s]??0;oe(e.components)}),this.setNeedsRender()}async updateObjectVisibility(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));r&&(r.renderables.forEach(e=>e.visible=t),this.setNeedsRender())}render(e,t){if(null==this._componentColorManager)return;this._localOrigins.updateViewMatrices(e.camera.viewMatrix);const r=e.camera.viewInverseTransposeMatrix,s=j(),n=new M;let i=0,o=0;if(this._renderers.forEach(r=>{0!==r.refCount?(++this.techniques.precompiling,r.forEachRenderable(t=>{t.visible&&(i+=t.statistics.averageEdgeLength,o++,t.regular&&r.acquireTechnique(e,!1),t.silhouette&&r.acquireTechnique(e,!0))},t),--this.techniques.precompiling):this._renderers.delete(r.key)}),this._componentColorManager.garbageCollect(),this._componentColorManager.updateTextures(),0===o)return;const a=new I(40*i/o,t);_(s,r[3],r[7],r[11]),n.set(s),y(a.transformWorldFromViewTH,n.high),y(a.transformWorldFromViewTL,n.low),u(a.transformViewFromCameraRelativeRS,e.camera.viewMatrix),g(me,a.transformViewFromCameraRelativeRS),m(a.transformNormalViewFromGlobal,me),this._updateObjectCameraDistances(e),this._renderers.forEach(t=>{ae(t,e,a),le(t,e,a)})}_updateTransparency(e){const t=z(e.components.meta),r=G(e.components.meta);t===e.edgeTransparency&&r===e.objectTransparency||(e.edgeTransparency=t,e.objectTransparency=r,this._renderers.get(e.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(e,t,r){e.getCombinedShaderTransformation(t,r);const s=null!=t.localOrigin?this._localOrigins.register(t.localOrigin):this._localOrigins.acquire(_(this._tmpModelPosition,r[12],r[13],r[14]));return t.localOrigin=s.origin,C(s.origin.vec3,r),s}_createComponentBuffers(e){if(null==this._componentColorManager)return null;const t=new Array,r=this._componentColorManager.getBuffer(e.length),s=r.acquireIndices(e.length);for(let i=0;i<e.length;i++){const r=e[i],n=s[i];t.push({index:n,verticalOffset:0,material:r})}const n=new te(r,t);return oe(n),n}_extractEdges(e,t,r,s,n,i,o=i.length){return o<X&&(n=!0),this._workerHandle.process({data:r,indices:i,indicesLength:o,writerSettings:t,skipDeduplicate:s},e,n)}_createRenderable(e,t,r,s,n){const i=t=>new re(new D(this.rctx,new Map([["vertices",this._vertexBuffer],["instances",0===t?new Q(this.rctx,U,e.regular.instancesData.buffer):new Q(this.rctx,q,e.silhouette.instancesData.buffer)]])),0===t?e.regular.lodInfo:e.silhouette.lodInfo),o=e.regular.lodInfo.lengths.length>0?i(0):null,a=e.silhouette.lodInfo.lengths.length>0?i(1):null,l=(o?.vao.usedMemory??0)+(a?.vao.usedMemory??0);return new ne(o,a,{gpuMemoryUsage:l,externalMemoryUsage:n,averageEdgeLength:e.averageEdgeLength},r,z(t.meta),G(t.meta),t,s)}async _addGeometry(e,t,r,s,n,i){if(r.edgeIndicesLength<=0)return;const o=r.attributes.get("position"),a=f(),l=this._computeModelTransformWithLocalOrigin(e,r,a),c=new ge(o,a,l);return this._addPositionData(t,c,r.edgeIndicesLength,s,n,i)}async _addPositionData(e,t,r,s,n,i=!1){if(null==e.loaded)return;const o=this._createComponentBuffers([s]);if(null==o)return;const a=this._acquireRenderer(s.type,n,!0),{modelTransform:l,origin:c}=t,d=t.position.indices,h=t.position,u=h.data.length/h.size,g=S.createBuffer(u);for(let f=0;f<u;f++)g.position.set(f,0,h.data[f*h.size]),g.position.set(f,1,h.data[f*h.size+1]),g.position.set(f,2,h.data[f*h.size+2]);K(o.meta,[0,g.componentIndex.count],g.componentIndex);const m=await this._updatingHandles.addPromise(this._extractEdges(e.abort?.signal||this._workerAbort.signal,a.writerSettings,g,!1,i,d,r));if(null==e.loaded)return;const p=this._createRenderable(m,o,new se(l,c),a.key,!1);e.renderables.push(p),a.addRenderable(p),this._gpuMemoryUsage+=p.statistics.gpuMemoryUsage}async _addComponentGeometry(e,t,r,s,n,i,o,a){if(null==t.loaded)return 0;const l=this._createComponentBuffers(i);if(null==l)return 0;const c=W(i),d=this._acquireRenderer(c,o||!1,!1),h=S.createBuffer(r.length/3);v(h.position.typedBuffer,r,h.position.typedBufferStride,3),K(l.meta,n,h.componentIndex,s);const u=!0,g=d.writerSettings,m=await this._updatingHandles.addPromise(this._extractEdges(this._workerAbort.signal,g,h,u,!1,s));if(null==t.loaded)return 0;const p=this._createRenderable(m,l,e,d.key,!0);return t.renderables.push(p),d.addRenderable(p),this._updateAllVerticalOffsets(t,a),p.statistics.gpuMemoryUsage}async _addObjectMergedGeometries(e,t,r,s,n){const i=new Map;let o=0,a=0,l=null;const c=e.geometries.filter(e=>{if(e.edgeIndicesLength<=0||!e.material.supportsEdges)return!1;!l&&e.localOrigin&&(l=e);const t=e.positionAttribute;return a+=t.data.length/t.size,o+=e.edgeIndicesLength,!0});if(0===c.length)return;const d=a>=65536?Uint32Array:Uint16Array,h=o?new d(o):null,u=[];let g=0;c.forEach(e=>{const t=e.attributes.get("position"),r=t.indices;let s=i.get(t.data);if(null==s){s=u.length/3;for(let e=0;e<t.data.length;e+=t.size)u.push(t.data[e]),u.push(t.data[e+1]),u.push(t.data[e+2]);i.set(t.data,s)}for(let n=0;n<e.edgeIndicesLength;n++)h[g++]=s+r[n]});const m=l||e.geometries[0],p=f(),_=this._computeModelTransformWithLocalOrigin(e,m,p);for(let f=0;f<e.geometries.length;f++)e.geometries[f].localOrigin=_.origin;const y=new ge(new T(u,h,3),p,_);await this._updatingHandles.addPromise(this._addPositionData(t,y,h.length,r,s,n))}_acquireRenderer(e,t,r){const s=H.getKey(e,t,r);let n=this._renderers.get(s);return null==this._strokesTexture&&(this._strokesTexture=N(this.rctx)),n||(n=new H(this.rctx,this.techniques,{type:e,hasSlicePlane:t,strokesTexture:this._strokesTexture,legacy:r,spherical:1===this.viewingMode}),this._renderers.set(s,n)),++n.refCount,n}_removeRenderable(e){Z(e.regular),Z(e.silhouette);const t=this._renderers.get(e.rendererKey);if(t){t.removeRenderable(e),--t.refCount,this._localOrigins.release(e.transform.origin),this._gpuMemoryUsage-=e.statistics.externalMemoryUsage?0:e.statistics.gpuMemoryUsage;for(const t of e.components.meta)e.components.buffer.releaseIndex(t.index)}}_updateObjectCameraDistances(e){const t=e.camera.eye,r=e.camera.viewForward,s=j(),n=e=>{b(s,e.center,t);const n=w(s,r),i=e.radius,o=n<-i?1/0:n<i?0:n-i;e.renderables.forEach(e=>e.distanceToCamera=o)};this._objectEntries.forEach(n),this._pendingDeletions.forEach(n)}get test(){}};function Z(e){e?.vao&&(e.vao.buffer("instances")?.dispose(),e.vao.disposeVAOOnly(),e.vao=null)}function $(e){let t=null,s=null;for(const n of e.geometries){if(n.material.supportsEdges){if(t){if(!r(t,n.transformation))return!1}else t=n.transformation;if(s||null==n.localOrigin){if(null!=s?.localOrigin&&null!=n.localOrigin&&s.localOrigin.id!==n.localOrigin.id)return!1}else s=n}}return!0}e([d({constructOnly:!0})],Y.prototype,"rctx",void 0),e([d({constructOnly:!0})],Y.prototype,"renderSR",void 0),e([d({constructOnly:!0})],Y.prototype,"viewingMode",void 0),e([d({constructOnly:!0})],Y.prototype,"techniques",void 0),e([d({constructOnly:!0})],Y.prototype,"setNeedsRender",void 0),e([d({constructOnly:!0})],Y.prototype,"schedule",void 0),e([d({readOnly:!0})],Y.prototype,"_updatingHandles",void 0),e([d({readOnly:!0})],Y.prototype,"updating",null),Y=e([h("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView")],Y);class ee{constructor(e,t,r,s){this.abort=e,this.radius=s,this.renderables=new Array;const n=e?c(e.signal,()=>e.abort()):null;this.loaded=t,this.loaded.then(()=>{null!=this.loaded&&(this.loaded=!0),this.abort=null,n?.remove()}),this.center=O(r)}}class te{constructor(e,t){this.buffer=e,this.meta=t}}class re{constructor(e,t){this.vao=e,this.lod=t}}class se{constructor(e,t){this.modelMatrix=e,this.origin=t}}class ne{constructor(e,t,r,s,n,i,o,a){this.regular=e,this.silhouette=t,this.statistics=r,this.transform=s,this.edgeTransparency=n,this.objectTransparency=i,this.components=o,this.rendererKey=a,this.distanceToCamera=0,this.visible=!0}}class ie extends ne{}function oe(e){const{meta:t,buffer:r}=e,s=r.textureBuffer,n=s.getVec4Field("color"),o=s.getScalarField("lineWidth"),a=s.getScalarField("extensionLength"),l=s.getScalarField("materialType"),c=s.getScalarField("opacity"),d=s.getScalarField("elevationOffset");for(let h=0;h<t.length;h++){const e=t[h].material,r=t[h].index,s=i(Math.round(e.size*V),0,255),u=i(e.extensionLength,-B,255-B)+B,g=255*e.opacity,m=e.color,p=255*m[0],f=255*m[1],_=255*m[2],y=255*m[3];n.setValues(r,p,f,_,y),o.set(r,s),a.set(r,u),l.set(r,e.type),c.set(r,g),d.set(r,t[h].verticalOffset)}}function ae(e,t,r){let s,n;const i=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable(i=>{if(!ce(i)||!i.visible)return;s??=e.acquireTechnique(t,!1),n??=e.rctx.bindTechnique(s,t,r);const a=ue(i.regular.lod.lengths,i.distanceToCamera,o);e.renderRegularEdges(n,i,r,t,a)},i)}function le(e,t,r){let s,n;const i=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable(i=>{if(!he(i)||!i.visible)return;s??=e.acquireTechnique(t,!0),n??=e.rctx.bindTechnique(s,t,r);const a=ue(i.silhouette.lod.lengths,i.distanceToCamera,o);e.renderSilhouetteEdges(n,i,r,t,a)},i)}function ce(e){return null!=e.regular}class de extends ne{}function he(e){return null!=e.silhouette}function ue(e,t,r){const n=t*r,i=s(e,n,!0);return-1===i?n<e[0]?e.length:0:e.length-i}class ge{constructor(e,t,r){this.position=e,this.modelTransform=t,this.origin=r}}const me=p(),pe=()=>Promise.reject(),fe=[{name:"color",type:"vec4u8"},{name:"lineWidth",type:"u8"},{name:"extensionLength",type:"u8"},{name:"materialType",type:"u8"},{name:"opacity",type:"u8"},{name:"elevationOffset",type:"packed-f32",maxValue:x}];export{Y as EdgeView,se as LegacyTransform,ie as RegularRenderable,ne as Renderable,de as SilhouetteRenderable};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{equals as r,binaryIndexOf as s}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import n from"../../../../../core/Logger.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as o,destroyMaybe as a}from"../../../../../core/maybe.js";import{isAbortError as c,onAbortOrThrow as l}from"../../../../../core/promiseUtils.js";import{property as d,subclass as h}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as u,transpose as g,invert as m}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as p}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{h as _,d as b,a as y,g as w}from"../../../../../chunks/vec32.js";import{create as j,clone as O}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as E}from"../../../../../core/support/UpdatingHandles.js";import{c as v}from"../../../../../chunks/vec33.js";import{TwoVectorPosition as x}from"../../core/util/TwoVectorPosition.js";import{Attribute as M}from"../Attribute.js";import{GridLocalOriginFactory as T}from"../GridLocalOriginFactory.js";import{applyToModelMatrix as R}from"../localOriginHelper.js";import{LocalOriginManager as C}from"../LocalOriginManager.js";import{Object3D as A}from"../Object3D.js";import{VertexArrayObject as P}from"../VertexArrayObject.js";import{VertexLayout as D,glVertexLayout as k,edgeViewTextureLayout as S,EdgeInputBufferLayout as L,RegularEdgeInstancesGLLayout as U,SilhouetteEdgeInstancesGLLayout as q}from"./bufferLayouts.js";import{EdgeRenderer as H,lineWidthFractionFactor as V,extensionLengthOffset as B}from"./EdgeRenderer.js";import{EdgePassParameters as I}from"./EdgeShaderParameters.js";import{EdgeWorkerHandle as F}from"./EdgeWorkerHandle.js";import{generateStrokesTexture as N}from"./strokes.js";import{determineRendererType as z,determineEdgeTransparency as W,determineObjectTransparency as G,fillComponentBufferIndices as K}from"./util.js";import{BufferManager as J}from"../TextureBackedBuffer/BufferManager.js";import{VertexBuffer as Q}from"../../../../webgl/VertexBuffer.js";const X=128;let Y=class extends t{constructor(e){super(e),this._updatingHandles=new E,this._objectEntries=new Map,this._pendingDeletions=new Map,this._renderers=new Map,this._gpuMemoryUsage=0,this._workerAbort=new AbortController,this._tmpModelPosition=j(),this._localOrigins=new C(new T(e.renderSR));const t=D.createBuffer(4);for(let r=0;r<4;r++)t.sideness.set(r,0,0===r||3===r?0:1),t.sideness.set(r,1,0===r||1===r?0:1);this._vertexBuffer=new Q(e.rctx,k,t.buffer)}initialize(){this._workerHandle=new F(this.schedule),this._componentColorManager=new J(this.rctx,S)}destroy(){this.destroyed||(this._objectEntries.forEach(e=>this._discardObjectEntry(e)),this._objectEntries.clear(),this._pendingDeletions.forEach(e=>this._discardObjectEntry(e)),this._pendingDeletions.clear(),this._strokesTexture=o(this._strokesTexture),this._componentColorManager=a(this._componentColorManager),this._workerAbort.abort(),this._workerHandle.destroy(),this._vertexBuffer.dispose(),this._renderers.clear(),this._updatingHandles.destroy(),this._set("schedule",fe))}get updating(){return this._updatingHandles.updating}get usedMemory(){return this._gpuMemoryUsage}shouldRender(){return this._renderers.size>0}async addComponentObject(e,t,r,s,n,i,o){if(this.hasObject(e))return this._getObjectMemoryUsage(e);let a;const c=new ee(null,new Promise(e=>a=e),e.obb.center,e.obb.radius);this._objectEntries.set(e,c);const l=await this._updatingHandles.addPromise(this._addComponentGeometry(e.transform,c,t,r,s,n,i,o));return this.setNeedsRender(),a(),l}async addOrUpdateObject3D(e,t,r,s){if(this.destroyed)return void n.getLogger(this).warn("Attempt to add an object to a destroyed instance");const i=new AbortController;let o;const{center:a,radius:l}=e.boundingVolumeWorldSpace.bounds,d=new ee(i,new Promise(e=>o=e),a,l),h=this._objectEntries.get(e);h&&(this._pendingDeletions.has(e)?this._discardObjectEntry(h):this._pendingDeletions.set(e,h)),this._objectEntries.set(e,d);try{const n=new Array;if(e.geometries.length>1&&$(e))n.push(this._addObjectMergedGeometries(e,d,t,r,s));else for(const i of e.geometries)i.material.supportsEdges&&n.push(this._addGeometry(e,d,i,t,r,s));await this._updatingHandles.addPromise(Promise.all(n)),this._removePendingDeletion(e)}catch(u){c(u)?this._discardObjectEntry(d):this._removePendingDeletion(e)}finally{this.setNeedsRender(),o()}}removeObject(e){const t=this._objectEntries.get(e);this._objectEntries.delete(e),this._discardObjectEntry(t),this._removePendingDeletion(e)}_removePendingDeletion(e){const t=this._pendingDeletions.get(e);this._pendingDeletions.delete(e),this._discardObjectEntry(t)}async _getObjectEntry(e){const t=this._objectEntries.get(e);if(!t)throw new Error("no object");return await t.loaded,null==t.loaded?null:t}fastUpdateObject3DEdgesTransform(e){if(this.destroyed)return!1;const t=this._objectEntries.get(e);if(!t)return!1;const{geometries:r}=e,{renderables:s}=t;if(0===r.length||0===s.length)return!0;if(s.length>1)return!1;const[n]=s,i=n.transform;if(!(i instanceof se))return!1;const[o]=r;if(o.localOrigin!==i.origin.origin)return!1;const a=p(),c=this._computeModelTransformWithLocalOrigin(e,o,a);return n.transform=new se(a,c),this.setNeedsRender(),!0}_discardObjectEntry(e){e&&(e.abort?.abort(),e.renderables.length&&(e.renderables.forEach(e=>this._removeRenderable(e)),this.setNeedsRender()),e.loaded=null)}hasObject(e){return this._objectEntries.has(e)}async updateAllComponentOpacities(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));if(null==r)return;const s=Array.isArray(t)?e=>t[e]:()=>t;r.renderables.forEach(e=>{const{meta:t,buffer:r}=e.components,n=t.length,i=r.textureBuffer.getScalarField("opacity");for(let o=0;o<n;o++){const e=s(o),r=t[o],n=r.index;r.material.opacity=e,i.set(n,255*e)}this._updateTransparency(e)}),this.setNeedsRender()}async _getObjectMemoryUsage(e){const t=await this._getObjectEntry(e);return t?t.renderables.reduce((e,t)=>e+t.statistics.gpuMemoryUsage,0):0}async updateAllComponentMaterials(e,t,r,s){const n=e instanceof A,i=z(t),o=H.getKey(i,r,n),a=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=a&&(a.renderables.forEach(e=>{if(o!==e.rendererKey){const t=this._renderers.get(e.rendererKey),s=this._acquireRenderer(i,r,n);t.removeRenderable(e),--t.refCount,e.rendererKey=o,s.addRenderable(e)}if(Array.isArray(t))for(let r=0;r<t.length;r++)e.components.meta[r].material=t[r];else e.components.meta[0].material=t;s&&oe(e.components),this._updateTransparency(e)}),this.setNeedsRender())}async updateAllVerticalOffsets(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=r&&this._updateAllVerticalOffsets(r,t)}_updateAllVerticalOffsets(e,t){e.renderables.forEach(e=>{const r=e.components.meta;for(let s=0;s<r.length;s++)e.components.meta[s].verticalOffset=t?.[s]??0;oe(e.components)}),this.setNeedsRender()}async updateObjectVisibility(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));r&&(r.renderables.forEach(e=>e.visible=t),this.setNeedsRender())}render(e,t){if(null==this._componentColorManager)return;this._localOrigins.updateViewMatrices(e.camera.viewMatrix);const r=e.camera.viewInverseTransposeMatrix,s=j(),n=new x;let i=0,o=0;if(this._renderers.forEach(r=>{0!==r.refCount?(++this.techniques.precompiling,r.forEachRenderable(t=>{t.visible&&(i+=t.statistics.averageEdgeLength,o++,t.regular&&r.acquireTechnique(e,!1),t.silhouette&&r.acquireTechnique(e,!0))},t),--this.techniques.precompiling):this._renderers.delete(r.key)}),this._componentColorManager.garbageCollect(),this._componentColorManager.updateTextures(),0===o)return;const a=new I(40*i/o,t);_(s,r[3],r[7],r[11]),n.set(s),b(a.transformWorldFromViewTH,n.high),b(a.transformWorldFromViewTL,n.low),u(a.transformViewFromCameraRelativeRS,e.camera.viewMatrix),g(me,a.transformViewFromCameraRelativeRS),m(a.transformNormalViewFromGlobal,me),this._updateObjectCameraDistances(e),this._renderers.forEach(t=>{ae(t,e,a),ce(t,e,a)})}_updateTransparency(e){const t=W(e.components.meta),r=G(e.components.meta);t===e.edgeTransparency&&r===e.objectTransparency||(e.edgeTransparency=t,e.objectTransparency=r,this._renderers.get(e.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(e,t,r){e.getCombinedShaderTransformation(t,r);const s=null!=t.localOrigin?this._localOrigins.register(t.localOrigin):this._localOrigins.acquire(_(this._tmpModelPosition,r[12],r[13],r[14]));return t.localOrigin=s.origin,R(s.origin.vec3,r),s}_createComponentBuffers(e){if(null==this._componentColorManager)return null;const t=new Array,r=this._componentColorManager.getBuffer(e.length),s=r.acquireIndices(e.length);for(let i=0;i<e.length;i++){const r=e[i],n=s[i];t.push({index:n,verticalOffset:0,material:r})}const n=new te(r,t);return oe(n),n}_extractEdges(e,t,r,s,n,i,o=i.length){return o<X&&(n=!0),this._workerHandle.process({data:r,indices:i,indicesLength:o,writerSettings:t,skipDeduplicate:s},e,n)}_createRenderable(e,t,r,s,n){const i=t=>new re(new P(this.rctx,new Map([["vertices",this._vertexBuffer],["instances",0===t?new Q(this.rctx,U,e.regular.instancesData.buffer):new Q(this.rctx,q,e.silhouette.instancesData.buffer)]])),0===t?e.regular.lodInfo:e.silhouette.lodInfo),o=e.regular.lodInfo.lengths.length>0?i(0):null,a=e.silhouette.lodInfo.lengths.length>0?i(1):null,c=(o?.vao.usedMemory??0)+(a?.vao.usedMemory??0);return new ne(o,a,{gpuMemoryUsage:c,externalMemoryUsage:n,averageEdgeLength:e.averageEdgeLength},r,W(t.meta),G(t.meta),t,s)}async _addGeometry(e,t,r,s,n,i){if(r.edgeIndicesLength<=0)return;const o=r.attributes.get("position"),a=p(),c=this._computeModelTransformWithLocalOrigin(e,r,a),l=new ge(o,a,c);return this._addPositionData(t,l,r.edgeIndicesLength,s,n,i)}async _addPositionData(e,t,r,s,n,i=!1){if(null==e.loaded)return;const o=this._createComponentBuffers([s]);if(null==o)return;const a=this._acquireRenderer(s.type,n,!0),{modelTransform:c,origin:l}=t,d=t.position.indices,h=t.position,u=h.data.length/h.size,g=L.createBuffer(u);for(let p=0;p<u;p++)g.position.set(p,0,h.data[p*h.size]),g.position.set(p,1,h.data[p*h.size+1]),g.position.set(p,2,h.data[p*h.size+2]);K(o.meta,[0,g.componentIndex.count],g.componentIndex);const m=await this._updatingHandles.addPromise(this._extractEdges(e.abort?.signal||this._workerAbort.signal,a.writerSettings,g,!1,i,d,r));if(null==e.loaded)return;const f=this._createRenderable(m,o,new se(c,l),a.key,!1);e.renderables.push(f),a.addRenderable(f),this._gpuMemoryUsage+=f.statistics.gpuMemoryUsage}async _addComponentGeometry(e,t,r,s,n,i,o,a){if(null==t.loaded)return 0;const c=this._createComponentBuffers(i);if(null==c)return 0;const l=z(i),d=this._acquireRenderer(l,o||!1,!1),h=L.createBuffer(r.length/3);v(h.position.typedBuffer,r,h.position.typedBufferStride,3),K(c.meta,n,h.componentIndex,s);const u=!0,g=d.writerSettings,m=await this._updatingHandles.addPromise(this._extractEdges(this._workerAbort.signal,g,h,u,!1,s));if(null==t.loaded)return 0;const f=this._createRenderable(m,c,e,d.key,!0);return t.renderables.push(f),d.addRenderable(f),this._updateAllVerticalOffsets(t,a),f.statistics.gpuMemoryUsage}async _addObjectMergedGeometries(e,t,r,s,n){const i=new Map;let o=0,a=0,c=null;const l=e.geometries.filter(e=>{if(e.edgeIndicesLength<=0||!e.material.supportsEdges)return!1;!c&&e.localOrigin&&(c=e);const t=e.positionAttribute;return a+=t.data.length/t.size,o+=e.edgeIndicesLength,!0});if(0===l.length)return;const d=a>=65536?Uint32Array:Uint16Array,h=o?new d(o):null,u=[];let g=0;l.forEach(e=>{const t=e.attributes.get("position"),r=t.indices;let s=i.get(t.data);if(null==s){s=u.length/3;for(let e=0;e<t.data.length;e+=t.size)u.push(t.data[e]),u.push(t.data[e+1]),u.push(t.data[e+2]);i.set(t.data,s)}for(let n=0;n<e.edgeIndicesLength;n++)h[g++]=s+r[n]});const m=c||e.geometries[0],f=p(),_=this._computeModelTransformWithLocalOrigin(e,m,f);for(let p=0;p<e.geometries.length;p++)e.geometries[p].localOrigin=_.origin;const b=new ge(new M(u,h,3),f,_);await this._updatingHandles.addPromise(this._addPositionData(t,b,h.length,r,s,n))}_acquireRenderer(e,t,r){const s=H.getKey(e,t,r);let n=this._renderers.get(s);return null==this._strokesTexture&&(this._strokesTexture=N(this.rctx)),n||(n=new H(this.rctx,this.techniques,{type:e,hasSlicePlane:t,strokesTexture:this._strokesTexture,legacy:r,spherical:1===this.viewingMode}),this._renderers.set(s,n)),++n.refCount,n}_removeRenderable(e){Z(e.regular),Z(e.silhouette);const t=this._renderers.get(e.rendererKey);if(t){t.removeRenderable(e),--t.refCount,this._localOrigins.release(e.transform.origin),this._gpuMemoryUsage-=e.statistics.externalMemoryUsage?0:e.statistics.gpuMemoryUsage;for(const t of e.components.meta)e.components.buffer.releaseIndex(t.index)}}_updateObjectCameraDistances(e){const t=e.camera.eye,r=e.camera.viewForward,s=j(),n=e=>{y(s,e.center,t);const n=w(s,r),i=e.radius,o=n<-i?1/0:n<i?0:n-i;e.renderables.forEach(e=>e.distanceToCamera=o)};this._objectEntries.forEach(n),this._pendingDeletions.forEach(n)}get test(){}};function Z(e){e?.vao&&(e.vao.buffer("instances")?.dispose(),e.vao.disposeVAOOnly(),e.vao=null)}function $(e){let t=null,s=null;for(const n of e.geometries){if(n.material.supportsEdges){if(t){if(!r(t,n.transformation))return!1}else t=n.transformation;if(s||null==n.localOrigin){if(null!=s?.localOrigin&&null!=n.localOrigin&&s.localOrigin.id!==n.localOrigin.id)return!1}else s=n}}return!0}e([d({constructOnly:!0})],Y.prototype,"rctx",void 0),e([d({constructOnly:!0})],Y.prototype,"renderSR",void 0),e([d({constructOnly:!0})],Y.prototype,"viewingMode",void 0),e([d({constructOnly:!0})],Y.prototype,"techniques",void 0),e([d({constructOnly:!0})],Y.prototype,"setNeedsRender",void 0),e([d({constructOnly:!0})],Y.prototype,"schedule",void 0),e([d({readOnly:!0})],Y.prototype,"_updatingHandles",void 0),e([d({readOnly:!0})],Y.prototype,"updating",null),Y=e([h("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView")],Y);class ee{constructor(e,t,r,s){this.abort=e,this.radius=s,this.renderables=new Array;const n=e?l(e.signal,()=>e.abort()):null;this.loaded=t,this.loaded.then(()=>{null!=this.loaded&&(this.loaded=!0),this.abort=null,n?.remove()}),this.center=O(r)}}class te{constructor(e,t){this.buffer=e,this.meta=t}}class re{constructor(e,t){this.vao=e,this.lod=t}}class se{constructor(e,t){this.modelMatrix=e,this.origin=t}}class ne{constructor(e,t,r,s,n,i,o,a){this.regular=e,this.silhouette=t,this.statistics=r,this.transform=s,this.edgeTransparency=n,this.objectTransparency=i,this.components=o,this.rendererKey=a,this.distanceToCamera=0,this.visible=!0}}class ie extends ne{}function oe(e){const{meta:t,buffer:r}=e,s=r.textureBuffer,n=s.getVec4Field("color"),o=s.getScalarField("lineWidth"),a=s.getScalarField("extensionLength"),c=s.getScalarField("materialType"),l=s.getScalarField("opacity"),d=s.getScalarField("elevationOffset");for(let h=0;h<t.length;h++){const e=t[h].material,r=t[h].index,s=i(Math.round(e.size*V),0,255),u=i(e.extensionLength,-B,255-B)+B,g=255*e.opacity,m=e.color,f=255*m[0],p=255*m[1],_=255*m[2],b=255*m[3];n.setValues(r,f,p,_,b),o.set(r,s),a.set(r,u),c.set(r,e.type),l.set(r,g),d.set(r,t[h].verticalOffset)}}function ae(e,t,r){let s,n;const i=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable(i=>{if(!le(i)||!i.visible)return;s??=e.acquireTechnique(t,!1),n??=e.rctx.bindTechnique(s,t,r);const a=ue(i.regular.lod.lengths,i.distanceToCamera,o);e.renderRegularEdges(n,i,r,t,a)},i)}function ce(e,t,r){let s,n;const i=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable(i=>{if(!he(i)||!i.visible)return;s??=e.acquireTechnique(t,!0),n??=e.rctx.bindTechnique(s,t,r);const a=ue(i.silhouette.lod.lengths,i.distanceToCamera,o);e.renderSilhouetteEdges(n,i,r,t,a)},i)}function le(e){return null!=e.regular}class de extends ne{}function he(e){return null!=e.silhouette}function ue(e,t,r){const n=t*r,i=s(e,n,!0);return-1===i?n<e[0]?e.length:0:e.length-i}class ge{constructor(e,t,r){this.position=e,this.modelTransform=t,this.origin=r}}const me=f(),fe=()=>Promise.reject();export{Y as EdgeView,se as LegacyTransform,ie as RegularRenderable,ne as Renderable,de as SilhouetteRenderable};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{glLayout as e}from"../../../support/buffer/glUtil.js";import{newLayout as o}from"../../../support/buffer/InterleavedLayout.js";import{fromLayouts as r}from"../../../../webgl/VertexAttributeLocations.js";const
|
|
5
|
+
import{glLayout as e}from"../../../support/buffer/glUtil.js";import{newLayout as o}from"../../../support/buffer/InterleavedLayout.js";import{maxElevationOffset as t}from"../../collections/Component/Material/shader/ComponentDataConstants.js";import{TextureBackedBufferLayout as n}from"../TextureBackedBuffer/TextureBackedBufferLayout.js";import{fromLayouts as r}from"../../../../webgl/VertexAttributeLocations.js";const a=o().vec3f("position").u16("componentIndex").freeze(),i=o().vec2u8("sideness").freeze(),m=e(i),s=o().vec3f("position0").vec3f("position1").vec2i16("normalCompressed").u16("componentIndex").u8("variantOffset",{glNormalized:!0}).u8("variantStroke").u8("variantExtension",{glNormalized:!0}).freeze(),p=o().vec3f("position0").vec3f("position1").vec2i16("normalCompressed").vec2i16("normal2Compressed").u16("componentIndex").u8("variantOffset",{glNormalized:!0}).u8("variantStroke").u8("variantExtension",{glNormalized:!0}).freeze(),f=e(s,1),u=e(p,1),l=r([m,f]),c=r([m,u]),v=new n([{name:"color",type:"vec4u8"},{name:"lineWidth",type:"u8"},{name:"extensionLength",type:"u8"},{name:"materialType",type:"u8"},{name:"opacity",type:"u8"},{name:"elevationOffset",type:"packed-f32",maxValue:t}]);export{a as EdgeInputBufferLayout,f as RegularEdgeInstancesGLLayout,s as RegularEdgeInstancesLayout,l as RegularEdgeLocations,u as SilhouetteEdgeInstancesGLLayout,p as SilhouetteEdgeInstancesLayout,c as SilhouetteEdgeLocations,i as VertexLayout,v as edgeViewTextureLayout,m as glVertexLayout};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{glLayout as e}from"../../support/buffer/glUtil.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{maxElevationOffset as t,maxPackedRGBEmission as r}from"../collections/Component/Material/shader/ComponentDataConstants.js";import{olidEnabled as f}from"../effects/geometry/olidUtils.js";import{TextureBackedBufferLayout as n}from"../lib/TextureBackedBuffer/TextureBackedBufferLayout.js";const i=o().vec3f("position").freeze(),u=o().vec3f("position").vec2f16("uv0").freeze(),s=o().vec3f("position").vec4u8("color").freeze(),a=o().vec3f("position").vec2f("uv0").freeze(),p=o().vec3f("position").vec2f("uv0").vec4u8("olidColor").freeze(),c=e(o().u16("componentIndex")),m=[{name:"colorAndCastShadows",type:"u8u8u7xu8"},{name:"elevationOffset",type:"packed-f32",maxValue:t},{name:"emissiveStrength",type:"packed-f24",maxValue:r},{name:"emissiveSourceMode",type:"u8"}],l={name:"olidColor",type:"vec4u8"},v=new n(m),d=new n([...m,l]);function y(){return f()?d:v}export{s as PositionColorLayout,i as PositionLayout,u as PositionUvLayout,a as PositionUvf32Layout,p as PositionUvf32OlidLayout,v as componentDataLayout,d as componentDataOlidLayout,y as getComponentDataLayout,c as indexGlLayout,l as olidAttribute};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{ShaderTechniqueConfiguration as e,parameter as
|
|
5
|
+
import{__decorate as t}from"tslib";import{ShaderTechniqueConfiguration as e,parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends e{constructor(t=!1){super(),this.alphaCutoff=1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.fadingEnabled=!1,this.occlusionPass=!1,this.depthPass=t}}function i(t){switch(t){case 2:return.005;case 0:return.05;default:return.01}}t([o({count:3})],r.prototype,"alphaCutoff",void 0),t([o()],r.prototype,"terrainDepthTest",void 0),t([o()],r.prototype,"cullAboveTerrain",void 0),t([o()],r.prototype,"fadingEnabled",void 0);export{r as GaussianSplatTechniqueConfiguration,i as getGaussianSplatAlphaCutoffValue};
|
|
@@ -2,16 +2,7 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
6
|
-
vec2 _componentTextureCoords(float componentIndex, float fieldOffset) {
|
|
7
|
-
float fieldIndex = ${n.float(M)} * componentIndex + fieldOffset;
|
|
8
|
-
float texSize = float(textureSize(componentDataTex, 0).x);
|
|
9
|
-
float colIndex = mod(fieldIndex, texSize);
|
|
10
|
-
float rowIndex = floor(fieldIndex / texSize);
|
|
11
|
-
|
|
12
|
-
return vec2(colIndex, rowIndex) + 0.5;
|
|
13
|
-
}
|
|
14
|
-
|
|
5
|
+
import{TextureBackedBufferModule as o}from"../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{NormalAttribute as e}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{DoublePrecision as r}from"../../../core/shaderLibrary/util/DoublePrecision.glsl.js";import{RgbaFloatEncoding as t}from"../../../core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import{Float3DrawUniform as a}from"../../../core/shaderModules/Float3DrawUniform.js";import{Float3PassUniform as l}from"../../../core/shaderModules/Float3PassUniform.js";import{glsl as n}from"../../../core/shaderModules/glsl.js";import{Matrix3DrawUniform as d}from"../../../core/shaderModules/Matrix3DrawUniform.js";import{Matrix3PassUniform as m}from"../../../core/shaderModules/Matrix3PassUniform.js";import{Matrix4BindUniform as i}from"../../../core/shaderModules/Matrix4BindUniform.js";import{Texture2DDrawUniform as s}from"../../../core/shaderModules/Texture2DDrawUniform.js";import{edgeViewTextureLayout as c}from"../../../lib/edgeRendering/bufferLayouts.js";const f=new o(c,"componentIndex",new s("componentDataTex",o=>o.componentDataTexture));function v(o,s){const{vertex:c}=o;c.include(t),o.include(e,s);const{silhouette:v,legacy:u,spherical:w}=s;o.attributes.add("componentIndex","float");const{getTextureAttribute:p,TextureBackedBufferModule:F}=f;o.include(F);const M=8,h=128;c.constants.add("lineWidthFractionFactor","float",M),c.constants.add("extensionLengthOffset","float",h),c.code.add(n`
|
|
15
6
|
struct ComponentData {
|
|
16
7
|
vec4 color;
|
|
17
8
|
vec3 normal;
|
|
@@ -23,40 +14,42 @@ import{maxElevationOffset as o}from"../../../collections/Component/Material/shad
|
|
|
23
14
|
};
|
|
24
15
|
|
|
25
16
|
ComponentData readComponentData() {
|
|
26
|
-
vec2 colorIndex = _componentTextureCoords(componentIndex, ${n.float(w)});
|
|
27
|
-
vec2 otherIndex = _componentTextureCoords(componentIndex, ${n.float(F)});
|
|
28
|
-
vec2 verticalOffsetIndex = _componentTextureCoords(float(componentIndex), ${n.float(h)} );
|
|
29
17
|
vec3 normal = normalModel();
|
|
30
|
-
vec3 normal2 = ${
|
|
18
|
+
vec3 normal2 = ${v?n`decompressNormal(normal2Compressed)`:n`normal`};
|
|
19
|
+
|
|
20
|
+
vec4 colorValue = ${p("color")};
|
|
21
|
+
float lineWidth = ${p("lineWidth")} * (255.0 / lineWidthFractionFactor);
|
|
22
|
+
float extensionLength = ${p("extensionLength")} * 255.0 - extensionLengthOffset;
|
|
23
|
+
// SOLID (=0/255) needs to be > 0.0, SKETCHY (=1/255) needs to be <= 0;
|
|
24
|
+
float type = -(${p("materialType")} * 255.0) + 0.5;
|
|
25
|
+
float opacity = ${p("opacity")};
|
|
31
26
|
|
|
32
|
-
|
|
33
|
-
vec4 otherValue = texelFetch(componentDataTex, ivec2(otherIndex), 0);
|
|
34
|
-
float verticalOffset = uninterpolatedRGBAToFloat(texelFetch(componentDataTex, ivec2(verticalOffsetIndex), 0)) * ${n.float(o)};
|
|
27
|
+
float verticalOffset = ${p("elevationOffset")};
|
|
35
28
|
|
|
36
29
|
return ComponentData(
|
|
37
|
-
vec4(colorValue.rgb, colorValue.a *
|
|
30
|
+
vec4(colorValue.rgb, colorValue.a * opacity),
|
|
38
31
|
normal, normal2,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
lineWidth,
|
|
33
|
+
extensionLength,
|
|
34
|
+
type,
|
|
42
35
|
verticalOffset
|
|
43
36
|
);
|
|
44
37
|
}
|
|
45
|
-
`),
|
|
38
|
+
`),u?c.code.add(n`vec3 _modelToWorldNormal(vec3 normal) {
|
|
46
39
|
return (model * vec4(normal, 0.0)).xyz;
|
|
47
40
|
}
|
|
48
41
|
vec3 _modelToViewNormal(vec3 normal) {
|
|
49
42
|
return (localView * model * vec4(normal, 0.0)).xyz;
|
|
50
|
-
}`):(
|
|
43
|
+
}`):(c.uniforms.add(new d("transformNormalGlobalFromModel",o=>o.transformNormalGlobalFromModel)),c.code.add(n`vec3 _modelToWorldNormal(vec3 normal) {
|
|
51
44
|
return transformNormalGlobalFromModel * normal;
|
|
52
|
-
}`)),
|
|
45
|
+
}`)),v?(o.attributes.add("normal2Compressed","vec2"),c.code.add(n`vec3 worldNormal(ComponentData data) {
|
|
53
46
|
return _modelToWorldNormal(normalize(data.normal + data.normal2));
|
|
54
|
-
}`)):
|
|
47
|
+
}`)):c.code.add(n`vec3 worldNormal(ComponentData data) {
|
|
55
48
|
return _modelToWorldNormal(data.normal);
|
|
56
|
-
}`),
|
|
49
|
+
}`),u?c.code.add(n`void worldAndViewFromModelPosition(vec3 modelPos, float verticalOffset, out vec3 worldPos, out vec3 viewPos) {
|
|
57
50
|
worldPos = (model * vec4(modelPos, 1.0)).xyz;
|
|
58
51
|
viewPos = (localView * vec4(worldPos, 1.0)).xyz;
|
|
59
|
-
}`):(
|
|
52
|
+
}`):(c.include(r,s),c.uniforms.add(new m("transformViewFromCameraRelativeRS",o=>o.transformViewFromCameraRelativeRS),new d("transformWorldFromModelRS",o=>o.transformWorldFromModelRS),new a("transformWorldFromModelTL",o=>o.transformWorldFromModelTL),new a("transformWorldFromModelTH",o=>o.transformWorldFromModelTH),new l("transformWorldFromViewTL",o=>o.transformWorldFromViewTL),new l("transformWorldFromViewTH",o=>o.transformWorldFromViewTH)),c.code.add(n`
|
|
60
53
|
void worldAndViewFromModelPosition(vec3 modelPos, float verticalOffset, out vec3 worldPos, out vec3 viewPos) {
|
|
61
54
|
vec3 rotatedModelPosition = transformWorldFromModelRS * modelPos;
|
|
62
55
|
|
|
@@ -70,14 +63,14 @@ viewPos = (localView * vec4(worldPos, 1.0)).xyz;
|
|
|
70
63
|
worldPos = transformCameraRelativeFromModel + rotatedModelPosition;
|
|
71
64
|
|
|
72
65
|
if (verticalOffset != 0.0) {
|
|
73
|
-
vec3 vUp = ${
|
|
66
|
+
vec3 vUp = ${w?"normalize(transformWorldFromModelTL + rotatedModelPosition);":"vec3(0.0, 0.0, 1.0);"}
|
|
74
67
|
worldPos += verticalOffset * vUp;
|
|
75
68
|
}
|
|
76
69
|
|
|
77
70
|
viewPos = transformViewFromCameraRelativeRS * worldPos;
|
|
78
71
|
}
|
|
79
|
-
`)),
|
|
72
|
+
`)),c.uniforms.add(new i("transformProjFromView",o=>o.camera.projectionMatrix)).code.add(n`vec4 projFromViewPosition(vec3 position) {
|
|
80
73
|
return transformProjFromView * vec4(position, 1.0);
|
|
81
|
-
}`),
|
|
74
|
+
}`),c.code.add(n`float calculateExtensionLength(float extensionLength, float lineLength) {
|
|
82
75
|
return extensionLength / (log2(max(1.0, 256.0 / lineLength)) * 0.2 + 1.0);
|
|
83
|
-
}`)}function
|
|
76
|
+
}`)}function u(o){return 1===o||2===o}export{v as EdgeUtil,u as usesSketchLogic};
|
package/views/Attribution.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../core/Accessor.js";import{makeHandle as s}from"../core/handleUtils.js";import{isActivationKey as i}from"../core/keyboard.js";import{watch as o}from"../core/reactiveUtils.js";import{addFrameTask as
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../core/Accessor.js";import{makeHandle as s}from"../core/handleUtils.js";import{isActivationKey as i}from"../core/keyboard.js";import{watch as o,initial as r}from"../core/reactiveUtils.js";import{addFrameTask as n}from"../core/scheduling.js";import{property as a,subclass as c}from"../core/accessorSupport/decorators.js";import{setCalciteModeClass as h}from"../support/modeUtils.js";import{globalCss as d}from"../widgets/support/globalCss.js";const l="esri-attribution",u={poweredBy:`${l}__powered-by`,sources:`${l}__sources`,sourcesOpen:`${l}__sources--open`,link:`${l}__link`};let p=class extends t{constructor(e){super(e),this._previousSourceHeight=0,this._opened=!1,this._overflowing=!1,this._changeSet=new Set,this._toggleState=()=>{(this._opened||this._overflowing)&&(this._opened=!this._opened,this._invalidate("opened"))},this.surface=document.createElement("div"),this._task=n({render:()=>{this._update(),this._task.pause(),this._changeSet.clear()}}),this.addHandles(this._task)}initialize(){const e=document.createElement("div");h(e),e.setAttribute("dir","ltr"),e.classList.add("esri-view-attribution"),e.classList.add("esri-attribution"),this._set("surface",e),e.innerHTML=`\n <div class="${u.sources}"></div>\n <div class="${u.poweredBy}">\n Powered by\n <a class="${u.link}" href="https://www.esri.com/" rel="noreferrer" target="_blank">Esri</a>\n </div>`,this.addHandles([this.surface,o(()=>this.attributionItems,()=>this._invalidate("attributionItems"),r)]);const t=e.querySelector(`.${u.sources}`);this._previousSourceHeight=t.clientHeight;const n=new ResizeObserver(()=>{this._invalidate("overflow")});n.observe(t),this.addHandles(s(()=>n.disconnect()));const a=new MutationObserver(()=>{this._invalidate("overflow")});a.observe(t,{childList:!0,subtree:!0,characterData:!0}),this.addHandles(s(()=>a.disconnect())),t.onclick=this._toggleState,t.onkeydown=e=>{i(e.key)&&(e.preventDefault(),this._toggleState())}}_invalidate(e){this._changeSet.add(e),this._task.resume()}_update(){const e=this.surface.querySelector(`.${u.sources}`);if(this._changeSet.has("overflow")){const{clientHeight:t,clientWidth:s,scrollWidth:i}=e,o=t<this._previousSourceHeight;this._previousSourceHeight=t,this._opened?o&&(this._opened=!1):o||(this._overflowing=i>s)}if(this._changeSet.has("overflow")||this._changeSet.has("opened")){const t=this._opened||this._overflowing,s=t?"0":"";e.setAttribute("tabindex",s),e.classList.toggle(d.interactive,t),e.classList.toggle(u.sourcesOpen,this._opened)}this._changeSet.has("attributionItems")&&(e.innerText=this.attributionItems?.map(e=>e.text).join(" | ")??"")}};e([a()],p.prototype,"attributionItems",void 0),e([a({readOnly:!0})],p.prototype,"surface",void 0),p=e([c("esri.views.Attribution")],p);export{p as Attribution};
|
package/views/DOMContainer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{byId as e,reparent as i}from"../core/domUtils.js";import{on as s}from"../core/events.js";import{makeHandle as r}from"../core/handleUtils.js";import n from"../core/Logger.js";import{destroyMaybe as o,removeMaybe as a}from"../core/maybe.js";import{watch as h,initial as l}from"../core/reactiveUtils.js";import{addFrameTask as
|
|
5
|
+
import{__decorate as t}from"tslib";import{byId as e,reparent as i}from"../core/domUtils.js";import{on as s}from"../core/events.js";import{makeHandle as r}from"../core/handleUtils.js";import n from"../core/Logger.js";import{destroyMaybe as o,removeMaybe as a}from"../core/maybe.js";import{watch as h,initial as l,syncAndInitial as d,sync as u}from"../core/reactiveUtils.js";import{addFrameTask as c}from"../core/scheduling.js";import{property as p,subclass as m}from"../core/accessorSupport/decorators.js";import{Attribution as f}from"./Attribution.js";import _ from"./overlay/ViewOverlay.js";const y=[0,0];function g(t){const e=(t.ownerDocument||window.document).defaultView,i=t.getBoundingClientRect();return y[0]=i.left+(e?.pageXOffset??0),y[1]=i.top+(e?.pageYOffset??0),y}function v(t){t&&(t.textContent="",t.parentNode&&t.parentNode.removeChild(t))}const b=16,w=750,C=512,H=2,O=y=>{const O=y;let z=class extends O{constructor(...t){super(...t),this._freqInfo={freq:b,time:w},this._overlayRenderTaskHandle=null,this.aria={},this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([h(()=>this.cursor,t=>{const{surface:e}=this;e&&e.setAttribute("data-cursor",t)}),h(()=>this.navigating,t=>{const{surface:e}=this;e&&e.setAttribute("data-navigating",t.toString())}),h(()=>[this.aria,this.surface],()=>this._updateAria(),{initial:!0})])}initialize(){const t=this;this.addHandles([h(()=>this.ui,(t,e)=>this._handleUIChange(t,e),l),t.on("focus",()=>this.notifyChange("focused")),t.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui?.destroy(),this.container=null)}get container(){return this._get("container")??null}set container(t){const s=this._get("container"),r=e(t);if(r||"string"!=typeof t||n.getLogger(this).error("#container",`element with id '${t}' not found`),s===r)return;if(this._stopMeasuring(),this.removeHandles("container"),s&&(s.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this._attribution=o(this._attribution),this.root&&(v(this.root),this._set("root",null)),this.userContent&&(i(this.userContent,s),v(this.userContent),this._set("userContent",null))),!r)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);r.classList.add("esri-view");const l=document.createElement("div");l.className="esri-view-user-storage",i(r,l),r.appendChild(l),this._set("userContent",l);const p=document.createElement("div");p.className="esri-view-root",r.insertBefore(p,r.firstChild),this._set("root",p);const m=document.createElement("div");m.className="esri-view-surface",m.setAttribute("role","application"),m.tabIndex=0,p.appendChild(m),this._set("surface",m);const y=new _;p.appendChild(y.surface),this._set("overlay",y),this.addHandles(h(()=>y.needsRender,t=>{t&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=c({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=a(this._overlayRenderTaskHandle)}),"container"),this.addHandles([h(()=>this.attributionVisible,t=>{t?!this._attribution&&t&&(this._attribution=new f({attributionItems:this.attributionItems}),p.appendChild(this._attribution.surface)):this._attribution=o(this._attribution)},d),h(()=>this.attributionItems,t=>{this._attribution&&(this._attribution.attributionItems=t)},u)],"container"),this.forceDOMReadyCycle(),this._set("container",r),this._startMeasuring()}get focused(){const t=document.activeElement===this.surface;return document.hasFocus()&&t}get size(){return[this.width,this.height]}set ui(t){const e=this._get("ui");e!==t&&e?.destroy(),this._set("ui",t)}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(t,e,i){const s=this.position;return t-=s?s[0]:0,e-=s?s[1]:0,i?(i[0]=t,i[1]=e):i=[t,e],i}containerToPage(t,e,i){const s=this.position;return t+=s?s[0]:0,e+=s?s[1]:0,i?(i[0]=t,i[1]=e):i=[t,e],i}_updateAria(){const{surface:t,aria:e}=this;t&&(t.ariaLabelledByElements=e?.labelledByElements??null,t.ariaDescribedByElements=e?.describedByElements??null,t.ariaLabel=e?.label??null,t.ariaDescription=e?.description??null)}_handleUIChange(t,e){this.removeHandles("ui"),e&&e!==t&&e.destroy(),t&&(t.view=this,this.addHandles(h(()=>this.root,e=>{if(e){const i=document.createElement("div");e.insertBefore(i,this._attribution?.surface??null),t.container=i}else t.container=null},l),"ui")),this._set("ui",t)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const t=this._freqInfo;t.freq=b,t.time=w;const e=c({prepare:t=>{const i=this._measure(),s=this._freqInfo;if(s.time+=t.deltaTime,i&&(s.freq=b,this._get("resizing")||this._set("resizing",!0)),s.time<s.freq)return;s.time=0;const r=this._position();s.freq=r||i?b:Math.min(w,s.freq*H),!i&&s.freq>=C&&(e.pause(),this._get("resizing")&&this._set("resizing",!1))}}),i=new ResizeObserver(i=>{t.freq=b,t.time=w,e.resume()});null!=this.container&&i.observe(this.container);const n=r(()=>i.disconnect());this.addHandles([s(window,"resize",()=>{t.freq=b,t.time=w,e.resume()}),n,e],"measuring"),this._measure(),this._position()}_measure(){const t=this.container,e=t?t.clientWidth:0,i=t?t.clientHeight:0;if(0===e||0===i)return this.suspended||this._set("suspended",!0),!1;const s=this.width,r=this.height;if(e===s&&i===r)return this.suspended&&this._set("suspended",!1),!1;this._set("width",e),this._set("height",i),this.suspended&&this._set("suspended",!1);return this.emit("resize",{oldWidth:s,oldHeight:r,width:e,height:i}),!0}_position(){const t=this.container,e=this.position,i=t&&g(t);return!!i&&((!e||i[0]!==e[0]||i[1]!==e[1])&&(this._set("position",[i[0],i[1]]),!0))}forceDOMReadyCycle(){}};return t([p()],z.prototype,"aria",void 0),t([p()],z.prototype,"container",null),t([p({readOnly:!0})],z.prototype,"focused",null),t([p({readOnly:!0})],z.prototype,"height",void 0),t([p()],z.prototype,"messagesCommon",void 0),t([p({type:_})],z.prototype,"overlay",void 0),t([p({readOnly:!0})],z.prototype,"position",void 0),t([p({readOnly:!0})],z.prototype,"resizing",void 0),t([p({readOnly:!0})],z.prototype,"root",void 0),t([p({value:null,readOnly:!0})],z.prototype,"size",null),t([p({readOnly:!0})],z.prototype,"surface",void 0),t([p({readOnly:!0})],z.prototype,"suspended",void 0),t([p({nonNullable:!0})],z.prototype,"ui",null),t([p({readOnly:!0})],z.prototype,"userContent",void 0),t([p({readOnly:!0})],z.prototype,"width",void 0),t([p()],z.prototype,"widthBreakpoint",void 0),z=t([m("esri.views.DOMContainer")],z),z};export{O as DOMContainer};
|
package/views/View.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../Map.js";import{createTask as i}from"../core/asyncUtils.js";import r from"../core/Collection.js";import a from"../core/CollectionFlattener.js";import{referenceSetter as s}from"../core/collectionUtils.js";import o from"../core/Error.js";import{EventedMixin as n}from"../core/Evented.js";import l from"../core/Handles.js";import{makeHandle as p}from"../core/handleUtils.js";import has from"../core/has.js";import{isLoadable as d}from"../core/Loadable.js";import h from"../core/Logger.js";import{destroyMaybe as y,abortMaybe as u}from"../core/maybe.js";import{EsriPromise as m}from"../core/Promise.js";import{after as c}from"../core/promiseUtils.js";import{watch as g,sync as f,whenOnce as w,when as v,syncAndInitial as _}from"../core/reactiveUtils.js";import{property as V,subclass as M}from"../core/accessorSupport/decorators.js";import{owningCollectionProperty as b}from"../core/support/OwningCollection.js";import{UpdatingHandles as R}from"../core/support/UpdatingHandles.js";import S from"../geometry/Extent.js";import T from"../geometry/HeightModelInfo.js";import E from"../geometry/SpatialReference.js";import{equals as j}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as F}from"../support/AnalysesCollection.js";import{GraphicsCollection as L}from"../support/GraphicsCollection.js";import{system as x}from"../time/constants.js";import k from"../time/TimeExtent.js";import{isTimeZoneValid as C}from"../time/timeZoneUtils.js";import O from"./BasemapView.js";import H from"./Magnifier.js";import I from"./SelectionManager.js";import q from"./Theme.js";import{ToolViewManager as P}from"./ToolViewManager.js";import{makeDefaultHighlightOptions as W}from"./3d/support/DefaultHighlights.js";import Z from"./input/Input.js";import{ViewEvents as D}from"./input/ViewEvents.js";import A from"./navigation/Navigation.js";import{deduplicateAttributionItems as U}from"./support/attributionUtils.js";import{DefaultsFromMap as z}from"./support/DefaultsFromMap.js";import N from"./support/HighlightOptions.js";import G from"./support/LayerViewManager.js";import $ from"./support/RequiredFieldsOptions.js";var B;let J=class extends(n(m)){static{B=this}constructor(e){super(e),this._userSpatialReference=null,this.handles=new l,this.updatingHandles=new R,this.allLayerViews=new a({getCollections:()=>this.layerviewCollections,getChildrenFunction:X}),this.analyses=new F,this.animationsEnabled=!0,this.attributionVisible=!0,this.basemapView=null,this.dependencies={popup:void 0},this.displayFilterEnabled=!0,this.fatalError=null,this.graphics=new L,this.typeSpecificPreconditionsReady=!0,this.layerViews=new r,this.magnifier=new H,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this._readyStateWaitingTask=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this._lowPriorityCursorHandles=new r,this._highPriorityCursorHandles=new r,this.input=new Z,this.navigation=new A,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new D(this),this.persistableViewModels=new r,this.requiredFieldsOptions=new $,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this.theme=null,this.handles.add(g(()=>this.preconditionsReady,e=>{const t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,B.views.add(this)):(this._lockedSpatialReference=null,B.views.remove(this)),this.notifyChange("spatialReference"),!e&&t)this.toolViewManager?.detach(),this.analysisViewManager?.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!t){try{this._startup()}catch(i){return void queueMicrotask(()=>{this.fatalError=new o("view:startup-error","View._startup failed",i)})}this.analysisViewManager?.attach(),this.toolViewManager.attach()}},f))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this._validateWithErrorDisplay()]).then(()=>(this._isValid=!0,w(()=>this.ready)))),this.basemapView=new O({view:this}),this.layerViewManager=new G({view:this,layerViewFilter:e=>this.layerViewFilter?.(e)??!0,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},layerviewMapping:this._layerToLayerviewMapping}),this.toolViewManager=new P({view:this}),this.selectionManager=new I({view:this}),this.addHandles([v(()=>"map-content-error"===this.readyState&&!this.spatialReference,()=>{h.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),g(()=>this.initialExtentRequired,e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e},_),g(()=>this.ready,e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)},f),g(()=>this._userSpatialReference,e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)},_)])}get _layerToLayerviewMapping(){return B._layerToLayerview}static{this._layerToLayerview=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.basemap.groundLayers","view.basemapView.groundLayerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"],["view.map.layers","view.layerViews"]]}destroy(){this.destroyed||(B.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=y(this.graphics),this.analyses=y(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),this.analysisViewManager=y(this.analysisViewManager),this.toolViewManager=y(this.toolViewManager),this.layerViewManager=y(this.layerViewManager),this.selectionManager=y(this.selectionManager),this.basemapView=y(this.basemapView),this.layerViews?.forEach(e=>e.destroy()),this.layerViews.length=0,this.invalidate(),this.handles.destroy(),this.map=y(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return h.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get attributionItems(){return U(this._get("attributionItems"),this.getAttributionItems())}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new z({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(e,t)=>this.getSpatialReferenceSupport(e,t),...this.defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get highlights(){return this._get("highlights")??W()}set highlights(e){this._set("highlights",s(e,this._get("highlights"),r.ofType(N)))}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!this.destroying&&!this.destroyed&&!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||d(this.map)&&!this.map.loaded||0===this.width||0===this.height||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e?.destroyed&&(h.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),d(e)&&e.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",e))}get readyState(){if(this.destroyed)return this._get("readyState");if(!this.map)return"missing-map";if("container"in this&&!this.container)return"missing-container";if(this.fatalError)return"rendering-error";if((this.defaultsFromMap?.ready??!1)&&!this.spatialReference){const e=!("loaded"in this.map)||this.map.loaded,t=this.map.ground.loaded,r=this.map.basemap?.loaded??!0;return e&&r&&t&&!this.map?.allLayers.length?"empty-map":(this._readyStateWaitingTask||(this._readyStateWaitingTask=i(e=>c(has("view-readyState-waiting-delay"),null,e)),this.addHandles(this._readyStateWaitingTask),this.addHandles(this._readyStateWaitingTask,"ready-state-task")),this._readyStateWaitingTask?.finished?"map-content-error":"loading")}return this._readyStateWaitingTask=u(this._readyStateWaitingTask),this.removeHandles("ready-state-task"),this.ready?"ready":"loading"}get spatialReference(){const e=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(e&&this.defaultsFromMap?.required?.heightModelInfo){const t=e.clone();return t.vcsWkid=this.defaultsFromMap.vcsWkid,t.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,t}return e}set spatialReference(e){const t=!j(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(e){this._userTimeExtent=e}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??x}set timeZone(e){this._userTimeZone=e,C(e)||h.getLogger(this).warn("#timeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._highPriorityCursorHandles.at(-1)?.cursor??this._lowPriorityCursorHandles.at(-1)?.cursor??"default"}acquireCursor(e,t="low"){const i="high"===t?this._highPriorityCursorHandles:this._lowPriorityCursorHandles,r={cursor:e},a=p(()=>i.remove(r));return i.add(r),this.addHandles(a),a}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new q}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getAttributionItems(){return this.allLayerViews.items.flatMap(e=>e.attributionItems)}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}getSurface(){return null}importLayerView(e){throw new o("view:importLayerView-missing","importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return null!=this.getSpatialReferenceSupport(e)}when(e,t){return this.isResolved()&&!this.ready&&h.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(v(()=>this.destroyed||!1===this.preconditionsReady,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}on(e,t){return super.on(e,t)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}static{this.views=new r}async _validateWithErrorDisplay(){try{await this.validate()}catch(e){const t=document.createElement("div");t.setAttribute("style","display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;");const i=document.createElement("div");i.innerHTML="Unable to display map. WebGL2 support is required.",i.setAttribute("style","font-size: 24px; font-weight: bold;");const r=document.createElement("div");r.innerHTML="Ensure that your browser and hardware meet the minimum requirements.",r.setAttribute("style","font-size: 18px;");const a=document.createElement("a");a.innerHTML="https://esriurl.com/webgl-faq",a.target="_blank",a.setAttribute("style","font-size: 18px;"),a.href="https://esriurl.com/webgl-faq",t.appendChild(i),t.appendChild(r),t.appendChild(a);const s=this.getSurface();throw s&&s.appendChild(t),e}}};e([V()],J.prototype,"_userSpatialReference",void 0),e([V()],J.prototype,"activeTool",null),e([V({readOnly:!0})],J.prototype,"allLayerViews",void 0),e([V({readOnly:!0})],J.prototype,"layerviewCollections",null),e([V(b(F,"analyses"))],J.prototype,"analyses",void 0),e([V()],J.prototype,"animation",null),e([V()],J.prototype,"animationsEnabled",void 0),e([V({readOnly:!0})],J.prototype,"attributionItems",null),e([V()],J.prototype,"attributionVisible",void 0),e([V()],J.prototype,"basemapView",void 0),e([V()],J.prototype,"center",null),e([V()],J.prototype,"defaultsFromMapSettings",null),e([V()],J.prototype,"defaultsFromMap",null),e([V()],J.prototype,"dependencies",void 0),e([V()],J.prototype,"displayFilterEnabled",void 0),e([V({type:S})],J.prototype,"extent",null),e([V()],J.prototype,"fatalError",void 0),e([V(b(L,"graphics"))],J.prototype,"graphics",void 0),e([V({readOnly:!0,type:T})],J.prototype,"heightModelInfo",null),e([V({type:r.ofType(N)})],J.prototype,"highlights",null),e([V({readOnly:!0})],J.prototype,"interacting",null),e([V({constructOnly:!0})],J.prototype,"layerViewFilter",void 0),e([V({readOnly:!0})],J.prototype,"navigating",null),e([V({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],J.prototype,"preconditionsReady",null),e([V({readOnly:!0})],J.prototype,"typeSpecificPreconditionsReady",void 0),e([V({type:r,readOnly:!0})],J.prototype,"layerViews",void 0),e([V()],J.prototype,"resolution",null),e([V({type:H})],J.prototype,"magnifier",void 0),e([V({value:null,type:t})],J.prototype,"map",null),e([V()],J.prototype,"padding",void 0),e([V({readOnly:!0})],J.prototype,"ready",void 0),e([V()],J.prototype,"_readyStateWaitingTask",void 0),e([V({readOnly:!0})],J.prototype,"readyState",null),e([V({type:E})],J.prototype,"spatialReference",null),e([V()],J.prototype,"stationary",null),e([V({type:k})],J.prototype,"timeExtent",null),e([V({type:String,nonNullable:!0})],J.prototype,"timeZone",null),e([V()],J.prototype,"tools",null),e([V()],J.prototype,"toolViewManager",void 0),e([V({readOnly:!0})],J.prototype,"type",void 0),e([V({type:Number})],J.prototype,"scale",void 0),e([V({readOnly:!0})],J.prototype,"updating",void 0),e([V({readOnly:!0})],J.prototype,"initialExtentRequired",void 0),e([V({readOnly:!0})],J.prototype,"initialExtent",null),e([V()],J.prototype,"cursor",null),e([V({readOnly:!0})],J.prototype,"input",void 0),e([V({type:A,nonNullable:!0})],J.prototype,"navigation",void 0),e([V()],J.prototype,"layerViewManager",void 0),e([V()],J.prototype,"analysisViewManager",void 0),e([V()],J.prototype,"selectionManager",void 0),e([V()],J.prototype,"width",void 0),e([V()],J.prototype,"height",void 0),e([V({readOnly:!0})],J.prototype,"resizing",void 0),e([V({value:null,readOnly:!0})],J.prototype,"size",null),e([V({readOnly:!0})],J.prototype,"suspended",void 0),e([V({readOnly:!0})],J.prototype,"viewEvents",void 0),e([V({readOnly:!0})],J.prototype,"persistableViewModels",void 0),e([V()],J.prototype,"_isValid",void 0),e([V()],J.prototype,"_readyCycleForced",void 0),e([V()],J.prototype,"_lockedSpatialReference",void 0),e([V()],J.prototype,"_userTimeZone",void 0),e([V()],J.prototype,"_lockedTimeZone",void 0),e([V()],J.prototype,"_userTimeExtent",void 0),e([V()],J.prototype,"_lockedTimeExtent",void 0),e([V({type:q})],J.prototype,"theme",void 0),e([V({readOnly:!0,type:q})],J.prototype,"effectiveTheme",null),J=B=e([M("esri.views.View")],J);const K=globalThis.$arcgis;K&&!K.views&&Object.defineProperty(K,"views",{configurable:!1,enumerable:!0,writable:!1,value:J.views});const Q=J;function X(e){return e.layerViews}export{Q as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../Map.js";import{createTask as i}from"../core/asyncUtils.js";import r from"../core/Collection.js";import a from"../core/CollectionFlattener.js";import{referenceSetter as s}from"../core/collectionUtils.js";import o from"../core/Error.js";import{EventedMixin as n}from"../core/Evented.js";import l from"../core/Handles.js";import{makeHandle as p}from"../core/handleUtils.js";import has from"../core/has.js";import{isLoadable as d}from"../core/Loadable.js";import h from"../core/Logger.js";import{destroyMaybe as y,abortMaybe as u}from"../core/maybe.js";import{EsriPromise as m}from"../core/Promise.js";import{after as c}from"../core/promiseUtils.js";import{watch as g,sync as f,whenOnce as w,when as v,syncAndInitial as _}from"../core/reactiveUtils.js";import{property as V,subclass as M}from"../core/accessorSupport/decorators.js";import{owningCollectionProperty as b}from"../core/support/OwningCollection.js";import{UpdatingHandles as R}from"../core/support/UpdatingHandles.js";import S from"../geometry/Extent.js";import T from"../geometry/HeightModelInfo.js";import E from"../geometry/SpatialReference.js";import{equals as j}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as F}from"../support/AnalysesCollection.js";import{GraphicsCollection as L}from"../support/GraphicsCollection.js";import{system as x}from"../time/constants.js";import k from"../time/TimeExtent.js";import{isTimeZoneValid as C}from"../time/timeZoneUtils.js";import O from"./BasemapView.js";import H from"./Magnifier.js";import I from"./SelectionManager.js";import q from"./Theme.js";import{ToolViewManager as P}from"./ToolViewManager.js";import{makeDefaultHighlightOptions as W}from"./3d/support/DefaultHighlights.js";import Z from"./input/Input.js";import{ViewEvents as D}from"./input/ViewEvents.js";import A from"./navigation/Navigation.js";import{deduplicateAttributionItems as U}from"./support/attributionUtils.js";import{DefaultsFromMap as z}from"./support/DefaultsFromMap.js";import N from"./support/HighlightOptions.js";import G from"./support/LayerViewManager.js";import $ from"./support/RequiredFieldsOptions.js";var B;let J=class extends(n(m)){static{B=this}constructor(e){super(e),this._userSpatialReference=null,this.handles=new l,this.updatingHandles=new R,this.allLayerViews=new a({getCollections:()=>this.layerviewCollections,getChildrenFunction:X}),this.analyses=new F,this.animationsEnabled=!0,this.attributionVisible=!0,this.basemapView=null,this.dependencies={popup:void 0},this.displayFilterEnabled=!0,this.fatalError=null,this.graphics=new L,this.typeSpecificPreconditionsReady=!0,this.layerViews=new r,this.magnifier=new H,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this._readyStateWaitingTask=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this._lowPriorityCursorHandles=new r,this._highPriorityCursorHandles=new r,this.input=new Z,this.navigation=new A,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new D(this),this.persistableViewModels=new r,this.requiredFieldsOptions=new $,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this.theme=null,this.handles.add(g(()=>this.preconditionsReady,e=>{const t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,B.views.add(this)):(this._lockedSpatialReference=null,B.views.remove(this)),this.notifyChange("spatialReference"),!e&&t)this.toolViewManager?.detach(),this.analysisViewManager?.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!t){try{this._startup()}catch(i){return void queueMicrotask(()=>{this.fatalError=new o("view:startup-error","View._startup failed",i)})}this.analysisViewManager?.attach(),this.toolViewManager.attach()}},f))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this._validateWithErrorDisplay()]).then(()=>(this._isValid=!0,w(()=>this.ready)))),this.basemapView=new O({view:this}),this.layerViewManager=new G({view:this,layerViewFilter:e=>this.layerViewFilter?.(e)??!0,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},layerviewMapping:this._layerToLayerviewMapping}),this.toolViewManager=new P({view:this}),this.selectionManager=new I({view:this}),this.addHandles([v(()=>"map-content-error"===this.readyState&&!this.spatialReference,()=>{h.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),g(()=>this.initialExtentRequired,e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e},_),g(()=>this.ready,e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)},f),g(()=>this._userSpatialReference,e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)},_)])}get _layerToLayerviewMapping(){return B._layerToLayerview}static{this._layerToLayerview=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.basemap.groundLayers","view.basemapView.groundLayerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"],["view.map.layers","view.layerViews"]]}destroy(){this.destroyed||(B.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=y(this.graphics),this.analyses=y(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),this.analysisViewManager=y(this.analysisViewManager),this.toolViewManager=y(this.toolViewManager),this.layerViewManager=y(this.layerViewManager),this.selectionManager=y(this.selectionManager),this.basemapView=y(this.basemapView),this.layerViews?.forEach(e=>e.destroy()),this.layerViews.length=0,this.invalidate(),this.handles.destroy(),this.map=y(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return h.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get attributionItems(){return this.suspended?[]:U(this._get("attributionItems"),this.getAttributionItems())}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new z({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(e,t)=>this.getSpatialReferenceSupport(e,t),...this.defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get highlights(){return this._get("highlights")??W()}set highlights(e){this._set("highlights",s(e,this._get("highlights"),r.ofType(N)))}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!this.destroying&&!this.destroyed&&!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||d(this.map)&&!this.map.loaded||0===this.width||0===this.height||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e?.destroyed&&(h.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),d(e)&&e.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",e))}get readyState(){if(this.destroyed)return this._get("readyState");if(!this.map)return"missing-map";if("container"in this&&!this.container)return"missing-container";if(this.fatalError)return"rendering-error";if((this.defaultsFromMap?.ready??!1)&&!this.spatialReference){const e=!("loaded"in this.map)||this.map.loaded,t=this.map.ground.loaded,r=this.map.basemap?.loaded??!0;return e&&r&&t&&!this.map?.allLayers.length?"empty-map":(this._readyStateWaitingTask||(this._readyStateWaitingTask=i(e=>c(has("view-readyState-waiting-delay"),null,e)),this.addHandles(this._readyStateWaitingTask),this.addHandles(this._readyStateWaitingTask,"ready-state-task")),this._readyStateWaitingTask?.finished?"map-content-error":"loading")}return this._readyStateWaitingTask=u(this._readyStateWaitingTask),this.removeHandles("ready-state-task"),this.ready?"ready":"loading"}get spatialReference(){const e=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(e&&this.defaultsFromMap?.required?.heightModelInfo){const t=e.clone();return t.vcsWkid=this.defaultsFromMap.vcsWkid,t.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,t}return e}set spatialReference(e){const t=!j(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(e){this._userTimeExtent=e}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??x}set timeZone(e){this._userTimeZone=e,C(e)||h.getLogger(this).warn("#timeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._highPriorityCursorHandles.at(-1)?.cursor??this._lowPriorityCursorHandles.at(-1)?.cursor??"default"}acquireCursor(e,t="low"){const i="high"===t?this._highPriorityCursorHandles:this._lowPriorityCursorHandles,r={cursor:e},a=p(()=>i.remove(r));return i.add(r),this.addHandles(a),a}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new q}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getAttributionItems(){return this.allLayerViews.items.flatMap(e=>e.attributionItems)}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}getSurface(){return null}importLayerView(e){throw new o("view:importLayerView-missing","importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return null!=this.getSpatialReferenceSupport(e)}when(e,t){return this.isResolved()&&!this.ready&&h.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(v(()=>this.destroyed||!1===this.preconditionsReady,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}on(e,t){return super.on(e,t)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}static{this.views=new r}async _validateWithErrorDisplay(){try{await this.validate()}catch(e){const t=document.createElement("div");t.setAttribute("style","display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;");const i=document.createElement("div");i.innerHTML="Unable to display map. WebGL2 support is required.",i.setAttribute("style","font-size: 24px; font-weight: bold;");const r=document.createElement("div");r.innerHTML="Ensure that your browser and hardware meet the minimum requirements.",r.setAttribute("style","font-size: 18px;");const a=document.createElement("a");a.innerHTML="https://esriurl.com/webgl-faq",a.target="_blank",a.setAttribute("style","font-size: 18px;"),a.href="https://esriurl.com/webgl-faq",t.appendChild(i),t.appendChild(r),t.appendChild(a);const s=this.getSurface();throw s&&s.appendChild(t),e}}};e([V()],J.prototype,"_userSpatialReference",void 0),e([V()],J.prototype,"activeTool",null),e([V({readOnly:!0})],J.prototype,"allLayerViews",void 0),e([V({readOnly:!0})],J.prototype,"layerviewCollections",null),e([V(b(F,"analyses"))],J.prototype,"analyses",void 0),e([V()],J.prototype,"animation",null),e([V()],J.prototype,"animationsEnabled",void 0),e([V({readOnly:!0})],J.prototype,"attributionItems",null),e([V()],J.prototype,"attributionVisible",void 0),e([V()],J.prototype,"basemapView",void 0),e([V()],J.prototype,"center",null),e([V()],J.prototype,"defaultsFromMapSettings",null),e([V()],J.prototype,"defaultsFromMap",null),e([V()],J.prototype,"dependencies",void 0),e([V()],J.prototype,"displayFilterEnabled",void 0),e([V({type:S})],J.prototype,"extent",null),e([V()],J.prototype,"fatalError",void 0),e([V(b(L,"graphics"))],J.prototype,"graphics",void 0),e([V({readOnly:!0,type:T})],J.prototype,"heightModelInfo",null),e([V({type:r.ofType(N)})],J.prototype,"highlights",null),e([V({readOnly:!0})],J.prototype,"interacting",null),e([V({constructOnly:!0})],J.prototype,"layerViewFilter",void 0),e([V({readOnly:!0})],J.prototype,"navigating",null),e([V({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],J.prototype,"preconditionsReady",null),e([V({readOnly:!0})],J.prototype,"typeSpecificPreconditionsReady",void 0),e([V({type:r,readOnly:!0})],J.prototype,"layerViews",void 0),e([V()],J.prototype,"resolution",null),e([V({type:H})],J.prototype,"magnifier",void 0),e([V({value:null,type:t})],J.prototype,"map",null),e([V()],J.prototype,"padding",void 0),e([V({readOnly:!0})],J.prototype,"ready",void 0),e([V()],J.prototype,"_readyStateWaitingTask",void 0),e([V({readOnly:!0})],J.prototype,"readyState",null),e([V({type:E})],J.prototype,"spatialReference",null),e([V()],J.prototype,"stationary",null),e([V({type:k})],J.prototype,"timeExtent",null),e([V({type:String,nonNullable:!0})],J.prototype,"timeZone",null),e([V()],J.prototype,"tools",null),e([V()],J.prototype,"toolViewManager",void 0),e([V({readOnly:!0})],J.prototype,"type",void 0),e([V({type:Number})],J.prototype,"scale",void 0),e([V({readOnly:!0})],J.prototype,"updating",void 0),e([V({readOnly:!0})],J.prototype,"initialExtentRequired",void 0),e([V({readOnly:!0})],J.prototype,"initialExtent",null),e([V()],J.prototype,"cursor",null),e([V({readOnly:!0})],J.prototype,"input",void 0),e([V({type:A,nonNullable:!0})],J.prototype,"navigation",void 0),e([V()],J.prototype,"layerViewManager",void 0),e([V()],J.prototype,"analysisViewManager",void 0),e([V()],J.prototype,"selectionManager",void 0),e([V()],J.prototype,"width",void 0),e([V()],J.prototype,"height",void 0),e([V({readOnly:!0})],J.prototype,"resizing",void 0),e([V({value:null,readOnly:!0})],J.prototype,"size",null),e([V({readOnly:!0})],J.prototype,"suspended",void 0),e([V({readOnly:!0})],J.prototype,"viewEvents",void 0),e([V({readOnly:!0})],J.prototype,"persistableViewModels",void 0),e([V()],J.prototype,"_isValid",void 0),e([V()],J.prototype,"_readyCycleForced",void 0),e([V()],J.prototype,"_lockedSpatialReference",void 0),e([V()],J.prototype,"_userTimeZone",void 0),e([V()],J.prototype,"_lockedTimeZone",void 0),e([V()],J.prototype,"_userTimeExtent",void 0),e([V()],J.prototype,"_lockedTimeExtent",void 0),e([V({type:q})],J.prototype,"theme",void 0),e([V({readOnly:!0,type:q})],J.prototype,"effectiveTheme",null),J=B=e([M("esri.views.View")],J);const K=globalThis.$arcgis;K&&!K.views&&Object.defineProperty(K,"views",{configurable:!1,enumerable:!0,writable:!1,value:J.views});const Q=J;function X(e){return e.layerViews}export{Q as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../core/Logger.js";import{property as i,subclass as n}from"../../core/accessorSupport/decorators.js";import r from"../../geometry/SpatialReference.js";import{toExtent as o}from"../../geometry/support/aaBoundingRect.js";import{extentContainsXYZ as a}from"../../geometry/support/contains.js";import{GroundViewElevationSampler as s}from"./GroundViewElevationSampler.js";let l=class extends s{initialize(){this.view.basemapTerrain.on("elevation-change",()=>this.emit("changed",{}))}get demResolution(){return this.view.basemapTerrain.demResolution}get extent(){const e=this.view.basemapTerrain;if(null==e?.extent||null==e.spatialReference)return null;const t=o(e.extent,e.spatialReference);return t.zmin=e.
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../core/Logger.js";import{property as i,subclass as n}from"../../core/accessorSupport/decorators.js";import r from"../../geometry/SpatialReference.js";import{toExtent as o}from"../../geometry/support/aaBoundingRect.js";import{extentContainsXYZ as a}from"../../geometry/support/contains.js";import{GroundViewElevationSampler as s}from"./GroundViewElevationSampler.js";let l=class extends s{initialize(){this.view.basemapTerrain.on("elevation-change",()=>this.emit("changed",{}))}get demResolution(){return this.view.basemapTerrain.demResolution}get extent(){const e=this.view.basemapTerrain;if(null==e?.extent||null==e.spatialReference)return null;const t=o(e.extent,e.spatialReference);return t.zmin=e.visibleElevationRange.minElevation,t.zmax=e.visibleElevationRange.maxElevation,t}get spatialReference(){return this.view.basemapTerrain?.spatialReference??r.WGS84}elevationAt(e,i){if(null==this.extent||!a(this.extent,e,i)){const n=null!=this.extent?`${this.extent.xmin}, ${this.extent.ymin}, ${this.extent.xmax}, ${this.extent.ymax}`:null;return t.getLogger(this).warn("#elevationAt()",`Point used to sample elevation (${e}, ${i}) is outside of the sampler extent (${n})`),this.noDataValue}return this.view.elevationProvider?.getElevation(e,i,0,this.spatialReference,"ground")??this.noDataValue}};e([i({readOnly:!0})],l.prototype,"demResolution",null),e([i({readOnly:!0})],l.prototype,"extent",null),e([i()],l.prototype,"spatialReference",null),l=e([n("esri.views.support.GroundElevationSampler")],l);export{l as GroundElevationSampler};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4342,9062,9279],{22671:(e,t,r)=>{r.d(t,{A:()=>m});var i,n=r(31635),s=r(52106),o=r(66552),a=r(25482),l=r(4718),d=r(91429),p=r(16930),u=r(65864),c=r(50498),y=r(20437),h=r(36005),f=r(43937);const g=new o.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let m=i=class extends a.o{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){return this.readFeaturesWithClass(e,t,s.A)}writeGeometryType(e,t,r,i){if(e)return void g.write(e,t,r,i);const{features:n}=this;if(n)for(const e of n)if(null!=e?.geometry)return void g.write(e.geometry.type,t,r,i)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,i=(0,u.rS)(e);return i&&!r&&t.spatialReference&&(i.spatialReference=p.A.fromJSON(t.spatialReference)),i}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new i(this.cloneProperties())}cloneProperties(){return(0,l.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const i=t.features[r];if(i.geometry){const t=e?.[r];i.geometry=t?.toJSON()||i.geometry}}return t}quantize(e){const{scale:[t,r],translate:[i,n]}=e,s=this.features,o=this._getQuantizationFunction(this.geometryType,e=>Math.round((e-i)/t),e=>Math.round((n-e)/r));for(let e=0,t=s.length;e<t;e++)o?.(s[e].geometry)||(s.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[i,n],scale:[s,o]}=r;let a=null,l=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;a=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;l=r=>null==r?r:r*t+e}const d=this._getHydrationFunction(e,e=>e*s+i,e=>n-e*o,a,l);for(const{geometry:e}of t)null!=e&&d&&d(e);return this.transform=null,this}readFeaturesWithClass(e,t,r){const i=p.A.fromJSON(t.spatialReference),n=[];for(let t=0;t<e.length;t++){const s=e[t],o=r.fromJSON(s),a=s.geometry?.spatialReference;null==o.geometry||a||(o.geometry.spatialReference=i);const l=s.aggregateGeometries,d=o.aggregateGeometries;if(l&&null!=d)for(const e in d){const t=d[e],r=l[e],n=r?.spatialReference;null==t||n||(t.spatialReference=i)}n.push(o)}return n}_quantizePoints(e,t,r){let i,n;const s=[];for(let o=0,a=e.length;o<a;o++){const a=e[o];if(o>0){const e=t(a[0]),o=r(a[1]);e===i&&o===n||(s.push([e-i,o-n]),i=e,n=o)}else i=t(a[0]),n=r(a[1]),s.push([i,n])}return s.length>0?s:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const i=(0,u.Bi)(e)?e.rings:e.paths,n=[];for(let e=0,s=i.length;e<s;e++){const s=i[e],o=this._quantizePoints(s,t,r);o&&n.push(o)}return n.length>0?((0,u.Bi)(e)?e.rings=n:e.paths=n,e):null}:"multipoint"===e?e=>{const i=this._quantizePoints(e.points,t,r);return i&&i.length>0?(e.points=i,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,i,n){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),i&&(e.z=i(e.z))}:"polyline"===e||"polygon"===e?e=>{const s=(0,u.Bi)(e)?e.rings:e.paths;let o,a;for(let e=0,i=s.length;e<i;e++){const i=s[e];for(let e=0,n=i.length;e<n;e++){const n=i[e];e>0?(o+=n[0],a+=n[1]):(o=n[0],a=n[1]),n[0]=t(o),n[1]=r(a)}}if(i&&n)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2]),r[3]=n(r[3])}}else if(i)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2])}}else if(n)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=n(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),i&&null!=e.zmax&&null!=e.zmin&&(e.zmax=i(e.zmax),e.zmin=i(e.zmin)),n&&null!=e.mmax&&null!=e.mmin&&(e.mmax=n(e.mmax),e.mmin=n(e.mmin))}:"multipoint"===e?e=>{const s=e.points;let o,a;for(let e=0,i=s.length;e<i;e++){const i=s[e];e>0?(o+=i[0],a+=i[1]):(o=i[0],a=i[1]),i[0]=t(o),i[1]=r(a)}if(i&&n)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=i(t[2]),t[3]=n(t[3])}else if(i)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=i(t[2])}else if(n)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=n(t[2])}}:null}};(0,n.Cg)([(0,d.MZ)({type:String,json:{write:!0}})],m.prototype,"displayFieldName",void 0),(0,n.Cg)([(0,d.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],m.prototype,"exceededTransferLimit",void 0),(0,n.Cg)([(0,d.MZ)({type:[s.A],json:{write:!0}})],m.prototype,"features",void 0),(0,n.Cg)([(0,h.w)("features")],m.prototype,"readFeatures",null),(0,n.Cg)([(0,d.MZ)({type:[y.A],json:{write:!0}})],m.prototype,"fields",void 0),(0,n.Cg)([(0,d.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],m.prototype,"geometryType",void 0),(0,n.Cg)([(0,f.K)("geometryType")],m.prototype,"writeGeometryType",null),(0,n.Cg)([(0,d.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],m.prototype,"hasM",void 0),(0,n.Cg)([(0,d.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],m.prototype,"hasZ",void 0),(0,n.Cg)([(0,d.MZ)({types:c.yR,json:{write:!0}})],m.prototype,"queryGeometry",void 0),(0,n.Cg)([(0,h.w)("queryGeometry")],m.prototype,"readQueryGeometry",null),(0,n.Cg)([(0,d.MZ)({type:p.A,json:{write:!0}})],m.prototype,"spatialReference",void 0),(0,n.Cg)([(0,f.K)("spatialReference")],m.prototype,"writeSpatialReference",null),(0,n.Cg)([(0,d.MZ)({json:{write:!0}})],m.prototype,"transform",void 0),m=i=(0,n.Cg)([(0,d.$K)("esri.rest.support.FeatureSet")],m),m.prototype.toJSON.isDefaultToJSON=!0},32587:(e,t,r)=>{r.d(t,{A:()=>s});var i=r(62788),n=r(95488);class s{constructor(e){this._observable=new n.I,this._notifyPending=!1,this._batchDepth=0,this._map=new Map(e)}get size(){return(0,i.gc)(this._observable),this._map.size}batch(e){try{this._batchDepth++,e()}finally{this._batchDepth--,this._notifyPending&&0===this._batchDepth&&(this._notifyPending=!1,this._notify())}}clear(){this._map.size>0&&(this._map.clear(),this._notify())}delete(e){const t=this._map.delete(e);return t&&this._notify(),t}entries(){return(0,i.gc)(this._observable),this._map.entries()}forEach(e,t){(0,i.gc)(this._observable),this._map.forEach((r,i)=>e.call(t,r,i,this),t)}get(e){return(0,i.gc)(this._observable),this._map.get(e)}has(e){return(0,i.gc)(this._observable),this._map.has(e)}keys(){return(0,i.gc)(this._observable),this._map.keys()}set(e,t){return this._map.set(e,t),this._notify(),this}transformValues(e,t=this._map.keys()){this.batch(()=>{for(const r of t){if(!this._map.has(r))continue;const t=this._map.get(r),i=e(t,r);i!==t&&this.set(r,i)}})}values(){return(0,i.gc)(this._observable),this._map.values()}[Symbol.iterator](){return(0,i.gc)(this._observable),this._map[Symbol.iterator]()}[Symbol.dispose](){this._observable.destroy()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}_notify(){this._batchDepth>0?this._notifyPending=!0:this._observable.notify()}}},32756:(e,t,r)=>{r.d(t,{Rr:()=>a,fY:()=>d,ne:()=>l});var i=r(31635),n=r(93637),s=r(91429),o=r(91880);function a(e,t,r){if(!e)return null;const i=e.find(e=>!!e.field);if(!i)return null;const n=new o.A;return n.read(i,r),[n]}const l={type:[o.A],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:a},write:{writer:function(e,t,r,i){const s=e.find(e=>!!e.field);s&&(0,n.sM)(r,[s.toJSON()],t)}}}},d=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.orderBy=null}};return(0,i.Cg)([(0,s.MZ)(l)],r.prototype,"orderBy",void 0),r=(0,i.Cg)([(0,s.$K)("esri.layers.mixins.OrderedLayer")],r),r}},33143:(e,t,r)=>{r.d(t,{A:()=>u});var i=r(31635),n=r(69540),s=r(25482),o=r(91429),a=r(80451),l=r(29005),d=r(36005),p=r(43937);let u=class extends((0,n.OU)(s.o)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,a.rS)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,i.Cg)([(0,o.MZ)({json:{write:!0}})],u.prototype,"id",void 0),(0,i.Cg)([(0,o.MZ)({json:{write:!0}})],u.prototype,"name",void 0),(0,i.Cg)([(0,o.MZ)({json:{write:!0}})],u.prototype,"domains",void 0),(0,i.Cg)([(0,d.w)("domains")],u.prototype,"readDomains",null),(0,i.Cg)([(0,p.K)("domains")],u.prototype,"writeDomains",null),(0,i.Cg)([(0,o.MZ)({type:[l.A],json:{write:!0}})],u.prototype,"templates",void 0),u=(0,i.Cg)([(0,o.$K)("esri.layers.support.FeatureType")],u)},44794:(e,t,r)=>{r.d(t,{v:()=>a});var i=r(4718),n=r(62788),s=r(95488);class o{constructor(e,t){this._observable=new s.I,this._value=e,this._equalityFunction=t}get value(){return(0,n.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function a(e,t=i.gh){return new o(e,t)}},46140:(e,t,r)=>{r.d(t,{R:()=>n});var i=r(49186);let n=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[n,s]=t.split("."),o=/^\s*\d+\s*$/;if(!n?.match||!o.test(n))throw new i.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!s?.match||!o.test(s))throw new i.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const a=parseInt(n,10),l=parseInt(s,10);return new e(a,l,r)}}},55674:(e,t,r)=>{r.d(t,{Ad:()=>y,Gj:()=>g,QY:()=>c,lL:()=>m,xR:()=>h});var i=r(66131),n=r(49186),s=(r(44208),r(44729)),o=r(15032),a=r(65864),l=r(95466),d=r(43668),p=r(98623);const u=["geometry","scale","timeProperties"];function c(e,t){if(null!=t)for(const r of u)t.hasArcadeDependency(r)&&e.add(r);return e}function y(e,t){return f.create(e,t,null,["$feature","$view"])}function h(e,t,r){return f.create(e,t,r,["$feature","$view","$config"])}class f{static async create(e,t,r,i){const{arcade:s,Dictionary:o}=await(0,d.l)();let a;try{a=s.parseScript(e)}catch(t){throw new n.A("arcade-bad-expression","Failed to parse arcade script",{script:e,error:t})}const l=s.scriptUsesGeometryEngine(a);l&&await s.enableGeometrySupport(),await s.loadDependentModules(new Set,a,null,!1,l);const p={vars:i.reduce((e,t)=>({...e,[t]:null}),{}),spatialReference:t,useAsync:!1},u=s.compileScript(a,p);let c=null;null!=r&&(c=new o(r),c.immutable=!0);const y=new o;return y.immutable=!1,y.setField("scale",0),new f(e,s,a,u,t,y,c,o)}constructor(e,t,r,i,n,s,o,a){this.script=e,this._arcade=t,this._syntaxTree=r,this._compiled=i,this._spatialReference=n,this._viewDict=s,this._configDict=o,this._dictionaryCtor=a,this._dependencies=new Map,this._featureReader=new g,this._dependencies.set("geometry",t.scriptTouchesGeometry(this._syntaxTree)),this._dependencies.set("scale",this._arcade.referencesMember(this._syntaxTree,"scale")),this._dependencies.set("timeProperties",this._arcade.scriptUsesViewProperties(this._syntaxTree,["timeProperties"]))}evaluate(e,t){const r=t.$view?.timeZone;if(t.$view){let e;if(this._viewDict.setField("scale",t.$view.scale),null!=t.$view.timeProperties){const{currentStart:n,currentEnd:s}=t.$view.timeProperties;e=new this._dictionaryCtor({currentStart:null!=n?null!=r?i.lY.epochToArcadeDate(n,r):i.lY.unknownEpochToArcadeDate(n):void 0,currentEnd:null!=s?null!=r?i.lY.epochToArcadeDate(s,r):i.lY.unknownEpochToArcadeDate(s):void 0,startIncluded:!0,endIncluded:!0})}this._viewDict.setField("timeProperties",e)}return this._compiled({vars:{$view:this._viewDict,$config:this._configDict,$feature:e},spatialReference:this._spatialReference,timeZone:r})}repurposeFeature(e,t){return this._featureReader.bind(e,t,this._spatialReference),this._featureReader}references(e){return this._dependencies.get(e)??!1}}class g{constructor(){this._boundTarget=null,this._boundSchema={fields:null,fieldsIndex:null,spatialReference:null,get geometryType(){return null},get objectIdField(){return null}},this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}bind(e,t,r){const i=t??new l.A(m(e.attributes));this._boundTarget=e,this._boundSchema.fields=i.fields,this._boundSchema.fieldsIndex=i,this._boundSchema.spatialReference=r}_getField(e){return this._boundSchema.fieldsIndex.get(e)}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this._boundSchema.fieldsIndex.has(e)}geometry(){if("fromJSON"in this._boundTarget)return this._boundTarget.geometry;const e=(0,a.rS)(this._boundTarget.geometry);if(e){if(!this._boundSchema.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");e.spatialReference=this._boundSchema.spatialReference}return e}_hasGeometry(){return null!=this._boundTarget.geometry}isUnknownDateTimeField(e){return this._boundSchema.fieldsIndex.getTimeZone(e)===p.L5}field(e,t=!0){const r=this._getField(e);if(r){const t=this._boundTarget.attributes[r.name];if(null==t)return null;switch(r.type){case"date-only":case"esriFieldTypeDateOnly":return s.n.fromReader(t);case"time-only":case"esriFieldTypeTimeOnly":return o.k.fromReader(t);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return i.lY.fromReaderAsTimeStampOffset(t);case"date":case"esriFieldTypeDate":return this.isUnknownDateTimeField(e)?i.lY.unknownEpochToArcadeDate(t):i.lY.epochToArcadeDate(t,this.contextTimeZone??p.qU);default:return t}}if(t)throw new Error(`Field ${e} does not exist`);return null}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this._boundSchema.fieldsIndex.fields.map(e=>e.name)}isEmpty(){return this._boundSchema.fields.length<=0&&!this._hasGeometry()}castToText(e=!1){return JSON.stringify(this._boundTarget)}gdbVersion(){return null}fullSchema(){return this._boundSchema}castAsJson(e=null){return{attributes:this._boundTarget.attributes,geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}}function m(e){const t=[];for(const r in e)t.push({name:r,alias:r,type:"string"==typeof e[r]?"esriFieldTypeString":"esriFieldTypeDouble"});return t}},58501:(e,t,r)=>{r.d(t,{q:()=>n});var i=r(62815);function n(e,t,r){if(!r?.features||!r.hasZ)return;const n=(0,i.N)(r.geometryType,t,e.outSpatialReference);if(n)for(const e of r.features)n(e.geometry)}},73681:(e,t,r)=>{r.d(t,{n:()=>l});var i=r(49186),n=r(53966),s=r(46140),o=r(95466),a=r(55674);class l{static async from(e,t,r){const o=e.dictionary_version?s.R.parse(e.dictionary_version):null,p=new Set(e.itemsNames),u={};if(t)for(const e in t)u[e]=t[e];if(e.authoringInfo.configuration)for(const t of e.authoringInfo.configuration)u.hasOwnProperty(t.name)||(u[t.name]=t.value);const c=new Set(e.authoringInfo.symbol);for(const e of Object.keys(r))c.delete(e);c.size&&n.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("missing-fields: fieldMap entries for the following symbol fields are missing",{symbolFields:c});const y=await(0,a.xR)(e.expression,null,u);if(!y)throw new i.A("dictionary-renderer:expression-error","Unable to create dictionary renderer expression");const h=!o||!o.greaterEqual(4,0);h&&n.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("Dictionary script does not support native field types. Applying fallback",{version:o});const f=new d(r,h);return new l(h,p,y,f)}constructor(e,t,r,i){this._requiresFieldCoercionToString=e,this._itemNames=t,this._compiled=r,this._reader=i}get itemNames(){return this._itemNames}evaluate(e,t,r,i){try{return this._reader.bind(e,r,i),this._compiled.evaluate(this._reader,{$view:{scale:t}})}catch(e){n.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("arcade: dictionary script evaluation failed",{error:e})}return null}createDictionaryFieldsIndex(e){if(!this._requiresFieldCoercionToString)return new o.A(e);const t=e.map(e=>({...e,type:"esriFieldTypeString"}));return new o.A(t)}}class d extends a.Gj{constructor(e,t){super(),this._fieldMap=e,this._requiresFieldCoercionToString=t}_getField(e){const t=this._fieldMap[e]??e;return this._boundSchema.fieldsIndex.get(t)}field(e){if(!this._requiresFieldCoercionToString)return super.field(e,!1);const t=this._getField(e);return null==t||null==this._boundTarget.attributes[t.name]?"":""+this._boundTarget.attributes[t.name]}}},83508:(e,t,r)=>{r.r(t),r.d(t,{default:()=>fe});var i=r(31635),n=r(11254),s=r(7762),o=r(49186),a=r(91869),l=r(25728),d=r(74887),p=r(84952),u=r(91429),c=r(4146),y=r(36563),h=r(66344),f=r(32587),g=r(36708),m=r(44794),w=r(56507),b=r(63074),v=r(25036),_=r(10873),C=r(91880),M=r(1873);let Z=class extends((0,v.j)((0,b.dM)((0,l.P)(c.A)))){constructor(e){super(e),this._layerCache=new h.q(20,e=>e.destroy()),this._oidToReference=new f.A,this._layerToReference=new Map,this.legendEnabled=!0,this.layers=new s.A,this.maximumVisibleSublayers=10,this.opacity=1,this.parent=null,this.persistenceEnabled=!0,this.title="Layers in view",this.type="catalog-dynamic-group",this.visible=!0}initialize(){this.addHandles([this.layers.on("after-add",({item:e})=>{e.parent=this}),this.layers.on("after-remove",({item:e})=>{e.parent=null}),(0,g.wB)(()=>this._orderBy,()=>{this._updateLayerSortValues(),this._sortAllLayers()})])}load(e){return this.addResolvingPromise(this.parent.load()),Promise.resolve(this)}destroy(){this._layerCache.destroy(),this._oidToReference.clear(),this._layerToReference.clear()}get _orderBy(){return this.parent?this.parent.orderBy?.find(e=>!e.valueExpression&&e.field)??new C.A({field:this.parent.objectIdField}):null}get _referenceComparator(){const e=this._orderBy;if(!this.parent||!e)return()=>0;const t=this.parent.fieldsIndex.get(e.field),r=(0,M.FM)(t?.toJSON().type,"descending"===e.order),i=(0,M.FM)("esriFieldTypeOID","descending"===e.order);return(e,t)=>r(t.sortValue,e.sortValue)||i(t.objectId,e.objectId)}get fullExtent(){return this.parent?.fullExtent??null}get updating(){return(0,a.Bs)(this._oidToReference,({pending:e})=>null!=e)}acquireLayer(e){if(this.destroyed)return(0,y.hA)();const t=this._getLayerReference(e);return t.count++,(0,y.hA)(()=>{t.count--,t.count||this._destroyLayerReference(t)})}_getLayerReference(e){const t=e.getObjectId();return(0,a.tE)(this._oidToReference,t,()=>{const t=e.getObjectId(),r=`${t}`,i=e.getAttribute(this.parent.itemSourceField),n=new F(e,t,i),s=this._layerCache.pop(r);return s?(this._addLayer(n,s),n):(n.pending=this.parent.createLayerFromFootprint(e).then(e=>{n.count?this._addLayer(n,e):(this.destroyed||this._layerCache.get(r)||this._layerCache.put(r,e),n.layer=null)}).catch(()=>{}).finally(()=>{n.pending=null}),n)})}_destroyLayerReference(e){e.layer&&(this._layerToReference.delete(e.layer),this.layers.remove(e.layer),this.destroyed?e.layer.destroy():this._layerCache.put(`${e.objectId}`,e.layer),e.layer=null),this._oidToReference.delete(e.objectId)}_addLayer(e,t){e.layer=t,t.persistenceEnabled=!1,this._layerToReference.set(t,e),this._updateLayerSortValue(e),this.layers.add(t),this._sortAllLayers()}_updateLayerSortValues(){for(const e of this._layerToReference.values())this._updateLayerSortValue(e)}_updateLayerSortValue(e){this._orderBy&&(e.sortValue=e.footprint.getAttribute(this._orderBy.field))}_sortAllLayers(){this.layers.sort((e,t)=>this._referenceComparator(this._layerToReference.get(e),this._layerToReference.get(t)))}};(0,i.Cg)([(0,u.MZ)()],Z.prototype,"_orderBy",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],Z.prototype,"_referenceComparator",null),(0,i.Cg)([(0,u.MZ)(_.fV)],Z.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,u.MZ)({type:["show","hide","hide-children"],json:{write:!0}})],Z.prototype,"listMode",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],Z.prototype,"fullExtent",null),(0,i.Cg)([(0,u.MZ)({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0,isRequired:!0}}})],Z.prototype,"id",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],Z.prototype,"layers",void 0),(0,i.Cg)([(0,u.MZ)({type:w.jz,range:{min:0,max:50},json:{write:!0,default:10}})],Z.prototype,"maximumVisibleSublayers",void 0),(0,i.Cg)([(0,u.MZ)(_.ke)],Z.prototype,"opacity",void 0),(0,i.Cg)([(0,u.MZ)({clonable:!1})],Z.prototype,"parent",void 0),(0,i.Cg)([(0,u.MZ)({type:String,nonNullable:!0,json:{write:{ignoreOrigin:!0,isRequired:!0}}})],Z.prototype,"title",void 0),(0,i.Cg)([(0,u.MZ)({json:{read:!1}})],Z.prototype,"type",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],Z.prototype,"updating",null),(0,i.Cg)([(0,u.MZ)({type:Boolean,json:{name:"visibility",write:!0}})],Z.prototype,"visible",void 0),Z=(0,i.Cg)([(0,u.$K)("esri.layers.catalog.CatalogDynamicGroupLayer")],Z);class F{constructor(e,t,r){this.footprint=e,this.objectId=t,this.itemSource=r,this.count=0,this.layer=null,this.sortValue=void 0,this._pending=(0,m.v)(null)}get pending(){return this._pending.value}set pending(e){this._pending.value=e}}var x=r(37838),S=r(4718),T=r(965),I=r(55156),O=r(60950),j=r(89808),E=r(99959);const R=Symbol("isCatalogGraphicOrigin");var A;class L extends E.A{get[(A=R,O.ym)](){return this.layer}get[I.e](){return this.layer}get[j.Q](){return this.layer}constructor(e){super(),this[A]=!0,this.type="catalog",this.layer=e}get id(){return this.layer.id}}var P=r(87718),q=r(30524),D=r(46499),N=r(39383),G=r(96576),V=r(41214),$=r(30291),B=r(94985);let k=class extends((0,v.j)((0,P.F)((0,b.dM)((0,l.P)(c.A))))){constructor(e){super(e),this.attributeTableTemplate=null,this.charts=null,this.editingEnabled=!0,this.elevationInfo=null,this.formTemplate=null,this.graphicOrigin=new L(this),this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.opacity=1,this.parent=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.title="Footprints",this.type="catalog-footprint",this.visible=!0}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.parent.load(e),(0,q.yp)(this.renderer,this.fieldsIndex),this.addHandles([this.parent.on("apply-edits",e=>this.emit("apply-edits",e)),this.parent.on("edits",e=>this.emit("edits",e)),this.parent.on("refresh",e=>this.emit("refresh",e))])}get apiKey(){return this.parent?.apiKey}get capabilities(){return this.parent?.capabilities}get customParameters(){return this.parent?.customParameters}get dateFieldsTimeZone(){return this.parent?.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this.parent?.datesInUnknownTimezone??!1}get definitionExpression(){return this.parent?.definitionExpression}get editingInfo(){return this.parent?.editingInfo}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get createQueryVersion(){return this.parent?.createQueryVersion}get defaultPopupTemplate(){return this.createPopupTemplate()}get displayField(){return this.parent?.displayField}get displayFilterEnabled(){return this.parent?.displayFilterEnabled??!0}get displayFilterInfo(){return this.parent?.displayFilterInfo??null}get effectiveEditingEnabled(){return!1}get fields(){return this.parent?.fields}get fieldsIndex(){return this.parent?.fieldsIndex}get fullExtent(){return this.parent?.fullExtent}get geometryFieldsInfo(){return this.parent?.geometryFieldsInfo}get geometryType(){return this.parent?.geometryType}get globalIdField(){return this.parent?.globalIdField}get hasM(){return this.parent?.hasM??!1}get hasZ(){return this.parent?.hasZ??!1}get objectIdField(){return this.parent?.objectIdField}get orderBy(){return this.parent?.orderBy??null}get outFields(){return this.parent?.outFields}get parsedUrl(){return this.parent?.parsedUrl??null}get preferredTimeZone(){return this.parent?.preferredTimeZone??null}set renderer(e){(0,q.yp)(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){return this._isOverridden("renderer")?this._get("renderer"):function(){const e=new B.A({style:"solid",color:[0,0,0,0],outline:{style:"solid",color:[96,96,96,.75],width:.75}});return new G.A({symbol:e})}()}get returnM(){return this.parent?.returnM}get returnZ(){return this.parent?.returnZ}get source(){return this.parent?.source}get timeExtent(){return this.parent?.timeExtent}get timeInfo(){return this.parent?.timeInfo}get timeOffset(){return this.parent?.timeOffset}get typeIdField(){return this.parent?.typeIdField}get types(){return this.parent?.types}get useViewTime(){return this.parent?.useViewTime??!0}get version(){return this.parent?.version}async applyEdits(e,t){return await this.load(),this.parent.applyEdits(e,t)}createPopupTemplate(e){const t={fields:this.fields,objectIdField:this.objectIdField,title:this.title};return(0,$.tn)(t,e)}createQuery(){return this.parent?.createQuery()}getField(e){return this.parent?.getField(e)}getFieldDomain(e,t){return this.parent?.getFieldDomain(e,t)}async queryExtent(e,t){return await this.load(),this.parent.queryExtent(e,t)}async queryFeatures(e,t){return await this.load(),this.parent.queryFeatures(e,t)}async queryFeatureCount(e,t){return await this.load(),this.parent.queryFeatureCount(e,t)}async queryObjectIds(e,t){return await this.load(),this.parent.queryObjectIds(e,t)}async queryAttributeBins(e,t){return await this.load(),this.parent.queryAttributeBins(e,t)}};(0,i.Cg)([(0,u.MZ)(_.zQ)],k.prototype,"attributeTableTemplate",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"apiKey",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"capabilities",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"customParameters",null),(0,i.Cg)([(0,u.MZ)()],k.prototype,"dateFieldsTimeZone",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"datesInUnknownTimezone",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"definitionExpression",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"editingInfo",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"effectiveCapabilities",null),(0,i.Cg)([(0,u.MZ)({json:{origins:{"web-scene":{write:!1}},write:!0}})],k.prototype,"charts",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"createQueryVersion",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"defaultPopupTemplate",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"displayField",null),(0,i.Cg)([(0,u.MZ)({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],k.prototype,"editingEnabled",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"effectiveEditingEnabled",null),(0,i.Cg)([(0,u.MZ)((()=>{const e=(0,S.o8)(_.Yj);return e.json.origins["web-map"]={read:!1,write:!1},e})())],k.prototype,"elevationInfo",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"fields",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"fieldsIndex",null),(0,i.Cg)([(0,u.MZ)({type:T.A,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],k.prototype,"formTemplate",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"fullExtent",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"geometryFieldsInfo",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"geometryType",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"globalIdField",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0,clonable:!1})],k.prototype,"graphicOrigin",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"hasM",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"hasZ",null),(0,i.Cg)([(0,u.MZ)({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0,isRequired:!0}}})],k.prototype,"id",void 0),(0,i.Cg)([(0,u.MZ)({type:[D.A],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:N.w,write:!0}})],k.prototype,"labelingInfo",void 0),(0,i.Cg)([(0,u.MZ)(_.kF)],k.prototype,"labelsVisible",void 0),(0,i.Cg)([(0,u.MZ)(_.fV)],k.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,u.MZ)({type:["show","hide"],json:{write:!0}})],k.prototype,"listMode",void 0),(0,i.Cg)([(0,u.MZ)((()=>{const e=(0,S.o8)(_.hG);return e.json.origins.service.read=!1,e})())],k.prototype,"maxScale",void 0),(0,i.Cg)([(0,u.MZ)((()=>{const e=(0,S.o8)(_.hn);return e.json.origins.service.read=!1,e})())],k.prototype,"minScale",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"objectIdField",null),(0,i.Cg)([(0,u.MZ)(_.ke)],k.prototype,"opacity",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"orderBy",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"outFields",null),(0,i.Cg)([(0,u.MZ)({clonable:!1})],k.prototype,"parent",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"parsedUrl",null),(0,i.Cg)([(0,u.MZ)(_.M6)],k.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,u.MZ)({type:x.A,json:{name:"popupInfo",write:!0}})],k.prototype,"popupTemplate",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"preferredTimeZone",null),(0,i.Cg)([(0,u.MZ)({types:V.Hg,json:{origins:{"web-scene":{types:V.XJ}},name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(e,t){return{ignoreOrigin:this.originIdOf(t)<3}}}}})],k.prototype,"renderer",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"returnM",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"returnZ",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"source",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"timeExtent",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"timeInfo",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"timeOffset",null),(0,i.Cg)([(0,u.MZ)({type:String,nonNullable:!0,json:{write:{ignoreOrigin:!0,isRequired:!0}}})],k.prototype,"title",void 0),(0,i.Cg)([(0,u.MZ)({json:{read:!1}})],k.prototype,"type",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"typeIdField",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"types",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],k.prototype,"useViewTime",null),(0,i.Cg)([(0,u.MZ)({type:Boolean,json:{name:"visibility",write:!0}})],k.prototype,"visible",void 0),k=(0,i.Cg)([(0,u.$K)("esri.layers.catalog.CatalogFootprintLayer")],k);var J=r(72593),z=r(52136),U=r(18768),Q=r(69208),K=r(6455),Y=r(47685),H=r(87796),W=r(16131),X=r(32756),ee=r(8303),te=r(54310),re=r(82935),ie=r(15426),ne=r(33143),se=r(17036),oe=r(91908),ae=r(20655),le=r(80812),de=r(39131),pe=r(61956);const ue=(0,se.p)();function ce(e,t,r,i){const n=e.write({},i);(function(e){if(null==e)return!0;const t=Object.keys(e);return!t.length||1===t.length&&"id"===t[0]})(n)||(t[r]=n)}let ye=class extends((0,K.FJ)((0,H.j)((0,Y.w6)((0,b.dM)((0,X.fY)((0,re.e)((0,v.j)((0,te.J)((0,U.b)((0,W.q)((0,ee.A)((0,l.P)((0,Q.d)((0,z.p)(c.A))))))))))))))){constructor(e){super(e),this.legendEnabled=!0,this._portals=new Map,this._layerToFootprint=new WeakMap,this.drawOrderField="cd_draworder",this.dynamicGroupLayer=new Z({parent:this}),this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.floorInfo=null,this.footprintLayer=new k({parent:this}),this.itemNameField="cd_itemname",this.itemSourceField="cd_itemsource",this.itemTypeField="cd_itemtype",this.layers=new s.A([this.dynamicGroupLayer,this.footprintLayer]),this.maxScaleField="cd_maxscale",this.minScaleField="cd_minscale",this.orderBy=null,this.outFields=null,this.supportedSourceTypes=new Set(["Catalog Layer"]),this.source=new J.default({layer:this,supportedSourceTypes:this.supportedSourceTypes}),this.type="catalog",this.typeIdField=null,this.types=null}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(d.QP).then(async()=>{const{url:e,source:r,portalItem:i}=this;if(!e)throw new o.A("catalog-layer:missing-url","Catalog layer must be created with a url");if(null==this.layerId){const r=await this._fetchFirstValidLayerId(t);if(null==r)throw new o.A("catalog-layer:missing-layerId","There is no Catalog Layer in the service",{service:e});this.layerId=r}await r.load({signal:t});const{sourceJSON:n}=r;n&&(this.sourceJSON=n,this.read(n,{origin:"service",portalItem:i,portal:i?.portal,url:this.parsedUrl}))}).then(()=>{const e=[this.itemNameField,this.itemSourceField,this.itemTypeField,this.minScaleField,this.maxScaleField],t=e.filter(e=>!this.fieldsIndex.has(e));if(t.length)throw new o.A("catalog-layer:missing-fields","There are missing fields to operate properly",{requiredFields:e,missingFields:t})}).then(()=>(0,ie.VA)(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}destroy(){this.footprintLayer.destroy(),this.dynamicGroupLayer.destroy();for(const e of this._portals.values())e.destroy();this._portals.clear()}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return!1}async applyEdits(e,t){return(0,ie.ct)(this,e,t)}async createLayerFromFootprint(e){const t=await this._createLayer(e);return this._configureLayer(t,e),this._layerToFootprint.set(t,e),t}createFootprintFromLayer(e){return this._layerToFootprint.get(e)?.clone()}createQuery(){const e=new pe.A,t=this.capabilities?.query;e.returnGeometry=!0,t&&(e.compactGeometryEnabled=t.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=t.supportsDefaultSpatialReference),e.outFields=["*"];const{timeOffset:r,timeExtent:i}=this;return e.timeExtent=null!=r&&null!=i?i.offset(-r.value,r.unit):i||null,e.where=this.definitionExpression||"1=1",e}getFeatureType(e){return(0,ie.xd)(this.types,this.typeIdField,e)}getFieldDomain(e,t){const r=t?.feature,i=this.getFeatureType(r);if(i){const t=i.domains&&i.domains[e];if(t&&"inherited"!==t.type)return t}return this.getField(e)?.domain}async hasDataChanged(){return(0,ie.jp)(this)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(pe.A.from(e)??r.createQuery(),t),n=r.footprintLayer.graphicOrigin;if(i?.features)for(const e of i.features)e.layer=e.sourceLayer=r.footprintLayer,e.origin=n;return i}async queryObjectIds(e,t){return(await this.load()).source.queryObjectIds(pe.A.from(e)??this.createQuery(),t)}async queryFeatureCount(e,t){return(await this.load()).source.queryFeatureCount(pe.A.from(e)??this.createQuery(),t)}async queryExtent(e,t){return(await this.load()).source.queryExtent(pe.A.from(e)??this.createQuery(),t)}serviceSupportsSpatialReference(e){return this.loaded&&(0,oe.D)(this,e)}read(e,t){if(super.read(e,t),e){const{footprintLayer:r,dynamicGroupLayer:i}=e;r&&this.footprintLayer.read(r,t),i&&this.dynamicGroupLayer.read(i,t)}}async queryAttributeBins(e,t){const{source:i,capabilities:n}=await this.load();(0,ie.ZJ)(e,n,"CatalogLayer");const s=await r.e(6956).then(r.bind(r,14575)),o=await i.queryAttributeBins(s.default.from(e),t);if(o.features)for(const e of o.features)e.layer=e.sourceLayer=this.footprintLayer;return o}async _fetchFirstValidLayerId(e){const{data:t}=await(0,n.A)(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(this.applyPreferredHost(t),Array.isArray(t?.layers))return t.layers.find(({type:e})=>this.supportedSourceTypes.has(e))?.id}async _createLayer(e){const t=e.getAttribute(this.itemSourceField);if(!t)throw new o.A("catalog-layer:item-source-missing",`The footprint is missing the "${this.itemSourceField}" attribute`);const i=JSON.parse(t);if(function(e){return"object"==typeof e&&null!=e&&"itemId"in e&&"portalUrl"in e}(i)){const{itemId:e,portalUrl:t}=i,r=(0,de.qG)(t),n=this.portalItem?.portal,s=ae.A.getDefault();let o,l=!0;n&&(0,p.ut)(t,n.url)?o=n:(0,p.ut)(t,s.url)?o=s:(o=(0,a.tE)(this._portals,r,()=>new ae.A({url:r})),l=!1);const d=await c.A.fromPortalItem(new le.default({id:e,portal:o}));return l||await he(d),d}if(function(e){return"object"==typeof e&&null!=e&&"url"in e}(i))return c.A.fromArcGISServerUrl({url:i.url});const{default:n}=await r.e(7546).then(r.bind(r,45165));return new n}_configureLayer(e,t){const r=t.getAttribute(this.itemNameField);r&&(e.title=r);const i=t.getAttribute(this.maxScaleField);null!=i&&"maxScale"in e&&(e.maxScale=i);const n=t.getAttribute(this.minScaleField);null!=n&&"minScale"in e&&(e.minScale=n)}};async function he(e){if("portalItem"in e&&e.portalItem){try{await e.load()}catch{}e.portalItem=null,"group"===e.type&&await Promise.allSettled([...e.layers.map(e=>he(e)),...e.tables.map(e=>he(e))])}}(0,i.Cg)([(0,u.MZ)(_.fV)],ye.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],ye.prototype,"createQueryVersion",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],ye.prototype,"drawOrderField",void 0),(0,i.Cg)([(0,u.MZ)({type:Z,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:ce}}})],ye.prototype,"dynamicGroupLayer",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],ye.prototype,"editingEnabled",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],ye.prototype,"effectiveEditingEnabled",null),(0,i.Cg)([(0,u.MZ)({json:{origins:{"web-scene":{name:"layerDefinition.elevationInfo",read:!1,write:!1}}}})],ye.prototype,"elevationInfo",void 0),(0,i.Cg)([(0,u.MZ)({...ue.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],ye.prototype,"fields",void 0),(0,i.Cg)([(0,u.MZ)(ue.fieldsIndex)],ye.prototype,"fieldsIndex",void 0),(0,i.Cg)([(0,u.MZ)({json:{origins:{"web-scene":{name:"layerDefinition.floorInfo",read:!1,write:!1}}}})],ye.prototype,"floorInfo",void 0),(0,i.Cg)([(0,u.MZ)({type:k,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:ce}}})],ye.prototype,"footprintLayer",void 0),(0,i.Cg)([(0,u.MZ)(_.id)],ye.prototype,"id",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],ye.prototype,"itemNameField",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],ye.prototype,"itemSourceField",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],ye.prototype,"itemTypeField",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],ye.prototype,"layers",void 0),(0,i.Cg)([(0,u.MZ)({type:["show","hide","hide-children"]})],ye.prototype,"listMode",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],ye.prototype,"maxScaleField",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],ye.prototype,"minScaleField",void 0),(0,i.Cg)([(0,u.MZ)({value:"CatalogLayer",type:["CatalogLayer"]})],ye.prototype,"operationalLayerType",void 0),(0,i.Cg)([(0,u.MZ)({json:{origins:{"web-scene":{name:"layerDefinition.orderBy",write:!0,read:!0}}}})],ye.prototype,"orderBy",void 0),(0,i.Cg)([(0,u.MZ)(ue.outFields)],ye.prototype,"outFields",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],ye.prototype,"source",void 0),(0,i.Cg)([(0,u.MZ)({json:{read:!1}})],ye.prototype,"type",void 0),(0,i.Cg)([(0,u.MZ)({type:String})],ye.prototype,"typeIdField",void 0),(0,i.Cg)([(0,u.MZ)({type:[ne.A]})],ye.prototype,"types",void 0),ye=(0,i.Cg)([(0,u.$K)("esri.layers.CatalogLayer")],ye);const fe=ye},87718:(e,t,r)=>{r.d(t,{F:()=>x,Y:()=>F});var i,n=r(31635),s=r(91429),o=r(49186),a=r(25482),l=r(93637),d=r(76369),p=r(66552),u=r(4718),c=r(50498),y=r(61956),h=r(79677);const f=new p.J({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),g=new p.J({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let m=i=class extends a.o{constructor(e){super(e),this.where=null,this.geometry=null,this.spatialRelationship="intersects",this.distance=void 0,this.objectIds=null,this.units=null,this.timeExtent=null}createQuery(e={}){const{where:t,geometry:r,spatialRelationship:i,timeExtent:n,objectIds:s,units:o,distance:a}=this;return new y.A({geometry:(0,u.o8)(r),objectIds:(0,u.o8)(s),spatialRelationship:i,timeExtent:(0,u.o8)(n),where:t,units:o,distance:a,...e})}clone(){const{where:e,geometry:t,spatialRelationship:r,timeExtent:n,objectIds:s,units:o,distance:a}=this;return new i({geometry:(0,u.o8)(t),objectIds:(0,u.o8)(s),spatialRelationship:r,timeExtent:(0,u.o8)(n),where:e,units:o,distance:a})}};(0,n.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],m.prototype,"where",void 0),(0,n.Cg)([(0,s.MZ)({types:c.yR,json:{write:!0}})],m.prototype,"geometry",void 0),(0,n.Cg)([(0,s.MZ)({type:f.apiValues,json:{name:"spatialRel",read:{reader:f.read},write:{allowNull:!1,writer:f.write,overridePolicy(){return{enabled:null!=this.geometry}}}}})],m.prototype,"spatialRelationship",void 0),(0,n.Cg)([(0,s.MZ)({type:Number,json:{write:{overridePolicy(e){return{enabled:null!=e&&null!=this.geometry}}}}})],m.prototype,"distance",void 0),(0,n.Cg)([(0,s.MZ)({type:[Number],json:{write:!0}})],m.prototype,"objectIds",void 0),(0,n.Cg)([(0,s.MZ)({type:g.apiValues,json:{read:g.read,write:{writer:g.write,overridePolicy(e){return{enabled:null!=e&&null!=this.geometry}}}}})],m.prototype,"units",void 0),(0,n.Cg)([(0,s.MZ)({type:h.A,json:{write:!0}})],m.prototype,"timeExtent",void 0),m=i=(0,n.Cg)([(0,s.$K)("esri.layers.support.FeatureFilter")],m);const w=m;var b;const v={read:{reader:d.LF},write:{writer:d.M9,overridePolicy(){return{allowNull:null!=this.excludedEffect,isRequired:null==this.excludedEffect}}}},_={read:{reader:d.LF},write:{writer:d.M9,overridePolicy(){return{allowNull:null!=this.includedEffect,isRequired:null==this.includedEffect}}}},C={name:"showExcludedLabels",default:!0};let M=b=class extends a.o{constructor(e){super(e),this.filter=null,this.includedEffect=null,this.excludedEffect=null,this.excludedLabelsVisible=!1}write(e,t){const r=super.write(e,t);if(t?.origin){if(r.filter){const e=Object.keys(r.filter);if(e.length>1||"where"!==e[0])return t.messages?.push(new o.A("web-document-write:unsupported-feature-effect","Invalid feature effect 'filter'. A filter can only contain a 'where' property",{layer:t.layer,effect:this})),null}if("showExcludedLabels"in r)return t.messages?.push(new o.A("web-document-write:unsupported-feature-effect","Invalid value for property 'excludedLabelsVisible' which should always be 'true'",{layer:t.layer,effect:this})),null}return r}clone(){return new b({filter:null!=this.filter?this.filter.clone():null,includedEffect:this.includedEffect,excludedEffect:this.excludedEffect,excludedLabelsVisible:this.excludedLabelsVisible})}};(0,n.Cg)([(0,s.MZ)({type:w,json:{write:{allowNull:!0,writer(e,t,r,i){const n=e?.write({},i);n&&0!==Object.keys(n).length?(0,l.sM)(r,n,t):(0,l.sM)(r,null,t)}}}})],M.prototype,"filter",void 0),(0,n.Cg)([(0,s.MZ)({json:{read:d.LF,write:{writer:d.M9,allowNull:!0},origins:{"web-map":v,"portal-item":v}}})],M.prototype,"includedEffect",void 0),(0,n.Cg)([(0,s.MZ)({json:{read:d.LF,write:{writer:d.M9,allowNull:!0},origins:{"web-map":_,"portal-item":_}}})],M.prototype,"excludedEffect",void 0),(0,n.Cg)([(0,s.MZ)({type:Boolean,json:{write:!0,name:"showExcludedLabels",origins:{"web-map":C,"portal-item":C}}})],M.prototype,"excludedLabelsVisible",void 0),M=b=(0,n.Cg)([(0,s.$K)("esri.layers.support.FeatureEffect")],M);const Z={write:{allowNull:!0}},F={type:M,json:{origins:{"web-map":Z,"portal-item":Z}}},x=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.featureEffect=null}};return(0,n.Cg)([(0,s.MZ)(F)],r.prototype,"featureEffect",void 0),r=(0,n.Cg)([(0,s.$K)("esri.layers.mixins.FeatureEffectLayer")],r),r}},91880:(e,t,r)=>{r.d(t,{A:()=>d});var i,n=r(31635),s=r(66552),o=r(25482),a=r(91429);const l=new s.J({asc:"ascending",desc:"descending"});let d=class extends o.o{static{i=this}constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new i({field:this.field,valueExpression:this.valueExpression,order:this.order})}};(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],d.prototype,"field",void 0),(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],d.prototype,"valueExpression",void 0),(0,n.Cg)([(0,a.MZ)({type:l.apiValues,json:{type:l.jsonValues,read:l.read,write:l.write}})],d.prototype,"order",void 0),d=i=(0,n.Cg)([(0,a.$K)("esri.layers.support.OrderByInfo")],d)},96520:(e,t,r)=>{r.d(t,{u:()=>o});var i=r(86211),n=r(21325);function s(e,t,r){if(null==e.hasM||e.hasZ)for(const e of t)for(const t of e)t.length>2&&(t[2]*=r)}function o(e,t,r){if(!e&&!t||!r)return;const n=(0,i.G9)(r);a(e,r,n),a(t,r,n)}function a(e,t,r){if(e)for(const i of e)l(i.geometry,t,r)}function l(e,t,r){if(!e?.spatialReference||(0,n.aI)(e.spatialReference,t))return;const o=(0,i.G9)(e.spatialReference)/r;if(1!==o)if("x"in e)null!=e.z&&(e.z*=o);else if("rings"in e)s(e,e.rings,o);else if("paths"in e)s(e,e.paths,o);else if("points"in e&&(null==e.hasM||e.hasZ))for(const t of e.points)t.length>2&&(t[2]*=o)}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3054,3169,8125],{49074:(e,t,n)=>{n.d(t,{fz:()=>i,g7:()=>s,zo:()=>u});var r=n(76061),o=(n(55537),n(39117));n(83661),n(88885),n(79187),n(95213);const a=new o.K;function s(e,t,n){return a.execute(e,t,n,null)}function u(e,t,n){const o=a.executeMany(new r.S(e),new r.S([t]),n,null);return Array.from(o)}function i(){return a.supportsCurves()}},70722:(e,t,n)=>{n.d(t,{d:()=>u,e:()=>a});var r=n(49074),o=n(78125);function a(e,t){const n=(0,o.getSpatialReference)(e);return(0,o.toGeometry)((0,r.g7)((0,o.fromGeometry)(e),(0,o.fromGeometry)(t),(0,o.fromSpatialReference)(n)),n)}const s=(0,r.fz)(),u=Object.freeze(Object.defineProperty({__proto__:null,execute:a,executeMany:function(e,t){const n=e.map(o.fromGeometry),a=(0,o.getSpatialReference)(e);return(0,r.zo)(n,(0,o.fromGeometry)(t),(0,o.fromSpatialReference)(a)).map(e=>(0,o.toGeometry)(e,a))},supportsCurves:s},Symbol.toStringTag,{value:"Module"}))},76061:(e,t,n)=>{n.d(t,{G:()=>r,S:()=>o});class r{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}class o extends r{constructor(e){super(),this.m_iGeom=-1,this.m_aGeoms=e?e.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const e=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,e}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}},78125:(e,t,n)=>{n.r(t),n.d(t,{fromExtent:()=>C,fromGeometry:()=>G,fromMultipoint:()=>M,fromPoint:()=>w,fromPolygon:()=>V,fromPolyline:()=>v,fromSpatialReference:()=>d,getSpatialReference:()=>x,toExtent:()=>R,toGeometry:()=>P,toMultipoint:()=>Z,toPoint:()=>S,toPolygon:()=>_,toPolyline:()=>z});var r=n(83661),o=(n(79187),n(55537)),a=n(95213),s=n(88885),u=n(39117),i=n(5443),c=n(48526),l=n(86738),m=n(39829),f=n(82799),h=(n(90293),n(83299));const p="_gxVersion",y=2,g=1;function x(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function G(e){switch(e.type){case"point":return w(e);case"multipoint":return M(e);case"polyline":return v(e);case"polygon":return V(e);case"extent":return C(e);default:throw new Error(`Unsupported geometry type: ${e.type}`)}}function C(e){if(!e.getCacheValue(p)){const t=new a.E;t.setCoords(e.xmin,e.ymin,e.xmax,e.ymax),e.hasM&&t.setInterval(y,0,e.mmin,e.mmax),e.hasZ&&t.setInterval(g,0,e.zmin,e.zmax),e.setCacheValue(p,t)}return e.getCacheValue(p)}function M(e){if(!e.getCacheValue(p)){const t=new s.M,n=new a.P,r=e.points,o=e.hasM,u=e.hasZ,i=u?3:2;for(let e=0,a=r.length;e<a;e++){const a=r[e];n.setXYCoords(a[0],a[1]),u&&n.setZ(a[2]??0),o&&n.setM(a[i]??NaN),t.add(n)}e.setCacheValue(p,t)}return e.getCacheValue(p)}function w(e){if(!e.getCacheValue(p)){const t=new a.P;t.setXYCoords(e.x,e.y),e.hasM&&t.setM(e.m),e.hasZ&&t.setZ(e.z),e.setCacheValue(p,t)}return e.getCacheValue(p)}function V(e){if(!e.getCacheValue(p)){const{curveRings:t,hasM:n,hasZ:r,rings:o}=e,a=(0,h.fromGeometryToGXGeometry)({curveRings:t,hasM:n,hasZ:r,rings:o});e.setCacheValue(p,a)}return e.getCacheValue(p)}function v(e){if(!e.getCacheValue(p)){const{curvePaths:t,hasM:n,hasZ:r,paths:o}=e,a=(0,h.fromGeometryToGXGeometry)({curvePaths:t,hasM:n,hasZ:r,paths:o});e.setCacheValue(p,a)}return e.getCacheValue(p)}function d(e){if(e.wkid)return(0,u.c)(e.wkid);const t=e.wkt2||e.wkt;return t?(0,u.b)(t):null}function P(e,t){if(e)switch(e.getGeometryType()){case o.G.enumPoint:return S(e,t);case o.G.enumEnvelope:return R(e,t);case o.G.enumMultiPoint:return Z(e,t);case o.G.enumPolyline:return z(e,t);case o.G.enumPolygon:return _(e,t)}return null}function R(e,t){if(e.isEmpty())return null;const n=new i.A({xmin:e.getXMin(),ymin:e.getYMin(),xmax:e.getXMax(),ymax:e.getYMax(),spatialReference:t}),r=e.getDescription();if(r.hasM()){const t=e.queryInterval(y,0);n.mmin=t.vmin,n.mmax=t.vmax}if(r.hasZ()){const t=e.queryInterval(g,0);n.zmin=t.vmin,n.zmax=t.vmax}return n.setCacheValue(p,e),n}function Z(e,t){if(e.isEmpty())return null;const n=e.getDescription(),r=n.hasM(),o=n.hasZ(),s=[],u=new a.P;for(let t=0,n=e.getPointCount();t<n;t++){e.getPointByVal(t,u);const n=[u.getX(),u.getY()];o&&n.push(u.getZ()),r&&n.push(u.getM()),s.push(n)}const i=new c.A({hasM:r,hasZ:o,points:s,spatialReference:t});return i.setCacheValue(p,e),i}function S(e,t){if(e instanceof r.P)return new l.A({x:e.x,y:e.y,spatialReference:t});if(e.isEmpty())return null;const n=new l.A({x:e.getX(),y:e.getY(),spatialReference:t}),o=e.getDescription();return o.hasM()&&(n.m=e.getM()),o.hasZ()&&(n.z=e.getZ()),n.setCacheValue(p,e),n}function _(e,t){if(e.isEmpty())return null;const n=m.A.fromJSON({spatialReference:t,...(0,h.toGeometry)(e,null)});return n.setCacheValue(p,e),n}function z(e,t){if(e.isEmpty())return null;const n=f.A.fromJSON({spatialReference:t,...(0,h.toGeometry)(e,null)});return n.setCacheValue(p,e),n}},93054:(e,t,n)=>{n.d(t,{execute:()=>r.e}),n(49074),n(78125);var r=n(70722)}}]);
|