@arcgis/core 4.33.0-next.20250616 → 4.33.0-next.20250618

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 (196) hide show
  1. package/EULA.pdf +0 -0
  2. package/applications/MapViewer/templateUtils.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/089821d58267c16ccf0a.js +1 -0
  5. package/assets/esri/core/workers/chunks/{2ad538440cfb3ab94787.js → 2c0c97acb7714b1e0e01.js} +1 -1
  6. package/assets/esri/core/workers/chunks/490c733be256a1ce25b2.js +1 -0
  7. package/assets/esri/core/workers/chunks/52410198c4b2eccfeadd.js +1 -0
  8. package/assets/esri/core/workers/chunks/5bad1c6b53c1290c1bee.js +1 -0
  9. package/assets/esri/core/workers/chunks/{04e558a970c6a77f243e.js → 5cbaf4ff688aafa6643e.js} +1 -1
  10. package/assets/esri/core/workers/chunks/5e1975ea139ebcee9d9c.js +1 -0
  11. package/assets/esri/core/workers/chunks/5e53c7e29bb6d43d08be.js +1 -0
  12. package/assets/esri/core/workers/chunks/606782a94adcce6975af.js +1 -0
  13. package/assets/esri/core/workers/chunks/616502f99247ff6b00c2.js +1 -0
  14. package/assets/esri/core/workers/chunks/6f8de923519bb16af8ba.js +1 -0
  15. package/assets/esri/core/workers/chunks/764e505f2bafdf5afaf9.js +1 -0
  16. package/assets/esri/core/workers/chunks/77342fa644507f57c41a.js +1 -0
  17. package/assets/esri/core/workers/chunks/8637b9cb30170ac4eae2.js +1 -0
  18. package/assets/esri/core/workers/chunks/8656c145ff0ca2e51ea6.js +1 -0
  19. package/assets/esri/core/workers/chunks/8b4a35e3ed39d8be3394.js +1 -0
  20. package/assets/esri/core/workers/chunks/{4e38fcd99d7d9f984356.js → a1e1fb43463977e4014c.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{8281c9ae86fec895f617.js → a2715eddd71f47b1f951.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{130c848bf6337649052c.js → a3e43fa3cee99f28b272.js} +1 -1
  23. package/assets/esri/core/workers/chunks/a507192771e5f4f82973.js +1 -0
  24. package/assets/esri/core/workers/chunks/ac03f1b2402598b394d5.js +1 -0
  25. package/assets/esri/core/workers/chunks/b63a5067b18b6754a997.js +1 -0
  26. package/assets/esri/core/workers/chunks/c1822b03302c3db71b1f.js +1 -0
  27. package/assets/esri/core/workers/chunks/c872a06e3b5c3fb2ba56.js +1 -0
  28. package/assets/esri/core/workers/chunks/d3bfd0c382c2f39a787b.js +1 -0
  29. package/assets/esri/core/workers/chunks/d568070513f2b98fd9b5.js +1 -0
  30. package/assets/esri/core/workers/chunks/d6df12bed626d56cd6b2.js +1 -0
  31. package/assets/esri/core/workers/chunks/{28fceb79e5888e0109cc.js → d7968726733eee609ec6.js} +1 -1
  32. package/assets/esri/core/workers/chunks/df6d6ac6ebe2fb044a97.js +1 -0
  33. package/assets/esri/core/workers/chunks/ec339075bb4faeec1413.js +1 -0
  34. package/assets/esri/core/workers/chunks/{e02437168d5a55b51831.js → f08b5fce5f9a5afdcc97.js} +1 -1
  35. package/assets/esri/core/workers/chunks/f4442a2b40e44f90b461.js +1 -0
  36. package/assets/esri/themes/base/widgets/_Legend.scss +3 -1
  37. package/assets/esri/themes/dark/main.css +1 -1
  38. package/assets/esri/themes/light/main.css +1 -1
  39. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
  40. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
  41. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
  42. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
  43. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
  44. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
  45. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
  46. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
  47. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
  48. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
  49. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
  50. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
  51. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
  52. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
  53. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
  54. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
  55. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
  56. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
  57. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
  58. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
  59. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
  60. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
  61. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
  62. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
  63. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
  64. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
  65. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
  66. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
  67. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
  68. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
  69. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
  70. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
  71. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
  72. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
  73. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
  74. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
  75. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
  76. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
  77. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
  78. package/interfaces.d.ts +114 -49
  79. package/layers/FeatureLayer.js +1 -1
  80. package/layers/OrientedImageryLayer.js +1 -1
  81. package/layers/SubtypeGroupLayer.js +1 -1
  82. package/layers/VideoLayer.js +1 -1
  83. package/layers/graphics/data/QueryEngineResult.js +1 -1
  84. package/layers/mixins/FeatureLayerBase.js +1 -1
  85. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  86. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  87. package/layers/orientedImagery/core/utils.js +1 -1
  88. package/layers/orientedImagery/transformations/updateElevation.js +1 -1
  89. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  90. package/layers/orientedImagery/transformations/utils.js +1 -1
  91. package/layers/support/SubtypeSublayer.js +1 -1
  92. package/layers/support/TitleCreator.js +1 -1
  93. package/layers/support/arcgisLayerUrl.js +1 -1
  94. package/layers/support/arcgisLayers.js +1 -1
  95. package/layers/support/fetchService.js +1 -1
  96. package/layers/support/fieldUtils.js +1 -1
  97. package/layers/support/layerUtils.js +1 -1
  98. package/layers/video/VideoCameraSensorModel.js +1 -1
  99. package/layers/video/VideoController.js +1 -1
  100. package/package.json +1 -1
  101. package/portal/support/layersLoader.js +1 -1
  102. package/portal/support/loadUtils.js +1 -1
  103. package/portal/support/portalLayers.js +1 -1
  104. package/request.js +1 -1
  105. package/rest/knowledgeGraphService.js +1 -1
  106. package/rest/support/DateBinParameters.js +1 -1
  107. package/smartMapping/renderers/size.js +1 -1
  108. package/smartMapping/renderers/support/spikeUtils.js +1 -1
  109. package/support/requestUtils.js +1 -1
  110. package/support/revision.js +1 -1
  111. package/symbols/cim/effects/EffectRadial.js +1 -1
  112. package/symbols/cim/utils.js +1 -1
  113. package/symbols/support/previewCIMSymbol.js +1 -1
  114. package/symbols/support/previewSymbol2D.js +1 -1
  115. package/symbols/support/svgUtils.js +1 -1
  116. package/views/2d/engine/ManagedCanvas.js +1 -1
  117. package/views/2d/engine/ParentChildStage.js +5 -0
  118. package/views/2d/engine/Stage.js +1 -1
  119. package/views/2d/engine/webgl/OverlayContainer.js +1 -1
  120. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  121. package/views/2d/engine/webgl/Painter.js +1 -1
  122. package/views/2d/engine/webgl/VideoScreenRenderer.js +5 -0
  123. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueType.js +1 -1
  124. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js +5 -0
  125. package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +5 -0
  126. package/views/2d/layers/MediaLayerView2D.js +1 -1
  127. package/views/2d/layers/TileLayerView2D.js +1 -1
  128. package/views/2d/mapViewDeps.js +1 -1
  129. package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
  130. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  131. package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
  132. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  133. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  134. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  135. package/views/3d/layers/I3SMeshView3D.js +1 -1
  136. package/views/3d/support/popupHitTest.js +1 -1
  137. package/views/3d/terrain/OverlayRenderer.js +1 -1
  138. package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
  139. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  140. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  141. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  142. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  143. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  144. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  145. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  146. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  147. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  148. package/views/VideoView.js +1 -1
  149. package/views/View2D.js +1 -1
  150. package/views/Viewport2DBaseMixin.js +5 -0
  151. package/views/Viewport2DMixin.js +1 -1
  152. package/views/analysis/analysisViewUtils.js +1 -1
  153. package/views/layers/DimensionLayerView.js +1 -1
  154. package/views/layers/LineOfSightLayerView.js +1 -1
  155. package/views/layers/ViewshedLayerView.js +1 -1
  156. package/views/video/VideoOperationalDataView.js +5 -0
  157. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  158. package/widgets/Expand.js +1 -1
  159. package/widgets/FeatureTable/support/templateUtils.js +1 -1
  160. package/widgets/Legend/styles/support/sizeRampUtils.js +1 -1
  161. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  162. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  163. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  164. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  165. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  166. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  167. package/widgets/OrientedImageryViewer.js +1 -1
  168. package/widgets/Print/PrintViewModel.js +1 -1
  169. package/widgets/Print.js +1 -1
  170. package/widgets/VideoPlayer.js +1 -1
  171. package/widgets/support/GridControls.js +1 -1
  172. package/assets/esri/core/workers/chunks/0ed4ec00ef16aa58a33d.js +0 -1
  173. package/assets/esri/core/workers/chunks/273beed633cc37416ad7.js +0 -1
  174. package/assets/esri/core/workers/chunks/49a57dc1e6d1048fa949.js +0 -1
  175. package/assets/esri/core/workers/chunks/4b1e6f481e3608486e20.js +0 -1
  176. package/assets/esri/core/workers/chunks/500fb5f615f0c1db1b66.js +0 -1
  177. package/assets/esri/core/workers/chunks/513dc2467e9b8b8c6df4.js +0 -1
  178. package/assets/esri/core/workers/chunks/5198dc5f8620b47dce79.js +0 -1
  179. package/assets/esri/core/workers/chunks/5e539ce4751bcfa57145.js +0 -1
  180. package/assets/esri/core/workers/chunks/5ef1095842e21090f1f4.js +0 -1
  181. package/assets/esri/core/workers/chunks/7687f1071b1d161d6fc8.js +0 -1
  182. package/assets/esri/core/workers/chunks/7716a9fb380d66ba7292.js +0 -1
  183. package/assets/esri/core/workers/chunks/78a57f5aeb277b84b3da.js +0 -1
  184. package/assets/esri/core/workers/chunks/7c56740cac444419e5b4.js +0 -1
  185. package/assets/esri/core/workers/chunks/802c6b1a6cb9264b8e4f.js +0 -1
  186. package/assets/esri/core/workers/chunks/8855f1a6224ffbd0bb66.js +0 -1
  187. package/assets/esri/core/workers/chunks/88b1214c284c2ec7d51b.js +0 -1
  188. package/assets/esri/core/workers/chunks/9dd40566d0730f79e504.js +0 -1
  189. package/assets/esri/core/workers/chunks/a622ed3f182648ab3ff6.js +0 -1
  190. package/assets/esri/core/workers/chunks/cc1328cacc4ac07eb548.js +0 -1
  191. package/assets/esri/core/workers/chunks/cfc5e0ec9b0290407383.js +0 -1
  192. package/assets/esri/core/workers/chunks/d2139307f62ea8bf999a.js +0 -1
  193. package/assets/esri/core/workers/chunks/d9cdefb1cd8399ffac20.js +0 -1
  194. package/assets/esri/core/workers/chunks/ddb66fe6fcd0764daa7a.js +0 -1
  195. package/assets/esri/core/workers/chunks/ec49e2849766402ad5c7.js +0 -1
  196. package/assets/esri/core/workers/chunks/f5b426f57f87eb9b2f35.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as s,d as a,e as n,g as o,f as l,c,l as p,j as h,t as f}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as u}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as T}from"../../../../geometry/support/float16.js";import{PlaneIndex as d}from"../../../../geometry/support/frustum.js";import{distance2 as E,fromPoints as _,create as A,closestLineSegmentPoint as R}from"../../../../geometry/support/lineSegment.js";import{fromPoints as g,create as S,signedDistance as O,getNormal as I}from"../../../../geometry/support/plane.js";import{newLayout as v}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as P,isColorOrColorEmission as N,isDepth as L,isColorEmissionHighlightOIDOrDepth as b,is2DGeometryOutput as C,ShaderOutput as U}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as y}from"../effects/geometry/olidUtils.js";import j from"../lib/GLMaterial.js";import{Material as D,RenderOccludedFlag as F}from"../lib/Material.js";import{RenderSlot as w}from"../lib/RenderSlot.js";import{isTranslationMatrix as M}from"../lib/Util.js";import{VertexAttribute as B}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as x}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as J}from"./internal/bufferWriterUtils.js";import{LineMarkerAnchor as z}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as H}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as G,RibbonLineTechnique as k}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as Z,CapType as V}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as W}from"../../../../webscene/support/AlphaCutoff.js";var Y;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(Y||(Y={}));class q extends D{constructor(e){super(e,Q),this._configuration=new Z,this.vertexAttributeLocations=G,this.produces=new Map([[w.OPAQUE_MATERIAL,e=>P(e)||N(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>L(e)],[w.OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL,e=>N(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>N(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.DRAPED_MATERIAL,e=>C(e)]])}getConfiguration(e,t){super.getConfiguration(e,t,this._configuration),this._configuration.oitPass=t.oitPass,this._configuration.draped=t.slot===w.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==U.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&te(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=t.hasOccludees,this._configuration.occluder=this.parameters.renderOccluded===F.OccludeAndTransparentStencil,this._configuration.terrainDepthTest=t.terrainDepthTest&&N(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration}get visible(){return this.parameters.color[3]>=W||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>W}intersectDraped({attributes:e,screenToWorldRatio:r},i,s,a,n){if(!i.options.selectionMode)return;const o=e.get(B.SIZE);let l=this.parameters.width;if(this.parameters.vvSize){const r=e.get(B.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(r)?l*=this.parameters.vvSize.fallback[0]:l*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(l*=o.data[0]);const c=s[0],p=s[1],h=(l/2+4)*r;let f=Number.MAX_VALUE,m=0;const u=e.get(B.POSITION).data,T=ee(this.parameters,e)?u.length-2:u.length-5;for(let d=0;d<T;d+=3){const e=u[d],r=u[d+1],i=(d+3)%u.length,s=c-e,a=p-r,n=u[i]-e,o=u[i+1]-r,l=t((n*s+o*a)/(n*n+o*o),0,1),h=n*l-s,T=o*l-a,E=h*h+T*T;E<f&&(f=E,m=d/3)}f<h*h&&a(n.distance,n.normal,m)}intersect(r,f,m,u,T,A){const{options:S,camera:v,rayBegin:P,rayEnd:N}=m;if(!S.selectionMode||!r.visible||!v)return;if(!M(f))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const L=r.attributes,b=L.get(B.POSITION).data;let C=this.parameters.width;if(this.parameters.vvSize){const e=L.get(B.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(e)||(C*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else L.has(B.SIZE)&&(C*=L.get(B.SIZE).data[0]);const U=ne;i(U,m.point);const y=C*v.pixelRatio/2+4*v.pixelRatio;s(de[0],U[0]-y,U[1]+y,0),s(de[1],U[0]+y,U[1]+y,0),s(de[2],U[0]+y,U[1]-y,0),s(de[3],U[0]-y,U[1]-y,0);for(let e=0;e<4;e++)if(!v.unprojectFromRenderScreen(de[e],Ee[e]))return;g(v.eye,Ee[0],Ee[1],_e),g(v.eye,Ee[1],Ee[2],Ae),g(v.eye,Ee[2],Ee[3],Re),g(v.eye,Ee[3],Ee[0],ge);let j=Number.MAX_VALUE,D=0;const F=ee(this.parameters,L)?b.length-2:b.length-5;for(let e=0;e<F;e+=3){re[0]=b[e]+f[12],re[1]=b[e+1]+f[13],re[2]=b[e+2]+f[14];const t=(e+3)%b.length;if(ie[0]=b[t]+f[12],ie[1]=b[t+1]+f[13],ie[2]=b[t+2]+f[14],O(_e,re)<0&&O(_e,ie)<0||O(Ae,re)<0&&O(Ae,ie)<0||O(Re,re)<0&&O(Re,ie)<0||O(ge,re)<0&&O(ge,ie)<0)continue;if(v.projectToRenderScreen(re,oe),v.projectToRenderScreen(ie,le),oe[2]<0&&le[2]>0){a(se,re,ie);const e=v.frustum,t=-O(e[d.NEAR],re)/n(se,I(e[d.NEAR]));o(se,se,t),l(re,re,se),v.projectToRenderScreen(re,oe)}else if(oe[2]>0&&le[2]<0){a(se,ie,re);const e=v.frustum,t=-O(e[d.NEAR],ie)/n(se,I(e[d.NEAR]));o(se,se,t),l(ie,ie,se),v.projectToRenderScreen(ie,le)}else if(oe[2]<0&&le[2]<0)continue;oe[2]=0,le[2]=0;const r=E(_(oe,le,he),U);r<j&&(j=r,c(ce,re),c(pe,ie),D=e/3)}if(j<y*y){let e=Number.MAX_VALUE;if(R(_(ce,pe,he),_(P,N,fe),ae)){a(ae,ae,P);const t=p(ae);o(ae,ae,1/t),e=t/h(P,N)}A(e,ae,D)}}get _layout(){const e=v().vec3f(B.POSITION).vec4f16(B.PREVIOUSDELTA).vec4f16(B.NEXTDELTA).f32(B.U0).vec2f16(B.LINEPARAMETERS);return this.parameters.vvSize&&e.f32(B.SIZEFEATUREATTRIBUTE),this.parameters.vvColor?e.f16(B.COLORFEATUREATTRIBUTE):e.vec4u8(B.COLOR,{glNormalized:!0}),this.parameters.vvSize||e.f16(B.SIZE),this.parameters.vvOpacity&&e.f16(B.OPACITYFEATUREATTRIBUTE),y()&&e.vec4u8(B.OLIDCOLOR),e}createBufferWriter(){return new K(this._layout,this.parameters)}createGLMaterial(e){return new X(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class X extends j{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(k,e)}}class Q extends x{constructor(){super(...arguments),this.width=0,this.color=u,this.join="miter",this.cap=V.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1}get transparent(){return this.color[3]<1||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}}class K{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=H+r}}_isClosed(e){return ee(this._parameters,e)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.get(B.POSITION).indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,a,n){const o=r.get(B.POSITION),l=o.indices,p=o.data.length/3,m=r.get(B.DISTANCETOSTART)?.data;l&&l.length!==2*(p-1)&&console.warn("RibbonLineMaterial does not support indices");const u=this.vertexBufferLayout.fields.has(B.SIZEFEATUREATTRIBUTE),d=(u?r.get(B.SIZEFEATUREATTRIBUTE)?.data[0]:r.get(B.SIZE)?.data[0])??1;let E=[1,1,1,1],_=0;const A=this.vertexBufferLayout.fields.has(B.COLORFEATUREATTRIBUTE);A?_=r.get(B.COLORFEATUREATTRIBUTE).data[0]:r.has(B.COLOR)&&(E=r.get(B.COLOR).data);const R=this.vertexBufferLayout.fields.has(B.OPACITYFEATUREATTRIBUTE),g=R?r.get(B.OPACITYFEATUREATTRIBUTE).data[0]:0,S=new Float32Array(a.buffer),O=T(a.buffer),I=new Uint8Array(a.buffer),v=this.vertexBufferLayout.stride/4;let P=n*v;const N=P;let L=0;const b=m?(e,t,r)=>L=m[r]:(e,t,r)=>L+=h(e,t),C=S.BYTES_PER_ELEMENT/O.BYTES_PER_ELEMENT,U=4/C,j=(e,t,r,s,a,n,o)=>{S[P++]=t[0],S[P++]=t[1],S[P++]=t[2],J(e,t,O,P*C),P+=U,J(r,t,O,P*C),P+=U,S[P++]=o;let l=P*C;if(O[l++]=s,O[l++]=a,u&&(P=Math.ceil(l/C),S[P]=d,l+=C),A)O[l++]=_;else{const e=Math.min(4*n,E.length-4),t=l/C*4;l+=C,I[t]=255*E[e],I[t+1]=255*E[e+1],I[t+2]=255*E[e+2],I[t+3]=255*E[e+3]}u||(O[l++]=d),R&&(O[l++]=g);let c=l/C*4;y()&&(i?(I[c++]=i[0],I[c++]=i[1],I[c++]=i[2],I[c++]=i[3]):(I[c++]=0,I[c++]=0,I[c++]=0,I[c++]=0)),P=Math.ceil(.25*c)};P+=v,s(ue,o.data[0],o.data[1],o.data[2]),e&&f(ue,ue,e);const D=this._isClosed(r);if(D){const t=o.data.length-3;s(me,o.data[t],o.data[t+1],o.data[t+2]),e&&f(me,me,e)}else s(Te,o.data[3],o.data[4],o.data[5]),e&&f(Te,Te,e),j(ue,ue,Te,1,Y.LEFT_CAP_START,0,0),j(ue,ue,Te,1,Y.RIGHT_CAP_START,0,0),c(me,ue),c(ue,Te);const F=D?0:1,w=D?p:p-1;for(let h=F;h<w;h++){const t=(h+1)%p*3;s(Te,o.data[t],o.data[t+1],o.data[t+2]),e&&f(Te,Te,e),b(me,ue,h),j(me,ue,Te,0,Y.LEFT_JOIN_END,h,L),j(me,ue,Te,0,Y.RIGHT_JOIN_END,h,L);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);j(me,ue,Te,t,Y.LEFT_JOIN_END,h,L),j(me,ue,Te,t,Y.RIGHT_JOIN_END,h,L)}j(me,ue,Te,1,Y.LEFT_JOIN_START,h,L),j(me,ue,Te,1,Y.RIGHT_JOIN_START,h,L),c(me,ue),c(ue,Te)}D?(s(Te,o.data[3],o.data[4],o.data[5]),e&&f(Te,Te,e),L=b(me,ue,w),j(me,ue,Te,0,Y.LEFT_JOIN_END,F,L),j(me,ue,Te,0,Y.RIGHT_JOIN_END,F,L)):(L=b(me,ue,w),j(me,ue,ue,0,Y.LEFT_CAP_END,w,L),j(me,ue,ue,0,Y.RIGHT_CAP_END,w,L)),$(S,N+v,S,N,v);return P=$(S,P-v,S,P,v),this._parameters.wireframe&&this._addWireframeVertices(a,N,P,v),null}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=$(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function $(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function ee(e,t){if(!e.isClosed)return!1;return t.get(B.POSITION).indices.length>2}function te(e){return e.anchor===z.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const re=m(),ie=m(),se=m(),ae=m(),ne=m(),oe=r(),le=r(),ce=m(),pe=m(),he=A(),fe=A(),me=m(),ue=m(),Te=m(),de=[r(),r(),r(),r()],Ee=[m(),m(),m(),m()],_e=S(),Ae=S(),Re=S(),ge=S();export{Q as Parameters,q as RibbonLineMaterial};
5
+ import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as s,d as a,e as n,g as o,f as l,c,l as p,j as h,t as f}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as u}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as T}from"../../../../geometry/support/float16.js";import{PlaneIndex as d}from"../../../../geometry/support/frustum.js";import{distance2 as E,fromPoints as _,create as A,closestLineSegmentPoint as R}from"../../../../geometry/support/lineSegment.js";import{fromPoints as g,create as S,signedDistance as O,getNormal as I}from"../../../../geometry/support/plane.js";import{newLayout as v}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as P,isColorOrColorEmission as N,isDepth as L,isColorEmissionHighlightOIDOrDepth as b,is2DGeometryOutput as C,ShaderOutput as U}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as y}from"../effects/geometry/olidUtils.js";import j from"../lib/GLMaterial.js";import{Material as D,RenderOccludedFlag as F}from"../lib/Material.js";import{RenderSlot as w}from"../lib/RenderSlot.js";import{isTranslationMatrix as M}from"../lib/Util.js";import{VertexAttribute as B}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as x}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as J}from"./internal/bufferWriterUtils.js";import{LineMarkerAnchor as z}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as H}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as G,RibbonLineTechnique as k}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as Z,CapType as V}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as W}from"../../../../webscene/support/AlphaCutoff.js";var Y;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(Y||(Y={}));class q extends D{constructor(e){super(e,Q),this._configuration=new Z,this.vertexAttributeLocations=G,this.produces=new Map([[w.OPAQUE_MATERIAL,e=>P(e)||N(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>L(e)],[w.OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL,e=>N(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>N(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.DRAPED_MATERIAL,e=>C(e)]])}getConfiguration(e,t){super.getConfiguration(e,t,this._configuration),this._configuration.oitPass=t.oitPass,this._configuration.draped=t.slot===w.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==U.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&te(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=t.hasOccludees,this._configuration.occluder=this.parameters.renderOccluded===F.OccludeAndTransparentStencil,this._configuration.terrainDepthTest=t.terrainDepthTest&&N(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration}get visible(){return this.parameters.color[3]>=W||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>W}intersectDraped({attributes:e,screenToWorldRatio:r},i,s,a,n){if(!i.options.selectionMode)return;const o=e.get(B.SIZE);let l=this.parameters.width;if(this.parameters.vvSize){const r=e.get(B.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(r)?l*=this.parameters.vvSize.fallback[0]:l*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(l*=o.data[0]);const c=s[0],p=s[1],h=(l/2+4)*r;let f=Number.MAX_VALUE,m=0;const u=e.get(B.POSITION).data,T=ee(this.parameters,e)?u.length-2:u.length-5;for(let d=0;d<T;d+=3){const e=u[d],r=u[d+1],i=(d+3)%u.length,s=c-e,a=p-r,n=u[i]-e,o=u[i+1]-r,l=t((n*s+o*a)/(n*n+o*o),0,1),h=n*l-s,T=o*l-a,E=h*h+T*T;E<f&&(f=E,m=d/3)}f<h*h&&a(n.distance,n.normal,m)}intersect(r,f,m,u,T,A){const{options:S,camera:v,rayBegin:P,rayEnd:N}=m;if(!S.selectionMode||!r.visible||!v)return;if(!M(f))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const L=r.attributes,b=L.get(B.POSITION).data;let C=this.parameters.width;if(this.parameters.vvSize){const e=L.get(B.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(e)||(C*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else L.has(B.SIZE)&&(C*=L.get(B.SIZE).data[0]);const U=ne;i(U,m.point);const y=C*v.pixelRatio/2+4*v.pixelRatio;s(de[0],U[0]-y,U[1]+y,0),s(de[1],U[0]+y,U[1]+y,0),s(de[2],U[0]+y,U[1]-y,0),s(de[3],U[0]-y,U[1]-y,0);for(let e=0;e<4;e++)if(!v.unprojectFromRenderScreen(de[e],Ee[e]))return;g(v.eye,Ee[0],Ee[1],_e),g(v.eye,Ee[1],Ee[2],Ae),g(v.eye,Ee[2],Ee[3],Re),g(v.eye,Ee[3],Ee[0],ge);let j=Number.MAX_VALUE,D=0;const F=ee(this.parameters,L)?b.length-2:b.length-5;for(let e=0;e<F;e+=3){re[0]=b[e]+f[12],re[1]=b[e+1]+f[13],re[2]=b[e+2]+f[14];const t=(e+3)%b.length;if(ie[0]=b[t]+f[12],ie[1]=b[t+1]+f[13],ie[2]=b[t+2]+f[14],O(_e,re)<0&&O(_e,ie)<0||O(Ae,re)<0&&O(Ae,ie)<0||O(Re,re)<0&&O(Re,ie)<0||O(ge,re)<0&&O(ge,ie)<0)continue;if(v.projectToRenderScreen(re,oe),v.projectToRenderScreen(ie,le),oe[2]<0&&le[2]>0){a(se,re,ie);const e=v.frustum,t=-O(e[d.NEAR],re)/n(se,I(e[d.NEAR]));o(se,se,t),l(re,re,se),v.projectToRenderScreen(re,oe)}else if(oe[2]>0&&le[2]<0){a(se,ie,re);const e=v.frustum,t=-O(e[d.NEAR],ie)/n(se,I(e[d.NEAR]));o(se,se,t),l(ie,ie,se),v.projectToRenderScreen(ie,le)}else if(oe[2]<0&&le[2]<0)continue;oe[2]=0,le[2]=0;const r=E(_(oe,le,he),U);r<j&&(j=r,c(ce,re),c(pe,ie),D=e/3)}if(j<y*y){let e=Number.MAX_VALUE;if(R(_(ce,pe,he),_(P,N,fe),ae)){a(ae,ae,P);const t=p(ae);o(ae,ae,1/t),e=t/h(P,N)}A(e,ae,D)}}get _layout(){const e=v().vec3f(B.POSITION).vec4f16(B.PREVIOUSDELTA).vec4f16(B.NEXTDELTA).f32(B.U0).vec2f16(B.LINEPARAMETERS);return this.parameters.vvColor?e.f32(B.COLORFEATUREATTRIBUTE):e.vec4u8(B.COLOR,{glNormalized:!0}),this.parameters.vvSize?e.f32(B.SIZEFEATUREATTRIBUTE):e.f32(B.SIZE),this.parameters.vvOpacity&&e.f32(B.OPACITYFEATUREATTRIBUTE),y()&&e.vec4u8(B.OLIDCOLOR),e}createBufferWriter(){return new K(this._layout,this.parameters)}createGLMaterial(e){return new X(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class X extends j{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(k,e)}}class Q extends x{constructor(){super(...arguments),this.width=0,this.color=u,this.join="miter",this.cap=V.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1}get transparent(){return this.color[3]<1||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}}class K{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=H+r}}_isClosed(e){return ee(this._parameters,e)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.get(B.POSITION).indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,a,n){const o=r.get(B.POSITION),l=o.indices,p=o.data.length/3,m=r.get(B.DISTANCETOSTART)?.data;l&&l.length!==2*(p-1)&&console.warn("RibbonLineMaterial does not support indices");const u=(this.vertexBufferLayout.fields.has(B.SIZEFEATUREATTRIBUTE)?r.get(B.SIZEFEATUREATTRIBUTE)?.data[0]:r.get(B.SIZE)?.data[0])??1;let d=[1,1,1,1],E=0;const _=this.vertexBufferLayout.fields.has(B.COLORFEATUREATTRIBUTE);_?E=r.get(B.COLORFEATUREATTRIBUTE).data[0]:r.has(B.COLOR)&&(d=r.get(B.COLOR).data);const A=this.vertexBufferLayout.fields.has(B.OPACITYFEATUREATTRIBUTE),R=A?r.get(B.OPACITYFEATUREATTRIBUTE).data[0]:0,g=new Float32Array(a.buffer),S=T(a.buffer),O=new Uint8Array(a.buffer),I=this.vertexBufferLayout.stride/4;let v=n*I;const P=v;let N=0;const L=m?(e,t,r)=>N=m[r]:(e,t,r)=>N+=h(e,t),b=g.BYTES_PER_ELEMENT/S.BYTES_PER_ELEMENT,C=4/b,U=(e,t,r,s,a,n,o)=>{g[v++]=t[0],g[v++]=t[1],g[v++]=t[2],J(e,t,S,v*b),v+=C,J(r,t,S,v*b),v+=C,g[v++]=o;let l=v*b;if(S[l++]=s,S[l++]=a,v++,_)g[v]=E;else{const e=Math.min(4*n,d.length-4),t=4*v;O[t]=255*d[e],O[t+1]=255*d[e+1],O[t+2]=255*d[e+2],O[t+3]=255*d[e+3]}if(v++,g[v++]=u,A&&(g[v++]=R),y()){let e=4*v;i?(O[e++]=i[0],O[e++]=i[1],O[e++]=i[2],O[e++]=i[3]):(O[e++]=0,O[e++]=0,O[e++]=0,O[e++]=0),v=Math.ceil(.25*e)}};v+=I,s(ue,o.data[0],o.data[1],o.data[2]),e&&f(ue,ue,e);const j=this._isClosed(r);if(j){const t=o.data.length-3;s(me,o.data[t],o.data[t+1],o.data[t+2]),e&&f(me,me,e)}else s(Te,o.data[3],o.data[4],o.data[5]),e&&f(Te,Te,e),U(ue,ue,Te,1,Y.LEFT_CAP_START,0,0),U(ue,ue,Te,1,Y.RIGHT_CAP_START,0,0),c(me,ue),c(ue,Te);const D=j?0:1,F=j?p:p-1;for(let h=D;h<F;h++){const t=(h+1)%p*3;s(Te,o.data[t],o.data[t+1],o.data[t+2]),e&&f(Te,Te,e),L(me,ue,h),U(me,ue,Te,0,Y.LEFT_JOIN_END,h,N),U(me,ue,Te,0,Y.RIGHT_JOIN_END,h,N);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);U(me,ue,Te,t,Y.LEFT_JOIN_END,h,N),U(me,ue,Te,t,Y.RIGHT_JOIN_END,h,N)}U(me,ue,Te,1,Y.LEFT_JOIN_START,h,N),U(me,ue,Te,1,Y.RIGHT_JOIN_START,h,N),c(me,ue),c(ue,Te)}j?(s(Te,o.data[3],o.data[4],o.data[5]),e&&f(Te,Te,e),N=L(me,ue,F),U(me,ue,Te,0,Y.LEFT_JOIN_END,D,N),U(me,ue,Te,0,Y.RIGHT_JOIN_END,D,N)):(N=L(me,ue,F),U(me,ue,ue,0,Y.LEFT_CAP_END,F,N),U(me,ue,ue,0,Y.RIGHT_CAP_END,F,N)),$(g,P+I,g,P,I);return v=$(g,v-I,g,v,I),this._parameters.wireframe&&this._addWireframeVertices(a,P,v,I),null}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=$(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function $(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function ee(e,t){if(!e.isClosed)return!1;return t.get(B.POSITION).indices.length>2}function te(e){return e.anchor===z.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const re=m(),ie=m(),se=m(),ae=m(),ne=m(),oe=r(),le=r(),ce=m(),pe=m(),he=A(),fe=A(),me=m(),ue=m(),Te=m(),de=[r(),r(),r(),r()],Ee=[m(),m(),m(),m()],_e=S(),Ae=S(),Re=S(),ge=S();export{Q as Parameters,q as RibbonLineMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{d as e,l as t,g as f}from"../../../../../chunks/vec32.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{hasIdentityRotation as o,isOrthoNormal as i}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{BufferViewVec4u8 as s,BufferViewVec3f16 as n,BufferViewVec3f as c,BufferViewVec4f16 as l,BufferViewVec4f as d,BufferViewFloat16 as u,BufferViewFloat as a,BufferViewVec2i16 as g,BufferViewVec2f16 as p,BufferViewVec2f as B}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as y}from"../../lib/Util.js";import{VertexAttribute as b}from"../../lib/VertexAttribute.js";function m(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l)s[f]=o[i[l]],f+=n;else for(let l=0;l<c;++l){const e=o[i[l]];for(let t=0;t<r;t++)s[f]=e,f+=n}}function O(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=2*o[c];i[f]=r[e],i[f+1]=r[e+1],f+=s}}function h(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=3*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}else for(let l=0;l<c;++l){const e=3*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}}function F(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=4*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}else for(let l=0;l<c;++l){const e=4*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}}function I(e,t,f){const r=e.typedBuffer,o=e.typedBufferStride;t*=o;for(let i=0;i<f;++i)r[t]=0,r[t+1]=0,r[t+2]=0,r[t+3]=0,t+=o}function T(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=9*o[c];for(let t=0;t<9;++t)i[f+t]=r[e+t];f+=s}}function N(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=16*o[c];for(let t=0;t<16;++t)i[f+t]=r[e+t];f+=s}}function R(e,t,f,r,i=1){if(!t)return void h(e,f,r,i);const{data:s,indices:n}=e,c=f.typedBuffer,l=f.typedBufferStride,d=n.length,u=t[0],a=t[1],g=t[2],p=t[4],B=t[5],y=t[6],b=t[8],m=t[9],O=t[10],F=t[12],I=t[13],T=t[14];r*=l;let N=0,R=0,S=0;const E=o(t)?e=>{N=s[e]+F,R=s[e+1]+I,S=s[e+2]+T}:e=>{const t=s[e],f=s[e+1],r=s[e+2];N=u*t+p*f+b*r+F,R=a*t+B*f+m*r+I,S=g*t+y*f+O*r+T};if(1===i)for(let o=0;o<d;++o)E(3*n[o]),c[r]=N,c[r+1]=R,c[r+2]=S,r+=l;else for(let o=0;o<d;++o){E(3*n[o]);for(let e=0;e<i;++e)c[r]=N,c[r+1]=R,c[r+2]=S,r+=l}}function S(e,t,f,r,s=1){if(!t)return void h(e,f,r,s);const{data:n,indices:c}=e,l=t,d=f.typedBuffer,u=f.typedBufferStride,a=c.length,g=l[0],p=l[1],B=l[2],y=l[4],b=l[5],m=l[6],O=l[8],F=l[9],I=l[10],T=!i(l),N=1e-6,R=1-N;r*=u;let S=0,E=0,A=0;const v=o(l)?e=>{S=n[e],E=n[e+1],A=n[e+2]}:e=>{const t=n[e],f=n[e+1],r=n[e+2];S=g*t+y*f+O*r,E=p*t+b*f+F*r,A=B*t+m*f+I*r};if(1===s)if(T)for(let o=0;o<a;++o){v(3*c[o]);const e=S*S+E*E+A*A;if(e<R&&e>N){const t=1/Math.sqrt(e);d[r]=S*t,d[r+1]=E*t,d[r+2]=A*t}else d[r]=S,d[r+1]=E,d[r+2]=A;r+=u}else for(let o=0;o<a;++o)v(3*c[o]),d[r]=S,d[r+1]=E,d[r+2]=A,r+=u;else for(let o=0;o<a;++o){if(v(3*c[o]),T){const e=S*S+E*E+A*A;if(e<R&&e>N){const t=1/Math.sqrt(e);S*=t,E*=t,A*=t}}for(let e=0;e<s;++e)d[r]=S,d[r+1]=E,d[r+2]=A,r+=u}}function E(e,t,f,r,o=1){if(!t)return void F(e,f,r,o);const{data:s,indices:n}=e,c=t,l=f.typedBuffer,d=f.typedBufferStride,u=n.length,a=c[0],g=c[1],p=c[2],B=c[4],y=c[5],b=c[6],m=c[8],O=c[9],h=c[10],I=!i(c),T=1e-6,N=1-T;if(r*=d,1===o)for(let i=0;i<u;++i){const e=4*n[i],t=s[e],f=s[e+1],o=s[e+2],c=s[e+3];let u=a*t+B*f+m*o,F=g*t+y*f+O*o,R=p*t+b*f+h*o;if(I){const e=u*u+F*F+R*R;if(e<N&&e>T){const t=1/Math.sqrt(e);u*=t,F*=t,R*=t}}l[r]=u,l[r+1]=F,l[r+2]=R,l[r+3]=c,r+=d}else for(let i=0;i<u;++i){const e=4*n[i],t=s[e],f=s[e+1],c=s[e+2],u=s[e+3];let F=a*t+B*f+m*c,R=g*t+y*f+O*c,S=p*t+b*f+h*c;if(I){const e=F*F+R*R+S*S;if(e<N&&e>T){const t=1/Math.sqrt(e);F*=t,R*=t,S*=t}}for(let i=0;i<o;++i)l[r]=F,l[r+1]=R,l[r+2]=S,l[r+3]=u,r+=d}}function A(e,t,f,r,o=1){const{data:i,indices:s}=e,n=f.typedBuffer,c=f.typedBufferStride,l=s.length;if(r*=c,t!==i.length||4!==t)if(1!==o)if(4!==t)for(let d=0;d<l;++d){const e=3*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=255,r+=c}else for(let d=0;d<l;++d){const e=4*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=i[e+3],r+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=i[t+3],r+=c}return}for(let e=0;e<l;++e){const t=3*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=255,r+=c}}else{n[r]=i[0],n[r+1]=i[1],n[r+2]=i[2],n[r+3]=i[3];const e=new Uint32Array(f.typedBuffer.buffer,f.start),t=c/4,s=e[r/=4];r+=t;const d=l*o;for(let f=1;f<d;++f)e[r]=s,r+=t}}function v(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length,c=r[0];f*=s;for(let l=0;l<n;++l)i[f]=c,f+=s}function w(r,o,i,s){e(k,r,o);const n=Math.max(Math.sqrt(t(k)),1e-4);f(k,k,1/n),i[s++]=k[0],i[s++]=k[1],i[s++]=k[2],i[s++]=n}const k=r();function z(e,t,f,r,o=1){const i=t.typedBuffer,s=t.typedBufferStride;if(r*=s,1===o)for(let n=0;n<f;++n)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s;else for(let n=0;n<f;++n)for(let t=0;t<o;++t)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s}function L(e,t,f,r,o,i,n){let c={numItems:0,numVerticesPerItem:0};for(const l of f.fields.keys()){const f=e.get(l),d=f?.indices;if(f&&d)l===b.POSITION&&(c={numItems:1,numVerticesPerItem:d.length}),P(l,f,r,o,i,n);else if(l===b.OLIDCOLOR&&null!=t){const f=e.get(b.POSITION)?.indices;if(f){const e=f.length;z(t,i.getField(l,s),e,n)}}}return c}function P(e,t,f,r,o,i){switch(e){case b.POSITION:{y(3===t.size);const r=o.getField(e,c);y(!!r,`No buffer view for ${e}`),R(t,f,r,i);break}case b.NORMAL:{y(3===t.size);const f=o.getField(e,c);y(!!f,`No buffer view for ${e}`),S(t,r,f,i);break}case b.NORMALCOMPRESSED:case b.PROFILERIGHT:case b.PROFILEUP:{y(2===t.size);const f=o.getField(e,g);y(!!f,`No buffer view for ${e}`),O(t,f,i);break}case b.UV0:{y(2===t.size);const f=o.getField(e,p)??o.getField(e,B);y(!!f,`No buffer view for ${e}`),O(t,f,i);break}case b.UVI:{y(2===t.size);const f=o.getField(e,g);y(!!f,`No buffer view for ${e}`),O(t,f,i);break}case b.COLOR:case b.SYMBOLCOLOR:{const f=o.getField(e,s);y(!!f,`No buffer view for ${e}`),y(3===t.size||4===t.size),A(t,t.size,f,i);break}case b.SIZEFEATUREATTRIBUTE:{const f=o.getField(e,a);y(!!f,`No buffer view for ${e}`),y(1===t.size),v(t,f,i);break}case b.COLORFEATUREATTRIBUTE:case b.OPACITYFEATUREATTRIBUTE:{const f=o.getField(e,u)??o.getField(e,a);y(!!f,`No buffer view for ${e}`),y(1===t.size),v(t,f,i);break}case b.TANGENT:{y(4===t.size);const r=o.getField(e,d);y(!!r,`No buffer view for ${e}`),E(t,f,r,i);break}case b.PROFILEVERTEXANDNORMAL:{y(4===t.size);const f=o.getField(e,l)??o.getField(e,d);y(!!f,`No buffer view for ${e}`),F(t,f,i);break}case b.PROFILEAUXDATA:{y(3===t.size);const f=o.getField(e,n)??o.getField(e,c);y(!!f,`No buffer view for ${e}`),h(t,f,i);break}}}export{m as writeBufferFloat,T as writeBufferMat3f,N as writeBufferMat4f,O as writeBufferVec2,h as writeBufferVec3,F as writeBufferVec4,I as writeBufferVec4Zeros,A as writeColor,v as writeColorFeatureAttribute,P as writeDefaultAttribute,L as writeDefaultAttributes,w as writeDeltaF16Vector,S as writeNormal,z as writeOlidColor,R as writePosition,E as writeTangent};
5
+ import{d as e,l as t,g as f}from"../../../../../chunks/vec32.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{hasIdentityRotation as o,isOrthoNormal as i}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{BufferViewVec4u8 as s,BufferViewVec3f16 as n,BufferViewVec3f as c,BufferViewVec4f16 as l,BufferViewVec4f as d,BufferViewFloat as u,BufferViewVec2i16 as a,BufferViewVec2f16 as p,BufferViewVec2f as g}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as B}from"../../lib/Util.js";import{VertexAttribute as y}from"../../lib/VertexAttribute.js";function b(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l)s[f]=o[i[l]],f+=n;else for(let l=0;l<c;++l){const e=o[i[l]];for(let t=0;t<r;t++)s[f]=e,f+=n}}function m(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=2*o[c];i[f]=r[e],i[f+1]=r[e+1],f+=s}}function O(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=3*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}else for(let l=0;l<c;++l){const e=3*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}}function h(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=4*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}else for(let l=0;l<c;++l){const e=4*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}}function F(e,t,f){const r=e.typedBuffer,o=e.typedBufferStride;t*=o;for(let i=0;i<f;++i)r[t]=0,r[t+1]=0,r[t+2]=0,r[t+3]=0,t+=o}function I(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=9*o[c];for(let t=0;t<9;++t)i[f+t]=r[e+t];f+=s}}function T(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=16*o[c];for(let t=0;t<16;++t)i[f+t]=r[e+t];f+=s}}function R(e,t,f,r,i=1){if(!t)return void O(e,f,r,i);const{data:s,indices:n}=e,c=f.typedBuffer,l=f.typedBufferStride,d=n.length,u=t[0],a=t[1],p=t[2],g=t[4],B=t[5],y=t[6],b=t[8],m=t[9],h=t[10],F=t[12],I=t[13],T=t[14];r*=l;let R=0,S=0,E=0;const N=o(t)?e=>{R=s[e]+F,S=s[e+1]+I,E=s[e+2]+T}:e=>{const t=s[e],f=s[e+1],r=s[e+2];R=u*t+g*f+b*r+F,S=a*t+B*f+m*r+I,E=p*t+y*f+h*r+T};if(1===i)for(let o=0;o<d;++o)N(3*n[o]),c[r]=R,c[r+1]=S,c[r+2]=E,r+=l;else for(let o=0;o<d;++o){N(3*n[o]);for(let e=0;e<i;++e)c[r]=R,c[r+1]=S,c[r+2]=E,r+=l}}function S(e,t,f,r,s=1){if(!t)return void O(e,f,r,s);const{data:n,indices:c}=e,l=t,d=f.typedBuffer,u=f.typedBufferStride,a=c.length,p=l[0],g=l[1],B=l[2],y=l[4],b=l[5],m=l[6],h=l[8],F=l[9],I=l[10],T=!i(l),R=1e-6,S=1-R;r*=u;let E=0,N=0,A=0;const v=o(l)?e=>{E=n[e],N=n[e+1],A=n[e+2]}:e=>{const t=n[e],f=n[e+1],r=n[e+2];E=p*t+y*f+h*r,N=g*t+b*f+F*r,A=B*t+m*f+I*r};if(1===s)if(T)for(let o=0;o<a;++o){v(3*c[o]);const e=E*E+N*N+A*A;if(e<S&&e>R){const t=1/Math.sqrt(e);d[r]=E*t,d[r+1]=N*t,d[r+2]=A*t}else d[r]=E,d[r+1]=N,d[r+2]=A;r+=u}else for(let o=0;o<a;++o)v(3*c[o]),d[r]=E,d[r+1]=N,d[r+2]=A,r+=u;else for(let o=0;o<a;++o){if(v(3*c[o]),T){const e=E*E+N*N+A*A;if(e<S&&e>R){const t=1/Math.sqrt(e);E*=t,N*=t,A*=t}}for(let e=0;e<s;++e)d[r]=E,d[r+1]=N,d[r+2]=A,r+=u}}function E(e,t,f,r,o=1){if(!t)return void h(e,f,r,o);const{data:s,indices:n}=e,c=t,l=f.typedBuffer,d=f.typedBufferStride,u=n.length,a=c[0],p=c[1],g=c[2],B=c[4],y=c[5],b=c[6],m=c[8],O=c[9],F=c[10],I=!i(c),T=1e-6,R=1-T;if(r*=d,1===o)for(let i=0;i<u;++i){const e=4*n[i],t=s[e],f=s[e+1],o=s[e+2],c=s[e+3];let u=a*t+B*f+m*o,h=p*t+y*f+O*o,S=g*t+b*f+F*o;if(I){const e=u*u+h*h+S*S;if(e<R&&e>T){const t=1/Math.sqrt(e);u*=t,h*=t,S*=t}}l[r]=u,l[r+1]=h,l[r+2]=S,l[r+3]=c,r+=d}else for(let i=0;i<u;++i){const e=4*n[i],t=s[e],f=s[e+1],c=s[e+2],u=s[e+3];let h=a*t+B*f+m*c,S=p*t+y*f+O*c,E=g*t+b*f+F*c;if(I){const e=h*h+S*S+E*E;if(e<R&&e>T){const t=1/Math.sqrt(e);h*=t,S*=t,E*=t}}for(let i=0;i<o;++i)l[r]=h,l[r+1]=S,l[r+2]=E,l[r+3]=u,r+=d}}function N(e,t,f,r,o=1){const{data:i,indices:s}=e,n=f.typedBuffer,c=f.typedBufferStride,l=s.length;if(r*=c,t!==i.length||4!==t)if(1!==o)if(4!==t)for(let d=0;d<l;++d){const e=3*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=255,r+=c}else for(let d=0;d<l;++d){const e=4*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=i[e+3],r+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=i[t+3],r+=c}return}for(let e=0;e<l;++e){const t=3*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=255,r+=c}}else{n[r]=i[0],n[r+1]=i[1],n[r+2]=i[2],n[r+3]=i[3];const e=new Uint32Array(f.typedBuffer.buffer,f.start),t=c/4,s=e[r/=4];r+=t;const d=l*o;for(let f=1;f<d;++f)e[r]=s,r+=t}}function A(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length,c=r[0];f*=s;for(let l=0;l<n;++l)i[f]=c,f+=s}function v(r,o,i,s){e(w,r,o);const n=Math.max(Math.sqrt(t(w)),1e-4);f(w,w,1/n),i[s++]=w[0],i[s++]=w[1],i[s++]=w[2],i[s++]=n}const w=r();function L(e,t,f,r,o=1){const i=t.typedBuffer,s=t.typedBufferStride;if(r*=s,1===o)for(let n=0;n<f;++n)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s;else for(let n=0;n<f;++n)for(let t=0;t<o;++t)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s}function k(e,t,f,r,o,i,n){let c={numItems:0,numVerticesPerItem:0};for(const l of f.fields.keys()){const f=e.get(l),d=f?.indices;if(f&&d)l===y.POSITION&&(c={numItems:1,numVerticesPerItem:d.length}),z(l,f,r,o,i,n);else if(l===y.OLIDCOLOR&&null!=t){const f=e.get(y.POSITION)?.indices;if(f){const e=f.length;L(t,i.getField(l,s),e,n)}}}return c}function z(e,t,f,r,o,i){switch(e){case y.POSITION:{B(3===t.size);const r=o.getField(e,c);B(!!r,`No buffer view for ${e}`),R(t,f,r,i);break}case y.NORMAL:{B(3===t.size);const f=o.getField(e,c);B(!!f,`No buffer view for ${e}`),S(t,r,f,i);break}case y.NORMALCOMPRESSED:case y.PROFILERIGHT:case y.PROFILEUP:{B(2===t.size);const f=o.getField(e,a);B(!!f,`No buffer view for ${e}`),m(t,f,i);break}case y.UV0:{B(2===t.size);const f=o.getField(e,p)??o.getField(e,g);B(!!f,`No buffer view for ${e}`),m(t,f,i);break}case y.UVI:{B(2===t.size);const f=o.getField(e,a);B(!!f,`No buffer view for ${e}`),m(t,f,i);break}case y.COLOR:case y.SYMBOLCOLOR:{const f=o.getField(e,s);B(!!f,`No buffer view for ${e}`),B(3===t.size||4===t.size),N(t,t.size,f,i);break}case y.COLORFEATUREATTRIBUTE:case y.OPACITYFEATUREATTRIBUTE:case y.SIZEFEATUREATTRIBUTE:{const f=o.getField(e,u)??o.getField(e,u);B(!!f,`No buffer view for ${e}`),B(1===t.size),A(t,f,i);break}case y.TANGENT:{B(4===t.size);const r=o.getField(e,d);B(!!r,`No buffer view for ${e}`),E(t,f,r,i);break}case y.PROFILEVERTEXANDNORMAL:{B(4===t.size);const f=o.getField(e,l)??o.getField(e,d);B(!!f,`No buffer view for ${e}`),h(t,f,i);break}case y.PROFILEAUXDATA:{B(3===t.size);const f=o.getField(e,n)??o.getField(e,c);B(!!f,`No buffer view for ${e}`),O(t,f,i);break}}}export{b as writeBufferFloat,I as writeBufferMat3f,T as writeBufferMat4f,m as writeBufferVec2,O as writeBufferVec3,h as writeBufferVec4,F as writeBufferVec4Zeros,N as writeColor,z as writeDefaultAttribute,k as writeDefaultAttributes,v as writeDeltaF16Vector,S as writeNormal,L as writeOlidColor,R as writePosition,E as writeTangent,A as writeVVFeatureAttribute};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{isColorOrColorEmission as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t,depthOnlyOutputBuffersOr as r}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as l,oitDepthTest as n,blending as s,getDrawBuffers as o}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as p}from"../lib/RenderSlot.js";import{stencilToolMaskBaseParams as c,stencilBaseAllZerosParams as u,stencilWriteMaskOn as a,stencilToolTransparentOccluderParams as d,depthCompareAlways as T,stencilToolMaskOccluderParams as h,stencilWriteMaskOff as m,depthCompareLess as P}from"../lib/StencilUtils.js";import{VertexAttribute as E}from"../lib/VertexAttribute.js";import{L as O}from"../../../../chunks/LineMarker.glsl.js";import{LineMarkerSpace as R}from"./LineMarkerTechniqueConfiguration.js";import{makePipelineState as f,defaultColorWrite as _,unpremultipliedAlphaToPremultipliedAlpha as A}from"../../../webgl/renderState.js";class S extends t{constructor(e,t){super(e,t,new i(O,(()=>import("./LineMarker.glsl.js"))),W)}_makePipelineState(i,t){const{output:p,oitPass:d,space:T,hasOccludees:h}=i;return f({blending:e(p)?s(d):null,depthTest:T===R.Draped?null:{func:n(d)},depthWrite:l(i),drawBuffers:r(p,o(d,p)),colorWrite:_,stencilWrite:h?a:null,stencilTest:h?t?c:u:null,polygonOffset:{factor:0,units:-10}})}initializePipeline(e){return e.occluder?(this._occluderPipelineTransparent=f({blending:A,depthTest:T,depthWrite:null,colorWrite:_,stencilWrite:null,stencilTest:d}),this._occluderPipelineOpaque=f({blending:A,depthTest:T,depthWrite:null,colorWrite:_,stencilWrite:m,stencilTest:h}),this._occluderPipelineMaskWrite=f({blending:null,depthTest:P,depthWrite:null,colorWrite:null,stencilWrite:a,stencilTest:c})):this._occluderPipelineTransparent=this._occluderPipelineOpaque=this._occluderPipelineMaskWrite=null,this._occludeePipelineState=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,i){return e?this._occludeePipelineState:i===p.TRANSPARENT_OCCLUDER_MATERIAL?this._occluderPipelineTransparent??super.getPipeline():i===p.OCCLUDER_MATERIAL?this._occluderPipelineOpaque??super.getPipeline():this._occluderPipelineMaskWrite??super.getPipeline()}}const W=new Map([[E.POSITION,0],[E.PREVIOUSDELTA,1],[E.UV0,2],[E.NORMAL,3],[E.COLOR,4],[E.COLORFEATUREATTRIBUTE,4],[E.SIZE,5],[E.SIZEFEATUREATTRIBUTE,5],[E.OPACITYFEATUREATTRIBUTE,6]]);export{S as LineMarkerTechnique,W as vertexAttributeLocations};
5
+ import{isColorOrColorEmission as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t,depthOnlyOutputBuffersOr as r}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as l,oitDepthTest as n,blending as s,getDrawBuffers as o}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as p}from"../lib/RenderSlot.js";import{stencilToolMaskBaseParams as c,stencilBaseAllZerosParams as u,stencilWriteMaskOn as a,stencilToolTransparentOccluderParams as d,depthCompareAlways as T,stencilToolMaskOccluderParams as h,stencilWriteMaskOff as m,depthCompareLess as P}from"../lib/StencilUtils.js";import{VertexAttribute as E}from"../lib/VertexAttribute.js";import{L as O}from"../../../../chunks/LineMarker.glsl.js";import{LineMarkerSpace as R}from"./LineMarkerTechniqueConfiguration.js";import{makePipelineState as f,defaultColorWrite as _,unpremultipliedAlphaToPremultipliedAlpha as A}from"../../../webgl/renderState.js";class S extends t{constructor(e,t){super(e,t,new i(O,(()=>import("./LineMarker.glsl.js"))),W)}_makePipelineState(i,t){const{output:p,oitPass:d,space:T,hasOccludees:h}=i;return f({blending:e(p)?s(d):null,depthTest:T===R.Draped?null:{func:n(d)},depthWrite:l(i),drawBuffers:r(p,o(d,p)),colorWrite:_,stencilWrite:h?a:null,stencilTest:h?t?c:u:null,polygonOffset:{factor:0,units:-10}})}initializePipeline(e){return e.occluder?(this._occluderPipelineTransparent=f({blending:A,depthTest:T,depthWrite:null,colorWrite:_,stencilWrite:null,stencilTest:d}),this._occluderPipelineOpaque=f({blending:A,depthTest:T,depthWrite:null,colorWrite:_,stencilWrite:m,stencilTest:h}),this._occluderPipelineMaskWrite=f({blending:null,depthTest:P,depthWrite:null,colorWrite:null,stencilWrite:a,stencilTest:c})):this._occluderPipelineTransparent=this._occluderPipelineOpaque=this._occluderPipelineMaskWrite=null,this._occludeePipelineState=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,i){return e?this._occludeePipelineState:i===p.TRANSPARENT_OCCLUDER_MATERIAL?this._occluderPipelineTransparent??super.getPipeline():i===p.OCCLUDER_MATERIAL?this._occluderPipelineOpaque??super.getPipeline():this._occluderPipelineMaskWrite??super.getPipeline()}}const W=new Map([[E.POSITION,0],[E.PREVIOUSDELTA,1],[E.UV0,2],[E.COLOR,3],[E.COLORFEATUREATTRIBUTE,3],[E.OPACITYFEATUREATTRIBUTE,4],[E.SIZE,5],[E.SIZEFEATUREATTRIBUTE,5],[E.NORMAL,6]]);export{S as LineMarkerTechnique,W as vertexAttributeLocations};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{isColorOrColorEmission as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as t}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i,depthOnlyOutputBuffersOr as r}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as l}from"../lib/OITPass.js";import{OITPolygonOffset as n,depthWrite as s,oitDepthTest as o,blending as u,getDrawBuffers as p}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{stencilToolMaskBaseParams as a,stencilBaseAllZerosParams as d,stencilWriteMaskOn as T,stencilToolTransparentOccluderParams as f,depthCompareAlways as h,stencilToolMaskOccluderParams as m,stencilWriteMaskOff as O,depthCompareLess as E}from"../lib/StencilUtils.js";import{VertexAttribute as P}from"../lib/VertexAttribute.js";import{R}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as A}from"../../../webgl/enums.js";import{makePipelineState as b,defaultColorWrite as g,unpremultipliedAlphaToPremultipliedAlpha as I}from"../../../webgl/renderState.js";class S extends i{constructor(e,i){super(e,i,new t(R,(()=>import("./RibbonLine.glsl.js"))),_),this.primitiveType=i.wireframe?A.LINES:A.TRIANGLE_STRIP}_makePipelineState(t,i){const{oitPass:c,output:f,hasOccludees:h,hasPolygonOffset:m}=t,O=c===l.NONE,E=c===l.FrontFace;return b({blending:e(f)?u(c):null,depthTest:{func:o(c)},depthWrite:s(t),drawBuffers:r(f,p(c,f)),colorWrite:g,stencilWrite:h?T:null,stencilTest:h?i?a:d:null,polygonOffset:O||E?m?L:null:n})}initializePipeline(e){if(e.occluder){const t=e.hasPolygonOffset?L:null,{output:i,hasOccludees:l}=e;this._occluderPipelineTransparent=b({blending:I,polygonOffset:t,depthTest:h,depthWrite:null,colorWrite:g,stencilWrite:null,stencilTest:l?f:null,drawBuffers:r(i)}),this._occluderPipelineOpaque=b({blending:I,polygonOffset:t,depthTest:l?h:E,depthWrite:null,colorWrite:g,stencilWrite:l?O:null,stencilTest:l?m:null,drawBuffers:r(i)}),this._occluderPipelineMaskWrite=b({blending:null,polygonOffset:t,depthTest:E,depthWrite:null,colorWrite:null,stencilWrite:l?T:null,stencilTest:l?a:null,drawBuffers:r(i)})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){if(e)return this._occludeePipeline;switch(t){case c.TRANSPARENT_OCCLUDER_MATERIAL:return this._occluderPipelineTransparent??super.getPipeline();case c.OCCLUDER_MATERIAL:return this._occluderPipelineOpaque??super.getPipeline();default:return this._occluderPipelineMaskWrite??super.getPipeline()}}}const L={factor:0,units:-4},_=new Map([[P.POSITION,0],[P.PREVIOUSDELTA,1],[P.NEXTDELTA,2],[P.U0,3],[P.LINEPARAMETERS,4],[P.SIZE,5],[P.SIZEFEATUREATTRIBUTE,5],[P.COLOR,6],[P.COLORFEATUREATTRIBUTE,6],[P.OPACITYFEATUREATTRIBUTE,7],[P.OLIDCOLOR,8]]);export{S as RibbonLineTechnique,_ as vertexAttributeLocations};
5
+ import"../../../../core/has.js";import{isColorOrColorEmission as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as t}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i,depthOnlyOutputBuffersOr as r}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as l}from"../lib/OITPass.js";import{OITPolygonOffset as n,depthWrite as s,oitDepthTest as o,blending as u,getDrawBuffers as p}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{stencilToolMaskBaseParams as a,stencilBaseAllZerosParams as d,stencilWriteMaskOn as T,stencilToolTransparentOccluderParams as f,depthCompareAlways as h,stencilToolMaskOccluderParams as m,stencilWriteMaskOff as O,depthCompareLess as E}from"../lib/StencilUtils.js";import{VertexAttribute as P}from"../lib/VertexAttribute.js";import{R}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as A}from"../../../webgl/enums.js";import{makePipelineState as b,defaultColorWrite as g,unpremultipliedAlphaToPremultipliedAlpha as I}from"../../../webgl/renderState.js";class S extends i{constructor(e,i){super(e,i,new t(R,(()=>import("./RibbonLine.glsl.js"))),_),this.primitiveType=i.wireframe?A.LINES:A.TRIANGLE_STRIP}_makePipelineState(t,i){const{oitPass:c,output:f,hasOccludees:h,hasPolygonOffset:m}=t,O=c===l.NONE,E=c===l.FrontFace;return b({blending:e(f)?u(c):null,depthTest:{func:o(c)},depthWrite:s(t),drawBuffers:r(f,p(c,f)),colorWrite:g,stencilWrite:h?T:null,stencilTest:h?i?a:d:null,polygonOffset:O||E?m?L:null:n})}initializePipeline(e){if(e.occluder){const t=e.hasPolygonOffset?L:null,{output:i,hasOccludees:l}=e;this._occluderPipelineTransparent=b({blending:I,polygonOffset:t,depthTest:h,depthWrite:null,colorWrite:g,stencilWrite:null,stencilTest:l?f:null,drawBuffers:r(i)}),this._occluderPipelineOpaque=b({blending:I,polygonOffset:t,depthTest:l?h:E,depthWrite:null,colorWrite:g,stencilWrite:l?O:null,stencilTest:l?m:null,drawBuffers:r(i)}),this._occluderPipelineMaskWrite=b({blending:null,polygonOffset:t,depthTest:E,depthWrite:null,colorWrite:null,stencilWrite:l?T:null,stencilTest:l?a:null,drawBuffers:r(i)})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){if(e)return this._occludeePipeline;switch(t){case c.TRANSPARENT_OCCLUDER_MATERIAL:return this._occluderPipelineTransparent??super.getPipeline();case c.OCCLUDER_MATERIAL:return this._occluderPipelineOpaque??super.getPipeline();default:return this._occluderPipelineMaskWrite??super.getPipeline()}}}const L={factor:0,units:-4},_=new Map([[P.POSITION,0],[P.PREVIOUSDELTA,1],[P.NEXTDELTA,2],[P.U0,3],[P.LINEPARAMETERS,4],[P.COLOR,5],[P.COLORFEATUREATTRIBUTE,5],[P.SIZE,6],[P.SIZEFEATUREATTRIBUTE,6],[P.OPACITYFEATUREATTRIBUTE,7],[P.OLIDCOLOR,8]]);export{S as RibbonLineTechnique,_ as vertexAttributeLocations};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../Color.js";import i from"../Viewpoint.js";import s from"../core/Accessor.js";import r from"../core/Evented.js";import{destroyMaybe as o}from"../core/maybe.js";import n from"../core/Promise.js";import{watch as a,initial as m,whenOnce as p,syncAndInitial as l}from"../core/reactiveUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import{cast as c}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as g}from"../core/accessorSupport/ensureType.js";import f from"../geometry/Extent.js";import j from"../geometry/Point.js";import y from"../geometry/SpatialReference.js";import u from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as w}from"../layers/support/MediaElementView.js";import b from"../layers/support/TileInfo.js";import v from"../layers/support/VideoElement.js";import{DOMContainer as M}from"./DOMContainer.js";import{Viewport2DMixin as _}from"./Viewport2DMixin.js";import C from"./2d/AnimationManager.js";import x from"./2d/MapViewConstraints.js";import"../core/Error.js";import"../core/scheduling.js";import"../core/Logger.js";import"../core/colorUtils.js";import"../config.js";import"../symbols/cim/defaultCIMValues.js";import"../symbols/cim/enums.js";import"../core/floatRGBA.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Polygon.js";import"../geometry/Polyline.js";import"./2d/engine/webgl/definitions.js";import"./2d/engine/webgl/animations/instructions.js";import"../core/mathUtils.js";import"../symbols/Font.js";import"../core/ObjectPool.js";import"../geometry/support/Axis.js";import"../geometry/support/spatialReferenceUtils.js";import"../geometry/support/TileClipper.js";import"../symbols/cim/effects/EffectAddControlPoints.js";import"../symbols/cim/effects/EffectArrow.js";import"../symbols/cim/effects/EffectBuffer.js";import"../symbols/cim/effects/EffectControlMeasureLine.js";import"../symbols/cim/effects/EffectCut.js";import"../symbols/cim/effects/EffectDashes.js";import"../symbols/cim/effects/EffectDonut.js";import"../symbols/cim/effects/EffectEnclosingPolygon.js";import"../symbols/cim/effects/EffectJog.js";import"../symbols/cim/effects/EffectMove.js";import"../symbols/cim/effects/EffectOffset.js";import"../symbols/cim/effects/EffectRadial.js";import"../symbols/cim/effects/EffectReverse.js";import"../symbols/cim/effects/EffectRotate.js";import"../symbols/cim/effects/EffectScale.js";import"../symbols/cim/effects/EffectSuppress.js";import"../symbols/cim/effects/EffectTaperedPolygon.js";import"../symbols/cim/effects/EffectWave.js";import"../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../symbols/cim/placements/PlacementAtExtremities.js";import"../symbols/cim/placements/PlacementAtRatioPositions.js";import"../symbols/cim/placements/PlacementInsidePolygon.js";import"../symbols/cim/placements/PlacementOnLine.js";import"../symbols/cim/placements/PlacementOnVertices.js";import"../symbols/cim/placements/PlacementPolygonCenter.js";import"../symbols/cim/constants.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"./2d/engine/webgl/alignmentUtils.js";import"../symbols/support/defaults.js";import"../symbols/cim/OverrideHelper.js";import{Container as G}from"./2d/engine/Container.js";import"./2d/engine/webgl/enums.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"./webgl/enums.js";import"./2d/engine/webgl/shaders/BackgroundPrograms.js";import"./webgl/checkWebGLError.js";import"./2d/engine/webgl/DefaultVertexAttributeLayouts.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/cpuMapped/MappedMesh.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/shaders/TileInfoPrograms.js";import"./webgl/Texture.js";import"./webgl/FBOAttachmentType.js";import"./2d/engine/vectorTiles/style/StyleDefinition.js";import"./2d/engine/vectorTiles/enums.js";import"./2d/engine/webgl/shaders/BitBlitPrograms.js";import"../request.js";import"../core/urlUtils.js";import"../core/pbf.js";import"./2d/engine/webgl/shaders/StencilPrograms.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueType.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"./2d/engine/webgl/shaders/HighlightPrograms.js";import"./webgl/FramebufferObject.js";import"./2d/engine/webgl/meshing/SimpleMesh.js";import"./2d/engine/webgl/PooledUint32Array.js";import"./2d/engine/webgl/Profiler.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"./2d/engine/webgl/shaderGraph/techniques/animated/attributes.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/constants.js";import"./2d/engine/webgl/mesh/templates/templateUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../geometry/support/aaBoundingBox.js";import"./2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../arcade/ArcadeDate.js";import"../intl/locale.js";import"luxon";import"../core/sql/UnknownTimeZone.js";import"../layers/support/fieldUtils.js";import"../time/constants.js";import"./2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"./webgl/renderState.js";import"./3d/webgl-engine/core/shaderModules/glsl.js";import"./webgl/testSVGPremultipliedAlpha.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import"./2d/engine/transitions/FadeTransition.js";import"../chunks/earcut.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"../geometry/support/normalizeUtilsCommon.js";import"../geometry/support/Ellipsoid.js";import"../kernel.js";import"./2d/layers/support/util.js";import E from"./2d/navigation/MapViewNavigation.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../core/unitUtils.js";import"../geometry/ellipsoidUtils.js";import"../chunks/pe.js";import"../geometry/projection/projectors.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import{ViewStateManager as S}from"./2d/ViewStateManager.js";import P from"./2d/engine/webgl/Overlay.js";import q from"./2d/engine/webgl/OverlayContainer.js";import V from"./navigation/Navigation.js";import R from"./ui/DefaultUI.js";import T from"./ui/video/DefaultUIVideo.js";const O=new t("#000");let W;async function z(){const[,{Stage:e}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);W=e}const A=.01;let U=class extends s{};U=e([h("esri.views.VideoView.Base")],U);let k=class extends(_(M(r.EventedMixin(n.EsriPromiseMixin(U))))){constructor(e){super(e),this._isValid=!1,this.stage=null,this.layer=null,this.navigation=new V,this.ready=!1,this.spatialReference=new y({wkid:0}),this.stateManager=new S({constraints:new x({view:this,minScale:1,maxScale:A})}),this.type="2d",this.ui=new T,this.view2dType="video",this.addHandles([a((()=>this.preconditionsReady),(e=>e?this._startup():this._teardown())),a((()=>this.layer),(()=>this.addResolvingPromise(p((()=>this.ready)))),m),a((()=>this.videoSize),(([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)})),a((()=>[this.layer?.frameEffect,this._effectsContainer]),(()=>{this._effectsContainer&&(this._effectsContainer.effect=this.layer?.frameEffect??null)}),l)])}initialize(){this.addResolvingPromise(z().then((()=>(this._isValid=!0,p((()=>this.ready))))))}destroy(){this._teardown(),this.removeAllHandles(),this._set("preconditionsReady",!1),this.frameTask=o(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get preconditionsReady(){return!(!this._isValid||0===this.width||0===this.height||0===this.videoSize[0]||0===this.videoSize[1])}get rendering(){return this.stage?.renderRequested??!1}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];const[e,t]=this.size,i=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),s=t*i,r=e/i;return e/t>=1?i>=1?s<=e?[s,t]:[e,r]:r<=t?[e,r]:[s,t]:i>=1?r<=t?[e,r]:[s,t]:s<=e?[s,t]:[e,r]}_startup(){if(!this.layer)return;const e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference),this.stage=new W(this.surface,{renderingOptions:this.renderingOptions,backgroundColor:O}),this._prepareStage(this.stage);const t=new C({view:this});this._set("animationManager",t);const i=new E({view:this,animationManager:t});this._set("mapViewNavigation",i),this._updateConstraints(),this.frameTask.start(),this._set("ready",!0)}_teardown(){this.stage.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer.removeAllChildren(),this._overlayContainer=null,this.removeHandles("video-view"),this._set("ready",!1),this.stateManager.teardown(),this.frameTask.stop(),this.stationaryManager.clear()}_getViewpoint(){return new i({targetGeometry:new j({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([a((()=>this.stationary),(t=>e.stationary=t),l),a((()=>this.state.id),(()=>e.state=this.state),l),a((()=>this.renderingOptions),(t=>e.renderingOptions=t),l)],"video-view"),this._extent=new f({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new w({element:new v({video:this.layer?.videoElement,georeference:new u({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});const t=new P(this._videoElementView);this._overlayContainer=new q,this._overlayContainer.addChild(t),this._effectsContainer=new G,this._effectsContainer.addChild(this._overlayContainer),this.stage.addChild(this._effectsContainer);const i=document.createElement("div");i.classList.add("esri-video-poster"),this.container?.classList.add("esri-video-view"),this.container?.appendChild(i)}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){const e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),i=[];for(let r=t;r>A;r/=2)i.push(r);i.push(A);const{lods:s}=b.create({scales:i});this.constraints.set({lods:s,minScale:t})}_updatePanConstraints(){const e=e=>{if(!e.targetGeometry)return e;const[t,i]=this.videoSize,s=t*e.scale/2,r=i*e.scale/2,o=e.targetGeometry.clone();return o.x=Math.max(s,Math.min(t-s,o.x)),o.y=Math.max(r,Math.min(i-r,o.y)),e.targetGeometry=o,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}};e([d()],k.prototype,"_overlayContainer",void 0),e([d()],k.prototype,"_isValid",void 0),e([d()],k.prototype,"_effectsContainer",void 0),e([d()],k.prototype,"constraintsInfo",null),e([d()],k.prototype,"layer",void 0),e([d({type:V,nonNullable:!0})],k.prototype,"navigation",void 0),e([d({readOnly:!0})],k.prototype,"preconditionsReady",null),e([d({readOnly:!0})],k.prototype,"ready",void 0),e([d({readOnly:!0})],k.prototype,"rendering",null),e([d()],k.prototype,"scale",null),e([d()],k.prototype,"spatialReference",void 0),e([d()],k.prototype,"stateManager",void 0),e([d()],k.prototype,"type",void 0),e([d(),c((e=>e instanceof R?e:g(T,e)))],k.prototype,"ui",void 0),e([d({readOnly:!0})],k.prototype,"videoSize",null),e([d({readOnly:!0})],k.prototype,"view2dType",void 0),k=e([h("esri.views.VideoView")],k);const D=k;export{D as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Color.js";import i from"../Viewpoint.js";import s from"../core/Accessor.js";import r from"../core/Evented.js";import{destroyMaybe as o}from"../core/maybe.js";import n from"../core/Promise.js";import{watch as a,initial as l,whenOnce as p,syncAndInitial as m}from"../core/reactiveUtils.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import{cast as d}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as g}from"../core/accessorSupport/ensureType.js";import f from"../geometry/Extent.js";import j from"../geometry/Point.js";import y from"../geometry/SpatialReference.js";import{load as u,execute as w}from"../geometry/operators/projectOperator.js";import b from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as v}from"../layers/support/MediaElementView.js";import M from"../layers/support/TileInfo.js";import _ from"../layers/support/VideoElement.js";import{DOMContainer as C}from"./DOMContainer.js";import{Viewport2DBaseMixin as S}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as x}from"./Viewport2DMixin.js";import P from"./2d/AnimationManager.js";import V from"./2d/MapViewConstraints.js";import"../core/Error.js";import"../core/scheduling.js";import"../core/Logger.js";import"../core/colorUtils.js";import"../config.js";import"../symbols/cim/defaultCIMValues.js";import"../symbols/cim/enums.js";import"../core/floatRGBA.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Polygon.js";import"../geometry/Polyline.js";import"./2d/engine/webgl/definitions.js";import"./2d/engine/webgl/animations/instructions.js";import"../core/mathUtils.js";import"../symbols/Font.js";import"../core/ObjectPool.js";import"../geometry/support/Axis.js";import"../geometry/support/spatialReferenceUtils.js";import"../geometry/support/TileClipper.js";import"../symbols/cim/effects/EffectAddControlPoints.js";import"../symbols/cim/effects/EffectArrow.js";import"../symbols/cim/effects/EffectBuffer.js";import"../symbols/cim/effects/EffectControlMeasureLine.js";import"../symbols/cim/effects/EffectCut.js";import"../symbols/cim/effects/EffectDashes.js";import"../symbols/cim/effects/EffectDonut.js";import"../symbols/cim/effects/EffectEnclosingPolygon.js";import"../symbols/cim/effects/EffectJog.js";import"../symbols/cim/effects/EffectMove.js";import"../symbols/cim/effects/EffectOffset.js";import"../symbols/cim/effects/EffectRadial.js";import"../symbols/cim/effects/EffectReverse.js";import"../symbols/cim/effects/EffectRotate.js";import"../symbols/cim/effects/EffectScale.js";import"../symbols/cim/effects/EffectSuppress.js";import"../symbols/cim/effects/EffectTaperedPolygon.js";import"../symbols/cim/effects/EffectWave.js";import"../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../symbols/cim/placements/PlacementAtExtremities.js";import"../symbols/cim/placements/PlacementAtRatioPositions.js";import"../symbols/cim/placements/PlacementInsidePolygon.js";import"../symbols/cim/placements/PlacementOnLine.js";import"../symbols/cim/placements/PlacementOnVertices.js";import"../symbols/cim/placements/PlacementPolygonCenter.js";import"../symbols/cim/constants.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"./2d/engine/webgl/alignmentUtils.js";import"../symbols/support/defaults.js";import"../symbols/cim/OverrideHelper.js";import{Container as G}from"./2d/engine/Container.js";import"./2d/engine/webgl/enums.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"./webgl/enums.js";import"./2d/engine/webgl/shaders/BackgroundPrograms.js";import"./webgl/checkWebGLError.js";import"./2d/engine/webgl/DefaultVertexAttributeLayouts.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/cpuMapped/MappedMesh.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/shaders/TileInfoPrograms.js";import"./webgl/Texture.js";import"./webgl/FBOAttachmentType.js";import"./2d/engine/vectorTiles/style/StyleDefinition.js";import"./2d/engine/vectorTiles/enums.js";import"./2d/engine/webgl/shaders/BitBlitPrograms.js";import"../request.js";import"../core/urlUtils.js";import"../core/pbf.js";import"./2d/engine/webgl/shaders/StencilPrograms.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueType.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"./2d/engine/webgl/shaders/HighlightPrograms.js";import"./webgl/FramebufferObject.js";import"./2d/engine/webgl/meshing/SimpleMesh.js";import"./2d/engine/webgl/PooledUint32Array.js";import"./2d/engine/webgl/Profiler.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"./2d/engine/webgl/shaderGraph/techniques/animated/attributes.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/constants.js";import"./2d/engine/webgl/mesh/templates/templateUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../geometry/support/aaBoundingBox.js";import"./2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../arcade/ArcadeDate.js";import"../intl/locale.js";import"luxon";import"../core/sql/UnknownTimeZone.js";import"../layers/support/fieldUtils.js";import"../time/constants.js";import"./2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"./webgl/renderState.js";import"./3d/webgl-engine/core/shaderModules/glsl.js";import"./webgl/testSVGPremultipliedAlpha.js";import{ManagedCanvas as E}from"./2d/engine/ManagedCanvas.js";import"./2d/engine/transitions/FadeTransition.js";import"./2d/engine/webgl/meshing/definitions.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import"../chunks/earcut.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"../geometry/support/normalizeUtilsCommon.js";import"../geometry/support/Ellipsoid.js";import"../kernel.js";import"./2d/layers/support/util.js";import q from"./2d/navigation/MapViewNavigation.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../core/unitUtils.js";import"../geometry/ellipsoidUtils.js";import"../chunks/pe.js";import"../geometry/projection/projectors.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import{ViewStateManager as R}from"./2d/ViewStateManager.js";import D from"./2d/engine/webgl/Overlay.js";import T from"./2d/engine/webgl/OverlayContainer.js";import O from"./navigation/Navigation.js";import z from"./ui/DefaultUI.js";import W from"./ui/video/DefaultUIVideo.js";const A=new t("#000");let U;async function k(){const[,{ParentStage:e}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);U=e}const F=.01,H=["feature","geojson","csv","stream","ogc-feature","catalog","wfs","parquet","graphics"];let L=class extends s{};L=e([c("esri.views.VideoView.Base")],L);let B=class extends(x(S(C(r.EventedMixin(n.EsriPromiseMixin(L)))))){constructor(e){super(e),this._isValid=!1,this.stage=null,this.childStage=null,this._operationalDataView=null,this.operationalDataVisible=!0,this.layer=null,this.map=null,this.navigation=new O,this.ready=!1,this.spatialReference=new y({wkid:0}),this.stateManager=new R({constraints:new V({view:this,minScale:1,maxScale:F})}),this.type="2d",this.ui=new W,this.view2dType="video",this.addHandles([a((()=>this.preconditionsReady),(e=>e?this._startup():this._teardown())),a((()=>this.layer),(()=>this.addResolvingPromise(p((()=>this.ready)))),l),a((()=>this.videoSize),(([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)})),a((()=>[this.layer?.frameEffect,this._effectsContainer]),(()=>{this._effectsContainer&&(this._effectsContainer.effect=this.layer?.frameEffect??null)}),m),a((()=>[this.childStage,this.operationalDataVisible]),(()=>{this.childStage&&(this.childStage.visible=this.operationalDataVisible)}),m)])}initialize(){this.addResolvingPromise(k().then((()=>(this._isValid=!0,p((()=>this.ready))))))}destroy(){this._teardown(),this.removeAllHandles(),this._set("preconditionsReady",!1),this.frameTask=o(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get preconditionsReady(){return!(!this._isValid||0===this.width||0===this.height||0===this.videoSize[0]||0===this.videoSize[1])}get rendering(){return this.stage?.renderRequested??!1}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];const[e,t]=this.size,i=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),s=t*i,r=e/i;return e/t>=1?i>=1?s<=e?[s,t]:[e,r]:r<=t?[e,r]:[s,t]:i>=1?r<=t?[e,r]:[s,t]:s<=e?[s,t]:[e,r]}async hitTest(e,t){return this._operationalDataView&&this._operationalDataView.ready?this._operationalDataView.hitTest(e,t):{screenPoint:e,results:[]}}_startup(){if(!this.layer)return;const e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference);const t={renderingOptions:this.renderingOptions,backgroundColor:A,groundControlPoints:()=>this.layer?.groundControlPoints},i=new U(this.surface,t,new E(this.surface));this.stage=i,this._prepareStage(this.stage),this.childStage=i.childStage,this._prepareChildStage(this.childStage);const s=new P({view:this});this._set("animationManager",s);const r=new q({view:this,animationManager:s});this._set("mapViewNavigation",r),this._updateConstraints(),this.frameTask.start(),this._set("ready",!0)}_teardown(){this.stage.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer.removeAllChildren(),this._overlayContainer=null,this.removeHandles("video-view"),this._set("ready",!1),this.stateManager.teardown(),this.frameTask.stop(),this.stationaryManager.clear()}_getViewpoint(){return new i({targetGeometry:new j({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([a((()=>this.stationary),(t=>e.stationary=t),m),a((()=>this.state.id),(()=>e.state=this.state),m),a((()=>this.renderingOptions),(t=>e.renderingOptions=t),m)],"video-view"),this._extent=new f({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new v({element:new _({video:this.layer?.videoElement,georeference:new b({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});const t=new D(this._videoElementView);this._overlayContainer=new T,this._overlayContainer.addChild(t),this._effectsContainer=new G,this._effectsContainer.addChild(this._overlayContainer),this.stage.addChild(this._effectsContainer);const i=document.createElement("div");i.classList.add("esri-video-poster"),this.container?.classList.add("esri-video-view"),this.container?.appendChild(i)}_prepareChildStage(e){this.addHandles([a((()=>this.map),(async t=>{if(this.ready&&t!==this.map)return;const{default:i}=await import("./video/VideoOperationalDataView.js");this._operationalDataView=new i({stage:e,layerViewFilter:e=>new Set(H).has(e.type),videoWidth:this.videoSize[0],videoHeight:this.videoSize[1],map:t})}),m),a((()=>this.layer?.groundControlPoints),(async()=>{if(!this.layer?.groundControlPoints)return;const t=this.layer.groundControlPoints,i=t?.length;if(!i)return;await u();const s=new Array(i),r=e.state.spatialReference;for(let e=0;e<i;e++){const{lat:i,lon:o}=t[e];s[e]=w(new j(o,i),r)}let o=1/0,n=1/0,a=-1/0,l=-1/0;for(const e of s)o=Math.min(o,e.x),n=Math.min(n,e.y),a=Math.max(a,e.x),l=Math.max(l,e.y);const p=f.fromJSON({xmin:o,ymin:n,xmax:a,ymax:l,spatialReference:r});await(this._operationalDataView?.goTo(p,{animate:!1}).catch((()=>{})))}),m)])}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){const e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),i=[];for(let r=t;r>F;r/=2)i.push(r);i.push(F);const{lods:s}=M.create({scales:i});this.constraints.set({lods:s,minScale:t})}_updatePanConstraints(){const e=e=>{if(!e.targetGeometry)return e;const[t,i]=this.videoSize,s=t*e.scale/2,r=i*e.scale/2,o=e.targetGeometry.clone();return o.x=Math.max(s,Math.min(t-s,o.x)),o.y=Math.max(r,Math.min(i-r,o.y)),e.targetGeometry=o,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}};e([h()],B.prototype,"_overlayContainer",void 0),e([h()],B.prototype,"_isValid",void 0),e([h()],B.prototype,"_effectsContainer",void 0),e([h()],B.prototype,"constraintsInfo",null),e([h()],B.prototype,"operationalDataVisible",void 0),e([h()],B.prototype,"layer",void 0),e([h()],B.prototype,"map",void 0),e([h({type:O,nonNullable:!0})],B.prototype,"navigation",void 0),e([h({readOnly:!0})],B.prototype,"preconditionsReady",null),e([h({readOnly:!0})],B.prototype,"ready",void 0),e([h({readOnly:!0})],B.prototype,"rendering",null),e([h()],B.prototype,"scale",null),e([h()],B.prototype,"spatialReference",void 0),e([h()],B.prototype,"stateManager",void 0),e([h()],B.prototype,"type",void 0),e([h(),d((e=>e instanceof z?e:g(W,e)))],B.prototype,"ui",void 0),e([h({readOnly:!0})],B.prototype,"videoSize",null),e([h({readOnly:!0})],B.prototype,"view2dType",void 0),B=e([c("esri.views.VideoView")],B);const I=B;export{I as default};
package/views/View2D.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/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../Viewpoint.js";import i from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import s from"../core/Error.js";import has from"../core/has.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{watch as o,syncAndInitial as l}from"../core/reactiveUtils.js";import{initialize as p}from"../core/workers/workers.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import{cast as d}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as c}from"../core/accessorSupport/ensureType.js";import u from"../geometry/Polygon.js";import{isLoadedOrLoadFor as m}from"../geometry/projectionUtils.js";import y from"../layers/support/TileInfo.js";import{BreakpointsOwner as f}from"./BreakpointsOwner.js";import{DOMContainer as w}from"./DOMContainer.js";import{PopupView as V}from"./PopupView.js";import b from"./View.js";import{Viewport2DMixin as M}from"./Viewport2DMixin.js";import v from"./2d/AnimationManager.js";import{layerView2DImporter as _}from"./2d/layerViewModuleImportUtils.js";import j from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as S}from"./2d/viewpointUtils.js";import L from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as R}from"./2d/layers/support/util.js";import{clipContainsPoint as O}from"./2d/support/clippingUtils.js";import{getDefaultHighlightOptions as T,setDefaultHighlightOptions as k}from"./2d/support/highlightOptionsUtils.js";import{hitTest as C}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as x,takeScreenshot as D}from"./2d/support/screenshotUtils.js";import{Timeline as E}from"./2d/support/Timeline.js";import P from"./navigation/Navigation.js";import G from"./navigation/NavigationActionMap.js";import U from"./support/HighlightOptions.js";import{check as q}from"./support/WebGLRequirements.js";import z from"./ui/DefaultUI.js";import A from"./ui/2d/DefaultUI2D.js";import{isWebMap as I}from"../webmap/utils.js";import N from"../webmap/background/ColorBackground.js";let W,$,F,H,B,Z,J;async function K(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:r,MagnifierView2D:s,GridView2D:a,Stage:n}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);$=e,F=t,H=i,B=r,Z=s,J=a,W=n}let Q=class extends(M(f(V(w(b))))){constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.labelManager=null,this.navigation=new P({actionMap:new G({dragTertiary:"none"})}),this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.floors=new i,this.grid=null,this.map=null,this.spatialReferenceLocked=!1,this.timeline=new E,this.type="2d",this.view2dType=null,this.ui=new A,this.test={takeScreenshot:async e=>x(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},p()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=n(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new L(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:i,viewpoint:r,extent:s}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!s&&(t?.effectiveLODs||(a=-1),(!i||0===e&&-1===a)&&(null==r?.targetGeometry||"extent"!==r.targetGeometry.type&&!r.scale)))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return m(t.spatialReference,i)}get background(){return I(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get highlightOptions(){return T(this)}set highlightOptions(e){k(this,e)}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resolution(){return this.stateManager.resolution??0}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){const e=!(!this.magnifier.visible||null===this.magnifier.position||!this._magnifierView?.updatingHandles.updating),t=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some((e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating))||e);if(has("esri-2d-log-updating")){const i=this.allLayerViews.reduce(((e,t)=>({...e,[`${t.layer.id}(${t.layer.type})`]:!t.destroyed&&!("layerViews"in t)&&t.updating})),{});console.log(`Updating MapView: ${t}\n-> Null LayerViewManager: ${!this.layerViewManager}\n-> Null LabelManager: ${!this.labelManager}\n-> Null GraphicsView: ${!this.graphicsView}\n-> layerViewManager.updating: ${this.layerViewManager?.updating}\n-> labelManager.updating: ${this.labelManager?.updating}\n-> graphicsView.updating: ${this.graphicsView?.updating}\n-> allLayerViews: ${JSON.stringify(i)}\n-> updatingMagnifier: ${e}\n`)}return t}get visibleArea(){const e=this.stateManager.visibleArea;return e?new u({rings:[e.map((e=>[e[0],e[1]]))],spatialReference:this.spatialReference}):e}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}async hitTest(e,t){return C(this,e,t)}async takeScreenshot(e){return D(this._getScreenshotView(e),e)}toScreen(e,t){return this.stateManager.toScreen(e,t)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return I(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return I(this.map)?this.map.initialViewProperties.timeExtent:null}hasLayerViewModule(e){return _.hasLayerViewModule(e)}importLayerView(e){return _.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(a.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=this.toMap(e),i=await this.hitTest(e),r=this.allLayerViews.toArray().filter((i=>i.clips.every((i=>O(this,i,e,t))))).reverse(),s=new globalThis.Map(r.map((e=>[e.layer.uid,e]))),a=[];let n=0,o=0;for(;n<i.results.length||o<r.length;){const e=i.results.at(n);if(e&&"graphic"!==e.type){++n;continue}const l=s.get((e?.layer??e?.graphic.layer)?.uid);if((!e||l)&&o<r.length&&r.at(o)!==l){const e=r.at(o);"fetchPopupFeaturesAtLocation"in e&&a.push({mapPoint:t,layerView:e}),++o}else e&&(a.push({graphic:e.graphic,layerView:l}),++n)}return{hits:a,location:t}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}async validate(){let e=q(this.type);if(has("safari")&&has("safari")<9&&(e=new s("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:has("safari")})),null!=e){a.getLogger(this).warn("#validate()",e.message);const t=document.createElement("div");t.setAttribute("style","display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;");const i=document.createElement("div");i.innerHTML="Unable to display map. WebGL2 support is required.",i.setAttribute("style","font-size: 24px; font-weight: bold;");const r=document.createElement("div");r.innerHTML="Ensure that your browser and hardware meet the minimum requirements.",r.setAttribute("style","font-size: 18px;");const s=document.createElement("a");throw s.innerHTML="https://esriurl.com/systemRequirements",s.target="_blank",s.setAttribute("style","font-size: 18px;"),s.href="https://esriurl.com/systemRequirements",t.appendChild(i),t.appendChild(r),t.appendChild(s),this.surface.appendChild(t),e}}loadAsyncDependencies(){return K()}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:r,padding:s,size:a}=this;if(!e)return null;const n=r&&"initialViewProperties"in r?r.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),l=n?.viewpoint,p=l?.targetGeometry?.extent??i,h=p?.center,d=l?.rotation??0,g=l?.scale||p&&S(p,[a[0]-s.left-s.right,a[1]-s.top-s.bottom]),c=o.center??h,u=o.rotation??d,m=o.scale??g;return c&&m?new t({targetGeometry:c,scale:m,rotation:u}):null}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=new W(this.surface,{canvas:this.renderCanvas,contextOptions:{disabledExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions},renderingOptions:this.renderingOptions,timeline:this.timeline});this.stage=t,this._magnifierView=new Z,this._magnifierView.magnifier=this.magnifier,this._gridView=new J;const i=new H({view:this});this._set("labelManager",i);const r=new v({view:this});this._set("animationManager",r);const s=new B({view:this,animationManager:r});this._set("mapViewNavigation",s),this._setupSpatialReferenceDependentProperties(),this.addHandles([this.rootLayerViews.on("change",(()=>this._updateStageChildren())),t.on("webgl-error",(e=>this.fatalError=e.error)),o((()=>this.stationary),(e=>t.stationary=e),l),o((()=>this.background),(e=>{t.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color}),l),o((()=>this.magnifier),(e=>this._magnifierView.magnifier=e),l),o((()=>this.grid),(e=>this._gridView.grid=e),l),o((()=>this.renderingOptions),(e=>t.renderingOptions=e),l),o((()=>this.highlights.items.map((e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})))),(()=>{t.highlightGradient=R(t.highlightGradient,this.highlights.items)}),l),o((()=>this.state.id),(()=>t.state=this.state),l)],"map-view"),this._updateStageChildren();const a=this._resolveWhenReady;this._resolveWhenReady=[],a.forEach((e=>e(this))),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach((e=>{this.stage.addChild(e.container)}));const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(){const e=new j(y.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new $({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new F(e)});this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:i,size:r,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:i,size:r,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}static{this.type="2d"}};e([h({constructOnly:!0})],Q.prototype,"deactivatedWebGLExtensions",void 0),e([h({constructOnly:!0})],Q.prototype,"debugWebGLExtensions",void 0),e([h({readOnly:!0})],Q.prototype,"featuresTilingScheme",void 0),e([h({readOnly:!0})],Q.prototype,"graphicsTileStore",null),e([h()],Q.prototype,"graphicsView",void 0),e([h()],Q.prototype,"constraintsInfo",null),e([h()],Q.prototype,"initialExtentRequired",null),e([h()],Q.prototype,"labelManager",void 0),e([h({type:P,nonNullable:!0})],Q.prototype,"navigation",void 0),e([h({constructOnly:!0})],Q.prototype,"renderCanvas",void 0),e([h()],Q.prototype,"renderingOptions",void 0),e([h({constructOnly:!0})],Q.prototype,"supersampleScreenshotsEnabled",void 0),e([h({readOnly:!0})],Q.prototype,"supportsGround",void 0),e([h()],Q.prototype,"defaultsFromMapSettings",null),e([h({readOnly:!0})],Q.prototype,"typeSpecificPreconditionsReady",null),e([h({type:N})],Q.prototype,"background",null),e([h()],Q.prototype,"center",null),e([h({type:i})],Q.prototype,"floors",void 0),e([h()],Q.prototype,"grid",void 0),e([h({type:U})],Q.prototype,"highlightOptions",null),e([h()],Q.prototype,"map",void 0),e([h()],Q.prototype,"padding",null),e([h({readOnly:!0})],Q.prototype,"rendering",null),e([h({readOnly:!0})],Q.prototype,"resolution",null),e([h()],Q.prototype,"scale",null),e([h({constructOnly:!0})],Q.prototype,"spatialReferenceLocked",void 0),e([h({readOnly:!0})],Q.prototype,"tileInfo",null),e([h({type:E,readOnly:!0})],Q.prototype,"timeline",void 0),e([h({readOnly:!0})],Q.prototype,"type",void 0),e([h({readOnly:!0})],Q.prototype,"updating",null),e([h({readOnly:!0})],Q.prototype,"view2dType",void 0),e([h({readOnly:!0})],Q.prototype,"visibleArea",null),e([h()],Q.prototype,"zoom",null),e([h({readOnly:!0})],Q.prototype,"navigating",null),e([h(),d((e=>e instanceof z?e:c(A,e)))],Q.prototype,"ui",void 0),Q=e([g("esri.views.View2D")],Q);const X=Q;export{X as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Viewpoint.js";import i from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import s from"../core/Error.js";import has from"../core/has.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{watch as o,syncAndInitial as l}from"../core/reactiveUtils.js";import{initialize as p}from"../core/workers/workers.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import{cast as d}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as c}from"../core/accessorSupport/ensureType.js";import u from"../geometry/Polygon.js";import{isLoadedOrLoadFor as m}from"../geometry/projectionUtils.js";import y from"../layers/support/TileInfo.js";import{BreakpointsOwner as f}from"./BreakpointsOwner.js";import{DOMContainer as w}from"./DOMContainer.js";import{PopupView as V}from"./PopupView.js";import M from"./View.js";import{Viewport2DBaseMixin as b}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as v}from"./Viewport2DMixin.js";import _ from"./2d/AnimationManager.js";import{layerView2DImporter as j}from"./2d/layerViewModuleImportUtils.js";import S from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as L}from"./2d/viewpointUtils.js";import{ManagedCanvas as R}from"./2d/engine/ManagedCanvas.js";import O from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as T}from"./2d/layers/support/util.js";import{clipContainsPoint as C}from"./2d/support/clippingUtils.js";import{getDefaultHighlightOptions as k,setDefaultHighlightOptions as x}from"./2d/support/highlightOptionsUtils.js";import{hitTest as D}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as E,takeScreenshot as P}from"./2d/support/screenshotUtils.js";import{Timeline as G}from"./2d/support/Timeline.js";import U from"./navigation/Navigation.js";import q from"./navigation/NavigationActionMap.js";import z from"./support/HighlightOptions.js";import{check as A}from"./support/WebGLRequirements.js";import I from"./ui/DefaultUI.js";import N from"./ui/2d/DefaultUI2D.js";import{isWebMap as W}from"../webmap/utils.js";import $ from"../webmap/background/ColorBackground.js";let F,H,B,Z,J,K,Q;async function X(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:r,MagnifierView2D:s,GridView2D:a,Stage:n}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);H=e,B=t,Z=i,J=r,K=s,Q=a,F=n}let Y=class extends(v(b(f(V(w(M)))))){constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.labelManager=null,this.navigation=new U({actionMap:new q({dragTertiary:"none"})}),this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.floors=new i,this.grid=null,this.map=null,this.spatialReferenceLocked=!1,this.timeline=new G,this.type="2d",this.view2dType=null,this.ui=new N,this.test={takeScreenshot:async e=>E(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},p()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=n(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new O(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:i,viewpoint:r,extent:s}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!s&&(t?.effectiveLODs||(a=-1),(!i||0===e&&-1===a)&&(null==r?.targetGeometry||"extent"!==r.targetGeometry.type&&!r.scale)))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return m(t.spatialReference,i)}get background(){return W(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get highlightOptions(){return k(this)}set highlightOptions(e){x(this,e)}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resolution(){return this.stateManager.resolution??0}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){const e=!(!this.magnifier.visible||null===this.magnifier.position||!this._magnifierView?.updatingHandles.updating),t=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some((e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating))||e);if(has("esri-2d-log-updating")){const i=this.allLayerViews.reduce(((e,t)=>({...e,[`${t.layer.id}(${t.layer.type})`]:!t.destroyed&&!("layerViews"in t)&&t.updating})),{});console.log(`Updating MapView: ${t}\n-> Null LayerViewManager: ${!this.layerViewManager}\n-> Null LabelManager: ${!this.labelManager}\n-> Null GraphicsView: ${!this.graphicsView}\n-> layerViewManager.updating: ${this.layerViewManager?.updating}\n-> labelManager.updating: ${this.labelManager?.updating}\n-> graphicsView.updating: ${this.graphicsView?.updating}\n-> allLayerViews: ${JSON.stringify(i)}\n-> updatingMagnifier: ${e}\n`)}return t}get visibleArea(){const e=this.stateManager.visibleArea;return e?new u({rings:[e.map((e=>[e[0],e[1]]))],spatialReference:this.spatialReference}):e}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}async hitTest(e,t){return D(this,e,t)}async takeScreenshot(e){return P(this._getScreenshotView(e),e)}toScreen(e,t){return this.stateManager.toScreen(e,t)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return W(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return W(this.map)?this.map.initialViewProperties.timeExtent:null}hasLayerViewModule(e){return j.hasLayerViewModule(e)}importLayerView(e){return j.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(a.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=this.toMap(e),i=await this.hitTest(e),r=this.allLayerViews.toArray().filter((i=>i.clips.every((i=>C(this,i,e,t))))).reverse(),s=new globalThis.Map(r.map((e=>[e.layer.uid,e]))),a=[];let n=0,o=0;for(;n<i.results.length||o<r.length;){const e=i.results.at(n);if(e&&"graphic"!==e.type){++n;continue}const l=s.get((e?.layer??e?.graphic.layer)?.uid);if((!e||l)&&o<r.length&&r.at(o)!==l){const e=r.at(o);"fetchPopupFeaturesAtLocation"in e&&a.push({mapPoint:t,layerView:e}),++o}else e&&(a.push({graphic:e.graphic,layerView:l}),++n)}return{hits:a,location:t}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}async validate(){let e=A(this.type);if(has("safari")&&has("safari")<9&&(e=new s("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:has("safari")})),null!=e){a.getLogger(this).warn("#validate()",e.message);const t=document.createElement("div");t.setAttribute("style","display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;");const i=document.createElement("div");i.innerHTML="Unable to display map. WebGL2 support is required.",i.setAttribute("style","font-size: 24px; font-weight: bold;");const r=document.createElement("div");r.innerHTML="Ensure that your browser and hardware meet the minimum requirements.",r.setAttribute("style","font-size: 18px;");const s=document.createElement("a");throw s.innerHTML="https://esriurl.com/systemRequirements",s.target="_blank",s.setAttribute("style","font-size: 18px;"),s.href="https://esriurl.com/systemRequirements",t.appendChild(i),t.appendChild(r),t.appendChild(s),this.surface.appendChild(t),e}}loadAsyncDependencies(){return X()}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:r,padding:s,size:a}=this;if(!e)return null;const n=r&&"initialViewProperties"in r?r.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),l=n?.viewpoint,p=l?.targetGeometry?.extent??i,h=p?.center,d=l?.rotation??0,g=l?.scale||p&&L(p,[a[0]-s.left-s.right,a[1]-s.top-s.bottom]),c=o.center??h,u=o.rotation??d,m=o.scale??g;return c&&m?new t({targetGeometry:c,scale:m,rotation:u}):null}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=new R(this.surface),i=new F(this.surface,{canvas:this.renderCanvas,contextOptions:{disabledExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions},renderingOptions:this.renderingOptions,timeline:this.timeline},t);this.stage=i,this._magnifierView=new K,this._magnifierView.magnifier=this.magnifier,this._gridView=new Q;const r=new Z({view:this});this._set("labelManager",r);const s=new _({view:this});this._set("animationManager",s);const a=new J({view:this,animationManager:s});this._set("mapViewNavigation",a),this._setupSpatialReferenceDependentProperties(),this.addHandles([this.rootLayerViews.on("change",(()=>this._updateStageChildren())),i.on("webgl-error",(e=>this.fatalError=e.error)),o((()=>this.stationary),(e=>i.stationary=e),l),o((()=>this.background),(e=>{i.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color}),l),o((()=>this.magnifier),(e=>this._magnifierView.magnifier=e),l),o((()=>this.grid),(e=>this._gridView.grid=e),l),o((()=>this.renderingOptions),(e=>i.renderingOptions=e),l),o((()=>this.highlights.items.map((e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})))),(()=>{i.highlightGradient=T(i.highlightGradient,this.highlights.items)}),l),o((()=>this.state.id),(()=>i.state=this.state),l)],"map-view"),this._updateStageChildren();const n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach((e=>e(this))),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach((e=>{this.stage.addChild(e.container)}));const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(){const e=new S(y.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new H({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new B(e)});this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:i,size:r,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:i,size:r,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}static{this.type="2d"}};e([h({constructOnly:!0})],Y.prototype,"deactivatedWebGLExtensions",void 0),e([h({constructOnly:!0})],Y.prototype,"debugWebGLExtensions",void 0),e([h({readOnly:!0})],Y.prototype,"featuresTilingScheme",void 0),e([h({readOnly:!0})],Y.prototype,"graphicsTileStore",null),e([h()],Y.prototype,"graphicsView",void 0),e([h()],Y.prototype,"constraintsInfo",null),e([h()],Y.prototype,"initialExtentRequired",null),e([h()],Y.prototype,"labelManager",void 0),e([h({type:U,nonNullable:!0})],Y.prototype,"navigation",void 0),e([h({constructOnly:!0})],Y.prototype,"renderCanvas",void 0),e([h()],Y.prototype,"renderingOptions",void 0),e([h({constructOnly:!0})],Y.prototype,"supersampleScreenshotsEnabled",void 0),e([h({readOnly:!0})],Y.prototype,"supportsGround",void 0),e([h()],Y.prototype,"defaultsFromMapSettings",null),e([h({readOnly:!0})],Y.prototype,"typeSpecificPreconditionsReady",null),e([h({type:$})],Y.prototype,"background",null),e([h()],Y.prototype,"center",null),e([h({type:i})],Y.prototype,"floors",void 0),e([h()],Y.prototype,"grid",void 0),e([h({type:z})],Y.prototype,"highlightOptions",null),e([h()],Y.prototype,"map",void 0),e([h()],Y.prototype,"padding",null),e([h({readOnly:!0})],Y.prototype,"rendering",null),e([h({readOnly:!0})],Y.prototype,"resolution",null),e([h()],Y.prototype,"scale",null),e([h({constructOnly:!0})],Y.prototype,"spatialReferenceLocked",void 0),e([h({readOnly:!0})],Y.prototype,"tileInfo",null),e([h({type:G,readOnly:!0})],Y.prototype,"timeline",void 0),e([h({readOnly:!0})],Y.prototype,"type",void 0),e([h({readOnly:!0})],Y.prototype,"updating",null),e([h({readOnly:!0})],Y.prototype,"view2dType",void 0),e([h({readOnly:!0})],Y.prototype,"visibleArea",null),e([h()],Y.prototype,"zoom",null),e([h({readOnly:!0})],Y.prototype,"navigating",null),e([h(),d((e=>e instanceof I?e:c(N,e)))],Y.prototype,"ui",void 0),Y=e([g("esri.views.View2D")],Y);const ee=Y;export{ee as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{_ as t}from"../chunks/tslib.es6.js";import e from"../Viewpoint.js";import{watch as i,sync as n}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import r from"./2d/FrameTask.js";import o from"./2d/MapViewConstraints.js";import{ViewStateManager as p}from"./2d/ViewStateManager.js";import{StationaryManager as l}from"./2d/support/StationaryManager.js";import{ViewEvents as g}from"./input/ViewEvents.js";const d=d=>{let h=class extends d{constructor(...t){super(...t),this.fullOpacity=1,this.stateManager=new p({constraints:new o({view:this})}),this.stationaryManager=new l,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!1,labelsAnimationTime:0,labelCollisionsEnabled:!1},this.frameTask=new r(this),this.viewEvents=new g(this),this.padding={top:0,right:0,bottom:0,left:0},this.addHandles([i((()=>this.viewpoint),(()=>this.stationaryManager.flip()),n)])}get constraintsInfo(){return{lods:null,spatialReference:null}}get extent(){return this.stateManager?.extent??null}set extent(t){this.stateManager.extent=t}get state(){return this.stateManager.state}get interacting(){return!1}get stationary(){return!this.animation&&this.stationaryManager.stationary}set animation(t){const e=this._get("animation");if(t===e)return;if(e&&e.stop(),t!==this.animationManager.animation&&this.animationManager.stop(),!t||t.isFulfilled())return void this._set("animation",null);this._set("animation",t);const i=()=>{this.destroyed||t===this._get("animation")&&(this._set("animation",null),this.frameTask?.requestFrame())};t.when(i,i)}get constraints(){return this.stateManager?.constraints}set constraints(t){t.view=this;const e=this.stateManager.constraints;this.stateManager.constraints=t,e?.destroy()}get padding(){return this.stateManager?.padding}set padding(t){this.stateManager&&(this.stateManager.padding=t)}get resizeAlign(){return this.stateManager.resizeAlign}set resizeAlign(t){this.stateManager.resizeAlign=t}get rotation(){return this.stateManager.rotation??0}set rotation(t){const{rotationEnabled:e}=this.constraints;this.constraints.rotationEnabled=!0,this.stateManager.rotation=t,this.constraints.rotationEnabled=e}get viewpoint(){return this.stateManager.viewpoint??null}set viewpoint(t){this.stateManager.viewpoint=t,this.frameTask.requestFrame()}};return t([a({readOnly:!0})],h.prototype,"animationManager",void 0),t([a({readOnly:!0})],h.prototype,"fullOpacity",void 0),t([a()],h.prototype,"stateManager",void 0),t([a()],h.prototype,"constraintsInfo",null),t([a()],h.prototype,"extent",null),t([a({readOnly:!0})],h.prototype,"state",null),t([a({readOnly:!0})],h.prototype,"mapViewNavigation",void 0),t([a()],h.prototype,"renderingOptions",void 0),t([a({readOnly:!0})],h.prototype,"interacting",null),t([a()],h.prototype,"stationary",null),t([a()],h.prototype,"animation",null),t([a({type:o})],h.prototype,"constraints",null),t([a()],h.prototype,"padding",null),t([a()],h.prototype,"resizeAlign",null),t([a()],h.prototype,"rotation",null),t([a({readOnly:!0})],h.prototype,"viewEvents",void 0),t([a({type:e})],h.prototype,"viewpoint",null),h=t([s("esri.views.Viewport2DBaseMixin")],h),h};export{d as Viewport2DBaseMixin};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../chunks/tslib.es6.js";import e from"../Viewpoint.js";import{watch as i,sync as n}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import r from"./2d/FrameTask.js";import{GoToManager as o}from"./2d/GoToManager.js";import p from"./2d/MapViewConstraints.js";import{ViewStateManager as l}from"./2d/ViewStateManager.js";import g from"./2d/input/MapViewInputManager.js";import{StationaryManager as h}from"./2d/support/StationaryManager.js";import{ViewEvents as d}from"./input/ViewEvents.js";import{isSupportedScreenPointEvent as u,createScreenPointFromSupportedEvent as m}from"./support/screenUtils.js";const c=c=>{let y=class extends c{constructor(...t){super(...t),this.fullOpacity=1,this.stateManager=new l({constraints:new p({view:this})}),this.goToManager=new o({view:this}),this.stationaryManager=new h,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!1,labelsAnimationTime:0,labelCollisionsEnabled:!1},this.frameTask=new r(this),this.inputManager=new g({view:this}),this.viewEvents=new d(this),this.padding={top:0,right:0,bottom:0,left:0},this.addHandles([i((()=>this.viewpoint),(()=>this.stationaryManager.flip()),n),this.on("resize",(t=>this.stateManager.resize(t.width,t.height)))])}get constraintsInfo(){return{lods:null,spatialReference:null}}get extent(){return this.stateManager?.extent??null}set extent(t){this.stateManager.extent=t}get state(){return this.stateManager.state}get interacting(){return this.navigating}get stationary(){return!this.animation&&!this.navigating&&!this.resizing&&this.stationaryManager.stationary}set animation(t){const e=this._get("animation");if(t===e)return;if(e&&e.stop(),t!==this.animationManager.animation&&this.animationManager.stop(),!t||t.isFulfilled())return void this._set("animation",null);this._set("animation",t);const i=()=>{this.destroyed||t===this._get("animation")&&(this._set("animation",null),this.frameTask?.requestFrame())};t.when(i,i)}get constraints(){return this.stateManager?.constraints}set constraints(t){t.view=this;const e=this.stateManager.constraints;this.stateManager.constraints=t,e?.destroy()}get padding(){return this.stateManager?.padding}set padding(t){this.stateManager&&(this.stateManager.padding=t)}get resizeAlign(){return this.stateManager.resizeAlign}set resizeAlign(t){this.stateManager.resizeAlign=t}get rotation(){return this.stateManager.rotation??0}set rotation(t){const{rotationEnabled:e}=this.constraints;this.constraints.rotationEnabled=!0,this.stateManager.rotation=t,this.constraints.rotationEnabled=e}get viewpoint(){return this.stateManager.viewpoint??null}set viewpoint(t){this.stateManager.viewpoint=t,this.frameTask.requestFrame()}on(t,e,i,n){const a=this.inputManager&&this.viewEvents.on(t,e,i,n);return a||super.on(t,e)}hasEventListener(t){return super.hasEventListener(t)||this.viewEvents.hasHandler(t)}goTo(t,e){return this.goToManager.goTo(t,e)}toMap(t){if(!this.ready)return null;const e=u(t)?m(this,t):t;return this.stateManager.toMap(e)}};return t([a({readOnly:!0})],y.prototype,"animationManager",void 0),t([a({readOnly:!0})],y.prototype,"fullOpacity",void 0),t([a()],y.prototype,"stateManager",void 0),t([a()],y.prototype,"constraintsInfo",null),t([a()],y.prototype,"extent",null),t([a()],y.prototype,"goToManager",void 0),t([a({readOnly:!0})],y.prototype,"state",null),t([a({readOnly:!0})],y.prototype,"mapViewNavigation",void 0),t([a()],y.prototype,"renderingOptions",void 0),t([a({readOnly:!0})],y.prototype,"interacting",null),t([a()],y.prototype,"stationary",null),t([a()],y.prototype,"animation",null),t([a({type:p})],y.prototype,"constraints",null),t([a({readOnly:!0})],y.prototype,"inputManager",void 0),t([a()],y.prototype,"padding",null),t([a()],y.prototype,"resizeAlign",null),t([a()],y.prototype,"rotation",null),t([a({readOnly:!0})],y.prototype,"viewEvents",void 0),t([a({type:e})],y.prototype,"viewpoint",null),y=t([s("esri.views.Viewport2DMixin")],y),y};export{c as Viewport2DMixin};
5
+ import{_ as t}from"../chunks/tslib.es6.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as e}from"../core/accessorSupport/decorators/subclass.js";import{GoToManager as s}from"./2d/GoToManager.js";import o from"./2d/input/MapViewInputManager.js";import{isSupportedScreenPointEvent as i,createScreenPointFromSupportedEvent as n}from"./support/screenUtils.js";const a=a=>{let p=class extends a{constructor(...t){super(...t),this.goToManager=new s({view:this}),this.inputManager=new o({view:this}),this.addHandles([this.on("resize",(t=>this.stateManager.resize(t.width,t.height)))])}get interacting(){return this.navigating}get stationary(){return!this.animation&&!this.navigating&&!this.resizing&&this.stationaryManager.stationary}on(t,r,e,s){const o=this.inputManager&&this.viewEvents.on(t,r,e,s);return o||super.on(t,r)}hasEventListener(t){return super.hasEventListener(t)||this.viewEvents.hasHandler(t)}goTo(t,r){return this.goToManager.goTo(t,r)}toMap(t){if(!this.ready)return null;const r=i(t)?n(this,t):t;return this.stateManager.toMap(r)}};return t([r()],p.prototype,"goToManager",void 0),t([r({readOnly:!0})],p.prototype,"interacting",null),t([r()],p.prototype,"stationary",null),t([r({readOnly:!0})],p.prototype,"inputManager",void 0),p=t([e("esri.views.Viewport2DMixin")],p),p};export{a as Viewport2DMixin};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{createTask as o}from"../../core/asyncUtils.js";import{handlesGroup as t}from"../../core/handleUtils.js";import{removeMaybe as e}from"../../core/maybe.js";import{throwIfAborted as n,isAbortError as i,onAbort as a}from"../../core/promiseUtils.js";import{watch as r,syncAndInitial as l,on as s,whenOnce as c}from"../../core/reactiveUtils.js";function u(t,n){t.interactive=!0;const{tool:i,view:r}=t;r.activeTool=i;let l=a(n,(()=>{r.activeTool===i&&(r.activeTool=null)}));return o((async o=>{await c((()=>!t.tool?.active),o),l=e(l)}),n)}function m(o,t){return r((()=>o.interactive),(()=>p(o,t)),l)}function p(o,t){o.interactive?v(o,t):f(o)}function v(o,t){f(o);const{view:e,analysis:n}=o,i=new t({view:e,analysis:n,analysisViewData:o});return o.tool=i,e.tools.add(i),i}function f(o){const{view:t,tool:e}=o;null!=e&&(t.tools.remove(e),o.tool=null)}function y(e,a){const r=e.userOperation,l=o((async o=>{if(r){const t=r.promise.catch((()=>{}));r?.abort(),await t,n(o)}const l=u(e,{signal:o}),c=a?.shouldRejectOnCancel??(()=>!0),m=t([s((()=>e.tool),"cancel",(()=>{c()&&l.abort()}))]),{tool:p}=e;try{p&&(p.resetCreated(),a?.onToolActivated?.(p)),await l.promise,n(o)}catch(v){if(o.aborted||!i(v)||c())throw v}finally{m?.remove()}}),{signal:a?.abortOptions?.signal});return e.userOperation=l,l.promise.finally((()=>{e.userOperation===l&&(e.userOperation=null)}))}function d(o,t){const e=o.analysis.clone();return y(o,{abortOptions:t?.placementOptions,onToolActivated:t?.onToolActivated,shouldRejectOnCancel:()=>{const{analysis:t}=o;return!t.valid||t.equals(e)}})}export{u as activateAnalysisViewTool,m as connectAnalysisViewToTool,f as removeAnalysisViewTool,y as startExclusiveInteractiveOperation,d as startPlaceOperation};
5
+ import{createTask as o}from"../../core/asyncUtils.js";import{handlesGroup as t}from"../../core/handleUtils.js";import{removeMaybe as e}from"../../core/maybe.js";import{throwIfAborted as n,isAbortError as i,onAbort as a}from"../../core/promiseUtils.js";import{watch as r,syncAndInitial as s,on as l,whenOnce as c}from"../../core/reactiveUtils.js";function u(t,n){t.interactive=!0;const{tool:i,view:r}=t;r.activeTool=i;let s=a(n,(()=>{r.activeTool===i&&(r.activeTool=null)}));return o((async o=>{await c((()=>!t.tool?.active),o),s=e(s)}),n)}function m(o,t){return r((()=>o.interactive),(()=>p(o,t)),s)}function p(o,t){o.interactive?v(o,t):f(o)}function v(o,t){f(o);const{view:e,analysis:n}=o,i=new t({view:e,analysis:n,analysisViewData:o});return o.tool=i,e.tools.add(i),i}function f(o){const{view:t,tool:e}=o;null!=e&&(t.tools.remove(e),o.tool=null)}function y(e,a){const r=e.userOperation,s=o((async o=>{if(r){const t=r.promise.catch((()=>{}));r?.abort(),await t,n(o)}const s=u(e,{signal:o}),c=a?.shouldRejectOnCancel??(()=>!0),m=t([l((()=>e.tool),"cancel",(()=>{c()&&s.abort()}))]),{tool:p}=e;try{p&&(p.resetCreated(),a?.onToolActivated?.(p)),await s.promise,n(o)}catch(v){if(o.aborted||!i(v)||c())throw v}finally{m?.remove()}}),{signal:a?.abortOptions?.signal});return e.userOperation=s,s.promise.finally((()=>{e.userOperation===s&&(e.userOperation=null)}))}async function d(o,t){const e=o.analysis.clone();return await y(o,{abortOptions:t?.placementOptions,onToolActivated:t?.onToolActivated,shouldRejectOnCancel:()=>{const{analysis:t}=o;return!t.valid||t.equals(e)}}),{}}export{u as activateAnalysisViewTool,m as connectAnalysisViewToTool,f as removeAnalysisViewTool,y as startExclusiveInteractiveOperation,d as startPlaceOperation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import s from"../../core/Collection.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";const r=r=>{let n=class extends r{constructor(...e){super(...e),this.layer=null}get interactive(){return null!=this.analysisView&&this.analysisView.interactive}set interactive(e){null!=this.analysisView&&(this.analysisView.interactive=e)}get results(){return this.analysisView?.results??new s}get selectedDimension(){return null!=this.analysisView?this.analysisView.selectedDimension:null}set selectedDimension(e){null!=this.analysisView&&(this.analysisView.selectedDimension=e)}async createLengthDimensions(e){await(this.analysisView?.createLengthDimensions(e))}async place(e){await(this.analysisView?.place(e))}};return e([i()],n.prototype,"layer",void 0),e([i()],n.prototype,"interactive",null),e([i({readOnly:!0})],n.prototype,"results",null),e([i()],n.prototype,"selectedDimension",null),n=e([t("esri.views.layers.DimensionLayerView")],n),n};export{r as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import s from"../../core/Collection.js";import{createAbortError as i}from"../../core/promiseUtils.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";const n=n=>{let o=class extends n{constructor(...e){super(...e),this.layer=null}get interactive(){return null!=this.analysisView&&this.analysisView.interactive}set interactive(e){null!=this.analysisView&&(this.analysisView.interactive=e)}get results(){return this.analysisView?.results??new s}get selectedDimension(){return null!=this.analysisView?this.analysisView.selectedDimension:null}set selectedDimension(e){null!=this.analysisView&&(this.analysisView.selectedDimension=e)}async createLengthDimensions(e){await(this.analysisView?.createLengthDimensions(e))}place(e){if(null!=this.analysisView)return this.analysisView?.place(e);throw i()}};return e([t()],o.prototype,"layer",void 0),e([t()],o.prototype,"interactive",null),e([t({readOnly:!0})],o.prototype,"results",null),e([t()],o.prototype,"selectedDimension",null),o=e([r("esri.views.layers.DimensionLayerView")],o),o};export{n as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../core/Collection.js";import{createAbortError as s}from"../../core/promiseUtils.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";const o=o=>{let a=class extends o{constructor(...e){super(...e),this.layer=null}get interactive(){return this.analysisView?.interactive??!1}set interactive(e){null!=this.analysisView&&(this.analysisView.interactive=e)}get results(){return this.analysisView?.results??new r}async place(e){if(null!=this.analysisView)return await this.analysisView.place(e);throw s()}};return e([t()],a.prototype,"layer",void 0),e([t()],a.prototype,"interactive",null),e([t({readOnly:!0})],a.prototype,"results",null),a=e([i("esri.views.layers.LineOfSightLayerView")],a),a};export{o as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../core/Collection.js";import{createAbortError as s}from"../../core/promiseUtils.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";const o=o=>{let a=class extends o{constructor(...e){super(...e),this.layer=null}get interactive(){return this.analysisView?.interactive??!1}set interactive(e){null!=this.analysisView&&(this.analysisView.interactive=e)}get results(){return this.analysisView?.results??new r}place(e){if(null!=this.analysisView)return this.analysisView.place(e);throw s()}};return e([t()],a.prototype,"layer",void 0),e([t()],a.prototype,"interactive",null),e([t({readOnly:!0})],a.prototype,"results",null),a=e([i("esri.views.layers.LineOfSightLayerView")],a),a};export{o as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";const t=t=>{let a=class extends t{constructor(...e){super(...e),this.layer=null}get interactive(){return null!=this.analysisView&&this.analysisView.interactive}set interactive(e){null!=this.analysisView&&(this.analysisView.interactive=e)}get selectedViewshed(){return null!=this.analysisView?this.analysisView.selectedViewshed:null}set selectedViewshed(e){null!=this.analysisView&&(this.analysisView.selectedViewshed=e)}async createViewsheds(e){await(this.analysisView?.createViewsheds(e))}async place(e){await(this.analysisView?.place(e))}};return e([s()],a.prototype,"layer",void 0),e([s()],a.prototype,"interactive",null),e([s()],a.prototype,"selectedViewshed",null),a=e([i("esri.views.layers.ViewshedLayerView")],a),a};export{t as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{createAbortError as s}from"../../core/promiseUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";const r=r=>{let a=class extends r{constructor(...e){super(...e),this.layer=null}get interactive(){return null!=this.analysisView&&this.analysisView.interactive}set interactive(e){null!=this.analysisView&&(this.analysisView.interactive=e)}get selectedViewshed(){return null!=this.analysisView?this.analysisView.selectedViewshed:null}set selectedViewshed(e){null!=this.analysisView&&(this.analysisView.selectedViewshed=e)}async createViewsheds(e){await(this.analysisView?.createViewsheds(e))}place(e){if(null!=this.analysisView)return this.analysisView.place(e);throw s()}};return e([i()],a.prototype,"layer",void 0),e([i()],a.prototype,"interactive",null),e([i()],a.prototype,"selectedViewshed",null),a=e([t("esri.views.layers.ViewshedLayerView")],a),a};export{r as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Viewpoint.js";import i from"../../core/CollectionFlattener.js";import{destroyMaybe as s}from"../../core/maybe.js";import{whenOnce as r,watch as a,syncAndInitial as o}from"../../core/reactiveUtils.js";import{initialize as n}from"../../core/workers/workers.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{isLoadedOrLoadFor as l}from"../../geometry/projectionUtils.js";import d from"../../layers/support/TileInfo.js";import g from"../View.js";import{Viewport2DBaseMixin as c}from"../Viewport2DBaseMixin.js";import m from"../2d/AnimationManager.js";import{GoToManager as u}from"../2d/GoToManager.js";import{layerView2DImporter as w}from"../2d/layerViewModuleImportUtils.js";import y from"../2d/tiling/TileInfoView.js";import"../2d/tiling/TileKey.js";import"../2d/tiling/TileQueue.js";import"../2d/tiling/TileStrategy.js";import{extentToScale as f}from"../2d/viewpointUtils.js";import v from"../2d/layers/features/support/TileStore.js";import{hitTest as V}from"../2d/support/hitTestUtils.js";import{Timeline as j}from"../2d/support/Timeline.js";let M,T,_,S;async function b(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:s}]=await Promise.all([import("../2d/webglDeps.js"),import("../2d/mapViewDeps.js")]);M=e,T=t,_=i,S=s}let C=class extends(c(g)){constructor(e){super(e),this.stage=null,this.rootLayerViews=new i({getCollections:()=>[this.layerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.timeline=new j,this.goToManager=new u({view:this}),this.labelManager=null,this.map=null,this.videoWidth=0,this.videoHeight=0,this.surface=null,this.padding={top:0,right:0,bottom:0,left:0},n()}initialize(){this._set("width",this.videoWidth),this._set("height",this.videoHeight),this.addResolvingPromise(r((()=>this.ready)))}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=s(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy()}get graphicsTileStore(){return new v(this.featuresTilingScheme)}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return l(t.spatialReference,i)}async hitTest(e,t){return V(this,e,t)}goTo(e,t){return this.goToManager.goTo(e,t)}toMap(e){return this.stateManager.toMap(e)}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}loadAsyncDependencies(){return b()}hasLayerViewModule(e){return w.hasLayerViewModule(e)}importLayerView(e){return w.importLayerView(e)}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:s,padding:r,size:a}=this;if(!e)return null;const o=s&&"initialViewProperties"in s?s.initialViewProperties:void 0,n=this.stateManager.getUserStartupOptions(this.size),p=o?.viewpoint,h=p?.targetGeometry?.extent??i,l=h?.center,d=p?.rotation??0,g=p?.scale||h&&f(h,[a[0]-r.left-r.right,a[1]-r.top-r.bottom]),c=n.center??l,m=n.rotation??d,u=n.scale??g;return c&&u?new t({targetGeometry:c,scale:u,rotation:m}):null}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach((e=>{this.stage.addChild(e.container)}));const e=this.graphicsView;this.stage.addChild(e.container)}_startup(){this.timeline.begin("VideoOperationalDataView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=new _({view:this});this._set("labelManager",t);const i=new m({view:this});this._set("animationManager",i);const s=new S({view:this,animationManager:i});this._set("mapViewNavigation",s);const r=new y(d.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",r);const n=new M({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new T(r)});this._set("graphicsView",n),this.addHandles([this.rootLayerViews.on("change",(()=>this._updateStageChildren())),this.stage.on("webgl-error",(e=>this.fatalError=e.error)),a((()=>this.stationary),(e=>this.stage.stationary=e),o),a((()=>this.state.id),(()=>this.stage.state=this.state),o)],"video-graphics-view"),this._updateStageChildren(),this.timeline.end("VideoOperationalDataView Startup"),this.frameTask.start(),this.stage.viewIsReady=!0,this._set("ready",!0)}_teardown(){this.removeHandles("video-graphics-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.stage.destroy(),this.stage=null;const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}};e([p()],C.prototype,"stage",void 0),e([p({readOnly:!0})],C.prototype,"featuresTilingScheme",void 0),e([p({readOnly:!0})],C.prototype,"graphicsTileStore",null),e([p()],C.prototype,"graphicsView",void 0),e([p({type:j,readOnly:!0})],C.prototype,"timeline",void 0),e([p()],C.prototype,"goToManager",void 0),e([p()],C.prototype,"labelManager",void 0),e([p()],C.prototype,"map",void 0),e([p()],C.prototype,"videoWidth",void 0),e([p()],C.prototype,"videoHeight",void 0),e([p({readOnly:!0})],C.prototype,"typeSpecificPreconditionsReady",null),e([p({readOnly:!0})],C.prototype,"surface",void 0),C=e([h("esri.views.video.VideoOperationalDataView")],C);const D=C;export{D as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{substitute as e}from"../../../intl/substitute.js";import{isUpdateFeaturesWorkflow as t,isBatchAttributeFormViewModel as o}from"../workflowUtils.js";import{loadFooterActionsComponents as i,FooterActions as a}from"./FooterActions.js";import{loadNoticesComponents as n,Notices as s}from"./Notices.js";import{loadPanelContentComponents as l,PanelContentSection as r,PanelContentSectionGroup as u,PanelContent as d}from"./PanelContent.js";import c from"./PendingFeatureList.js";import{Heading as p,incrementHeadingLevel as m}from"../../support/Heading.js";import"../../support/widgetUtils.js";import{tsx as f,tsxFragment as h}from"../../support/jsxFactory.js";const v=()=>Promise.all([i(),n(),l()]);function w({editorViewModel:i,headingLevel:n,messages:l,messagesCommon:v,onDelete:w,onDeleteAssociation:b,onSave:g,renderAttachments:y,renderFeatureForm:k,renderBatchAttributeForm:F,renderSketchToolbar:A}){const{activeFeatureCount:j,activeLeafWorkflow:C,activeWorkflow:S,formViewModel:L,syncing:D}=i;if(!C||!S||!L)return null;const I=C.type.includes("update"),P=o(L),B=j>1?l.multiFeature:l.singleFeature,H=I&&!C.hasPendingEdits||D||L.updating||L.disabled,T=e(I?B.update:B.create,{count:j}),x="create-features"!==C?.type||!!C.data.selectedPendingFeature,M="shouldShowAttachments"in C&&C.shouldShowAttachments&&!P&&!L.activeRelationshipInput&&!L.activeAssociationInput,V=(P?L.activeForm.inputs:L.inputs).every((e=>!e.visible))&&!M,U=t(C)?F:k,W=V?f(r,null,"create-features"===C.type?f(c,{headingLevel:n,key:"pending-feature-list",workflow:C}):void 0):f(r,{key:"panel-content-section"},f(s,{activeFeatureCount:j,messages:l,workflow:S}),f(u,null,x||"create-features"!==C.type?U():f(c,{headingLevel:n,key:"pending-feature-list",workflow:C}),M?f("div",{key:"attachments"},f(p,{level:m(n)},l.attachments),y()):null)),E=()=>{const{featureFormViewModel:e}=i;null!=e?.associationId&&(e.associationId=null)},N={appearance:"solid",onClick:g,disabled:H,label:T,type:"button"},R={appearance:"outline",onClick:w,disabled:D,kind:"danger",label:e(B.delete,{count:j}),type:"button"},q={...R,onClick:b,label:l.deleteAssociationTitle,type:"button"},z={...R,primaryLabel:v.delete,primaryText:v.delete,dropdownItems:[{onClick:b,label:l.deleteAssociationTitle}],type:"split-button"},G={appearance:"outline",onClick:E,disabled:D,label:v.cancel,type:"button"},J="viewing-associated-features"===i.page||"viewing-associated-layers"===i.page?[G]:[N,i.shouldShowDeleteButton&&!i.featureFormHasAssociation?R:void 0,i.shouldShowDeleteButton&&i.featureFormHasAssociation?z:void 0,!i.shouldShowDeleteButton&&i.featureFormHasAssociation?q:void 0];return f(h,null,V?A?.():void 0,f(d,{key:"attribute-panel-content"},W),f(a,{buttons:J}))}export{w as UpdateFeaturePanelContent,v as loadUpdateFeaturePanelContentComponents};
5
+ import{substitute as e}from"../../../intl/substitute.js";import{isCreateFeaturesWorkflow as t,isUpdateFeaturesWorkflow as o,isBatchAttributeFormViewModel as i}from"../workflowUtils.js";import{loadFooterActionsComponents as n,FooterActions as a}from"./FooterActions.js";import{loadNoticesComponents as s,Notices as l}from"./Notices.js";import{loadPanelContentComponents as r,PanelContentSection as u,PanelContentSectionGroup as d,PanelContent as c}from"./PanelContent.js";import p from"./PendingFeatureList.js";import{Heading as m,incrementHeadingLevel as f}from"../../support/Heading.js";import"../../support/widgetUtils.js";import{tsx as h,tsxFragment as w}from"../../support/jsxFactory.js";const b=()=>Promise.all([n(),s(),r()]);function g({editorViewModel:n,headingLevel:s,messages:r,messagesCommon:b,onDelete:g,onDeleteAssociation:v,onSave:y,renderAttachments:k,renderFeatureForm:F,renderBatchAttributeForm:A,renderSketchToolbar:j}){const{activeFeatureCount:C,activeLeafWorkflow:S,activeWorkflow:L,formViewModel:D,syncing:I}=n;if(!S||!L||!D)return null;const P=S.type.includes("update"),B=i(D),H=C>1?r.multiFeature:r.singleFeature,T=P&&!S.hasPendingEdits||I||D.updating||D.disabled,x=e(P?H.update:H.create,{count:C}),M="create-features"!==S?.type||!!S.data.selectedPendingFeature,V="shouldShowAttachments"in S&&S.shouldShowAttachments&&!B&&!D.activeRelationshipInput&&!D.activeAssociationInput,U=B?D.activeForm.inputs:D.inputs,W=t(S)&&U.every((e=>!e.visible))&&!V,E=o(S)?A:F,N=W?h(u,null,h(p,{headingLevel:s,key:"pending-feature-list",workflow:S})):h(u,{key:"panel-content-section"},h(l,{activeFeatureCount:C,messages:r,workflow:L}),h(d,null,M||"create-features"!==S.type?E():h(p,{headingLevel:s,key:"pending-feature-list",workflow:S}),V?h("div",{key:"attachments"},h(m,{level:f(s)},r.attachments),k()):null)),R=()=>{const{featureFormViewModel:e}=n;null!=e?.associationId&&(e.associationId=null)},q={appearance:"solid",onClick:y,disabled:T,label:x,type:"button"},z={appearance:"outline",onClick:g,disabled:I,kind:"danger",label:e(H.delete,{count:C}),type:"button"},G={...z,onClick:v,label:r.deleteAssociationTitle,type:"button"},J={...z,primaryLabel:b.delete,primaryText:b.delete,dropdownItems:[{onClick:v,label:r.deleteAssociationTitle}],type:"split-button"},K={appearance:"outline",onClick:R,disabled:I,label:b.cancel,type:"button"},O="viewing-associated-features"===n.page||"viewing-associated-layers"===n.page?[K]:[q,n.shouldShowDeleteButton&&!n.featureFormHasAssociation?z:void 0,n.shouldShowDeleteButton&&n.featureFormHasAssociation?J:void 0,!n.shouldShowDeleteButton&&n.featureFormHasAssociation?G:void 0];return h(w,null,W?j?.():void 0,h(c,{key:"attribute-panel-content"},N),h(a,{buttons:O}))}export{g as UpdateFeaturePanelContent,b as loadUpdateFeaturePanelContentComponents};
package/widgets/Expand.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/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{watch as t,initial as o}from"../core/reactiveUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import i from"./Widget.js";import l from"./Expand/ExpandViewModel.js";import{loadCalciteComponents as r}from"./support/componentsUtils.js";import{globalCss as a}from"./support/globalCss.js";import{isWidget as p,hasDomNode as c}from"./support/widget.js";import{messageBundle as d}from"./support/decorators/messageBundle.js";import{tsx as h}from"./support/jsxFactory.js";const u="esri-expand",m={base:u,toggle:`${u}__toggle`,popoverContent:`${u}__popover-content`,panel:`${u}__panel`,panelContent:`${u}__panel-content`,sheet:`${u}__sheet`,contentContainer:`${u}__content-container`,icon:"esri-collapse__icon",iconFlip:"esri-collapse__icon-flip",iconNumber:`${u}__icon-number`},g="chevrons-left",_="chevrons-right";let v=class extends i{constructor(e,t){super(e,t),this.closeOnEsc=!0,this.collapseTooltip="",this.content="",this.expandTooltip="",this.focusTrapDisabled=!1,this.iconNumber=0,this.messages=null,this.messagesCommon=null,this.mode="auto",this.placement=null,this.viewModel=new l,this.toggle=()=>{this.viewModel.expanded=!this.viewModel.expanded},this._handlePopoverClose=e=>{e.target===this._popoverEl&&(this.viewModel.expanded=e.currentTarget.open)},this._handleSheetClose=e=>{this.viewModel.expanded=e.currentTarget.open},this._handlePanelClose=e=>{this.viewModel.expanded=!e.currentTarget.closed},this._handleKeyDown=e=>{this.viewModel.expanded&&"Escape"===e.key&&!this._willCloseOnEsc(e)&&e.preventDefault()},this._storeToggleActionEl=e=>{this._toggleActionEl=e},this._storePopoverEl=e=>{this._popoverEl=e}}initialize(){this.addHandles(t((()=>this.viewModel?.view?.size),(()=>this._popoverEl?.reposition()),o))}loadDependencies(){return r({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),sheet:()=>import("@esri/calcite-components/dist/components/calcite-sheet")})}get expandTitle(){const{expanded:e,messagesCommon:t,collapseTooltip:o,expandTooltip:n}=this;return(e?o||t?.collapse:n||t?.expand)??""}get _displaySheet(){switch(this.mode){case"drawer":return!0;case"auto":return"xsmall"===this.viewModel.view?.widthBreakpoint;default:return!1}}get autoCollapse(){return this.viewModel.autoCollapse}set autoCollapse(e){this.viewModel.autoCollapse=e}get collapseIcon(){return _}set collapseIcon(e){this._overrideIfSome("collapseIcon",e)}get expanded(){return this.viewModel.expanded}set expanded(e){this.viewModel.expanded=e}get expandIcon(){return p(this.content)?this.content.icon:g}set expandIcon(e){this._overrideIfSome("expandIcon",e)}get group(){return this.viewModel.group}set group(e){this.viewModel.group=e}get icon(){return null}get label(){return(p(this.content)?this.content.label:null)??this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}expand(){this.viewModel.expanded=!0}collapse(){this.viewModel.expanded=!1}render(){const{_displaySheet:e,_toggleActionEl:t,viewModel:{expanded:o},label:n,placement:s}=this;return h("div",{class:this.classes(m.base,a.widget)},this._renderToggle(),e?h("calcite-sheet",{class:m.sheet,heightScale:"l",label:n,onkeydown:this._handleKeyDown,open:o,position:"block-end",onCalciteSheetClose:this._handleSheetClose},h("calcite-panel",{class:m.panel,closable:!0,closed:!o,heading:n,onkeydown:this._handleKeyDown,onCalcitePanelClose:this._handlePanelClose},h("div",{class:m.panelContent},this._renderContent()))):t?h("calcite-popover",{afterCreate:this._storePopoverEl,afterUpdate:this._storePopoverEl,focusTrapDisabled:this.focusTrapDisabled,label:n,onkeydown:this._handleKeyDown,open:o,overlayPositioning:"fixed",placement:s??this._getPlacement(),referenceElement:t,onCalcitePopoverClose:this._handlePopoverClose},h("div",{class:m.popoverContent},this._renderContent())):null)}_getPlacement(){const{container:e,view:t}=this,o=e&&t?t.ui.getPosition(e):null;if(!o||"manual"===o)return"auto";const[n,s]=o.split("-");return`${"right"===s?"left":"right"}-${"bottom"===n?"end":"start"}`}_willCloseOnEsc(e){const{closeOnEsc:t}=this;return"function"==typeof t?t(e):t}_renderBadgeNumber(){const{expanded:e,iconNumber:t}=this;return t&&!e?h("span",{class:m.iconNumber,key:"expand__icon-number"},t):null}_renderToggleButton(){const{expanded:e,expandTitle:t,expandIcon:o,collapseIcon:n}=this,s=e?n:o,i=s===g||s===_;return h("calcite-action",{afterCreate:this._storeToggleActionEl,afterUpdate:this._storeToggleActionEl,class:a.widgetButton,onclick:this.toggle,scale:"s",text:t,title:t},s?h("calcite-icon",{class:this.classes(m.icon,i&&m.iconFlip),icon:s,scale:"s"}):null)}_renderToggle(){return h("div",{class:m.toggle},this._renderToggleButton(),this._renderBadgeNumber())}_renderContent(){const{content:e}=this;return"string"==typeof e?h("div",{class:m.contentContainer,innerHTML:e,key:"content__string"}):p(e)?h("div",{afterCreate:t=>e.container=t,class:m.contentContainer,key:"content__widget"}):e instanceof HTMLElement?h("div",{afterCreate:this._attachToNode,bind:e,class:m.contentContainer,key:"content__html-element"}):c(e)?h("div",{afterCreate:this._attachToNode,bind:e.domNode,class:m.contentContainer,key:"content__node"}):null}_attachToNode(e){const t=this;e.appendChild(t)}};e([n({readOnly:!0})],v.prototype,"expandTitle",null),e([n()],v.prototype,"_toggleActionEl",void 0),e([n()],v.prototype,"_displaySheet",null),e([n()],v.prototype,"autoCollapse",null),e([n()],v.prototype,"closeOnEsc",void 0),e([n()],v.prototype,"collapseIcon",null),e([n()],v.prototype,"collapseTooltip",void 0),e([n()],v.prototype,"content",void 0),e([n()],v.prototype,"expanded",null),e([n()],v.prototype,"expandIcon",null),e([n()],v.prototype,"expandTooltip",void 0),e([n()],v.prototype,"focusTrapDisabled",void 0),e([n()],v.prototype,"group",null),e([n()],v.prototype,"icon",null),e([n()],v.prototype,"iconNumber",void 0),e([n()],v.prototype,"label",null),e([n(),d("esri/widgets/Expand/t9n/Expand")],v.prototype,"messages",void 0),e([n(),d("esri/t9n/common")],v.prototype,"messagesCommon",void 0),e([n()],v.prototype,"mode",void 0),e([n()],v.prototype,"placement",void 0),e([n()],v.prototype,"view",null),e([n({type:l})],v.prototype,"viewModel",void 0),v=e([s("esri.widgets.Expand")],v);const w=v;export{w as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{makeHandle as t}from"../core/handleUtils.js";import{watch as o,initial as n}from"../core/reactiveUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import l from"./Widget.js";import r from"./Expand/ExpandViewModel.js";import{loadCalciteComponents as a}from"./support/componentsUtils.js";import{globalCss as d}from"./support/globalCss.js";import{isWidget as p,hasDomNode as c}from"./support/widget.js";import{messageBundle as h}from"./support/decorators/messageBundle.js";import{tsx as u}from"./support/jsxFactory.js";const m="esri-expand",g={base:m,toggle:`${m}__toggle`,popoverContent:`${m}__popover-content`,panel:`${m}__panel`,panelContent:`${m}__panel-content`,sheet:`${m}__sheet`,contentContainer:`${m}__content-container`,icon:"esri-collapse__icon",iconFlip:"esri-collapse__icon-flip",iconNumber:`${m}__icon-number`},v="chevrons-left",_="chevrons-right",w=Symbol("scheduleRender-override-handle");let y=class extends l{constructor(e,t){super(e,t),this._boundScheduledRender=this.scheduleRender.bind(this),this.closeOnEsc=!0,this.collapseTooltip="",this.content="",this.expandTooltip="",this.focusTrapDisabled=!1,this.iconNumber=0,this.messages=null,this.messagesCommon=null,this.mode="auto",this.placement=null,this.viewModel=new r,this.toggle=()=>{this.viewModel.expanded=!this.viewModel.expanded},this._handlePopoverClose=e=>{e.target===this._popoverEl&&(this.viewModel.expanded=e.currentTarget.open)},this._handleSheetClose=e=>{this.viewModel.expanded=e.currentTarget.open},this._handlePanelClose=e=>{this.viewModel.expanded=!e.currentTarget.closed},this._handleKeyDown=e=>{this.viewModel.expanded&&"Escape"===e.key&&!this._willCloseOnEsc(e)&&e.preventDefault()},this._storeToggleActionEl=e=>{this._toggleActionEl=e},this._storePopoverEl=e=>{this._popoverEl=e}}initialize(){this.addHandles(o((()=>this.viewModel?.view?.size),(()=>this._popoverEl?.reposition()),n))}loadDependencies(){return a({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),sheet:()=>import("@esri/calcite-components/dist/components/calcite-sheet")})}get expandTitle(){const{expanded:e,messagesCommon:t,collapseTooltip:o,expandTooltip:n}=this;return(e?o||t?.collapse:n||t?.expand)??""}get _displaySheet(){switch(this.mode){case"drawer":return!0;case"auto":return"xsmall"===this.viewModel.view?.widthBreakpoint;default:return!1}}get autoCollapse(){return this.viewModel.autoCollapse}set autoCollapse(e){this.viewModel.autoCollapse=e}get collapseIcon(){return _}set collapseIcon(e){this._overrideIfSome("collapseIcon",e)}get expanded(){return this.viewModel.expanded}set expanded(e){this.viewModel.expanded=e}get expandIcon(){return p(this.content)?this.content.icon:v}set expandIcon(e){this._overrideIfSome("expandIcon",e)}get group(){return this.viewModel.group}set group(e){this.viewModel.group=e}get icon(){return null}get label(){return(p(this.content)?this.content.label:null)??this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}expand(){this.viewModel.expanded=!0}collapse(){this.viewModel.expanded=!1}render(){const{_displaySheet:e,_toggleActionEl:t,viewModel:{expanded:o},label:n,placement:s}=this;return u("div",{class:this.classes(g.base,d.widget)},this._renderToggle(),e?u("calcite-sheet",{class:g.sheet,heightScale:"l",label:n,onkeydown:this._handleKeyDown,open:o,position:"block-end",onCalciteSheetClose:this._handleSheetClose},u("calcite-panel",{class:g.panel,closable:!0,closed:!o,heading:n,onkeydown:this._handleKeyDown,onCalcitePanelClose:this._handlePanelClose},u("div",{class:g.panelContent},this._renderContent()))):t?u("calcite-popover",{afterCreate:this._storePopoverEl,afterUpdate:this._storePopoverEl,focusTrapDisabled:this.focusTrapDisabled,label:n,onkeydown:this._handleKeyDown,open:o,overlayPositioning:"fixed",placement:s??this._getPlacement(),referenceElement:t,onCalcitePopoverClose:this._handlePopoverClose},u("div",{class:g.popoverContent},this._renderContent())):null)}_getPlacement(){const{container:e,view:t}=this,o=e&&t?t.ui.getPosition(e):null;if(!o||"manual"===o)return"auto";const[n,s]=o.split("-");return`${"right"===s?"left":"right"}-${"bottom"===n?"end":"start"}`}_willCloseOnEsc(e){const{closeOnEsc:t}=this;return"function"==typeof t?t(e):t}_renderBadgeNumber(){const{expanded:e,iconNumber:t}=this;return t&&!e?u("span",{class:g.iconNumber,key:"expand__icon-number"},t):null}_renderToggleButton(){const{expanded:e,expandTitle:t,expandIcon:o,collapseIcon:n}=this,s=e?n:o,i=s===v||s===_;return u("calcite-action",{afterCreate:this._storeToggleActionEl,afterUpdate:this._storeToggleActionEl,class:d.widgetButton,onclick:this.toggle,scale:"s",text:t,title:t},s?u("calcite-icon",{class:this.classes(g.icon,i&&g.iconFlip),icon:s,scale:"s"}):null)}_renderToggle(){return u("div",{class:g.toggle},this._renderToggleButton(),this._renderBadgeNumber())}_renderContent(){const{content:e}=this;return"string"==typeof e?u("div",{class:g.contentContainer,innerHTML:e,key:"content__string"}):p(e)?u("div",{afterCreate:()=>{this._overwriteChildScheduleRender(e)},afterRemoved:()=>this.removeHandles(w),afterUpdate:()=>{e.scheduleRender!==this._boundScheduledRender&&(this.removeHandles(w),this._overwriteChildScheduleRender(e))},class:g.contentContainer,key:"content__widget"},e.render()):e instanceof HTMLElement?u("div",{afterCreate:this._attachToNode,bind:e,class:g.contentContainer,key:"content__html-element"}):c(e)?u("div",{afterCreate:this._attachToNode,bind:e.domNode,class:g.contentContainer,key:"content__node"}):null}_overwriteChildScheduleRender(e){const o=e.scheduleRender;e.scheduleRender=this._boundScheduledRender,this.addHandles(t((()=>e.scheduleRender=o)),w)}_attachToNode(e){const t=this;e.appendChild(t)}};e([s({readOnly:!0})],y.prototype,"expandTitle",null),e([s()],y.prototype,"_toggleActionEl",void 0),e([s()],y.prototype,"_displaySheet",null),e([s()],y.prototype,"autoCollapse",null),e([s()],y.prototype,"closeOnEsc",void 0),e([s()],y.prototype,"collapseIcon",null),e([s()],y.prototype,"collapseTooltip",void 0),e([s()],y.prototype,"content",void 0),e([s()],y.prototype,"expanded",null),e([s()],y.prototype,"expandIcon",null),e([s()],y.prototype,"expandTooltip",void 0),e([s()],y.prototype,"focusTrapDisabled",void 0),e([s()],y.prototype,"group",null),e([s()],y.prototype,"icon",null),e([s()],y.prototype,"iconNumber",void 0),e([s()],y.prototype,"label",null),e([s(),h("esri/widgets/Expand/t9n/Expand")],y.prototype,"messages",void 0),e([s(),h("esri/t9n/common")],y.prototype,"messagesCommon",void 0),e([s()],y.prototype,"mode",void 0),e([s()],y.prototype,"placement",void 0),e([s()],y.prototype,"view",null),e([s({type:r})],y.prototype,"viewModel",void 0),y=e([i("esri.widgets.Expand")],y);const C=y;export{C as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e}from"../../../core/arrayUtils.js";import t from"../../../tables/elements/AttributeTableAttachmentElement.js";import i from"../../../tables/elements/AttributeTableFieldElement.js";import n from"../../../tables/elements/AttributeTableGroupElement.js";import r from"../../../tables/elements/AttributeTableRelationshipElement.js";import l from"./AttachmentsColumnTemplate.js";import{isGroupColumn as o,isFieldColumn as s,isRelationshipColumn as m,isAttachmentsColumn as a}from"./columnUtils.js";import p from"./FieldColumnTemplate.js";import f from"./GroupColumnTemplate.js";import c from"./RelationshipColumnTemplate.js";function d(t,i){const n=[];return t?.forEach((t=>{const{description:r,label:l,type:o}=t;if("group"===o){const o=t.elements.map((e=>u(e,i))).filter(e);if(!o?.length)return;n.push(new f({description:r,columnTemplates:o,label:l}))}else{const e=u(t,i);if(!e)return;n.push(e)}})),n}function u(e,t){const{description:i,label:n,type:r}=e;if("field"===r){const r=e.fieldName??void 0,l=t.findIndex((e=>e.field&&e.field===r)),o=l>-1?t.at(l)?.order:void 0;return new p({description:i,direction:o,fieldName:r,initialSortPriority:l,label:n})}return"attachment"===r?new l({description:i,label:n}):"relationship"===r?new c({description:i,label:n,relationshipId:e.relationshipId}):void 0}function b(t){const i=[];return t.forEach((t=>{const{description:r,label:l,hidden:s}=t;if(o(t)){if(s)return;const o=t.columns?.map((e=>h(e))).filter(e);if(!o?.length)return;i.push(new n({description:r,elements:o,label:l}))}else{const e=h(t);if(!e)return;i.push(e)}})),i}function h(e){const{fieldName:n,description:l,hidden:o,label:p}=e;if(s(e)){if(!o)return new i({description:l,fieldName:n,label:p})}else if(m(e)){if(!o)return new r({description:l,label:p,relationshipId:e.relationshipId})}else if(a(e)&&!o)return new t({description:l,label:p})}export{b as createAttributeTableElements,d as createColumnTemplates,h as createNestedAttributeTableElement,u as createNestedColumnTemplate};
5
+ import{isSome as e}from"../../../core/arrayUtils.js";import{createFieldInfos as i}from"../../../support/popupUtils.js";import t from"../../../tables/AttributeTableTemplate.js";import l from"../../../tables/elements/AttributeTableAttachmentElement.js";import r from"../../../tables/elements/AttributeTableFieldElement.js";import n from"../../../tables/elements/AttributeTableGroupElement.js";import o from"../../../tables/elements/AttributeTableRelationshipElement.js";import s from"../../../tables/support/FieldOrder.js";import a from"./AttachmentsColumnTemplate.js";import{isGroupColumn as d,isFieldColumn as m,isRelationshipColumn as p,isAttachmentsColumn as f}from"./columnUtils.js";import c from"./FieldColumnTemplate.js";import u from"./GroupColumnTemplate.js";import h from"./RelationshipColumnTemplate.js";import b from"./TableTemplate.js";import{isIFeatureTableSupportedLayer as w,isIFeatureTableSupportedLayerWithAttachments as y,isIFeatureTableSupportedLayerWithRelationships as T,hasTemplateForField as j}from"./tableUtils.js";function v(i,t){const l=[];return i?.forEach((i=>{const{description:r,label:n,type:o}=i;if("group"===o){const o=i.elements.map((e=>E(e,t))).filter(e);if(!o?.length)return;l.push(new u({description:r,columnTemplates:o,label:n}))}else{const e=E(i,t);if(!e)return;l.push(e)}})),l}function E(e,i){const{description:t,label:l,type:r}=e;if("field"===r){const r=e.fieldName??void 0,n=i.findIndex((e=>e.field&&e.field===r)),o=n>-1?i.at(n)?.order:void 0;return new c({description:t,direction:o,fieldName:r,initialSortPriority:n,label:l})}return"attachment"===r?new a({description:t,label:l}):"relationship"===r?new h({description:t,label:l,relationshipId:e.relationshipId}):void 0}function F(i){const t=[];return i.forEach((i=>{const{hidden:l}=i;if(d(i)){if(l)return;const r=i.columns?.map((e=>N(e))).filter(e);if(!r?.length)return;t.push(new n({elements:r}))}else{const e=N(i);if(!e)return;t.push(e)}})),t}function N(e){const{fieldName:i,hidden:t}=e;if(m(e)){if(!t)return new r({fieldName:i})}else if(p(e)){if(!t)return new o({relationshipId:e.relationshipId})}else if(f(e)&&!t)return new l}async function x({layer:e,excludeAttachments:n,excludeRelationships:s,excludedFieldTypesOverride:a}){const d=[],m=[];if(!e||!w(e))return new t;await e.load();const p=i(e,{...a&&{ignoreFieldTypes:a},sortDisabled:!0});for(const{visible:i,fieldName:t}of p)i&&d.push(new r({fieldName:t}));return y(e)&&!0!==n&&d.push(new l),T(e)&&!0!==s&&e.relationships?.forEach((e=>{d.push(new o({relationshipId:e.id}))})),new t({elements:d,orderByFields:m})}async function A(e){const{excludeAttachments:t,excludeRelationships:l,layer:r,excludedFieldTypesOverride:n}=e,o=[];await r.load();return i(r,{...n&&{ignoreFieldTypes:n},sortDisabled:!0}).forEach((({fieldName:e,format:i,label:t,visible:l})=>{null!=e&&o.push(new c({fieldName:e,format:i,label:t,visible:l}))})),y(r)&&!0!==t&&o.push(new a),T(r)&&!0!==l&&r.relationships?.forEach((({id:e})=>{o.push(new h({relationshipId:e}))})),new b({columnTemplates:o})}async function I(e){const{layer:t,template:l,includeHiddenFields:r,excludedFieldTypesOverride:n}=e,o=l.orderByFields??[],s=v(l.elements,o);if(r){await t.load();i(t,{...n&&{ignoreFieldTypes:n},sortDisabled:!0}).forEach((e=>{if(!e.fieldName)return;const{fieldName:i,label:t}=e;if(!j(i,s)){const e=o.findIndex((e=>e.field&&e.field===i)),l=e>-1?o.at(e)?.order:void 0;s.push(new c({direction:l,fieldName:i,initialSortPriority:e,label:t,visible:!1}))}})),y(t)&&!s.some((e=>"attachment"===e.type))&&s.push(new a({visible:!1})),T(t)&&t.relationships?.forEach((({id:e})=>{s.some((i=>"relationship"===i.type&&i.relationshipId===e))||s.push(new h({relationshipId:e,visible:!1}))}))}return new b({columnTemplates:s})}function g(e,i,t=!0){const{allColumns:l,columns:r}=e,n=[],o=F(r.toArray());e.activeSortOrders.forEach((({fieldName:e,direction:i})=>{e&&i&&n.push(new s({field:e,order:i}))}));return l.filter((e=>null!=e.direction&&(!e.hidden||t))).forEach((({fieldName:e,direction:i})=>{const t=n.find((i=>i.field===e));i&&!t&&n.push(new s({field:e,order:i}))})),i.elements=o,i.orderByFields=n,i}export{F as createAttributeTableElements,x as createAttributeTableTemplateFromLayer,v as createColumnTemplates,N as createNestedAttributeTableElement,E as createNestedColumnTemplate,I as createTableTemplateFromAttributeTableTemplate,A as createTableTemplateFromLayer,g as syncAttributeTableTemplateWithTable};