@arcgis/core 4.29.7 → 4.29.9

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 (98) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{4984e2b79d862114d6a6.js → 1a8d56e01ddfec2257c3.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{a8ac511280f873960d46.js → 1dc474a28d5ddac1a4b7.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{3afb525a131b6841276b.js → 1e4d779a884f13762601.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{2447a4d5886aeb0ff72a.js → 205597cd91cb7ff3d2b4.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{6c50daccd84ba5545bfe.js → 22ebdec0867e44d8d58c.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{fc5ac713872766571e07.js → 31c065746e53f7518c17.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{da4616b02dd0c3dd3d5d.js → 321547d796a2ecd72ab4.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{6c3ae96ec90e9ed7dd50.js → 32be478638e9e643ea32.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{c556644bb0cf88770939.js → 413978b96c88d5ff01ee.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{a61f337802ae963d7f65.js → 59f03847a9eb96e5f65c.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{7a98d2e026f63a581b1e.js → 5b08309b184f5d8345a0.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{8225febaf0a412f4cee4.js → 5e4465448b2728cafab0.js} +1 -1
  14. package/assets/esri/core/workers/chunks/6301990e489d31596bc8.js +1 -0
  15. package/assets/esri/core/workers/chunks/631bda7b99a27f4453c1.js +1 -0
  16. package/assets/esri/core/workers/chunks/{c527692694688a5b3b07.js → 658a8ee9a4f24bc03f7f.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{9a8ab968ebb18480481d.js → 8699eaadd3fb6709fd94.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{b139cf91bc148aa84419.js → 96cb79adabfbbcc3e707.js} +1 -1
  19. package/assets/esri/core/workers/chunks/99ac2a6a5be0604ee4c2.js +1 -0
  20. package/assets/esri/core/workers/chunks/{2433b39624a7e274cb98.js → b4c41a8244b7371e864e.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{48db6e0bbb1a9c043193.js → b7a78246d25dc07f173d.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{60ab18c6a04d4b2f1d4c.js → bb05528d2ca12c57a031.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{b42a83db83851cb57d44.js → bed684a8d38fa7ac5eb7.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{5227f9eea6988aadad7f.js → cf0dc0ccbeaf9458de6e.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{f59b5ea05caca8a1a398.js → d40408be9bbcb0021d18.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{fe74ee642bc72fe18210.js → d576aa444ad7c9289617.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{f60e5dd0e712cf32f782.js → f2e8b75ad3b574894ade.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{b9c55ff1f21db198ce03.js → ff96940be6a4c8489ebb.js} +1 -1
  29. package/chunks/Laserlines.glsl.js +1 -1
  30. package/chunks/sphere.js +1 -1
  31. package/chunks/vec32.js +1 -1
  32. package/chunks/vec42.js +1 -1
  33. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  34. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  35. package/core/libs/gl-matrix-2/math/vec4.js +1 -1
  36. package/geometry/support/sphere.js +1 -1
  37. package/interfaces.d.ts +5 -5
  38. package/kernel.js +1 -1
  39. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  40. package/layers/mixins/FeatureLayerBase.js +1 -1
  41. package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
  42. package/layers/support/SubtypeSublayer.js +1 -1
  43. package/layers/voxel/VoxelVolume.js +1 -1
  44. package/package.json +1 -1
  45. package/support/revision.js +1 -1
  46. package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
  47. package/views/2d/engine/webgl/mesh/MultiTileMeshData.js +1 -1
  48. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  49. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  50. package/views/2d/layers/RouteLayerView2D.js +1 -1
  51. package/views/2d/layers/features/FeatureContainer.js +1 -1
  52. package/views/2d/layers/features/Processor.js +1 -1
  53. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  54. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  55. package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
  56. package/views/2d/layers/features/sources/strategies/AFetchLoadStrategy.js +1 -1
  57. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  58. package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
  59. package/views/2d/layers/features/support/GraphicsReader.js +1 -1
  60. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  61. package/views/3d/camera/constraintUtils/distance.js +1 -1
  62. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  63. package/views/3d/layers/I3SMeshView3D.js +1 -1
  64. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  65. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  66. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  67. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  68. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  69. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  70. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  71. package/views/3d/layers/support/makeScheduleFunction.js +5 -0
  72. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  73. package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
  74. package/views/3d/state/controllers/global/ZoomController.js +1 -1
  75. package/views/3d/state/controllers/global/ZoomStepController.js +1 -1
  76. package/views/3d/state/controllers/momentum/ZoomSphericalMomentumController.js +1 -1
  77. package/views/3d/state/utils/navigationUtils.js +1 -1
  78. package/views/3d/support/geometryUtils/sphere.js +1 -1
  79. package/views/3d/terrain/OverlayManager.js +1 -1
  80. package/views/3d/terrain/PatchRenderData.js +1 -1
  81. package/views/3d/terrain/SphericalPatch.js +1 -1
  82. package/views/3d/terrain/TerrainSurface.js +1 -1
  83. package/views/3d/terrain/Tile.js +1 -1
  84. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  85. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  86. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  87. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  88. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  89. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  90. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  91. package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
  92. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  93. package/views/interactive/sketch/constraints.js +1 -1
  94. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  95. package/views/support/geometry3dUtils.js +1 -1
  96. package/assets/esri/core/workers/chunks/967812e66fef41febb98.js +0 -1
  97. package/assets/esri/core/workers/chunks/a28b7d868346e13468bb.js +0 -1
  98. package/assets/esri/core/workers/chunks/ccd53b81c2688dd11584.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.29/esri/copyright.txt for details.
4
4
  */
5
- import{create as t}from"../factories/mat3f64.js";import{create as n}from"../factories/quatf64.js";import{create as s,fromValues as o}from"../factories/vec3f64.js";import{getEpsilon as a,RANDOM as r}from"./common.js";import{k as e,b as c,D as i,n as u}from"../../../../chunks/vec32.js";import{c as h,s as M,g as f,d as l,h as m,l as p,i as q,j,n as d,a as g,e as P}from"../../../../chunks/vec42.js";function I(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function b(t,n,s){s*=.5;const o=Math.sin(s);return t[0]=o*n[0],t[1]=o*n[1],t[2]=o*n[2],t[3]=Math.cos(s),t}function v(t,n){const s=2*Math.acos(n[3]),o=Math.sin(s/2);return o>a()?(t[0]=n[0]/o,t[1]=n[1]/o,t[2]=n[2]/o):(t[0]=1,t[1]=0,t[2]=0),s}function x(t,n,s){const o=n[0],a=n[1],r=n[2],e=n[3],c=s[0],i=s[1],u=s[2],h=s[3];return t[0]=o*h+e*c+a*u-r*i,t[1]=a*h+e*i+r*c-o*u,t[2]=r*h+e*u+o*i-a*c,t[3]=e*h-o*c-a*i-r*u,t}function y(t,n,s){s*=.5;const o=n[0],a=n[1],r=n[2],e=n[3],c=Math.sin(s),i=Math.cos(s);return t[0]=o*i+e*c,t[1]=a*i+r*c,t[2]=r*i-a*c,t[3]=e*i-o*c,t}function A(t,n,s){s*=.5;const o=n[0],a=n[1],r=n[2],e=n[3],c=Math.sin(s),i=Math.cos(s);return t[0]=o*i-r*c,t[1]=a*i+e*c,t[2]=r*i+o*c,t[3]=e*i-a*c,t}function _(t,n,s){s*=.5;const o=n[0],a=n[1],r=n[2],e=n[3],c=Math.sin(s),i=Math.cos(s);return t[0]=o*i+a*c,t[1]=a*i-o*c,t[2]=r*i+e*c,t[3]=e*i-r*c,t}function k(t,n){const s=n[0],o=n[1],a=n[2];return t[0]=s,t[1]=o,t[2]=a,t[3]=Math.sqrt(Math.abs(1-s*s-o*o-a*a)),t}function z(t,n,s,o){const r=n[0],e=n[1],c=n[2],i=n[3];let u,h,M,f,l,m=s[0],p=s[1],q=s[2],j=s[3];return h=r*m+e*p+c*q+i*j,h<0&&(h=-h,m=-m,p=-p,q=-q,j=-j),1-h>a()?(u=Math.acos(h),M=Math.sin(u),f=Math.sin((1-o)*u)/M,l=Math.sin(o*u)/M):(f=1-o,l=o),t[0]=f*r+l*m,t[1]=f*e+l*p,t[2]=f*c+l*q,t[3]=f*i+l*j,t}function E(t){const n=r,s=n(),o=n(),a=n(),e=Math.sqrt(1-s),c=Math.sqrt(s);return t[0]=e*Math.sin(2*Math.PI*o),t[1]=e*Math.cos(2*Math.PI*o),t[2]=c*Math.sin(2*Math.PI*a),t[3]=c*Math.cos(2*Math.PI*a),t}function L(t,n){const s=n[0],o=n[1],a=n[2],r=n[3],e=s*s+o*o+a*a+r*r,c=e?1/e:0;return t[0]=-s*c,t[1]=-o*c,t[2]=-a*c,t[3]=r*c,t}function O(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}function S(t,n){const s=n[0]+n[4]+n[8];let o;if(s>0)o=Math.sqrt(s+1),t[3]=.5*o,o=.5/o,t[0]=(n[5]-n[7])*o,t[1]=(n[6]-n[2])*o,t[2]=(n[1]-n[3])*o;else{let s=0;n[4]>n[0]&&(s=1),n[8]>n[3*s+s]&&(s=2);const a=(s+1)%3,r=(s+2)%3;o=Math.sqrt(n[3*s+s]-n[3*a+a]-n[3*r+r]+1),t[s]=.5*o,o=.5/o,t[3]=(n[3*a+r]-n[3*r+a])*o,t[a]=(n[3*a+s]+n[3*s+a])*o,t[r]=(n[3*r+s]+n[3*s+r])*o}return t}function T(t,n,s,o){const a=.5*Math.PI/180;n*=a,s*=a,o*=a;const r=Math.sin(n),e=Math.cos(n),c=Math.sin(s),i=Math.cos(s),u=Math.sin(o),h=Math.cos(o);return t[0]=r*i*h-e*c*u,t[1]=e*c*h+r*i*u,t[2]=e*i*u-r*c*h,t[3]=e*i*h+r*c*u,t}function D(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}const W=h,X=M,Y=f,Z=x,w=l,B=m,C=p,F=q,G=F,H=j,J=H,K=d,N=g,Q=P;function R(t,n,s){const o=e(n,s);return o<-.999999?(c(U,V,n),i(U)<1e-6&&c(U,$,n),u(U,U),b(t,U,Math.PI),t):o>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(c(U,n,s),t[0]=U[0],t[1]=U[1],t[2]=U[2],t[3]=1+o,K(t,t))}const U=s(),V=o(1,0,0),$=o(0,1,0);function tt(t,n,s,o,a,r){return z(nt,n,a,r),z(st,s,o,r),z(t,nt,st,2*r*(1-r)),t}const nt=n(),st=n();function ot(t,n,s,o){const a=at;return a[0]=s[0],a[3]=s[1],a[6]=s[2],a[1]=o[0],a[4]=o[1],a[7]=o[2],a[2]=-n[0],a[5]=-n[1],a[8]=-n[2],K(t,S(t,a))}const at=t(),rt=Object.freeze(Object.defineProperty({__proto__:null,add:Y,calculateW:k,conjugate:O,copy:W,dot:B,equals:Q,exactEquals:N,fromEuler:T,fromMat3:S,getAxisAngle:v,identity:I,invert:L,len:G,length:F,lerp:C,mul:Z,multiply:x,normalize:K,random:E,rotateX:y,rotateY:A,rotateZ:_,rotationTo:R,scale:w,set:X,setAxes:ot,setAxisAngle:b,slerp:z,sqlerp:tt,sqrLen:J,squaredLength:H,str:D},Symbol.toStringTag,{value:"Module"}));export{Y as add,k as calculateW,O as conjugate,W as copy,B as dot,Q as equals,N as exactEquals,T as fromEuler,S as fromMat3,v as getAxisAngle,I as identity,L as invert,G as len,F as length,C as lerp,Z as mul,x as multiply,K as normalize,rt as q,E as random,y as rotateX,A as rotateY,_ as rotateZ,R as rotationTo,w as scale,X as set,ot as setAxes,b as setAxisAngle,z as slerp,tt as sqlerp,J as sqrLen,H as squaredLength,D as str};
5
+ import{create as t}from"../factories/mat3f64.js";import{create as n}from"../factories/quatf64.js";import{create as s,fromValues as o}from"../factories/vec3f64.js";import{getEpsilon as a,RANDOM as r}from"./common.js";import{k as e,b as c,H as i,n as u}from"../../../../chunks/vec32.js";import{c as h,s as M,f,b as l,g as m,l as p,i as q,j,n as g,a as d,e as P}from"../../../../chunks/vec42.js";function b(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function I(t,n,s){s*=.5;const o=Math.sin(s);return t[0]=o*n[0],t[1]=o*n[1],t[2]=o*n[2],t[3]=Math.cos(s),t}function v(t,n){const s=2*Math.acos(n[3]),o=Math.sin(s/2);return o>a()?(t[0]=n[0]/o,t[1]=n[1]/o,t[2]=n[2]/o):(t[0]=1,t[1]=0,t[2]=0),s}function x(t,n,s){const o=n[0],a=n[1],r=n[2],e=n[3],c=s[0],i=s[1],u=s[2],h=s[3];return t[0]=o*h+e*c+a*u-r*i,t[1]=a*h+e*i+r*c-o*u,t[2]=r*h+e*u+o*i-a*c,t[3]=e*h-o*c-a*i-r*u,t}function y(t,n,s){s*=.5;const o=n[0],a=n[1],r=n[2],e=n[3],c=Math.sin(s),i=Math.cos(s);return t[0]=o*i+e*c,t[1]=a*i+r*c,t[2]=r*i-a*c,t[3]=e*i-o*c,t}function A(t,n,s){s*=.5;const o=n[0],a=n[1],r=n[2],e=n[3],c=Math.sin(s),i=Math.cos(s);return t[0]=o*i-r*c,t[1]=a*i+e*c,t[2]=r*i+o*c,t[3]=e*i-a*c,t}function _(t,n,s){s*=.5;const o=n[0],a=n[1],r=n[2],e=n[3],c=Math.sin(s),i=Math.cos(s);return t[0]=o*i+a*c,t[1]=a*i-o*c,t[2]=r*i+e*c,t[3]=e*i-r*c,t}function k(t,n){const s=n[0],o=n[1],a=n[2];return t[0]=s,t[1]=o,t[2]=a,t[3]=Math.sqrt(Math.abs(1-s*s-o*o-a*a)),t}function z(t,n,s,o){const r=n[0],e=n[1],c=n[2],i=n[3];let u,h,M,f,l,m=s[0],p=s[1],q=s[2],j=s[3];return h=r*m+e*p+c*q+i*j,h<0&&(h=-h,m=-m,p=-p,q=-q,j=-j),1-h>a()?(u=Math.acos(h),M=Math.sin(u),f=Math.sin((1-o)*u)/M,l=Math.sin(o*u)/M):(f=1-o,l=o),t[0]=f*r+l*m,t[1]=f*e+l*p,t[2]=f*c+l*q,t[3]=f*i+l*j,t}function E(t){const n=r,s=n(),o=n(),a=n(),e=Math.sqrt(1-s),c=Math.sqrt(s);return t[0]=e*Math.sin(2*Math.PI*o),t[1]=e*Math.cos(2*Math.PI*o),t[2]=c*Math.sin(2*Math.PI*a),t[3]=c*Math.cos(2*Math.PI*a),t}function L(t,n){const s=n[0],o=n[1],a=n[2],r=n[3],e=s*s+o*o+a*a+r*r,c=e?1/e:0;return t[0]=-s*c,t[1]=-o*c,t[2]=-a*c,t[3]=r*c,t}function O(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}function S(t,n){const s=n[0]+n[4]+n[8];let o;if(s>0)o=Math.sqrt(s+1),t[3]=.5*o,o=.5/o,t[0]=(n[5]-n[7])*o,t[1]=(n[6]-n[2])*o,t[2]=(n[1]-n[3])*o;else{let s=0;n[4]>n[0]&&(s=1),n[8]>n[3*s+s]&&(s=2);const a=(s+1)%3,r=(s+2)%3;o=Math.sqrt(n[3*s+s]-n[3*a+a]-n[3*r+r]+1),t[s]=.5*o,o=.5/o,t[3]=(n[3*a+r]-n[3*r+a])*o,t[a]=(n[3*a+s]+n[3*s+a])*o,t[r]=(n[3*r+s]+n[3*s+r])*o}return t}function T(t,n,s,o){const a=.5*Math.PI/180;n*=a,s*=a,o*=a;const r=Math.sin(n),e=Math.cos(n),c=Math.sin(s),i=Math.cos(s),u=Math.sin(o),h=Math.cos(o);return t[0]=r*i*h-e*c*u,t[1]=e*c*h+r*i*u,t[2]=e*i*u-r*c*h,t[3]=e*i*h+r*c*u,t}function H(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}const W=h,X=M,Y=f,Z=x,w=l,B=m,C=p,D=q,F=D,G=j,J=G,K=g,N=d,Q=P;function R(t,n,s){const o=e(n,s);return o<-.999999?(c(U,V,n),i(U)<1e-6&&c(U,$,n),u(U,U),I(t,U,Math.PI),t):o>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(c(U,n,s),t[0]=U[0],t[1]=U[1],t[2]=U[2],t[3]=1+o,K(t,t))}const U=s(),V=o(1,0,0),$=o(0,1,0);function tt(t,n,s,o,a,r){return z(nt,n,a,r),z(st,s,o,r),z(t,nt,st,2*r*(1-r)),t}const nt=n(),st=n();function ot(t,n,s,o){const a=at;return a[0]=s[0],a[3]=s[1],a[6]=s[2],a[1]=o[0],a[4]=o[1],a[7]=o[2],a[2]=-n[0],a[5]=-n[1],a[8]=-n[2],K(t,S(t,a))}const at=t(),rt=Object.freeze(Object.defineProperty({__proto__:null,add:Y,calculateW:k,conjugate:O,copy:W,dot:B,equals:Q,exactEquals:N,fromEuler:T,fromMat3:S,getAxisAngle:v,identity:b,invert:L,len:F,length:D,lerp:C,mul:Z,multiply:x,normalize:K,random:E,rotateX:y,rotateY:A,rotateZ:_,rotationTo:R,scale:w,set:X,setAxes:ot,setAxisAngle:I,slerp:z,sqlerp:tt,sqrLen:J,squaredLength:G,str:H},Symbol.toStringTag,{value:"Module"}));export{Y as add,k as calculateW,O as conjugate,W as copy,B as dot,Q as equals,N as exactEquals,T as fromEuler,S as fromMat3,v as getAxisAngle,b as identity,L as invert,F as len,D as length,C as lerp,Z as mul,x as multiply,K as normalize,rt as q,E as random,y as rotateX,A as rotateY,_ as rotateZ,R as rotationTo,w as scale,X as set,ot as setAxes,I as setAxisAngle,z as slerp,tt as sqlerp,J as sqrLen,G as squaredLength,H as str};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import"../factories/vec3f64.js";import"./common.js";export{v as abs,g as add,d as angle,O as bezier,L as ceil,c as copy,b as cross,E as direction,o as dist,q as distance,U as div,H as divide,k as dot,G as equals,j as exactEquals,J as floor,N as hermite,i as inverse,D as len,l as length,m as lerp,C as max,y as min,T as mul,B as multiply,F as negate,n as normalize,P as random,Q as rotateX,R as rotateY,K as rotateZ,M as round,h as scale,r as scaleAndAdd,s as set,A as sign,w as sqrDist,x as sqrLen,a as squaredDistance,p as squaredLength,S as str,z as sub,f as subtract,t as transformMat3,e as transformMat4,u as transformQuat}from"../../../../chunks/vec32.js";
5
+ import"../factories/vec3f64.js";import"./common.js";export{v as abs,g as add,d as angle,O as bezier,L as ceil,c as copy,b as cross,E as direction,o as dist,q as distance,U as div,D as divide,k as dot,G as equals,j as exactEquals,J as floor,N as hermite,i as inverse,H as len,l as length,m as lerp,C as max,y as min,T as mul,B as multiply,F as negate,n as normalize,P as random,Q as rotateX,R as rotateY,K as rotateZ,M as round,h as scale,r as scaleAndAdd,s as set,A as sign,w as sqrDist,x as sqrLen,a as squaredDistance,p as squaredLength,S as str,z as sub,f as subtract,t as transformMat3,e as transformMat4,u as transformQuat}from"../../../../chunks/vec32.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import"./common.js";export{g as add,p as ceil,c as copy,b as copyVec3,H as dist,y as distance,G as div,o as divide,h as dot,e as equals,a as exactEquals,q as floor,A as inverse,J as len,i as length,l as lerp,u as max,r as min,F as mul,m as multiply,z as negate,n as normalize,B as random,w as round,d as scale,x as scaleAndAdd,s as set,I as sqrDist,K as sqrLen,f as squaredDistance,j as squaredLength,D as str,E as sub,k as subtract,t as transformMat4,C as transformQuat}from"../../../../chunks/vec42.js";
5
+ import"./common.js";export{f as add,p as ceil,c as copy,h as copyVec3,H as dist,y as distance,G as div,o as divide,g as dot,e as equals,a as exactEquals,q as floor,A as inverse,J as len,i as length,l as lerp,u as max,r as min,F as mul,m as multiply,z as negate,n as normalize,B as random,w as round,b as scale,x as scaleAndAdd,s as set,I as sqrDist,K as sqrLen,d as squaredDistance,j as squaredLength,D as str,E as sub,k as subtract,t as transformMat4,C as transformQuat}from"../../../../chunks/vec42.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import"../../core/Logger.js";import"../../core/mathUtils.js";import"../../core/libs/gl-matrix-2/math/mat4.js";import"../../chunks/vec32.js";import"../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../chunks/vec42.js";import"../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../../core/libs/gl-matrix-2/math/common.js";import"./Axis.js";import"./ray.js";import"./vector.js";import"./vectorStacks.js";export{N as NullSphere,B as altitudeAt,z as angleToSilhouette,A as axisAt,q as clear,y as closestPoint,j as closestPointOnSilhouette,n as containsPoint,c as copy,d as create,e as distanceToSilhouette,r as elevate,o as equals,l as exactEquals,b as fromCenterAndRadius,k as fromRadius,f as fromValues,g as getCenter,a as getRadius,m as intersectLine,h as intersectRay,x as intersectRayClosestSilhouette,i as intersectsRay,p as projectPoint,C as setAltitudeAt,v as setExtent,t as tmpSphere,u as union,w as wrap}from"../../chunks/sphere.js";
5
+ import"../../core/has.js";import"../../core/Logger.js";import"../../core/mathUtils.js";import"../../core/libs/gl-matrix-2/math/mat4.js";import"../../chunks/vec32.js";import"../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../chunks/vec42.js";import"../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../../core/libs/gl-matrix-2/math/common.js";import"./Axis.js";import"./ray.js";import"./vector.js";import"./vectorStacks.js";export{N as NullSphere,B as altitudeAt,z as angleToSilhouette,A as axisAt,q as clear,y as closestPoint,e as closestPointOnSilhouette,n as containsPoint,a as copy,c as create,d as distanceToSilhouette,r as elevate,o as equals,l as exactEquals,k as fromCenterAndRadius,h as fromRadius,f as fromValues,g as getCenter,b as getRadius,m as intersectLine,i as intersectRay,x as intersectRayClosestSilhouette,j as intersectsRay,p as projectPoint,C as setAltitudeAt,v as setExtent,t as tmpSphere,u as union,w as wrap}from"../../chunks/sphere.js";
package/interfaces.d.ts CHANGED
@@ -15623,19 +15623,19 @@ declare namespace __esri {
15623
15623
  *
15624
15624
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KnowledgeGraphLayer.html#addRecords)
15625
15625
  */
15626
- static addRecords(records: IdTypePair[]): Promise<void>;
15626
+ addRecords(records: IdTypePair[]): Promise<void>;
15627
15627
  /**
15628
15628
  * Assumes that data for all of the members defined in the inclusionModeDefinition is already loaded into local storage.
15629
15629
  *
15630
15630
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KnowledgeGraphLayer.html#loadLayerAssumingLocalCache)
15631
15631
  */
15632
- static loadLayerAssumingLocalCache(): void;
15632
+ loadLayerAssumingLocalCache(): void;
15633
15633
  /**
15634
15634
  * Removes entities or relationships from the knowledge graph layer.
15635
15635
  *
15636
15636
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KnowledgeGraphLayer.html#removeRecords)
15637
15637
  */
15638
- static removeRecords(records: IdTypePair[]): Promise<IdTypePair[]>;
15638
+ removeRecords(records: IdTypePair[]): Promise<IdTypePair[]>;
15639
15639
  }
15640
15640
 
15641
15641
  interface KnowledgeGraphLayerProperties extends LayerProperties {
@@ -38051,13 +38051,13 @@ declare namespace __esri {
38051
38051
  *
38052
38052
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-UtilityNetwork.html#generateAddAssociations)
38053
38053
  */
38054
- generateAddAssociations(association: Association[]): Promise<ServiceEdits>;
38054
+ generateAddAssociations(association: Association[]): ServiceEdits;
38055
38055
  /**
38056
38056
  * Returns [ServiceEdits](https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-UtilityNetwork.html#ServiceEdits) which are used to delete an [Association](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-networks-support-Association.html) via the `applyEdits` method on the [FeatureService](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-featureService-FeatureService.html) class.
38057
38057
  *
38058
38058
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-UtilityNetwork.html#generateDeleteAssociations)
38059
38059
  */
38060
- generateDeleteAssociations(association: Association[]): Promise<ServiceEdits>;
38060
+ generateDeleteAssociations(association: Association[]): ServiceEdits;
38061
38061
  /**
38062
38062
  * All devices features have terminal configurations (default single terminal).
38063
38063
  *
package/kernel.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";import{buildDate as s,commitHash as e}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const r="4.29";let t,i=r;i="4.29.7";function n(o){t=o}function m(s){const e=t?.findCredential(s);return e?.token?o(s,"token",e.token):s}has("host-webworker");export{m as addTokenParameter,s as buildDate,i as fullVersion,t as id,e as revision,n as setId,r as version};
5
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";import{buildDate as s,commitHash as e}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const r="4.29";let t,i=r;i="4.29.9";function n(o){t=o}function m(s){const e=t?.findCredential(s);return e?.token?o(s,"token",e.token):s}has("host-webworker");export{m as addTokenParameter,s as buildDate,i as fullVersion,t as id,e as revision,n as setId,r as version};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import i from"../core/Accessor.js";import r from"../core/Logger.js";import{isAbortError as s}from"../core/promiseUtils.js";import{watch as n}from"../core/reactiveUtils.js";import{addFrameTask as a}from"../core/scheduling.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{wasmFailedToInit as d,Lyr3DWasmWorkerOutputStatus as h,invalidLayerView as u}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as _}from"./Lyr3DWorkerHandle.js";import{loadLyr3DMainWASM as y}from"../libs/lyr3d/Lyr3DModule.js";import{getMetersPerUnit as c}from"../symbols/support/unitConversionUtils.js";import{makeScheduleFunction as g}from"../views/3d/layers/I3SMeshView3D.js";var m,b;!function(e){e[e.Lifetime=0]="Lifetime",e[e.Jobs=1]="Jobs",e[e.Renderables=2]="Renderables"}(m||(m={})),function(e){e[e.Critical=0]="Critical",e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Info=3]="Info"}(b||(b={}));let f=class extends i{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._debugFlags=new Set,this._debugLevel=b.Critical,this._pulseTaskHandle=null,this._session=null,this._debugFlags.add(m.Lifetime),this._debugFlags.add(m.Jobs),this._debugFlags.add(m.Renderables)}_debugLog(e,t,i,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=t){const e=s?`[js] ${i}`:`${i}`;t===b.Critical||t===b.Error?r.getLogger(this).error(e):t===b.Warning&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}initialize(){this._debugLevel>b.Warning&&(r.getLogger(this).level="info"),this._debugLog(m.Lifetime,b.Info,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([n((()=>this.view.state?.contentCamera),(()=>this._updateWasmCamera()))]),this._pulseTaskHandle=a({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(m.Lifetime,b.Info,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach((e=>{e.abortController.abort()})),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null);const e=this._worker;e&&e.destroyWasm().then((()=>{this._worker?.destroy(),this._worker=null})),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}add3DTilesLayerView(e){return this._lyr3DMain?this._add3DTilesLayerView(e):(this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),d)}remove3DTilesLayerView(e){if(!this._lyr3DMain)return this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() called when WASM wasn't loaded!"),0;this._doRemoveLayerView(e);const t=this._layers.size;return 0===t&&(this._debugLog(m.Lifetime,b.Info,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),t}setEnabled(e,t){if(!this._lyr3DMain)return void this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.setEnabled() called when WASM wasn't loaded!");const i=this._layers.get(e.wasmLayerId);i&&(this._lyr3DMain.set_enabled(e.wasmLayerId,t),i.needMemoryUsageUpdate=!0)}setLayerOffset(e,t){if(!this._lyr3DMain)return void this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.setLayerOffset() called when WASM wasn't loaded!");this._layers.get(e.wasmLayerId)&&this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,t)}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.getAttributionText() called when WASM wasn't loaded!"),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,t,i){if(!this._lyr3DMain)return void this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.onRenderableEvicted() called when WASM wasn't loaded!");this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,t,i)}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const t=this._layers.get(e);return!!t&&(t.outstandingJobCount>0||t.outstandingRenderableCount>0)}initializeWasm(){return this._lyr3DMain?Promise.resolve():(this._debugLog(m.Lifetime,b.Info,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=y().then((e=>{this._lyr3DMain=e,this._lyr3DMainPromise=null;const t=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),i=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),r=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),s=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),n=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),a="global"===this.view.viewingMode,o=this.view.renderSpatialReference?.isWebMercator?3857:this.view.renderSpatialReference?.wkid??-1,l=this.view.heightModelInfo?.heightModel,d=!l||"gravity-related-height"===l;return this._lyr3DMain.initialize_lyr3d_wasm(n,t,i,r,s,a,d,o,this._debugLevel)?(this._worker=new _(g(this.view.resourceController)),this._worker.promise?this._worker.promise:void 0):(this._lyr3DMain=null,void this._debugLog(m.Lifetime,b.Critical,"Lyr3d Main WASM failed to initialize",!1))})).catch((e=>{this._debugLog(m.Lifetime,b.Critical,`Lyr3d WASM failed to download error = ${e}`,!1)}))),this._lyr3DMainPromise)}_pulseTask(){if(this._lyr3DMain){let e=0;this._layers.forEach((t=>{e+=t.layerView.usedMemory})),e/=1048576;const t=this.view.resourceController.memoryController,i=t.usedMemory*t.maxMemory-e,r=t.maxMemory-i+t.additionalCacheMemory;this._lyr3DMain.frame_pulse(r,e,i,t.maxMemory)}}_incrementJobCount(e){e.outstandingJobCount+=1,1===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_decrementJobCount(e){e.outstandingJobCount-=1,0===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){e.outstandingRenderableCount+=1,e.outstandingJobCount<1&&1===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){e.outstandingRenderableCount-=1,e.outstandingJobCount<1&&0===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_onJobFailed(e,t,i){t.error.length&&this._debugLog(m.Jobs,b.Error,t.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(i.jobId,i.desc),this._decrementJobCount(e)}_onJobSucceeded(e,t,i){if(this._lyr3DMain){const e=t.data.byteLength,r=this._lyr3DMain._malloc(e);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,r,e).set(t.data),this._lyr3DMain.on_job_completed(i.jobId,t.jobDescJson,r,e),this._lyr3DMain._free(r)}this._decrementJobCount(e)}_getRequestPromises(e,i){const r=[];for(const s of e){const e=new URL(s),n=e.searchParams.get("session");n?this._session=n:this._session&&e.searchParams.append("session",this._session),r.push(t(e.toString(),i).then((e=>e.data)))}return r}_onNewJob(){const e=this._lyr3DMain.get_next_job(),t=this._layers.get(e.layerId);if(!t)return;this._incrementJobCount(t);const i=t.abortController.signal,r={responseType:"array-buffer",signal:i,query:{...t.customParameters,token:t.apiKey}},n={inputs:[],jobDescJson:e.desc,isMissingResourceCase:!1},a=this._getRequestPromises(e.urls,r);Promise.all(a).then((e=>(n.inputs=e,this._worker.invoke(n,i)))).then((e=>e)).catch((t=>(s(t)?this._debugLog(m.Jobs,b.Warning,`job ${e.jobId} was cancelled.`):this._debugLog(m.Jobs,b.Error,`job ${e.jobId} failed with error ${t}.`),{status:h.Failed,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}))).then((a=>{if(a.status===h.Failed)this._onJobFailed(t,a,e);else if(a.status===h.Succeeded)this._onJobSucceeded(t,a,e);else if(a.status===h.MissingInputs){const o=this._getRequestPromises(a.missingInputUrls,r);Promise.all(o).then((e=>{n.jobDescJson=a.jobDescJson,a.originalInputs?n.inputs=a.originalInputs:n.inputs=[],n.isMissingResourceCase=!0;for(const t of e)n.inputs.push(t);return this._worker.invoke(n,i)})).then((i=>{i.status===h.Failed?this._onJobFailed(t,i,e):i.status===h.Succeeded&&this._onJobSucceeded(t,i,e)})).catch((i=>{this._decrementJobCount(t),s(i)?this._debugLog(m.Jobs,b.Warning,`job ${e.jobId} was cancelled.`):this._debugLog(m.Jobs,b.Error,`job ${e.jobId} failed with error2 ${i}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)}))}}))}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),t=e.meshData;if(t.data&&t.data.byteLength>0){const e=t.data.slice();t.data=e}const i=this._layers.get(e.layerId);i&&(this._incrementRenderableCount(i),i.layerView.createRenderable(e).then((t=>{this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!0,e.layerId,e.handle,t.memUsageBytes),this._decrementRenderableCount(i)})).catch((t=>{s(t)||this._debugLog(m.Renderables,b.Error,`createRenderable failed with error ${t}.`),this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!1,e.layerId,e.handle,0),this._decrementRenderableCount(i)})))}_freeRenderables(e,t,i){if(i<1)return;const r=this._layers.get(e);if(!r)return;const s=r.layerView,n=[],a=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,i);for(let o=0;o<i;++o)n.push(a[o]);for(let o=0;o<i;++o)s.freeRenderable(n[o])}_setRenderableVisibility(e,t,i,r){if(r<1)return;const s=this._layers.get(e);if(!s)return;const n=s.layerView,a=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,r),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,i,r);for(let h=0;h<r;++h)a.push(l[h]),o.push(1===d[h]);n.setRenderableVisibility(a,o,r)}_onWasmError(e,t,i,r){this._lyr3DMain&&this._debugLog(i,r,this._lyr3DMain.UTF8ToString(e,t),!1)}_doRemoveLayerView(e){const t=this._layers.get(e.wasmLayerId);return!!t&&(t.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._layers.delete(e.wasmLayerId),!0)}_add3DTilesLayerView(e){const t=e.layer;if(!t.url)return u;const i=this._lyr3DMain.get_next_layer_id(),r=new AbortController;this._layers.set(i,{layerView:e,abortController:r,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:t.customParameters,apiKey:t.apiKey});const s=t.elevationInfo?.offset??0,n=t.elevationInfo?.unit?c(t.elevationInfo?.unit):1;return this._lyr3DMain.add_layer(t.url,i,s*n)?(this._updateWasmCamera(),i):(this._layers.delete(i),u)}_updateWasmCamera(){const e=this.view.state?.contentCamera;if(!e||!this._lyr3DMain)return;const{eye:t,center:i,up:r,near:s,far:n,fovY:a}=e,o=[e.viewport[2],e.viewport[3]],l=e.width/e.height;this._lyr3DMain.set_camera_parameters({eye:t,center:i,up:r,near:s,far:n,fov:a,aspectRatio:l,viewport:o})}};e([o({constructOnly:!0})],f.prototype,"view",void 0),f=e([l("esri.layers.Lyr3DWasmPerSceneView")],f);const w=f;export{w as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import i from"../core/Accessor.js";import r from"../core/Logger.js";import{isAbortError as s}from"../core/promiseUtils.js";import{watch as n}from"../core/reactiveUtils.js";import{addFrameTask as a}from"../core/scheduling.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{wasmFailedToInit as d,Lyr3DWasmWorkerOutputStatus as h,invalidLayerView as u}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as _}from"./Lyr3DWorkerHandle.js";import{loadLyr3DMainWASM as y}from"../libs/lyr3d/Lyr3DModule.js";import{getMetersPerUnit as c}from"../symbols/support/unitConversionUtils.js";import{makeScheduleFunction as g}from"../views/3d/layers/support/makeScheduleFunction.js";var m,b;!function(e){e[e.Lifetime=0]="Lifetime",e[e.Jobs=1]="Jobs",e[e.Renderables=2]="Renderables"}(m||(m={})),function(e){e[e.Critical=0]="Critical",e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Info=3]="Info"}(b||(b={}));let f=class extends i{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._debugFlags=new Set,this._debugLevel=b.Critical,this._pulseTaskHandle=null,this._session=null,this._debugFlags.add(m.Lifetime),this._debugFlags.add(m.Jobs),this._debugFlags.add(m.Renderables)}_debugLog(e,t,i,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=t){const e=s?`[js] ${i}`:`${i}`;t===b.Critical||t===b.Error?r.getLogger(this).error(e):t===b.Warning&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}initialize(){this._debugLevel>b.Warning&&(r.getLogger(this).level="info"),this._debugLog(m.Lifetime,b.Info,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([n((()=>this.view.state?.contentCamera),(()=>this._updateWasmCamera()))]),this._pulseTaskHandle=a({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(m.Lifetime,b.Info,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach((e=>{e.abortController.abort()})),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null);const e=this._worker;e&&e.destroyWasm().then((()=>{this._worker?.destroy(),this._worker=null})),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}add3DTilesLayerView(e){return this._lyr3DMain?this._add3DTilesLayerView(e):(this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),d)}remove3DTilesLayerView(e){if(!this._lyr3DMain)return this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() called when WASM wasn't loaded!"),0;this._doRemoveLayerView(e);const t=this._layers.size;return 0===t&&(this._debugLog(m.Lifetime,b.Info,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),t}setEnabled(e,t){if(!this._lyr3DMain)return void this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.setEnabled() called when WASM wasn't loaded!");const i=this._layers.get(e.wasmLayerId);i&&(this._lyr3DMain.set_enabled(e.wasmLayerId,t),i.needMemoryUsageUpdate=!0)}setLayerOffset(e,t){if(!this._lyr3DMain)return void this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.setLayerOffset() called when WASM wasn't loaded!");this._layers.get(e.wasmLayerId)&&this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,t)}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.getAttributionText() called when WASM wasn't loaded!"),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,t,i){if(!this._lyr3DMain)return void this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.onRenderableEvicted() called when WASM wasn't loaded!");this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,t,i)}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const t=this._layers.get(e);return!!t&&(t.outstandingJobCount>0||t.outstandingRenderableCount>0)}initializeWasm(){return this._lyr3DMain?Promise.resolve():(this._debugLog(m.Lifetime,b.Info,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=y().then((e=>{this._lyr3DMain=e,this._lyr3DMainPromise=null;const t=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),i=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),r=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),s=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),n=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),a="global"===this.view.viewingMode,o=this.view.renderSpatialReference?.isWebMercator?3857:this.view.renderSpatialReference?.wkid??-1,l=this.view.heightModelInfo?.heightModel,d=!l||"gravity-related-height"===l;return this._lyr3DMain.initialize_lyr3d_wasm(n,t,i,r,s,a,d,o,this._debugLevel)?(this._worker=new _(g(this.view.resourceController)),this._worker.promise?this._worker.promise:void 0):(this._lyr3DMain=null,void this._debugLog(m.Lifetime,b.Critical,"Lyr3d Main WASM failed to initialize",!1))})).catch((e=>{this._debugLog(m.Lifetime,b.Critical,`Lyr3d WASM failed to download error = ${e}`,!1)}))),this._lyr3DMainPromise)}_pulseTask(){if(this._lyr3DMain){let e=0;this._layers.forEach((t=>{e+=t.layerView.usedMemory})),e/=1048576;const t=this.view.resourceController.memoryController,i=t.usedMemory*t.maxMemory-e,r=t.maxMemory-i+t.additionalCacheMemory;this._lyr3DMain.frame_pulse(r,e,i,t.maxMemory)}}_incrementJobCount(e){e.outstandingJobCount+=1,1===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_decrementJobCount(e){e.outstandingJobCount-=1,0===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){e.outstandingRenderableCount+=1,e.outstandingJobCount<1&&1===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){e.outstandingRenderableCount-=1,e.outstandingJobCount<1&&0===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_onJobFailed(e,t,i){t.error.length&&this._debugLog(m.Jobs,b.Error,t.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(i.jobId,i.desc),this._decrementJobCount(e)}_onJobSucceeded(e,t,i){if(this._lyr3DMain){const e=t.data.byteLength,r=this._lyr3DMain._malloc(e);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,r,e).set(t.data),this._lyr3DMain.on_job_completed(i.jobId,t.jobDescJson,r,e),this._lyr3DMain._free(r)}this._decrementJobCount(e)}_getRequestPromises(e,i){const r=[];for(const s of e){const e=new URL(s),n=e.searchParams.get("session");n?this._session=n:this._session&&e.searchParams.append("session",this._session),r.push(t(e.toString(),i).then((e=>e.data)))}return r}_onNewJob(){const e=this._lyr3DMain.get_next_job(),t=this._layers.get(e.layerId);if(!t)return;this._incrementJobCount(t);const i=t.abortController.signal,r={responseType:"array-buffer",signal:i,query:{...t.customParameters,token:t.apiKey}},n={inputs:[],jobDescJson:e.desc,isMissingResourceCase:!1},a=this._getRequestPromises(e.urls,r);Promise.all(a).then((e=>(n.inputs=e,this._worker.invoke(n,i)))).then((e=>e)).catch((t=>(s(t)?this._debugLog(m.Jobs,b.Warning,`job ${e.jobId} was cancelled.`):this._debugLog(m.Jobs,b.Error,`job ${e.jobId} failed with error ${t}.`),{status:h.Failed,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}))).then((a=>{if(a.status===h.Failed)this._onJobFailed(t,a,e);else if(a.status===h.Succeeded)this._onJobSucceeded(t,a,e);else if(a.status===h.MissingInputs){const o=this._getRequestPromises(a.missingInputUrls,r);Promise.all(o).then((e=>{n.jobDescJson=a.jobDescJson,a.originalInputs?n.inputs=a.originalInputs:n.inputs=[],n.isMissingResourceCase=!0;for(const t of e)n.inputs.push(t);return this._worker.invoke(n,i)})).then((i=>{i.status===h.Failed?this._onJobFailed(t,i,e):i.status===h.Succeeded&&this._onJobSucceeded(t,i,e)})).catch((i=>{this._decrementJobCount(t),s(i)?this._debugLog(m.Jobs,b.Warning,`job ${e.jobId} was cancelled.`):this._debugLog(m.Jobs,b.Error,`job ${e.jobId} failed with error2 ${i}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)}))}}))}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),t=e.meshData;if(t.data&&t.data.byteLength>0){const e=t.data.slice();t.data=e}const i=this._layers.get(e.layerId);i&&(this._incrementRenderableCount(i),i.layerView.createRenderable(e).then((t=>{this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!0,e.layerId,e.handle,t.memUsageBytes),this._decrementRenderableCount(i)})).catch((t=>{s(t)||this._debugLog(m.Renderables,b.Error,`createRenderable failed with error ${t}.`),this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!1,e.layerId,e.handle,0),this._decrementRenderableCount(i)})))}_freeRenderables(e,t,i){if(i<1)return;const r=this._layers.get(e);if(!r)return;const s=r.layerView,n=[],a=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,i);for(let o=0;o<i;++o)n.push(a[o]);for(let o=0;o<i;++o)s.freeRenderable(n[o])}_setRenderableVisibility(e,t,i,r){if(r<1)return;const s=this._layers.get(e);if(!s)return;const n=s.layerView,a=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,r),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,i,r);for(let h=0;h<r;++h)a.push(l[h]),o.push(1===d[h]);n.setRenderableVisibility(a,o,r)}_onWasmError(e,t,i,r){this._lyr3DMain&&this._debugLog(i,r,this._lyr3DMain.UTF8ToString(e,t),!1)}_doRemoveLayerView(e){const t=this._layers.get(e.wasmLayerId);return!!t&&(t.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._layers.delete(e.wasmLayerId),!0)}_add3DTilesLayerView(e){const t=e.layer;if(!t.url)return u;const i=this._lyr3DMain.get_next_layer_id(),r=new AbortController;this._layers.set(i,{layerView:e,abortController:r,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:t.customParameters,apiKey:t.apiKey});const s=t.elevationInfo?.offset??0,n=t.elevationInfo?.unit?c(t.elevationInfo?.unit):1;return this._lyr3DMain.add_layer(t.url,i,s*n)?(this._updateWasmCamera(),i):(this._layers.delete(i),u)}_updateWasmCamera(){const e=this.view.state?.contentCamera;if(!e||!this._lyr3DMain)return;const{eye:t,center:i,up:r,near:s,far:n,fovY:a}=e,o=[e.viewport[2],e.viewport[3]],l=e.width/e.height;this._lyr3DMain.set_camera_parameters({eye:t,center:i,up:r,near:s,far:n,fov:a,aspectRatio:l,viewport:o})}};e([o({constructOnly:!0})],f.prototype,"view",void 0),f=e([l("esri.layers.Lyr3DWasmPerSceneView")],f);const w=f;export{w 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.29/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Collection.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{reader as s}from"../../core/accessorSupport/decorators/reader.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{writer as n}from"../../core/accessorSupport/decorators/writer.js";import{excludeTables as l}from"../../core/accessorSupport/layerContainerType.js";import a from"../../geometry/Extent.js";import d from"../../geometry/HeightModelInfo.js";import u from"../../geometry/SpatialReference.js";import{sanitizeUrlWithLayerId as c,writeUrlWithLayerId as y}from"../support/arcgisLayerUrl.js";import{elevationInfo as m,maxScale as h,minScale as v,url as f}from"../support/commonProperties.js";import g from"../support/EditFieldsInfo.js";import{FeatureIndex as I}from"../support/FeatureIndex.js";import{geometryTypeKebabDict as S,isLayerCacheStale as F,readGlobalIdField as b,readObjectIdField as j,readVersion as x}from"../support/featureLayerUtils.js";import E from"../support/GeometryFieldsInfo.js";import O from"../support/LayerFloorInfo.js";import U from"../support/Relationship.js";import{getFeatureLayerCapabilities as w}from"../support/serviceCapabilitiesUtils.js";import T from"../support/Subtype.js";import{timeZoneProperty as M}from"../../time/timeZoneUtils.js";const D=D=>{let R=class extends D{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(t.ofType(I)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=u.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.version=void 0}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:e}=this;if(e){const{query:t,operations:r,editing:i}=e;if(!t.supportsQueryByOthers||!t.supportsQueryByAnonymous)return"load";if(r.supportsEditing&&!(i.supportsUpdateByOthers&&i.supportsUpdateByAnonymous&&i.supportsDeleteByOthers&&i.supportsDeleteByAnonymous))return"load"}return this.userHasUpdateItemPrivileges?F(this)?"load":this.hasUpdateItemRestrictions?e.operations.supportsQuery?"editing":"load":null:this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions?"editing":null}readCapabilitiesFromService(e,t){return w(t,this.url)}readEditingInfo(e,t){const{editingInfo:r}=t;return r?{lastEditDate:null!=r.lastEditDate?new Date(r.lastEditDate):null}:null}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=r(e),{operations:i,editing:o}=t;return this.sourceJSON?.isMultiServicesView?(this.userHasUpdateItemPrivileges&&(i.supportsQuery=!0),t):this.userHasUpdateItemPrivileges?(i.supportsAdd=i.supportsDelete=i.supportsEditing=i.supportsQuery=i.supportsUpdate=o.supportsDeleteByOthers=o.supportsGeometryUpdate=o.supportsUpdateByOthers=!0,t):(this.userHasFullEditingPrivileges&&i.supportsEditing&&(i.supportsAdd=i.supportsDelete=i.supportsUpdate=o.supportsGeometryUpdate=!0),t)}readGlobalIdFieldFromService(e,t){return b(t)}get hasFullEditingRestrictions(){const e=this.capabilities;if(!e||this.sourceJSON?.isMultiServicesView)return!1;const{operations:t,editing:r}=e;return t.supportsEditing&&!(t.supportsAdd&&t.supportsDelete&&t.supportsUpdate&&r.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const e=this.capabilities;if(!e)return!1;const{operations:t,editing:r}=e;return this.sourceJSON?.isMultiServicesView?!t.supportsQuery:!(t.supportsAdd&&t.supportsDelete&&t.supportsEditing&&t.supportsQuery&&t.supportsUpdate&&r.supportsDeleteByOthers&&r.supportsGeometryUpdate&&r.supportsUpdateByOthers)}readIsTableFromService(e,t){return"Table"===t.type}readMaxScale(e,t){return t.effectiveMaxScale||e||0}readMinScale(e,t){return t.effectiveMinScale||e||0}readObjectIdFieldFromService(e,t){return j(t)}readServiceDefinitionExpression(e,t){return t.definitionQuery||t.definitionExpression}set url(e){const t=c({layer:this,url:e,nonStandardUrlAllowed:!0,logger:i.getLogger(this)});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,i){y(this,e,null,t,i)}readVersion(e,t){return x(t)}};return e([o({readOnly:!0})],R.prototype,"authenticationTriggerEvent",null),e([o({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],R.prototype,"copyright",void 0),e([o({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],R.prototype,"capabilities",void 0),e([s("service","capabilities")],R.prototype,"readCapabilitiesFromService",null),e([o(M("dateFieldsTimeReference"))],R.prototype,"dateFieldsTimeZone",void 0),e([o({type:Boolean})],R.prototype,"datesInUnknownTimezone",void 0),e([o({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],R.prototype,"definitionExpression",void 0),e([o({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],R.prototype,"displayField",void 0),e([o({readOnly:!0,type:g})],R.prototype,"editFieldsInfo",void 0),e([o({readOnly:!0})],R.prototype,"editingInfo",void 0),e([s("editingInfo")],R.prototype,"readEditingInfo",null),e([o({readOnly:!0})],R.prototype,"effectiveCapabilities",null),e([o((()=>{const e=r(m),t=e.json.origins;return t["web-map"]={read:!1,write:!1},t["portal-item"]={read:!1,write:!1},e})())],R.prototype,"elevationInfo",void 0),e([o({type:O,json:{name:"layerDefinition.floorInfo",write:!0,origins:{"web-scene":{name:"layerDefinition.floorInfo",write:{enabled:!0,layerContainerTypes:l}}}}})],R.prototype,"floorInfo",void 0),e([o({type:a,json:{origins:{service:{read:{source:"extent"}}}}})],R.prototype,"fullExtent",void 0),e([o()],R.prototype,"gdbVersion",void 0),e([o({readOnly:!0,type:E,json:{read:{source:"geometryProperties"}}})],R.prototype,"geometryFieldsInfo",void 0),e([o({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:S.read}}}})],R.prototype,"geometryType",void 0),e([o({type:String})],R.prototype,"globalIdField",void 0),e([s("service","globalIdField",["globalIdField","fields"])],R.prototype,"readGlobalIdFieldFromService",null),e([o({readOnly:!0})],R.prototype,"hasFullEditingRestrictions",null),e([o({type:Boolean,json:{origins:{service:{read:!0}}}})],R.prototype,"hasM",void 0),e([o({readOnly:!0})],R.prototype,"hasUpdateItemRestrictions",null),e([o({type:Boolean,json:{origins:{service:{read:!0}}}})],R.prototype,"hasZ",void 0),e([o({readOnly:!0,type:d})],R.prototype,"heightModelInfo",void 0),e([o({type:Date})],R.prototype,"historicMoment",void 0),e([o({type:t.ofType(I),readOnly:!0})],R.prototype,"indexes",void 0),e([o({readOnly:!0})],R.prototype,"isTable",void 0),e([s("service","isTable",["type"])],R.prototype,"readIsTableFromService",null),e([o({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],R.prototype,"layerId",void 0),e([o(h)],R.prototype,"maxScale",void 0),e([s("service","maxScale",["maxScale","effectiveMaxScale"])],R.prototype,"readMaxScale",null),e([o(v)],R.prototype,"minScale",void 0),e([s("service","minScale",["minScale","effectiveMinScale"])],R.prototype,"readMinScale",null),e([o({type:String})],R.prototype,"objectIdField",void 0),e([s("service","objectIdField",["objectIdField","fields"])],R.prototype,"readObjectIdFieldFromService",null),e([o(M("preferredTimeReference"))],R.prototype,"preferredTimeZone",void 0),e([o({type:[U],readOnly:!0})],R.prototype,"relationships",void 0),e([o({type:Boolean})],R.prototype,"returnM",void 0),e([o({type:Boolean})],R.prototype,"returnZ",void 0),e([o({readOnly:!0,json:{write:!1}})],R.prototype,"serverGens",void 0),e([o({readOnly:!0})],R.prototype,"serviceDefinitionExpression",void 0),e([s("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],R.prototype,"readServiceDefinitionExpression",null),e([o({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],R.prototype,"serviceItemId",void 0),e([o()],R.prototype,"sourceJSON",void 0),e([o({type:u,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],R.prototype,"spatialReference",void 0),e([o({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],R.prototype,"subtypeField",void 0),e([o({type:[T],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],R.prototype,"subtypes",void 0),e([o({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],R.prototype,"trackIdField",void 0),e([o(f)],R.prototype,"url",null),e([n("url")],R.prototype,"writeUrl",null),e([o({json:{origins:{service:{read:!0}},read:!1}})],R.prototype,"version",void 0),e([s("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],R.prototype,"readVersion",null),R=e([p("esri.layers.mixins.FeatureLayerBase")],R),R};export{D as FeatureLayerBase};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Collection.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{reader as s}from"../../core/accessorSupport/decorators/reader.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{writer as n}from"../../core/accessorSupport/decorators/writer.js";import{excludeTables as l}from"../../core/accessorSupport/layerContainerType.js";import a from"../../geometry/Extent.js";import d from"../../geometry/HeightModelInfo.js";import u from"../../geometry/SpatialReference.js";import{sanitizeUrlWithLayerId as c,writeUrlWithLayerId as y}from"../support/arcgisLayerUrl.js";import{elevationInfo as m,maxScale as h,minScale as f,url as v}from"../support/commonProperties.js";import g from"../support/EditFieldsInfo.js";import{FeatureIndex as I}from"../support/FeatureIndex.js";import{geometryTypeKebabDict as F,isLayerCacheStale as S,readGlobalIdField as b,readObjectIdField as j,readVersion as x}from"../support/featureLayerUtils.js";import E from"../support/GeometryFieldsInfo.js";import O from"../support/LayerFloorInfo.js";import U from"../support/Relationship.js";import{getFeatureLayerCapabilities as w}from"../support/serviceCapabilitiesUtils.js";import T from"../support/Subtype.js";import{timeZoneProperty as M}from"../../time/timeZoneUtils.js";const D=D=>{let R=class extends D{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(t.ofType(I)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=u.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.version=void 0}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:e}=this;if(e){const{query:t,operations:r,editing:i}=e;if(!t.supportsQueryByOthers||!t.supportsQueryByAnonymous)return"load";if(r.supportsEditing&&!(i.supportsUpdateByOthers&&i.supportsUpdateByAnonymous&&i.supportsDeleteByOthers&&i.supportsDeleteByAnonymous))return"load"}if(this.userHasUpdateItemPrivileges){if(S(this))return"load";if(this.hasUpdateItemRestrictions)return e.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const t=this.editFieldsInfo;return(t?.creatorField||t?.editorField)&&e?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(e,t){return w(t,this.url)}readEditingInfo(e,t){const{editingInfo:r}=t;return r?{lastEditDate:null!=r.lastEditDate?new Date(r.lastEditDate):null}:null}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=r(e),{operations:i,editing:o}=t;return this.sourceJSON?.isMultiServicesView?(this.userHasUpdateItemPrivileges&&(i.supportsQuery=!0),t):this.userHasUpdateItemPrivileges?(i.supportsAdd=i.supportsDelete=i.supportsEditing=i.supportsQuery=i.supportsUpdate=o.supportsDeleteByOthers=o.supportsGeometryUpdate=o.supportsUpdateByOthers=!0,t):(this.userHasFullEditingPrivileges&&i.supportsEditing&&(i.supportsAdd=i.supportsDelete=i.supportsUpdate=o.supportsGeometryUpdate=!0),t)}readGlobalIdFieldFromService(e,t){return b(t)}get hasFullEditingRestrictions(){const e=this.capabilities;if(!e||this.sourceJSON?.isMultiServicesView)return!1;const{operations:t,editing:r}=e;return t.supportsEditing&&!(t.supportsAdd&&t.supportsDelete&&t.supportsUpdate&&r.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const e=this.capabilities;if(!e)return!1;const{operations:t,editing:r}=e;return this.sourceJSON?.isMultiServicesView?!t.supportsQuery:!(t.supportsAdd&&t.supportsDelete&&t.supportsEditing&&t.supportsQuery&&t.supportsUpdate&&r.supportsDeleteByOthers&&r.supportsGeometryUpdate&&r.supportsUpdateByOthers)}readIsTableFromService(e,t){return"Table"===t.type}readMaxScale(e,t){return t.effectiveMaxScale||e||0}readMinScale(e,t){return t.effectiveMinScale||e||0}readObjectIdFieldFromService(e,t){return j(t)}readServiceDefinitionExpression(e,t){return t.definitionQuery||t.definitionExpression}set url(e){const t=c({layer:this,url:e,nonStandardUrlAllowed:!0,logger:i.getLogger(this)});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,i){y(this,e,null,t,i)}readVersion(e,t){return x(t)}};return e([o({readOnly:!0})],R.prototype,"authenticationTriggerEvent",null),e([o({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],R.prototype,"copyright",void 0),e([o({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],R.prototype,"capabilities",void 0),e([s("service","capabilities")],R.prototype,"readCapabilitiesFromService",null),e([o(M("dateFieldsTimeReference"))],R.prototype,"dateFieldsTimeZone",void 0),e([o({type:Boolean})],R.prototype,"datesInUnknownTimezone",void 0),e([o({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],R.prototype,"definitionExpression",void 0),e([o({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],R.prototype,"displayField",void 0),e([o({readOnly:!0,type:g})],R.prototype,"editFieldsInfo",void 0),e([o({readOnly:!0})],R.prototype,"editingInfo",void 0),e([s("editingInfo")],R.prototype,"readEditingInfo",null),e([o({readOnly:!0})],R.prototype,"effectiveCapabilities",null),e([o((()=>{const e=r(m),t=e.json.origins;return t["web-map"]={read:!1,write:!1},t["portal-item"]={read:!1,write:!1},e})())],R.prototype,"elevationInfo",void 0),e([o({type:O,json:{name:"layerDefinition.floorInfo",write:!0,origins:{"web-scene":{name:"layerDefinition.floorInfo",write:{enabled:!0,layerContainerTypes:l}}}}})],R.prototype,"floorInfo",void 0),e([o({type:a,json:{origins:{service:{read:{source:"extent"}}}}})],R.prototype,"fullExtent",void 0),e([o()],R.prototype,"gdbVersion",void 0),e([o({readOnly:!0,type:E,json:{read:{source:"geometryProperties"}}})],R.prototype,"geometryFieldsInfo",void 0),e([o({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:F.read}}}})],R.prototype,"geometryType",void 0),e([o({type:String})],R.prototype,"globalIdField",void 0),e([s("service","globalIdField",["globalIdField","fields"])],R.prototype,"readGlobalIdFieldFromService",null),e([o({readOnly:!0})],R.prototype,"hasFullEditingRestrictions",null),e([o({type:Boolean,json:{origins:{service:{read:!0}}}})],R.prototype,"hasM",void 0),e([o({readOnly:!0})],R.prototype,"hasUpdateItemRestrictions",null),e([o({type:Boolean,json:{origins:{service:{read:!0}}}})],R.prototype,"hasZ",void 0),e([o({readOnly:!0,type:d})],R.prototype,"heightModelInfo",void 0),e([o({type:Date})],R.prototype,"historicMoment",void 0),e([o({type:t.ofType(I),readOnly:!0})],R.prototype,"indexes",void 0),e([o({readOnly:!0})],R.prototype,"isTable",void 0),e([s("service","isTable",["type"])],R.prototype,"readIsTableFromService",null),e([o({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],R.prototype,"layerId",void 0),e([o(h)],R.prototype,"maxScale",void 0),e([s("service","maxScale",["maxScale","effectiveMaxScale"])],R.prototype,"readMaxScale",null),e([o(f)],R.prototype,"minScale",void 0),e([s("service","minScale",["minScale","effectiveMinScale"])],R.prototype,"readMinScale",null),e([o({type:String})],R.prototype,"objectIdField",void 0),e([s("service","objectIdField",["objectIdField","fields"])],R.prototype,"readObjectIdFieldFromService",null),e([o(M("preferredTimeReference"))],R.prototype,"preferredTimeZone",void 0),e([o({type:[U],readOnly:!0})],R.prototype,"relationships",void 0),e([o({type:Boolean})],R.prototype,"returnM",void 0),e([o({type:Boolean})],R.prototype,"returnZ",void 0),e([o({readOnly:!0,json:{write:!1}})],R.prototype,"serverGens",void 0),e([o({readOnly:!0})],R.prototype,"serviceDefinitionExpression",void 0),e([s("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],R.prototype,"readServiceDefinitionExpression",null),e([o({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],R.prototype,"serviceItemId",void 0),e([o()],R.prototype,"sourceJSON",void 0),e([o({type:u,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],R.prototype,"spatialReference",void 0),e([o({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],R.prototype,"subtypeField",void 0),e([o({type:[T],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],R.prototype,"subtypes",void 0),e([o({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],R.prototype,"trackIdField",void 0),e([o(v)],R.prototype,"url",null),e([n("url")],R.prototype,"writeUrl",null),e([o({json:{origins:{service:{read:!0}},read:!1}})],R.prototype,"version",void 0),e([s("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],R.prototype,"readVersion",null),R=e([p("esri.layers.mixins.FeatureLayerBase")],R),R};export{D as FeatureLayerBase};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import"../../../geometry.js";import{deg2rad as e}from"../../../core/mathUtils.js";import{zeros as t,create as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{z as r,g as i}from"../../../chunks/vec32.js";import n from"../../../geometry/Point.js";import{initializeProjection as s,project as o}from"../../../geometry/projection.js";import{fromPoints as c,fromValues as f}from"../../../geometry/support/ray.js";import{b as y,h as l}from"../../../chunks/sphere.js";import{geographicToWebMercator as x,webMercatorToGeographic as p}from"../../../geometry/support/webMercatorUtils.js";import{createCoveragePolygon as z}from"../core/coverageUtils.js";import m from"../core/ExposurePoint.js";import{transformPoints as u,updateElevation as h}from"./groundToImageUtils.js";import{getWebMercatorScalingFactor as w,convertPixelToHeadingPitch as R,convertHeadingPitchToSphereVertex as g,scaleAndAddWithFactor as b,ltpToGeographic as d,computeHFOVAndVFOV as P,projectiveTransform2 as M,scaleWithFactor as j,calculateRotationMatrix as O,transformMat3 as v,projectiveTransform as H,getPlaneLineIntersectionPoint as S}from"./utils.js";import{defaultImageSphereCenter as E}from"../../../widgets/PanoramicViewer/constants.js";import{isNumber as V}from"../../../widgets/support/dataUtils.js";import F from"../../../geometry/SpatialReference.js";import U from"../../../geometry/Polygon.js";function k(e,t){if(!e)return Promise.resolve([]);const a=t.feature;let r=a.attributes;return r instanceof m||(r=m.fromJSON(a),r&&(a.attributes=r)),D(e,t)}function D(e,t){const{attributes:a}=t.feature;if(a.isSpherical||360===a.horizontalFieldOfView){const{location:r,cameraOrientation:i,farDistance:n,cameraHeading:s,cameraHeight:o}=a;return G(e,r,n,[t.imageProperties.width,t.imageProperties.height],s,o,i)}return W(e,t)}async function G(e,t,r,i,s,o,p){let z=new n(t);const m=w(z);z.spatialReference.isGeographic&&z.spatialReference.isWGS84&&4!==p?.type&&(z=x(z));const u=new Array,[h,d,P]=z.toArray(),M=y([h,d,P??0],r/m),j=E.toArray();for(const y of e){let e,t;if(V(y.heading)&&V(y.pitch))e=y.heading,t=y.pitch;else{const a=R({x:y.x,y:y.y},i[0],i[1]);e=a.heading,t=a.pitch}e=(e+s)%360;const r=c([j[0],j[1],j[2]],g(e,t)),x=f([h,d,P??0],r.direction),p=a();l(M,x,p);const w=(z.z??0)-o;if(p[2]<w){const e=Math.abs((z.z-w)/-r.direction[2])*m;b([z.x,z.y,z.z],r.direction,e,m,p)}else p[2]=w;u.push(new n(p,z.spatialReference))}return u}async function W(e,t){const{feature:a}=t,{attributes:r}=a;let i=new n(r.location);if(4===r.cameraOrientation?.type){const e=r.cameraOrientation;i=new n(d(i,[e.latitude,e.longitude,e.ellipsoidRadius,e.squaredEccentricity]))}let c=!1;i.spatialReference.isWGS84&&(c=!0,i=x(i));const f=i.spatialReference.isWebMercator?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*i.y/6378137))):1,y=A(t,i,f),l=4===r.cameraOrientation?.type?y.map((e=>p(new n(e)))):y,z=await u(l,t,!0),m=await Promise.all(z);m.forEach((e=>{e.z=1}));const w=P(r.horizontalFieldOfView,r.verticalFieldOfView,r.cameraRoll??0).vfov;return Promise.all(e.map((async e=>{e.z=1;let a,y=M(e,m,l);if(a=4===r.cameraOrientation?.type?(await u([p(new n({...y,spatialReference:i.spatialReference}))],t,!0))[0]:(await u([new n({...y,spatialReference:i.spatialReference})],t,!0))[0],!a)return null;let x,z=Math.abs(e.x-a.x)+Math.abs(e.y-a.y);if(z>1){const r=await N(e,a,m,l,i,y,t);y=r.point,z=r.error}if(r.elevationSource){await s(i.spatialReference,t.footprintExtent.spatialReference,null,t.options);let a=await I(t);if(a?.extent){let s=Z(a,i,y);if(!s)return null;const l={x:s.x,y:s.y,z:s.z,hasZ:!0,spatialReference:i.spatialReference},z=new n(l);if(s){const l=o(z,t.footprintExtent.spatialReference),m=h([l],t,!1);let R;R=m instanceof Promise?await m:m,z.z=s.z=R[0].z;const g=await u([4===r.cameraOrientation?.type?p(z):z],t);if(!g[0])return null;let b=Math.abs(e.x-g[0].x)+Math.abs(e.y-g[0].y);if(x=s.z,b>1){let l=0;const z=async m=>{if(b>1){const R=m.width/10,g=m.height/10;if(!m||R<1||g<1)return y=q(y,i,f,x,r.cameraPitch,w,c),y;const d=[{x:s.x-R,y:s.y-g,spatialReference:i.spatialReference},{x:s.x+R,y:s.y-g,spatialReference:i.spatialReference},{x:s.x+R,y:s.y+g,spatialReference:i.spatialReference},{x:s.x-R,y:s.y+g,spatialReference:i.spatialReference}].map((e=>new n(e))),P=await h(d,t,!1);if(a=new U({rings:[[[P[0].x,P[0].y,P[0].z],[P[1].x,P[1].y,P[1].z],[P[2].x,P[2].y,P[2].z],[P[3].x,P[3].y,P[3].z],[P[0].x,P[0].y,P[0].z]]],spatialReference:i.spatialReference}),s=Z(a,i,y),s){const m=o(new n({x:s.x,y:s.y,z:s.z,spatialReference:i.spatialReference}),t.footprintExtent.spatialReference),h=await u([4===r.cameraOrientation?.type?p(m):m],t);if(h[0])return b=Math.abs(e.x-h[0].x)+Math.abs(e.y-h[0].y),x=s.z,b<=1||8===l?q(y,i,f,x,r.cameraPitch,w,c):(l+=1,z(a.extent))}return q(y,i,f,i.z-r.cameraHeight,r.cameraPitch,w,c)}return q(y,i,f,i.z-r.cameraHeight,r.cameraPitch,w,c)};return z(a.extent)}return q(y,i,f,i.z-r.cameraHeight,r.cameraPitch,w,c)}return q(y,i,f,i.z-r.cameraHeight,r.cameraPitch,w,c)}}return q(y,i,f,i.z-r.cameraHeight,r.cameraPitch,w,c)})))}function q(e,a,i,s,o,c,f){const y=Math.sqrt((e.z-a.z)**2+(Math.sqrt((e.x-a.x)**2+(e.y-a.y)**2)/i)**2)*i,l=j(r(t(),[e.x,e.y,e.z],[a.x,a.y,a.z]),1/y,1/i);if(e.z<s||o+c/2<90){const t=Math.abs((a.z-s)/-l[2])*i,r=b([a.x,a.y,a.z],l,t,i);e={x:r[0],y:r[1],z:r[2]}}else e.z=s;return e.spatialReference=a.spatialReference,e=new n(e),f&&(e=p(e)),e}function A(a,s,o){const{feature:c}=a,{attributes:f}=c,y=2*Math.tan(e(f.verticalFieldOfView)/2)*f.farDistance*o,l=2*Math.tan(e(f.horizontalFieldOfView)/2)*f.farDistance*o,x=O("HPR",[f.cameraHeading,f.cameraPitch,f.cameraRoll??0]),p=v([0,0,-1],x),z=b([s.x,s.y,s.z],p,f.farDistance*o,o),m=v([0,1,0],x),u=v([1,0,0],x),h=j(m,y/2,o),w=j(u,l/2,o),R=r(t(),h,w),g=i(t(),h,w);return[i(t(),z,R),i(t(),z,g),r(t(),z,R),r(t(),z,g)].map((e=>{const[t,a,r]=e;return new n({x:t,y:a,z:r,spatialReference:s.spatialReference})}))}function I(e){const{feature:t}=e,{polygon:a}=z(e.feature);if(!a.extent)return Promise.resolve(null);const r=J(a.extent),i=t.attributes.location.spatialReference.isWGS84?new F({wkid:102100}):t.attributes.location.spatialReference;return h(r,e,!1).then((e=>{const t=e.map((e=>o(e,i)));return new U({hasZ:!0,rings:[t.map((e=>[e.x,e.y,e.z]))],spatialReference:i})}))}function J(e){const{xmin:t,xmax:a,ymin:r,ymax:i,spatialReference:s}=e;return[new n({x:t,y:i,spatialReference:s}),new n({x:a,y:i,spatialReference:s}),new n({x:a,y:r,spatialReference:s}),new n({x:t,y:r,spatialReference:s})]}async function N(e,t,a,r,i,s,o){const{feature:{attributes:c}}=o;let f=Math.abs(e.x-t.x)+Math.abs(e.y-t.y);if(f>1)for(let y=0;y<9;y++)if(f>1){let t,l={x:e.x-f,y:e.y-f,z:1},x={x:e.x+f,y:e.y-f,z:1},z={x:e.x+f,y:e.y+f,z:1},m={x:e.x-f,y:e.y+f,z:1};l=H(l,a[0],a[1],a[2],a[3],{x:r[0].x,y:r[0].y,z:r[0].z},{x:r[1].x,y:r[1].y,z:r[1].z},{x:r[2].x,y:r[2].y,z:r[2].z},{x:r[3].x,y:r[3].y,z:r[3].z}),x=H(x,a[0],a[1],a[2],a[3],{x:r[0].x,y:r[0].y,z:r[0].z},{x:r[1].x,y:r[1].y,z:r[1].z},{x:r[2].x,y:r[2].y,z:r[2].z},{x:r[3].x,y:r[3].y,z:r[3].z}),z=H(z,a[0],a[1],a[2],a[3],{x:r[0].x,y:r[0].y,z:r[0].z},{x:r[1].x,y:r[1].y,z:r[1].z},{x:r[2].x,y:r[2].y,z:r[2].z},{x:r[3].x,y:r[3].y,z:r[3].z}),m=H(m,a[0],a[1],a[2],a[3],{x:r[0].x,y:r[0].y,z:r[0].z},{x:r[1].x,y:r[1].y,z:r[1].z},{x:r[2].x,y:r[2].y,z:r[2].z},{x:r[3].x,y:r[3].y,z:r[3].z}),l.spatialReference=i.spatialReference,x.spatialReference=i.spatialReference,z.spatialReference=i.spatialReference,m.spatialReference=i.spatialReference,t=4===c.cameraOrientation?.type?await u([p(new n(l)),p(new n(x)),p(new n(z)),p(new n(m))],o,!0):await u([new n(l),new n(x),new n(z),new n(m)],o,!0);const h=await Promise.all(t);h.forEach((e=>{e.z=0}));const w=H(e,h[0],h[1],h[2],h[3],l,x,z,m);let R;if(R=4===c.cameraOrientation?.type?(await u([p(new n({x:w.x,y:w.y,z:w.z,spatialReference:i.spatialReference}))],o,!0))[0]:(await u([new n({x:w.x,y:w.y,z:w.z,spatialReference:i.spatialReference})],o,!0))[0],f=Math.abs(e.x-R.x)+Math.abs(e.y-R.y),f<=1||8===y){s=w;break}}return{error:f,point:s}}function Z(e,t,a){const r={x:e.rings[0][0][0],y:e.rings[0][0][1],z:e.rings[0][0][2]},i={x:e.rings[0][1][0],y:e.rings[0][1][1],z:e.rings[0][1][2]},n={x:e.rings[0][1][0],y:e.rings[0][1][1],z:e.rings[0][1][2]},s={x:e.rings[0][2][0],y:e.rings[0][2][1],z:e.rings[0][2][2]},o=(s.z-n.z)*(i.y-r.y)-(s.y-n.y)*(i.z-r.z),c=-((s.z-n.z)*(i.x-r.x)-(i.z-r.z)*(s.x-n.x)),f=(s.y-n.y)*(i.x-r.x)-(i.y-r.y)*(s.x-n.x),y=-(o*r.x+c*r.y+f*r.z);return S(t.toJSON(),a,o,c,f,y)}export{k as transformPoints};
5
+ import"../../../geometry.js";import{deg2rad as e}from"../../../core/mathUtils.js";import{zeros as t,create as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{z as r,g as i}from"../../../chunks/vec32.js";import n from"../../../geometry/Point.js";import{initializeProjection as s,project as o}from"../../../geometry/projection.js";import{fromPoints as c,fromValues as f}from"../../../geometry/support/ray.js";import{k as y,i as l}from"../../../chunks/sphere.js";import{geographicToWebMercator as x,webMercatorToGeographic as p}from"../../../geometry/support/webMercatorUtils.js";import{createCoveragePolygon as z}from"../core/coverageUtils.js";import m from"../core/ExposurePoint.js";import{transformPoints as u,updateElevation as h}from"./groundToImageUtils.js";import{getWebMercatorScalingFactor as w,convertPixelToHeadingPitch as R,convertHeadingPitchToSphereVertex as g,scaleAndAddWithFactor as d,ltpToGeographic as b,computeHFOVAndVFOV as P,projectiveTransform2 as M,scaleWithFactor as j,calculateRotationMatrix as O,transformMat3 as v,projectiveTransform as H,getPlaneLineIntersectionPoint as S}from"./utils.js";import{defaultImageSphereCenter as E}from"../../../widgets/PanoramicViewer/constants.js";import{isNumber as V}from"../../../widgets/support/dataUtils.js";import k from"../../../geometry/SpatialReference.js";import F from"../../../geometry/Polygon.js";function U(e,t){if(!e)return Promise.resolve([]);const a=t.feature;let r=a.attributes;return r instanceof m||(r=m.fromJSON(a),r&&(a.attributes=r)),D(e,t)}function D(e,t){const{attributes:a}=t.feature;if(a.isSpherical||360===a.horizontalFieldOfView){const{location:r,cameraOrientation:i,farDistance:n,cameraHeading:s,cameraHeight:o}=a;return G(e,r,n,[t.imageProperties.width,t.imageProperties.height],s,o,i)}return W(e,t)}async function G(e,t,r,i,s,o,p){let z=new n(t);const m=w(z);z.spatialReference.isGeographic&&z.spatialReference.isWGS84&&4!==p?.type&&(z=x(z));const u=new Array,[h,b,P]=z.toArray(),M=y([h,b,P??0],r/m),j=E.toArray();for(const y of e){let e,t;if(V(y.heading)&&V(y.pitch))e=y.heading,t=y.pitch;else{const a=R({x:y.x,y:y.y},i[0],i[1]);e=a.heading,t=a.pitch}e=(e+s)%360;const r=c([j[0],j[1],j[2]],g(e,t)),x=f([h,b,P??0],r.direction),p=a();l(M,x,p);const w=(z.z??0)-o;if(p[2]<w){const e=Math.abs((z.z-w)/-r.direction[2])*m;d([z.x,z.y,z.z],r.direction,e,m,p)}else p[2]=w;u.push(new n(p,z.spatialReference))}return u}async function W(e,t){const{feature:a}=t,{attributes:r}=a;let i=new n(r.location);if(4===r.cameraOrientation?.type){const e=r.cameraOrientation;i=new n(b(i,[e.latitude,e.longitude,e.ellipsoidRadius,e.squaredEccentricity]))}let c=!1;i.spatialReference.isWGS84&&(c=!0,i=x(i));const f=i.spatialReference.isWebMercator?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*i.y/6378137))):1,y=A(t,i,f),l=4===r.cameraOrientation?.type?y.map((e=>p(new n(e)))):y,z=await u(l,t,!0),m=await Promise.all(z);m.forEach((e=>{e.z=1}));const w=P(r.horizontalFieldOfView,r.verticalFieldOfView,r.cameraRoll??0).vfov;return Promise.all(e.map((async e=>{e.z=1;let a,y=M(e,m,l);if(a=4===r.cameraOrientation?.type?(await u([p(new n({...y,spatialReference:i.spatialReference}))],t,!0))[0]:(await u([new n({...y,spatialReference:i.spatialReference})],t,!0))[0],!a)return null;let x,z=Math.abs(e.x-a.x)+Math.abs(e.y-a.y);if(z>1){const r=await N(e,a,m,l,i,y,t);y=r.point,z=r.error}if(r.elevationSource){await s(i.spatialReference,t.footprintExtent.spatialReference,null,t.options);let a=await I(t);if(a?.extent){let s=Z(a,i,y);if(!s)return null;const l={x:s.x,y:s.y,z:s.z,hasZ:!0,spatialReference:i.spatialReference},z=new n(l);if(s){const l=o(z,t.footprintExtent.spatialReference),m=h([l],t,!1);let R;R=m instanceof Promise?await m:m,z.z=s.z=R[0].z;const g=await u([4===r.cameraOrientation?.type?p(z):z],t);if(!g[0])return null;let d=Math.abs(e.x-g[0].x)+Math.abs(e.y-g[0].y);if(x=s.z,d>1){let l=0;const z=async m=>{if(d>1){const R=m.width/10,g=m.height/10;if(!m||R<1||g<1)return y=q(y,i,f,x,r.cameraPitch,w,c),y;const b=[{x:s.x-R,y:s.y-g,spatialReference:i.spatialReference},{x:s.x+R,y:s.y-g,spatialReference:i.spatialReference},{x:s.x+R,y:s.y+g,spatialReference:i.spatialReference},{x:s.x-R,y:s.y+g,spatialReference:i.spatialReference}].map((e=>new n(e))),P=await h(b,t,!1);if(a=new F({rings:[[[P[0].x,P[0].y,P[0].z],[P[1].x,P[1].y,P[1].z],[P[2].x,P[2].y,P[2].z],[P[3].x,P[3].y,P[3].z],[P[0].x,P[0].y,P[0].z]]],spatialReference:i.spatialReference}),s=Z(a,i,y),s){const m=o(new n({x:s.x,y:s.y,z:s.z,spatialReference:i.spatialReference}),t.footprintExtent.spatialReference),h=await u([4===r.cameraOrientation?.type?p(m):m],t);if(h[0])return d=Math.abs(e.x-h[0].x)+Math.abs(e.y-h[0].y),x=s.z,d<=1||8===l?q(y,i,f,x,r.cameraPitch,w,c):(l+=1,z(a.extent))}return q(y,i,f,i.z-r.cameraHeight,r.cameraPitch,w,c)}return q(y,i,f,i.z-r.cameraHeight,r.cameraPitch,w,c)};return z(a.extent)}return q(y,i,f,i.z-r.cameraHeight,r.cameraPitch,w,c)}return q(y,i,f,i.z-r.cameraHeight,r.cameraPitch,w,c)}}return q(y,i,f,i.z-r.cameraHeight,r.cameraPitch,w,c)})))}function q(e,a,i,s,o,c,f){const y=Math.sqrt((e.z-a.z)**2+(Math.sqrt((e.x-a.x)**2+(e.y-a.y)**2)/i)**2)*i,l=j(r(t(),[e.x,e.y,e.z],[a.x,a.y,a.z]),1/y,1/i);if(e.z<s||o+c/2<90){const t=Math.abs((a.z-s)/-l[2])*i,r=d([a.x,a.y,a.z],l,t,i);e={x:r[0],y:r[1],z:r[2]}}else e.z=s;return e.spatialReference=a.spatialReference,e=new n(e),f&&(e=p(e)),e}function A(a,s,o){const{feature:c}=a,{attributes:f}=c,y=2*Math.tan(e(f.verticalFieldOfView)/2)*f.farDistance*o,l=2*Math.tan(e(f.horizontalFieldOfView)/2)*f.farDistance*o,x=O("HPR",[f.cameraHeading,f.cameraPitch,f.cameraRoll??0]),p=v([0,0,-1],x),z=d([s.x,s.y,s.z],p,f.farDistance*o,o),m=v([0,1,0],x),u=v([1,0,0],x),h=j(m,y/2,o),w=j(u,l/2,o),R=r(t(),h,w),g=i(t(),h,w);return[i(t(),z,R),i(t(),z,g),r(t(),z,R),r(t(),z,g)].map((e=>{const[t,a,r]=e;return new n({x:t,y:a,z:r,spatialReference:s.spatialReference})}))}function I(e){const{feature:t}=e,{polygon:a}=z(e.feature);if(!a.extent)return Promise.resolve(null);const r=J(a.extent),i=t.attributes.location.spatialReference.isWGS84?new k({wkid:102100}):t.attributes.location.spatialReference;return h(r,e,!1).then((e=>{const t=e.map((e=>o(e,i)));return new F({hasZ:!0,rings:[t.map((e=>[e.x,e.y,e.z]))],spatialReference:i})}))}function J(e){const{xmin:t,xmax:a,ymin:r,ymax:i,spatialReference:s}=e;return[new n({x:t,y:i,spatialReference:s}),new n({x:a,y:i,spatialReference:s}),new n({x:a,y:r,spatialReference:s}),new n({x:t,y:r,spatialReference:s})]}async function N(e,t,a,r,i,s,o){const{feature:{attributes:c}}=o;let f=Math.abs(e.x-t.x)+Math.abs(e.y-t.y);if(f>1)for(let y=0;y<9;y++)if(f>1){let t,l={x:e.x-f,y:e.y-f,z:1},x={x:e.x+f,y:e.y-f,z:1},z={x:e.x+f,y:e.y+f,z:1},m={x:e.x-f,y:e.y+f,z:1};l=H(l,a[0],a[1],a[2],a[3],{x:r[0].x,y:r[0].y,z:r[0].z},{x:r[1].x,y:r[1].y,z:r[1].z},{x:r[2].x,y:r[2].y,z:r[2].z},{x:r[3].x,y:r[3].y,z:r[3].z}),x=H(x,a[0],a[1],a[2],a[3],{x:r[0].x,y:r[0].y,z:r[0].z},{x:r[1].x,y:r[1].y,z:r[1].z},{x:r[2].x,y:r[2].y,z:r[2].z},{x:r[3].x,y:r[3].y,z:r[3].z}),z=H(z,a[0],a[1],a[2],a[3],{x:r[0].x,y:r[0].y,z:r[0].z},{x:r[1].x,y:r[1].y,z:r[1].z},{x:r[2].x,y:r[2].y,z:r[2].z},{x:r[3].x,y:r[3].y,z:r[3].z}),m=H(m,a[0],a[1],a[2],a[3],{x:r[0].x,y:r[0].y,z:r[0].z},{x:r[1].x,y:r[1].y,z:r[1].z},{x:r[2].x,y:r[2].y,z:r[2].z},{x:r[3].x,y:r[3].y,z:r[3].z}),l.spatialReference=i.spatialReference,x.spatialReference=i.spatialReference,z.spatialReference=i.spatialReference,m.spatialReference=i.spatialReference,t=4===c.cameraOrientation?.type?await u([p(new n(l)),p(new n(x)),p(new n(z)),p(new n(m))],o,!0):await u([new n(l),new n(x),new n(z),new n(m)],o,!0);const h=await Promise.all(t);h.forEach((e=>{e.z=0}));const w=H(e,h[0],h[1],h[2],h[3],l,x,z,m);let R;if(R=4===c.cameraOrientation?.type?(await u([p(new n({x:w.x,y:w.y,z:w.z,spatialReference:i.spatialReference}))],o,!0))[0]:(await u([new n({x:w.x,y:w.y,z:w.z,spatialReference:i.spatialReference})],o,!0))[0],f=Math.abs(e.x-R.x)+Math.abs(e.y-R.y),f<=1||8===y){s=w;break}}return{error:f,point:s}}function Z(e,t,a){const r={x:e.rings[0][0][0],y:e.rings[0][0][1],z:e.rings[0][0][2]},i={x:e.rings[0][1][0],y:e.rings[0][1][1],z:e.rings[0][1][2]},n={x:e.rings[0][1][0],y:e.rings[0][1][1],z:e.rings[0][1][2]},s={x:e.rings[0][2][0],y:e.rings[0][2][1],z:e.rings[0][2][2]},o=(s.z-n.z)*(i.y-r.y)-(s.y-n.y)*(i.z-r.z),c=-((s.z-n.z)*(i.x-r.x)-(i.z-r.z)*(s.x-n.x)),f=(s.y-n.y)*(i.x-r.x)-(i.y-r.y)*(s.x-n.x),y=-(o*r.x+c*r.y+f*r.z);return S(t.toJSON(),a,o,c,f,y)}export{U as transformPoints};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../PopupTemplate.js";import r from"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import"../../renderers/PieChartRenderer.js";import i from"../../renderers/Renderer.js";import o from"../../renderers/SimpleRenderer.js";import n from"../../renderers/UniqueValueRenderer.js";import"../../renderers/support/jsonUtils.js";import s from"../../core/Logger.js";import{ClonableMixin as l}from"../../core/Clonable.js";import"../../core/has.js";import a from"../../core/Error.js";import{IdentifiableMixin as p}from"../../core/Identifiable.js";import{clone as d}from"../../core/lang.js";import u from"../../core/Loadable.js";import{MultiOriginJSONMixin as y}from"../../core/MultiOriginJSONSupport.js";import{setDeepValue as c}from"../../core/object.js";import{sqlAnd as m}from"../../core/sql.js";import{property as f}from"../../core/accessorSupport/decorators/property.js";import{reader as b}from"../../core/accessorSupport/decorators/reader.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{writer as g}from"../../core/accessorSupport/decorators/writer.js";import{createTypeReader as v}from"../../core/accessorSupport/extensions/serializableProperty/reader.js";import j from"../../form/FormTemplate.js";import{labelsVisible as w,legendEnabled as O,minScale as F,maxScale as I,popupEnabled as S}from"./commonProperties.js";import{createQuery as T}from"./featureLayerUtils.js";import E from"./FeatureTemplate.js";import{defineFieldProperties as C}from"./fieldProperties.js";import{fixRendererFields as A}from"./fieldUtils.js";import x from"./LabelClass.js";import{reader as R}from"./labelingInfo.js";import P from"../../rest/support/Query.js";import{createPopupTemplate as D}from"../../support/popupUtils.js";import{defaultPolygonSymbol2D as L,defaultPolylineSymbol2D as q,defaultPointSymbol2D as V}from"../../symbols/support/defaults.js";const G={key:"type",base:i,errorContext:"renderer",typeMap:{simple:o,"unique-value":n,"class-breaks":r}},N=C(),U=v({types:G});let $=0;function k(e){const t=e.json.write;return"object"==typeof t?t.ignoreOrigin=!0:e.json.write={ignoreOrigin:!0},e}function M(e){return new o({symbol:_(e)})}function _(e){switch(e){case"point":case"multipoint":return V.clone();case"polyline":return q.clone();case"polygon":case"multipatch":return L.clone();default:return null}}function B(e,t){return!!t&&("unique-value"===e?.type&&"string"==typeof e.field&&e.field.toLowerCase()===t.toLowerCase()&&!e.field2&&!e.field3&&!e.valueExpression)}function H(e,t){return null==e?null:t.subtypes?.find((t=>t.code===e))}function Q(e,t){let r=null;switch(t.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":r="point";break;case"esriGeometryPolyline":r="line";break;case"esriGeometryPolygon":case"esriGeometryMultiPatch":r="polygon";break;default:t.type,r=null}const i={},o=H(e,t);if(null!=o){const{defaultValues:e}=o;for(const t in e)i[t]=e[t]}return i[t.subtypeField]=e,new E({name:"New Feature",drawingTool:r,prototype:{attributes:i}})}const z="esri.layers.support.SubtypeSublayer";let J=class extends(y(l(p(u)))){constructor(e){super(e),this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${$++}`,this.type="subtype-sublayer",this.labelsVisible=!0,this.labelingInfo=null,this.layerType="ArcGISFeatureLayer",this.legendEnabled=!0,this.listMode="show",this.minScale=0,this.maxScale=0,this.opacity=1,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}get capabilities(){return this.parent?.capabilities}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get effectiveEditingEnabled(){const{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){return this.parent?.elevationInfo}writeFieldOverrides(e,t,r){const{fields:i,parent:o}=this;let n;if(i){n=[];let e=0;i.forEach((({name:t,alias:r,editable:i,visible:s})=>{if(!s)return;const l=o?.fields?.find((e=>e.name===t));if(!l)return;const a={name:t};let p=!1;r!==l.alias&&(a.alias=r,p=!0),i!==l.editable&&(a.editable=i,p=!0),n.push(a),p&&e++})),0===e&&n.length===i.length&&(n=null)}else n=d(e);n?.length&&c(r,n,t)}get fields(){const{parent:e,fieldOverrides:t,subtypeCode:r}=this,i=e?.fields;if(!e||!i?.length)return null;const{subtypes:o,subtypeField:n}=e,s=o?.find((e=>e.code===r)),l=s?.defaultValues,a=s?.domains,p=[];for(const d of i){const e=d.clone(),{name:i}=e,o=t?.find((e=>e.name===i));if(e.visible=!t||!!o,o){const{alias:t,editable:r}=o;t&&(e.alias=t),!1===r&&(e.editable=!1)}const s=l?.[i]??null;e.defaultValue=i===n?r:s;const u=a?.[i]??null;e.domain=i===n?null:u?"inherited"===u.type?e.domain:u.clone():null,p.push(e)}return p}get floorInfo(){return this.parent?.floorInfo}get geometryType(){return this.parent?.geometryType}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){return this.parent||s.getLogger(z).error(W("objectIdField")),this.parent?.objectIdField}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){A(e,this.fieldsIndex),this._override("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const{parent:e}=this;return e&&!e.isTable&&"mesh"!==e.geometryType?M(e.geometryType):null}readRendererFromService(e,t,r){if("Table"===t.type)return null;const i=t.drawingInfo?.renderer,n=U(i,t,r);let s;const{subtypeCode:l}=this;if(null!=l&&B(n,t.subtypeField)){const e=n.uniqueValueInfos?.find((({value:e})=>(e="number"==typeof e?String(e):e)===String(l)));e&&(s=new o({symbol:e.symbol}))}else"simple"!==n?.type||n.visualVariables?.length||(s=n);return s}readRenderer(e,t,r){const i=t?.layerDefinition?.drawingInfo?.renderer;if(!i)return;const o=i.visualVariables?.some((e=>"rotationInfo"!==e.type));return o?void 0:U(i,t,r)||void 0}get spatialReference(){return this.parent?.spatialReference}get subtypeField(){return this.parent?.subtypeField}readTemplatesFromService(e,t){return[Q(this.subtypeCode,t)]}readTitleFromService(e,t){const r=H(this.subtypeCode,t);return null!=r?r.name:null}get url(){return this.parent?.url}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}async addAttachment(e,t){const{parent:r}=this;if(!r)throw W("addAttachment");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new a("subtype-sublayer:addAttachment","The feature provided does not belong to this SubtypeSublayer");return r.addAttachment(e,t)}async updateAttachment(e,t,r){const{parent:i}=this;if(!i)throw W("updateAttachment");if(e.getAttribute(i.subtypeField)!==this.subtypeCode)throw new a("subtype-sublayer:updateAttachment","The feature provided does not belong to this SubtypeSublayer");return i.updateAttachment(e,t,r)}async deleteAttachments(e,t){const{parent:r}=this;if(!r)throw W("deleteAttachments");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new a("subtype-sublayer:deleteAttachments","The feature provided does not belong to this SubtypeSublayer");return r.deleteAttachments(e,t)}async applyEdits(e,t){if(!this.parent)throw W("applyEdits");return this.parent.applyEdits(e,t)}createPopupTemplate(e){let t=this;const{parent:r,fields:i,title:o}=this;if(r){const{displayField:e,editFieldsInfo:n,objectIdField:s}=r;t={displayField:e,editFieldsInfo:n,fields:i,objectIdField:s,title:o}}return D(t,e)}createQuery(){if(!this.parent)throw W("createQuery");const e=T(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=m(t,this.parent.definitionExpression),e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e){return this._getLayerDomain(e)}async queryAttachments(e,t){const r=await this.load();if(!r.parent)throw W("queryAttachments");const i=e.clone();return i.where=K(i.where,r.parent.subtypeField,r.subtypeCode),r.parent.queryAttachments(e,t)}async queryFeatures(e,t){const r=await this.load();if(!r.parent)throw W("queryFeatures");const i=P.from(e)??r.createQuery();return null!=e&&(i.where=K(i.where,r.parent.subtypeField,r.subtypeCode)),r.parent.queryFeatures(i,t)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};e([f({readOnly:!0,json:{read:!1}})],J.prototype,"capabilities",null),e([f({readOnly:!0,json:{read:!1}})],J.prototype,"effectiveCapabilities",null),e([f({json:{write:{ignoreOrigin:!0}}})],J.prototype,"charts",void 0),e([f({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:{ignoreOrigin:!0}}})],J.prototype,"editingEnabled",void 0),e([f({type:Boolean,readOnly:!0})],J.prototype,"effectiveEditingEnabled",null),e([f({readOnly:!0,json:{read:!1}})],J.prototype,"elevationInfo",null),e([f({json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],J.prototype,"fieldOverrides",void 0),e([g("fieldOverrides")],J.prototype,"writeFieldOverrides",null),e([f({...N.fields,readOnly:!0,json:{read:!1}})],J.prototype,"fields",null),e([f(N.fieldsIndex)],J.prototype,"fieldsIndex",void 0),e([f({readOnly:!0,json:{read:!1}})],J.prototype,"floorInfo",null),e([f({type:j,json:{name:"formInfo",write:{ignoreOrigin:!0}}})],J.prototype,"formTemplate",void 0),e([f({type:String,clonable:!1,readOnly:!0,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],J.prototype,"id",void 0),e([f({readOnly:!0,json:{read:!1}})],J.prototype,"geometryType",null),e([f({readOnly:!0,json:{read:!1}})],J.prototype,"type",void 0),e([f(k(d(w)))],J.prototype,"labelsVisible",void 0),e([f({type:[x],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:R},write:{ignoreOrigin:!0}}})],J.prototype,"labelingInfo",void 0),e([f({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],J.prototype,"layerType",void 0),e([f(k(d(O)))],J.prototype,"legendEnabled",void 0),e([f({type:["show","hide"]})],J.prototype,"listMode",void 0),e([f((()=>{const e=d(F);return e.json.origins.service.read=!1,k(e)})())],J.prototype,"minScale",void 0),e([f((()=>{const e=d(I);return e.json.origins.service.read=!1,k(e)})())],J.prototype,"maxScale",void 0),e([f({readOnly:!0})],J.prototype,"effectiveScaleRange",null),e([f({readOnly:!0,json:{read:!1}})],J.prototype,"objectIdField",null),e([f({type:Number,range:{min:0,max:1},nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],J.prototype,"opacity",void 0),e([f({clonable:!1})],J.prototype,"parent",void 0),e([f(k(d(S)))],J.prototype,"popupEnabled",void 0),e([f({type:t,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],J.prototype,"popupTemplate",void 0),e([f({readOnly:!0})],J.prototype,"defaultPopupTemplate",null),e([f({types:G,json:{write:{target:"layerDefinition.drawingInfo.renderer",ignoreOrigin:!0}}})],J.prototype,"renderer",null),e([b("service","renderer",["drawingInfo.renderer","subtypeField","type"])],J.prototype,"readRendererFromService",null),e([b("renderer",["layerDefinition.drawingInfo.renderer"])],J.prototype,"readRenderer",null),e([f({readOnly:!0,json:{read:!1}})],J.prototype,"spatialReference",null),e([f({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],J.prototype,"subtypeCode",void 0),e([f({readOnly:!0,json:{read:!1}})],J.prototype,"subtypeField",null),e([f({type:[E],json:{name:"layerDefinition.templates",write:{ignoreOrigin:!0}}})],J.prototype,"templates",void 0),e([b("service","templates",["geometryType","subtypeField","subtypes","type"])],J.prototype,"readTemplatesFromService",null),e([f({type:String,json:{write:{ignoreOrigin:!0}}})],J.prototype,"title",void 0),e([b("service","title",["subtypes"])],J.prototype,"readTitleFromService",null),e([f({readOnly:!0,json:{read:!1}})],J.prototype,"url",null),e([f({readOnly:!0})],J.prototype,"userHasUpdateItemPrivileges",null),e([f({type:Boolean,nonNullable:!0,json:{name:"visibility",write:{ignoreOrigin:!0}}})],J.prototype,"visible",void 0),J=e([h(z)],J);const K=(e,t,r)=>{const i=new RegExp(`${t}\\s*=\\s*\\d+`),o=`${t}=${r}`,n=e??"";return i.test(n)?n.replace(i,o):m(o,n)},W=e=>new a(`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`),X=J;export{X as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../PopupTemplate.js";import r from"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import"../../renderers/PieChartRenderer.js";import i from"../../renderers/Renderer.js";import o from"../../renderers/SimpleRenderer.js";import n from"../../renderers/UniqueValueRenderer.js";import"../../renderers/support/jsonUtils.js";import s from"../../core/Logger.js";import{ClonableMixin as l}from"../../core/Clonable.js";import"../../core/has.js";import a from"../../core/Error.js";import{IdentifiableMixin as p}from"../../core/Identifiable.js";import{clone as d}from"../../core/lang.js";import u from"../../core/Loadable.js";import{MultiOriginJSONMixin as y}from"../../core/MultiOriginJSONSupport.js";import{setDeepValue as c}from"../../core/object.js";import{sqlAnd as m}from"../../core/sql.js";import{property as f}from"../../core/accessorSupport/decorators/property.js";import{reader as h}from"../../core/accessorSupport/decorators/reader.js";import{subclass as b}from"../../core/accessorSupport/decorators/subclass.js";import{writer as g}from"../../core/accessorSupport/decorators/writer.js";import{createTypeReader as v}from"../../core/accessorSupport/extensions/serializableProperty/reader.js";import j from"../../form/FormTemplate.js";import{labelsVisible as w,legendEnabled as O,minScale as F,maxScale as I,popupEnabled as S}from"./commonProperties.js";import{createQuery as T}from"./featureLayerUtils.js";import E from"./FeatureTemplate.js";import{defineFieldProperties as C}from"./fieldProperties.js";import{fixRendererFields as A}from"./fieldUtils.js";import x from"./LabelClass.js";import{reader as R}from"./labelingInfo.js";import P from"../../rest/support/Query.js";import{createPopupTemplate as D}from"../../support/popupUtils.js";import{defaultPolygonSymbol2D as L,defaultPolylineSymbol2D as q,defaultPointSymbol2D as V}from"../../symbols/support/defaults.js";const G={key:"type",base:i,errorContext:"renderer",typeMap:{simple:o,"unique-value":n,"class-breaks":r}},N=C(),U=v({types:G});let $=0;function k(e){const t=e.json.write;return"object"==typeof t?t.ignoreOrigin=!0:e.json.write={ignoreOrigin:!0},e}function M(e){return new o({symbol:_(e)})}function _(e){switch(e){case"point":case"multipoint":return V.clone();case"polyline":return q.clone();case"polygon":case"multipatch":return L.clone();default:return null}}function B(e,t){return!!t&&("unique-value"===e?.type&&"string"==typeof e.field&&e.field.toLowerCase()===t.toLowerCase()&&!e.field2&&!e.field3&&!e.valueExpression)}function H(e,t){return null==e?null:t.subtypes?.find((t=>t.code===e))}function Q(e,t){let r=null;switch(t.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":r="point";break;case"esriGeometryPolyline":r="line";break;case"esriGeometryPolygon":case"esriGeometryMultiPatch":r="polygon";break;default:t.type,r=null}const i={},o=H(e,t);if(null!=o){const{defaultValues:e}=o;for(const t in e)i[t]=e[t]}return i[t.subtypeField]=e,new E({name:"New Feature",drawingTool:r,prototype:{attributes:i}})}const z="esri.layers.support.SubtypeSublayer";let J=class extends(y(l(p(u)))){constructor(e){super(e),this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${$++}`,this.type="subtype-sublayer",this.labelsVisible=!0,this.labelingInfo=null,this.layerType="ArcGISFeatureLayer",this.legendEnabled=!0,this.listMode="show",this.minScale=0,this.maxScale=0,this.opacity=1,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}load(e){return A(this.renderer,this.fieldsIndex),Promise.resolve(this)}get capabilities(){return this.parent?.capabilities}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get effectiveEditingEnabled(){const{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){return this.parent?.elevationInfo}writeFieldOverrides(e,t,r){const{fields:i,parent:o}=this;let n;if(i){n=[];let e=0;i.forEach((({name:t,alias:r,editable:i,visible:s})=>{if(!s)return;const l=o?.fields?.find((e=>e.name===t));if(!l)return;const a={name:t};let p=!1;r!==l.alias&&(a.alias=r,p=!0),i!==l.editable&&(a.editable=i,p=!0),n.push(a),p&&e++})),0===e&&n.length===i.length&&(n=null)}else n=d(e);n?.length&&c(r,n,t)}get fields(){const{parent:e,fieldOverrides:t,subtypeCode:r}=this,i=e?.fields;if(!e||!i?.length)return null;const{subtypes:o,subtypeField:n}=e,s=o?.find((e=>e.code===r)),l=s?.defaultValues,a=s?.domains,p=[];for(const d of i){const e=d.clone(),{name:i}=e,o=t?.find((e=>e.name===i));if(e.visible=!t||!!o,o){const{alias:t,editable:r}=o;t&&(e.alias=t),!1===r&&(e.editable=!1)}const s=l?.[i]??null;e.defaultValue=i===n?r:s;const u=a?.[i]??null;e.domain=i===n?null:u?"inherited"===u.type?e.domain:u.clone():null,p.push(e)}return p}get floorInfo(){return this.parent?.floorInfo}get geometryType(){return this.parent?.geometryType}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){return this.parent||s.getLogger(z).error(W("objectIdField")),this.parent?.objectIdField}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){A(e,this.fieldsIndex),this._override("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const{parent:e}=this;return e&&!e.isTable&&"mesh"!==e.geometryType?M(e.geometryType):null}readRendererFromService(e,t,r){if("Table"===t.type)return null;const i=t.drawingInfo?.renderer,n=U(i,t,r);let s;const{subtypeCode:l}=this;if(null!=l&&B(n,t.subtypeField)){const e=n.uniqueValueInfos?.find((({value:e})=>(e="number"==typeof e?String(e):e)===String(l)));e&&(s=new o({symbol:e.symbol}))}else"simple"!==n?.type||n.visualVariables?.length||(s=n);return s}readRenderer(e,t,r){const i=t?.layerDefinition?.drawingInfo?.renderer;if(!i)return;const o=i.visualVariables?.some((e=>"rotationInfo"!==e.type));return o?void 0:U(i,t,r)||void 0}get spatialReference(){return this.parent?.spatialReference}get subtypeField(){return this.parent?.subtypeField}readTemplatesFromService(e,t){return[Q(this.subtypeCode,t)]}readTitleFromService(e,t){const r=H(this.subtypeCode,t);return null!=r?r.name:null}get url(){return this.parent?.url}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}async addAttachment(e,t){const{parent:r}=this;if(!r)throw W("addAttachment");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new a("subtype-sublayer:addAttachment","The feature provided does not belong to this SubtypeSublayer");return r.addAttachment(e,t)}async updateAttachment(e,t,r){const{parent:i}=this;if(!i)throw W("updateAttachment");if(e.getAttribute(i.subtypeField)!==this.subtypeCode)throw new a("subtype-sublayer:updateAttachment","The feature provided does not belong to this SubtypeSublayer");return i.updateAttachment(e,t,r)}async deleteAttachments(e,t){const{parent:r}=this;if(!r)throw W("deleteAttachments");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new a("subtype-sublayer:deleteAttachments","The feature provided does not belong to this SubtypeSublayer");return r.deleteAttachments(e,t)}async applyEdits(e,t){if(!this.parent)throw W("applyEdits");return this.parent.applyEdits(e,t)}createPopupTemplate(e){let t=this;const{parent:r,fields:i,title:o}=this;if(r){const{displayField:e,editFieldsInfo:n,objectIdField:s}=r;t={displayField:e,editFieldsInfo:n,fields:i,objectIdField:s,title:o}}return D(t,e)}createQuery(){if(!this.parent)throw W("createQuery");const e=T(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=m(t,this.parent.definitionExpression),e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e){return this._getLayerDomain(e)}async queryAttachments(e,t){const r=await this.load();if(!r.parent)throw W("queryAttachments");const i=e.clone();return i.where=K(i.where,r.parent.subtypeField,r.subtypeCode),r.parent.queryAttachments(e,t)}async queryFeatures(e,t){const r=await this.load();if(!r.parent)throw W("queryFeatures");const i=P.from(e)??r.createQuery();return null!=e&&(i.where=K(i.where,r.parent.subtypeField,r.subtypeCode)),r.parent.queryFeatures(i,t)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};e([f({readOnly:!0,json:{read:!1}})],J.prototype,"capabilities",null),e([f({readOnly:!0,json:{read:!1}})],J.prototype,"effectiveCapabilities",null),e([f({json:{write:{ignoreOrigin:!0}}})],J.prototype,"charts",void 0),e([f({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:{ignoreOrigin:!0}}})],J.prototype,"editingEnabled",void 0),e([f({type:Boolean,readOnly:!0})],J.prototype,"effectiveEditingEnabled",null),e([f({readOnly:!0,json:{read:!1}})],J.prototype,"elevationInfo",null),e([f({json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],J.prototype,"fieldOverrides",void 0),e([g("fieldOverrides")],J.prototype,"writeFieldOverrides",null),e([f({...N.fields,readOnly:!0,json:{read:!1}})],J.prototype,"fields",null),e([f(N.fieldsIndex)],J.prototype,"fieldsIndex",void 0),e([f({readOnly:!0,json:{read:!1}})],J.prototype,"floorInfo",null),e([f({type:j,json:{name:"formInfo",write:{ignoreOrigin:!0}}})],J.prototype,"formTemplate",void 0),e([f({type:String,clonable:!1,readOnly:!0,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],J.prototype,"id",void 0),e([f({readOnly:!0,json:{read:!1}})],J.prototype,"geometryType",null),e([f({readOnly:!0,json:{read:!1}})],J.prototype,"type",void 0),e([f(k(d(w)))],J.prototype,"labelsVisible",void 0),e([f({type:[x],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:R},write:{ignoreOrigin:!0}}})],J.prototype,"labelingInfo",void 0),e([f({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],J.prototype,"layerType",void 0),e([f(k(d(O)))],J.prototype,"legendEnabled",void 0),e([f({type:["show","hide"]})],J.prototype,"listMode",void 0),e([f((()=>{const e=d(F);return e.json.origins.service.read=!1,k(e)})())],J.prototype,"minScale",void 0),e([f((()=>{const e=d(I);return e.json.origins.service.read=!1,k(e)})())],J.prototype,"maxScale",void 0),e([f({readOnly:!0})],J.prototype,"effectiveScaleRange",null),e([f({readOnly:!0,json:{read:!1}})],J.prototype,"objectIdField",null),e([f({type:Number,range:{min:0,max:1},nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],J.prototype,"opacity",void 0),e([f({clonable:!1})],J.prototype,"parent",void 0),e([f(k(d(S)))],J.prototype,"popupEnabled",void 0),e([f({type:t,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],J.prototype,"popupTemplate",void 0),e([f({readOnly:!0})],J.prototype,"defaultPopupTemplate",null),e([f({types:G,json:{write:{target:"layerDefinition.drawingInfo.renderer",ignoreOrigin:!0}}})],J.prototype,"renderer",null),e([h("service","renderer",["drawingInfo.renderer","subtypeField","type"])],J.prototype,"readRendererFromService",null),e([h("renderer",["layerDefinition.drawingInfo.renderer"])],J.prototype,"readRenderer",null),e([f({readOnly:!0,json:{read:!1}})],J.prototype,"spatialReference",null),e([f({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],J.prototype,"subtypeCode",void 0),e([f({readOnly:!0,json:{read:!1}})],J.prototype,"subtypeField",null),e([f({type:[E],json:{name:"layerDefinition.templates",write:{ignoreOrigin:!0}}})],J.prototype,"templates",void 0),e([h("service","templates",["geometryType","subtypeField","subtypes","type"])],J.prototype,"readTemplatesFromService",null),e([f({type:String,json:{write:{ignoreOrigin:!0}}})],J.prototype,"title",void 0),e([h("service","title",["subtypes"])],J.prototype,"readTitleFromService",null),e([f({readOnly:!0,json:{read:!1}})],J.prototype,"url",null),e([f({readOnly:!0})],J.prototype,"userHasUpdateItemPrivileges",null),e([f({type:Boolean,nonNullable:!0,json:{name:"visibility",write:{ignoreOrigin:!0}}})],J.prototype,"visible",void 0),J=e([b(z)],J);const K=(e,t,r)=>{const i=new RegExp(`${t}\\s*=\\s*\\d+`),o=`${t}=${r}`,n=e??"";return i.test(n)?n.replace(i,o):m(o,n)},W=e=>new a(`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`),X=J;export{X 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.29/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{JSONSupport as i}from"../../core/JSONSupport.js";import s from"../../core/Logger.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";import{f as n,H as o,B as a,g as l}from"../../chunks/vec32.js";import{fromValues as p,fromArray as u}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../../geometry/Point.js";import c from"../../geometry/SpatialReference.js";import{equals as h}from"../../geometry/support/spatialReferenceUtils.js";import g from"./VoxelDimension.js";let d=class extends i{constructor(e){super(e),this.id=0,this.dimensions=null,this.spatialReference=c.WGS84}get zDimension(){if(!this.dimensions)return-1;if(!Array.isArray(this.dimensions))return-1;if(4!==this.dimensions.length)return-1;for(let e=2;e<4;++e)if(this.dimensions[e].size>0)return e;return-1}get isValid(){return!!this.dimensions&&(!!Array.isArray(this.dimensions)&&(4===this.dimensions.length&&(!(this.dimensions[0].size<1||this.dimensions[1].size<1)&&!(-1===this.zDimension||this.dimensions[this.zDimension].size<1))))}get originInLayerSpace3D(){if(!this.isValid||"xyt"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),s=this.dimensions[2],r=s.isRegular?s.getRange():[0,s.size];return[e[0],i[0],r[0]]}get voxelSizeInLayerSpaceSigned(){if(!this.isValid||"xyt"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),s=this.dimensions[2],r=s.isRegular?s.getRange():[0,s.size],t=[this.sizeInVoxels[0],this.sizeInVoxels[1],this.sizeInVoxels[2]];for(let n=0;n<3;++n)t[n]<2?t[n]=1:t[n]-=1;return s.isRegular&&!s.isPositiveUp&&(t[2]*=-1),[(e[1]-e[0])/t[0],(i[1]-i[0])/t[1],(r[1]-r[0])/t[2]]}get volumeType(){if(this.isValid){const e=this.dimensions[2].size>0,i=this.dimensions[3].size>0;if(!e&&i)return"xyt";if(e&&i)return"xyzt"}return"xyz"}get sizeInVoxels(){if(!this.isValid)return[0,0,0];const e=this.zDimension;return[this.dimensions[0].size,this.dimensions[1].size,this.dimensions[e].size]}computeVoxelSpaceLocation(e){if(!this.isValid)return[0,0,0];if("xyt"===this.volumeType)return s.getLogger(this).error("computeVoxelSpacePosition cannot be used with XYT volumes."),[0,0,0];if(!h(this.spatialReference,e.spatialReference))return s.getLogger(this).error("pos argument should have the same spatial reference as the VoxelLayer."),[0,0,0];const i=p(e.x,e.y,e.z??0);n(i,i,this.originInLayerSpace3D),o(i,i,this.voxelSizeInLayerSpaceSigned);const r=this.dimensions[this.zDimension];if(!r.isRegular&&Array.isArray(r.irregularSpacing?.values)&&r.irregularSpacing.values.length>1){const s=e.z??0,t=r.irregularSpacing.values,n=r.isPositiveUp?1:-1,o=t.reduce(((e,i)=>Math.abs(n*i-s)<Math.abs(n*e-s)?i:e));for(let e=0;e<t.length;++e)if(t[e]===o){i[2]=e;break}}return[i[0],i[1],i[2]]}computeLayerSpaceLocation(e){if(!this.isValid)return new m({x:0,y:0,spatialReference:this.spatialReference});const i=u(e);if(a(i,i,this.voxelSizeInLayerSpaceSigned),l(i,i,this.originInLayerSpace3D),"xyt"===this.volumeType)return new m({x:i[0],y:i[1],spatialReference:this.spatialReference});const s=this.dimensions[this.zDimension];return s.isRegular||Array.isArray(s.irregularSpacing?.values)&&(e[2]<0?i[2]=s.irregularSpacing.values[0]:e[2]<s.irregularSpacing.values.length?i[2]=s.irregularSpacing.values[e[2]]:i[2]=s.irregularSpacing.values[s.irregularSpacing.values.length-1],s.isPositiveUp||(i[2]*=-1)),new m({x:i[0],y:i[1],z:i[2],spatialReference:this.spatialReference})}};e([r({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"id",void 0),e([r({type:[g],json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"dimensions",void 0),e([r({type:c,json:{read:{enabled:!1}}})],d.prototype,"spatialReference",void 0),e([r({type:Number,json:{read:!1}})],d.prototype,"zDimension",null),e([r({type:[Boolean],json:{read:!1}})],d.prototype,"isValid",null),e([r({type:[Number],json:{read:!1}})],d.prototype,"originInLayerSpace3D",null),e([r({type:[Number],json:{read:!1}})],d.prototype,"voxelSizeInLayerSpaceSigned",null),e([r({type:["xyz","xyzt","xyt"],json:{read:{enabled:!1}}})],d.prototype,"volumeType",null),e([r({type:[Number],json:{read:!1}})],d.prototype,"sizeInVoxels",null),d=e([t("esri.layers.voxel.VoxelVolume")],d);const y=d;export{y as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{JSONSupport as i}from"../../core/JSONSupport.js";import s from"../../core/Logger.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";import{f as n,D as o,B as a,g as l}from"../../chunks/vec32.js";import{fromValues as p,fromArray as u}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../../geometry/Point.js";import c from"../../geometry/SpatialReference.js";import{equals as h}from"../../geometry/support/spatialReferenceUtils.js";import g from"./VoxelDimension.js";let d=class extends i{constructor(e){super(e),this.id=0,this.dimensions=null,this.spatialReference=c.WGS84}get zDimension(){if(!this.dimensions)return-1;if(!Array.isArray(this.dimensions))return-1;if(4!==this.dimensions.length)return-1;for(let e=2;e<4;++e)if(this.dimensions[e].size>0)return e;return-1}get isValid(){return!!this.dimensions&&(!!Array.isArray(this.dimensions)&&(4===this.dimensions.length&&(!(this.dimensions[0].size<1||this.dimensions[1].size<1)&&!(-1===this.zDimension||this.dimensions[this.zDimension].size<1))))}get originInLayerSpace3D(){if(!this.isValid||"xyt"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),s=this.dimensions[2],r=s.isRegular?s.getRange():[0,s.size];return[e[0],i[0],r[0]]}get voxelSizeInLayerSpaceSigned(){if(!this.isValid||"xyt"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),s=this.dimensions[2],r=s.isRegular?s.getRange():[0,s.size],t=[this.sizeInVoxels[0],this.sizeInVoxels[1],this.sizeInVoxels[2]];for(let n=0;n<3;++n)t[n]<2?t[n]=1:t[n]-=1;return s.isRegular&&!s.isPositiveUp&&(t[2]*=-1),[(e[1]-e[0])/t[0],(i[1]-i[0])/t[1],(r[1]-r[0])/t[2]]}get volumeType(){if(this.isValid){const e=this.dimensions[2].size>0,i=this.dimensions[3].size>0;if(!e&&i)return"xyt";if(e&&i)return"xyzt"}return"xyz"}get sizeInVoxels(){if(!this.isValid)return[0,0,0];const e=this.zDimension;return[this.dimensions[0].size,this.dimensions[1].size,this.dimensions[e].size]}computeVoxelSpaceLocation(e){if(!this.isValid)return[0,0,0];if("xyt"===this.volumeType)return s.getLogger(this).error("computeVoxelSpacePosition cannot be used with XYT volumes."),[0,0,0];if(!h(this.spatialReference,e.spatialReference))return s.getLogger(this).error("pos argument should have the same spatial reference as the VoxelLayer."),[0,0,0];const i=p(e.x,e.y,e.z??0);n(i,i,this.originInLayerSpace3D),o(i,i,this.voxelSizeInLayerSpaceSigned);const r=this.dimensions[this.zDimension];if(!r.isRegular&&Array.isArray(r.irregularSpacing?.values)&&r.irregularSpacing.values.length>1){const s=e.z??0,t=r.irregularSpacing.values,n=r.isPositiveUp?1:-1,o=t.reduce(((e,i)=>Math.abs(n*i-s)<Math.abs(n*e-s)?i:e));for(let e=0;e<t.length;++e)if(t[e]===o){i[2]=e;break}}return[i[0],i[1],i[2]]}computeLayerSpaceLocation(e){if(!this.isValid)return new m({x:0,y:0,spatialReference:this.spatialReference});const i=u(e);if(a(i,i,this.voxelSizeInLayerSpaceSigned),l(i,i,this.originInLayerSpace3D),"xyt"===this.volumeType)return new m({x:i[0],y:i[1],spatialReference:this.spatialReference});const s=this.dimensions[this.zDimension];return s.isRegular||Array.isArray(s.irregularSpacing?.values)&&(e[2]<0?i[2]=s.irregularSpacing.values[0]:e[2]<s.irregularSpacing.values.length?i[2]=s.irregularSpacing.values[e[2]]:i[2]=s.irregularSpacing.values[s.irregularSpacing.values.length-1],s.isPositiveUp||(i[2]*=-1)),new m({x:i[0],y:i[1],z:i[2],spatialReference:this.spatialReference})}};e([r({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"id",void 0),e([r({type:[g],json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"dimensions",void 0),e([r({type:c,json:{read:{enabled:!1}}})],d.prototype,"spatialReference",void 0),e([r({type:Number,json:{read:!1}})],d.prototype,"zDimension",null),e([r({type:[Boolean],json:{read:!1}})],d.prototype,"isValid",null),e([r({type:[Number],json:{read:!1}})],d.prototype,"originInLayerSpace3D",null),e([r({type:[Number],json:{read:!1}})],d.prototype,"voxelSizeInLayerSpaceSigned",null),e([r({type:["xyz","xyzt","xyt"],json:{read:{enabled:!1}}})],d.prototype,"volumeType",null),e([r({type:[Number],json:{read:!1}})],d.prototype,"sizeInVoxels",null),d=e([t("esri.layers.voxel.VoxelVolume")],d);const y=d;export{y as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.29.7",
3
+ "version": "4.29.9",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- const b="20240307",d="8edb474d2bd6a26e9cb72a83b1b1aaddd81bbf2a";export{b as buildDate,d as commitHash};
5
+ const c="20240320",a="c72966ca3c6dfcf112e49506485a47a1b3562602";export{c as buildDate,a as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import t from"../DisplayEntity.js";import e from"../DisplayRecord.js";import{VertexDataWriter as r}from"./VertexDataWriter.js";import i from"../util/Writer.js";class n{constructor(e,r=0){this._id=e,this._sizeHint=r,this._entityRecordCountOffset=0,this._entityCountOffset=0,this._entityIdIndex=0,this._entitySortKeyIndex=0,this._instanceIdToVertexData=new Map,this._current={metric:null,writer:null,start:0,sortKey:0,instanceId:0,layoutHash:0,indexStart:0,vertexStart:0,textureKey:0,metricBoxLenPointer:0},this._entities=new i(Uint32Array,this._sizeHint*t.byteSizeHint),this._entityCountOffset=this._entities.push(0)}get id(){return this._id}serialize(){const t=new Array,e=[],r=this._entities.buffer();for(const i of this._instanceIdToVertexData.values())e.push(i.serialize(t));return{message:{data:e,entities:r},transferList:t}}vertexCount(){return this._current.writer?.vertexCount??0}indexCount(){return this._current.writer?.indexCount??0}vertexEnsureSize(t){this._current.writer.vertexEnsureSize(t)}indexEnsureSize(t){this._current.writer.indexEnsureSize(t)}vertexWrite(t){this._current.writer.writeVertex(t)}vertexWriteRegion(t){this._current.writer.writeVertexRegion(t)}vertexWriteF32(t){this._current.writer.writeVertexF32(t)}recordBounds(t,e,r,i){}indexWrite(t){this._current.writer.writeIndex(t)}metricStart(t){this._current.metric=t}metricEnd(){const t=this._current.writer;this._current.metric.bounds.length&&t.writeMetric(this._current.metric)}metricBoxWrite(t){this._current.metric.bounds.push(t)}entityStart(t,e=t){this._entityIdIndex=this._entities.push(t),this._entitySortKeyIndex=this._entities.writeF32(e),this._entityRecordCountOffset=this._entities.push(0)}entityRecordCount(){return this._entities.getValue(this._entityRecordCountOffset)}entityEnd(){0===this.entityRecordCount()?this._entities.seek(this._entityIdIndex):this._entities.incr(this._entityCountOffset)}recordCount(){return this._entities.getValue(this._entityRecordCountOffset)}recordStart(t,e,r=0){this._current.writer=this._getVertexWriter(t,e),this._current.indexStart=this._current.writer.indexCount,this._current.vertexStart=this._current.writer.vertexCount,this._current.instanceId=t,this._current.layoutHash=e.hash,this._current.textureKey=r}recordEnd(t=0){const r=this._current.vertexStart,i=this._current.writer.vertexCount-r;if(!i)return!1;const n=this._current.indexStart,s=this._current.writer.indexCount-n;return this._entities.incr(this._entityRecordCountOffset),e.write(this._entities,this._current.instanceId,this._current.textureKey,n,s,r,i,t),!0}copyLastFrom(t,e,r){const i=t._entities.getValue(t._entityIdIndex);if(i!==this._entities.getValue(this._entityIdIndex)){const e=t._entities.getValueF32(t._entitySortKeyIndex);this.entityStart(i,e)}this.recordStart(t._current.instanceId,t._current.writer.layout,t._current.textureKey);const n=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,s=this._current.vertexStart,u=t._current.vertexStart-s,c=this._current.writer.indexWriter,h=this._current.writer.vertexWriter,o=t._current.writer.indexWriter,_=t._current.writer.vertexWriter;for(let f=t._current.indexStart;f!==o.length;f++){const t=o.getValue(f);c.push(t-u)}for(let f=t._current.vertexStart*n;f!==_.length;f++){const t=_.getValue(f);h.push(t)}const a=this._current.writer.layout.position,d=a.packPrecisionFactor??1,x=a.offset/Uint32Array.BYTES_PER_ELEMENT,y=e*d,w=r*d;for(let f=s*n;f<=h.length;f+=n)h.i1616Add(f+x,y,w);this.recordEnd()}_getVertexWriter(t,e){const{stride:i}=e,n=this._instanceIdToVertexData;return n.has(t)||n.set(t,new r(t,e,i,this._sizeHint)),n.get(t)}}export{n as MeshData};
5
+ import t from"../DisplayEntity.js";import e from"../DisplayRecord.js";import{VertexDataWriter as r}from"./VertexDataWriter.js";import i from"../util/Writer.js";class n{constructor(e,r=0){this._id=e,this._sizeHint=r,this._entityRecordCountOffset=0,this._entityCountOffset=0,this._entityIdIndex=0,this._entitySortKeyIndex=0,this._instanceIdToVertexData=new Map,this._recordIndexStart=0,this._recordIndexCount=0,this._recordVertexStart=0,this._recordVertexCount=0,this._current={metric:null,writer:null,start:0,sortKey:0,instanceId:0,layoutHash:0,indexStart:0,vertexStart:0,textureKey:0,metricBoxLenPointer:0},this._entities=new i(Uint32Array,this._sizeHint*t.byteSizeHint),this._entityCountOffset=this._entities.push(0)}get id(){return this._id}serialize(){const t=new Array,e=[],r=this._entities.buffer();for(const i of this._instanceIdToVertexData.values())e.push(i.serialize(t));return{message:{data:e,entities:r},transferList:t}}vertexCount(){return this._current.writer?.vertexCount??0}indexCount(){return this._current.writer?.indexCount??0}vertexEnsureSize(t){this._current.writer.vertexEnsureSize(t)}indexEnsureSize(t){this._current.writer.indexEnsureSize(t)}vertexWrite(t){this._current.writer.writeVertex(t)}vertexWriteRegion(t){this._current.writer.writeVertexRegion(t)}vertexWriteF32(t){this._current.writer.writeVertexF32(t)}recordBounds(t,e,r,i){}indexWrite(t){this._current.writer.writeIndex(t)}metricStart(t){this._current.metric=t}metricEnd(){const t=this._current.writer;this._current.metric.bounds.length&&t.writeMetric(this._current.metric)}metricBoxWrite(t){this._current.metric.bounds.push(t)}entityStart(t,e=t){this._entityIdIndex=this._entities.push(t),this._entitySortKeyIndex=this._entities.writeF32(e),this._entityRecordCountOffset=this._entities.push(0)}entityRecordCount(){return this._entities.getValue(this._entityRecordCountOffset)}entityEnd(){0===this.entityRecordCount()?this._entities.seek(this._entityIdIndex):this._entities.incr(this._entityCountOffset)}recordCount(){return this._entities.getValue(this._entityRecordCountOffset)}recordStart(t,e,r=0){this._current.writer=this._getVertexWriter(t,e),this._current.indexStart=this._current.writer.indexCount,this._current.vertexStart=this._current.writer.vertexCount,this._current.instanceId=t,this._current.layoutHash=e.hash,this._current.textureKey=r}recordEnd(t=0){const r=this._current.vertexStart,i=this._current.writer.vertexCount-r;if(!i)return!1;const n=this._current.indexStart,s=this._current.writer.indexCount-n;return this._recordIndexStart=n,this._recordIndexCount=s,this._recordVertexStart=r,this._recordVertexCount=i,this._entities.incr(this._entityRecordCountOffset),e.write(this._entities,this._current.instanceId,this._current.textureKey,n,s,r,i,t),!0}copyLast(t,r){const i=this._recordVertexStart+this._recordVertexCount;this._entities.incr(this._entityRecordCountOffset),e.write(this._entities,this._current.instanceId,this._current.textureKey,this._recordIndexStart+this._recordIndexCount,this._recordIndexCount,i,this._recordVertexCount,0);const n=this._current.writer.indexWriter,s=this._current.writer.vertexWriter,o=this._recordIndexStart+this._recordIndexCount,c=this._recordVertexCount;for(let e=this._recordIndexStart;e!==o;e++){const t=n.getValue(e);n.push(t+c)}const u=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,h=this._recordVertexStart*u,_=(this._recordVertexStart+this._recordVertexCount)*u;for(let e=h;e!==_;e++){const t=s.getValue(e);s.push(t)}const d=this._current.writer.layout.position,a=d.packPrecisionFactor??1,x=d.offset/Uint32Array.BYTES_PER_ELEMENT,y=t*a,f=r*a;for(let e=i*u;e<=s.length;e+=u)s.i1616Add(e+x,y,f);this.recordEnd()}copyLastFrom(t,e,r){const i=t._entities.getValue(t._entityIdIndex);if(i!==this._entities.getValue(this._entityIdIndex)){const e=t._entities.getValueF32(t._entitySortKeyIndex);this.entityStart(i,e)}this.recordStart(t._current.instanceId,t._current.writer.layout,t._current.textureKey);const n=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,s=this._current.vertexStart,o=t._current.vertexStart-s,c=this._current.writer.indexWriter,u=this._current.writer.vertexWriter,h=t._current.writer.indexWriter,_=t._current.writer.vertexWriter;for(let l=t._current.indexStart;l!==h.length;l++){const t=h.getValue(l);c.push(t-o)}for(let l=t._current.vertexStart*n;l!==_.length;l++){const t=_.getValue(l);u.push(t)}const d=this._current.writer.layout.position,a=d.packPrecisionFactor??1,x=d.offset/Uint32Array.BYTES_PER_ELEMENT,y=e*a,f=r*a;for(let l=s*n;l<=u.length;l+=n)u.i1616Add(l+x,y,f);this.recordEnd()}_getVertexWriter(t,e){const{stride:i}=e,n=this._instanceIdToVertexData;return n.has(t)||n.set(t,new r(t,e,i,this._sizeHint)),n.get(t)}}export{n as MeshData};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import"../../../tiling/TileInfoView.js";import e from"../../../tiling/TileKey.js";import"../../../tiling/TileQueue.js";import"../../../tiling/TileStrategy.js";import{tileSize as s}from"../definitions.js";import{MeshData as t}from"./MeshData.js";import{getPow2NeighborKey as r}from"../../../layers/features/support/tileUtils.js";const i=1,n=2,h=4,o=8,c=16,a=32,l=64,m=128;function u(e){switch(e){case i:case o:case a:return-1;case n:case l:return 0;case h:case c:case m:return 1}}function f(e){switch(e){case i:case n:case h:return-1;case o:case c:return 0;case a:case l:case m:return 1}}const _=i|o|a,d=h|c|m,p=i|n|h,g=a|l|m;class y{constructor(e,s,r=0){this.tileKey=e,this._bufferingEnabled=s,this._sizeHint=r,this._meshes={self:new t(this.id,this._sizeHint),neighbors:new Array},this._currentRecordOverlaps=0,this._currentEntityOverlaps=0}get id(){return this.tileKey}vertexCount(){return this._meshes.self.vertexCount()}indexCount(){return this._meshes.self.indexCount()}indexEnsureSize(e){this._meshes.self.indexEnsureSize(e)}entityStart(e,s=e){this._currentEntityOverlaps=0,this._meshes.self.entityStart(e,s)}entityRecordCount(){return this._meshes.self.entityRecordCount()}entityEnd(){if(this._meshes.self.entityEnd(),this._bufferingEnabled)for(let e=0;e<8;e++){const s=1<<e;!!(this._currentEntityOverlaps&s)&&this._meshes.neighbors[e].entityEnd()}}recordStart(e,s,t){this._currentRecordOverlaps=0,this._meshes.self.recordStart(e,s,t)}recordEnd(e=0){const s=this._meshes.self.recordEnd(this._currentRecordOverlaps);return s&&0!==this._currentRecordOverlaps?(this._copyIntoNeighbors(),this._currentEntityOverlaps|=this._currentRecordOverlaps,!0):s}recordBounds(e,s,t,r){this._bufferingEnabled&&this._addOverlap(e,s,t,r)}recordCount(){return this._meshes.self.recordCount()}metricStart(e){this._meshes.self.metricStart(e)}metricBoxWrite(e){this._meshes.self.metricBoxWrite(e)}metricEnd(){this._meshes.self.metricEnd()}vertexWrite(e){this._meshes.self.vertexWrite(e)}vertexWriteF32(e){this._meshes.self.vertexWriteF32(e)}vertexWriteRegion(e){this._meshes.self.vertexWriteRegion(e)}indexWrite(e){this._meshes.self.indexWrite(e)}serialize(s){const t={message:[],transferList:[]},i=this._meshes.self.serialize();return t.message.push({tileId:this.tileKey,...i.message}),t.transferList.push(...i.transferList),this._meshes.neighbors.forEach(((i,n)=>{const h=i.serialize(),o=1<<n,c=u(o),a=f(o),l=r(new e(this.tileKey),c,a,s);t.message.push({tileId:l.id,...h.message}),t.transferList.push(...h.transferList)})),t}_addOverlap(e,t,r,i){const n=Math.min(s/2,r),h=Math.min(s/2,i),o=255^((e<0+n?d:e>=s-n?_:d|_)|(t<0+h?g:t>=s-h?p:g|p));this._currentRecordOverlaps|=o}_copyIntoNeighbors(){for(let e=0;e<8;e++){const r=1<<e;if(!!(this._currentRecordOverlaps&r)){if(!this._meshes.neighbors[e]){const s=Math.floor(this._sizeHint/16);this._meshes.neighbors[e]=new t(r,s)}const i=this._meshes.neighbors[e],n=-u(r)*s,h=-f(r)*s;i.copyLastFrom(this._meshes.self,n,h)}}}}export{y as MultiTileMeshData};
5
+ import"../../../tiling/TileInfoView.js";import e from"../../../tiling/TileKey.js";import"../../../tiling/TileQueue.js";import"../../../tiling/TileStrategy.js";import{tileSize as s}from"../definitions.js";import{MeshData as t}from"./MeshData.js";import{getPow2NeighborKey as r}from"../../../layers/features/support/tileUtils.js";const i=1,n=2,h=4,o=8,c=16,a=32,l=64,f=128;function u(e){switch(e){case i:case o:case a:return-1;case n:case l:return 0;case h:case c:case f:return 1}}function m(e){switch(e){case i:case n:case h:return-1;case o:case c:return 0;case a:case l:case f:return 1}}const _=i|o|a,d=h|c|f,p=i|n|h,y=a|l|f;class g{constructor(e,s,r,i=0){this.tileKey=e,this._bufferingEnabled=s,this._sizeHint=i,this._meshes={self:new t(this.id,this._sizeHint),neighbors:new Array},this._currentRecordOverlaps=0,this._currentEntityOverlaps=0,this._copyBufferedDataIntoSelf=r&&this._bufferingEnabled&&0===e.level}get id(){return this.tileKey.id}vertexCount(){return this._meshes.self.vertexCount()}indexCount(){return this._meshes.self.indexCount()}indexEnsureSize(e){this._meshes.self.indexEnsureSize(e)}entityStart(e,s=e){this._currentEntityOverlaps=0,this._meshes.self.entityStart(e,s)}entityRecordCount(){return this._meshes.self.entityRecordCount()}entityEnd(){if(this._meshes.self.entityEnd(),this._bufferingEnabled){if(this._copyBufferedDataIntoSelf)return;for(let e=0;e<8;e++){const s=1<<e;!!(this._currentEntityOverlaps&s)&&this._meshes.neighbors[e].entityEnd()}}}recordStart(e,s,t){this._currentRecordOverlaps=0,this._meshes.self.recordStart(e,s,t)}recordEnd(e=0){const s=this._meshes.self.recordEnd(this._currentRecordOverlaps);return s&&0!==this._currentRecordOverlaps?(this._copyIntoNeighbors(),this._currentEntityOverlaps|=this._currentRecordOverlaps,!0):s}recordBounds(e,s,t,r){this._bufferingEnabled&&this._addOverlap(e,s,t,r)}recordCount(){return this._meshes.self.recordCount()}metricStart(e){this._meshes.self.metricStart(e)}metricBoxWrite(e){this._meshes.self.metricBoxWrite(e)}metricEnd(){this._meshes.self.metricEnd()}vertexWrite(e){this._meshes.self.vertexWrite(e)}vertexWriteF32(e){this._meshes.self.vertexWriteF32(e)}vertexWriteRegion(e){this._meshes.self.vertexWriteRegion(e)}indexWrite(e){this._meshes.self.indexWrite(e)}serialize(s){const t={message:[],transferList:[]},i=this._meshes.self.serialize();return t.message.push({tileId:this.tileKey.id,...i.message}),t.transferList.push(...i.transferList),this._meshes.neighbors.forEach(((i,n)=>{const h=i.serialize(),o=1<<n,c=u(o),a=m(o),l=r(new e(this.tileKey),c,a,s);t.message.push({tileId:l.id,...h.message}),t.transferList.push(...h.transferList)})),t}_addOverlap(e,t,r,i){const n=Math.min(s/2,r),h=Math.min(s/2,i),o=255^((e<0+n?d:e>=s-n?_:d|_)|(t<0+h?y:t>=s-h?p:y|p));this._currentRecordOverlaps|=o}_copyIntoNeighbors(){for(let e=0;e<8;e++){const r=1<<e;if(!!(this._currentRecordOverlaps&r)){if(this._copyBufferedDataIntoSelf){const e=-u(r)*s,t=-m(r)*s;this._meshes.self.copyLast(e,t);continue}if(!this._meshes.neighbors[e]){const s=Math.floor(this._sizeHint/16);this._meshes.neighbors[e]=new t(r,s)}const i=this._meshes.neighbors[e],n=-u(r)*s,h=-m(r)*s;i.copyLastFrom(this._meshes.self,n,h)}}}}export{g as MultiTileMeshData};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{memoize as e}from"../../../../../../../core/MapUtils.js";import{fromRotation as t}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as i}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{getXAnchorDirection as s,getYAnchorDirection as a}from"../../../alignmentUtils.js";import{getDisplayIdTexel as n}from"../../../DisplayId.js";import{LabelMetric as r}from"../../../collisions/LabelMetric.js";import{smoothPaths as o,pathDivide as l}from"../../../mesh/templates/segmentUtils.js";import{getMinMaxZoom as h,processColorInput as c}from"../fill/meshWriterUtils.js";import{TextMeshWriter as m,maxLabelZoom as d}from"../text/TextMeshWriter.js";const u=1,g=0,p=128,f=e((e=>{let t=0;if(0===e)return 1/0;for(;!(e%2);)t++,e/=2;return t}));class x extends m{constructor(){super(...arguments),this._zoomLevel=0}_write(e,t,i,s){if(this._zoomLevel=s||0,null!=i)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const i=t.readXForDisplay(),s=t.readYForDisplay();return this._writePoint(e,i,s,t)}case"esriGeometryEnvelope":case"esriGeometryPolygon":case"esriGeometryMultipoint":{const i=t.readCentroidForDisplay();if(!i)return;const[s,a]=i.coords;return this._writePoint(e,s,a,t)}case"esriGeometryPolyline":{const i=t.readLegacyGeometryForDisplay();this._writeLines(e,t,i)}}}_writePoint(e,t,i,o){const l=this._getShaping();if(!l)return;let h=this._getPointReferenceBounds();h||(h={offsetX:0,offsetY:0,size:0});const c=l.boundsT,m=s(this.evaluatedMeshParams.horizontalAlignment),d=a(this.evaluatedMeshParams.verticalAlignment),u=this.evaluatedMeshParams.scaleInfo?.maxScale??0,g=this.evaluatedMeshParams.scaleInfo?.minScale??0,p=n(o.getDisplayId());e.metricStart(new r(p,t,i,m,d,u,g,h)),e.metricBoxWrite(c),this._writeGlyphs(e,o.getDisplayId(),t,i,l,0,h),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t,i){const{repeatLabel:s,scaleInfo:a}=this.evaluatedMeshParams,n=this.evaluatedMeshParams.repeatLabelDistance||128,r=this._getShaping();if(!r)return;this._current={out:e,id:t.getDisplayId(),shaping:r,zoomRange:h(a,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0}};const c=o(i.paths,r.bounds.width),m=this._placeSubdivGlyphs.bind(this),d=(r.bounds.width+n)/(1<<u);for(const o of c)l(o,d,m,!!s)}_placeSubdivGlyphs(e,t,i,s){const{allowOverrun:a,labelPosition:n,repeatLabelDistance:r}=this.evaluatedMeshParams,o=this._current.zoomRange[0],l=f(t),h=this._current.shaping.bounds.width/(1<<u),c=Math.sqrt(r||p)/(1<<u),m=Math.min(i,s-i),g=this._current.shaping.isMultiline?d:Math.log2(m/(c+h/2)),x=0===t?g:Math.min(l,g),_=Math.max(o,this._zoomLevel+u-x),M=this._zoomLevel-_,y=this._current.shaping.bounds.width/2*2**M;this._current.shaping.isMultiline?0===t&&this._placeStraight(e,_):a&&M<0?this._placeStraightAlong(e,o):"parallel"===n?this._placeStraightAlong(e,_):"curved"===n&&this._placeCurved(e,_,y)}_placeStraight(e,s){const{out:a,id:o,shaping:l,zoomRange:h,referenceBounds:c}=this._current,{x:m,y:u}=e,g=e.angle*(180/Math.PI)%360,p=(e.angle*(180/Math.PI)+180)%360;if(l.textBox){const n=Math.max(s,h[0],0),r=Math.min(d,h[1]),m=t(i(),-e.angle),[u,f]=l.shapeBackground(m),x={minZoom:n,maxZoom:r,clipAngle:g,mapAligned:!0,isLineLabel:!0};a.recordStart(this.instanceId,this.attributeLayout,l.glyphs[0].textureBinding),this._writeTextBox(a,o,e.x,e.y,f,c,x),a.recordEnd(),x.clipAngle=p,a.recordStart(this.instanceId,this.attributeLayout,l.glyphs[0].textureBinding),this._writeTextBox(a,o,e.x,e.y,f,c,x),a.recordEnd()}const f=n(o),x=this.evaluatedMeshParams.scaleInfo?.maxScale??0,_=this.evaluatedMeshParams.scaleInfo?.minScale??0;a.metricStart(new r(f,e.x,e.y,0,0,x,_,null)),a.metricBoxWrite(l.bounds);for(const t of l.glyphs)t.minZoom=s,t.maxZoom=h[1],t.angle=e.angle,this._writeLineGlyph(a,o,m,u,l.bounds,t,g,c,!0),t.angle=e.angle+Math.PI,this._writeLineGlyph(a,o,m,u,l.bounds,t,p,c,!0);a.metricEnd()}_placeCurved(e,t,i){const{out:s,id:a}=this._current,o=e.clone(),l=e.angle*(180/Math.PI)%360,h=(e.angle*(180/Math.PI)+180)%360,c=n(a),m=this.evaluatedMeshParams.scaleInfo?.maxScale??0,d=this.evaluatedMeshParams.scaleInfo?.minScale??0;s.metricStart(new r(c,e.x,e.y,0,0,m,d,null)),this._placeFirst(o,t,1,l),this._placeBack(e,o,t,i,1,l),this._placeForward(e,o,t,i,1,l),this._placeFirst(o,t,0,h),this._placeBack(e,o,t,i,0,h),this._placeForward(e,o,t,i,0,h),s.metricEnd()}_placeStraightAlong(e,s){const{out:a,id:o,shaping:l,zoomRange:h,referenceBounds:c}=this._current,{boxBorderLineColor:m,boxBackgroundColor:u}=this.evaluatedMeshParams,g=e.clone(),p=e.angle*(180/Math.PI)%360,f=(e.angle*(180/Math.PI)+180)%360;if(l.glyphs.length>0&&(m||u)){const n=Math.max(s,h[0],0),r=Math.min(d,h[1]),m=t(i(),-e.angle),[u,g]=l.shapeBackground(m),x={minZoom:n,maxZoom:r,clipAngle:p,mapAligned:!0,isLineLabel:!0};a.recordStart(this.instanceId,this.attributeLayout,l.glyphs[0].textureBinding),this._writeTextBox(a,o,e.x,e.y,g,c,x),a.recordEnd(),x.clipAngle=f,a.recordStart(this.instanceId,this.attributeLayout,l.glyphs[0].textureBinding),this._writeTextBox(a,o,e.x,e.y,g,c,x),a.recordEnd()}const x=n(o),_=this.evaluatedMeshParams.scaleInfo?.maxScale??0,M=this.evaluatedMeshParams.scaleInfo?.minScale??0;a.metricStart(new r(x,e.x,e.y,0,0,_,M,null)),this._placeFirst(g,s,1,p,!0),this._placeFirst(g,s,0,f,!0),a.metricEnd()}_placeBack(e,t,i,s,a,n){const r=e.clone();let o=e.backwardLength+g;for(;r.prev()&&!(o>=s);)this._placeOnSegment(r,t,o,i,-1,a,n),o+=r.length+g}_placeForward(e,t,i,s,a,n){const r=e.clone();let o=e.remainingLength+g;for(;r.next()&&!(o>=s);)this._placeOnSegment(r,t,o,i,1,a,n),o+=r.length+g}_placeFirst(e,t,i,s,a=!1){const n=e,{out:r,id:o,shaping:l,zoomRange:h,referenceBounds:c}=this._current,m=l.glyphs;for(const u of m){const m=u.x>l.bounds.x?i:1-i,p=m*e.remainingLength+(1-m)*e.backwardLength,f=Math.abs(u.x+u.width/2-l.bounds.x),x=Math.max(0,this._zoomLevel+Math.log2(f/(p+g))),_=Math.max(t,a?0:x);u.maxZoom=Math.min(h[1],d),u.angle=e.angle+(1-i)*Math.PI,u.minZoom=Math.max(h[0],_),r.metricBoxWrite(u.bounds),this._writeLineGlyph(r,o,n.x,n.y,l.bounds,u,s,c,!0)}}_placeOnSegment(e,t,i,s,a,n,r){const{out:o,id:l,shaping:h,referenceBounds:c}=this._current,m=h.glyphs,d=e.dx/e.length,u=e.dy/e.length,p={x:e.x+i*-a*d,y:e.y+i*-a*u};for(const f of m){const t=f.x>h.bounds.x?n:1-n;if(!(t&&1===a||!t&&-1===a))continue;const m=Math.abs(f.x+f.width/2-h.bounds.x),d=Math.max(0,this._zoomLevel+Math.log2(m/i)-.1),u=Math.max(s,this._zoomLevel+Math.log2(m/(i+e.length+g)));0!==d&&(f.angle=e.angle+(1-n)*Math.PI,f.minZoom=u,f.maxZoom=d,this._writeLineGlyph(o,l,p.x,p.y,h.bounds,f,r,c,!0))}}_writeLineGlyph(e,t,i,s,a,n,r,o,l){const h=i+a.x,m=s+a.y,d=2*(this.evaluatedMeshParams.minPixelBuffer?this.evaluatedMeshParams.minPixelBuffer/this._textMeshTransformProps.fontSize:1),u=Math.max(a.width,a.height)*d;e.recordStart(this.instanceId,this.attributeLayout,n.textureBinding),e.recordBounds(h,m,u,u);const{texcoords:g,offsets:p}=n,f=this._textMeshTransformProps.fontSize;this._writeQuad(e,t,i,s,{texcoords:g,offsets:p,fontSize:f,color:c(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:o,minZoom:Math.max(this._current.zoomRange[0],n.minZoom),maxZoom:Math.min(this._current.zoomRange[1],n.maxZoom),clipAngle:r,mapAligned:l,isLineLabel:!0}),e.recordEnd()}}export{x as LabelMeshWriter};
5
+ import{memoize as e}from"../../../../../../../core/MapUtils.js";import{fromRotation as t}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as i}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{getXAnchorDirection as s,getYAnchorDirection as a}from"../../../alignmentUtils.js";import{getDisplayIdTexel as o}from"../../../DisplayId.js";import n from"../../../collisions/BoundingBox.js";import{LabelMetric as r}from"../../../collisions/LabelMetric.js";import{smoothPaths as l,pathDivide as h}from"../../../mesh/templates/segmentUtils.js";import{getMinMaxZoom as c,processColorInput as m}from"../fill/meshWriterUtils.js";import{TextMeshWriter as d,maxLabelZoom as u}from"../text/TextMeshWriter.js";const g=1,p=0,f=128,_=e((e=>{let t=0;if(0===e)return 1/0;for(;!(e%2);)t++,e/=2;return t}));class x extends d{constructor(){super(...arguments),this._zoomLevel=0}_write(e,t,i,s){if(this._zoomLevel=s||0,null!=i)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const i=t.readXForDisplay(),s=t.readYForDisplay();return this._writePoint(e,i,s,t)}case"esriGeometryEnvelope":case"esriGeometryPolygon":case"esriGeometryMultipoint":{const i=t.readCentroidForDisplay();if(!i)return;const[s,a]=i.coords;return this._writePoint(e,s,a,t)}case"esriGeometryPolyline":{const i=t.readLegacyGeometryForDisplay();this._writeLines(e,t,i)}}}_writePoint(e,t,i,n){const l=this._getShaping();if(!l)return;let h=this._getPointReferenceBounds();h||(h={offsetX:0,offsetY:0,size:0});const c=l.boundsT,m=s(this.evaluatedMeshParams.horizontalAlignment),d=a(this.evaluatedMeshParams.verticalAlignment),u=this.evaluatedMeshParams.scaleInfo?.maxScale??0,g=this.evaluatedMeshParams.scaleInfo?.minScale??0,p=o(n.getDisplayId());e.metricStart(new r(p,t,i,m,d,u,g,h)),e.metricBoxWrite(c),this._writeGlyphs(e,n.getDisplayId(),t,i,l,0,h),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t,i){const{repeatLabel:s,scaleInfo:a}=this.evaluatedMeshParams,o=this.evaluatedMeshParams.repeatLabelDistance||128,n=this._getShaping();if(!n)return;this._current={out:e,id:t.getDisplayId(),shaping:n,zoomRange:c(a,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0}};const r=l(i.paths,n.bounds.width),m=this._placeSubdivGlyphs.bind(this),d=(n.bounds.width+o)/(1<<g);for(const l of r)h(l,d,m,!!s)}_placeSubdivGlyphs(e,t,i,s){const{allowOverrun:a,labelPosition:o,repeatLabelDistance:n}=this.evaluatedMeshParams,r=this._current.zoomRange[0],l=_(t),h=this._current.shaping.bounds.width/(1<<g),c=Math.sqrt(n||f)/(1<<g),m=Math.min(i,s-i),d=this._current.shaping.isMultiline?u:Math.log2(m/(c+h/2)),p=0===t?d:Math.min(l,d),x=Math.max(r,this._zoomLevel+g-p),M=this._zoomLevel-x,y=this._current.shaping.bounds.width/2*2**M;this._current.shaping.isMultiline?0===t&&this._placeStraight(e,x):a&&M<0?this._placeStraightAlong(e,r):"parallel"===o?this._placeStraightAlong(e,x):"curved"===o&&this._placeCurved(e,x,y)}_placeStraight(e,t){const{out:i,id:s,shaping:a,referenceBounds:n}=this._current,{x:l,y:h}=e,c=o(s),m=this.evaluatedMeshParams.scaleInfo?.maxScale??0,d=this.evaluatedMeshParams.scaleInfo?.minScale??0;i.metricStart(new r(c,e.x,e.y,0,0,m,d,null)),i.metricBoxWrite(a.boundsT);const u=e.angle*(180/Math.PI)%360,g=(e.angle*(180/Math.PI)+180)%360;this._writeGlyphs(i,s,l,h,a,0,n,{clipAngle:u,mapAligned:!0,isLineLabel:!0,minZoom:t}),this._writeGlyphs(i,s,l,h,a,0,n,{clipAngle:g,mapAligned:!0,isLineLabel:!0,minZoom:t}),i.metricEnd()}_placeCurved(e,t,i){const{out:s,id:a}=this._current,n=e.clone(),l=e.angle*(180/Math.PI)%360,h=(e.angle*(180/Math.PI)+180)%360,c=o(a),m=this.evaluatedMeshParams.scaleInfo?.maxScale??0,d=this.evaluatedMeshParams.scaleInfo?.minScale??0;s.metricStart(new r(c,e.x,e.y,0,0,m,d,null)),this._placeFirst(n,t,1,l),this._placeBack(e,n,t,i,1,l),this._placeForward(e,n,t,i,1,l),this._placeFirst(n,t,0,h),this._placeBack(e,n,t,i,0,h),this._placeForward(e,n,t,i,0,h),s.metricEnd()}_placeStraightAlong(e,s){const{out:a,id:n,shaping:l,zoomRange:h,referenceBounds:c}=this._current,{boxBorderLineColor:m,boxBackgroundColor:d}=this.evaluatedMeshParams,g=e.clone(),p=e.angle*(180/Math.PI)%360,f=(e.angle*(180/Math.PI)+180)%360;if(l.glyphs.length>0&&(m||d)){const o=Math.max(s,h[0],0),r=Math.min(u,h[1]),m=t(i(),-e.angle),[d,g]=l.shapeBackground(m),_={minZoom:o,maxZoom:r,clipAngle:p,mapAligned:!0,isLineLabel:!0};a.recordStart(this.instanceId,this.attributeLayout,l.glyphs[0].textureBinding),this._writeTextBox(a,n,e.x,e.y,g,c,_),a.recordEnd(),_.clipAngle=f,a.recordStart(this.instanceId,this.attributeLayout,l.glyphs[0].textureBinding),this._writeTextBox(a,n,e.x,e.y,g,c,_),a.recordEnd()}const _=o(n),x=this.evaluatedMeshParams.scaleInfo?.maxScale??0,M=this.evaluatedMeshParams.scaleInfo?.minScale??0;a.metricStart(new r(_,e.x,e.y,0,0,x,M,null)),this._placeFirst(g,s,1,p,!0),this._placeFirst(g,s,0,f,!0),a.metricEnd()}_placeBack(e,t,i,s,a,o){const n=e.clone();let r=e.backwardLength+p;for(;n.prev()&&!(r>=s);)this._placeOnSegment(n,t,r,i,-1,a,o),r+=n.length+p}_placeForward(e,t,i,s,a,o){const n=e.clone();let r=e.remainingLength+p;for(;n.next()&&!(r>=s);)this._placeOnSegment(n,t,r,i,1,a,o),r+=n.length+p}_placeFirst(e,t,i,s,a=!1){const o=e,{out:n,id:r,shaping:l,zoomRange:h,referenceBounds:c}=this._current,m=l.glyphs;for(const d of m){const m=d.x>l.bounds.x?i:1-i,g=m*e.remainingLength+(1-m)*e.backwardLength,f=Math.abs(d.x+d.width/2-l.bounds.x),_=Math.max(0,this._zoomLevel+Math.log2(f/(g+p))),x=Math.max(t,a?0:_);d.maxZoom=Math.min(h[1],u),d.angle=e.angle+(1-i)*Math.PI,d.minZoom=Math.max(h[0],x),this._writeLineGlyph(n,r,o.x,o.y,l.bounds,d,s,c,!0),i&&this._isVisible(d.minZoom,d.maxZoom)&&n.metricBoxWrite(d.bounds)}}_placeOnSegment(e,t,i,s,a,o,r){const{out:l,id:h,shaping:c,referenceBounds:m}=this._current,d=c.glyphs,u=e.dx/e.length,g=e.dy/e.length,f={x:e.x+i*-a*u,y:e.y+i*-a*g};for(const _ of d){const d=_.x>c.bounds.x?o:1-o;if(!(d&&1===a||!d&&-1===a))continue;const u=Math.abs(_.x+_.width/2-c.bounds.x),g=Math.max(0,this._zoomLevel+Math.log2(u/i)-.1),x=Math.max(s,this._zoomLevel+Math.log2(u/(i+e.length+p)));if(0!==g&&(_.angle=e.angle+(1-o)*Math.PI,_.minZoom=x,_.maxZoom=g,this._writeLineGlyph(l,h,f.x,f.y,c.bounds,_,r,m,!0),o&&this._isVisible(_.minZoom,_.maxZoom))){const i=_.bounds,s=e.x-t.x,a=e.y-t.y,o=new n(i.center[0]+s,i.center[1]+a,i.width,i.height);l.metricBoxWrite(o)}}}_writeLineGlyph(e,t,i,s,a,o,n,r,l){const h=i+a.x,c=s+a.y,d=2*(this.evaluatedMeshParams.minPixelBuffer?this.evaluatedMeshParams.minPixelBuffer/this._textMeshTransformProps.fontSize:1),u=Math.max(a.width,a.height)*d;e.recordStart(this.instanceId,this.attributeLayout,o.textureBinding),e.recordBounds(h,c,u,u);const{texcoords:g,offsets:p}=o,f=this._textMeshTransformProps.fontSize;this._writeQuad(e,t,i,s,{texcoords:g,offsets:p,fontSize:f,color:m(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:r,minZoom:Math.max(this._current.zoomRange[0],o.minZoom),maxZoom:Math.min(this._current.zoomRange[1],o.maxZoom),clipAngle:n,mapAligned:l,isLineLabel:!0}),e.recordEnd()}_isVisible(e,t){const i=this._zoomLevel;return e<=i&&i<=t}}export{x as LabelMeshWriter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as t}from"../../../../../../../core/mathUtils.js";import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as o}from"../../../../../../../geometry/GeometryCursor.js";import{CIMMarkerPlacementHelper as r}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{getXDirection as i,getYDirection as s}from"../../../alignmentUtils.js";import{minMaxZoomPrecisionFactor as n,magicLabelLineHeight as a,glyphSize as c}from"../../../definitions.js";import{shapeGlyphs as l}from"../../../mesh/templates/shapingUtils.js";import{packBitset as h,processColorInput as p}from"../fill/meshWriterUtils.js";import{getGeometryEngine as f}from"../mesh/loadGeometryEngine.js";import{MeshWriter as m}from"../mesh/MeshWriter.js";import{bitsetTextIsBackground as d,bitsetTextIsMapAligned as u}from"../shaders/constants.js";import{TextMeshTransformProps as g}from"./TextParams.js";import{DataType as x}from"../../../../../../webgl/enums.js";const y=28,_=[4,4],P=[16,4],S={topLeft:P,topRight:P,bottomLeft:P,bottomRight:P},k=[4,2],b=[4,6],T={topLeft:k,topRight:k,bottomLeft:b,bottomRight:b},B={topLeft:k,topRight:b,bottomLeft:k,bottomRight:b},R={topLeft:b,topRight:b,bottomLeft:_,bottomRight:_},w={topLeft:_,topRight:_,bottomLeft:b,bottomRight:b},M={topLeft:b,topRight:_,bottomLeft:b,bottomRight:_},z={topLeft:_,topRight:b,bottomLeft:_,bottomRight:b},L={createComputedParams:t=>t,attributes:{pos:{type:x.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:x.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:x.UNSIGNED_BYTE,count:1,packTessellation:({isBackground:t,mapAligned:e})=>h([[d,t],[u,!!e]])},zoomRange:{type:x.UNSIGNED_SHORT,count:2,packPrecisionFactor:n,packTessellation:({minZoom:t,maxZoom:e})=>[t||0,e||y]},offset:{type:x.SHORT,count:2,packPrecisionFactor:8,packAlternating:{count:4,packTessellation:({offsets:t})=>{const{bottomLeft:e,bottomRight:o,topLeft:r,topRight:i}=t;return[r,i,e,o]}}},textureUV:{type:x.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,packTessellation:({texcoords:t})=>{const{bottomLeft:e,bottomRight:o,topLeft:r,topRight:i}=t;return[r,i,e,o]}}},color:{type:x.UNSIGNED_BYTE,count:4,normalized:!0,packTessellation:({color:t})=>t},fontSize:{type:x.UNSIGNED_SHORT,count:1,packPrecisionFactor:4,packTessellation:({fontSize:t})=>e(t)},referenceSize:{type:x.UNSIGNED_BYTE,count:1,packPrecisionFactor:4,packTessellation:({fontSize:t},{referenceSize:o})=>e(o??t)},haloColor:{type:x.UNSIGNED_BYTE,count:4,normalized:!0,pack:({haloColor:t})=>p(t)},haloFontSize:{type:x.UNSIGNED_SHORT,count:1,packPrecisionFactor:4,pack:({haloFontSize:t})=>e(t)},clipAngle:{type:x.UNSIGNED_BYTE,count:1,packTessellation:({clipAngle:t})=>G(t||0)},referenceSymbol:{type:x.BYTE,count:4,packPrecisionFactor:1,packTessellation:(t,o)=>{if(!t.referenceBounds)return[0,0,0,0];const r=i(o.horizontalAlignment),n=s(o.verticalAlignment),{offsetX:a,offsetY:c,size:l}=t.referenceBounds;return[e(a),-e(c),e(l),r+1<<2|n+1]}}}};class E extends m{constructor(){super(...arguments),this.vertexSpec=L,this._textMeshParamsPropsInitialized=!1}ensurePacked(t,e,o){super.ensurePacked(t,e,o),this._textMeshParamsPropsInitialized&&!this._evaluator.hasDynamicProperties||(this._textMeshTransformProps=new g(this.evaluatedMeshParams),this._textMeshParamsPropsInitialized=!0)}_write(t,e,o){const r=this._getShaping();if(!r)return;const i=e.getDisplayId();if(null!=this.evaluatedMeshParams.placement)return this._writePlacedTextMarkers(t,e,r,o);if(o&&o.nextPath())return o.nextPoint(),this._writeGlyphs(t,i,o.x,o.y,r,0);if("esriGeometryPolygon"===e.geometryType){const o=e.readCentroidForDisplay();if(!o)return;const[s,n]=o.coords;return this._writeGlyphs(t,i,s,n,r,0)}if("esriGeometryMultipoint"===e.geometryType){const o=e.readGeometryForDisplay();return void o?.forEachVertex(((e,o)=>this._writeGlyphs(t,i,e,o,r,0)))}const s=e.readXForDisplay(),n=e.readYForDisplay();return this._writeGlyphs(t,i,s,n,r,0)}_writePlacedTextMarkers(t,i,s,n){const a=n??o.fromFeatureSetReaderCIM(i);if(!a)return;const c=-1,l=r.getPlacement(a,c,this.evaluatedMeshParams.placement,e(1),t.id,f());if(!l)return;const h=i.getDisplayId();let p=l.next();for(;null!=p;){const e=p.tx,o=-p.ty,r=-p.getAngle();this._writeGlyphs(t,h,e,o,s,r),p=l.next()}}_getShaping(){const o=this._textMeshTransformProps,r=this.evaluatedMeshParams;if(!r.glyphs?.glyphs.length)return null;const i=Math.round(e(o.fontSize)),s=e(o.offsetX),n=e(o.offsetY),h=t(e(r.lineWidth),32,512),p=a*t(r.lineHeightRatio,.25,4);return l(r.glyphs,{scale:i/c,angle:o.postAngle,xOffset:s,yOffset:n,horizontalAlignment:r.horizontalAlignment,verticalAlignment:r.verticalAlignment,maxLineWidth:h,lineHeight:p,decoration:r.decoration,borderLineSizePx:e(r.boxBorderLineSize),hasBackground:!!r.boxBackgroundColor,useCIMAngleBehavior:r.useCIMAngleBehavior})}_writeGlyphs(t,o,r,i,s,n,a){const c=this.evaluatedMeshParams,l=this._textMeshTransformProps,h=l.fontSize,f=e(l.offsetX),m=e(l.offsetY);0!==n&&s.setRotation(n);const d=s.bounds,u=r+d.x+f,g=i+d.y-m,x=2*(c.minPixelBuffer?c.minPixelBuffer/h:1),y=Math.max(d.width,d.height)*x;s.textBox&&(t.recordStart(this.instanceId,this.attributeLayout,s.glyphs[0].textureBinding),t.recordBounds(u,g,y,y),this._writeTextBox(t,o,r,i,s.textBox,a),t.recordEnd());for(const e of s.glyphs){t.recordStart(this.instanceId,this.attributeLayout,e.textureBinding),t.recordBounds(u,g,y,y);const{texcoords:s,offsets:n}=e;this._writeQuad(t,o,r,i,{texcoords:s,offsets:n,fontSize:h,color:p(c.color),isBackground:!1,referenceBounds:a}),t.recordEnd()}0!==n&&s.setRotation(-n)}_writeTextBox(t,e,o,r,i,s,n){const a=this.evaluatedMeshParams,{fontSize:c}=this._textMeshTransformProps,{boxBackgroundColor:l,boxBorderLineColor:h}=a,f={isBackground:!0,fontSize:c,referenceBounds:s,...n};l&&(this._writeQuad(t,e,o,r,{texcoords:S,offsets:i.main,color:p(l),...f}),h||(this._writeQuad(t,e,o,r,{texcoords:R,offsets:i.top,color:p(l),...f}),this._writeQuad(t,e,o,r,{texcoords:w,offsets:i.bot,color:p(l),...f}),this._writeQuad(t,e,o,r,{texcoords:M,offsets:i.left,color:p(l),...f}),this._writeQuad(t,e,o,r,{texcoords:z,offsets:i.right,color:p(l),...f}))),h&&(this._writeQuad(t,e,o,r,{texcoords:T,offsets:i.top,color:p(h),...f}),this._writeQuad(t,e,o,r,{texcoords:T,offsets:i.bot,color:p(h),...f}),this._writeQuad(t,e,o,r,{texcoords:B,offsets:i.left,color:p(h),...f}),this._writeQuad(t,e,o,r,{texcoords:B,offsets:i.right,color:p(h),...f}))}_writeQuad(t,e,o,r,i){const s=t.vertexCount();this._writeVertex(t,e,o,r,i),t.indexWrite(s+0),t.indexWrite(s+1),t.indexWrite(s+2),t.indexWrite(s+1),t.indexWrite(s+3),t.indexWrite(s+2)}}const G=t=>Math.round(t*(254/360));export{E as TextMeshWriter,L as TextVertexSpec,y as maxLabelZoom};
5
+ import{clamp as t}from"../../../../../../../core/mathUtils.js";import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as o}from"../../../../../../../geometry/GeometryCursor.js";import{CIMMarkerPlacementHelper as r}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{getXDirection as i,getYDirection as s}from"../../../alignmentUtils.js";import{minMaxZoomPrecisionFactor as n,magicLabelLineHeight as a,glyphSize as c}from"../../../definitions.js";import{shapeGlyphs as l}from"../../../mesh/templates/shapingUtils.js";import{packBitset as f,processColorInput as h,getMinMaxZoom as p}from"../fill/meshWriterUtils.js";import{getGeometryEngine as m}from"../mesh/loadGeometryEngine.js";import{MeshWriter as d}from"../mesh/MeshWriter.js";import{bitsetTextIsBackground as u,bitsetTextIsMapAligned as g}from"../shaders/constants.js";import{TextMeshTransformProps as x}from"./TextParams.js";import{DataType as y}from"../../../../../../webgl/enums.js";const _=28,P=[4,4],S=[16,4],k={topLeft:S,topRight:S,bottomLeft:S,bottomRight:S},T=[4,2],b=[4,6],B={topLeft:T,topRight:T,bottomLeft:b,bottomRight:b},R={topLeft:T,topRight:b,bottomLeft:T,bottomRight:b},w={topLeft:b,topRight:b,bottomLeft:P,bottomRight:P},M={topLeft:P,topRight:P,bottomLeft:b,bottomRight:b},z={topLeft:b,topRight:P,bottomLeft:b,bottomRight:P},L={topLeft:P,topRight:b,bottomLeft:P,bottomRight:b},I={createComputedParams:t=>t,attributes:{pos:{type:y.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:y.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:y.UNSIGNED_BYTE,count:1,packTessellation:({isBackground:t,mapAligned:e})=>f([[u,t],[g,!!e]])},zoomRange:{type:y.UNSIGNED_SHORT,count:2,packPrecisionFactor:n,packTessellation:({minZoom:t,maxZoom:e})=>[t||0,e||_]},offset:{type:y.SHORT,count:2,packPrecisionFactor:8,packAlternating:{count:4,packTessellation:({offsets:t})=>{const{bottomLeft:e,bottomRight:o,topLeft:r,topRight:i}=t;return[r,i,e,o]}}},textureUV:{type:y.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,packTessellation:({texcoords:t})=>{const{bottomLeft:e,bottomRight:o,topLeft:r,topRight:i}=t;return[r,i,e,o]}}},color:{type:y.UNSIGNED_BYTE,count:4,normalized:!0,packTessellation:({color:t})=>t},fontSize:{type:y.UNSIGNED_SHORT,count:1,packPrecisionFactor:4,packTessellation:({fontSize:t})=>e(t)},referenceSize:{type:y.UNSIGNED_BYTE,count:1,packPrecisionFactor:4,packTessellation:({fontSize:t},{referenceSize:o})=>e(o??t)},haloColor:{type:y.UNSIGNED_BYTE,count:4,normalized:!0,pack:({haloColor:t})=>h(t)},haloFontSize:{type:y.UNSIGNED_SHORT,count:1,packPrecisionFactor:4,pack:({haloFontSize:t})=>e(t)},clipAngle:{type:y.UNSIGNED_BYTE,count:1,packTessellation:({clipAngle:t})=>G(t||0)},referenceSymbol:{type:y.BYTE,count:4,packPrecisionFactor:1,packTessellation:(t,o)=>{if(!t.referenceBounds)return[0,0,0,0];const r=i(o.horizontalAlignment),n=s(o.verticalAlignment),{offsetX:a,offsetY:c,size:l}=t.referenceBounds;return[e(a),-e(c),e(l),r+1<<2|n+1]}}}};class E extends d{constructor(){super(...arguments),this.vertexSpec=I,this._textMeshParamsPropsInitialized=!1}ensurePacked(t,e,o){super.ensurePacked(t,e,o),this._textMeshParamsPropsInitialized&&!this._evaluator.hasDynamicProperties||(this._textMeshTransformProps=new x(this.evaluatedMeshParams),this._textMeshParamsPropsInitialized=!0)}_write(t,e,o){const r=this._getShaping();if(!r)return;const i=e.getDisplayId();if(null!=this.evaluatedMeshParams.placement)return this._writePlacedTextMarkers(t,e,r,o);if(o&&o.nextPath())return o.nextPoint(),this._writeGlyphs(t,i,o.x,o.y,r,0);if("esriGeometryPolygon"===e.geometryType){const o=e.readCentroidForDisplay();if(!o)return;const[s,n]=o.coords;return this._writeGlyphs(t,i,s,n,r,0)}if("esriGeometryMultipoint"===e.geometryType){const o=e.readGeometryForDisplay();return void o?.forEachVertex(((e,o)=>this._writeGlyphs(t,i,e,o,r,0)))}const s=e.readXForDisplay(),n=e.readYForDisplay();return this._writeGlyphs(t,i,s,n,r,0)}_writePlacedTextMarkers(t,i,s,n){const a=n??o.fromFeatureSetReaderCIM(i);if(!a)return;const c=-1,l=r.getPlacement(a,c,this.evaluatedMeshParams.placement,e(1),t.id,m());if(!l)return;const f=i.getDisplayId();let h=l.next();for(;null!=h;){const e=h.tx,o=-h.ty,r=-h.getAngle();this._writeGlyphs(t,f,e,o,s,r),h=l.next()}}_getShaping(){const o=this._textMeshTransformProps,r=this.evaluatedMeshParams;if(!r.glyphs?.glyphs.length)return null;const i=Math.round(e(o.fontSize)),s=e(o.offsetX),n=e(o.offsetY),f=t(e(r.lineWidth),32,512),h=a*t(r.lineHeightRatio,.25,4);return l(r.glyphs,{scale:i/c,angle:o.postAngle,xOffset:s,yOffset:n,horizontalAlignment:r.horizontalAlignment,verticalAlignment:r.verticalAlignment,maxLineWidth:f,lineHeight:h,decoration:r.decoration,borderLineSizePx:e(r.boxBorderLineSize),hasBackground:!!r.boxBackgroundColor,useCIMAngleBehavior:r.useCIMAngleBehavior})}_writeGlyphs(t,o,r,i,s,n,a,c){const l=this.evaluatedMeshParams,f=this._textMeshTransformProps,m=f.fontSize,d=e(f.offsetX),u=e(f.offsetY),[g,x]=p(l.scaleInfo,this.getTileInfo());0!==n&&s.setRotation(n);const y=s.bounds,_=r+y.x+d,P=i+y.y-u,S=2*(l.minPixelBuffer?l.minPixelBuffer/m:1),k=Math.max(y.width,y.height)*S;s.textBox&&(t.recordStart(this.instanceId,this.attributeLayout,s.glyphs[0].textureBinding),t.recordBounds(_,P,k,k),this._writeTextBox(t,o,r,i,s.textBox,a,c),t.recordEnd());for(const e of s.glyphs){t.recordStart(this.instanceId,this.attributeLayout,e.textureBinding),t.recordBounds(_,P,k,k);const{texcoords:s,offsets:n}=e;this._writeQuad(t,o,r,i,{texcoords:s,offsets:n,fontSize:m,color:h(l.color),isBackground:!1,referenceBounds:a,minZoom:g,maxZoom:x,...c}),t.recordEnd()}0!==n&&s.setRotation(-n)}_writeTextBox(t,e,o,r,i,s,n){const a=this.evaluatedMeshParams,{fontSize:c}=this._textMeshTransformProps,{boxBackgroundColor:l,boxBorderLineColor:f}=a,p={isBackground:!0,fontSize:c,referenceBounds:s,...n};l&&(this._writeQuad(t,e,o,r,{texcoords:k,offsets:i.main,color:h(l),...p}),f||(this._writeQuad(t,e,o,r,{texcoords:w,offsets:i.top,color:h(l),...p}),this._writeQuad(t,e,o,r,{texcoords:M,offsets:i.bot,color:h(l),...p}),this._writeQuad(t,e,o,r,{texcoords:z,offsets:i.left,color:h(l),...p}),this._writeQuad(t,e,o,r,{texcoords:L,offsets:i.right,color:h(l),...p}))),f&&(this._writeQuad(t,e,o,r,{texcoords:B,offsets:i.top,color:h(f),...p}),this._writeQuad(t,e,o,r,{texcoords:B,offsets:i.bot,color:h(f),...p}),this._writeQuad(t,e,o,r,{texcoords:R,offsets:i.left,color:h(f),...p}),this._writeQuad(t,e,o,r,{texcoords:R,offsets:i.right,color:h(f),...p}))}_writeQuad(t,e,o,r,i){const s=t.vertexCount();this._writeVertex(t,e,o,r,i),t.indexWrite(s+0),t.indexWrite(s+1),t.indexWrite(s+2),t.indexWrite(s+1),t.indexWrite(s+3),t.indexWrite(s+2)}}const G=t=>Math.round(t*(254/360));export{E as TextMeshWriter,I as TextVertexSpec,_ as maxLabelZoom};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import{isSome as e}from"../../../core/arrayUtils.js";import r from"../../../core/Collection.js";import i from"../../../core/CollectionFlattener.js";import{makeHandle as s}from"../../../core/handleUtils.js";import{initial as o,watch as a}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../rest/support/DirectionLine.js";import l from"../../../rest/support/DirectionPoint.js";import c from"../../../rest/support/PointBarrier.js";import g from"../../../rest/support/PolygonBarrier.js";import d from"../../../rest/support/PolylineBarrier.js";import u from"../../../rest/support/RouteInfo.js";import _ from"../../../rest/support/Stop.js";import{getHighlightBits as m}from"../engine/highlightReasons.js";import{LayerView2DMixin as w}from"./LayerView2D.js";import f from"./graphics/GraphicContainer.js";import y from"./graphics/GraphicsView2D.js";import k from"../../layers/LayerView.js";const j=["route-info","direction-line","direction-point","polygon-barrier","polyline-barrier","point-barrier","stop"],M={graphic:null,property:null,oldValue:null,newValue:null};function V(t){return t instanceof p||t instanceof l||t instanceof c||t instanceof g||t instanceof d||t instanceof u||t instanceof _}function v(t){return r.isCollection(t)&&t.length&&V(t.at(0))}function G(t){return Array.isArray(t)&&t.length>0&&V(t[0])}let I=class extends(w(k)){constructor(){super(...arguments),this._graphics=new r,this._highlightIds=new Map,this._networkFeatureMap=new Map,this._networkGraphicMap=new Map}get _routeItems(){return new i({getCollections:()=>null==this.layer||this.destroyed?[]:[null!=this.layer.routeInfo?new r([this.layer.routeInfo]):null,this.layer.directionLines,this.layer.directionPoints,this.layer.polygonBarriers,this.layer.polylineBarriers,this.layer.pointBarriers,this.layer.stops]})}initialize(){this._updatingHandles.addOnCollectionChange((()=>this._routeItems),(t=>this._routeItemsChanged(t)),o)}destroy(){this._networkFeatureMap.clear(),this._networkGraphicMap.clear(),this._graphics.removeAll(),this._get("_routeItems")?.destroy()}attach(){this._createGraphicsView()}detach(){this._destroyGraphicsView()}highlight(t){let r;r=V(t)?[this._getNetworkFeatureUid(t)]:G(t)?t.map((t=>this._getNetworkFeatureUid(t))):v(t)?t.map((t=>this._getNetworkFeatureUid(t))).toArray():[t.uid];const i=r.filter(e);return i.length?(this._addHighlight(i),s((()=>this._removeHighlight(i)))):s()}async hitTest(t,r){if(this.suspended)return null;const i=this._graphicsView.hitTest(t).filter(e).map((t=>this._networkGraphicMap.get(t)));if(!i.length)return null;const{layer:s}=this;return i.reverse().map((e=>({type:"route",layer:s,mapPoint:t,networkFeature:e})))}isUpdating(){return this._graphicsView.updating}moveStart(){}moveEnd(){}update(t){this._graphicsView.processUpdate(t)}viewChange(){this._graphicsView.viewChange()}_addHighlight(t){for(const e of t)if(this._highlightIds.has(e)){const t=this._highlightIds.get(e);this._highlightIds.set(e,t+1)}else this._highlightIds.set(e,1);this._updateHighlight()}_createGraphic(t){const e=t.toGraphic();return e.layer=this.layer,e.sourceLayer=this.layer,e}_createGraphicsView(){const t=this.view,e=()=>this.requestUpdate(),r=new f(t.featuresTilingScheme);this._graphicsView=new y({container:r,graphics:this._graphics,requestUpdateCallback:e,view:t}),this.container.addChild(r),this._updateHighlight()}_destroyGraphicsView(){this.container.removeChild(this._graphicsView.container),this._graphicsView.destroy()}_getDrawOrder(t){const e=this._networkGraphicMap.get(t);return j.indexOf(e.type)}_getNetworkFeatureUid(t){return this._networkFeatureMap.has(t)?this._networkFeatureMap.get(t).uid:null}_removeHighlight(t){for(const e of t)if(this._highlightIds.has(e)){const t=this._highlightIds.get(e)-1;0===t?this._highlightIds.delete(e):this._highlightIds.set(e,t)}this._updateHighlight()}_routeItemsChanged(t){if(t.removed.length){this._graphics.removeMany(t.removed.map((t=>{const e=this._networkFeatureMap.get(t);return this._networkFeatureMap.delete(t),this._networkGraphicMap.delete(e),e})));for(const e of t.removed)this.removeHandles(e)}if(t.added.length){this._graphics.addMany(t.added.map((t=>{const e=this._createGraphic(t);return null==e.symbol?null:(this._networkFeatureMap.set(t,e),this._networkGraphicMap.set(e,t),e)})).filter(e));for(const e of t.added)this.addHandles([a((()=>e.geometry),((t,r)=>{this._updateGraphic(e,"geometry",t,r)})),a((()=>e.symbol),((t,r)=>{this._updateGraphic(e,"symbol",t,r)}))],e);this._graphics.sort(((t,e)=>this._getDrawOrder(t)-this._getDrawOrder(e)))}}_updateGraphic(t,e,r,i){if(!this._networkFeatureMap.has(t)){const e=this._createGraphic(t);return this._networkFeatureMap.set(t,e),this._networkGraphicMap.set(e,t),void this._graphics.add(e)}const s=this._networkFeatureMap.get(t);s[e]=r,M.graphic=s,M.property=e,M.oldValue=i,M.newValue=r,this._graphicsView.graphicUpdateHandler(M)}_updateHighlight(){const t=Array.from(this._highlightIds.keys()),e=m("highlight");this._graphicsView.setHighlight(t.map((t=>({objectId:t,highlightFlags:e}))))}};t([h()],I.prototype,"_graphics",void 0),t([h()],I.prototype,"_routeItems",null),I=t([n("esri.views.2d.layers.RouteLayerView2D")],I);const F=I;export{F as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import{isSome as e}from"../../../core/arrayUtils.js";import r from"../../../core/Collection.js";import i from"../../../core/CollectionFlattener.js";import{makeHandle as s}from"../../../core/handleUtils.js";import{initial as o,watch as a}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../rest/support/DirectionLine.js";import l from"../../../rest/support/DirectionPoint.js";import c from"../../../rest/support/PointBarrier.js";import g from"../../../rest/support/PolygonBarrier.js";import d from"../../../rest/support/PolylineBarrier.js";import u from"../../../rest/support/RouteInfo.js";import _ from"../../../rest/support/Stop.js";import{getHighlightBits as m}from"../engine/highlightReasons.js";import{LayerView2DMixin as f}from"./LayerView2D.js";import w from"./graphics/GraphicContainer.js";import y from"./graphics/GraphicsView2D.js";import k from"../../layers/LayerView.js";const j=["route-info","direction-line","direction-point","polygon-barrier","polyline-barrier","point-barrier","stop"],M={graphic:null,property:null,oldValue:null,newValue:null};function V(t){return t instanceof p||t instanceof l||t instanceof c||t instanceof g||t instanceof d||t instanceof u||t instanceof _}function v(t){return r.isCollection(t)&&t.length&&V(t.at(0))}function G(t){return Array.isArray(t)&&t.length>0&&V(t[0])}let I=class extends(f(k)){constructor(){super(...arguments),this._graphics=new r,this._highlightIds=new Map,this._networkFeatureMap=new Map,this._networkGraphicMap=new Map}get _routeItems(){return new i({getCollections:()=>null==this.layer||this.destroyed?[]:[null!=this.layer.routeInfo?new r([this.layer.routeInfo]):null,this.layer.directionLines,this.layer.directionPoints,this.layer.polygonBarriers,this.layer.polylineBarriers,this.layer.pointBarriers,this.layer.stops]})}initialize(){this._updatingHandles.addOnCollectionChange((()=>this._routeItems),(t=>this._routeItemsChanged(t)),o)}destroy(){this._networkFeatureMap.clear(),this._networkGraphicMap.clear(),this._graphics.removeAll(),this._get("_routeItems")?.destroy()}attach(){this._createGraphicsView()}detach(){this._destroyGraphicsView()}async fetchPopupFeaturesAtLocation(t,e){return this._graphicsView.hitTest(t).filter((({popupTemplate:t})=>!!t))}highlight(t){let r;r=V(t)?[this._getNetworkFeatureUid(t)]:G(t)?t.map((t=>this._getNetworkFeatureUid(t))):v(t)?t.map((t=>this._getNetworkFeatureUid(t))).toArray():[t.uid];const i=r.filter(e);return i.length?(this._addHighlight(i),s((()=>this._removeHighlight(i)))):s()}async hitTest(t,r){if(this.suspended)return null;const i=this._graphicsView.hitTest(t).filter(e).map((t=>this._networkGraphicMap.get(t)));if(!i.length)return null;const{layer:s}=this;return i.reverse().map((e=>({type:"route",layer:s,mapPoint:t,networkFeature:e})))}isUpdating(){return this._graphicsView.updating}moveStart(){}moveEnd(){}update(t){this._graphicsView.processUpdate(t)}viewChange(){this._graphicsView.viewChange()}_addHighlight(t){for(const e of t)if(this._highlightIds.has(e)){const t=this._highlightIds.get(e);this._highlightIds.set(e,t+1)}else this._highlightIds.set(e,1);this._updateHighlight()}_createGraphic(t){const e=t.toGraphic();return e.layer=this.layer,e.sourceLayer=this.layer,e}_createGraphicsView(){const t=this.view,e=()=>this.requestUpdate(),r=new w(t.featuresTilingScheme);this._graphicsView=new y({container:r,graphics:this._graphics,requestUpdateCallback:e,view:t}),this.container.addChild(r),this._updateHighlight()}_destroyGraphicsView(){this.container.removeChild(this._graphicsView.container),this._graphicsView.destroy()}_getDrawOrder(t){const e=this._networkGraphicMap.get(t);return j.indexOf(e.type)}_getNetworkFeatureUid(t){return this._networkFeatureMap.has(t)?this._networkFeatureMap.get(t).uid:null}_removeHighlight(t){for(const e of t)if(this._highlightIds.has(e)){const t=this._highlightIds.get(e)-1;0===t?this._highlightIds.delete(e):this._highlightIds.set(e,t)}this._updateHighlight()}_routeItemsChanged(t){if(t.removed.length){this._graphics.removeMany(t.removed.map((t=>{const e=this._networkFeatureMap.get(t);return this._networkFeatureMap.delete(t),this._networkGraphicMap.delete(e),e})));for(const e of t.removed)this.removeHandles(e)}if(t.added.length){this._graphics.addMany(t.added.map((t=>{const e=this._createGraphic(t);return null==e.symbol?null:(this._networkFeatureMap.set(t,e),this._networkGraphicMap.set(e,t),e)})).filter(e));for(const e of t.added)this.addHandles([a((()=>e.geometry),((t,r)=>{this._updateGraphic(e,"geometry",t,r)})),a((()=>e.symbol),((t,r)=>{this._updateGraphic(e,"symbol",t,r)}))],e);this._graphics.sort(((t,e)=>this._getDrawOrder(t)-this._getDrawOrder(e)))}}_updateGraphic(t,e,r,i){if(!this._networkFeatureMap.has(t)){const e=this._createGraphic(t);return this._networkFeatureMap.set(t,e),this._networkGraphicMap.set(e,t),void this._graphics.add(e)}const s=this._networkFeatureMap.get(t);s[e]=r,M.graphic=s,M.property=e,M.oldValue=i,M.newValue=r,this._graphicsView.graphicUpdateHandler(M)}_updateHighlight(){const t=Array.from(this._highlightIds.keys()),e=m("highlight");this._graphicsView.setHighlight(t.map((t=>({objectId:t,highlightFlags:e}))))}};t([h()],I.prototype,"_graphics",void 0),t([h()],I.prototype,"_routeItems",null),I=t([n("esri.views.2d.layers.RouteLayerView2D")],I);const F=I;export{F as default};