@arcgis/core 4.32.0-next.20250101 → 4.32.0-next.20250103
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.
- package/Color.js +1 -1
- package/PopupTemplate.js +1 -1
- package/arcade/functions/date.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/featuresetstats.js +1 -1
- package/arcade/functions/featuresetstring.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geometry.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/functions/knowledgegraph.js +1 -1
- package/arcade/functions/string.js +1 -1
- package/arcade/geometry/extendedUnitData.js +5 -0
- package/arcade/geometry/functions.js +5 -0
- package/arcade/geometry/operators.js +5 -0
- package/arcade/geometry/unitConversion.js +5 -0
- package/arcade/geometry/wkt.js +5 -0
- package/arcade/languageUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{e371f4f0eb3c22f222df.js → 005727711cca0614c2ab.js} +2 -2
- package/assets/esri/core/workers/chunks/{e371f4f0eb3c22f222df.js.LICENSE.txt → 005727711cca0614c2ab.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{2d908c115ea18e813b95.js → 00c0fbe19c12691cf2c3.js} +1 -1
- package/assets/esri/core/workers/chunks/08e28328385066c519c2.js +1 -0
- package/assets/esri/core/workers/chunks/{0e735d01296d340b393e.js → 0b95ec12218f3c04df18.js} +1 -1
- package/assets/esri/core/workers/chunks/{59bf879b4802a5ba431e.js → 0ee669947c23f469e357.js} +1 -1
- package/assets/esri/core/workers/chunks/116103ecec27cce47a2f.js +1 -0
- package/assets/esri/core/workers/chunks/11f00218905f0db447ff.js +1 -0
- package/assets/esri/core/workers/chunks/14b87f3dd9942e6b19d0.js +1 -0
- package/assets/esri/core/workers/chunks/16d7c07e1c11b88dae84.js +1 -0
- package/assets/esri/core/workers/chunks/1d04fe800cb98e4d6bc4.js +1 -0
- package/assets/esri/core/workers/chunks/{71f6e5742cf0c482066b.js → 1dc6b5b177022b80c473.js} +1 -1
- package/assets/esri/core/workers/chunks/{59455e2dd44b4c01cc76.js → 2586741c359057b3f626.js} +1 -1
- package/assets/esri/core/workers/chunks/{250a810dd4e1ff293564.js → 318a39b56851e707edad.js} +1 -1
- package/assets/esri/core/workers/chunks/{b1e4813f0c73fc2a483c.js → 370b230fd2d7703d0698.js} +2 -2
- package/assets/esri/core/workers/chunks/{b1e4813f0c73fc2a483c.js.LICENSE.txt → 370b230fd2d7703d0698.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/38d03fe352057fb375b5.js +1 -0
- package/assets/esri/core/workers/chunks/{ebf9caf2dc8af89afec2.js → 42aa697b4718b75b8cb2.js} +2 -2
- package/assets/esri/core/workers/chunks/{ebf9caf2dc8af89afec2.js.LICENSE.txt → 42aa697b4718b75b8cb2.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{801dbea20966806db1c9.js → 53cd990b2c988518de6d.js} +1 -1
- package/assets/esri/core/workers/chunks/5a1eb0d1e25ff5574c43.js +1 -0
- package/assets/esri/core/workers/chunks/6157c49e7431f5868c77.js +1 -0
- package/assets/esri/core/workers/chunks/{eef2d94a73064f9bc085.js → 61d64f163840563017d5.js} +1 -1
- package/assets/esri/core/workers/chunks/6d218fb5e0f0a04d72c5.js +2 -0
- package/assets/esri/core/workers/chunks/{d82b3e2905cab511ff3a.js.LICENSE.txt → 6d218fb5e0f0a04d72c5.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/6ed57d01be6bc054c7cd.js +1 -0
- package/assets/esri/core/workers/chunks/7254956381e823219db0.js +1 -0
- package/assets/esri/core/workers/chunks/740e6bdb3b76f2ea6d61.js +1 -0
- package/assets/esri/core/workers/chunks/756c2f7c8659deab6c96.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{56fc353421252f2d0a99.js → 75e8ba7e02647b7216ae.js} +1 -1
- package/assets/esri/core/workers/chunks/89d7eec47e5b29935d92.js +1 -0
- package/assets/esri/core/workers/chunks/8cd2c9ec1e541836b81c.js +1 -0
- package/assets/esri/core/workers/chunks/{0b3e1e903120da297641.js → 932375de79e3d33bc4d7.js} +1 -1
- package/assets/esri/core/workers/chunks/{263adfd1c2641ef5c0f5.js → 95f23bd17ce9e07fc8ef.js} +1 -1
- package/assets/esri/core/workers/chunks/{7de9c01849c4aa1940e7.js → 986889cea53c4a470347.js} +1 -1
- package/assets/esri/core/workers/chunks/{cc6160e8ab3cea4040c2.js → 9e9b2fd958e816b1b5f6.js} +1 -1
- package/assets/esri/core/workers/chunks/a57cead317eb2fc9afd8.js +1 -0
- package/assets/esri/core/workers/chunks/acec58a7f23b2cc938ee.js +1 -0
- package/assets/esri/core/workers/chunks/b0f4254d8a32dd713009.js +1 -0
- package/assets/esri/core/workers/chunks/b277b8c2f556918e4f9a.js +1 -0
- package/assets/esri/core/workers/chunks/{deffd56e39ce725ce377.js → b30046a40bcfbec8abe4.js} +1 -1
- package/assets/esri/core/workers/chunks/{5c11e2e65b97565e5003.js → b7db64b07edb0b37ece1.js} +1 -1
- package/assets/esri/core/workers/chunks/bd1fb82e8bac439d05ea.js +1 -0
- package/assets/esri/core/workers/chunks/bf0a0ca7fdac98f06a89.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/c44ce0302dc82fb66ada.js +1 -0
- package/assets/esri/core/workers/chunks/c52872a50a5989121388.js +1 -0
- package/assets/esri/core/workers/chunks/c8cd6ba5600d8ff8db0b.js +2 -0
- package/assets/esri/core/workers/chunks/{a100fb789d72410f8d4f.js.LICENSE.txt → c8cd6ba5600d8ff8db0b.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{57c1370b310768c0790a.js → ca1e186f136abb23ae4b.js} +1 -1
- package/assets/esri/core/workers/chunks/{d14e4fc82ad772899336.js → ca4a37bdc0f7fb705146.js} +1 -1
- package/assets/esri/core/workers/chunks/cb94fc9b0f613ad50b3f.js +1 -0
- package/assets/esri/core/workers/chunks/d20764cc99fcabcb7cbf.js +1 -0
- package/assets/esri/core/workers/chunks/df18a72e3625cbe31935.js +1 -0
- package/assets/esri/core/workers/chunks/eff8fcb6393cd1193cbc.js +1 -0
- package/assets/esri/core/workers/chunks/f19d3c855f6e93544918.js +1 -0
- package/assets/esri/core/workers/chunks/{60b40b2319d1651dd150.js → f7e50a8284d12da21355.js} +1 -1
- package/assets/esri/core/workers/chunks/f9c0d571f62e611ffe2b.js +1 -0
- package/assets/esri/core/workers/chunks/fdfe8e0d942b78f08191.js +1 -0
- package/assets/esri/core/workers/chunks/ff21207f46a354786eed.js +1 -0
- package/chunks/Bufferer-BiY2mtjI.js +1 -1
- package/chunks/Centroid-DZi-eb9F.js +1 -1
- package/chunks/Clipper-a9xfvRaw.js +1 -1
- package/chunks/CrackAndCluster-CfzXpEle.js +1 -1
- package/chunks/Distance2DCalculator-eS0piaux.js +1 -1
- package/chunks/GeodeticDistanceCalculator-bNilDneE.js +1 -1
- package/chunks/Geometry.js +1 -1
- package/chunks/GeometryCleaner-DVgW95-D.js +1 -1
- package/chunks/Intersector-K1VmdfQW.js +1 -1
- package/chunks/LineSeries.js +1 -1
- package/chunks/OperatorClip.js +1 -1
- package/chunks/OperatorCrosses.js +1 -1
- package/chunks/OperatorCut.js +1 -1
- package/chunks/OperatorDensify.js +1 -1
- package/chunks/OperatorDifference.js +1 -1
- package/chunks/OperatorGeneralize.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticDistance.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorIntersection.js +1 -1
- package/chunks/OperatorIntersects.js +1 -1
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorOverlaps.js +1 -1
- package/chunks/OperatorProject.js +1 -1
- package/chunks/OperatorProximity.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingDensify.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorSimplify.js +1 -1
- package/chunks/OperatorTouches.js +1 -1
- package/chunks/OperatorUnion.js +1 -1
- package/chunks/OperatorWithin.js +1 -1
- package/chunks/QuadraticBezier.js +1 -1
- package/chunks/SideCalculator2D-Bf4QCxCR.js +1 -1
- package/chunks/Theme.js +1 -1
- package/chunks/Tick.js +1 -1
- package/chunks/Transformation2D.js +1 -1
- package/chunks/arcade.js +1 -1
- package/chunks/areaOperator.js +5 -0
- package/chunks/array.js +1 -1
- package/chunks/bufferOperator.js +5 -0
- package/chunks/centroidOperator.js +5 -0
- package/chunks/chartUtilsAm5.js +1 -1
- package/chunks/clipOperator.js +5 -0
- package/chunks/containsOperator.js +5 -0
- package/chunks/convexHullOperator.js +5 -0
- package/chunks/crossesOperator.js +5 -0
- package/chunks/cutOperator.js +5 -0
- package/chunks/densifyOperator.js +5 -0
- package/chunks/differenceOperator.js +5 -0
- package/chunks/disjointOperator.js +5 -0
- package/chunks/distanceOperator.js +5 -0
- package/chunks/equalsOperator.js +5 -0
- package/chunks/generalizeOperator.js +5 -0
- package/chunks/geodesicBufferOperator.js +5 -0
- package/chunks/geodeticAreaOperator.js +5 -0
- package/chunks/geodeticDensifyOperator.js +5 -0
- package/chunks/geodeticLengthOperator.js +5 -0
- package/chunks/i3s.js +1 -1
- package/chunks/intersectionOperator.js +5 -0
- package/chunks/intersectsOperator.js +5 -0
- package/chunks/languageUtils.js +1 -1
- package/chunks/lclayout.js +1 -1
- package/chunks/lengthOperator.js +5 -0
- package/chunks/lyr3DMain.js +1 -1
- package/chunks/lyr3DWorker.js +1 -1
- package/chunks/offsetOperator.js +5 -0
- package/chunks/overlapsOperator.js +5 -0
- package/chunks/pe-wasm.js +1 -1
- package/chunks/proximityOperator.js +5 -0
- package/chunks/relateOperator.js +5 -0
- package/chunks/simplifyOperator.js +5 -0
- package/chunks/symmetricDifferenceOperator.js +5 -0
- package/chunks/touchesOperator.js +5 -0
- package/chunks/unionOperator.js +5 -0
- package/chunks/vxlLayer.js +1 -1
- package/chunks/withinOperator.js +5 -0
- package/copyright.txt +2 -2
- package/core/Evented.js +1 -1
- package/geometry/operators/areaOperator.js +1 -1
- package/geometry/operators/bufferOperator.js +1 -1
- package/geometry/operators/centroidOperator.js +1 -1
- package/geometry/operators/clipOperator.js +1 -1
- package/geometry/operators/containsOperator.js +1 -1
- package/geometry/operators/convexHullOperator.js +1 -1
- package/geometry/operators/crossesOperator.js +1 -1
- package/geometry/operators/cutOperator.js +1 -1
- package/geometry/operators/densifyOperator.js +1 -1
- package/geometry/operators/differenceOperator.js +1 -1
- package/geometry/operators/disjointOperator.js +1 -1
- package/geometry/operators/distanceOperator.js +1 -1
- package/geometry/operators/equalsOperator.js +1 -1
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/generalizeOperator.js +1 -1
- package/geometry/operators/geodesicBufferOperator.js +1 -1
- package/geometry/operators/geodeticAreaOperator.js +1 -1
- package/geometry/operators/geodeticDensifyOperator.js +1 -1
- package/geometry/operators/geodeticLengthOperator.js +1 -1
- package/geometry/operators/gx/operatorAffineTransform.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorAutoComplete.js +1 -1
- package/geometry/operators/gx/operatorBoundary.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorConvexHull.js +1 -1
- package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
- package/geometry/operators/gx/operatorIntegrate.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorLocateBetween.js +1 -1
- package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/operators/gx/operatorSinglePartToMultiPart.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/intersectionOperator.js +1 -1
- package/geometry/operators/intersectsOperator.js +1 -1
- package/geometry/operators/isNearOperator.js +1 -1
- package/geometry/operators/json/disjointOperator.js +1 -1
- package/geometry/operators/lengthOperator.js +1 -1
- package/geometry/operators/offsetOperator.js +1 -1
- package/geometry/operators/overlapsOperator.js +1 -1
- package/geometry/operators/proximityOperator.js +1 -1
- package/geometry/operators/relateOperator.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/simplifyOperator.js +1 -1
- package/geometry/operators/support/apiConverter.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/operators/symmetricDifferenceOperator.js +1 -1
- package/geometry/operators/touchesOperator.js +1 -1
- package/geometry/operators/unionOperator.js +1 -1
- package/geometry/operators/withinOperator.js +1 -1
- package/geometry/support/contains.js +1 -1
- package/kernel.js +1 -1
- package/layers/KMLLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/support/rasterDatasets/WCSRaster.js +1 -1
- package/layers/support/rasterFormats/RasterCodec.js +1 -1
- package/layers/support/rasterFormats/TiffDecoder.js +1 -1
- package/layers/support/wmtsUtils.js +1 -1
- package/package.json +3 -3
- package/smartMapping/renderers/support/utils.js +1 -1
- package/smartMapping/symbology/support/Theme.js +1 -1
- package/support/revision.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
- package/views/3d/support/DisplayQualityProfile.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/interfaces.js +1 -1
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/Legend/support/heatmapRampUtils.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/assets/esri/core/workers/chunks/015285436ca965f94e17.js +0 -1
- package/assets/esri/core/workers/chunks/048d296efa26ccd79056.js +0 -1
- package/assets/esri/core/workers/chunks/0e0b978459d70b15acb5.js +0 -1
- package/assets/esri/core/workers/chunks/10fa211987b16fd71a1a.js +0 -1
- package/assets/esri/core/workers/chunks/200a5f1864c2c2f7536c.js +0 -1
- package/assets/esri/core/workers/chunks/23a697d48f6e45cc033e.js +0 -1
- package/assets/esri/core/workers/chunks/29b610ff44708e044cbd.js +0 -1
- package/assets/esri/core/workers/chunks/3600125c58d5d04c515a.js +0 -1
- package/assets/esri/core/workers/chunks/457d4abc938d14f28e31.js +0 -1
- package/assets/esri/core/workers/chunks/4b5dbdcad438cb2dd4bf.js +0 -1
- package/assets/esri/core/workers/chunks/69efc716991a407c3d23.js +0 -1
- package/assets/esri/core/workers/chunks/6e254e846e284223ef63.js +0 -1
- package/assets/esri/core/workers/chunks/785610aa615198fd3815.js +0 -1
- package/assets/esri/core/workers/chunks/7bf7aace72f81f5de4e4.js +0 -1
- package/assets/esri/core/workers/chunks/7ea3d652536e1d79dfc6.js +0 -1
- package/assets/esri/core/workers/chunks/816c9c81352cd0ca8ce8.js +0 -1
- package/assets/esri/core/workers/chunks/9291508232b23f030178.js +0 -1
- package/assets/esri/core/workers/chunks/9fc49968dea8e2b64f3e.js +0 -1
- package/assets/esri/core/workers/chunks/a0b3d70a1b0360084593.js +0 -1
- package/assets/esri/core/workers/chunks/a100fb789d72410f8d4f.js +0 -2
- package/assets/esri/core/workers/chunks/b4d76d46661aba356ea3.js +0 -1
- package/assets/esri/core/workers/chunks/cb3af81e1fe6405c4885.js +0 -1
- package/assets/esri/core/workers/chunks/cbf57abb537e86c1dd7f.js +0 -1
- package/assets/esri/core/workers/chunks/cebdf2f88c4d2ad8baab.js +0 -1
- package/assets/esri/core/workers/chunks/d56d77125798beb7e493.js +0 -1
- package/assets/esri/core/workers/chunks/d82b3e2905cab511ff3a.js +0 -2
- package/assets/esri/core/workers/chunks/e2f91098793b8742fae6.js +0 -1
- package/assets/esri/core/workers/chunks/f25c04cf1a4bc1d2636a.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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{G as t,S as e}from"../../../chunks/SimpleGeometryCursor.js";import{t as s,g as r}from"../../../chunks/Geometry.js";import{a5 as n,a as i,a6 as o,a7 as a,a8 as u,h as l,a9 as h,b as m,g as c,P as p,t as _,aa as g,n as f}from"../../../chunks/QuadraticBezier.js";import{K as y,d,T as x,E as T,m as A,P as E,b as v,v as N}from"../../../chunks/Transformation2D.js";import{O as S}from"../../../chunks/OperatorClip.js";import{O as w}from"../../../chunks/OperatorMultiPartToSinglePart.js";import{O as C}from"../../../chunks/OperatorCut.js";function X(t,e,s,r,n){return new G(n).findSlicesByArea(t,e,s,r)}function b(t,e,s,r,n){return new G(n).sliceIntoStrips(t,e,s,r)}function H(t,e,s,r){return new G(r).recursiveSliceEqualArea(t,e,s)}function k(t){this.currentX=this.calcX(t)}function P(t){if(null===this.curve){const e=(t-this.y0)/(this.y1-this.y0);return N(this.x0,this.x1,e)}return this.curve.intersectionOfYMonotonicWithAxisX(t,this.x0)}function Y(){return{x0:Number.NaN,y0:Number.NaN,x1:Number.NaN,y1:Number.NaN,currentX:Number.NaN,nextAET:null,prevAET:null,startNodeNext:null,nextInChain:null,curve:null,advance:k,calcX:P}}function I(t,e){const s=Y();return s.x0=t.getStartX(),s.y0=t.getStartY(),s.x1=t.getEndX(),s.y1=t.getEndY(),e&&(s.y0=v(s.x0,s.x0=s.y0),s.y1=v(s.x1,s.x1=s.y1)),s.y1<s.y0&&(s.y1=v(s.y0,s.y0=s.y1),s.x1=v(s.x0,s.x0=s.x1)),s.currentX=Number.NaN,s.nextAET=null,s.prevAET=null,s.startNodeNext=null,s.nextInChain=null,s.curve=null,s}function O(t){const e=Y();return e.x0=t.getStartX(),e.y0=t.getStartY(),e.x1=t.getEndX(),e.y1=t.getEndY(),e.curve=t,e.y1<e.y0&&(e.y1=v(e.y0,e.y0=e.y1),e.x1=v(e.x0,e.x0=e.x1)),e.currentX=Number.NaN,e.nextAET=null,e.prevAET=null,e.startNodeNext=null,e.nextInChain=null,e}function q(t){if(this.x===t.x&&this.y===t.y){const e=null!==this.endEdge,s=null!==t.startEdge;return e&&s?-1:1}return this.y!==t.y?this.y-t.y:this.x-t.x}function R(){return{x:Number.NaN,y:Number.NaN,startEdge:null,endEdge:null,compare:q}}function M(t,e){return{y:t,startingEdges:e}}class D{constructor(t,e,s,r,n,i){this.m_parent=t,this.m_y0=e,this.m_y1=s,this.m_t0=r,this.m_area=i}getMaxDerivative(){return 1}getValue(t,e){return 1===t?0:this.getArea(e)-this.m_area}getError(t){return r(0),0}getArea(t){const e=.5*(this.m_parent.m_sumBase-this.m_parent.m_sumA),s=this.m_y1-this.m_y0;let r=(this.m_parent.m_sumBase-e*(t+this.m_t0))*s*(t-this.m_t0),n=!1;for(let i=this.m_parent.m_AETHead;null!==i;i=i.nextAET)if(n=!n,n&&(null!==i.curve||null!==i.nextAET.curve)){const e=this.m_y0+s*this.m_t0,n=this.m_y0+s*t;i.curve&&(r+=V(i.curve,this.m_y0+s*this.m_t0,this.m_y0+s*t)),i.nextAET.curve&&(r-=V(i.nextAET.curve,this.m_y0+s*this.m_t0,this.m_y0+s*t));r+=(n-e)*(i.nextAET.calcX(e)-i.calcX(e)+(i.nextAET.calcX(n)-i.calcX(n)))*.5}return r}}function B(t,e,s){return{polygon:t,from:e,to:s}}function V(t,e,s){const n=[0,0],i=t.intersectionWithAxis2D(!0,e,null,n);r(1===i);const o=n[0],a=t.intersectionWithAxis2D(!0,s,null,n);r(1===a);const u=n[0],l=A(E,4);g(t,l,!0);const h=l[3],m=l[2],c=l[1],p=t.getCoordX(o)-t.getStartX(),_=t.getCoordY(o)-t.getStartY(),f=t=>{const e=t*t;return e*t*(10*(m.x*c.y-m.y*c.x)-15*t*(h.y*c.x-h.x*c.y)+6*e*(m.y*h.x-h.y*m.x))/60},y=t=>(-t*(c.y+t*(m.y+h.y*t))*p+t*(c.x+t*(m.x+h.x*t))*_)/2;return f(u)-f(o)-(y(u)-y(o))}class z extends t{constructor(t){super(),this.m_geoms=[],this.m_index=-1,this.m_id=-1,this.m_geoms=t}tock(){return!0}getRank(){return 1}next(){return this.m_index++,this.m_index>=this.m_geoms.length?null:(this.m_id=this.m_geoms[this.m_index].second,this.m_geoms[this.m_index].first)}getGeometryID(){return this.m_id}}class G{constructor(t){this.m_edges=[],this.m_curves=[],this.m_sortedNodes=[],this.m_sortHelper=[],this.m_cuts=[],this.m_cutAreas=[],this.m_totalAreaOfTraps=new y(0),this.m_areaTracking=0,this.m_splitArea=0,this.m_sumBase=0,this.m_sumA=0,this.m_numberOfCuts=0,this.m_currentScan=0,this.m_progressCounter=0,this.m_AETHead=null,this.m_bHorizontalSweep=!1,this.m_bPolygonHasCurves=!1,this.m_progressTracker=t}findSlicesByArea(t,e,r,i){i<0&&s("remainingArea");let o=t,a=null;o.hasNonLinearSegments()&&(this.m_bPolygonHasCurves=!0,a=n(t,1e-16,!0),L(a),o=a);const u=Math.abs(o.calculateArea2D());return 0===u||0===r||i>=u||1===r&&0===i?[]:(this.m_splitArea=(u-i)/r,this.m_numberOfCuts=r-1,i>0&&this.m_numberOfCuts++,this.m_edges.length=0,this.m_sortedNodes.length=0,this.m_cuts.length=0,this.m_areaTracking=0,this.m_totalAreaOfTraps.reset(),this.m_curves.length=0,this.buildEdges(o),this.buildScanNodes(),this.trapezoidation(),this.m_cuts)}sliceIntoStrips(t,s,r,n){if(0===n)return new e([t]);const o=new i;t.queryLooseEnvelope(o);const a=o.width()+o.height();return new z(this.splitPolygon(t,s,o.xmin-a-1+1,o.xmax+a+1,r,n))}recursiveSliceEqualArea(t,s,n){if(n<=1||t.isEmpty())return new e([t]);{const e=[],o=[];o.push(d(t.clone(),n));let a=0,u=0;for(;o.length>0;){r(u++<2*n);const t=o.at(-1);if(o.pop(),1===t.second){e.push(d(t.first,a++));continue}const l=new i;t.first.queryEnvelope(l);const h=l.width()+l.height(),m=new x;m.setIdentity(),l.width()>l.height()&&(m.setRotateCcw90(),t.first.applyTransformation(m),m.transformEnvInPlace(l));const c=t.first.calculateArea2D(),p=c/t.second,_=c-Math.trunc(t.second/2)*p,g=new G(this.m_progressTracker).findSlicesByArea(t.first,s,1,_),f=new G(this.m_progressTracker).splitPolygon(t.first,s,l.xmin-h-1+1,l.xmax+h+1,g,1),y=f.length;if(r(y>0&&y<=2),!m.isIdentity()){const t=new x;t.setRotateCw90(),f[0].first.applyTransformation(t),2===y&&f[1].first.applyTransformation(t)}2===y?(o.push(d(f[1].first,t.second-Math.trunc(t.second/2))),o.push(d(f[0].first,Math.trunc(t.second/2)))):o.push(d(f[0].first,t.second))}return new z(e)}}recursiveSliceEqualAreaImpl(t,e,s,n){return r(0),{}}processTraps(t,e,s){s?this.processTrapsCurves(t,e):this.processTrapsLinear(t,e)}processTrapsLinear(t,e){let s=0,r=1;const n=.5*(this.m_sumBase-this.m_sumA),i=e-t,a=(this.m_sumBase-n*(r+s))*i*(r-s);if(a+this.m_areaTracking<this.m_splitArea)return this.m_totalAreaOfTraps.pe(a),void(this.m_areaTracking+=a);const u=new y(a),l=new T(0,1);let h=!1;for(;s<1;){const e=this.m_splitArea-this.m_areaTracking,m=[Number.NaN,Number.NaN];if(!(o(-n*i,this.m_sumBase*i,(n*s-this.m_sumBase)*i*s-e,l,!1,m)>0)){h?this.m_areaTracking=u.getResult():this.m_areaTracking+=a;break}{h=!0,r=m[0],this.m_areaTracking=0,s=r,u.me(e);const n=r*i+t;if(this.m_cuts.push(n),this.m_cutAreas.push(this.m_totalAreaOfTraps.getResult()+a-u.getResult()),this.m_cuts.length===this.m_numberOfCuts)return void this.m_totalAreaOfTraps.pe(a-u.getResult())}}this.m_totalAreaOfTraps.pe(a)}processTrapsCurves(t,e){let s=0,r=1;const n=new D(this,t,e,0,1,0).getArea(1);if(n+this.m_areaTracking<this.m_splitArea)return this.m_totalAreaOfTraps.pe(n),void(this.m_areaTracking+=n);const i=e-t,o=new y(n);let u=!1;for(;s<1;){const l=this.m_splitArea-this.m_areaTracking,h=new D(this,t,e,s,1,l),m=[0],c=new T(s,1);if(!(a(h,c,1,m)>0)){u?this.m_areaTracking=o.getResult():this.m_areaTracking+=n;break}{u=!0,r=m[0],this.m_areaTracking=0,s=r,o.me(l);const e=r*i+t;if(this.m_cuts.push(e),this.m_cutAreas.push(this.m_totalAreaOfTraps.getResult()+n-o.getResult()),this.m_cuts.length===this.m_numberOfCuts)return void this.m_totalAreaOfTraps.pe(n-o.getResult())}}this.m_totalAreaOfTraps.pe(n)}advanceAET(){const t=this.m_sortedNodes[this.m_currentScan-1].y,e=this.m_sortedNodes[this.m_currentScan];let s=!1,r=!1;const n=new y(0);for(let a=this.m_AETHead;null!==a;a=a.nextAET){const t=a.prevAET;s=!s,null!==a.nextAET&&s&&(this.m_bPolygonHasCurves&&(a.curve||a.nextAET.curve)||n.pe(a.nextAET.currentX-a.currentX)),a.advance(e.y),null!==t&&a.currentX<t.currentX&&(r=!0)}this.m_sumBase=n.getResult(),r&&this.sortAET();const i=new y(0);s=!1;let o=!1;for(let a=this.m_AETHead;null!==a;a=a.nextAET){o=o||null!==a.curve;s=!s,null!==a.prevAET&&(s||this.m_bPolygonHasCurves&&(a.curve||a.prevAET.curve)||i.pe(a.currentX-a.prevAET.currentX))}this.m_sumA=i.getResult(),this.processTraps(t,e.y,o);for(let a=this.m_AETHead;null!=a;){const t=a.prevAET,s=a.nextAET;if(e.y===a.y1)if(a.prevAET=null,a.nextAET=null,null!==a.nextInChain){const e=a.currentX;a=a.nextInChain,a.currentX=e,a.prevAET=t,t?t.nextAET=a:this.m_AETHead=a,a.nextAET=s,s&&(s.prevAET=a)}else t?t.nextAET=s:this.m_AETHead=s,s&&(s.prevAET=t);a=s}}mergeNewEdgesToAET(){for(let r=this.m_sortedNodes[this.m_currentScan].startingEdges;null!==r;r=r.startNodeNext)Number.isNaN(r.currentX)&&(this.m_sortHelper.push(r),r.currentX=r.x0);if(!this.m_sortHelper.length)return;this.sortHelper();let t=this.m_AETHead,e=0,s=t;for(;null!==t&&e<this.m_sortHelper.length;)t.currentX>this.m_sortHelper[e].currentX?(this.m_sortHelper[e].prevAET=t.prevAET,t.prevAET?t.prevAET.nextAET=this.m_sortHelper[e]:this.m_AETHead=this.m_sortHelper[e],this.m_sortHelper[e].nextAET=t,t.prevAET=this.m_sortHelper[e],e++):(s=t,t=t.nextAET);for(;e<this.m_sortHelper.length;)this.m_sortHelper[e].prevAET=s,null!==s?s.nextAET=this.m_sortHelper[e]:this.m_AETHead=this.m_sortHelper[e],this.m_sortHelper[e].nextAET=null,s=this.m_sortHelper[e],e++;this.m_sortHelper.length=0}sortAET(){for(let e=this.m_AETHead;null!==e;e=e.nextAET)this.m_sortHelper.push(e);this.sortHelper(),this.m_AETHead=null;let t=null;for(const e of this.m_sortHelper)e.prevAET=t,t?t.nextAET=e:this.m_AETHead=e,e.nextAET=null,t=e;this.m_sortHelper.length=0}sortHelper(){this.m_sortHelper.sort(((t,e)=>t.currentX-e.currentX))}trapezoidation(){for(this.m_currentScan=0,this.mergeNewEdgesToAET(),this.m_currentScan++;this.m_currentScan<this.m_sortedNodes.length&&(this.progress(),this.advanceAET(),this.m_cuts.length!==this.m_numberOfCuts);)this.mergeNewEdgesToAET(),this.m_currentScan++}buildEdges(t){const e=t.querySegmentIterator();for(e.stripAttributes();e.nextPath();)for(;e.hasNextSegment();){const t=e.nextSegment();if(t.isCurve()){const e=t;if(u(e),this.m_bHorizontalSweep){const t=A(E,4);e.queryControlPoints(t);for(const e of t)e.y=v(e.x,e.x=e.y);e.constructPoints(t)}const s=e.getStartY(),r=e.getEndY();if(r===s)continue;r<s&&e.reverse(),this.m_curves.push(e.clone()),this.m_edges.push(O(this.m_curves.at(-1)))}else{const e=this.m_bHorizontalSweep?t.getStartX():t.getStartY();if((this.m_bHorizontalSweep?t.getEndX():t.getEndY())===e)continue;this.m_edges.push(I(t,this.m_bHorizontalSweep))}}this.m_edges.sort(((t,e)=>t.y0===e.y0?t.x0-e.x0:t.y0-e.y0))}buildScanNodes(){const t=[];for(const n of this.m_edges){const e=R();e.x=n.x0,e.y=n.y0,e.startEdge=n,e.endEdge=null,t.push(e);const s=R();s.x=n.x1,s.y=n.y1,s.startEdge=null,s.endEdge=n,t.push(s)}t.sort(((t,e)=>t.compare(e)));let e=0,s=t[e].y;this.m_sortedNodes.push(M(s,t[e].startEdge));let r=e;for(e++;e!==t.length;++e){t[e].y!==s&&(this.m_sortedNodes.push(M(t[e].y,null)),s=t[e].y);const n=t[e].startEdge;if(n){const t=this.m_sortedNodes.at(-1);n.startNodeNext=t.startingEdges,t.startingEdges=n}if(t[r].x!==t[e].x||t[r].y!==t[e].y){if(e-r==2){let e=r;e++,null!==t[r].endEdge&&null!==t[e].startEdge&&(t[r].endEdge.nextInChain=t[e].startEdge)}r=e}}}progress(){}splitPolygonLinear(t,s,n,o,a,u){const h=[];h.push([t,0,u]);const m=[],c=new l;for(c.startPathCoords(n,0),c.lineToCoords(o,0);h.length>0;){const l=h.at(-1);h.pop();const p=l[0],_=l[1],g=l[2],f=(new w).executeMany(new e([p]),s,this.m_progressTracker);for(let e=f.next();null!==e;e=f.next()){const l=e,p=new i;l.queryLooseEnvelope(p);let f=_,y=g;for(let t=_,e=g-1;t<g;++t,--e)p.ymin>=a[t]&&(f=t+1),p.ymax<=a[e]&&(y=e);if(f!==g)if(y!==_)if(f!==y)if(this.isYMonotone(l))this.splitYMonotone(m,l,s,a,f,y);else{const e=Math.trunc((f+y)/2);c.setXYCoords(0,n,a[e]),c.setXYCoords(1,o,a[e]);const _=(new C).execute(!1,l,c,null,this.m_progressTracker),g=_.next(),x=_.next(),T=_.next();if(null!==g){if(g.isEmpty()||(e===y-1?(m.push(d(g,e)),r(j(m.at(-1).first,s,t,m.at(-1).second,a,u))):h.push([g,e+1,y])),x.isEmpty()||(e===f?(m.push(d(x,e-1)),r(j(m.at(-1).first,s,t,m.at(-1).second,a,u))):h.push([x,f,e])),null!==T&&!T.isEmpty()){const t=new i;T.queryLooseEnvelope(t),t.ymin>=a[e]?h.push([T,e+1,y]):t.ymax<=a[e]?h.push([T,f,e]):h.push([T,f,y])}}else e+1===y?(a[e]-p.ymin<p.ymax-a[e]?m.push(d(l,e)):m.push(d(l,e+1)),r(j(m.at(-1).first,s,t,m.at(-1).second,a,u))):h.push([l,e+1,y])}else m.push(d(e,f-1));else m.push(d(e,_-1));else m.push(d(e,g-1))}}return m}splitPolygon(t,e,s,r,n,o){const a=new i;t.queryLooseEnvelope(a),a.inflateCoords(0,Math.max(a.width(),a.height()));const u=[],l=[];for(l.push(B(t,0,o));l.length;){const o={...l.at(-1)};if(l.pop(),o.polygon.hasNonLinearSegments()){const t=Math.trunc((o.to+o.from)/2),h=n[t],m=new i(s,a.ymin,r,h),c=(new S).execute(o.polygon,m,e,this.m_progressTracker);c.isEmpty()||(t-o.from==0?u.push(d(c,t-1)):l.push(B(c,o.from,t)));const p=new i(s,h,r,a.ymax),_=(new S).execute(o.polygon,p,e,this.m_progressTracker);_.isEmpty()||(o.to-t==1?u.push(d(_,t)):l.push(B(_,t+1,o.to)))}else{const i=this.splitPolygonLinear(t,e,s,r,n.slice(o.from),o.to-o.from);u.push(...i)}}u.sort(((t,e)=>t.second-e.second));const m=[];return h(u,((t,e)=>t.second===e.second),((t,e)=>{const s=new c;for(let r=t;r!==e;++r)s.add(u[r].first,!1);m.push(d(s,u[t].second))})),m}isYMonotone(t){if(1!==t.getPathCount())return!1;const e=t.getXY(0);let s=0,r=0;const n=new E;for(let i=1,o=t.getPointCount();i<=o;i++){t.queryXY(i===o?0:i,n);const a=n.y>e.y?1:n.y<e.y?-1:0;if(e.setCoordsPoint2D(n),s!==a&&0!==a){if(0!==s&&(r++,r>2))return!1;s=a}}return!0}splitYMonotone(t,e,s,n,i,o){const a=new m;a.addGeometry(e);const u=a.getFirstPath(a.getFirstGeometry()),l=a.getFirstVertex(u),h=new E,c=new E;let p=l,_=l;{const t=a.getXY(l);h.setCoordsPoint2D(t),c.setCoordsPoint2D(t)}let g=a.getNextVertex(l);const y=new E;for(let r=0,m=a.getPathSize(u);r<m;r++,g=a.getNextVertex(g))a.queryXY(g,y),y.compare(h)<0?(p=g,h.setCoordsPoint2D(y)):y.compare(c)>0&&(_=g,c.setCoordsPoint2D(y));let x=p,T=p,A=x,v=T,N=!1,S=!1,w=i,C=h.y,X=h.y,b=!1;for(;w<o;)if(n[w]<=h.y)w++;else{if(n[w]>=c.y)break;if(!N){const t=a.getNextVertex(x),e=a.getY(t);if(e<C)break;const s=n[w];C<=s&&e>=s?N=!0:(C=e,x=t)}if(!S){const t=a.getPrevVertex(T),e=a.getY(t);if(e<X)break;const s=n[w];X<=s&&e>=s?S=!0:(X=e,T=t)}if(N&&S){b=!0;let e=a.getXY(x);const s=a.getNextVertex(x);let i=a.getXY(s),o=f;if(i.y===e.y)o=i.x<e.x?x:s;else{const t=(n[w]-e.y)/(i.y-e.y);if(0===t)o=x;else if(1===t)o=s;else{const e=a.splitSegmentAxisAware(x,[t],1,null,-1);r(1===e),o=a.getNextVertex(x),a.getY(o)!==n[w]&&a.setXYCoords(o,a.getX(o),n[w])}}const u=a.getPrevVertex(T);e=a.getXY(u),i=a.getXY(T);let l=f;if(i.y===e.y)l=i.x<e.x?T:u;else{const t=(n[w]-e.y)/(i.y-e.y);if(0===t)l=u;else if(1===t)l=T;else{const e=a.splitSegmentAxisAware(u,[t],1,null,-1);r(1===e),l=a.getNextVertex(u),a.getY(l)!==n[w]&&a.setXYCoords(l,a.getX(l),n[w])}}t.push(d(this.extractTrapezoid(a,A,o,v,l),w-1)),A=o,v=l,x=o,T=l,C=X=n[w],N=!1,S=!1,w++}}b?t.push(d(this.extractTrapezoid(a,A,_,v,_),w-1)):t.push(d(e,w))}extractTrapezoid(t,e,s,r,n){const i=new c({vd:t.getVertexDescription()}),o=new p;let a=!0;for(let u=e;;u=t.getNextVertex(u)){const e=t.getSegment(u);if(e?i.addSegment(e,a):(t.queryPoint(u,o),a?i.startPathPoint(o):i.lineToPoint(o)),a=!1,u===s)break}s!==n&&(t.queryPoint(n,o),i.lineToPoint(o)),a=!0;for(let u=n;;u=t.getNextVertex(u)){const s=t.getSegment(u);if(s?i.addSegment(s,a):a||u===e||(t.queryPoint(u,o),i.lineToPoint(o)),a=!1,u===r)break}return i}}function L(t){return t.getImpl().ensureXYMonotoneSegments()}function j(t,e,s,r,n,o){const a=new i;t.queryEnvelope(a);const u=4*_(e,s,!0).total();return(!(r>=0)||a.ymin+u>=n[r])&&!(r+1<o&&a.ymax>n[r+1]+u)}class F{getOperatorType(){return 10011}accelerateGeometry(t,e,s){return!1}canAccelerateGeometry(t){return!1}supportsCurves(){return!0}sliceIntoStrips(t,e,s,r,n,i){return new W(0,t,e,s,n,0,i)}findSlicesByArea(t,e,s,r,n,i){if(!n||n.isIdentity())return X(t,e,s,r,i);{const o=t.clone();return o.applyTransformation(n),X(o,e,s,r,i)}}recursiveSliceEqualArea(t,e,s,r,n){return new W(1,t,e,null,r,s,n)}}class W extends t{constructor(t,e,s,r,n,i,o){super(),this.m_resultCursor=null,this.m_method=t,this.m_polygon=e,this.m_sr=s,this.m_ySplits=r?.slice()??null,this.m_transform=n,this.m_bReversePaths=n?.isReflective()??!1,this.m_inverseTransform=n?n.clone().invertThis():null,this.m_partCount=i,this.m_tracker=o}tock(){return!0}getRank(){return 1}next(){this.m_resultCursor||(this.m_method?this.recursiveSliceEqualArea():this.sliceIntoStrips());const t=this.m_resultCursor.next();return t?(this.m_inverseTransform&&!this.m_inverseTransform.isIdentity()&&(t.applyTransformation(this.m_inverseTransform),this.m_bReversePaths&&t.reverseAllPaths()),t):t}getGeometryID(){return this.m_resultCursor?this.m_resultCursor.getGeometryID():-1}sliceIntoStrips(){if(!this.m_transform||this.m_transform.isIdentity())this.m_resultCursor=b(this.m_polygon,this.m_sr,this.m_ySplits,this.m_ySplits.length,this.m_tracker);else{const t=this.m_polygon.clone();t.applyTransformation(this.m_transform),this.m_bReversePaths&&t.reverseAllPaths(),this.m_resultCursor=b(t,this.m_sr,this.m_ySplits,this.m_ySplits.length,this.m_tracker)}}recursiveSliceEqualArea(){if(!this.m_transform||this.m_transform.isIdentity())this.m_resultCursor=H(this.m_polygon,this.m_sr,this.m_partCount,this.m_tracker);else{const t=this.m_polygon.clone();t.applyTransformation(this.m_transform),this.m_bReversePaths&&t.reverseAllPaths(),this.m_resultCursor=H(t,this.m_sr,this.m_partCount,this.m_tracker)}}}const K=new F;function Q(t,e,s,r,n){return K.findSlicesByArea(t,e,s,r,n,null)}function J(t,e,s,r){const n=K.recursiveSliceEqualArea(t,e,s,r,null);return Array.from(n)}function U(t,e,s,r){const n=K.sliceIntoStrips(t,e,s,0,r,null);return Array.from(n)}function Z(){return K.supportsCurves()}export{Q as findSlicesByArea,J as recursiveSliceEqualArea,U as sliceIntoStrips,Z as supportsCurves};
|
|
5
|
+
import{G as t,S as e}from"../../../chunks/SimpleGeometryCursor.js";import{t as s,g as r}from"../../../chunks/Geometry.js";import{a5 as n,a as i,a6 as o,a7 as a,a8 as u,i as l,a9 as h,d as m,h as c,P as p,u as _,aa as g,n as f}from"../../../chunks/QuadraticBezier.js";import{K as y,d,T as x,E as T,m as A,P as E,b as v,w as N}from"../../../chunks/Transformation2D.js";import{O as S}from"../../../chunks/OperatorClip.js";import{O as w}from"../../../chunks/OperatorMultiPartToSinglePart.js";import{O as C}from"../../../chunks/OperatorCut.js";function X(t,e,s,r,n){return new G(n).findSlicesByArea(t,e,s,r)}function H(t,e,s,r,n){return new G(n).sliceIntoStrips(t,e,s,r)}function b(t,e,s,r){return new G(r).recursiveSliceEqualArea(t,e,s)}function k(t){this.currentX=this.calcX(t)}function P(t){if(null===this.curve){const e=(t-this.y0)/(this.y1-this.y0);return N(this.x0,this.x1,e)}return this.curve.intersectionOfYMonotonicWithAxisX(t,this.x0)}function Y(){return{x0:Number.NaN,y0:Number.NaN,x1:Number.NaN,y1:Number.NaN,currentX:Number.NaN,nextAET:null,prevAET:null,startNodeNext:null,nextInChain:null,curve:null,advance:k,calcX:P}}function I(t,e){const s=Y();return s.x0=t.getStartX(),s.y0=t.getStartY(),s.x1=t.getEndX(),s.y1=t.getEndY(),e&&(s.y0=v(s.x0,s.x0=s.y0),s.y1=v(s.x1,s.x1=s.y1)),s.y1<s.y0&&(s.y1=v(s.y0,s.y0=s.y1),s.x1=v(s.x0,s.x0=s.x1)),s.currentX=Number.NaN,s.nextAET=null,s.prevAET=null,s.startNodeNext=null,s.nextInChain=null,s.curve=null,s}function O(t){const e=Y();return e.x0=t.getStartX(),e.y0=t.getStartY(),e.x1=t.getEndX(),e.y1=t.getEndY(),e.curve=t,e.y1<e.y0&&(e.y1=v(e.y0,e.y0=e.y1),e.x1=v(e.x0,e.x0=e.x1)),e.currentX=Number.NaN,e.nextAET=null,e.prevAET=null,e.startNodeNext=null,e.nextInChain=null,e}function q(t){if(this.x===t.x&&this.y===t.y){const e=null!==this.endEdge,s=null!==t.startEdge;return e&&s?-1:1}return this.y!==t.y?this.y-t.y:this.x-t.x}function R(){return{x:Number.NaN,y:Number.NaN,startEdge:null,endEdge:null,compare:q}}function M(t,e){return{y:t,startingEdges:e}}class D{constructor(t,e,s,r,n,i){this.m_parent=t,this.m_y0=e,this.m_y1=s,this.m_t0=r,this.m_area=i}getMaxDerivative(){return 1}getValue(t,e){return 1===t?0:this.getArea(e)-this.m_area}getError(t){return r(0),0}getArea(t){const e=.5*(this.m_parent.m_sumBase-this.m_parent.m_sumA),s=this.m_y1-this.m_y0;let r=(this.m_parent.m_sumBase-e*(t+this.m_t0))*s*(t-this.m_t0),n=!1;for(let i=this.m_parent.m_AETHead;null!==i;i=i.nextAET)if(n=!n,n&&(null!==i.curve||null!==i.nextAET.curve)){const e=this.m_y0+s*this.m_t0,n=this.m_y0+s*t;i.curve&&(r+=V(i.curve,this.m_y0+s*this.m_t0,this.m_y0+s*t)),i.nextAET.curve&&(r-=V(i.nextAET.curve,this.m_y0+s*this.m_t0,this.m_y0+s*t));r+=(n-e)*(i.nextAET.calcX(e)-i.calcX(e)+(i.nextAET.calcX(n)-i.calcX(n)))*.5}return r}}function B(t,e,s){return{polygon:t,from:e,to:s}}function V(t,e,s){const n=[0,0],i=t.intersectionWithAxis2D(!0,e,null,n);r(1===i);const o=n[0],a=t.intersectionWithAxis2D(!0,s,null,n);r(1===a);const u=n[0],l=A(E,4);g(t,l,!0);const h=l[3],m=l[2],c=l[1],p=t.getCoordX(o)-t.getStartX(),_=t.getCoordY(o)-t.getStartY(),f=t=>{const e=t*t;return e*t*(10*(m.x*c.y-m.y*c.x)-15*t*(h.y*c.x-h.x*c.y)+6*e*(m.y*h.x-h.y*m.x))/60},y=t=>(-t*(c.y+t*(m.y+h.y*t))*p+t*(c.x+t*(m.x+h.x*t))*_)/2;return f(u)-f(o)-(y(u)-y(o))}class z extends t{constructor(t){super(),this.m_geoms=[],this.m_index=-1,this.m_id=-1,this.m_geoms=t}tock(){return!0}getRank(){return 1}next(){return this.m_index++,this.m_index>=this.m_geoms.length?null:(this.m_id=this.m_geoms[this.m_index].second,this.m_geoms[this.m_index].first)}getGeometryID(){return this.m_id}}class G{constructor(t){this.m_edges=[],this.m_curves=[],this.m_sortedNodes=[],this.m_sortHelper=[],this.m_cuts=[],this.m_cutAreas=[],this.m_totalAreaOfTraps=new y(0),this.m_areaTracking=0,this.m_splitArea=0,this.m_sumBase=0,this.m_sumA=0,this.m_numberOfCuts=0,this.m_currentScan=0,this.m_progressCounter=0,this.m_AETHead=null,this.m_bHorizontalSweep=!1,this.m_bPolygonHasCurves=!1,this.m_progressTracker=t}findSlicesByArea(t,e,r,i){i<0&&s("remainingArea");let o=t,a=null;o.hasNonLinearSegments()&&(this.m_bPolygonHasCurves=!0,a=n(t,1e-16,!0),L(a),o=a);const u=Math.abs(o.calculateArea2D());return 0===u||0===r||i>=u||1===r&&0===i?[]:(this.m_splitArea=(u-i)/r,this.m_numberOfCuts=r-1,i>0&&this.m_numberOfCuts++,this.m_edges.length=0,this.m_sortedNodes.length=0,this.m_cuts.length=0,this.m_areaTracking=0,this.m_totalAreaOfTraps.reset(),this.m_curves.length=0,this.buildEdges(o),this.buildScanNodes(),this.trapezoidation(),this.m_cuts)}sliceIntoStrips(t,s,r,n){if(0===n)return new e([t]);const o=new i;t.queryLooseEnvelope(o);const a=o.width()+o.height();return new z(this.splitPolygon(t,s,o.xmin-a-1+1,o.xmax+a+1,r,n))}recursiveSliceEqualArea(t,s,n){if(n<=1||t.isEmpty())return new e([t]);{const e=[],o=[];o.push(d(t.clone(),n));let a=0,u=0;for(;o.length>0;){r(u++<2*n);const t=o.at(-1);if(o.pop(),1===t.second){e.push(d(t.first,a++));continue}const l=new i;t.first.queryEnvelope(l);const h=l.width()+l.height(),m=new x;m.setIdentity(),l.width()>l.height()&&(m.setRotateCcw90(),t.first.applyTransformation(m),m.transformEnvInPlace(l));const c=t.first.calculateArea2D(),p=c/t.second,_=c-Math.trunc(t.second/2)*p,g=new G(this.m_progressTracker).findSlicesByArea(t.first,s,1,_),f=new G(this.m_progressTracker).splitPolygon(t.first,s,l.xmin-h-1+1,l.xmax+h+1,g,1),y=f.length;if(r(y>0&&y<=2),!m.isIdentity()){const t=new x;t.setRotateCw90(),f[0].first.applyTransformation(t),2===y&&f[1].first.applyTransformation(t)}2===y?(o.push(d(f[1].first,t.second-Math.trunc(t.second/2))),o.push(d(f[0].first,Math.trunc(t.second/2)))):o.push(d(f[0].first,t.second))}return new z(e)}}recursiveSliceEqualAreaImpl(t,e,s,n){return r(0),{}}processTraps(t,e,s){s?this.processTrapsCurves(t,e):this.processTrapsLinear(t,e)}processTrapsLinear(t,e){let s=0,r=1;const n=.5*(this.m_sumBase-this.m_sumA),i=e-t,a=(this.m_sumBase-n*(r+s))*i*(r-s);if(a+this.m_areaTracking<this.m_splitArea)return this.m_totalAreaOfTraps.pe(a),void(this.m_areaTracking+=a);const u=new y(a),l=new T(0,1);let h=!1;for(;s<1;){const e=this.m_splitArea-this.m_areaTracking,m=[Number.NaN,Number.NaN];if(!(o(-n*i,this.m_sumBase*i,(n*s-this.m_sumBase)*i*s-e,l,!1,m)>0)){h?this.m_areaTracking=u.getResult():this.m_areaTracking+=a;break}{h=!0,r=m[0],this.m_areaTracking=0,s=r,u.me(e);const n=r*i+t;if(this.m_cuts.push(n),this.m_cutAreas.push(this.m_totalAreaOfTraps.getResult()+a-u.getResult()),this.m_cuts.length===this.m_numberOfCuts)return void this.m_totalAreaOfTraps.pe(a-u.getResult())}}this.m_totalAreaOfTraps.pe(a)}processTrapsCurves(t,e){let s=0,r=1;const n=new D(this,t,e,0,1,0).getArea(1);if(n+this.m_areaTracking<this.m_splitArea)return this.m_totalAreaOfTraps.pe(n),void(this.m_areaTracking+=n);const i=e-t,o=new y(n);let u=!1;for(;s<1;){const l=this.m_splitArea-this.m_areaTracking,h=new D(this,t,e,s,1,l),m=[0],c=new T(s,1);if(!(a(h,c,1,m)>0)){u?this.m_areaTracking=o.getResult():this.m_areaTracking+=n;break}{u=!0,r=m[0],this.m_areaTracking=0,s=r,o.me(l);const e=r*i+t;if(this.m_cuts.push(e),this.m_cutAreas.push(this.m_totalAreaOfTraps.getResult()+n-o.getResult()),this.m_cuts.length===this.m_numberOfCuts)return void this.m_totalAreaOfTraps.pe(n-o.getResult())}}this.m_totalAreaOfTraps.pe(n)}advanceAET(){const t=this.m_sortedNodes[this.m_currentScan-1].y,e=this.m_sortedNodes[this.m_currentScan];let s=!1,r=!1;const n=new y(0);for(let a=this.m_AETHead;null!==a;a=a.nextAET){const t=a.prevAET;s=!s,null!==a.nextAET&&s&&(this.m_bPolygonHasCurves&&(a.curve||a.nextAET.curve)||n.pe(a.nextAET.currentX-a.currentX)),a.advance(e.y),null!==t&&a.currentX<t.currentX&&(r=!0)}this.m_sumBase=n.getResult(),r&&this.sortAET();const i=new y(0);s=!1;let o=!1;for(let a=this.m_AETHead;null!==a;a=a.nextAET){o=o||null!==a.curve;s=!s,null!==a.prevAET&&(s||this.m_bPolygonHasCurves&&(a.curve||a.prevAET.curve)||i.pe(a.currentX-a.prevAET.currentX))}this.m_sumA=i.getResult(),this.processTraps(t,e.y,o);for(let a=this.m_AETHead;null!=a;){const t=a.prevAET,s=a.nextAET;if(e.y===a.y1)if(a.prevAET=null,a.nextAET=null,null!==a.nextInChain){const e=a.currentX;a=a.nextInChain,a.currentX=e,a.prevAET=t,t?t.nextAET=a:this.m_AETHead=a,a.nextAET=s,s&&(s.prevAET=a)}else t?t.nextAET=s:this.m_AETHead=s,s&&(s.prevAET=t);a=s}}mergeNewEdgesToAET(){for(let r=this.m_sortedNodes[this.m_currentScan].startingEdges;null!==r;r=r.startNodeNext)Number.isNaN(r.currentX)&&(this.m_sortHelper.push(r),r.currentX=r.x0);if(!this.m_sortHelper.length)return;this.sortHelper();let t=this.m_AETHead,e=0,s=t;for(;null!==t&&e<this.m_sortHelper.length;)t.currentX>this.m_sortHelper[e].currentX?(this.m_sortHelper[e].prevAET=t.prevAET,t.prevAET?t.prevAET.nextAET=this.m_sortHelper[e]:this.m_AETHead=this.m_sortHelper[e],this.m_sortHelper[e].nextAET=t,t.prevAET=this.m_sortHelper[e],e++):(s=t,t=t.nextAET);for(;e<this.m_sortHelper.length;)this.m_sortHelper[e].prevAET=s,null!==s?s.nextAET=this.m_sortHelper[e]:this.m_AETHead=this.m_sortHelper[e],this.m_sortHelper[e].nextAET=null,s=this.m_sortHelper[e],e++;this.m_sortHelper.length=0}sortAET(){for(let e=this.m_AETHead;null!==e;e=e.nextAET)this.m_sortHelper.push(e);this.sortHelper(),this.m_AETHead=null;let t=null;for(const e of this.m_sortHelper)e.prevAET=t,t?t.nextAET=e:this.m_AETHead=e,e.nextAET=null,t=e;this.m_sortHelper.length=0}sortHelper(){this.m_sortHelper.sort(((t,e)=>t.currentX-e.currentX))}trapezoidation(){for(this.m_currentScan=0,this.mergeNewEdgesToAET(),this.m_currentScan++;this.m_currentScan<this.m_sortedNodes.length&&(this.progress(),this.advanceAET(),this.m_cuts.length!==this.m_numberOfCuts);)this.mergeNewEdgesToAET(),this.m_currentScan++}buildEdges(t){const e=t.querySegmentIterator();for(e.stripAttributes();e.nextPath();)for(;e.hasNextSegment();){const t=e.nextSegment();if(t.isCurve()){const e=t;if(u(e),this.m_bHorizontalSweep){const t=A(E,4);e.queryControlPoints(t);for(const e of t)e.y=v(e.x,e.x=e.y);e.constructPoints(t)}const s=e.getStartY(),r=e.getEndY();if(r===s)continue;r<s&&e.reverse(),this.m_curves.push(e.clone()),this.m_edges.push(O(this.m_curves.at(-1)))}else{const e=this.m_bHorizontalSweep?t.getStartX():t.getStartY();if((this.m_bHorizontalSweep?t.getEndX():t.getEndY())===e)continue;this.m_edges.push(I(t,this.m_bHorizontalSweep))}}this.m_edges.sort(((t,e)=>t.y0===e.y0?t.x0-e.x0:t.y0-e.y0))}buildScanNodes(){const t=[];for(const n of this.m_edges){const e=R();e.x=n.x0,e.y=n.y0,e.startEdge=n,e.endEdge=null,t.push(e);const s=R();s.x=n.x1,s.y=n.y1,s.startEdge=null,s.endEdge=n,t.push(s)}t.sort(((t,e)=>t.compare(e)));let e=0,s=t[e].y;this.m_sortedNodes.push(M(s,t[e].startEdge));let r=e;for(e++;e!==t.length;++e){t[e].y!==s&&(this.m_sortedNodes.push(M(t[e].y,null)),s=t[e].y);const n=t[e].startEdge;if(n){const t=this.m_sortedNodes.at(-1);n.startNodeNext=t.startingEdges,t.startingEdges=n}if(t[r].x!==t[e].x||t[r].y!==t[e].y){if(e-r==2){let e=r;e++,null!==t[r].endEdge&&null!==t[e].startEdge&&(t[r].endEdge.nextInChain=t[e].startEdge)}r=e}}}progress(){}splitPolygonLinear(t,s,n,o,a,u){const h=[];h.push([t,0,u]);const m=[],c=new l;for(c.startPathCoords(n,0),c.lineToCoords(o,0);h.length>0;){const l=h.at(-1);h.pop();const p=l[0],_=l[1],g=l[2],f=(new w).executeMany(new e([p]),s,this.m_progressTracker);for(let e=f.next();null!==e;e=f.next()){const l=e,p=new i;l.queryLooseEnvelope(p);let f=_,y=g;for(let t=_,e=g-1;t<g;++t,--e)p.ymin>=a[t]&&(f=t+1),p.ymax<=a[e]&&(y=e);if(f!==g)if(y!==_)if(f!==y)if(this.isYMonotone(l))this.splitYMonotone(m,l,s,a,f,y);else{const e=Math.trunc((f+y)/2);c.setXYCoords(0,n,a[e]),c.setXYCoords(1,o,a[e]);const _=(new C).execute(!1,l,c,null,this.m_progressTracker),g=_.next(),x=_.next(),T=_.next();if(null!==g){if(g.isEmpty()||(e===y-1?(m.push(d(g,e)),r(j(m.at(-1).first,s,t,m.at(-1).second,a,u))):h.push([g,e+1,y])),x.isEmpty()||(e===f?(m.push(d(x,e-1)),r(j(m.at(-1).first,s,t,m.at(-1).second,a,u))):h.push([x,f,e])),null!==T&&!T.isEmpty()){const t=new i;T.queryLooseEnvelope(t),t.ymin>=a[e]?h.push([T,e+1,y]):t.ymax<=a[e]?h.push([T,f,e]):h.push([T,f,y])}}else e+1===y?(a[e]-p.ymin<p.ymax-a[e]?m.push(d(l,e)):m.push(d(l,e+1)),r(j(m.at(-1).first,s,t,m.at(-1).second,a,u))):h.push([l,e+1,y])}else m.push(d(e,f-1));else m.push(d(e,_-1));else m.push(d(e,g-1))}}return m}splitPolygon(t,e,s,r,n,o){const a=new i;t.queryLooseEnvelope(a),a.inflateCoords(0,Math.max(a.width(),a.height()));const u=[],l=[];for(l.push(B(t,0,o));l.length;){const o={...l.at(-1)};if(l.pop(),o.polygon.hasNonLinearSegments()){const t=Math.trunc((o.to+o.from)/2),h=n[t],m=new i(s,a.ymin,r,h),c=(new S).execute(o.polygon,m,e,this.m_progressTracker);c.isEmpty()||(t-o.from==0?u.push(d(c,t-1)):l.push(B(c,o.from,t)));const p=new i(s,h,r,a.ymax),_=(new S).execute(o.polygon,p,e,this.m_progressTracker);_.isEmpty()||(o.to-t==1?u.push(d(_,t)):l.push(B(_,t+1,o.to)))}else{const i=this.splitPolygonLinear(t,e,s,r,n.slice(o.from),o.to-o.from);u.push(...i)}}u.sort(((t,e)=>t.second-e.second));const m=[];return h(u,((t,e)=>t.second===e.second),((t,e)=>{const s=new c;for(let r=t;r!==e;++r)s.add(u[r].first,!1);m.push(d(s,u[t].second))})),m}isYMonotone(t){if(1!==t.getPathCount())return!1;const e=t.getXY(0);let s=0,r=0;const n=new E;for(let i=1,o=t.getPointCount();i<=o;i++){t.queryXY(i===o?0:i,n);const a=n.y>e.y?1:n.y<e.y?-1:0;if(e.setCoordsPoint2D(n),s!==a&&0!==a){if(0!==s&&(r++,r>2))return!1;s=a}}return!0}splitYMonotone(t,e,s,n,i,o){const a=new m;a.addGeometry(e);const u=a.getFirstPath(a.getFirstGeometry()),l=a.getFirstVertex(u),h=new E,c=new E;let p=l,_=l;{const t=a.getXY(l);h.setCoordsPoint2D(t),c.setCoordsPoint2D(t)}let g=a.getNextVertex(l);const y=new E;for(let r=0,m=a.getPathSize(u);r<m;r++,g=a.getNextVertex(g))a.queryXY(g,y),y.compare(h)<0?(p=g,h.setCoordsPoint2D(y)):y.compare(c)>0&&(_=g,c.setCoordsPoint2D(y));let x=p,T=p,A=x,v=T,N=!1,S=!1,w=i,C=h.y,X=h.y,H=!1;for(;w<o;)if(n[w]<=h.y)w++;else{if(n[w]>=c.y)break;if(!N){const t=a.getNextVertex(x),e=a.getY(t);if(e<C)break;const s=n[w];C<=s&&e>=s?N=!0:(C=e,x=t)}if(!S){const t=a.getPrevVertex(T),e=a.getY(t);if(e<X)break;const s=n[w];X<=s&&e>=s?S=!0:(X=e,T=t)}if(N&&S){H=!0;let e=a.getXY(x);const s=a.getNextVertex(x);let i=a.getXY(s),o=f;if(i.y===e.y)o=i.x<e.x?x:s;else{const t=(n[w]-e.y)/(i.y-e.y);if(0===t)o=x;else if(1===t)o=s;else{const e=a.splitSegmentAxisAware(x,[t],1,null,-1);r(1===e),o=a.getNextVertex(x),a.getY(o)!==n[w]&&a.setXYCoords(o,a.getX(o),n[w])}}const u=a.getPrevVertex(T);e=a.getXY(u),i=a.getXY(T);let l=f;if(i.y===e.y)l=i.x<e.x?T:u;else{const t=(n[w]-e.y)/(i.y-e.y);if(0===t)l=u;else if(1===t)l=T;else{const e=a.splitSegmentAxisAware(u,[t],1,null,-1);r(1===e),l=a.getNextVertex(u),a.getY(l)!==n[w]&&a.setXYCoords(l,a.getX(l),n[w])}}t.push(d(this.extractTrapezoid(a,A,o,v,l),w-1)),A=o,v=l,x=o,T=l,C=X=n[w],N=!1,S=!1,w++}}H?t.push(d(this.extractTrapezoid(a,A,_,v,_),w-1)):t.push(d(e,w))}extractTrapezoid(t,e,s,r,n){const i=new c({vd:t.getVertexDescription()}),o=new p;let a=!0;for(let u=e;;u=t.getNextVertex(u)){const e=t.getSegment(u);if(e?i.addSegment(e,a):(t.queryPoint(u,o),a?i.startPathPoint(o):i.lineToPoint(o)),a=!1,u===s)break}s!==n&&(t.queryPoint(n,o),i.lineToPoint(o)),a=!0;for(let u=n;;u=t.getNextVertex(u)){const s=t.getSegment(u);if(s?i.addSegment(s,a):a||u===e||(t.queryPoint(u,o),i.lineToPoint(o)),a=!1,u===r)break}return i}}function L(t){return t.getImpl().ensureXYMonotoneSegments()}function j(t,e,s,r,n,o){const a=new i;t.queryEnvelope(a);const u=4*_(e,s,!0).total();return(!(r>=0)||a.ymin+u>=n[r])&&!(r+1<o&&a.ymax>n[r+1]+u)}class F{getOperatorType(){return 10011}accelerateGeometry(t,e,s){return!1}canAccelerateGeometry(t){return!1}supportsCurves(){return!0}sliceIntoStrips(t,e,s,r,n,i){return new W(0,t,e,s,n,0,i)}findSlicesByArea(t,e,s,r,n,i){if(!n||n.isIdentity())return X(t,e,s,r,i);{const o=t.clone();return o.applyTransformation(n),X(o,e,s,r,i)}}recursiveSliceEqualArea(t,e,s,r,n){return new W(1,t,e,null,r,s,n)}}class W extends t{constructor(t,e,s,r,n,i,o){super(),this.m_resultCursor=null,this.m_method=t,this.m_polygon=e,this.m_sr=s,this.m_ySplits=r?.slice()??null,this.m_transform=n,this.m_bReversePaths=n?.isReflective()??!1,this.m_inverseTransform=n?n.clone().invertThis():null,this.m_partCount=i,this.m_tracker=o}tock(){return!0}getRank(){return 1}next(){this.m_resultCursor||(this.m_method?this.recursiveSliceEqualArea():this.sliceIntoStrips());const t=this.m_resultCursor.next();return t?(this.m_inverseTransform&&!this.m_inverseTransform.isIdentity()&&(t.applyTransformation(this.m_inverseTransform),this.m_bReversePaths&&t.reverseAllPaths()),t):t}getGeometryID(){return this.m_resultCursor?this.m_resultCursor.getGeometryID():-1}sliceIntoStrips(){if(!this.m_transform||this.m_transform.isIdentity())this.m_resultCursor=H(this.m_polygon,this.m_sr,this.m_ySplits,this.m_ySplits.length,this.m_tracker);else{const t=this.m_polygon.clone();t.applyTransformation(this.m_transform),this.m_bReversePaths&&t.reverseAllPaths(),this.m_resultCursor=H(t,this.m_sr,this.m_ySplits,this.m_ySplits.length,this.m_tracker)}}recursiveSliceEqualArea(){if(!this.m_transform||this.m_transform.isIdentity())this.m_resultCursor=b(this.m_polygon,this.m_sr,this.m_partCount,this.m_tracker);else{const t=this.m_polygon.clone();t.applyTransformation(this.m_transform),this.m_bReversePaths&&t.reverseAllPaths(),this.m_resultCursor=b(t,this.m_sr,this.m_partCount,this.m_tracker)}}}const K=new F;function Q(t,e,s,r,n){return K.findSlicesByArea(t,e,s,r,n,null)}function J(t,e,s,r){const n=K.recursiveSliceEqualArea(t,e,s,r,null);return Array.from(n)}function U(t,e,s,r){const n=K.sliceIntoStrips(t,e,s,0,r,null);return Array.from(n)}function Z(){return K.supportsCurves()}export{Q as findSlicesByArea,J as recursiveSliceEqualArea,U as sliceIntoStrips,Z as supportsCurves};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{G as e,S as t}from"../../../chunks/SimpleGeometryCursor.js";import{i as n,G as s,
|
|
5
|
+
import{G as e,S as t}from"../../../chunks/SimpleGeometryCursor.js";import{i as n,G as s,e as r,h as i,b as u}from"../../../chunks/Geometry.js";import{h as o,i as m,M as l}from"../../../chunks/QuadraticBezier.js";import"../../../chunks/OperatorProject.js";import"../../../chunks/Transformation2D.js";function c(e,t){if(n(e.getGeometryType())){const n=t;return e.getImpl().setIsSimple(n.flags,n.tolerance),!0}return!1}class p{getOperatorType(){return 10701}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}executeMany(e,t,n){return new a(e,t,n)}}class a extends e{constructor(e,t,n){super(),this.m_results=[],this.m_index=0,this.m_progressTracker=t,this.m_inputGeoms=e,this.m_descr=n}tock(){return!0}getRank(){return 1}next(){if(this.m_inputGeoms&&(this.combineGeometries(this.m_descr),this.m_descr=null,this.m_inputGeoms=null),this.m_index<this.m_results.length){const e=this.m_results[this.m_index];return this.m_index++,e}return null}getGeometryID(){return this.m_index-1}combineGeometries(e){let t=s.enumUnknown,n=null,p=null,a=null;for(let c=this.m_inputGeoms.next();null!==c;c=this.m_inputGeoms.next()){if(t=c.getGeometryType(),t===s.enumPolygon||t===s.enumEnvelope){if(a||(a=new o({vd:c.getDescription()})),t===s.enumPolygon){a.add(c,!1);continue}if(t===s.enumEnvelope){a.addEnvelope(c,!1);continue}}else if(r(t)||t===s.enumPolyline){if(p||(p=new m({vd:c.getDescription()})),t===s.enumPolyline){p.add(c,!1);continue}if(r(t)){p.addSegment(c,!0);continue}}else if(i(t)){if(n||(n=new l({vd:c.getDescription()})),t===s.enumPoint){n.add(c);continue}if(t===s.enumMultiPoint){n.addPoints(c,0,-1);continue}}u("unsupported type")}null!==e&&(null!==n&&c(n,e),null!==p&&c(p,e),null!==a&&c(a,e)),n&&this.m_results.push(n),p&&this.m_results.push(p),a&&this.m_results.push(a)}}const h=new p;function d(e){const n=h.executeMany(new t(e),null,null);return Array.from(n)}function f(){return h.supportsCurves()}export{d as executeMany,f as supportsCurves};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{S as e,G as t}from"../../../chunks/SimpleGeometryCursor.js";import{
|
|
5
|
+
import{S as e,G as t}from"../../../chunks/SimpleGeometryCursor.js";import{b as n,c as r,G as s}from"../../../chunks/Geometry.js";import{P as o,a as i}from"../../../chunks/Transformation2D.js";import{a as u,b as m,l as a,M as c}from"../../../chunks/QuadraticBezier.js";import{j as p}from"../../../chunks/OperatorSimplify.js";class l{getOperatorType(){return 10003}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,n,r){return new y(e,t,n,r)}execute(t,r,s,o){const i=new e([t]),u=new e([r]),m=this.executeMany(i,u,s,o).next();return m||n("null output"),m}}function f(e,t,n,r){const o=e.getDimension(),i=t.getDimension();if(o!==i)return o>i?e:t;if(e.isEmpty())return t;if(t.isEmpty())return e;const a=new u,c=new u,l=new u;e.queryEnvelope(a),t.queryEnvelope(c),l.setCoords({env2D:a}),l.mergeEnvelope2D(c);const f=m(n,l,!0),y=e.getGeometryType(),g=t.getGeometryType();return y===s.enumPoint&&g===s.enumPoint?h(e,t,f):y===s.enumPoint&&g===s.enumMultiPoint?d(t,e,f):y===s.enumMultiPoint&&g===s.enumPoint?d(e,t,f):p(e,t,n,r)}function h(e,t,n,r){const s=a(n),i=s*s,u=e.getXY(),m=t.getXY(),p=new c({vd:e.getDescription()});return o.sqrDistance(u,m)>i&&(p.add(e),p.add(t)),p}function d(e,t,n,r){const s=e.getImpl().getAttributeStreamRef(0),o=e.getPointCount(),m=t.getXY(),c=e.createInstance(),p=a(n),l=new u;if(e.queryEnvelope(l),l.inflateCoords(p,p),l.contains(m)){const n=p*p;let r=!1;const u=i(o,!1);for(let e=0;e<o;e++){const t=s.read(2*e),o=s.read(2*e+1),i=t-m.x,a=o-m.y;i*i+a*a<=n&&(r=!0,u[e]=!0)}if(r)for(let t=0;t<o;t++)u[t]||c.addPoints(e,t,t+1);else c.addPoints(e,0,o),c.add(t)}else c.addPoints(e,0,o),c.add(t);return c}class y extends t{constructor(e,t,n,s){super(),this.m_progressTracker=s,this.m_index=-1,this.m_inputGeoms=e,this.m_spatialReference=n,this.m_rightGeom=t.next(),this.m_bEmpty=!this.m_rightGeom,r(this.m_rightGeom)}tock(){return!0}getRank(){return 1}next(){if(this.m_bEmpty)return null;const e=this.m_inputGeoms.next();return e?(r(e),this.m_index=this.m_inputGeoms.getGeometryID(),f(e,this.m_rightGeom,this.m_spatialReference,this.m_progressTracker)):null}getGeometryID(){return this.m_index}}const g=new l;function G(e,t,n){return g.execute(e,t,n,null)}function _(t,n,r){const s=g.executeMany(new e(t),new e([n]),r,null);return Array.from(s)}function x(){return g.supportsCurves()}export{G as execute,_ as executeMany,x as supportsCurves};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import"../../core/arrayUtils.js";import"./gx/operatorIntersection.js";import"./support/apiConverter.js";export{a as accelerateGeometry,e as execute,b as executeMany,s as supportsCurves}from"../../chunks/intersectionOperator.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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import"../../chunks/OperatorIntersects.js";import"./support/apiConverter.js";export{a as accelerateGeometry,e as execute,s as supportsCurves}from"../../chunks/intersectsOperator.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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{t as e,
|
|
5
|
+
import{t as e,c as r}from"../../chunks/Geometry.js";import{D as t}from"../../chunks/Distance2DCalculator-eS0piaux.js";import{convertToSpatialReferenceUnit as s}from"../../core/unitUtils.js";import{getSpatialReference as n,fromGeometry as o}from"./support/apiConverter.js";class u{getOperatorType(){return 10}accelerateGeometry(e,r,t){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(s,n,o,u){if(s.isEmpty()||n.isEmpty())return!1;o<0&&e("distance"),r(s),r(n);const c=s,i=n;Number.isNaN(o)&&(o=Number.POSITIVE_INFINITY);return new t(o,u).isNear(c,i)}}const c=new u;function i(e,r,t,u={}){const{unit:i}=u;if(i){const r=n(e);t=s(t,i,r)}return c.execute(o(e),o(r),t,null)}const a=c.supportsCurves();export{i as execute,a as supportsCurves};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{a as e}from"../../../chunks/OperatorProject.js";import{fromGeometry as t,fromGeometryToGXGeometry as r}from"../support/jsonConverter.js";const o=new e;function n(e,n){const s=t(e);return o.execute(s.getGeometry(),r(n),s.getSpatialReference())}export{n as execute};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import"../../core/unitUtils.js";import"./support/apiConverter.js";export{e as execute,s as supportsCurves}from"../../chunks/lengthOperator.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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import"../../core/arrayUtils.js";import"../../core/unitUtils.js";import"./gx/operatorOffset.js";import"./support/apiConverter.js";export{e as execute,a as executeMany,s as supportsCurves}from"../../chunks/offsetOperator.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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import"../../chunks/OperatorOverlaps.js";import"./support/apiConverter.js";export{a as accelerateGeometry,e as execute,s as supportsCurves}from"../../chunks/overlapsOperator.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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import"../../chunks/OperatorProximity.js";import"../../core/unitUtils.js";import"./support/apiConverter.js";import"./support/proximityResult.js";export{g as getNearestCoordinate,a as getNearestVertex,b as getNearestVertices,s as supportsCurves}from"../../chunks/proximityOperator.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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
export{a as accelerateGeometry,e as execute,i as isValidDE9IM,s as supportsCurves}from"../../chunks/relateOperator.js";import"./support/apiConverter.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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{a as e,p as t,G as r,b as s}from"../../chunks/Geometry.js";import{a,b as n,i as m,S as i,P as o,h}from"../../chunks/QuadraticBezier.js";import{O as l}from"../../chunks/OperatorSimplify.js";import{getSpatialReference as c,fromGeometry as u,fromPolyline as g,fromSpatialReference as _,toGeometry as d}from"./support/apiConverter.js";function x(s,i,o,h){if(i.getPathCount()>1&&e(""),s.isEmpty()||i.isEmpty())return null;t(s),t(i);let l=null;const c=new a;s.queryEnvelope(c);const u=new a;i.queryEnvelope(u);const g=new a;g.setCoords({env2D:c}),g.mergeEnvelope2D(u);const _=n(o,g,!1).total(),d=new A(h);let x=d.setIndicesAndScalars(s,i,_);if(x){const e=d.getTrimmedPolyline(s,i);if(e.isEmpty())return null;l=d.getReshapedMultiPath(s,e,o)}else{if(Number.isNaN(d.m_scalarB0)||s.getGeometryType()===r.enumPolyline)return null;const e=new m;if(e.add(i,!0),d.clearIndicesAndScalars(),x=d.setIndicesAndScalars(s,e,_),!x)return null;const t=d.getTrimmedPolyline(s,e);if(t.isEmpty())return null;l=d.getReshapedMultiPath(s,t,o)}return l}class A{constructor(e){this.m_progressTracker=e,this.clearIndicesAndScalars()}setIndicesAndScalars(e,t,s){const n=new a,m=new a;e.queryEnvelope(n),e.queryEnvelope(m),n.inflateCoords(s,s);if(!n.intersect(m))return!1;const i=e.getImpl().querySegmentIterator(),o=t.getImpl().querySegmentIterator(),h=[0,0],l=[0,0];let c=-1,u=-1,g=-1,_=-1,d=-1,x=-1,A=Number.NaN,p=Number.NaN,S=Number.NaN,y=Number.NaN;for(o.nextPath();o.hasNextSegment();){const e=o.nextSegment(),t=new a;for(e.queryEnvelope(t),t.inflateCoords(s,s),i.resetToFirstPath();i.nextPath();){for(;i.hasNextSegment();){const r=i.nextSegment(),n=new a;if(r.queryEnvelope(n),t.isIntersecting(n)){if(0!==e.intersect(r,null,l,h,s)&&(Number.isNaN(S)||l[0]<S)&&(c=i.getPathIndex(),g=i.getStartPointIndex(),d=o.getStartPointIndex(),A=h[0],S=l[0],0===S))break}}if(0===S)break}if(!Number.isNaN(S)&&1!==S)break}if(Number.isNaN(S))return!1;this.m_pathA0=c,this.m_vertexA0=g,this.m_vertexB0=d,this.m_scalarA0=A,this.m_scalarB0=S;const v=e.getGeometryType();for(o.resetToLastSegment();o.hasPreviousSegment();){const e=o.previousSegment(),t=new a;for(e.queryEnvelope(t),t.inflateCoords(s,s),v===r.enumPolygon?i.resetToPath(c):i.resetToFirstPath();i.nextPath();){for(;i.hasNextSegment();){const r=i.nextSegment(),n=new a;if(r.queryEnvelope(n),t.isIntersecting(n)){const t=e.intersect(r,null,l,h,s);if(0!==t&&(Number.isNaN(y)||l[t-1]>y)&&(o.getStartPointIndex()!==this.m_vertexB0||l[t-1]!==this.m_scalarB0)&&(u=i.getPathIndex(),_=i.getStartPointIndex(),x=o.getStartPointIndex(),p=h[t-1],y=l[t-1],1===y))break}}if(1===y)break;if(v===r.enumPolygon)break}if(!Number.isNaN(y))break}return!Number.isNaN(y)&&(this.m_pathA1=u,this.m_vertexA1=_,this.m_vertexB1=x,this.m_scalarA1=p,this.m_scalarB1=y,!0)}getTrimmedPolyline(e,t){const r=new i,s=t.createInstance();let a=!0;const n=t.getImpl().querySegmentIterator();if(n.resetToVertex(this.m_vertexB0,0),this.m_vertexB0>this.m_vertexB1)return s;if(this.m_vertexB0===this.m_vertexB1){n.nextSegment().queryCut(this.m_scalarB0,this.m_scalarB1,r,!1),s.addSegment(r.get(),!0)}else for(;;){const e=n.nextSegment(),t=n.getStartPointIndex();if(t===this.m_vertexB0)1!==this.m_scalarB0&&(e.queryCut(this.m_scalarB0,1,r,!1),s.addSegment(r.get(),a),a=!1);else{if(t===this.m_vertexB1){0!==this.m_scalarB1&&(e.queryCut(0,this.m_scalarB1,r),s.addSegment(r.get(),a),a=!1);break}s.addSegment(e,a)}}if(s.isEmpty())return s;if(e.getDescription().getAttributeCount()>1){const t=e.getImpl().querySegmentIterator(),r=new o,a=s.getPointCount();t.resetToVertex(this.m_vertexA0,this.m_pathA0);t.nextSegment().queryCoord(this.m_scalarA0,r),s.setPointByVal(0,r),t.resetToVertex(this.m_vertexA1,this.m_pathA1);t.nextSegment().queryCoord(this.m_scalarA1,r),s.setPointByVal(a-1,r),s.interpolateAttributesRange(0,0,0,a-1)}return s}getReshapedMultiPath(e,t,s){let a;return a=e.getGeometryType()===r.enumPolygon?this.getReshapedPolygon(e,t,s):this.getReshapedPolyline(e,t),a}getReshapedPolygon(e,t,r){const s=e.getImpl().querySegmentIterator();s.setCirculator(!0);const a=new i;new o;const n=new h({vd:e.getDescription()});if(n.addSegmentsFromPath(t,0,0,t.getSegmentCountPath(0),!0),s.resetToVertex(this.m_vertexA1,this.m_pathA0),this.m_vertexA1===this.m_vertexA0&&this.m_scalarA1<=this.m_scalarA0){s.nextSegment().queryCut(this.m_scalarA1,this.m_scalarA0,a),n.addSegment(a.get(),!1)}else{{const e=s.nextSegment();1!==this.m_scalarA1&&(e.queryCut(this.m_scalarA1,1,a),n.addSegment(a.get(),!1))}for(;;){const e=s.nextSegment();if(s.getStartPointIndex()===this.m_vertexA0){0!==this.m_scalarA0&&(e.queryCut(0,this.m_scalarA0,a),n.addSegment(a.get(),!1));break}n.addSegment(e,!1)}}const m=new h({vd:e.getDescription()}),c=t.clone();if(c.reversePath(0),m.addSegmentsFromPath(c,0,0,c.getSegmentCountPath(0),!0),s.resetToVertex(this.m_vertexA0,this.m_pathA0),this.m_vertexA0===this.m_vertexA1&&this.m_scalarA0<this.m_scalarA1){s.nextSegment().queryCut(this.m_scalarA0,this.m_scalarA1,a),m.addSegment(a.get(),!1)}else{{const e=s.nextSegment();1!==this.m_scalarA0&&(e.queryCut(this.m_scalarA0,1,a),m.addSegment(a.get(),!1))}for(;;){const e=s.nextSegment();if(s.getStartPointIndex()===this.m_vertexA1){0!==this.m_scalarA1&&(e.queryCut(0,this.m_scalarA1,a),m.addSegment(a.get(),!1));break}m.addSegment(e,!1)}}const u=Math.abs(n.calculateArea2D()),g=Math.abs(m.calculateArea2D());let _=e.createInstance();for(let i=0;i<e.getPathCount();i++)i===this.m_pathA0?u>=g?_.add(n,!1):_.add(m,!1):_.addPath(e,i,!0);return _=(new l).execute(_,r,!1,this.m_progressTracker),_}getReshapedPolyline(e,t){const r=e.getImpl().querySegmentIterator(),a=new m,n=new i;let o=!1,h=-1,l=Number.NaN;o=this.m_pathA0>this.m_pathA1||this.m_pathA0===this.m_pathA1&&(this.m_vertexA0>this.m_vertexA1||this.m_vertexA0===this.m_vertexA1&&this.m_scalarA0>this.m_scalarA1),o?(h=this.m_vertexA1,l=this.m_scalarA1,r.resetToPath(this.m_pathA1)):(h=this.m_vertexA0,l=this.m_scalarA0,r.resetToPath(this.m_pathA0));let c=!0;for(r.nextPath()||s("reshaper");;){const e=r.nextSegment();if(r.getStartPointIndex()===h){0!==l&&(e.queryCut(0,l,n),a.addSegment(n.get(),c),c=!1);break}a.addSegment(e,c),c=!1}if(o){const e=t.clone();e.reversePath(0),a.addSegmentsFromPath(e,0,0,e.getSegmentCount(),c)}else a.addSegmentsFromPath(t,0,0,t.getSegmentCount(),c);o?(l=this.m_scalarA0,r.resetToVertex(this.m_vertexA0,this.m_pathA0)):(l=this.m_scalarA1,r.resetToVertex(this.m_vertexA1,this.m_pathA1));{const e=r.nextSegment();1!==l&&(e.queryCut(l,1,n),a.addSegment(n.get(),!1))}for(;r.hasNextSegment();){const e=r.nextSegment();a.addSegment(e,!1)}const u=e.createInstance();let g=!1;for(let s=0;s<e.getPathCount();s++)s===this.m_pathA0||s===this.m_pathA1?g||(u.add(a,!1),g=!0):u.addPath(e,s,!0);return u}clearIndicesAndScalars(){this.m_pathA0=-1,this.m_pathA1=-1,this.m_vertexA0=-1,this.m_vertexA1=-1,this.m_vertexB0=-1,this.m_vertexB1=-1,this.m_scalarA0=Number.NaN,this.m_scalarA1=Number.NaN,this.m_scalarB0=Number.NaN,this.m_scalarB1=Number.NaN}}class p{getOperatorType(){return 10006}accelerateGeometry(e,t,r){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!1}execute(e,t,r,s){return x(e,t,r,s)}}const S=new p;function y(e,t){const r=c(e),s=S.execute(u(e),g(t),_(r),null);return d(s,r)}const v=S.supportsCurves();export{y as execute,v as supportsCurves};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import"./gx/operatorSimplify.js";import"./support/apiConverter.js";export{e as execute,a as executeMany,i as isSimple,b as supportsCurves}from"../../chunks/simplifyOperator.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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{P as e}from"../../../chunks/Transformation2D.js";import{E as t,M as n,P as r}from"../../../chunks/QuadraticBezier.js";import{G as s}from"../../../chunks/Geometry.js";import{c as a,
|
|
5
|
+
import{P as e}from"../../../chunks/Transformation2D.js";import{E as t,M as n,P as r}from"../../../chunks/QuadraticBezier.js";import{G as s}from"../../../chunks/Geometry.js";import{c as a,b as o}from"../../../chunks/OperatorProject.js";import"../../../geometry.js";import"./initNoPeFactory.js";import{fromGeometryToGXGeometry as i,toGeometry as u}from"./jsonConverter.js";import c from"../../Extent.js";import l from"../../Multipoint.js";import m from"../../Point.js";import h from"../../Polygon.js";import f from"../../Polyline.js";const p="_gxVersion",g=2,y=1;function C(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function x(e){switch(e.type){case"point":return w(e);case"multipoint":return V(e);case"polyline":return Z(e);case"polygon":return P(e);case"extent":return M(e);default:throw new Error(`Unsupported geometry type: ${e.type}`)}}function M(e){if(!e.getCacheValue(p)){const n=new t;n.setCoords(e.xmin,e.ymin,e.xmax,e.ymax),e.hasM&&n.setInterval(g,0,e.mmin,e.mmax),e.hasZ&&n.setInterval(y,0,e.zmin,e.zmax),e.setCacheValue(p,n)}return e.getCacheValue(p)}function V(e){if(!e.getCacheValue(p)){const t=new n,s=new r,a=e.points,o=e.hasM,i=e.hasZ,u=i?3:2;for(let e=0,n=a.length;e<n;e++){const n=a[e];s.setXYCoords(n[0],n[1]),i&&s.setZ(n[2]??0),o&&s.setM(n[u]??NaN),t.add(s)}e.setCacheValue(p,t)}return e.getCacheValue(p)}function w(e){if(!e.getCacheValue(p)){const t=new r;t.setXYCoords(e.x,e.y),e.hasM&&t.setM(e.m),e.hasZ&&t.setZ(e.z),e.setCacheValue(p,t)}return e.getCacheValue(p)}function P(e){if(!e.getCacheValue(p)){const{curveRings:t,hasM:n,hasZ:r,rings:s}=e,a=i({curveRings:t,hasM:n,hasZ:r,rings:s});e.setCacheValue(p,a)}return e.getCacheValue(p)}function Z(e){if(!e.getCacheValue(p)){const{curvePaths:t,hasM:n,hasZ:r,paths:s}=e,a=i({curvePaths:t,hasM:n,hasZ:r,paths:s});e.setCacheValue(p,a)}return e.getCacheValue(p)}function j(e){if(e.wkid)return a(e.wkid);const t=e.wkt2||e.wkt;return t?o(t):null}function v(e,t){if(e)switch(e.getGeometryType()){case s.enumPoint:return E(e,t);case s.enumEnvelope:return d(e,t);case s.enumMultiPoint:return R(e,t);case s.enumPolyline:return z(e,t);case s.enumPolygon:return k(e,t)}return null}function d(e,t){if(e.isEmpty())return null;const n=new c({xmin:e.getXMin(),ymin:e.getYMin(),xmax:e.getXMax(),ymax:e.getYMax(),spatialReference:t}),r=e.getDescription();if(r.hasM()){const t=e.queryInterval(g,0);n.mmin=t.vmin,n.mmax=t.vmax}if(r.hasZ()){const t=e.queryInterval(y,0);n.zmin=t.vmin,n.zmax=t.vmax}return n.setCacheValue(p,e),n}function R(e,t){if(e.isEmpty())return null;const n=e.getDescription(),s=n.hasM(),a=n.hasZ(),o=[],i=new r;for(let r=0,c=e.getPointCount();r<c;r++){e.getPointByVal(r,i);const t=[i.getX(),i.getY()];a&&t.push(i.getZ()),s&&t.push(i.getM()),o.push(t)}const u=new l({hasM:s,hasZ:a,points:o,spatialReference:t});return u.setCacheValue(p,e),u}function E(t,n){if(t instanceof e)return new m({x:t.x,y:t.y,spatialReference:n});if(t.isEmpty())return null;const r=new m({x:t.getX(),y:t.getY(),spatialReference:n}),s=t.getDescription();return s.hasM()&&(r.m=t.getM()),s.hasZ()&&(r.z=t.getZ()),r.setCacheValue(p,t),r}function k(e,t){if(e.isEmpty())return null;const n=h.fromJSON({spatialReference:t,...u(e,null)});return n.setCacheValue(p,e),n}function z(e,t){if(e.isEmpty())return null;const n=f.fromJSON({spatialReference:t,...u(e,null)});return n.setCacheValue(p,e),n}export{M as fromExtent,x as fromGeometry,V as fromMultipoint,w as fromPoint,P as fromPolygon,Z as fromPolyline,j as fromSpatialReference,C as getSpatialReference,d as toExtent,v as toGeometry,R as toMultipoint,E as toPoint,k as toPolygon,z as toPolyline};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{a as e,t,g as n,w as r,u as i,G as s,k as a}from"../../../chunks/Geometry.js";import{L as o,o as u,P as m,D as l,N as c,m as d}from"../../../chunks/Transformation2D.js";import{a3 as _,a as h,a4 as f,a5 as p,c as k,j as b,a6 as y,S as N,a7 as T}from"../../../chunks/OperatorProject.js";import{af as g,aw as v,ax as x,ay as A,P as S,E as w,g as C,h as D,az as F,aA as j,S as z,aB as O,M as I,aC as E,aD as B,aE as P,aF as V,aG as M,aH as R}from"../../../chunks/QuadraticBezier.js";import"./initNoPeFactory.js";function U(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:1,m_value:null},done:!1};if(this.m_i<this.m_keys.length){const e=this.m_bReturnKey,t=Math.trunc(this.m_i);return this.m_bReturnKey=!this.m_bReturnKey,this.m_i+=.5,e?{value:{m_token:5,m_value:this.m_keys[t]},done:!1}:{value:{m_token:6,m_value:this.m_o[this.m_keys[t]]},done:!1}}return{value:{m_token:3,m_value:null},done:!0}}function X(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:2,m_value:null},done:!1};if(this.m_i<this.m_a.length){const e={value:{m_token:6,m_value:this.m_a[this.m_i++]},done:!1};return this.m_strict||void 0===e.value.m_value&&(e.value.m_value=Number.NaN),e}return{value:{m_token:4,m_value:null},done:!0}}class L{createJSONObjectIterator(e){return{m_iteratorType:"object",m_o:e,m_keys:this.m_options.strict?Object.keys(e):Object.keys(e).filter((t=>void 0!==e[t])),m_i:-1,m_bReturnKey:!0,next:U}}createJSONArrayIterator(e){return{m_iteratorType:"array",m_strict:this.m_options.strict,m_i:-1,m_a:e,next:X}}constructor(e,t){this.m_currentToken=0,this.m_options=t?{...t}:{strict:!0};const n=e;this.m_iteratorStack=[n instanceof Array?this.createJSONArrayIterator(n):this.createJSONObjectIterator(n)],this.m_nextFlatToken={m_value:null,m_token:0}}nextToken(){if(0===this.m_iteratorStack.length)return this.m_currentToken=0;switch(this.m_nextFlatToken=this.m_iteratorStack.at(-1).next().value,this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_currentToken=1;case 3:return this.m_iteratorStack.pop(),this.m_currentToken=3;case 2:return this.m_currentToken=2;case 4:return this.m_iteratorStack.pop(),this.m_currentToken=4;case 5:return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=5;case 6:if(this.m_nextFlatToken.m_value instanceof Array)return this.m_iteratorStack.push(this.createJSONArrayIterator(this.m_nextFlatToken.m_value)),this.nextToken();if(this.m_nextFlatToken.m_value instanceof Object)return this.m_iteratorStack.push(this.createJSONObjectIterator(this.m_nextFlatToken.m_value)),this.nextToken();if("number"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,Number.isSafeInteger(this.m_currentValue)&&this.m_currentValue>=o()&&this.m_currentValue<=u()?this.m_currentToken=8:this.m_currentToken=7;if("string"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=6;if("boolean"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=this.m_nextFlatToken.m_value?11:12;if("object"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=null,this.m_currentToken=10;e("unrecognized json element type")}return e("unrecognized json element type"),0}currentToken(){return this.m_currentToken}skipChildren(){if(0!==this.m_iteratorStack.length)switch(this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=3,void(this.m_currentToken=3);case 2:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=4,void(this.m_currentToken=4)}}currentString(){return 6!==this.m_currentToken&&5!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentDoubleValue(){return 7!==this.m_currentToken&&8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt32Value(){return 8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt64Value(){return n(0),0n}currentBoolValue(){return 12!==this.m_currentToken&&11!==this.m_currentToken&&t("invalid token"),this.m_currentValue}isError(){return 0}}class Y{constructor(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject=[]}reset(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject.length=0}startObject(){const e={};this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}startArray(){const e=[];this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}endObject(){this.m_acceptedObject=this.m_currentObject.at(-1),this.m_currentObject.pop()}endArray(){this.m_currentObject.pop()}addFieldName(e){this.m_pendingKey=e}addValue_(e){this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):this.m_currentObject.at(-1).push(e)}addString(e){this.addValue_(e)}addDouble(e,t){this.addValue_(e)}addInt64(e){n(0)}addInt32(e){this.addValue_(e)}addBool(e){this.addValue_(e)}addNull(){this.addValue_(null)}getObject(){return this.m_acceptedObject}}class G{constructor(t){return this.m_buffer=null,this.m_view=null,this.m_sz=0,this.m_offset=0,this.m_bOwnsBuffer=!0,this.m_bLittleEndian=!0,this.m_element=new ArrayBuffer(8),this.m_elementBytes=new Uint8Array(this.m_element),this.m_elementView=new DataView(this.m_element),this.m_elementDouble=new Float64Array(this.m_element),this.m_elementFloat=new Float32Array(this.m_element),this.m_elementInt64=new BigInt64Array(this.m_element),this.m_elementInt32=new Int32Array(this.m_element),this.m_elementInt16=new Int16Array(this.m_element),void 0!==t.sz?(this.m_sz=t.sz,t.buffer?(this.m_sz<0&&r("size out of range"),this.m_buffer=t.buffer,this.m_offset=void 0!==t.offset?t.offset:0,this.m_view=void 0!==t.offset?new DataView(t.buffer,t.offset,t.sz):new DataView(this.m_buffer),this.m_bOwnsBuffer=!1,void(this.m_bLittleEndian=!0)):(this.m_sz<0&&r("size out of range"),void(this.m_sz>0&&(this.m_buffer=new ArrayBuffer(this.m_sz),this.m_view=new DataView(this.m_buffer))))):t.move?(this.m_sz=t.move.m_sz,this.m_buffer=t.move.m_buffer,this.m_view=t.move.m_view,this.m_bOwnsBuffer=t.move.m_bOwnsBuffer,this.m_bLittleEndian=t.move.m_bLittleEndian,t.move.m_buffer=null,t.move.m_view=null,t.move.m_sz=0,void(t.move.m_bOwnsBuffer=!0)):void e("unrecognized constructor options")}swapBytesDouble(){this.doSwap()&&(this.m_elementDouble[0]=this.m_elementBytes[0]<<56|this.m_elementBytes[1]<<48|this.m_elementBytes[2]<<40|this.m_elementBytes[3]<<32|this.m_elementBytes[4]<<24|this.m_elementBytes[5]<<16|this.m_elementBytes[6]<<8|this.m_elementBytes[7])}swapBytesInt32(){this.doSwap()&&(this.m_elementInt32[0]=this.m_elementBytes[0]<<24|this.m_elementBytes[1]<<16|this.m_elementBytes[2]<<8|this.m_elementBytes[3])}getOffset(){return this.m_offset}assignMove(e){return this===e||(this.clear(),this.m_sz=e.m_sz,this.m_buffer=e.m_buffer,this.m_view=e.m_view,this.m_bOwnsBuffer=e.m_bOwnsBuffer,this.m_bLittleEndian=e.m_bLittleEndian,e.m_buffer=null,e.m_sz=0,e.m_bOwnsBuffer=!0),this}doSwap(){return this.m_bLittleEndian!==(1===G.getNativeByteOrder())}setNativeByteOrder(){this.m_bLittleEndian=1===G.getNativeByteOrder()}setOrder(e){this.m_bLittleEndian=1===e}getOrder(){return this.m_bLittleEndian?1:0}getView(){return this.m_view||i("buffer not defined"),this.m_view}static getNativeByteOrder(){return 1}clear(){this.m_buffer=null,this.m_sz=0,this.m_bOwnsBuffer=!0}size(){return this.m_sz}readDouble(e){return this.doSwap()?(this.m_elementDouble[0]=this.m_view.getFloat64(e,this.m_bLittleEndian),this.swapBytesDouble(),this.m_elementDouble[0]):this.m_view.getFloat64(e,this.m_bLittleEndian)}writeDouble(e,t){this.m_elementDouble[0]=t,this.swapBytesDouble(),this.m_view.setFloat64(e,this.m_elementDouble[0],this.m_bLittleEndian)}readInt32(e){return this.doSwap()?(this.m_elementInt32[0]=this.m_view.getInt32(e,this.m_bLittleEndian),this.swapBytesInt32(),this.m_elementInt32[0]):this.m_view.getInt32(e,this.m_bLittleEndian)}writeInt32(e,t){this.m_elementInt32[0]=t,this.swapBytesInt32(),this.m_view.setInt32(e,this.m_elementInt32[0],this.m_bLittleEndian)}getPtr(){return this.m_buffer}setSizeNoRealloc(e){n(e>=0&&e<=this.m_sz),this.m_sz=e}}function W(e,r,i,a,o,u){let m=!1,l=!1,c=!1,d=!1,_=!1,h=!1,f=!1,p=!1,k=!1,b=!1,y=!1,N=!1,T=!1,g=!1,v=!1,C=!1,D=!1,F=!1,j=!1,z=!1,O=!1,I=!1,E=!1,B=!1,P=Number.NaN,V=Number.NaN,M=Number.NaN,R=Number.NaN,U=0,X=Number.NaN,L=Number.NaN,Y=Number.NaN,G=Number.NaN,W=Number.NaN,K=Number.NaN,te=Number.NaN,ne=Number.NaN,re=0,ie=0,se=!1,ae=!1,oe=null,ue=null,me=null,le=null,ce=null;for(;3!==i.nextToken();){const u=i.currentString();if(i.nextToken(),"spatialReference"===u){if(o&&!m){m=!0,1===i.currentToken()?le=q(i):10!==i.currentToken()&&t("failed to parse spatial reference: object or null is expected");continue}}else if(a)if("hasZ"===u){if(!l){l=!0,se=11===i.currentToken();continue}}else if("hasM"===u){if(!c){c=!0,ae=11===i.currentToken();continue}}else if("rings"===u){if(!(_||h||e!==s.enumUnknown&&e!==s.enumPolygon)){_=!0,({geometry:ce,as:oe,bs:ue}=Q(!0,!1,r,i));continue}}else if("curveRings"===u){if(!h&&(e===s.enumUnknown||e===s.enumPolygon)){h=!0,({geometry:ce,as:oe,bs:ue}=Q(!0,!0,r,i));continue}}else if("paths"===u){if(!(f||p||e!==s.enumUnknown&&e!==s.enumPolyline)){f=!0,({geometry:ce,as:oe,bs:ue}=Q(!1,!1,r,i));continue}}else if("curvePaths"===u){if(!p&&(e===s.enumUnknown||e===s.enumPolyline)){p=!0,({geometry:ce,as:oe,bs:ue}=Q(!1,!0,r,i));continue}}else if("points"===u){if(!k&&(e===s.enumUnknown||e===s.enumMultiPoint)){k=!0,({geometry:ce,as:oe,bs:ue}=Z(r,i));continue}}else if("ids"===u){if(!d){d=!0,me=J(r,i);continue}}else if("x"===u){if(!b&&(e===s.enumUnknown||e===s.enumPoint)){b=!0,P=H(i);continue}}else if("y"===u){if(!y&&(e===s.enumUnknown||e===s.enumPoint)){y=!0,V=H(i);continue}}else if("z"===u){if(!N&&(e===s.enumUnknown||e===s.enumPoint)){N=!0,M=H(i);continue}}else if("m"===u){if(!T&&(e===s.enumUnknown||e===s.enumPoint)){T=!0,R=H(i);continue}}else if("id"===u){if(!g&&(e===s.enumUnknown||e===s.enumPoint)){g=!0,U=$(i);continue}}else if("xmin"===u){if(!v&&(e===s.enumUnknown||e===s.enumEnvelope)){v=!0,X=H(i);continue}}else if("ymin"===u){if(!C&&(e===s.enumUnknown||e===s.enumEnvelope)){C=!0,L=H(i);continue}}else if("mmin"===u){if(!O&&(e===s.enumUnknown||e===s.enumEnvelope)){O=!0,te=H(i);continue}}else if("zmin"===u){if(!j&&(e===s.enumUnknown||e===s.enumEnvelope)){j=!0,W=H(i);continue}}else if("idmin"===u){if(!E&&(e===s.enumUnknown||e===s.enumEnvelope)){E=!0,re=$(i);continue}}else if("xmax"===u){if(!D&&(e===s.enumUnknown||e===s.enumEnvelope)){D=!0,Y=H(i);continue}}else if("ymax"===u){if(!F&&(e===s.enumUnknown||e===s.enumEnvelope)){F=!0,G=H(i);continue}}else if("mmax"===u){if(!I&&(e===s.enumUnknown||e===s.enumEnvelope)){I=!0,ne=H(i);continue}}else if("zmax"===u){if(!z&&(e===s.enumUnknown||e===s.enumEnvelope)){z=!0,K=H(i);continue}}else if("idmax"===u){if(!B&&(e===s.enumUnknown||e===s.enumEnvelope)){B=!0,ie=$(i);continue}}else"materials"===u&&n(0);i.skipChildren()}if(_||h||f||p||k){let e=null,t=null;const n=ce;se&&(ce.addAttribute(1),e=oe,e||(e=x(n.getPointCount(),Number.NaN))),ae&&(ce.addAttribute(2),t=se?ue:oe),null!=me&&ce.addAttribute(3),se&&null!=e&&n.setAttributeStreamRef(1,e),ae&&null!=t&&n.setAttributeStreamRef(2,t),null!=me&&ee(n,me)}else if(b||y||T||N||g){A(P,V)||t("failed to parse point: x and y must be finite or nan"),(Number.isNaN(V)||Number.isNaN(P))&&(P=Number.NaN,V=Number.NaN);const e=new S({x:P,y:V});N&&e.setZ(M),T&&e.setM(R),g&&e.setID(U),ce=e}else if(v||C||D||F||j||z||O||I||E||B){(Number.isNaN(L)||Number.isNaN(Y)||Number.isNaN(G))&&(X=Number.NaN);const e=new w({xmin:X,ymin:L,xmax:Y,ymax:G});j&&z&&e.setInterval(1,0,W,K),O&&I&&e.setInterval(2,0,te,ne),E&&B&&e.setInterval(3,0,re,ie),ce=e}return{...ce?{geom:ce}:{},...le?{sr:le}:{}}}function K(e){let t=!1;for(;3!==e.nextToken();){const n=e.currentString();e.nextToken(),"uwkid"===n?t||(t=!0,8===e.currentToken()&&e.currentInt32Value()):e.skipChildren()}return null}function q(e){let t=!1,n=!1,r=!1,i=!1,s=!1,a=!1,o=!1,u=!1,m=!1,l=!1,c=!1,d=!1,T=!1,g=!1,v=!1,x=!1,A=!1,S=-1,w=-1,C=-1,D=-1,F=0,j=0,z=0,O=0,I=0,E=0,B=0,P=0,V=0,M=0,R="",U="",X=null;for(;3!==e.nextToken();){const _=e.currentString();e.nextToken(),"wkid"===_?t||(t=!0,8===e.currentToken()&&(S=e.currentInt32Value())):"latestWkid"===_?n||(n=!0,8===e.currentToken()&&(w=e.currentInt32Value())):"wkt"===_?s||(s=!0,6===e.currentToken()&&(R=e.currentString())):"wkt2"===_?s||6===e.currentToken()&&(U=e.currentString()):"vcsWkid"===_?r||(r=!0,8===e.currentToken()&&(C=e.currentInt32Value())):"latestVcsWkid"===_?i||(i=!0,8===e.currentToken()&&(D=e.currentInt32Value())):"xyTolerance"===_?o||(o=!0,a=!0,F=e.currentDoubleValue()):"zTolerance"===_?u||(u=!0,a=!0,j=e.currentDoubleValue()):"mTolerance"===_?m||(m=!0,a=!0,z=e.currentDoubleValue()):"falseX"===_?l||(l=!0,a=!0,B=e.currentDoubleValue()):"falseY"===_?c||(c=!0,a=!0,P=e.currentDoubleValue()):"falseZ"===_?d||(d=!0,a=!0,V=e.currentDoubleValue()):"falseM"===_?T||(T=!0,a=!0,M=e.currentDoubleValue()):"xyUnits"===_?g||(g=!0,a=!0,O=e.currentDoubleValue()):"zUnits"===_?v||(v=!0,a=!0,I=e.currentDoubleValue()):"mUnits"===_?x||(x=!0,a=!0,E=e.currentDoubleValue()):"unit"===_?A||(A=!0,X=K(e)):e.skipChildren()}D<=0&&C>0&&(D=C),C<=0&&D>0&&(C=D);let L=null,Y=!0;if(0!==R.length&&(Y=!1,_(R)&&(L=h(R))),L||0===U.length||(Y=!1,_(U)&&(L=h(U))),!L&&w>0&&(Y=!1,f(w)&&(D<=0||p())&&(L=k(w,D))),!L&&S>0&&(Y=!1,f(S)&&(C<=0||p())&&(L=k(S,C))),Y&&(L=b(X)),a&&L){const e=new N;L.queryPrecisionDescriptorWithoutFalseXY(e),o&&e.setTolerance(0,F),u&&e.setTolerance(1,j),m&&e.setTolerance(2,z),g&&l&&c&&e.setGridParams(B,P,O),v&&d&&e.setZParams(V,I),x&&T&&e.setMParams(M,E),L=y(L,e)}return L}function Q(e,n,r,i){2!==i.currentToken()&&t("failed to parse multipath: array of array of vertices is expected");const s=e?new C:new D,a=s,o=F(0),u=x(2,0),d=j(0);let _=null,h=null,f=null,p=null,k=null,b=0,y=0,N=0;const T=new z,g=m.getNAN();let v=0,A=0;const S=e?1:0;for(;4!==i.nextToken();){2!==i.currentToken()&&t("failed to parse multipath: ring/path array is expected");let r=2,s=0,w=!0;const C=4;let D=0,z=0;const I=m.getNAN(),E=new Array(C),B=new Array(C);let P=!1;for(i.nextToken();4!==i.currentToken();){if(n&&1===i.currentToken())w&&t("failed to parse multipath: starting vertex array is expected"),f||(f=j(v-1,1),p=F(v-1,-1),k=x(0)),P=!0,r=1,({segFlag:N,toPointSz:D}=oe(T,E,g,i));else{for(P=!1,2!==i.currentToken()&&t("failed to parse multipath: array is expected, rings/paths vertices consist of arrays of coordinates"),D=0;4!==i.nextToken();)D===C&&t("failed to parse multipath: each vertex array has to have at most 4 elements"),E[D++]=H(i);D<2&&t("failed to parse multipath: each vertex array has to have at least 2 elements"),O(E[0],E[1])||t("failed to parse multipath: x and y must be finite")}i.nextToken();do{if(u.size()===2*v&&u.resize(te(v)),u.writePoint2D(2*v,I.setCoords(E[0],E[1])),_&&_.size()===v&&_.resize(ne(v)),D>2?(_||(_=x(v+1,Number.NaN)),_.write(v,E[2])):_&&_.write(v,Number.NaN),h&&h.size()===v&&h.resize(ne(v)),D>3?(h||(h=x(v+1,Number.NaN)),h.write(v,E[3])):h&&h.write(v,Number.NaN),w)A++,o.add(v),d.add(S),w=!1,z=D,l(B,E,0,0,z);else if(null!==f)if(P){const e=M(N),t=k.size();k.resize(t+e),f.add(N),p.add(b),T.get().writeInBufferStream(k,b),b+=e,a.incCurveType(N,1),y++}else f.add(1),p.add(-1);v++,s++,g.setCoords(E[0],E[1])}while(s<r&&4===i.currentToken())}0!==s&&(e&&s>r&&D===z&&0===c(E,B,D)?(v--,s--):null!==f&&(f.add(1),p.add(-1)))}return v&&(o.resize(A),d.resize(A),v>0&&(o.add(v),d.add(0)),a.setAttributeStreamRef(0,u),a.setPathFlagsStreamRef(d),a.setPathStreamRef(o),null!==f&&(a.updateCurveCounter(y),a.setSegmentData(p,k,f,b)),a.notifyModifiedFlags(65535)),{geometry:s,as:_,bs:h}}function Z(e,n){2!==n.currentToken()&&t("failed to parse multipoint: array of vertices is expected");let r=0;const i=new I,s=x(2,0);let a=0;const o=4,u=new Array(o),l=new m;let c=null,d=null;for(;4!==n.nextToken();){for(2!==n.currentToken()&&t("failed to parse multipoint: array is expected, multipoint vertices consist of arrays of cooridinates"),a=0;4!==n.nextToken();)a===o&&t("failed to parse multipoint: each vertex array has to have at most 4 elements"),u[a++]=H(n);a<2&&t("failed to parse multipoint: each vertex array has to have at least 2 elements"),O(u[0],u[1])||t("failed to parse multipoint: x and y must be finite"),s.size()===2*r&&s.resize(te(r)),s.writePoint2D(2*r,l.setCoords(u[0],u[1])),c&&c.size()===r&&c.resize(ne(r)),a>2?(c||(c=x(r+1,Number.NaN)),c.write(r,u[2])):c&&c.write(r,Number.NaN),d&&d.size()===r&&d.resize(ne(r)),a>3?(d||(d=x(r+1,Number.NaN)),d.write(r,u[3])):d&&d.write(r,Number.NaN),r++}if(r){const e=i.getImpl();e.setAttributeStreamRef(0,s),e.resizeNoInit(r),e.notifyModifiedFlags(65535)}return{geometry:i,as:c,bs:d}}function J(e,n){2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected");const r=E(2,0);let i=0,s=-1;for(;4!==n.nextToken();){const e=i;r.size()===i&&r.resize(ne(i)),i++;let a=0;for(-1===s?s=2===n.currentToken()?1:0:1===s&&2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected"),0===s&&(r.size()===i&&r.resize(ne(i)),r.write(i,$(n)),a++,i++);4!==n.nextToken();)r.size()===i&&r.resize(ne(i)),r.write(i,$(n)),a++,i++;if(r.write(e,a),0===s)break}return r.resize(i),r}function H(e){const t=e.currentToken();if(10===t||6===t&&"NaN"===e.currentString())return Number.NaN;{const t=e.currentDoubleValue();return Number.isNaN(t)?Number.NaN:t}}function $(e){return e.currentInt32Value()}function ee(t,n){if(t.isEmpty())return;const r=E(2,0),i=t.getGeometryType();let s=0;i===I.type?s=1:i===D.type||i===C.type?s=t.getPathCount():e("not implemented"),r.resize(t.getPointCount(),0);let a=0;for(let o=0;o<s;++o){const s=n.read(a);a++;const u=a+s;let m=0,l=0;i===I.type?m=t.getPointCount():i===D.type||i===C.type?(m=t.getPathSize(o),l=t.getPathStart(o)):e("not implemented");for(let e=0,t=Math.min(s,m);e<t;++e)r.write(l,n.read(a)),a++,l++;a=u}t.getImpl().setAttributeStreamRef(3,r)}function te(e){let t=2*Math.trunc(3*(e+1)/2);return t<8?t=8:t<32&&(t=32),t}function ne(e){let t=Math.trunc(3*(e+1)/2);return t<4?t=4:t<16&&(t=16),t}function re(e,t,n,i,s){s>=i.size()&&r("Byte_buffer out of range access"),e.m_bits=0,e.m_rotation=0,e.m_cosr=1,e.m_sinr=0,e.setStartXY(t),e.setEndXY(n);const a=m.getNAN();a.x=i.readDouble(s),a.y=i.readDouble(s+8);const o=i.readInt32(s+16);if(!!(1&o))return e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,B(e),!1;let u=!!(64&o);const l=!!(128&o);let c=!!(32&o);const d=!!(8&o),_=!!(16&o),h=t.equals(n);return u&&!h&&(u=!1,c=!0),c&&h&&(u=!0,c=!1,a.setCoords(0,0)),u||(l?c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0):(e.constructCircularArcThreePoint(t,n,a),h&&d===e.isClockwise()&&e.reverse()):c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,B(e),e.queryCoord2D(.5,e.m_interior)):P(e,t,n,a,d,_)),u&&(e.m_center.assign(t),e.m_startAngle=a.x,e.m_sweepAngle=a.y,V(e,Number.NaN,d,_),e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.setCoordsPoint2D(t)),e.setProjectionBehavior(0),B(e),!0}function ie(e,t,n,r,i){e.m_bits=0,e.m_center.x=r.readDouble(i),e.m_center.y=r.readDouble(i+8),e.m_rotation=r.readDouble(i+16),e.m_semiMajorAxis=r.readDouble(i+24),e.m_minorMajorRatio=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y;const s=r.readInt32(i+40);if(1&s)return!1;let a=!!(64&s),o=!!(128&s);const u=!!(2048&s),m=!!(4096&s);return!!!(512&s)&&!!!(1024&s)||o||(a=!0),o&&!t.equals(n)?(o=!1,a=!0):a&&t.equals(n)&&(o=!0,a=!1),o?(e.m_center.assign(t),e.m_startAngle=e.m_center.x,e.m_sweepAngle=e.m_center.y,V(e,Number.NaN,u,m),e.m_semiMajorAxis=0,e.m_interior.setCoordsPoint2D(t)):a?(e.m_center.setNAN(),e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,B(e),e.queryCoord2D(.5,e.m_interior)):e.constructEllipticArcEndPointsCenter(t,n,e.m_semiMajorAxis,e.m_minorMajorRatio,e.m_rotation,!m,u,e.m_center),e.setProjectionBehavior(1),B(e),!0}function se(e,t,r,i,s){return n(s+32<=i.size()),e.m_cp=d(m,2),e.m_cp[0].x=i.readDouble(s),e.m_cp[0].y=i.readDouble(s+8),e.m_cp[1].x=i.readDouble(s+16),e.m_cp[1].y=i.readDouble(s+24),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=r.x,e.m_YEnd=r.y,!0}function ae(e,t,n,r,i){return e.m_cp.x=r.readDouble(i),e.m_cp.y=r.readDouble(i+8),e.m_weights[0]=r.readDouble(i+16),e.m_weights[1]=r.readDouble(i+24),e.m_weights[2]=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y,!0}function oe(e,n,r,i,s){const a={segFlag:0,toPointSz:0};let o=i.currentToken();o=i.nextToken();const u=i.currentString(),l=u[0];for((1!==u.length||"a"!==l&&"b"!==l&&"c"!==l&&"n"!==l&&"q"!==l)&&t('failed to parse curve: expecting "a", "b", "n", "q", or "c"'),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for curve parameters"),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for to point"),a.toPointSz=0;4!==i.nextToken();)4===a.toPointSz&&t("failed to parse curve: vertex array cannot have more than 4 elements"),n[a.toPointSz++]=H(i);a.toPointSz<2&&t("failed to parse curve: vertex array must have at least 2 elements");const c=m.construct(n[0],n[1]),d=m.getNAN();let _=-1,h=-1,f=!1,p=Number.NaN,k=Number.NaN,b=Number.NaN;const y=[m.getNAN(),m.getNAN(),m.getNAN()],N=m.getNAN();if("a"===l){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for center point"),o=i.nextToken();const e=H(i);o=i.nextToken();const n=H(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for center point"),d.setCoords(e,n),o=i.nextToken(),_=i.currentInt32Value(),o=i.nextToken(),h=i.currentInt32Value(),o=i.nextToken(),4!==o?(f=!1,p=H(i),o=i.nextToken(),k=H(i),o=i.nextToken(),b=H(i),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters")):f=!0,a.segFlag=4}else if("b"===l){for(let e=0;e<2;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=H(i);o=i.nextToken();const r=H(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=2}else if("n"===l){{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const e=H(i);o=i.nextToken();const n=H(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[0].setCoords(e,n)}o=i.nextToken();const e=H(i);o=i.nextToken();const n=H(i);o=i.nextToken();const r=H(i);y[1].setCoords(e,n),y[2].setCoords(r,r),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=8}else if("q"===l){for(let e=0;e<1;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=H(i);o=i.nextToken();const r=H(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=16}else{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for interior point"),o=i.nextToken();const e=H(i);o=i.nextToken();const n=H(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for interior point"),N.setCoords(e,n),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=4}if(o=i.nextToken(),3!==o&&t("failed to parse curve: end object is expected for curve"),"a"===l)if(e.createEllipticArc(),f){const t=!0;ue(e.get(),r,c,d,t,_,h)}else me(e.get(),r,c,d,_,h,p,k,b);else if("b"===l)e.createCubicBezier(),le(e.get(),r,c,y);else if("n"===l)e.createQuadraticRationalBezier(),ce(e.get(),r,c,y[0],y[1].x,y[1].y,y[2].x);else if("q"===l)e.createQuadraticBezier(),e.get().construct(r,y[0],c);else{e.createEllipticArc();const t=!1;ue(e.get(),r,c,N,t,-1,-1)}return a}function ue(e,t,n,r,i,s,a){e.dropAllAttributes();const o=20,u=new ArrayBuffer(o),m=new G({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8;let c=0;i?(a||(c|=8),s&&(c|=16)):c|=128,m.writeInt32(l,c),l+=4,re(e,t,n,m,0)}function me(e,t,n,r,i,s,a,o,u){e.dropAllAttributes();const m=44,l=new ArrayBuffer(m),c=new G({sz:m,buffer:l});let d=0;c.writeDouble(d,r.x),d+=8,c.writeDouble(d,r.y),d+=8,c.writeDouble(d,a),d+=8,c.writeDouble(d,o),d+=8,c.writeDouble(d,u),d+=8;let _=0;s||(_|=2048),i&&(_|=4096),c.writeInt32(d,_),d+=4,ie(e,t,n,c,0)}function le(e,t,n,r){e.dropAllAttributes();const i=32,s=new ArrayBuffer(i),a=new G({sz:i,buffer:s});let o=0;a.writeDouble(o,r[0].x),o+=8,a.writeDouble(o,r[0].y),o+=8,a.writeDouble(o,r[1].x),o+=8,a.writeDouble(o,r[1].y),o+=8,se(e,t,n,a,0)}function ce(e,t,n,r,i,s,a){e.dropAllAttributes();const o=40,u=new ArrayBuffer(o),m=new G({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8,m.writeDouble(l,i),l+=8,m.writeDouble(l,s),l+=8,m.writeDouble(l,a),l+=8,ae(e,t,n,m,0)}function de(e,t,n,r,i){const o=e.getGeometryType();if(o===s.enumEllipticArc)return _e(e,t,n,r,i);if(o===s.enumBezier)return he(e,t,n,r,i);if(o===s.enumRationalBezier2)return fe(e,t,n,r,i);if(o===s.enumBezier2){const s=new g;return s.constructFromQuadraticSegment(e),he(s,t,n,r,i)}a("")}function _e(e,t,r,i,s){n(!v(e));const a=e.getEndXY(),o=e.hasAttribute(1)&&!t,u=e.hasAttribute(2)&&!r;let m=Number.NaN,l=Number.NaN;if(o&&(m=e.getEndAttributeAsDbl(1,0)),u&&(l=e.getEndAttributeAsDbl(2,0)),e.isDegenerateToLine()||e.isDegenerate(0))return pe(o,u,a.x,a.y,m,l,i,s),!0;const c=0===e.projectionBehavior(),d=!!c&&e.isClosed();if(c&&!d)s.startObject(),s.addFieldName("c"),s.startArray(),pe(o,u,a.x,a.y,m,l,i,s),ke(e.m_interior.x,e.m_interior.y,17,s),s.endArray(),s.endObject();else if(c){s.startObject(),s.addFieldName("a"),s.startArray(),pe(o,u,a.x,a.y,m,l,i,s);const t=0,n=0;ke(e.m_center.x+t,e.m_center.y+n,17,s);const r=!e.isMajor();s.addInt32(r?1:0);const c=e.isClockwise();s.addInt32(c?1:0),s.endArray(),s.endObject()}else{s.startObject(),s.addFieldName("a"),s.startArray(),pe(o,u,a.x,a.y,m,l,i,s);const t=e;ke(t.m_center.x,t.m_center.y,17,s);const n=!t.isMajor();s.addInt32(n?1:0);const r=t.isClockwise();s.addInt32(r?1:0),s.addDouble(t.m_rotation,17),s.addDouble(t.m_semiMajorAxis,17),s.addDouble(t.m_minorMajorRatio,17),s.endArray(),s.endObject()}return!1}function he(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;return a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("b"),i.startArray(),pe(a,o,s.x,s.y,u,m,r,i),ke(e.m_cp[0].x,e.m_cp[0].y,r,i),ke(e.m_cp[1].x,e.m_cp[1].y,r,i),i.endArray(),i.endObject(),!1}function fe(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("n"),i.startArray(),pe(a,o,s.x,s.y,u,m,r,i),ke(e.m_cp.x,e.m_cp.y,r,i);const l=r;return i.addDouble(e.m_weights[0],l),i.addDouble(e.m_weights[1],l),i.addDouble(e.m_weights[2],l),i.endArray(),i.endObject(),!1}function pe(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}function ke(e,t,n,r){r.startArray(),r.addDouble(e,n),r.addDouble(t,n),r.endArray()}class be{getOperatorType(){return 10405}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,r,i,s){ye(e,t,n,r)}exportSpatialReference(e,t,r,i){n(0)}exportProjectionTransformation(e,t,r,i){n(0)}exportDatumTransformation(e,t,r,i){n(0)}static geometryTypeToString(e){return n(0),""}}function ye(t,r,i,a,o){if(r||i){if(a.startObject(),null!==r){switch(r.getGeometryType()){case s.enumPolygon:Ne(!0,t,r,a);break;case s.enumPolyline:Ne(!1,t,r,a);break;case s.enumMultiPoint:Te(t,r,a);break;case s.enumPoint:ge(t,r,a);break;case s.enumEnvelope:ve(t,r,a);break;case s.enumMultipatch:n(0);break;default:e("exportToJSON")}}null!==i&&(a.addFieldName("spatialReference"),Ae(t,i,a)),a.endObject()}}function Ne(e,t,r,i){const s=r.getImpl(),o=!!(2&t),u=!!(4&t),m=!!(8&t),l=s.hasAttribute(1)&&!o,c=s.hasAttribute(2)&&!u,d=s.hasAttribute(3)&&!m,_=s.hasNonLinearSegments();l&&(i.addFieldName("hasZ"),i.addBool(!0)),c&&(i.addFieldName("hasM"),i.addBool(!0)),e?_?i.addFieldName("curveRings"):i.addFieldName("rings"):_?i.addFieldName("curvePaths"):i.addFieldName("paths");let h=null;const f=[];if(r.isEmpty())i.startArray(),i.endArray();else{const e=17-(31&t>>13);i.startArray();const n=r.getPathCount();let m=0;const p=s.getAttributeStreamRef(0);let k=null,b=null,y=null;const N=new z;let T=null,g=null,v=null;_&&(T=s.getSegmentFlagsStreamRef(),g=s.getSegmentIndexStreamRef(),v=s.getSegmentDataStreamRef()),l&&(k=s.getAttributeStreamRef(1)),c&&(b=s.getAttributeStreamRef(2)),d&&(y=s.getAttributeStreamRef(3),h=R(3,0));for(let t=0;t<n;t++){i.startArray(),d&&f.push(0);const n=r.getPathEnd(t);if(m===n){i.endArray();continue}const s=r.isClosedPath(t);let _=p.read(2*m),x=p.read(2*m+1),A=l?k.read(m):Number.NaN,S=c?b.read(m):Number.NaN,w=d?y.read(m):0;Se(l,c,_,x,A,S,e,i);let C=1;d&&(h.add(w),f[f.length-1]++);const D=_,F=x,j=A,z=S,O=w;let I=!1,E=0,B=Number.NaN,P=Number.NaN,V=0;for(let t=m+1,r=m,M=s?n+1:n;t<M;t++,r++){const s=null!==T?31&T.read(r):1;let m,M;if(t<n?(m=p.read(2*t),M=p.read(2*t+1),l&&(B=k.read(t)),c&&(P=b.read(t)),d&&(V=y.read(t))):(m=D,M=F,B=j,P=z,V=O),1!==s){I=!0,4===s?N.createEllipticArc():2===s?N.createCubicBezier():16===s?N.createQuadraticBezier():8===s?N.createQuadraticRationalBezier():a("JSON export.unsupported curve");const t=N.get(),n=g.read(r);t.setStartXYCoords(_,x),t.setEndXYCoords(m,M),l&&(t.setStartAttribute(1,0,A),t.setEndAttribute(1,0,B)),c&&(t.setStartAttribute(2,0,S),t.setEndAttribute(2,0,P)),t.readFromBufferStream(v,n);de(N.get(),o,u,e,i)&&E++}else Se(l,c,m,M,B,P,e,i);d&&(h.add(V),f[f.length-1]++),C++,_=m,x=M,A=B,S=P,w=V}I&&0===E||(C<2&&E<1&&(Se(l,c,_,x,A,S,e,i),C++,d&&(h.add(w),f[f.length-1]++)),s&&C<3&&E<2&&(Se(l,c,D,F,j,z,e,i),C++,_=D,x=F,A=j,S=z,w=O,d&&(h.add(O),f[f.length-1]++))),i.endArray(),m=n}i.endArray()}if(d){i.addFieldName("ids"),i.startArray();let e=0;for(let t=0,r=f.length;t<r;++t){const r=f[t];n(0===r||null!==h&&e+r<=h.size()),i.startArray();for(let t=0;t<r;++t)i.addInt32(h.read(e)),e++;i.endArray()}i.endArray()}}function Te(e,t,r){const i=t.getImpl(),s=i.hasAttribute(1)&&!(2&e),a=i.hasAttribute(2)&&!(4&e),o=i.hasAttribute(3)&&!(8&e);s&&(r.addFieldName("hasZ"),r.addBool(!0)),a&&(r.addFieldName("hasM"),r.addBool(!0)),r.addFieldName("points");const u=t.getPointCount();if(t.isEmpty())r.startArray(),r.endArray();else{const t=17-(31&e>>13);r.startArray();const n=i.getAttributeStreamRef(0);let o=null,m=null;s&&(o=i.getAttributeStreamRef(1)),a&&(m=i.getAttributeStreamRef(2));for(let e=0;e<u;e++){const i=n.read(2*e),u=n.read(2*e+1);let l=Number.NaN,c=Number.NaN;s&&(l=o.read(e)),a&&(c=m.read(e)),Se(s,a,i,u,l,c,t,r)}r.endArray()}if(o){let e=null;i.isEmpty()||(e=i.getAttributeStreamRef(3)),n(0===u||null!==e&&e.size()>=u),r.addFieldName("ids"),r.startArray();for(let t=0;t<u;t++)r.addInt32(e.read(t));r.endArray()}}function ge(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("x"),n.addNull(),n.addFieldName("y"),n.addNull(),r&&(n.addFieldName("z"),n.addNull()),i&&(n.addFieldName("m"),n.addNull()),void(s&&(n.addFieldName("id"),n.addInt32(0)));const a=17-(31&e>>13);n.addFieldName("x"),n.addDouble(t.getX(),a),n.addFieldName("y"),n.addDouble(t.getY(),a),r&&(n.addFieldName("z"),n.addDouble(t.getZ(),a)),i&&(n.addFieldName("m"),n.addDouble(t.getM(),a)),s&&(n.addFieldName("id"),n.addInt32(t.getID()))}function ve(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("xmin"),n.addNull(),n.addFieldName("ymin"),n.addNull(),n.addFieldName("xmax"),n.addNull(),n.addFieldName("ymax"),n.addNull(),r&&(n.addFieldName("zmin"),n.addNull(),n.addFieldName("zmax"),n.addNull()),i&&(n.addFieldName("mmin"),n.addNull(),n.addFieldName("mmax"),n.addNull()),void(s&&(n.addFieldName("idmin"),n.addInt32(0),n.addFieldName("idmax"),n.addInt32(0)));const a=17-(31&e>>13);if(n.addFieldName("xmin"),n.addDouble(t.getXMin(),a),n.addFieldName("ymin"),n.addDouble(t.getYMin(),a),n.addFieldName("xmax"),n.addDouble(t.getXMax(),a),n.addFieldName("ymax"),n.addDouble(t.getYMax(),a),r){const e=t.queryInterval(1,0);n.addFieldName("zmin"),n.addDouble(e.vmin,a),n.addFieldName("zmax"),n.addDouble(e.vmax,a)}if(i){const e=t.queryInterval(2,0);n.addFieldName("mmin"),n.addDouble(e.vmin,a),n.addFieldName("mmax"),n.addDouble(e.vmax,a)}if(s){const e=t.queryInterval(3,0);n.addFieldName("idmin"),n.addInt32(e.vmin),n.addFieldName("idmax"),n.addInt32(e.vmax)}}function xe(e,n,r){r.startObject();const i=n.getID();i<=0&&t("cannot export unit that has no valid WKID"),r.addFieldName("uwkid"),r.addInt32(i),r.endObject()}function Ae(e,t,n){n.startObject();let r=0;t.isCustomWkid()||(r=t.getOldID());let i=0;const s=t.getVCS();if(null!==s&&(s.isCustomWkid()||(i=s.getOldID()),i<=0&&(r=0)),r>0){n.addFieldName("wkid"),n.addInt32(r);const e=t.getLatestID();if(e>0&&e!==r&&(n.addFieldName("latestWkid"),n.addInt32(e)),i>0){n.addFieldName("vcsWkid"),n.addInt32(i);const e=t.getLatestVerticalID();e!==i&&(n.addFieldName("latestVcsWkid"),n.addInt32(e))}}if(0===t.getCoordinateSystemType())n.addFieldName("wkid"),n.addNull(),null!==t.getUnit()&&(n.addFieldName("unit"),xe(e,t.getUnit(),n));else if(r<=0||1&e){let r="";64&e&&(r=t.getText2(),n.addFieldName("wkt2"),n.addString(r));const i=t.getText();i!==r&&(n.addFieldName("wkt"),n.addString(i))}if(16&e){const e=new N;t.queryPrecisionDescriptor(e),n.addFieldName("xyTolerance"),n.addDouble(e.getTolerance(0)),n.addFieldName("zTolerance"),n.addDouble(e.getTolerance(1)),n.addFieldName("mTolerance"),n.addDouble(e.getTolerance(2)),n.addFieldName("falseX"),n.addDouble(e.getFalseX()),n.addFieldName("falseY"),n.addDouble(e.getFalseY()),n.addFieldName("xyUnits"),n.addDouble(e.getGridUnitsXY()),n.addFieldName("falseZ"),n.addDouble(e.getFalseZ()),n.addFieldName("zUnits"),n.addDouble(e.getGridUnitsZ()),n.addFieldName("falseM"),n.addDouble(e.getFalseM()),n.addFieldName("mUnits"),n.addDouble(e.getGridUnitsM())}n.endObject()}function Se(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}const we={s_a:"a".charCodeAt(0),s_A:"A".charCodeAt(0),s_asterisk:"*".charCodeAt(0),s_b:"b".charCodeAt(0),s_backspace:"\b".charCodeAt(0),s_backslash:"\\".charCodeAt(0),s_beginArray:"[".charCodeAt(0),s_beginObject:"{".charCodeAt(0),s_colon:":".charCodeAt(0),s_period:".".charCodeAt(0),s_comma:",".charCodeAt(0),s_doubleQuote:'"'.charCodeAt(0),s_endArray:"]".charCodeAt(0),s_endObject:"}".charCodeAt(0),s_e:"e".charCodeAt(0),s_E:"E".charCodeAt(0),s_f:"f".charCodeAt(0),s_formfeed:"\f".charCodeAt(0),s_F:"F".charCodeAt(0),s_forwardslash:"/".charCodeAt(0),s_lt:"<".charCodeAt(0),s_minus:"-".charCodeAt(0),s_plus:"+".charCodeAt(0),s_n:"n".charCodeAt(0),s_N:"N".charCodeAt(0),s_newline:"\n".charCodeAt(0),s_r:"r".charCodeAt(0),s_carriageReturn:"\r".charCodeAt(0),s_t:"t".charCodeAt(0),s_tab:"\t".charCodeAt(0),s_u:"u".charCodeAt(0),s_zero:"0".charCodeAt(0),s_nine:"9".charCodeAt(0)};class Ce{constructor(t){this.m_functionStack=[],this.m_pushPositions=[],this.m_utf8Decoder=new TextDecoder("utf-8",{fatal:!0}),void 0===t?(this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_endToken=0,this.m_currentTokenType=0,this.m_functionStack.push((()=>this.accept_())),this.m_jsonString=null,this.m_bHasEscapes=!1):t.jsonString?this.resetParserFromString(t.jsonString):t.jsonStream?a("streaming json parsing not yet impl"):e("invalid constructor parameter")}prepSubstrString_(){}getCurrentSubstrString_(){return this.m_jsonString.slice(this.m_startToken,this.m_endToken)}stepOverCharString_(){this.m_endToken++}peekCharString_(){return this.m_jsonString.charCodeAt(this.m_endToken)}getString_(e){const t=this.m_jsonString?.slice(this.m_startToken,this.m_startToken+e-1);this.m_endToken+=e-1;return{s:t,bDone:this.m_endToken>=this.m_jsonString.length}}incrementString_(){this.m_endToken++}eofString_(){return this.m_endToken>=this.m_jsonString.length}setStringFunctions_(){this.m_prepSubstr=this.prepSubstrString_,this.m_getCurrentSubstr=this.getCurrentSubstrString_,this.m_stepOverChar=this.stepOverCharString_,this.m_peekChar=this.peekCharString_,this.m_get=this.getString_,this.m_increment=this.incrementString_,this.m_eof=this.eofString_}setStreamFunctions_(){a("streaming json parsing not yet impl")}reset_(){this.m_jsonString=null,this.m_endToken=0,this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_currentTokenType=0,this.m_bHasEscapes=!1,this.m_functionStack.length=0,this.m_functionStack.push((()=>this.start_())),this.m_pushPositions.length=0}resetParserFromString(e){this.reset_(),this.setStringFunctions_(),this.m_jsonString=e}resetParserFromStream(e){a("streaming json parsing not yet impl")}resetToPosition(e){return n(0),!1}nextToken(){return this.m_functionStack.at(-1)(),this.m_currentTokenType}currentToken(){return this.m_currentTokenType}currentTokenStartIndex(){return this.m_startToken}currentTokenEndIndex(){return this.m_endToken}currentText(){return n(0),""}childrenAsString(){return n(0),""}skipChildren(){this.skipChildren_()}skipChildren_(){if(1!==this.m_currentTokenType)if(2!==this.m_currentTokenType);else{let e=1;do{this.m_currentTokenType=this.nextToken(),2===this.m_currentTokenType?e++:4===this.m_currentTokenType&&e--}while(4!==this.m_currentTokenType||0!==e)}else{let e=1;do{this.m_currentTokenType=this.nextToken(),1===this.m_currentTokenType?e++:3===this.m_currentTokenType&&e--}while(3!==this.m_currentTokenType||0!==e)}}currentTerminalAsString_(){switch(this.m_currentTokenType){case 7:case 8:case 9:return this.m_getCurrentSubstr().slice(0,this.m_endToken-this.m_startToken);case 10:return"null";case 11:return"true";case 12:return"false"}t("invalid token")}toUTF8_(e,t){let n=0,r=e;for(;t.charCodeAt(r)===we.s_backslash&&t.charCodeAt(r+1)===we.s_u;)n++,r+=6;r=e;const i=new Uint8Array(n);let s=0;for(;t.charCodeAt(r)===we.s_backslash&&t.charCodeAt(r+1)===we.s_u;)i[s++]=Number.parseInt(t.slice(r+2,r+6),16),r+=6;return{u8s:this.m_utf8Decoder.decode(i),end:r}}unquoteCurrentString_(){let e="",t=1;const n=this.m_endToken-this.m_startToken-1;let r=0;const i=this.m_getCurrentSubstr();for(let s=t;s<n;s++)if(i.charCodeAt(s)!==we.s_backslash)r++;else{switch(r>0&&(e+=i.slice(t,t+r)),i.charCodeAt(++s)){case we.s_doubleQuote:e+='"';break;case we.s_u:{const{u8s:t,end:n}=this.toUTF8_(s-1,i);s=n-1,e+=t;break}case we.s_backslash:e+="\\";break;case we.s_forwardslash:e+="/";break;case we.s_b:e+="\b";break;case we.s_f:e+="\f";break;case we.s_n:e+="\n";break;case we.s_r:e+="\r";break;case we.s_t:e+="\t"}t=s+1,r=0}return r>0&&(e+=i.slice(t,t+r)),e}currentString(){if(5!==this.m_currentTokenType&&6!==this.m_currentTokenType)return this.currentTerminalAsString_();if(this.m_bHasEscapes)return this.unquoteCurrentString_();return this.m_getCurrentSubstr().slice(1,this.m_endToken-this.m_startToken-2+1)}currentDoubleValue(){if(7!==this.m_currentTokenType&&8!==this.m_currentTokenType&&9!==this.m_currentTokenType&&6!==this.m_currentTokenType&&10!==this.m_currentTokenType&&t("invalid token"),10===this.m_currentTokenType)return Number.NaN;let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;if(6===this.m_currentTokenType){if("NaN"===this.currentString())return Number.NaN;e=e.slice(1),n-=2,0===n&&t("invalid token")}const r=Number.parseFloat(e);if(6===this.m_currentTokenType)Number.isNaN(r)&&t("invalid token");else if(Number.isNaN(r))return Number.NaN;return r}currentInt32Value(){8!==this.m_currentTokenType&&6!==this.m_currentTokenType&&t("invalid token");let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;6===this.m_currentTokenType&&(e=e.slice(1),n-=2,0===n&&t("invalid token"));const r=parseInt(e);return Number.isNaN(r)&&t("invalid token"),r}currentInt64Value(){return n(0),0n}currentBoolValue(){return n(0),!1}isError(){return 0}JSONString(){return n(0),""}pushPosition(){return n(0),!1}popPosition(){return n(0),!1}skipCStyleComments_(){n(0)}skipCppStyleComments_(){n(0)}skipComments_(){this.m_prepSubstr();let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e===we.s_asterisk?this.skipCStyleComments_():e===we.s_forwardslash?this.skipCppStyleComments_():t("invalid token")}skipWhiteSpace_(){let e;do{this.m_eof()&&t("invalid token");let n=this.m_peekChar();for(;n>=9&&n<=13||32===n;)this.m_increment(),this.m_eof()&&t("invalid token"),n=this.m_peekChar();n===we.s_forwardslash?(this.m_startToken=this.m_endToken,e=!0,this.skipComments_()):e=!1}while(e)}rightBracket_(){return this.m_peekChar()===we.s_endArray&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=4,!0)}rightBrace_(){return this.m_peekChar()===we.s_endObject&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=3,!0)}string_(){this.m_prepSubstr(),this.m_bHasEscapes=!1,this.m_stepOverChar(),this.m_eof()&&t("invalid token");let e=this.m_peekChar();for(;e!==we.s_doubleQuote;){const n=e===we.s_backslash;if(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),n)if(this.m_bHasEscapes=!0,e===we.s_doubleQuote||e===we.s_backslash||e===we.s_forwardslash||e===we.s_b||e===we.s_f||e===we.s_n||e===we.s_r||e===we.s_t)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar();else if(e===we.s_u)for(let r=0;r<4;r++)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=we.s_zero&&e<=we.s_nine||e>=we.s_a&&e<=we.s_f||e>=we.s_A&&e<=we.s_F||t("invalid token");else t("invalid token")}this.m_stepOverChar()}comma_(){return this.m_peekChar()===we.s_comma&&(this.m_increment(),!0)}colon_(){return this.m_peekChar()===we.s_colon&&(this.m_increment(),!0)}fieldNameEnd_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.colon_()?(this.skipWhiteSpace_(),this.value_()):t("invalid token")}fieldNameStart_(){this.m_startToken=this.m_endToken;this.m_peekChar()!==we.s_doubleQuote&&t("invalid token"),this.string_(),this.m_currentTokenType=5,this.m_functionStack.push((()=>this.fieldNameEnd_()))}pairEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.fieldNameStart_()):this.rightBrace_()?this.m_functionStack.pop():t("invalid token")}arrayStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBracket_()||(this.m_functionStack.push((()=>this.elementEnd_())),this.value_())}elementEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.value_()):this.rightBracket_()?this.m_functionStack.pop():t("invalid token")}objectStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBrace_()||(this.m_functionStack.push((()=>this.pairEnd_())),this.fieldNameStart_())}valueStartObject_(){this.m_increment(),this.m_currentTokenType=1,this.m_functionStack.push((()=>this.objectStart_()))}valueStartArray_(){this.m_increment(),this.m_currentTokenType=2,this.m_functionStack.push((()=>this.arrayStart_()))}valueString_(){this.string_(),this.m_currentTokenType=6}int_(){this.m_peekChar()!==we.s_zero?this.digits_():this.m_stepOverChar()}digits_(){let e=this.m_peekChar();do{this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()}while(e>=we.s_zero&&e<=we.s_nine)}frac_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=we.s_zero&&e<=we.s_nine||t("invalid token"),this.digits_()}exp_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e!==we.s_plus&&e!==we.s_minus||(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()),e>=we.s_zero&&e<=we.s_nine||t("invalid token"),this.digits_()}valueNumber_(){this.m_prepSubstr();let e=!1,n=this.m_peekChar();if(n===we.s_minus?(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),n=this.m_peekChar(),e=!0,n>=we.s_zero&&n<=we.s_nine||t("invalid token"),this.int_()):this.int_(),n=this.m_peekChar(),n===we.s_period)this.m_currentTokenType=7,this.frac_(),n=this.m_peekChar(),n!==we.s_e&&n!==we.s_E||this.exp_();else if(n===we.s_e||n===we.s_E)this.m_currentTokenType=7,this.exp_();else{let t=0;e&&t++;const n=this.m_endToken-this.m_startToken-t;if(n<10)this.m_currentTokenType=8;else if(10===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="2147483648"?this.m_currentTokenType=8:this.m_currentTokenType=9:n.slice(t)<="2147483647"?this.m_currentTokenType=8:this.m_currentTokenType=9}else if(n<19)this.m_currentTokenType=9;else if(19===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="9223372036854775808"?this.m_currentTokenType=9:this.m_currentTokenType=7:n.slice(t)<="9223372036854775807"?this.m_currentTokenType=9:this.m_currentTokenType=7}else this.m_currentTokenType=7}}valueNull_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"null"!==e&&t("invalid token"),this.m_currentTokenType=10}valueTrue_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"true"!==e&&t("invalid token"),this.m_currentTokenType=11}valueFalse_(){const{s:e,bDone:n}=this.m_get(6);n&&t("invalid token"),"false"!==e&&t("invalid token"),this.m_currentTokenType=12}valueNan_(){const{s:e,bDone:n}=this.m_get(4);n&&t("invalid token"),"NaN"!==e&&t("invalid token"),this.m_currentTokenType=7}value_(){this.m_startToken=this.m_endToken;const e=this.m_peekChar();e===we.s_beginObject?this.valueStartObject_():e===we.s_beginArray?this.valueStartArray_():e===we.s_doubleQuote?this.valueString_():e===we.s_minus||e>=we.s_zero&&e<=we.s_zero+9?this.valueNumber_():e===we.s_n?this.valueNull_():e===we.s_t?this.valueTrue_():e===we.s_f?this.valueFalse_():e===we.s_N?this.valueNan_():t("invalid token")}start_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.m_functionStack.push((()=>this.accept_()));const e=this.m_peekChar();e!==we.s_beginObject&&e!==we.s_beginArray&&t("invalid token"),this.value_()}accept_(){this.m_startToken=this.m_endToken,this.m_currentTokenType=0}}class De{getOperatorType(){return 10404}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,n,r,i,s,a,o){let u;"string"==typeof r?(u=new Ce({jsonString:r}),u.nextToken()):u=r,1!==u.currentToken()&&t("failed to import map geometry: start of object is expected");const m=W(n,e,u,i,s);return new T(m)}importProjectionTransformation(e,t){return n(0),{}}importDatumTransformation(e,t){return n(0),{}}static stringToGeometryType(e){return s.enumPoint}}const Fe=new Y,je=new be,ze=new De;function Oe(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function Ie(e,t){const n=new L(e,{strict:!1});return n.nextToken(),ze.execute(0,s.enumUnknown,n,!0,t)}function Ee(e){let t=null;return[e.map((e=>{if(null==t){const n=Be(e);return t=n.getSpatialReference(),n.getGeometry()}return Pe(e)})),t]}function Be(e){return Ie(e,!0)}function Pe(e){return Ie(e,!1).getGeometry()}function Ve(e,t){return e instanceof T&&(t=e.getSpatialReference(),e=e.getGeometry()),Fe.reset(),je.execute(0,e,t,Fe),Fe.getObject()}export{Ee as fromGeometries,Be as fromGeometry,Pe as fromGeometryToGXGeometry,Oe as getSpatialReference,Ve as toGeometry};
|
|
5
|
+
import{b as e,t,g as n,w as r,u as i,G as s,a}from"../../../chunks/Geometry.js";import{L as o,o as u,P as m,D as l,N as c,m as d}from"../../../chunks/Transformation2D.js";import{a3 as _,b as h,a4 as f,a5 as p,c as k,j as b,a6 as y,S as N,a7 as T}from"../../../chunks/OperatorProject.js";import{af as g,aw as v,ax as x,ay as A,P as S,E as w,h as C,i as D,az as F,aA as j,S as z,aB as O,M as I,aC as E,aD as B,aE as P,aF as V,aG as M,aH as R}from"../../../chunks/QuadraticBezier.js";import"./initNoPeFactory.js";function U(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:1,m_value:null},done:!1};if(this.m_i<this.m_keys.length){const e=this.m_bReturnKey,t=Math.trunc(this.m_i);return this.m_bReturnKey=!this.m_bReturnKey,this.m_i+=.5,e?{value:{m_token:5,m_value:this.m_keys[t]},done:!1}:{value:{m_token:6,m_value:this.m_o[this.m_keys[t]]},done:!1}}return{value:{m_token:3,m_value:null},done:!0}}function X(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:2,m_value:null},done:!1};if(this.m_i<this.m_a.length){const e={value:{m_token:6,m_value:this.m_a[this.m_i++]},done:!1};return this.m_strict||void 0===e.value.m_value&&(e.value.m_value=Number.NaN),e}return{value:{m_token:4,m_value:null},done:!0}}class L{createJSONObjectIterator(e){return{m_iteratorType:"object",m_o:e,m_keys:this.m_options.strict?Object.keys(e):Object.keys(e).filter((t=>void 0!==e[t])),m_i:-1,m_bReturnKey:!0,next:U}}createJSONArrayIterator(e){return{m_iteratorType:"array",m_strict:this.m_options.strict,m_i:-1,m_a:e,next:X}}constructor(e,t){this.m_currentToken=0,this.m_options=t?{...t}:{strict:!0};const n=e;this.m_iteratorStack=[n instanceof Array?this.createJSONArrayIterator(n):this.createJSONObjectIterator(n)],this.m_nextFlatToken={m_value:null,m_token:0}}nextToken(){if(0===this.m_iteratorStack.length)return this.m_currentToken=0;switch(this.m_nextFlatToken=this.m_iteratorStack.at(-1).next().value,this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_currentToken=1;case 3:return this.m_iteratorStack.pop(),this.m_currentToken=3;case 2:return this.m_currentToken=2;case 4:return this.m_iteratorStack.pop(),this.m_currentToken=4;case 5:return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=5;case 6:if(this.m_nextFlatToken.m_value instanceof Array)return this.m_iteratorStack.push(this.createJSONArrayIterator(this.m_nextFlatToken.m_value)),this.nextToken();if(this.m_nextFlatToken.m_value instanceof Object)return this.m_iteratorStack.push(this.createJSONObjectIterator(this.m_nextFlatToken.m_value)),this.nextToken();if("number"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,Number.isSafeInteger(this.m_currentValue)&&this.m_currentValue>=o()&&this.m_currentValue<=u()?this.m_currentToken=8:this.m_currentToken=7;if("string"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=6;if("boolean"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=this.m_nextFlatToken.m_value?11:12;if("object"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=null,this.m_currentToken=10;e("unrecognized json element type")}return e("unrecognized json element type"),0}currentToken(){return this.m_currentToken}skipChildren(){if(0!==this.m_iteratorStack.length)switch(this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=3,void(this.m_currentToken=3);case 2:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=4,void(this.m_currentToken=4)}}currentString(){return 6!==this.m_currentToken&&5!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentDoubleValue(){return 7!==this.m_currentToken&&8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt32Value(){return 8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt64Value(){return n(0),0n}currentBoolValue(){return 12!==this.m_currentToken&&11!==this.m_currentToken&&t("invalid token"),this.m_currentValue}isError(){return 0}}class Y{constructor(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject=[]}reset(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject.length=0}startObject(){const e={};this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}startArray(){const e=[];this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}endObject(){this.m_acceptedObject=this.m_currentObject.at(-1),this.m_currentObject.pop()}endArray(){this.m_currentObject.pop()}addFieldName(e){this.m_pendingKey=e}addValue_(e){this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):this.m_currentObject.at(-1).push(e)}addString(e){this.addValue_(e)}addDouble(e,t){this.addValue_(e)}addInt64(e){n(0)}addInt32(e){this.addValue_(e)}addBool(e){this.addValue_(e)}addNull(){this.addValue_(null)}getObject(){return this.m_acceptedObject}}class G{constructor(t){return this.m_buffer=null,this.m_view=null,this.m_sz=0,this.m_offset=0,this.m_bOwnsBuffer=!0,this.m_bLittleEndian=!0,this.m_element=new ArrayBuffer(8),this.m_elementBytes=new Uint8Array(this.m_element),this.m_elementView=new DataView(this.m_element),this.m_elementDouble=new Float64Array(this.m_element),this.m_elementFloat=new Float32Array(this.m_element),this.m_elementInt64=new BigInt64Array(this.m_element),this.m_elementInt32=new Int32Array(this.m_element),this.m_elementInt16=new Int16Array(this.m_element),void 0!==t.sz?(this.m_sz=t.sz,t.buffer?(this.m_sz<0&&r("size out of range"),this.m_buffer=t.buffer,this.m_offset=void 0!==t.offset?t.offset:0,this.m_view=void 0!==t.offset?new DataView(t.buffer,t.offset,t.sz):new DataView(this.m_buffer),this.m_bOwnsBuffer=!1,void(this.m_bLittleEndian=!0)):(this.m_sz<0&&r("size out of range"),void(this.m_sz>0&&(this.m_buffer=new ArrayBuffer(this.m_sz),this.m_view=new DataView(this.m_buffer))))):t.move?(this.m_sz=t.move.m_sz,this.m_buffer=t.move.m_buffer,this.m_view=t.move.m_view,this.m_bOwnsBuffer=t.move.m_bOwnsBuffer,this.m_bLittleEndian=t.move.m_bLittleEndian,t.move.m_buffer=null,t.move.m_view=null,t.move.m_sz=0,void(t.move.m_bOwnsBuffer=!0)):void e("unrecognized constructor options")}swapBytesDouble(){this.doSwap()&&(this.m_elementDouble[0]=this.m_elementBytes[0]<<56|this.m_elementBytes[1]<<48|this.m_elementBytes[2]<<40|this.m_elementBytes[3]<<32|this.m_elementBytes[4]<<24|this.m_elementBytes[5]<<16|this.m_elementBytes[6]<<8|this.m_elementBytes[7])}swapBytesInt32(){this.doSwap()&&(this.m_elementInt32[0]=this.m_elementBytes[0]<<24|this.m_elementBytes[1]<<16|this.m_elementBytes[2]<<8|this.m_elementBytes[3])}getOffset(){return this.m_offset}assignMove(e){return this===e||(this.clear(),this.m_sz=e.m_sz,this.m_buffer=e.m_buffer,this.m_view=e.m_view,this.m_bOwnsBuffer=e.m_bOwnsBuffer,this.m_bLittleEndian=e.m_bLittleEndian,e.m_buffer=null,e.m_sz=0,e.m_bOwnsBuffer=!0),this}doSwap(){return this.m_bLittleEndian!==(1===G.getNativeByteOrder())}setNativeByteOrder(){this.m_bLittleEndian=1===G.getNativeByteOrder()}setOrder(e){this.m_bLittleEndian=1===e}getOrder(){return this.m_bLittleEndian?1:0}getView(){return this.m_view||i("buffer not defined"),this.m_view}static getNativeByteOrder(){return 1}clear(){this.m_buffer=null,this.m_sz=0,this.m_bOwnsBuffer=!0}size(){return this.m_sz}readDouble(e){return this.doSwap()?(this.m_elementDouble[0]=this.m_view.getFloat64(e,this.m_bLittleEndian),this.swapBytesDouble(),this.m_elementDouble[0]):this.m_view.getFloat64(e,this.m_bLittleEndian)}writeDouble(e,t){this.m_elementDouble[0]=t,this.swapBytesDouble(),this.m_view.setFloat64(e,this.m_elementDouble[0],this.m_bLittleEndian)}readInt32(e){return this.doSwap()?(this.m_elementInt32[0]=this.m_view.getInt32(e,this.m_bLittleEndian),this.swapBytesInt32(),this.m_elementInt32[0]):this.m_view.getInt32(e,this.m_bLittleEndian)}writeInt32(e,t){this.m_elementInt32[0]=t,this.swapBytesInt32(),this.m_view.setInt32(e,this.m_elementInt32[0],this.m_bLittleEndian)}getPtr(){return this.m_buffer}setSizeNoRealloc(e){n(e>=0&&e<=this.m_sz),this.m_sz=e}}function W(e,r,i,a,o,u){let m=!1,l=!1,c=!1,d=!1,_=!1,h=!1,f=!1,p=!1,k=!1,b=!1,y=!1,N=!1,T=!1,g=!1,v=!1,C=!1,D=!1,F=!1,j=!1,z=!1,O=!1,I=!1,E=!1,B=!1,P=Number.NaN,V=Number.NaN,M=Number.NaN,R=Number.NaN,U=0,X=Number.NaN,L=Number.NaN,Y=Number.NaN,G=Number.NaN,W=Number.NaN,K=Number.NaN,te=Number.NaN,ne=Number.NaN,re=0,ie=0,se=!1,ae=!1,oe=null,ue=null,me=null,le=null,ce=null;for(;3!==i.nextToken();){const u=i.currentString();if(i.nextToken(),"spatialReference"===u){if(o&&!m){m=!0,1===i.currentToken()?le=q(i):10!==i.currentToken()&&t("failed to parse spatial reference: object or null is expected");continue}}else if(a)if("hasZ"===u){if(!l){l=!0,se=11===i.currentToken();continue}}else if("hasM"===u){if(!c){c=!0,ae=11===i.currentToken();continue}}else if("rings"===u){if(!(_||h||e!==s.enumUnknown&&e!==s.enumPolygon)){_=!0,({geometry:ce,as:oe,bs:ue}=Q(!0,!1,r,i));continue}}else if("curveRings"===u){if(!h&&(e===s.enumUnknown||e===s.enumPolygon)){h=!0,({geometry:ce,as:oe,bs:ue}=Q(!0,!0,r,i));continue}}else if("paths"===u){if(!(f||p||e!==s.enumUnknown&&e!==s.enumPolyline)){f=!0,({geometry:ce,as:oe,bs:ue}=Q(!1,!1,r,i));continue}}else if("curvePaths"===u){if(!p&&(e===s.enumUnknown||e===s.enumPolyline)){p=!0,({geometry:ce,as:oe,bs:ue}=Q(!1,!0,r,i));continue}}else if("points"===u){if(!k&&(e===s.enumUnknown||e===s.enumMultiPoint)){k=!0,({geometry:ce,as:oe,bs:ue}=Z(r,i));continue}}else if("ids"===u){if(!d){d=!0,me=J(r,i);continue}}else if("x"===u){if(!b&&(e===s.enumUnknown||e===s.enumPoint)){b=!0,P=H(i);continue}}else if("y"===u){if(!y&&(e===s.enumUnknown||e===s.enumPoint)){y=!0,V=H(i);continue}}else if("z"===u){if(!N&&(e===s.enumUnknown||e===s.enumPoint)){N=!0,M=H(i);continue}}else if("m"===u){if(!T&&(e===s.enumUnknown||e===s.enumPoint)){T=!0,R=H(i);continue}}else if("id"===u){if(!g&&(e===s.enumUnknown||e===s.enumPoint)){g=!0,U=$(i);continue}}else if("xmin"===u){if(!v&&(e===s.enumUnknown||e===s.enumEnvelope)){v=!0,X=H(i);continue}}else if("ymin"===u){if(!C&&(e===s.enumUnknown||e===s.enumEnvelope)){C=!0,L=H(i);continue}}else if("mmin"===u){if(!O&&(e===s.enumUnknown||e===s.enumEnvelope)){O=!0,te=H(i);continue}}else if("zmin"===u){if(!j&&(e===s.enumUnknown||e===s.enumEnvelope)){j=!0,W=H(i);continue}}else if("idmin"===u){if(!E&&(e===s.enumUnknown||e===s.enumEnvelope)){E=!0,re=$(i);continue}}else if("xmax"===u){if(!D&&(e===s.enumUnknown||e===s.enumEnvelope)){D=!0,Y=H(i);continue}}else if("ymax"===u){if(!F&&(e===s.enumUnknown||e===s.enumEnvelope)){F=!0,G=H(i);continue}}else if("mmax"===u){if(!I&&(e===s.enumUnknown||e===s.enumEnvelope)){I=!0,ne=H(i);continue}}else if("zmax"===u){if(!z&&(e===s.enumUnknown||e===s.enumEnvelope)){z=!0,K=H(i);continue}}else if("idmax"===u){if(!B&&(e===s.enumUnknown||e===s.enumEnvelope)){B=!0,ie=$(i);continue}}else"materials"===u&&n(0);i.skipChildren()}if(_||h||f||p||k){let e=null,t=null;const n=ce;se&&(ce.addAttribute(1),e=oe,e||(e=x(n.getPointCount(),Number.NaN))),ae&&(ce.addAttribute(2),t=se?ue:oe),null!=me&&ce.addAttribute(3),se&&null!=e&&n.setAttributeStreamRef(1,e),ae&&null!=t&&n.setAttributeStreamRef(2,t),null!=me&&ee(n,me)}else if(b||y||T||N||g){A(P,V)||t("failed to parse point: x and y must be finite or nan"),(Number.isNaN(V)||Number.isNaN(P))&&(P=Number.NaN,V=Number.NaN);const e=new S({x:P,y:V});N&&e.setZ(M),T&&e.setM(R),g&&e.setID(U),ce=e}else if(v||C||D||F||j||z||O||I||E||B){(Number.isNaN(L)||Number.isNaN(Y)||Number.isNaN(G))&&(X=Number.NaN);const e=new w({xmin:X,ymin:L,xmax:Y,ymax:G});j&&z&&e.setInterval(1,0,W,K),O&&I&&e.setInterval(2,0,te,ne),E&&B&&e.setInterval(3,0,re,ie),ce=e}return{...ce?{geom:ce}:{},...le?{sr:le}:{}}}function K(e){let t=!1;for(;3!==e.nextToken();){const n=e.currentString();e.nextToken(),"uwkid"===n?t||(t=!0,8===e.currentToken()&&e.currentInt32Value()):e.skipChildren()}return null}function q(e){let t=!1,n=!1,r=!1,i=!1,s=!1,a=!1,o=!1,u=!1,m=!1,l=!1,c=!1,d=!1,T=!1,g=!1,v=!1,x=!1,A=!1,S=-1,w=-1,C=-1,D=-1,F=0,j=0,z=0,O=0,I=0,E=0,B=0,P=0,V=0,M=0,R="",U="",X=null;for(;3!==e.nextToken();){const _=e.currentString();e.nextToken(),"wkid"===_?t||(t=!0,8===e.currentToken()&&(S=e.currentInt32Value())):"latestWkid"===_?n||(n=!0,8===e.currentToken()&&(w=e.currentInt32Value())):"wkt"===_?s||(s=!0,6===e.currentToken()&&(R=e.currentString())):"wkt2"===_?s||6===e.currentToken()&&(U=e.currentString()):"vcsWkid"===_?r||(r=!0,8===e.currentToken()&&(C=e.currentInt32Value())):"latestVcsWkid"===_?i||(i=!0,8===e.currentToken()&&(D=e.currentInt32Value())):"xyTolerance"===_?o||(o=!0,a=!0,F=e.currentDoubleValue()):"zTolerance"===_?u||(u=!0,a=!0,j=e.currentDoubleValue()):"mTolerance"===_?m||(m=!0,a=!0,z=e.currentDoubleValue()):"falseX"===_?l||(l=!0,a=!0,B=e.currentDoubleValue()):"falseY"===_?c||(c=!0,a=!0,P=e.currentDoubleValue()):"falseZ"===_?d||(d=!0,a=!0,V=e.currentDoubleValue()):"falseM"===_?T||(T=!0,a=!0,M=e.currentDoubleValue()):"xyUnits"===_?g||(g=!0,a=!0,O=e.currentDoubleValue()):"zUnits"===_?v||(v=!0,a=!0,I=e.currentDoubleValue()):"mUnits"===_?x||(x=!0,a=!0,E=e.currentDoubleValue()):"unit"===_?A||(A=!0,X=K(e)):e.skipChildren()}D<=0&&C>0&&(D=C),C<=0&&D>0&&(C=D);let L=null,Y=!0;if(0!==R.length&&(Y=!1,_(R)&&(L=h(R))),L||0===U.length||(Y=!1,_(U)&&(L=h(U))),!L&&w>0&&(Y=!1,f(w)&&(D<=0||p())&&(L=k(w,D))),!L&&S>0&&(Y=!1,f(S)&&(C<=0||p())&&(L=k(S,C))),Y&&(L=b(X)),a&&L){const e=new N;L.queryPrecisionDescriptorWithoutFalseXY(e),o&&e.setTolerance(0,F),u&&e.setTolerance(1,j),m&&e.setTolerance(2,z),g&&l&&c&&e.setGridParams(B,P,O),v&&d&&e.setZParams(V,I),x&&T&&e.setMParams(M,E),L=y(L,e)}return L}function Q(e,n,r,i){2!==i.currentToken()&&t("failed to parse multipath: array of array of vertices is expected");const s=e?new C:new D,a=s,o=F(0),u=x(2,0),d=j(0);let _=null,h=null,f=null,p=null,k=null,b=0,y=0,N=0;const T=new z,g=m.getNAN();let v=0,A=0;const S=e?1:0;for(;4!==i.nextToken();){2!==i.currentToken()&&t("failed to parse multipath: ring/path array is expected");let r=2,s=0,w=!0;const C=4;let D=0,z=0;const I=m.getNAN(),E=new Array(C),B=new Array(C);let P=!1;for(i.nextToken();4!==i.currentToken();){if(n&&1===i.currentToken())w&&t("failed to parse multipath: starting vertex array is expected"),f||(f=j(v-1,1),p=F(v-1,-1),k=x(0)),P=!0,r=1,({segFlag:N,toPointSz:D}=oe(T,E,g,i));else{for(P=!1,2!==i.currentToken()&&t("failed to parse multipath: array is expected, rings/paths vertices consist of arrays of coordinates"),D=0;4!==i.nextToken();)D===C&&t("failed to parse multipath: each vertex array has to have at most 4 elements"),E[D++]=H(i);D<2&&t("failed to parse multipath: each vertex array has to have at least 2 elements"),O(E[0],E[1])||t("failed to parse multipath: x and y must be finite")}i.nextToken();do{if(u.size()===2*v&&u.resize(te(v)),u.writePoint2D(2*v,I.setCoords(E[0],E[1])),_&&_.size()===v&&_.resize(ne(v)),D>2?(_||(_=x(v+1,Number.NaN)),_.write(v,E[2])):_&&_.write(v,Number.NaN),h&&h.size()===v&&h.resize(ne(v)),D>3?(h||(h=x(v+1,Number.NaN)),h.write(v,E[3])):h&&h.write(v,Number.NaN),w)A++,o.add(v),d.add(S),w=!1,z=D,l(B,E,0,0,z);else if(null!==f)if(P){const e=M(N),t=k.size();k.resize(t+e),f.add(N),p.add(b),T.get().writeInBufferStream(k,b),b+=e,a.incCurveType(N,1),y++}else f.add(1),p.add(-1);v++,s++,g.setCoords(E[0],E[1])}while(s<r&&4===i.currentToken())}0!==s&&(e&&s>r&&D===z&&0===c(E,B,D)?(v--,s--):null!==f&&(f.add(1),p.add(-1)))}return v&&(o.resize(A),d.resize(A),v>0&&(o.add(v),d.add(0)),a.setAttributeStreamRef(0,u),a.setPathFlagsStreamRef(d),a.setPathStreamRef(o),null!==f&&(a.updateCurveCounter(y),a.setSegmentData(p,k,f,b)),a.notifyModifiedFlags(65535)),{geometry:s,as:_,bs:h}}function Z(e,n){2!==n.currentToken()&&t("failed to parse multipoint: array of vertices is expected");let r=0;const i=new I,s=x(2,0);let a=0;const o=4,u=new Array(o),l=new m;let c=null,d=null;for(;4!==n.nextToken();){for(2!==n.currentToken()&&t("failed to parse multipoint: array is expected, multipoint vertices consist of arrays of cooridinates"),a=0;4!==n.nextToken();)a===o&&t("failed to parse multipoint: each vertex array has to have at most 4 elements"),u[a++]=H(n);a<2&&t("failed to parse multipoint: each vertex array has to have at least 2 elements"),O(u[0],u[1])||t("failed to parse multipoint: x and y must be finite"),s.size()===2*r&&s.resize(te(r)),s.writePoint2D(2*r,l.setCoords(u[0],u[1])),c&&c.size()===r&&c.resize(ne(r)),a>2?(c||(c=x(r+1,Number.NaN)),c.write(r,u[2])):c&&c.write(r,Number.NaN),d&&d.size()===r&&d.resize(ne(r)),a>3?(d||(d=x(r+1,Number.NaN)),d.write(r,u[3])):d&&d.write(r,Number.NaN),r++}if(r){const e=i.getImpl();e.setAttributeStreamRef(0,s),e.resizeNoInit(r),e.notifyModifiedFlags(65535)}return{geometry:i,as:c,bs:d}}function J(e,n){2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected");const r=E(2,0);let i=0,s=-1;for(;4!==n.nextToken();){const e=i;r.size()===i&&r.resize(ne(i)),i++;let a=0;for(-1===s?s=2===n.currentToken()?1:0:1===s&&2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected"),0===s&&(r.size()===i&&r.resize(ne(i)),r.write(i,$(n)),a++,i++);4!==n.nextToken();)r.size()===i&&r.resize(ne(i)),r.write(i,$(n)),a++,i++;if(r.write(e,a),0===s)break}return r.resize(i),r}function H(e){const t=e.currentToken();if(10===t||6===t&&"NaN"===e.currentString())return Number.NaN;{const t=e.currentDoubleValue();return Number.isNaN(t)?Number.NaN:t}}function $(e){return e.currentInt32Value()}function ee(t,n){if(t.isEmpty())return;const r=E(2,0),i=t.getGeometryType();let s=0;i===I.type?s=1:i===D.type||i===C.type?s=t.getPathCount():e("not implemented"),r.resize(t.getPointCount(),0);let a=0;for(let o=0;o<s;++o){const s=n.read(a);a++;const u=a+s;let m=0,l=0;i===I.type?m=t.getPointCount():i===D.type||i===C.type?(m=t.getPathSize(o),l=t.getPathStart(o)):e("not implemented");for(let e=0,t=Math.min(s,m);e<t;++e)r.write(l,n.read(a)),a++,l++;a=u}t.getImpl().setAttributeStreamRef(3,r)}function te(e){let t=2*Math.trunc(3*(e+1)/2);return t<8?t=8:t<32&&(t=32),t}function ne(e){let t=Math.trunc(3*(e+1)/2);return t<4?t=4:t<16&&(t=16),t}function re(e,t,n,i,s){s>=i.size()&&r("Byte_buffer out of range access"),e.m_bits=0,e.m_rotation=0,e.m_cosr=1,e.m_sinr=0,e.setStartXY(t),e.setEndXY(n);const a=m.getNAN();a.x=i.readDouble(s),a.y=i.readDouble(s+8);const o=i.readInt32(s+16);if(!!(1&o))return e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,B(e),!1;let u=!!(64&o);const l=!!(128&o);let c=!!(32&o);const d=!!(8&o),_=!!(16&o),h=t.equals(n);return u&&!h&&(u=!1,c=!0),c&&h&&(u=!0,c=!1,a.setCoords(0,0)),u||(l?c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0):(e.constructCircularArcThreePoint(t,n,a),h&&d===e.isClockwise()&&e.reverse()):c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,B(e),e.queryCoord2D(.5,e.m_interior)):P(e,t,n,a,d,_)),u&&(e.m_center.assign(t),e.m_startAngle=a.x,e.m_sweepAngle=a.y,V(e,Number.NaN,d,_),e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.setCoordsPoint2D(t)),e.setProjectionBehavior(0),B(e),!0}function ie(e,t,n,r,i){e.m_bits=0,e.m_center.x=r.readDouble(i),e.m_center.y=r.readDouble(i+8),e.m_rotation=r.readDouble(i+16),e.m_semiMajorAxis=r.readDouble(i+24),e.m_minorMajorRatio=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y;const s=r.readInt32(i+40);if(1&s)return!1;let a=!!(64&s),o=!!(128&s);const u=!!(2048&s),m=!!(4096&s);return!!!(512&s)&&!!!(1024&s)||o||(a=!0),o&&!t.equals(n)?(o=!1,a=!0):a&&t.equals(n)&&(o=!0,a=!1),o?(e.m_center.assign(t),e.m_startAngle=e.m_center.x,e.m_sweepAngle=e.m_center.y,V(e,Number.NaN,u,m),e.m_semiMajorAxis=0,e.m_interior.setCoordsPoint2D(t)):a?(e.m_center.setNAN(),e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,B(e),e.queryCoord2D(.5,e.m_interior)):e.constructEllipticArcEndPointsCenter(t,n,e.m_semiMajorAxis,e.m_minorMajorRatio,e.m_rotation,!m,u,e.m_center),e.setProjectionBehavior(1),B(e),!0}function se(e,t,r,i,s){return n(s+32<=i.size()),e.m_cp=d(m,2),e.m_cp[0].x=i.readDouble(s),e.m_cp[0].y=i.readDouble(s+8),e.m_cp[1].x=i.readDouble(s+16),e.m_cp[1].y=i.readDouble(s+24),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=r.x,e.m_YEnd=r.y,!0}function ae(e,t,n,r,i){return e.m_cp.x=r.readDouble(i),e.m_cp.y=r.readDouble(i+8),e.m_weights[0]=r.readDouble(i+16),e.m_weights[1]=r.readDouble(i+24),e.m_weights[2]=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y,!0}function oe(e,n,r,i,s){const a={segFlag:0,toPointSz:0};let o=i.currentToken();o=i.nextToken();const u=i.currentString(),l=u[0];for((1!==u.length||"a"!==l&&"b"!==l&&"c"!==l&&"n"!==l&&"q"!==l)&&t('failed to parse curve: expecting "a", "b", "n", "q", or "c"'),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for curve parameters"),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for to point"),a.toPointSz=0;4!==i.nextToken();)4===a.toPointSz&&t("failed to parse curve: vertex array cannot have more than 4 elements"),n[a.toPointSz++]=H(i);a.toPointSz<2&&t("failed to parse curve: vertex array must have at least 2 elements");const c=m.construct(n[0],n[1]),d=m.getNAN();let _=-1,h=-1,f=!1,p=Number.NaN,k=Number.NaN,b=Number.NaN;const y=[m.getNAN(),m.getNAN(),m.getNAN()],N=m.getNAN();if("a"===l){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for center point"),o=i.nextToken();const e=H(i);o=i.nextToken();const n=H(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for center point"),d.setCoords(e,n),o=i.nextToken(),_=i.currentInt32Value(),o=i.nextToken(),h=i.currentInt32Value(),o=i.nextToken(),4!==o?(f=!1,p=H(i),o=i.nextToken(),k=H(i),o=i.nextToken(),b=H(i),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters")):f=!0,a.segFlag=4}else if("b"===l){for(let e=0;e<2;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=H(i);o=i.nextToken();const r=H(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=2}else if("n"===l){{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const e=H(i);o=i.nextToken();const n=H(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[0].setCoords(e,n)}o=i.nextToken();const e=H(i);o=i.nextToken();const n=H(i);o=i.nextToken();const r=H(i);y[1].setCoords(e,n),y[2].setCoords(r,r),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=8}else if("q"===l){for(let e=0;e<1;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=H(i);o=i.nextToken();const r=H(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=16}else{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for interior point"),o=i.nextToken();const e=H(i);o=i.nextToken();const n=H(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for interior point"),N.setCoords(e,n),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=4}if(o=i.nextToken(),3!==o&&t("failed to parse curve: end object is expected for curve"),"a"===l)if(e.createEllipticArc(),f){const t=!0;ue(e.get(),r,c,d,t,_,h)}else me(e.get(),r,c,d,_,h,p,k,b);else if("b"===l)e.createCubicBezier(),le(e.get(),r,c,y);else if("n"===l)e.createQuadraticRationalBezier(),ce(e.get(),r,c,y[0],y[1].x,y[1].y,y[2].x);else if("q"===l)e.createQuadraticBezier(),e.get().construct(r,y[0],c);else{e.createEllipticArc();const t=!1;ue(e.get(),r,c,N,t,-1,-1)}return a}function ue(e,t,n,r,i,s,a){e.dropAllAttributes();const o=20,u=new ArrayBuffer(o),m=new G({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8;let c=0;i?(a||(c|=8),s&&(c|=16)):c|=128,m.writeInt32(l,c),l+=4,re(e,t,n,m,0)}function me(e,t,n,r,i,s,a,o,u){e.dropAllAttributes();const m=44,l=new ArrayBuffer(m),c=new G({sz:m,buffer:l});let d=0;c.writeDouble(d,r.x),d+=8,c.writeDouble(d,r.y),d+=8,c.writeDouble(d,a),d+=8,c.writeDouble(d,o),d+=8,c.writeDouble(d,u),d+=8;let _=0;s||(_|=2048),i&&(_|=4096),c.writeInt32(d,_),d+=4,ie(e,t,n,c,0)}function le(e,t,n,r){e.dropAllAttributes();const i=32,s=new ArrayBuffer(i),a=new G({sz:i,buffer:s});let o=0;a.writeDouble(o,r[0].x),o+=8,a.writeDouble(o,r[0].y),o+=8,a.writeDouble(o,r[1].x),o+=8,a.writeDouble(o,r[1].y),o+=8,se(e,t,n,a,0)}function ce(e,t,n,r,i,s,a){e.dropAllAttributes();const o=40,u=new ArrayBuffer(o),m=new G({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8,m.writeDouble(l,i),l+=8,m.writeDouble(l,s),l+=8,m.writeDouble(l,a),l+=8,ae(e,t,n,m,0)}function de(e,t,n,r,i){const o=e.getGeometryType();if(o===s.enumEllipticArc)return _e(e,t,n,r,i);if(o===s.enumBezier)return he(e,t,n,r,i);if(o===s.enumRationalBezier2)return fe(e,t,n,r,i);if(o===s.enumBezier2){const s=new g;return s.constructFromQuadraticSegment(e),he(s,t,n,r,i)}a("")}function _e(e,t,r,i,s){n(!v(e));const a=e.getEndXY(),o=e.hasAttribute(1)&&!t,u=e.hasAttribute(2)&&!r;let m=Number.NaN,l=Number.NaN;if(o&&(m=e.getEndAttributeAsDbl(1,0)),u&&(l=e.getEndAttributeAsDbl(2,0)),e.isDegenerateToLine()||e.isDegenerate(0))return pe(o,u,a.x,a.y,m,l,i,s),!0;const c=0===e.projectionBehavior(),d=!!c&&e.isClosed();if(c&&!d)s.startObject(),s.addFieldName("c"),s.startArray(),pe(o,u,a.x,a.y,m,l,i,s),ke(e.m_interior.x,e.m_interior.y,17,s),s.endArray(),s.endObject();else if(c){s.startObject(),s.addFieldName("a"),s.startArray(),pe(o,u,a.x,a.y,m,l,i,s);const t=0,n=0;ke(e.m_center.x+t,e.m_center.y+n,17,s);const r=!e.isMajor();s.addInt32(r?1:0);const c=e.isClockwise();s.addInt32(c?1:0),s.endArray(),s.endObject()}else{s.startObject(),s.addFieldName("a"),s.startArray(),pe(o,u,a.x,a.y,m,l,i,s);const t=e;ke(t.m_center.x,t.m_center.y,17,s);const n=!t.isMajor();s.addInt32(n?1:0);const r=t.isClockwise();s.addInt32(r?1:0),s.addDouble(t.m_rotation,17),s.addDouble(t.m_semiMajorAxis,17),s.addDouble(t.m_minorMajorRatio,17),s.endArray(),s.endObject()}return!1}function he(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;return a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("b"),i.startArray(),pe(a,o,s.x,s.y,u,m,r,i),ke(e.m_cp[0].x,e.m_cp[0].y,r,i),ke(e.m_cp[1].x,e.m_cp[1].y,r,i),i.endArray(),i.endObject(),!1}function fe(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("n"),i.startArray(),pe(a,o,s.x,s.y,u,m,r,i),ke(e.m_cp.x,e.m_cp.y,r,i);const l=r;return i.addDouble(e.m_weights[0],l),i.addDouble(e.m_weights[1],l),i.addDouble(e.m_weights[2],l),i.endArray(),i.endObject(),!1}function pe(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}function ke(e,t,n,r){r.startArray(),r.addDouble(e,n),r.addDouble(t,n),r.endArray()}class be{getOperatorType(){return 10405}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,r,i,s){ye(e,t,n,r)}exportSpatialReference(e,t,r,i){n(0)}exportProjectionTransformation(e,t,r,i){n(0)}exportDatumTransformation(e,t,r,i){n(0)}static geometryTypeToString(e){return n(0),""}}function ye(t,r,i,a,o){if(r||i){if(a.startObject(),null!==r){switch(r.getGeometryType()){case s.enumPolygon:Ne(!0,t,r,a);break;case s.enumPolyline:Ne(!1,t,r,a);break;case s.enumMultiPoint:Te(t,r,a);break;case s.enumPoint:ge(t,r,a);break;case s.enumEnvelope:ve(t,r,a);break;case s.enumMultipatch:n(0);break;default:e("exportToJSON")}}null!==i&&(a.addFieldName("spatialReference"),Ae(t,i,a)),a.endObject()}}function Ne(e,t,r,i){const s=r.getImpl(),o=!!(2&t),u=!!(4&t),m=!!(8&t),l=s.hasAttribute(1)&&!o,c=s.hasAttribute(2)&&!u,d=s.hasAttribute(3)&&!m,_=s.hasNonLinearSegments();l&&(i.addFieldName("hasZ"),i.addBool(!0)),c&&(i.addFieldName("hasM"),i.addBool(!0)),e?_?i.addFieldName("curveRings"):i.addFieldName("rings"):_?i.addFieldName("curvePaths"):i.addFieldName("paths");let h=null;const f=[];if(r.isEmpty())i.startArray(),i.endArray();else{const e=17-(31&t>>13);i.startArray();const n=r.getPathCount();let m=0;const p=s.getAttributeStreamRef(0);let k=null,b=null,y=null;const N=new z;let T=null,g=null,v=null;_&&(T=s.getSegmentFlagsStreamRef(),g=s.getSegmentIndexStreamRef(),v=s.getSegmentDataStreamRef()),l&&(k=s.getAttributeStreamRef(1)),c&&(b=s.getAttributeStreamRef(2)),d&&(y=s.getAttributeStreamRef(3),h=R(3,0));for(let t=0;t<n;t++){i.startArray(),d&&f.push(0);const n=r.getPathEnd(t);if(m===n){i.endArray();continue}const s=r.isClosedPath(t);let _=p.read(2*m),x=p.read(2*m+1),A=l?k.read(m):Number.NaN,S=c?b.read(m):Number.NaN,w=d?y.read(m):0;Se(l,c,_,x,A,S,e,i);let C=1;d&&(h.add(w),f[f.length-1]++);const D=_,F=x,j=A,z=S,O=w;let I=!1,E=0,B=Number.NaN,P=Number.NaN,V=0;for(let t=m+1,r=m,M=s?n+1:n;t<M;t++,r++){const s=null!==T?31&T.read(r):1;let m,M;if(t<n?(m=p.read(2*t),M=p.read(2*t+1),l&&(B=k.read(t)),c&&(P=b.read(t)),d&&(V=y.read(t))):(m=D,M=F,B=j,P=z,V=O),1!==s){I=!0,4===s?N.createEllipticArc():2===s?N.createCubicBezier():16===s?N.createQuadraticBezier():8===s?N.createQuadraticRationalBezier():a("JSON export.unsupported curve");const t=N.get(),n=g.read(r);t.setStartXYCoords(_,x),t.setEndXYCoords(m,M),l&&(t.setStartAttribute(1,0,A),t.setEndAttribute(1,0,B)),c&&(t.setStartAttribute(2,0,S),t.setEndAttribute(2,0,P)),t.readFromBufferStream(v,n);de(N.get(),o,u,e,i)&&E++}else Se(l,c,m,M,B,P,e,i);d&&(h.add(V),f[f.length-1]++),C++,_=m,x=M,A=B,S=P,w=V}I&&0===E||(C<2&&E<1&&(Se(l,c,_,x,A,S,e,i),C++,d&&(h.add(w),f[f.length-1]++)),s&&C<3&&E<2&&(Se(l,c,D,F,j,z,e,i),C++,_=D,x=F,A=j,S=z,w=O,d&&(h.add(O),f[f.length-1]++))),i.endArray(),m=n}i.endArray()}if(d){i.addFieldName("ids"),i.startArray();let e=0;for(let t=0,r=f.length;t<r;++t){const r=f[t];n(0===r||null!==h&&e+r<=h.size()),i.startArray();for(let t=0;t<r;++t)i.addInt32(h.read(e)),e++;i.endArray()}i.endArray()}}function Te(e,t,r){const i=t.getImpl(),s=i.hasAttribute(1)&&!(2&e),a=i.hasAttribute(2)&&!(4&e),o=i.hasAttribute(3)&&!(8&e);s&&(r.addFieldName("hasZ"),r.addBool(!0)),a&&(r.addFieldName("hasM"),r.addBool(!0)),r.addFieldName("points");const u=t.getPointCount();if(t.isEmpty())r.startArray(),r.endArray();else{const t=17-(31&e>>13);r.startArray();const n=i.getAttributeStreamRef(0);let o=null,m=null;s&&(o=i.getAttributeStreamRef(1)),a&&(m=i.getAttributeStreamRef(2));for(let e=0;e<u;e++){const i=n.read(2*e),u=n.read(2*e+1);let l=Number.NaN,c=Number.NaN;s&&(l=o.read(e)),a&&(c=m.read(e)),Se(s,a,i,u,l,c,t,r)}r.endArray()}if(o){let e=null;i.isEmpty()||(e=i.getAttributeStreamRef(3)),n(0===u||null!==e&&e.size()>=u),r.addFieldName("ids"),r.startArray();for(let t=0;t<u;t++)r.addInt32(e.read(t));r.endArray()}}function ge(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("x"),n.addNull(),n.addFieldName("y"),n.addNull(),r&&(n.addFieldName("z"),n.addNull()),i&&(n.addFieldName("m"),n.addNull()),void(s&&(n.addFieldName("id"),n.addInt32(0)));const a=17-(31&e>>13);n.addFieldName("x"),n.addDouble(t.getX(),a),n.addFieldName("y"),n.addDouble(t.getY(),a),r&&(n.addFieldName("z"),n.addDouble(t.getZ(),a)),i&&(n.addFieldName("m"),n.addDouble(t.getM(),a)),s&&(n.addFieldName("id"),n.addInt32(t.getID()))}function ve(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("xmin"),n.addNull(),n.addFieldName("ymin"),n.addNull(),n.addFieldName("xmax"),n.addNull(),n.addFieldName("ymax"),n.addNull(),r&&(n.addFieldName("zmin"),n.addNull(),n.addFieldName("zmax"),n.addNull()),i&&(n.addFieldName("mmin"),n.addNull(),n.addFieldName("mmax"),n.addNull()),void(s&&(n.addFieldName("idmin"),n.addInt32(0),n.addFieldName("idmax"),n.addInt32(0)));const a=17-(31&e>>13);if(n.addFieldName("xmin"),n.addDouble(t.getXMin(),a),n.addFieldName("ymin"),n.addDouble(t.getYMin(),a),n.addFieldName("xmax"),n.addDouble(t.getXMax(),a),n.addFieldName("ymax"),n.addDouble(t.getYMax(),a),r){const e=t.queryInterval(1,0);n.addFieldName("zmin"),n.addDouble(e.vmin,a),n.addFieldName("zmax"),n.addDouble(e.vmax,a)}if(i){const e=t.queryInterval(2,0);n.addFieldName("mmin"),n.addDouble(e.vmin,a),n.addFieldName("mmax"),n.addDouble(e.vmax,a)}if(s){const e=t.queryInterval(3,0);n.addFieldName("idmin"),n.addInt32(e.vmin),n.addFieldName("idmax"),n.addInt32(e.vmax)}}function xe(e,n,r){r.startObject();const i=n.getID();i<=0&&t("cannot export unit that has no valid WKID"),r.addFieldName("uwkid"),r.addInt32(i),r.endObject()}function Ae(e,t,n){n.startObject();let r=0;t.isCustomWkid()||(r=t.getOldID());let i=0;const s=t.getVCS();if(null!==s&&(s.isCustomWkid()||(i=s.getOldID()),i<=0&&(r=0)),r>0){n.addFieldName("wkid"),n.addInt32(r);const e=t.getLatestID();if(e>0&&e!==r&&(n.addFieldName("latestWkid"),n.addInt32(e)),i>0){n.addFieldName("vcsWkid"),n.addInt32(i);const e=t.getLatestVerticalID();e!==i&&(n.addFieldName("latestVcsWkid"),n.addInt32(e))}}if(0===t.getCoordinateSystemType())n.addFieldName("wkid"),n.addNull(),null!==t.getUnit()&&(n.addFieldName("unit"),xe(e,t.getUnit(),n));else if(r<=0||1&e){let r="";64&e&&(r=t.getText2(),n.addFieldName("wkt2"),n.addString(r));const i=t.getText();i!==r&&(n.addFieldName("wkt"),n.addString(i))}if(16&e){const e=new N;t.queryPrecisionDescriptor(e),n.addFieldName("xyTolerance"),n.addDouble(e.getTolerance(0)),n.addFieldName("zTolerance"),n.addDouble(e.getTolerance(1)),n.addFieldName("mTolerance"),n.addDouble(e.getTolerance(2)),n.addFieldName("falseX"),n.addDouble(e.getFalseX()),n.addFieldName("falseY"),n.addDouble(e.getFalseY()),n.addFieldName("xyUnits"),n.addDouble(e.getGridUnitsXY()),n.addFieldName("falseZ"),n.addDouble(e.getFalseZ()),n.addFieldName("zUnits"),n.addDouble(e.getGridUnitsZ()),n.addFieldName("falseM"),n.addDouble(e.getFalseM()),n.addFieldName("mUnits"),n.addDouble(e.getGridUnitsM())}n.endObject()}function Se(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}const we={s_a:"a".charCodeAt(0),s_A:"A".charCodeAt(0),s_asterisk:"*".charCodeAt(0),s_b:"b".charCodeAt(0),s_backspace:"\b".charCodeAt(0),s_backslash:"\\".charCodeAt(0),s_beginArray:"[".charCodeAt(0),s_beginObject:"{".charCodeAt(0),s_colon:":".charCodeAt(0),s_period:".".charCodeAt(0),s_comma:",".charCodeAt(0),s_doubleQuote:'"'.charCodeAt(0),s_endArray:"]".charCodeAt(0),s_endObject:"}".charCodeAt(0),s_e:"e".charCodeAt(0),s_E:"E".charCodeAt(0),s_f:"f".charCodeAt(0),s_formfeed:"\f".charCodeAt(0),s_F:"F".charCodeAt(0),s_forwardslash:"/".charCodeAt(0),s_lt:"<".charCodeAt(0),s_minus:"-".charCodeAt(0),s_plus:"+".charCodeAt(0),s_n:"n".charCodeAt(0),s_N:"N".charCodeAt(0),s_newline:"\n".charCodeAt(0),s_r:"r".charCodeAt(0),s_carriageReturn:"\r".charCodeAt(0),s_t:"t".charCodeAt(0),s_tab:"\t".charCodeAt(0),s_u:"u".charCodeAt(0),s_zero:"0".charCodeAt(0),s_nine:"9".charCodeAt(0)};class Ce{constructor(t){this.m_functionStack=[],this.m_pushPositions=[],this.m_utf8Decoder=new TextDecoder("utf-8",{fatal:!0}),void 0===t?(this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_endToken=0,this.m_currentTokenType=0,this.m_functionStack.push((()=>this.accept_())),this.m_jsonString=null,this.m_bHasEscapes=!1):t.jsonString?this.resetParserFromString(t.jsonString):t.jsonStream?a("streaming json parsing not yet impl"):e("invalid constructor parameter")}prepSubstrString_(){}getCurrentSubstrString_(){return this.m_jsonString.slice(this.m_startToken,this.m_endToken)}stepOverCharString_(){this.m_endToken++}peekCharString_(){return this.m_jsonString.charCodeAt(this.m_endToken)}getString_(e){const t=this.m_jsonString?.slice(this.m_startToken,this.m_startToken+e-1);this.m_endToken+=e-1;return{s:t,bDone:this.m_endToken>=this.m_jsonString.length}}incrementString_(){this.m_endToken++}eofString_(){return this.m_endToken>=this.m_jsonString.length}setStringFunctions_(){this.m_prepSubstr=this.prepSubstrString_,this.m_getCurrentSubstr=this.getCurrentSubstrString_,this.m_stepOverChar=this.stepOverCharString_,this.m_peekChar=this.peekCharString_,this.m_get=this.getString_,this.m_increment=this.incrementString_,this.m_eof=this.eofString_}setStreamFunctions_(){a("streaming json parsing not yet impl")}reset_(){this.m_jsonString=null,this.m_endToken=0,this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_currentTokenType=0,this.m_bHasEscapes=!1,this.m_functionStack.length=0,this.m_functionStack.push((()=>this.start_())),this.m_pushPositions.length=0}resetParserFromString(e){this.reset_(),this.setStringFunctions_(),this.m_jsonString=e}resetParserFromStream(e){a("streaming json parsing not yet impl")}resetToPosition(e){return n(0),!1}nextToken(){return this.m_functionStack.at(-1)(),this.m_currentTokenType}currentToken(){return this.m_currentTokenType}currentTokenStartIndex(){return this.m_startToken}currentTokenEndIndex(){return this.m_endToken}currentText(){return n(0),""}childrenAsString(){return n(0),""}skipChildren(){this.skipChildren_()}skipChildren_(){if(1!==this.m_currentTokenType)if(2!==this.m_currentTokenType);else{let e=1;do{this.m_currentTokenType=this.nextToken(),2===this.m_currentTokenType?e++:4===this.m_currentTokenType&&e--}while(4!==this.m_currentTokenType||0!==e)}else{let e=1;do{this.m_currentTokenType=this.nextToken(),1===this.m_currentTokenType?e++:3===this.m_currentTokenType&&e--}while(3!==this.m_currentTokenType||0!==e)}}currentTerminalAsString_(){switch(this.m_currentTokenType){case 7:case 8:case 9:return this.m_getCurrentSubstr().slice(0,this.m_endToken-this.m_startToken);case 10:return"null";case 11:return"true";case 12:return"false"}t("invalid token")}toUTF8_(e,t){let n=0,r=e;for(;t.charCodeAt(r)===we.s_backslash&&t.charCodeAt(r+1)===we.s_u;)n++,r+=6;r=e;const i=new Uint8Array(n);let s=0;for(;t.charCodeAt(r)===we.s_backslash&&t.charCodeAt(r+1)===we.s_u;)i[s++]=Number.parseInt(t.slice(r+2,r+6),16),r+=6;return{u8s:this.m_utf8Decoder.decode(i),end:r}}unquoteCurrentString_(){let e="",t=1;const n=this.m_endToken-this.m_startToken-1;let r=0;const i=this.m_getCurrentSubstr();for(let s=t;s<n;s++)if(i.charCodeAt(s)!==we.s_backslash)r++;else{switch(r>0&&(e+=i.slice(t,t+r)),i.charCodeAt(++s)){case we.s_doubleQuote:e+='"';break;case we.s_u:{const{u8s:t,end:n}=this.toUTF8_(s-1,i);s=n-1,e+=t;break}case we.s_backslash:e+="\\";break;case we.s_forwardslash:e+="/";break;case we.s_b:e+="\b";break;case we.s_f:e+="\f";break;case we.s_n:e+="\n";break;case we.s_r:e+="\r";break;case we.s_t:e+="\t"}t=s+1,r=0}return r>0&&(e+=i.slice(t,t+r)),e}currentString(){if(5!==this.m_currentTokenType&&6!==this.m_currentTokenType)return this.currentTerminalAsString_();if(this.m_bHasEscapes)return this.unquoteCurrentString_();return this.m_getCurrentSubstr().slice(1,this.m_endToken-this.m_startToken-2+1)}currentDoubleValue(){if(7!==this.m_currentTokenType&&8!==this.m_currentTokenType&&9!==this.m_currentTokenType&&6!==this.m_currentTokenType&&10!==this.m_currentTokenType&&t("invalid token"),10===this.m_currentTokenType)return Number.NaN;let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;if(6===this.m_currentTokenType){if("NaN"===this.currentString())return Number.NaN;e=e.slice(1),n-=2,0===n&&t("invalid token")}const r=Number.parseFloat(e);if(6===this.m_currentTokenType)Number.isNaN(r)&&t("invalid token");else if(Number.isNaN(r))return Number.NaN;return r}currentInt32Value(){8!==this.m_currentTokenType&&6!==this.m_currentTokenType&&t("invalid token");let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;6===this.m_currentTokenType&&(e=e.slice(1),n-=2,0===n&&t("invalid token"));const r=parseInt(e);return Number.isNaN(r)&&t("invalid token"),r}currentInt64Value(){return n(0),0n}currentBoolValue(){return n(0),!1}isError(){return 0}JSONString(){return n(0),""}pushPosition(){return n(0),!1}popPosition(){return n(0),!1}skipCStyleComments_(){n(0)}skipCppStyleComments_(){n(0)}skipComments_(){this.m_prepSubstr();let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e===we.s_asterisk?this.skipCStyleComments_():e===we.s_forwardslash?this.skipCppStyleComments_():t("invalid token")}skipWhiteSpace_(){let e;do{this.m_eof()&&t("invalid token");let n=this.m_peekChar();for(;n>=9&&n<=13||32===n;)this.m_increment(),this.m_eof()&&t("invalid token"),n=this.m_peekChar();n===we.s_forwardslash?(this.m_startToken=this.m_endToken,e=!0,this.skipComments_()):e=!1}while(e)}rightBracket_(){return this.m_peekChar()===we.s_endArray&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=4,!0)}rightBrace_(){return this.m_peekChar()===we.s_endObject&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=3,!0)}string_(){this.m_prepSubstr(),this.m_bHasEscapes=!1,this.m_stepOverChar(),this.m_eof()&&t("invalid token");let e=this.m_peekChar();for(;e!==we.s_doubleQuote;){const n=e===we.s_backslash;if(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),n)if(this.m_bHasEscapes=!0,e===we.s_doubleQuote||e===we.s_backslash||e===we.s_forwardslash||e===we.s_b||e===we.s_f||e===we.s_n||e===we.s_r||e===we.s_t)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar();else if(e===we.s_u)for(let r=0;r<4;r++)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=we.s_zero&&e<=we.s_nine||e>=we.s_a&&e<=we.s_f||e>=we.s_A&&e<=we.s_F||t("invalid token");else t("invalid token")}this.m_stepOverChar()}comma_(){return this.m_peekChar()===we.s_comma&&(this.m_increment(),!0)}colon_(){return this.m_peekChar()===we.s_colon&&(this.m_increment(),!0)}fieldNameEnd_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.colon_()?(this.skipWhiteSpace_(),this.value_()):t("invalid token")}fieldNameStart_(){this.m_startToken=this.m_endToken;this.m_peekChar()!==we.s_doubleQuote&&t("invalid token"),this.string_(),this.m_currentTokenType=5,this.m_functionStack.push((()=>this.fieldNameEnd_()))}pairEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.fieldNameStart_()):this.rightBrace_()?this.m_functionStack.pop():t("invalid token")}arrayStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBracket_()||(this.m_functionStack.push((()=>this.elementEnd_())),this.value_())}elementEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.value_()):this.rightBracket_()?this.m_functionStack.pop():t("invalid token")}objectStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBrace_()||(this.m_functionStack.push((()=>this.pairEnd_())),this.fieldNameStart_())}valueStartObject_(){this.m_increment(),this.m_currentTokenType=1,this.m_functionStack.push((()=>this.objectStart_()))}valueStartArray_(){this.m_increment(),this.m_currentTokenType=2,this.m_functionStack.push((()=>this.arrayStart_()))}valueString_(){this.string_(),this.m_currentTokenType=6}int_(){this.m_peekChar()!==we.s_zero?this.digits_():this.m_stepOverChar()}digits_(){let e=this.m_peekChar();do{this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()}while(e>=we.s_zero&&e<=we.s_nine)}frac_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=we.s_zero&&e<=we.s_nine||t("invalid token"),this.digits_()}exp_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e!==we.s_plus&&e!==we.s_minus||(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()),e>=we.s_zero&&e<=we.s_nine||t("invalid token"),this.digits_()}valueNumber_(){this.m_prepSubstr();let e=!1,n=this.m_peekChar();if(n===we.s_minus?(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),n=this.m_peekChar(),e=!0,n>=we.s_zero&&n<=we.s_nine||t("invalid token"),this.int_()):this.int_(),n=this.m_peekChar(),n===we.s_period)this.m_currentTokenType=7,this.frac_(),n=this.m_peekChar(),n!==we.s_e&&n!==we.s_E||this.exp_();else if(n===we.s_e||n===we.s_E)this.m_currentTokenType=7,this.exp_();else{let t=0;e&&t++;const n=this.m_endToken-this.m_startToken-t;if(n<10)this.m_currentTokenType=8;else if(10===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="2147483648"?this.m_currentTokenType=8:this.m_currentTokenType=9:n.slice(t)<="2147483647"?this.m_currentTokenType=8:this.m_currentTokenType=9}else if(n<19)this.m_currentTokenType=9;else if(19===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="9223372036854775808"?this.m_currentTokenType=9:this.m_currentTokenType=7:n.slice(t)<="9223372036854775807"?this.m_currentTokenType=9:this.m_currentTokenType=7}else this.m_currentTokenType=7}}valueNull_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"null"!==e&&t("invalid token"),this.m_currentTokenType=10}valueTrue_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"true"!==e&&t("invalid token"),this.m_currentTokenType=11}valueFalse_(){const{s:e,bDone:n}=this.m_get(6);n&&t("invalid token"),"false"!==e&&t("invalid token"),this.m_currentTokenType=12}valueNan_(){const{s:e,bDone:n}=this.m_get(4);n&&t("invalid token"),"NaN"!==e&&t("invalid token"),this.m_currentTokenType=7}value_(){this.m_startToken=this.m_endToken;const e=this.m_peekChar();e===we.s_beginObject?this.valueStartObject_():e===we.s_beginArray?this.valueStartArray_():e===we.s_doubleQuote?this.valueString_():e===we.s_minus||e>=we.s_zero&&e<=we.s_zero+9?this.valueNumber_():e===we.s_n?this.valueNull_():e===we.s_t?this.valueTrue_():e===we.s_f?this.valueFalse_():e===we.s_N?this.valueNan_():t("invalid token")}start_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.m_functionStack.push((()=>this.accept_()));const e=this.m_peekChar();e!==we.s_beginObject&&e!==we.s_beginArray&&t("invalid token"),this.value_()}accept_(){this.m_startToken=this.m_endToken,this.m_currentTokenType=0}}class De{getOperatorType(){return 10404}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,n,r,i,s,a,o){let u;"string"==typeof r?(u=new Ce({jsonString:r}),u.nextToken()):u=r,1!==u.currentToken()&&t("failed to import map geometry: start of object is expected");const m=W(n,e,u,i,s);return new T(m)}importProjectionTransformation(e,t){return n(0),{}}importDatumTransformation(e,t){return n(0),{}}static stringToGeometryType(e){return s.enumPoint}}const Fe=new Y,je=new be,ze=new De;function Oe(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function Ie(e,t){const n=new L(e,{strict:!1});return n.nextToken(),ze.execute(0,s.enumUnknown,n,!0,t)}function Ee(e){let t=null;return[e.map((e=>{if(null==t){const n=Be(e);return t=n.getSpatialReference(),n.getGeometry()}return Pe(e)})),t]}function Be(e){return Ie(e,!0)}function Pe(e){return Ie(e,!1).getGeometry()}function Ve(e,t){return e instanceof T&&(t=e.getSpatialReference(),e=e.getGeometry()),e?.isEmpty()?null:(Fe.reset(),je.execute(0,e,t,Fe),Fe.getObject())}export{Ee as fromGeometries,Be as fromGeometry,Pe as fromGeometryToGXGeometry,Oe as getSpatialReference,Ve as toGeometry};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import"../../core/arrayUtils.js";import"./gx/operatorSymmetricDifference.js";import"./support/apiConverter.js";export{e as execute,a as executeMany,b as supportsCurves}from"../../chunks/symmetricDifferenceOperator.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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import"../../chunks/OperatorTouches.js";import"./support/apiConverter.js";export{a as accelerateGeometry,e as execute,s as supportsCurves}from"../../chunks/touchesOperator.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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import"./gx/operatorUnion.js";import"./support/apiConverter.js";export{e as execute,a as executeMany,s as supportsCurves}from"../../chunks/unionOperator.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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import"../../chunks/OperatorWithin.js";import"./support/apiConverter.js";export{a as accelerateGeometry,e as execute,s as supportsCurves}from"../../chunks/withinOperator.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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const n=[0,0];function t(n,t){return null!=t&&
|
|
5
|
+
const n=[0,0];function t(n,t){return null!=t&&o(n,t.x,t.y,t.z)}function r(n,t){if(!t.points?.length)return!1;for(const r of t.points)if(!i(n,r))return!1;return!0}function u(n,t){const{xmin:r,ymin:u,zmin:i,xmax:e,ymax:f,zmax:c}=t;return n.hasZ&&t.hasZ?o(n,r,u,i)&&o(n,r,f,i)&&o(n,e,f,i)&&o(n,e,u,i)&&o(n,r,u,c)&&o(n,r,f,c)&&o(n,e,f,c)&&o(n,e,u,c):o(n,r,u)&&o(n,r,f)&&o(n,e,f)&&o(n,e,u)}function i(n,t){return o(n,t[0],t[1])}function e(n,t){return o(n,t[0],t[1],t[2])}function o(n,t,r,u){return t>=n.xmin&&t<=n.xmax&&r>=n.ymin&&r<=n.ymax&&(null==u||!n.hasZ||u>=n.zmin&&u<=n.zmax)}function f(t,r){return n[1]=r.y,n[0]=r.x,c(t,n)}function c(n,t){return x(n.rings,t)}function x(n,t){if(!n)return!1;if(m(n))return s(!1,n,t);let r=!1;for(let u=0,i=n.length;u<i;u++)r=s(r,n[u],t);return r}function m(n){return!Array.isArray(n[0][0])}function s(n,t,r){const[u,i]=r;let e=n,o=0;for(let f=0,c=t.length;f<c;f++){o++,o===c&&(o=0);const[n,r]=t[f],[x,m]=t[o];(r<i&&m>=i||m<i&&r>=i)&&n+(i-r)/(m-r)*(x-n)<u&&(e=!e)}return e}export{i as extentContainsCoords2D,e as extentContainsCoords3D,u as extentContainsExtent,r as extentContainsMultipoint,t as extentContainsPoint,o as extentContainsXYZ,c as polygonContainsCoords,f as polygonContainsPoint,x as ringsContainsCoords};
|