@arcgis/core 5.0.0-next.16 → 5.0.0-next.17

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 (182) hide show
  1. package/analysis/ElevationProfile/ElevationProfileLineInput.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/234b52b2a391631ceff6.js +1 -0
  4. package/assets/esri/core/workers/chunks/{8f3503b2fb6cd38757b9.js → 458e87902abc24b375da.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{57b410198d83bf0ab708.js → 4a89e120be142ab58a27.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{a410dcf80d17a2383337.js → 65a4099bdbe31834d0cc.js} +1 -1
  7. package/assets/esri/core/workers/chunks/722da7a39a0ad9300752.js +1 -0
  8. package/assets/esri/core/workers/chunks/{cdb4664fd59860ddeb5a.js → 888f188541f8bd68e33e.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{319c3f46f2afb8f3e5a9.js → 89c9cf7f799858d14c76.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{e19cd07df8ce87e18832.js → 8b33732e3c2924c1f60d.js} +1 -1
  11. package/assets/esri/core/workers/chunks/98739414c107ad78e4d8.js +1 -0
  12. package/assets/esri/core/workers/chunks/{bc318b6fef192cee2a72.js → a4518f25b9f8fe704286.js} +17 -17
  13. package/assets/esri/core/workers/chunks/{8b73db0f4d6714396eb0.js → a6fa90eab77ac0e1cdfc.js} +1 -1
  14. package/assets/esri/core/workers/chunks/ac366221e8636b60aee5.js +1 -0
  15. package/assets/esri/core/workers/chunks/{23e17b745adf71a5efc7.js → aca72ca7f43f70eb8077.js} +1 -1
  16. package/assets/esri/core/workers/chunks/ad0c7225941437d18408.js +1 -0
  17. package/assets/esri/core/workers/chunks/b30897952494a3e5b9fe.js +1 -0
  18. package/assets/esri/core/workers/chunks/bfd3d81e8e148be99686.js +1 -0
  19. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  20. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  21. package/assets/esri/themes/base/widgets/_Editor.scss +2 -1
  22. package/assets/esri/themes/base/widgets/_FeatureForm.scss +1 -1
  23. package/assets/esri/themes/dark/main.css +1 -1
  24. package/assets/esri/themes/light/main.css +1 -1
  25. package/assets/esri/themes/light/view.css +1 -1
  26. package/chunks/GaussianSplat.glsl.js +2 -2
  27. package/chunks/lyr3DMain.js +1 -1
  28. package/config.js +1 -1
  29. package/graphic/graphicOriginUtils.js +1 -1
  30. package/interfaces.d.ts +66 -26
  31. package/kernel.js +1 -1
  32. package/layers/BingMapsLayer.js +1 -1
  33. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  34. package/layers/support/attributionUtils.js +5 -0
  35. package/layers/support/fieldConfigUtils.js +1 -1
  36. package/layers/support/fieldFormatUtils.js +1 -1
  37. package/layers/video/VideoController.js +1 -1
  38. package/libs/parquet/parquet.js +1 -1
  39. package/package.json +1 -1
  40. package/support/revision.js +1 -1
  41. package/symbols/cim/SDFHelper.js +1 -1
  42. package/symbols/cim/cimAnalyzer.js +1 -1
  43. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  44. package/views/2d/engine/flow/dataUtils.js +1 -1
  45. package/views/2d/engine/webgl/TextureManager.js +1 -1
  46. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedPolyShader.js +1 -1
  47. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
  48. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +1 -1
  49. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
  50. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  51. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  52. package/views/2d/layers/features/Processor.js +1 -1
  53. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  54. package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
  55. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  56. package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
  57. package/views/3d/analysis/ElevationProfile/ElevationProfileGeometryVisualization3D.js +1 -1
  58. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  59. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  60. package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
  61. package/views/3d/environment/CloudsCompositionTechnique.js +1 -1
  62. package/views/3d/environment/CloudsTechnique.js +1 -1
  63. package/views/3d/environment/FogTechnique.js +1 -1
  64. package/views/3d/environment/NoiseTextureAtlasTechnique.js +1 -1
  65. package/views/3d/environment/PrecipitationTechnique.js +1 -1
  66. package/views/3d/environment/SimpleAtmosphereTechnique.js +1 -1
  67. package/views/3d/layers/FlowSubView3D.js +1 -1
  68. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  69. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  70. package/views/3d/layers/TiledLayerView3D.js +1 -1
  71. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  72. package/views/3d/support/DisplayQualityProfile.js +1 -1
  73. package/views/3d/support/QualitySettings.js +1 -1
  74. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  75. package/views/3d/support/flow/FlowWorker.js +1 -1
  76. package/views/3d/support/flow/FlowWorkerHandle.js +1 -1
  77. package/views/3d/support/flow/StreamlineResources3D.js +1 -1
  78. package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
  79. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  80. package/views/3d/support/flow/constants.js +1 -1
  81. package/views/3d/support/flow/loadUtils.js +1 -1
  82. package/views/3d/support/popupHitTest.js +1 -1
  83. package/views/3d/terrain/BlendLayersTechnique.js +1 -1
  84. package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
  85. package/views/3d/terrain/TerrainSurface.js +1 -1
  86. package/views/3d/terrain/TileAgent.js +1 -1
  87. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  88. package/views/3d/webgl-engine/core/shaderTechnique/{ReloadableShaderModule.js → ReloadableShader.js} +1 -1
  89. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  90. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
  91. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskTechnique.js +1 -1
  92. package/views/3d/webgl-engine/effects/glow/GlowBlurTechnique.js +1 -1
  93. package/views/3d/webgl-engine/effects/glow/GlowCompositionTechnique.js +1 -1
  94. package/views/3d/webgl-engine/effects/haze/HazeCompositingTechnique.js +1 -1
  95. package/views/3d/webgl-engine/effects/haze/HazeTechnique.js +1 -1
  96. package/views/3d/webgl-engine/effects/highlight/HighlightApplyTechnique.js +1 -1
  97. package/views/3d/webgl-engine/effects/highlight/HighlightBlurTechnique.js +1 -1
  98. package/views/3d/webgl-engine/effects/highlight/HighlightDownsampleTechnique.js +1 -1
  99. package/views/3d/webgl-engine/effects/highlight/HighlightToSingleTechnique.js +1 -1
  100. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
  101. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechnique.js +1 -1
  102. package/views/3d/webgl-engine/effects/laserlines/LaserlineTechnique.js +1 -1
  103. package/views/3d/webgl-engine/effects/magnifier/MagnifierTechnique.js +1 -1
  104. package/views/3d/webgl-engine/effects/smaa/SMAABlendWeightsTechnique.js +1 -1
  105. package/views/3d/webgl-engine/effects/smaa/SMAABlurTechnique.js +1 -1
  106. package/views/3d/webgl-engine/effects/smaa/SMAAEdgeDetectTechnique.js +1 -1
  107. package/views/3d/webgl-engine/effects/ssao/SSAOBlurTechnique.js +1 -1
  108. package/views/3d/webgl-engine/effects/ssao/SSAOTechnique.js +1 -1
  109. package/views/3d/webgl-engine/effects/stars/StarsTechnique.js +1 -1
  110. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
  111. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  112. package/views/3d/webgl-engine/lib/Program.js +1 -1
  113. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  114. package/views/3d/webgl-engine/lib/TextureTechnique.js +1 -1
  115. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
  116. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  117. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  118. package/views/3d/webgl-engine/shaders/AtmosphereCompositingTechnique.js +1 -1
  119. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  120. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  121. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  122. package/views/3d/webgl-engine/shaders/CutFillCompositionTechnique.js +1 -1
  123. package/views/3d/webgl-engine/shaders/CutFillDepthTechnique.js +1 -1
  124. package/views/3d/webgl-engine/shaders/CutFillMaskTechnique.js +1 -1
  125. package/views/3d/webgl-engine/shaders/CutFillReductionTechnique.js +1 -1
  126. package/views/3d/webgl-engine/shaders/CutFillTargetDepthTechnique.js +1 -1
  127. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  128. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  129. package/views/3d/webgl-engine/shaders/GaussianSplatCompositionTechnique.js +1 -1
  130. package/views/3d/webgl-engine/shaders/GaussianSplatDepthCompositionTechnique.js +1 -1
  131. package/views/3d/webgl-engine/shaders/GaussianSplatDepthTechnique.js +1 -1
  132. package/views/3d/webgl-engine/shaders/GaussianSplatTechnique.js +1 -1
  133. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  134. package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +1 -1
  135. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  136. package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
  137. package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
  138. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  139. package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
  140. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  141. package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
  142. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  143. package/views/3d/webgl-engine/shaders/OverlayCompositingTechnique.js +1 -1
  144. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  145. package/views/3d/webgl-engine/shaders/PointRendererTechnique.js +1 -1
  146. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  147. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  148. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  149. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
  150. package/views/3d/webgl-engine/shaders/ShadowCastClearTechnique.js +1 -1
  151. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
  152. package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
  153. package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
  154. package/views/3d/webgl-engine/shaders/ViewshedTechnique.js +1 -1
  155. package/views/SceneView.js +1 -1
  156. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  157. package/views/analysis/ElevationProfile/types.d.ts +5 -0
  158. package/views/analysis/ElevationProfile/types.js +5 -0
  159. package/views/webgl/VertexAttributeLocations.js +1 -1
  160. package/widgets/Attribution/AttributionViewModel.js +1 -1
  161. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  162. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  163. package/widgets/Editor/UpdateWorkflow.js +1 -1
  164. package/widgets/Editor/Workflow.js +1 -1
  165. package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
  166. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  167. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  168. package/widgets/Editor.js +1 -1
  169. package/widgets/Feature/support/featureUtils.js +1 -1
  170. package/widgets/FeatureTable/FieldColumn.js +1 -1
  171. package/widgets/FeatureTable/Grid/Column.js +1 -1
  172. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  173. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  174. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  175. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  176. package/assets/esri/core/workers/chunks/38ee69125da60464d5a1.js +0 -1
  177. package/assets/esri/core/workers/chunks/4f0016111fd84c612f41.js +0 -1
  178. package/assets/esri/core/workers/chunks/8208dfa8f7fae7e616b9.js +0 -1
  179. package/assets/esri/core/workers/chunks/847f4fc39100fac1df01.js +0 -1
  180. package/assets/esri/core/workers/chunks/ab005fe84952f0676020.js +0 -1
  181. package/assets/esri/core/workers/chunks/bc19a232076d98825eef.js +0 -1
  182. package/assets/esri/core/workers/chunks/c3dcfe26c2c3c829762d.js +0 -1
@@ -2,6 +2,6 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{ZEROS as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{ZEROS as n}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{terrainDepthTest as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{ComputeCovariance as i}from"../views/3d/webgl-engine/core/shaderLibrary/util/ComputeCovariance.glsl.js";import{FastApproximateTrigonometry as t}from"../views/3d/webgl-engine/core/shaderLibrary/util/FastApproximateTrigonometry.glsl.js";import{GaussianSplatUnpacking as o}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import{QuaternionToRotationMatrix as r}from"../views/3d/webgl-engine/core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import{Float2PassUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float3BindUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{Float3PassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as u,If as p}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{IntegerBindUniform as v}from"../views/3d/webgl-engine/core/shaderModules/IntegerBindUniform.js";import{IntegerPassUniform as m}from"../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{Matrix4BindUniform as h}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DUintPassUniform as f}from"../views/3d/webgl-engine/core/shaderModules/Texture2DUintPassUniform.js";import{NoParameters as g}from"../views/webgl/NoParameters.js";import{ShaderBuilder as x}from"../views/webgl/ShaderBuilder.js";class w extends g{constructor(){super(...arguments),this.totalGaussians=-1,this.focalLength=-1,this.minSplatRadius=-1,this.minSplatOpacity=-1,this.tanFov=e,this.cameraDelta=n,this.cameraPos8k=n}}function y(e){const n=new x;n.varyings.add("vColor","vec4"),n.varyings.add("conicOpacity","vec4"),n.varyings.add("depth","float"),n.varyings.add("gaussianCenterScreenPos","vec2"),n.varyings.add("fragScreenPos","vec2"),n.varyings.add("offsetFromCenter","vec2"),n.outputs.add("fragColor","vec4",0),n.vertex.uniforms.add(new f("splatOrderTexture",e=>e.splatOrder),new f("splatAtlasTexture",e=>e.splatAtlas),new m("numSplats",e=>e.totalGaussians),new d("focalLength",e=>e.focalLength),new d("minSplatRadius",e=>e.minSplatRadius),new d("minSplatOpacity",e=>e.minSplatOpacity),new s("tanFov",e=>e.tanFov),new l("cameraDelta",e=>e.cameraDelta),new l("cameraPos8k",e=>e.cameraPos8k),new v("fullWidth",({camera:e})=>e.viewport[2]),new v("fullHeight",({camera:e})=>e.viewport[3]),new h("proj",e=>e.camera.projectionMatrix),new h("view",e=>e.camera.viewMatrix),new c("cameraPosition",e=>e.camera.eye)),n.vertex.include(o),n.vertex.include(r),n.vertex.include(i),n.vertex.include(t),n.include(a,e);const g=1/255,w=Math.log(g),y=-2*w;n.vertex.code.add(u`float ndcToPixel(float ndcCoord, float screenSize) {
5
+ import{ZEROS as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{ZEROS as n}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{terrainDepthTest as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{ComputeCovariance as i}from"../views/3d/webgl-engine/core/shaderLibrary/util/ComputeCovariance.glsl.js";import{FastApproximateTrigonometry as t}from"../views/3d/webgl-engine/core/shaderLibrary/util/FastApproximateTrigonometry.glsl.js";import{GaussianSplatUnpacking as o}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import{QuaternionToRotationMatrix as r}from"../views/3d/webgl-engine/core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import{Float2PassUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float3BindUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{Float3PassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as u,If as p}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{IntegerBindUniform as v}from"../views/3d/webgl-engine/core/shaderModules/IntegerBindUniform.js";import{IntegerPassUniform as h}from"../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{Matrix4BindUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DUintPassUniform as f}from"../views/3d/webgl-engine/core/shaderModules/Texture2DUintPassUniform.js";import{getGaussianSplatAlphaCutoffValue as g}from"../views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js";import{NoParameters as x}from"../views/webgl/NoParameters.js";import{ShaderBuilder as w}from"../views/webgl/ShaderBuilder.js";class y extends x{constructor(){super(...arguments),this.totalGaussians=-1,this.focalLength=-1,this.minSplatRadius=-1,this.tanFov=e,this.cameraDelta=n,this.cameraPos8k=n}}function b(e){const n=new w;n.varyings.add("vColor","vec4"),n.varyings.add("conicOpacity","vec4"),n.varyings.add("depth","float"),n.varyings.add("gaussianCenterScreenPos","vec2"),n.varyings.add("fragScreenPos","vec2"),n.varyings.add("offsetFromCenter","vec2"),n.outputs.add("fragColor","vec4",0),n.vertex.uniforms.add(new f("splatOrderTexture",e=>e.splatOrder),new f("splatAtlasTexture",e=>e.splatAtlas),new h("numSplats",e=>e.totalGaussians),new d("focalLength",e=>e.focalLength),new d("minSplatRadius",e=>e.minSplatRadius),new s("tanFov",e=>e.tanFov),new l("cameraDelta",e=>e.cameraDelta),new l("cameraPos8k",e=>e.cameraPos8k),new v("fullWidth",({camera:e})=>e.viewport[2]),new v("fullHeight",({camera:e})=>e.viewport[3]),new m("proj",e=>e.camera.projectionMatrix),new m("view",e=>e.camera.viewMatrix),new c("cameraPosition",e=>e.camera.eye)),n.vertex.include(o),n.vertex.include(r),n.vertex.include(i),n.vertex.include(t),n.include(a,e);const x=g(e.alphaCutoff),y=Math.log(x),b=-2*y;n.vertex.code.add(u`float ndcToPixel(float ndcCoord, float screenSize) {
6
6
  return ((ndcCoord + 1.0) * screenSize - 1.0) * 0.5;
7
- }`),n.vertex.main.add(`\n uint instanceID = uint(gl_InstanceID);\n\n // Transform the instanceID into 2D coordinates\n uint orderTextureWidth = uint(textureSize(splatOrderTexture, 0).x);\n uint x = instanceID % orderTextureWidth;\n uint y = instanceID / orderTextureWidth;\n\n // Fetch the index of the remaining frontmost Gaussian\n uint gaussianIndex = texelFetch(splatOrderTexture, ivec2(x, y), 0).r;\n\n uint splatAtlasWidth = uint(textureSize(splatAtlasTexture, 0).x);\n\n // Fetch the packed Gaussian according to the index\n uint gaussianIndexX = gaussianIndex % splatAtlasWidth;\n uint gaussianIndexY = gaussianIndex / splatAtlasWidth;\n uvec4 packedGaussian = texelFetch(splatAtlasTexture, ivec2(gaussianIndexX, gaussianIndexY), 0);\n\n // Fetch the header associated with the packed Gaussian (contains tile origin and number of fractional bits)\n uint pageNum = gaussianIndex / 1024u;\n uint headerIndex = (pageNum + 1u) * 1024u - 1u;\n uint headerIndexX = headerIndex % splatAtlasWidth;\n uint headerIndexY = headerIndex / splatAtlasWidth;\n uvec4 packedHeader = texelFetch(splatAtlasTexture, ivec2(headerIndexX, headerIndexY), 0);\n\n // Unpack the Gaussian\n vColor = unpackColor(packedGaussian);\n // Ignore gaussians with very small contribution, with tolerance based on the quality profile\n if(vColor.a < minSplatOpacity) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n\n vec3 scale = unpackScale(packedGaussian); \n vec4 quaternion = unpackQuaternion(packedGaussian);\n mat3 rotation = quaternionToRotationMatrix(quaternion);\n vec3 tileOriginRelativePosition = unpackTileOriginRelativePosition(packedGaussian);\n\n vec3 cameraRelativePosition = unpackCameraRelativeGaussianPosition(packedHeader, tileOriginRelativePosition, cameraPosition, cameraPos8k, cameraDelta);\n\n vec4 viewPos = vec4(mat3(view) * cameraRelativePosition, 1);\n\n if (viewPos.z > 1.0) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n\n forwardViewPosDepth(viewPos.xyz);\n\n vec3 covarianceA;\n vec3 covarianceB;\n computeCovariance3D(rotation, scale.xyz, covarianceA, covarianceB);\n\n float covariance3D[6] = float[6](covarianceA.x, covarianceA.y, covarianceA.z, covarianceB.x, covarianceB.y, covarianceB.z);\n\n vec3 covariance2D = computeCovariance2D(viewPos.xyz, focalLength, tanFov, covariance3D, view);\n \n // Invert covariance (EWA algorithm)\n float determinant = (covariance2D.x * covariance2D.z - covariance2D.y * covariance2D.y);\n if (determinant == 0.) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n float invDeterminant = 1. / determinant;\n \n\n vec4 projPos = proj * viewPos;\n float invW = 1. / (projPos.w + 1e-7);\n vec3 ndcPos = projPos.xyz * invW;\n\n // Compute extent in screen space (by finding the eigenvalues of the 2D covariance matrix). \n // Use the extent to compute the bounding rectangle of the Gaussian in screen space.\n float mid = 0.5 * (covariance2D.x + covariance2D.z);\n float delta = sqrt(max(0.1, mid * mid - determinant));\n float lambda1 = mid + delta;\n float lambda2 = mid - delta;\n // Compute principal radii (a and b)\n float a = sqrt(${y} * lambda1); // Semi-major axis\n float b = sqrt(${y} * lambda2); // Semi-minor axis\n \n // Compute rotation angle phi from covariance\n float delta_angle = covariance2D.x - covariance2D.z;\n float phi = 0.5 * fastAtan2(2.0 * covariance2D.y, delta_angle);\n \n // Compute projected axis-aligned extents\n float cos_phi = fastCos(phi);\n float sin_phi = fastSin(phi);\n float radius_x = ceil(sqrt(a * a * cos_phi * cos_phi + b * b * sin_phi * sin_phi));\n float radius_y = ceil(sqrt(a * a * sin_phi * sin_phi + b * b * cos_phi * cos_phi));\n gaussianCenterScreenPos = vec2(ndcToPixel(ndcPos.x, float(fullWidth)), ndcToPixel(ndcPos.y, float(fullHeight)));\n\n // Ignore gaussians with very small contribution, with tolerance based on the quality profile\n if(minSplatRadius > 0.0) {\n float effectiveSize = max(radius_x, radius_y) * vColor.a;\n if(effectiveSize < minSplatRadius) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n }\n\n // This maps vertex IDs 0, 1, 2, 3 to (-1,-1), (1,-1), (-1,1), (1,1)\n vec2 corner = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2) - 1.0;\n\n // Vertex (corner) position in screen space\n fragScreenPos = gaussianCenterScreenPos + vec2(radius_x * corner.x, radius_y * corner.y);\n\n // We use a conic function to derive the opacity\n vec3 conic = vec3(covariance2D.z, -covariance2D.y, covariance2D.x) * invDeterminant;\n conicOpacity = vec4(conic, vColor.a);\n\n depth = ndcPos.z;\n \n // Convert from screen-space to clip-space\n vec2 clipPos = fragScreenPos / vec2(fullWidth, fullHeight) * 2. - 1.;\n\n offsetFromCenter = gaussianCenterScreenPos - fragScreenPos;\n\n gl_Position = vec4(clipPos, depth, 1.0);\n\n `);const b=e.depthPass;return n.fragment.main.add(`\n discardByTerrainDepth();\n\n // Evaluate the 2D elliptical Gaussian exponent using the general conic form: Ax^2+2Bxy+Cy^2\n float x = offsetFromCenter.x;\n float y = offsetFromCenter.y;\n float conic = dot(conicOpacity.xyz, vec3(x * x, 2.0 * x * y, y * y)); \n float gaussianExponent = -0.5 * conic;\n\n // A positive exponent indicates alpha > 1, this should not happen\n // We also early check the alphaCutoff (i.e., ln(alphaCutoff)), to avoid unnecessary exp()\n if (gaussianExponent > 0.0 || gaussianExponent < ${w}) {\n discard;\n discard;\n }\n\n float gaussianFalloff = exp(gaussianExponent);\n \n // cap at 0.99 to avoid blending issues, such as seams between overlapping Gaussians\n float alpha = min(.99f, conicOpacity.w * gaussianFalloff);\n\n // We cannot write color and depth in the same pass, as they require different blend modes.\n // Regular depth writing based on first hit is not precise enough due to the inherently \n // transparent nature of Gaussian Splats (especially at the borders of the Splat).\n // We thus use a blended depth that computes a non-linear average using \n // the splat order and opacity with geometric decay.\n // This means the depth is averaged based on the order and opacity of the Gaussians,\n // with the frontmost Gaussians contributing the most.\n ${p(b,"fragColor = vec4(depth, 0, 0, alpha);","fragColor = vec4(vColor.rgb * alpha, alpha);")}\n `),n}const b=Object.freeze(Object.defineProperty({__proto__:null,GaussianSplatPassParameters:w,build:y},Symbol.toStringTag,{value:"Module"}));export{w as G,b as a,y as b};
7
+ }`),n.vertex.main.add(`\n uint instanceID = uint(gl_InstanceID);\n\n // Transform the instanceID into 2D coordinates\n uint orderTextureWidth = uint(textureSize(splatOrderTexture, 0).x);\n uint x = instanceID % orderTextureWidth;\n uint y = instanceID / orderTextureWidth;\n\n // Fetch the index of the remaining frontmost Gaussian\n uint gaussianIndex = texelFetch(splatOrderTexture, ivec2(x, y), 0).r;\n\n uint splatAtlasWidth = uint(textureSize(splatAtlasTexture, 0).x);\n\n // Fetch the packed Gaussian according to the index\n uint gaussianIndexX = gaussianIndex % splatAtlasWidth;\n uint gaussianIndexY = gaussianIndex / splatAtlasWidth;\n uvec4 packedGaussian = texelFetch(splatAtlasTexture, ivec2(gaussianIndexX, gaussianIndexY), 0);\n\n // Fetch the header associated with the packed Gaussian (contains tile origin and number of fractional bits)\n uint pageNum = gaussianIndex / 1024u;\n uint headerIndex = (pageNum + 1u) * 1024u - 1u;\n uint headerIndexX = headerIndex % splatAtlasWidth;\n uint headerIndexY = headerIndex / splatAtlasWidth;\n uvec4 packedHeader = texelFetch(splatAtlasTexture, ivec2(headerIndexX, headerIndexY), 0);\n\n // Unpack the Gaussian\n vColor = unpackColor(packedGaussian);\n\n if(vColor.a < ${x}) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n\n vec3 scale = unpackScale(packedGaussian); \n vec4 quaternion = unpackQuaternion(packedGaussian);\n mat3 rotation = quaternionToRotationMatrix(quaternion);\n vec3 tileOriginRelativePosition = unpackTileOriginRelativePosition(packedGaussian);\n\n vec3 cameraRelativePosition = unpackCameraRelativeGaussianPosition(packedHeader, tileOriginRelativePosition, cameraPosition, cameraPos8k, cameraDelta);\n\n vec4 viewPos = vec4(mat3(view) * cameraRelativePosition, 1);\n\n if (viewPos.z > 1.0) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n\n forwardViewPosDepth(viewPos.xyz);\n\n vec3 covarianceA;\n vec3 covarianceB;\n computeCovariance3D(rotation, scale.xyz, covarianceA, covarianceB);\n\n float covariance3D[6] = float[6](covarianceA.x, covarianceA.y, covarianceA.z, covarianceB.x, covarianceB.y, covarianceB.z);\n\n vec3 covariance2D = computeCovariance2D(viewPos.xyz, focalLength, tanFov, covariance3D, view);\n \n // Invert covariance (EWA algorithm)\n float determinant = (covariance2D.x * covariance2D.z - covariance2D.y * covariance2D.y);\n if (determinant == 0.) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n float invDeterminant = 1. / determinant;\n \n\n vec4 projPos = proj * viewPos;\n float invW = 1. / (projPos.w + 1e-7);\n vec3 ndcPos = projPos.xyz * invW;\n\n // Compute extent in screen space (by finding the eigenvalues of the 2D covariance matrix). \n // Use the extent to compute the bounding rectangle of the Gaussian in screen space.\n float mid = 0.5 * (covariance2D.x + covariance2D.z);\n float delta = sqrt(max(0.1, mid * mid - determinant));\n float lambda1 = mid + delta;\n float lambda2 = mid - delta;\n // Compute principal radii (a and b)\n float a = sqrt(${b} * lambda1); // Semi-major axis\n float b = sqrt(${b} * lambda2); // Semi-minor axis\n \n // Compute rotation angle phi from covariance\n float delta_angle = covariance2D.x - covariance2D.z;\n float phi = 0.5 * fastAtan2(2.0 * covariance2D.y, delta_angle);\n \n // Compute projected axis-aligned extents\n float cos_phi = fastCos(phi);\n float sin_phi = fastSin(phi);\n float radius_x = ceil(sqrt(a * a * cos_phi * cos_phi + b * b * sin_phi * sin_phi));\n float radius_y = ceil(sqrt(a * a * sin_phi * sin_phi + b * b * cos_phi * cos_phi));\n gaussianCenterScreenPos = vec2(ndcToPixel(ndcPos.x, float(fullWidth)), ndcToPixel(ndcPos.y, float(fullHeight)));\n\n // Ignore gaussians with very small contribution, with tolerance based on the quality profile\n if(minSplatRadius > 0.0) {\n float effectiveSize = max(radius_x, radius_y) * vColor.a;\n if(effectiveSize < minSplatRadius) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n }\n\n // This maps vertex IDs 0, 1, 2, 3 to (-1,-1), (1,-1), (-1,1), (1,1)\n vec2 corner = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2) - 1.0;\n\n // Vertex (corner) position in screen space\n fragScreenPos = gaussianCenterScreenPos + vec2(radius_x * corner.x, radius_y * corner.y);\n\n // We use a conic function to derive the opacity\n vec3 conic = vec3(covariance2D.z, -covariance2D.y, covariance2D.x) * invDeterminant;\n conicOpacity = vec4(conic, vColor.a);\n\n depth = ndcPos.z;\n \n // Convert from screen-space to clip-space\n vec2 clipPos = fragScreenPos / vec2(fullWidth, fullHeight) * 2. - 1.;\n\n offsetFromCenter = gaussianCenterScreenPos - fragScreenPos;\n\n gl_Position = vec4(clipPos, depth, 1.0);\n\n `);const P=e.depthPass;return n.fragment.main.add(`\n discardByTerrainDepth();\n\n // Evaluate the 2D elliptical Gaussian exponent using the general conic form: Ax^2+2Bxy+Cy^2\n float x = offsetFromCenter.x;\n float y = offsetFromCenter.y;\n float conic = dot(conicOpacity.xyz, vec3(x * x, 2.0 * x * y, y * y)); \n float gaussianExponent = -0.5 * conic;\n\n // A positive exponent indicates alpha > 1, this should not happen\n // We also early check the alphaCutoff (i.e., ln(alphaCutoff)), to avoid unnecessary exp()\n if (gaussianExponent > 0.0 || gaussianExponent < ${y}) {\n discard;\n }\n\n float gaussianFalloff = exp(gaussianExponent);\n \n // cap at 0.99 to avoid blending issues, such as seams between overlapping Gaussians\n float alpha = min(.99f, conicOpacity.w * gaussianFalloff);\n\n // We cannot write color and depth in the same pass, as they require different blend modes.\n // Regular depth writing based on first hit is not precise enough due to the inherently \n // transparent nature of Gaussian Splats (especially at the borders of the Splat).\n // We thus use a blended depth that computes a non-linear average using \n // the splat order and opacity with geometric decay.\n // This means the depth is averaged based on the order and opacity of the Gaussians,\n // with the frontmost Gaussians contributing the most.\n ${p(P,"fragColor = vec4(depth, 0, 0, alpha);","fragColor = vec4(vColor.rgb * alpha, alpha);")}\n `),n}const P=Object.freeze(Object.defineProperty({__proto__:null,GaussianSplatPassParameters:y,build:b},Symbol.toStringTag,{value:"Module"}));export{y as G,P as a,b};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{g as r}from"./_commonjsHelpers.js";var e,t={exports:{}};function n(){return e||(e=1,r=t,n="undefined"!=typeof document?document.currentScript?.src:void 0,a=async function(r={}){var e,t=r,a="./this.program",o="";function i(r){return t.locateFile?t.locateFile(r,o):o+r}try{o=new URL(".",n).href}catch{}e=async r=>{var e=await fetch(r,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw new Error(e.status+" : "+e.url)},console.log.bind(console);var u,s,f,l,c,p,v,d,h,g,m,y,w,T,A=console.error.bind(console),b=!1,P=!1;function C(){var r=l.buffer;c=new Int8Array(r),v=new Int16Array(r),t.HEAPU8=p=new Uint8Array(r),d=new Uint16Array(r),h=new Int32Array(r),t.HEAPU32=g=new Uint32Array(r),m=new Float32Array(r),t.HEAPF64=y=new Float64Array(r),w=new BigInt64Array(r),T=new BigUint64Array(r)}function W(){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)z(t.preRun.shift());H(L)}function E(){P=!0,Ne.E()}function F(){if(t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;)N(t.postRun.shift());H(j)}var _,x=0,R=null;function $(r){x++,t.monitorRunDependencies?.(x)}function S(r){if(x--,t.monitorRunDependencies?.(x),0==x&&R){var e=R;R=null,e()}}function k(r){t.onAbort?.(r),A(r="Aborted("+r+")"),b=!0,r+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(r);throw f?.(e),e}function I(){return i("lyr3DMain.wasm")}function U(r){if(r==_&&u)return new Uint8Array(u);throw"both async and sync fetching of the wasm failed"}async function O(r){if(!u)try{var t=await e(r);return new Uint8Array(t)}catch{}return U(r)}async function D(r,e){try{var t=await O(r);return await WebAssembly.instantiate(t,e)}catch(n){A(`failed to asynchronously prepare wasm: ${n}`),k(n)}}async function V(r,e,t){if(!r&&"function"==typeof WebAssembly.instantiateStreaming)try{var n=fetch(e,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(n,t)}catch(a){A(`wasm streaming compile failed: ${a}`),A("falling back to ArrayBuffer instantiation")}return D(e,t)}function B(){return{a:je}}async function M(){function r(r,e){return Ne=r.exports,l=Ne.D,C(),Fr=Ne.G,He(Ne),S(),Ne}function e(e){return r(e.instance)}$();var n=B();return t.instantiateWasm?new Promise((e,a)=>{t.instantiateWasm(n,(t,n)=>{e(r(t))})}):(_??=I(),e(await V(u,_,n)))}var H=r=>{for(;r.length>0;)r.shift()(t)},j=[],N=r=>j.push(r),L=[],z=r=>L.push(r);class G{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){g[this.ptr+4>>2]=r}get_type(){return g[this.ptr+4>>2]}set_destructor(r){g[this.ptr+8>>2]=r}get_destructor(){return g[this.ptr+8>>2]}set_caught(r){r=r?1:0,c[this.ptr+12]=r}get_caught(){return 0!=c[this.ptr+12]}set_rethrown(r){r=r?1:0,c[this.ptr+13]=r}get_rethrown(){return 0!=c[this.ptr+13]}init(r,e){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(e)}set_adjusted_ptr(r){g[this.ptr+16>>2]=r}get_adjusted_ptr(){return g[this.ptr+16>>2]}}var Y=(r,e,t)=>{throw new G(r).init(e,t),r},q=()=>k(""),J={},K=r=>{for(;r.length;){var e=r.pop();r.pop()(e)}};function Q(r){return this.fromWireType(g[r>>2])}var X={},Z={},rr={},er=class extends Error{constructor(r){super(r),this.name="InternalError"}},tr=r=>{throw new er(r)},nr=(r,e,t)=>{function n(e){var n=t(e);n.length!==r.length&&tr("Mismatched type converter count");for(var a=0;a<r.length;++a)cr(r[a],n[a])}r.forEach(r=>rr[r]=e);var a=new Array(e.length),o=[],i=0;e.forEach((r,e)=>{Z.hasOwnProperty(r)?a[e]=Z[r]:(o.push(r),X.hasOwnProperty(r)||(X[r]=[]),X[r].push(()=>{a[e]=Z[r],++i===o.length&&n(a)}))}),0===o.length&&n(a)},ar=r=>{var e=J[r];delete J[r];var t=e.elements,n=t.length,a=t.map(r=>r.getterReturnType).concat(t.map(r=>r.setterArgumentType)),o=e.rawConstructor,i=e.rawDestructor;nr([r],a,r=>(t.forEach((e,t)=>{var a=r[t],o=e.getter,i=e.getterContext,u=r[t+n],s=e.setter,f=e.setterContext;e.read=r=>a.fromWireType(o(i,r)),e.write=(r,e)=>{var t=[];s(f,r,u.toWireType(t,e)),K(t)}}),[{name:e.name,fromWireType:r=>{for(var e=new Array(n),a=0;a<n;++a)e[a]=t[a].read(r);return i(r),e},toWireType:(r,a)=>{if(n!==a.length)throw new TypeError(`Incorrect number of tuple elements for ${e.name}: expected=${n}, actual=${a.length}`);for(var u=o(),s=0;s<n;++s)t[s].write(u,a[s]);return null!==r&&r.push(i,u),u},argPackAdvance:dr,readValueFromPointer:Q,destructorFunction:i}]))},or={},ir=r=>{var e=or[r];delete or[r];var t=e.rawConstructor,n=e.rawDestructor,a=e.fields,o=a.map(r=>r.getterReturnType).concat(a.map(r=>r.setterArgumentType));nr([r],o,r=>{var o={};return a.forEach((e,t)=>{var n=e.fieldName,i=r[t],u=r[t].optional,s=e.getter,f=e.getterContext,l=r[t+a.length],c=e.setter,p=e.setterContext;o[n]={read:r=>i.fromWireType(s(f,r)),write:(r,e)=>{var t=[];c(p,r,l.toWireType(t,e)),K(t)},optional:u}}),[{name:e.name,fromWireType:r=>{var e={};for(var t in o)e[t]=o[t].read(r);return n(r),e},toWireType:(r,e)=>{for(var a in o)if(!(a in e)&&!o[a].optional)throw new TypeError(`Missing field: "${a}"`);var i=t();for(a in o)o[a].write(i,e[a]);return null!==r&&r.push(n,i),i},argPackAdvance:dr,readValueFromPointer:Q,destructorFunction:n}]})},ur=r=>{for(var e="";;){var t=p[r++];if(!t)return e;e+=String.fromCharCode(t)}},sr=class extends Error{constructor(r){super(r),this.name="BindingError"}},fr=r=>{throw new sr(r)};function lr(r,e,t={}){var n=e.name;if(r||fr(`type "${n}" must have a positive integer typeid pointer`),Z.hasOwnProperty(r)){if(t.ignoreDuplicateRegistrations)return;fr(`Cannot register type '${n}' twice`)}if(Z[r]=e,delete rr[r],X.hasOwnProperty(r)){var a=X[r];delete X[r],a.forEach(r=>r())}}function cr(r,e,t={}){return lr(r,e,t)}var pr=(r,e,t)=>{switch(e){case 1:return t?r=>c[r]:r=>p[r];case 2:return t?r=>v[r>>1]:r=>d[r>>1];case 4:return t?r=>h[r>>2]:r=>g[r>>2];case 8:return t?r=>w[r>>3]:r=>T[r>>3];default:throw new TypeError(`invalid integer width (${e}): ${r}`)}},vr=(r,e,t,n,a)=>{e=ur(e);const o=0n===n;let i=r=>r;if(o){const r=8*t;i=e=>BigInt.asUintN(r,e),a=i(a)}cr(r,{name:e,fromWireType:i,toWireType:(r,e)=>("number"==typeof e&&(e=BigInt(e)),e),argPackAdvance:dr,readValueFromPointer:pr(e,t,!o),destructorFunction:null})},dr=8,hr=(r,e,t,n)=>{cr(r,{name:e=ur(e),fromWireType:function(r){return!!r},toWireType:function(r,e){return e?t:n},argPackAdvance:dr,readValueFromPointer:function(r){return this.fromWireType(p[r])},destructorFunction:null})},gr=[],mr=[0,1,,1,null,1,!0,1,!1,1],yr=r=>{r>9&&0===--mr[r+1]&&(mr[r]=void 0,gr.push(r))},wr={toValue:r=>(r||fr(`Cannot use deleted val. handle = ${r}`),mr[r]),toHandle:r=>{switch(r){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const e=gr.pop()||mr.length;return mr[e]=r,mr[e+1]=1,e}}}},Tr={name:"emscripten::val",fromWireType:r=>{var e=wr.toValue(r);return yr(r),e},toWireType:(r,e)=>wr.toHandle(e),argPackAdvance:dr,readValueFromPointer:Q,destructorFunction:null},Ar=r=>cr(r,Tr),br=(r,e)=>{switch(e){case 4:return function(r){return this.fromWireType(m[r>>2])};case 8:return function(r){return this.fromWireType(y[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${r}`)}},Pr=(r,e,t)=>{cr(r,{name:e=ur(e),fromWireType:r=>r,toWireType:(r,e)=>e,argPackAdvance:dr,readValueFromPointer:br(e,t),destructorFunction:null})},Cr=(r,e)=>Object.defineProperty(e,"name",{value:r});function Wr(r){for(var e=1;e<r.length;++e)if(null!==r[e]&&void 0===r[e].destructorFunction)return!0;return!1}function Er(r,e,t,n,a,o){var i=e.length;i<2&&fr("argTypes array size mismatch! Must at least get return value and 'this' types!"),e[1];var u=Wr(e),s="void"!==e[0].name,f=i-2,l=new Array(f),c=[],p=[];return Cr(r,function(...r){var t;p.length=0,c.length=1,c[0]=a;for(var o=0;o<f;++o)l[o]=e[o+2].toWireType(p,r[o]),c.push(l[o]);function i(r){if(u)K(p);else for(var n=2;n<e.length;n++){var a=1===n?t:l[n-2];null!==e[n].destructorFunction&&e[n].destructorFunction(a)}if(s)return e[0].fromWireType(r)}return i(n(...c))})}var Fr,_r=(r,e,t)=>{if(void 0===r[e].overloadTable){var n=r[e];r[e]=function(...n){return r[e].overloadTable.hasOwnProperty(n.length)||fr(`Function '${t}' called with an invalid number of arguments (${n.length}) - expects one of (${r[e].overloadTable})!`),r[e].overloadTable[n.length].apply(this,n)},r[e].overloadTable=[],r[e].overloadTable[n.argCount]=n}},xr=(r,e,n)=>{t.hasOwnProperty(r)?((void 0===n||void 0!==t[r].overloadTable&&void 0!==t[r].overloadTable[n])&&fr(`Cannot register public name '${r}' twice`),_r(t,r,r),t[r].overloadTable.hasOwnProperty(n)&&fr(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),t[r].overloadTable[n]=e):(t[r]=e,t[r].argCount=n)},Rr=(r,e)=>{for(var t=[],n=0;n<r;n++)t.push(g[e+4*n>>2]);return t},$r=(r,e,n)=>{t.hasOwnProperty(r)||tr("Replacing nonexistent public symbol"),void 0!==t[r].overloadTable&&void 0!==n?t[r].overloadTable[n]=e:(t[r]=e,t[r].argCount=n)},Sr=[],kr=r=>{var e=Sr[r];return e||(Sr[r]=e=Fr.get(r)),e},Ir=(r,e,t=!1)=>{function n(){return kr(e)}r=ur(r);var a=n();return"function"!=typeof a&&fr(`unknown function pointer with signature ${r}: ${e}`),a};class Ur extends Error{}var Or,Dr,Vr,Br,Mr=r=>{var e=Dr(r),t=ur(e);return Br(e),t},Hr=(r,e)=>{var t=[],n={};function a(r){n[r]||Z[r]||(rr[r]?rr[r].forEach(a):(t.push(r),n[r]=!0))}throw e.forEach(a),new Ur(`${r}: `+t.map(Mr).join([", "]))},jr=r=>{const e=(r=r.trim()).indexOf("(");return-1===e?r:r.slice(0,e)},Nr=(r,e,t,n,a,o,i,u)=>{var s=Rr(e,t);r=ur(r),r=jr(r),a=Ir(n,a,i),xr(r,function(){Hr(`Cannot call ${r} due to unbound types`,s)},e-1),nr([],s,t=>{var n=[t[0],null].concat(t.slice(1));return $r(r,Er(r,n,null,a,o),e-1),[]})},Lr=(r,e,t,n,a)=>{e=ur(e);let o=r=>r;if(0===n){var i=32-8*t;o=r=>r<<i>>>i,a=o(a)}cr(r,{name:e,fromWireType:o,toWireType:(r,e)=>e,argPackAdvance:dr,readValueFromPointer:pr(e,t,0!==n),destructorFunction:null})},zr=(r,e,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][e];function a(r){var e=g[r>>2],t=g[r+4>>2];return new n(c.buffer,t,e)}cr(r,{name:t=ur(t),fromWireType:a,argPackAdvance:dr,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},Gr=(r,e,t,n)=>{if(!(n>0))return 0;for(var a=t,o=t+n-1,i=0;i<r.length;++i){var u=r.codePointAt(i);if(u<=127){if(t>=o)break;e[t++]=u}else if(u<=2047){if(t+1>=o)break;e[t++]=192|u>>6,e[t++]=128|63&u}else if(u<=65535){if(t+2>=o)break;e[t++]=224|u>>12,e[t++]=128|u>>6&63,e[t++]=128|63&u}else{if(t+3>=o)break;e[t++]=240|u>>18,e[t++]=128|u>>12&63,e[t++]=128|u>>6&63,e[t++]=128|63&u,i++}}return e[t]=0,t-a},Yr=(r,e,t)=>Gr(r,p,e,t),qr=r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++t):e+=3}return e},Jr="undefined"!=typeof TextDecoder?new TextDecoder:void 0,Kr=(r,e=0,t=NaN)=>{for(var n=e+t,a=e;r[a]&&!(a>=n);)++a;if(a-e>16&&r.buffer&&Jr)return Jr.decode(r.subarray(e,a));for(var o="";e<a;){var i=r[e++];if(128&i){var u=63&r[e++];if(192!=(224&i)){var s=63&r[e++];if((i=224==(240&i)?(15&i)<<12|u<<6|s:(7&i)<<18|u<<12|s<<6|63&r[e++])<65536)o+=String.fromCharCode(i);else{var f=i-65536;o+=String.fromCharCode(55296|f>>10,56320|1023&f)}}else o+=String.fromCharCode((31&i)<<6|u)}else o+=String.fromCharCode(i)}return o},Qr=(r,e)=>r?Kr(p,r,e):"",Xr=(r,e)=>{cr(r,{name:e=ur(e),fromWireType(r){for(var e,t=g[r>>2],n=r+4,a=n,o=0;o<=t;++o){var i=n+o;if(o==t||0==p[i]){var u=Qr(a,i-a);void 0===e?e=u:(e+=String.fromCharCode(0),e+=u),a=i+1}}return Br(r),e},toWireType(r,e){var t;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var n="string"==typeof e;n||ArrayBuffer.isView(e)&&1==e.BYTES_PER_ELEMENT||fr("Cannot pass non-string to std::string"),t=n?qr(e):e.length;var a=Vr(4+t+1),o=a+4;return g[a>>2]=t,n?Yr(e,o,t+1):p.set(e,o),null!==r&&r.push(Br,a),a},argPackAdvance:dr,readValueFromPointer:Q,destructorFunction(r){Br(r)}})},Zr="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,re=(r,e)=>{for(var t=r>>1,n=t+e/2,a=t;!(a>=n)&&d[a];)++a;if(a-t>16&&Zr)return Zr.decode(d.subarray(t,a));for(var o="",i=t;!(i>=n);++i){var u=d[i];if(0==u)break;o+=String.fromCharCode(u)}return o},ee=(r,e,t)=>{if(t??=2147483647,t<2)return 0;for(var n=e,a=(t-=2)<2*r.length?t/2:r.length,o=0;o<a;++o){var i=r.charCodeAt(o);v[e>>1]=i,e+=2}return v[e>>1]=0,e-n},te=r=>2*r.length,ne=(r,e)=>{for(var t="",n=0;!(n>=e/4);n++){var a=h[r+4*n>>2];if(!a)break;t+=String.fromCodePoint(a)}return t},ae=(r,e,t)=>{if(t??=2147483647,t<4)return 0;for(var n=e,a=n+t-4,o=0;o<r.length;++o){var i=r.codePointAt(o);if(i>65535&&o++,h[e>>2]=i,(e+=4)+4>a)break}return h[e>>2]=0,e-n},oe=r=>{for(var e=0,t=0;t<r.length;++t)r.codePointAt(t)>65535&&t++,e+=4;return e},ie=(r,e,t)=>{var n,a,o,i;t=ur(t),2===e?(n=re,a=ee,i=te,o=r=>d[r>>1]):4===e&&(n=ne,a=ae,i=oe,o=r=>g[r>>2]),cr(r,{name:t,fromWireType:r=>{for(var t,a=g[r>>2],i=r+4,u=0;u<=a;++u){var s=r+4+u*e;if(u==a||0==o(s)){var f=n(i,s-i);void 0===t?t=f:(t+=String.fromCharCode(0),t+=f),i=s+e}}return Br(r),t},toWireType:(r,n)=>{"string"!=typeof n&&fr(`Cannot pass non-string to C++ string type ${t}`);var o=i(n),u=Vr(4+o+e);return g[u>>2]=o/e,a(n,u+4,o+e),null!==r&&r.push(Br,u),u},argPackAdvance:dr,readValueFromPointer:Q,destructorFunction(r){Br(r)}})},ue=(r,e,t,n,a,o)=>{J[r]={name:ur(e),rawConstructor:Ir(t,n),rawDestructor:Ir(a,o),elements:[]}},se=(r,e,t,n,a,o,i,u,s)=>{J[r].elements.push({getterReturnType:e,getter:Ir(t,n),getterContext:a,setterArgumentType:o,setter:Ir(i,u),setterContext:s})},fe=(r,e,t,n,a,o)=>{or[r]={name:ur(e),rawConstructor:Ir(t,n),rawDestructor:Ir(a,o),fields:[]}},le=(r,e,t,n,a,o,i,u,s,f)=>{or[r].fields.push({fieldName:ur(e),getterReturnType:t,getter:Ir(n,a),getterContext:o,setterArgumentType:i,setter:Ir(u,s),setterContext:f})},ce=(r,e)=>{cr(r,{isVoid:!0,name:e=ur(e),argPackAdvance:0,fromWireType:()=>{},toWireType:(r,e)=>{}})},pe=r=>{r>9&&(mr[r+1]+=1)},ve=()=>wr.toHandle([]),de={},he=r=>{var e=de[r];return void 0===e?ur(r):e},ge=r=>wr.toHandle(he(r)),me=()=>wr.toHandle({}),ye=(r,e,t)=>{r=wr.toValue(r),e=wr.toValue(e),t=wr.toValue(t),r[e]=t},we=(r,e)=>{var t=Z[r];return void 0===t&&fr(`${e} has unknown type ${Mr(r)}`),t},Te=(r,e)=>{var t=(r=we(r,"_emval_take_value")).readValueFromPointer(e);return wr.toHandle(t)},Ae=(r,e,t,n)=>{var a=(new Date).getFullYear(),o=new Date(a,0,1),i=new Date(a,6,1),u=o.getTimezoneOffset(),s=i.getTimezoneOffset(),f=Math.max(u,s);g[r>>2]=60*f,h[e>>2]=Number(u!=s);var l=r=>{var e=r>=0?"-":"+",t=Math.abs(r);return`UTC${e}${String(Math.floor(t/60)).padStart(2,"0")}${String(t%60).padStart(2,"0")}`},c=l(u),p=l(s);s<u?(Yr(c,t,17),Yr(p,n,17)):(Yr(c,n,17),Yr(p,t,17))},be=()=>2147483648,Pe=(r,e)=>Math.ceil(r/e)*e,Ce=r=>{var e=(r-l.buffer.byteLength+65535)/65536|0;try{return l.grow(e),C(),1}catch(t){}},We=r=>{var e=p.length;r>>>=0;var t=be();if(r>t)return!1;for(var n=1;n<=4;n*=2){var a=e*(1+.2/n);a=Math.min(a,r+100663296);var o=Math.min(t,Pe(Math.max(r,a),65536));if(Ce(o))return!0}return!1},Ee={},Fe=()=>a||"./this.program",_e=()=>{if(!_e.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.language||"C").replace("-","_")+".UTF-8",_:Fe()};for(var e in Ee)void 0===Ee[e]?delete r[e]:r[e]=Ee[e];var t=[];for(var e in r)t.push(`${e}=${r[e]}`);_e.strings=t}return _e.strings},xe=(r,e)=>{var t=0,n=0;for(var a of _e()){var o=e+t;g[r+n>>2]=o,t+=Yr(a,o,1/0)+1,n+=4}return 0},Re=(r,e)=>{var t=_e();g[r>>2]=t.length;var n=0;for(var a of t)n+=qr(a)+1;return g[e>>2]=n,0},$e=(r,e)=>{r<128?e.push(r):e.push(r%128|128,r>>7)},Se=r=>{for(var e={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},t={parameters:[],results:"v"==r[0]?[]:[e[r[0]]]},n=1;n<r.length;++n)t.parameters.push(e[r[n]]);return t},ke=(r,e)=>{var t=r.slice(0,1),n=r.slice(1),a={i:127,p:127,j:126,f:125,d:124,e:111};for(var o of(e.push(96),$e(n.length,e),n))e.push(a[o]);"v"==t?e.push(0):e.push(1,a[t])},Ie=(r,e)=>{if("function"==typeof WebAssembly.Function)return new WebAssembly.Function(Se(e),r);var t=[1];ke(e,t);var n=[0,97,115,109,1,0,0,0,1];$e(t.length,n),n.push(...t),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var a=new WebAssembly.Module(new Uint8Array(n));return new WebAssembly.Instance(a,{e:{f:r}}).exports.f},Ue=(r,e)=>{if(Or)for(var t=r;t<r+e;t++){var n=kr(t);n&&Or.set(n,t)}},Oe=r=>(Or||(Or=new WeakMap,Ue(0,Fr.length)),Or.get(r)||0),De=[],Ve=()=>{if(De.length)return De.pop();try{Fr.grow(1)}catch(A){if(!(A instanceof RangeError))throw A;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return Fr.length-1},Be=(r,e)=>{Fr.set(r,e),Sr[r]=Fr.get(r)},Me=(r,e)=>{var t=Oe(r);if(t)return t;var n=Ve();try{Be(n,r)}catch(A){if(!(A instanceof TypeError))throw A;var a=Ie(r,e);Be(n,a)}return Or.set(r,n),n};function He(r){Dr=r.F,t._malloc=Vr=r.H,t._free=Br=r.I}t.noExitRuntime&&t.noExitRuntime,t.print&&t.print,t.printErr&&(A=t.printErr),t.wasmBinary&&(u=t.wasmBinary),t.arguments&&t.arguments,t.thisProgram&&(a=t.thisProgram),t.addFunction=Me,t.UTF8ToString=Qr;var je={b:Y,x:q,l:ar,o:ir,s:vr,C:hr,A:Ar,r:Pr,d:Nr,j:Lr,c:zr,B:Xr,n:ie,m:ue,f:se,p:fe,e:le,t:ce,a:yr,q:pe,z:ve,i:ge,k:me,g:ye,h:Te,u:Ae,y:We,v:xe,w:Re},Ne=await M();function Le(){function r(){t.calledRun=!0,b||(E(),s?.(t),t.onRuntimeInitialized?.(),F())}x>0?R=Le:(W(),x>0?R=Le:t.setStatus?(t.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>t.setStatus(""),1),r()},1)):r())}function ze(){if(t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.shift()()}return ze(),Le(),P?t:new Promise((r,e)=>{s=r,f=e})},r.exports=a,r.exports.default=a),t.exports;var r,n,a}const a=r(n()),o=Object.freeze(Object.defineProperty({__proto__:null,default:a},Symbol.toStringTag,{value:"Module"}));export{o as l};
5
+ import{g as r}from"./_commonjsHelpers.js";var e,t={exports:{}};function n(){return e||(e=1,r=t,n="undefined"!=typeof document?document.currentScript?.src:void 0,a=async function(r={}){var e,t=r,a="./this.program",o="";function i(r){return t.locateFile?t.locateFile(r,o):o+r}try{o=new URL(".",n).href}catch{}e=async r=>{var e=await fetch(r,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw new Error(e.status+" : "+e.url)};var u,s,f,l,c,p,v,h,d,g,m,y,w,T,A=console.log.bind(console),b=console.error.bind(console),P=!1,C=!1;function W(){var r=l.buffer;c=new Int8Array(r),v=new Int16Array(r),t.HEAPU8=p=new Uint8Array(r),h=new Uint16Array(r),d=new Int32Array(r),t.HEAPU32=g=new Uint32Array(r),m=new Float32Array(r),t.HEAPF64=y=new Float64Array(r),w=new BigInt64Array(r),T=new BigUint64Array(r)}function E(){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)G(t.preRun.shift());j(z)}function F(){C=!0,Ye.F()}function _(){if(t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;)L(t.postRun.shift());j(N)}var x,R=0,$=null;function S(r){R++,t.monitorRunDependencies?.(R)}function k(r){if(R--,t.monitorRunDependencies?.(R),0==R&&$){var e=$;$=null,e()}}function I(r){t.onAbort?.(r),b(r="Aborted("+r+")"),P=!0,r+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(r);throw f?.(e),e}function U(){return i("lyr3DMain.wasm")}function O(r){if(r==x&&u)return new Uint8Array(u);throw"both async and sync fetching of the wasm failed"}async function D(r){if(!u)try{var t=await e(r);return new Uint8Array(t)}catch{}return O(r)}async function V(r,e){try{var t=await D(r);return await WebAssembly.instantiate(t,e)}catch(n){b(`failed to asynchronously prepare wasm: ${n}`),I(n)}}async function B(r,e,t){if(!r&&"function"==typeof WebAssembly.instantiateStreaming)try{var n=fetch(e,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(n,t)}catch(a){b(`wasm streaming compile failed: ${a}`),b("falling back to ArrayBuffer instantiation")}return V(e,t)}function M(){return{a:Ge}}async function H(){function r(r,e){return Ye=r.exports,l=Ye.E,W(),_r=Ye.H,ze(Ye),k(),Ye}function e(e){return r(e.instance)}S();var n=M();return t.instantiateWasm?new Promise((e,a)=>{t.instantiateWasm(n,(t,n)=>{e(r(t))})}):(x??=U(),e(await B(u,x,n)))}var j=r=>{for(;r.length>0;)r.shift()(t)},N=[],L=r=>N.push(r),z=[],G=r=>z.push(r);class Y{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){g[this.ptr+4>>2]=r}get_type(){return g[this.ptr+4>>2]}set_destructor(r){g[this.ptr+8>>2]=r}get_destructor(){return g[this.ptr+8>>2]}set_caught(r){r=r?1:0,c[this.ptr+12]=r}get_caught(){return 0!=c[this.ptr+12]}set_rethrown(r){r=r?1:0,c[this.ptr+13]=r}get_rethrown(){return 0!=c[this.ptr+13]}init(r,e){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(e)}set_adjusted_ptr(r){g[this.ptr+16>>2]=r}get_adjusted_ptr(){return g[this.ptr+16>>2]}}var q=(r,e,t)=>{throw new Y(r).init(e,t),r},J=()=>I(""),K={},Q=r=>{for(;r.length;){var e=r.pop();r.pop()(e)}};function X(r){return this.fromWireType(g[r>>2])}var Z={},rr={},er={},tr=class extends Error{constructor(r){super(r),this.name="InternalError"}},nr=r=>{throw new tr(r)},ar=(r,e,t)=>{function n(e){var n=t(e);n.length!==r.length&&nr("Mismatched type converter count");for(var a=0;a<r.length;++a)pr(r[a],n[a])}r.forEach(r=>er[r]=e);var a=new Array(e.length),o=[],i=0;e.forEach((r,e)=>{rr.hasOwnProperty(r)?a[e]=rr[r]:(o.push(r),Z.hasOwnProperty(r)||(Z[r]=[]),Z[r].push(()=>{a[e]=rr[r],++i===o.length&&n(a)}))}),0===o.length&&n(a)},or=r=>{var e=K[r];delete K[r];var t=e.elements,n=t.length,a=t.map(r=>r.getterReturnType).concat(t.map(r=>r.setterArgumentType)),o=e.rawConstructor,i=e.rawDestructor;ar([r],a,r=>(t.forEach((e,t)=>{var a=r[t],o=e.getter,i=e.getterContext,u=r[t+n],s=e.setter,f=e.setterContext;e.read=r=>a.fromWireType(o(i,r)),e.write=(r,e)=>{var t=[];s(f,r,u.toWireType(t,e)),Q(t)}}),[{name:e.name,fromWireType:r=>{for(var e=new Array(n),a=0;a<n;++a)e[a]=t[a].read(r);return i(r),e},toWireType:(r,a)=>{if(n!==a.length)throw new TypeError(`Incorrect number of tuple elements for ${e.name}: expected=${n}, actual=${a.length}`);for(var u=o(),s=0;s<n;++s)t[s].write(u,a[s]);return null!==r&&r.push(i,u),u},argPackAdvance:dr,readValueFromPointer:X,destructorFunction:i}]))},ir={},ur=r=>{var e=ir[r];delete ir[r];var t=e.rawConstructor,n=e.rawDestructor,a=e.fields,o=a.map(r=>r.getterReturnType).concat(a.map(r=>r.setterArgumentType));ar([r],o,r=>{var o={};return a.forEach((e,t)=>{var n=e.fieldName,i=r[t],u=r[t].optional,s=e.getter,f=e.getterContext,l=r[t+a.length],c=e.setter,p=e.setterContext;o[n]={read:r=>i.fromWireType(s(f,r)),write:(r,e)=>{var t=[];c(p,r,l.toWireType(t,e)),Q(t)},optional:u}}),[{name:e.name,fromWireType:r=>{var e={};for(var t in o)e[t]=o[t].read(r);return n(r),e},toWireType:(r,e)=>{for(var a in o)if(!(a in e)&&!o[a].optional)throw new TypeError(`Missing field: "${a}"`);var i=t();for(a in o)o[a].write(i,e[a]);return null!==r&&r.push(n,i),i},argPackAdvance:dr,readValueFromPointer:X,destructorFunction:n}]})},sr=r=>{for(var e="";;){var t=p[r++];if(!t)return e;e+=String.fromCharCode(t)}},fr=class extends Error{constructor(r){super(r),this.name="BindingError"}},lr=r=>{throw new fr(r)};function cr(r,e,t={}){var n=e.name;if(r||lr(`type "${n}" must have a positive integer typeid pointer`),rr.hasOwnProperty(r)){if(t.ignoreDuplicateRegistrations)return;lr(`Cannot register type '${n}' twice`)}if(rr[r]=e,delete er[r],Z.hasOwnProperty(r)){var a=Z[r];delete Z[r],a.forEach(r=>r())}}function pr(r,e,t={}){return cr(r,e,t)}var vr=(r,e,t)=>{switch(e){case 1:return t?r=>c[r]:r=>p[r];case 2:return t?r=>v[r>>1]:r=>h[r>>1];case 4:return t?r=>d[r>>2]:r=>g[r>>2];case 8:return t?r=>w[r>>3]:r=>T[r>>3];default:throw new TypeError(`invalid integer width (${e}): ${r}`)}},hr=(r,e,t,n,a)=>{e=sr(e);const o=0n===n;let i=r=>r;if(o){const r=8*t;i=e=>BigInt.asUintN(r,e),a=i(a)}pr(r,{name:e,fromWireType:i,toWireType:(r,e)=>("number"==typeof e&&(e=BigInt(e)),e),argPackAdvance:dr,readValueFromPointer:vr(e,t,!o),destructorFunction:null})},dr=8,gr=(r,e,t,n)=>{pr(r,{name:e=sr(e),fromWireType:function(r){return!!r},toWireType:function(r,e){return e?t:n},argPackAdvance:dr,readValueFromPointer:function(r){return this.fromWireType(p[r])},destructorFunction:null})},mr=[],yr=[0,1,,1,null,1,!0,1,!1,1],wr=r=>{r>9&&0===--yr[r+1]&&(yr[r]=void 0,mr.push(r))},Tr={toValue:r=>(r||lr(`Cannot use deleted val. handle = ${r}`),yr[r]),toHandle:r=>{switch(r){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const e=mr.pop()||yr.length;return yr[e]=r,yr[e+1]=1,e}}}},Ar={name:"emscripten::val",fromWireType:r=>{var e=Tr.toValue(r);return wr(r),e},toWireType:(r,e)=>Tr.toHandle(e),argPackAdvance:dr,readValueFromPointer:X,destructorFunction:null},br=r=>pr(r,Ar),Pr=(r,e)=>{switch(e){case 4:return function(r){return this.fromWireType(m[r>>2])};case 8:return function(r){return this.fromWireType(y[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${r}`)}},Cr=(r,e,t)=>{pr(r,{name:e=sr(e),fromWireType:r=>r,toWireType:(r,e)=>e,argPackAdvance:dr,readValueFromPointer:Pr(e,t),destructorFunction:null})},Wr=(r,e)=>Object.defineProperty(e,"name",{value:r});function Er(r){for(var e=1;e<r.length;++e)if(null!==r[e]&&void 0===r[e].destructorFunction)return!0;return!1}function Fr(r,e,t,n,a,o){var i=e.length;i<2&&lr("argTypes array size mismatch! Must at least get return value and 'this' types!"),e[1];var u=Er(e),s="void"!==e[0].name,f=i-2,l=new Array(f),c=[],p=[];return Wr(r,function(...r){var t;p.length=0,c.length=1,c[0]=a;for(var o=0;o<f;++o)l[o]=e[o+2].toWireType(p,r[o]),c.push(l[o]);function i(r){if(u)Q(p);else for(var n=2;n<e.length;n++){var a=1===n?t:l[n-2];null!==e[n].destructorFunction&&e[n].destructorFunction(a)}if(s)return e[0].fromWireType(r)}return i(n(...c))})}var _r,xr=(r,e,t)=>{if(void 0===r[e].overloadTable){var n=r[e];r[e]=function(...n){return r[e].overloadTable.hasOwnProperty(n.length)||lr(`Function '${t}' called with an invalid number of arguments (${n.length}) - expects one of (${r[e].overloadTable})!`),r[e].overloadTable[n.length].apply(this,n)},r[e].overloadTable=[],r[e].overloadTable[n.argCount]=n}},Rr=(r,e,n)=>{t.hasOwnProperty(r)?((void 0===n||void 0!==t[r].overloadTable&&void 0!==t[r].overloadTable[n])&&lr(`Cannot register public name '${r}' twice`),xr(t,r,r),t[r].overloadTable.hasOwnProperty(n)&&lr(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),t[r].overloadTable[n]=e):(t[r]=e,t[r].argCount=n)},$r=(r,e)=>{for(var t=[],n=0;n<r;n++)t.push(g[e+4*n>>2]);return t},Sr=(r,e,n)=>{t.hasOwnProperty(r)||nr("Replacing nonexistent public symbol"),void 0!==t[r].overloadTable&&void 0!==n?t[r].overloadTable[n]=e:(t[r]=e,t[r].argCount=n)},kr=[],Ir=r=>{var e=kr[r];return e||(kr[r]=e=_r.get(r)),e},Ur=(r,e,t=!1)=>{function n(){return Ir(e)}r=sr(r);var a=n();return"function"!=typeof a&&lr(`unknown function pointer with signature ${r}: ${e}`),a};class Or extends Error{}var Dr,Vr,Br,Mr,Hr=r=>{var e=Vr(r),t=sr(e);return Mr(e),t},jr=(r,e)=>{var t=[],n={};function a(r){n[r]||rr[r]||(er[r]?er[r].forEach(a):(t.push(r),n[r]=!0))}throw e.forEach(a),new Or(`${r}: `+t.map(Hr).join([", "]))},Nr=r=>{const e=(r=r.trim()).indexOf("(");return-1===e?r:r.slice(0,e)},Lr=(r,e,t,n,a,o,i,u)=>{var s=$r(e,t);r=sr(r),r=Nr(r),a=Ur(n,a,i),Rr(r,function(){jr(`Cannot call ${r} due to unbound types`,s)},e-1),ar([],s,t=>{var n=[t[0],null].concat(t.slice(1));return Sr(r,Fr(r,n,null,a,o),e-1),[]})},zr=(r,e,t,n,a)=>{e=sr(e);let o=r=>r;if(0===n){var i=32-8*t;o=r=>r<<i>>>i,a=o(a)}pr(r,{name:e,fromWireType:o,toWireType:(r,e)=>e,argPackAdvance:dr,readValueFromPointer:vr(e,t,0!==n),destructorFunction:null})},Gr=(r,e,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][e];function a(r){var e=g[r>>2],t=g[r+4>>2];return new n(c.buffer,t,e)}pr(r,{name:t=sr(t),fromWireType:a,argPackAdvance:dr,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},Yr=(r,e,t,n)=>{if(!(n>0))return 0;for(var a=t,o=t+n-1,i=0;i<r.length;++i){var u=r.codePointAt(i);if(u<=127){if(t>=o)break;e[t++]=u}else if(u<=2047){if(t+1>=o)break;e[t++]=192|u>>6,e[t++]=128|63&u}else if(u<=65535){if(t+2>=o)break;e[t++]=224|u>>12,e[t++]=128|u>>6&63,e[t++]=128|63&u}else{if(t+3>=o)break;e[t++]=240|u>>18,e[t++]=128|u>>12&63,e[t++]=128|u>>6&63,e[t++]=128|63&u,i++}}return e[t]=0,t-a},qr=(r,e,t)=>Yr(r,p,e,t),Jr=r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++t):e+=3}return e},Kr="undefined"!=typeof TextDecoder?new TextDecoder:void 0,Qr=(r,e=0,t=NaN)=>{for(var n=e+t,a=e;r[a]&&!(a>=n);)++a;if(a-e>16&&r.buffer&&Kr)return Kr.decode(r.subarray(e,a));for(var o="";e<a;){var i=r[e++];if(128&i){var u=63&r[e++];if(192!=(224&i)){var s=63&r[e++];if((i=224==(240&i)?(15&i)<<12|u<<6|s:(7&i)<<18|u<<12|s<<6|63&r[e++])<65536)o+=String.fromCharCode(i);else{var f=i-65536;o+=String.fromCharCode(55296|f>>10,56320|1023&f)}}else o+=String.fromCharCode((31&i)<<6|u)}else o+=String.fromCharCode(i)}return o},Xr=(r,e)=>r?Qr(p,r,e):"",Zr=(r,e)=>{pr(r,{name:e=sr(e),fromWireType(r){for(var e,t=g[r>>2],n=r+4,a=n,o=0;o<=t;++o){var i=n+o;if(o==t||0==p[i]){var u=Xr(a,i-a);void 0===e?e=u:(e+=String.fromCharCode(0),e+=u),a=i+1}}return Mr(r),e},toWireType(r,e){var t;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var n="string"==typeof e;n||ArrayBuffer.isView(e)&&1==e.BYTES_PER_ELEMENT||lr("Cannot pass non-string to std::string"),t=n?Jr(e):e.length;var a=Br(4+t+1),o=a+4;return g[a>>2]=t,n?qr(e,o,t+1):p.set(e,o),null!==r&&r.push(Mr,a),a},argPackAdvance:dr,readValueFromPointer:X,destructorFunction(r){Mr(r)}})},re="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,ee=(r,e)=>{for(var t=r>>1,n=t+e/2,a=t;!(a>=n)&&h[a];)++a;if(a-t>16&&re)return re.decode(h.subarray(t,a));for(var o="",i=t;!(i>=n);++i){var u=h[i];if(0==u)break;o+=String.fromCharCode(u)}return o},te=(r,e,t)=>{if(t??=2147483647,t<2)return 0;for(var n=e,a=(t-=2)<2*r.length?t/2:r.length,o=0;o<a;++o){var i=r.charCodeAt(o);v[e>>1]=i,e+=2}return v[e>>1]=0,e-n},ne=r=>2*r.length,ae=(r,e)=>{for(var t="",n=0;!(n>=e/4);n++){var a=d[r+4*n>>2];if(!a)break;t+=String.fromCodePoint(a)}return t},oe=(r,e,t)=>{if(t??=2147483647,t<4)return 0;for(var n=e,a=n+t-4,o=0;o<r.length;++o){var i=r.codePointAt(o);if(i>65535&&o++,d[e>>2]=i,(e+=4)+4>a)break}return d[e>>2]=0,e-n},ie=r=>{for(var e=0,t=0;t<r.length;++t)r.codePointAt(t)>65535&&t++,e+=4;return e},ue=(r,e,t)=>{var n,a,o,i;t=sr(t),2===e?(n=ee,a=te,i=ne,o=r=>h[r>>1]):4===e&&(n=ae,a=oe,i=ie,o=r=>g[r>>2]),pr(r,{name:t,fromWireType:r=>{for(var t,a=g[r>>2],i=r+4,u=0;u<=a;++u){var s=r+4+u*e;if(u==a||0==o(s)){var f=n(i,s-i);void 0===t?t=f:(t+=String.fromCharCode(0),t+=f),i=s+e}}return Mr(r),t},toWireType:(r,n)=>{"string"!=typeof n&&lr(`Cannot pass non-string to C++ string type ${t}`);var o=i(n),u=Br(4+o+e);return g[u>>2]=o/e,a(n,u+4,o+e),null!==r&&r.push(Mr,u),u},argPackAdvance:dr,readValueFromPointer:X,destructorFunction(r){Mr(r)}})},se=(r,e,t,n,a,o)=>{K[r]={name:sr(e),rawConstructor:Ur(t,n),rawDestructor:Ur(a,o),elements:[]}},fe=(r,e,t,n,a,o,i,u,s)=>{K[r].elements.push({getterReturnType:e,getter:Ur(t,n),getterContext:a,setterArgumentType:o,setter:Ur(i,u),setterContext:s})},le=(r,e,t,n,a,o)=>{ir[r]={name:sr(e),rawConstructor:Ur(t,n),rawDestructor:Ur(a,o),fields:[]}},ce=(r,e,t,n,a,o,i,u,s,f)=>{ir[r].fields.push({fieldName:sr(e),getterReturnType:t,getter:Ur(n,a),getterContext:o,setterArgumentType:i,setter:Ur(u,s),setterContext:f})},pe=(r,e)=>{pr(r,{isVoid:!0,name:e=sr(e),argPackAdvance:0,fromWireType:()=>{},toWireType:(r,e)=>{}})},ve=r=>{r>9&&(yr[r+1]+=1)},he=()=>Tr.toHandle([]),de={},ge=r=>{var e=de[r];return void 0===e?sr(r):e},me=r=>Tr.toHandle(ge(r)),ye=()=>Tr.toHandle({}),we=(r,e,t)=>{r=Tr.toValue(r),e=Tr.toValue(e),t=Tr.toValue(t),r[e]=t},Te=(r,e)=>{var t=rr[r];return void 0===t&&lr(`${e} has unknown type ${Hr(r)}`),t},Ae=(r,e)=>{var t=(r=Te(r,"_emval_take_value")).readValueFromPointer(e);return Tr.toHandle(t)},be=(r,e,t,n)=>{var a=(new Date).getFullYear(),o=new Date(a,0,1),i=new Date(a,6,1),u=o.getTimezoneOffset(),s=i.getTimezoneOffset(),f=Math.max(u,s);g[r>>2]=60*f,d[e>>2]=Number(u!=s);var l=r=>{var e=r>=0?"-":"+",t=Math.abs(r);return`UTC${e}${String(Math.floor(t/60)).padStart(2,"0")}${String(t%60).padStart(2,"0")}`},c=l(u),p=l(s);s<u?(qr(c,t,17),qr(p,n,17)):(qr(c,n,17),qr(p,t,17))},Pe=()=>2147483648,Ce=(r,e)=>Math.ceil(r/e)*e,We=r=>{var e=(r-l.buffer.byteLength+65535)/65536|0;try{return l.grow(e),W(),1}catch(t){}},Ee=r=>{var e=p.length;r>>>=0;var t=Pe();if(r>t)return!1;for(var n=1;n<=4;n*=2){var a=e*(1+.2/n);a=Math.min(a,r+100663296);var o=Math.min(t,Ce(Math.max(r,a),65536));if(We(o))return!0}return!1},Fe={},_e=()=>a||"./this.program",xe=()=>{if(!xe.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.language||"C").replace("-","_")+".UTF-8",_:_e()};for(var e in Fe)void 0===Fe[e]?delete r[e]:r[e]=Fe[e];var t=[];for(var e in r)t.push(`${e}=${r[e]}`);xe.strings=t}return xe.strings},Re=(r,e)=>{var t=0,n=0;for(var a of xe()){var o=e+t;g[r+n>>2]=o,t+=qr(a,o,1/0)+1,n+=4}return 0},$e=(r,e)=>{var t=xe();g[r>>2]=t.length;var n=0;for(var a of t)n+=Jr(a)+1;return g[e>>2]=n,0},Se=[null,[],[]],ke=(r,e)=>{var t=Se[r];0===e||10===e?((1===r?A:b)(Qr(t)),t.length=0):t.push(e)},Ie=(r,e,t,n)=>{for(var a=0,o=0;o<t;o++){var i=g[e>>2],u=g[e+4>>2];e+=8;for(var s=0;s<u;s++)ke(r,p[i+s]);a+=u}return g[n>>2]=a,0},Ue=(r,e)=>{r<128?e.push(r):e.push(r%128|128,r>>7)},Oe=r=>{for(var e={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},t={parameters:[],results:"v"==r[0]?[]:[e[r[0]]]},n=1;n<r.length;++n)t.parameters.push(e[r[n]]);return t},De=(r,e)=>{var t=r.slice(0,1),n=r.slice(1),a={i:127,p:127,j:126,f:125,d:124,e:111};for(var o of(e.push(96),Ue(n.length,e),n))e.push(a[o]);"v"==t?e.push(0):e.push(1,a[t])},Ve=(r,e)=>{if("function"==typeof WebAssembly.Function)return new WebAssembly.Function(Oe(e),r);var t=[1];De(e,t);var n=[0,97,115,109,1,0,0,0,1];Ue(t.length,n),n.push(...t),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var a=new WebAssembly.Module(new Uint8Array(n));return new WebAssembly.Instance(a,{e:{f:r}}).exports.f},Be=(r,e)=>{if(Dr)for(var t=r;t<r+e;t++){var n=Ir(t);n&&Dr.set(n,t)}},Me=r=>(Dr||(Dr=new WeakMap,Be(0,_r.length)),Dr.get(r)||0),He=[],je=()=>{if(He.length)return He.pop();try{_r.grow(1)}catch(b){if(!(b instanceof RangeError))throw b;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return _r.length-1},Ne=(r,e)=>{_r.set(r,e),kr[r]=_r.get(r)},Le=(r,e)=>{var t=Me(r);if(t)return t;var n=je();try{Ne(n,r)}catch(b){if(!(b instanceof TypeError))throw b;var a=Ve(r,e);Ne(n,a)}return Dr.set(r,n),n};function ze(r){Vr=r.G,t._malloc=Br=r.I,t._free=Mr=r.J}t.noExitRuntime&&t.noExitRuntime,t.print&&(A=t.print),t.printErr&&(b=t.printErr),t.wasmBinary&&(u=t.wasmBinary),t.arguments&&t.arguments,t.thisProgram&&(a=t.thisProgram),t.addFunction=Le,t.UTF8ToString=Xr;var Ge={b:q,y:J,l:or,o:ur,t:hr,D:gr,B:br,s:Cr,c:Lr,j:zr,d:Gr,C:Zr,n:ue,m:se,f:fe,p:le,e:ce,u:pe,a:wr,r:ve,A:he,i:me,k:ye,g:we,h:Ae,v:be,z:Ee,w:Re,x:$e,q:Ie},Ye=await H();function qe(){function r(){t.calledRun=!0,P||(F(),s?.(t),t.onRuntimeInitialized?.(),_())}R>0?$=qe:(E(),R>0?$=qe:t.setStatus?(t.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>t.setStatus(""),1),r()},1)):r())}function Je(){if(t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.shift()()}return Je(),qe(),C?t:new Promise((r,e)=>{s=r,f=e})},r.exports=a,r.exports.default=a),t.exports;var r,n,a}const a=r(n()),o=Object.freeze(Object.defineProperty({__proto__:null,default:a},Symbol.toStringTag,{value:"Module"}));export{o as l};
package/config.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.16";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
5
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.17";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}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/5.0/esri/copyright.txt for details.
4
4
  */
5
- function r(r){return r&&"layer"in r?r.layer:void 0}function e(e){return r(e.origin)??e.sourceLayer??e.layer}export{e as getGraphicLayer,r as getGraphicOriginLayer};
5
+ import{isSubtypeGroupLayer as r}from"../layers/support/layerUtils.js";function e(r){return r&&"layer"in r?r.layer:void 0}function o(o){let t=e(o.origin);return r(t)&&(t=t.findSublayerForFeature(o)),t??o.sourceLayer??o.layer}export{o as getGraphicLayer,e as getGraphicOriginLayer};
package/interfaces.d.ts CHANGED
@@ -1163,11 +1163,6 @@ declare namespace __esri {
1163
1163
  viewOptions?: ElevationProfileViewOptionsProperties;
1164
1164
  }
1165
1165
 
1166
- export interface ElevationProfileEffectiveDisplayUnits {
1167
- distance: LengthUnit;
1168
- elevation: LengthUnit;
1169
- }
1170
-
1171
1166
  export interface LengthDimension extends Accessor, Clonable {
1172
1167
  }
1173
1168
 
@@ -34001,7 +33996,7 @@ declare namespace __esri {
34001
33996
  * Converts the given {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html mapPoint} to a
34002
33997
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ControlPointsGeoreference.html#SourcePoint sourcePoint}.
34003
33998
  *
34004
- * @param point A point geometry. In the case where the point is not in the same spatial reference as the one in the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html mapPoint} of the first control point, it will be reprojected. {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-projectOperator.html projectOperator} would need to be loaded to perform the reprojection, otherwise `null` is returned.
33999
+ * @param point A point geometry. In the case where the point is not in the same spatial reference as the one in the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html mapPoint} of the first control point, it will be reprojected. The {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-projectOperator.html projectOperator} would need to be loaded to perform the reprojection, otherwise `null` is returned.
34005
34000
  *
34006
34001
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ControlPointsGeoreference.html#toSource Read more...}
34007
34002
  */
@@ -37776,13 +37771,13 @@ declare namespace __esri {
37776
37771
 
37777
37772
  export class ParquetEncodingLocation {
37778
37773
  /**
37779
- * The name of the field in the Parquet file that contains the latitude values.
37774
+ * The name of the field in the Parquet file that contains the y values.
37780
37775
  *
37781
37776
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingLocation.html#latitudeFieldName Read more...}
37782
37777
  */
37783
37778
  latitudeFieldName: string;
37784
37779
  /**
37785
- * The name of the field in the Parquet file that contains the longitude values.
37780
+ * The name of the field in the Parquet file that contains the x values.
37786
37781
  *
37787
37782
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingLocation.html#longitudeFieldName Read more...}
37788
37783
  */
@@ -37794,7 +37789,7 @@ declare namespace __esri {
37794
37789
  */
37795
37790
  readonly type: "location";
37796
37791
  /**
37797
- * The location format used to store geometries in Pparquet files.
37792
+ * The location format used to store geometries in Parquet files.
37798
37793
  *
37799
37794
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingLocation.html Read more...}
37800
37795
  */
@@ -37819,13 +37814,13 @@ declare namespace __esri {
37819
37814
 
37820
37815
  interface ParquetEncodingLocationProperties {
37821
37816
  /**
37822
- * The name of the field in the Parquet file that contains the latitude values.
37817
+ * The name of the field in the Parquet file that contains the y values.
37823
37818
  *
37824
37819
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingLocation.html#latitudeFieldName Read more...}
37825
37820
  */
37826
37821
  latitudeFieldName?: string;
37827
37822
  /**
37828
- * The name of the field in the Parquet file that contains the longitude values.
37823
+ * The name of the field in the Parquet file that contains the x values.
37829
37824
  *
37830
37825
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingLocation.html#longitudeFieldName Read more...}
37831
37826
  */
@@ -96941,13 +96936,6 @@ declare namespace __esri {
96941
96936
  signal?: AbortSignal | nullish;
96942
96937
  }
96943
96938
 
96944
- export interface ElevationProfilePickResult {
96945
- feature: Graphic;
96946
- }
96947
-
96948
- export interface ElevationProfilePlacementResult {
96949
- }
96950
-
96951
96939
  export class BaseLayerView2D extends LayerView {
96952
96940
  /**
96953
96941
  * The array of {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile Tile} objects computed to cover the MapView's visible area.
@@ -98873,6 +98861,58 @@ declare namespace __esri {
98873
98861
  avgNegativeSlope: number | nullish;
98874
98862
  }
98875
98863
 
98864
+ /**
98865
+ * Types common to the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-analysis-ElevationProfileAnalysisView2D.html ElevationProfileAnalysisView2D} and
98866
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-analysis-ElevationProfileAnalysisView3D.html ElevationProfileAnalysisView3D}.
98867
+ *
98868
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-analysis-ElevationProfile-types.html Read more...}
98869
+ */
98870
+ namespace ElevationProfileTypes {
98871
+ /**
98872
+ * Result of interactively placing an elevation profile line on the view.
98873
+ *
98874
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-analysis-ElevationProfile-types.html#ElevationProfilePlacementResult Read more...}
98875
+ */
98876
+ export interface ElevationProfilePlacementResult {
98877
+ }
98878
+
98879
+ /**
98880
+ * Result of picking a feature from the view to perform an elevation profile analysis.
98881
+ *
98882
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-analysis-ElevationProfile-types.html#ElevationProfilePickResult Read more...}
98883
+ */
98884
+ export interface ElevationProfilePickResult {
98885
+ feature: Graphic;
98886
+ }
98887
+
98888
+ export interface ElevationProfileEffectiveDisplayUnits {
98889
+ distance: LengthUnit;
98890
+ elevation: LengthUnit;
98891
+ }
98892
+ }
98893
+
98894
+ export interface ElevationProfileEffectiveDisplayUnits {
98895
+ distance: LengthUnit;
98896
+ elevation: LengthUnit;
98897
+ }
98898
+
98899
+ /**
98900
+ * Result of picking a feature from the view to perform an elevation profile analysis.
98901
+ *
98902
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-analysis-ElevationProfile-types.html#ElevationProfilePickResult Read more...}
98903
+ */
98904
+ export interface ElevationProfilePickResult {
98905
+ feature: Graphic;
98906
+ }
98907
+
98908
+ /**
98909
+ * Result of interactively placing an elevation profile line on the view.
98910
+ *
98911
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-analysis-ElevationProfile-types.html#ElevationProfilePlacementResult Read more...}
98912
+ */
98913
+ export interface ElevationProfilePlacementResult {
98914
+ }
98915
+
98876
98916
  /**
98877
98917
  * Represents the result of a LengthDimension.
98878
98918
  *
@@ -100470,7 +100510,7 @@ declare namespace __esri {
100470
100510
  */
100471
100511
  queryFeatureCount(query?: QueryProperties, options?: FeatureLayerViewMixinQueryFeatureCountOptions): Promise<number>;
100472
100512
  /**
100473
- * Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the layerView
100513
+ * Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the LayerView
100474
100514
  * and returns a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FeatureSet.html FeatureSet}.
100475
100515
  *
100476
100516
  * @param query Specifies the attributes and spatial filter of the query. When this parameter is not passed to `queryFeatures()` method, then a default query is created using {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CatalogFootprintLayerView.html#createQuery createQuery()} method and all features that pass the layer view {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CatalogFootprintLayerView.html#filter filter} are returned along with their attributes that are {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CatalogFootprintLayerView.html#availableFields available on the client}. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent.
@@ -100707,7 +100747,7 @@ declare namespace __esri {
100707
100747
  */
100708
100748
  queryFeatureCount(query?: QueryProperties, options?: FeatureLayerViewMixinQueryFeatureCountOptions): Promise<number>;
100709
100749
  /**
100710
- * Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the layerView
100750
+ * Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the LayerView
100711
100751
  * and returns a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FeatureSet.html FeatureSet}.
100712
100752
  *
100713
100753
  * @param query Specifies the attributes and spatial filter of the query. When this parameter is not passed to `queryFeatures()` method, then a default query is created using {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#createQuery createQuery()} method and all features that pass the layer view {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#filter filter} are returned along with their attributes that are {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#availableFields available on the client}. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent.
@@ -100995,7 +101035,7 @@ declare namespace __esri {
100995
101035
  */
100996
101036
  queryFeatureCount(query?: QueryProperties, options?: FeatureLayerViewMixinQueryFeatureCountOptions): Promise<number>;
100997
101037
  /**
100998
- * Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the layerView
101038
+ * Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the LayerView
100999
101039
  * and returns a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FeatureSet.html FeatureSet}.
101000
101040
  *
101001
101041
  * @param query Specifies the attributes and spatial filter of the query. When this parameter is not passed to `queryFeatures()` method, then a default query is created using {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#createQuery createQuery()} method and all features that pass the layer view {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#filter filter} are returned along with their attributes that are {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#availableFields available on the client}. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent.
@@ -101120,7 +101160,7 @@ declare namespace __esri {
101120
101160
  */
101121
101161
  queryFeatureCount(query?: QueryProperties, options?: FeatureLayerViewMixinQueryFeatureCountOptions): Promise<number>;
101122
101162
  /**
101123
- * Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the layerView
101163
+ * Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the LayerView
101124
101164
  * and returns a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FeatureSet.html FeatureSet}.
101125
101165
  *
101126
101166
  * @param query Specifies the attributes and spatial filter of the query. When this parameter is not passed to `queryFeatures()` method, then a default query is created using {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerViewMixin.html#createQuery createQuery()} method and all features that pass the layer view {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerViewMixin.html#filter filter} are returned along with their attributes that are {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerViewMixin.html#availableFields available on the client}. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent.
@@ -101318,7 +101358,7 @@ declare namespace __esri {
101318
101358
  */
101319
101359
  queryFeatureCount(query?: QueryProperties, options?: FeatureLayerViewMixinQueryFeatureCountOptions): Promise<number>;
101320
101360
  /**
101321
- * Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the layerView
101361
+ * Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the LayerView
101322
101362
  * and returns a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FeatureSet.html FeatureSet}.
101323
101363
  *
101324
101364
  * @param query Specifies the attributes and spatial filter of the query. When this parameter is not passed to `queryFeatures()` method, then a default query is created using {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-GeoJSONLayerView.html#createQuery createQuery()} method and all features that pass the layer view {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-GeoJSONLayerView.html#filter filter} are returned along with their attributes that are {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-GeoJSONLayerView.html#availableFields available on the client}. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent.
@@ -102023,7 +102063,7 @@ declare namespace __esri {
102023
102063
  */
102024
102064
  queryFeatureCount(query?: QueryProperties, options?: FeatureLayerViewMixinQueryFeatureCountOptions): Promise<number>;
102025
102065
  /**
102026
- * Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the layerView
102066
+ * Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the LayerView
102027
102067
  * and returns a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FeatureSet.html FeatureSet}.
102028
102068
  *
102029
102069
  * @param query Specifies the attributes and spatial filter of the query. When this parameter is not passed to `queryFeatures()` method, then a default query is created using {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-OGCFeatureLayerView.html#createQuery createQuery()} method and all features that pass the layer view {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-OGCFeatureLayerView.html#filter filter} are returned along with their attributes that are {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-OGCFeatureLayerView.html#availableFields available on the client}. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent.
@@ -102227,7 +102267,7 @@ declare namespace __esri {
102227
102267
  */
102228
102268
  queryFeatureCount(query?: QueryProperties, options?: FeatureLayerViewMixinQueryFeatureCountOptions): Promise<number>;
102229
102269
  /**
102230
- * Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the layerView
102270
+ * Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the LayerView
102231
102271
  * and returns a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FeatureSet.html FeatureSet}.
102232
102272
  *
102233
102273
  * @param query Specifies the attributes and spatial filter of the query. When this parameter is not passed to `queryFeatures()` method, then a default query is created using {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ParquetLayerView.html#createQuery createQuery()} method and all features that pass the layer view {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ParquetLayerView.html#filter filter} are returned along with their attributes that are {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ParquetLayerView.html#availableFields available on the client}. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent.
@@ -102972,7 +103012,7 @@ declare namespace __esri {
102972
103012
  */
102973
103013
  queryFeatureCount(query?: QueryProperties, options?: FeatureLayerViewMixinQueryFeatureCountOptions): Promise<number>;
102974
103014
  /**
102975
- * Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the layerView
103015
+ * Executes a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html Query} against features available for drawing in the LayerView
102976
103016
  * and returns a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FeatureSet.html FeatureSet}.
102977
103017
  *
102978
103018
  * @param query Specifies the attributes and spatial filter of the query. When this parameter is not passed to `queryFeatures()` method, then a default query is created using {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-WFSLayerView.html#createQuery createQuery()} method and all features that pass the layer view {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-WFSLayerView.html#filter filter} are returned along with their attributes that are {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-WFSLayerView.html#availableFields available on the client}. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent.
package/kernel.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.0";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.0.0-next.16",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
5
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.0";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.0.0-next.17",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../request.js";import{deprecatedModule as r}from"../core/deprecate.js";import o from"../core/Error.js";import{JSONMap as a}from"../core/jsonMap.js";import s from"../core/Logger.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import p from"../geometry/Point.js";import g from"../geometry/SpatialReference.js";import u from"./BaseTileLayer.js";import{BlendLayer as d}from"./mixins/BlendLayer.js";import{OperationalLayer as y}from"./mixins/OperationalLayer.js";import c from"./support/LOD.js";import m from"./support/TileInfo.js";const h=new a({BingMapsAerial:"aerial",BingMapsRoad:"road",BingMapsHybrid:"hybrid"}),b="https://dev.virtualearth.net";r(s.getLogger("esri.layers.BingMapsLayer"),"esri.layers.BingMapsLayer",{version:"4.33",warnOnce:!0});let w=class extends(d(y(i(u)))){constructor(e){super(e),this.type="bing-maps",this.tileInfo=new m({size:[256,256],dpi:96,origin:new p({x:-20037508.342787,y:20037508.342787,spatialReference:g.WebMercator}),spatialReference:g.WebMercator,lods:[new c({level:1,resolution:78271.5169639999,scale:295828763.795777}),new c({level:2,resolution:39135.7584820001,scale:147914381.897889}),new c({level:3,resolution:19567.8792409999,scale:73957190.948944}),new c({level:4,resolution:9783.93962049996,scale:36978595.474472}),new c({level:5,resolution:4891.96981024998,scale:18489297.737236}),new c({level:6,resolution:2445.98490512499,scale:9244648.868618}),new c({level:7,resolution:1222.99245256249,scale:4622324.434309}),new c({level:8,resolution:611.49622628138,scale:2311162.217155}),new c({level:9,resolution:305.748113140558,scale:1155581.108577}),new c({level:10,resolution:152.874056570411,scale:577790.554289}),new c({level:11,resolution:76.4370282850732,scale:288895.277144}),new c({level:12,resolution:38.2185141425366,scale:144447.638572}),new c({level:13,resolution:19.1092570712683,scale:72223.819286}),new c({level:14,resolution:9.55462853563415,scale:36111.909643}),new c({level:15,resolution:4.77731426794937,scale:18055.954822}),new c({level:16,resolution:2.38865713397468,scale:9027.977411}),new c({level:17,resolution:1.19432856685505,scale:4513.988705}),new c({level:18,resolution:.597164283559817,scale:2256.994353}),new c({level:19,resolution:.298582141647617,scale:1128.497176}),new c({level:20,resolution:.1492910708238085,scale:564.248588})]}),this.key=null,this.style="road",this.culture="en-US",this.region=null,this.portalUrl=null,this.hasAttributionData=!0}get bingMetadata(){return this._get("bingMetadata")}set bingMetadata(e){this._set("bingMetadata",e)}get copyright(){return null!=this.bingMetadata?this.bingMetadata.copyright:null}get operationalLayerType(){return h.toJSON(this.style)}get bingLogo(){return null!=this.bingMetadata?this.bingMetadata.brandLogoUri:null}load(e){return this.key?this.addResolvingPromise(this._getMetadata()):this.portalUrl?this.addResolvingPromise(this._getPortalBingKey().then(()=>this._getMetadata())):this.addResolvingPromise(Promise.reject(new o("bingmapslayer:load","Bing layer must have bing key."))),Promise.resolve(this)}getTileUrl(e,t,r){if(!this.loaded||null==this.bingMetadata)return null;const o=this.bingMetadata.resourceSets[0].resources[0],a=o.imageUrlSubdomains[t%o.imageUrlSubdomains.length],s=this._getQuadKey(e,t,r);return o.imageUrl.replace("{subdomain}",a).replace("{quadkey}",s)}async fetchAttributionData(){return this.load().then(()=>{if(null==this.bingMetadata)return null;return{contributors:this.bingMetadata.resourceSets[0].resources[0].imageryProviders.map(e=>({attribution:e.attribution,coverageAreas:e.coverageAreas.map(e=>({zoomMin:e.zoomMin,zoomMax:e.zoomMax,score:1,bbox:[e.bbox[0],e.bbox[1],e.bbox[2],e.bbox[3]]}))}))}})}_getMetadata(){const e={road:"roadOnDemand",aerial:"aerial",hybrid:"aerialWithLabelsOnDemand"}[this.style];return t(`${b}/REST/v1/Imagery/Metadata/${e}`,{responseType:"json",query:{include:"ImageryProviders",uriScheme:"https",key:this.key,suppressStatus:!0,output:"json",culture:this.culture,userRegion:this.region}}).then(e=>{const t=e.data;if(200!==t.statusCode)throw new o("bingmapslayer:getmetadata",t.statusDescription);if(this.bingMetadata=t,0===this.bingMetadata.resourceSets.length)throw new o("bingmapslayer:getmetadata","no bing resourcesets");if(0===this.bingMetadata.resourceSets[0].resources.length)throw new o("bingmapslayer:getmetadata","no bing resources")}).catch(e=>{throw new o("bingmapslayer:getmetadata",e.message)})}_getPortalBingKey(){return t(this.portalUrl??"",{responseType:"json",authMode:"no-prompt",query:{f:"json"}}).then(e=>{if(!e.data.bingKey)throw new o("bingmapslayer:getportalbingkey","The referenced Portal does not contain a valid bing key");this.key=e.data.bingKey}).catch(e=>{throw new o("bingmapslayer:getportalbingkey",e.message)})}_getQuadKey(e,t,r){let o="";for(let a=e;a>0;a--){let e=0;const s=1<<a-1;0!==(r&s)&&(e+=1),0!==(t&s)&&(e+=2),o+=e.toString()}return o}};e([n({json:{read:!1,write:!1},value:null})],w.prototype,"bingMetadata",null),e([n({json:{read:!1,write:!1},value:"bing-maps",readOnly:!0})],w.prototype,"type",void 0),e([n({type:m})],w.prototype,"tileInfo",void 0),e([n({type:String,readOnly:!0,json:{read:!1,write:!1}})],w.prototype,"copyright",null),e([n({type:String,json:{write:!1,read:!1}})],w.prototype,"key",void 0),e([n({type:h.apiValues,nonNullable:!0,json:{read:{source:"layerType",reader:h.read}}})],w.prototype,"style",void 0),e([n({type:["BingMapsAerial","BingMapsHybrid","BingMapsRoad"]})],w.prototype,"operationalLayerType",null),e([n({type:String,json:{write:!1,read:!1}})],w.prototype,"culture",void 0),e([n({type:String,json:{write:!1,read:!1}})],w.prototype,"region",void 0),e([n({type:String,json:{write:!0,read:!0}})],w.prototype,"portalUrl",void 0),e([n({type:Boolean,json:{write:!1,read:!1}})],w.prototype,"hasAttributionData",void 0),e([n({type:String,readOnly:!0})],w.prototype,"bingLogo",null),w=e([l("esri.layers.BingMapsLayer")],w);const v=w;export{v as default};
5
+ import{__decorate as e}from"tslib";import t from"../request.js";import{deprecatedModule as r}from"../core/deprecate.js";import o from"../core/Error.js";import{JSONMap as a}from"../core/jsonMap.js";import i from"../core/Logger.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import p from"../geometry/Point.js";import g from"../geometry/SpatialReference.js";import u from"./BaseTileLayer.js";import{BlendLayer as d}from"./mixins/BlendLayer.js";import{OperationalLayer as y}from"./mixins/OperationalLayer.js";import c from"./support/LOD.js";import m from"./support/TileInfo.js";const h=new a({BingMapsAerial:"aerial",BingMapsRoad:"road",BingMapsHybrid:"hybrid"}),b="https://dev.virtualearth.net";r(i.getLogger("esri.layers.BingMapsLayer"),"esri.layers.BingMapsLayer",{version:"4.33",warnOnce:!0});let w=class extends(d(y(s(u)))){constructor(e){super(e),this.type="bing-maps",this.tileInfo=new m({size:[256,256],dpi:96,origin:new p({x:-20037508.342787,y:20037508.342787,spatialReference:g.WebMercator}),spatialReference:g.WebMercator,lods:[new c({level:1,resolution:78271.5169639999,scale:295828763.795777}),new c({level:2,resolution:39135.7584820001,scale:147914381.897889}),new c({level:3,resolution:19567.8792409999,scale:73957190.948944}),new c({level:4,resolution:9783.93962049996,scale:36978595.474472}),new c({level:5,resolution:4891.96981024998,scale:18489297.737236}),new c({level:6,resolution:2445.98490512499,scale:9244648.868618}),new c({level:7,resolution:1222.99245256249,scale:4622324.434309}),new c({level:8,resolution:611.49622628138,scale:2311162.217155}),new c({level:9,resolution:305.748113140558,scale:1155581.108577}),new c({level:10,resolution:152.874056570411,scale:577790.554289}),new c({level:11,resolution:76.4370282850732,scale:288895.277144}),new c({level:12,resolution:38.2185141425366,scale:144447.638572}),new c({level:13,resolution:19.1092570712683,scale:72223.819286}),new c({level:14,resolution:9.55462853563415,scale:36111.909643}),new c({level:15,resolution:4.77731426794937,scale:18055.954822}),new c({level:16,resolution:2.38865713397468,scale:9027.977411}),new c({level:17,resolution:1.19432856685505,scale:4513.988705}),new c({level:18,resolution:.597164283559817,scale:2256.994353}),new c({level:19,resolution:.298582141647617,scale:1128.497176}),new c({level:20,resolution:.1492910708238085,scale:564.248588})]}),this.key=null,this.style="road",this.culture="en-US",this.region=null,this.portalUrl=null,this.hasAttributionData=!0}get bingMetadata(){return this._get("bingMetadata")}set bingMetadata(e){this._set("bingMetadata",e)}get copyright(){return null!=this.bingMetadata?this.bingMetadata.copyright:null}get operationalLayerType(){return h.toJSON(this.style)}get bingLogo(){return null!=this.bingMetadata?this.bingMetadata.brandLogoUri:null}load(e){return this.key?this.addResolvingPromise(this._getMetadata()):this.portalUrl?this.addResolvingPromise(this._getPortalBingKey().then(()=>this._getMetadata())):this.addResolvingPromise(Promise.reject(new o("bingmapslayer:load","Bing layer must have bing key."))),Promise.resolve(this)}getTileUrl(e,t,r){if(!this.loaded||null==this.bingMetadata)return null;const o=this.bingMetadata.resourceSets[0].resources[0],a=o.imageUrlSubdomains[t%o.imageUrlSubdomains.length],i=this._getQuadKey(e,t,r);return o.imageUrl.replace("{subdomain}",a).replace("{quadkey}",i)}async fetchAttributionData(){return this.load().then(()=>{if(null==this.bingMetadata)return null;return{contributors:this.bingMetadata.resourceSets[0].resources[0].imageryProviders.map(e=>({attribution:e.attribution,coverageAreas:e.coverageAreas.map(e=>({zoomMin:e.zoomMin-(e.zoomMin?1:0),zoomMax:e.zoomMax-(e.zoomMin?1:0),score:1,bbox:[e.bbox[0],e.bbox[1],e.bbox[2],e.bbox[3]]}))}))}})}_getMetadata(){const e={road:"roadOnDemand",aerial:"aerial",hybrid:"aerialWithLabelsOnDemand"}[this.style];return t(`${b}/REST/v1/Imagery/Metadata/${e}`,{responseType:"json",query:{include:"ImageryProviders",uriScheme:"https",key:this.key,suppressStatus:!0,output:"json",culture:this.culture,userRegion:this.region}}).then(e=>{const t=e.data;if(200!==t.statusCode)throw new o("bingmapslayer:getmetadata",t.statusDescription);if(this.bingMetadata=t,0===this.bingMetadata.resourceSets.length)throw new o("bingmapslayer:getmetadata","no bing resourcesets");if(0===this.bingMetadata.resourceSets[0].resources.length)throw new o("bingmapslayer:getmetadata","no bing resources")}).catch(e=>{throw new o("bingmapslayer:getmetadata",e.message)})}_getPortalBingKey(){return t(this.portalUrl??"",{responseType:"json",authMode:"no-prompt",query:{f:"json"}}).then(e=>{if(!e.data.bingKey)throw new o("bingmapslayer:getportalbingkey","The referenced Portal does not contain a valid bing key");this.key=e.data.bingKey}).catch(e=>{throw new o("bingmapslayer:getportalbingkey",e.message)})}_getQuadKey(e,t,r){let o="";for(let a=e;a>0;a--){let e=0;const i=1<<a-1;0!==(r&i)&&(e+=1),0!==(t&i)&&(e+=2),o+=e.toString()}return o}};e([n({json:{read:!1,write:!1},value:null})],w.prototype,"bingMetadata",null),e([n({json:{read:!1,write:!1},value:"bing-maps",readOnly:!0})],w.prototype,"type",void 0),e([n({type:m})],w.prototype,"tileInfo",void 0),e([n({type:String,readOnly:!0,json:{read:!1,write:!1}})],w.prototype,"copyright",null),e([n({type:String,json:{write:!1,read:!1}})],w.prototype,"key",void 0),e([n({type:h.apiValues,nonNullable:!0,json:{read:{source:"layerType",reader:h.read}}})],w.prototype,"style",void 0),e([n({type:["BingMapsAerial","BingMapsHybrid","BingMapsRoad"]})],w.prototype,"operationalLayerType",null),e([n({type:String,json:{write:!1,read:!1}})],w.prototype,"culture",void 0),e([n({type:String,json:{write:!1,read:!1}})],w.prototype,"region",void 0),e([n({type:String,json:{write:!0,read:!0}})],w.prototype,"portalUrl",void 0),e([n({type:Boolean,json:{write:!1,read:!1}})],w.prototype,"hasAttributionData",void 0),e([n({type:String,readOnly:!0})],w.prototype,"bingLogo",null),w=e([l("esri.layers.BingMapsLayer")],w);const v=w;export{v as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../request.js";import i from"../core/Accessor.js";import s from"../core/Logger.js";import{isAbortError as r}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{addFrameTask as n}from"../core/scheduling.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{isGeographic as d}from"../geometry/support/spatialReferenceUtils.js";import h from"../geometry/support/WKIDUnitConversion.js";import{wasmFailedToInit as _,invalidLayerView as u}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as y}from"./Lyr3DWorkerHandle.js";import{loadLyr3DMainWASM as c}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as g}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as m}from"../views/3d/layers/support/makeScheduleFunction.js";const w=3857,b=32662,p=4326,f=5773,M=115700;let L=class extends i{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._viewSR=null,this._debugFlags=new Set,this._debugLevel=0,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,t,i,r=!0){if(this._debugFlags.has(e)&&this._debugLevel>=t){const e=r?`[js] ${i}`:`${i}`;0===t||1===t?s.getLogger(this).error(e):2===t&&s.getLogger(this).warn(e),s.getLogger(this).info(e)}}initialize(){this._debugLevel>2&&(s.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([a(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera())]),this._pulseTaskHandle=n({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach(e=>{e.abortController.abort()}),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null);const e=this._workerHandle;e&&e.destroyWasm().then(()=>{this._workerHandle?.destroy(),this._workerHandle=null}),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}addLayerView(e){return this._lyr3DMain?this._addLayerView(e):(this._debugLog(0,1,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),{wasmLayerId:_})}removeLayerView(e){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const t=this._layers.size;return 0===t&&(this._debugLog(0,3,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),t}getValidLayerViewCount(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;let e=0;return this._layers.forEach(t=>{t.layerView.wasmLayerId>=0&&++e}),e}setEnabled(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const i=this._layers.get(e.wasmLayerId);i&&(this._lyr3DMain.set_enabled(e.wasmLayerId,t),i.needMemoryUsageUpdate=!0,i.needFrame=!0,i.layerView.updatingFlagChanged())}setLayerOffset(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,t)}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,t,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,t,i)}setMeshModifications(e,t,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const s=this._layers.get(e.wasmLayerId);if(s){const r=this._lyr3DMain._malloc(8*t.length),a=new Float64Array(this._lyr3DMain.HEAPF64.buffer,r,t.length);for(let e=0;e<t.length;++e)a[e]=t[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,r,t.length,i),this._lyr3DMain._free(r),s.needFrame=!0,s.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const t=this._layers.get(e);return!!t&&(t.outstandingJobCount>0||t.outstandingRenderableCount>0||t.needFrame)}initializeWasm(e,t){return this._lyr3DMain?Promise.resolve():this.view.renderSpatialReference?(this._debugLog(0,3,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=c().then(i=>{this._lyr3DMain=i,this._lyr3DMainPromise=null;const s=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),r=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii");if(!this.view.renderSpatialReference)return void(this._lyr3DMain=null);this._viewSR=this.view.renderSpatialReference?.toJSON();const l="global"===this.view.viewingMode?5:3;if(5===l)this._viewSR.wkid=this._viewSR.latestWkid=p,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=f;else if(this.view.renderSpatialReference?.isWebMercator)this._viewSR.wkid=this._viewSR.latestWkid=w,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=f;else if(this.view.renderSpatialReference?.wkid===b)this._viewSR.wkid=this._viewSR.latestWkid=p,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=f;else if(!this._viewSR.latestVcsWkid&&!this._viewSR.vcsWkid){const e=this.view.heightModelInfo?.heightModel,t=!e||"gravity-related-height"===e;this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=t?f:M}return this._lyr3DMain.initialize_lyr3d_wasm(o,s,r,a,n,e,t,l,this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),Math.max(this._debugLevel,0))?(this._workerHandle=new y(m(this.view.resourceController)),this._workerHandle.promise?this._workerHandle.promise:void 0):(this._lyr3DMain=null,void this._debugLog(0,0,"Lyr3d Main WASM failed to initialize",!1))}).catch(e=>{this._debugLog(0,0,`Lyr3d WASM failed to download error = ${e}`,!1)})),this._lyr3DMainPromise):Promise.reject()}_pulseTask(){if(this._lyr3DMain){let e=0,t=0;this._layers.forEach(i=>{e+=i.layerView.usedMemory,t+=i.layerView.cachedMemory}),e/=1048576,t/=1048576;const i=this.view.resourceController.memoryController,s=i.usedMemory*i.maxMemory-e;this._lyr3DMain.frame_pulse(i.memoryFactor,e,t,s,i.maxMemory),this._layers.forEach(e=>{!0===e.needFrame&&(e.needFrame=!1,e.layerView.updatingFlagChanged())})}}_incrementJobCount(e){e.outstandingJobCount+=1,1===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_decrementJobCount(e){e.outstandingJobCount-=1,0===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){e.outstandingRenderableCount+=1,e.outstandingJobCount<1&&1===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){e.outstandingRenderableCount-=1,e.outstandingJobCount<1&&0===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_onJobFailed(e,t,i){t.error.length&&this._debugLog(1,1,t.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(i.jobId,i.desc),this._decrementJobCount(e)}_onJobSucceeded(e,t,i){if(this._lyr3DMain){const e=t.data.byteLength,s=this._lyr3DMain._malloc(e);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,s,e).set(t.data),this._lyr3DMain.on_job_completed(i.jobId,t.jobDescJson,s,e),this._lyr3DMain._free(s)}this._decrementJobCount(e)}_getRequestPromises(e,i,s,r){const a=[];for(const n of e){const e=new URL(n);if("integrated-mesh-3dtiles"===r.type){if(e.origin===s.origin&&e.pathname===s.pathname){if(r.rootTileset){a.push(Promise.resolve(r.rootTileset.slice()));continue}}else r.session&&e.searchParams.append("session",r.session)}a.push(t(e.toString(),i).then(e=>e.data))}return a}_getInitialPromise(e,t,i,s,a,n,o){const l=this._getRequestPromises(e.urls,t,i,s);return Promise.all(l).then(e=>(a.inputs=e,this._workerHandle.invoke(a,n))).then(e=>e).catch(t=>{let i=1;return r(t)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):o&&400===t.details?.httpStatus?(i=3,this._debugLog(1,2,"Session expired, trying to create new Session.")):this._debugLog(1,1,`job ${e.jobId} failed with error ${t}.`),{status:i,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}})}async _onNewJob(){const e=this._lyr3DMain.get_next_job(),t=this._layers.get(e.layerId);if(!t)return;this._incrementJobCount(t);const i=t.abortController.signal,s=t.layerView.layer,a="integrated-mesh-3dtiles"===s.type?s.key:null,n="integrated-mesh-3dtiles"===s.type?s.session:null,o={responseType:"array-buffer",signal:i,query:{...t.customParameters,token:t.apiKey,key:a}},l={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},d=new URL(s.url),h=a=>{if(1===a.status)this._onJobFailed(t,a,e);else if(0===a.status)this._onJobSucceeded(t,a,e);else if(2===a.status){const n=this._getRequestPromises(a.missingInputUrls,o,d,s);Promise.all(n).then(e=>{l.jobDescJson=a.jobDescJson,a.originalInputs?l.inputs=a.originalInputs:l.inputs=[],l.isMissingResourceCase=!0;for(const t of e)l.inputs.push(t);return this._workerHandle.invoke(l,i)}).then(i=>{1===i.status?this._onJobFailed(t,i,e):0===i.status&&this._onJobSucceeded(t,i,e)}).catch(i=>{this._decrementJobCount(t),r(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error2 ${i}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)})}};try{const t=await this._getInitialPromise(e,o,d,s,l,i,n);if(3===t.status&&"integrated-mesh-3dtiles"===s.type){n===s.session&&null!==s.session&&await s.requestRootAndSession(i);h(await this._getInitialPromise(e,o,d,s,l,i,s.session))}else h(t)}catch(_){_&&this._debugLog(1,1,_.toString(),!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc),this._decrementJobCount(t)}}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),t=e.meshData;if(t.data&&t.data.byteLength>0){const e=t.data.slice();t.data=e}const i=this._layers.get(e.layerId);i&&(this._incrementRenderableCount(i),i.layerView.createRenderable(e).then(t=>{this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!0,e.layerId,e.handle,t.memUsageBytes),this._decrementRenderableCount(i)}).catch(t=>{r(t)||this._debugLog(2,1,`createRenderable failed with error ${t}.`),this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!1,e.layerId,e.handle,0),this._decrementRenderableCount(i)}))}_freeRenderables(e,t,i){if(i<1)return;const s=this._layers.get(e);if(!s)return;const r=s.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,i);for(let o=0;o<i;++o)a.push(n[o]);for(let o=0;o<i;++o)r.freeRenderable(a[o])}_setRenderableVisibility(e,t,i,s){if(s<1)return;const r=this._layers.get(e);if(!r)return;const a=r.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,s),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,i,s);for(let h=0;h<s;++h)n.push(l[h]),o.push(1===d[h]);a.setRenderableVisibility(n,o,s)}_onWasmError(e,t,i,s){this._lyr3DMain&&this._debugLog(i,s,this._lyr3DMain.UTF8ToString(e,t),!1)}_doRemoveLayerView(e){const t=this._layers.get(e.wasmLayerId);return!!t&&(t.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._layers.delete(e.wasmLayerId),!0)}_isGaussianSplatLayerView(e){return"gaussian-splat"===e.layer.type}_isGaussianSplatLayer(e){return"gaussian-splat"===e.type}_addLayerView(e){const t=e.layer;if(!t.url||!t.rootTilesetJSON)return{wasmLayerId:u};const i="integrated-mesh-3dtiles"===t.type?0:2,r=this._lyr3DMain.validate_root_tileset(JSON.stringify(t.rootTilesetJSON),i);if(0!==r.errorCode)return{wasmLayerId:u,check:r};const a=this._lyr3DMain.get_next_layer_id(),n=new AbortController;this._layers.set(a,{layerView:e,abortController:n,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:t.customParameters,apiKey:t.apiKey,needFrame:!1});const o=g(t.elevationInfo),l=e=>s.getLogger(this).error("add-spatial-reference-error","Error when adding SR:",e);let _=!1;if(this._isGaussianSplatLayerView(e)&&this._isGaussianSplatLayer(t)){let i=t.spatialReference;if(e.useEsriCrs&&t.esriCrsSpatialReference){i=t.esriCrsSpatialReference;const s=d(i);let r=1,a=1;!s&&i.wkid&&-1!==i.wkid&&(r=h.values[h[i.wkid]],a=e.metersPerVCSUnit),this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(i)),s,r,a).catch(l)}_=this._lyr3DMain.add_gaussian_splat_layer(t.url,a,o)}else _=this._lyr3DMain.add_3dtiles_layer(t.url,a,o);return _?(this._updateWasmCamera(),{wasmLayerId:a}):(this._layers.delete(a),{wasmLayerId:u})}_updateWasmCamera(){const e=this.view.state?.contentCamera;if(!e||!this._lyr3DMain)return;const{eye:t,center:i,up:s,near:r,far:a,fovY:n}=e,o=[e.viewport[2],e.viewport[3]],l=e.width/e.height;this._lyr3DMain.set_camera_parameters({eye:t,center:i,up:s,near:r,far:a,fov:n,aspectRatio:l,viewport:o})}_makeSRWasmSerializable(e){return{wkid:e?.wkid??-1,latestWkid:e?.latestWkid??-1,vcsWkid:e?.vcsWkid??-1,latestVcsWkid:e?.latestVcsWkid??-1,wkt:e?.wkt??""}}_cleanUpSR(e){return-1===e?.wkid&&e.latestWkid&&-1!==e.latestWkid?e.wkid=e.latestWkid:-1===e?.latestWkid&&e.wkid&&-1!==e.wkid&&(e.latestWkid=e.wkid),-1===e?.vcsWkid&&e.latestVcsWkid&&-1!==e.latestVcsWkid?e.vcsWkid=e.latestVcsWkid:-1===e?.latestVcsWkid&&e.vcsWkid&&-1!==e.vcsWkid&&(e.latestVcsWkid=e.vcsWkid),e}};e([o({constructOnly:!0})],L.prototype,"view",void 0),L=e([l("esri.layers.Lyr3DWasmPerSceneView")],L);const v=L;export{v as default};
5
+ import{__decorate as e}from"tslib";import i from"../request.js";import t from"../core/Accessor.js";import s from"../core/Logger.js";import{isAbortError as r}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{addFrameTask as n}from"../core/scheduling.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{isGeographic as d}from"../geometry/support/spatialReferenceUtils.js";import h from"../geometry/support/WKIDUnitConversion.js";import{wasmFailedToInit as _,invalidLayerView as y}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as u}from"./Lyr3DWorkerHandle.js";import{loadLyr3DMainWASM as c}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as m}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as g}from"../views/3d/layers/support/makeScheduleFunction.js";const w=3857,p=32662,f=4326,b=5773,D=115700;let M=class extends t{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._viewSR=null,this._lyr3DBusyCount=0,this._debugFlags=new Set,this._debugLevel=2,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,i,t,r=!0){if(this._debugFlags.has(e)&&this._debugLevel>=i){const e=r?`[js] ${t}`:`${t}`;0===i||1===i?s.getLogger(this).error(e):2===i&&s.getLogger(this).warn(e),s.getLogger(this).info(e)}}initialize(){this._debugLevel>2&&(s.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([a(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera())]),this._pulseTaskHandle=n({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach(e=>{e.abortController.abort()}),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null);const e=this._workerHandle;e&&e.destroyWasm().then(()=>{this._workerHandle?.destroy(),this._workerHandle=null}),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}addLayerView(e){return this._lyr3DMain?this._addLayerView(e):(this._debugLog(0,1,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),{wasmLayerId:_})}removeLayerView(e){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const i=this._layers.size;return 0===i&&(this._debugLog(0,3,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),i}getValidLayerViewCount(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;let e=0;return this._layers.forEach(i=>{i.layerView.wasmLayerId>=0&&++e}),e}setEnabled(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);if(t){this._lyr3DMain.set_enabled(e.wasmLayerId,i),t.needMemoryUsageUpdate=!0;const s=t.needFrame||this._lyr3DBusyCount>0;t.needFrame=!0,s||t.layerView.updatingFlagChanged()}}setLayerOffset(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,i)}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,i,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,i,t)}setMeshModifications(e,i,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const s=this._layers.get(e.wasmLayerId);if(s){const r=this._lyr3DMain._malloc(8*i.length),a=new Float64Array(this._lyr3DMain.HEAPF64.buffer,r,i.length);for(let e=0;e<i.length;++e)a[e]=i[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,r,i.length,t),this._lyr3DMain._free(r);const n=s.needFrame||this._lyr3DBusyCount>0;s.needFrame=!0,n||s.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const i=this._layers.get(e);return!!i&&(i.needFrame||this._lyr3DBusyCount>0)}initializeWasm(e,i){return this._lyr3DMain?Promise.resolve():this.view.renderSpatialReference?(this._debugLog(0,3,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=c().then(t=>{this._lyr3DMain=t,this._lyr3DMainPromise=null;const s=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),r=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii");if(!this.view.renderSpatialReference)return void(this._lyr3DMain=null);this._viewSR=this.view.renderSpatialReference?.toJSON();const l="global"===this.view.viewingMode?5:3;if(5===l)this._viewSR.wkid=this._viewSR.latestWkid=f,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=b;else if(this.view.renderSpatialReference?.isWebMercator)this._viewSR.wkid=this._viewSR.latestWkid=w,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=b;else if(this.view.renderSpatialReference?.wkid===p)this._viewSR.wkid=this._viewSR.latestWkid=f,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=b;else if(!this._viewSR.latestVcsWkid&&!this._viewSR.vcsWkid){const e=this.view.heightModelInfo?.heightModel,i=!e||"gravity-related-height"===e;this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=i?b:D}return this._lyr3DMain.initialize_lyr3d_wasm(o,s,r,a,n,e,i,l,this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),Math.max(this._debugLevel,0))?(this._workerHandle=new u(g(this.view.resourceController)),this._workerHandle.promise?this._workerHandle.promise:void 0):(this._lyr3DMain=null,void this._debugLog(0,0,"Lyr3d Main WASM failed to initialize",!1))}).catch(e=>{this._debugLog(0,0,`Lyr3d WASM failed to download error = ${e}`,!1)})),this._lyr3DMainPromise):Promise.reject()}setLodPixelThreshold(e,i){this._lyr3DMain?.set_lod_pixel_threshold(i);const t=this._layers.get(e.wasmLayerId);t&&(t.needFrame=!0)}_pulseTask(){if(this._lyr3DMain){let e=0,i=0;this._layers.forEach(t=>{e+=t.layerView.usedMemory,i+=t.layerView.cachedMemory}),e/=1048576,i/=1048576;const t=this.view.resourceController.memoryController,s=t.usedMemory*t.maxMemory-e,r=this._lyr3DBusyCount>0;this._lyr3DBusyCount=this._lyr3DMain.frame_pulse(t.memoryFactor,e,i,s,t.maxMemory);const a=this._lyr3DBusyCount>0;this._layers.forEach(e=>{const i=(r||e.needFrame)!==a;e.needFrame=!1,i&&e.layerView.updatingFlagChanged()})}}_onJobFailed(e,i){e.error.length&&this._debugLog(1,1,e.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(i.jobId,i.desc)}_onJobSucceeded(e,i){if(this._lyr3DMain){const t=e.data.byteLength,s=this._lyr3DMain._malloc(t);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,s,t).set(e.data),this._lyr3DMain.on_job_completed(i.jobId,e.jobDescJson,s,t),this._lyr3DMain._free(s)}}_getRequestPromises(e,t,s,r){const a=[];for(const n of e){const e=new URL(n);if("integrated-mesh-3dtiles"===r.type){if(e.origin===s.origin&&e.pathname===s.pathname){if(r.rootTileset){a.push(Promise.resolve(r.rootTileset.slice()));continue}}else r.session&&e.searchParams.append("session",r.session)}a.push(i(e.toString(),t).then(e=>e.data))}return a}_getInitialPromise(e,i,t,s,a,n,o){const l=this._getRequestPromises(e.urls,i,t,s);return Promise.all(l).then(e=>(a.inputs=e,this._workerHandle.invoke(a,n))).then(e=>e).catch(i=>{let t=1;return r(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):o&&400===i.details?.httpStatus?(t=3,this._debugLog(1,2,"Session expired, trying to create new Session.")):this._debugLog(1,1,`job ${e.jobId} failed with error ${i}.`),{status:t,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}})}async _onNewJob(){const e=this._lyr3DMain.get_next_job(),i=this._layers.get(e.layerId);if(!i)return;const t=i.abortController.signal,s=i.layerView.layer,a="integrated-mesh-3dtiles"===s.type?s.key:null,n="integrated-mesh-3dtiles"===s.type?s.session:null,o={responseType:"array-buffer",signal:t,query:{...i.customParameters,token:i.apiKey,key:a}},l={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},d=new URL(s.url),h=i=>{if(1===i.status)this._onJobFailed(i,e);else if(0===i.status)this._onJobSucceeded(i,e);else if(2===i.status){const a=this._getRequestPromises(i.missingInputUrls,o,d,s);Promise.all(a).then(e=>{l.jobDescJson=i.jobDescJson,i.originalInputs?l.inputs=i.originalInputs:l.inputs=[],l.isMissingResourceCase=!0;for(const i of e)l.inputs.push(i);return this._workerHandle.invoke(l,t)}).then(i=>{1===i.status?this._onJobFailed(i,e):0===i.status&&this._onJobSucceeded(i,e)}).catch(i=>{r(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error2 ${i}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)})}};try{const i=await this._getInitialPromise(e,o,d,s,l,t,n);if(3===i.status&&"integrated-mesh-3dtiles"===s.type){n===s.session&&null!==s.session&&await s.requestRootAndSession(t);h(await this._getInitialPromise(e,o,d,s,l,t,s.session))}else h(i)}catch(_){_&&this._debugLog(1,1,_.toString(),!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)}}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),i=e.meshData;if(i.data&&i.data.byteLength>0){const e=i.data.slice();i.data=e}const t=this._layers.get(e.layerId);t&&t.layerView.createRenderable(e).then(i=>{this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!0,e.layerId,e.handle,i.memUsageBytes)}).catch(i=>{r(i)||this._debugLog(2,1,`createRenderable failed with error ${i}.`),this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!1,e.layerId,e.handle,0)})}_freeRenderables(e,i,t){if(t<1)return;const s=this._layers.get(e);if(!s)return;const r=s.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,i,t);for(let o=0;o<t;++o)a.push(n[o]);for(let o=0;o<t;++o)r.freeRenderable(a[o])}_setRenderableVisibility(e,i,t,s){if(s<1)return;const r=this._layers.get(e);if(!r)return;const a=r.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,i,s),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,t,s);for(let h=0;h<s;++h)n.push(l[h]),o.push(1===d[h]);a.setRenderableVisibility(n,o,s)}_onWasmError(e,i,t,s){this._lyr3DMain&&this._debugLog(t,s,this._lyr3DMain.UTF8ToString(e,i),!1)}_doRemoveLayerView(e){const i=this._layers.get(e.wasmLayerId);return!!i&&(i.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._layers.delete(e.wasmLayerId),!0)}_isGaussianSplatLayerView(e){return"gaussian-splat"===e.layer.type}_isGaussianSplatLayer(e){return"gaussian-splat"===e.type}_toWasmQuality(e){switch(e){case"low":return 1;case"medium":return 2;case"high":return 3}}_addLayerView(e){const i=e.layer;if(!i.url||!i.rootTilesetJSON)return{wasmLayerId:y};const t="integrated-mesh-3dtiles"===i.type?0:2,r=this._lyr3DMain.validate_root_tileset(JSON.stringify(i.rootTilesetJSON),t);if(0!==r.errorCode)return{wasmLayerId:y,check:r};const a=this._lyr3DMain.get_next_layer_id(),n=new AbortController;this._layers.set(a,{layerView:e,abortController:n,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:i.customParameters,apiKey:i.apiKey,needFrame:!1});const o=m(i.elevationInfo),l=this._toWasmQuality(this.view?.qualityProfile),_=e=>s.getLogger(this).error("add-spatial-reference-error","Error when adding SR:",e);let u=!1;if(this._isGaussianSplatLayerView(e)&&this._isGaussianSplatLayer(i)){let t=i.spatialReference;if(e.useEsriCrs&&i.esriCrsSpatialReference){t=i.esriCrsSpatialReference;const s=d(t);let r=1,a=1;!s&&t.wkid&&-1!==t.wkid&&(r=h.values[h[t.wkid]],a=e.metersPerVCSUnit),this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(t)),s,r,a).catch(_)}u=this._lyr3DMain.add_gaussian_splat_layer(l,i.url,a,o)}else u=this._lyr3DMain.add_3dtiles_layer(l,i.url,a,o);return u?(this._updateWasmCamera(),{wasmLayerId:a}):(this._layers.delete(a),{wasmLayerId:y})}_updateWasmCamera(){const e=this.view.state?.contentCamera;if(!e||!this._lyr3DMain)return;const{eye:i,center:t,up:s,near:r,far:a,fovY:n}=e,o=[e.viewport[2],e.viewport[3]],l=e.width/e.height;this._lyr3DMain.set_camera_parameters({eye:i,center:t,up:s,near:r,far:a,fov:n,aspectRatio:l,viewport:o})}_makeSRWasmSerializable(e){return{wkid:e?.wkid??-1,latestWkid:e?.latestWkid??-1,vcsWkid:e?.vcsWkid??-1,latestVcsWkid:e?.latestVcsWkid??-1,wkt:e?.wkt??""}}_cleanUpSR(e){return-1===e?.wkid&&e.latestWkid&&-1!==e.latestWkid?e.wkid=e.latestWkid:-1===e?.latestWkid&&e.wkid&&-1!==e.wkid&&(e.latestWkid=e.wkid),-1===e?.vcsWkid&&e.latestVcsWkid&&-1!==e.latestVcsWkid?e.vcsWkid=e.latestVcsWkid:-1===e?.latestVcsWkid&&e.vcsWkid&&-1!==e.vcsWkid&&(e.latestVcsWkid=e.vcsWkid),e}};e([o({constructOnly:!0})],M.prototype,"view",void 0),M=e([l("esri.layers.Lyr3DWasmPerSceneView")],M);const L=M;export{L as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{project as t}from"../../geometry/projectionUtils.js";import o from"../../geometry/SpatialReference.js";import{containsXY as e,fromValues as r}from"../../geometry/support/aaBoundingRect.js";class n{constructor(t,o,e){this.index=t,this.bbox=o,this.score=e}}function i(t){const o=t.contributors,e={maxKey:0,attributions:[]};if(!o)return e;for(const i of o){if(!i.coverageAreas?.length||!i.attribution)continue;const t=e.attributions.length;e.attributions.push(i.attribution);for(const o of i.coverageAreas){const i=o.bbox,s=new n(t,r(i[1],i[0],i[3],i[2]),o.score??100);for(let t=o.zoomMin;t<=o.zoomMax;t++)e[t]??=[],e[t].push(s)}}return e.maxKey=Math.max.apply(null,Object.keys(e).map(t=>+t).filter(t=>Number.isFinite(t))),e}function s(r,n,i,s){let a=n?.scaleToZoom(i)??0;if(a=Math.min(r.maxKey??0,Math.round(a)),!s||null==a||a<=-1)return"";const c=r[a],{x:u,y:m}=t(s.center.clone().normalize(),o.WGS84),l=new Set;return c?.filter(t=>{const o=!l.has(t.index)&&e(t.bbox,u,m);return o&&l.add(t.index),o}).sort((t,o)=>o.score-t.score||t.index-o.index).map(t=>r.attributions[t.index]).join(", ")??""}export{i as createContributorIndex,s as getDynamicAttribution};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{clone as n}from"../../core/lang.js";import e from"./FieldConfiguration.js";import{isFormattableField as o,fieldFormatFromFieldInfoFormat as t,defaultFieldFormat as s,fieldInfoFormatFromFieldFormat as l}from"./fieldFormatUtils.js";import{isFieldEditable as f}from"./fieldUtils.js";import i from"../../popup/FieldInfo.js";function r(n){const{popupTemplate:l,fieldsIndex:f}=n,i=l?.fieldInfos;if(!i?.length||!f)return;const r=[];for(const{fieldName:a,label:u,format:c}of i){const n=f.get(a);if(!n)continue;const l=u&&u!==n.alias?u:null,i=o(n)?c?t(c,n):s(n,{hour12:"always",useGrouping:"always"}):null;(l||i)&&r.push(new e({name:n.name,alias:l,fieldFormat:i}))}return r.length?r:null}function a(n){const{fields:t}=n;if(!t?.length)return;const l=[];for(const f of t){const n=o(f)?s(f):null;n&&l.push(new e({name:f.name,fieldFormat:n}))}return l.length?l:null}function u(n,e){const{popupTemplate:o,fieldsIndex:t}=n;if(!o||!t)return;const s=c(n,e,o.fieldInfos);if(!s)return;const l=o.clone();return l.fieldInfos=s,l}function c(e,t,s){t??=[],s=n(s)??[];let f=!1;const i=new Map;for(const n of t){const o=e.fieldsIndex.get(n.name);o&&i.set(o.name,n)}for(const n of s){const t=e.fieldsIndex.get(n.fieldName);if(!t)continue;const s=i.get(t.name);n.label=s?.alias||t.alias,n.format=o(t)&&s?.fieldFormat?l(s.fieldFormat,t):null,f=!0,i.delete(t.name)}for(const n of i.values()){const o=m(e,n);o&&(s.push(o),f=!0)}return f?s:null}function m(n,e){const{name:t,alias:s,fieldFormat:r}=e,a=n.fieldsIndex.get(t);if(!a||!s&&!r)return;const u=s||a.alias,c=o(a)&&r?l(r,a):null;return new i({fieldName:a.name,label:u,format:c,visible:!1,isEditable:f(a,n)})}function d(n){const e=new Map;for(const o of n)e.set(o.name.toLowerCase(),o);return e}function p(e,o){if(!o.length)return;const{fieldConfigurations:t}=e,s=t?d(t):null;let l;if(s?.size){l=[];for(const n of o)s.has(n.name.toLowerCase())||l.push(n);if(!l.length)return}else l=o;const f=n(t)??[];f.push(...l),e.fieldConfigurations=f}function g(n,e){const{fieldConfigurations:o}=n;if(!e.length||!o?.length)return;const t=d(e),s=[];let l=!1;for(const f of o){const n=t.get(f.name.toLowerCase());n?(s.push(n),l=!0):s.push(f.clone())}l&&(n.fieldConfigurations=s)}function h(n,e){const{fieldConfigurations:o}=n;if(!e.length||!o?.length)return;const t=new Set(e.map(n=>n.toLowerCase())),s=[];let l=!1;for(const f of o)t.has(f.name.toLowerCase())?l=!0:s.push(f.clone());l&&(n.fieldConfigurations=s)}export{p as addFieldConfigurations,a as fieldConfigurationsFromFields,r as fieldConfigurationsFromPopupTemplate,u as popupTemplateWithFieldConfigurations,h as removeFieldConfigurations,g as replaceFieldConfigurations};
5
+ import{clone as n}from"../../core/lang.js";import e from"./FieldConfiguration.js";import{fieldFormatFromFieldInfo as o,isFormattableField as t,defaultFieldFormat as s,fieldInfoFormatFromFieldFormat as f}from"./fieldFormatUtils.js";import{isFieldEditable as i}from"./fieldUtils.js";import l from"../../popup/FieldInfo.js";function r(n){const{popupTemplate:t,fieldsIndex:s}=n,f=t?.fieldInfos;if(!f?.length||!s)return;const i=[];for(const l of f){const{fieldName:n,label:t}=l,f=s.get(n);if(!f)continue;const r=t&&t!==f.alias?t:null,a=o(l,f);(r||a)&&i.push(new e({name:f.name,alias:r,fieldFormat:a}))}return i.length?i:null}function a(n){const{fields:o}=n;if(!o?.length)return;const f=[];for(const i of o){const n=t(i)?s(i):null;n&&f.push(new e({name:i.name,fieldFormat:n}))}return f.length?f:null}function u(n,e){const{popupTemplate:o,fieldsIndex:t}=n;if(!o||!t)return;const s=c(n,e,o.fieldInfos);if(!s)return;const f=o.clone();return f.fieldInfos=s,f}function c(e,o,s){o??=[],s=n(s)??[];let i=!1;const l=new Map;for(const n of o){const o=e.fieldsIndex.get(n.name);o&&l.set(o.name,n)}for(const n of s){const o=e.fieldsIndex.get(n.fieldName);if(!o)continue;const s=l.get(o.name);n.label=s?.alias||o.alias,n.format=t(o)&&s?.fieldFormat?f(s.fieldFormat,o):null,i=!0,l.delete(o.name)}for(const n of l.values()){const o=m(e,n);o&&(s.push(o),i=!0)}return i?s:null}function m(n,e){const{name:o,alias:s,fieldFormat:r}=e,a=n.fieldsIndex.get(o);if(!a||!s&&!r)return;const u=s||a.alias,c=t(a)&&r?f(r,a):null;return new l({fieldName:a.name,label:u,format:c,visible:!1,isEditable:i(a,n)})}function d(n){const e=new Map;for(const o of n)e.set(o.name.toLowerCase(),o);return e}function p(e,o){if(!o.length)return;const{fieldConfigurations:t}=e,s=t?d(t):null;let f;if(s?.size){f=[];for(const n of o)s.has(n.name.toLowerCase())||f.push(n);if(!f.length)return}else f=o;const i=n(t)??[];i.push(...f),e.fieldConfigurations=i}function g(n,e){const{fieldConfigurations:o}=n;if(!e.length||!o?.length)return;const t=d(e),s=[];let f=!1;for(const i of o){const n=t.get(i.name.toLowerCase());n?(s.push(n),f=!0):s.push(i.clone())}f&&(n.fieldConfigurations=s)}function h(n,e){const{fieldConfigurations:o}=n;if(!e.length||!o?.length)return;const t=new Set(e.map(n=>n.toLowerCase())),s=[];let f=!1;for(const i of o)t.has(i.name.toLowerCase())?f=!0:s.push(i.clone());f&&(n.fieldConfigurations=s)}export{p as addFieldConfigurations,a as fieldConfigurationsFromFields,r as fieldConfigurationsFromPopupTemplate,u as popupTemplateWithFieldConfigurations,h as removeFieldConfigurations,g as replaceFieldConfigurations};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import t from"./DateTimeFieldFormat.js";import e from"./FieldFormat.js";import{isNumericField as n,isDateField as r,isDateOnlyField as o,isTimeOnlyField as a,isTimestampOffsetField as u}from"./fieldUtils.js";import i from"./NumberFieldFormat.js";import s from"../../popup/support/FieldInfoFormat.js";const l={base:e,key:"type",errorContext:"field-configuration-field-format",typeMap:{"date-time":t,number:i}};function c(t,e){const{dateFormat:n}=t;if(!e)return n?f(t):h(t);if(!m(e))return;const r={hour12:"always"};switch(e.type){case"integer":case"small-integer":case"big-integer":case"long":return d(t);case"single":case"double":return h(t);case"date":case"timestamp-offset":return n?f(t):I(e,r);case"date-only":return n?y(t):I(e);case"time-only":return n?g(t):I(e,r)}}function m(t){return n(t)||r(t)||o(t)||a(t)||u(t)}function d(t){return new i({useGrouping:t.digitSeparator?"always":"never"})}function h(t){const e=d(t),{places:n}=t;return e.minimumFractionDigits=n??0,e.maximumFractionDigits=n??2,e}function f(e){return new t({dateStyle:p(e),year:$(e),month:w(e),timeStyle:S(e),hour12:F(e)})}function y(e){return new t({dateStyle:p(e),year:$(e),month:w(e)})}function g(e){return new t({timeStyle:S(e),hour12:F(e)})}function p(t){const{dateFormat:e}=t;return e?e.startsWith("short-date")?"short":e.startsWith("day-short-month-year")?"medium":e.startsWith("long-month-day-year")?"long":e.startsWith("long-date")?"full":null:null}function F(t){return t.dateFormat?.endsWith("-24")?"never":"always"}function w(t){switch(t.dateFormat){case"short-month-year":return"short";case"long-month-year":return"long";default:return null}}function S(t){const{dateFormat:e}=t;return e?e.includes("short-time")?"short":e.includes("long-time")?"medium":null:null}function $(t){switch(t.dateFormat){case"short-month-year":case"long-month-year":case"year":return"numeric";default:return null}}function b(t,e){const n="number"===t.type,r="date-time"===t.type;if(!e)return n?x(t):r?j(t):null;if(m(e))switch(e.type){case"integer":case"small-integer":case"big-integer":case"long":return n?D(t):null;case"single":case"double":return n?x(t):null;case"date":case"timestamp-offset":return r?j(t):null;case"date-only":return r?v(t):null;case"time-only":return r?G(t):null}}function D(t){return new s({digitSeparator:"never"!==t.useGrouping})}function x(t){const e=D(t);return e.places=t.maximumFractionDigits,e}function j(t){let e;const n=W(t),r=k(t),o="never"===t.hour12?"24":null,a="numeric"===t.year?"year":null,u=C(t);return n&&r&&o?e=`${n}-${r}-${o}`:n&&r?e=`${n}-${r}`:n?e=n:a&&u?e=`${u}-${a}`:a&&(e=a),e?new s({dateFormat:e}):null}function v(t){let e;const n=W(t),r="numeric"===t.year?"year":null,o=C(t);return n?e=n:r&&o?e=`${o}-${r}`:r&&(e=r),e?new s({dateFormat:e}):null}function G(t){let e;const n=k(t),r="never"===t.hour12?"24":null;return n&&r?e=`short-date-${n}-${r}`:n&&(e=`short-date-${n}`),e?new s({dateFormat:e}):null}function W(t){switch(t.dateStyle){case"short":return"short-date";case"medium":return"day-short-month-year";case"long":return"long-month-day-year";case"full":return"long-date";default:return}}function k(t){return t.timeStyle&&("short"===t.timeStyle?"short-time":"long-time")}function C(t){switch(t.month){case"short":return"short-month";case"long":return"long-month";default:return}}function I(e,n){if(!m(e))return;const r=n?.useGrouping??"auto",o=n?.hour12??"auto";switch(e.type){case"integer":case"small-integer":case"big-integer":case"long":return new i({minimumFractionDigits:0,maximumFractionDigits:0,useGrouping:r});case"single":case"double":return new i({minimumFractionDigits:0,maximumFractionDigits:2,useGrouping:r});case"date":case"timestamp-offset":return new t({dateStyle:"short",timeStyle:"short",hour12:o});case"date-only":return new t({dateStyle:"short"});case"time-only":return new t({timeStyle:"short",hour12:o})}}export{I as defaultFieldFormat,c as fieldFormatFromFieldInfoFormat,b as fieldInfoFormatFromFieldFormat,l as formatTypes,m as isFormattableField};
5
+ import t from"./DateTimeFieldFormat.js";import e from"./FieldFormat.js";import{isNumericField as n,isDateField as r,isDateOnlyField as o,isTimeOnlyField as a,isTimestampOffsetField as u}from"./fieldUtils.js";import i from"./NumberFieldFormat.js";import s from"../../popup/support/FieldInfoFormat.js";const l={base:e,key:"type",errorContext:"field-configuration-field-format",typeMap:{"date-time":t,number:i}};function c(t,e){const{format:n}=t;return e&&h(e)?n?m(n,e):M(e,{hour12:"always",useGrouping:"always"}):null}function m(t,e){const{dateFormat:n}=t;if(!e)return n?y(t):f(t);if(!h(e))return;const r={hour12:"always"};switch(e.type){case"integer":case"small-integer":case"big-integer":case"long":return d(t);case"single":case"double":return f(t);case"date":case"timestamp-offset":return n?y(t):M(e,r);case"date-only":return n?g(t):M(e);case"time-only":return n?p(t):M(e,r)}}function h(t){return n(t)||r(t)||o(t)||a(t)||u(t)}function d(t){return new i({useGrouping:t.digitSeparator?"always":"never"})}function f(t){const e=d(t),{places:n}=t;return e.minimumFractionDigits=n??0,e.maximumFractionDigits=n??2,e}function y(e){return new t({dateStyle:w(e),year:b(e),month:S(e),timeStyle:$(e),hour12:F(e)})}function g(e){return new t({dateStyle:w(e),year:b(e),month:S(e)})}function p(e){return new t({timeStyle:$(e),hour12:F(e)})}function w(t){const{dateFormat:e}=t;return e?e.startsWith("short-date")?"short":e.startsWith("day-short-month-year")?"medium":e.startsWith("long-month-day-year")?"long":e.startsWith("long-date")?"full":null:null}function F(t){return t.dateFormat?.endsWith("-24")?"never":"always"}function S(t){switch(t.dateFormat){case"short-month-year":return"short";case"long-month-year":return"long";default:return null}}function $(t){const{dateFormat:e}=t;return e?e.includes("short-time")?"short":e.includes("long-time")?"medium":null:null}function b(t){switch(t.dateFormat){case"short-month-year":case"long-month-year":case"year":return"numeric";default:return null}}function D(t,e){const n="number"===t.type,r="date-time"===t.type;if(!e)return n?G(t):r?j(t):null;if(h(e))switch(e.type){case"integer":case"small-integer":case"big-integer":case"long":return n?x(t):null;case"single":case"double":return n?G(t):null;case"date":case"timestamp-offset":return r?j(t):null;case"date-only":return r?v(t):null;case"time-only":return r?W(t):null}}function x(t){return new s({digitSeparator:"never"!==t.useGrouping})}function G(t){const e=x(t);return e.places=t.maximumFractionDigits,e}function j(t){let e;const n=k(t),r=C(t),o="never"===t.hour12?"24":null,a="numeric"===t.year?"year":null,u=I(t);return n&&r&&o?e=`${n}-${r}-${o}`:n&&r?e=`${n}-${r}`:n?e=n:a&&u?e=`${u}-${a}`:a&&(e=a),e?new s({dateFormat:e}):null}function v(t){let e;const n=k(t),r="numeric"===t.year?"year":null,o=I(t);return n?e=n:r&&o?e=`${o}-${r}`:r&&(e=r),e?new s({dateFormat:e}):null}function W(t){let e;const n=C(t),r="never"===t.hour12?"24":null;return n&&r?e=`short-date-${n}-${r}`:n&&(e=`short-date-${n}`),e?new s({dateFormat:e}):null}function k(t){switch(t.dateStyle){case"short":return"short-date";case"medium":return"day-short-month-year";case"long":return"long-month-day-year";case"full":return"long-date";default:return}}function C(t){return t.timeStyle&&("short"===t.timeStyle?"short-time":"long-time")}function I(t){switch(t.month){case"short":return"short-month";case"long":return"long-month";default:return}}function M(e,n){if(!h(e))return;const r=n?.useGrouping??"auto",o=n?.hour12??"auto";switch(e.type){case"integer":case"small-integer":case"big-integer":case"long":return new i({minimumFractionDigits:0,maximumFractionDigits:0,useGrouping:r});case"single":case"double":return new i({minimumFractionDigits:0,maximumFractionDigits:2,useGrouping:r});case"date":case"timestamp-offset":return new t({dateStyle:"short",timeStyle:"short",hour12:o});case"date-only":return new t({dateStyle:"short"});case"time-only":return new t({timeStyle:"short",hour12:o})}}export{M as defaultFieldFormat,c as fieldFormatFromFieldInfo,m as fieldFormatFromFieldInfoFormat,D as fieldInfoFormatFromFieldFormat,l as formatTypes,h as isFormattableField};