@arcgis/core 4.31.0-next.20240819 → 4.31.0-next.20240821

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 (150) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{d2fa4d2887692a1ec9b1.js → 0553357f4cdf4deb13d0.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{b21db356f243d097ab3e.js → 122f3f294b8f95619f27.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{dc03a639c97a6f99dbc9.js → 1ac47b7a77818c372e1a.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{23a6700a3278d2cfcd75.js → 203cf58345df86caf4ca.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{a2c40517266fe420017c.js → 25fa59544c13db8cee30.js} +1 -1
  7. package/assets/esri/core/workers/chunks/29545cd255b763d393d0.js +1 -0
  8. package/assets/esri/core/workers/chunks/3f75b7ed24b440b4508a.js +1 -0
  9. package/assets/esri/core/workers/chunks/40e4224f700206c67053.js +1 -0
  10. package/assets/esri/core/workers/chunks/48ab5ce08a97e5dac709.js +1 -0
  11. package/assets/esri/core/workers/chunks/{56bb7b589a0c040263ff.js → 4f1d44ce2f68e2ec2b60.js} +1 -1
  12. package/assets/esri/core/workers/chunks/5429c2e1d2f159f332f9.js +1 -0
  13. package/assets/esri/core/workers/chunks/{d8f416440963b77595e3.js → 58c476c8f6c274d77c0c.js} +1 -1
  14. package/assets/esri/core/workers/chunks/5c4173205f885cd21422.js +1 -0
  15. package/assets/esri/core/workers/chunks/5cb07fa227b7fd06499f.js +1 -0
  16. package/assets/esri/core/workers/chunks/6f7c2d02fbd29870f6ee.js +1 -0
  17. package/assets/esri/core/workers/chunks/75ac4dfa3c8feeb82de2.js +1 -0
  18. package/assets/esri/core/workers/chunks/7fda3d3b211b6da5b0e5.js +1 -0
  19. package/assets/esri/core/workers/chunks/{1e7ce327435e0f4a4bec.js → 8224351edd777843180d.js} +1 -1
  20. package/assets/esri/core/workers/chunks/949cbb667531527e6918.js +1 -0
  21. package/assets/esri/core/workers/chunks/{6e966c885e2ac9dff46b.js → 991295637f51e8207efe.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{252ff37bf5e12dae0b18.js → 9acc02df376d5bdfac87.js} +1 -1
  23. package/assets/esri/core/workers/chunks/9bbf7129579fe04ab268.js +1 -0
  24. package/assets/esri/core/workers/chunks/{492137ecf03ad2b2c2e3.js → a0fdb0fa96680ac758c0.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{3ab02b7660e751cffe1c.js → a4b0e6084971989c526b.js} +1 -1
  26. package/assets/esri/core/workers/chunks/a6834f66d8da628c3fb2.js +1 -0
  27. package/assets/esri/core/workers/chunks/{238936d241e76c4c0343.js → ace8b6351ed35b03499b.js} +1 -1
  28. package/assets/esri/core/workers/chunks/b08689e5b0d1449877f5.js +1 -0
  29. package/assets/esri/core/workers/chunks/b686d70586623f7bf9a6.js +1 -0
  30. package/assets/esri/core/workers/chunks/b6dffcacd8b02384d6e2.js +1 -0
  31. package/assets/esri/core/workers/chunks/{bf7253f7e5d6d63333c3.js → b765a72c9d4f092855f5.js} +1 -1
  32. package/assets/esri/core/workers/chunks/b9490d5cc65cce2f2948.js +1 -0
  33. package/assets/esri/core/workers/chunks/{4706798c58398447d79f.js → bbd5477944da39234c30.js} +1 -1
  34. package/assets/esri/core/workers/chunks/cd8d595d577b74817623.js +1 -0
  35. package/assets/esri/core/workers/chunks/{145592dc516b86fbda63.js → cfc93bbd35cc4bfde7c0.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{48aeb087a1b10a8f4c0b.js → d5d70b3ecc0aca2ac184.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{a784222a7f9dc40ed67c.js → e2a6f77c05d0818e3f74.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{1ee365125c9fb9d9cafe.js → e5474bcde5b8fa037b56.js} +11 -11
  39. package/assets/esri/core/workers/chunks/{f7ab24d3dfc0ba9bf760.js → ea561b2460e634a643fc.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{cf7be98af841fadacf50.js → fc5129c825bc3c78b112.js} +1 -1
  41. package/chunks/BloomComposition.glsl.js +45 -0
  42. package/chunks/Centroid-DZi-eb9F.js +5 -0
  43. package/chunks/OperatorGeodesicBuffer.js +1 -1
  44. package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
  45. package/chunks/OperatorGeodeticDistance.js +5 -0
  46. package/chunks/OperatorProximity.js +5 -0
  47. package/chunks/OperatorShapePreservingDensify.js +1 -1
  48. package/chunks/Polyline.js +1 -1
  49. package/core/mathUtils.js +1 -1
  50. package/geometry/Mesh.js +1 -1
  51. package/geometry/operators/gx/operatorAutoComplete.js +5 -0
  52. package/geometry/operators/gx/operatorClip.js +1 -1
  53. package/geometry/operators/gx/operatorCut.js +1 -1
  54. package/geometry/operators/gx/operatorDensify.js +1 -1
  55. package/geometry/operators/gx/operatorGeodesicBuffer.js +1 -1
  56. package/geometry/operators/gx/operatorGeodeticDensifyByLength.js +1 -1
  57. package/geometry/operators/gx/operatorGeodeticDistance.js +5 -0
  58. package/geometry/operators/gx/operatorIntersection.js +1 -1
  59. package/geometry/operators/gx/operatorLabelPoint.js +5 -0
  60. package/geometry/operators/gx/operatorOffset.js +5 -0
  61. package/geometry/operators/gx/operatorShapePreservingDensify.js +1 -1
  62. package/geometry/operators/gx/operatorSimplify.js +1 -1
  63. package/geometry/operators/gx/operatorUnion.js +1 -1
  64. package/geometry/operators/operatorAutoComplete.js +5 -0
  65. package/geometry/operators/operatorCentroid.js +5 -0
  66. package/geometry/operators/operatorContains.js +1 -1
  67. package/geometry/operators/operatorCrosses.js +1 -1
  68. package/geometry/operators/operatorCut.js +1 -1
  69. package/geometry/operators/operatorDensify.js +1 -1
  70. package/geometry/operators/operatorDifference.js +1 -1
  71. package/geometry/operators/operatorDisjoint.js +1 -1
  72. package/geometry/operators/operatorEquals.js +1 -1
  73. package/geometry/operators/operatorGeodesicBuffer.js +1 -1
  74. package/geometry/operators/operatorGeodeticDensifyByLength.js +1 -1
  75. package/geometry/operators/operatorGeodeticDistance.js +5 -0
  76. package/geometry/operators/operatorIntersection.js +1 -1
  77. package/geometry/operators/operatorIntersects.js +1 -1
  78. package/geometry/operators/operatorLabelPoint.js +5 -0
  79. package/geometry/operators/operatorOffset.js +5 -0
  80. package/geometry/operators/operatorOverlaps.js +1 -1
  81. package/geometry/operators/operatorProximity.js +5 -0
  82. package/geometry/operators/operatorRelate.js +1 -1
  83. package/geometry/operators/operatorReshape.js +5 -0
  84. package/geometry/operators/operatorShapePreservingDensify.js +1 -1
  85. package/geometry/operators/operatorTouches.js +1 -1
  86. package/geometry/operators/operatorWithin.js +1 -1
  87. package/geometry/operators/support/converterAPI.js +1 -1
  88. package/geometry/support/spatialReferenceUtils.js +1 -1
  89. package/geometry/support/webMercatorUtils.js +1 -1
  90. package/interfaces.d.ts +34 -6
  91. package/layers/LinkChartLayer.js +1 -1
  92. package/layers/OrientedImageryLayer.js +1 -1
  93. package/layers/graphics/sources/geojson/geojson.js +1 -1
  94. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  95. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  96. package/layers/knowledgeGraph/SessionMemoryStorage.js +1 -1
  97. package/layers/knowledgeGraph/layerUtils.js +1 -1
  98. package/layers/mixins/operationalLayers.js +1 -1
  99. package/layers/orientedImagery/core/ElevationSourceDefinitions.js +1 -1
  100. package/layers/orientedImagery/core/utils.js +1 -1
  101. package/layers/support/layersCreator.js +1 -1
  102. package/libs/linkchartlayout/LinkChartLayout.js +1 -1
  103. package/package.json +1 -1
  104. package/portal/PortalItem.js +1 -1
  105. package/portal/schemas/definitions.js +1 -1
  106. package/rest/versionManagement/gdbVersion/differences.js +5 -0
  107. package/rest/versionManagement/gdbVersion/support/DifferencesParameters.js +5 -0
  108. package/rest/versionManagement/gdbVersion/support/DifferencesResult.js +5 -0
  109. package/smartMapping/statistics/support/utils.js +1 -1
  110. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  111. package/support/revision.js +1 -1
  112. package/symbols/cim/cimAnalyzer.js +1 -1
  113. package/symbols/support/utils.js +1 -1
  114. package/views/2d/engine/webgl/mesh/MultiTileMeshData.js +1 -1
  115. package/views/2d/layers/features/Processor.js +1 -1
  116. package/views/2d/layers/features/RenderState.js +1 -1
  117. package/views/2d/support/highlightGroupUtils.js +1 -1
  118. package/views/2d/tiling/LODInfo.js +1 -1
  119. package/views/2d/tiling/TileKey.js +1 -1
  120. package/views/3d/state/ViewStateManager.js +1 -1
  121. package/views/3d/support/cameraUtils.js +1 -1
  122. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  123. package/views/3d/support/viewpointUtils.js +1 -1
  124. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +3 -3
  125. package/views/3d/webgl-engine/effects/bloom/BloomComposition.glsl.js +5 -0
  126. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +5 -0
  127. package/views/3d/webgl-engine/effects/bloom/BloomTechnique.js +5 -0
  128. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  129. package/widgets/OrientedImageryViewer.js +1 -1
  130. package/assets/esri/core/workers/chunks/0c6411a08d8b40fc7f4c.js +0 -1
  131. package/assets/esri/core/workers/chunks/22128034bf3b5aa713fc.js +0 -1
  132. package/assets/esri/core/workers/chunks/2dddb8a989b9c96572fe.js +0 -1
  133. package/assets/esri/core/workers/chunks/31f931de94414f13bd13.js +0 -1
  134. package/assets/esri/core/workers/chunks/370dd36904acad113842.js +0 -1
  135. package/assets/esri/core/workers/chunks/5f93a59c92f464925f9c.js +0 -1
  136. package/assets/esri/core/workers/chunks/6a04b6c7a5ec2389a768.js +0 -1
  137. package/assets/esri/core/workers/chunks/6f1853ab502bebefd3c3.js +0 -1
  138. package/assets/esri/core/workers/chunks/8a37c5b110665c8ff5a7.js +0 -1
  139. package/assets/esri/core/workers/chunks/945a3cc2191606f3a917.js +0 -1
  140. package/assets/esri/core/workers/chunks/9661398ce832137461f6.js +0 -1
  141. package/assets/esri/core/workers/chunks/b09bc516b7a7bf5a44a8.js +0 -1
  142. package/assets/esri/core/workers/chunks/b370dae404d8ff733a54.js +0 -1
  143. package/assets/esri/core/workers/chunks/c2ba052733e8ccae82e1.js +0 -1
  144. package/assets/esri/core/workers/chunks/d7d2552ff3e2d44319c7.js +0 -1
  145. package/assets/esri/core/workers/chunks/f2c3b68f00f88700e698.js +0 -1
  146. package/assets/esri/core/workers/chunks/f4d9689194d8d2547bb1.js +0 -1
  147. package/assets/esri/core/workers/chunks/f91b811fa044a01b6bb3.js +0 -1
  148. package/chunks/SimpleGeometryCursor.js +0 -5
  149. package/geometry/operators/support/cursorUtils.js +0 -5
  150. package/views/2d/layers/features/support/tileUtils.js +0 -5
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
+ */
5
+ import{e as t,m as e,y as i,o as n,Z as s,J as o,A as a,G as r,a4 as m,a6 as u,a7 as c,a8 as h,s as l,al as _,am as d,an as p,ao as g,ap as x,aq as y,ar as P,as as S,at as f,O as G,au as D,av as v,L as T,p as w,a as b,t as M,aw as E,ax as C,I as R,B,ay as I,az as N,q as A,aA as q,a9 as F}from"./Polyline.js";import{OperatorShapePreservingDensify as X}from"./OperatorShapePreservingDensify.js";function k(){return new n}class Y{constructor(t,e,i){void 0!==t?this.reset(t,e,i):this.reset(1,0,1)}reset(t,e,i){this.m_a=t,this.m_e2=e,this.m_b=this.m_a*Math.sqrt(1-this.m_e2),this.m_unitToDegree=i,this.m_unitToRad=.017453292519943295*i,this.m_u180=180/this.m_unitToDegree,this.m_u360=360/this.m_unitToDegree}calculateBbox(t,e,i,n){const s={stack:[],error:void 0,hasError:!1};try{const o=m(s,new u,!1),a=m(s,new u,!1),r=m(s,new u,!1);c.geodeticDistance(this.m_a,this.m_e2,t*this.m_unitToRad,e*this.m_unitToRad,i*this.m_unitToRad,n*this.m_unitToRad,r,o,a,0);const h=Math.cos(o.val),l=Math.cos(a.val+3.141592653589793),_=e*this.m_unitToRad,d=B.phiToEta(this.m_e2,_),p=Math.sin(o.val)*Math.cos(d);let g=e;if(h*l<0){const t=h<0?-1:1,e=Math.acos(Math.abs(p))*t;g=B.etaToPhi(this.m_e2,e)/this.m_unitToRad}let x=I((i-t)*this.m_unitToRad,2*Math.PI);Math.abs(x)>Math.PI&&(x=x>0?x-2*Math.PI:x+2*Math.PI),x/=this.m_unitToRad,i=t+x;const y=k();return y.xmin=Math.min(t,i),y.xmax=Math.max(t,i),y.ymin=Math.min(e,n),y.ymin=Math.min(y.ymin,g),y.ymax=Math.max(e,n),y.ymax=Math.max(y.ymax,g),y}catch(o){s.error=o,s.hasError=!0}finally{h(s)}}minDistanceGeodesic(t,e){const i=O(t),n=O(e);if(i&&n)return this.lowerDistanceGeodetic_(t.xmin,t.ymin,e.xmin,e.ymin);const s=this.normalizeGeodesic_(e,t);return U(t,s)?t.ymin>=s.ymax?this.minDistanceGeodesicUpDown_(t,s):s.ymin>=t.ymax?this.minDistanceGeodesicUpDown_(s,t):t.xmin>s.xmax?this.minDistanceGeodesicLeftRight_(s,t):this.minDistanceGeodesicLeftRight_(t,s):0}sqrMaxMinDistanceGeodesic(t,e){return l(0),0}maxDistanceGeodesic(t,e){return l(0),0}sqrMinDistance(t,e){return l(0),0}sqrMaxDistance(t,e){return l(0),0}sqrMaxMinDistance(t,e){return l(0),0}calculateMaxDim(t){return l(0),0}lowerDistanceGeodesic(t,e,i,n){return l(0),0}upperDistanceGeodesic(t,e,i,n){return l(0),0}normalizeGeodesic_(t,e){const i=t.clone(),n=t.clone();let s=L(i,e);if(0===s)return i;for(;n.xmax>e.xmin;){n.xmin-=this.m_u360,n.xmax-=this.m_u360;const t=L(n,e);if(t<s&&(i.assign(n),s=t,0===s))return i}for(n.assign(t);n.xmin<e.xmax;){n.xmin+=this.m_u360,n.xmax+=this.m_u360;const t=L(n,e);if(t<s&&(i.assign(n),s=t,0===s))return i}return i}lowerDistanceGeodetic_(t,e,i,n){const s={stack:[],error:void 0,hasError:!1};try{const o=m(s,new u,!1);{const s=this.m_b*this.m_b/this.m_a,a=B.phiToPhig(this.m_e2,this.m_unitToRad*e),r=B.phiToPhig(this.m_e2,this.m_unitToRad*n);c.geodeticDistance(s,0,this.m_unitToRad*t,a,this.m_unitToRad*i,r,o,null,null,0)}return o.val}catch(o){s.error=o,s.hasError=!0}finally{h(s)}}upperDistanceGeodetic_(t,e,i,n){return l(0),0}minDistanceGeodesicUpDown_(t,e){if(e.xmin<=t.xmin?e.xmax>=t.xmin:t.xmax>=e.xmin)return this.lowerDistanceGeodetic_(0,t.ymin,0,e.ymax);if(e.xmin>t.xmax){const i=this.lowerDistanceGeodeticSegMeridional_(t.xmax,t.ymin,t.ymax,e.xmin,e.ymin,e.ymax);if(e.xmax-t.xmin<this.m_u180)return i;const n=this.lowerDistanceGeodeticSegMeridional_(t.xmin,t.ymin,t.ymax,e.xmax,e.ymin,e.ymax);return Math.min(i,n)}{const i=this.lowerDistanceGeodeticSegMeridional_(t.xmin,t.ymin,t.ymax,e.xmax,e.ymin,e.ymax);if(t.xmax-e.xmin<this.m_u180)return i;const n=this.lowerDistanceGeodeticSegMeridional_(t.xmax,t.ymin,t.ymax,e.xmin,e.ymin,e.ymax);return Math.min(i,n)}}minDistanceGeodesicLeftRight_(t,e){let i=Math.abs(t.xmax-e.xmin);for(;i>this.m_u180;)i-=this.m_u360;let n=Math.abs(t.xmin-e.xmax);for(;n>this.m_u180;)n-=this.m_u360;return Math.abs(i)<=Math.abs(n)?this.minDistanceGeodesicLeftRightNormalized_(t,e):this.minDistanceGeodesicLeftRightNormalized_(e,t)}minDistanceGeodesicLeftRightNormalized_(t,e){let i,n;return i=this.lowerDistanceGeodetic_(t.xmax,t.ymin,e.xmin,e.ymin),t.ymin>=e.ymin&&t.ymin<=e.ymax&&(n=this.lowerDistanceGeodeticPtMeridional_(t.xmax,t.ymin,e.xmin,e.ymin,e.ymax),i=Math.min(i,n)),e.ymin>=t.ymin&&e.ymin<=t.ymax&&(n=this.lowerDistanceGeodeticPtMeridional_(e.xmin,e.ymin,t.xmax,t.ymin,t.ymax),i=Math.min(i,n)),n=this.lowerDistanceGeodetic_(t.xmax,t.ymax,e.xmin,e.ymax),i=Math.min(i,n),t.ymax>=e.ymin&&t.ymax<=e.ymax&&(n=this.lowerDistanceGeodeticPtMeridional_(t.xmax,t.ymax,e.xmin,e.ymin,e.ymax),i=Math.min(i,n)),e.ymax>=t.ymin&&e.ymax<=t.ymax&&(n=this.lowerDistanceGeodeticPtMeridional_(e.xmin,e.ymax,t.xmax,t.ymin,t.ymax),i=Math.min(i,n)),i}normalizeDistance_(t){return l(0),0}lowerDistanceGeodeticSegMeridional_(t,e,i,n,s,o){let a=this.lowerDistanceGeodeticPtMeridional_(t,e,n,s,o);const r=this.lowerDistanceGeodeticPtMeridional_(t,i,n,s,o);let m=this.lowerDistanceGeodeticPtMeridional_(n,s,t,e,i);const u=this.lowerDistanceGeodeticPtMeridional_(n,o,t,e,i);return a=Math.min(a,r),m=Math.min(m,u),Math.min(a,m)}minDistanceGeodesicPointBox_(t,e,i){return l(0),0}lowerDistanceGeodeticPtMeridional_(e,i,n,s,o){const a={stack:[],error:void 0,hasError:!1};try{const l=this.m_b*this.m_b/this.m_a,_=B.phiToPhig(this.m_e2,this.m_unitToRad*i),g=B.phiToPhig(this.m_e2,this.m_unitToRad*s),x=B.phiToPhig(this.m_e2,this.m_unitToRad*o),y=m(a,new u,!1);c.geodeticDistance(l,0,this.m_unitToRad*n,g,this.m_unitToRad*e,_,y,null,null,0);const P=m(a,new u,!1);c.geodeticDistance(l,0,this.m_unitToRad*n,x,this.m_unitToRad*e,_,P,null,null,0);const S=d(1,0,new t(this.m_unitToRad*e,_)),f=d(1,0,new t(this.m_unitToRad*n,g)),G=d(1,0,new t(this.m_unitToRad*n,x));let D=new p;D.setCrossProductVector(f,G);const v=f.dotProduct(G);if(D.length()<1.568e-10)return v>=0?Math.min(y.val,P.val):0;D=D.getUnitVector();let T=new p;if(T.setCrossProductVector(D,S),T.length()<1.568e-10){return Math.min(y.val,P.val)-1e-5*l}T=T.getUnitVector();let w=S.sub(D.mul(S.dotProduct(D)));{const t=new p;t.setCrossProductVector(f,w);const i=new p;i.setCrossProductVector(w,G);let n=D.dotProduct(t)>0&&D.dotProduct(i)>0;if(n||(w.negateThis(),t.setCrossProductVector(f,w),i.setCrossProductVector(w,G),n=D.dotProduct(t)>0&&D.dotProduct(i)>0),n){const t={stack:[],error:void 0,hasError:!1};try{w=w.getUnitVector();const i=N(1,0,w),n=m(t,new u,!1);c.geodeticDistance(l,0,this.m_unitToRad*e,_,i.x,i.y,n,null,null,0);const s=Math.min(y.val,P.val);return Math.min(s,n.val)}catch(r){t.error=r,t.hasError=!0}finally{h(t)}}}return Math.min(y.val,P.val)}catch(l){a.error=l,a.hasError=!0}finally{h(a)}}fixAngle(t){return l(0),0}moveCloser(t,e){return l(0),0}}function O(t){return t.xmin===t.xmax&&t.ymin===t.ymax}function U(t,e){return e.xmax<t.xmin||e.xmin>t.xmax||e.ymax<t.ymin||e.ymin>t.ymax}function L(t,e){let i,n=0;return i=t.xmin-e.xmax,i>n&&(n=i),i=e.xmin-t.xmax,i>n&&(n=i),n}function V(){return{outPoint:new t,index:-1,t:Number.NaN}}function z(t,e,i,n){t.outPoint.assign(e),t.index=i,t.t=n}function H(t,e,i,n,s,o){if(t.getGeometryType()===r.enumPolygon){for(;n.nextPath();)if(n.hasNextSegment()){const e=n.nextSegment();if(0!==A(t,e.getEndXY(),0))return z(s,e.getEndXY(),-1,Number.NaN),z(o,e.getEndXY(),-1,Number.NaN),!0}n.resetToFirstPath()}if(e.getGeometryType()===r.enumPolygon){for(;i.nextPath();)if(i.hasNextSegment()){const t=i.nextSegment();if(0!==A(e,t.getEndXY(),0))return z(s,t.getEndXY(),-1,Number.NaN),z(o,t.getEndXY(),-1,Number.NaN),!0}i.resetToFirstPath()}return!1}function j(t){const e=t.getPathCount(),i=new Array(t.getSegmentCount());let n=0;for(let s=0;s<e;++s){const e=n+t.getSegmentCountPath(s);for(let o=n,a=t.getPathStart(s);o<e;++o,++a)i[o]=a;n=e}return q(i),i}class J{}function Z(e){return{outPoint:void 0===e?new t:e.clone()}}function K(t,e){t.outPoint.assign(e.outPoint)}function Q(){return new n}class W{constructor(e,i,n,s,o=0,a=4){this.m_ptDistFrom=new t,this.m_segStartPt=new t,this.m_segEndPt=new t,this.m_geodeticLength=new u,this.m_az12=new u,this.m_minGeodeticDist=new u,this.m_segStartPt3d=new p,this.m_segEndPt3d=new p,this.m_sr=s,this.m_distCurveType=o,this.m_segCurveType=a,this.m_inputGCS=this.m_sr.getGCS(),this.m_rpu=this.m_inputGCS.getUnit().getUnitToBaseFactor(),this.m_bIsPannablePcs=2===this.m_sr.getCoordinateSystemType()&&this.m_sr.isPannable();const r=F();this.m_inputGCS.querySpheroidData(r),this.m_a=r.majorSemiAxis,this.m_eSquared=r.e2,this.setPointDistFrom(e),this.setSegmentEndPoints(i,n)}setSegmentEndPoints(t,e){this.m_segStartPt.assign(t),this.m_segEndPt.assign(e),this.m_bIsPannablePcs||(this.m_segStartPt.mulThis(this.m_rpu),this.m_segEndPt.mulThis(this.m_rpu)),2===this.m_segCurveType&&(this.m_segStartPt3d.assign(d(this.m_a,this.m_eSquared,this.m_segStartPt)),this.m_segEndPt3d.assign(d(this.m_a,this.m_eSquared,this.m_segEndPt))),this.calculateAndUpdateSegmentLength()}setPointDistFrom(t){this.m_ptDistFrom.assign(t),this.m_ptDistFrom.scale(this.m_rpu)}setSegmentCurveType(t){this.m_segCurveType=t}setDistanceCurveType(t){this.m_distCurveType=t}makeFunctor(){return e=>{let i;switch(this.m_segCurveType){case 0:case 1:case 3:{const s={stack:[],error:void 0,hasError:!1};try{const n=m(s,new u,!1),o=m(s,new u,!1);c.geodeticCoordinate(this.m_a,this.m_eSquared,this.m_segStartPt.x,this.m_segStartPt.y,this.m_geodeticLength.val*e,this.m_az12.val,n,o,this.m_segCurveType),i=new t(n.val,o.val);break}catch(n){s.error=n,s.hasError=!0}finally{h(s)}}case 2:{const t=p.lerp(this.m_segStartPt3d,this.m_segEndPt3d,e);i=N(this.m_a,this.m_eSquared,t);break}case 4:i=t.lerp(this.m_segStartPt,this.m_segEndPt,e),this.m_bIsPannablePcs&&(y(this.m_sr,0,[i],1),i.mulThis(this.m_rpu));break;default:M("Invalid curve type")}return c.geodeticDistance(this.m_a,this.m_eSquared,this.m_ptDistFrom.x,this.m_ptDistFrom.y,i.x,i.y,this.m_minGeodeticDist,null,null,this.m_distCurveType),this.m_minGeodeticDist.val}}calculateAndUpdateSegmentLength(){switch(this.m_segCurveType){case 0:case 2:case 1:case 3:c.geodeticDistance(this.m_a,this.m_eSquared,this.m_segStartPt.x,this.m_segStartPt.y,this.m_segEndPt.x,this.m_segEndPt.y,this.m_geodeticLength,this.m_az12,null,this.m_segCurveType);break;case 4:this.m_geodeticLength.val=t.distance(this.m_segStartPt,this.m_segEndPt);break;default:M("Invalid curve type")}}[Symbol.dispose](){this.m_geodeticLength[Symbol.dispose](),this.m_az12[Symbol.dispose](),this.m_minGeodeticDist[Symbol.dispose]()}}function $(){return new J}class tt{constructor(t,e,i,o,a){this.m_boxGeomA=Q(),this.m_boxGeomB=Q(),this.m_envGeomA=new n,this.m_envGeomB=new n,this.m_transformPCS2GCS=null,this.m_segmentBoxesA=new Map,this.m_segmentBoxesB=new Map,this.m_boundaryPtsA=[],this.m_boundaryPtsB=[],this.m_scaleToRadians=new s,this.m_scaleToDegrees=new s,this.m_inputSR=t,this.m_distCurveType=e,this.m_progressTracker=i,this.m_maxDistance=o,this.m_maxDeviation=a,this.m_inputGCS=t.getGCS(),this.m_peGeogcs=this.m_inputGCS.getPECoordSys(),this.m_tolerance=0;const r=F();this.m_inputGCS.querySpheroidData(r),this.m_a=r.majorSemiAxis,this.m_eSquared=r.e2,this.m_rpu=this.m_inputGCS.getUnit().getUnitToBaseFactor(),this.m_envHelper=new Y(this.m_a,this.m_eSquared,1),4===this.m_distCurveType&&(this.m_distCurveType=0),this.m_boxGeomA.setEmpty(),this.m_boxGeomB.setEmpty(),this.m_envGeomA.setEmpty(),this.m_envGeomB.setEmpty(),this.m_bIsPannablePcs=2===this.m_inputSR.getCoordinateSystemType()&&this.m_inputSR.isPannable()}calculate(t,e,i,n){const s=Z(),o=Z();if(t.queryEnvelope(this.m_envGeomA),e.queryEnvelope(this.m_envGeomB),this.checkGeometriesIntersect(t,e,s,o))return i&&K(i,s),n&&K(n,o),0;const a=this.prepareGeometry(t);if(a.isEmpty())return Number.NaN;const r=this.prepareGeometry(e);if(r.isEmpty())return Number.NaN;this.m_tolerance=this.computeTolerance(a,r);const m=this._ExecuteBruteForce(a,r,s,o);return m>this.m_maxDistance?Number.NaN:(i&&(this.prepareOutput(s),K(i,s)),n&&(this.prepareOutput(o),K(n,o)),m)}createDistanceFunctor(t,e,i){const n=new W(t,e,i,this.m_inputSR,this.m_distCurveType);return this.m_bIsPannablePcs||1===this.m_inputSR.getCoordinateSystemType()||n.setSegmentCurveType(2),n}_NormalizeAndProject(t){if(this.m_inputSR.isPannable()&&(t=(new o).foldInto360Range(t,this.m_inputSR)),2===this.m_inputSR.getCoordinateSystemType()){const e=a(this.m_inputSR,this.m_inputGCS,null);t=(new o).execute(t,e,this.m_progressTracker)}return t}_ExecuteBruteForce(t,i,n,s){switch(t.getGeometryType()){case r.enumPoint:return this.calculateDistanceGeodeticPointGeometry(t,i,n,s);case r.enumMultiPoint:return this.calculateDistanceGeodeticMultipointGeometry(t,i,n,s);case r.enumPolyline:case r.enumPolygon:case r.enumEnvelope:return this.calculateDistanceGeodeticMultipathGeometry(t,i,n,s);default:e("")}}calculateDistanceGeodeticPointGeometry(t,i,n,s){switch(i.getGeometryType()){case r.enumPoint:return this.calculateDistanceGeodeticPointPoint(t,i,n,s);case r.enumMultiPoint:return this.calculateDistanceGeodeticPointMultipoint(t,i,n,s);case r.enumPolyline:case r.enumPolygon:return this.calculateDistanceGeodeticPointMultipath(t,i,n,s);default:e("")}}calculateDistanceGeodeticPointPoint(t,e,i,n){const s={stack:[],error:void 0,hasError:!1};try{const o=t.getXY();o.scale(this.m_rpu);const a=e.getXY();a.scale(this.m_rpu),i.outPoint.assign(o),n.outPoint.assign(a);const r=m(s,new u,!1);return c.geodeticDistance(this.m_a,this.m_eSquared,o.x,o.y,a.x,a.y,r,null,null,this.m_distCurveType),r.val}catch(o){s.error=o,s.hasError=!0}finally{h(s)}}calculateDistanceGeodeticPointMultipoint(t,e,i,n){return l(0),0}calculateDistanceGeodeticPointMultipath(e,i,n,s){const o={stack:[],error:void 0,hasError:!1};try{const a=new t,r=new t;a.assign(e.getXY()),r.assign(e.getXY()),n.outPoint.assign(r.mul(this.m_rpu)),this.m_bIsPannablePcs&&_(this.m_inputSR,[a],1,!1),this.computeEnvelopesAndBoxes(e,i);const u=this.estimateMinimumDistance(n,s);let c=u<this.m_maxDistance?u:this.m_maxDistance;const h=i.getImpl(),d=new t(0,0),p=new t(0,0),g=[1],x=this.canUseSpatialTree(e,i),y=$();x&&this.buildSpatialTree(y,i);const P=Q();P.setCoords({xmin:r.x,ymin:r.y,xmax:r.x,ymax:r.y});const S=m(o,this.createDistanceFunctor(r,d,p),!1),f=h.querySegmentIterator();f.stripAttributes();if(x)l(0);else for(;f.nextPath();)for(;f.hasNextSegment();){const t=f.nextSegment(),e=this.findOrComputeBoxSegment(f.getStartPointIndex(),t,this.m_segmentBoxesB);if(this.m_envHelper.minDistanceGeodesic(P,e)>c)continue;const i=this.calculateDistanceGeodeticPointSegment(a,r,t,g,S);if(i.second<c&&(this.updateOutputSegment(s,t,i.first),c=i.second,0===c))return 0}return c===this.m_maxDistance?Number.POSITIVE_INFINITY:c}catch(a){o.error=a,o.hasError=!0}finally{h(o)}}calculateDistanceGeodeticMultipointGeometry(t,i,n,s){switch(i.getGeometryType()){case r.enumPoint:return this.calculateDistanceGeodeticPointMultipoint(i,t,s,n);case r.enumMultiPoint:return this.calculateDistanceGeodeticMultipointMultipoint(t,i,n,s);case r.enumPolyline:case r.enumPolygon:case r.enumEnvelope:return this.calculateDistanceGeodeticMultipointMultipath(t,i,n,s);default:e("")}}calculateDistanceGeodeticMultipointMultipoint(e,i,n,s){const o={stack:[],error:void 0,hasError:!1};try{const a=m(o,new u,!1);this.computeEnvelopesAndBoxes(e,i);const r=this.estimateMinimumDistance(n,s);let h=r<this.m_maxDistance?r:this.m_maxDistance;const l=new t,_=new t,g=e.getImpl(),x=i.getImpl(),y=Q(),P=g.getPointCount(),S=x.getPointCount();for(let t=0;t<P;++t){if(l.assign(g.getXY(t)),y.setCoords({xmin:l.x,ymin:l.y,xmax:l.x,ymax:l.y}),this.m_envHelper.minDistanceGeodesic(y,this.m_boxGeomB)>h)continue;l.scale(this.m_rpu);const e=d(this.m_a,this.m_eSquared,l);for(let t=0;t<S;++t){_.assign(x.getXY(t)),_.scale(this.m_rpu);const i=d(this.m_a,this.m_eSquared,_);if(!(p.distance(e,i)>=h)&&(c.geodeticDistance(this.m_a,this.m_eSquared,l.x,l.y,_.x,_.y,a,null,null,this.m_distCurveType),a.val<h&&(n.outPoint.assign(l),s.outPoint.assign(_),h=a.val,0===h)))return h}}return h===this.m_maxDistance?Number.POSITIVE_INFINITY:h}catch(a){o.error=a,o.hasError=!0}finally{h(o)}}calculateDistanceGeodeticMultipointMultipath(e,i,n,s){const o={stack:[],error:void 0,hasError:!1};try{const a=i.getImpl().querySegmentIterator();a.stripAttributes(),this.computeEnvelopesAndBoxes(e,i);const r=this.estimateMinimumDistance(n,s);let u=r<this.m_maxDistance?r:this.m_maxDistance;const c=new t,h=new t(0,0),d=new t(0,0),p=new t(0,0),g=[0],x=Q(),y=m(o,this.createDistanceFunctor(h,d,p),!1),P=$(),S=this.canUseSpatialTree(e,i);S&&this.buildSpatialTree(P,i);const f=e.getPointCount();for(let t=0;t<f;++t)if(c.assign(e.getXY(t)),h.assign(e.getXY(t)),this.m_bIsPannablePcs&&_(this.m_inputSR,[c],1,!1),x.setCoords({xmin:h.x,ymin:h.y,xmax:h.x,ymax:h.y}),!(this.m_envHelper.minDistanceGeodesic(x,this.m_boxGeomB)>u))if(y.setPointDistFrom(h),S)l(0);else{for(;a.nextPath();)for(;a.hasNextSegment();){const t=a.nextSegment();if(this.m_envHelper.minDistanceGeodesic(x,this.findOrComputeBoxSegment(a.getStartPointIndex(),t,this.m_segmentBoxesB))>u)continue;const e=this.calculateDistanceGeodeticPointSegment(c,h,t,g,y);if(e.second<u&&(n.outPoint.assign(h.mul(this.m_rpu)),this.updateOutputSegment(s,t,e.first),u=e.second,0===u))return 0}a.resetToFirstPath()}return u===this.m_maxDistance?Number.POSITIVE_INFINITY:u}catch(a){o.error=a,o.hasError=!0}finally{h(o)}}calculateDistanceGeodeticMultipathGeometry(t,i,n,s){switch(i.getGeometryType()){case r.enumPoint:return this.calculateDistanceGeodeticPointMultipath(i,t,s,n);case r.enumMultiPoint:return this.calculateDistanceGeodeticMultipointMultipath(i,t,s,n);case r.enumPolyline:case r.enumPolygon:case r.enumEnvelope:return this.calculateDistanceGeodeticMultipathMultipath(t,i,n,s);default:e("")}}calculateDistanceGeodeticMultipathMultipath(t,e,i,n){const s=[t],o=[e],a=this.swapGeometries(s,o),r=s[0],m=o[0];this.computeEnvelopesAndBoxes(s[0],o[0]);const u=this.estimateMinimumDistance(i,n),c=this.calculateDistanceGeodeticMultipathMultipath_(r,m,i,n,u);return a&&(n.outPoint=g(i.outPoint,i.outPoint=n.outPoint)),c}calculateDistanceGeodeticMultipathMultipath_(e,i,n,s,o=Number.MAX_VALUE){const a={stack:[],error:void 0,hasError:!1};try{let r=o;const u=new t(0,0),c=new t,h=new t(0,0),_=new t,d=new t(0,0),p=new t,g=new t,S=new t,f=[new t],G=[0],D=[0],v=Q(),T=Q(),w=m(a,this.createDistanceFunctor(d,u,h),!1),b=$(),M=this.canUseSpatialTree(e,i);M&&this.buildSpatialTree(b,i);const E=i.querySegmentIterator();E.stripAttributes();const C=new x,R=j(e);for(let t=0;t<R.length;++t){const i=R[t];e.getSegmentBuffer(i,C,!0);const o=C.get();if(v.assign(this.findOrComputeBoxSegment(i,o,this.m_segmentBoxesA)),M)l(0);else{if(d.assign(o.getStartXY()),p.assign(o.getStartXY()),g.assign(o.getEndXY()),S.assign(o.getEndXY()),this.m_bIsPannablePcs&&(y(this.m_inputSR,0,[p],1),y(this.m_inputSR,0,[S],1)),this.m_envHelper.minDistanceGeodesic(v,this.m_boxGeomB)>r)continue;for(;E.nextPath();){for(;E.hasNextSegment();){const t=E.nextSegment();if(u.assign(t.getStartXY()),c.assign(t.getStartXY()),h.assign(t.getEndXY()),_.assign(t.getEndXY()),o.intersect(t,f,G,D,this.m_tolerance))return this.updateOutputSegment(n,o,G[0]),this.updateOutputSegment(s,t,D[0]),0;if(this.m_bIsPannablePcs&&(y(this.m_inputSR,0,[c],1),y(this.m_inputSR,0,[_],1)),T.assign(this.findOrComputeBoxPoint(E.getStartPointIndex(),c,_,this.m_segmentBoxesB)),this.m_envHelper.minDistanceGeodesic(v,T)>r)continue;w.setSegmentEndPoints(u,h),w.setPointDistFrom(p);let e=P(w.makeFunctor(),0,1,1e-10);if(e.second<r&&(n.outPoint.assign(p.mul(this.m_rpu)),this.updateOutputSegment(s,t,e.first),r=e.second,0===r))break;if(w.setPointDistFrom(S),e=P(w.makeFunctor(),0,1,1e-10),e.second<r&&(n.outPoint.assign(S.mul(this.m_rpu)),this.updateOutputSegment(s,t,e.first),r=e.second,0===r))break;if(w.setSegmentEndPoints(d,g),w.setPointDistFrom(c),e=P(w.makeFunctor(),0,1,1e-10),e.second<r&&(this.updateOutputSegment(n,o,e.first),s.outPoint.assign(c.mul(this.m_rpu)),r=e.second,0===r))break;if(w.setPointDistFrom(_),e=P(w.makeFunctor(),0,1,1e-10),e.second<r&&(this.updateOutputSegment(n,o,e.first),s.outPoint.assign(_.mul(this.m_rpu)),r=e.second,0===r))break}if(0===r)return 0}E.resetToFirstPath()}}return r===this.m_maxDistance?Number.POSITIVE_INFINITY:r}catch(r){a.error=r,a.hasError=!0}finally{h(a)}}calculateDistanceGeodeticPointSegment(t,e,i,n,s){const o=i.getStartXY(),a=i.getEndXY();return i.intersectPoint(t,n,this.m_tolerance)?S(n[0],0):(s.setPointDistFrom(e),s.setSegmentEndPoints(o,a),P(s.makeFunctor(),0,1,1e-10))}prepareGeometry(t){let e=t.clone();const i=t.getGeometryType();if(i===r.enumPoint||i===r.enumMultiPoint)return this._NormalizeAndProject(e);if(i===r.enumEnvelope&&(e=this.envelopeToPolygon(e)),this.m_inputSR.isPannable())return this.prepareGeometryPannable(e,4);if(2===this.m_inputSR.getCoordinateSystemType()){if(e=f(e,this.m_inputSR,0,null),e.isEmpty())return e;e=(new X).execute(e,this.m_inputSR,5e4,this.m_maxDeviation/2,0,null);const t=this.m_inputSR.getSRToGCSTransform();return(new o).execute(e,t,this.m_progressTracker)}const s=new n;e.queryLooseEnvelope(s);const a=this.m_inputSR.getPannableExtent();if(s.ymin<a.ymin||s.ymax>a.ymax){const t=new n(s.xmin-1,a.ymin,s.xmax+1,a.ymax);if(e=(new G).execute(e,t,this.m_inputSR,this.m_progressTracker),e.isEmpty())return e}return s.width()>2*a.width()?(e=D(e,-2*a.width(),2*a.width(),this.m_inputSR,!0,0,!0,this.m_progressTracker),e):e}prepareGeometryPannable(t,e){const i=new n;t.queryEnvelope(i);const s=this.m_inputSR.getPannableExtent();if(s.containsEnvelope(i))return t;const a=new v;s.queryIntervalX(a);const r=new v;return i.queryIntervalX(r),t=a.contains(r)?T(t,this.m_inputSR):(new o).foldInto360RangeGeodetic(t,this.m_inputSR,e)}prepareOutput(t){t.outPoint.scale(1/this.m_rpu),2===this.m_inputSR.getCoordinateSystemType()&&_(this.m_inputSR,[t.outPoint],1,!1)}updateOutputSegment(t,e,i){e.queryCoord2D(i,t.outPoint),this.m_bIsPannablePcs&&y(this.m_inputSR,0,[t.outPoint],1),t.outPoint.mulThis(this.m_rpu)}updateOutputPoint2D(t,e){l(0)}computeTolerance(t,e){t.queryEnvelope(this.m_envGeomA),e.queryEnvelope(this.m_envGeomB);const i=new n(this.m_envGeomA);return i.mergeEnvelope2D(this.m_envGeomB),w(null,i)}envelopeToPolygon(t){const e=new b;return e.addEnvelope(t,!1),e}computeEnvelopesAndBoxes(t,e){t.queryEnvelope(this.m_envGeomA),e.queryEnvelope(this.m_envGeomB),this.m_boxGeomA=this.computeBoxGeometry(t,this.m_boundaryPtsA,this.m_segmentBoxesA),this.m_boxGeomB=this.computeBoxGeometry(e,this.m_boundaryPtsB,this.m_segmentBoxesB)}computeBoxGeometry(t,e,i){switch(t.getGeometryType()){case r.enumPoint:return this.computeBoxPoint(t,e);case r.enumMultiPoint:return this.computeBoxMultiPoint(t,e);case r.enumPolyline:case r.enumPolygon:return this.computeBoxMultiPath(t,e,i);default:M("Invalid geometry type")}}computeBoxPoint(t,e){const i=t.getXY();e.length=1,e[0]=i.mul(this.m_rpu);const n=Q();return n.setCoords({xmin:i.x,ymin:i.y,xmax:i.x,ymax:i.y}),n}computeBoxSegment(t){return l(0),{}}computeBoxMultiPoint(t,e){let i=!0;for(let s=0;s<t.getPointCount();++s){const n=t.getXY(s);if(i){e.length=4;for(let t=0;t<e.length;++t)e[t]=n.clone();i=!1}n.x<e[0].x&&(e[0]=n),n.y>e[1].y&&(e[1]=n),n.x>e[2].x&&(e[2]=n),n.y<e[3].y&&(e[3]=n)}for(let s=0;s<e.length;++s)e[s].mulThis(this.m_rpu);const n=Q();return t.queryEnvelope(n),n}computeBoxMultiPath(t,e,i){let n=!0;const s=Q();s.setEmpty();const o=t.querySegmentIterator();for(o.stripAttributes();o.nextPath();)for(;o.hasNextSegment();){const t=o.nextSegment(),a=t.getStartXY(),r=t.getEndXY();if(this.m_bIsPannablePcs&&(y(this.m_inputSR,0,[a],1),y(this.m_inputSR,0,[r],1)),n){e.length=4;for(let t=0;t<e.length;++t)e[t]=a.clone();n=!1}a.x<e[0].x&&e[0].assign(a),a.y>e[1].y&&e[1].assign(a),a.x>e[2].x&&e[2].assign(a),a.y<e[3].y&&e[3].assign(a),r.x<e[0].x&&e[0].assign(r),r.y>e[1].y&&e[1].assign(r),r.x>e[2].x&&e[2].assign(r),r.y<e[3].y&&e[3].assign(r);const m=this.findOrComputeBoxPoint(o.getStartPointIndex(),a,r,i);s.mergeEnvelope2D(m)}for(let a=0;a<e.length;++a)e[a].mulThis(this.m_rpu);return s}findOrComputeBoxSegment(e,i,n){if(!n.has(e)){let s=Q();if(i.queryEnvelope(s),this.m_bIsPannablePcs){const e=t.construct(s.xmin,s.ymin),i=t.construct(s.xmax,s.ymax);y(this.m_inputSR,0,[e],1),y(this.m_inputSR,0,[i],1),s=this.m_envHelper.calculateBbox(e.x,e.y,i.x,i.y)}return n.set(e,s),s}return n.get(e)}findOrComputeBoxPoint(t,e,i,n){if(!n.has(t)){let s=Q();return s.setCoords({xmin:e.x,ymin:e.y,xmax:i.x,ymax:i.y}),this.m_bIsPannablePcs&&(s=this.m_envHelper.calculateBbox(s.xmin,s.ymin,s.xmax,s.ymax)),n.set(t,s),s}return n.get(t)}checkPointInPolygon(t,e){return l(0),!1}estimateMinimumDistance(t,e){const i={stack:[],error:void 0,hasError:!1};try{const n=t=>d(this.m_a,this.m_eSquared,t),s=this.m_boundaryPtsA.map(n),o=this.m_boundaryPtsB.map(n);let a=Number.MAX_VALUE,r=0,h=0;for(let t=0;t<s.length;++t)for(let e=0;e<o.length;++e){const i=p.distance(s[t],o[e]);i<a&&(a=i,r=t,h=e)}t.outPoint.assign(this.m_boundaryPtsA[r]),e.outPoint.assign(this.m_boundaryPtsB[h]);const l=m(i,new u,!1);return c.geodeticDistance(this.m_a,this.m_eSquared,this.m_boundaryPtsA[r].x,this.m_boundaryPtsA[r].y,this.m_boundaryPtsB[h].x,this.m_boundaryPtsB[h].y,l,null,null,this.m_distCurveType),l.val}catch(n){i.error=n,i.hasError=!0}finally{h(i)}}swapGeometries(t,e){return E(t[0])>E(e[0])&&(e[0]=g(t[0],t[0]=e[0]),this.m_envGeomB=g(this.m_envGeomA,this.m_envGeomA=this.m_envGeomB),!0)}canUseSpatialTree(t,e){return!1}checkGeometriesIntersect(t,e,i,n){let s=t.getGeometryType(),o=e.getGeometryType();if(this.m_envGeomA.isIntersecting(this.m_envGeomB)){if(s===r.enumPoint&&2===e.getDimension()){const s=[0],o=[t.getXY()];if(C(e,o,1,this.m_tolerance,s),0!==s[0])return i.outPoint.assign(o[0]),n.outPoint.assign(o[0]),!0}else if(o===r.enumPoint&&2===t.getDimension()){const s=[2],o=[e.getXY()];if(C(t,o,1,this.m_tolerance,s),0!==s[0])return i.outPoint.assign(o[0]),n.outPoint.assign(o[0]),!0}if(s===r.enumMultiPoint&&2===e.getDimension())return this.multipointIntersectsArea(t,e,i,n);if(o===r.enumMultiPoint&&2===t.getDimension())return this.multipointIntersectsArea(e,t,n,i);let a,m,u=t,c=e;if(s===r.enumEnvelope&&(a=this.envelopeToPolygon(t),u=a,s=r.enumPolygon),o===r.enumEnvelope&&(m=this.envelopeToPolygon(e),c=m,o=r.enumPolygon),R(s)&&R(o)){const t=u.querySegmentIterator(),e=c.querySegmentIterator(),s=V();if(H(u,c,t,e,s,V()))return i.outPoint.assign(s.outPoint),n.outPoint.assign(s.outPoint),!0}}return!1}multipointIntersectsArea(t,e,i,n){return l(0),!1}getNearestNeighbourVisitor(t,e,i,n,s,o,a){return l(0),{}}buildSpatialTree(t,e){l(0)}}class et{getOperatorType(){return 10316}supportsCurves(){return!0}accelerateGeometry(t,e,i){return!1}canAccelerateGeometry(t){return!1}execute(t,e,i,n,s){return this.executeEx(t,e,i,n,s,null,null,Number.NaN)}executeEx(t,n,s,o,a,r,m,u){if(s&&0!==s.getCoordinateSystemType()||e(""),i(t),i(n),t.isEmpty()||n.isEmpty())return Number.NaN;Number.isNaN(u)&&(u=Number.MAX_VALUE);const c=new tt(s,o,a,u,1),h=Z(),l=Z(),_=c.calculate(t,n,h,l);return r&&r.outPoint.assign(h.outPoint),m&&m.outPoint.assign(l.outPoint),_}}export{et as OperatorGeodeticDistance,Z as makeOutput};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
+ */
5
+ import{e,m as t,n,G as r,o as s,p as o,q as i,r as a,s as u}from"./Polyline.js";function c(e,t,n=-1,o=-1){if(e.isEmpty())return 3;const i=e.getGeometryType();if(a(i))return m(e,t,n,o);if(i===r.enumPolygon)return l();if(i===r.enumPolyline)return g();if(i===r.enumEnvelope){const n=new s;return e.queryEnvelope(n),n.contains(t)?n.containsExclusive(t)?1:2:0}return 3}function m(n,r,s,o){if(s>=0||o>=0)return t("");if(n.isDegenerate(0))return n.getStartXY().equals(r)?2:3;if(!n.isCurve()){const t=e.orientationRobust(r,n.getStartXY(),n.getEndXY());return t<0?1:t>0?0:2}const i=n.getClosestCoordinate(r,!1),a=n.getTangent(i),u=n.getCoord2D(i),c=e.orientationRobust(r,u,u.add(a));return c<0?1:c>0?0:2}function l(e,t,n,r){return u(0),3}function g(e,t,n,r){return u(0),3}const y=N(new e,-1,Number.NaN);function N(e,t,n){return{m_coordinate:e.clone(),m_vertexIndex:t,m_geometryIndex:0,m_distance:n,m_bRightSide:!1,isEmpty:d}}function d(){return Number.isNaN(this.m_distance)}class f{getOperatorType(){return 10500}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}getNearestCoordinate(e,s,o,i){if(s.isNAN()&&t("NAN xy coordinates are not allowed"),e.isEmpty())return y;switch(e.getGeometryType()){case r.enumPoint:return this.pointGetNearestVertex(e,s);case r.enumMultiPoint:return this.multiVertexGetNearestVertex(e,s);case r.enumPolyline:case r.enumPolygon:return this.multiPathGetNearestCoordinate(e,s,o,i);default:n("")}}getNearestVertex(e,s){if(s.isNAN()&&t("NAN xy coordinates are not allowed"),e.isEmpty())return y;switch(e.getGeometryType()){case r.enumPoint:return this.pointGetNearestVertex(e,s);case r.enumMultiPoint:case r.enumPolyline:case r.enumPolygon:return this.multiVertexGetNearestVertex(e,s);default:n("")}}getNearestVertices(e,s,o,i){if(0===i&&t(""),s.isNAN()&&t("NAN xy coordinates are not allowed"),e.isEmpty())return[];switch(e.getGeometryType()){case r.enumPoint:return this.pointGetNearestVertices(e,s,o,i);case r.enumMultiPoint:case r.enumPolyline:case r.enumPolygon:return this.multiVertexGetNearestVertices(e,s,o,i);default:n("")}}multiPathGetNearestCoordinate(n,a,u,m){if(n.getGeometryType()===r.enumPolygon&&u){const e=new s;n.queryEnvelope(e);const t=o(null,e,!1);let r;if(r=i(n,a,m?0:t),0!==r){const e=N(a,-1,0);return m&&(e.m_bRightSide=!0),e}}const l=n.querySegmentIterator(),g=new e;let y=-1,d=-1,f=Number.MAX_VALUE,p=0;for(;l.nextPath();)for(;l.hasNextSegment();){const t=l.nextSegment(),n=t.getClosestCoordinate(a,!1),r=t.getCoord2D(n),s=e.sqrDistance(r,a);s<f?(p=1,g.assign(r),y=l.getStartPointIndex(),d=l.getPathIndex(),f=s):s===f&&p++}-1===y&&t("");const x=N(g,y,Math.sqrt(f));if(m)if(n.getGeometryType()!==r.enumPolygon){let e=!1;if(p>1){const t=c(n,a,y,d);e=0!==t&&3!==t}else{l.resetToVertex(y,d);e=0!==c(l.nextSegment(),a)}x.m_bRightSide=e}else if(!u){0!==i(n,a,0)&&(x.m_bRightSide=!0)}return x}pointGetNearestVertex(t,n){const r=t.getXY();return N(r,0,e.distance(r,n))}multiVertexGetNearestVertex(t,n){const r=t.getAttributeStreamRef(0),s=t.getPointCount();let o=-1;const i=new e;let a=Number.MAX_VALUE;const u=new e;for(let c=0;c<s;c++){r.queryPoint2D(2*c,u);const t=e.sqrDistance(u,n);t<a&&(i.assign(u),o=c,a=t)}return N(i,o,Math.sqrt(a))}pointGetNearestVertices(t,n,r,s){const o=[];if(0!==s){const s=r*r,i=t.getXY(),a=e.sqrDistance(i,n);a<=s&&o.push(N(i,0,Math.sqrt(a)))}return o}multiVertexGetNearestVertices(t,n,r,s){const o=[];if(0!==s){const i=t.getAttributeStreamRef(0),a=t.getPointCount();o.length=s+1;const u=r*r;for(let t=0;t<a;t++){const r=i.read(2*t),s=i.read(2*t+1),a=n.x-r,c=n.y-s,m=a*a+c*c;m<=u&&o.push(N(e.construct(r,s),t,Math.sqrt(m)))}o.sort(((e,t)=>e.m_distance-t.m_distance))}return o.slice(0,s)}}export{f as O};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{S as e}from"./SimpleGeometryCursor.js";import{OperatorGeodeticDensifyCursor as r}from"./OperatorGeodeticDensifyByLength.js";class t{getOperatorType(){return 10317}supportsCurves(){return!0}accelerateGeometry(e,r,t){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,n,o,s,u){return new r(e,t,4,n,o,s,u)}execute(r,t,n,o,s,u){const c=new e([r]);return this.executeMany(c,t,n,o,s,u).next()}}export{t as OperatorShapePreservingDensify};
5
+ import{S as e}from"./Polyline.js";import{OperatorGeodeticDensifyCursor as r}from"./OperatorGeodeticDensifyByLength.js";class t{getOperatorType(){return 10317}supportsCurves(){return!0}accelerateGeometry(e,r,t){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,n,o,c,s){return new r(e,t,4,n,o,c,s)}execute(r,t,n,o,c,s){const u=new e([r]);return this.executeMany(u,t,n,o,c,s).next()}}export{t as OperatorShapePreservingDensify};