@arcgis/core 4.33.0-next.20250402 → 4.33.0-next.20250403

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/0cec53e6f1464c69448d.js +1 -0
  3. package/assets/esri/core/workers/chunks/{322cb1b1871d03b69f0a.js → 5beb525b4adde1d98532.js} +33 -33
  4. package/assets/esri/core/workers/chunks/6b0a6469673417563616.js +1 -0
  5. package/assets/esri/core/workers/chunks/c977a47cabc419610277.js +1 -0
  6. package/assets/esri/core/workers/chunks/{7e00122014d0a55363a8.js → ccb289911e7445b17763.js} +1 -1
  7. package/core/typedArrayUtil.js +1 -1
  8. package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
  9. package/geometry/Polygon.js +1 -1
  10. package/geometry/support/buffer/BufferView.js +1 -1
  11. package/geometry/support/buffer/internals/Vec2.js +1 -1
  12. package/interfaces.d.ts +23 -21
  13. package/package.json +1 -1
  14. package/support/revision.js +1 -1
  15. package/undoredo/support/Services.js +1 -1
  16. package/views/2d/engine/vectorTiles/decluttering/CollisionJob.js +1 -1
  17. package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
  18. package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
  19. package/views/2d/layers/StreamLayerView2D.js +1 -1
  20. package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
  21. package/views/3d/environment/NoiseTextureAtlasTechnique.js +1 -1
  22. package/views/3d/environment/PrecipitationTechnique.js +1 -1
  23. package/views/3d/environment/SimpleAtmosphereTechnique.js +1 -1
  24. package/views/3d/layers/DrapedSubView3D.js +1 -1
  25. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  26. package/views/3d/terrain/PatchGeometry.js +1 -1
  27. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  28. package/views/3d/terrain/TerrainAttributes.js +1 -1
  29. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +3 -3
  30. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  31. package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
  32. package/views/3d/webgl-engine/effects/haze/HazeTechnique.js +1 -1
  33. package/views/3d/webgl-engine/effects/highlight/HighlightApplyTechnique.js +1 -1
  34. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
  35. package/views/3d/webgl-engine/effects/magnifier/MagnifierTechnique.js +1 -1
  36. package/views/3d/webgl-engine/effects/stars/StarsTechnique.js +1 -1
  37. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
  38. package/views/3d/webgl-engine/lib/ChangeSet.js +1 -1
  39. package/views/3d/webgl-engine/lib/GLMaterials.js +1 -1
  40. package/views/3d/webgl-engine/lib/ITexture.js +1 -1
  41. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  42. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  43. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  44. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  45. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  46. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  47. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  48. package/views/3d/webgl-engine/lib/TextureTechnique.js +1 -1
  49. package/views/3d/webgl-engine/lib/TextureUpdater.js +5 -0
  50. package/views/3d/webgl-engine/lib/rendererUtils.js +1 -1
  51. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  52. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  53. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  54. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  55. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  56. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  57. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  58. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  59. package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
  60. package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
  61. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  62. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  63. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  64. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  65. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
  66. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
  67. package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
  68. package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
  69. package/views/3d/webgl-engine/shaders/ViewshedTechnique.js +1 -1
  70. package/views/webgl/renderState.js +1 -1
  71. package/views/webgl/testFloatBufferBlend.js +1 -1
  72. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  73. package/widgets/Editor/UpdateWorkflow.js +1 -1
  74. package/widgets/Editor/workflowUtils.js +1 -1
  75. package/widgets/Editor.js +1 -1
  76. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  77. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  78. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  79. package/widgets/FeatureForm.js +1 -1
  80. package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
  81. package/widgets/support/GridControls.js +1 -1
  82. package/assets/esri/core/workers/chunks/a56da688088404259481.js +0 -1
  83. package/assets/esri/core/workers/chunks/e6469173c65531d6524a.js +0 -1
  84. package/assets/esri/core/workers/chunks/e9e517a2141e504eec64.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/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../chunks/tslib.es6.js";import{equals as e}from"../core/arrayUtils.js";import{clone as r}from"../core/lang.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import{writer as n}from"../core/accessorSupport/decorators/writer.js";import o from"./Extent.js";import a from"./Geometry.js";import l from"./Point.js";import h from"./SpatialReference.js";import{polygonCentroid as p}from"./support/centroid.js";import{polygonContainsPoint as c}from"./support/contains.js";import{isClockwise as u}from"./support/coordsUtils.js";import{getPolygonExtent as m}from"./support/extentUtils.js";import{isSelfIntersecting as f}from"./support/intersectsBase.js";import{project as g}from"./support/webMercatorUtils.js";import{updateSupportFromPoint as y}from"./support/zmUtils.js";var R;function d(t){return!Array.isArray(t[0])}function w(t){return"number"==typeof t[0]?.[0]}function v(t){if(!t)return;let{rings:e,hasM:r,hasZ:s,spatialReference:i}=t;switch(e??=[],w(e)&&(e=[e]),e[0]?.[0]?.length){case 4:s??=!0,r??=!0;break;case 3:s??=!0!==r,r??=!s;break;default:s??=!1,r??=!1}return i??=h.WGS84,{...t,hasM:r,hasZ:s,rings:e,spatialReference:i}}let x=R=class extends a{static fromExtent(t){const e=t.clone().normalize(),{spatialReference:r}=t;let s=!1,i=!1;for(const o of e)o.hasZ&&(s=!0),o.hasM&&(i=!0);const n={rings:e.map((t=>{const e=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]];if(s&&t.hasZ){const r=t.zmin+.5*(t.zmax-t.zmin);for(let t=0;t<e.length;t++)e[t].push(r)}if(i&&t.hasM){const r=t.mmin+.5*(t.mmax-t.mmin);for(let t=0;t<e.length;t++)e[t].push(r)}return e})),spatialReference:r};return s&&(n.hasZ=!0),i&&(n.hasM=!0),new R(n)}constructor(t){super(v(t)),this.curveRings=void 0,this.rings=[],this.type="polygon"}get cache(){return this.commitProperty("curveRings"),this.commitProperty("hasM"),this.commitProperty("hasZ"),this.commitProperty("rings"),this.commitProperty("spatialReference"),{}}get centroid(){const t=p(this);if(!t||isNaN(t[0])||isNaN(t[1])||this.hasZ&&isNaN(t[2]))return null;const e=new l;return e.x=t[0],e.y=t[1],e.spatialReference=this.spatialReference,this.hasZ&&(e.z=t[2]),e}writeCurveRings(t,e){e.curveRings=r(t)}get extent(){const t=m(this),{spatialReference:e}=this;return t?new o({...t,spatialReference:e}):null}get isSelfIntersecting(){return f(this.rings)}writeRings(t,e){e.rings=r(this.rings)}addRing(t){if(!t)return;const e=this.rings,r=e.length;if(d(t)){const s=[];for(let e=0,r=t.length;e<r;e++)s[e]=t[e].toArray();e[r]=s}else e[r]=t.slice();return this.notifyChange("rings"),this}clone(){const t=new R;return t.spatialReference=this.spatialReference,t.rings=r(this.rings),t.curveRings=r(this.curveRings),t.hasZ=this.hasZ,t.hasM=this.hasM,t}equals(t){if(this===t)return!0;if(null==t)return!1;const r=this.spatialReference,s=t.spatialReference;if(null!=r!=(null!=s))return!1;if(null!=r&&null!=s&&!r.equals(s))return!1;if(this.rings.length!==t.rings.length)return!1;const i=([t,e,r,s],[i,n,o,a])=>t===i&&e===n&&(null==r&&null==o||r===o)&&(null==s&&null==a||s===a);for(let n=0;n<this.rings.length;n++){const r=this.rings[n],s=t.rings[n];if(!e(r,s,i))return!1}return!0}contains(t){if(!t)return!1;const e=g(t,this.spatialReference);return c(this,null!=e?e:t)}isClockwise(t){const e=d(t)?t.map((t=>this.hasZ?this.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])):t;return u(e)}getPoint(t,e){if(!this._validateInputs(t,e))return null;const r=this.rings[t][e],s=this.hasZ,i=this.hasM;return s&&!i?new l(r[0],r[1],r[2],void 0,this.spatialReference):i&&!s?new l(r[0],r[1],void 0,r[2],this.spatialReference):s&&i?new l(r[0],r[1],r[2],r[3],this.spatialReference):new l(r[0],r[1],this.spatialReference)}insertPoint(t,e,r){return this._validateInputs(t,e,!0)?(y(this,r),Array.isArray(r)||(r=r.toArray()),this.rings[t].splice(e,0,r),this.notifyChange("rings"),this):this}removePoint(t,e){if(!this._validateInputs(t,e))return null;const r=new l(this.rings[t].splice(e,1)[0],this.spatialReference);return this.notifyChange("rings"),r}removeRing(t){if(!this._validateInputs(t,null))return null;const e=this.rings.splice(t,1)[0],r=this.spatialReference,s=e.map((t=>new l(t,r)));return this.notifyChange("rings"),s}setPoint(t,e,r){return this._validateInputs(t,e)?(y(this,r),Array.isArray(r)||(r=r.toArray()),this.rings[t][e]=r,this.notifyChange("rings"),this):this}_validateInputs(t,e,r=!1){if(null==t||t<0||t>=this.rings.length)return!1;if(null!=e){const s=this.rings[t];if(r&&(e<0||e>s.length))return!1;if(!r&&(e<0||e>=s.length))return!1}return!0}toJSON(t){return this.write({},t)}};t([s({readOnly:!0})],x.prototype,"cache",null),t([s({readOnly:!0})],x.prototype,"centroid",null),t([s({json:{write:!0,origins:{"portal-item":{write:!1},"web-map":{write:!1},"web-scene":{write:!1}}}})],x.prototype,"curveRings",void 0),t([n("curveRings")],x.prototype,"writeCurveRings",null),t([s({readOnly:!0})],x.prototype,"extent",null),t([s({readOnly:!0})],x.prototype,"isSelfIntersecting",null),t([s({type:[[[Number]]],json:{write:{isRequired:!0}}})],x.prototype,"rings",void 0),t([n("rings")],x.prototype,"writeRings",null),x=R=t([i("esri.geometry.Polygon")],x);const j=x;x.prototype.toJSON.isDefaultToJSON=!0;export{j as default};
5
+ import{_ as t}from"../chunks/tslib.es6.js";import{equals as e}from"../core/arrayUtils.js";import{deprecatedProperty as r}from"../core/deprecate.js";import{clone as s}from"../core/lang.js";import i from"../core/Logger.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../core/accessorSupport/decorators/writer.js";import l from"./Extent.js";import p from"./Geometry.js";import c from"./Point.js";import h from"./SpatialReference.js";import{polygonCentroid as u}from"./support/centroid.js";import{polygonContainsPoint as m}from"./support/contains.js";import{isClockwise as f}from"./support/coordsUtils.js";import{getPolygonExtent as g}from"./support/extentUtils.js";import{isSelfIntersecting as y}from"./support/intersectsBase.js";import{project as R}from"./support/webMercatorUtils.js";import{updateSupportFromPoint as d}from"./support/zmUtils.js";var w;function v(t){return!Array.isArray(t[0])}function j(t){return"number"==typeof t[0]?.[0]}function x(t){if(!t)return;let{rings:e,hasM:r,hasZ:s,spatialReference:i}=t;switch(e??=[],j(e)&&(e=[e]),e[0]?.[0]?.length){case 4:s??=!0,r??=!0;break;case 3:s??=!0!==r,r??=!s;break;default:s??=!1,r??=!1}return i??=h.WGS84,{...t,hasM:r,hasZ:s,rings:e,spatialReference:i}}let P=w=class extends p{static fromExtent(t){const e=t.clone().normalize(),{spatialReference:r}=t;let s=!1,i=!1;for(const o of e)o.hasZ&&(s=!0),o.hasM&&(i=!0);const n={rings:e.map((t=>{const e=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]];if(s&&t.hasZ){const r=t.zmin+.5*(t.zmax-t.zmin);for(let t=0;t<e.length;t++)e[t].push(r)}if(i&&t.hasM){const r=t.mmin+.5*(t.mmax-t.mmin);for(let t=0;t<e.length;t++)e[t].push(r)}return e})),spatialReference:r};return s&&(n.hasZ=!0),i&&(n.hasM=!0),new w(n)}constructor(t){super(x(t)),this.curveRings=void 0,this.rings=[],this.type="polygon"}get cache(){return this.commitProperty("curveRings"),this.commitProperty("hasM"),this.commitProperty("hasZ"),this.commitProperty("rings"),this.commitProperty("spatialReference"),{}}get centroid(){const t=u(this);if(!t||isNaN(t[0])||isNaN(t[1])||this.hasZ&&isNaN(t[2]))return null;const e=new c;return e.x=t[0],e.y=t[1],e.spatialReference=this.spatialReference,this.hasZ&&(e.z=t[2]),e}writeCurveRings(t,e){e.curveRings=s(t)}get extent(){const t=g(this),{spatialReference:e}=this;return t?new l({...t,spatialReference:e}):null}get isSelfIntersecting(){return r(i.getLogger(this),"isSelfIntersecting",{replacement:"Please use simplifyOperator.isSimple() instead.",version:"4.33",warnOnce:!0}),y(this.rings)}writeRings(t,e){e.rings=s(this.rings)}addRing(t){if(!t)return;const e=this.rings,r=e.length;if(v(t)){const s=[];for(let e=0,r=t.length;e<r;e++)s[e]=t[e].toArray();e[r]=s}else e[r]=t.slice();return this.notifyChange("rings"),this}clone(){const t=new w;return t.spatialReference=this.spatialReference,t.rings=s(this.rings),t.curveRings=s(this.curveRings),t.hasZ=this.hasZ,t.hasM=this.hasM,t}equals(t){if(this===t)return!0;if(null==t)return!1;const r=this.spatialReference,s=t.spatialReference;if(null!=r!=(null!=s))return!1;if(null!=r&&null!=s&&!r.equals(s))return!1;if(this.rings.length!==t.rings.length)return!1;const i=([t,e,r,s],[i,n,o,a])=>t===i&&e===n&&(null==r&&null==o||r===o)&&(null==s&&null==a||s===a);for(let n=0;n<this.rings.length;n++){const r=this.rings[n],s=t.rings[n];if(!e(r,s,i))return!1}return!0}contains(t){if(!t)return!1;const e=R(t,this.spatialReference);return m(this,null!=e?e:t)}isClockwise(t){const e=v(t)?t.map((t=>this.hasZ?this.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])):t;return f(e)}getPoint(t,e){if(!this._validateInputs(t,e))return null;const r=this.rings[t][e],s=this.hasZ,i=this.hasM;return s&&!i?new c(r[0],r[1],r[2],void 0,this.spatialReference):i&&!s?new c(r[0],r[1],void 0,r[2],this.spatialReference):s&&i?new c(r[0],r[1],r[2],r[3],this.spatialReference):new c(r[0],r[1],this.spatialReference)}insertPoint(t,e,r){return this._validateInputs(t,e,!0)?(d(this,r),Array.isArray(r)||(r=r.toArray()),this.rings[t].splice(e,0,r),this.notifyChange("rings"),this):this}removePoint(t,e){if(!this._validateInputs(t,e))return null;const r=new c(this.rings[t].splice(e,1)[0],this.spatialReference);return this.notifyChange("rings"),r}removeRing(t){if(!this._validateInputs(t,null))return null;const e=this.rings.splice(t,1)[0],r=this.spatialReference,s=e.map((t=>new c(t,r)));return this.notifyChange("rings"),s}setPoint(t,e,r){return this._validateInputs(t,e)?(d(this,r),Array.isArray(r)||(r=r.toArray()),this.rings[t][e]=r,this.notifyChange("rings"),this):this}_validateInputs(t,e,r=!1){if(null==t||t<0||t>=this.rings.length)return!1;if(null!=e){const s=this.rings[t];if(r&&(e<0||e>s.length))return!1;if(!r&&(e<0||e>=s.length))return!1}return!0}toJSON(t){return this.write({},t)}};t([n({readOnly:!0})],P.prototype,"cache",null),t([n({readOnly:!0})],P.prototype,"centroid",null),t([n({json:{write:!0,origins:{"portal-item":{write:!1},"web-map":{write:!1},"web-scene":{write:!1}}}})],P.prototype,"curveRings",void 0),t([a("curveRings")],P.prototype,"writeCurveRings",null),t([n({readOnly:!0})],P.prototype,"extent",null),t([n({readOnly:!0})],P.prototype,"isSelfIntersecting",null),t([n({type:[[[Number]]],json:{write:{isRequired:!0}}})],P.prototype,"rings",void 0),t([a("rings")],P.prototype,"writeRings",null),P=w=t([o("esri.geometry.Polygon")],P);const S=P;P.prototype.toJSON.isDefaultToJSON=!0;export{S 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/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{Float16Array as e}from"@petamoriken/float16";import{BufferViewMat3Impl as t}from"./internals/Mat3.js";import{BufferViewMat4Impl as r}from"./internals/Mat4.js";import{BufferViewScalarImpl as s}from"./internals/Scalar.js";import{BufferViewVec2Impl as f}from"./internals/Vec2.js";import{BufferViewVec3Impl as n}from"./internals/Vec3.js";import{BufferViewVec4Impl as i}from"./internals/Vec4.js";class y extends s{constructor(t,r=0,s,f){super(e,t,r,s,f),this.elementType="f16"}static fromTypedArray(e,t){return new y(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f16"}}class c extends s{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}static fromTypedArray(e,t){return new c(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f32"}}class u extends f{constructor(t,r=0,s,f){super(e,t,r,s,f),this.elementType="f16"}slice(e,t){return this.sliceBuffer(u,e,t)}static fromTypedArray(e,t){return new u(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f16"}}class a extends f{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(a,e,t)}static fromTypedArray(e,t){return new a(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f32"}}class l extends n{constructor(t,r=0,s,f){super(e,t,r,s,f),this.elementType="f16"}slice(e,t){return this.sliceBuffer(l,e,t)}static fromTypedArray(e,t){return new l(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f16"}}class p extends n{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(p,e,t)}static fromTypedArray(e,t){return new p(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f32"}}class b extends i{constructor(t,r=0,s,f){super(e,t,r,s,f),this.elementType="f16"}slice(e,t){return this.sliceBuffer(b,e,t)}static fromTypedArray(e,t){return new b(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f16"}}class h extends i{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(h,e,t)}static fromTypedArray(e,t){return new h(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f32"}}class o extends t{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(o,e,t)}static fromTypedArray(e,t){return new o(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f32"}}class m extends t{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(m,e,t)}static fromTypedArray(e,t){return new m(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f64"}}class T extends r{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(T,e,t)}static fromTypedArray(e,t){return new T(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f32"}}class d extends r{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(d,e,t)}static fromTypedArray(e,t){return new d(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f64"}}class O extends s{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(O,e,t)}static fromTypedArray(e,t){return new O(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f64"}}class A extends f{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(A,e,t)}static fromTypedArray(e,t){return new A(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f64"}}class x extends n{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(x,e,t)}static fromTypedArray(e,t){return new x(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f64"}}class g extends i{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(g,e,t)}static fromTypedArray(e,t){return new g(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f64"}}class w extends s{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(w,e,t)}static fromTypedArray(e,t){return new w(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="u8"}}class E extends f{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(E,e,t)}static fromTypedArray(e,t){return new E(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="u8"}}class L extends n{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(L,e,t)}static fromTypedArray(e,t){return new L(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="u8"}}class B extends i{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(B,e,t)}static fromTypedArray(e,t){return new B(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="u8"}}class F extends s{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(F,e,t)}static fromTypedArray(e,t){return new F(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="u16"}}class I extends f{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(I,e,t)}static fromTypedArray(e,t){return new I(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="u16"}}class U extends n{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(U,e,t)}static fromTypedArray(e,t){return new U(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="u16"}}class j extends i{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(j,e,t)}static fromTypedArray(e,t){return new j(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="u16"}}class V extends s{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(V,e,t)}static fromTypedArray(e,t){return new V(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="u32"}}class M extends f{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(M,e,t)}static fromTypedArray(e,t){return new M(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="u32"}}class k extends n{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(k,e,t)}static fromTypedArray(e,t){return new k(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="u32"}}class S extends i{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(S,e,t)}static fromTypedArray(e,t){return new S(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="u32"}}class q extends s{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(q,e,t)}static fromTypedArray(e,t){return new q(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="i8"}}class v extends f{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(v,e,t)}static fromTypedArray(e,t){return new v(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="i8"}}class z extends n{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(z,e,t)}static fromTypedArray(e,t){return new z(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="i8"}}class C extends i{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(C,e,t)}static fromTypedArray(e,t){return new C(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="i8"}}class D extends s{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(D,e,t)}static fromTypedArray(e,t){return new D(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="i16"}}class G extends f{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(G,e,t)}static fromTypedArray(e,t){return new G(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="i16"}}class H extends n{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(H,e,t)}static fromTypedArray(e,t){return new H(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="i16"}}class J extends i{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(J,e,t)}static fromTypedArray(e,t){return new J(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="i16"}}class K extends s{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(K,e,t)}static fromTypedArray(e,t){return new K(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="i32"}}class N extends f{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(N,e,t)}static fromTypedArray(e,t){return new N(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="i32"}}class P extends n{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(P,e,t)}static fromTypedArray(e,t){return new P(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="i32"}}class Q extends i{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(Q,e,t)}static fromTypedArray(e,t){return new Q(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="i32"}}export{c as BufferViewFloat,y as BufferViewFloat16,O as BufferViewFloat64,D as BufferViewInt16,K as BufferViewInt32,q as BufferViewInt8,o as BufferViewMat3f,m as BufferViewMat3f64,T as BufferViewMat4f,d as BufferViewMat4f64,F as BufferViewUint16,V as BufferViewUint32,w as BufferViewUint8,a as BufferViewVec2f,u as BufferViewVec2f16,A as BufferViewVec2f64,G as BufferViewVec2i16,N as BufferViewVec2i32,v as BufferViewVec2i8,I as BufferViewVec2u16,M as BufferViewVec2u32,E as BufferViewVec2u8,p as BufferViewVec3f,l as BufferViewVec3f16,x as BufferViewVec3f64,H as BufferViewVec3i16,P as BufferViewVec3i32,z as BufferViewVec3i8,U as BufferViewVec3u16,k as BufferViewVec3u32,L as BufferViewVec3u8,h as BufferViewVec4f,b as BufferViewVec4f16,g as BufferViewVec4f64,J as BufferViewVec4i16,Q as BufferViewVec4i32,C as BufferViewVec4i8,j as BufferViewVec4u16,S as BufferViewVec4u32,B as BufferViewVec4u8};
5
+ import{Float16Array as e}from"@petamoriken/float16";import{BufferViewMat3Impl as t}from"./internals/Mat3.js";import{BufferViewMat4Impl as s}from"./internals/Mat4.js";import{BufferViewScalarImpl as r}from"./internals/Scalar.js";import{BufferViewVec2Impl as i}from"./internals/Vec2.js";import{BufferViewVec3Impl as n}from"./internals/Vec3.js";import{BufferViewVec4Impl as c}from"./internals/Vec4.js";class l extends r{constructor(t,s=0,r,i){super(e,t,s,r,i),this.elementType="f16"}static{this.ElementType="f16"}}class u extends r{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}static{this.ElementType="f32"}}class a extends i{constructor(t,s=0,r,i){super(e,t,s,r,i),this.elementType="f16"}slice(e,t){return this.sliceBuffer(a,e,t)}static{this.ElementType="f16"}}class f extends i{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(f,e,t)}static{this.ElementType="f32"}}class p extends n{constructor(t,s=0,r,i){super(e,t,s,r,i),this.elementType="f16"}slice(e,t){return this.sliceBuffer(p,e,t)}static{this.ElementType="f16"}}class y extends n{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(y,e,t)}static fromTypedArray(e,t){return new y(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f32"}}class h extends c{constructor(t,s=0,r,i){super(e,t,s,r,i),this.elementType="f16"}slice(e,t){return this.sliceBuffer(h,e,t)}static{this.ElementType="f16"}}class o extends c{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(o,e,t)}static{this.ElementType="f32"}}class m extends t{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(m,e,t)}static{this.ElementType="f32"}}class T extends t{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(T,e,t)}static{this.ElementType="f64"}}class d extends s{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(d,e,t)}static{this.ElementType="f32"}}class x extends s{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(x,e,t)}static{this.ElementType="f64"}}class E extends r{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(E,e,t)}static{this.ElementType="f64"}}class A extends i{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(A,e,t)}static{this.ElementType="f64"}}class B extends n{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(B,e,t)}static fromTypedArray(e,t){return new B(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f64"}}class b extends c{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(b,e,t)}static{this.ElementType="f64"}}class F extends r{constructor(e,t=0,s,r){super(Uint8Array,e,t,s,r),this.elementType="u8"}slice(e,t){return this.sliceBuffer(F,e,t)}static{this.ElementType="u8"}}class I extends i{constructor(e,t=0,s,r){super(Uint8Array,e,t,s,r),this.elementType="u8"}slice(e,t){return this.sliceBuffer(I,e,t)}static{this.ElementType="u8"}}class U extends n{constructor(e,t=0,s,r){super(Uint8Array,e,t,s,r),this.elementType="u8"}slice(e,t){return this.sliceBuffer(U,e,t)}static fromTypedArray(e,t){return new U(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="u8"}}class j extends c{constructor(e,t=0,s,r){super(Uint8Array,e,t,s,r),this.elementType="u8"}slice(e,t){return this.sliceBuffer(j,e,t)}static{this.ElementType="u8"}}class O extends r{constructor(e,t=0,s,r){super(Uint16Array,e,t,s,r),this.elementType="u16"}slice(e,t){return this.sliceBuffer(O,e,t)}static{this.ElementType="u16"}}class g extends i{constructor(e,t=0,s,r){super(Uint16Array,e,t,s,r),this.elementType="u16"}slice(e,t){return this.sliceBuffer(g,e,t)}static{this.ElementType="u16"}}class w extends n{constructor(e,t=0,s,r){super(Uint16Array,e,t,s,r),this.elementType="u16"}slice(e,t){return this.sliceBuffer(w,e,t)}static{this.ElementType="u16"}}class L extends c{constructor(e,t=0,s,r){super(Uint16Array,e,t,s,r),this.elementType="u16"}slice(e,t){return this.sliceBuffer(L,e,t)}static{this.ElementType="u16"}}class V extends r{constructor(e,t=0,s,r){super(Uint32Array,e,t,s,r),this.elementType="u32"}slice(e,t){return this.sliceBuffer(V,e,t)}static{this.ElementType="u32"}}class M extends i{constructor(e,t=0,s,r){super(Uint32Array,e,t,s,r),this.elementType="u32"}slice(e,t){return this.sliceBuffer(M,e,t)}static{this.ElementType="u32"}}class k extends n{constructor(e,t=0,s,r){super(Uint32Array,e,t,s,r),this.elementType="u32"}slice(e,t){return this.sliceBuffer(k,e,t)}static{this.ElementType="u32"}}class S extends c{constructor(e,t=0,s,r){super(Uint32Array,e,t,s,r),this.elementType="u32"}slice(e,t){return this.sliceBuffer(S,e,t)}static{this.ElementType="u32"}}class q extends r{constructor(e,t=0,s,r){super(Int8Array,e,t,s,r),this.elementType="i8"}slice(e,t){return this.sliceBuffer(q,e,t)}static{this.ElementType="i8"}}class v extends i{constructor(e,t=0,s,r){super(Int8Array,e,t,s,r),this.elementType="i8"}slice(e,t){return this.sliceBuffer(v,e,t)}static{this.ElementType="i8"}}class z extends n{constructor(e,t=0,s,r){super(Int8Array,e,t,s,r),this.elementType="i8"}slice(e,t){return this.sliceBuffer(z,e,t)}static{this.ElementType="i8"}}class C extends c{constructor(e,t=0,s,r){super(Int8Array,e,t,s,r),this.elementType="i8"}slice(e,t){return this.sliceBuffer(C,e,t)}static{this.ElementType="i8"}}class D extends r{constructor(e,t=0,s,r){super(Int16Array,e,t,s,r),this.elementType="i16"}slice(e,t){return this.sliceBuffer(D,e,t)}static{this.ElementType="i16"}}class G extends i{constructor(e,t=0,s,r){super(Int16Array,e,t,s,r),this.elementType="i16"}slice(e,t){return this.sliceBuffer(G,e,t)}static{this.ElementType="i16"}}class H extends n{constructor(e,t=0,s,r){super(Int16Array,e,t,s,r),this.elementType="i16"}slice(e,t){return this.sliceBuffer(H,e,t)}static{this.ElementType="i16"}}class J extends c{constructor(e,t=0,s,r){super(Int16Array,e,t,s,r),this.elementType="i16"}slice(e,t){return this.sliceBuffer(J,e,t)}static{this.ElementType="i16"}}class K extends r{constructor(e,t=0,s,r){super(Int32Array,e,t,s,r),this.elementType="i32"}slice(e,t){return this.sliceBuffer(K,e,t)}static{this.ElementType="i32"}}class N extends i{constructor(e,t=0,s,r){super(Int32Array,e,t,s,r),this.elementType="i32"}slice(e,t){return this.sliceBuffer(N,e,t)}static{this.ElementType="i32"}}class P extends n{constructor(e,t=0,s,r){super(Int32Array,e,t,s,r),this.elementType="i32"}slice(e,t){return this.sliceBuffer(P,e,t)}static{this.ElementType="i32"}}class Q extends c{constructor(e,t=0,s,r){super(Int32Array,e,t,s,r),this.elementType="i32"}slice(e,t){return this.sliceBuffer(Q,e,t)}static{this.ElementType="i32"}}export{u as BufferViewFloat,l as BufferViewFloat16,E as BufferViewFloat64,D as BufferViewInt16,K as BufferViewInt32,q as BufferViewInt8,m as BufferViewMat3f,T as BufferViewMat3f64,d as BufferViewMat4f,x as BufferViewMat4f64,O as BufferViewUint16,V as BufferViewUint32,F as BufferViewUint8,f as BufferViewVec2f,a as BufferViewVec2f16,A as BufferViewVec2f64,G as BufferViewVec2i16,N as BufferViewVec2i32,v as BufferViewVec2i8,g as BufferViewVec2u16,M as BufferViewVec2u32,I as BufferViewVec2u8,y as BufferViewVec3f,p as BufferViewVec3f16,B as BufferViewVec3f64,H as BufferViewVec3i16,P as BufferViewVec3i32,z as BufferViewVec3i8,w as BufferViewVec3u16,k as BufferViewVec3u32,U as BufferViewVec3u8,o as BufferViewVec4f,h as BufferViewVec4f16,b as BufferViewVec4f64,J as BufferViewVec4i16,Q as BufferViewVec4i32,C as BufferViewVec4i8,L as BufferViewVec4u16,S as BufferViewVec4u32,j as BufferViewVec4u8};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{set as t}from"../../../../core/libs/gl-matrix-2/math/vec2.js";class e{static{this.ElementCount=2}constructor(t,e,r=0,f,s){this.TypedArrayConstructor=t,this.elementCount=2;const i=this.TypedArrayConstructor;void 0===f&&(f=2*i.BYTES_PER_ELEMENT);const d=0===e.byteLength?0:r;this.typedBuffer=null==s?new i(e,d):new i(e,d,(s-r)/i.BYTES_PER_ELEMENT),this.typedBufferStride=f/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(t,e,r=this.count-e){const f=this.typedBuffer.byteOffset+e*this.stride;return new t(this.buffer,f,this.stride,f+r*this.stride)}getVec(e,r){return e*=this.typedBufferStride,t(r,this.typedBuffer[e],this.typedBuffer[e+1])}setVec(t,e){t*=this.typedBufferStride,this.typedBuffer[t++]=e[0],this.typedBuffer[t]=e[1]}get(t,e){return this.typedBuffer[t*this.typedBufferStride+e]}set(t,e,r){this.typedBuffer[t*this.typedBufferStride+e]=r}setValues(t,e,r){t*=this.typedBufferStride,this.typedBuffer[t++]=e,this.typedBuffer[t]=r}copyFrom(t,e,r){const f=this.typedBuffer,s=e.typedBuffer;let i=t*this.typedBufferStride,d=r*e.typedBufferStride;f[i++]=s[d++],f[i]=s[d]}get buffer(){return this.typedBuffer.buffer}}export{e as BufferViewVec2Impl};
5
+ import{set as t}from"../../../../core/libs/gl-matrix-2/math/vec2.js";class e{static{this.ElementCount=2}constructor(t,e,r=0,f,s){this.TypedArrayConstructor=t,this.start=r,this.elementCount=2;const i=this.TypedArrayConstructor;void 0===f&&(f=2*i.BYTES_PER_ELEMENT);const d=0===e.byteLength?0:r;this.typedBuffer=null==s?new i(e,d):new i(e,d,(s-r)/i.BYTES_PER_ELEMENT),this.typedBufferStride=f/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(t,e,r=this.count-e){const f=this.typedBuffer.byteOffset+e*this.stride;return new t(this.buffer,f,this.stride,f+r*this.stride)}getVec(e,r){return e*=this.typedBufferStride,t(r,this.typedBuffer[e],this.typedBuffer[e+1])}setVec(t,e){t*=this.typedBufferStride,this.typedBuffer[t++]=e[0],this.typedBuffer[t]=e[1]}get(t,e){return this.typedBuffer[t*this.typedBufferStride+e]}set(t,e,r){this.typedBuffer[t*this.typedBufferStride+e]=r}setValues(t,e,r){t*=this.typedBufferStride,this.typedBuffer[t++]=e,this.typedBuffer[t]=r}copyFrom(t,e,r){const f=this.typedBuffer,s=e.typedBuffer;let i=t*this.typedBufferStride,d=r*e.typedBufferStride;f[i++]=s[d++],f[i]=s[d]}get buffer(){return this.typedBuffer.buffer}}export{e as BufferViewVec2Impl};
package/interfaces.d.ts CHANGED
@@ -8961,7 +8961,7 @@ declare namespace __esri {
8961
8961
  }
8962
8962
 
8963
8963
  /**
8964
- * Returns the planar area of a 2D geometry in its spatial reference units.
8964
+ * Returns the planar area of a 2D geometry.
8965
8965
  *
8966
8966
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-areaOperator.html Read more...}
8967
8967
  */
@@ -8972,7 +8972,7 @@ declare namespace __esri {
8972
8972
  *
8973
8973
  * @param geometry The geometry to calculate the area from.
8974
8974
  * @param options Additional options.
8975
- * @param options.unit The area unit of the return value.
8975
+ * @param options.unit The area unit of the return value. The default is the input geometry's spatial reference unit. An error will be thrown if this is set for Geographic Coordinate Systems.
8976
8976
  *
8977
8977
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-areaOperator.html#execute Read more...}
8978
8978
  */
@@ -9045,7 +9045,7 @@ declare namespace __esri {
9045
9045
  * @param geometry The input geometry to be buffered.
9046
9046
  * @param distance The buffer distance for the geometry. Unless the `unit` option is set, the default is the geometry's spatial reference unit.
9047
9047
  * @param options Additional options.
9048
- * @param options.unit The length unit of the buffer distance. An error will be thrown if this is set for Geographic Coordinate Systems.
9048
+ * @param options.unit The length unit of the buffer distance. The default is the input geometry's spatial reference unit. An error will be thrown if this is set for Geographic Coordinate Systems.
9049
9049
  *
9050
9050
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-bufferOperator.html#execute Read more...}
9051
9051
  */
@@ -9059,7 +9059,7 @@ declare namespace __esri {
9059
9059
  * @param options.maxDeviation The max deviation of the result buffer from the true buffer. When the value is NaN, internal logic is used to select deviation based on the buffer distance. Unless the `unit` option is set, the default is the geometries spatial reference unit.
9060
9060
  * @param options.maxVerticesInFullCircle The maximum number of vertices in the polygon produced from a buffered point.
9061
9061
  * @param options.union Indicates if the buffer geometries should be unioned. When set to `true`, the output will be a single geometry.
9062
- * @param options.unit The length unit of the buffer distances and max deviation. An error will be thrown if this is set for Geographic Coordinate Systems.
9062
+ * @param options.unit The length unit of the buffer distances and max deviation. The default is the input geometry's spatial reference unit. An error will be thrown if this is set for Geographic Coordinate Systems.
9063
9063
  *
9064
9064
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-bufferOperator.html#executeMany Read more...}
9065
9065
  */
@@ -9259,7 +9259,7 @@ declare namespace __esri {
9259
9259
  * @param options Additional options.
9260
9260
  * @param options.maxAngleInDegrees The maximum angle that a new vertex can deviate from the original geometry. The number must be greater than or equal to zero. Applicable only on curves. The default value of `0` disables densification by angle. The value will be capped at 90.
9261
9261
  * @param options.maxDeviation The maximum distance a newly placed vertex on a densified polyline can deviate from the original location on the curve. The number must be greater than or equal to zero. Applicable only on curves. The default of passing `0` disables densification by deviation. Unless the `unit` option is set, the default is the geometry's spatial reference unit.
9262
- * @param options.unit The length unit of `maxSegmentLength` and `maxDeviation`. An error will be thrown if this is set for Geographic Coordinate Systems.
9262
+ * @param options.unit The length unit of `maxSegmentLength` and `maxDeviation`. The default is the input geometry's spatial reference unit. An error will be thrown if this is set for Geographic Coordinate Systems.
9263
9263
  *
9264
9264
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-densifyOperator.html#execute Read more...}
9265
9265
  */
@@ -9272,7 +9272,7 @@ declare namespace __esri {
9272
9272
  * @param options Additional options.
9273
9273
  * @param options.maxAngleInDegrees The maximum angle allowed. The number must be greater than or equal to zero. Applicable only on curves. The default of passing `0` disables densification by angle. The value will be capped at pi/2.
9274
9274
  * @param options.maxDeviation The maximum deviation allowed. The number must be greater than or equal to zero. Applicable only on curves. The default of passing `0` disables densification by deviation.
9275
- * @param options.unit The length unit of `maxSegmentLength` and `maxDeviation`. An error will be thrown if this is set for Geographic Coordinate Systems.
9275
+ * @param options.unit The length unit of `maxSegmentLength` and `maxDeviation`. The default is the input geometry's spatial reference unit. An error will be thrown if this is set for Geographic Coordinate Systems.
9276
9276
  *
9277
9277
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-densifyOperator.html#executeMany Read more...}
9278
9278
  */
@@ -9363,7 +9363,7 @@ declare namespace __esri {
9363
9363
  * @param geometry1 The first input geometry.
9364
9364
  * @param geometry2 The second input geometry.
9365
9365
  * @param options Additional options.
9366
- * @param options.unit The length unit of the distance. An error will be thrown if this is set for Geographic Coordinate Systems.
9366
+ * @param options.unit The length unit of the distance. The default is the input geometry's spatial reference unit. An error will be thrown if this is set for Geographic Coordinate Systems.
9367
9367
  *
9368
9368
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-distanceOperator.html#execute Read more...}
9369
9369
  */
@@ -9452,7 +9452,7 @@ declare namespace __esri {
9452
9452
  * @param maxDeviation The maximum allowed deviation from the generalized geometry to the original geometry. If maxDeviation <= 0 the operator returns the input geometry. Unless the `unit` option is set, the default is the spatial reference unit of `geometry`.
9453
9453
  * @param options Additional options.
9454
9454
  * @param options.removeDegenerateParts Preserves degenerate parts. The operator will try to output three distinct vertices for closed polyline paths and polygon rings, and it will output two distinct vertices for open polyline paths. When set to `true`, the degenerate parts of the geometry will be removed from the output. This may not be desirable for displaying the geometry.
9455
- * @param options.unit The length unit of `maxDeviation`. An error will be thrown if this is set for Geographic Coordinate Systems.
9455
+ * @param options.unit The length unit of `maxDeviation`. The default is the input geometry's spatial reference unit. An error will be thrown if this is set for Geographic Coordinate Systems.
9456
9456
  *
9457
9457
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-generalizeOperator.html#execute Read more...}
9458
9458
  */
@@ -9464,7 +9464,7 @@ declare namespace __esri {
9464
9464
  * @param maxDeviation The maximum allowed deviation from the generalized geometry to the original geometry. If the value is less than or equal to zero, then the operator returns the input geometries. Unless the `unit` option is set, the default is the spatial reference unit of `geometries`.
9465
9465
  * @param options Additional options.
9466
9466
  * @param options.removeDegenerateParts Preserves degenerate parts. The operator will try to output three distinct vertices for closed polyline paths and polygon rings, and it will output two distinct vertices for open polyline paths. When set to `true`, the degenerate parts of the geometries will be removed from the output. This may not be desirable for displaying the geometries.
9467
- * @param options.unit The length unit of `maxDeviation`. An error will be thrown if this is set for Geographic Coordinate Systems.
9467
+ * @param options.unit The length unit of `maxDeviation`. The default is the input geometry's spatial reference unit. An error will be thrown if this is set for Geographic Coordinate Systems.
9468
9468
  *
9469
9469
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-generalizeOperator.html#executeMany Read more...}
9470
9470
  */
@@ -9835,7 +9835,7 @@ declare namespace __esri {
9835
9835
  * @param options.maxVerticesInFullCircle The maximum number of vertices in the polygon produced from a buffered point.
9836
9836
  * @param options.miterLimit Defines when miter joins are replaced with bevel joins.
9837
9837
  * @param options.union Indicates if the buffer geometries should be unioned. When set to `true`, the output will be a single geometry.
9838
- * @param options.unit The length unit of the buffer distances and max deviation. An error will be thrown if this is set for Geographic Coordinate Systems.
9838
+ * @param options.unit The length unit of the buffer distances and max deviation. The default is the input geometries spatial reference unit. An error will be thrown if this is set for Geographic Coordinate Systems.
9839
9839
  *
9840
9840
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-graphicBufferOperator.html#executeMany Read more...}
9841
9841
  */
@@ -9950,7 +9950,7 @@ declare namespace __esri {
9950
9950
  * @param geometry2 The second geometry.
9951
9951
  * @param distance The distance (must be positive). Unless the `unit` option is set, the default is the geometry's spatial reference unit.
9952
9952
  * @param options Additional options.
9953
- * @param options.unit The length unit of the distance. An error will be thrown if this is set for Geographic Coordinate Systems.
9953
+ * @param options.unit The length unit of the distance. Unless the `unit` option is set, the default is the geometry's spatial reference unit. An error will be thrown if this is set for Geographic Coordinate Systems.
9954
9954
  *
9955
9955
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-isNearOperator.html#execute Read more...}
9956
9956
  */
@@ -10002,7 +10002,7 @@ declare namespace __esri {
10002
10002
  *
10003
10003
  * @param geometry The geometry to calculate the length from.
10004
10004
  * @param options Additional options.
10005
- * @param options.unit The length unit of the return value. An error will be thrown if this is set for Geographic Coordinate Systems.
10005
+ * @param options.unit The length unit of the return value. The default is the input geometry's spatial reference unit. An error will be thrown if this is set for Geographic Coordinate Systems.
10006
10006
  *
10007
10007
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-lengthOperator.html#execute Read more...}
10008
10008
  */
@@ -10129,7 +10129,7 @@ declare namespace __esri {
10129
10129
  * @param options.flattenError The maximum distance of the resulting segments compared to the true circular arc (used only when `joins` is set to `"round"`). The algorithm never produces more than around 180 vertices for each round join.
10130
10130
  * @param options.joins Defines the join type of the offset geometry.
10131
10131
  * @param options.miterLimit Defines when miter joins are replaced with bevel joins.
10132
- * @param options.unit The length unit of the offset distance. An error will be thrown if this is set for Geographic Coordinate Systems.
10132
+ * @param options.unit The length unit of the offset distance. The default is the input geometry's spatial reference unit. An error will be thrown if this is set for Geographic Coordinate Systems.
10133
10133
  *
10134
10134
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-offsetOperator.html#execute Read more...}
10135
10135
  */
@@ -10143,7 +10143,7 @@ declare namespace __esri {
10143
10143
  * @param options.flattenError The maximum distance of the resulting segments compared to the true circular arc (used only when joins is round). The algorithm never produces more than around 180 vertices for each round join.
10144
10144
  * @param options.joins Defines the join type of the offset geometry.
10145
10145
  * @param options.miterLimit Defines when miter joins are replaced with bevel joins.
10146
- * @param options.unit The length unit of the offset distance. An error will be thrown if this is set for Geographic Coordinate Systems.
10146
+ * @param options.unit The length unit of the offset distance. The default is the input geometries spatial reference unit. An error will be thrown if this is set for Geographic Coordinate Systems.
10147
10147
  *
10148
10148
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-offsetOperator.html#executeMany Read more...}
10149
10149
  */
@@ -10252,7 +10252,7 @@ declare namespace __esri {
10252
10252
  * @param remainingArea The size of the remaining piece of the uncut polygon. Pass zero, if you want to slice the whole polygon. Unless the `unit` option is set, the default is the spatial reference unit of `polygon`.
10253
10253
  * @param options Additional options.
10254
10254
  * @param options.transform The affine transformation to apply to the polygon before slicing. When applying the transformation, the slicing starts from the bottom and proceeds to the top. The default is the identity transformation. For horizontal slices, use {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-support-Transformation.html#setIdentity Transformation.setIdentity()}. To slice vertically, apply {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-support-Transformation.html#setSwapCoordinates Transformation.setSwapCoordinates()} that swaps x and y coordinate values, and for an arbitrary angle, use {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-support-Transformation.html#rotate Transformation.rotate()}.
10255
- * @param options.unit The area unit of the remaining area.
10255
+ * @param options.unit The area unit of the remaining area. The default is the input geometry's spatial reference unit. An error will be thrown if this is set for Geographic Coordinate Systems.
10256
10256
  *
10257
10257
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-polygonSlicerOperator.html#findSlicesByArea Read more...}
10258
10258
  */
@@ -10368,7 +10368,7 @@ declare namespace __esri {
10368
10368
  * @param options Additional options.
10369
10369
  * @param options.calculateLeftRightSide When the parameter is set to true, this function will calculate the left/right side of a polyline or polygon. Look for the result in the `rightSide` property of the returned `ProximityResult` object.
10370
10370
  * @param options.testPolygonInterior When `geometry` is a polygon, the function will test if `point` is inside of the polygon. Points that are inside of the polygon have zero distance to the polygon. When set to false, the function will not check if the point is inside of the polygon, but will only determine proximity to the boundary.
10371
- * @param options.unit The length unit of the result distance. An error will be thrown if this is set for Geographic Coordinate Systems.
10371
+ * @param options.unit The length unit of the result distance. The default is the input geometry's spatial reference unit. An error will be thrown if this is set for Geographic Coordinate Systems.
10372
10372
  *
10373
10373
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-proximityOperator.html#getNearestCoordinate Read more...}
10374
10374
  */
@@ -10379,7 +10379,7 @@ declare namespace __esri {
10379
10379
  * @param geometry The input geometry.
10380
10380
  * @param point The point used to search for the nearest coordinate in the input `geometry`.
10381
10381
  * @param options Additional options.
10382
- * @param options.unit The length unit of the result distance. An error will be thrown if this is set for Geographic Coordinate Systems.
10382
+ * @param options.unit The length unit of the result distance. The default is the input geometry's spatial reference unit. An error will be thrown if this is set for Geographic Coordinate Systems.
10383
10383
  *
10384
10384
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-proximityOperator.html#getNearestVertex Read more...}
10385
10385
  */
@@ -10392,7 +10392,7 @@ declare namespace __esri {
10392
10392
  * @param searchRadius The planar distance from the `inputPoint` to search for vertices. Unless the `unit` option is set, the default is the geometry's spatial reference unit.
10393
10393
  * @param maxVertexCountToReturn The maximum number of vertices that will be returned. Must be a positive number.
10394
10394
  * @param options Additional options.
10395
- * @param options.unit The length unit of the search radius and result distances. An error will be thrown if this is set for Geographic Coordinate Systems.
10395
+ * @param options.unit The length unit of the search radius and result distances. The default is the input geometry's spatial reference unit. An error will be thrown if this is set for Geographic Coordinate Systems.
10396
10396
  *
10397
10397
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-proximityOperator.html#getNearestVertices Read more...}
10398
10398
  */
@@ -11083,6 +11083,8 @@ declare namespace __esri {
11083
11083
  * Checks to see if polygon rings cross each other and indicates if the polygon is
11084
11084
  * self-intersecting, which means the ring of the polygon crosses itself.
11085
11085
  *
11086
+ * @deprecated since 4.33. Please use {@link module:esri/geometry/operators/simplifyOperator#isSimple simplifyOperator.isSimple()} instead.
11087
+ *
11086
11088
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#isSelfIntersecting Read more...}
11087
11089
  */
11088
11090
  readonly isSelfIntersecting: boolean;
@@ -131191,8 +131193,8 @@ declare namespace __esri {
131191
131193
  *
131192
131194
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GridControls-GridControlsViewModel.html#gridColor Read more...}
131193
131195
  */
131194
- get gridColor(): Color;
131195
- set gridColor(value: ColorProperties);
131196
+ get gridColor(): Color | nullish;
131197
+ set gridColor(value: ColorProperties | nullish);
131196
131198
  /**
131197
131199
  * This is the snapping options object that will be configured by the 'enable snapping' property.
131198
131200
  *
@@ -131222,7 +131224,7 @@ declare namespace __esri {
131222
131224
  *
131223
131225
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GridControls-GridControlsViewModel.html#gridColor Read more...}
131224
131226
  */
131225
- gridColor?: ColorProperties;
131227
+ gridColor?: ColorProperties | nullish;
131226
131228
  /**
131227
131229
  * Sets the interactive placement state, either starting or ending a draw operation that implicitly adjusts the grid.
131228
131230
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.33.0-next.20250402",
3
+ "version": "4.33.0-next.20250403",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- const b="20250402",e="a3fe9b98d9e84bb51d7aa0599c2b4ee831020ab8";export{b as buildDate,e as commitHash};
5
+ const c="20250403",f="378291f9d13234dc2483cf348050c8f6de4c332f";export{c as buildDate,f as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{id as i}from"../../kernel.js";import r from"../../core/Collection.js";import n from"../../core/Error.js";import s from"../../core/Evented.js";import t from"../../core/Loadable.js";import o from"../../core/Logger.js";import{getOrCreateMapValue as a}from"../../core/MapUtils.js";import d from"../../core/Promise.js";import{debounce as c,throwIfAborted as v}from"../../core/promiseUtils.js";import l from"../../core/ReactiveMap.js";import{watch as p,whenOnce as m}from"../../core/reactiveUtils.js";import{normalize as u}from"../../core/urlUtils.js";import{property as f}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as g}from"../../core/support/UpdatingHandles.js";import{parse as w}from"../../layers/support/arcgisLayerUrl.js";import{isSubtypeGroupLayer as y,isFeatureLayer as S}from"../../layers/support/layerUtils.js";import I from"../../portal/Portal.js";import{hasUserTypeExtension as _}from"../../portal/support/utils.js";import b from"../../rest/featureService/FeatureService.js";import{ServiceVersionInfo as L}from"./ServiceVersionInfo.js";import V from"../../versionManagement/VersionManagementService.js";function A(e){return!e||0===e.trim().length}const U=new Map;function T(e){return a(U,e,(()=>{const i=new j({view:e});return e.addHandles({remove(){U.delete(e),i.destroy()}}),i.load().catch((e=>{o.getLogger("esri.views.Services").error("Failed to load service metadata",e)})),i}))}let j=class extends(t.LoadableMixin(d.EsriPromiseMixin(s.EventedAccessor))){constructor(e){super(e),this._updatingHandles=new g,this.items=new r,this.tablesAndLayersLookup=new l,this.additionalLayers=new r,this._debouncedCheckAndUpdateServiceInfos=c((async()=>{const e=[];for(const i of this.items){if(0===i.layersAndTables.length)continue;const r=i.layersAndTables.getItemAt(0);r?.gdbVersion!==i.versionInfo?.versionIdentifier.name&&e.push(i)}0!==e.length&&(await m((()=>!this.updating)),await this._updateVersionInfos(e))})),this._debouncedLayersChanged=c((async()=>{const e=this._detectNewLayersAndTables();0!==e.length&&(await m((()=>!this._updatingHandles.updating)),await this._updatingHandles.addPromise((async()=>{const i=new Set;for(const n of e)if("feature"===n.type||"subtype-group"===n.type){if(!n.url)continue;const e=w(n.url).url.path,s=this._findServiceInfo(e);if(s)this.tablesAndLayersLookup.set(n,s),n.isTable?s.tables.push(n):s.layers.push(n);else if(!i.has(e))try{await this._addServiceInfo(e,n)}catch(r){o.getLogger(this).error(`Failed to load feature service: ${e}`,r)}finally{i.add(e)}}})()))})),this._processed=new Set}destroy(){this._set("view",null),this.items.removeAll(),this.tablesAndLayersLookup.clear()}async load(e){return v(e),this.addHandles([p((()=>this._allLayersAndTables),(()=>{this._debouncedLayersChanged().catch((e=>{o.getLogger(this).warn("Failed to update service info",e)}))})),p((()=>this.items.map((e=>e.layersAndTables.map((e=>e.gdbVersion??"")).join(",")))),(()=>{this.checkAndUpdateServiceInfos().catch((e=>{o.getLogger(this).warn("Failed to update service info",e)}))}))]),this.addResolvingPromise(this._debouncedLayersChanged()),this}get updating(){return"loading"===this.loadStatus||this._updatingHandles.updating}checkAndUpdateServiceInfos(){return this._debouncedCheckAndUpdateServiceInfos()}changeVersion(e,i,r){return this._updatingHandles.addPromise((async()=>{await this._changeVersionInternal(e,i,r)})())}createVersion(e){return this._updatingHandles.addPromise((async()=>{const i=e.featureServerUrl,r=this._findServiceInfo(i);if(!r?.versionService)throw new n("services:no-version-management-service","No version management service");const s=r.hasAdvancedEditingUserTypeExtension,t=r.loggedInServiceUser.toUpperCase(),o=A(e.ownerName)?t:e.ownerName?.trim().toUpperCase();if(o!==t){if(r.featureServiceVersion<=11.1)throw new n("services:versioning-api-error","Version management API too old");if(!s)throw new n("services:no-advanced-editing-user-type-extension","No advanced editing extension on service")}if("SDE"===o?.toUpperCase()&&"DEFAULT"===e.versionName.toUpperCase())throw new n("services:no-valid-version-name","No valid version name");{const i=await r.versionService.getVersionInfos();if(i?.find((i=>i.versionIdentifier.name.toUpperCase()===(o+"."+e.versionName).toUpperCase()||i.versionIdentifier.name.toUpperCase()===(t+"."+e.versionName).toUpperCase())))throw new n("services:no-valid-version-name","No valid version name")}const a=await r.versionService.createVersion({versionName:e.versionName,access:o!==t?"public":e.access,description:e.description});if(o!==t){const{guid:i,name:n}=a.versionIdentifier;await r.versionService.alterVersion({guid:i,name:n},{ownerName:o,access:e.access})}e.switchToVersion&&await this._changeVersionInternal(i,a.versionIdentifier.name,a.versionIdentifier.guid),this.emit("version-created",{versionIdentifier:a.versionIdentifier,versionManagementService:r.versionService})})())}deleteVersion(e,i,r){return this._updatingHandles.addPromise((async()=>{const s=this._findServiceInfo(e);if(!s?.versionService)throw new n("services:no-version-management-service","No version management service");if(s.featureServiceVersion<=11.1)throw new n("services:versioning-api-error","Version management API too old");if(!s.hasAdvancedEditingUserTypeExtension)throw new n("services:no-advanced-editing-user-type-extension","No advanced editing extension on service");const t={name:i,guid:r};await s.versionService.deleteVersion(t)&&(await this._updateVersionInfo(s),this.emit("version-deleted",{versionIdentifier:t,versionManagementService:s.versionService}))})())}startEditing(e){return this._updatingHandles.addPromise((async()=>{const i=this._findServiceInfo(e);if(!i?.versionService)throw new n("services:no-version-management-service","No version management service");if(!i.hasAdvancedEditingUserTypeExtension)throw new n("services:no-advanced-editing-user-type-extension","No advanced editing extension on service");const r=i.versionInfo?.versionIdentifier??{name:i.versionService.defaultVersionIdentifier.name,guid:i.versionService.defaultVersionIdentifier.guid};let s=!0;("none"!==i.versionService.getLockType(r)||(s=await i.versionService.startReading(r),s))&&(s=await i.versionService.startEditing(r),i.updateLockType())})())}finishEditing(e,i){return this._updatingHandles.addPromise((async()=>{const r=this._findServiceInfo(e);if(!r?.versionService)throw new n("services:no-version-management-service","No version management service");if(!r.hasAdvancedEditingUserTypeExtension)throw new n("services:no-advanced-editing-user-type-extension","No advanced editing extension on service");const s=r.versionInfo?.versionIdentifier??{name:r.versionService.defaultVersionIdentifier.name,guid:r.versionService.defaultVersionIdentifier.guid},t=r.versionService.getLockType(s);if("none"!==t)return"read"===t?(await r.versionService.stopReading(s),void r.updateLockType()):"edit"===t?(await r.versionService.stopEditing(s,i),await r.versionService.stopReading(s),void r.updateLockType()):void 0})())}async _changeVersionInternal(e,i,r){const s=this._findServiceInfo(e);if(!s?.versionService)throw new n("services:no-version-management-service","No version management service");const t=s.versionInfo?.versionIdentifier??{name:s.versionService.defaultVersionIdentifier.name,guid:s.versionService.defaultVersionIdentifier.guid},o={name:i,guid:r};await s.versionService.changeVersion(this.view?.map,t,o)&&await this._updateVersionInfo(s)}async _updateVersionInfo(e){const i=e.versionService;if(!i)return;if(0===e.layersAndTables.length)return;const r=e.layersAndTables.getItemAt(0)?.gdbVersion,n=r?await i.getVersionIdentifierFromName(r):i.defaultVersionIdentifier;e.versionInfo=await i.getVersionInfoExtended(n)}_findServiceInfo(e){return this.items.find((i=>i.featureService.url===e))??null}_removeFeatureService(e){this.items.remove(e)}async _findPortal(e){const r=i?.findServerInfo(e??"");if(!r?.owningSystemUrl)return null;const n=`${r.owningSystemUrl}/sharing/rest`,s=I.getDefault();if(s?.loaded&&u(s.restUrl)===u(n))return s;return new I({authMode:"immediate",url:r.owningSystemUrl}).load()}_updateVersionInfos(e){return this._updatingHandles.addPromise((async()=>{for(const i of e)await this._updateVersionInfo(i).catch((e=>{o.getLogger(this).error("Failed to update version details",e)}))})())}async _addServiceInfo(e,i){const n=new b({url:e});await n.load();const s=await this._findPortal(e),t=s?.user?.username;let o=!1;t&&(o=await _(s,t,"advediting"));let a=null;n.versionManagementServiceUrl&&(a=new V({url:n.versionManagementServiceUrl}),await a.load());const d=i.isTable?[]:[i],c=i.isTable?[i]:[],v=new L({loggedInServiceUser:t??"",hasAdvancedEditingUserTypeExtension:o,versionInfo:null,lockType:"none",canEditVersionedData:!0,canCreateVersion:!0,featureService:n,versionService:a,layers:new r(d),tables:new r(c)});return a&&await this._updateVersionInfo(v),this.items.push(v),this.tablesAndLayersLookup.set(i,v),i.isTable?v.tables.push(i):v.layers.push(i),v}get _allLayersAndTables(){return[...this.view.map.allLayers,...this.view.map.allTables,...this.additionalLayers]}_detectNewLayersAndTables(){const e=new Set(this._allLayersAndTables),i=[];for(const r of e)"feature"!==r.type&&"subtype-group"!==r.type||this._processed.has(r)||i.push(r);for(const r of this._processed)if(!e.has(r)&&(y(r)||S(r))){const e=this.tablesAndLayersLookup.get(r);if(!e)continue;this.tablesAndLayersLookup.delete(r),r.isTable?e.tables.remove(r):e.layers.remove(r),0===e.layersAndTables.length&&this._removeFeatureService(e)}return this._processed=e,i}};e([f({constructOnly:!0})],j.prototype,"view",void 0),e([f()],j.prototype,"items",void 0),e([f()],j.prototype,"tablesAndLayersLookup",void 0),e([f()],j.prototype,"additionalLayers",void 0),e([f()],j.prototype,"updating",null),e([f()],j.prototype,"_allLayersAndTables",null),j=e([h("esri.undoredo.support.Services")],j);export{j as Services,T as getServices};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{id as i}from"../../kernel.js";import r from"../../core/Collection.js";import n from"../../core/Error.js";import s from"../../core/Evented.js";import t from"../../core/Loadable.js";import o from"../../core/Logger.js";import{getOrCreateMapValue as a}from"../../core/MapUtils.js";import d from"../../core/Promise.js";import{debounce as c,throwIfAborted as v}from"../../core/promiseUtils.js";import l from"../../core/ReactiveMap.js";import{watch as p,whenOnce as m}from"../../core/reactiveUtils.js";import{normalize as u}from"../../core/urlUtils.js";import{property as f}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as g}from"../../core/support/UpdatingHandles.js";import{parse as w}from"../../layers/support/arcgisLayerUrl.js";import{isSubtypeGroupLayer as y,isFeatureLayer as S}from"../../layers/support/layerUtils.js";import I from"../../portal/Portal.js";import{hasUserTypeExtension as _}from"../../portal/support/utils.js";import b from"../../rest/featureService/FeatureService.js";import{ServiceVersionInfo as L}from"./ServiceVersionInfo.js";function V(e){return!e||0===e.trim().length}const A=new Map;function U(e){return a(A,e,(()=>{const i=new T({view:e});return e.addHandles({remove(){A.delete(e),i.destroy()}}),i.load().catch((e=>{o.getLogger("esri.views.Services").error("Failed to load service metadata",e)})),i}))}let T=class extends(t.LoadableMixin(d.EsriPromiseMixin(s.EventedAccessor))){constructor(e){super(e),this._updatingHandles=new g,this.items=new r,this.tablesAndLayersLookup=new l,this.additionalLayers=new r,this._debouncedCheckAndUpdateServiceInfos=c((async()=>{const e=[];for(const i of this.items){if(0===i.layersAndTables.length)continue;const r=i.layersAndTables.getItemAt(0);r?.gdbVersion!==i.versionInfo?.versionIdentifier.name&&e.push(i)}0!==e.length&&(await m((()=>!this.updating)),await this._updateVersionInfos(e))})),this._debouncedLayersChanged=c((async()=>{const e=this._detectNewLayersAndTables();0!==e.length&&(await m((()=>!this._updatingHandles.updating)),await this._updatingHandles.addPromise((async()=>{const i=new Set;for(const n of e)if("feature"===n.type||"subtype-group"===n.type){if(!n.url)continue;const e=w(n.url).url.path,s=this._findServiceInfo(e);if(s)this.tablesAndLayersLookup.set(n,s),n.isTable?s.tables.push(n):s.layers.push(n);else if(!i.has(e))try{await this._addServiceInfo(e,n)}catch(r){o.getLogger(this).error(`Failed to load feature service: ${e}`,r)}finally{i.add(e)}}})()))})),this._processed=new Set}destroy(){this._set("view",null),this.items.removeAll(),this.tablesAndLayersLookup.clear()}async load(e){return v(e),this.addHandles([p((()=>this._allLayersAndTables),(()=>{this._debouncedLayersChanged().catch((e=>{o.getLogger(this).warn("Failed to update service info",e)}))})),p((()=>this.items.map((e=>e.layersAndTables.map((e=>e.gdbVersion??"")).join(",")))),(()=>{this.checkAndUpdateServiceInfos().catch((e=>{o.getLogger(this).warn("Failed to update service info",e)}))}))]),this.addResolvingPromise(this._debouncedLayersChanged()),this}get updating(){return"loading"===this.loadStatus||this._updatingHandles.updating}checkAndUpdateServiceInfos(){return this._debouncedCheckAndUpdateServiceInfos()}changeVersion(e,i,r){return this._updatingHandles.addPromise((async()=>{await this._changeVersionInternal(e,i,r)})())}createVersion(e){return this._updatingHandles.addPromise((async()=>{const i=e.featureServerUrl,r=this._findServiceInfo(i);if(!r?.versionService)throw new n("services:no-version-management-service","No version management service");const s=r.hasAdvancedEditingUserTypeExtension,t=r.loggedInServiceUser.toUpperCase(),o=V(e.ownerName)?t:e.ownerName?.trim().toUpperCase();if(o!==t){if(r.featureServiceVersion<=11.1)throw new n("services:versioning-api-error","Version management API too old");if(!s)throw new n("services:no-advanced-editing-user-type-extension","No advanced editing extension on service")}if("SDE"===o?.toUpperCase()&&"DEFAULT"===e.versionName.toUpperCase())throw new n("services:no-valid-version-name","No valid version name");{const i=await r.versionService.getVersionInfos();if(i?.find((i=>i.versionIdentifier.name.toUpperCase()===(o+"."+e.versionName).toUpperCase()||i.versionIdentifier.name.toUpperCase()===(t+"."+e.versionName).toUpperCase())))throw new n("services:no-valid-version-name","No valid version name")}const a=await r.versionService.createVersion({versionName:e.versionName,access:o!==t?"public":e.access,description:e.description});if(o!==t){const{guid:i,name:n}=a.versionIdentifier;await r.versionService.alterVersion({guid:i,name:n},{ownerName:o,access:e.access})}e.switchToVersion&&await this._changeVersionInternal(i,a.versionIdentifier.name,a.versionIdentifier.guid),this.emit("version-created",{versionIdentifier:a.versionIdentifier,versionManagementService:r.versionService})})())}deleteVersion(e,i,r){return this._updatingHandles.addPromise((async()=>{const s=this._findServiceInfo(e);if(!s?.versionService)throw new n("services:no-version-management-service","No version management service");if(s.featureServiceVersion<=11.1)throw new n("services:versioning-api-error","Version management API too old");if(!s.hasAdvancedEditingUserTypeExtension)throw new n("services:no-advanced-editing-user-type-extension","No advanced editing extension on service");const t={name:i,guid:r};await s.versionService.deleteVersion(t)&&(await this._updateVersionInfo(s),this.emit("version-deleted",{versionIdentifier:t,versionManagementService:s.versionService}))})())}startEditing(e){return this._updatingHandles.addPromise((async()=>{const i=this._findServiceInfo(e);if(!i?.versionService)throw new n("services:no-version-management-service","No version management service");if(!i.hasAdvancedEditingUserTypeExtension)throw new n("services:no-advanced-editing-user-type-extension","No advanced editing extension on service");const r=i.versionInfo?.versionIdentifier??{name:i.versionService.defaultVersionIdentifier.name,guid:i.versionService.defaultVersionIdentifier.guid};let s=!0;("none"!==i.versionService.getLockType(r)||(s=await i.versionService.startReading(r),s))&&(s=await i.versionService.startEditing(r),i.updateLockType())})())}finishEditing(e,i){return this._updatingHandles.addPromise((async()=>{const r=this._findServiceInfo(e);if(!r?.versionService)throw new n("services:no-version-management-service","No version management service");if(!r.hasAdvancedEditingUserTypeExtension)throw new n("services:no-advanced-editing-user-type-extension","No advanced editing extension on service");const s=r.versionInfo?.versionIdentifier??{name:r.versionService.defaultVersionIdentifier.name,guid:r.versionService.defaultVersionIdentifier.guid},t=r.versionService.getLockType(s);if("none"!==t)return"read"===t?(await r.versionService.stopReading(s),void r.updateLockType()):"edit"===t?(await r.versionService.stopEditing(s,i),await r.versionService.stopReading(s),void r.updateLockType()):void 0})())}async _changeVersionInternal(e,i,r){const s=this._findServiceInfo(e);if(!s?.versionService)throw new n("services:no-version-management-service","No version management service");const t=s.versionInfo?.versionIdentifier??{name:s.versionService.defaultVersionIdentifier.name,guid:s.versionService.defaultVersionIdentifier.guid},o={name:i,guid:r};await s.versionService.changeVersion(this.view?.map,t,o)&&await this._updateVersionInfo(s)}async _updateVersionInfo(e){const i=e.versionService;if(!i)return;if(0===e.layersAndTables.length)return;const r=e.layersAndTables.getItemAt(0)?.gdbVersion,n=r?await i.getVersionIdentifierFromName(r):i.defaultVersionIdentifier;e.versionInfo=await i.getVersionInfoExtended(n)}_findServiceInfo(e){return this.items.find((i=>i.featureService.url===e))??null}_removeFeatureService(e){this.items.remove(e)}async _findPortal(e){const r=i?.findServerInfo(e??"");if(!r?.owningSystemUrl)return null;const n=`${r.owningSystemUrl}/sharing/rest`,s=I.getDefault();if(s?.loaded&&u(s.restUrl)===u(n))return s;return new I({authMode:"immediate",url:r.owningSystemUrl}).load()}_updateVersionInfos(e){return this._updatingHandles.addPromise((async()=>{for(const i of e)await this._updateVersionInfo(i).catch((e=>{o.getLogger(this).error("Failed to update version details",e)}))})())}async _addServiceInfo(e,i){const n=new b({url:e});await n.load();const s=await this._findPortal(e),t=s?.user?.username;let o=!1;t&&(o=await _(s,t,"advediting"));let a=null;if(n.versionManagementServiceUrl){a=new(0,(await import("../../versionManagement/VersionManagementService.js")).default)({url:n.versionManagementServiceUrl}),await a.load()}const d=i.isTable?[]:[i],c=i.isTable?[i]:[],v=new L({loggedInServiceUser:t??"",hasAdvancedEditingUserTypeExtension:o,versionInfo:null,lockType:"none",canEditVersionedData:!0,canCreateVersion:!0,featureService:n,versionService:a,layers:new r(d),tables:new r(c)});return a&&await this._updateVersionInfo(v),this.items.push(v),this.tablesAndLayersLookup.set(i,v),i.isTable?v.tables.push(i):v.layers.push(i),v}get _allLayersAndTables(){return[...this.view.map.allLayers,...this.view.map.allTables,...this.additionalLayers]}_detectNewLayersAndTables(){const e=new Set(this._allLayersAndTables),i=[];for(const r of e)"feature"!==r.type&&"subtype-group"!==r.type||this._processed.has(r)||i.push(r);for(const r of this._processed)if(!e.has(r)&&(y(r)||S(r))){const e=this.tablesAndLayersLookup.get(r);if(!e)continue;this.tablesAndLayersLookup.delete(r),r.isTable?e.tables.remove(r):e.layers.remove(r),0===e.layersAndTables.length&&this._removeFeatureService(e)}return this._processed=e,i}};e([f({constructOnly:!0})],T.prototype,"view",void 0),e([f()],T.prototype,"items",void 0),e([f()],T.prototype,"tablesAndLayersLookup",void 0),e([f()],T.prototype,"additionalLayers",void 0),e([f()],T.prototype,"updating",null),e([f()],T.prototype,"_allLayersAndTables",null),T=e([h("esri.undoredo.support.Services")],T);export{T as Services,U as getServices};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{clone as e}from"../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{collisionGridCellSize as t}from"./config.js";import{GridIndex as s}from"./util.js";import{TranslateAnchor as o,RotationAlignment as r}from"../style/StyleDefinition.js";class i{constructor(o,r,i,n,l,c,h=!0){this._symbols=o,this._styleRepository=n,this._zoom=l,this._useCollisionGroups=h,this._currentLayerCursor=0,this._currentSymbolCursor=0,this._styleProps=new Map,this._allNeededMatrices=new Map,this._symbolGroups=[],this._gridIndex=new s(r,i,t),this._si=Math.sin(Math.PI*c/180),this._co=Math.cos(Math.PI*c/180),n.cachedStyles&&(this._styleProps=n.cachedStyles);for(const t of o)for(const s of t.symbols)this._allNeededMatrices.has(s.tile)||this._allNeededMatrices.set(s.tile,e(s.tile.transforms.tileUnitsToPixels));this._useCollisionGroups&&this._buildSymbolGroups()}work(e){const t=performance.now();if(this._useCollisionGroups)return this._collideByGroups(t,e);for(;this._currentLayerCursor<this._symbols.length;this._currentLayerCursor++,this._currentSymbolCursor=0){const s=this._symbols[this._currentLayerCursor],o=this._getProperties(s.styleLayerUID),r=this._styleRepository.layerContexts?.get(s.styleLayerUID);for(;this._currentSymbolCursor<s.symbols.length;this._currentSymbolCursor++){if(this._currentSymbolCursor%100==99&&performance.now()-t>e)return!1;const i=s.symbols[this._currentSymbolCursor];if(!i.uniqueSymbol?.show)continue;const n=this._computeCoordinates(i,o,r),l=i.uniqueSymbol;if(!l.show)continue;const{iconAllowOverlap:c,textAllowOverlap:h}=o;for(const e of n){if(!e.enabled)continue;const t=l.parts[e.partIndex];if(!t.show)continue;!(e.partIndex?h:c)&&this._doesCollide(e)&&(e.hard?l.show=!1:t.show=!1)}l.show&&this._insertColliders(l.parts,n,o)}}return!0}_buildSymbolGroups(){const e=new Map;for(const t of this._symbols){const s=this._getProperties(t.styleLayerUID),o=this._styleRepository.layerContexts?.get(t.styleLayerUID);if("esriGeometryPoint"===s.geometryType)for(const r of t.symbols){const t=this._computeCoordinates(r,s,o);if(r.featureID){let o=e.get(r.featureID);o||(o=[],e.set(r.featureID,o)),o.push({symbol:r,colliders:t,styleProps:s})}}else for(const e of t.symbols){const t=[{symbol:e,colliders:this._computeCoordinates(e,s,o),styleProps:s}];this._symbolGroups.push(t)}}for(const t of e.values())this._symbolGroups.push(t)}_collideByGroups(e,t){for(;this._currentSymbolCursor<this._symbolGroups.length;this._currentSymbolCursor++){if(this._currentSymbolCursor%100==99&&performance.now()-e>t)return!1;let s=!1;const o=this._symbolGroups[this._currentSymbolCursor];for(const{symbol:e,colliders:t,styleProps:r}of o){if(!e.uniqueSymbol?.show)continue;const o=e.uniqueSymbol;if(!o.show)continue;const{iconAllowOverlap:i,textAllowOverlap:n}=r;for(const e of t){if(!e.enabled)continue;const t=o.parts[e.partIndex];if(!t.show)continue;!(e.partIndex?n:i)&&this._doesCollide(e)&&(e.hard?(s=!0,o.show=!1):(s=!0,t.show=!1))}}if(s)for(const{symbol:e}of o)e.uniqueSymbol.show=!1;else for(const{symbol:e,colliders:t,styleProps:r}of o)this._insertColliders(e.uniqueSymbol.parts,t,r)}return!0}_insertColliders(e,t,s){const{iconIgnorePlacement:o,textIgnorePlacement:r}=s;for(const i of t){if(!i.enabled)continue;if(i.partIndex?r:o)continue;if(!e[i.partIndex].show)continue;const t=i.xScreen+i.dxScreen,s=i.yScreen+i.dyScreen,n=t+i.width,l=s+i.height,[c,h,y,u]=this._gridIndex.getCellSpan(t,s,n,l);for(let e=h;e<=u;e++)for(let t=c;t<=y;t++){this._gridIndex.cells[e][t].push(i)}}}_computeCoordinates(e,t,s){const{iconRotationAlignment:i,textRotationAlignment:n,iconTranslate:l,iconTranslateAnchor:c,textTranslate:h,textTranslateAnchor:y}=t,u=this._si,a=this._co,d=this._zoom,f=this._allNeededMatrices.get(e.tile),m=e.uniqueSymbol,p=e.colliders(s);let _=0;for(const x of p){const[e,t]=0===x.partIndex?l:h,s=0===x.partIndex?c:y,m=x.minLod<=d&&d<=x.maxLod;_+=m?0:1,x.enabled=m,x.xScreen=x.xTile*f[0]+x.yTile*f[3]+f[6],x.yScreen=x.xTile*f[1]+x.yTile*f[4]+f[7],s===o.MAP?(x.xScreen+=a*e-u*t,x.yScreen+=u*e+a*t):(x.xScreen+=e,x.yScreen+=t),r.VIEWPORT===(0===x.partIndex?i:n)?(x.dxScreen=x.dxPixels,x.dyScreen=x.dyPixels):(x.dxScreen=a*(x.dxPixels+x.width/2)-u*(x.dyPixels+x.height/2)-x.width/2,x.dyScreen=u*(x.dxPixels+x.width/2)+a*(x.dyPixels+x.height/2)-x.height/2)}return p.length>0&&_===p.length&&m&&(m.show=!1),p}_getProperties(e){const t=this._styleProps.get(e);if(t)return t;const s=this._styleRepository.getLayerStyleProperties?.(e,this._zoom);return this._styleProps.set(e,s),s}_doesCollide(e){const t=e.xScreen+e.dxScreen,s=e.yScreen+e.dyScreen,o=t+e.width,r=s+e.height,[i,n,l,c]=this._gridIndex.getCellSpan(t,s,o,r);for(let h=n;h<=c;h++)for(let e=i;e<=l;e++){const i=this._gridIndex.cells[h][e];for(const e of i){const i=e.xScreen+e.dxScreen,n=e.yScreen+e.dyScreen,l=i+e.width,c=n+e.height;if(!(o<i||t>l||r<n||s>c))return!0}}return!1}}export{i as CollisionJob};
5
+ import{clone as e}from"../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{collisionGridCellSize as t}from"./config.js";import{GridIndex as r}from"./util.js";import{TranslateAnchor as s,RotationAlignment as o}from"../style/StyleDefinition.js";class n{constructor(s,o,n,i,l,c){this._symbols=s,this._styleRepository=i,this._zoom=l,this._currentLayerCursor=0,this._currentSymbolCursor=0,this._styleProps=new Map,this._allNeededMatrices=new Map,this._gridIndex=new r(o,n,t),this._si=Math.sin(Math.PI*c/180),this._co=Math.cos(Math.PI*c/180),i.cachedStyles&&(this._styleProps=i.cachedStyles);for(const t of s)for(const r of t.symbols)this._allNeededMatrices.has(r.tile)||this._allNeededMatrices.set(r.tile,e(r.tile.transforms.tileUnitsToPixels))}work(e){const t=performance.now();for(;this._currentLayerCursor<this._symbols.length;this._currentLayerCursor++,this._currentSymbolCursor=0){const r=this._symbols[this._currentLayerCursor],s=this._getProperties(r.styleLayerUID),o=this._styleRepository.layerContexts?.get(r.styleLayerUID);for(;this._currentSymbolCursor<r.symbols.length;this._currentSymbolCursor++){if(this._currentSymbolCursor%100==99&&performance.now()-t>e)return!1;const n=r.symbols[this._currentSymbolCursor];if(!n.uniqueSymbol?.show)continue;const i=this._computeCoordinates(n,s,o),l=n.uniqueSymbol;if(!l.show)continue;const{iconAllowOverlap:c,textAllowOverlap:h}=s;for(const e of i){if(!e.enabled)continue;const t=l.parts[e.partIndex];if(!t.show)continue;!(e.partIndex?h:c)&&this._doesCollide(e)&&(e.hard?l.show=!1:t.show=!1)}l.show&&this._insertColliders(l.parts,i,s)}}return!0}_insertColliders(e,t,r){const{iconIgnorePlacement:s,textIgnorePlacement:o}=r;for(const n of t){if(!n.enabled)continue;if(n.partIndex?o:s)continue;if(!e[n.partIndex].show)continue;const t=n.xScreen+n.dxScreen,r=n.yScreen+n.dyScreen,i=t+n.width,l=r+n.height,[c,h,a,d]=this._gridIndex.getCellSpan(t,r,i,l);for(let e=h;e<=d;e++)for(let t=c;t<=a;t++){this._gridIndex.cells[e][t].push(n)}}}_computeCoordinates(e,t,r){const{iconRotationAlignment:n,textRotationAlignment:i,iconTranslate:l,iconTranslateAnchor:c,textTranslate:h,textTranslateAnchor:a}=t,d=this._si,y=this._co,u=this._zoom,x=this._allNeededMatrices.get(e.tile),_=e.uniqueSymbol,f=e.colliders(r);let m=0;for(const S of f){const[e,t]=0===S.partIndex?l:h,r=0===S.partIndex?c:a,_=S.minLod<=u&&u<=S.maxLod;m+=_?0:1,S.enabled=_,S.xScreen=S.xTile*x[0]+S.yTile*x[3]+x[6],S.yScreen=S.xTile*x[1]+S.yTile*x[4]+x[7],r===s.MAP?(S.xScreen+=y*e-d*t,S.yScreen+=d*e+y*t):(S.xScreen+=e,S.yScreen+=t),o.VIEWPORT===(0===S.partIndex?n:i)?(S.dxScreen=S.dxPixels,S.dyScreen=S.dyPixels):(S.dxScreen=y*(S.dxPixels+S.width/2)-d*(S.dyPixels+S.height/2)-S.width/2,S.dyScreen=d*(S.dxPixels+S.width/2)+y*(S.dyPixels+S.height/2)-S.height/2)}return f.length>0&&m===f.length&&_&&(_.show=!1),f}_getProperties(e){const t=this._styleProps.get(e);if(t)return t;const r=this._styleRepository.getLayerStyleProperties?.(e,this._zoom);return this._styleProps.set(e,r),r}_doesCollide(e){const t=e.xScreen+e.dxScreen,r=e.yScreen+e.dyScreen,s=t+e.width,o=r+e.height,[n,i,l,c]=this._gridIndex.getCellSpan(t,r,s,o);for(let h=i;h<=c;h++)for(let e=n;e<=l;e++){const n=this._gridIndex.cells[h][e];for(const e of n){const n=e.xScreen+e.dxScreen,i=e.yScreen+e.dyScreen,l=n+e.width,c=i+e.height;if(!(s<n||t>l||o<i||r>c))return!0}}return!1}}export{n as CollisionJob};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{VectorTile as e}from"../VectorTile.js";import{fadeDuration as t}from"./config.js";import{effectFlag0 as o,filterFlag0 as i}from"../../webgl/definitions.js";function s(e){return(e.uniqueSymbol?.show&&e.uniqueSymbol?.lastShow)??!1}function r(e,t){if(e.priority-t.priority)return e.priority-t.priority;if(s(e)&&!s(t))return-1;if(s(t)&&!s(e))return 1;const o=e.tile.key,i=t.tile.key;return o.world-i.world?o.world-i.world:o.level-i.level?o.level-i.level:o.row-i.row?o.row-i.row:o.col-i.col?o.col-i.col:e.xTile-t.xTile?e.xTile-t.xTile:e.yTile-t.yTile}class n{get running(){return this._running}constructor(e,t,o,i,s,r,n,l){this.selectionMode=e,this._visibleTiles=t,this._symbolRepository=o,this._styleRepository=i,this._createCollisionJob=s,this._assignTileSymbolsOpacity=r,this._symbolLayerSorter=n,this._isLayerVisible=l,this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}setScreenSize(e,t){this._screenWidth===e&&this._screenHeight===t||this.restart(),this._screenWidth=e,this._screenHeight=t}restart(){this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}continue(e){if(this._selectionJob||(this._selectionJob=this._createSelectionJob()),!this._selectionJobCompleted){const t=performance.now();if(!this._selectionJob.work(e))return!1;if(this._selectionJobCompleted=!0,0===(e=Math.max(0,e-(performance.now()-t))))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight,!0)),!this._collisionJobCompleted){const t=performance.now();if(!this._collisionJob.work(e))return!1;if(this._collisionJobCompleted=!0,0===(e=Math.max(0,e-(performance.now()-t))))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){const t=performance.now();if(!this._opacityJob.work(e))return!1;if(this._opacityJobCompleted=!0,0===(e=Math.max(0,e-(performance.now()-t))))return!1}return this._running=!1,!0}_isFeatureFiltered(e,t,s){const r=t.getFilterFlags(e),n=r&i,l=null==s.featureEffect||s.featureEffect.excludedLabelsVisible||r&o;return!(n&&l)}_getFiltered(){let e;if(this._styleRepository?.layerContexts)for(const t of this._symbolRepository.uniqueSymbols){const o=this._styleRepository.layerContexts?.get(t.styleLayerUID);if(o?.attributeView)for(const i of t.uniqueSymbols){e??=new Set;const t=o.attributeView,s=o.layerView;this._isFeatureFiltered(i.featureID,t,s)&&e.add(i.featureID)}}return e}_resetSelection(){for(let e=0;e<this._symbolRepository.uniqueSymbols.length;e++){const t=this._symbolRepository.uniqueSymbols[e];for(let e=0;e<t.uniqueSymbols.length;e++){const o=t.uniqueSymbols[e];for(const e of o.tileSymbols)e.selectedForRendering=!1}}}_createSelectionJob(){const e="feature-tile"===this.selectionMode?c:a,t=this._symbolRepository.uniqueSymbols;this._resetSelection();const o=[];let i=0,s=0;const n=this._isLayerVisible,l=this._getFiltered(),h=this._styleRepository?.layerContexts;function y(c){let a;const y=performance.now();for(;s<t.length;s++,i=0){const r=t[s],u=r.styleLayerUID;let f=0;if(h){const e=h.get(u).layerView;f=e.view.allLayerViews.items.indexOf(e)}if(!n(u)){o[s]||(o[s]={styleLayerUID:u,layerOrder:f,symbols:[]});continue}o[s]||={styleLayerUID:u,symbols:[],layerOrder:f};const b=o[s];for(;i<r.uniqueSymbols.length;i++){if(a=r.uniqueSymbols[i],i%100==99&&performance.now()-y>c)return!1;if(a.lastShow=a.show,a.featureID&&l?.has(a.featureID)){a.show=!1,a.parts[0].show=!1,a.parts[1].show=!1;continue}const t=e(a);if(t){t.selectedForRendering=!0,b.symbols.push(t),a.show=!0;for(const e of a.parts)e.show=!0}else a.show=!1}}for(const e of o)e.symbols.sort(r);return o.sort(((e,t)=>t.layerOrder-e.layerOrder)),!0}const u=this._symbolLayerSorter;return{work:y,get sortedSymbols(){return o.sort(u)}}}_createOpacityJob(){const t=this._assignTileSymbolsOpacity,o=this._visibleTiles;let i=0;function s(e,o){for(const t of e.symbols.values())l(t,o);t(e,o);for(const t of e.childrenTiles)s(t,o)}return{work(r){const n=performance.now();for(;i<o.length;i++){if(performance.now()-n>r)return!1;const l=o[i];if(null!=l.parentTile)continue;const c=performance.now();l instanceof e?s(l,c):t(l,c)}return!0}}}}function l(e,o){for(const i of e){const e=i.uniqueSymbol;for(const i of e.parts){const s=i.targetOpacity>.5?1:-1;i.startOpacity+=s*((o-i.startTime)/t),i.startOpacity=Math.min(Math.max(i.startOpacity,0),1),i.startTime=o,i.targetOpacity=e.show&&i.show?1:0}}}function c(e){let t=null,o=null,i=null;for(const s of e.tileSymbols){const e=s.tile;e.isReady&&e.isCoverage?t=s:e.isReady?o=s:e.rendering&&(i=s)}return t??o??i}function a(e){let t=null,o=!1,i=!1;for(const s of e.tileSymbols)if(!i||!o){const e=s.tile;(!t||e.isCoverage||e.neededForCoverage&&!o)&&(t=s,(e.neededForCoverage||e.isCoverage)&&(i=!0),e.isCoverage&&(o=!0))}return i?t:null}export{n as SymbolDeclutterer};
5
+ import{VectorTile as e}from"../VectorTile.js";import{fadeDuration as t}from"./config.js";import{effectFlag0 as o,filterFlag0 as i}from"../../webgl/definitions.js";function s(e){return(e.uniqueSymbol?.show&&e.uniqueSymbol?.lastShow)??!1}function r(e,t){if(e.priority-t.priority)return e.priority-t.priority;if(s(e)&&!s(t))return-1;if(s(t)&&!s(e))return 1;const o=e.tile.key,i=t.tile.key;return o.world-i.world?o.world-i.world:o.level-i.level?o.level-i.level:o.row-i.row?o.row-i.row:o.col-i.col?o.col-i.col:e.xTile-t.xTile?e.xTile-t.xTile:e.yTile-t.yTile}class n{get running(){return this._running}constructor(e,t,o,i,s,r,n,l){this.selectionMode=e,this._visibleTiles=t,this._symbolRepository=o,this._styleRepository=i,this._createCollisionJob=s,this._assignTileSymbolsOpacity=r,this._symbolLayerSorter=n,this._isLayerVisible=l,this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}setScreenSize(e,t){this._screenWidth===e&&this._screenHeight===t||this.restart(),this._screenWidth=e,this._screenHeight=t}restart(){this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}continue(e){if(this._selectionJob||(this._selectionJob=this._createSelectionJob()),!this._selectionJobCompleted){const t=performance.now();if(!this._selectionJob.work(e))return!1;if(this._selectionJobCompleted=!0,0===(e=Math.max(0,e-(performance.now()-t))))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight)),!this._collisionJobCompleted){const t=performance.now();if(!this._collisionJob.work(e))return!1;if(this._collisionJobCompleted=!0,0===(e=Math.max(0,e-(performance.now()-t))))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){const t=performance.now();if(!this._opacityJob.work(e))return!1;if(this._opacityJobCompleted=!0,0===(e=Math.max(0,e-(performance.now()-t))))return!1}return this._running=!1,!0}_isFeatureFiltered(e,t,s){const r=t.getFilterFlags(e),n=r&i,l=null==s.featureEffect||s.featureEffect.excludedLabelsVisible||r&o;return!(n&&l)}_getFiltered(){let e;if(this._styleRepository?.layerContexts)for(const t of this._symbolRepository.uniqueSymbols){const o=this._styleRepository.layerContexts?.get(t.styleLayerUID);if(o?.attributeView)for(const i of t.uniqueSymbols){e??=new Set;const t=o.attributeView,s=o.layerView;this._isFeatureFiltered(i.featureID,t,s)&&e.add(i.featureID)}}return e}_resetSelection(){for(let e=0;e<this._symbolRepository.uniqueSymbols.length;e++){const t=this._symbolRepository.uniqueSymbols[e];for(let e=0;e<t.uniqueSymbols.length;e++){const o=t.uniqueSymbols[e];for(const e of o.tileSymbols)e.selectedForRendering=!1}}}_createSelectionJob(){const e="feature-tile"===this.selectionMode?c:a,t=this._symbolRepository.uniqueSymbols;this._resetSelection();const o=[];let i=0,s=0;const n=this._isLayerVisible,l=this._getFiltered(),h=this._styleRepository?.layerContexts;function y(c){let a;const y=performance.now();for(;s<t.length;s++,i=0){const r=t[s],u=r.styleLayerUID;let f=0;if(h){const e=h.get(u).layerView;f=e.view.allLayerViews.items.indexOf(e)}if(!n(u)){o[s]||(o[s]={styleLayerUID:u,layerOrder:f,symbols:[]});continue}o[s]||={styleLayerUID:u,symbols:[],layerOrder:f};const b=o[s];for(;i<r.uniqueSymbols.length;i++){if(a=r.uniqueSymbols[i],i%100==99&&performance.now()-y>c)return!1;if(a.lastShow=a.show,a.featureID&&l?.has(a.featureID)){a.show=!1,a.parts[0].show=!1,a.parts[1].show=!1;continue}const t=e(a);if(t){t.selectedForRendering=!0,b.symbols.push(t),a.show=!0;for(const e of a.parts)e.show=!0}else a.show=!1}}for(const e of o)e.symbols.sort(r);return o.sort(((e,t)=>t.layerOrder-e.layerOrder)),!0}const u=this._symbolLayerSorter;return{work:y,get sortedSymbols(){return o.sort(u)}}}_createOpacityJob(){const t=this._assignTileSymbolsOpacity,o=this._visibleTiles;let i=0;function s(e,o){for(const t of e.symbols.values())l(t,o);t(e,o);for(const t of e.childrenTiles)s(t,o)}return{work(r){const n=performance.now();for(;i<o.length;i++){if(performance.now()-n>r)return!1;const l=o[i];if(null!=l.parentTile)continue;const c=performance.now();l instanceof e?s(l,c):t(l,c)}return!0}}}}function l(e,o){for(const i of e){const e=i.uniqueSymbol;for(const i of e.parts){const s=i.targetOpacity>.5?1:-1;i.startOpacity+=s*((o-i.startTime)/t),i.startOpacity=Math.min(Math.max(i.startOpacity,0),1),i.startTime=o,i.targetOpacity=e.show&&i.show?1:0}}}function c(e){let t=null,o=null,i=null;for(const s of e.tileSymbols){const e=s.tile;e.isReady&&e.isCoverage?t=s:e.isReady?o=s:e.rendering&&(i=s)}return t??o??i}function a(e){let t=null,o=!1,i=!1;for(const s of e.tileSymbols)if(!i||!o){const e=s.tile;(!t||e.isCoverage||e.neededForCoverage&&!o)&&(t=s,(e.neededForCoverage||e.isCoverage)&&(i=!0),e.isCoverage&&(o=!0))}return i?t:null}export{n as SymbolDeclutterer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{signal as t}from"../../../../../core/signal.js";import{CollisionJob as e}from"./CollisionJob.js";import{declutterBudget as i,fadeDuration as s}from"./config.js";import{SymbolDeclutterer as r}from"./SymbolDeclutterer.js";import{SymbolRepository as o}from"./SymbolRepository.js";import{Visibility as l}from"../style/StyleDefinition.js";const a=.5,n=1e-6;class c{constructor(e,s,a,c,h,y=i){this.styleRepository=s,this._declutterBudget=y,this._tileToHandle=new Map,this._viewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._declutterViewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._offsetFromScreenCenter=[0,0],this._completed=!1,this._fading=t(!1);const _=(t,e,i,s)=>this._createCollisionJob(t,e,i,s),u=t=>{const e=this.styleRepository.getStyleLayerByUID?.(t);if(e){if(this._zoom+n<e.minzoom||this._zoom-n>=e.maxzoom)return!1;const t=e.getLayoutProperty?.("visibility");if(t&&t.getValue()===l.NONE)return!1}return!0},m=(t,e)=>(this.styleRepository.getStyleLayerByUID?.(t.styleLayerUID)?.z??0)-(this.styleRepository.getStyleLayerByUID?.(e.styleLayerUID)?.z??0);this._symbolRepository=new o(h,c),this._symbolDeclutterer=new r(e,c,this._symbolRepository,this.styleRepository,_,a,m,u)}get symbolRepository(){return this._symbolRepository}_createCollisionJob(t,i,s,r){return this.updateDecluttererViewState(),new e(t,i,s,this.styleRepository,this._zoom,this._viewState.rotation,r)}get fading(){return this._fading.value}get decluttererOffset(){return this._offsetFromScreenCenter}registerFeatureTile(t){this.symbolRepository?(this.symbolRepository.registerFeatureTile(t),this.restartDeclutter()):console.error("InternalError: Symbol repository not yet initialized")}unregisterFeatureTile(t){this.symbolRepository?(this._symbolRepository.unregisterFeatureTile(t),this.restartDeclutter()):console.error("InternalError: Symbol repository not yet initialized")}insertFeatureTileMetrics(t,e){this.symbolRepository?(this.symbolRepository.insertFeatureTileMetrics(t,e),this.restartDeclutter()):console.error("InternalError: Symbol repository not yet initialized")}removeFeatureTileMetrics(t,e){this.symbolRepository?(this.symbolRepository.removeFeatureTileMetrics(t,e),this.restartDeclutter()):console.error("InternalError: Symbol repository not yet initialized")}addTile(t){t.decluttered=!1,this._tileToHandle.set(t,t.on("symbols-changed",(()=>{this._symbolRepository.registerVectorTile(t),this.restartDeclutter()}))),this._symbolRepository.registerVectorTile(t),this.restartDeclutter()}removeTile(t){const e=this._tileToHandle.get(t);e&&(this._symbolRepository.unregisterVectorTile(t),this.restartDeclutter(),e.remove(),this._tileToHandle.delete(t))}update(t,e){this._zoom=t,this._viewState={scale:e.scale,rotation:e.rotation,center:[e.center[0],e.center[1]],size:[e.size[0],e.size[1]]};const i=[0,0];e.toScreen(i,e.center);const s=[0,0];return e.toScreen(s,this._declutterViewState.center),this._offsetFromScreenCenter[0]=i[0]-s[0],this._offsetFromScreenCenter[1]=i[1]-s[1],this._continueDeclutter(),this._completed}restartDeclutter(){this._completed=!1,this._symbolDeclutterer.restart(),this._notifyUnstable()}clear(){this._completed=!1,this._symbolRepository=null,this._symbolDeclutterer.restart(),this._tileToHandle.forEach((t=>t.remove())),this._tileToHandle.clear()}get stale(){return this._zoom!==this._declutterZoom||this._viewState.size[0]!==this._declutterViewState.size[0]||this._viewState.size[1]!==this._declutterViewState.size[1]||this._viewState.scale!==this._declutterViewState.scale||this._viewState.rotation!==this._declutterViewState.rotation}deleteStyleLayers(t){this._symbolRepository.deleteStyleLayers(t)}_continueDeclutter(){this._completed&&!this.stale||(this._symbolDeclutterer.running||(this.updateDecluttererViewState(),this._symbolDeclutterer.restart()),this._symbolDeclutterer.setScreenSize(this._viewState.size[0],this._viewState.size[1]),this._completed=this._symbolDeclutterer.continue(this._declutterBudget),this._completed&&this._scheduleNotifyStable())}_scheduleNotifyStable(){null!=this._stableNotificationHandle&&clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=setTimeout((()=>{this._stableNotificationHandle=null,this._fading.value=!1}),(1+a)*s)}_notifyUnstable(){null!=this._stableNotificationHandle&&(clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=null),this._fading.value=!0}updateDecluttererViewState(){this._declutterZoom=this._zoom,this._declutterViewState.center[0]=this._viewState.center[0],this._declutterViewState.center[1]=this._viewState.center[1],this._declutterViewState.rotation=this._viewState.rotation,this._declutterViewState.scale=this._viewState.scale,this._declutterViewState.size[0]=this._viewState.size[0],this._declutterViewState.size[1]=this._viewState.size[1],this._offsetFromScreenCenter[0]=0,this._offsetFromScreenCenter[1]=0}}export{c as SymbolFader};
5
+ import{signal as t}from"../../../../../core/signal.js";import{CollisionJob as e}from"./CollisionJob.js";import{declutterBudget as i,fadeDuration as s}from"./config.js";import{SymbolDeclutterer as r}from"./SymbolDeclutterer.js";import{SymbolRepository as o}from"./SymbolRepository.js";import{Visibility as l}from"../style/StyleDefinition.js";const a=.5,n=1e-6;class c{constructor(e,s,a,c,h,y=i){this.styleRepository=s,this._declutterBudget=y,this._tileToHandle=new Map,this._viewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._declutterViewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._offsetFromScreenCenter=[0,0],this._completed=!1,this._fading=t(!1);const _=(t,e,i)=>this._createCollisionJob(t,e,i),u=t=>{const e=this.styleRepository.getStyleLayerByUID?.(t);if(e){if(this._zoom+n<e.minzoom||this._zoom-n>=e.maxzoom)return!1;const t=e.getLayoutProperty?.("visibility");if(t&&t.getValue()===l.NONE)return!1}return!0},m=(t,e)=>(this.styleRepository.getStyleLayerByUID?.(t.styleLayerUID)?.z??0)-(this.styleRepository.getStyleLayerByUID?.(e.styleLayerUID)?.z??0);this._symbolRepository=new o(h,c),this._symbolDeclutterer=new r(e,c,this._symbolRepository,this.styleRepository,_,a,m,u)}get symbolRepository(){return this._symbolRepository}_createCollisionJob(t,i,s){return this.updateDecluttererViewState(),new e(t,i,s,this.styleRepository,this._zoom,this._viewState.rotation)}get fading(){return this._fading.value}get decluttererOffset(){return this._offsetFromScreenCenter}registerFeatureTile(t){this.symbolRepository?(this.symbolRepository.registerFeatureTile(t),this.restartDeclutter()):console.error("InternalError: Symbol repository not yet initialized")}unregisterFeatureTile(t){this.symbolRepository?(this._symbolRepository.unregisterFeatureTile(t),this.restartDeclutter()):console.error("InternalError: Symbol repository not yet initialized")}insertFeatureTileMetrics(t,e){this.symbolRepository?(this.symbolRepository.insertFeatureTileMetrics(t,e),this.restartDeclutter()):console.error("InternalError: Symbol repository not yet initialized")}removeFeatureTileMetrics(t,e){this.symbolRepository?(this.symbolRepository.removeFeatureTileMetrics(t,e),this.restartDeclutter()):console.error("InternalError: Symbol repository not yet initialized")}addTile(t){t.decluttered=!1,this._tileToHandle.set(t,t.on("symbols-changed",(()=>{this._symbolRepository.registerVectorTile(t),this.restartDeclutter()}))),this._symbolRepository.registerVectorTile(t),this.restartDeclutter()}removeTile(t){const e=this._tileToHandle.get(t);e&&(this._symbolRepository.unregisterVectorTile(t),this.restartDeclutter(),e.remove(),this._tileToHandle.delete(t))}update(t,e){this._zoom=t,this._viewState={scale:e.scale,rotation:e.rotation,center:[e.center[0],e.center[1]],size:[e.size[0],e.size[1]]};const i=[0,0];e.toScreen(i,e.center);const s=[0,0];return e.toScreen(s,this._declutterViewState.center),this._offsetFromScreenCenter[0]=i[0]-s[0],this._offsetFromScreenCenter[1]=i[1]-s[1],this._continueDeclutter(),this._completed}restartDeclutter(){this._completed=!1,this._symbolDeclutterer.restart(),this._notifyUnstable()}clear(){this._completed=!1,this._symbolRepository=null,this._symbolDeclutterer.restart(),this._tileToHandle.forEach((t=>t.remove())),this._tileToHandle.clear()}get stale(){return this._zoom!==this._declutterZoom||this._viewState.size[0]!==this._declutterViewState.size[0]||this._viewState.size[1]!==this._declutterViewState.size[1]||this._viewState.scale!==this._declutterViewState.scale||this._viewState.rotation!==this._declutterViewState.rotation}deleteStyleLayers(t){this._symbolRepository.deleteStyleLayers(t)}_continueDeclutter(){this._completed&&!this.stale||(this._symbolDeclutterer.running||(this.updateDecluttererViewState(),this._symbolDeclutterer.restart()),this._symbolDeclutterer.setScreenSize(this._viewState.size[0],this._viewState.size[1]),this._completed=this._symbolDeclutterer.continue(this._declutterBudget),this._completed&&this._scheduleNotifyStable())}_scheduleNotifyStable(){null!=this._stableNotificationHandle&&clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=setTimeout((()=>{this._stableNotificationHandle=null,this._fading.value=!1}),(1+a)*s)}_notifyUnstable(){null!=this._stableNotificationHandle&&(clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=null),this._fading.value=!0}updateDecluttererViewState(){this._declutterZoom=this._zoom,this._declutterViewState.center[0]=this._viewState.center[0],this._declutterViewState.center[1]=this._viewState.center[1],this._declutterViewState.rotation=this._viewState.rotation,this._declutterViewState.scale=this._viewState.scale,this._declutterViewState.size[0]=this._viewState.size[0],this._declutterViewState.size[1]=this._viewState.size[1],this._offsetFromScreenCenter[0]=0,this._offsetFromScreenCenter[1]=0}}export{c as SymbolFader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{handlesGroup as t,makeHandle as s}from"../../../core/handleUtils.js";import{watch as n}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import a from"../../../rest/support/FeatureSet.js";import{isNumber as c}from"../../../support/guards.js";import l from"./FeatureLayerView2D.js";import{handleNoEngineError as h}from"./support/handleNoEngineError.js";import u from"../../layers/StreamLayerView.js";let p=class extends(u(l)){constructor(){super(...arguments),this.pipelineConnectionStatus="disconnected",this.pipelineErrorString=null}initialize(){this.addHandles([n((()=>this.layer.customParameters),(async e=>{(await this.getWorker()).streamMessenger.updateCustomParameters(e)})),this.layer.on("send-message-to-socket",(async e=>{(await this.getWorker()).streamMessenger.sendMessageToSocket(e)})),this.layer.on("send-message-to-client",(async e=>{(await this.getWorker()).streamMessenger.sendMessageToClient(e),this._isUserPaused&&"type"in e&&"clear"===e.type&&this.incrementSourceRefreshVersion()})),n((()=>this.layer.purgeOptions),(()=>this._update())),n((()=>this.suspended),this._onSuspendedChange.bind(this))],"constructor"),this._doResume()}destroy(){this._doPause()}get connectionError(){return this.pipelineErrorString?new r("stream-controller",this.pipelineErrorString):null}on(e,r){if(Array.isArray(e))return t(e.map((e=>this.on(e,r))));const n=["data-received","message-received"].includes(e);n&&this.getWorker().then((r=>r.streamMessenger.enableEvent(e,!0)));const o=super.on(e,r),i=this;return s((()=>{o.remove(),n&&(i._workerProxy.closed||i.hasEventListener(e)||i.getWorker().then((r=>r.streamMessenger.enableEvent(e,!1))))}))}async queryLatestObservations(e,t){if(!(this.layer.timeInfo?.endField||this.layer.timeInfo?.startField||this.layer.timeInfo?.trackIdField))throw new r("streamlayer-no-timeField","queryLatestObservation can only be used with services that define a TrackIdField");const s=await this.getWorker();return h(s.features.executeQueryForLatestObservations(this._cleanUpQuery(e),t).then((e=>{const r=a.fromJSON(e);return r.features.forEach((e=>{e.layer=this.layer,e.sourceLayer=this.layer})),r})),new a({features:[]}))}detach(){super.detach(),this.pipelineConnectionStatus="disconnected"}async queryObjectIds(e,r){return(await super.queryObjectIds(e,r)).filter(c)}get _streamConnectionStatus(){return this.pipelineConnectionStatus}_doPause(){null!=this._refreshInterval&&(clearInterval(this._refreshInterval),this._refreshInterval=null)}_doResume(){this._refreshInterval=setInterval((()=>this.incrementSourceRefreshVersion()),this.layer.updateInterval)}_doDisconnect(){this.getWorker().then((e=>e.streamMessenger.disconnect())),this._doPause()}_doConnect(){this.getWorker().then((e=>e.streamMessenger.connect())),this.resume()}_doClear(){this.getWorker().then((e=>e.streamMessenger.clear())),null==this._refreshInterval&&this.incrementSourceRefreshVersion()}_createClientOptions(){const e=super._createClientOptions(),r=this;return{...e,get container(){return r.featureContainer},setProperty:e=>{this.set(e.propertyName,e.value)}}}};e([o()],p.prototype,"pipelineConnectionStatus",void 0),e([o()],p.prototype,"pipelineErrorString",void 0),e([o({readOnly:!0})],p.prototype,"connectionError",null),e([o({readOnly:!0})],p.prototype,"_streamConnectionStatus",null),p=e([i("esri.views.2d.layers.StreamLayerView2D")],p);const d=p;export{d as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{handlesGroup as t,makeHandle as s}from"../../../core/handleUtils.js";import{watch as n}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import a from"../../../rest/support/FeatureSet.js";import{isNumber as c}from"../../../support/guards.js";import l from"./FeatureLayerView2D.js";import{handleNoEngineError as h}from"./support/handleNoEngineError.js";import u from"../../layers/StreamLayerView.js";let p=class extends(u(l)){constructor(){super(...arguments),this.pipelineConnectionStatus="disconnected",this.pipelineErrorString=null}initialize(){this.addHandles([n((()=>this.layer.customParameters),(async e=>{(await this.getWorker()).streamMessenger.updateCustomParameters(e)})),this.layer.on("send-message-to-socket",(async e=>{(await this.getWorker()).streamMessenger.sendMessageToSocket(e)})),this.layer.on("send-message-to-client",(async e=>{(await this.getWorker()).streamMessenger.sendMessageToClient(e),this._isUserPaused&&"type"in e&&"clear"===e.type&&this.incrementSourceRefreshVersion()})),n((()=>this.layer.purgeOptions),(()=>this._update())),n((()=>this.suspended),this._onSuspendedChange.bind(this))],"constructor"),this._doResume()}destroy(){this._doPause()}get connectionError(){return this.pipelineErrorString?new r("stream-controller",this.pipelineErrorString):null}on(e,r){if(Array.isArray(e))return t(e.map((e=>this.on(e,r))));const n=["data-received","message-received"].includes(e);n&&this.getWorker().then((r=>r.streamMessenger.enableEvent(e,!0)));const o=super.on(e,r),i=this;return s((()=>{o.remove(),n&&(i._workerProxy.closed||i.hasEventListener(e)||i.getWorker().then((r=>r.streamMessenger.enableEvent(e,!1))))}))}async queryLatestObservations(e,t){if(!(this.layer.timeInfo?.endField||this.layer.timeInfo?.startField||this.layer.timeInfo?.trackIdField))throw new r("streamlayer-no-timeField","queryLatestObservation can only be used with services that define a TrackIdField");const s=await this.getWorker();return h(s.features.executeQueryForLatestObservations(this._cleanUpQuery(e),t).then((e=>{const r=a.fromJSON(e);return r.features.forEach((e=>{e.layer=this.layer,e.sourceLayer=this.layer})),r})),new a({features:[]}))}detach(){super.detach(),this.pipelineConnectionStatus="disconnected"}async queryObjectIds(e,r){return(await super.queryObjectIds(e,r)).filter(c)}get _streamConnectionStatus(){return this.pipelineConnectionStatus}_doPause(){null!=this._refreshInterval&&(clearInterval(this._refreshInterval),this._refreshInterval=null)}_doResume(){null==this._refreshInterval&&(this._refreshInterval=setInterval((()=>this.incrementSourceRefreshVersion()),this.layer.updateInterval))}_doDisconnect(){this.getWorker().then((e=>e.streamMessenger.disconnect())),this._doPause()}_doConnect(){this.getWorker().then((e=>e.streamMessenger.connect())),this.resume()}_doClear(){this.getWorker().then((e=>e.streamMessenger.clear())),null==this._refreshInterval&&this.incrementSourceRefreshVersion()}_createClientOptions(){const e=super._createClientOptions(),r=this;return{...e,get container(){return r.featureContainer},setProperty:e=>{this.set(e.propertyName,e.value)}}}};e([o()],p.prototype,"pipelineConnectionStatus",void 0),e([o()],p.prototype,"pipelineErrorString",void 0),e([o({readOnly:!0})],p.prototype,"connectionError",null),e([o({readOnly:!0})],p.prototype,"_streamConnectionStatus",null),p=e([i("esri.views.2d.layers.StreamLayerView2D")],p);const d=p;export{d 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/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{create as e}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ChapmanApproximationParameters as r}from"./ChapmanApproximation.glsl.js";import{C as o}from"../../../chunks/ChapmanAtmosphere.glsl.js";import{ReloadableShaderModule as s}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{BlendFactor as i,CompareFunction as n}from"../../webgl/enums.js";import{makePipelineState as a,keepSourceValues as l,simpleBlendingParams as m,defaultColorWrite as c}from"../../webgl/renderState.js";class p extends r{constructor(){super(...arguments),this.innerFadeDistance=0,this.altitudeFade=0,this.backgroundColor=e()}}class d extends t{constructor(e,r){super(e,r,new s(o,(()=>import("./ChapmanAtmosphere.glsl.js"))))}initializePipeline(e){return a({blending:e.reduced?l:m(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA),depthTest:{func:e.reduced?n.ALWAYS:n.LEQUAL},colorWrite:c})}}export{p as ChapmanAtmospherePassParameters,d as ChapmanAtmosphereTechnique};
5
+ import{create as e}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ChapmanApproximationParameters as r}from"./ChapmanApproximation.glsl.js";import{C as o}from"../../../chunks/ChapmanAtmosphere.glsl.js";import{ReloadableShaderModule as s}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{BlendFactor as i,CompareFunction as n}from"../../webgl/enums.js";import{makePipelineState as a,copySource as l,simpleBlendingParams as m,defaultColorWrite as c}from"../../webgl/renderState.js";class p extends r{constructor(){super(...arguments),this.innerFadeDistance=0,this.altitudeFade=0,this.backgroundColor=e()}}class d extends t{constructor(e,r){super(e,r,new s(o,(()=>import("./ChapmanAtmosphere.glsl.js"))))}initializePipeline(e){return a({blending:e.reduced?l:m(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA),depthTest:{func:e.reduced?n.ALWAYS:n.LEQUAL},colorWrite:c})}}export{p as ChapmanAtmospherePassParameters,d as ChapmanAtmosphereTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{a as e}from"../../../chunks/NoiseTextureAtlas.glsl.js";import{NoiseTextureRenderMode as r}from"./NoiseTextureAtlasConfiguration.js";import{ReloadableShaderModule as o}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as s}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{BlendFactor as i,CompareFunction as t}from"../../webgl/enums.js";import{makePipelineState as l,keepSourceValues as n,separateBlendingParams as a,defaultColorWrite as m}from"../../webgl/renderState.js";class u extends s{constructor(r,s){super(r,s,new o(e,(()=>import("./NoiseTextureAtlas.glsl.js"))))}initializePipeline(e){return l({blending:e.mode===r.Full?n:a(i.ZERO,i.ONE,i.ONE,i.ZERO),depthTest:{func:t.ALWAYS},colorWrite:m})}}export{u as NoiseTextureAtlasTechnique};
5
+ import{a as e}from"../../../chunks/NoiseTextureAtlas.glsl.js";import{NoiseTextureRenderMode as r}from"./NoiseTextureAtlasConfiguration.js";import{ReloadableShaderModule as o}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as s}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{BlendFactor as i,CompareFunction as t}from"../../webgl/enums.js";import{makePipelineState as l,copySource as n,separateBlendingParams as a,defaultColorWrite as m}from"../../webgl/renderState.js";class u extends s{constructor(r,s){super(r,s,new o(e,(()=>import("./NoiseTextureAtlas.glsl.js"))))}initializePipeline(e){return l({blending:e.mode===r.Full?n:a(i.ZERO,i.ONE,i.ONE,i.ZERO),depthTest:{func:t.ALWAYS},colorWrite:m})}}export{u as NoiseTextureAtlasTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{P as e}from"../../../chunks/Precipitation.glsl.js";import{ReloadableShaderModule as r}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{VertexAttribute as t}from"../webgl-engine/lib/VertexAttribute.js";import{CompareFunction as s}from"../../webgl/enums.js";import{NoParameters as o}from"../../webgl/NoParameters.js";import{makePipelineState as n,blendWithPremultipliedAlpha as l,defaultColorWrite as a}from"../../webgl/renderState.js";class m extends o{constructor(){super(...arguments),this.time=0,this.radius=1,this.width=500,this.opacity=0}}class c extends i{constructor(i,s){super(i,s,new r(e,(()=>import("./Precipitation.glsl.js"))),new Map([[t.POSITION,0],[t.INSTANCEFEATUREATTRIBUTE,1]]))}initializePipeline(){return n({blending:l,depthTest:{func:s.LEQUAL},colorWrite:a})}}export{m as PrecipitationPassParameters,c as PrecipitationTechnique};
5
+ import{P as e}from"../../../chunks/Precipitation.glsl.js";import{ReloadableShaderModule as r}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{VertexAttribute as t}from"../webgl-engine/lib/VertexAttribute.js";import{CompareFunction as s}from"../../webgl/enums.js";import{NoParameters as o}from"../../webgl/NoParameters.js";import{makePipelineState as n,premultipliedAlpha as l,defaultColorWrite as a}from"../../webgl/renderState.js";class m extends o{constructor(){super(...arguments),this.time=0,this.radius=1,this.width=500,this.opacity=0}}class c extends i{constructor(i,s){super(i,s,new r(e,(()=>import("./Precipitation.glsl.js"))),new Map([[t.POSITION,0],[t.INSTANCEFEATUREATTRIBUTE,1]]))}initializePipeline(){return n({blending:l,depthTest:{func:s.LEQUAL},colorWrite:a})}}export{m as PrecipitationPassParameters,c as PrecipitationTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{a as e}from"../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereGeometry as r}from"./SimpleAtmosphereTechniqueConfiguration.js";import{ReloadableShaderModule as o}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{CompareFunction as n}from"../../webgl/enums.js";import{makePipelineState as s,premultipliedAlphaToPremultipliedAlpha as t,backFaceCullingParams as l,defaultColorWrite as m}from"../../webgl/renderState.js";class p extends i{constructor(r,i){super(r,i,new o(e,(()=>import("./SimpleAtmosphere.glsl.js"))))}initializePipeline(e){const o=e.geometry===r.Cylinder;return s({blending:t,culling:o?l:void 0,depthTest:{func:n.LEQUAL},colorWrite:m})}}export{p as SimpleAtmosphereTechnique};
5
+ import{a as e}from"../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereGeometry as r}from"./SimpleAtmosphereTechniqueConfiguration.js";import{ReloadableShaderModule as o}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{CompareFunction as n}from"../../webgl/enums.js";import{makePipelineState as s,unpremultipliedAlphaToPremultipliedAlpha as t,backFaceCullingParams as l,defaultColorWrite as m}from"../../webgl/renderState.js";class p extends i{constructor(r,i){super(r,i,new o(e,(()=>import("./SimpleAtmosphere.glsl.js"))))}initializePipeline(e){const o=e.geometry===r.Cylinder;return s({blending:t,culling:o?l:void 0,depthTest:{func:n.LEQUAL},colorWrite:m})}}export{p as SimpleAtmosphereTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{forEach as t,result as r}from"../../../core/asyncUtils.js";import{makeHandle as i}from"../../../core/handleUtils.js";import a from"../../../core/Logger.js";import{abortMaybe as s}from"../../../core/maybe.js";import{isAbortError as o,onAbort as n,isAborted as l,createAbortError as m,throwIfAborted as h}from"../../../core/promiseUtils.js";import{whenOnce as g}from"../../../core/reactiveUtils.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import c from"../../../geometry/Extent.js";import{create as u,equals as p,width as f,height as w,copy as x,intersection as y}from"../../../geometry/support/aaBoundingRect.js";import{DrapeSourceType as _}from"./interfaces.js";import b from"./SubView3D.js";import{computeImageExportSize as E,createGeometryForExtent as R,createOuterImageGeometry as v}from"./support/overlayImageUtils.js";import{debugFlags as j}from"../support/debugFlags.js";import{OverlayIndex as S}from"../terrain/interfaces.js";import{DirtyOperation as A}from"../webgl-engine/lib/ModelDirtyTypes.js";import{RenderGeometry as I}from"../webgl-engine/lib/RenderGeometry.js";import{Texture as M}from"../webgl-engine/lib/Texture.js";import{UpdatePolicy as D}from"../webgl-engine/lib/UpdatePolicy.js";import{ImageMaterial as G}from"../webgl-engine/materials/ImageMaterial.js";import{TextureWrapMode as T}from"../../webgl/enums.js";let P=class extends b{constructor(e){super(e),this.drapeSourceType=_.RasterImage,this.updatePolicy=D.SYNC,this.maximumDataResolution=null,this._images=new Array,this._extents=new Array,this._overlays=new Array,this._drapeSourceRenderer=null}initialize(){this._drapeSourceRenderer=this.view.basemapTerrain.overlayManager.registerGeometryDrapeSource(this),this.addHandles(i((()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this))))}setDrapingExtent(e,t){this._spatialReference=t,e.forEach(((e,t)=>{this._overlays[t]=e,this._updateImageExtent(e,t)}))}destroy(){}get spatialReference(){return this._spatialReference}_updateImageExtent(e,t){const r=this._clippedExtent(e.extent,O);if(null==r)return;const i=E(e.extent,r,e.resolution);let s=e.pixelRatio*this.view.state.pixelRatio;const{layer:n}=this;if("imageMaxWidth"in n&&null!=n.imageMaxWidth||"imageMaxHeight"in n&&null!=n.imageMaxHeight){const e=n.imageMaxWidth,t=n.imageMaxHeight;if(i.width>e){const t=e/i.width;i.height=Math.floor(i.height*t),i.width=e,s*=t}if(i.height>t){const e=t/i.height;i.width=Math.floor(i.width*e),i.height=t,s*=e}}const l=this._extents[t];l&&p(l.extent,r)&&this._imageSizeEquals(r,l.imageSize,i)||(this._extents[t]={extent:u(r),imageSize:i,pixelRatio:s},this.suspended||this._fetch(t).catch((e=>{o(e)||a.getLogger(this).error(e)})))}clear(){for(let e=0;e<this._images.length;e++)this._clearImage(e)}async doRefresh(e){const t=[];for(let r=0;r<this._extents.length;r++)this._extents[r]&&t.push(this._fetch(r,e));await Promise.allSettled(t)}async processResult(e,t,r){(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement)&&(e.image=t)}findExtentInfoAt(e){for(const t of this._extents){const r=t.extent;if(new c(r[0],r[1],r[2],r[3],this._spatialReference).contains(e))return t}return null}async redraw(e,r){await t(this._images,(async(t,i)=>{t&&(await e(t,r),await this._createStageObjects(i,t.image,r))}))}_imageSizeEquals(e,t,r){if(!this.maximumDataResolution)return!1;const i=f(e)/this.maximumDataResolution.x,a=w(e)/this.maximumDataResolution.y,s=i/t.width,o=a/t.height,n=i/r.width,l=a/r.height,m=Math.abs(s-n),h=Math.abs(o-l),g=j.TESTS_DISABLE_OPTIMIZATIONS?0:1.5;return m<=g&&h<=g}async _fetch(e,t){if(this.suspended)return;const r=this._extents[e],i=r.extent;this._images[e]||(this._images[e]={texture:null,material:null,renderGeometry:null,loadingPromise:null,loadingAbortController:null,image:null,pixelData:null,renderExtent:u(i)});const g=this._images[e];g.loadingAbortController=s(g.loadingAbortController);const d=new c(i[0],i[1],i[2],i[3],this._spatialReference);if(0===d.width||0===d.height)return void this._clearImage(e);const p=new AbortController;g.loadingAbortController=p,n(t,(()=>p.abort()));const f=p.signal,w=this._waitFetchReady(f).then((async()=>{const t={requestAsImageElement:!0,pixelRatio:this._overlays[e].pixelRatio,...this.layerView.getFetchOptions(),signal:f},{height:i,width:a}=r.imageSize;return this.layer?"imagery"===this.layer.type?this.layer.internalFetchImage(d,a,i,t):this.layer.fetchImage(d,a,i,t):null})).then((e=>{if(l(f))throw a.getLogger(this).warnOnce("A call to fetchImage resolved even though the request was aborted. fetchImage should not resolve if options.signal.aborted is true."),m();return this.processResult(g,e)})).then((()=>{x(g.renderExtent,i)}));g.loadingPromise=w,await this.updatingHandles.addPromise(w.then((async()=>{h(f),await this._createStageObjects(e,g.image,f)})).catch((e=>{throw e&&!o(e)&&a.getLogger(this).error(e),e})).finally((()=>{w===g.loadingPromise&&(g.loadingPromise=null,g.loadingAbortController=null)})))}_clearImage(e){const t=this._images[e];if(t){null!=t.renderGeometry&&(this._drapeSourceRenderer.removeGeometries([t.renderGeometry],A.UPDATE),t.renderGeometry=null);const e=this.view.stage,r=t.texture;r?.unload(),e.remove(r),t.texture=null,e.remove(t.material),t.material=null,t.loadingAbortController=s(t.loadingAbortController),t.loadingPromise=null,t.image=null,t.pixelData=null}}async _createStageObjects(e,t,i){const a=this.view.stage,s=this._images[e],o=()=>{s.texture?.unload(),a.remove(s.texture),s.texture=null,s.renderGeometry&&(this._drapeSourceRenderer.removeGeometries([s.renderGeometry],A.UPDATE),s.renderGeometry=null)};if(t){const n=new M(t,{width:t.width,height:t.height,preMultiplyAlpha:!0,wrap:{s:T.CLAMP_TO_EDGE,t:T.CLAMP_TO_EDGE}});if(await r(this._images[e===S.INNER?S.OUTER:S.INNER].loadingPromise),h(i),o(),await a.schedule((()=>n.load(a.renderView.renderingContext)),i),!n.loaded)return void o();let l;if(a.add(n),s.texture=n,s.material??=new G({draped:!0,texture:n}),s.material.setParameters({texture:n}),e===S.INNER)l=R(s.material,s.renderExtent);else{const e=this._images[0].renderExtent;if(!e)return void o();l=v(s.material,e,s.renderExtent)}s.renderGeometry=new I(l),s.renderGeometry.localOrigin=this._overlays[e].renderLocalOrigin,this._drapeSourceRenderer.addGeometries([s.renderGeometry],A.UPDATE)}else o(),a.remove(s.material),s.material=null}_clippedExtent(e,t){if("local"!==this.view.viewingMode)return x(t,e);const r=this.view.basemapTerrain;return r.ready?y(e,r.extent,t):x(t,e)}async _waitFetchReady(e){await g((()=>this.view.stationary),e),h(e)}};P=e([d("esri.views.3d.layers.DrapedSubView3D")],P);const C=P,O=u();export{C as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{forEach as t,result as r}from"../../../core/asyncUtils.js";import{makeHandle as i}from"../../../core/handleUtils.js";import a from"../../../core/Logger.js";import{abortMaybe as s}from"../../../core/maybe.js";import{isAbortError as o,onAbort as n,throwIfAborted as l,isAborted as m,createAbortError as h}from"../../../core/promiseUtils.js";import{whenOnce as g}from"../../../core/reactiveUtils.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import c from"../../../geometry/Extent.js";import{create as u,equals as p,width as f,height as w,copy as x,intersection as y}from"../../../geometry/support/aaBoundingRect.js";import{DrapeSourceType as _}from"./interfaces.js";import b from"./SubView3D.js";import{computeImageExportSize as E,createGeometryForExtent as R,createOuterImageGeometry as v}from"./support/overlayImageUtils.js";import{debugFlags as j}from"../support/debugFlags.js";import{OverlayIndex as S}from"../terrain/interfaces.js";import{DirtyOperation as A}from"../webgl-engine/lib/ModelDirtyTypes.js";import{RenderGeometry as I}from"../webgl-engine/lib/RenderGeometry.js";import{Texture as M}from"../webgl-engine/lib/Texture.js";import{UpdatePolicy as D}from"../webgl-engine/lib/UpdatePolicy.js";import{ImageMaterial as G}from"../webgl-engine/materials/ImageMaterial.js";import{TextureWrapMode as T}from"../../webgl/enums.js";let P=class extends b{constructor(e){super(e),this.drapeSourceType=_.RasterImage,this.updatePolicy=D.SYNC,this.maximumDataResolution=null,this._images=new Array,this._extents=new Array,this._overlays=new Array,this._drapeSourceRenderer=null}initialize(){this._drapeSourceRenderer=this.view.basemapTerrain.overlayManager.registerGeometryDrapeSource(this),this.addHandles(i((()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this))))}setDrapingExtent(e,t){this._spatialReference=t,e.forEach(((e,t)=>{this._overlays[t]=e,this._updateImageExtent(e,t)}))}destroy(){this.clear()}get spatialReference(){return this._spatialReference}_updateImageExtent(e,t){const r=this._clippedExtent(e.extent,O);if(null==r)return;const i=E(e.extent,r,e.resolution);let s=e.pixelRatio*this.view.state.pixelRatio;const{layer:n}=this;if("imageMaxWidth"in n&&null!=n.imageMaxWidth||"imageMaxHeight"in n&&null!=n.imageMaxHeight){const e=n.imageMaxWidth,t=n.imageMaxHeight;if(i.width>e){const t=e/i.width;i.height=Math.floor(i.height*t),i.width=e,s*=t}if(i.height>t){const e=t/i.height;i.width=Math.floor(i.width*e),i.height=t,s*=e}}const l=this._extents[t];l&&p(l.extent,r)&&this._imageSizeEquals(r,l.imageSize,i)||(this._extents[t]={extent:u(r),imageSize:i,pixelRatio:s},this.suspended||this._fetch(t).catch((e=>{o(e)||a.getLogger(this).error(e)})))}clear(){for(let e=0;e<this._images.length;e++)this._clearImage(e)}async doRefresh(e){const t=[];for(let r=0;r<this._extents.length;r++)this._extents[r]&&t.push(this._fetch(r,e));await Promise.allSettled(t)}async processResult(e,t,r){(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement)&&(e.image=t)}findExtentInfoAt(e){for(const t of this._extents){const r=t.extent;if(new c(r[0],r[1],r[2],r[3],this._spatialReference).contains(e))return t}return null}async redraw(e,r){await t(this._images,(async(t,i)=>{t&&(await e(t,r),await this._createStageObjects(i,t.image,r))}))}_imageSizeEquals(e,t,r){if(!this.maximumDataResolution)return!1;const i=f(e)/this.maximumDataResolution.x,a=w(e)/this.maximumDataResolution.y,s=i/t.width,o=a/t.height,n=i/r.width,l=a/r.height,m=Math.abs(s-n),h=Math.abs(o-l),g=j.TESTS_DISABLE_OPTIMIZATIONS?0:1.5;return m<=g&&h<=g}async _fetch(e,t){if(this.suspended)return;const r=this._extents[e],i=r.extent;this._images[e]||(this._images[e]={texture:null,material:null,renderGeometry:null,loadingPromise:null,loadingAbortController:null,image:null,pixelData:null,renderExtent:u(i)});const g=this._images[e];g.loadingAbortController=s(g.loadingAbortController);const d=new c(i[0],i[1],i[2],i[3],this._spatialReference);if(0===d.width||0===d.height)return void this._clearImage(e);const p=new AbortController;g.loadingAbortController=p,n(t,(()=>p.abort()));const f=p.signal,w=this._waitFetchReady(f).then((async()=>{l(f);const t={requestAsImageElement:!0,pixelRatio:this._overlays[e].pixelRatio,...this.layerView.getFetchOptions(),signal:f},{height:i,width:a}=r.imageSize;return this.layer?"imagery"===this.layer.type?this.layer.internalFetchImage(d,a,i,t):this.layer.fetchImage(d,a,i,t):null})).then((e=>{if(m(f))throw a.getLogger(this).warnOnce("A call to fetchImage resolved even though the request was aborted. fetchImage should not resolve if options.signal.aborted is true."),h();return this.processResult(g,e)})).then((()=>{x(g.renderExtent,i)}));g.loadingPromise=w,await this.updatingHandles.addPromise(w.then((async()=>{l(f),await this._createStageObjects(e,g.image,f)})).catch((e=>{throw e&&!o(e)&&a.getLogger(this).error(e),e})).finally((()=>{w===g.loadingPromise&&(g.loadingPromise=null,g.loadingAbortController=null)})))}_clearImage(e){const t=this._images[e];if(t){null!=t.renderGeometry&&(this._drapeSourceRenderer.removeGeometries([t.renderGeometry],A.UPDATE),t.renderGeometry=null);const e=this.view.stage,r=t.texture;r?.unload(),e.remove(r),t.texture=null,e.remove(t.material),t.material=null,t.loadingAbortController=s(t.loadingAbortController),t.loadingPromise=null,t.image=null,t.pixelData=null}}async _createStageObjects(e,t,i){const a=this.view.stage,s=this._images[e],o=()=>{s.texture?.unload(),a.remove(s.texture),s.texture=null,s.renderGeometry&&(this._drapeSourceRenderer.removeGeometries([s.renderGeometry],A.UPDATE),s.renderGeometry=null)};if(t){const n=new M(t,{width:t.width,height:t.height,preMultiplyAlpha:!0,wrap:{s:T.CLAMP_TO_EDGE,t:T.CLAMP_TO_EDGE}});if(await r(this._images[e===S.INNER?S.OUTER:S.INNER].loadingPromise),l(i),o(),await a.schedule((()=>n.load(a.renderView.renderingContext)),i),!n.loaded)return void o();let m;if(a.add(n),s.texture=n,s.material??=new G({draped:!0,texture:n}),s.material.setParameters({texture:n}),e===S.INNER)m=R(s.material,s.renderExtent);else{const e=this._images[0].renderExtent;if(!e)return void o();m=v(s.material,e,s.renderExtent)}s.renderGeometry=new I(m),s.renderGeometry.localOrigin=this._overlays[e].renderLocalOrigin,this._drapeSourceRenderer.addGeometries([s.renderGeometry],A.UPDATE)}else o(),a.remove(s.material),s.material=null}_clippedExtent(e,t){if("local"!==this.view.viewingMode)return x(t,e);const r=this.view.basemapTerrain;return r.ready?y(e,r.extent,t):x(t,e)}async _waitFetchReady(e){await g((()=>this.view.stationary),e),l(e)}};P=e([d("esri.views.3d.layers.DrapedSubView3D")],P);const C=P,O=u();export{C as default};